From 0347038c9adf7b40d8a1b8418a5ee53a2f1ece06 Mon Sep 17 00:00:00 2001 From: Walle123 Date: Mon, 1 May 2023 11:32:29 +0200 Subject: [PATCH] brass tunnel distribution speed config added --- .../belts/tunnel/BrassTunnelTileEntity.java | 18 +++++++++--------- .../create/foundation/config/CLogistics.java | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java index c45ceff6b..e8b1ba8ed 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java @@ -66,7 +66,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave ItemStack stackToDistribute; Direction stackEnteredFrom; - + float distributionProgress; int distributionDistanceLeft; int distributionDistanceRight; @@ -174,7 +174,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave return; if (selectionMode.get() != SelectionMode.SYNCHRONIZE || syncedOutputActive) { - distributionProgress = 10; + distributionProgress = AllConfigs.SERVER.logistics.brassTunnelTimer.get(); sendData(); } return; @@ -528,7 +528,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave continue; if (!tunnelTE.sides.contains(direction)) continue; - + BlockPos offset = tunnelTE.worldPosition.below() .relative(direction); @@ -579,11 +579,11 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave compound.putBoolean("SyncedOutput", syncedOutputActive); compound.putBoolean("ConnectedLeft", connectedLeft); compound.putBoolean("ConnectedRight", connectedRight); - + compound.put("StackToDistribute", stackToDistribute.serializeNBT()); if (stackEnteredFrom != null) NBTHelper.writeEnum(compound, "StackEnteredFrom", stackEnteredFrom); - + compound.putFloat("DistributionProgress", distributionProgress); compound.putInt("PreviousIndex", previousOutputIndex); compound.putInt("DistanceLeft", distributionDistanceLeft); @@ -611,7 +611,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave syncedOutputActive = compound.getBoolean("SyncedOutput"); connectedLeft = compound.getBoolean("ConnectedLeft"); connectedRight = compound.getBoolean("ConnectedRight"); - + stackToDistribute = ItemStack.of(compound.getCompound("StackToDistribute")); stackEnteredFrom = compound.contains("StackEnteredFrom") ? NBTHelper.readEnum(compound, "StackEnteredFrom", Direction.class) @@ -719,7 +719,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave super.invalidate(); tunnelCapability.invalidate(); } - + @Override public void destroy() { super.destroy(); @@ -782,7 +782,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave List allStacks = grabAllStacksOfGroup(true); if (allStacks.isEmpty()) return false; - + tooltip.add(componentSpacing.plainCopy() .append(Lang.translateDirect("tooltip.brass_tunnel.contains")) .withStyle(ChatFormatting.WHITE)); @@ -795,7 +795,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave tooltip.add(componentSpacing.plainCopy() .append(Lang.translateDirect("tooltip.brass_tunnel.retrieve")) .withStyle(ChatFormatting.DARK_GRAY)); - + return true; } diff --git a/src/main/java/com/simibubi/create/foundation/config/CLogistics.java b/src/main/java/com/simibubi/create/foundation/config/CLogistics.java index cde5fe2d3..822f23230 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CLogistics.java +++ b/src/main/java/com/simibubi/create/foundation/config/CLogistics.java @@ -10,7 +10,7 @@ public class CLogistics extends ConfigBase { public final ConfigInt linkRange = i(256, 1, "linkRange", Comments.linkRange); public final ConfigInt displayLinkRange = i(64, 1, "displayLinkRange", Comments.displayLinkRange); public final ConfigInt vaultCapacity = i(20, 1, "vaultCapacity", Comments.vaultCapacity); - + public final ConfigInt brassTunnelTimer = i(1,10,10, "brassTunnelTimer",Comments.brassTunnelTimer); @Override public String getName() { return "logistics"; @@ -28,6 +28,7 @@ public class CLogistics extends ConfigBase { "The amount of ticks a portable storage interface waits for transfers until letting contraptions move along."; static String mechanicalArmRange = "Maximum distance in blocks a Mechanical Arm can reach across."; static String vaultCapacity = "The total amount of stacks a vault can hold per block in size."; + static String brassTunnelTimer = "The amount of ticks a brass tunnel waits between distributions"; } }