mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
Fixed a bug with the game sometimes crashing when looking at a block with the manual in hand
This should actually fix it.
This commit is contained in:
parent
41a78d0399
commit
a315acc50d
2 changed files with 3 additions and 7 deletions
|
@ -136,9 +136,7 @@ public class ClientEvents{
|
|||
if(stack != null){
|
||||
if(stack.getItem() instanceof IHudDisplay){
|
||||
profiler.startSection("ItemHudDisplay");
|
||||
if(minecraft.theWorld != null){
|
||||
((IHudDisplay)stack.getItem()).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution());
|
||||
}
|
||||
((IHudDisplay)stack.getItem()).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution());
|
||||
profiler.endSection();
|
||||
}
|
||||
}
|
||||
|
@ -149,9 +147,7 @@ public class ClientEvents{
|
|||
|
||||
if(blockHit instanceof IHudDisplay){
|
||||
profiler.startSection("BlockHudDisplay");
|
||||
if(minecraft.theWorld != null){
|
||||
((IHudDisplay)blockHit).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution());
|
||||
}
|
||||
((IHudDisplay)blockHit).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution());
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
|
|||
|
||||
@Override
|
||||
public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){
|
||||
if(posHit != null){
|
||||
if(posHit != null && posHit.getBlockPos() != null){
|
||||
IBlockState state = minecraft.theWorld.getBlockState(posHit.getBlockPos());
|
||||
Block block = state.getBlock();
|
||||
if(block != null && !block.isAir(minecraft.theWorld.getBlockState(posHit.getBlockPos()), minecraft.theWorld, posHit.getBlockPos())){
|
||||
|
|
Loading…
Reference in a new issue