From 87ecc7f74e5d380ee7cd7a604f0a472f0575bc50 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 24 Jan 2022 23:06:17 +0100 Subject: [PATCH] possibly really fixed #112?? --- .../ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java | 2 +- .../terminal/containers/CraftingTerminalContainer.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java b/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java index d18ae94..e58cad9 100644 --- a/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java +++ b/src/main/java/de/ellpeck/prettypipes/terminal/ItemTerminalTileEntity.java @@ -175,7 +175,7 @@ public class ItemTerminalTileEntity extends TileEntity implements INamedContaine return stack.getCount() - ret.getRight().getCount(); } - protected PlayerEntity[] getLookingPlayers() { + public PlayerEntity[] getLookingPlayers() { return this.world.getPlayers().stream() .filter(p -> p.openContainer instanceof ItemTerminalContainer) .filter(p -> ((ItemTerminalContainer) p.openContainer).tile == this) diff --git a/src/main/java/de/ellpeck/prettypipes/terminal/containers/CraftingTerminalContainer.java b/src/main/java/de/ellpeck/prettypipes/terminal/containers/CraftingTerminalContainer.java index dabb086..a6ffd22 100644 --- a/src/main/java/de/ellpeck/prettypipes/terminal/containers/CraftingTerminalContainer.java +++ b/src/main/java/de/ellpeck/prettypipes/terminal/containers/CraftingTerminalContainer.java @@ -39,7 +39,8 @@ public class CraftingTerminalContainer extends ItemTerminalContainer { this.craftResult = new CraftResultInventory() { @Override public void markDirty() { - CraftingTerminalContainer.this.onCraftMatrixChanged(this); + for (PlayerEntity player : CraftingTerminalContainer.this.getTile().getLookingPlayers()) + player.openContainer.onCraftMatrixChanged(this); } }; this.addSlot(new CraftingResultSlot(player, this.craftInventory, this.craftResult, 0, 25, 77));