فهرست منبع

We need to use event.getBlock() here

Fix my boo boo from previous commit
TfT_02 11 سال پیش
والد
کامیت
9a359bf42c

+ 1 - 1
src/main/java/com/gmail/nossr50/listeners/BlockListener.java

@@ -97,7 +97,7 @@ public class BlockListener implements Listener {
         Block movedBlock = event.getRetractLocation().getBlock();
 
         // Needed only because under some circumstances Minecraft doesn't move the block
-        new StickyPistonTrackerTask(event.getDirection(), movedBlock).runTaskLater(plugin, 2);
+        new StickyPistonTrackerTask(event.getDirection(), event.getBlock(), movedBlock).runTaskLater(plugin, 2);
     }
 
     /**

+ 4 - 2
src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java

@@ -10,10 +10,12 @@ import com.gmail.nossr50.util.BlockUtils;
 
 public class StickyPistonTrackerTask extends BukkitRunnable {
     private BlockFace direction;
+    private Block block;
     private Block movedBlock;
 
-    public StickyPistonTrackerTask(BlockFace direction, Block movedBlock) {
+    public StickyPistonTrackerTask(BlockFace direction, Block block, Block movedBlock) {
         this.direction = direction;
+        this.block = block;
         this.movedBlock = movedBlock;
     }
 
@@ -24,6 +26,6 @@ public class StickyPistonTrackerTask extends BukkitRunnable {
         }
 
         mcMMO.getPlaceStore().setFalse(movedBlock);
-        mcMMO.getPlaceStore().setTrue(movedBlock.getRelative(direction));
+        mcMMO.getPlaceStore().setTrue(block.getRelative(direction));
     }
 }