From 391eea0416e173016ef15d06b68aa961d8e0c9e7 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Thu, 14 Apr 2016 22:05:09 -0500 Subject: [PATCH] Minor optimization in jaded ama, closes #186 kinda maybe --- .../subtile/functional/SubTileJadedAmaranthus.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java index 251fc8271..f9dd0dad1 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java @@ -41,16 +41,18 @@ public class SubTileJadedAmaranthus extends SubTileFunctional { supertile.getPos().getY() + RANGE, supertile.getPos().getZ() - RANGE + supertile.getWorld().rand.nextInt(RANGE * 2 + 1) ); + + BlockPos up = pos.up(); for(int i = 0; i < RANGE * 2; i++) { - IBlockState stateAbove = supertile.getWorld().getBlockState(pos.up()); + IBlockState stateAbove = supertile.getWorld().getBlockState(up); Block blockAbove = stateAbove.getBlock(); - if((supertile.getWorld().isAirBlock(pos.up()) || blockAbove.isReplaceable(supertile.getWorld(), pos.up())) && stateAbove.getMaterial() != Material.water && ModBlocks.flower.canPlaceBlockAt(supertile.getWorld(), pos.up())) { + if((supertile.getWorld().isAirBlock(up) || blockAbove.isReplaceable(supertile.getWorld(), up)) && stateAbove.getMaterial() != Material.water && ModBlocks.flower.canPlaceBlockAt(supertile.getWorld(), up)) { EnumDyeColor color = EnumDyeColor.byMetadata(supertile.getWorld().rand.nextInt(16)); IBlockState state = ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, color); if(ConfigHandler.blockBreakParticles) - supertile.getWorld().playAuxSFX(2001, pos.up(), Block.getStateId(state)); - supertile.getWorld().setBlockState(pos.up(), state, 1 | 2); + supertile.getWorld().playAuxSFX(2001, up, Block.getStateId(state)); + supertile.getWorld().setBlockState(up, state, 1 | 2); mana -= COST; sync();