aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSoSeDiK <[email protected]>2022-03-21 19:43:52 +0100
committerGitHub <[email protected]>2022-03-21 11:43:52 -0700
commite7d928a8e169360c31c8539d0ddb0d376a87f358 (patch)
tree99a2ef8e9388c9da082aa86acea4ac0fd286b643
parentab666a48ee96a785751f1786a22dfc5e8fb96398 (diff)
downloadPaper-e7d928a8e169360c31c8539d0ddb0d376a87f358.tar.gz
Paper-e7d928a8e169360c31c8539d0ddb0d376a87f358.zip
Fix EntityChangeBlockEvent#getBlockData for when sheep eats grass block (#7646)
-rw-r--r--patches/server/0886-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0886-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch b/patches/server/0886-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch
new file mode 100644
index 0000000000..8a1fc34fd2
--- /dev/null
+++ b/patches/server/0886-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: SoSeDiK <[email protected]>
+Date: Mon, 21 Mar 2022 20:00:53 +0200
+Subject: [PATCH] Fix new block data for EntityChangeBlockEvent when sheep eats
+ grass block
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
+index 14ed3f0524773e22a792efb8b41a9217bad50f27..99044ebe2c37ce951566e3463ddbfaeec46d2b3c 100644
+--- a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
++++ b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
+@@ -81,7 +81,7 @@ public class EatBlockGoal extends Goal {
+
+ if (this.level.getBlockState(blockposition1).is(Blocks.GRASS_BLOCK)) {
+ // CraftBukkit
+- if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.AIR.defaultBlockState(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) {
++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.DIRT.defaultBlockState(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { // Paper - Fix wrong block state
+ this.level.levelEvent(2001, blockposition1, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
+ this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2);
+ }