more misc fluid work, gonna leave most of this untill we have an offical or new api

This commit is contained in:
modmuss50 2019-07-24 19:06:21 +01:00
parent 0742abb840
commit 6a93c3fd46
28 changed files with 147 additions and 404 deletions

View file

@ -92,7 +92,7 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
// Check cells input slot 2 time per second
if (!world.isClient && ticksSinceLastChange >= 10) {
if (!inventory.getInvStack(1).isEmpty()) {
FluidUtils.fillContainers(tank, inventory, 1, 2, tank.getFluidType());
FluidUtils.fillContainers(tank, inventory, 1, 2, tank.getFluid());
}
ticksSinceLastChange = 0;
}
@ -101,7 +101,6 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
super.tick();
}
tank.compareAndUpdate();
}
@Override
@ -144,7 +143,7 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
public BuiltContainer createContainer(int syncID, PlayerEntity player) {
return new ContainerBuilder("fluidreplicator").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(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()
.outputSlot(2, 124, 55).energySlot(3, 8, 72).sync(tank).syncEnergyValue().syncCrafterValue().addInventory()
.create(this, syncID);
}
}

View file

@ -108,7 +108,7 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
if (!world.isClient && ticksSinceLastChange >= 10) {
if (!inventory.getInvStack(1).isEmpty()) {
FluidUtils.drainContainers(tank, inventory, 1, 6);
FluidUtils.fillContainers(tank, inventory, 1, 6, tank.getFluidType());
FluidUtils.fillContainers(tank, inventory, 1, 6, tank.getFluid());
}
ticksSinceLastChange = 0;
}
@ -116,8 +116,6 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
if (!world.isClient && getMultiBlock()) {
super.tick();
}
tank.compareAndUpdate();
}
@Override
@ -147,7 +145,7 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
return new ContainerBuilder("industrialgrinder").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(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, syncID);
.sync(tank).syncEnergyValue().syncCrafterValue().addInventory().create(this, syncID);
}
}

View file

@ -98,7 +98,7 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
if (!world.isClient && ticksSinceLastChange >= 10) {
if (!inventory.getInvStack(1).isEmpty()) {
FluidUtils.drainContainers(tank, inventory, 1, 5);
FluidUtils.fillContainers(tank, inventory, 1, 5, tank.getFluidType());
FluidUtils.fillContainers(tank, inventory, 1, 5, tank.getFluidInstance().getFluid());
}
ticksSinceLastChange = 0;
}
@ -107,7 +107,6 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
super.tick();
}
tank.compareAndUpdate();
}
// TilePowerAcceptor
@ -147,7 +146,7 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory().hotbar().addInventory()
.blockEntity(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()
.outputSlot(4, 126, 61).outputSlot(5, 34, 55).energySlot(6, 8, 72).sync(tank).syncEnergyValue().syncCrafterValue()
.addInventory().create(this, syncID);
}