mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-15 05:23:43 +01:00
Merge pull request #4718 from Walle123/mc1.18/dev
add brass tunnel speed setting
This commit is contained in:
commit
bd24fead0f
2 changed files with 13 additions and 10 deletions
|
@ -11,6 +11,8 @@ import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.simibubi.create.foundation.config.AllConfigs;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
|
@ -66,7 +68,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
|
|
||||||
ItemStack stackToDistribute;
|
ItemStack stackToDistribute;
|
||||||
Direction stackEnteredFrom;
|
Direction stackEnteredFrom;
|
||||||
|
|
||||||
float distributionProgress;
|
float distributionProgress;
|
||||||
int distributionDistanceLeft;
|
int distributionDistanceLeft;
|
||||||
int distributionDistanceRight;
|
int distributionDistanceRight;
|
||||||
|
@ -174,7 +176,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (selectionMode.get() != SelectionMode.SYNCHRONIZE || syncedOutputActive) {
|
if (selectionMode.get() != SelectionMode.SYNCHRONIZE || syncedOutputActive) {
|
||||||
distributionProgress = 10;
|
distributionProgress = AllConfigs.SERVER.logistics.brassTunnelTimer.get();
|
||||||
sendData();
|
sendData();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -528,7 +530,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
continue;
|
continue;
|
||||||
if (!tunnelTE.sides.contains(direction))
|
if (!tunnelTE.sides.contains(direction))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BlockPos offset = tunnelTE.worldPosition.below()
|
BlockPos offset = tunnelTE.worldPosition.below()
|
||||||
.relative(direction);
|
.relative(direction);
|
||||||
|
|
||||||
|
@ -579,11 +581,11 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
compound.putBoolean("SyncedOutput", syncedOutputActive);
|
compound.putBoolean("SyncedOutput", syncedOutputActive);
|
||||||
compound.putBoolean("ConnectedLeft", connectedLeft);
|
compound.putBoolean("ConnectedLeft", connectedLeft);
|
||||||
compound.putBoolean("ConnectedRight", connectedRight);
|
compound.putBoolean("ConnectedRight", connectedRight);
|
||||||
|
|
||||||
compound.put("StackToDistribute", stackToDistribute.serializeNBT());
|
compound.put("StackToDistribute", stackToDistribute.serializeNBT());
|
||||||
if (stackEnteredFrom != null)
|
if (stackEnteredFrom != null)
|
||||||
NBTHelper.writeEnum(compound, "StackEnteredFrom", stackEnteredFrom);
|
NBTHelper.writeEnum(compound, "StackEnteredFrom", stackEnteredFrom);
|
||||||
|
|
||||||
compound.putFloat("DistributionProgress", distributionProgress);
|
compound.putFloat("DistributionProgress", distributionProgress);
|
||||||
compound.putInt("PreviousIndex", previousOutputIndex);
|
compound.putInt("PreviousIndex", previousOutputIndex);
|
||||||
compound.putInt("DistanceLeft", distributionDistanceLeft);
|
compound.putInt("DistanceLeft", distributionDistanceLeft);
|
||||||
|
@ -611,7 +613,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
syncedOutputActive = compound.getBoolean("SyncedOutput");
|
syncedOutputActive = compound.getBoolean("SyncedOutput");
|
||||||
connectedLeft = compound.getBoolean("ConnectedLeft");
|
connectedLeft = compound.getBoolean("ConnectedLeft");
|
||||||
connectedRight = compound.getBoolean("ConnectedRight");
|
connectedRight = compound.getBoolean("ConnectedRight");
|
||||||
|
|
||||||
stackToDistribute = ItemStack.of(compound.getCompound("StackToDistribute"));
|
stackToDistribute = ItemStack.of(compound.getCompound("StackToDistribute"));
|
||||||
stackEnteredFrom =
|
stackEnteredFrom =
|
||||||
compound.contains("StackEnteredFrom") ? NBTHelper.readEnum(compound, "StackEnteredFrom", Direction.class)
|
compound.contains("StackEnteredFrom") ? NBTHelper.readEnum(compound, "StackEnteredFrom", Direction.class)
|
||||||
|
@ -719,7 +721,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
super.invalidate();
|
super.invalidate();
|
||||||
tunnelCapability.invalidate();
|
tunnelCapability.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
|
@ -782,7 +784,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
List<ItemStack> allStacks = grabAllStacksOfGroup(true);
|
List<ItemStack> allStacks = grabAllStacksOfGroup(true);
|
||||||
if (allStacks.isEmpty())
|
if (allStacks.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
tooltip.add(componentSpacing.plainCopy()
|
tooltip.add(componentSpacing.plainCopy()
|
||||||
.append(Lang.translateDirect("tooltip.brass_tunnel.contains"))
|
.append(Lang.translateDirect("tooltip.brass_tunnel.contains"))
|
||||||
.withStyle(ChatFormatting.WHITE));
|
.withStyle(ChatFormatting.WHITE));
|
||||||
|
@ -795,7 +797,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity implements IHave
|
||||||
tooltip.add(componentSpacing.plainCopy()
|
tooltip.add(componentSpacing.plainCopy()
|
||||||
.append(Lang.translateDirect("tooltip.brass_tunnel.retrieve"))
|
.append(Lang.translateDirect("tooltip.brass_tunnel.retrieve"))
|
||||||
.withStyle(ChatFormatting.DARK_GRAY));
|
.withStyle(ChatFormatting.DARK_GRAY));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ public class CLogistics extends ConfigBase {
|
||||||
public final ConfigInt linkRange = i(256, 1, "linkRange", Comments.linkRange);
|
public final ConfigInt linkRange = i(256, 1, "linkRange", Comments.linkRange);
|
||||||
public final ConfigInt displayLinkRange = i(64, 1, "displayLinkRange", Comments.displayLinkRange);
|
public final ConfigInt displayLinkRange = i(64, 1, "displayLinkRange", Comments.displayLinkRange);
|
||||||
public final ConfigInt vaultCapacity = i(20, 1, "vaultCapacity", Comments.vaultCapacity);
|
public final ConfigInt vaultCapacity = i(20, 1, "vaultCapacity", Comments.vaultCapacity);
|
||||||
|
public final ConfigInt brassTunnelTimer = i(10,1,10, "brassTunnelTimer",Comments.brassTunnelTimer);
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "logistics";
|
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.";
|
"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 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 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";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue