Fix some logical bugs related to the Grindstone Event (#9089)

This commit is contained in:
KnightMiner authored and GitHub committed 2022-11-30 14:00:59 -08:00
1 parent b25a092cf1
commit 8358b800e9
5 files changed
+112 -12

No files matched your search

@@ -759,7 +759,11 @@ public class ForgeHooks
public static int onGrindstoneChange(@NotNull ItemStack top, @NotNull ItemStack bottom, Container outputSlot, int xp)
{
GrindstoneEvent.OnplaceItem e = new GrindstoneEvent.OnplaceItem(top, bottom, xp);
if (MinecraftForge.EVENT_BUS.post(e)) return e.getXp();
if (MinecraftForge.EVENT_BUS.post(e))
{
outputSlot.setItem(0, ItemStack.EMPTY);
return -1;
}
if (e.getOutput().isEmpty()) return Integer.MIN_VALUE;
outputSlot.setItem(0, e.getOutput());