Config option to make mounted storage output-only

This commit is contained in:
Stephen Barnes 2021-09-18 16:14:40 -05:00
parent 576a5922b4
commit 85d64010bd
2 changed files with 9 additions and 1 deletions

View file

@ -5,6 +5,7 @@ import javax.annotation.Nullable;
import com.jozufozu.flywheel.backend.material.MaterialManager; 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.ActorInstance;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; 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 com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld;
import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.IRenderTypeBuffer;
@ -33,7 +34,11 @@ public abstract class MovementBehaviour {
} }
public void dropItem(MovementContext context, ItemStack stack) { 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()) if (remainder.isEmpty())
return; return;

View file

@ -38,6 +38,7 @@ public class CKinetics extends ConfigBase {
public ConfigInt maxCartCouplingLength = i(32, 1, "maxCartCouplingLength", Comments.maxCartCouplingLength); public ConfigInt maxCartCouplingLength = i(32, 1, "maxCartCouplingLength", Comments.maxCartCouplingLength);
public ConfigEnum<SpawnerMovementSetting> spawnerMovement = public ConfigEnum<SpawnerMovementSetting> spawnerMovement =
e(SpawnerMovementSetting.NO_PICKUP, "movableSpawners", Comments.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 harvestPartiallyGrown = b(false, "harvestPartiallyGrown", Comments.harvestPartiallyGrown);
public ConfigBool harvesterReplants = b(true, "harvesterReplants", Comments.harvesterReplants); 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 maxPistonPoles = "Maximum amount of extension poles behind a Mechanical Piston.";
static String maxRopeLength = "Max length of rope available off a Rope Pulley."; static String maxRopeLength = "Max length of rope available off a Rope Pulley.";
static String maxCartCouplingLength = "Maximum allowed distance of two coupled minecarts."; 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 harvestPartiallyGrown = "Whether harvesters should break crops that aren't fully grown.";
static String harvesterReplants = "Whether harvesters should replant crops after harvesting."; static String harvesterReplants = "Whether harvesters should replant crops after harvesting.";
static String stats = "Configure speed/capacity levels for requirements and indicators."; static String stats = "Configure speed/capacity levels for requirements and indicators.";