2020-08-25 04:22:08 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
|
|
|
Date: Sun, 23 Aug 2020 19:01:04 +0200
|
|
|
|
Subject: [PATCH] Don't require FACING data
|
|
|
|
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java b/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java
|
2020-08-25 04:22:08 +02:00
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java
|
|
|
|
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -0,0 +0,0 @@ import org.bukkit.event.block.BlockDispenseEvent;
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
public class DispenseBehaviorItem implements IDispenseBehavior {
|
|
|
|
+ private EnumDirection enumdirection; // Paper
|
|
|
|
|
|
|
|
public DispenseBehaviorItem() {}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public final ItemStack dispense(ISourceBlock isourceblock, ItemStack itemstack) {
|
|
|
|
+ enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); // Paper - cache facing direction
|
|
|
|
ItemStack itemstack1 = this.a(isourceblock, itemstack);
|
|
|
|
|
|
|
|
this.a(isourceblock);
|
|
|
|
- this.a(isourceblock, (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
|
|
|
|
+ this.a(isourceblock, enumdirection); // Paper - cache facing direction
|
|
|
|
return itemstack1;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
|
|
|
- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
|
|
|
|
+ // Paper - cached enum direction
|
|
|
|
IPosition iposition = BlockDispenser.a(isourceblock);
|
|
|
|
ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
|
|
|
|
|