Created
April 18, 2011 19:42
-
-
Save d3xtro/926019 to your computer and use it in GitHub Desktop.
This file contains 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
@Override | |
public final void onPlayerInteract(PlayerInteractEvent event) { | |
//simulate lag | |
try { Thread.sleep(500); } catch (Exception e) {} | |
final Location loc = event.getPlayer().getLocation(); | |
switch (event.getAction()) { | |
case RIGHT_CLICK_AIR: | |
plugin.log("PlayerListener.onPlayerInteract(" + event.getAction() + ", " + event.isBlockInHand() + ", " + event.hasBlock() + ")"); | |
/* | |
if (placedBlockOnAir) { | |
event.getPlayer().sendMessage("If you lag jump you may look like a flyer and be banned."); | |
loc.setY(loc.getWorld().getHighestBlockYAt(loc)); | |
event.getPlayer().teleport(loc); | |
} | |
*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment