mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Start cleaning up BlockListener.
This commit is contained in:
parent
7e91776cfb
commit
0a9e1ba42e
@ -101,25 +101,31 @@ public class BlockListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
Config configInstance = Config.getInstance();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (Misc.isNPC(player)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
Player player = event.getPlayer();
|
|
||||||
int id = block.getTypeId();
|
|
||||||
|
|
||||||
if (player.hasMetadata("NPC")) return; // Check if this player is a Citizens NPC
|
|
||||||
|
|
||||||
/* Check if the blocks placed should be monitored so they do not give out XP in the future */
|
/* Check if the blocks placed should be monitored so they do not give out XP in the future */
|
||||||
if (BlockChecks.shouldBeWatched(block)) {
|
if (BlockChecks.shouldBeWatched(block)) {
|
||||||
mcMMO.placeStore.setTrue(block);
|
mcMMO.placeStore.setTrue(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id == configInstance.getRepairAnvilId() && configInstance.getRepairAnvilMessagesEnabled()) {
|
if (Config.getInstance().getRepairAnvilMessagesEnabled()) {
|
||||||
Repair.placedAnvilCheck(player, id);
|
int id = block.getTypeId();
|
||||||
}
|
|
||||||
if (id == configInstance.getSalvageAnvilId() && configInstance.getRepairAnvilMessagesEnabled()) {
|
if (id == Config.getInstance().getRepairAnvilId()) {
|
||||||
Salvage.placedAnvilCheck(player, id);
|
Repair.placedAnvilCheck(player, id);
|
||||||
|
}
|
||||||
|
else if (id == Config.getInstance().getSalvageAnvilId()) {
|
||||||
|
Salvage.placedAnvilCheck(player, id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user