diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-13 11:09:19 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-13 11:09:19 +0200 |
commit | e48d172f49e9aeb9b73b49f54e0be4af3e14b9db (patch) | |
tree | 88fbd34759f5e007c8a01acb8df9ee2b6985858e /MCServer/Plugins/DiamondMover/DiamondMover.lua | |
parent | Changed BroadcastSoundEffect function to take floating pos. (diff) | |
parent | Merge pull request #1167 from Howaner/Plugins (diff) | |
download | cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.gz cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.bz2 cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.lz cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.xz cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.zst cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.zip |
Diffstat (limited to '')
-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 |