mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 12:41:50 +01:00
SPIGOT-1622: Add drop chance methods for off hand.
This commit is contained in:
parent
912dfae454
commit
b0411e8799
2 changed files with 46 additions and 2 deletions
|
@ -113,14 +113,36 @@ public class CraftEntityEquipment implements EntityEquipment {
|
|||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getItemInHandDropChance() {
|
||||
return getItemInMainHandDropChance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInHandDropChance(float chance) {
|
||||
setItemInMainHandDropChance(chance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getItemInMainHandDropChance() {
|
||||
return getDropChance(EnumItemSlot.MAINHAND);
|
||||
}
|
||||
|
||||
public void setItemInHandDropChance(float chance) {
|
||||
@Override
|
||||
public void setItemInMainHandDropChance(float chance) {
|
||||
setDropChance(EnumItemSlot.MAINHAND, chance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getItemInOffHandDropChance() {
|
||||
return getDropChance(EnumItemSlot.OFFHAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInOffHandDropChance(float chance) {
|
||||
setDropChance(EnumItemSlot.OFFHAND, chance);
|
||||
}
|
||||
|
||||
public float getHelmetDropChance() {
|
||||
return getDropChance(EnumItemSlot.HEAD);
|
||||
}
|
||||
|
|
|
@ -191,11 +191,33 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
|||
return (HumanEntity) inventory.getOwner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getItemInHandDropChance() {
|
||||
return getItemInMainHandDropChance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInHandDropChance(float chance) {
|
||||
setItemInMainHandDropChance(chance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getItemInMainHandDropChance() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public void setItemInHandDropChance(float chance) {
|
||||
@Override
|
||||
public void setItemInMainHandDropChance(float chance) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getItemInOffHandDropChance() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInOffHandDropChance(float chance) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue