mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Added null checks to BlockBreak & BlockDamage events to help with mod
compatibility.
This commit is contained in:
parent
bebcc40987
commit
946b5bb006
@ -153,18 +153,23 @@ public class BlockListener implements Listener {
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockBreak(BlockBreakEvent event) {
|
||||
if (event instanceof FakeBlockBreakEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
|
||||
if (PP == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Block block = event.getBlock();
|
||||
ItemStack inHand = player.getItemInHand();
|
||||
|
||||
Config configInstance = Config.getInstance();
|
||||
Permissions permInstance = Permissions.getInstance();
|
||||
|
||||
if (event instanceof FakeBlockBreakEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* HERBALISM */
|
||||
if (BlockChecks.canBeGreenTerra(block)) {
|
||||
/* Green Terra */
|
||||
@ -264,6 +269,11 @@ public class BlockListener implements Listener {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
|
||||
if (PP == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack inHand = player.getItemInHand();
|
||||
Block block = event.getBlock();
|
||||
Material material = block.getType();
|
||||
|
Loading…
Reference in New Issue
Block a user