mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Fixed compatibility
This commit is contained in:
parent
a3fb6c044b
commit
24e344e219
@ -223,22 +223,22 @@ public abstract class AContainer extends SlimefunItem implements InventoryBlock,
|
||||
public void register(@Nonnull SlimefunAddon addon) {
|
||||
this.addon = addon;
|
||||
|
||||
if (energyCapacity <= 0) {
|
||||
if (getCapacity() <= 0) {
|
||||
warn("The capacity has not been configured correctly. The Item was disabled.");
|
||||
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("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("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);
|
||||
}
|
||||
}
|
||||
|
@ -277,17 +277,17 @@ public abstract class AGenerator extends AbstractEnergyProvider {
|
||||
public void register(@Nonnull SlimefunAddon addon) {
|
||||
this.addon = addon;
|
||||
|
||||
if (energyCapacity < 0) {
|
||||
if (getCapacity() < 0) {
|
||||
warn("The capacity has not been configured correctly. The Item was disabled.");
|
||||
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("Make sure to call '" + getClass().getSimpleName() + "#setEnergyProduction(...)' before registering!");
|
||||
}
|
||||
|
||||
if (energyCapacity >= 0 && energyProducedPerTick > 0) {
|
||||
if (getCapacity() >= 0 && getEnergyProduction() > 0) {
|
||||
super.register(addon);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user