Fix HoeItem patch incorrectly applied during migration. (#8384)

This commit is contained in:
Take Weiland authored and GitHub committed 2022-02-08 11:28:22 -08:00
1 parent 4f4849b60c
commit dda1be91ea
1 file changed
+6 -17
@@ -1,25 +1,14 @@
--- a/net/minecraft/world/item/HoeItem.java
+++ b/net/minecraft/world/item/HoeItem.java
@@ -33,6 +_,9 @@
@@ -30,6 +_,8 @@
}
public InteractionResult m_6225_(UseOnContext p_41341_) {
+ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(p_41341_);
+ if (hook != 0) return hook > 0 ? InteractionResult.SUCCESS : InteractionResult.FAIL;
Level level = p_41341_.m_43725_();
BlockPos blockpos = p_41341_.m_8083_();
Pair<Predicate<UseOnContext>, Consumer<UseOnContext>> pair = f_41332_.get(level.m_8055_(blockpos).m_60734_());
+ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(p_41341_);
+ if (hook != 0) return hook > 0 ? InteractionResult.SUCCESS : InteractionResult.FAIL;
+ if (p_41341_.m_43719_() != Direction.DOWN && level.m_46859_(blockpos.m_7494_())) {
if (pair == null) {
return InteractionResult.PASS;
} else {
@@ -55,6 +_,9 @@
return InteractionResult.PASS;
}
}
+ }
+
+ return InteractionResult.PASS;
}
public static Consumer<UseOnContext> m_150858_(BlockState p_150859_) {
@@ -72,5 +_,10 @@
public static boolean m_150856_(UseOnContext p_150857_) {