3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 13:00:06 +01:00

SPIGOT-1622: Add drop chance methods for off hand.

Dieser Commit ist enthalten in:
md_5 2016-03-02 17:03:20 +11:00
Ursprung 912dfae454
Commit b0411e8799
2 geänderte Dateien mit 46 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -113,14 +113,36 @@ public class CraftEntityEquipment implements EntityEquipment {
return entity; return entity;
} }
@Override
public float getItemInHandDropChance() { public float getItemInHandDropChance() {
return getItemInMainHandDropChance();
}
@Override
public void setItemInHandDropChance(float chance) {
setItemInMainHandDropChance(chance);
}
@Override
public float getItemInMainHandDropChance() {
return getDropChance(EnumItemSlot.MAINHAND); return getDropChance(EnumItemSlot.MAINHAND);
} }
public void setItemInHandDropChance(float chance) { @Override
public void setItemInMainHandDropChance(float chance) {
setDropChance(EnumItemSlot.MAINHAND, 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() { public float getHelmetDropChance() {
return getDropChance(EnumItemSlot.HEAD); return getDropChance(EnumItemSlot.HEAD);
} }

Datei anzeigen

@ -191,11 +191,33 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
return (HumanEntity) inventory.getOwner(); return (HumanEntity) inventory.getOwner();
} }
@Override
public float getItemInHandDropChance() { public float getItemInHandDropChance() {
return getItemInMainHandDropChance();
}
@Override
public void setItemInHandDropChance(float chance) {
setItemInMainHandDropChance(chance);
}
@Override
public float getItemInMainHandDropChance() {
return 1; 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(); throw new UnsupportedOperationException();
} }