Fix crash with lamp

This commit is contained in:
drcrazy 2019-09-16 12:53:09 +03:00
parent 7e05b0da12
commit 666e8f03b2
3 changed files with 4 additions and 3 deletions

View file

@ -37,7 +37,6 @@ import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.StringUtils;
import team.reborn.energy.Energy;
import team.reborn.energy.EnergyTier;
import techreborn.blocks.generator.BlockSolarPanel;
import techreborn.init.TRBlockEntities;

View file

@ -71,6 +71,10 @@ public class LampBlockEntity extends PowerAcceptorBlockEntity
@Override
public boolean canAcceptEnergy(final Direction direction) {
if (world == null) {
// Blame tooltip for this
return true;
}
Direction me = BlockLamp.getFacing(world.getBlockState(pos)).getOpposite();
return direction == me;
}

View file

@ -49,8 +49,6 @@ import techreborn.events.TRRecipeHandler;
import techreborn.init.ModSounds;
import techreborn.init.TRContent;
import techreborn.items.tool.ItemTreeTap;
import techreborn.items.tool.basic.ItemElectricTreetap;
import java.util.Random;
/**