2019-06-06 15:36:57 +00:00
From fbf426f28f91f86b2d67097486821e00442df970 Mon Sep 17 00:00:00 2001
2018-08-23 17:02:57 +00:00
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Thu, 23 Aug 2018 09:25:30 -0500
Subject: [PATCH] Fix MC-124320
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
2019-06-06 15:36:57 +00:00
index 03d3090b3f..0bddca623e 100644
2018-08-23 17:02:57 +00:00
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
2019-05-27 23:01:45 +00:00
@@ -167,6 +167,7 @@ public class Block implements IMaterial {
2018-08-23 17:02:57 +00:00
return tag.isTagged(this);
}
+ public static IBlockData getValidBlockForPosition(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { return Block.b(iblockdata, generatoraccess, blockposition); } // Paper - OBFHELPER
public static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
IBlockData iblockdata1 = iblockdata;
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
2019-06-06 15:36:57 +00:00
index 6db334cb59..5e850db327 100644
2018-08-23 17:02:57 +00:00
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
2019-05-14 02:20:58 +00:00
@@ -335,8 +335,9 @@ public class EntityEnderman extends EntityMonster {
2018-08-26 18:11:49 +00:00
if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
2018-08-23 17:02:57 +00:00
// CraftBukkit start - Pickup event
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
- this.enderman.setCarried(iblockdata);
+ //this.enderman.setCarried(iblockdata); // Paper - moved down
2019-05-05 08:33:44 +00:00
world.a(blockposition, false);
2018-08-23 17:02:57 +00:00
+ this.enderman.setCarried(Block.getValidBlockForPosition(iblockdata, this.enderman.world, blockposition)); // Paper - Fix MC-124320
}
// CraftBukkit end
}
2019-05-14 02:20:58 +00:00
@@ -346,6 +347,7 @@ public class EntityEnderman extends EntityMonster {
2018-08-23 17:02:57 +00:00
static class PathfinderGoalEndermanPlaceBlock extends PathfinderGoal {
+ private EntityEnderman getEnderman() { return this.a; } // Paper - OBFHELPER
private final EntityEnderman a;
public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) {
2019-05-14 02:20:58 +00:00
@@ -368,7 +370,7 @@ public class EntityEnderman extends EntityMonster {
2018-08-23 17:02:57 +00:00
IBlockData iblockdata = world.getType(blockposition);
2019-05-05 08:33:44 +00:00
BlockPosition blockposition1 = blockposition.down();
IBlockData iblockdata1 = world.getType(blockposition1);
2018-08-23 17:02:57 +00:00
- IBlockData iblockdata2 = this.a.getCarried();
+ IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320
2019-05-05 08:33:44 +00:00
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
2018-08-23 17:02:57 +00:00
// CraftBukkit start - Place event
--
2019-05-05 11:32:20 +00:00
2.21.0
2018-08-23 17:02:57 +00:00