2019-04-22 23:36:14 +02:00
From c31f3e86f6647a66fe4ab95da3ab06921900bd31 Mon Sep 17 00:00:00 2001
2018-08-23 19:02:57 +02: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-04-22 23:36:14 +02:00
index c674aa13d8..2e460a7f63 100644
2018-08-23 19:02:57 +02:00
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
2019-01-01 04:15:55 +01:00
@@ -154,6 +154,7 @@ public class Block implements IMaterial {
2018-08-23 19:02:57 +02: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-04-22 23:36:14 +02:00
index 139a70ca3b..e4aba0e0a8 100644
2018-08-23 19:02:57 +02:00
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
2019-01-01 04:15:55 +01:00
@@ -305,8 +305,9 @@ public class EntityEnderman extends EntityMonster {
2018-08-26 20:11:49 +02:00
if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
2018-08-23 19:02:57 +02: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
world.setAir(blockposition);
+ this.enderman.setCarried(Block.getValidBlockForPosition(iblockdata, this.enderman.world, blockposition)); // Paper - Fix MC-124320
}
// CraftBukkit end
}
2019-01-01 04:15:55 +01:00
@@ -316,6 +317,7 @@ public class EntityEnderman extends EntityMonster {
2018-08-23 19:02:57 +02:00
static class PathfinderGoalEndermanPlaceBlock extends PathfinderGoal {
+ private EntityEnderman getEnderman() { return this.a; } // Paper - OBFHELPER
private final EntityEnderman a;
public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) {
2019-01-01 04:15:55 +01:00
@@ -335,7 +337,7 @@ public class EntityEnderman extends EntityMonster {
2018-08-23 19:02:57 +02:00
BlockPosition blockposition = new BlockPosition(i, j, k);
IBlockData iblockdata = world.getType(blockposition);
IBlockData iblockdata1 = world.getType(blockposition.down());
- IBlockData iblockdata2 = this.a.getCarried();
+ IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1)) {
// CraftBukkit start - Place event
--
2019-03-20 02:46:00 +01:00
2.21.0
2018-08-23 19:02:57 +02:00