mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Configurable Disabling Cat Chest Detection
Offers a gameplay feature to stop cats from blocking chests
This commit is contained in:
parent
dd1cfc07db
commit
b380d6445b
1 changed files with 20 additions and 10 deletions
|
@ -26,13 +26,10 @@
|
|||
}
|
||||
|
||||
public Optional<MenuProvider> acceptSingle(ChestBlockEntity single) {
|
||||
@@ -118,8 +101,40 @@
|
||||
@Override
|
||||
public Optional<MenuProvider> acceptNone() {
|
||||
return Optional.empty();
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
@@ -121,6 +104,38 @@
|
||||
}
|
||||
};
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public static class DoubleInventory implements MenuProvider {
|
||||
+
|
||||
|
@ -61,12 +58,13 @@
|
|||
+ @Override
|
||||
+ public Component getDisplayName() {
|
||||
+ return (Component) (this.tileentitychest.hasCustomName() ? this.tileentitychest.getDisplayName() : (this.tileentitychest1.hasCustomName() ? this.tileentitychest1.getDisplayName() : Component.translatable("container.chestDouble")));
|
||||
}
|
||||
};
|
||||
+ }
|
||||
+ };
|
||||
+ // CraftBukkit end
|
||||
|
||||
+
|
||||
@Override
|
||||
public MapCodec<? extends ChestBlock> codec() {
|
||||
return ChestBlock.CODEC;
|
||||
@@ -257,7 +272,7 @@
|
||||
|
||||
@Override
|
||||
|
@ -94,3 +92,15 @@
|
|||
public static DoubleBlockCombiner.Combiner<ChestBlockEntity, Float2FloatFunction> opennessCombiner(final LidBlockEntity progress) {
|
||||
return new DoubleBlockCombiner.Combiner<ChestBlockEntity, Float2FloatFunction>() {
|
||||
public Float2FloatFunction acceptDouble(ChestBlockEntity first, ChestBlockEntity second) {
|
||||
@@ -321,6 +343,11 @@
|
||||
}
|
||||
|
||||
private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) {
|
||||
+ // Paper start - Option to disable chest cat detection
|
||||
+ if (world.getMinecraftWorld().paperConfig().entities.behavior.disableChestCatDetection) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Paper end - Option to disable chest cat detection
|
||||
List<Cat> list = world.getEntitiesOfClass(Cat.class, new AABB((double) pos.getX(), (double) (pos.getY() + 1), (double) pos.getZ(), (double) (pos.getX() + 1), (double) (pos.getY() + 2), (double) (pos.getZ() + 1)));
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
|
|
Loading…
Reference in a new issue