summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-22 08:52:17 +1000
committermd_5 <git@md-5.net>2018-08-22 08:52:17 +1000
commit3418f8d7a1597cd2aabad7e43ba39ab5151d3c66 (patch)
treeaf165fad35ae2b8fb121e5d475c9a4e59def6ff7 /src
parentec86574b9b648dc5e908723dfadf7c683cfc04b7 (diff)
downloadcraftbukkit-3418f8d7a1597cd2aabad7e43ba39ab5151d3c66.tar
craftbukkit-3418f8d7a1597cd2aabad7e43ba39ab5151d3c66.tar.gz
craftbukkit-3418f8d7a1597cd2aabad7e43ba39ab5151d3c66.tar.lz
craftbukkit-3418f8d7a1597cd2aabad7e43ba39ab5151d3c66.tar.xz
craftbukkit-3418f8d7a1597cd2aabad7e43ba39ab5151d3c66.zip
SPIGOT-4298: Block command sender returns wrong block
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java
index 3ad7dfdb..701a57e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java
@@ -1,13 +1,12 @@
package org.bukkit.craftbukkit.command;
-import net.minecraft.server.CommandBlockListenerAbstract;
import net.minecraft.server.CommandListenerWrapper;
-import net.minecraft.server.ICommandListener;
import net.minecraft.server.IChatBaseComponent;
-import net.minecraft.server.Vec3D;
+import net.minecraft.server.TileEntity;
import org.bukkit.block.Block;
import org.bukkit.command.BlockCommandSender;
+import org.bukkit.craftbukkit.block.CraftBlock;
import org.bukkit.craftbukkit.util.CraftChatMessage;
/**
@@ -15,15 +14,16 @@ import org.bukkit.craftbukkit.util.CraftChatMessage;
*/
public class CraftBlockCommandSender extends ServerCommandSender implements BlockCommandSender {
private final CommandListenerWrapper block;
+ private final TileEntity tile;
- public CraftBlockCommandSender(CommandListenerWrapper commandBlockListenerAbstract) {
+ public CraftBlockCommandSender(CommandListenerWrapper commandBlockListenerAbstract, TileEntity tile) {
super();
this.block = commandBlockListenerAbstract;
+ this.tile = tile;
}
public Block getBlock() {
- Vec3D pos = block.getPosition();
- return block.getWorld().getWorld().getBlockAt((int) pos.x, (int) pos.y, (int) pos.z);
+ return CraftBlock.at(tile.getWorld(), tile.getPosition());
}
public void sendMessage(String message) {