mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Because the block is null if they click air.
This commit is contained in:
parent
f42a28f34f
commit
89d2f07c03
@ -309,7 +309,6 @@ public class PlayerListener implements Listener {
|
|||||||
public void onPlayerInteractLowest(PlayerInteractEvent event) {
|
public void onPlayerInteractLowest(PlayerInteractEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
int blockID = block.getTypeId();
|
|
||||||
ItemStack heldItem = player.getItemInHand();
|
ItemStack heldItem = player.getItemInHand();
|
||||||
|
|
||||||
if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) {
|
if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) {
|
||||||
@ -320,6 +319,8 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
switch (event.getAction()) {
|
switch (event.getAction()) {
|
||||||
case RIGHT_CLICK_BLOCK:
|
case RIGHT_CLICK_BLOCK:
|
||||||
|
int blockID = block.getTypeId();
|
||||||
|
|
||||||
/* REPAIR CHECKS */
|
/* REPAIR CHECKS */
|
||||||
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
||||||
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
|
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
|
||||||
@ -355,6 +356,8 @@ public class PlayerListener implements Listener {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LEFT_CLICK_BLOCK:
|
case LEFT_CLICK_BLOCK:
|
||||||
|
blockID = block.getTypeId();
|
||||||
|
|
||||||
/* REPAIR CHECKS */
|
/* REPAIR CHECKS */
|
||||||
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
if (blockID == Repair.repairAnvilId && Permissions.skillEnabled(player, SkillType.REPAIR) && mcMMO.getRepairableManager().isRepairable(heldItem)) {
|
||||||
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
|
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
|
||||||
|
Loading…
Reference in New Issue
Block a user