PaperMC/Spigot-Server-Patches/0275-Fix-MC-124320.patch

51 lines
3.3 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 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
2020-06-25 16:09:55 +02:00
index 247d9300a755aa22c2ca3bcef86b3b25f3ed75ee..bbd2e1be0f401d7e267dcfa2c905f42c2a475dd7 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
2020-06-25 16:09:55 +02:00
@@ -93,6 +93,7 @@ public class Block extends BlockBase implements IMaterial {
return this == block;
2018-08-23 19:02:57 +02:00
}
+ 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
2020-06-25 16:09:55 +02:00
index 7c13e5b711706c8aaa363d80350597a52920f12b..8da3b10cd6db379cf5d9d667154dd8911813284b 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
2020-06-25 16:09:55 +02:00
@@ -391,8 +391,9 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
if (block.a((Tag) 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
2019-05-05 10:33:44 +02:00
world.a(blockposition, false);
2018-08-23 19:02:57 +02:00
+ this.enderman.setCarried(Block.getValidBlockForPosition(iblockdata, this.enderman.world, blockposition)); // Paper - Fix MC-124320
}
// CraftBukkit end
}
2020-06-25 16:09:55 +02:00
@@ -402,6 +403,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
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) {
2020-06-25 16:09:55 +02:00
@@ -424,7 +426,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
2018-08-23 19:02:57 +02:00
IBlockData iblockdata = world.getType(blockposition);
2019-05-05 10:33:44 +02:00
BlockPosition blockposition1 = blockposition.down();
IBlockData iblockdata1 = world.getType(blockposition1);
2018-08-23 19:02:57 +02:00
- IBlockData iblockdata2 = this.a.getCarried();
+ IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320
2019-05-05 10:33:44 +02:00
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
2018-08-23 19:02:57 +02:00
// CraftBukkit start - Place event