diff --git a/build.gradle b/build.gradle index ba2d6ea5..01ac13ca 100755 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ apply plugin: 'forge' // adds the forge dependency apply plugin: 'maven' // for uploading to a maven repo apply plugin: 'checkstyle' -version = "6.3.2" +version = "6.3.3" group= "com.mod-buildcraft" archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] diff --git a/buildcraft_resources/changelog/6.3.3 b/buildcraft_resources/changelog/6.3.3 new file mode 100644 index 00000000..64aa8cbc --- /dev/null +++ b/buildcraft_resources/changelog/6.3.3 @@ -0,0 +1,4 @@ +Bugfixes: +[#2407] Crash with blocks NPEing on getSubBlocks (asie) +Crash with null-block facades and/or pipe plugs (asie) +Removed facade debug code (asie) diff --git a/buildcraft_resources/versions.txt b/buildcraft_resources/versions.txt index 8cf033ee..9bf3fc34 100755 --- a/buildcraft_resources/versions.txt +++ b/buildcraft_resources/versions.txt @@ -1,3 +1,3 @@ 1.6.4:BuildCraft:4.2.2 1.7.2:BuildCraft:6.0.16 -1.7.10:BuildCraft:6.3.2 +1.7.10:BuildCraft:6.3.3 diff --git a/common/buildcraft/transport/ItemFacade.java b/common/buildcraft/transport/ItemFacade.java index f044bb8d..8ed0344a 100644 --- a/common/buildcraft/transport/ItemFacade.java +++ b/common/buildcraft/transport/ItemFacade.java @@ -242,14 +242,18 @@ public class ItemFacade extends ItemBuildCraft implements IFacadeItem, IPipePlug private void registerValidFacades(Block block, Item item) { ArrayList stacks = new ArrayList(16); - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { - for (CreativeTabs ct : item.getCreativeTabs()) { - block.getSubBlocks(item, ct, stacks); - } - } else { - for (int i = 0; i < 16; i++) { - stacks.add(new ItemStack(item, 1, i)); + try { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { + for (CreativeTabs ct : item.getCreativeTabs()) { + block.getSubBlocks(item, ct, stacks); + } + } else { + for (int i = 0; i < 16; i++) { + stacks.add(new ItemStack(item, 1, i)); + } } + } catch (Exception e) { + e.printStackTrace(); } for (ItemStack stack : stacks) { try { diff --git a/common/buildcraft/transport/render/FacadeBlockAccess.java b/common/buildcraft/transport/render/FacadeBlockAccess.java index 3e43a67b..c205d6a5 100644 --- a/common/buildcraft/transport/render/FacadeBlockAccess.java +++ b/common/buildcraft/transport/render/FacadeBlockAccess.java @@ -22,12 +22,12 @@ public class FacadeBlockAccess implements IBlockAccess { @Override public Block getBlock(int x, int y, int z) { - System.out.println("Querying block at " + x + ", " + y + ", " + z); + //System.out.println("Querying block at " + x + ", " + y + ", " + z); TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TileGenericPipe) { PipePluggable p = ((TileGenericPipe) tile).getPipePluggable(side); if (p instanceof FacadePluggable) { - System.out.println("Found facade"); + //System.out.println("Found facade"); return ((FacadePluggable) p).getRenderingBlock(); } } @@ -46,12 +46,12 @@ public class FacadeBlockAccess implements IBlockAccess { @Override public int getBlockMetadata(int x, int y, int z) { - System.out.println("Querying block metadata at " + x + ", " + y + ", " + z); + //System.out.println("Querying block metadata at " + x + ", " + y + ", " + z); TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TileGenericPipe) { PipePluggable p = ((TileGenericPipe) tile).getPipePluggable(side); if (p instanceof FacadePluggable) { - System.out.println("Found facade " + ((FacadePluggable) p).getRenderingMeta()); + //System.out.println("Found facade " + ((FacadePluggable) p).getRenderingMeta()); return ((FacadePluggable) p).getRenderingMeta(); } } diff --git a/common/buildcraft/transport/render/FacadeItemRenderer.java b/common/buildcraft/transport/render/FacadeItemRenderer.java index 5e3ff3fe..a60abf1a 100644 --- a/common/buildcraft/transport/render/FacadeItemRenderer.java +++ b/common/buildcraft/transport/render/FacadeItemRenderer.java @@ -158,13 +158,16 @@ public class FacadeItemRenderer implements IItemRenderer { GL11.glPushMatrix(); // Enable glBlending for transparency - if (block != null && block.getRenderBlockPass() > 0) { - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); + if (block != null) { + if (block.getRenderBlockPass() > 0) { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + RenderUtils.setGLColorFromInt(block.getRenderColor(decodedMeta)); } - RenderUtils.setGLColorFromInt(block.getRenderColor(decodedMeta)); if (hollow) { GL11.glTranslatef(translateX, translateY, translateZ); drawHollowCube(tessellator, render, block, decodedMeta); diff --git a/common/buildcraft/transport/render/FakeBlock.java b/common/buildcraft/transport/render/FakeBlock.java index 50001652..99568ba9 100644 --- a/common/buildcraft/transport/render/FakeBlock.java +++ b/common/buildcraft/transport/render/FakeBlock.java @@ -21,7 +21,6 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.api.core.render.ITextureStates; import buildcraft.transport.BlockGenericPipe; - /* * This is fake block to render pluggables and pipes without altering host state * May prove useful if we will make API for roboports, pipes, plugs and facades