修复beastCharge调用错误
This commit is contained in:
parent
fb18af97dd
commit
d42e79fd91
1 changed files with 5 additions and 7 deletions
|
@ -348,12 +348,10 @@ public class DPSGeneratorEntity extends LivingEntity implements GeoEntity {
|
|||
|
||||
public void beastCharge() {
|
||||
this.entityData.set(LEVEL, 7);
|
||||
this.getEnergy().ifPresent(cap -> {
|
||||
if (cap instanceof SyncedEntityEnergyStorage storage) {
|
||||
if (this.getCapability(Capabilities.EnergyStorage.ENTITY, null) instanceof SyncedEntityEnergyStorage storage) {
|
||||
storage.setCapacity(this.getMaxEnergy());
|
||||
storage.setMaxExtract(this.getMaxTransfer());
|
||||
storage.setEnergy(this.getMaxEnergy());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue