From 027f4d3d7b5bafe3cf85911f07a65e84cce045b0 Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 3 Jul 2023 17:25:01 -0700 Subject: [PATCH] Fix PitcherCropBlock not calling canSustainPlant, not allowing it to be placed on custom farmland. Close #9611 --- .../world/level/block/PitcherCropBlock.java.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 patches/minecraft/net/minecraft/world/level/block/PitcherCropBlock.java.patch diff --git a/patches/minecraft/net/minecraft/world/level/block/PitcherCropBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/PitcherCropBlock.java.patch new file mode 100644 index 0000000000..19c3854bf2 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/PitcherCropBlock.java.patch @@ -0,0 +1,15 @@ +--- a/net/minecraft/world/level/block/PitcherCropBlock.java ++++ b/net/minecraft/world/level/block/PitcherCropBlock.java +@@ -69,7 +_,11 @@ + if (!m_278754_(p_277671_)) { + return super.m_7898_(p_277671_, p_277477_, p_278085_); + } else { +- return this.m_6266_(p_277477_.m_8055_(p_278085_.m_7495_()), p_277477_, p_278085_.m_7495_()) && m_290004_(p_277477_, p_278085_) && (p_277671_.m_61143_(f_276478_) < 3 || m_290001_(p_277477_.m_8055_(p_278085_.m_7494_()))); ++ BlockPos below = p_278085_.m_7495_(); ++ boolean isSoil = this.m_6266_(p_277477_.m_8055_(below), p_277477_, below); ++ if (p_277671_.m_60734_() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. ++ isSoil = p_277477_.m_8055_(below).canSustainPlant(p_277477_, below, Direction.UP, this); ++ return isSoil && m_290004_(p_277477_, p_278085_) && (p_277671_.m_61143_(f_276478_) < 3 || m_290001_(p_277477_.m_8055_(p_278085_.m_7494_()))); + } + } +