diff --git a/internal/v1_15_R1/src/main/java/com/lishid/openinv/internal/v1_15_R1/AnySilentContainer.java b/internal/v1_15_R1/src/main/java/com/lishid/openinv/internal/v1_15_R1/AnySilentContainer.java index e4b58ed..3cceef7 100644 --- a/internal/v1_15_R1/src/main/java/com/lishid/openinv/internal/v1_15_R1/AnySilentContainer.java +++ b/internal/v1_15_R1/src/main/java/com/lishid/openinv/internal/v1_15_R1/AnySilentContainer.java @@ -33,7 +33,6 @@ import net.minecraft.server.v1_15_R1.ContainerChest; import net.minecraft.server.v1_15_R1.Containers; import net.minecraft.server.v1_15_R1.EntityHuman; import net.minecraft.server.v1_15_R1.EntityPlayer; -import net.minecraft.server.v1_15_R1.EnumChatFormat; import net.minecraft.server.v1_15_R1.EnumGamemode; import net.minecraft.server.v1_15_R1.IBlockData; import net.minecraft.server.v1_15_R1.IChatBaseComponent; @@ -192,7 +191,7 @@ public class AnySilentContainer implements IAnySilentContainer { InventoryEnderChest enderChest = player.getEnderChest(); enderChest.a((TileEntityEnderChest) tile); player.openContainer(new TileInventory((containerCounter, playerInventory, ignored) -> { - Containers containers; + Containers containers; int rows = enderChest.getSize() / 9; switch (rows) { case 1: @@ -251,8 +250,8 @@ public class AnySilentContainer implements IAnySilentContainer { TileEntityChest rightChest = chestType == BlockPropertyChestType.RIGHT ? ((TileEntityChest) tileInventory) : (TileEntityChest) adjacentTile; TileEntityChest leftChest = chestType == BlockPropertyChestType.RIGHT ? (TileEntityChest) adjacentTile : ((TileEntityChest) tileInventory); - if (rightChest.lootTable != null || leftChest.lootTable != null) { - player.a(new ChatMessage("Loot not generated! Please disable /silentcontainer.").a(EnumChatFormat.RED), true); + if (silentchest && (rightChest.lootTable != null || leftChest.lootTable != null)) { + OpenInv.getPlugin(OpenInv.class).sendSystemMessage(bukkitPlayer, "messages.error.lootNotGenerated"); return false; } diff --git a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java b/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java index 2319810..f5bbd2f 100644 --- a/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java +++ b/internal/v1_16_R1/src/main/java/com/lishid/openinv/internal/v1_16_R1/AnySilentContainer.java @@ -33,7 +33,6 @@ import net.minecraft.server.v1_16_R1.ContainerChest; import net.minecraft.server.v1_16_R1.Containers; import net.minecraft.server.v1_16_R1.EntityHuman; import net.minecraft.server.v1_16_R1.EntityPlayer; -import net.minecraft.server.v1_16_R1.EnumChatFormat; import net.minecraft.server.v1_16_R1.EnumGamemode; import net.minecraft.server.v1_16_R1.IBlockData; import net.minecraft.server.v1_16_R1.IChatBaseComponent; @@ -251,8 +250,8 @@ public class AnySilentContainer implements IAnySilentContainer { TileEntityChest rightChest = chestType == BlockPropertyChestType.RIGHT ? ((TileEntityChest) tileInventory) : (TileEntityChest) adjacentTile; TileEntityChest leftChest = chestType == BlockPropertyChestType.RIGHT ? (TileEntityChest) adjacentTile : ((TileEntityChest) tileInventory); - if (rightChest.lootTable != null || leftChest.lootTable != null) { - player.a(new ChatMessage("Loot not generated! Please disable /silentcontainer.").a(EnumChatFormat.RED), true); + if (silentchest && (rightChest.lootTable != null || leftChest.lootTable != null)) { + OpenInv.getPlugin(OpenInv.class).sendSystemMessage(bukkitPlayer, "messages.error.lootNotGenerated"); return false; }