Add silent barrels - fixes #106
This commit is contained in:
@@ -21,6 +21,7 @@ import java.lang.reflect.Field;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import net.minecraft.server.v1_14_R1.AxisAlignedBB;
|
import net.minecraft.server.v1_14_R1.AxisAlignedBB;
|
||||||
import net.minecraft.server.v1_14_R1.Block;
|
import net.minecraft.server.v1_14_R1.Block;
|
||||||
|
import net.minecraft.server.v1_14_R1.BlockBarrel;
|
||||||
import net.minecraft.server.v1_14_R1.BlockChest;
|
import net.minecraft.server.v1_14_R1.BlockChest;
|
||||||
import net.minecraft.server.v1_14_R1.BlockChestTrapped;
|
import net.minecraft.server.v1_14_R1.BlockChestTrapped;
|
||||||
import net.minecraft.server.v1_14_R1.BlockEnderChest;
|
import net.minecraft.server.v1_14_R1.BlockEnderChest;
|
||||||
@@ -78,7 +79,8 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
}
|
}
|
||||||
BlockState state = bukkitBlock.getState();
|
BlockState state = bukkitBlock.getState();
|
||||||
return state instanceof org.bukkit.block.Chest
|
return state instanceof org.bukkit.block.Chest
|
||||||
|| state instanceof org.bukkit.block.ShulkerBox;
|
|| state instanceof org.bukkit.block.ShulkerBox
|
||||||
|
|| state instanceof org.bukkit.block.Barrel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -258,6 +260,10 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
bukkitPlayer.incrementStatistic(Statistic.SHULKER_BOX_OPENED);
|
bukkitPlayer.incrementStatistic(Statistic.SHULKER_BOX_OPENED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (block instanceof BlockBarrel) {
|
||||||
|
bukkitPlayer.incrementStatistic(Statistic.OPEN_BARREL);
|
||||||
|
}
|
||||||
|
|
||||||
// AnyChest only - SilentChest not active, container unsupported, or unnecessary.
|
// AnyChest only - SilentChest not active, container unsupported, or unnecessary.
|
||||||
if (!silentchest || player.playerInteractManager.getGameMode() == EnumGamemode.SPECTATOR) {
|
if (!silentchest || player.playerInteractManager.getGameMode() == EnumGamemode.SPECTATOR) {
|
||||||
player.openContainer(tileInventory);
|
player.openContainer(tileInventory);
|
||||||
@@ -287,6 +293,7 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
case CHEST:
|
case CHEST:
|
||||||
case ENDER_CHEST:
|
case ENDER_CHEST:
|
||||||
case SHULKER_BOX:
|
case SHULKER_BOX:
|
||||||
|
case BARREL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user