diff --git a/MODSRC/vazkii/botania/api/BotaniaAPI.java b/MODSRC/vazkii/botania/api/BotaniaAPI.java index 3b867c2c2..98cdf3375 100644 --- a/MODSRC/vazkii/botania/api/BotaniaAPI.java +++ b/MODSRC/vazkii/botania/api/BotaniaAPI.java @@ -42,12 +42,12 @@ public final class BotaniaAPI { public static List manaInfusionRecipes = new ArrayList(); private static BiMap> subTiles = HashBiMap.> create(); - + public static Map oreWeights = new HashMap(); - + static { registerSubTile("", DummySubTile.class); - + addOreWeight("oreAluminum", 3940); // Tinkers' Construct addOreWeight("oreAmber", 2075); // Thaumcraft addOreWeight("oreApatite", 1595); // Forestry @@ -163,7 +163,7 @@ public final class BotaniaAPI { allEntries.add(entry); category.entries.add(entry); } - + /** * Maps an ore (ore dictionary key) to it's weight on the world generation. This * is used for the Orechid flower. Check the static block in the BotaniaAPI class @@ -178,7 +178,7 @@ public final class BotaniaAPI { public static int getOreWeight(String ore) { return oreWeights.get(ore); } - + /** * Gets the last recipe to have been added to the recipe list. */ diff --git a/MODSRC/vazkii/botania/api/lexicon/IRecipeKeyProvider.java b/MODSRC/vazkii/botania/api/lexicon/IRecipeKeyProvider.java index 85c9bfc75..d07c0325b 100644 --- a/MODSRC/vazkii/botania/api/lexicon/IRecipeKeyProvider.java +++ b/MODSRC/vazkii/botania/api/lexicon/IRecipeKeyProvider.java @@ -20,5 +20,5 @@ import net.minecraft.item.ItemStack; public interface IRecipeKeyProvider { public String getKey(ItemStack stack); - + } diff --git a/MODSRC/vazkii/botania/api/mana/ILens.java b/MODSRC/vazkii/botania/api/mana/ILens.java index 28a80c034..3ac52d112 100644 --- a/MODSRC/vazkii/botania/api/mana/ILens.java +++ b/MODSRC/vazkii/botania/api/mana/ILens.java @@ -49,18 +49,18 @@ public interface ILens { * do any particles. */ public boolean doParticles(IManaBurst burst, ItemStack stack); - + /** * Can the source lens be combined with the composite lens? This is called * for both the ILens instance of ItemStack.getItem() of sourceLens and compositeLens. */ public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens); - + /** * Gets the composite lens in the stack passed in, return null for none. */ public ItemStack getCompositeLens(ItemStack stack); - + /** * Sets the composite lens for the sourceLens as the compositeLens, returns * the ItemStack with the combination. diff --git a/MODSRC/vazkii/botania/api/mana/IManaCollisionGhost.java b/MODSRC/vazkii/botania/api/mana/IManaCollisionGhost.java index b5f253f8f..420f683c4 100644 --- a/MODSRC/vazkii/botania/api/mana/IManaCollisionGhost.java +++ b/MODSRC/vazkii/botania/api/mana/IManaCollisionGhost.java @@ -18,5 +18,5 @@ package vazkii.botania.api.mana; public interface IManaCollisionGhost { public boolean isGhost(); - + } diff --git a/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java b/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java index 457451ae0..def634a00 100644 --- a/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java +++ b/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java @@ -18,7 +18,7 @@ public final class ManaItemHandler { /** * Requests mana from items in a given player's inventory. Note that stack.getItem() - * must be instanceof IManaItem. + * must be instanceof IManaItem. * @param manaToGet How much mana is to be requested, if less mana exists than this amount, * the amount of mana existent will be returned instead, if you want exact values use requestManaExact. * @param remove If true, the mana will be removed from the target item. Set to false to just check. @@ -27,33 +27,33 @@ public final class ManaItemHandler { public static int requestMana(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { if(stack == null) return 0; - + for(ItemStack stackInSlot : player.inventory.mainInventory) { if(stackInSlot == stack) continue; - + if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { IManaItem manaItem = (IManaItem) stackInSlot.getItem(); if(manaItem.canExportManaToItem(stackInSlot, stack) && manaItem.getMana(stackInSlot) > 0) { if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) continue; - + int mana = Math.min(manaToGet, manaItem.getMana(stackInSlot)); - + if(remove) manaItem.addMana(stackInSlot, -mana); - + return mana; } } } - + return 0; } - + /** - * Requests an exact amount of mana from items in a given player's inventory. - * Note that stack.getItem() must be instanceof IManaItem. + * Requests an exact amount of mana from items in a given player's inventory. + * Note that stack.getItem() must be instanceof IManaItem. * @param manaToGet How much mana is to be requested, if less mana exists than this amount, * false will be returned instead, and nothing will happen. * @param remove If true, the mana will be removed from the target item. Set to false to just check. @@ -62,26 +62,26 @@ public final class ManaItemHandler { public static boolean requestManaExact(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { if(stack == null) return false; - + for(ItemStack stackInSlot : player.inventory.mainInventory) { if(stackInSlot == stack) continue; - + if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); if(manaItemSlot.canExportManaToItem(stackInSlot, stack) && manaItemSlot.getMana(stackInSlot) > manaToGet) { if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) continue; - + if(remove) manaItemSlot.addMana(stackInSlot, -manaToGet); - + return true; } } } - + return false; } - + } diff --git a/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java b/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java index 4893c2fd8..3f7d968b7 100644 --- a/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java +++ b/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java @@ -13,7 +13,6 @@ package vazkii.botania.api.subtile; import java.awt.Color; -import cpw.mods.fml.common.network.PacketDispatcher; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; @@ -25,6 +24,7 @@ import net.minecraft.util.StatCollector; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.IManaNetwork; import vazkii.botania.api.mana.IManaCollector; +import cpw.mods.fml.common.network.PacketDispatcher; /** * The basic class for a Generating Flower. @@ -53,7 +53,7 @@ public class SubTileGenerating extends SubTileEntity { super.onUpdate(); linkCollector(); - + if(canGeneratePassively()) { int delay = getDelayBetweenPassiveGeneration(); if(delay > 0 && supertile.worldObj.getWorldTime() % delay == 0) { @@ -111,7 +111,7 @@ public class SubTileGenerating extends SubTileEntity { } } } - + public boolean shouldSyncPassiveGeneration() { return false; } @@ -133,7 +133,7 @@ public class SubTileGenerating extends SubTileEntity { public boolean onWanded(EntityPlayer player, ItemStack wand) { if(!player.worldObj.isRemote) PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId); - + knownMana = mana; player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1F); diff --git a/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java b/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java index 6ff7ca168..ca869a36d 100644 --- a/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java @@ -14,7 +14,6 @@ package vazkii.botania.client.core.proxy; import java.util.ArrayList; import java.util.List; -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -54,7 +53,6 @@ import vazkii.botania.common.core.handler.ManaNetworkHandler; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.core.proxy.CommonProxy; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibBlockIDs; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.event.FMLInitializationEvent; diff --git a/MODSRC/vazkii/botania/client/fx/FXSparkle.java b/MODSRC/vazkii/botania/client/fx/FXSparkle.java index b1477e661..1b8ba7d14 100644 --- a/MODSRC/vazkii/botania/client/fx/FXSparkle.java +++ b/MODSRC/vazkii/botania/client/fx/FXSparkle.java @@ -100,7 +100,7 @@ public class FXSparkle extends EntityFX { motionY -= 0.04D * particleGravity; - if (!noClip && !fake) + if (!noClip && !fake) pushOutOfBlocks(posX, (boundingBox.minY + boundingBox.maxY) / 2.0D, posZ); posX += motionX; diff --git a/MODSRC/vazkii/botania/client/fx/FXWisp.java b/MODSRC/vazkii/botania/client/fx/FXWisp.java index adf1ff182..672d17915 100644 --- a/MODSRC/vazkii/botania/client/fx/FXWisp.java +++ b/MODSRC/vazkii/botania/client/fx/FXWisp.java @@ -46,7 +46,7 @@ public class FXWisp extends EntityFX { if(distanceLimit) { int visibleDistance = 50; - if (!FMLClientHandler.instance().getClient().gameSettings.fancyGraphics) + if (!FMLClientHandler.instance().getClient().gameSettings.fancyGraphics) visibleDistance = 25; if (renderentity == null || renderentity.getDistance(posX, posY, posZ) > visibleDistance) @@ -62,7 +62,7 @@ public class FXWisp extends EntityFX { public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) { float agescale = 0; agescale = (float)particleAge / (float) moteHalfLife; - if (agescale > 1F) + if (agescale > 1F) agescale = 2 - agescale; particleScale = moteParticleScale * agescale; diff --git a/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java b/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java index d90526c9a..dcac5b604 100644 --- a/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java +++ b/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java @@ -25,11 +25,11 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class RenderSpecialFlower implements ISimpleBlockRenderingHandler { int id; - + public RenderSpecialFlower(int id) { this.id = id; } - + @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { // NO-OP @@ -65,15 +65,15 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler { double d2 = par4; drawCrossedSquares(blockAccess, par1Block, par2, par3, par4, d0, d1, d2, 1.0F, render); - + if(ConfigHandler.overrideVanillaBlocks) { int snow = -1; boolean foundSnow = false; - + ForgeDirection[] directions = new ForgeDirection[] { ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST }; - + for(ForgeDirection dir : directions) if(blockAccess.getBlockId(par2 + dir.offsetX, par3 + dir.offsetY, par4 + dir.offsetZ) == Block.snow.blockID) { int meta = blockAccess.getBlockMetadata(par2 + dir.offsetX, par3 + dir.offsetY, par4 + dir.offsetZ); @@ -84,9 +84,9 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler { if(snow >= 0) { BlockSnowOverride.forcedMeta = snow; render.renderBlockByRenderType(Block.blocksList[Block.snow.blockID], par2, par3, par4); - } + } } - + return true; } diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java index d5ff7d37d..cb770f965 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java @@ -36,28 +36,28 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { TileEnchanter enchanter = (TileEnchanter) tileentity; float alphaMod = 0F; - + if(enchanter.stage == 2) - alphaMod = (float) Math.min(20, enchanter.stageTicks) / 20F; + alphaMod = Math.min(20, enchanter.stageTicks) / 20F; else if(enchanter.stage == 4) - alphaMod = (float) (20 - enchanter.stageTicks) / 20F; + alphaMod = (20 - enchanter.stageTicks) / 20F; else if(enchanter.stage > 2) alphaMod = 1F; - + if(enchanter.itemToEnchant != null) { if(item == null) item = new EntityItem(enchanter.worldObj, enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant); - + item.age = (int) tileentity.worldObj.getTotalWorldTime(); item.setEntityItemStack(enchanter.itemToEnchant); - + GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslatef(0.5F, 1.25F, 0.5F); ((Render) RenderManager.instance.entityRenderMap.get(EntityItem.class)).doRender(item, d0, d1, d2, 1F, f); GL11.glTranslatef(-0.5F, -1.25F, -0.5F); } - + GL11.glPushMatrix(); GL11.glTranslated(d0, d1, d2); @@ -67,22 +67,22 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_LIGHTING); - GL11.glColor4f(0.6F + (float) ((Math.cos((double) enchanter.worldObj.getTotalWorldTime() / 6D) + 1D) / 5D), 0.1F, 0.9F, (float) ((Math.sin((double) enchanter.worldObj.getTotalWorldTime() / 8D) + 1D) / 5D + 0.4D) * alphaMod); - + GL11.glColor4f(0.6F + (float) ((Math.cos(enchanter.worldObj.getTotalWorldTime() / 6D) + 1D) / 5D), 0.1F, 0.9F, (float) ((Math.sin(enchanter.worldObj.getTotalWorldTime() / 8D) + 1D) / 5D + 0.4D) * alphaMod); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - + if(enchanter.stage == 3 || enchanter.stage == 4) { int ticks = enchanter.stageTicks + enchanter.stage3EndTicks; int angle = ticks * 2; - float yTranslation = (float) Math.min(20, ticks) / 20F * 1.15F; - float scale = ticks < 10 ? 1F : 1F - (float) Math.min(20, ticks - 10) / 20F * 0.75F; - + float yTranslation = Math.min(20, ticks) / 20F * 1.15F; + float scale = ticks < 10 ? 1F : 1F - Math.min(20, ticks - 10) / 20F * 0.75F; + GL11.glTranslatef(2.5F, 2.5F, -yTranslation); GL11.glScalef(scale, scale, 1F); GL11.glRotatef(angle, 0F, 0F, 1F); GL11.glTranslatef(-2.5F, -2.5F, 0F); } - + renderIcon(0, 0, BlockEnchanter.overlay, 5, 5, 240); GL11.glDisable(GL11.GL_BLEND); @@ -95,10 +95,10 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setBrightness(brightness); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5), (double)0, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV()); - tessellator.addVertexWithUV((double)(par1 + par4), (double)(par2 + par5), (double)0, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV()); - tessellator.addVertexWithUV((double)(par1 + par4), (double)(par2 + 0), (double)0, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV()); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)0, (double)par3Icon.getMinU(), (double)par3Icon.getMinV()); + tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV()); + tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV()); + tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV()); + tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV()); tessellator.draw(); } diff --git a/MODSRC/vazkii/botania/common/block/BlockEnchanter.java b/MODSRC/vazkii/botania/common/block/BlockEnchanter.java index e324ea7a8..6d320af26 100644 --- a/MODSRC/vazkii/botania/common/block/BlockEnchanter.java +++ b/MODSRC/vazkii/botania/common/block/BlockEnchanter.java @@ -28,7 +28,6 @@ import vazkii.botania.api.IWandable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.block.tile.TileEnchanter; -import vazkii.botania.common.block.tile.TileSimpleInventory; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockIDs; diff --git a/MODSRC/vazkii/botania/common/block/BlockManaDetector.java b/MODSRC/vazkii/botania/common/block/BlockManaDetector.java index f724b74a6..960cc4bfa 100644 --- a/MODSRC/vazkii/botania/common/block/BlockManaDetector.java +++ b/MODSRC/vazkii/botania/common/block/BlockManaDetector.java @@ -35,7 +35,7 @@ import vazkii.botania.common.lib.LibBlockNames; public class BlockManaDetector extends BlockModContainer implements ILexiconable { Icon[] icons; - + protected BlockManaDetector() { super(LibBlockIDs.idManaDetector, Material.rock); setHardness(2.0F); @@ -43,29 +43,29 @@ public class BlockManaDetector extends BlockModContainer implements ILexiconable setStepSound(soundStoneFootstep); setUnlocalizedName(LibBlockNames.MANA_DETECTOR); } - + @Override public void registerIcons(IconRegister par1IconRegister) { icons = new Icon[2]; for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } - + @Override public Icon getIcon(int par1, int par2) { return icons[Math.min(icons.length - 1, par2)]; } - + @Override public boolean canProvidePower() { return true; } - + @Override public int isProvidingWeakPower(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { return par1iBlockAccess.getBlockMetadata(par2, par3, par4) != 0 ? 15 : 0; } - + @Override public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { if(par7Entity != null && !(par7Entity instanceof IManaBurst)) diff --git a/MODSRC/vazkii/botania/common/block/BlockModFlower.java b/MODSRC/vazkii/botania/common/block/BlockModFlower.java index 60355f2c4..c2fa19ea7 100644 --- a/MODSRC/vazkii/botania/common/block/BlockModFlower.java +++ b/MODSRC/vazkii/botania/common/block/BlockModFlower.java @@ -79,7 +79,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable { public Icon getIcon(int par1, int par2) { return icons[par2]; } - + @Override public int getRenderType() { return LibRenderIDs.idSpecialFlower; diff --git a/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java b/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java index 79866dde0..07188ff47 100644 --- a/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java +++ b/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java @@ -53,7 +53,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid LibBlockNames.SUBTILE_PUREDAISY, // Generating - LibBlockNames.SUBTILE_DAYBLOOM, + LibBlockNames.SUBTILE_DAYBLOOM, LibBlockNames.SUBTILE_NIGHTSHADE, LibBlockNames.SUBTILE_ENDOFLAME, LibBlockNames.SUBTILE_HYDROANGEAS, diff --git a/MODSRC/vazkii/botania/common/block/BlockTurntable.java b/MODSRC/vazkii/botania/common/block/BlockTurntable.java index 2285b11dd..f4b10fb9b 100644 --- a/MODSRC/vazkii/botania/common/block/BlockTurntable.java +++ b/MODSRC/vazkii/botania/common/block/BlockTurntable.java @@ -33,21 +33,21 @@ import vazkii.botania.common.lib.LibBlockNames; public class BlockTurntable extends BlockModContainer implements IWandable, IWandHUD, ILexiconable { Icon[] icons; - + protected BlockTurntable() { super(LibBlockIDs.idTurntable, Material.wood); setHardness(2.0F); setStepSound(soundWoodFootstep); setUnlocalizedName(LibBlockNames.TURNTABLE); } - + @Override public void registerIcons(IconRegister par1IconRegister) { icons = new Icon[2]; for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } - + @Override public Icon getIcon(int par1, int par2) { return par1 == 1 ? icons[0] : icons[1]; diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java index 1440a925c..5ae01a1f8 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java @@ -20,18 +20,18 @@ public class SubTileAgricarnation extends SubTileFunctional { @Override public void onUpdate() { super.onUpdate(); - + if(supertile.worldObj.getTotalWorldTime() % 3 == 0) { int range = 5; int x = supertile.xCoord + supertile.worldObj.rand.nextInt(range * 2 + 1) - range; int z = supertile.zCoord + supertile.worldObj.rand.nextInt(range * 2 + 1) - range; - + for(int i = 4; i > -2; i--) { int y = supertile.yCoord + i; - + if(supertile.worldObj.isAirBlock(x, y, z)) continue; - + if(isPlant(x, y, z) && mana > 5) { int id = supertile.worldObj.getBlockId(x, y, z); mana -= 5; @@ -40,24 +40,24 @@ public class SubTileAgricarnation extends SubTileFunctional { } } } - + boolean isPlant(int x, int y, int z) { int id = supertile.worldObj.getBlockId(x, y, z); if(id == Block.grass.blockID || id == Block.leaves.blockID || id == Block.tallGrass.blockID) return false; - + Material mat = supertile.worldObj.getBlockMaterial(x, y, z); return mat != null && (mat == Material.plants || mat == Material.cactus || mat == Material.grass || mat == Material.leaves || mat == Material.vine || mat == Material.wood || mat == Material.pumpkin); } - + @Override public int getColor() { return 0x8EF828; } - + @Override public int getMaxMana() { return 200; } - + } diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java index 98460882f..0ac5899c6 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java @@ -17,17 +17,16 @@ import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import vazkii.botania.api.subtile.SubTileFunctional; -import cpw.mods.fml.common.network.PacketDispatcher; public class SubTileExoflame extends SubTileFunctional { @Override public void onUpdate() { super.onUpdate(); - + int range = 5; int rangeY = 2; - + fireFurnaces : { for(int i = -range + 1; i < range; i++) for(int j = -rangeY; j < rangeY; j++) @@ -35,7 +34,7 @@ public class SubTileExoflame extends SubTileFunctional { int x = supertile.xCoord + i; int y = supertile.yCoord + j; int z = supertile.zCoord + k; - + TileEntity tile = supertile.worldObj.getBlockTileEntity(x, y, z); if(tile != null && tile instanceof TileEntityFurnace) { TileEntityFurnace furnace = (TileEntityFurnace) tile; @@ -48,9 +47,9 @@ public class SubTileExoflame extends SubTileFunctional { } if(supertile.worldObj.getTotalWorldTime() % 2 == 0) furnace.furnaceCookTime = Math.min(199, furnace.furnaceCookTime + 1); - + mana -= 2; - + if(mana == 0) break fireFurnaces; } @@ -58,36 +57,36 @@ public class SubTileExoflame extends SubTileFunctional { } } } - - public boolean canFurnaceSmelt(TileEntityFurnace furnace){ - if(furnace.getStackInSlot(0) == null) - return false; - else { - ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnace.getStackInSlot(0)); - - if(itemstack == null) - return false; - - if(furnace.getStackInSlot(2) == null) - return true; - - if(!furnace.getStackInSlot(2).isItemEqual(itemstack)) - return false; - - int result = furnace.getStackInSlot(2).stackSize + itemstack.stackSize; - return result <= 64 && result <= itemstack.getMaxStackSize(); - } - } - + public boolean canFurnaceSmelt(TileEntityFurnace furnace){ + if(furnace.getStackInSlot(0) == null) + return false; + else { + ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnace.getStackInSlot(0)); + + if(itemstack == null) + return false; + + if(furnace.getStackInSlot(2) == null) + return true; + + if(!furnace.getStackInSlot(2).isItemEqual(itemstack)) + return false; + + int result = furnace.getStackInSlot(2).stackSize + itemstack.stackSize; + return result <= 64 && result <= itemstack.getMaxStackSize(); + } + } + + @Override public int getMaxMana() { return 300; } - + @Override public int getColor() { return 0x661600; } - + } diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java index 655ea8e06..9af834462 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java @@ -13,7 +13,6 @@ package vazkii.botania.common.block.subtile.functional; import java.util.List; -import cpw.mods.fml.common.network.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; @@ -21,16 +20,17 @@ import net.minecraft.util.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; +import cpw.mods.fml.common.network.PacketDispatcher; public class SubTileFallenKanade extends SubTileFunctional { @Override public void onUpdate() { super.onUpdate(); - + final int range = 5; final int cost = 20; - + List players = supertile.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range)); for(EntityPlayer player : players) { if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost) { @@ -40,20 +40,20 @@ public class SubTileFallenKanade extends SubTileFunctional { } } } - + @Override public int getColor() { return 0xFFFF00; } - + @Override public int getMaxMana() { return 60; } - + @Override public LexiconEntry getEntry() { return LexiconData.fallenKanade; } - + } diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java index d85d6216a..3ea127f14 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java @@ -39,7 +39,7 @@ import cpw.mods.fml.common.network.PacketDispatcher; public class SubTileHopperhock extends SubTileFunctional { private static final String TAG_FILTER_TYPE = "filterType"; - + int filterType = 0; private static final ForgeDirection[] VALID_DIRS = new ForgeDirection[] { @@ -51,7 +51,7 @@ public class SubTileHopperhock extends SubTileFunctional { super.onUpdate(); boolean pulledAny = false; - int range = mana > 0 ? 6 : 3; + int range = mana > 0 ? 6 : 3; int x = supertile.xCoord; int y = supertile.yCoord; @@ -82,11 +82,11 @@ public class SubTileHopperhock extends SubTileFunctional { if(canAccept) { boolean priority = !filter.isEmpty(); - + setInv : { if(priorityInv && !priority) break setInv; - + invToPutItemIn = inv; priorityInv = priority; sideToPutItemIn = dir.getOpposite(); @@ -162,36 +162,36 @@ public class SubTileHopperhock extends SubTileFunctional { return filter; } - + @Override public boolean onWanded(EntityPlayer player, ItemStack wand) { if(player.isSneaking()) { filterType = filterType == 2 ? 0 : filterType + 1; PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId); - + return true; } else return super.onWanded(player, wand); } - + @Override public void writeToPacketNBT(NBTTagCompound cmp) { super.writeToPacketNBT(cmp); - + cmp.setInteger(TAG_FILTER_TYPE, filterType); } - + @Override public void readFromPacketNBT(NBTTagCompound cmp) { super.readFromPacketNBT(cmp); - + filterType = cmp.getInteger(TAG_FILTER_TYPE); } - + @Override public void renderHUD(Minecraft mc, ScaledResolution res) { super.renderHUD(mc, res); - + int color = 0x66000000 | getColor(); String filter = StatCollector.translateToLocal("botaniamisc.filter" + filterType); GL11.glEnable(GL11.GL_BLEND); diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java index 3845f40b9..672765b89 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java @@ -15,7 +15,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import cpw.mods.fml.common.network.PacketDispatcher; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; @@ -26,48 +25,49 @@ import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; +import cpw.mods.fml.common.network.PacketDispatcher; public class SubtileOrechid extends SubTileFunctional { private static final int COST = 17500; - + @Override public void onUpdate() { super.onUpdate(); - + if(!supertile.worldObj.isRemote && mana >= COST && supertile.worldObj.getTotalWorldTime() % 100 == 0) { ChunkCoordinates coords = getCoordsToPut(); if(coords != null) { ItemStack stack = getOreToPut(); if(stack != null) { supertile.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, stack.itemID, stack.getItemDamage(), 1 | 2); - + mana -= COST; PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId); } } } } - + public ItemStack getOreToPut() { Collection values = new ArrayList(); for(String s : BotaniaAPI.oreWeights.keySet()) values.add(new StringRandomItem(BotaniaAPI.oreWeights.get(s), s)); - + String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.worldObj.rand, values)).s; - + List ores = OreDictionary.getOres(ore); if(ores.isEmpty()) return getOreToPut(); - + return ores.get(0); } - + public ChunkCoordinates getCoordsToPut() { List possibleCoords = new ArrayList(); int range = 5; int rangeY = 3; - + for(int i = -range; i < range; i++) for(int j = -rangeY; j < rangeY; j++) for(int k = -range; k < range; k++) { @@ -78,18 +78,18 @@ public class SubtileOrechid extends SubTileFunctional { Block block = Block.blocksList[id]; if(block != null && block.isGenMineableReplaceable(supertile.worldObj, x, y, z, Block.stone.blockID)) possibleCoords.add(new ChunkCoordinates(x, y, z)); - } - + } + if(possibleCoords.isEmpty()) return null; return possibleCoords.get(supertile.worldObj.rand.nextInt(possibleCoords.size())); } - + @Override public int getColor() { return 0x818181; } - + @Override public int getMaxMana() { return COST; @@ -99,15 +99,15 @@ public class SubtileOrechid extends SubTileFunctional { public LexiconEntry getEntry() { return LexiconData.orechid; } - + private static class StringRandomItem extends WeightedRandomItem { public String s; - + public StringRandomItem(int par1, String s) { super(par1); this.s = s; } - + } } diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java index e0621f475..8a2901895 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java @@ -13,23 +13,23 @@ package vazkii.botania.common.block.subtile.generating; import java.util.List; -import cpw.mods.fml.common.network.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.common.core.helper.ExperienceHelper; import vazkii.botania.common.lexicon.LexiconData; +import cpw.mods.fml.common.network.PacketDispatcher; public class SubTileArcaneRose extends SubTileGenerating { @Override public void onUpdate() { super.onUpdate(); - + if(mana >= getMaxMana()) return; - + List players = supertile.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - 1, supertile.yCoord, supertile.zCoord - 1, supertile.xCoord + 2, supertile.yCoord + 1, supertile.zCoord + 2)); for(EntityPlayer player : players) if(ExperienceHelper.getPlayerXP(player) >= 1 && player.onGround) { @@ -39,20 +39,20 @@ public class SubTileArcaneRose extends SubTileGenerating { return; } } - + @Override public int getColor() { return 0xFF8EF8; } - + @Override public int getMaxMana() { return 200; } - + @Override public LexiconEntry getEntry() { return LexiconData.arcaneRose; } - + } diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java index 77a7226cc..40314bbab 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java @@ -21,7 +21,7 @@ public class SubTileDaybloom extends SubTileGenerating { public int getColor() { return 0xFFFF00; } - + @Override public boolean shouldSyncPassiveGeneration() { return true; diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java index 9372015d6..4680ba008 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java @@ -46,7 +46,7 @@ public class SubTileEndoflame extends SubTileGenerating { ItemStack stack = item.getEntityItem(); if(stack.getItem().hasContainerItem()) continue; - + int burnTime = stack == null || stack.itemID == ModBlocks.spreader.blockID ? 0 : TileEntityFurnace.getItemBurnTime(stack); if(burnTime > 0 && stack.stackSize > 0) { this.burnTime = burnTime / 2; diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java index 8da2aad34..44546e085 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java @@ -57,7 +57,7 @@ public class SubTileHydroangeas extends SubTileGenerating { burnTime--; } } - + public void doBurnParticles() { Botania.proxy.wispFX(supertile.worldObj, supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60); } @@ -65,7 +65,7 @@ public class SubTileHydroangeas extends SubTileGenerating { public int getIdToSearchFor() { return Block.waterStill.blockID; } - + public int getBurnTime() { return 10; } diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java index e6d297ad3..ac56a0569 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java @@ -15,23 +15,23 @@ import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.lexicon.LexiconData; public class SubTileNightshade extends SubTileDaybloom { - + @Override public int getDelayBetweenPassiveGeneration() { return super.getDelayBetweenPassiveGeneration() * 2; } - + @Override public boolean canGeneratePassively() { System.out.println(!super.canGeneratePassively()); return !super.canGeneratePassively(); } - + @Override public int getColor() { return 0x3D2A90; } - + @Override public LexiconEntry getEntry() { return LexiconData.nightshade; diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java index bdc398b5c..3398bd43b 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java @@ -27,35 +27,35 @@ public class SubTileThermalily extends SubTileHydroangeas { public LexiconEntry getEntry() { return LexiconData.thermalily; } - + @Override public void doBurnParticles() { Botania.proxy.wispFX(supertile.worldObj, supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.9 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); } - + @Override public int getIdToSearchFor() { return Block.lavaStill.blockID; } - + @Override public int getDelayBetweenPassiveGeneration() { return 1; } - + @Override public int getBurnTime() { return 5000; } - + @Override public int getValueForPassiveGeneration() { return 5; } - + @Override public int getMaxMana() { return 250; } - + } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileAltar.java b/MODSRC/vazkii/botania/common/block/tile/TileAltar.java index 614edfe9f..b16f35c96 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileAltar.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileAltar.java @@ -20,7 +20,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.fluids.FluidRegistry; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.recipe.IFlowerComponent; import vazkii.botania.api.recipe.RecipePetals; @@ -38,7 +37,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory { ItemStack stack = item.getEntityItem(); if(stack == null) return false; - + if(!hasWater) { if(stack.itemID == Item.bucketWater.itemID) { hasWater = true; @@ -46,7 +45,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory { PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId); } else return false; } - + boolean didChange = false; if(stack.getItem() instanceof IFlowerComponent) { diff --git a/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java b/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java index 86395e73b..2100c38b3 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java @@ -43,7 +43,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver { public int stage = 0; public int stageTicks = 0; - + public int stage3EndTicks = 0; int manaRequired = -1; @@ -61,13 +61,13 @@ public class TileEnchanter extends TileMod implements IManaReceiver { { -2, -1, 0 }, { -2, -1, 1 }, { -2, -1, -1 } }; - private static final int[][][] PYLON_LOCATIONS = new int[][][] { - { { -5, 1, 0 }, { 5, 1, 0 }, { -4, 1, 3 }, { 4, 1, 3 }, { -4, 1, -3 }, { 4, 1, -3 } }, + private static final int[][][] PYLON_LOCATIONS = new int[][][] { + { { -5, 1, 0 }, { 5, 1, 0 }, { -4, 1, 3 }, { 4, 1, 3 }, { -4, 1, -3 }, { 4, 1, -3 } }, { { 0, 1, -5 }, { 0, 1, 5 }, { 3, 1, -4 }, { 3, 1, 4 }, { -3, 1, -4 }, { -3, 1, 4 } } }; private static final int[][] FLOWER_LOCATIONS = new int[][] { - { -1, 0, -1 }, { 1, 0, -1 }, { -1, 0, 1 }, { 1, 0, 1 } + { -1, 0, -1 }, { 1, 0, -1 }, { -1, 0, 1 }, { 1, 0, 1 } }; public void onWanded(EntityPlayer player, ItemStack wand) { @@ -159,18 +159,18 @@ public class TileEnchanter extends TileMod implements IManaReceiver { pylonTile.centerZ = zCoord; } } - + if(manaRequired == -1) { manaRequired = 0; for(EnchantmentData data : enchants) { Enchantment ench = Enchantment.enchantmentsList[data.enchant]; - manaRequired += (int) (3000F * ((15 - ench.getWeight()) * 1.45F) * ((3F + (data.level * data.level)) * 0.25F) * (0.9F + enchants.size() * 0.05F)); + manaRequired += (int) (3000F * ((15 - ench.getWeight()) * 1.45F) * ((3F + data.level * data.level) * 0.25F) * (0.9F + enchants.size() * 0.05F)); } } else if(mana >= manaRequired) { manaRequired = 0; for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) ((TilePylon) worldObj.getBlockTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2])).activated = false; - + advanceStage(); } else { getManaFromPools : { @@ -186,12 +186,12 @@ public class TileEnchanter extends TileMod implements IManaReceiver { PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), worldObj.provider.dimensionId); sync(); } - + if(mana >= manaRequired) break getManaFromPools; } } - } + } } break; @@ -224,7 +224,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver { public void advanceStage() { stage++; - + if(stage == 4) stage3EndTicks = stageTicks; else if(stage == 5) { @@ -258,7 +258,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver { @Override public void recieveMana(int mana) { - this.mana = Math.min(manaRequired, this.mana + mana); + this.mana = Math.min(manaRequired, this.mana + mana); } @Override @@ -341,7 +341,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver { return false; for(int[] pylon : PYLON_LOCATIONS[meta]) - if(world.getBlockId(pylon[0] + x, pylon[1] + y, pylon[2] + z) != ModBlocks.pylon.blockID || + if(world.getBlockId(pylon[0] + x, pylon[1] + y, pylon[2] + z) != ModBlocks.pylon.blockID || world.getBlockId(pylon[0] + x, pylon[1] + y - 1, pylon[2] + z) != ModBlocks.flower.blockID) return false; diff --git a/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java b/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java index 5146f5e21..1f0d06fb9 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java @@ -26,7 +26,7 @@ public class TileManaDetector extends TileMod implements IManaCollisionGhost { worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, expectedMeta, 1 | 2); } } - + @Override public boolean isGhost() { return true; diff --git a/MODSRC/vazkii/botania/common/block/tile/TilePylon.java b/MODSRC/vazkii/botania/common/block/tile/TilePylon.java index 8ec617e82..aaf054b0c 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TilePylon.java +++ b/MODSRC/vazkii/botania/common/block/tile/TilePylon.java @@ -29,7 +29,7 @@ public class TilePylon extends TileEntity { activated = false; return; } - + Vector3 centerBlock = new Vector3(centerX + 0.5, centerY + 0.75 + (Math.random() - 0.5 * 0.25), centerZ + 0.5); int id = worldObj.getBlockId(xCoord, yCoord - 1, zCoord); diff --git a/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java b/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java index 3592d7c5e..6fa314013 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -94,7 +94,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor } this.manaToGet = 0; } - + if(manaToGet != this.manaToGet) { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.orb", 1F, 1F); PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId); @@ -144,7 +144,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor craftingFanciness(); } } - + updateRecipe(); } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java b/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java index aef60ff99..18d33cde8 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java @@ -58,10 +58,10 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector boolean added = false; IManaReceiver receiver = null; - + public int lastBurstDeathTick = -1; public int burstParticleTick = 0; - + @Override public boolean isFull() { return mana >= MAX_MANA; diff --git a/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java b/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java index 913f7cd59..8e2091c82 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java @@ -11,12 +11,6 @@ */ package vazkii.botania.common.block.tile; -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.common.network.PacketDispatcher; -import vazkii.botania.api.mana.IManaPool; -import vazkii.botania.client.core.handler.HUDHandler; -import vazkii.botania.common.block.ModBlocks; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; @@ -24,17 +18,20 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.ForgeDirection; +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.common.network.PacketDispatcher; + public class TileTurntable extends TileMod { private static final String TAG_SPEED = "speed"; private static final String TAG_BACKWARDS = "backwards"; - + int speed = 1; boolean backwards = false; - + @Override public void updateEntity() { boolean redstone = false; @@ -44,37 +41,37 @@ public class TileTurntable extends TileMod { if(redstoneSide > 0) redstone = true; } - + if(!redstone) { TileEntity tile = worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord); if(tile instanceof TileSpreader) { TileSpreader spreader = (TileSpreader) tile; - spreader.rotationX += (speed * (backwards ? -1 : 1)); + spreader.rotationX += speed * (backwards ? -1 : 1); if(spreader.rotationX >= 360F) spreader.rotationX -= 360F; } } } - + @Override public void writeCustomNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_SPEED, speed); cmp.setBoolean(TAG_BACKWARDS, backwards); } - + @Override public void readCustomNBT(NBTTagCompound cmp) { speed = cmp.getInteger(TAG_SPEED); backwards = cmp.getBoolean(TAG_BACKWARDS); } - + public void onWanded(EntityPlayer player, ItemStack wand) { if(player.isSneaking()) backwards = !backwards; else speed = speed == 6 ? 1 : speed + 1; PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId); } - + public void renderHUD(Minecraft mc, ScaledResolution res) { int color = 0xAA006600; @@ -82,7 +79,7 @@ public class TileTurntable extends TileMod { String speed = EnumChatFormatting.BOLD + ""; for(int i = 0; i < this.speed; i++) speed = speed + motion; - + int x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(speed) / 2; int y = res.getScaledHeight() / 2 - 15; GL11.glEnable(GL11.GL_BLEND); diff --git a/MODSRC/vazkii/botania/common/block/vanilla/BlockFlowerOverride.java b/MODSRC/vazkii/botania/common/block/vanilla/BlockFlowerOverride.java index 4f75bdc4e..cfc623f7a 100644 --- a/MODSRC/vazkii/botania/common/block/vanilla/BlockFlowerOverride.java +++ b/MODSRC/vazkii/botania/common/block/vanilla/BlockFlowerOverride.java @@ -11,15 +11,15 @@ */ package vazkii.botania.common.block.vanilla; -import vazkii.botania.client.lib.LibRenderIDs; import net.minecraft.block.BlockFlower; +import vazkii.botania.client.lib.LibRenderIDs; public class BlockFlowerOverride extends BlockFlower { public BlockFlowerOverride(int par1) { super(par1); } - + @Override public int getRenderType() { return LibRenderIDs.idSpecialFlower; diff --git a/MODSRC/vazkii/botania/common/block/vanilla/BlockSnowOverride.java b/MODSRC/vazkii/botania/common/block/vanilla/BlockSnowOverride.java index 0b808521e..3c62d861c 100644 --- a/MODSRC/vazkii/botania/common/block/vanilla/BlockSnowOverride.java +++ b/MODSRC/vazkii/botania/common/block/vanilla/BlockSnowOverride.java @@ -17,13 +17,13 @@ import net.minecraft.world.IBlockAccess; public class BlockSnowOverride extends BlockSnow { public static int forcedMeta = -1; - + public BlockSnowOverride(int par1) { super(par1); } - + @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { if(forcedMeta != -1) { setBlockBoundsForSnowDepth(forcedMeta); forcedMeta = -1; diff --git a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java index fcc45a4d5..fc72b13ca 100644 --- a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java @@ -41,11 +41,11 @@ public final class ConfigHandler { Property subtlePowerSystemProp = config.get(Configuration.CATEGORY_GENERAL, "powerSystem.subtle", false); subtlePowerSystemProp.comment = "Set to true to set the power system's particles to be a lot more subtle. Good for low-end systems, if the particles are causing lag."; subtlePowerSystem = subtlePowerSystemProp.getBoolean(false); - + Property staticWandBeamProp = config.get(Configuration.CATEGORY_GENERAL, "wandBeam.static", false); staticWandBeamProp.comment = "Set to true to use a static wand beam that shows every single position of the burst, similar to the way it used to work on old botania versions. Warning: Disabled by default because it may be laggy."; staticWandBeam = staticWandBeamProp.getBoolean(false); - + Property overrideVanillaBlocksProp = config.get(Configuration.CATEGORY_GENERAL, "override.vanillaBlocks", true); overrideVanillaBlocksProp.comment = "Set to false to remove the overriding of vanilla blocks (snow, red and yellow flowers). Setting this to false will remove the snow on flowers tweak."; overrideVanillaBlocks = overrideVanillaBlocksProp.getBoolean(true); diff --git a/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java b/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java index fed870879..c34cabadc 100644 --- a/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java +++ b/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java @@ -35,7 +35,7 @@ public class ExperienceHelper { public static int getExperienceForLevel(int level) { if (level == 0) return 0; - + if (level > 0 && level < 16) return level * 17; else if (level > 15 && level < 31) diff --git a/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java b/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java index 85086ef88..cceb1b9a7 100644 --- a/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java +++ b/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java @@ -111,24 +111,24 @@ public class InventoryHelper { } public static int testInventoryInsertion(IInventory inventory, ItemStack item, ForgeDirection side) { - if (item == null || item.stackSize == 0) + if (item == null || item.stackSize == 0) return 0; item = item.copy(); - - if (inventory == null) + + if (inventory == null) return 0; - + int slotCount = inventory.getSizeInventory(); int itemSizeCounter = item.stackSize; for (int i = 0; i < slotCount && itemSizeCounter > 0; i++) { - if (!inventory.isItemValidForSlot(i, item)) + if (!inventory.isItemValidForSlot(i, item)) continue; - + if(side != ForgeDirection.UNKNOWN && inventory instanceof ISidedInventory) if(!((ISidedInventory)inventory).canInsertItem(i, item, side.ordinal())) continue; - + ItemStack inventorySlot = inventory.getStackInSlot(i); if (inventorySlot == null) itemSizeCounter -= Math.min(Math.min(itemSizeCounter, inventory.getInventoryStackLimit()), item.getMaxStackSize()); @@ -141,10 +141,10 @@ public class InventoryHelper { itemSizeCounter = Math.max(itemSizeCounter, 0); return item.stackSize - itemSizeCounter; } - + return 0; } - + public static IInventory getInventory(World world, int x, int y, int z) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if(tileEntity instanceof TileEntityChest) { diff --git a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java index bac79f11e..08b35b8ab 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java @@ -192,10 +192,10 @@ public final class ModCrafingRecipes { addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 10), new ItemStack(ModItems.lens), "ingotIron", "ingotGold"); recipeLensMagnet = BotaniaAPI.getLatestAddedRecipe(); - + addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 11), new ItemStack(ModItems.lens), LibOreDict.RUNE[14]); recipeLensExplosive = BotaniaAPI.getLatestAddedRecipe(); - + // Unstable Block Recipes for(int i = 0; i < 16; i++) addOreDictRecipe(new ItemStack(ModBlocks.unstableBlock, 2, i), @@ -282,17 +282,17 @@ public final class ModCrafingRecipes { 'S', LibOreDict.LIVING_ROCK, 'D', LibOreDict.MANA_DIAMOND); recipesManaTablet = BotaniaAPI.getLatestAddedRecipes(2); - + // Mana Detector Recipe - addOreDictRecipe(new ItemStack(ModBlocks.manaDetector), + addOreDictRecipe(new ItemStack(ModBlocks.manaDetector), "RSR", "SCS", "RSR", 'R', new ItemStack(Item.redstone), 'C', new ItemStack(Item.comparator), 'S', LibOreDict.LIVING_ROCK); recipeManaDetector = BotaniaAPI.getLatestAddedRecipe(); - + // Mana Blaster Recipe - addOreDictRecipe(new ItemStack(ModItems.manaGun), + addOreDictRecipe(new ItemStack(ModItems.manaGun), "SMD", " WT", " W", 'S', new ItemStack(ModBlocks.spreader), 'M', LibOreDict.RUNE[8], @@ -300,9 +300,9 @@ public final class ModCrafingRecipes { 'T', new ItemStack(Block.tnt), 'W', LibOreDict.LIVING_WOOD); recipeManaBlaster = BotaniaAPI.getLatestAddedRecipe(); - + // Spreader Turntable Recipe - addOreDictRecipe(new ItemStack(ModBlocks.turntable), + addOreDictRecipe(new ItemStack(ModBlocks.turntable), "WWW", "WPW", "WWW", 'W', LibOreDict.LIVING_WOOD, 'P', Block.pistonStickyBase); diff --git a/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java index b90da6665..e6de1c3a6 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java @@ -51,7 +51,7 @@ public final class ModPetalRecipes { hydroangeasRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HYDROANGEAS), blueMana, blue, pink, lightBlue); thermalilyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_THERMALILY), red, orangeMana, orange, runeEarth, runeFire); arcaneRoseRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ARCANE_ROSE), pink, pinkMana, pinkMana, lime, purple, purpleMana, runeMana); - + jadedAmaranthusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_JADED_AMARANTHUS), purpleMana, purpleMana, lime, purple, green, runeSpring); bellethorneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN), redMana, redMana, cyan, cyan, red); heiseiDreamRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HEISEI_DREAM), purpleMana, pinkMana, magentaMana, purple, pink, magenta, runeWrath); diff --git a/MODSRC/vazkii/botania/common/crafting/ModRuneRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModRuneRecipes.java index 90e2eba6b..ace3d9283 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModRuneRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModRuneRecipes.java @@ -48,7 +48,7 @@ public final class ModRuneRecipes { recipeWaterRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 0), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.reed), new ItemStack(Item.fishingRod)); recipeFireRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 1), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Item.blazeRod), new ItemStack(Item.gunpowder), new ItemStack(Item.netherStalkSeeds)); - + recipesEarthRune = new ArrayList(); recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 2), costTier1, LibOreDict.MANA_STEEL, "stone", new ItemStack(Block.dirt), new ItemStack(Block.mushroomBrown))); recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 2), costTier1, LibOreDict.MANA_STEEL, "stone", new ItemStack(Block.dirt), new ItemStack(Block.mushroomRed))); diff --git a/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java b/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java index d594614e3..43f40667e 100644 --- a/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java +++ b/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java @@ -101,9 +101,9 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { setBurstSourceCoords(0, -1, 0); setLocationAndAngles(player.posX, player.posY + player.getEyeHeight(), player.posZ, player.rotationYaw + 180, -player.rotationPitch); - posX -= (double)(MathHelper.cos((rotationYaw + 180) / 180.0F * (float) Math.PI) * 0.16F); + posX -= MathHelper.cos((rotationYaw + 180) / 180.0F * (float) Math.PI) * 0.16F; posY -= 0.10000000149011612D; - posZ -= (double)(MathHelper.sin((rotationYaw + 180) / 180.0F * (float) Math.PI) * 0.16F); + posZ -= MathHelper.sin((rotationYaw + 180) / 180.0F * (float) Math.PI) * 0.16F; setPosition(posX, posY, posZ); yOffset = 0.0F; @@ -231,21 +231,21 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { double d2 = 999.0D; if (i > l) - d0 = (double)l + 1.0D; + d0 = l + 1.0D; else if (i < l) - d0 = (double)l + 0.0D; + d0 = l + 0.0D; else flag2 = false; if (j > i1) - d1 = (double)i1 + 1.0D; + d1 = i1 + 1.0D; else if (j < i1) - d1 = (double)i1 + 0.0D; + d1 = i1 + 0.0D; else flag3 = false; if (k > j1) - d2 = (double)j1 + 1.0D; + d2 = j1 + 1.0D; else if (k < j1) - d2 = (double)j1 + 0.0D; + d2 = j1 + 0.0D; else flag4 = false; double d3 = 999.0D; @@ -293,21 +293,21 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } Vec3 vec32 = new Vector3(par1Vec3.xCoord, par1Vec3.yCoord, par1Vec3.zCoord).toVec3D(); - l = (int)(vec32.xCoord = (double)MathHelper.floor_double(par1Vec3.xCoord)); + l = (int)(vec32.xCoord = MathHelper.floor_double(par1Vec3.xCoord)); if (b0 == 5) { --l; ++vec32.xCoord; } - i1 = (int)(vec32.yCoord = (double)MathHelper.floor_double(par1Vec3.yCoord)); + i1 = (int)(vec32.yCoord = MathHelper.floor_double(par1Vec3.yCoord)); if (b0 == 1) { --i1; ++vec32.yCoord; } - j1 = (int)(vec32.zCoord = (double)MathHelper.floor_double(par1Vec3.zCoord)); + j1 = (int)(vec32.zCoord = MathHelper.floor_double(par1Vec3.zCoord)); if (b0 == 3) { --j1; @@ -675,7 +675,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { ChunkCoordinates coords = getBurstSourceChunkCoordinates(); TileEntity tile = worldObj.getBlockTileEntity(coords.posX, coords.posY, coords.posZ); if(tile != null && tile instanceof TileSpreader) - return (getMana() != getStartingMana() && fullManaLastTick) || Math.abs(((TileSpreader) tile).burstParticleTick - ticksExisted) < 4; + return getMana() != getStartingMana() && fullManaLastTick || Math.abs(((TileSpreader) tile).burstParticleTick - ticksExisted) < 4; return false; } diff --git a/MODSRC/vazkii/botania/common/item/ItemLens.java b/MODSRC/vazkii/botania/common/item/ItemLens.java index 53d7da665..f6afd5599 100644 --- a/MODSRC/vazkii/botania/common/item/ItemLens.java +++ b/MODSRC/vazkii/botania/common/item/ItemLens.java @@ -52,10 +52,10 @@ import cpw.mods.fml.common.registry.GameRegistry; public class ItemLens extends ItemMod implements ILens { private static final int NORMAL = 0, SPEED = 1, POWER = 2, TIME = 3, EFFICIENCY = 4, - BOUNCE = 5, GRAVITY = 6, MINE = 7, DAMAGE = 8, PHANTOM = 9, + BOUNCE = 5, GRAVITY = 6, MINE = 7, DAMAGE = 8, PHANTOM = 9, MAGNET = 10, EXPLOSIVE = 11; - private static final Map> blacklist = new HashMap(); + private static final Map> blacklist = new HashMap(); static { blacklistLenses(POWER, EXPLOSIVE); @@ -64,7 +64,7 @@ public class ItemLens extends ItemMod implements ILens { blacklistLenses(PHANTOM, EXPLOSIVE); blacklistLenses(PHANTOM, BOUNCE); } - + private static final String TAG_COLOR = "color"; private static final String TAG_COMPOSITE_LENS = "compositeLens"; @@ -128,12 +128,12 @@ public class ItemLens extends ItemMod implements ILens { if(storedColor != -1) par3List.add(String.format(StatCollector.translateToLocal("botaniamisc.color"), StatCollector.translateToLocal("botania.color" + storedColor))); } - + public String getItemShortTermName(ItemStack stack) { return StatCollector.translateToLocal(stack.getUnlocalizedName() + ".short"); } - + @Override public String getItemDisplayName(ItemStack stack) { ItemStack compositeLens = getCompositeLens(stack); @@ -141,13 +141,13 @@ public class ItemLens extends ItemMod implements ILens { return super.getItemDisplayName(stack); return String.format(StatCollector.translateToLocal("item.botania:compositeLens.name"), getItemShortTermName(stack), getItemShortTermName(compositeLens)); } - + @Override public void apply(ItemStack stack, BurstProperties props) { int storedColor = getStoredColor(stack); if(storedColor != -1) props.color = getLensColor(stack); - + switch(stack.getItemDamage()) { case SPEED : { props.motionModifier *= 2F; @@ -178,7 +178,7 @@ public class ItemLens extends ItemMod implements ILens { break; } } - + ItemStack compositeLens = getCompositeLens(stack); if(compositeLens != null && compositeLens.getItem() instanceof ILens) ((ILens) compositeLens.getItem()).apply(compositeLens, props); @@ -257,20 +257,20 @@ public class ItemLens extends ItemMod implements ILens { } break; } - case EXPLOSIVE : { + case EXPLOSIVE : { if(!burst.isFake()) { ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ)) - entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, (float) burst.getMana() / 50F, true); + entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true); } else dead = false; } - break; + break; } - + ItemStack compositeLens = getCompositeLens(stack); if(compositeLens != null && compositeLens.getItem() instanceof ILens) dead = ((ILens) compositeLens.getItem()).collideBurst(burst, pos, isManaBlock, dead, compositeLens); - + return dead; } @@ -296,7 +296,7 @@ public class ItemLens extends ItemMod implements ILens { for(int k = -range; k < range; k++) if(entity.worldObj.getBlockTileEntity(i + x, j + y, k + z) instanceof IManaReceiver) { TileEntity tile = entity.worldObj.getBlockTileEntity(i + x, j + y, k + z); - + if(magnetized) { int magX = entity.getEntityData().getInteger("Botania:MagnetizedX"); int magY = entity.getEntityData().getInteger("Botania:MagnetizedY"); @@ -304,7 +304,7 @@ public class ItemLens extends ItemMod implements ILens { if(tile.xCoord != magX || tile.yCoord != magY || tile.zCoord != magZ) continue; } - + IManaReceiver receiver = (IManaReceiver) tile; ChunkCoordinates srcCoords = burst.getBurstSourceChunkCoordinates(); @@ -314,7 +314,7 @@ public class ItemLens extends ItemMod implements ILens { Vector3 tileVec = Vector3.fromTileEntityCenter(tile).add(0, -0.1, 0); Vector3 motionVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ); - Vector3 normalMotionVec = motionVec.copy().normalize(); + Vector3 normalMotionVec = motionVec.copy().normalize(); Vector3 magnetVec = tileVec.sub(burstVec).normalize(); Vector3 differenceVec = normalMotionVec.sub(magnetVec).multiply(motionVec.mag() * 0.1); @@ -326,7 +326,7 @@ public class ItemLens extends ItemMod implements ILens { entity.getEntityData().setInteger("Botania:MagnetizedY", tile.yCoord); entity.getEntityData().setInteger("Botania:MagnetizedZ", tile.zCoord); } - + burst.setMotion(finalMotionVec.x, finalMotionVec.y, finalMotionVec.z); break magnetize; } @@ -334,7 +334,7 @@ public class ItemLens extends ItemMod implements ILens { } } } - + ItemStack compositeLens = getCompositeLens(stack); if(compositeLens != null && compositeLens.getItem() instanceof ILens) ((ILens) compositeLens.getItem()).updateBurst(burst, compositeLens); @@ -371,24 +371,24 @@ public class ItemLens extends ItemMod implements ILens { return true; } - + public static void blacklistLenses(int lens1, int lens2) { blacklistLenses(lens1, lens2, true); } - + public static void blacklistLenses(int lens1, int lens2, boolean recursive) { if(!blacklist.containsKey(lens1)) blacklist.put(lens1, new ArrayList()); blacklist.get(lens1).add(lens2); - + if(recursive) blacklistLenses(lens2, lens1, false); } - + public static boolean isBlacklisted(int lens1, int lens2) { if(!blacklist.containsKey(lens1)) return false; - + return blacklist.get(lens1).contains(lens2); } @@ -396,16 +396,16 @@ public class ItemLens extends ItemMod implements ILens { public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens) { if(sourceLens.getItemDamage() == compositeLens.getItemDamage()) return false; - + if(sourceLens.getItemDamage() == NORMAL || compositeLens.getItemDamage() == NORMAL) return false; - + if(isBlacklisted(sourceLens.getItemDamage(), compositeLens.getItemDamage())) return false; - + return true; } - + @Override public ItemStack getCompositeLens(ItemStack stack) { NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_COMPOSITE_LENS, false); @@ -418,7 +418,7 @@ public class ItemLens extends ItemMod implements ILens { NBTTagCompound cmp = new NBTTagCompound(); compositeLens.writeToNBT(cmp); ItemNBTHelper.setCompound(sourceLens, TAG_COMPOSITE_LENS, cmp); - + return sourceLens; } } diff --git a/MODSRC/vazkii/botania/common/item/ItemManaGun.java b/MODSRC/vazkii/botania/common/item/ItemManaGun.java index 6c7a51930..0bfb669a1 100644 --- a/MODSRC/vazkii/botania/common/item/ItemManaGun.java +++ b/MODSRC/vazkii/botania/common/item/ItemManaGun.java @@ -33,14 +33,14 @@ public class ItemManaGun extends ItemMod { private static final String TAG_LENS = "lens"; private static final int COOLDOWN = 30; - + public ItemManaGun() { super(LibItemIDs.idManaGun); setMaxDamage(COOLDOWN); setMaxStackSize(1); setNoRepair(); setUnlocalizedName(LibItemNames.MANA_GUN); - + GameRegistry.addRecipe(new ManaGunLensRecipe()); } @@ -67,7 +67,7 @@ public class ItemManaGun extends ItemMod { else setLens(par1ItemStack, null); } } - + return par1ItemStack; } @@ -86,7 +86,7 @@ public class ItemManaGun extends ItemMod { if(lens != null) ((ILens) lens.getItem()).apply(lens, props); - + burst.setSourceLens(lens); if(ManaItemHandler.requestManaExact(stack, player, props.maxMana, false)) { burst.setColor(props.color); @@ -101,7 +101,7 @@ public class ItemManaGun extends ItemMod { } return null; } - + @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ItemStack lens = getLens(par1ItemStack); @@ -111,20 +111,20 @@ public class ItemManaGun extends ItemMod { par3List.addAll(tooltip.subList(1, tooltip.size())); } } - + @Override public String getItemDisplayName(ItemStack par1ItemStack) { ItemStack lens = getLens(par1ItemStack); return super.getItemDisplayName(par1ItemStack) + (lens == null ? "" : " (" + EnumChatFormatting.GREEN + lens.getDisplayName() + EnumChatFormatting.RESET + ")"); } - + public static void setLens(ItemStack stack, ItemStack lens) { NBTTagCompound cmp = new NBTTagCompound(); if(lens != null) lens.writeToNBT(cmp); ItemNBTHelper.setCompound(stack, TAG_LENS, cmp); } - + public static ItemStack getLens(ItemStack stack) { NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_LENS, true); if(cmp != null) { diff --git a/MODSRC/vazkii/botania/common/item/ItemManaTablet.java b/MODSRC/vazkii/botania/common/item/ItemManaTablet.java index f432efe43..bffbf5077 100644 --- a/MODSRC/vazkii/botania/common/item/ItemManaTablet.java +++ b/MODSRC/vazkii/botania/common/item/ItemManaTablet.java @@ -33,7 +33,7 @@ public class ItemManaTablet extends ItemMod implements IManaItem { Icon[] icons; private static final int MAX_MANA = 500000; - + private static final String TAG_MANA = "mana"; private static final String TAG_CREATIVE = "creative"; @@ -47,11 +47,11 @@ public class ItemManaTablet extends ItemMod implements IManaItem { @Override public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 10000)); - + ItemStack fullPower = new ItemStack(par1, 1, 1); setMana(fullPower, MAX_MANA); par3List.add(fullPower); - + ItemStack creative = new ItemStack(par1, 1, 0); setMana(creative, MAX_MANA); setStackCreative(creative); @@ -92,12 +92,12 @@ public class ItemManaTablet extends ItemMod implements IManaItem { if(isStackCreative(par1ItemStack)) par3List.add(StatCollector.translateToLocal("botaniamisc.creative")); } - + @Override public boolean requiresMultipleRenderPasses() { return true; } - + @Override public int getEntityLifespan(ItemStack itemStack, World world) { return Integer.MAX_VALUE; @@ -106,11 +106,11 @@ public class ItemManaTablet extends ItemMod implements IManaItem { public static void setMana(ItemStack stack, int mana) { ItemNBTHelper.setInt(stack, TAG_MANA, mana); } - + public static void setStackCreative(ItemStack stack) { ItemNBTHelper.setBoolean(stack, TAG_CREATIVE, true); } - + public static boolean isStackCreative(ItemStack stack) { return ItemNBTHelper.getBoolean(stack, TAG_CREATIVE, false); } diff --git a/MODSRC/vazkii/botania/common/item/ItemTwigWand.java b/MODSRC/vazkii/botania/common/item/ItemTwigWand.java index 25d480c63..9ac2cbb19 100644 --- a/MODSRC/vazkii/botania/common/item/ItemTwigWand.java +++ b/MODSRC/vazkii/botania/common/item/ItemTwigWand.java @@ -55,7 +55,7 @@ public class ItemTwigWand extends Item16Colors { meta = 0; else if(TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 1)) meta = 1; - + if(meta != -1 && !par3World.isRemote) { par3World.setBlock(par4, par5, par6, ModBlocks.enchanter.blockID, meta, 1 | 2); par3World.playSoundEffect(par4, par5, par6, "random.levelup", 0.5F, 0.6F); @@ -63,11 +63,11 @@ public class ItemTwigWand extends Item16Colors { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); - + double x = (Math.random() - 0.5) * 6; double y = (Math.random() - 0.5) * 6; double z = (Math.random() - 0.5) * 6; - + float velMul = 0.07F; Botania.proxy.wispFX(par3World, par4 + 0.5 + x, par5 + 0.5 + y, par6 + 0.5 + z, red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul); @@ -77,7 +77,7 @@ public class ItemTwigWand extends Item16Colors { boolean wanded = ((IWandable) Block.blocksList[id]).onUsedByWand(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6, par7); if(wanded && par3World.isRemote) par2EntityPlayer.swingItem(); - + return wanded; } else if(BlockPistonRelay.InternalTickHandler.playerPositions.containsKey(par2EntityPlayer.username)) { diff --git a/MODSRC/vazkii/botania/common/item/recipe/CompositeLensRecipe.java b/MODSRC/vazkii/botania/common/item/recipe/CompositeLensRecipe.java index c87f94f2c..104c1e4c6 100644 --- a/MODSRC/vazkii/botania/common/item/recipe/CompositeLensRecipe.java +++ b/MODSRC/vazkii/botania/common/item/recipe/CompositeLensRecipe.java @@ -27,7 +27,7 @@ public class CompositeLensRecipe implements IRecipe { boolean foundLens = false; boolean foundSecondLens = false; boolean foundSlimeball = false; - + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); if(stack != null) { @@ -48,7 +48,7 @@ public class CompositeLensRecipe implements IRecipe { public ItemStack getCraftingResult(InventoryCrafting var1) { ItemStack lens = null; ItemStack secondLens = null; - + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); if(stack != null) { @@ -63,10 +63,10 @@ public class CompositeLensRecipe implements IRecipe { ILens lensItem = (ILens) lens.getItem(); if(secondLens == null || !lensItem.canCombineLenses(lens, secondLens) || lensItem.getCompositeLens(lens) != null || lensItem.getCompositeLens(secondLens) != null) return null; - + ItemStack lensCopy = lens.copy(); ((ItemLens) ModItems.lens).setCompositeLens(lensCopy, secondLens); - + return lensCopy; } diff --git a/MODSRC/vazkii/botania/common/item/recipe/ManaGunLensRecipe.java b/MODSRC/vazkii/botania/common/item/recipe/ManaGunLensRecipe.java index f2160cf1b..30e555298 100644 --- a/MODSRC/vazkii/botania/common/item/recipe/ManaGunLensRecipe.java +++ b/MODSRC/vazkii/botania/common/item/recipe/ManaGunLensRecipe.java @@ -24,7 +24,7 @@ public class ManaGunLensRecipe implements IRecipe { public boolean matches(InventoryCrafting var1, World var2) { boolean foundLens = false; boolean foundGun = false; - + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); if(stack != null) { @@ -45,7 +45,7 @@ public class ManaGunLensRecipe implements IRecipe { public ItemStack getCraftingResult(InventoryCrafting var1) { ItemStack lens = null; ItemStack gun = null; - + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); if(stack != null) { @@ -58,10 +58,10 @@ public class ManaGunLensRecipe implements IRecipe { if(lens == null || gun == null) return null; - + ItemStack gunCopy = gun.copy(); ItemManaGun.setLens(gunCopy, lens); - + return gunCopy; } diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index 3ad468f46..d1db0848f 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -66,7 +66,7 @@ public final class LexiconData { public static LexiconEntry manaTransport; public static LexiconEntry manaDetector; public static LexiconEntry compositeLens; - + public static LexiconEntry functionalIntro; public static LexiconEntry jadedAmaranthus; public static LexiconEntry bellethorne; @@ -167,13 +167,13 @@ public final class LexiconData { lensPhantom = new BLexiconEntry(LibLexicon.MANA_LENS_PHANTOM, categoryMana); lensPhantom.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLensPhantom)); - + lensMagnet = new BLexiconEntry(LibLexicon.MANA_LENS_MAGNET, categoryMana); lensMagnet.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLensMagnet)); - + lensExplosive = new BLexiconEntry(LibLexicon.MANA_LENS_EXPLOSIVE, categoryMana); lensExplosive.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLensExplosive)); - + manaVoid = new BLexiconEntry(LibLexicon.MANA_VOID, categoryMana); manaVoid.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManaVoid)); @@ -182,10 +182,10 @@ public final class LexiconData { manaDetector = new BLexiconEntry(LibLexicon.MANA_DETECTOR, categoryMana); manaDetector.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManaDetector)); - + compositeLens = new BLexiconEntry(LibLexicon.MANA_COMPOSITE_LENS, categoryMana); compositeLens.setLexiconPages(new PageText("0")); - + // FUNCTIONAL FLOWERS ENTRIES functionalIntro = new BLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers); functionalIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2")); @@ -204,19 +204,19 @@ public final class LexiconData { orechid = new BLexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers); orechid.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.orechidRecipe)); - + fallenKanade = new BLexiconEntry(LibLexicon.FFLOWER_FALLEN_KANADE, categoryFunctionalFlowers); fallenKanade.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.fallenKanadeRecipe)); - + exoflame = new BLexiconEntry(LibLexicon.FFLOWER_EXOFLAME, categoryFunctionalFlowers); exoflame.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.exoflameRecipe)); - + agricarnation = new BLexiconEntry(LibLexicon.FFLOWER_AGRICARNATION, categoryFunctionalFlowers); agricarnation.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.agricarnationRecipe)); - + hopperhock = new BLexiconEntry(LibLexicon.FFLOWER_HOPPERHOCK, categoryFunctionalFlowers); hopperhock.setLexiconPages(new PageText("0"), new PageText("1"), new PagePetalRecipe("2", ModPetalRecipes.hopperhockRecipe)); - + // GENERATING FLOWERS ENTRIES generatingIntro = new BLexiconEntry(LibLexicon.GFLOWER_INTRO, categoryGenerationFlowers); generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2")); @@ -226,7 +226,7 @@ public final class LexiconData { nightshade = new BLexiconEntry(LibLexicon.GFLOWER_NIGHTSHADE, categoryGenerationFlowers); nightshade.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.nightshadeRecipe)); - + endoflame = new BLexiconEntry(LibLexicon.GFLOWER_ENDOFLAME, categoryGenerationFlowers); endoflame.setLexiconPages(new PageText("0"), new PageText("1"), new PagePetalRecipe("2", ModPetalRecipes.endoflameRecipe)); @@ -235,10 +235,10 @@ public final class LexiconData { thermalily = new BLexiconEntry(LibLexicon.GFLOWER_THERMALILY, categoryGenerationFlowers); thermalily.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.thermalilyRecipe)); - + arcaneRose = new BLexiconEntry(LibLexicon.GFLOWER_ARCANE_ROSE, categoryGenerationFlowers); arcaneRose.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.arcaneRoseRecipe)); - + // DEVICES ENTRIES pistonRelay = new BLexiconEntry(LibLexicon.DEVICE_PISTON_RELAY, categoryDevices); pistonRelay.setLexiconPages(new PageText("0"), new PageText("1"), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.pistonRelayRecipe)); @@ -247,17 +247,17 @@ public final class LexiconData { pylon.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipePylon)); manaEnchanting = new BLexiconEntry(LibLexicon.DEVICE_MANA_ENCHANTING, categoryDevices); - manaEnchanting.setLexiconPages(new PageText("0"), new PageText("1"), + manaEnchanting.setLexiconPages(new PageText("0"), new PageText("1"), new PageImage("2", LibResources.ENTRY_ENCHANTER0), new PageImage("3", LibResources.ENTRY_ENCHANTER1), new PageImage("4", LibResources.ENTRY_ENCHANTER2), new PageImage("5", LibResources.ENTRY_ENCHANTER3), new PageText("6"), new PageText("7"), new PageText("8"), new PageText("9"), new PageText("10")); - + turntable = new BLexiconEntry(LibLexicon.DEVICE_TURNTABLE, categoryDevices); turntable.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTurntable)); - + // TOOLS ENTRIES manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools); manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManaBlaster)); - + // MISCLENAEOUS ENTRIES unstableBlocks = new BLexiconEntry(LibLexicon.MISC_UNSTABLE_BLOCKS, categoryMisc); unstableBlocks.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_UNSTABLE_BLOCK), new PageCraftingRecipe("2", ModCrafingRecipes.recipesUnstableBlocks), new PageText("3"), new PageImage("4", LibResources.ENTRY_UNSTABLE_BEACON), new PageCraftingRecipe("5", ModCrafingRecipes.recipesManaBeacons), new PageText("6"), new PageCraftingRecipe("7", ModCrafingRecipes.recipesSignalFlares)); diff --git a/MODSRC/vazkii/botania/common/lib/LibLexicon.java b/MODSRC/vazkii/botania/common/lib/LibLexicon.java index 9bf8e8387..509408b1b 100644 --- a/MODSRC/vazkii/botania/common/lib/LibLexicon.java +++ b/MODSRC/vazkii/botania/common/lib/LibLexicon.java @@ -75,7 +75,7 @@ public final class LibLexicon { public static final String DEVICE_TURNTABLE = "turntable"; public static final String TOOL_MANA_BLASTER = "manaBlaster"; - + public static final String MISC_UNSTABLE_BLOCKS = "unstableBlocks"; public static final String MISC_DECORATIVE_BLOCKS = "decorativeBlocks"; diff --git a/build.properties b/build.properties index c083ef362..12ddea82f 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ -#Mon, 10 Mar 2014 15:43:25 +0000 +#Thu, 20 Mar 2014 23:30:16 +0000 version=beta -build_number=12 +build_number=13 mc_version=1.6.4 mod_name=Botania dir.repo=./ diff --git a/web/changelog.html b/web/changelog.html index 0d6d24356..ebf003989 100644 --- a/web/changelog.html +++ b/web/changelog.html @@ -1,5 +1,43 @@

Botania Changelog:

+ beta 12:
+
  • Added Composite Lenses.
  • +
  • Added Mana Tablet creative version.
  • +
  • Added recipe for Earth Rune using a Red Mushroom
  • +
  • Added some new functional flowers: Orechid, Fallen Kanade, Exoflame, Agricarnation and Hopperhock.
  • +
  • Added some new generating flowers: Thermalily, Nightshade and Rosa Arcana.
  • +
  • Added the Mana Blaster.
  • +
  • Added the Mana Detector.
  • +
  • Added the Mana Enchanter.
  • +
  • Added the Mana Lenses: Phantom, Entropic and Magnetizing.
  • +
  • Added the Spreader Turntable.
  • +
  • Botania and vanilla flowers now have visual snow under them if there's snow on any side. Makes snow biomes much more pleasing.
  • +
  • Changed quite a few things with the API.
  • +
  • Changed the Hydroangeas and Endoflame textures.
  • +
  • Changed the cost for the Jaded Amaranthus and the Hydroanges, crafting wise. They're more expensive now.
  • +
  • Clipping checks for the Mana Burst entity are now handled internally, might fix some crashes.
  • +
  • Endoflames will no longer absorb items with container item data (eg Lava Buckets)
  • +
  • Fixed Dayblooms producing mana even at night.
  • +
  • Fixed Mana Pools never getting removed from the mana network, causing functional flowers trying to bind to pools that don't exist and never getting any mana.
  • +
  • Fixed Rune Altar pulling in mana even after the recipe has been concluded.
  • +
  • Fixed bursts with a Gravity lens having different arcs in prevision and reality.
  • +
  • Fixed crafting Mana Lenses outputting size 0 stacks.
  • +
  • Fixed some ambiguity in the Lexica Botania regarding some items (Heisei Dream and Rune Altar).
  • +
  • Fixed the Mana Spreader shooting a client only burst in singleplayer, having it shoot twice as much as it should.
  • +
  • Fixed tpyos.
  • +
  • Items in the petal and rune crafting pages of the Lexica Botania spin slower now, if enabled.
  • +
  • Made the Damaging lens more powerful.
  • +
  • Mana Lenses no longer display their dyed versions in the creative inventory, too much clutter.
  • +
  • Mana Tablets dropped on the ground won't ever despawn.
  • +
  • Normalized the sound for the functional flowers mana reading to be the same volume as other mana blocks.
  • +
  • Rebalanced the cost for tier 3 runes.
  • +
  • Redid the way flower generation works, it's much less sporadic and random and much more uniform over parts of the world.
  • +
  • Right clicking on Force Relays now has a sound effect.
  • +
  • The Mana Void now resists explosions as much as obsidian does.
  • +
  • The Petal Apothecary can now get water from dropped water buckets in item form.
  • +
  • The client prediction beam now has a larger than normal point that always displays, indicating where mana loss starts to happen.
  • +
  • The client prediction beam with the Wand of the Forest is no longer continuous, but rather, a moving lance. This effectively removes the lag caused by it on a large scale. There's a config option to use the continuous beam instead.
  • +
  • Tweaked the costs and power for some lenses.
  • beta 11:
  • Added some null checks to the client HUD for the Spreader, fixes a weird crash.
  • Added functionaility to the Lexica Botania to redirect to other entries when clicking an item, in order to see it's recipe.