Created
January 10, 2017 00:06
-
-
Save ticklemynausea/988e163b278ba132fbecbb581be913e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var EnderPearlFix = (function() { | |
| var module = {}; | |
| module.load = function() { | |
| addUnloadHandler(module.unload); | |
| } | |
| module.unload = function() { | |
| module.playerTeleportEvent.unregister(); | |
| } | |
| module.playerTeleportEvent = events.playerTeleport(function(event, cancelEvent) { | |
| var player = event.getPlayer(); | |
| var isOperator = player.hasPermission('server.operator'); | |
| var teleportCause = event.getCause(); | |
| var playerWorld = player.getWorld(); | |
| var playerWorldName = playerWorld.getName(); | |
| var thrownLocation = event.getTo(); | |
| if ((playerWorldName == 'limbo-1') && (teleportCause == 'ENDER_PEARL') && (!isOperator)) | |
| { | |
| player.sendMessage('Estranho, parece que as Ender Pearls não funcionam nesta ilha...'); | |
| playerWorld.dropItem(thrownLocation, new Packages.org.bukkit.inventory.ItemStack(Packages.org.bukkit.Material.ENDER_PEARL)); | |
| cancelEvent(); | |
| } | |
| }); | |
| return module; | |
| })(); | |
| EnderPearlFix.load(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment