Fix a crash with the laser relay

Closes #371
This commit is contained in:
Ellpeck 2016-11-18 06:40:08 +01:00
parent 3ce31d09fd
commit ee85dd3ba8

View file

@ -42,6 +42,8 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
@ -185,6 +187,7 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
} }
@Override @Override
@SideOnly(Side.CLIENT)
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){
if(posHit != null && posHit.getBlockPos() != null && minecraft.theWorld != null){ if(posHit != null && posHit.getBlockPos() != null && minecraft.theWorld != null){
TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos());