Created
July 6, 2013 02:28
-
-
Save fpigerre/5938387 to your computer and use it in GitHub Desktop.
BlockBreakListener for Ladders MiniGame
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
package io.github.psgs.ladders.listeners; | |
import org.bukkit.block.Block; | |
import org.bukkit.entity.Player; | |
import org.bukkit.event.Listener; | |
import org.bukkit.event.EventHandler; | |
import org.bukkit.event.EventPriority; | |
import org.bukkit.event.block.BlockBreakEvent; | |
import io.github.psgs.ladders.handlers.TeamHandler; | |
public class BlockBreakListener extends TeamHandler implements Listener { | |
@EventHandler(priority = EventPriority.NORMAL) | |
public void onBreak(BlockBreakEvent event) { | |
final Block block = event.getBlock(); | |
final Player p = event.getPlayer(); | |
checkJoin(p); | |
if (inGame == true) { | |
if (block.getType() == null) { | |
System.out | |
.println("[Ladders] An error has occured! Please notify the plugin developers of this error!"); | |
System.out | |
.println("Error at: io.github.psgs.ladders.listeners.BlockBreakListener"); | |
} else { | |
if (block.getTypeId() == 57) { | |
// Win Game | |
// Execute WinGame event | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment