From 411ff6cfee846e60632bcb002bfa75239dc9d8b4 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:39:57 +0200 Subject: [PATCH] Move obsidian movement from tag to config --- .../create/foundation/config/CKinetics.java | 3 +++ .../config/ContraptionMovementSetting.java | 15 ++++++++------- .../data/create/tags/blocks/non_movable.json | 1 - 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java index dba8f3bb0..0875a6a17 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java +++ b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java @@ -38,6 +38,8 @@ public class CKinetics extends ConfigBase { public final ConfigInt maxCartCouplingLength = i(32, 1, "maxCartCouplingLength", Comments.maxCartCouplingLength); public final ConfigEnum spawnerMovement = e(ContraptionMovementSetting.NO_PICKUP, "movableSpawners", Comments.spawnerMovement); + public final ConfigEnum obsidianMovement = + e(ContraptionMovementSetting.UNMOVABLE, "movableObsidian", Comments.obsidianMovement); public final CStress stressValues = nested(1, CStress::new, Comments.stress); @@ -99,6 +101,7 @@ public class CKinetics extends ConfigBase { static String ejectorScanInterval = "Time in ticks until the next item launched by an ejector scans blocks for potential collisions"; static String spawnerMovement = "Configure how Spawner blocks can be moved by contraptions."; + static String obsidianMovement = "Configure how Obsidian blocks can be moved by contraptions."; } public enum DeployerAggroSetting { diff --git a/src/main/java/com/simibubi/create/foundation/config/ContraptionMovementSetting.java b/src/main/java/com/simibubi/create/foundation/config/ContraptionMovementSetting.java index 3a0c2528d..dfe76e50b 100644 --- a/src/main/java/com/simibubi/create/foundation/config/ContraptionMovementSetting.java +++ b/src/main/java/com/simibubi/create/foundation/config/ContraptionMovementSetting.java @@ -1,17 +1,17 @@ package com.simibubi.create.foundation.config; +import java.util.Collection; +import java.util.HashMap; +import java.util.function.Supplier; + +import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.util.ResourceLocation; import net.minecraft.world.gen.feature.template.Template; import net.minecraftforge.common.extensions.IForgeBlock; -import javax.annotation.Nullable; - -import java.util.Collection; -import java.util.HashMap; -import java.util.function.Supplier; - public enum ContraptionMovementSetting { MOVABLE, NO_PICKUP, UNMOVABLE; @@ -22,8 +22,9 @@ public enum ContraptionMovementSetting { } static { - // config isnt registered at this point, so im using lambda instead of a method reference register(Blocks.SPAWNER.getRegistryName(), () -> AllConfigs.SERVER.kinetics.spawnerMovement.get()); + register(Blocks.OBSIDIAN.getRegistryName(), () -> AllConfigs.SERVER.kinetics.obsidianMovement.get()); + register(Blocks.CRYING_OBSIDIAN.getRegistryName(), () -> AllConfigs.SERVER.kinetics.obsidianMovement.get()); } @Nullable diff --git a/src/main/resources/data/create/tags/blocks/non_movable.json b/src/main/resources/data/create/tags/blocks/non_movable.json index 974dda4c5..1ded5b887 100644 --- a/src/main/resources/data/create/tags/blocks/non_movable.json +++ b/src/main/resources/data/create/tags/blocks/non_movable.json @@ -1,7 +1,6 @@ { "replace": false, "values": [ - "minecraft:obsidian" ], "optional": [ "immersiveengineering:connector_lv",