fix syncID issues, should fix a lot of issues with the inv handing.

This commit is contained in:
modmuss50 2019-07-22 11:54:13 +01:00
parent 50c13bafdc
commit 7f8674f1ca
83 changed files with 209 additions and 211 deletions

View file

@ -64,104 +64,102 @@ public class GuiHandler {
public static void register(){
EGui.stream().forEach(gui -> ContainerProviderRegistry.INSTANCE.registerFactory(gui.getID(), (i, identifier, playerEntity, packetByteBuf) -> {
EGui.stream().forEach(gui -> ContainerProviderRegistry.INSTANCE.registerFactory(gui.getID(), (syncID, identifier, playerEntity, packetByteBuf) -> {
final BlockEntity tile = playerEntity.world.getBlockEntity(packetByteBuf.readBlockPos());
BuiltContainer container = ((IContainerProvider) tile).createContainer(playerEntity);
((ContainerExtensions)container).setSyncID(i);
return container;
return ((IContainerProvider) tile).createContainer(syncID, playerEntity);
}));
EGui.stream().forEach(gui -> ScreenProviderRegistry.INSTANCE.registerFactory(gui.getID(), (i, identifier, playerEntity, packetByteBuf) -> getClientGuiElement(EGui.byID(identifier), playerEntity, packetByteBuf.readBlockPos())));
EGui.stream().forEach(gui -> ScreenProviderRegistry.INSTANCE.registerFactory(gui.getID(), (syncID, identifier, playerEntity, packetByteBuf) -> getClientGuiElement(EGui.byID(identifier), playerEntity, packetByteBuf.readBlockPos(), syncID)));
}
private static AbstractContainerScreen getClientGuiElement(final EGui gui, final PlayerEntity player, BlockPos pos) {
private static AbstractContainerScreen getClientGuiElement(final EGui gui, final PlayerEntity player, BlockPos pos, int syncID) {
final BlockEntity tile = player.world.getBlockEntity(pos);
switch (gui) {
case AESU:
return new GuiAESU(player, (TileAdjustableSU) tile);
return new GuiAESU(syncID, player, (TileAdjustableSU) tile);
case ALLOY_FURNACE:
return new GuiAlloyFurnace(player, (TileIronAlloyFurnace) tile);
return new GuiAlloyFurnace(syncID, player, (TileIronAlloyFurnace) tile);
case ALLOY_SMELTER:
return new GuiAlloySmelter(player, (TileAlloySmelter) tile);
return new GuiAlloySmelter(syncID, player, (TileAlloySmelter) tile);
case ASSEMBLING_MACHINE:
return new GuiAssemblingMachine(player, (TileAssemblingMachine) tile);
return new GuiAssemblingMachine(syncID, player, (TileAssemblingMachine) tile);
case LOW_VOLTAGE_SU:
return new GuiBatbox(player, (TileLowVoltageSU) tile);
return new GuiBatbox(syncID, player, (TileLowVoltageSU) tile);
case BLAST_FURNACE:
return new GuiBlastFurnace(player, (TileIndustrialBlastFurnace) tile);
return new GuiBlastFurnace(syncID, player, (TileIndustrialBlastFurnace) tile);
case CENTRIFUGE:
return new GuiCentrifuge(player, (TileIndustrialCentrifuge) tile);
return new GuiCentrifuge(syncID, player, (TileIndustrialCentrifuge) tile);
case CHARGEBENCH:
return new GuiChargeBench(player, (TileChargeOMat) tile);
return new GuiChargeBench(syncID, player, (TileChargeOMat) tile);
case CHEMICAL_REACTOR:
return new GuiChemicalReactor(player, (TileChemicalReactor) tile);
return new GuiChemicalReactor(syncID, player, (TileChemicalReactor) tile);
case CHUNK_LOADER:
return new GuiChunkLoader(player, (TileChunkLoader) tile);
return new GuiChunkLoader(syncID, player, (TileChunkLoader) tile);
case COMPRESSOR:
return new GuiCompressor(player, (TileCompressor) tile);
return new GuiCompressor(syncID, player, (TileCompressor) tile);
case DESTRUCTOPACK:
return new GuiDestructoPack(new ContainerDestructoPack(player));
case DIESEL_GENERATOR:
return new GuiDieselGenerator(player, (TileDieselGenerator) tile);
return new GuiDieselGenerator(syncID, player, (TileDieselGenerator) tile);
case DIGITAL_CHEST:
return new GuiDigitalChest(player, (TileDigitalChest) tile);
return new GuiDigitalChest(syncID, player, (TileDigitalChest) tile);
case ELECTRIC_FURNACE:
return new GuiElectricFurnace(player, (TileElectricFurnace) tile);
return new GuiElectricFurnace(syncID, player, (TileElectricFurnace) tile);
case EXTRACTOR:
return new GuiExtractor(player, (TileExtractor) tile);
return new GuiExtractor(syncID, player, (TileExtractor) tile);
case FUSION_CONTROLLER:
return new GuiFusionReactor(player, (TileFusionControlComputer) tile);
return new GuiFusionReactor(syncID, player, (TileFusionControlComputer) tile);
case GAS_TURBINE:
return new GuiGasTurbine(player, (TileGasTurbine) tile);
return new GuiGasTurbine(syncID, player, (TileGasTurbine) tile);
case GENERATOR:
return new GuiGenerator(player, (TileSolidFuelGenerator) tile);
return new GuiGenerator(syncID, player, (TileSolidFuelGenerator) tile);
case GRINDER:
return new GuiGrinder(player, (TileGrinder) tile);
return new GuiGrinder(syncID, player, (TileGrinder) tile);
case IDSU:
return new GuiIDSU(player, (TileInterdimensionalSU) tile);
return new GuiIDSU(syncID, player, (TileInterdimensionalSU) tile);
case IMPLOSION_COMPRESSOR:
return new GuiImplosionCompressor(player, (TileImplosionCompressor) tile);
return new GuiImplosionCompressor(syncID, player, (TileImplosionCompressor) tile);
case INDUSTRIAL_ELECTROLYZER:
return new GuiIndustrialElectrolyzer(player, (TileIndustrialElectrolyzer) tile);
return new GuiIndustrialElectrolyzer(syncID, player, (TileIndustrialElectrolyzer) tile);
case INDUSTRIAL_GRINDER:
return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) tile);
return new GuiIndustrialGrinder(syncID, player, (TileIndustrialGrinder) tile);
case IRON_FURNACE:
return new GuiIronFurnace(player, (TileIronFurnace) tile);
return new GuiIronFurnace(syncID, player, (TileIronFurnace) tile);
case LESU:
return new GuiLESU(player, (TileLapotronicSU) tile);
return new GuiLESU(syncID, player, (TileLapotronicSU) tile);
case MATTER_FABRICATOR:
return new GuiMatterFabricator(player, (TileMatterFabricator) tile);
return new GuiMatterFabricator(syncID, player, (TileMatterFabricator) tile);
case MEDIUM_VOLTAGE_SU:
return new GuiMFE(player, (TileMediumVoltageSU) tile);
return new GuiMFE(syncID, player, (TileMediumVoltageSU) tile);
case HIGH_VOLTAGE_SU:
return new GuiMFSU(player, (TileHighVoltageSU) tile);
return new GuiMFSU(syncID, player, (TileHighVoltageSU) tile);
case QUANTUM_CHEST:
return new GuiQuantumChest(player, (TileQuantumChest) tile);
return new GuiQuantumChest(syncID, player, (TileQuantumChest) tile);
case QUANTUM_TANK:
return new GuiQuantumTank(player, (TileQuantumTank) tile);
return new GuiQuantumTank(syncID, player, (TileQuantumTank) tile);
case RECYCLER:
return new GuiRecycler(player, (TileRecycler) tile);
return new GuiRecycler(syncID, player, (TileRecycler) tile);
case ROLLING_MACHINE:
return new GuiRollingMachine(player, (TileRollingMachine) tile);
return new GuiRollingMachine(syncID, player, (TileRollingMachine) tile);
case SAWMILL:
return new GuiIndustrialSawmill(player, (TileIndustrialSawmill) tile);
return new GuiIndustrialSawmill(syncID, player, (TileIndustrialSawmill) tile);
case SCRAPBOXINATOR:
return new GuiScrapboxinator(player, (TileScrapboxinator) tile);
return new GuiScrapboxinator(syncID, player, (TileScrapboxinator) tile);
case SEMIFLUID_GENERATOR:
return new GuiSemifluidGenerator(player, (TileSemiFluidGenerator) tile);
return new GuiSemifluidGenerator(syncID, player, (TileSemiFluidGenerator) tile);
case THERMAL_GENERATOR:
return new GuiThermalGenerator(player, (TileThermalGenerator) tile);
return new GuiThermalGenerator(syncID, player, (TileThermalGenerator) tile);
case VACUUM_FREEZER:
return new GuiVacuumFreezer(player, (TileVacuumFreezer) tile);
return new GuiVacuumFreezer(syncID, player, (TileVacuumFreezer) tile);
case AUTO_CRAFTING_TABLE:
return new GuiAutoCrafting(player, (TileAutoCraftingTable) tile);
return new GuiAutoCrafting(syncID, player, (TileAutoCraftingTable) tile);
case PLASMA_GENERATOR:
return new GuiPlasmaGenerator(player, (TilePlasmaGenerator) tile);
return new GuiPlasmaGenerator(syncID, player, (TilePlasmaGenerator) tile);
case DISTILLATION_TOWER:
return new GuiDistillationTower(player, (TileDistillationTower) tile);
return new GuiDistillationTower(syncID, player, (TileDistillationTower) tile);
case FLUID_REPLICATOR:
return new GuiFluidReplicator(player, (TileFluidReplicator) tile);
return new GuiFluidReplicator(syncID, player, (TileFluidReplicator) tile);
default:
break;

View file

@ -38,8 +38,8 @@ public class GuiAESU extends GuiBase {
TileAdjustableSU tile;
public GuiAESU(final PlayerEntity player, final TileAdjustableSU aesu) {
super(player, aesu, aesu.createContainer(player));
public GuiAESU(int syncID, final PlayerEntity player, final TileAdjustableSU aesu) {
super(player, aesu, aesu.createContainer(syncID, player));
this.tile = aesu;
}

View file

@ -40,8 +40,8 @@ public class GuiAlloyFurnace extends AbstractContainerScreen<BuiltContainer> {
TileIronAlloyFurnace alloyfurnace;
public GuiAlloyFurnace(final PlayerEntity player, final TileIronAlloyFurnace alloyFurnace) {
super(alloyFurnace.createContainer(player), player.inventory, new LiteralText("techreborn.alloy_furnace"));
public GuiAlloyFurnace(int syncID, final PlayerEntity player, final TileIronAlloyFurnace alloyFurnace) {
super(alloyFurnace.createContainer(syncID, player), player.inventory, new LiteralText("techreborn.alloy_furnace"));
this.containerWidth = 176;
this.containerHeight = 167;
this.alloyfurnace = alloyFurnace;

View file

@ -33,8 +33,8 @@ public class GuiAlloySmelter extends GuiBase {
TileAlloySmelter tile;
public GuiAlloySmelter(final PlayerEntity player, final TileAlloySmelter tile) {
super(player, tile, tile.createContainer(player));
public GuiAlloySmelter(int syncID, final PlayerEntity player, final TileAlloySmelter tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiAssemblingMachine extends GuiBase {
TileAssemblingMachine tile;
public GuiAssemblingMachine(final PlayerEntity player, final TileAssemblingMachine tile) {
super(player, tile, tile.createContainer(player));
public GuiAssemblingMachine(int syncID, final PlayerEntity player, final TileAssemblingMachine tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -44,8 +44,8 @@ public class GuiAutoCrafting extends GuiBase {
boolean showGui = true;
TileAutoCraftingTable tileAutoCraftingTable;
public GuiAutoCrafting(PlayerEntity player, TileAutoCraftingTable tile) {
super(player, tile, tile.createContainer(player));
public GuiAutoCrafting(int syncID, PlayerEntity player, TileAutoCraftingTable tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tileAutoCraftingTable = tile;
}

View file

@ -34,8 +34,8 @@ public class GuiBatbox extends GuiBase {
TileLowVoltageSU tile;
public GuiBatbox(final PlayerEntity player, final TileLowVoltageSU tile) {
super(player, tile, tile.createContainer(player));
public GuiBatbox(int syncID, final PlayerEntity player, final TileLowVoltageSU tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -44,8 +44,8 @@ public class GuiBlastFurnace extends GuiBase {
public TileIndustrialBlastFurnace tile;
boolean hasMultiBlock;
public GuiBlastFurnace(final PlayerEntity player, final TileIndustrialBlastFurnace tile) {
super(player, tile, tile.createContainer(player));
public GuiBlastFurnace(int syncID, final PlayerEntity player, final TileIndustrialBlastFurnace tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiCentrifuge extends GuiBase {
TileIndustrialCentrifuge tile;
public GuiCentrifuge(final PlayerEntity player, final TileIndustrialCentrifuge tile) {
super(player, tile, tile.createContainer(player));
public GuiCentrifuge(int syncID, final PlayerEntity player, final TileIndustrialCentrifuge tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -32,8 +32,8 @@ public class GuiChargeBench extends GuiBase {
TileChargeOMat tile;
public GuiChargeBench(final PlayerEntity player, final TileChargeOMat tile) {
super(player, tile, tile.createContainer(player));
public GuiChargeBench(int syncID, final PlayerEntity player, final TileChargeOMat tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiChemicalReactor extends GuiBase {
TileChemicalReactor tile;
public GuiChemicalReactor(final PlayerEntity player, final TileChemicalReactor tile) {
super(player, tile, tile.createContainer(player));
public GuiChemicalReactor(int syncID, final PlayerEntity player, final TileChemicalReactor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -44,8 +44,8 @@ public class GuiChunkLoader extends AbstractContainerScreen {
private ButtonWidget minusOneButton;
private ButtonWidget minusTenButton;
public GuiChunkLoader(final PlayerEntity player, final TileChunkLoader chunkLoader) {
super(chunkLoader.createContainer(player), player.inventory, new LiteralText("techreborn.chunkloader"));
public GuiChunkLoader(int syncID, final PlayerEntity player, final TileChunkLoader chunkLoader) {
super(chunkLoader.createContainer(syncID, player), player.inventory, new LiteralText("techreborn.chunkloader"));
this.containerWidth = 176;
this.containerHeight = 167;
this.chunkloader = chunkLoader;

View file

@ -33,8 +33,8 @@ public class GuiCompressor extends GuiBase {
TileCompressor tile;
public GuiCompressor(final PlayerEntity player, final TileCompressor tile) {
super(player, tile, tile.createContainer(player));
public GuiCompressor(int syncID, final PlayerEntity player, final TileCompressor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -36,8 +36,8 @@ public class GuiDieselGenerator extends GuiBase {
TileDieselGenerator tile;
public GuiDieselGenerator(final PlayerEntity player, final TileDieselGenerator tile) {
super(player, tile, tile.createContainer(player));
public GuiDieselGenerator(int syncID, final PlayerEntity player, final TileDieselGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -32,8 +32,8 @@ public class GuiDigitalChest extends GuiBase {
TileDigitalChest tile;
public GuiDigitalChest(final PlayerEntity player, final TileDigitalChest tile) {
super(player, tile, tile.createContainer(player));
public GuiDigitalChest(int syncID, final PlayerEntity player, final TileDigitalChest tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -43,8 +43,8 @@ public class GuiDistillationTower extends GuiBase {
public TileDistillationTower tile;
public GuiDistillationTower(final PlayerEntity player, final TileDistillationTower tile) {
super(player, tile, tile.createContainer(player));
public GuiDistillationTower(int syncID, final PlayerEntity player, final TileDistillationTower tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiElectricFurnace extends GuiBase {
TileElectricFurnace tile;
public GuiElectricFurnace(final PlayerEntity player, final TileElectricFurnace tile) {
super(player, tile, tile.createContainer(player));
public GuiElectricFurnace(int syncID, final PlayerEntity player, final TileElectricFurnace tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiExtractor extends GuiBase {
TileExtractor tile;
public GuiExtractor(final PlayerEntity player, final TileExtractor tile) {
super(player, tile, tile.createContainer(player));
public GuiExtractor(int syncID, final PlayerEntity player, final TileExtractor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -46,8 +46,8 @@ public class GuiFluidReplicator extends GuiBase {
TileFluidReplicator tile;
public GuiFluidReplicator(final PlayerEntity player, final TileFluidReplicator tile) {
super(player, tile, tile.createContainer(player));
public GuiFluidReplicator(int syncID, final PlayerEntity player, final TileFluidReplicator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -51,8 +51,8 @@ import java.util.Optional;
public class GuiFusionReactor extends GuiBase {
TileFusionControlComputer tile;
public GuiFusionReactor(final PlayerEntity player, final TileFusionControlComputer tile) {
super(player, tile, tile.createContainer(player));
public GuiFusionReactor(int syncID, final PlayerEntity player, final TileFusionControlComputer tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiGasTurbine extends GuiBase {
TileGasTurbine tile;
public GuiGasTurbine(final PlayerEntity player, final TileGasTurbine tile) {
super(player, tile, tile.createContainer(player));
public GuiGasTurbine(int syncID, final PlayerEntity player, final TileGasTurbine tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -32,8 +32,8 @@ public class GuiGenerator extends GuiBase {
TileSolidFuelGenerator tile;
public GuiGenerator(final PlayerEntity player, final TileSolidFuelGenerator tile) {
super(player, tile, tile.createContainer(player));
public GuiGenerator(int syncID, final PlayerEntity player, final TileSolidFuelGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiGrinder extends GuiBase {
TileGrinder tile;
public GuiGrinder(final PlayerEntity player, final TileGrinder tile) {
super(player, tile, tile.createContainer(player));
public GuiGrinder(int syncID, final PlayerEntity player, final TileGrinder tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -34,8 +34,8 @@ public class GuiIDSU extends GuiBase {
TileInterdimensionalSU idsu;
public GuiIDSU(PlayerEntity player, TileInterdimensionalSU tileIDSU) {
super(player, tileIDSU, tileIDSU.createContainer(player));
public GuiIDSU(int syncID, PlayerEntity player, TileInterdimensionalSU tileIDSU) {
super(player, tileIDSU, tileIDSU.createContainer(syncID, player));
idsu = tileIDSU;
}

View file

@ -42,8 +42,8 @@ public class GuiImplosionCompressor extends GuiBase {
TileImplosionCompressor tile;
public GuiImplosionCompressor(final PlayerEntity player, final TileImplosionCompressor tile) {
super(player, tile, tile.createContainer(player));
public GuiImplosionCompressor(int syncID, final PlayerEntity player, final TileImplosionCompressor tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiIndustrialElectrolyzer extends GuiBase {
TileIndustrialElectrolyzer tile;
public GuiIndustrialElectrolyzer(final PlayerEntity player, final TileIndustrialElectrolyzer tile) {
super(player, tile, tile.createContainer(player));
public GuiIndustrialElectrolyzer(int syncID, final PlayerEntity player, final TileIndustrialElectrolyzer tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -43,8 +43,8 @@ public class GuiIndustrialGrinder extends GuiBase {
TileIndustrialGrinder tile;
public GuiIndustrialGrinder(final PlayerEntity player, final TileIndustrialGrinder tile) {
super(player, tile, tile.createContainer(player));
public GuiIndustrialGrinder(int syncID, final PlayerEntity player, final TileIndustrialGrinder tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -43,8 +43,8 @@ public class GuiIndustrialSawmill extends GuiBase {
TileIndustrialSawmill tile;
public GuiIndustrialSawmill(final PlayerEntity player, final TileIndustrialSawmill tile) {
super(player, tile, tile.createContainer(player));
public GuiIndustrialSawmill(int syncID, final PlayerEntity player, final TileIndustrialSawmill tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -40,8 +40,8 @@ public class GuiIronFurnace extends GuiBase {
TileIronFurnace furnace;
public GuiIronFurnace(final PlayerEntity player, final TileIronFurnace furnace) {
super(player, furnace, furnace.createContainer(player));
public GuiIronFurnace(int syncID, final PlayerEntity player, final TileIronFurnace furnace) {
super(player, furnace, furnace.createContainer(syncID, player));
this.containerWidth = 176;
this.containerHeight = 167;
this.furnace = furnace;

View file

@ -34,8 +34,8 @@ public class GuiLESU extends GuiBase {
TileLapotronicSU tile;
public GuiLESU(final PlayerEntity player, final TileLapotronicSU tile) {
super(player, tile, tile.createContainer(player));
public GuiLESU(int syncID, final PlayerEntity player, final TileLapotronicSU tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -34,8 +34,8 @@ public class GuiMFE extends GuiBase {
TileMediumVoltageSU mfe;
public GuiMFE(final PlayerEntity player, final TileMediumVoltageSU mfe) {
super(player, mfe, mfe.createContainer(player));
public GuiMFE(int syncID, final PlayerEntity player, final TileMediumVoltageSU mfe) {
super(player, mfe, mfe.createContainer(syncID, player));
this.mfe = mfe;
}

View file

@ -34,8 +34,8 @@ public class GuiMFSU extends GuiBase {
TileHighVoltageSU mfsu;
public GuiMFSU(final PlayerEntity player, final TileHighVoltageSU mfsu) {
super(player, mfsu, mfsu.createContainer(player));
public GuiMFSU(int syncID, final PlayerEntity player, final TileHighVoltageSU mfsu) {
super(player, mfsu, mfsu.createContainer(syncID, player));
this.mfsu = mfsu;
}

View file

@ -33,8 +33,8 @@ public class GuiMatterFabricator extends GuiBase {
TileMatterFabricator tile;
public GuiMatterFabricator(final PlayerEntity player, final TileMatterFabricator tile) {
super(player, tile, tile.createContainer(player));
public GuiMatterFabricator(int syncID, final PlayerEntity player, final TileMatterFabricator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -45,8 +45,8 @@ public class GuiPlasmaGenerator extends GuiBase {
*/
TilePlasmaGenerator tile;
public GuiPlasmaGenerator(final PlayerEntity player, final TilePlasmaGenerator tile) {
super(player, tile, tile.createContainer(player));
public GuiPlasmaGenerator(int syncID, final PlayerEntity player, final TilePlasmaGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -32,8 +32,8 @@ public class GuiQuantumChest extends GuiBase {
TileQuantumChest quantumChest;
public GuiQuantumChest(final PlayerEntity player, final TileQuantumChest quantumChest) {
super(player, quantumChest, quantumChest.createContainer(player));
public GuiQuantumChest(int syncID, final PlayerEntity player, final TileQuantumChest quantumChest) {
super(player, quantumChest, quantumChest.createContainer(syncID, player));
this.quantumChest = quantumChest;
}

View file

@ -33,8 +33,8 @@ public class GuiQuantumTank extends GuiBase {
TileQuantumTank quantumTank;
public GuiQuantumTank(final PlayerEntity player, final TileQuantumTank quantumTank) {
super(player, quantumTank, quantumTank.createContainer(player));
public GuiQuantumTank(int syncID, final PlayerEntity player, final TileQuantumTank quantumTank) {
super(player, quantumTank, quantumTank.createContainer(syncID, player));
this.quantumTank = quantumTank;
}

View file

@ -33,8 +33,8 @@ public class GuiRecycler extends GuiBase {
TileRecycler tile;
public GuiRecycler(final PlayerEntity player, final TileRecycler tile) {
super(player, tile, tile.createContainer(player));
public GuiRecycler(int syncID, final PlayerEntity player, final TileRecycler tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -35,8 +35,8 @@ public class GuiRollingMachine extends GuiBase {
TileRollingMachine rollingMachine;
public GuiRollingMachine(final PlayerEntity player, final TileRollingMachine tileRollingmachine) {
super(player, tileRollingmachine, tileRollingmachine.createContainer(player));
public GuiRollingMachine(int syncID, final PlayerEntity player, final TileRollingMachine tileRollingmachine) {
super(player, tileRollingmachine, tileRollingmachine.createContainer(syncID, player));
this.rollingMachine = tileRollingmachine;
}

View file

@ -33,8 +33,8 @@ public class GuiScrapboxinator extends GuiBase {
TileScrapboxinator tile;
public GuiScrapboxinator(final PlayerEntity player, final TileScrapboxinator tile) {
super(player, tile, tile.createContainer(player));
public GuiScrapboxinator(int syncID, final PlayerEntity player, final TileScrapboxinator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiSemifluidGenerator extends GuiBase {
TileSemiFluidGenerator tile;
public GuiSemifluidGenerator(final PlayerEntity player, final TileSemiFluidGenerator tile) {
super(player, tile, tile.createContainer(player));
public GuiSemifluidGenerator(int syncID, final PlayerEntity player, final TileSemiFluidGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -33,8 +33,8 @@ public class GuiThermalGenerator extends GuiBase {
TileThermalGenerator tile;
public GuiThermalGenerator(final PlayerEntity player, final TileThermalGenerator tile) {
super(player, tile, tile.createContainer(player));
public GuiThermalGenerator(int syncID, final PlayerEntity player, final TileThermalGenerator tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -41,8 +41,8 @@ public class GuiVacuumFreezer extends GuiBase {
TileVacuumFreezer tile;
public GuiVacuumFreezer(final PlayerEntity player, final TileVacuumFreezer tile) {
super(player, tile, tile.createContainer(player));
public GuiVacuumFreezer(int syncID, final PlayerEntity player, final TileVacuumFreezer tile) {
super(player, tile, tile.createContainer(syncID, player));
this.tile = tile;
}

View file

@ -120,9 +120,9 @@ public class TileChargeOMat extends TilePowerAcceptor
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("chargebench").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).energySlot(0, 62, 25).energySlot(1, 98, 25).energySlot(2, 62, 45).energySlot(3, 98, 45)
.energySlot(4, 62, 65).energySlot(5, 98, 65).syncEnergyValue().addInventory().create(this);
.energySlot(4, 62, 65).energySlot(5, 98, 65).syncEnergyValue().addInventory().create(this, syncID);
}
}

View file

@ -44,8 +44,8 @@ public class TileDigitalChest extends TileTechStorageBase implements IContainerP
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("digitalchest").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this);
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this, syncID);
}
}

View file

@ -62,14 +62,14 @@ public class TileIndustrialCentrifuge extends TileGenericMachine implements ICon
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("centrifuge").player(player.inventory).inventory().hotbar()
.addInventory().tile(this)
.filterSlot(1, 40, 54, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
.filterSlot(0, 40, 34, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
.outputSlot(2, 82, 44).outputSlot(3, 101, 25)
.outputSlot(4, 120, 44).outputSlot(5, 101, 63).energySlot(6, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create(this);
.syncCrafterValue().addInventory().create(this, syncID);
}
// IListInfoProvider

View file

@ -379,7 +379,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("fusionreactor").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 34, 47).slot(1, 126, 47).outputSlot(2, 80, 47).syncEnergyValue()
.syncIntegerValue(this::getCoilStatus, this::setCoilStatus)
@ -387,7 +387,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
.syncIntegerValue(this::getFinalTickTime, this::setFinalTickTime)
.syncIntegerValue(this::getSize, this::setSize)
.syncIntegerValue(this::getState, this::setState)
.syncIntegerValue(this::getNeededPower, this::setNeededPower).addInventory().create(this);
.syncIntegerValue(this::getNeededPower, this::setNeededPower).addInventory().create(this, syncID);
}
public int getCoilStatus() {

View file

@ -68,12 +68,12 @@ public class TilePlasmaGenerator extends TileBaseFluidGenerator implements ICont
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("plasmagenerator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -69,11 +69,11 @@ public class TileDieselGenerator extends TileBaseFluidGenerator implements ICont
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("dieselgenerator").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -69,11 +69,11 @@ public class TileGasTurbine extends TileBaseFluidGenerator implements IContainer
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("gasturbine").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -69,11 +69,11 @@ public class TileSemiFluidGenerator extends TileBaseFluidGenerator implements IC
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("semifluidgenerator").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -69,11 +69,11 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("thermalgenerator").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 25, 35).outputSlot(1, 25, 55).syncEnergyValue()
.syncIntegerValue(this::getTicksSinceLastChange, this::setTicksSinceLastChange)
.syncIntegerValue(this::getTankAmount, this::setTankAmount)
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -177,11 +177,11 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("generator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).fuelSlot(0, 80, 54).energySlot(1, 8, 72).syncEnergyValue()
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this);
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this, syncID);
}
@Override

View file

@ -272,7 +272,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(this)
.filterSlot(0, 47, 17,
@ -281,7 +281,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getRebornIngredients().get(1).test(stack)))
.outputSlot(2, 116, 35).fuelSlot(3, 56, 53).syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getCookTime, this::setCookTime)
.syncIntegerValue(this::getCurrentItemBurnTime, this::setCurrentItemBurnTime).addInventory().create(this);
.syncIntegerValue(this::getCurrentItemBurnTime, this::setCurrentItemBurnTime).addInventory().create(this, syncID);
}
@Override

View file

@ -221,11 +221,11 @@ public class TileIronFurnace extends TileMachineBase
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(this).fuelSlot(2, 56, 53).slot(0, 56, 17).outputSlot(1, 116, 35)
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
.syncIntegerValue(this::getProgress, this::setProgress)
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this);
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this, syncID);
}
}

View file

@ -88,10 +88,10 @@ public class TileDistillationTower extends TileGenericMachine implements IContai
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("Distillationtower").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 35, 27).slot(1, 35, 47).outputSlot(2, 79, 37).outputSlot(3, 99, 37)
.outputSlot(4, 119, 37).outputSlot(5, 139, 37).energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue()
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -141,10 +141,10 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
// IContainerProvider
@Override
public BuiltContainer createContainer(PlayerEntity player) {
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("fluidreplicator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).fluidSlot(1, 124, 35).filterSlot(0, 55, 45, stack -> stack.isItemEqualIgnoreDamage(TRContent.Parts.UU_MATTER.getStack()))
.outputSlot(2, 124, 55).energySlot(3, 8, 72).syncEnergyValue().syncCrafterValue().addInventory()
.create(this);
.create(this, syncID);
}
}

View file

@ -81,9 +81,9 @@ public class TileImplosionCompressor extends TileGenericMachine implements ICont
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("implosioncompressor").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 92, 36).outputSlot(3, 110, 36)
.energySlot(4, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this);
.energySlot(4, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -140,11 +140,11 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("blastfurnace").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 50, 27).slot(1, 50, 47).outputSlot(2, 93, 37).outputSlot(3, 113, 37)
.energySlot(4, 8, 72).syncEnergyValue().syncCrafterValue()
.syncIntegerValue(this::getHeat, this::setHeat).addInventory().create(this);
.syncIntegerValue(this::getHeat, this::setHeat).addInventory().create(this, syncID);
}
}

View file

@ -142,12 +142,12 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
// fluidSlot first to support automation and shift-click
return new ContainerBuilder("industrialgrinder").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).fluidSlot(1, 34, 35).slot(0, 84, 43).outputSlot(2, 126, 18).outputSlot(3, 126, 36)
.outputSlot(4, 126, 54).outputSlot(5, 126, 72).outputSlot(6, 34, 55).energySlot(7, 8, 72)
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
.syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -144,11 +144,11 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).fluidSlot(1, 34, 35).slot(0, 84, 43).outputSlot(2, 126, 25).outputSlot(3, 126, 43)
.outputSlot(4, 126, 61).outputSlot(5, 34, 55).energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue()
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -84,9 +84,9 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("vacuumfreezer").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create(this);
.syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -56,7 +56,7 @@ public class TileAlloySmelter extends TileGenericMachine implements IContainerPr
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("alloysmelter").player(player.inventory).inventory().hotbar()
.addInventory().tile(this)
.filterSlot(0, 34, 47,
@ -64,6 +64,6 @@ public class TileAlloySmelter extends TileGenericMachine implements IContainerPr
.filterSlot(1, 126, 47,
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getRebornIngredients().get(1).test(stack)))
.outputSlot(2, 80, 47).energySlot(3, 8, 72).syncEnergyValue().syncCrafterValue().addInventory()
.create(this);
.create(this, syncID);
}
}

View file

@ -56,9 +56,9 @@ public class TileAssemblingMachine extends TileGenericMachine implements IContai
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("assemblingmachine").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 55, 35).slot(1, 55, 55).outputSlot(2, 101, 45).energySlot(3, 8, 72)
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
.syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -441,13 +441,13 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
// IContainerProvider
@Override
public BuiltContainer createContainer(PlayerEntity player) {
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("autocraftingtable").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 28, 25).slot(1, 46, 25).slot(2, 64, 25).slot(3, 28, 43).slot(4, 46, 43)
.slot(5, 64, 43).slot(6, 28, 61).slot(7, 46, 61).slot(8, 64, 61).outputSlot(9, 145, 42)
.outputSlot(10, 145, 70).syncEnergyValue().syncIntegerValue(this::getProgress, this::setProgress)
.syncIntegerValue(this::getMaxProgress, this::setMaxProgress)
.syncIntegerValue(this::getLockedInt, this::setLockedInt).addInventory().create(this);
.syncIntegerValue(this::getLockedInt, this::setLockedInt).addInventory().create(this, syncID);
}
@Override

View file

@ -56,9 +56,9 @@ public class TileChemicalReactor extends TileGenericMachine implements IContaine
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("chemicalreactor").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).slot(0, 34, 47).slot(1, 126, 47).outputSlot(2, 80, 47).energySlot(3, 8, 72)
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
.syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -56,9 +56,9 @@ public class TileCompressor extends TileGenericMachine implements IContainerProv
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("compressor").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create(this);
.syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -216,9 +216,9 @@ public class TileElectricFurnace extends TilePowerAcceptor
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("electricfurnace").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create(this);
.syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create(this, syncID);
}
}

View file

@ -56,9 +56,9 @@ public class TileExtractor extends TileGenericMachine implements IContainerProvi
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("extractor").player(player.inventory).inventory().hotbar().addInventory().tile(this)
.slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue().syncCrafterValue()
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -56,9 +56,9 @@ public class TileGrinder extends TileGenericMachine implements IContainerProvide
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("grinder").player(player.inventory).inventory().hotbar().addInventory().tile(this)
.slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue().syncCrafterValue()
.addInventory().create(this);
.addInventory().create(this, syncID);
}
}

View file

@ -58,12 +58,12 @@ public class TileIndustrialElectrolyzer extends TileGenericMachine implements IC
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory().hotbar()
.addInventory().tile(this)
.filterSlot(1, 47, 72, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
.filterSlot(0, 81, 72, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true))
.outputSlot(2, 51, 24).outputSlot(3, 71, 24).outputSlot(4, 91, 24).outputSlot(5, 111, 24)
.energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this);
.energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -202,9 +202,9 @@ public class TileRecycler extends TilePowerAcceptor
// IContainerProvider
@Override
public BuiltContainer createContainer(PlayerEntity player) {
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("recycler").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 55, 45, itemStack -> itemStack.getItem() instanceof IUpgrade).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue()
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this);
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this, syncID);
}
}

View file

@ -375,7 +375,7 @@ public class TileRollingMachine extends TilePowerAcceptor
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("rollingmachine").player(player.inventory)
.inventory().hotbar()
.addInventory().tile(this)
@ -385,7 +385,7 @@ public class TileRollingMachine extends TilePowerAcceptor
.onCraft(inv -> this.inventory.setInvStack(1, RollingMachineRecipe.instance.findMatchingRecipeOutput(getCraftingMatrix(), this.world)))
.outputSlot(9, 124, 40)
.energySlot(10, 8, 70)
.syncEnergyValue().syncIntegerValue(this::getBurnTime, this::setBurnTime).syncIntegerValue(this::getLockedInt, this::setLockedInt).addInventory().create(this);
.syncEnergyValue().syncIntegerValue(this::getBurnTime, this::setBurnTime).syncIntegerValue(this::getLockedInt, this::setLockedInt).addInventory().create(this, syncID);
}
//Easyest way to sync back to the client

View file

@ -61,9 +61,9 @@ public class TileScrapboxinator extends TileGenericMachine implements IContainer
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("scrapboxinator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).filterSlot(0, 55, 45, stack -> stack.getItem() == TRContent.SCRAP_BOX).outputSlot(1, 101, 45)
.energySlot(2, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this);
.energySlot(2, 8, 72).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -99,8 +99,8 @@ public class TileChunkLoader extends TilePowerAcceptor implements IToolDrop, Inv
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("chunkloader").player(player.inventory).inventory(8,84).hotbar(8,142).addInventory()
.create(this);
.create(this, syncID);
}
}

View file

@ -208,11 +208,11 @@ public class TileMatterFabricator extends TilePowerAcceptor
// IContainerProvider
@Override
public BuiltContainer createContainer(PlayerEntity player) {
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("matterfabricator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 30, 20).slot(1, 50, 20).slot(2, 70, 20).slot(3, 90, 20).slot(4, 110, 20)
.slot(5, 130, 20).outputSlot(6, 40, 66).outputSlot(7, 60, 66).outputSlot(8, 80, 66)
.outputSlot(9, 100, 66).outputSlot(10, 120, 66).energySlot(11, 8, 72).syncEnergyValue()
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this);
.syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this, syncID);
}
}

View file

@ -50,9 +50,9 @@ public class TileQuantumChest extends TileTechStorageBase implements IContainerP
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("quantumchest").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this);
.tile(this).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create(this, syncID);
}
}

View file

@ -144,10 +144,10 @@ public class TileQuantumTank extends TileMachineBase
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("quantumtank").player(player.inventory).inventory().hotbar()
.addInventory().tile(this).fluidSlot(0, 80, 17).outputSlot(1, 80, 53).addInventory()
.create(this);
.create(this, syncID);
}
@Nullable

View file

@ -167,10 +167,10 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
// IContainerProvider
@Override
public BuiltContainer createContainer(PlayerEntity player) {
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("aesu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().syncIntegerValue(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this);
.syncEnergyValue().syncIntegerValue(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this, syncID);
}
@Override

View file

@ -46,9 +46,9 @@ public class TileHighVoltageSU extends TileEnergyStorage implements IContainerPr
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("mfsu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create(this);
.syncEnergyValue().addInventory().create(this, syncID);
}
}

View file

@ -42,8 +42,8 @@ public class TileLowVoltageSU extends TileEnergyStorage implements IContainerPro
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("batbox").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create(this);
.tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create(this, syncID);
}
}

View file

@ -46,10 +46,10 @@ public class TileMediumVoltageSU extends TileEnergyStorage implements IContainer
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("mfe").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create(this);
.syncEnergyValue().addInventory().create(this, syncID);
}
}

View file

@ -110,10 +110,10 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("idsu").player(player.inventory).inventory().hotbar().armor()
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().addInventory().create(this);
.syncEnergyValue().addInventory().create(this, syncID);
}
@Override

View file

@ -133,10 +133,10 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
}
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("lesu").player(player.inventory).inventory().hotbar().armor().complete(8, 18)
.addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue()
.syncIntegerValue(this::getOutputRate, this::setOutputRate)
.syncIntegerValue(this::getConnectedBlocksNum, this::setConnectedBlocksNum).addInventory().create(this);
.syncIntegerValue(this::getConnectedBlocksNum, this::setConnectedBlocksNum).addInventory().create(this, syncID);
}
}