mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 04:33:56 -07:00
Update to Minecraft 1.16.2
This commit is contained in:
@@ -1,22 +1,48 @@
|
||||
--- a/net/minecraft/server/BehaviorInteractDoor.java
|
||||
+++ b/net/minecraft/server/BehaviorInteractDoor.java
|
||||
@@ -46,11 +46,18 @@
|
||||
if (TagsBlock.WOODEN_DOORS.isTagged(block) && block instanceof BlockDoor) {
|
||||
boolean flag = j >= i;
|
||||
@@ -52,6 +52,13 @@
|
||||
BlockDoor blockdoor = (BlockDoor) iblockdata.getBlock();
|
||||
|
||||
if (!blockdoor.h(iblockdata)) {
|
||||
+ // CraftBukkit start - entities opening doors
|
||||
+ org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.world, blockposition));
|
||||
+ entityliving.world.getServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CaftBukkit end
|
||||
((BlockDoor) block).setDoor(worldserver, blockposition, flag);
|
||||
GlobalPos globalpos = GlobalPos.create(worldserver.getDimensionKey(), blockposition);
|
||||
+ // CraftBukkit end
|
||||
blockdoor.setDoor(worldserver, iblockdata, blockposition, true);
|
||||
}
|
||||
|
||||
if (!behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).isPresent() && flag) {
|
||||
- behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, (Object) Sets.newHashSet(new GlobalPos[]{globalpos}));
|
||||
+ behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, Sets.newHashSet(new GlobalPos[]{globalpos})); // CraftBukkit - decompile error
|
||||
} else {
|
||||
behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).ifPresent((set1) -> {
|
||||
if (flag) {
|
||||
@@ -65,6 +72,13 @@
|
||||
BlockDoor blockdoor1 = (BlockDoor) iblockdata1.getBlock();
|
||||
|
||||
if (!blockdoor1.h(iblockdata1)) {
|
||||
+ // CraftBukkit start - entities opening doors
|
||||
+ org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.world, blockposition));
|
||||
+ entityliving.world.getServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
blockdoor1.setDoor(worldserver, iblockdata1, blockposition1, true);
|
||||
this.c(worldserver, entityliving, blockposition1);
|
||||
}
|
||||
@@ -113,7 +127,7 @@
|
||||
private static boolean a(WorldServer worldserver, EntityLiving entityliving, BlockPosition blockposition) {
|
||||
BehaviorController<?> behaviorcontroller = entityliving.getBehaviorController();
|
||||
|
||||
- return !behaviorcontroller.hasMemory(MemoryModuleType.MOBS) ? false : ((List) behaviorcontroller.getMemory(MemoryModuleType.MOBS).get()).stream().filter((entityliving1) -> {
|
||||
+ return !behaviorcontroller.hasMemory(MemoryModuleType.MOBS) ? false : (behaviorcontroller.getMemory(MemoryModuleType.MOBS).get()).stream().filter((entityliving1) -> { // CraftBukkit - decompile error
|
||||
return entityliving1.getEntityType() == entityliving.getEntityType();
|
||||
}).filter((entityliving1) -> {
|
||||
return blockposition.a((IPosition) entityliving1.getPositionVector(), 2.0D);
|
||||
@@ -155,7 +169,7 @@
|
||||
if (behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).isPresent()) {
|
||||
((Set) behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).get()).add(globalpos);
|
||||
} else {
|
||||
- behaviorcontroller.setMemory(MemoryModuleType.DOORS_TO_CLOSE, (Object) Sets.newHashSet(new GlobalPos[]{globalpos}));
|
||||
+ behaviorcontroller.setMemory(MemoryModuleType.DOORS_TO_CLOSE, Sets.newHashSet(new GlobalPos[]{globalpos})); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user