mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-23 09:37:35 +01:00
Fix block breaker on old versions not picking up the entity held item
This commit is contained in:
parent
849561337b
commit
a64ad43d11
@ -21,7 +21,8 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(EnumItemSlot.MAINHAND) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(EnumItemSlot.MAINHAND)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,8 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(EnumItemSlot.MAINHAND) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(EnumItemSlot.MAINHAND)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,8 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(EnumItemSlot.MAINHAND) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(EnumItemSlot.MAINHAND)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,8 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(EnumItemSlot.MAINHAND) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(EnumItemSlot.MAINHAND)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,7 +22,8 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(EnumItemSlot.MAINHAND) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(EnumItemSlot.MAINHAND)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,7 +22,8 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(EnumItemSlot.MAINHAND) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(EnumItemSlot.MAINHAND)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,7 +22,8 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private net.minecraft.server.v1_16_R3.ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(EnumItemSlot.MAINHAND) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(EnumItemSlot.MAINHAND)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,7 +20,7 @@ public class CitizensBlockBreaker extends AbstractBlockBreaker {
|
||||
|
||||
private ItemStack getCurrentItem() {
|
||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item())
|
||||
: entity instanceof EntityLiving ? ((EntityLiving) entity).getEquipment(0) : null;
|
||||
: getHandle() instanceof EntityLiving ? ((EntityLiving) getHandle()).getEquipment(0) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user