1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Fixed compatibility

This commit is contained in:
TheBusyBiscuit 2020-10-30 19:58:31 +01:00
parent a3fb6c044b
commit 24e344e219
2 changed files with 7 additions and 7 deletions

View File

@ -223,22 +223,22 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock,
public void register(@Nonnull SlimefunAddon addon) { public void register(@Nonnull SlimefunAddon addon) {
this.addon = addon; this.addon = addon;
if (energyCapacity <= 0) { if (getCapacity() <= 0) {
warn("The capacity has not been configured correctly. The Item was disabled."); warn("The capacity has not been configured correctly. The Item was disabled.");
warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyCapacity(...)' before registering!"); warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyCapacity(...)' before registering!");
} }
if (energyConsumedPerTick <= 0) { if (getEnergyConsumption() <= 0) {
warn("The energy consumption has not been configured correctly. The Item was disabled."); warn("The energy consumption has not been configured correctly. The Item was disabled.");
warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyConsumption(...)' before registering!"); warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyConsumption(...)' before registering!");
} }
if (processingSpeed <= 0) { if (getSpeed() <= 0) {
warn("The processing speed has not been configured correctly. The Item was disabled."); warn("The processing speed has not been configured correctly. The Item was disabled.");
warn("Make sure to call '" + getClass().getSimpleName() + "#setProcessingSpeed(...)' before registering!"); warn("Make sure to call '" + getClass().getSimpleName() + "#setProcessingSpeed(...)' before registering!");
} }
if (energyCapacity > 0 && energyConsumedPerTick > 0 && processingSpeed > 0) { if (getCapacity() > 0 && getEnergyConsumption() > 0 && getSpeed() > 0) {
super.register(addon); super.register(addon);
} }
} }

View File

@ -277,17 +277,17 @@ public abstract class AGenerator extends AbstractEnergyProvider {
public void register(@Nonnull SlimefunAddon addon) { public void register(@Nonnull SlimefunAddon addon) {
this.addon = addon; this.addon = addon;
if (energyCapacity < 0) { if (getCapacity() < 0) {
warn("The capacity has not been configured correctly. The Item was disabled."); warn("The capacity has not been configured correctly. The Item was disabled.");
warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyCapacity(...)' before registering!"); warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyCapacity(...)' before registering!");
} }
if (energyProducedPerTick <= 0) { if (getEnergyProduction() <= 0) {
warn("The energy consumption has not been configured correctly. The Item was disabled."); warn("The energy consumption has not been configured correctly. The Item was disabled.");
warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyProduction(...)' before registering!"); warn("Make sure to call '" + getClass().getSimpleName() + "#setEnergyProduction(...)' before registering!");
} }
if (energyCapacity >= 0 && energyProducedPerTick > 0) { if (getCapacity() >= 0 && getEnergyProduction() > 0) {
super.register(addon); super.register(addon);
} }
} }