summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalVillagerFarm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/PathfinderGoalVillagerFarm.patch')
-rw-r--r--nms-patches/PathfinderGoalVillagerFarm.patch11
1 files changed, 5 insertions, 6 deletions
diff --git a/nms-patches/PathfinderGoalVillagerFarm.patch b/nms-patches/PathfinderGoalVillagerFarm.patch
index 449a3a77..b24ce69b 100644
--- a/nms-patches/PathfinderGoalVillagerFarm.patch
+++ b/nms-patches/PathfinderGoalVillagerFarm.patch
@@ -1,9 +1,9 @@
--- a/net/minecraft/server/PathfinderGoalVillagerFarm.java
+++ b/net/minecraft/server/PathfinderGoalVillagerFarm.java
-@@ -48,7 +48,11 @@
+@@ -40,7 +40,11 @@
Block block = iblockdata.getBlock();
- if (this.f == 0 && block instanceof BlockCrops && ((BlockCrops) block).y(iblockdata)) {
+ if (this.f == 0 && block instanceof BlockCrops && ((BlockCrops) block).A(iblockdata)) {
- world.setAir(blockposition, true);
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.c, blockposition, Blocks.AIR, 0).isCancelled()) {
@@ -11,15 +11,14 @@
+ }
+ // CraftBukkit end
} else if (this.f == 1 && iblockdata.getMaterial() == Material.AIR) {
- InventorySubcontainer inventorysubcontainer = this.c.dj();
+ InventorySubcontainer inventorysubcontainer = this.c.dm();
-@@ -57,19 +61,29 @@
+@@ -49,19 +53,28 @@
boolean flag = false;
- if (itemstack != null) {
+ if (!itemstack.isEmpty()) {
+ // CraftBukkit start
+ Block planted = null;
-+
if (itemstack.getItem() == Items.WHEAT_SEEDS) {
- world.setTypeAndData(blockposition, Blocks.WHEAT.getBlockData(), 3);
+ planted = Blocks.WHEAT;