diff options
author | Mattes D <github@xoft.cz> | 2014-07-13 11:07:21 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-07-13 11:07:21 +0200 |
commit | 826ed2ddab73e1f2a49e9ba4601b9eb82032ad43 (patch) | |
tree | b1257740dee8b42c8a051a9a19dd8be029bbaa93 /MCServer/Plugins | |
parent | Merge pull request #1133 from Howaner/Sheep (diff) | |
parent | Fixed diamond mover plugin (diff) | |
download | cuberite-826ed2ddab73e1f2a49e9ba4601b9eb82032ad43.tar cuberite-826ed2ddab73e1f2a49e9ba4601b9eb82032ad43.tar.gz cuberite-826ed2ddab73e1f2a49e9ba4601b9eb82032ad43.tar.bz2 cuberite-826ed2ddab73e1f2a49e9ba4601b9eb82032ad43.tar.lz cuberite-826ed2ddab73e1f2a49e9ba4601b9eb82032ad43.tar.xz cuberite-826ed2ddab73e1f2a49e9ba4601b9eb82032ad43.tar.zst cuberite-826ed2ddab73e1f2a49e9ba4601b9eb82032ad43.zip |
Diffstat (limited to 'MCServer/Plugins')
-rw-r--r-- | MCServer/Plugins/DiamondMover/DiamondMover.lua | 8 |
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 |