summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/DiamondMover
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-13 01:18:41 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-13 01:18:41 +0200
commitf1491ad1d1df3e0b4d22af8329c95106e794ba01 (patch)
tree7017b01ca42b937ed1597f0b0f206f8f949010a7 /MCServer/Plugins/DiamondMover
parentMerge pull request #1154 from mc-server/trappedchests (diff)
downloadcuberite-f1491ad1d1df3e0b4d22af8329c95106e794ba01.tar
cuberite-f1491ad1d1df3e0b4d22af8329c95106e794ba01.tar.gz
cuberite-f1491ad1d1df3e0b4d22af8329c95106e794ba01.tar.bz2
cuberite-f1491ad1d1df3e0b4d22af8329c95106e794ba01.tar.lz
cuberite-f1491ad1d1df3e0b4d22af8329c95106e794ba01.tar.xz
cuberite-f1491ad1d1df3e0b4d22af8329c95106e794ba01.tar.zst
cuberite-f1491ad1d1df3e0b4d22af8329c95106e794ba01.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/DiamondMover/DiamondMover.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/MCServer/Plugins/DiamondMover/DiamondMover.lua b/MCServer/Plugins/DiamondMover/DiamondMover.lua
index 0fdd32250..d3e70acfc 100644
--- a/MCServer/Plugins/DiamondMover/DiamondMover.lua
+++ b/MCServer/Plugins/DiamondMover/DiamondMover.lua
@@ -22,6 +22,8 @@ function Initialize(Plugin)
Plugin:SetVersion(1);
cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USED_ITEM, OnPlayerUsedItem);
+
+ LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion());
return true;
end
@@ -36,8 +38,8 @@ function OnPlayerUsedItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, Cu
return false;
end;
- if (Player:HasPermission("diamondmover.move") == false) then
- return true;
+ if (not Player:HasPermission("diamondmover.move")) then
+ return false;
end;
-- Rclk with a diamond to push in the direction the player is facing
@@ -56,7 +58,7 @@ function OnPlayerUsedItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, Cu
if (PlayerPitch > 70) then -- looking down
BlockY = BlockY - 1;
else
- local PlayerRot = Player:GetRotation() + 180; -- Convert [-180, 180] into [0, 360] for simpler conditions
+ local PlayerRot = Player:GetYaw() + 180; -- Convert [-180, 180] into [0, 360] for simpler conditions
if ((PlayerRot < 45) or (PlayerRot > 315)) then
BlockZ = BlockZ - 1;
else