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

Update src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/EnergyNetComponent.java

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>
This commit is contained in:
LinoxGH 2020-10-08 16:04:01 +03:00 committed by GitHub
parent 40caa2d574
commit 09a40d036e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,11 @@ public interface EnergyNetComponent extends ItemAttribute {
*/
default int getCharge(@Nonnull Location l) {
Validate.notNull(l, "Location was null!");
if (!isChargeable()) return 0;
// Emergency fallback, this cannot hold a charge, so we'll just return zero
if (!isChargeable()) {
return 0;
}
String charge = BlockStorage.getLocationInfo(l, "energy-charge");