Only update Attachable's when applyPhysics is true
This commit is contained in:
parent
753cb006cc
commit
e7ca6faddb
|
@ -1,4 +1,4 @@
|
||||||
From 9deff5bd402324c0492c00a3b2d3023d549cc07d Mon Sep 17 00:00:00 2001
|
From 4715cecf8a6aca768fa90a38c78469cf1016eb6b Mon Sep 17 00:00:00 2001
|
||||||
From: Chad Waters <authorblues@gmail.com>
|
From: Chad Waters <authorblues@gmail.com>
|
||||||
Date: Tue, 26 Mar 2013 07:47:43 -0400
|
Date: Tue, 26 Mar 2013 07:47:43 -0400
|
||||||
Subject: [PATCH] Update Physics When Updating Attachables
|
Subject: [PATCH] Update Physics When Updating Attachables
|
||||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Update Physics When Updating Attachables
|
||||||
Update physics for Attachable to update redstone. Fixes BUKKIT-1858
|
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
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||||
index 2072db2..65cb405 100644
|
index 2072db2..c2ccc73 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||||
+++ b/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;
|
@@ -9,6 +9,7 @@ import org.bukkit.block.BlockState;
|
||||||
|
@ -21,7 +21,7 @@ index 2072db2..65cb405 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
block.setData(getRawData(), applyPhysics);
|
block.setData(getRawData(), applyPhysics);
|
||||||
+ if (data instanceof Attachable) {
|
+ if (applyPhysics && data instanceof Attachable) {
|
||||||
+ Block rel = block.getRelative(((Attachable) data).getFacing(), -1);
|
+ Block rel = block.getRelative(((Attachable) data).getFacing(), -1);
|
||||||
+ world.getHandle().applyPhysics(rel.getX(), rel.getY(), rel.getZ(), block.getTypeId());
|
+ world.getHandle().applyPhysics(rel.getX(), rel.getY(), rel.getZ(), block.getTypeId());
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Reference in New Issue