This commit is contained in:
MrBretzel 2015-10-22 13:34:11 +02:00
parent adb340feec
commit 94b0123a3b
2 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,6 @@
#Sat Jun 06 13:39:31 BST 2015
#Thu Oct 22 04:43:39 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

View file

@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import org.apache.commons.lang3.StringUtils;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.lib.Functions;
@ -15,15 +16,15 @@ public class TileIDSU extends TilePowerAcceptor {
@Override
public double getEnergy() {
if(ownerUdid == null && !this.ownerUdid.isEmpty()){
return 0;
if(ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
return 0.0;
}
return IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower;
}
@Override
public void setEnergy(double energy) {
if(ownerUdid == null && !this.ownerUdid.isEmpty()){
if(ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
return;
}
IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower = energy;
@ -98,7 +99,7 @@ public class TileIDSU extends TilePowerAcceptor {
public void writeToNBT(NBTTagCompound nbttagcompound) {
super.writeToNBT(nbttagcompound);
if(this.ownerUdid == null && !this.ownerUdid.isEmpty()){
if(ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
return;
}
nbttagcompound.setString("ownerUdid", this.ownerUdid);