From 85d64010bd062706c595ce2a57e49cede42824b5 Mon Sep 17 00:00:00 2001 From: Stephen Barnes Date: Sat, 18 Sep 2021 16:14:40 -0500 Subject: [PATCH] Config option to make mounted storage output-only --- .../components/structureMovement/MovementBehaviour.java | 7 ++++++- .../com/simibubi/create/foundation/config/CKinetics.java | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java index b7b3400eb..08b834108 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java @@ -5,6 +5,7 @@ import javax.annotation.Nullable; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; +import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; import net.minecraft.client.renderer.IRenderTypeBuffer; @@ -33,7 +34,11 @@ public abstract class MovementBehaviour { } public void dropItem(MovementContext context, ItemStack stack) { - ItemStack remainder = ItemHandlerHelper.insertItem(context.contraption.inventory, stack, false); + ItemStack remainder; + if (AllConfigs.SERVER.kinetics.moveItemsToStorage.get()) + remainder = ItemHandlerHelper.insertItem(context.contraption.inventory, stack, false); + else + remainder = stack; if (remainder.isEmpty()) return; 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 3662cba3e..f476c0a3d 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,7 @@ public class CKinetics extends ConfigBase { public ConfigInt maxCartCouplingLength = i(32, 1, "maxCartCouplingLength", Comments.maxCartCouplingLength); public ConfigEnum spawnerMovement = e(SpawnerMovementSetting.NO_PICKUP, "movableSpawners", Comments.spawnerMovement); + public ConfigBool moveItemsToStorage = b(true, "moveItemsToStorage", Comments.moveItemsToStorage); public ConfigBool harvestPartiallyGrown = b(false, "harvestPartiallyGrown", Comments.harvestPartiallyGrown); public ConfigBool harvesterReplants = b(true, "harvesterReplants", Comments.harvesterReplants); @@ -76,6 +77,8 @@ public class CKinetics extends ConfigBase { static String maxPistonPoles = "Maximum amount of extension poles behind a Mechanical Piston."; static String maxRopeLength = "Max length of rope available off a Rope Pulley."; static String maxCartCouplingLength = "Maximum allowed distance of two coupled minecarts."; + static String moveItemsToStorage = + "Whether items mined or harvested by contraptions should be placed in their mounted storage."; static String harvestPartiallyGrown = "Whether harvesters should break crops that aren't fully grown."; static String harvesterReplants = "Whether harvesters should replant crops after harvesting."; static String stats = "Configure speed/capacity levels for requirements and indicators.";