2013-09-14 00:11:53 +00:00
|
|
|
From 4715cecf8a6aca768fa90a38c78469cf1016eb6b Mon Sep 17 00:00:00 2001
|
2013-09-13 04:19:31 +00:00
|
|
|
From: Chad Waters <authorblues@gmail.com>
|
|
|
|
Date: Tue, 26 Mar 2013 07:47:43 -0400
|
|
|
|
Subject: [PATCH] Update Physics When Updating Attachables
|
|
|
|
|
|
|
|
Update physics for Attachable to update redstone. Fixes BUKKIT-1858
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
2013-09-14 00:11:53 +00:00
|
|
|
index 2072db2..c2ccc73 100644
|
2013-09-13 04:19:31 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
|
|
|
@@ -9,6 +9,7 @@ import org.bukkit.block.BlockState;
|
|
|
|
import org.bukkit.craftbukkit.CraftChunk;
|
|
|
|
import org.bukkit.craftbukkit.CraftWorld;
|
|
|
|
import org.bukkit.material.MaterialData;
|
|
|
|
+import org.bukkit.material.Attachable;
|
|
|
|
import org.bukkit.metadata.MetadataValue;
|
|
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
|
|
|
|
@@ -128,6 +129,10 @@ public class CraftBlockState implements BlockState {
|
|
|
|
}
|
|
|
|
|
|
|
|
block.setData(getRawData(), applyPhysics);
|
2013-09-14 00:11:53 +00:00
|
|
|
+ if (applyPhysics && data instanceof Attachable) {
|
2013-09-13 04:19:31 +00:00
|
|
|
+ Block rel = block.getRelative(((Attachable) data).getFacing(), -1);
|
|
|
|
+ world.getHandle().applyPhysics(rel.getX(), rel.getY(), rel.getZ(), block.getTypeId());
|
|
|
|
+ }
|
|
|
|
world.getHandle().notify(x, y, z);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
--
|
|
|
|
1.8.1.2
|
|
|
|
|