summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-07-17 00:19:25 +0200
committerErik Broes <erikbroes@grum.nl>2011-07-17 18:14:45 +0200
commitf3a86eaacaab527ce6dd26b3a9fd2ce86a15374c (patch)
treed336779981566246995424bfb779d8f60bdb98b9 /src/main/java/org/bukkit
parentdf9142cd14aba260939b8618010cceb47d706890 (diff)
downloadcraftbukkit-f3a86eaacaab527ce6dd26b3a9fd2ce86a15374c.tar
craftbukkit-f3a86eaacaab527ce6dd26b3a9fd2ce86a15374c.tar.gz
craftbukkit-f3a86eaacaab527ce6dd26b3a9fd2ce86a15374c.tar.lz
craftbukkit-f3a86eaacaab527ce6dd26b3a9fd2ce86a15374c.tar.xz
craftbukkit-f3a86eaacaab527ce6dd26b3a9fd2ce86a15374c.zip
Implemented BLOCK_PISTON_CONTRACT/EXPAND
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 5835a6f3..2faffdf5 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
+import org.bukkit.block.PistonMoveReaction;
import net.minecraft.server.BiomeBase;
import net.minecraft.server.BlockRedstoneWire;
@@ -222,7 +223,11 @@ public class CraftBlock implements Block {
* @return Block at the given offsets
*/
public Block getRelative(BlockFace face) {
- return getRelative(face.getModX(), face.getModY(), face.getModZ());
+ return getRelative(face, 1);
+ }
+
+ public Block getRelative(BlockFace face, int distance) {
+ return getRelative(face.getModX() * distance, face.getModY() * distance, face.getModZ() * distance);
}
/**
@@ -418,4 +423,9 @@ public class CraftBlock implements Block {
public boolean isLiquid() {
return (getType() == Material.WATER) || (getType() == Material.STATIONARY_WATER) || (getType() == Material.LAVA) || (getType() == Material.STATIONARY_LAVA);
}
+
+ public PistonMoveReaction getPistonMoveReaction() {
+ return PistonMoveReaction.getById(net.minecraft.server.Block.byId[this.getTypeId()].material.j());
+
+ }
}