From 2372198eb43de83893d096f4b744520b60280727 Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Mon, 14 Jun 2021 01:19:51 +0200 Subject: [PATCH] use local class for movecontrol stuff to prevent reobf mapping issue --- ...-Bees-get-gravity-in-void.-Fixes-MC-167279.patch | 13 +++++++++---- ...not-allow-bees-to-load-chunks-for-beehives.patch | 10 +++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/patches/server/0364-Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/patches/server/0364-Bees-get-gravity-in-void.-Fixes-MC-167279.patch index adb34b3de2..d42a9033b2 100644 --- a/patches/server/0364-Bees-get-gravity-in-void.-Fixes-MC-167279.patch +++ b/patches/server/0364-Bees-get-gravity-in-void.-Fixes-MC-167279.patch @@ -5,16 +5,20 @@ Subject: [PATCH] Bees get gravity in void. Fixes MC-167279 diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index f3ba4b26553915917c79f013ed9dd7c87d9f65a4..b4cd490a1b2a2a118dc5f49bcb0fb755fbad853b 100644 +index f3ba4b26553915917c79f013ed9dd7c87d9f65a4..3d049e43c8ea85597e98e9dad61c8d4c49b01b1c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -143,7 +143,17 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -143,7 +143,22 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { public Bee(EntityType type, Level world) { super(type, world); this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(this.random, 20, 60); - this.moveControl = new FlyingMoveControl(this, 20, true); + // Paper start - apply gravity to bees when they get stuck in the void, fixes MC-167279 -+ this.moveControl = new FlyingMoveControl(this, 20, true) { ++ class BeeFlyingMoveControl extends FlyingMoveControl { ++ public BeeFlyingMoveControl(final Mob entity, final int maxPitchChange, final boolean noGravity) { ++ super(entity, maxPitchChange, noGravity); ++ } ++ + @Override + public void tick() { + if (this.mob.getY() <= 0) { @@ -22,7 +26,8 @@ index f3ba4b26553915917c79f013ed9dd7c87d9f65a4..b4cd490a1b2a2a118dc5f49bcb0fb755 + } + super.tick(); + } -+ }; ++ } ++ this.moveControl = new BeeFlyingMoveControl(this, 20, true); + // Paper end this.lookControl = new Bee.BeeLookControl(this); this.setPathfindingMalus(BlockPathTypes.DANGER_FIRE, -1.0F); diff --git a/patches/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch b/patches/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch index bbc752cdd0..5e703d1985 100644 --- a/patches/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch +++ b/patches/server/0381-Do-not-allow-bees-to-load-chunks-for-beehives.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not allow bees to load chunks for beehives diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index b4cd490a1b2a2a118dc5f49bcb0fb755fbad853b..4aeffd9efe6f845007f35a3fd23fdfda2d1f20aa 100644 +index 3d049e43c8ea85597e98e9dad61c8d4c49b01b1c..207e6f411491d01f9ca5b49aa65a66e16255ff3e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -404,6 +404,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -409,6 +409,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (this.hivePos == null) { return false; } else { @@ -16,7 +16,7 @@ index b4cd490a1b2a2a118dc5f49bcb0fb755fbad853b..4aeffd9efe6f845007f35a3fd23fdfda BlockEntity tileentity = this.level.getBlockEntity(this.hivePos); return tileentity instanceof BeehiveBlockEntity && ((BeehiveBlockEntity) tileentity).isFireNearby(); -@@ -436,6 +437,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -441,6 +442,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { } private boolean doesHiveHaveSpace(BlockPos pos) { @@ -24,7 +24,7 @@ index b4cd490a1b2a2a118dc5f49bcb0fb755fbad853b..4aeffd9efe6f845007f35a3fd23fdfda BlockEntity tileentity = this.level.getBlockEntity(pos); return tileentity instanceof BeehiveBlockEntity ? !((BeehiveBlockEntity) tileentity).isFull() : false; -@@ -909,6 +911,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -914,6 +916,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public boolean canBeeUse() { if (Bee.this.hasHive() && Bee.this.wantsToEnterHive() && Bee.this.hivePos.closerThan((Position) Bee.this.position(), 2.0D)) { @@ -32,7 +32,7 @@ index b4cd490a1b2a2a118dc5f49bcb0fb755fbad853b..4aeffd9efe6f845007f35a3fd23fdfda BlockEntity tileentity = Bee.this.level.getBlockEntity(Bee.this.hivePos); if (tileentity instanceof BeehiveBlockEntity) { -@@ -932,6 +935,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -937,6 +940,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public void start() {