mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-03-04 09:11:28 +01:00
Fixed wings of icarus sometimes reporting a charge of -1
This commit is contained in:
parent
811e860a45
commit
4c6e7e79c7
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ public interface ChargeableItem {
|
|||
}
|
||||
|
||||
static float getEnergy(ItemStack stack) {
|
||||
return stack.hasNbt() && stack.getNbt().contains("energy") ? stack.getNbt().getFloat("energy") : getDefaultCharge(stack);
|
||||
return stack.hasNbt() && stack.getNbt().contains("energy") ? Math.max(0, stack.getNbt().getFloat("energy")) : getDefaultCharge(stack);
|
||||
}
|
||||
|
||||
static ItemStack setEnergy(ItemStack stack, float energy) {
|
||||
|
|
Loading…
Add table
Reference in a new issue