mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-12-26 16:49:23 +01:00
parent
c1695f7b78
commit
c06097f287
5 changed files with 11 additions and 11 deletions
|
@ -113,7 +113,7 @@ public final class Utility {
|
|||
public static void sendBlockEntityToClients(BlockEntity tile) {
|
||||
var world = (ServerLevel) tile.getLevel();
|
||||
var entities = world.getChunkSource().chunkMap.getPlayers(new ChunkPos(tile.getBlockPos()), false);
|
||||
var packet = ClientboundBlockEntityDataPacket.create(tile, t -> t.save(new CompoundTag()));
|
||||
var packet = ClientboundBlockEntityDataPacket.create(tile, BlockEntity::saveWithoutMetadata);
|
||||
for (var e : entities)
|
||||
e.connection.send(packet);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,8 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag compound) {
|
||||
public void saveAdditional(CompoundTag compound) {
|
||||
super.saveAdditional(compound);
|
||||
compound.put("modules", this.modules.serializeNBT());
|
||||
compound.putInt("module_drop_check", this.moduleDropCheck);
|
||||
compound.put("requests", Utility.serializeAll(this.craftIngredientRequests));
|
||||
|
@ -102,7 +103,6 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
|
|||
results.add(nbt);
|
||||
}
|
||||
compound.put("craft_results", results);
|
||||
return super.save(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -126,7 +126,7 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
|
|||
@Override
|
||||
public CompoundTag getUpdateTag() {
|
||||
// sync pipe items on load
|
||||
var nbt = this.save(new CompoundTag());
|
||||
var nbt = this.saveWithoutMetadata();
|
||||
nbt.put("items", Utility.serializeAll(this.getItems()));
|
||||
return nbt;
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@ public class PressurizerBlockEntity extends BlockEntity implements MenuProvider,
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag compound) {
|
||||
public void saveAdditional(CompoundTag compound) {
|
||||
super.saveAdditional(compound);
|
||||
compound.putInt("energy", this.getEnergy());
|
||||
return super.save(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +71,7 @@ public class PressurizerBlockEntity extends BlockEntity implements MenuProvider,
|
|||
|
||||
@Override
|
||||
public CompoundTag getUpdateTag() {
|
||||
return this.save(new CompoundTag());
|
||||
return this.saveWithoutMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -135,9 +135,9 @@ public class CraftingTerminalBlockEntity extends ItemTerminalBlockEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag compound) {
|
||||
public void saveAdditional(CompoundTag compound) {
|
||||
super.saveAdditional(compound);
|
||||
compound.put("craft_items", this.craftItems.serializeNBT());
|
||||
return super.save(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -224,10 +224,10 @@ public class ItemTerminalBlockEntity extends BlockEntity implements IPipeConnect
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag compound) {
|
||||
public void saveAdditional(CompoundTag compound) {
|
||||
super.saveAdditional(compound);
|
||||
compound.put("items", this.items.serializeNBT());
|
||||
compound.put("requests", Utility.serializeAll(this.existingRequests));
|
||||
return super.save(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue