aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches-Unmapped/0553-Don-t-require-FACING-data.patch
blob: 00f9b23e6f2571fcf681ebb5759162959e652d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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


diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java b/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java
index 979b862284ecd0dc504ee8a7018b27ff569b7b85..3d14ec72bb9babdf6b24aca3bde06d8b54815f9d 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseBehaviorItem.java
@@ -15,20 +15,22 @@ 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);