public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) { boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion(); try { Block block = blockStateIn.getBlock(); if (Config.isTreesSmart() && blockStateIn.getBlock() instanceof BlockLeavesBase) { modelIn = SmartLeaves.getLeavesModel(modelIn); } return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated"); CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn); crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag)); throw new ReportedException(crashreport); } }
private void init () { registerCompostMaterial(new ItemStack(Blocks.melon_block), defaultMaterial); registerCompostMaterial(new ItemStack(Blocks.pumpkin), defaultMaterial); registerCompostMaterial(new ItemStack(Blocks.hay_block), defaultMaterial); registerCompostMaterial(new ItemStack(Items.string), new StandardCompostMaterial(100, 0.0625f)); registerCompostMaterial(new ItemStack(Items.wheat), new StandardCompostMaterial(100, 0.125f)); registerCompostMaterial(new ItemStack(Items.reeds), new StandardCompostMaterial(150, 0.125f)); registerCompostMaterial(new ItemStack(Items.feather), new StandardCompostMaterial(50, 0.0625f)); registerCompostMaterial(new ItemStack(Items.rotten_flesh), new StandardCompostMaterial(150, 0.125f)); registerCompostMaterial(new ItemStack(Items.leather), new StandardCompostMaterial(150, 0.125f)); registerCompostMaterial("treeWood", new StandardCompostMaterial(300, 0.25f)); registerCompostMaterial("logWood", new StandardCompostMaterial(300, 0.25f)); registerCompostMaterial("treeLeaves", defaultMaterial); registerCompostMaterial("treeSapling", defaultMaterial); registerCompostMaterial("stickWood", defaultMaterial); registerCompostMaterial(IPlantable.class, defaultMaterial); registerCompostMaterial(IGrowable.class, defaultMaterial); registerCompostMaterial(BlockLeavesBase.class, defaultMaterial); registerCompostMaterial(BlockVine.class, defaultMaterial); registerCompostMaterial(ItemFood.class, defaultMaterial); }
private boolean isNeighborHardConnectionY (IBlockAccess world, int x, int y, int z, Block block, ForgeDirection side) { if (isNeighborHardConnection(world, x, y, z, block, side)) return true; return block instanceof BlockLeavesBase || block == ModBlocks.thinLogFence; }
private boolean isNeighborHardConnectionY (Block block) { if (isNeighborHardConnection(block)) return true; return block instanceof BlockLeavesBase || block == ModBlocks.thinLogFence; }
public boolean isBlockValid(Block block) { return block instanceof BlockLog || block instanceof BlockLeavesBase; }