/** * process player falling based on movement packet */ public void handleFalling(double p_71122_1_, boolean p_71122_3_) { int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); int k = MathHelper.floor_double(this.posZ); BlockPos blockpos = new BlockPos(i, j, k); Block block = this.worldObj.getBlockState(blockpos).getBlock(); if (block.getMaterial() == Material.air) { Block block1 = this.worldObj.getBlockState(blockpos.down()).getBlock(); if (block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate) { blockpos = blockpos.down(); block = this.worldObj.getBlockState(blockpos).getBlock(); } } super.updateFallState(p_71122_1_, p_71122_3_, block, blockpos); }
/** * process player falling based on movement packet */ public void handleFalling(double y, boolean onGroundIn) { int i = MathHelper.floor(this.posX); int j = MathHelper.floor(this.posY - 0.20000000298023224D); int k = MathHelper.floor(this.posZ); BlockPos blockpos = new BlockPos(i, j, k); IBlockState iblockstate = this.world.getBlockState(blockpos); if (iblockstate.getMaterial() == Material.AIR) { BlockPos blockpos1 = blockpos.down(); IBlockState iblockstate1 = this.world.getBlockState(blockpos1); Block block = iblockstate1.getBlock(); if (block instanceof BlockFence || block instanceof BlockWall || block instanceof BlockFenceGate) { blockpos = blockpos1; iblockstate = iblockstate1; } } super.updateFallState(y, onGroundIn, iblockstate, blockpos); }
/** * process player falling based on movement packet */ public void handleFalling(double y, boolean onGroundIn) { int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); int k = MathHelper.floor_double(this.posZ); BlockPos blockpos = new BlockPos(i, j, k); IBlockState iblockstate = this.worldObj.getBlockState(blockpos); if (iblockstate.getBlock().isAir(iblockstate, this.worldObj, blockpos)) { BlockPos blockpos1 = blockpos.down(); IBlockState iblockstate1 = this.worldObj.getBlockState(blockpos1); Block block = iblockstate1.getBlock(); if (block instanceof BlockFence || block instanceof BlockWall || block instanceof BlockFenceGate) { blockpos = blockpos1; iblockstate = iblockstate1; } } super.updateFallState(y, onGroundIn, iblockstate, blockpos); }
protected boolean canConnectTo(IBlockAccess blockAccess, int x, int y, int z) { Block block = blockAccess.getBlock(x, y, z); if (block == null) { return false; } else if (block.getMaterial().isOpaque() && block.renderAsNormalBlock()) { // We'll connect against full 1x1x1 blocks. return true; } else if (block instanceof FenceBlock || block instanceof BlockFence || block instanceof BlockPane || block instanceof BlockWall) { // Of course we connect to our own. // And to vanilla fences, iron bars, glass panes and walls. return true; } return false; }
private PathNodeType getPathNodeTypeRaw(IBlockAccess p_189553_1_, int p_189553_2_, int p_189553_3_, int p_189553_4_) { BlockPos blockpos = new BlockPos(p_189553_2_, p_189553_3_, p_189553_4_); IBlockState iblockstate = p_189553_1_.getBlockState(blockpos); Block block = iblockstate.getBlock(); Material material = iblockstate.getMaterial(); return material == Material.AIR ? PathNodeType.OPEN : (block != Blocks.TRAPDOOR && block != Blocks.IRON_TRAPDOOR && block != Blocks.WATERLILY ? (block == Blocks.FIRE ? PathNodeType.DAMAGE_FIRE : (block == Blocks.CACTUS ? PathNodeType.DAMAGE_CACTUS : (block instanceof BlockDoor && material == Material.WOOD && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_WOOD_CLOSED : (block instanceof BlockDoor && material == Material.IRON && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_IRON_CLOSED : (block instanceof BlockDoor && ((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_OPEN : (block instanceof BlockRailBase ? PathNodeType.RAIL : (!(block instanceof BlockFence) && !(block instanceof BlockWall) && (!(block instanceof BlockFenceGate) || ((Boolean)iblockstate.getValue(BlockFenceGate.OPEN)).booleanValue()) ? (material == Material.WATER ? PathNodeType.WATER : (material == Material.LAVA ? PathNodeType.LAVA : (block.isPassable(p_189553_1_, blockpos) ? PathNodeType.OPEN : PathNodeType.BLOCKED))) : PathNodeType.FENCE))))))) : PathNodeType.TRAPDOOR); }
private boolean isFenceish(Coord fenceLocation) { final Block block = fenceLocation.getBlock(); if (block instanceof BlockFence) return true; if (block instanceof BlockWall) return true; if (block instanceof BlockLog) return true; if (block.getMaterial() == Material.iron) return true; return false; }
private boolean isFenceish(Coord fenceLocation) { final Block block = fenceLocation.getBlock(); if (block instanceof BlockFence) return true; if (block instanceof BlockWall) return true; if (block instanceof BlockLog) return true; if (block.getMaterial() == Material.iron) { BlockPos pos = fenceLocation.toBlockPos(); if (block.isBeaconBase(worldObj, pos, pos)) { return true; } } return false; }
@Override public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock) { if (neighborBlock instanceof BlockWall) { if (world.getBlockState(pos.down()).getBlock() instanceof BlockWall) { world.setBlockToAir(pos); return; } } TileEntityWrathLamp.doAirCheck(world, pos); }
private static boolean isWallLow(int x, int y, int z, Block block, RenderBlocks renderer) { BlockWall blockWall = (BlockWall)block; IBlockAccess blockAccess = renderer.blockAccess; boolean flag = blockWall.canConnectWallTo(blockAccess, x - 1, y, z); boolean flag1 = blockWall.canConnectWallTo(blockAccess, x + 1, y, z); boolean flag2 = blockWall.canConnectWallTo(blockAccess, x, y, z - 1); boolean flag3 = blockWall.canConnectWallTo(blockAccess, x, y, z + 1); boolean flag4 = flag2 && flag3 && !flag && !flag1; boolean flag5 = !flag2 && !flag3 && flag && flag1; boolean flag6 = blockAccess.isAirBlock(x, y + 1, z); return (flag4 || flag5) && flag6; }
public boolean func_78612_b(Block p_78612_1_, int p_78612_2_, int p_78612_3_, int p_78612_4_) { int var5 = p_78612_1_.func_71857_b(); if(var5 == -1) { return false; } else { p_78612_1_.func_71902_a(this.field_78669_a, p_78612_2_, p_78612_3_, p_78612_4_); this.func_83018_a(p_78612_1_); return var5 == 0?this.func_78570_q(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 4?this.func_78621_p(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 31?this.func_78581_r(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 1?this.func_78620_l(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 2?this.func_78572_c(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 20?this.func_78598_k(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 11?this.func_78582_a((BlockFence)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 39?this.func_96445_r(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 5?this.func_78589_i(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 13?this.func_78584_s(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 9?this.func_78586_a((BlockRailBase)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 19?this.func_78603_m(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 23?this.func_78566_o(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 6?this.func_78614_n(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 3?this.func_78590_h((BlockFire)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 8?this.func_78576_j(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 7?this.func_78601_u(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 10?this.func_78565_t((BlockStairs)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 27?this.func_78618_a((BlockDragonEgg)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 32?this.func_82779_a((BlockWall)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 12?this.func_78594_e(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 29?this.func_78577_f(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 30?this.func_78619_g(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 14?this.func_78574_w(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 15?this.func_78610_x((BlockRedstoneRepeater)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 36?this.func_94176_a((BlockRedstoneLogic)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 37?this.func_94171_a((BlockComparator)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 16?this.func_78593_b(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_, false):(var5 == 17?this.func_78608_c(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_, true):(var5 == 18?this.func_78592_a((BlockPane)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 21?this.func_78580_a((BlockFenceGate)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 24?this.func_78615_a((BlockCauldron)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 33?this.func_82780_a((BlockFlowerPot)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 35?this.func_82775_a((BlockAnvil)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 25?this.func_78585_a((BlockBrewingStand)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 26?this.func_78567_v((BlockEndPortalFrame)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 28?this.func_78616_a((BlockCocoa)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 34?this.func_82778_a((BlockBeacon)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 38?this.func_94172_a((BlockHopper)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):false)))))))))))))))))))))))))))))))))))))); } }
@Override public boolean canConnectWallTo(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { Block block = par1iBlockAccess.getBlock(par2, par3, par4); if (block instanceof BlockWall) { return true; } return super.canConnectWallTo(par1iBlockAccess, par2, par3, par4); }
@Override public @Nonnull IBlockState getActualState(@Nonnull IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos) { EnumFacing.Axis enumfacing$axis = state.getValue(FACING).getAxis(); if (enumfacing$axis == EnumFacing.Axis.Z && (worldIn.getBlockState(pos.west()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.east()).getBlock() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (worldIn.getBlockState(pos.north()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.south()).getBlock() instanceof BlockWall)) { state = state.withProperty(IN_WALL, true); } return state; }
@Override public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int facing, float hitX, float hitY, float hitZ) { if (world.isRemote) { return true; } if (!item.hasTagCompound()) { return false; } if(player == null) { return false; } String entityId = item.stackTagCompound.getCompoundTag("entity").getString("id"); Entity entityToSpawn = EntityList.createEntityByName(entityId, world); Block blk = world.getBlock(x,y,z); double spawnX = x + Facing.offsetsXForSide[facing] + 0.5; double spawnY = y + Facing.offsetsYForSide[facing]; double spawnZ = z + Facing.offsetsZForSide[facing] + 0.5; if(facing == ForgeDirection.UP.ordinal() && (blk instanceof BlockFence || blk instanceof BlockWall)) { spawnY += 0.5; } if(entityToSpawn instanceof EntitySlime) { ((EntitySlime) entityToSpawn).setSlimeSize(item.stackTagCompound.getCompoundTag("entity").getInteger("slimesize")); } if(entityToSpawn instanceof EntityZombie){ if(item.stackTagCompound.getCompoundTag("entity").getBoolean("isBabyZombie")) ((EntityZombie) entityToSpawn).setChild(true); else ((EntityZombie) entityToSpawn).setChild(false); } entityToSpawn.setLocationAndAngles(spawnX, spawnY, spawnZ, world.rand.nextFloat() * 360.0F, 0); world.spawnEntityInWorld(entityToSpawn); if(entityToSpawn instanceof EntityLiving) { ((EntityLiving)entityToSpawn).playLivingSound(); ((EntityLiving)entityToSpawn).setHealth(item.stackTagCompound.getCompoundTag("entity").getFloat("health")); } Entity riddenByEntity = entityToSpawn.riddenByEntity; while(riddenByEntity != null) { riddenByEntity.setLocationAndAngles(spawnX, spawnY, spawnZ, world.rand.nextFloat() * 360.0F, 0.0F); world.spawnEntityInWorld(riddenByEntity); if(riddenByEntity instanceof EntityLiving) { ((EntityLiving)riddenByEntity).playLivingSound(); } riddenByEntity = riddenByEntity.riddenByEntity; } item.setTagCompound(null); player.setCurrentItemOrArmor(0, item); return true; }
public static int func_176170_a(IBlockAccess blockaccessIn, Entity entityIn, int x, int y, int z, int sizeX, int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors) { boolean flag = false; BlockPos blockpos = new BlockPos(entityIn); BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for (int i = x; i < x + sizeX; ++i) { for (int j = y; j < y + sizeY; ++j) { for (int k = z; k < z + sizeZ; ++k) { blockpos$mutableblockpos.func_181079_c(i, j, k); Block block = blockaccessIn.getBlockState(blockpos$mutableblockpos).getBlock(); if (block.getMaterial() != Material.air) { if (block != Blocks.trapdoor && block != Blocks.iron_trapdoor) { if (block != Blocks.flowing_water && block != Blocks.water) { if (!enterDoors && block instanceof BlockDoor && block.getMaterial() == Material.wood) { return 0; } } else { if (avoidWater) { return -1; } flag = true; } } else { flag = true; } if (entityIn.worldObj.getBlockState(blockpos$mutableblockpos).getBlock() instanceof BlockRailBase) { if (!(entityIn.worldObj.getBlockState(blockpos).getBlock() instanceof BlockRailBase) && !(entityIn.worldObj.getBlockState(blockpos.down()).getBlock() instanceof BlockRailBase)) { return -3; } } else if (!block.isPassable(blockaccessIn, blockpos$mutableblockpos) && (!breakDoors || !(block instanceof BlockDoor) || block.getMaterial() != Material.wood)) { if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof BlockWall) { return -3; } if (block == Blocks.trapdoor || block == Blocks.iron_trapdoor) { return -4; } Material material = block.getMaterial(); if (material != Material.lava) { return 0; } if (!entityIn.isInLava()) { return -2; } } } } } } return flag ? 2 : 1; }
private static boolean checkBlock(Block p_checkBlock_0_, IBlockState p_checkBlock_1_) { if (p_checkBlock_0_.isFullCube()) { return false; } else if (p_checkBlock_0_.isOpaqueCube()) { return false; } else if (p_checkBlock_0_ instanceof BlockSnow) { return false; } else if (!(p_checkBlock_0_ instanceof BlockBush) || !(p_checkBlock_0_ instanceof BlockDoublePlant) && !(p_checkBlock_0_ instanceof BlockFlower) && !(p_checkBlock_0_ instanceof BlockMushroom) && !(p_checkBlock_0_ instanceof BlockSapling) && !(p_checkBlock_0_ instanceof BlockTallGrass)) { if (!(p_checkBlock_0_ instanceof BlockFence) && !(p_checkBlock_0_ instanceof BlockFenceGate) && !(p_checkBlock_0_ instanceof BlockFlowerPot) && !(p_checkBlock_0_ instanceof BlockPane) && !(p_checkBlock_0_ instanceof BlockReed) && !(p_checkBlock_0_ instanceof BlockWall)) { if (p_checkBlock_0_ instanceof BlockRedstoneTorch && p_checkBlock_1_.getValue(BlockTorch.FACING) == EnumFacing.UP) { return true; } else { if (p_checkBlock_0_ instanceof BlockLever) { Object object = p_checkBlock_1_.getValue(BlockLever.FACING); if (object == BlockLever.EnumOrientation.UP_X || object == BlockLever.EnumOrientation.UP_Z) { return true; } } return false; } } else { return true; } } else { return true; } }
private static boolean checkBlock(Block p_checkBlock_0_, IBlockState p_checkBlock_1_) { if (p_checkBlock_1_.isFullCube()) { return false; } else if (p_checkBlock_1_.isOpaqueCube()) { return false; } else if (p_checkBlock_0_ instanceof BlockSnow) { return false; } else if (!(p_checkBlock_0_ instanceof BlockBush) || !(p_checkBlock_0_ instanceof BlockDoublePlant) && !(p_checkBlock_0_ instanceof BlockFlower) && !(p_checkBlock_0_ instanceof BlockMushroom) && !(p_checkBlock_0_ instanceof BlockSapling) && !(p_checkBlock_0_ instanceof BlockTallGrass)) { if (!(p_checkBlock_0_ instanceof BlockFence) && !(p_checkBlock_0_ instanceof BlockFenceGate) && !(p_checkBlock_0_ instanceof BlockFlowerPot) && !(p_checkBlock_0_ instanceof BlockPane) && !(p_checkBlock_0_ instanceof BlockReed) && !(p_checkBlock_0_ instanceof BlockWall)) { if (p_checkBlock_0_ instanceof BlockRedstoneTorch && p_checkBlock_1_.getValue(BlockTorch.FACING) == EnumFacing.UP) { return true; } else { if (p_checkBlock_0_ instanceof BlockLever) { Object object = p_checkBlock_1_.getValue(BlockLever.FACING); if (object == BlockLever.EnumOrientation.UP_X || object == BlockLever.EnumOrientation.UP_Z) { return true; } } return false; } } else { return true; } } else { return true; } }
public static void addWall() { ShiftedSnowApi.addSimpleClassMapping(BlockWall.class, EnumSnowType.OVER_WALL); }
private static EnumFacing getVineFacing(StructureConfiguration configuration, Block foundBlock, BuildBlock block, EnumFacing assumedNorth) { EnumFacing vineFacing = EnumFacing.UP; // Vines have a special property for it's "facing" if (foundBlock instanceof BlockVine || foundBlock instanceof BlockWall) { if (block.getProperty("east").getValue().equals("true")) { vineFacing = EnumFacing.EAST; } else if (block.getProperty("west").getValue().equals("true")) { vineFacing = EnumFacing.WEST; } else if (block.getProperty("south").getValue().equals("true")) { vineFacing = EnumFacing.SOUTH; } else if (block.getProperty("north").getValue().equals("true")) { vineFacing = EnumFacing.NORTH; } if (vineFacing != EnumFacing.UP) { if (configuration.houseFacing.rotateY() == assumedNorth) { vineFacing = vineFacing.rotateY(); } else if (configuration.houseFacing.getOpposite() == assumedNorth) { } else if (configuration.houseFacing.rotateYCCW() == assumedNorth) { vineFacing = vineFacing.rotateYCCW(); } else { vineFacing = vineFacing.getOpposite(); } } } return vineFacing; }
private static boolean isWall(Block block) { return block instanceof BlockWall; }
private static boolean isFenceOrWall(Block block) { return TFCBlocks.isBlockAFence(block) || block instanceof BlockWall; }
public boolean renderBlockWall(BlockWall p_147807_1_, int p_147807_2_, int p_147807_3_, int p_147807_4_) { boolean var5 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_ - 1, p_147807_3_, p_147807_4_); boolean var6 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_ + 1, p_147807_3_, p_147807_4_); boolean var7 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ - 1); boolean var8 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ + 1); boolean var9 = var7 && var8 && !var5 && !var6; boolean var10 = !var7 && !var8 && var5 && var6; boolean var11 = this.blockAccess.isAirBlock(p_147807_2_, p_147807_3_ + 1, p_147807_4_); if ((var9 || var10) && var11) { if (var9) { this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } else { this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } } else { this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); if (var5) { this.setRenderBounds(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } if (var6) { this.setRenderBounds(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } if (var7) { this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } if (var8) { this.setRenderBounds(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } } p_147807_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_); if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147807_2_, p_147807_3_, p_147807_4_)) { this.renderSnow(p_147807_2_, p_147807_3_, p_147807_4_, Blocks.snow_layer.getBlockBoundsMaxY()); } return true; }
@Override public boolean canConnectWallTo(IBlockAccess world, int x, int y, int z) { Block neighbour = world.getBlock(x, y, z); return neighbour instanceof BlockFenceGate || neighbour instanceof BlockWall || (neighbour.isOpaqueCube() && neighbour.renderAsNormalBlock()); }
private static boolean isSupportBlock(IBlockState parBlockState) { Block block = parBlockState.getBlock(); return block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof BlockWall; }
public boolean renderBlockByRenderType(Block p_147805_1_, int p_147805_2_, int p_147805_3_, int p_147805_4_) { int l = p_147805_1_.getRenderType(); if (l == -1) { return false; } else { p_147805_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147805_2_, p_147805_3_, p_147805_4_); this.setRenderBoundsFromBlock(p_147805_1_); switch (l) { //regex: ' : \(l == ([\d]+) \?' replace: ';\ncase \1: return' ::: IMPORTANT: REMEMBER THIS ON FIRST line! case 0 : return this.renderStandardBlock(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 4: return this.renderBlockLiquid(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 31: return this.renderBlockLog(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 1: return this.renderCrossedSquares(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 40: return this.renderBlockDoublePlant((BlockDoublePlant)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 2: return this.renderBlockTorch(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 20: return this.renderBlockVine(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 11: return this.renderBlockFence((BlockFence)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 39: return this.renderBlockQuartz(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 5: return this.renderBlockRedstoneWire(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 13: return this.renderBlockCactus(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 9: return this.renderBlockMinecartTrack((BlockRailBase)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 19: return this.renderBlockStem(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 23: return this.renderBlockLilyPad(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 6: return this.renderBlockCrops(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 3: return this.renderBlockFire((BlockFire)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 8: return this.renderBlockLadder(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 7: return this.renderBlockDoor(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 10: return this.renderBlockStairs((BlockStairs)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 27: return this.renderBlockDragonEgg((BlockDragonEgg)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 32: return this.renderBlockWall((BlockWall)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 12: return this.renderBlockLever(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 29: return this.renderBlockTripWireSource(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 30: return this.renderBlockTripWire(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 14: return this.renderBlockBed(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 15: return this.renderBlockRepeater((BlockRedstoneRepeater)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 36: return this.renderBlockRedstoneDiode((BlockRedstoneDiode)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 37: return this.renderBlockRedstoneComparator((BlockRedstoneComparator)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 16: return this.renderPistonBase(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, false) ; case 17: return this.renderPistonExtension(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, true) ; case 18: return this.renderBlockPane((BlockPane)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 41: return this.renderBlockStainedGlassPane(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 21: return this.renderBlockFenceGate((BlockFenceGate)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 24: return this.renderBlockCauldron((BlockCauldron)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 33: return this.renderBlockFlowerpot((BlockFlowerPot)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 35: return this.renderBlockAnvil((BlockAnvil)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 25: return this.renderBlockBrewingStand((BlockBrewingStand)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 26: return this.renderBlockEndPortalFrame((BlockEndPortalFrame)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 28: return this.renderBlockCocoa((BlockCocoa)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 34: return this.renderBlockBeacon((BlockBeacon)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; case 38: return this.renderBlockHopper((BlockHopper)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_); default: return FMLRenderAccessLibrary.renderWorldBlock(this, blockAccess, p_147805_2_, p_147805_3_, p_147805_4_, p_147805_1_, l); } } }
public boolean renderBlockWall(BlockWall p_147807_1_, int p_147807_2_, int p_147807_3_, int p_147807_4_) { boolean flag = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_ - 1, p_147807_3_, p_147807_4_); boolean flag1 = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_ + 1, p_147807_3_, p_147807_4_); boolean flag2 = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ - 1); boolean flag3 = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ + 1); boolean flag4 = flag2 && flag3 && !flag && !flag1; boolean flag5 = !flag2 && !flag3 && flag && flag1; boolean flag6 = this.blockAccess.isAirBlock(p_147807_2_, p_147807_3_ + 1, p_147807_4_); if ((flag4 || flag5) && flag6) { if (flag4) { this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } else { this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } } else { this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); if (flag) { this.setRenderBounds(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } if (flag1) { this.setRenderBounds(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } if (flag2) { this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } if (flag3) { this.setRenderBounds(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); } } p_147807_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_); return true; }