diff --git a/src/main/java/vazkii/botania/api/BotaniaAPI.java b/src/main/java/vazkii/botania/api/BotaniaAPI.java index 02bb41726..35edbd022 100644 --- a/src/main/java/vazkii/botania/api/BotaniaAPI.java +++ b/src/main/java/vazkii/botania/api/BotaniaAPI.java @@ -157,7 +157,7 @@ public final class BotaniaAPI { addOreWeight("oreMythril", 6485); // Simple Ores2 addOreWeight("oreAdamantium", 2275); // Simple Ores2 addOreWeight("oreTungsten", 3520); // Simple Tungsten - + addOreWeightNether("oreQuartz", 19600); // Vanilla addOreWeightNether("oreCobalt", 500); // Tinker's Construct addOreWeightNether("oreArdite", 500); // Tinker's Construct diff --git a/src/main/java/vazkii/botania/api/brew/Brew.java b/src/main/java/vazkii/botania/api/brew/Brew.java index e4b0aa360..d0dd6ba4d 100644 --- a/src/main/java/vazkii/botania/api/brew/Brew.java +++ b/src/main/java/vazkii/botania/api/brew/Brew.java @@ -52,7 +52,7 @@ public class Brew { canInfuseBloodPendant = false; return this; } - + /** * Sets this brew to not be able to be infused onto Incense Sticks. */ @@ -64,7 +64,7 @@ public class Brew { public boolean canInfuseBloodPendant() { return canInfuseBloodPendant; } - + public boolean canInfuseIncense() { return canInfuseIncense; } diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java index bec41ba48..52f716769 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java @@ -102,109 +102,109 @@ public class SubTileFunctional extends SubTileEntity { } cachedPoolCoordinates = null; } + } + } + + if(!needsNew && linkedPool != null) { + TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); + if(!(tileAt instanceof IManaPool)) { + linkedPool = null; + needsNew = true; + } else linkedPool = tileAt; + } + + if(needsNew) { + IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); + int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); + if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { + ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); + linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), range); + sizeLastCheck = size; + } } } - if(!needsNew && linkedPool != null) { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - if(!(tileAt instanceof IManaPool)) { - linkedPool = null; - needsNew = true; - } else linkedPool = tileAt; + public void addMana(int mana) { + this.mana = Math.min(getMaxMana(), this.mana + mana); } - if(needsNew) { - IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); - if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), range); - sizeLastCheck = size; + @Override + public boolean onWanded(EntityPlayer player, ItemStack wand) { + if(player == null) + return false; + + knownMana = mana; + player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); + + return super.onWanded(player, wand); + } + + public int getMaxMana() { + return 20; + } + + public int getColor() { + return 0xFFFFFF; + } + + @Override + public void readFromPacketNBT(NBTTagCompound cmp) { + mana = cmp.getInteger(TAG_MANA); + + int x = cmp.getInteger(TAG_POOL_X); + int y = cmp.getInteger(TAG_POOL_Y); + int z = cmp.getInteger(TAG_POOL_Z); + + cachedPoolCoordinates = new ChunkCoordinates(x, y, z); + } + + @Override + public void writeToPacketNBT(NBTTagCompound cmp) { + cmp.setInteger(TAG_MANA, mana); + + int x = linkedPool == null ? 0 : linkedPool.xCoord; + int y = linkedPool == null ? -1 : linkedPool.yCoord; + int z = linkedPool == null ? 0 : linkedPool.zCoord; + + cmp.setInteger(TAG_POOL_X, x); + cmp.setInteger(TAG_POOL_Y, y); + cmp.setInteger(TAG_POOL_Z, z); + } + + @Override + public ChunkCoordinates getBinding() { + if(linkedPool == null) + return null; + return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); + } + + @Override + public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + return true; + } + + @Override + public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + int range = 10; + range *= range; + + double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); + if(range >= dist) { + TileEntity tile = player.worldObj.getTileEntity(x, y, z); + if(tile instanceof IManaPool) { + linkedPool = tile; + return true; + } } - } -} -public void addMana(int mana) { - this.mana = Math.min(getMaxMana(), this.mana + mana); -} - -@Override -public boolean onWanded(EntityPlayer player, ItemStack wand) { - if(player == null) return false; - - knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); - - return super.onWanded(player, wand); -} - -public int getMaxMana() { - return 20; -} - -public int getColor() { - return 0xFFFFFF; -} - -@Override -public void readFromPacketNBT(NBTTagCompound cmp) { - mana = cmp.getInteger(TAG_MANA); - - int x = cmp.getInteger(TAG_POOL_X); - int y = cmp.getInteger(TAG_POOL_Y); - int z = cmp.getInteger(TAG_POOL_Z); - - cachedPoolCoordinates = new ChunkCoordinates(x, y, z); -} - -@Override -public void writeToPacketNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_MANA, mana); - - int x = linkedPool == null ? 0 : linkedPool.xCoord; - int y = linkedPool == null ? -1 : linkedPool.yCoord; - int z = linkedPool == null ? 0 : linkedPool.zCoord; - - cmp.setInteger(TAG_POOL_X, x); - cmp.setInteger(TAG_POOL_Y, y); - cmp.setInteger(TAG_POOL_Z, z); -} - -@Override -public ChunkCoordinates getBinding() { - if(linkedPool == null) - return null; - return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); -} - -@Override -public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return true; -} - -@Override -public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - int range = 10; - range *= range; - - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); - if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); - if(tile instanceof IManaPool) { - linkedPool = tile; - return true; - } } - return false; -} - -@Override -public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); - int color = getColor(); - BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); -} + @Override + public void renderHUD(Minecraft mc, ScaledResolution res) { + String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); + int color = getColor(); + BotaniaAPI.internalHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); + } } diff --git a/src/main/java/vazkii/botania/client/core/helper/IconHelper.java b/src/main/java/vazkii/botania/client/core/helper/IconHelper.java index 7fd80cf85..bf3c2304b 100644 --- a/src/main/java/vazkii/botania/client/core/helper/IconHelper.java +++ b/src/main/java/vazkii/botania/client/core/helper/IconHelper.java @@ -21,7 +21,7 @@ public final class IconHelper { public static IIcon forName(IIconRegister ir, String name) { return ir.registerIcon(LibResources.PREFIX_MOD + name); } - + public static IIcon forName(IIconRegister ir, String name, String dir) { return ir.registerIcon(LibResources.PREFIX_MOD + dir + "/" + name); } diff --git a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerBrewery.java b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerBrewery.java index e64994b5a..19b69a195 100644 --- a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerBrewery.java +++ b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerBrewery.java @@ -110,7 +110,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler { for(RecipeBrew recipe : BotaniaAPI.brewRecipes) { if(recipe == null) continue; - + if(((IBrewItem) result.getItem()).getBrew(result) == recipe.getBrew()) arecipes.add(new CachedBreweryRecipe(recipe)); } diff --git a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerElvenTrade.java b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerElvenTrade.java index 6c0bf1756..0e7878cd6 100644 --- a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerElvenTrade.java +++ b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerElvenTrade.java @@ -116,7 +116,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler { for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) { if(recipe == null) continue; - + arecipes.add(new CachedElvenTradeRecipe(recipe)); } } @@ -129,7 +129,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler { for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) { if(recipe == null) continue; - + if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result)) arecipes.add(new CachedElvenTradeRecipe(recipe)); } @@ -142,7 +142,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler { for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) { if(recipe == null) continue; - + CachedElvenTradeRecipe crecipe = new CachedElvenTradeRecipe(recipe); if(crecipe.contains(crecipe.inputs, ingredient)) arecipes.add(crecipe); diff --git a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerManaPool.java b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerManaPool.java index 4aa8e25b5..5a5d5b976 100644 --- a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerManaPool.java +++ b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerManaPool.java @@ -124,7 +124,7 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler { for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { if(recipe == null) continue; - + arecipes.add(new CachedManaPoolRecipe(recipe)); } } else super.loadCraftingRecipes(outputId, results); @@ -135,7 +135,7 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler { for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { if(recipe == null) continue; - + if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result)) arecipes.add(new CachedManaPoolRecipe(recipe)); } @@ -146,7 +146,7 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler { for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { if(recipe == null) continue; - + CachedManaPoolRecipe crecipe = new CachedManaPoolRecipe(recipe); if(crecipe.contains(crecipe.getIngredients(), ingredient) || crecipe.contains(crecipe.getOtherStacks(), ingredient)) arecipes.add(crecipe); diff --git a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPetalApothecary.java b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPetalApothecary.java index 6abc3d781..aa9ee0017 100644 --- a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPetalApothecary.java +++ b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPetalApothecary.java @@ -120,7 +120,7 @@ public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler { for(RecipePetals recipe : getRecipes()){ if(recipe == null) continue; - + if(recipe.getOutput().stackTagCompound != null && NEIServerUtils.areStacksSameType(recipe.getOutput(), result) || recipe.getOutput().stackTagCompound == null && NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result) && recipe.getOutput().getItem() != Items.skull) arecipes.add(getCachedRecipe(recipe)); } @@ -131,7 +131,7 @@ public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler { for(RecipePetals recipe : getRecipes()) { if(recipe == null) continue; - + CachedPetalApothecaryRecipe crecipe = getCachedRecipe(recipe); if(crecipe.contains(crecipe.inputs, ingredient) && recipe.getOutput().getItem() != Items.skull) arecipes.add(crecipe); diff --git a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPureDaisy.java b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPureDaisy.java index dce747436..88136d192 100644 --- a/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPureDaisy.java +++ b/src/main/java/vazkii/botania/client/integration/nei/RecipeHandlerPureDaisy.java @@ -104,7 +104,7 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler { for(RecipePureDaisy recipe : BotaniaAPI.pureDaisyRecipes) { if(recipe == null) continue; - + arecipes.add(new CachedPureDaisyRecipe(recipe)); } } else super.loadCraftingRecipes(outputId, results); @@ -115,7 +115,7 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler { for(RecipePureDaisy recipe : BotaniaAPI.pureDaisyRecipes) { if(recipe == null) continue; - + if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(recipe.getOutput()), result)) arecipes.add(new CachedPureDaisyRecipe(recipe)); } @@ -126,7 +126,7 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler { for(RecipePureDaisy recipe : BotaniaAPI.pureDaisyRecipes) { if(recipe == null) continue; - + CachedPureDaisyRecipe crecipe = new CachedPureDaisyRecipe(recipe); if(crecipe.contains(crecipe.getIngredients(), ingredient) || crecipe.contains(crecipe.getOtherStacks(), ingredient)) arecipes.add(crecipe); diff --git a/src/main/java/vazkii/botania/client/model/ModelIncensePlate.java b/src/main/java/vazkii/botania/client/model/ModelIncensePlate.java index df45606a1..d7fa2eadb 100644 --- a/src/main/java/vazkii/botania/client/model/ModelIncensePlate.java +++ b/src/main/java/vazkii/botania/client/model/ModelIncensePlate.java @@ -12,7 +12,6 @@ package vazkii.botania.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; public class ModelIncensePlate extends ModelBase { diff --git a/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java b/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java index dca7098c9..d487e4fa2 100644 --- a/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java +++ b/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java @@ -18,9 +18,7 @@ import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTilePool; import vazkii.botania.common.block.tile.TileIncensePlate; -import vazkii.botania.common.block.tile.mana.TilePool; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class RenderIncensePlate implements ISimpleBlockRenderingHandler{ @@ -48,5 +46,5 @@ public class RenderIncensePlate implements ISimpleBlockRenderingHandler{ public boolean shouldRender3DInInventory(int modelId) { return true; } - + } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java index 26f9a95b4..3a786db70 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java @@ -12,45 +12,38 @@ package vazkii.botania.client.render.tile; import java.awt.Color; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelIncensePlate; -import vazkii.botania.common.block.tile.TileIncensePlate; -import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.model.ModelIncensePlate; +import vazkii.botania.common.block.tile.TileIncensePlate; + public class RenderTileIncensePlate extends TileEntitySpecialRenderer { private static final float[] ROTATIONS = new float[] { 180F, 0F, 90F, 270F }; - + ResourceLocation texture = new ResourceLocation(LibResources.MODEL_INCENSE_PLATE); ModelIncensePlate model = new ModelIncensePlate(); @Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks) { TileIncensePlate plate = (TileIncensePlate) tileentity; - + int meta = plate.getWorldObj() != null ? plate.getBlockMetadata() : 0; - + GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL11.GL_BLEND); @@ -72,7 +65,7 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer { GL11.glTranslatef(0.1F, -1.46F, 0F); GL11.glScalef(s, s, s); GL11.glRotatef(180F, 0F, 1F, 0F); - + int renderPass = 0; do { IIcon icon = stack.getItem().getIcon(stack, renderPass); diff --git a/src/main/java/vazkii/botania/common/achievement/ModAchievements.java b/src/main/java/vazkii/botania/common/achievement/ModAchievements.java index 625a758cc..caf617996 100644 --- a/src/main/java/vazkii/botania/common/achievement/ModAchievements.java +++ b/src/main/java/vazkii/botania/common/achievement/ModAchievements.java @@ -116,7 +116,7 @@ public final class ModAchievements { relicAesirRing = new AchievementMod(LibAchievementNames.RELIC_AESIR_RING, -7, 5, ModItems.aesirRing, null).setSpecial(); } - + nullFlower = new AchievementMod(LibAchievementNames.NULL_FLOWER, -8, -4, ModBlocks.specialFlower, null).setSpecial(); ItemStack desu = new ItemStack(ModItems.manaGun); diff --git a/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java b/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java index 8840eba99..05d69a5fa 100644 --- a/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java +++ b/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java @@ -65,7 +65,7 @@ public class BlockIncensePlate extends BlockModContainer implements ILexiconable if(stack != null && stack.getItem() == Items.flint_and_steel) { plate.burning = true; Brew brew = ((ItemIncenseStick) ModItems.incenseStick).getBrew(plateStack); - plate.timeLeft = brew.getPotionEffects(plateStack).get(0).getDuration() * ItemIncenseStick.TIME_MULTIPLIER; + plate.timeLeft = brew.getPotionEffects(plateStack).get(0).getDuration() * ItemIncenseStick.TIME_MULTIPLIER; stack.damageItem(1, player); did = true; } else { diff --git a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java index 01249bb6a..11334d5bd 100644 --- a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java @@ -31,7 +31,6 @@ import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.core.handler.ConfigHandler; @@ -137,7 +136,7 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab @Override public IIcon getIcon(int p_149691_1_, int p_149691_2_) { boolean top = func_149887_c(p_149691_2_); - return (ConfigHandler.altFlowerTextures ? (top ? doublePlantTopIconsAlt : doublePlantBottomIconsAlt) : (top ? doublePlantTopIcons : doublePlantBottomIcons))[p_149691_2_ & 7]; + return (ConfigHandler.altFlowerTextures ? top ? doublePlantTopIconsAlt : doublePlantBottomIconsAlt : top ? doublePlantTopIcons : doublePlantBottomIcons)[p_149691_2_ & 7]; } @Override @@ -147,7 +146,7 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab if(top) meta = world.getBlockMetadata(x, y - 1, z); - return (ConfigHandler.altFlowerTextures ? (top ? doublePlantBottomIconsAlt : doublePlantTopIconsAlt) : (top ? doublePlantBottomIcons : doublePlantTopIcons))[meta & 7]; + return (ConfigHandler.altFlowerTextures ? top ? doublePlantBottomIconsAlt : doublePlantTopIconsAlt : top ? doublePlantBottomIcons : doublePlantTopIcons)[meta & 7]; } @Override diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java b/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java index 940ef1cf0..d5133c48e 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java @@ -89,7 +89,7 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, IWan } else if(altar.isEmpty() && stack == null) altar.trySetLastRecipe(par5EntityPlayer); else if(stack != null) - return altar.addItem(par5EntityPlayer, stack); + return altar.addItem(par5EntityPlayer, stack); return false; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java index 0353ae804..66014b564 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java @@ -32,7 +32,6 @@ import vazkii.botania.api.item.IPetalApothecary; import vazkii.botania.api.recipe.IFlowerComponent; import vazkii.botania.api.recipe.RecipePetals; import vazkii.botania.common.Botania; -import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.lib.LibBlockNames; public class TileAltar extends TileSimpleInventory implements ISidedInventory, IPetalApothecary { @@ -47,10 +46,10 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I public boolean hasLava = false; public boolean isMossy = false; - + List lastRecipe = null; int recipeKeepTicks = 0; - + public boolean collideEntityItem(EntityItem item) { ItemStack stack = item.getEntityItem(); if(stack == null || item.isDead) @@ -109,7 +108,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I for(RecipePetals recipe : BotaniaAPI.petalRecipes) { if(recipe.matches(this)) { saveLastRecipe(); - + for(int i = 0; i < getSizeInventory(); i++) setInventorySlotContents(i, null); @@ -127,7 +126,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I setWater(false); worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); didChange = true; - + break; } } @@ -135,7 +134,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I return didChange; } - + public void saveLastRecipe() { lastRecipe = new ArrayList(); for(int i = 0; i < getSizeInventory(); i++) { @@ -146,30 +145,30 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I } recipeKeepTicks = 400; } - + public void trySetLastRecipe(EntityPlayer player) { tryToSetLastRecipe(player, this, lastRecipe); if(!isEmpty()) VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); } - + public static void tryToSetLastRecipe(EntityPlayer player, IInventory inv, List lastRecipe) { if(lastRecipe == null || lastRecipe.isEmpty() || player.worldObj.isRemote) return; - + int index = 0; boolean didAny = false; for(ItemStack stack : lastRecipe) { - if(stack == null) + if(stack == null) continue; - + for(int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack pstack = player.inventory.getStackInSlot(i); if(pstack != null && pstack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(stack, pstack)) { pstack.stackSize--; if(pstack.stackSize == 0) player.inventory.setInventorySlotContents(i, null); - + ItemStack stackToPut = pstack.copy(); stackToPut.stackSize = 1; inv.setInventorySlotContents(index, stackToPut); @@ -179,7 +178,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I } } } - + if(didAny) { if(inv instanceof TileAltar) player.worldObj.playSoundAtEntity(player, "game.neutral.swim.splash", 0.1F, 1F); @@ -199,12 +198,12 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); } } - + public boolean isEmpty() { for(int i = 0; i < getSizeInventory(); i++) if(getStackInSlot(i) != null) return false; - + return true; } @@ -242,7 +241,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I if(Math.random() > 0.9) worldObj.spawnParticle("lava", xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0); } - + if(recipeKeepTicks > 0) --recipeKeepTicks; else lastRecipe = null; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java b/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java index 5a3b6916e..6d8aaa9c7 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java @@ -91,7 +91,7 @@ public class TileCraftCrate extends TileOpenCrate { @Override public void updateEntity() { - if(!worldObj.isRemote && ((craft(true) && canEject()) || isFull())) + if(!worldObj.isRemote && (craft(true) && canEject() || isFull())) ejectAll(); int newSignal = 0; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java b/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java index 57ec158ae..9750d32ec 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java @@ -55,7 +55,7 @@ public class TileIncensePlate extends TileSimpleInventory implements ISidedInven player.addPotionEffect(applyEffect); } } - + if(worldObj.rand.nextInt(20) == 0) worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.1, zCoord + 0.5, "fire.fire", 0.1F, 1F); } else { diff --git a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java index 791b984ae..343a0c2c3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -45,7 +45,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor List lastRecipe = null; int recipeKeepTicks = 0; - + public boolean addItem(EntityPlayer player, ItemStack stack) { if(cooldown > 0 || stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0) return false; @@ -116,7 +116,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor signal = newSignal; worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); } - + if(recipeKeepTicks > 0) --recipeKeepTicks; else lastRecipe = null; @@ -139,7 +139,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); } } - + public void saveLastRecipe() { lastRecipe = new ArrayList(); for(int i = 0; i < getSizeInventory(); i++) { @@ -150,7 +150,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor } recipeKeepTicks = 400; } - + public void trySetLastRecipe(EntityPlayer player) { TileAltar.tryToSetLastRecipe(player, this, lastRecipe); if(!isEmpty()) @@ -159,7 +159,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor public boolean hasValidRecipe() { for(RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes) - if(recipe.matches(this)) + if(recipe.matches(this)) return true; return false; @@ -223,12 +223,12 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); } } - + public boolean isEmpty() { for(int i = 0; i < getSizeInventory(); i++) if(getStackInSlot(i) != null) return false; - + return true; } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java index 5685d0900..156db07d4 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java @@ -67,7 +67,7 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor public boolean requestMatches(Object request, ItemStack filter) { if(filter == null) return false; - + if(request instanceof ItemStack) { ItemStack stack = (ItemStack) request; return stack != null && stack.isItemEqual(filter) && ItemStack.areItemStacksEqual(filter, stack); diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index 7fb8daa6e..bfc45c441 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -1708,35 +1708,35 @@ public final class ModCraftingRecipes { recipeCorporeaCrystalCube = BotaniaAPI.getLatestAddedRecipe(); // Stone of Temperance Recipe - addOreDictRecipe(new ItemStack(ModItems.temperanceStone), + addOreDictRecipe(new ItemStack(ModItems.temperanceStone), " S ", "SRS", " S ", 'S', "stone", 'R', LibOreDict.RUNE[2]); recipeTemperanceStone = BotaniaAPI.getLatestAddedRecipe(); - + // Incense Stick Recipe - addOreDictRecipe(new ItemStack(ModItems.incenseStick), + addOreDictRecipe(new ItemStack(ModItems.incenseStick), " G", " B ", "T ", 'G', new ItemStack(Items.ghast_tear), 'B', new ItemStack(Items.blaze_powder), 'T', LibOreDict.LIVINGWOOD_TWIG); recipeIncenseStick = BotaniaAPI.getLatestAddedRecipe(); - + // Incense Plate Recipe - addOreDictRecipe(new ItemStack(ModBlocks.incensePlate), + addOreDictRecipe(new ItemStack(ModBlocks.incensePlate), "WSS", 'W', LibOreDict.LIVING_WOOD, 'S', new ItemStack(ModFluffBlocks.livingwoodSlab)); recipeIncensePlate = BotaniaAPI.getLatestAddedRecipe(); - + // Terra Truncator Recipe - addOreDictRecipe(new ItemStack(ModItems.terraAxe), + addOreDictRecipe(new ItemStack(ModItems.terraAxe), "TTG", "TST", " S ", 'T', LibOreDict.TERRA_STEEL, 'G', new ItemStack(Blocks.glowstone), 'S', LibOreDict.LIVINGWOOD_TWIG); recipeTerraAxe = BotaniaAPI.getLatestAddedRecipe(); - + // Storage Block Recipes addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0), "III", "III", "III", diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java index 719b71906..23e2dd1ec 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java @@ -11,13 +11,13 @@ package vazkii.botania.common.crafting.recipe; import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.world.World; -import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.core.helper.ItemNBTHelper; import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; +import vazkii.botania.common.core.helper.ItemNBTHelper; +import vazkii.botania.common.item.ModItems; public class HelmRevealingRecipe implements IRecipe { @@ -26,7 +26,7 @@ public class HelmRevealingRecipe implements IRecipe { Item goggles = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemGoggles"); if(goggles == null) return false; // NO TC loaded - + boolean foundGoggles = false; boolean foundHelm = false; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -59,15 +59,15 @@ public class HelmRevealingRecipe implements IRecipe { Item helmItem = helmCopy.getItem(); ItemStack newHelm; - + if(helmItem == ModItems.manasteelHelm) newHelm = new ItemStack(ModItems.manasteelHelmRevealing); - else if(helmItem == ModItems.terrasteelHelm) + else if(helmItem == ModItems.terrasteelHelm) newHelm = new ItemStack(ModItems.terrasteelHelmRevealing); - else if(helmItem == ModItems.elementiumHelm) + else if(helmItem == ModItems.elementiumHelm) newHelm = new ItemStack(ModItems.elementiumHelmRevealing); else return null; - + //Copy Ancient Wills for(int i = 0; i < 6; i++) if(ItemNBTHelper.getBoolean(helmCopy, "AncientWill" + i, false)) @@ -77,7 +77,7 @@ public class HelmRevealingRecipe implements IRecipe { NBTTagList enchList = ItemNBTHelper.getList(helmCopy, "ench", 10, true); if(enchList != null) ItemNBTHelper.setList(newHelm, "ench", enchList); - + return newHelm; } @@ -90,7 +90,7 @@ public class HelmRevealingRecipe implements IRecipe { public ItemStack getRecipeOutput() { return new ItemStack(ModItems.manasteelHelmRevealing); } - + private boolean checkHelm(ItemStack helmStack) { Item helmItem = helmStack.getItem(); return helmItem == ModItems.manasteelHelm || helmItem == ModItems.terrasteelHelm || helmItem == ModItems.elementiumHelm; diff --git a/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java b/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java index 8c10e1a9c..7b4c3d0af 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java +++ b/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java @@ -17,7 +17,6 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockLeavesBase; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; diff --git a/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java b/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java index 82f580aa9..371d5a089 100644 --- a/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java +++ b/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java @@ -67,7 +67,7 @@ public class ItemTemperanceStone extends ItemMod { void addStringToTooltip(String s, List tooltip) { tooltip.add(s.replaceAll("&", "\u00a7")); } - + public static boolean hasTemperanceActive(EntityPlayer player) { IInventory inv = player.inventory; for(int i = 0; i < inv.getSizeInventory(); i++) { @@ -75,8 +75,8 @@ public class ItemTemperanceStone extends ItemMod { if(stack != null && stack.getItem() == ModItems.temperanceStone && stack.getItemDamage() == 1) return true; } - + return false; } - + } diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java b/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java index d4c88b6b3..2dbfb1f03 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java @@ -31,21 +31,20 @@ import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemMod; -import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContainer { private static final String TAG_BREW_KEY = "brewKey"; public static final int TIME_MULTIPLIER = 60; - + IIcon[] icons; public ItemIncenseStick() { setUnlocalizedName(LibItemNames.INCENSE_STICK); setMaxStackSize(1); } - + @Override public void getSubItems(Item item, CreativeTabs tab, List list) { super.getSubItems(item, tab, list); @@ -108,11 +107,11 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain addStringToTooltip(" " + format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))) + EnumChatFormatting.GRAY + (potion.isInstant() ? "" : " (" + Potion.getDurationString(longEffect) + ")"), list); } } - + void addStringToTooltip(String s, List tooltip) { tooltip.add(s.replaceAll("&", "\u00a7")); } - + @Override public Brew getBrew(ItemStack stack) { String key = ItemNBTHelper.getString(stack, TAG_BREW_KEY, ""); @@ -126,7 +125,7 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain public static void setBrew(ItemStack stack, String brew) { ItemNBTHelper.setString(stack, TAG_BREW_KEY, brew); } - + @Override public ItemStack getItemForBrew(Brew brew, ItemStack stack) { if(!brew.canInfuseIncense() || brew.getPotionEffects(stack).size() != 1 || Potion.potionTypes[brew.getPotionEffects(stack).get(0).getPotionID()].isInstant()) diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java index 4d931af0e..5a7dcd66b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java @@ -43,7 +43,6 @@ import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; -import vazkii.botania.common.item.brew.ItemBrewBase; import vazkii.botania.common.lib.LibItemNames; import baubles.api.BaubleType; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java index 06d3afe0b..426138020 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java @@ -66,7 +66,7 @@ public final class ToolCommons { public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose) { removeBlockWithDrops(player, stack, world, x, y, z, bx, by, bz, block, materialsListing, silk, fortune, blockHardness, dispose, true); } - + public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose, boolean particles) { if(!world.blockExists(x, y, z)) return; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java index c4d34535f..6d673dd6d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java @@ -83,7 +83,7 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortab return true; } - + public int getManaPerDamage() { return MANA_PER_DAMAGE; } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java index 572864ff0..43b670288 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java @@ -97,7 +97,7 @@ public class ItemManasteelSword extends ItemSword implements IManaUsingItem { if(!world.isRemote && player instanceof EntityPlayer && stack.getItemDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (EntityPlayer) player, getManaPerDamage() * 2, true)) stack.setItemDamage(stack.getItemDamage() - 1); } - + public int getManaPerDamage() { return MANA_PER_DAMAGE; } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java index 820a8df79..82dd5cb9b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java @@ -45,14 +45,14 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker private static final int MANA_PER_DAMAGE = 100; private static Map> blockSwappers = new HashMap(); - + IIcon iconOn, iconOff; - + public ItemTerraAxe() { super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_AXE); FMLCommonHandler.instance().bus().register(this); } - + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { @@ -64,16 +64,16 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker public IIcon getIconFromDamage(int p_77617_1_) { return iconOn; } - + @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { return shouldBreak(player) ? iconOn : iconOff; } - + public boolean shouldBreak(EntityPlayer player) { return !player.isSneaking() && !ItemTemperanceStone.hasTemperanceActive(player); } - + @Override public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { MovingObjectPosition raycast = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10); @@ -84,17 +84,17 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker return false; } - + @Override public int getManaPerDamage() { return MANA_PER_DAMAGE; } - + @Override public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) { if(shouldBreak(player)) { ChunkCoordinates coords = new ChunkCoordinates(x, y, z); - addBlockSwapper(player.worldObj, player, stack, coords, coords, 32, false, true, new ArrayList()); + addBlockSwapper(player.worldObj, player, stack, coords, coords, 32, false, true, new ArrayList()); } } @@ -102,7 +102,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker public boolean disposeOfTrashBlocks(ItemStack stack) { return false; } - + @SubscribeEvent public void onTickEnd(TickEvent.WorldTickEvent event) { if(event.phase == Phase.END) { @@ -111,7 +111,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker List swappers = blockSwappers.get(dim); List swappersSafe = new ArrayList(swappers); swappers.clear(); - + for(BlockSwapper s : swappersSafe) if(s != null) s.tick(); @@ -141,8 +141,6 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker final boolean leaves; final boolean force; final List posChecked; - int ticks = 2; - BlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, ChunkCoordinates coords, int steps, boolean leaves, boolean force, List posChecked) { this.world = world; this.player = player; @@ -159,12 +157,12 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker Block blockat = world.getBlock(coords.posX, coords.posY, coords.posZ); if(!force && blockat.isAir(world, coords.posX, coords.posY, coords.posZ)) return; - + ToolCommons.removeBlockWithDrops(player, stack, world, coords.posX, coords.posY, coords.posZ, origCoords.posX, origCoords.posY, origCoords.posZ, null, ToolCommons.materialsAxe, EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack), 0F, false, !leaves); - + if(steps == 0) return; - + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { int x = coords.posX + dir.offsetX; int y = coords.posY + dir.offsetY; @@ -172,22 +170,22 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker String pstr = posStr(x, y, z); if(posChecked.contains(pstr)) continue; - + Block block = world.getBlock(x, y, z); boolean log = block.isWood(world, x, y, z); boolean leaf = block.isLeaves(world, x, y, z); if(log || leaf) { int steps = this.steps - 1; - steps = leaf ? this.leaves ? steps : 3 : steps; + steps = leaf ? leaves ? steps : 3 : steps; addBlockSwapper(world, player, stack, origCoords, new ChunkCoordinates(x, y, z), steps, leaf, false, posChecked); posChecked.add(pstr); } } } - + String posStr(int x, int y, int z) { return x + ":" + y + ":" + z; } } - + } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java index 530b09a83..9d3a3e8e7 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java @@ -109,7 +109,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ return par1ItemStack; } - + @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float sx, float sy, float sz) { return player.isSneaking() && super.onItemUse(stack, player, world, x, y, z, s, sx, sy, sz); @@ -144,7 +144,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ public int getManaPerDmg() { return MANA_PER_DAMAGE; } - + @Override public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) { if(!isEnabled(stack)) @@ -170,7 +170,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ int level = origLevel + (thor ? 1 : 0); if(ItemTemperanceStone.hasTemperanceActive(player) && level > 2) level = 2; - + int range = Math.max(0, level - 1); int rangeY = Math.max(1, range); diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java index 1b4cdd7a2..4865193ec 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java @@ -42,9 +42,9 @@ import vazkii.botania.common.lib.LibItemNames; public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, ICraftAchievement { private static final String TAG_ATTACKER_USERNAME = "attackerUsername"; - + private static final int MANA_PER_DAMAGE = 100; - + public ItemTerraSword() { super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_SWORD); } @@ -65,7 +65,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I } } } - + @Override public int getManaPerDamage() { return MANA_PER_DAMAGE; diff --git a/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java b/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java index 3c7800853..4c4085589 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java @@ -28,8 +28,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; -import vazkii.botania.api.brew.Brew; -import vazkii.botania.api.brew.IBrewContainer; import vazkii.botania.api.recipe.IElvenItem; import vazkii.botania.api.recipe.IFlowerComponent; import vazkii.botania.client.core.helper.IconHelper; diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java index 759c11f65..4d4a4edda 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java @@ -60,7 +60,7 @@ public class ItemDice extends ItemRelic { if(hasRelicAlready(player, i)) alreadyHas.add(i); else possible.add(i); - + if(alreadyHas.size() > 0) possible.add(alreadyHas.get(world.rand.nextInt(alreadyHas.size()))); relic = possible.get(world.rand.nextInt(possible.size())); diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java b/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java index a7d47ed72..40002e614 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java @@ -63,7 +63,7 @@ public class ItemRelic extends ItemMod implements IRelic { if(stack.getItem() == ModItems.aesirRing) addStringToTooltip(StatCollector.translateToLocal("botaniamisc.dropIkea"), list); - + addStringToTooltip("", list); String name = stack.getUnlocalizedName() + ".poem"; for(int i = 0; i < 4; i++) diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index b63d86653..dd805b94c 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -584,7 +584,7 @@ public final class LexiconData { incense = new BLexiconEntry(LibLexicon.DEVICE_INCENSE, categoryDevices); incense.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeIncenseStick), new PageCraftingRecipe("4", ModCraftingRecipes.recipeIncensePlate)); - + // TOOLS ENTRIES manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools); manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeManaBlaster)); @@ -694,10 +694,10 @@ public final class LexiconData { temperanceStone = new BLexiconEntry(LibLexicon.TOOL_TEMPERANCE_STONE, categoryTools); temperanceStone.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTemperanceStone)); - + terraAxe = new BLexiconEntry(LibLexicon.TOOL_TERRA_AXE, categoryTools); terraAxe.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTerraAxe)); - + // ENDER ENTRIES enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder); enderAir.setPriority().setLexiconPages(new PageText("0"));