diff --git a/MODSRC/vazkii/botania/api/BotaniaAPI.java b/MODSRC/vazkii/botania/api/BotaniaAPI.java index 3b8eca7e9..f463dc2cd 100644 --- a/MODSRC/vazkii/botania/api/BotaniaAPI.java +++ b/MODSRC/vazkii/botania/api/BotaniaAPI.java @@ -205,15 +205,14 @@ public final class BotaniaAPI { public static List getLatestAddedRecipes(int x) { List list = CraftingManager.getInstance().getRecipeList(); List newList = new ArrayList(); - for (int i = x - 1; i >= 0; i--) + for(int i = x - 1; i >= 0; i--) newList.add(list.get(list.size() - 1 - i)); return newList; } public static Class getSubTileMapping(String key) { - if (!subTiles.containsKey(key)) - key = ""; + if(!subTiles.containsKey(key)) key = ""; return subTiles.get(key); } diff --git a/MODSRC/vazkii/botania/api/lexicon/LexiconEntry.java b/MODSRC/vazkii/botania/api/lexicon/LexiconEntry.java index fadf0b622..ee3144543 100644 --- a/MODSRC/vazkii/botania/api/lexicon/LexiconEntry.java +++ b/MODSRC/vazkii/botania/api/lexicon/LexiconEntry.java @@ -55,7 +55,7 @@ public class LexiconEntry implements Comparable { public LexiconEntry setLexiconPages(LexiconPage... pages) { this.pages.addAll(Arrays.asList(pages)); - for (int i = 0; i < this.pages.size(); i++) + for(int i = 0; i < this.pages.size(); i++) this.pages.get(i).onPageAdded(this, i); return this; diff --git a/MODSRC/vazkii/botania/api/lexicon/LexiconRecipeMappings.java b/MODSRC/vazkii/botania/api/lexicon/LexiconRecipeMappings.java index 0832be2d6..6aff32ec5 100644 --- a/MODSRC/vazkii/botania/api/lexicon/LexiconRecipeMappings.java +++ b/MODSRC/vazkii/botania/api/lexicon/LexiconRecipeMappings.java @@ -32,8 +32,7 @@ public final class LexiconRecipeMappings { EntryData data = new EntryData(entry, page); String str = stackToString(stack); - if (force || !mappings.containsKey(str)) - mappings.put(str, data); + if(force || !mappings.containsKey(str)) mappings.put(str, data); } public static void map(ItemStack stack, LexiconEntry entry, int page) { @@ -46,7 +45,7 @@ public final class LexiconRecipeMappings { } public static String stackToString(ItemStack stack) { - if (stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) + if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) return ((IRecipeKeyProvider) stack.getItem()).getKey(stack); return stack.getUnlocalizedName() + "~" + stack.getItemDamage(); diff --git a/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java b/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java index c3980b37e..03a358569 100644 --- a/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java +++ b/MODSRC/vazkii/botania/api/mana/ManaItemHandler.java @@ -26,23 +26,20 @@ public final class ManaItemHandler { * @return The amount of mana received from the request. */ public static int requestMana(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if (stack == null) - return 0; + if(stack == null) return 0; - for (ItemStack stackInSlot : player.inventory.mainInventory) { - if (stackInSlot == stack) - continue; + for(ItemStack stackInSlot : player.inventory.mainInventory) { + if(stackInSlot == stack) continue; - if (stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { + 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)) + 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); + if(remove) manaItem.addMana(stackInSlot, -mana); return mana; } @@ -62,21 +59,18 @@ public final class ManaItemHandler { * @return If the request was succesful. */ public static boolean requestManaExact(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if (stack == null) - return false; + if(stack == null) return false; - for (ItemStack stackInSlot : player.inventory.mainInventory) { - if (stackInSlot == stack) - continue; + for(ItemStack stackInSlot : player.inventory.mainInventory) { + if(stackInSlot == stack) continue; - if (stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { + 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)) + 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); + if(remove) manaItemSlot.addMana(stackInSlot, -manaToGet); return true; } diff --git a/MODSRC/vazkii/botania/api/recipe/RecipeManaInfusion.java b/MODSRC/vazkii/botania/api/recipe/RecipeManaInfusion.java index eda53a4b2..d081fb48f 100644 --- a/MODSRC/vazkii/botania/api/recipe/RecipeManaInfusion.java +++ b/MODSRC/vazkii/botania/api/recipe/RecipeManaInfusion.java @@ -27,8 +27,7 @@ public class RecipeManaInfusion { } public boolean matches(ItemStack stack) { - if (input instanceof ItemStack) - return stack.isItemEqual((ItemStack) input); + if(input instanceof ItemStack) return stack.isItemEqual((ItemStack) input); String oredict = OreDictionary.getOreName(OreDictionary.getOreID(stack)); return oredict.equals(input); diff --git a/MODSRC/vazkii/botania/api/recipe/RecipePetals.java b/MODSRC/vazkii/botania/api/recipe/RecipePetals.java index 1d2dcea40..876633fa5 100644 --- a/MODSRC/vazkii/botania/api/recipe/RecipePetals.java +++ b/MODSRC/vazkii/botania/api/recipe/RecipePetals.java @@ -27,9 +27,8 @@ public class RecipePetals { this.output = output; List inputsToSet = new ArrayList(); - for (Object obj : inputs) { - if (obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); + for(Object obj : inputs) { + if(obj instanceof String || obj instanceof ItemStack) inputsToSet.add(obj); else throw new IllegalArgumentException("Invalid input"); } @@ -39,30 +38,27 @@ public class RecipePetals { public boolean matches(IInventory inv) { List inputsMissing = new ArrayList(inputs); - for (int i = 0; i < inv.getSizeInventory(); i++) { + for(int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); - if (stack == null) - break; + if(stack == null) break; String oredict = OreDictionary.getOreName(OreDictionary.getOreID(stack)); int stackIndex = -1, oredictIndex = -1; - for (int j = 0; j < inputsMissing.size(); j++) { + for(int j = 0; j < inputsMissing.size(); j++) { Object input = inputsMissing.get(j); - if (input instanceof String && input.equals(oredict)) { + if(input instanceof String && input.equals(oredict)) { oredictIndex = j; break; - } else if (input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { + } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { stackIndex = j; break; } } - if (stackIndex != -1) - inputsMissing.remove(stackIndex); - else if (oredictIndex != -1) - inputsMissing.remove(oredictIndex); + if(stackIndex != -1) inputsMissing.remove(stackIndex); + else if(oredictIndex != -1) inputsMissing.remove(oredictIndex); else return false; } diff --git a/MODSRC/vazkii/botania/api/subtile/SubTileFunctional.java b/MODSRC/vazkii/botania/api/subtile/SubTileFunctional.java index 9afce2b08..534a70111 100644 --- a/MODSRC/vazkii/botania/api/subtile/SubTileFunctional.java +++ b/MODSRC/vazkii/botania/api/subtile/SubTileFunctional.java @@ -55,7 +55,7 @@ public class SubTileFunctional extends SubTileEntity { linkPool(); - if (linkedPool != null) { + if(linkedPool != null) { IManaPool pool = (IManaPool) linkedPool; int manaInPool = pool.getCurrentMana(); int manaMissing = getMaxMana() - mana; @@ -64,10 +64,10 @@ public class SubTileFunctional extends SubTileEntity { addMana(manaToRemove); } - if (supertile.getWorldObj().isRemote) { + if(supertile.getWorldObj().isRemote) { double particleChance = 1F - (double) mana / (double) getMaxMana() / 2F; Color color = new Color(getColor()); - if (Math.random() > particleChance) + if(Math.random() > particleChance) BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); } } @@ -76,12 +76,12 @@ public class SubTileFunctional extends SubTileEntity { final int range = 10; boolean needsNew = false; - if (linkedPool == null) { + if(linkedPool == null) { needsNew = true; - if (cachedPoolCoordinates != null) { + if(cachedPoolCoordinates != null) { TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); - if (tileAt != null && tileAt instanceof IManaPool) { + if(tileAt != null && tileAt instanceof IManaPool) { linkedPool = tileAt; needsNew = false; } @@ -89,18 +89,18 @@ public class SubTileFunctional extends SubTileEntity { } } - if (!needsNew) { + if(!needsNew) { TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - if (!(tileAt instanceof IManaPool)) { + if(!(tileAt instanceof IManaPool)) { linkedPool = null; needsNew = true; } else linkedPool = tileAt; } - if (needsNew) { + if(needsNew) { IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); int size = network.getAllPoolsInWorld(supertile.getWorldObj().provider.dimensionId).size(); - if (size != sizeLastCheck) { + if(size != sizeLastCheck) { ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); linkedPool = network.getClosestPool(coords, supertile.getWorldObj().provider.dimensionId, range); sizeLastCheck = size; @@ -154,8 +154,7 @@ public class SubTileFunctional extends SubTileEntity { @Override public ChunkCoordinates getBinding() { - if (linkedPool == null) - return null; + if(linkedPool == null) return null; return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); } diff --git a/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java b/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java index da03150ff..fc7721ff7 100644 --- a/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java +++ b/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java @@ -55,20 +55,19 @@ public class SubTileGenerating extends SubTileEntity { linkCollector(); - if (canGeneratePassively()) { + if(canGeneratePassively()) { int delay = getDelayBetweenPassiveGeneration(); - if (delay > 0 && supertile.getWorldObj().getWorldTime() % delay == 0) { - if (shouldSyncPassiveGeneration()) - sync(); + if(delay > 0 && supertile.getWorldObj().getWorldTime() % delay == 0) { + if(shouldSyncPassiveGeneration()) sync(); addMana(getValueForPassiveGeneration()); } emptyManaIntoCollector(); } - if (supertile.getWorldObj().isRemote) { + if(supertile.getWorldObj().isRemote) { double particleChance = 1F - (double) mana / (double) getMaxMana() / 2F; Color color = new Color(getColor()); - if (Math.random() > particleChance) + if(Math.random() > particleChance) BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); } } @@ -77,12 +76,12 @@ public class SubTileGenerating extends SubTileEntity { final int range = 4; boolean needsNew = false; - if (linkedCollector == null) { + if(linkedCollector == null) { needsNew = true; - if (cachedCollectorCoordinates != null) { + if(cachedCollectorCoordinates != null) { TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); - if (tileAt != null && tileAt instanceof IManaCollector) { + if(tileAt != null && tileAt instanceof IManaCollector) { linkedCollector = tileAt; needsNew = false; } @@ -90,18 +89,18 @@ public class SubTileGenerating extends SubTileEntity { } } - if (!needsNew) { + if(!needsNew) { TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); - if (!(tileAt instanceof IManaCollector)) { + if(!(tileAt instanceof IManaCollector)) { linkedCollector = null; needsNew = true; } else linkedCollector = tileAt; } - if (needsNew) { + if(needsNew) { IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); int size = network.getAllCollectorsInWorld(supertile.getWorldObj().provider.dimensionId).size(); - if (size != sizeLastCheck) { + if(size != sizeLastCheck) { ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj().provider.dimensionId, range); sizeLastCheck = size; @@ -114,9 +113,9 @@ public class SubTileGenerating extends SubTileEntity { } public void emptyManaIntoCollector() { - if (linkedCollector != null) { + if(linkedCollector != null) { IManaCollector collector = (IManaCollector) linkedCollector; - if (!collector.isFull()) { + if(!collector.isFull()) { collector.recieveMana(mana); mana = 0; } @@ -142,8 +141,7 @@ public class SubTileGenerating extends SubTileEntity { @Override public boolean onWanded(EntityPlayer player, ItemStack wand) { - if (!player.worldObj.isRemote) - sync(); + if(!player.worldObj.isRemote) sync(); knownMana = mana; player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1F); @@ -185,8 +183,7 @@ public class SubTileGenerating extends SubTileEntity { @Override public ChunkCoordinates getBinding() { - if (linkedCollector == null) - return null; + if(linkedCollector == null) return null; return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); } diff --git a/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java b/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java index c190871de..1abf9296c 100644 --- a/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java +++ b/MODSRC/vazkii/botania/client/core/handler/BoundTileRenderer.java @@ -45,13 +45,13 @@ public final class BoundTileRenderer { EntityPlayer player = Minecraft.getMinecraft().thePlayer; World world = player.worldObj; ItemStack stack = player.getCurrentEquippedItem(); - if (stack != null && stack.getItem() instanceof ItemTwigWand) { + if(stack != null && stack.getItem() instanceof ItemTwigWand) { MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver; - if (pos != null) { + if(pos != null) { TileEntity tile = world.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); - if (tile != null && tile instanceof ITileBound) { + if(tile != null && tile instanceof ITileBound) { ChunkCoordinates coords = ((ITileBound) tile).getBinding(); - if (coords != null) + if(coords != null) renderBlockOutlineAt(coords, Color.HSBtoRGB(world.getTotalWorldTime() % 200 / 200F, 0.6F, 1F)); } } @@ -73,15 +73,14 @@ public final class BoundTileRenderer { Block block = world.getBlock(pos.posX, pos.posY, pos.posZ); drawWireframe: { - if (block != null) { + if(block != null) { AxisAlignedBB axis; - if (block instanceof IWireframeAABBProvider) + if(block instanceof IWireframeAABBProvider) axis = ((IWireframeAABBProvider) block).getWireframeAABB(world, pos.posX, pos.posY, pos.posZ); else axis = block.getSelectedBoundingBoxFromPool(world, pos.posX, pos.posY, pos.posZ); - if (axis == null) - break drawWireframe; + if(axis == null) break drawWireframe; axis.minX -= pos.posX; axis.maxX -= pos.posX; diff --git a/MODSRC/vazkii/botania/client/core/handler/CapeHandler.java b/MODSRC/vazkii/botania/client/core/handler/CapeHandler.java index 5e3f5d69f..ae2657c22 100644 --- a/MODSRC/vazkii/botania/client/core/handler/CapeHandler.java +++ b/MODSRC/vazkii/botania/client/core/handler/CapeHandler.java @@ -38,13 +38,12 @@ public class CapeHandler { @SubscribeEvent public void onPreRenderSpecials(RenderPlayerEvent.Specials.Pre event) { - if (Loader.isModLoaded("shadersmod")) - return; + if(Loader.isModLoaded("shadersmod")) return; - if (event.entityPlayer instanceof AbstractClientPlayer && (event.entityPlayer.getCommandSenderName().equals("Vazkii"))) { + if(event.entityPlayer instanceof AbstractClientPlayer && (event.entityPlayer.getCommandSenderName().equals("Vazkii"))) { AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) event.entityPlayer; - if (!capePlayers.contains(abstractClientPlayer)) { + if(!capePlayers.contains(abstractClientPlayer)) { ReflectionHelper.setPrivateValue(ThreadDownloadImageData.class, abstractClientPlayer.getTextureCape(), false, LibObfuscation.TEXTURE_UPLOADED); new Thread(new CloakThread(abstractClientPlayer)).start(); event.renderCape = true; @@ -65,7 +64,7 @@ public class CapeHandler { try { BufferedImage bo = ImageIO.read(Botania.class.getResourceAsStream(LibResources.MODEL_CAPE)); ReflectionHelper.setPrivateValue(ThreadDownloadImageData.class, abstractClientPlayer.getTextureCape(), bo, LibObfuscation.BUFFERED_IMAGE); - } catch (IOException e) { + } catch(IOException e) { e.printStackTrace(); } } diff --git a/MODSRC/vazkii/botania/client/core/handler/ClientTickHandler.java b/MODSRC/vazkii/botania/client/core/handler/ClientTickHandler.java index 88ff1bc61..7267e148b 100644 --- a/MODSRC/vazkii/botania/client/core/handler/ClientTickHandler.java +++ b/MODSRC/vazkii/botania/client/core/handler/ClientTickHandler.java @@ -37,42 +37,36 @@ public class ClientTickHandler { @SubscribeEvent public void tickEnd(ClientTickEvent event) { - if (event.phase == Phase.END && event.type == Type.CLIENT) { + if(event.phase == Phase.END && event.type == Type.CLIENT) { LightningBolt.update(); - if (Minecraft.getMinecraft().theWorld == null) - ManaNetworkHandler.instance.clear(); + if(Minecraft.getMinecraft().theWorld == null) ManaNetworkHandler.instance.clear(); GuiScreen gui = Minecraft.getMinecraft().currentScreen; - if (gui == null || !gui.doesGuiPauseGame()) { + if(gui == null || !gui.doesGuiPauseGame()) { ticksInGame++; EntityPlayer player = Minecraft.getMinecraft().thePlayer; - if (player != null) { + if(player != null) { ItemStack stack = player.getCurrentEquippedItem(); - if (stack != null && stack.getItem() instanceof ItemTwigWand) { + if(stack != null && stack.getItem() instanceof ItemTwigWand) { List list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld.provider.dimensionId)); - for (TileEntity tile : list) { - if (tile instanceof IManaCollector) - ((IManaCollector) tile).onClientDisplayTick(); + for(TileEntity tile : list) { + if(tile instanceof IManaCollector) ((IManaCollector) tile).onClientDisplayTick(); } } } } int ticksToOpen = 10; - if (gui instanceof GuiLexicon) { - if (ticksWithLexicaOpen < 0) - ticksWithLexicaOpen = 0; - if (ticksWithLexicaOpen < ticksToOpen) - ticksWithLexicaOpen++; - if (pageFlipTicks > 0) - pageFlipTicks--; + if(gui instanceof GuiLexicon) { + if(ticksWithLexicaOpen < 0) ticksWithLexicaOpen = 0; + if(ticksWithLexicaOpen < ticksToOpen) ticksWithLexicaOpen++; + if(pageFlipTicks > 0) pageFlipTicks--; } else { pageFlipTicks = 0; - if (ticksWithLexicaOpen > 0) { - if (ticksWithLexicaOpen > ticksToOpen) - ticksWithLexicaOpen = ticksToOpen; + if(ticksWithLexicaOpen > 0) { + if(ticksWithLexicaOpen > ticksToOpen) ticksWithLexicaOpen = ticksToOpen; ticksWithLexicaOpen--; } } @@ -80,8 +74,7 @@ public class ClientTickHandler { } public static void notifyPageChange() { - if (pageFlipTicks == 0) - pageFlipTicks = 5; + if(pageFlipTicks == 0) pageFlipTicks = 5; } } diff --git a/MODSRC/vazkii/botania/client/core/handler/HUDHandler.java b/MODSRC/vazkii/botania/client/core/handler/HUDHandler.java index 74b019c01..ddde53be0 100644 --- a/MODSRC/vazkii/botania/client/core/handler/HUDHandler.java +++ b/MODSRC/vazkii/botania/client/core/handler/HUDHandler.java @@ -39,19 +39,18 @@ public final class HUDHandler { @SubscribeEvent public void onDrawScreen(RenderGameOverlayEvent.Post event) { - if (event.type == ElementType.ALL) { + if(event.type == ElementType.ALL) { Minecraft mc = Minecraft.getMinecraft(); MovingObjectPosition pos = mc.objectMouseOver; - if (pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() == ModItems.twigWand) { + if(pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() == ModItems.twigWand) { Block block = mc.theWorld.getBlock(pos.blockX, pos.blockY, pos.blockZ); - if (block instanceof IWandHUD) + if(block instanceof IWandHUD) ((IWandHUD) block).renderHUD(mc, event.resolution, mc.theWorld, pos.blockX, pos.blockY, pos.blockZ); - } else if (pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() == ModItems.lexicon) { + } else if(pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() == ModItems.lexicon) { Block block = mc.theWorld.getBlock(pos.blockX, pos.blockY, pos.blockZ); - if (block instanceof ILexiconable) { + if(block instanceof ILexiconable) { LexiconEntry entry = ((ILexiconable) block).getEntry(mc.theWorld, pos.blockX, pos.blockY, pos.blockZ, mc.thePlayer, mc.thePlayer.getCurrentEquippedItem()); - if (entry != null) - drawLexiconGUI(entry, event.resolution); + if(entry != null) drawLexiconGUI(entry, event.resolution); } } } @@ -90,7 +89,7 @@ public final class HUDHandler { renderManaBar(x, y, color, 0.5F, mana, maxMana); - if (mana < 0) { + if(mana < 0) { String text = StatCollector.translateToLocal("botaniamisc.statusUnknown"); x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(text) / 2; y -= 1; @@ -109,8 +108,7 @@ public final class HUDHandler { int manaPercentage = Math.max(0, (int) ((double) mana / (double) maxMana * 100)); - if (manaPercentage == 0 && mana > 0) - manaPercentage = 1; + if(manaPercentage == 0 && mana > 0) manaPercentage = 1; RenderHelper.drawTexturedModalRect(x + 1 + manaPercentage, y + 1, 0, 0, 5, 100 - manaPercentage, 3); diff --git a/MODSRC/vazkii/botania/client/core/handler/LightningHandler.java b/MODSRC/vazkii/botania/client/core/handler/LightningHandler.java index 3804fd239..14cfc9042 100644 --- a/MODSRC/vazkii/botania/client/core/handler/LightningHandler.java +++ b/MODSRC/vazkii/botania/client/core/handler/LightningHandler.java @@ -69,14 +69,14 @@ public class LightningHandler { render.bindTexture(outsideResource); tessellator.startDrawingQuads(); tessellator.setBrightness(0xF000F0); - for (LightningBolt bolt : LightningBolt.boltlist) + for(LightningBolt bolt : LightningBolt.boltlist) renderBolt(bolt, tessellator, frame, ActiveRenderInfo.rotationX, ActiveRenderInfo.rotationXZ, ActiveRenderInfo.rotationZ, ActiveRenderInfo.rotationXY, 0, false); tessellator.draw(); render.bindTexture(insideResource); tessellator.startDrawingQuads(); tessellator.setBrightness(0xF000F0); - for (LightningBolt bolt : LightningBolt.boltlist) + for(LightningBolt bolt : LightningBolt.boltlist) renderBolt(bolt, tessellator, frame, ActiveRenderInfo.rotationX, ActiveRenderInfo.rotationXZ, ActiveRenderInfo.rotationZ, ActiveRenderInfo.rotationXY, 1, true); tessellator.draw(); @@ -96,8 +96,7 @@ public class LightningHandler { private void renderBolt(LightningBolt bolt, Tessellator tessellator, float partialframe, float cosyaw, float cospitch, float sinyaw, float cossinpitch, int pass, boolean inner) { float boltage = bolt.particleAge < 0 ? 0 : (float) bolt.particleAge / (float) bolt.particleMaxAge; float mainalpha = 1; - if (pass == 0) - mainalpha = (1 - boltage) * 0.4F; + if(pass == 0) mainalpha = (1 - boltage) * 0.4F; else mainalpha = 1 - boltage * 0.5F; int expandTime = (int) (bolt.length * bolt.speed); @@ -105,9 +104,8 @@ public class LightningHandler { int renderstart = (int) ((expandTime / 2 - bolt.particleMaxAge + bolt.particleAge) / (float) (expandTime / 2) * bolt.numsegments0); int renderend = (int) ((bolt.particleAge + expandTime) / (float) expandTime * bolt.numsegments0); - for (Segment rendersegment : bolt.segments) { - if (rendersegment.segmentno < renderstart || rendersegment.segmentno > renderend) - continue; + for(Segment rendersegment : bolt.segments) { + if(rendersegment.segmentno < renderstart || rendersegment.segmentno > renderend) continue; Vector3 playervec = getRelativeViewVector(rendersegment.startpoint.point).multiply(-1); @@ -126,7 +124,7 @@ public class LightningHandler { tessellator.addVertexWithUV(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z, 0.5, 1); tessellator.addVertexWithUV(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z, 0.5, 1); - if (rendersegment.next == null) { + if(rendersegment.next == null) { Vector3 roundend = rendersegment.endpoint.point.copy().add(rendersegment.diff.copy().normalize().multiply(width)); tessellator.addVertexWithUV(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z, 0, 0); @@ -135,7 +133,7 @@ public class LightningHandler { tessellator.addVertexWithUV(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z, 0, 1); } - if (rendersegment.prev == null) { + if(rendersegment.prev == null) { Vector3 roundend = rendersegment.startpoint.point.copy().subtract(rendersegment.diff.copy().normalize().multiply(width)); tessellator.addVertexWithUV(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z, 0.5, 0); @@ -198,8 +196,7 @@ public class LightningHandler { @Override public int compare(Segment o1, Segment o2) { int comp = Integer.valueOf(o1.splitno).compareTo(o2.splitno); - if (comp == 0) - return Integer.valueOf(o1.segmentno).compareTo(o2.segmentno); + if(comp == 0) return Integer.valueOf(o1.segmentno).compareTo(o2.segmentno); else return comp; } } @@ -231,7 +228,7 @@ public class LightningHandler { } public void calcEndDiffs() { - if (prev != null) { + if(prev != null) { Vector3 prevdiffnorm = prev.diff.copy().normalize(); Vector3 thisdiffnorm = diff.copy().normalize(); @@ -242,7 +239,7 @@ public class LightningHandler { sinprev = 1; } - if (next != null) { + if(next != null) { Vector3 nextdiffnorm = next.diff.copy().normalize(); Vector3 thisdiffnorm = diff.copy().normalize(); @@ -317,15 +314,14 @@ public class LightningHandler { } public void fractal(int splits, double amount, double splitchance, double splitlength, double splitangle) { - if (finalized) - return; + if(finalized) return; ArrayList oldsegments = segments; segments = new ArrayList(); Segment prev = null; - for (Segment segment : oldsegments) { + for(Segment segment : oldsegments) { prev = segment.prev; Vector3 subsegment = segment.diff.copy().multiply(1F / splits); @@ -336,7 +332,7 @@ public class LightningHandler { newpoints[0] = segment.startpoint; newpoints[splits] = segment.endpoint; - for (int i = 1; i < splits; i++) { + for(int i = 1; i < splits; i++) { Vector3 randoff = segment.diff.copy().perpendicular().normalize().rotate(rand.nextFloat() * 360, segment.diff); randoff.multiply((rand.nextFloat() - 0.5F) * amount * 2); @@ -345,13 +341,12 @@ public class LightningHandler { newpoints[i] = new BoltPoint(basepoint, randoff); } - for (int i = 0; i < splits; i++) { + for(int i = 0; i < splits; i++) { Segment next = new Segment(newpoints[i], newpoints[i + 1], segment.light, segment.segmentno * splits + i, segment.splitno); next.prev = prev; - if (prev != null) - prev.next = next; + if(prev != null) prev.next = next; - if (i != 0 && rand.nextFloat() < splitchance) { + if(i != 0 && rand.nextFloat() < splitchance) { Vector3 splitrot = next.diff.copy().xCrossProduct().rotate(rand.nextFloat() * 360, next.diff); Vector3 diff = next.diff.copy().rotate((rand.nextFloat() * 0.66F + 0.33F) * splitangle, splitrot).multiply(splitlength); @@ -368,8 +363,7 @@ public class LightningHandler { segments.add(next); } - if (segment.next != null) - segment.next.prev = prev; + if(segment.next != null) segment.next.prev = prev; } numsegments0 *= splits; @@ -388,14 +382,12 @@ public class LightningHandler { private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) { MovingObjectPosition mop = world.rayTraceBlocks(start.toVec3D(), end.toVec3D()); - if (mop == null) - return prevresistance; + if(mop == null) return prevresistance; - if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + if(mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); - if (world.isAirBlock(mop.blockX, mop.blockY, mop.blockZ)) - return prevresistance; + if(world.isAirBlock(mop.blockX, mop.blockY, mop.blockZ)) return prevresistance; return prevresistance + block.getExplosionResistance(source) + 0.3F; } else return prevresistance; @@ -410,16 +402,15 @@ public class LightningHandler { int lastactiveseg = 0;// unterminated float splitresistance = 0; - for (Segment segment : segments) { - if (segment.splitno > lastsplitcalc) { + for(Segment segment : segments) { + if(segment.splitno > lastsplitcalc) { lastactivesegment.put(lastsplitcalc, lastactiveseg); lastsplitcalc = segment.splitno; lastactiveseg = lastactivesegment.get(splitparents.get(segment.splitno)); splitresistance = lastactiveseg < segment.segmentno ? 50 : 0; } - if (splitresistance >= 40 * segment.light) - continue; + if(splitresistance >= 40 * segment.light) continue; splitresistance = rayTraceResistance(segment.startpoint.point, segment.endpoint.point, splitresistance); lastactiveseg = segment.segmentno; @@ -428,22 +419,20 @@ public class LightningHandler { lastsplitcalc = 0; lastactiveseg = lastactivesegment.get(0); - for (Iterator iterator = segments.iterator(); iterator.hasNext(); ) { + for(Iterator iterator = segments.iterator(); iterator.hasNext(); ) { Segment segment = iterator.next(); - if (lastsplitcalc != segment.splitno) { + if(lastsplitcalc != segment.splitno) { lastsplitcalc = segment.splitno; lastactiveseg = lastactivesegment.get(segment.splitno); } - if (segment.segmentno > lastactiveseg) - iterator.remove(); + if(segment.segmentno > lastactiveseg) iterator.remove(); segment.calcEndDiffs(); } } public void finalizeBolt() { - if (finalized) - return; + if(finalized) return; finalized = true; calculateCollisionAndDiffs(); @@ -456,18 +445,16 @@ public class LightningHandler { public void onUpdate() { particleAge++; - if (particleAge >= particleMaxAge) - isDead = true; + if(particleAge >= particleMaxAge) isDead = true; } // Called in ClientTickHandler public static void update() { - for (Iterator iterator = boltlist.iterator(); iterator.hasNext(); ) { + for(Iterator iterator = boltlist.iterator(); iterator.hasNext(); ) { LightningBolt bolt = iterator.next(); bolt.onUpdate(); - if (bolt.isDead) - iterator.remove(); + if(bolt.isDead) iterator.remove(); } } } diff --git a/MODSRC/vazkii/botania/client/core/handler/LocalizationHandler.java b/MODSRC/vazkii/botania/client/core/handler/LocalizationHandler.java index 02f6fee67..dc695ec4e 100644 --- a/MODSRC/vazkii/botania/client/core/handler/LocalizationHandler.java +++ b/MODSRC/vazkii/botania/client/core/handler/LocalizationHandler.java @@ -17,7 +17,7 @@ import vazkii.botania.client.lib.LibResources; public final class LocalizationHandler { public static void loadLocalizations() { - for (String locale : LibResources.LANGS) + for(String locale : LibResources.LANGS) LanguageRegistry.instance().loadLocalization(LibResources.PREFIX_LANG + locale + ".lang", locale, false); } diff --git a/MODSRC/vazkii/botania/client/core/helper/FontHelper.java b/MODSRC/vazkii/botania/client/core/helper/FontHelper.java index ebe4f1a84..b19a98c4f 100644 --- a/MODSRC/vazkii/botania/client/core/helper/FontHelper.java +++ b/MODSRC/vazkii/botania/client/core/helper/FontHelper.java @@ -26,14 +26,12 @@ public final class FontHelper { int i = -1; int j = par0Str.length(); - while ((i = par0Str.indexOf(167, i + 1)) != -1) { - if (i < j - 1) { + while((i = par0Str.indexOf(167, i + 1)) != -1) { + if(i < j - 1) { char c0 = par0Str.charAt(i + 1); - if (isFormatColor(c0)) - s1 = "\u00a7" + c0; - else if (isFormatSpecial(c0)) - s1 = s1 + "\u00a7" + c0; + if(isFormatColor(c0)) s1 = "\u00a7" + c0; + else if(isFormatSpecial(c0)) s1 = s1 + "\u00a7" + c0; } } diff --git a/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java b/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java index c6e2d0b52..6d91104b6 100644 --- a/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java +++ b/MODSRC/vazkii/botania/client/core/helper/RenderHelper.java @@ -44,24 +44,21 @@ public final class RenderHelper { public static void renderTooltip(int x, int y, List tooltipData, int color, int color2) { boolean lighting = GL11.glGetBoolean(GL11.GL_LIGHTING); - if (lighting) - net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); + if(lighting) net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - if (!tooltipData.isEmpty()) { + if(!tooltipData.isEmpty()) { int var5 = 0; int var6; int var7; FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; - for (var6 = 0; var6 < tooltipData.size(); ++var6) { + for(var6 = 0; var6 < tooltipData.size(); ++var6) { var7 = fontRenderer.getStringWidth(tooltipData.get(var6)); - if (var7 > var5) - var5 = var7; + if(var7 > var5) var5 = var7; } var6 = x + 12; var7 = y - 12; int var9 = 8; - if (tooltipData.size() > 1) - var9 += 2 + (tooltipData.size() - 1) * 10; + if(tooltipData.size() > 1) var9 += 2 + (tooltipData.size() - 1) * 10; float z = 300F; drawGradientRect(var6 - 3, var7 - 4, z, var6 + var5 + 3, var7 - 3, color2, color2); drawGradientRect(var6 - 3, var7 + var9 + 3, z, var6 + var5 + 3, var7 + var9 + 4, color2, color2); @@ -75,17 +72,15 @@ public final class RenderHelper { drawGradientRect(var6 - 3, var7 + var9 + 2, z, var6 + var5 + 3, var7 + var9 + 3, var12, var12); GL11.glDisable(GL11.GL_DEPTH_TEST); - for (int var13 = 0; var13 < tooltipData.size(); ++var13) { + for(int var13 = 0; var13 < tooltipData.size(); ++var13) { String var14 = tooltipData.get(var13); fontRenderer.drawStringWithShadow(var14, var6, var7, -1); - if (var13 == 0) - var7 += 2; + if(var13 == 0) var7 += 2; var7 += 10; } GL11.glEnable(GL11.GL_DEPTH_TEST); } - if (!lighting) - net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); + if(!lighting) net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); GL11.glColor4f(1F, 1F, 1F, 1F); } @@ -134,13 +129,11 @@ public final class RenderHelper { Tessellator tessellator = Tessellator.instance; int ticks = (int) (Minecraft.getMinecraft().theWorld.getTotalWorldTime() % 200); - if (ticks >= 100) - ticks = 200 - ticks - 1; + if(ticks >= 100) ticks = 200 - ticks - 1; float f1 = ticks / 200F; float f2 = 0F; - if (f1 > 0.7F) - f2 = (f1 - 0.7F) / 0.2F; + if(f1 > 0.7F) f2 = (f1 - 0.7F) / 0.2F; Random random = new Random(seed); GL11.glPushMatrix(); @@ -154,7 +147,7 @@ public final class RenderHelper { GL11.glTranslatef(0F, -1F, -2F); GL11.glScalef(xScale, yScale, zScale); - for (int i = 0; i < (f1 + f1 * f1) / 2F * 90F + 30F; i++) { + for(int i = 0; i < (f1 + f1 * f1) / 2F * 90F + 30F; i++) { GL11.glRotatef(random.nextFloat() * 360F, 1F, 0F, 0F); GL11.glRotatef(random.nextFloat() * 360F, 0F, 1F, 0F); GL11.glRotatef(random.nextFloat() * 360F, 0F, 0F, 1F); diff --git a/MODSRC/vazkii/botania/client/core/helper/ShaderHelper.java b/MODSRC/vazkii/botania/client/core/helper/ShaderHelper.java index de85bc8a0..8d628e8a1 100644 --- a/MODSRC/vazkii/botania/client/core/helper/ShaderHelper.java +++ b/MODSRC/vazkii/botania/client/core/helper/ShaderHelper.java @@ -36,8 +36,7 @@ public final class ShaderHelper { public static int manaPool = 0; public static void initShaders() { - if (!useShaders()) - return; + if(!useShaders()) return; pylonGlow = createProgram(null, LibResources.SHADER_PYLON_GLOW_FRAG); enchanterRune = createProgram(null, LibResources.SHADER_ENCHANTER_RUNE_FRAG); @@ -45,12 +44,11 @@ public final class ShaderHelper { } public static void useShader(int shader) { - if (!useShaders()) - return; + if(!useShaders()) return; ARBShaderObjects.glUseProgramObjectARB(shader); - if (shader != 0) { + if(shader != 0) { int time = ARBShaderObjects.glGetUniformLocationARB(shader, "time"); ARBShaderObjects.glUniform1iARB(time, ClientTickHandler.ticksInGame); } @@ -69,28 +67,23 @@ public final class ShaderHelper { private static int createProgram(String vert, String frag) { int vertId = 0, fragId = 0, program = 0; - if (vert != null) - vertId = createShader(vert, VERT); - if (frag != null) - fragId = createShader(frag, FRAG); + if(vert != null) vertId = createShader(vert, VERT); + if(frag != null) fragId = createShader(frag, FRAG); program = ARBShaderObjects.glCreateProgramObjectARB(); - if (program == 0) - return 0; + if(program == 0) return 0; - if (vert != null) - ARBShaderObjects.glAttachObjectARB(program, vertId); - if (frag != null) - ARBShaderObjects.glAttachObjectARB(program, fragId); + if(vert != null) ARBShaderObjects.glAttachObjectARB(program, vertId); + if(frag != null) ARBShaderObjects.glAttachObjectARB(program, fragId); ARBShaderObjects.glLinkProgramARB(program); - if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) { + if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) { FMLLog.log(Level.ERROR, getLogInfo(program)); return 0; } ARBShaderObjects.glValidateProgramARB(program); - if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) { + if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) { FMLLog.log(Level.ERROR, getLogInfo(program)); return 0; } @@ -103,17 +96,16 @@ public final class ShaderHelper { try { shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType); - if (shader == 0) - return 0; + if(shader == 0) return 0; ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename)); ARBShaderObjects.glCompileShaderARB(shader); - if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) + if(ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) throw new RuntimeException("Error creating shader: " + getLogInfo(shader)); return shader; - } catch (Exception e) { + } catch(Exception e) { ARBShaderObjects.glDeleteObjectARB(shader); e.printStackTrace(); return -1; @@ -130,8 +122,7 @@ public final class ShaderHelper { Exception exception = null; BufferedReader reader; - if (in == null) - return ""; + if(in == null) return ""; try { reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); @@ -139,35 +130,30 @@ public final class ShaderHelper { Exception innerExc = null; try { String line; - while ((line = reader.readLine()) != null) - source.append(line).append('\n'); - } catch (Exception exc) { + while((line = reader.readLine()) != null) source.append(line).append('\n'); + } catch(Exception exc) { exception = exc; } finally { try { reader.close(); - } catch (Exception exc) { - if (innerExc == null) - innerExc = exc; + } catch(Exception exc) { + if(innerExc == null) innerExc = exc; else exc.printStackTrace(); } } - if (innerExc != null) - throw innerExc; - } catch (Exception exc) { + if(innerExc != null) throw innerExc; + } catch(Exception exc) { exception = exc; } finally { try { in.close(); - } catch (Exception exc) { - if (exception == null) - exception = exc; + } catch(Exception exc) { + if(exception == null) exception = exc; else exc.printStackTrace(); } - if (exception != null) - throw exception; + if(exception != null) throw exception; } return source.toString(); diff --git a/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java b/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java index 74fa900b4..0f5ae2305 100644 --- a/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java @@ -48,8 +48,7 @@ public class ClientProxy extends CommonProxy { MinecraftForge.EVENT_BUS.register(new HUDHandler()); MinecraftForge.EVENT_BUS.register(new LightningHandler()); MinecraftForge.EVENT_BUS.register(new CapeHandler()); - if (ConfigHandler.boundBlockWireframe) - MinecraftForge.EVENT_BUS.register(new BoundTileRenderer()); + if(ConfigHandler.boundBlockWireframe) MinecraftForge.EVENT_BUS.register(new BoundTileRenderer()); initRenderers(); } @@ -68,7 +67,7 @@ public class ClientProxy extends CommonProxy { RenderingRegistry.registerBlockHandler(new RenderPylon()); MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens()); - if (ConfigHandler.lexicon3dModel) + if(ConfigHandler.lexicon3dModel) MinecraftForgeClient.registerItemRenderer(ModItems.lexicon, new RenderLexicon()); ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new RenderTileAltar()); diff --git a/MODSRC/vazkii/botania/client/fx/FXSparkle.java b/MODSRC/vazkii/botania/client/fx/FXSparkle.java index 22f2cd8d7..4a583f209 100644 --- a/MODSRC/vazkii/botania/client/fx/FXSparkle.java +++ b/MODSRC/vazkii/botania/client/fx/FXSparkle.java @@ -62,7 +62,7 @@ public class FXSparkle extends EntityFX { float var10 = part / 8 / 8.0F; float var11 = var10 + 0.0624375F * 2; float var12 = 0.1F * particleScale; - if (shrink) var12 *= (particleMaxAge - particleAge + 1) / (float) particleMaxAge; + if(shrink) var12 *= (particleMaxAge - particleAge + 1) / (float) particleMaxAge; float var13 = (float) (prevPosX + (posX - prevPosX) * f - interpPosX); float var14 = (float) (prevPosY + (posY - prevPosY) * f - interpPosY); float var15 = (float) (prevPosZ + (posZ - prevPosZ) * f - interpPosZ); @@ -93,31 +93,28 @@ public class FXSparkle extends EntityFX { prevPosY = posY; prevPosZ = posZ; - if (particleAge++ >= particleMaxAge) - setDead(); + if(particleAge++ >= particleMaxAge) setDead(); motionY -= 0.04D * particleGravity; - if (!noClip && !fake) - pushOutOfBlocks(posX, (boundingBox.minY + boundingBox.maxY) / 2.0D, posZ); + if(!noClip && !fake) pushOutOfBlocks(posX, (boundingBox.minY + boundingBox.maxY) / 2.0D, posZ); posX += motionX; posY += motionY; posZ += motionZ; - if (slowdown) { + if(slowdown) { motionX *= 0.908000001907348633D; motionY *= 0.908000001907348633D; motionZ *= 0.908000001907348633D; - if (onGround) { + if(onGround) { motionX *= 0.69999998807907104D; motionZ *= 0.69999998807907104D; } } - if (fake && particleAge > 1) - setDead(); + if(fake && particleAge > 1) setDead(); } public void setGravity(float value) { @@ -132,7 +129,7 @@ public class FXSparkle extends EntityFX { double var12 = par3 - var8; double var14 = par5 - var9; - if (!worldObj.isAirBlock(var7, var8, var9)) { + if(!worldObj.isAirBlock(var7, var8, var9)) { boolean var16 = !worldObj.isBlockNormalCubeDefault(var7 - 1, var8, var9, false); boolean var17 = !worldObj.isBlockNormalCubeDefault(var7 + 1, var8, var9, false); boolean var18 = !worldObj.isBlockNormalCubeDefault(var7, var8 - 1, var9, false); @@ -142,32 +139,32 @@ public class FXSparkle extends EntityFX { byte var22 = -1; double var23 = 9999.0D; - if (var16 && var10 < var23) { + if(var16 && var10 < var23) { var23 = var10; var22 = 0; } - if (var17 && 1.0D - var10 < var23) { + if(var17 && 1.0D - var10 < var23) { var23 = 1.0D - var10; var22 = 1; } - if (var18 && var12 < var23) { + if(var18 && var12 < var23) { var23 = var12; var22 = 2; } - if (var19 && 1.0D - var12 < var23) { + if(var19 && 1.0D - var12 < var23) { var23 = 1.0D - var12; var22 = 3; } - if (var20 && var14 < var23) { + if(var20 && var14 < var23) { var23 = var14; var22 = 4; } - if (var21 && 1.0D - var14 < var23) { + if(var21 && 1.0D - var14 < var23) { var23 = 1.0D - var14; var22 = 5; } @@ -175,32 +172,32 @@ public class FXSparkle extends EntityFX { float var25 = rand.nextFloat() * 0.05F + 0.025F; float var26 = (rand.nextFloat() - rand.nextFloat()) * 0.1F; - if (var22 == 0) { + if(var22 == 0) { motionX = -var25; motionY = motionZ = var26; } - if (var22 == 1) { + if(var22 == 1) { motionX = var25; motionY = motionZ = var26; } - if (var22 == 2) { + if(var22 == 2) { motionY = -var25; motionX = motionZ = var26; } - if (var22 == 3) { + if(var22 == 3) { motionY = var25; motionX = motionZ = var26; } - if (var22 == 4) { + if(var22 == 4) { motionZ = -var25; motionY = motionX = var26; } - if (var22 == 5) { + if(var22 == 5) { motionZ = var25; motionY = motionX = var26; } diff --git a/MODSRC/vazkii/botania/client/fx/FXWisp.java b/MODSRC/vazkii/botania/client/fx/FXWisp.java index 61c7609fe..6f4d67187 100644 --- a/MODSRC/vazkii/botania/client/fx/FXWisp.java +++ b/MODSRC/vazkii/botania/client/fx/FXWisp.java @@ -42,13 +42,11 @@ public class FXWisp extends EntityFX { setSize(0.01F, 0.01F); EntityLivingBase renderentity = FMLClientHandler.instance().getClient().renderViewEntity; - if (distanceLimit) { + if(distanceLimit) { int visibleDistance = 50; - if (!FMLClientHandler.instance().getClient().gameSettings.fancyGraphics) - visibleDistance = 25; + if(!FMLClientHandler.instance().getClient().gameSettings.fancyGraphics) visibleDistance = 25; - if (renderentity == null || renderentity.getDistance(posX, posY, posZ) > visibleDistance) - particleMaxAge = 0; + if(renderentity == null || renderentity.getDistance(posX, posY, posZ) > visibleDistance) particleMaxAge = 0; } prevPosX = posX; @@ -60,8 +58,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) - agescale = 2 - agescale; + if(agescale > 1F) agescale = 2 - agescale; particleScale = moteParticleScale * agescale; @@ -105,8 +102,7 @@ public class FXWisp extends EntityFX { prevPosY = posY; prevPosZ = posZ; - if (particleAge++ >= particleMaxAge) - setDead(); + if(particleAge++ >= particleMaxAge) setDead(); motionY -= 0.04D * particleGravity; posX += motionX; diff --git a/MODSRC/vazkii/botania/client/gui/GuiLexicon.java b/MODSRC/vazkii/botania/client/gui/GuiLexicon.java index 66286b21e..2b21ca1fa 100644 --- a/MODSRC/vazkii/botania/client/gui/GuiLexicon.java +++ b/MODSRC/vazkii/botania/client/gui/GuiLexicon.java @@ -44,9 +44,9 @@ public class GuiLexicon extends GuiScreen { top = height / 2 - guiHeight / 2; buttonList.clear(); - if (isIndex()) { + if(isIndex()) { int x = 18; - for (int i = 0; i < 12; i++) { + for(int i = 0; i < 12; i++) { int y = 16 + i * 12; buttonList.add(new GuiButtonInvisible(i, left + x, top + y, 110, 10, "")); } @@ -76,13 +76,12 @@ public class GuiLexicon extends GuiScreen { @Override protected void actionPerformed(GuiButton par1GuiButton) { int i = par1GuiButton.id - 3; - if (i < 0) - return; + if(i < 0) return; List categoryList = BotaniaAPI.getAllCategories(); LexiconCategory category = i >= categoryList.size() ? null : categoryList.get(i); - if (category != null) { + if(category != null) { mc.displayGuiScreen(new GuiLexiconIndex(category)); ClientTickHandler.notifyPageChange(); } @@ -103,12 +102,11 @@ public class GuiLexicon extends GuiScreen { void populateIndex() { List categoryList = BotaniaAPI.getAllCategories(); - for (int i = 3; i < 12; i++) { + for(int i = 3; i < 12; i++) { int i_ = i - 3; GuiButtonInvisible button = (GuiButtonInvisible) buttonList.get(i); LexiconCategory category = i_ >= categoryList.size() ? null : categoryList.get(i_); - if (category != null) - button.displayString = StatCollector.translateToLocal(category.getUnlocalizedName()); + if(category != null) button.displayString = StatCollector.translateToLocal(category.getUnlocalizedName()); else button.displayString = ""; } } diff --git a/MODSRC/vazkii/botania/client/gui/GuiLexiconEntry.java b/MODSRC/vazkii/botania/client/gui/GuiLexiconEntry.java index c535ac010..e2c7fe1eb 100644 --- a/MODSRC/vazkii/botania/client/gui/GuiLexiconEntry.java +++ b/MODSRC/vazkii/botania/client/gui/GuiLexiconEntry.java @@ -75,7 +75,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry { @Override protected void actionPerformed(GuiButton par1GuiButton) { - switch (par1GuiButton.id) { + switch(par1GuiButton.id) { case 0: mc.displayGuiScreen(GuiScreen.isShiftKeyDown() ? new GuiLexicon() : parent); ClientTickHandler.notifyPageChange(); diff --git a/MODSRC/vazkii/botania/client/gui/GuiLexiconIndex.java b/MODSRC/vazkii/botania/client/gui/GuiLexiconIndex.java index 486866e38..a026c1505 100644 --- a/MODSRC/vazkii/botania/client/gui/GuiLexiconIndex.java +++ b/MODSRC/vazkii/botania/client/gui/GuiLexiconIndex.java @@ -67,10 +67,10 @@ public class GuiLexiconIndex extends GuiLexicon { @Override void populateIndex() { - for (int i = page * 12; i < (page + 1) * 12; i++) { + for(int i = page * 12; i < (page + 1) * 12; i++) { GuiButtonInvisible button = (GuiButtonInvisible) buttonList.get(i - page * 12); LexiconEntry entry = i >= entriesToDisplay.size() ? null : entriesToDisplay.get(i); - if (entry != null) + if(entry != null) button.displayString = (entry.isPriority() ? EnumChatFormatting.ITALIC : "") + StatCollector.translateToLocal(entry.getUnlocalizedName()); else button.displayString = ""; } @@ -78,7 +78,7 @@ public class GuiLexiconIndex extends GuiLexicon { @Override protected void actionPerformed(GuiButton par1GuiButton) { - switch (par1GuiButton.id) { + switch(par1GuiButton.id) { case 12: mc.displayGuiScreen(new GuiLexicon()); ClientTickHandler.notifyPageChange(); @@ -97,8 +97,7 @@ public class GuiLexiconIndex extends GuiLexicon { break; default: int index = par1GuiButton.id + page * 12; - if (index >= entriesToDisplay.size()) - return; + if(index >= entriesToDisplay.size()) return; LexiconEntry entry = entriesToDisplay.get(index); mc.displayGuiScreen(new GuiLexiconEntry(entry, this)); diff --git a/MODSRC/vazkii/botania/client/gui/button/GuiButtonBack.java b/MODSRC/vazkii/botania/client/gui/button/GuiButtonBack.java index 65a6df8c7..b2ad6d74e 100644 --- a/MODSRC/vazkii/botania/client/gui/button/GuiButtonBack.java +++ b/MODSRC/vazkii/botania/client/gui/button/GuiButtonBack.java @@ -38,8 +38,7 @@ public class GuiButtonBack extends GuiButton { List tooltip = getTooltip(); int tooltipY = (tooltip.size() - 1) * 10; - if (k == 2) - RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip); + if(k == 2) RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip); } public List getTooltip() { diff --git a/MODSRC/vazkii/botania/client/gui/button/GuiButtonPage.java b/MODSRC/vazkii/botania/client/gui/button/GuiButtonPage.java index be37ee0b0..a997a493e 100644 --- a/MODSRC/vazkii/botania/client/gui/button/GuiButtonPage.java +++ b/MODSRC/vazkii/botania/client/gui/button/GuiButtonPage.java @@ -31,7 +31,7 @@ public class GuiButtonPage extends GuiButton { @Override public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - if (enabled) { + if(enabled) { field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; int k = getHoverState(field_146123_n); @@ -39,7 +39,7 @@ public class GuiButtonPage extends GuiButton { GL11.glColor4f(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 18 : 0, right ? 180 : 190, 18, 10); - if (k == 2) + if(k == 2) RenderHelper.renderTooltip(par2, par3, Arrays.asList(StatCollector.translateToLocal(right ? "botaniamisc.nextPage" : "botaniamisc.prevPage"))); } } diff --git a/MODSRC/vazkii/botania/client/lib/LibResources.java b/MODSRC/vazkii/botania/client/lib/LibResources.java index 7f13f21d8..1c26f86d1 100644 --- a/MODSRC/vazkii/botania/client/lib/LibResources.java +++ b/MODSRC/vazkii/botania/client/lib/LibResources.java @@ -68,8 +68,6 @@ public final class LibResources { public static final String SHADER_ENCHANTER_RUNE_FRAG = PREFIX_SHADER + "enchanter_rune.frag"; public static final String SHADER_MANA_POOL_FRAG = PREFIX_SHADER + "mana_pool.frag"; - public static final String[] LANGS = new String[]{ - "en_US", "de_DE" - }; + public static final String[] LANGS = new String[]{"en_US", "de_DE"}; } diff --git a/MODSRC/vazkii/botania/client/model/ModelPylon.java b/MODSRC/vazkii/botania/client/model/ModelPylon.java index 69a41a2d6..b998053d7 100644 --- a/MODSRC/vazkii/botania/client/model/ModelPylon.java +++ b/MODSRC/vazkii/botania/client/model/ModelPylon.java @@ -36,7 +36,7 @@ public class ModelPylon implements IPylonModel { @Override public void renderGems() { - for (int i = 1; i < 5; i++) + for(int i = 1; i < 5; i++) model.renderPart("Ring_Gem0" + i); } } diff --git a/MODSRC/vazkii/botania/client/model/ModelSpinningCubes.java b/MODSRC/vazkii/botania/client/model/ModelSpinningCubes.java index 7aed7e9eb..9b4c3cbde 100644 --- a/MODSRC/vazkii/botania/client/model/ModelSpinningCubes.java +++ b/MODSRC/vazkii/botania/client/model/ModelSpinningCubes.java @@ -41,7 +41,7 @@ public class ModelSpinningCubes extends ModelBase { GL11.glPushMatrix(); GL11.glTranslatef(-0.025F, 0.85F, -0.025F); - for (int i = 0; i < cubes; i++) { + for(int i = 0; i < cubes; i++) { float offset = offsetPerCube * i; float deg = (int) (ticks / rotationModifier % 360F + offset); float rad = deg * (float) Math.PI / 180F; @@ -58,7 +58,7 @@ public class ModelSpinningCubes extends ModelBase { float zRotate = (float) Math.cos(ticks * rotationModifier) / 2F; GL11.glRotatef(deg, xRotate, yRotate, zRotate); - if (repeat < origRepeat) { + if(repeat < origRepeat) { GL11.glColor4f(1F, 1F, 1F, 0.2F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -71,8 +71,7 @@ public class ModelSpinningCubes extends ModelBase { OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); spinningCube.render(1F / 16F); - if (repeat < origRepeat) - GL11.glDisable(GL11.GL_BLEND); + if(repeat < origRepeat) GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); } @@ -80,8 +79,7 @@ public class ModelSpinningCubes extends ModelBase { GL11.glEnable(GL11.GL_TEXTURE_2D); - if (repeat != 0) - renderSpinningCubes(cubes, repeat - 1, origRepeat); + if(repeat != 0) renderSpinningCubes(cubes, repeat - 1, origRepeat); } } diff --git a/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java b/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java index d481049d4..af02921e7 100644 --- a/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java +++ b/MODSRC/vazkii/botania/client/render/block/RenderSpecialFlower.java @@ -47,7 +47,7 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler { float f2 = (l >> 8 & 255) / 255.0F; float f3 = (l & 255) / 255.0F; - if (EntityRenderer.anaglyphEnable) { + if(EntityRenderer.anaglyphEnable) { float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; diff --git a/MODSRC/vazkii/botania/client/render/item/RenderLens.java b/MODSRC/vazkii/botania/client/render/item/RenderLens.java index adefa0d89..c420a7ee0 100644 --- a/MODSRC/vazkii/botania/client/render/item/RenderLens.java +++ b/MODSRC/vazkii/botania/client/render/item/RenderLens.java @@ -41,7 +41,7 @@ public class RenderLens implements IItemRenderer { @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { + switch(type) { case ENTITY: { GL11.glPushMatrix(); GL11.glTranslatef(-0.5F, 0F, 0F); @@ -107,8 +107,7 @@ public class RenderLens implements IItemRenderer { float zLevel = 0F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); - if (shiny) - tessellator.setBrightness(240); + if(shiny) tessellator.setBrightness(240); tessellator.addVertexWithUV(par1 + 0, par2 + par5, zLevel, icon.getMinU(), icon.getMaxV()); tessellator.addVertexWithUV(par1 + par4, par2 + par5, zLevel, icon.getMaxU(), icon.getMaxV()); tessellator.addVertexWithUV(par1 + par4, par2 + 0, zLevel, icon.getMaxU(), icon.getMinV()); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileAltar.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileAltar.java index 67bb986d2..177b7b101 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileAltar.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileAltar.java @@ -51,19 +51,18 @@ public class RenderTileAltar extends TileEntitySpecialRenderer { GL11.glScalef(1F, -1F, -1F); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - if (altar.hasWater) { + if(altar.hasWater) { GL11.glPushMatrix(); float s = 1F / 256F * 10F; float v = 1F / 8F; float w = -v * 2.5F; int petals = 0; - for (int i = 0; i < altar.getSizeInventory(); i++) - if (altar.getStackInSlot(i) != null) - petals++; + for(int i = 0; i < altar.getSizeInventory(); i++) + if(altar.getStackInSlot(i) != null) petals++; else break; - if (petals > 0) { + if(petals > 0) { final float modifier = 6F; final float rotationModifier = 0.25F; final float radiusBase = 1.2F; @@ -75,7 +74,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer { GL11.glPushMatrix(); GL11.glTranslatef(-0.05F, -0.5F, 0F); GL11.glScalef(v, v, v); - for (int i = 0; i < petals; i++) { + for(int i = 0; i < petals; i++) { float offset = offsetPerPetal * i; float deg = (int) (ticks / rotationModifier % 360F + offset); float rad = deg * (float) Math.PI / 180F; @@ -102,7 +101,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer { ItemStack stack = altar.getStackInSlot(i); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); IIcon icon = stack.getItem().getIcon(stack, 0); - if (icon != null) { + if(icon != null) { Color color = new Color(stack.getItem().getColorFromItemStack(stack, 0)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); float f = icon.getMinU(); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java index 963e7e3bc..84b43ce3e 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileEnchanter.java @@ -37,15 +37,12 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { TileEnchanter enchanter = (TileEnchanter) tileentity; float alphaMod = 0F; - if (enchanter.stage == 2) - alphaMod = Math.min(20, enchanter.stageTicks) / 20F; - else if (enchanter.stage == 4) - alphaMod = (20 - enchanter.stageTicks) / 20F; - else if (enchanter.stage > 2) - alphaMod = 1F; + if(enchanter.stage == 2) alphaMod = Math.min(20, enchanter.stageTicks) / 20F; + else if(enchanter.stage == 4) alphaMod = (20 - enchanter.stageTicks) / 20F; + else if(enchanter.stage > 2) alphaMod = 1F; - if (enchanter.itemToEnchant != null) { - if (item == null) + if(enchanter.itemToEnchant != null) { + if(item == null) item = new EntityItem(enchanter.getWorldObj(), enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant); item.age = (int) tileentity.getWorldObj().getTotalWorldTime(); @@ -68,8 +65,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glDisable(GL11.GL_ALPHA_TEST); float alpha = (float) ((Math.sin(enchanter.getWorldObj().getTotalWorldTime() / 8D) + 1D) / 5D + 0.4D) * alphaMod; - if (ShaderHelper.useShaders()) - GL11.glColor4f(1F, 1F, 1F, alpha); + if(ShaderHelper.useShaders()) GL11.glColor4f(1F, 1F, 1F, alpha); else { int light = 15728880; int lightmapX = light % 65536; @@ -80,7 +76,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - if (enchanter.stage == 3 || enchanter.stage == 4) { + if(enchanter.stage == 3 || enchanter.stage == 4) { int ticks = enchanter.stageTicks + enchanter.stage3EndTicks; int angle = ticks * 2; float yTranslation = Math.min(20, ticks) / 20F * 1.15F; diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java b/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java index ccc9f9e0d..2668d362f 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTilePool.java @@ -52,7 +52,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); float waterLevel = (float) pool.getCurrentMana() / (float) TilePool.MAX_MANA * 0.40F; - if (waterLevel > 0) { + if(waterLevel > 0) { float s = 1F / 256F * 14F; float v = 1F / 8F; float w = -v * 3.5F; diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java b/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java index d392f36f7..7134dcddb 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTilePylon.java @@ -36,8 +36,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { @Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) { - if (model == null) - model = ConfigHandler.oldPylonModel ? new ModelPylonOld() : new ModelPylon(); + if(model == null) model = ConfigHandler.oldPylonModel ? new ModelPylonOld() : new ModelPylon(); GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); @@ -47,10 +46,10 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { Minecraft.getMinecraft().renderEngine.bindTexture(ConfigHandler.oldPylonModel ? textureOld : texture); int worldTime = (int) (tileentity.getWorldObj() == null ? 0 : tileentity.getWorldObj().getTotalWorldTime()); - if (tileentity != null) + if(tileentity != null) worldTime += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(360); - if (ConfigHandler.oldPylonModel) { + if(ConfigHandler.oldPylonModel) { GL11.glTranslated(d0 + 0.5, d1 + 2.2, d2 + 0.5); GL11.glScalef(1F, -1.5F, -1F); } else { @@ -59,11 +58,9 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { } GL11.glPushMatrix(); - if (!ConfigHandler.oldPylonModel) - GL11.glTranslatef(0.5F, 0F, -0.5F); + if(!ConfigHandler.oldPylonModel) GL11.glTranslatef(0.5F, 0F, -0.5F); GL11.glRotatef(worldTime * 1.5F, 0F, 1F, 0F); - if (!ConfigHandler.oldPylonModel) - GL11.glTranslatef(-0.5F, 0F, 0.5F); + if(!ConfigHandler.oldPylonModel) GL11.glTranslatef(-0.5F, 0F, 0.5F); model.renderRing(); GL11.glTranslated(0D, Math.sin(worldTime / 20D) / 20 - 0.025, 0D); @@ -73,19 +70,17 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { GL11.glPushMatrix(); GL11.glTranslated(0D, Math.sin(worldTime / 20D) / 17.5, 0D); - if (!ConfigHandler.oldPylonModel) - GL11.glTranslatef(0.5F, 0F, -0.5F); + if(!ConfigHandler.oldPylonModel) GL11.glTranslatef(0.5F, 0F, -0.5F); GL11.glRotatef(-worldTime, 0F, 1F, 0F); - if (!ConfigHandler.oldPylonModel) - GL11.glTranslatef(-0.5F, 0F, 0.5F); + if(!ConfigHandler.oldPylonModel) GL11.glTranslatef(-0.5F, 0F, 0.5F); GL11.glDisable(GL11.GL_CULL_FACE); model.renderCrystal(); GL11.glColor4f(1F, 1F, 1F, 1F); - if (!ShaderHelper.useShaders()) { + if(!ShaderHelper.useShaders()) { int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; @@ -96,8 +91,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glScalef(1.1F, 1.1F, 1.1F); - if (!ConfigHandler.oldPylonModel) - GL11.glTranslatef(-0.05F, -0.1F, 0.05F); + if(!ConfigHandler.oldPylonModel) GL11.glTranslatef(-0.05F, -0.1F, 0.05F); else GL11.glTranslatef(0F, -0.09F, 0F); ShaderHelper.useShader(ShaderHelper.pylonGlow); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java index da132160e..fcf68eb99 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileRuneAltar.java @@ -45,18 +45,17 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { GL11.glTranslated(x, y, z); int items = 0; - for (int i = 0; i < altar.getSizeInventory(); i++) - if (altar.getStackInSlot(i) == null) - break; + for(int i = 0; i < altar.getSizeInventory(); i++) + if(altar.getStackInSlot(i) == null) break; else items++; float[] angles = new float[altar.getSizeInventory()]; float anglePer = 360F / items; float totalAngle = 0F; - for (int i = 0; i < angles.length; i++) + for(int i = 0; i < angles.length; i++) angles[i] = totalAngle += anglePer; - for (int i = 0; i < altar.getSizeInventory(); i++) { + for(int i = 0; i < altar.getSizeInventory(); i++) { GL11.glPushMatrix(); GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(1F, 2.5F, 1F); @@ -66,13 +65,13 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { GL11.glTranslated(0D, 0.15 * Math.sin((tileentity.getWorldObj().getTotalWorldTime() + i * 10) / 5D), 0F); ItemStack stack = altar.getStackInSlot(i); Minecraft mc = Minecraft.getMinecraft(); - if (stack != null) { + if(stack != null) { mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); GL11.glScalef(2F, 2F, 2F); - if (!ForgeHooksClient.renderEntityItem(new EntityItem(altar.getWorldObj(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) { + if(!ForgeHooksClient.renderEntityItem(new EntityItem(altar.getWorldObj(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) { GL11.glScalef(0.5F, 0.5F, 0.5F); - if (stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { + if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(1F, 1.1F, 0F); renderBlocks.renderBlockAsItem(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F); @@ -82,7 +81,7 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { int renderPass = 0; do { IIcon icon = stack.getItem().getIcon(stack, renderPass); - if (icon != null) { + if(icon != null) { Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); float f = icon.getMinU(); @@ -93,7 +92,7 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { GL11.glColor3f(1F, 1F, 1F); } renderPass++; - } while (renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); + } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); } } } @@ -111,7 +110,7 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { GL11.glTranslatef(0F, 1.2F, 2F); float scale = altar.getTargetMana() == 0 ? 0 : (float) altar.getCurrentMana() / (float) altar.getTargetMana() / 75F; - if (scale != 0) { + if(scale != 0) { int seed = altar.xCoord ^ altar.yCoord ^ altar.zCoord; GL11.glTranslatef(0.5F, 0.7F, 0.5F); RenderHelper.renderStar(0x00E4D7, scale, scale, scale, seed); diff --git a/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java b/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java index fb017ac79..0ba8f66bd 100644 --- a/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java +++ b/MODSRC/vazkii/botania/client/render/tile/RenderTileSpreader.java @@ -52,7 +52,7 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer { GL11.glScalef(1F, -1F, -1F); ItemStack stack = spreader.getStackInSlot(0); - if (stack != null) { + if(stack != null) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); ILens lens = (ILens) stack.getItem(); GL11.glPushMatrix(); diff --git a/MODSRC/vazkii/botania/common/block/BlockAltar.java b/MODSRC/vazkii/botania/common/block/BlockAltar.java index c8c73e59d..a8d65b655 100644 --- a/MODSRC/vazkii/botania/common/block/BlockAltar.java +++ b/MODSRC/vazkii/botania/common/block/BlockAltar.java @@ -57,10 +57,9 @@ public class BlockAltar extends BlockModContainer implements ILexiconable { @Override public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par5Entity instanceof EntityItem) { + if(par5Entity instanceof EntityItem) { TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4); - if (tile.collideEntityItem((EntityItem) par5Entity)) - par1World.markBlockForUpdate(par2, par3, par4); + if(tile.collideEntityItem((EntityItem) par5Entity)) par1World.markBlockForUpdate(par2, par3, par4); } } @@ -68,9 +67,9 @@ public class BlockAltar extends BlockModContainer implements ILexiconable { public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ItemStack stack = par5EntityPlayer.getCurrentEquippedItem(); TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4); - if (stack != null && stack.getItem() == Items.water_bucket) { - if (!tile.hasWater) { - if (!par5EntityPlayer.capabilities.isCreativeMode) + if(stack != null && stack.getItem() == Items.water_bucket) { + if(!tile.hasWater) { + if(!par5EntityPlayer.capabilities.isCreativeMode) par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Items.bucket)); tile.hasWater = true; par1World.func_147453_f(par2, par3, par4, this); @@ -111,20 +110,19 @@ public class BlockAltar extends BlockModContainer implements ILexiconable { public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { + if(inv != null) { + for(int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { ItemStack itemstack = inv.getStackInSlot(j1); - if (itemstack != null) { + if(itemstack != null) { float f = random.nextFloat() * 0.8F + 0.1F; float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { + for(float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; + if(k1 > itemstack.stackSize) k1 = itemstack.stackSize; itemstack.stackSize -= k1; entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); @@ -133,7 +131,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable { entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) + if(itemstack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } diff --git a/MODSRC/vazkii/botania/common/block/BlockEnchanter.java b/MODSRC/vazkii/botania/common/block/BlockEnchanter.java index be8573f3f..a1ff73ff6 100644 --- a/MODSRC/vazkii/botania/common/block/BlockEnchanter.java +++ b/MODSRC/vazkii/botania/common/block/BlockEnchanter.java @@ -76,19 +76,18 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { TileEnchanter enchanter = (TileEnchanter) par1World.getTileEntity(par2, par3, par4); ItemStack stack = par5EntityPlayer.getCurrentEquippedItem(); - if (stack != null && stack.getItem() == ModItems.twigWand) - return false; + if(stack != null && stack.getItem() == ModItems.twigWand) return false; boolean stackEnchantable = stack != null && stack.isItemEnchantable() && stack.stackSize == 1 && stack.getItem().getItemEnchantability() > 0; - if (enchanter.itemToEnchant == null) { - if (stackEnchantable) { + if(enchanter.itemToEnchant == null) { + if(stackEnchantable) { enchanter.itemToEnchant = stack.copy(); par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null); enchanter.sync(); } - } else if (enchanter.stage == 0) { - if (par5EntityPlayer.inventory.addItemStackToInventory(enchanter.itemToEnchant.copy())) { + } else if(enchanter.stage == 0) { + if(par5EntityPlayer.inventory.addItemStackToInventory(enchanter.itemToEnchant.copy())) { enchanter.itemToEnchant = null; enchanter.sync(); } else par5EntityPlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.invFull")); @@ -103,16 +102,15 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex ItemStack itemstack = enchanter.itemToEnchant; - if (itemstack != null) { + if(itemstack != null) { float f = random.nextFloat() * 0.8F + 0.1F; float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { + for(float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; + if(k1 > itemstack.stackSize) k1 = itemstack.stackSize; itemstack.stackSize -= k1; entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); @@ -121,7 +119,7 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3 * 0.5; - if (itemstack.hasTagCompound()) + if(itemstack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } diff --git a/MODSRC/vazkii/botania/common/block/BlockLivingrock.java b/MODSRC/vazkii/botania/common/block/BlockLivingrock.java index 4667a2c0c..38f1e7695 100644 --- a/MODSRC/vazkii/botania/common/block/BlockLivingrock.java +++ b/MODSRC/vazkii/botania/common/block/BlockLivingrock.java @@ -62,14 +62,14 @@ public class BlockLivingrock extends BlockMod implements ILexiconable { @Override public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < TYPES; i++) + for(int i = 0; i < TYPES; i++) par3List.add(new ItemStack(par1, 1, i)); } @Override public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[TYPES]; - for (int i = 0; i < TYPES; i++) + for(int i = 0; i < TYPES; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } diff --git a/MODSRC/vazkii/botania/common/block/BlockLivingwood.java b/MODSRC/vazkii/botania/common/block/BlockLivingwood.java index c8906a800..e1bb5c34e 100644 --- a/MODSRC/vazkii/botania/common/block/BlockLivingwood.java +++ b/MODSRC/vazkii/botania/common/block/BlockLivingwood.java @@ -62,14 +62,14 @@ public class BlockLivingwood extends BlockMod implements ILexiconable { @Override public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < TYPES; i++) + for(int i = 0; i < TYPES; i++) par3List.add(new ItemStack(par1, 1, i)); } @Override public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[TYPES]; - for (int i = 0; i < TYPES; i++) + for(int i = 0; i < TYPES; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } diff --git a/MODSRC/vazkii/botania/common/block/BlockManaBeacon.java b/MODSRC/vazkii/botania/common/block/BlockManaBeacon.java index 24354b7b1..9ef1603d6 100644 --- a/MODSRC/vazkii/botania/common/block/BlockManaBeacon.java +++ b/MODSRC/vazkii/botania/common/block/BlockManaBeacon.java @@ -52,7 +52,7 @@ public class BlockManaBeacon extends BlockModContainer implements ILexiconable { @Override public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[2]; - for (int i = 0; i < 2; i++) + for(int i = 0; i < 2; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } @@ -63,7 +63,7 @@ public class BlockManaBeacon extends BlockModContainer implements ILexiconable { @Override public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) par3List.add(new ItemStack(par1, 1, i)); } diff --git a/MODSRC/vazkii/botania/common/block/BlockManaDetector.java b/MODSRC/vazkii/botania/common/block/BlockManaDetector.java index 0d671dcfa..a084e198a 100644 --- a/MODSRC/vazkii/botania/common/block/BlockManaDetector.java +++ b/MODSRC/vazkii/botania/common/block/BlockManaDetector.java @@ -47,7 +47,7 @@ public class BlockManaDetector extends BlockModContainer implements ILexiconable @Override public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[2]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } @@ -68,7 +68,7 @@ public class BlockManaDetector extends BlockModContainer implements ILexiconable @Override public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { - if (par7Entity != null && !(par7Entity instanceof IManaBurst)) + if(par7Entity != null && !(par7Entity instanceof IManaBurst)) super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } diff --git a/MODSRC/vazkii/botania/common/block/BlockMod.java b/MODSRC/vazkii/botania/common/block/BlockMod.java index 9c592294f..0dced34de 100644 --- a/MODSRC/vazkii/botania/common/block/BlockMod.java +++ b/MODSRC/vazkii/botania/common/block/BlockMod.java @@ -24,14 +24,12 @@ public class BlockMod extends Block { public BlockMod(Material par2Material) { super(par2Material); - if (registerInCreative()) - setCreativeTab(BotaniaCreativeTab.INSTANCE); + if(registerInCreative()) setCreativeTab(BotaniaCreativeTab.INSTANCE); } @Override public Block setBlockName(String par1Str) { - if (shouldRegisterInNameSet()) - GameRegistry.registerBlock(this, par1Str); + if(shouldRegisterInNameSet()) GameRegistry.registerBlock(this, par1Str); return super.setBlockName(par1Str); } diff --git a/MODSRC/vazkii/botania/common/block/BlockModContainer.java b/MODSRC/vazkii/botania/common/block/BlockModContainer.java index bd6f51862..1b049e7c1 100644 --- a/MODSRC/vazkii/botania/common/block/BlockModContainer.java +++ b/MODSRC/vazkii/botania/common/block/BlockModContainer.java @@ -27,14 +27,12 @@ public abstract class BlockModContainer extends BlockConta protected BlockModContainer(Material par2Material) { super(par2Material); - if (registerInCreative()) - setCreativeTab(BotaniaCreativeTab.INSTANCE); + if(registerInCreative()) setCreativeTab(BotaniaCreativeTab.INSTANCE); } @Override public Block setBlockName(String par1Str) { - if (shouldRegisterInNameSet()) - GameRegistry.registerBlock(this, par1Str); + if(shouldRegisterInNameSet()) GameRegistry.registerBlock(this, par1Str); return super.setBlockName(par1Str); } diff --git a/MODSRC/vazkii/botania/common/block/BlockModFlower.java b/MODSRC/vazkii/botania/common/block/BlockModFlower.java index 807cd3393..771f9f69a 100644 --- a/MODSRC/vazkii/botania/common/block/BlockModFlower.java +++ b/MODSRC/vazkii/botania/common/block/BlockModFlower.java @@ -54,7 +54,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable { @Override public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) par3List.add(new ItemStack(par1, 1, i)); } @@ -68,7 +68,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable { @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[17]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } @@ -92,7 +92,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable { int meta = par1World.getBlockMetadata(par2, par3, par4); float[] color = EntitySheep.fleeceColorTable[meta]; - if (par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency) + if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency) Botania.proxy.sparkleFX(par1World, par2 + 0.3 + par5Random.nextFloat() * 0.5, par3 + 0.5 + par5Random.nextFloat() * 0.5, par4 + 0.3 + par5Random.nextFloat() * 0.5, color[0], color[1], color[2], par5Random.nextFloat(), 5); } diff --git a/MODSRC/vazkii/botania/common/block/BlockPistonRelay.java b/MODSRC/vazkii/botania/common/block/BlockPistonRelay.java index ada6c0a6c..31306e0bf 100644 --- a/MODSRC/vazkii/botania/common/block/BlockPistonRelay.java +++ b/MODSRC/vazkii/botania/common/block/BlockPistonRelay.java @@ -84,8 +84,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl static void decrCoords(String key) { int time = getTimeInCoords(key); - if (time <= 0) - removeThese.add(key); + if(time <= 0) removeThese.add(key); else coordsToCheck.put(key, time - 1); } @@ -95,8 +94,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl static Block getBlockAt(String key) { MinecraftServer server = MinecraftServer.getServer(); - if (server == null) - return Blocks.air; + if(server == null) return Blocks.air; String[] tokens = key.split(":"); int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); @@ -106,8 +104,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl static int getBlockMetaAt(String key) { MinecraftServer server = MinecraftServer.getServer(); - if (server == null) - return 0; + if(server == null) return 0; String[] tokens = key.split(":"); int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); @@ -117,14 +114,13 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl @Override public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - if (!player.isSneaking()) { + if(!player.isSneaking()) { playerPositions.put(player.getCommandSenderName(), getCoordsAsString(world.provider.dimensionId, x, y, z)); world.playSoundEffect(x, y, z, "random.orb", 0.5F, 1F); } else { dropBlockAsItem(world, x, y, z, new ItemStack(this)); world.setBlockToAir(x, y, z); - if (!world.isRemote) - world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(this)); + if(!world.isRemote) world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(this)); } return true; @@ -148,9 +144,9 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl mappedPositions.clear(); Collection tags = nbttagcompound.func_150296_c(); - for (String key : tags) { + for(String key : tags) { NBTBase tag = nbttagcompound.getTag(key); - if (tag instanceof NBTTagString) { + if(tag instanceof NBTTagString) { String value = ((NBTTagString) tag).func_150285_a_(); mappedPositions.put(key, value); @@ -160,14 +156,14 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl @Override public void writeToNBT(NBTTagCompound nbttagcompound) { - for (String s : mappedPositions.keySet()) + for(String s : mappedPositions.keySet()) nbttagcompound.setString(s, mappedPositions.get(s)); } public static WorldData get(World world) { WorldData data = (WorldData) world.mapStorage.loadData(WorldData.class, ID); - if (data == null) { + if(data == null) { data = new WorldData(ID); data.markDirty(); world.mapStorage.setData(ID, data); @@ -178,58 +174,57 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl @SubscribeEvent public void tickEnd(TickEvent event) { - if (event.type == Type.SERVER && event.phase == Phase.END) - for (String s : coordsToCheck.keySet()) { - Block block = getBlockAt(s); - decrCoords(s); + if(event.type == Type.SERVER && event.phase == Phase.END) for(String s : coordsToCheck.keySet()) { + Block block = getBlockAt(s); + decrCoords(s); - if (block == Blocks.piston_extension) { - int meta = getBlockMetaAt(s); - ForgeDirection dir = ForgeDirection.getOrientation(meta & ~8); + if(block == Blocks.piston_extension) { + int meta = getBlockMetaAt(s); + ForgeDirection dir = ForgeDirection.getOrientation(meta & ~8); - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = MinecraftServer.getServer(); - if (server != null && getTimeInCoords(s) == 0) { - String newPos; + if(server != null && getTimeInCoords(s) == 0) { + String newPos; - { - String[] tokens = s.split(":"); - int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); - World world = server.worldServerForDimension(worldId); - world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.pistonRelay); - newPos = getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); - } + { + String[] tokens = s.split(":"); + int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); + World world = server.worldServerForDimension(worldId); + world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.pistonRelay); + newPos = getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); + } - if (mappedPositions.containsKey(s)) { - String pos = mappedPositions.get(s); - String[] tokens = pos.split(":"); - int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); - World world = server.worldServerForDimension(worldId); + if(mappedPositions.containsKey(s)) { + String pos = mappedPositions.get(s); + String[] tokens = pos.split(":"); + int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); + World world = server.worldServerForDimension(worldId); - Block srcBlock = world.getBlock(x, y, z); - int srcMeta = world.getBlockMetadata(x, y, z); - TileEntity tile = world.getTileEntity(x, y, z); - Material mat = srcBlock.getMaterial(); + Block srcBlock = world.getBlock(x, y, z); + int srcMeta = world.getBlockMetadata(x, y, z); + TileEntity tile = world.getTileEntity(x, y, z); + Material mat = srcBlock.getMaterial(); - if (tile == null && mat.getMaterialMobility() == 0 && !srcBlock.isAir(world, x, y, z)) { - Material destMat = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).getMaterial(); - if (world.isAirBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) || destMat.isReplaceable()) { - world.setBlock(x, y, z, Blocks.air); - world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, srcBlock, srcMeta, 1 | 2); - mappedPositions.put(s, getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)); - } + if(tile == null && mat.getMaterialMobility() == 0 && !srcBlock.isAir(world, x, y, z)) { + Material destMat = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).getMaterial(); + if(world.isAirBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) || destMat.isReplaceable()) { + world.setBlock(x, y, z, Blocks.air); + world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, srcBlock, srcMeta, 1 | 2); + mappedPositions.put(s, getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)); } - - pos = mappedPositions.get(s); - mappedPositions.remove(s); - mappedPositions.put(newPos, pos); - WorldData.get(world).markDirty(); } + + pos = mappedPositions.get(s); + mappedPositions.remove(s); + mappedPositions.put(newPos, pos); + WorldData.get(world).markDirty(); } } } + } - for (String s : removeThese) + for(String s : removeThese) coordsToCheck.remove(s); removeThese.clear(); } diff --git a/MODSRC/vazkii/botania/common/block/BlockPool.java b/MODSRC/vazkii/botania/common/block/BlockPool.java index ada901efd..06d7f751b 100644 --- a/MODSRC/vazkii/botania/common/block/BlockPool.java +++ b/MODSRC/vazkii/botania/common/block/BlockPool.java @@ -54,10 +54,9 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable, @Override public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par5Entity instanceof EntityItem) { + if(par5Entity instanceof EntityItem) { TilePool tile = (TilePool) par1World.getTileEntity(par2, par3, par4); - if (tile.collideEntityItem((EntityItem) par5Entity)) - par1World.markBlockForUpdate(par2, par3, par4); + if(tile.collideEntityItem((EntityItem) par5Entity)) par1World.markBlockForUpdate(par2, par3, par4); } } @@ -90,8 +89,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable, public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { TilePool pool = (TilePool) par1World.getTileEntity(par2, par3, par4); int val = (int) ((double) pool.getCurrentMana() / (double) TilePool.MAX_MANA * 15.0); - if (pool.getCurrentMana() > 0) - val = Math.max(val, 1); + if(pool.getCurrentMana() > 0) val = Math.max(val, 1); return val; } diff --git a/MODSRC/vazkii/botania/common/block/BlockRuneAltar.java b/MODSRC/vazkii/botania/common/block/BlockRuneAltar.java index c4b1187b0..6506ece45 100644 --- a/MODSRC/vazkii/botania/common/block/BlockRuneAltar.java +++ b/MODSRC/vazkii/botania/common/block/BlockRuneAltar.java @@ -61,14 +61,14 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex @Override public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[3]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ItemStack stack = par5EntityPlayer.getCurrentEquippedItem(); - if (stack != null) + if(stack != null) return ((TileRuneAltar) par1World.getTileEntity(par2, par3, par4)).addItem(par5EntityPlayer, stack); return false; @@ -78,20 +78,19 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { + if(inv != null) { + for(int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { ItemStack itemstack = inv.getStackInSlot(j1); - if (itemstack != null) { + if(itemstack != null) { float f = random.nextFloat() * 0.8F + 0.1F; float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { + for(float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; + if(k1 > itemstack.stackSize) k1 = itemstack.stackSize; itemstack.stackSize -= k1; entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); @@ -100,7 +99,7 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) + if(itemstack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } diff --git a/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java b/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java index 34d43550d..16ccd6455 100644 --- a/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java +++ b/MODSRC/vazkii/botania/common/block/BlockSpecialFlower.java @@ -50,26 +50,10 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid LibBlockNames.SUBTILE_PUREDAISY, // Generating - LibBlockNames.SUBTILE_DAYBLOOM, - LibBlockNames.SUBTILE_NIGHTSHADE, - LibBlockNames.SUBTILE_ENDOFLAME, - LibBlockNames.SUBTILE_HYDROANGEAS, - LibBlockNames.SUBTILE_THERMALILY, - LibBlockNames.SUBTILE_ARCANE_ROSE, + LibBlockNames.SUBTILE_DAYBLOOM, LibBlockNames.SUBTILE_NIGHTSHADE, LibBlockNames.SUBTILE_ENDOFLAME, LibBlockNames.SUBTILE_HYDROANGEAS, LibBlockNames.SUBTILE_THERMALILY, LibBlockNames.SUBTILE_ARCANE_ROSE, // Functional - LibBlockNames.SUBTILE_JADED_AMARANTHUS, - LibBlockNames.SUBTILE_BELLETHORN, - LibBlockNames.SUBTILE_HEISEI_DREAM, - LibBlockNames.SUBTILE_TIGERSEYE, - LibBlockNames.SUBTILE_ORECHID, - LibBlockNames.SUBTILE_FALLEN_KANADE, - LibBlockNames.SUBTILE_EXOFLAME, - LibBlockNames.SUBTILE_AGRICARNATION, - LibBlockNames.SUBTILE_HOPPERHOCK, - LibBlockNames.SUBTILE_TANGLEBERRIE, - LibBlockNames.SUBTILE_JIYUULIA - }; + LibBlockNames.SUBTILE_JADED_AMARANTHUS, LibBlockNames.SUBTILE_BELLETHORN, LibBlockNames.SUBTILE_HEISEI_DREAM, LibBlockNames.SUBTILE_TIGERSEYE, LibBlockNames.SUBTILE_ORECHID, LibBlockNames.SUBTILE_FALLEN_KANADE, LibBlockNames.SUBTILE_EXOFLAME, LibBlockNames.SUBTILE_AGRICARNATION, LibBlockNames.SUBTILE_HOPPERHOCK, LibBlockNames.SUBTILE_TANGLEBERRIE, LibBlockNames.SUBTILE_JIYUULIA}; protected BlockSpecialFlower() { super(0); @@ -99,13 +83,13 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid @Override public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (String s : subtypes) + for(String s : subtypes) par3List.add(ItemBlockSpecialFlower.ofType(s)); } @Override public void registerBlockIcons(IIconRegister par1IconRegister) { - for (String s : subtypes) + for(String s : subtypes) icons.put(s, IconHelper.forName(par1IconRegister, s)); } @@ -127,8 +111,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid @Override public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (!par6EntityPlayer.capabilities.isCreativeMode) - dropBlockAsItem(par1World, par2, par3, par4, par5, 0); + if(!par6EntityPlayer.capabilities.isCreativeMode) dropBlockAsItem(par1World, par2, par3, par4, par5, 0); } @Override @@ -136,7 +119,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid ArrayList list = new ArrayList(); TileEntity tile = world.getTileEntity(x, y, z); - if (tile != null) { + if(tile != null) { String name = ((TileSpecialFlower) tile).subTileName; list.add(ItemBlockSpecialFlower.ofType(name)); } diff --git a/MODSRC/vazkii/botania/common/block/BlockSpreader.java b/MODSRC/vazkii/botania/common/block/BlockSpreader.java index f9da3b549..dc060ef17 100644 --- a/MODSRC/vazkii/botania/common/block/BlockSpreader.java +++ b/MODSRC/vazkii/botania/common/block/BlockSpreader.java @@ -75,7 +75,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand @Override public void getSubBlocks(Item par1, CreativeTabs par2, List par3) { - for (int i = 0; i < 2; i++) + for(int i = 0; i < 2; i++) par3.add(new ItemStack(par1, 1, i)); } @@ -85,7 +85,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand TileSpreader spreader = (TileSpreader) par1World.getTileEntity(par2, par3, par4); par1World.setBlockMetadataWithNotify(par2, par3, par4, par6ItemStack.getItemDamage() & 1, 1 | 2); - switch (orientation) { + switch(orientation) { case 0: spreader.rotationY = -90F; break; @@ -138,17 +138,15 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand ItemStack heldItem = par5EntityPlayer.getCurrentEquippedItem(); boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens; - if (heldItem != null) - if (heldItem.getItem() == ModItems.twigWand) - return false; + if(heldItem != null) if(heldItem.getItem() == ModItems.twigWand) return false; - if (lens == null && isHeldItemLens) { + if(lens == null && isHeldItemLens) { par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null); spreader.setInventorySlotContents(0, heldItem.copy()); spreader.markDirty(); - } else if (lens != null) { + } else if(lens != null) { ItemStack add = lens.copy(); - if (!par5EntityPlayer.inventory.addItemStackToInventory(add)) + if(!par5EntityPlayer.inventory.addItemStackToInventory(add)) par5EntityPlayer.dropPlayerItemWithRandomChoice(add, false); spreader.setInventorySlotContents(0, null); spreader.markDirty(); @@ -161,20 +159,19 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { + if(inv != null) { + for(int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { ItemStack itemstack = inv.getStackInSlot(j1); - if (itemstack != null) { + if(itemstack != null) { float f = random.nextFloat() * 0.8F + 0.1F; float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { + for(float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; + if(k1 > itemstack.stackSize) k1 = itemstack.stackSize; itemstack.stackSize -= k1; entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); @@ -183,7 +180,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) + if(itemstack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } diff --git a/MODSRC/vazkii/botania/common/block/BlockTurntable.java b/MODSRC/vazkii/botania/common/block/BlockTurntable.java index c9811943c..40691f0dc 100644 --- a/MODSRC/vazkii/botania/common/block/BlockTurntable.java +++ b/MODSRC/vazkii/botania/common/block/BlockTurntable.java @@ -43,7 +43,7 @@ public class BlockTurntable extends BlockModContainer implements IWandable, IWan @Override public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[2]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forBlock(par1IconRegister, this, i); } diff --git a/MODSRC/vazkii/botania/common/block/BlockUnstable.java b/MODSRC/vazkii/botania/common/block/BlockUnstable.java index e15fd1ae2..c7340dfb0 100644 --- a/MODSRC/vazkii/botania/common/block/BlockUnstable.java +++ b/MODSRC/vazkii/botania/common/block/BlockUnstable.java @@ -47,7 +47,7 @@ public class BlockUnstable extends BlockMod implements ILexiconable { @Override public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) par3List.add(new ItemStack(par1, 1, i)); } diff --git a/MODSRC/vazkii/botania/common/block/ModBlocks.java b/MODSRC/vazkii/botania/common/block/ModBlocks.java index 39a30b2b7..165edb27c 100644 --- a/MODSRC/vazkii/botania/common/block/ModBlocks.java +++ b/MODSRC/vazkii/botania/common/block/ModBlocks.java @@ -63,7 +63,7 @@ public final class ModBlocks { enchanter = new BlockEnchanter(); turntable = new BlockTurntable(); - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) OreDictionary.registerOre(LibOreDict.FLOWER[i], new ItemStack(flower, 1, i)); OreDictionary.registerOre(LibOreDict.LIVING_ROCK, livingrock); @@ -110,11 +110,11 @@ public final class ModBlocks { } private static void registerMultiparts() { - if (Loader.isModLoaded("ForgeMultipart")) { + if(Loader.isModLoaded("ForgeMultipart")) { try { Class clazz = Class.forName("vazkii.botania.common.block.multipart.MultipartHandler"); clazz.newInstance(); - } catch (Throwable e) { + } catch(Throwable e) { e.printStackTrace(); } } diff --git a/MODSRC/vazkii/botania/common/block/multipart/MultipartHandler.java b/MODSRC/vazkii/botania/common/block/multipart/MultipartHandler.java index 92dc72d49..74a3f7598 100644 --- a/MODSRC/vazkii/botania/common/block/multipart/MultipartHandler.java +++ b/MODSRC/vazkii/botania/common/block/multipart/MultipartHandler.java @@ -22,7 +22,7 @@ public final class MultipartHandler { } private static void registerMultipartMetadataLine(Block block, int maxMeta) { - for (int i = 0; i < maxMeta; i++) + for(int i = 0; i < maxMeta; i++) registerMultipart(block, i); } diff --git a/MODSRC/vazkii/botania/common/block/subtile/SubTilePureDaisy.java b/MODSRC/vazkii/botania/common/block/subtile/SubTilePureDaisy.java index 96d1a9558..a8e53dc31 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/SubTilePureDaisy.java +++ b/MODSRC/vazkii/botania/common/block/subtile/SubTilePureDaisy.java @@ -28,16 +28,7 @@ public class SubTilePureDaisy extends SubTileEntity { private static final String TAG_POSITION = "position"; private static final String TAG_TICKS_REMAINING = "ticksRemaining"; - private static final int[][] POSITIONS = new int[][]{ - {-1, 0, -1}, - {-1, 0, 0}, - {-1, 0, 1}, - {0, 0, 1}, - {1, 0, 1}, - {1, 0, 0}, - {1, 0, -1}, - {0, 0, -1}, - }; + private static final int[][] POSITIONS = new int[][]{{-1, 0, -1}, {-1, 0, 0}, {-1, 0, 1}, {0, 0, 1}, {1, 0, 1}, {1, 0, 0}, {1, 0, -1}, {0, 0, -1},}; int positionAt = 0; int[] ticksRemaining = new int[]{200, 200, 200, 200, 200, 200, 200, 200}; @@ -50,25 +41,24 @@ public class SubTilePureDaisy extends SubTileEntity { @Override public void onUpdate() { positionAt++; - if (positionAt == POSITIONS.length) - positionAt = 0; + if(positionAt == POSITIONS.length) positionAt = 0; int[] acoords = POSITIONS[positionAt]; ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord + acoords[0], supertile.yCoord + acoords[1], supertile.zCoord + acoords[2]); Block block = supertile.getWorldObj().getBlock(coords.posX, coords.posY, coords.posZ); - if (block != Blocks.air) { + if(block != Blocks.air) { String oredict = OreDictionary.getOreName(OreDictionary.getOreID(new ItemStack(block, 1, supertile.getWorldObj().getBlockMetadata(coords.posX, coords.posY, coords.posZ)))); Block output = oredict.equals("stone") ? ModBlocks.livingrock : oredict.endsWith("logWood") ? ModBlocks.livingwood : null; - if (output != null) { + if(output != null) { ticksRemaining[positionAt] = ticksRemaining[positionAt] - 1; Botania.proxy.sparkleFX(supertile.getWorldObj(), coords.posX + Math.random(), coords.posY + Math.random(), coords.posZ + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5); - if (ticksRemaining[positionAt] <= 0) { + if(ticksRemaining[positionAt] <= 0) { supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, output); ticksRemaining[positionAt] = 200; - for (int i = 0; i < 25; i++) { + for(int i = 0; i < 25; i++) { double x = coords.posX + Math.random(); double y = coords.posY + Math.random() + 0.5; double z = coords.posZ + Math.random(); @@ -84,15 +74,15 @@ public class SubTilePureDaisy extends SubTileEntity { public void readFromPacketNBT(NBTTagCompound cmp) { positionAt = cmp.getInteger(TAG_POSITION); - if (supertile.getWorldObj() != null && !supertile.getWorldObj().isRemote) - for (int i = 0; i < ticksRemaining.length; i++) + if(supertile.getWorldObj() != null && !supertile.getWorldObj().isRemote) + for(int i = 0; i < ticksRemaining.length; i++) ticksRemaining[i] = cmp.getInteger(TAG_TICKS_REMAINING + i); } @Override public void writeToPacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_POSITION, positionAt); - for (int i = 0; i < ticksRemaining.length; i++) + for(int i = 0; i < ticksRemaining.length; i++) cmp.setInteger(TAG_TICKS_REMAINING + i, ticksRemaining[i]); } diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java index 3be851b98..79bbcffcd 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java @@ -23,18 +23,17 @@ public class SubTileAgricarnation extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if (supertile.getWorldObj().getTotalWorldTime() % 3 == 0) { + if(supertile.getWorldObj().getTotalWorldTime() % 3 == 0) { int range = 5; int x = supertile.xCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range; int z = supertile.zCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range; - for (int i = 4; i > -2; i--) { + for(int i = 4; i > -2; i--) { int y = supertile.yCoord + i; - if (supertile.getWorldObj().isAirBlock(x, y, z)) - continue; + if(supertile.getWorldObj().isAirBlock(x, y, z)) continue; - if (isPlant(x, y, z) && mana > 5) { + if(isPlant(x, y, z) && mana > 5) { Block block = supertile.getWorldObj().getBlock(x, y, z); mana -= 5; supertile.getWorldObj().scheduleBlockUpdate(x, y, z, block, 1); @@ -45,7 +44,7 @@ public class SubTileAgricarnation extends SubTileFunctional { boolean isPlant(int x, int y, int z) { Block block = supertile.getWorldObj().getBlock(x, y, z); - if (block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || block instanceof BlockBush) + if(block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || block instanceof BlockBush) return false; Material mat = block.getMaterial(); diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java index 96029214a..d44d57c5b 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java @@ -40,13 +40,12 @@ public class SubTileBellethorn extends SubTileFunctional { final int range = 6; final int manaToUse = 16; - if (supertile.getWorldObj().getTotalWorldTime() % 15 == 0) { + if(supertile.getWorldObj().getTotalWorldTime() % 15 == 0) { List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range)); - for (EntityLivingBase entity : entities) { - if (entity instanceof EntityPlayer) - continue; + for(EntityLivingBase entity : entities) { + if(entity instanceof EntityPlayer) continue; - if (entity.hurtTime == 0 && mana >= manaToUse) { + if(entity.hurtTime == 0 && mana >= manaToUse) { entity.attackEntityFrom(DamageSource.magic, 1); mana -= manaToUse; } diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java index 611a13002..93ead871e 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java @@ -29,30 +29,29 @@ public class SubTileExoflame extends SubTileFunctional { fireFurnaces: { - for (int i = -range + 1; i < range; i++) - for (int j = -rangeY; j < rangeY; j++) - for (int k = -range + 1; k < range; k++) { + for(int i = -range + 1; i < range; i++) + for(int j = -rangeY; j < rangeY; j++) + for(int k = -range + 1; k < range; k++) { int x = supertile.xCoord + i; int y = supertile.yCoord + j; int z = supertile.zCoord + k; TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z); - if (tile != null && tile instanceof TileEntityFurnace) { + if(tile != null && tile instanceof TileEntityFurnace) { TileEntityFurnace furnace = (TileEntityFurnace) tile; boolean canSmelt = canFurnaceSmelt(furnace); - if (canSmelt && mana > 2) { - if (furnace.furnaceBurnTime < 2) { - if (furnace.furnaceBurnTime == 0) + if(canSmelt && mana > 2) { + if(furnace.furnaceBurnTime < 2) { + if(furnace.furnaceBurnTime == 0) BlockFurnace.updateFurnaceBlockState(true, supertile.getWorldObj(), x, y, z); furnace.furnaceBurnTime = 200; } - if (supertile.getWorldObj().getTotalWorldTime() % 2 == 0) + if(supertile.getWorldObj().getTotalWorldTime() % 2 == 0) furnace.furnaceCookTime = Math.min(199, furnace.furnaceCookTime + 1); mana -= 2; - if (mana == 0) - break fireFurnaces; + if(mana == 0) break fireFurnaces; } } } @@ -60,19 +59,15 @@ public class SubTileExoflame extends SubTileFunctional { } public boolean canFurnaceSmelt(TileEntityFurnace furnace) { - if (furnace.getStackInSlot(0) == null) - return false; + if(furnace.getStackInSlot(0) == null) return false; else { ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnace.getStackInSlot(0)); - if (itemstack == null) - return false; + if(itemstack == null) return false; - if (furnace.getStackInSlot(2) == null) - return true; + if(furnace.getStackInSlot(2) == null) return true; - if (!furnace.getStackInSlot(2).isItemEqual(itemstack)) - return false; + if(!furnace.getStackInSlot(2).isItemEqual(itemstack)) return false; int result = furnace.getStackInSlot(2).stackSize + itemstack.stackSize; return result <= 64 && result <= itemstack.getMaxStackSize(); diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java index 7222f7917..85689a1c1 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java @@ -31,8 +31,8 @@ public class SubTileFallenKanade extends SubTileFunctional { final int cost = 20; List players = supertile.getWorldObj().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) { + for(EntityPlayer player : players) { + if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost) { player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 100, 1)); mana -= cost; sync(); diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java index 79539ef5d..0d1dad150 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java @@ -37,35 +37,33 @@ public class SubTileHeiseiDream extends SubTileFunctional { final int cost = 100; List mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range)); - if (mobs.size() > 1 && mana >= cost) - for (IMob mob : mobs) { - if (mob instanceof EntityLiving) { - EntityLiving entity = (EntityLiving) mob; - EntityLivingBase target = entity.getAttackTarget(); - if (target == null || !(target instanceof IMob)) { - IMob newTarget; - do newTarget = mobs.get(supertile.getWorldObj().rand.nextInt(mobs.size())); - while (newTarget == mob); + if(mobs.size() > 1 && mana >= cost) for(IMob mob : mobs) { + if(mob instanceof EntityLiving) { + EntityLiving entity = (EntityLiving) mob; + EntityLivingBase target = entity.getAttackTarget(); + if(target == null || !(target instanceof IMob)) { + IMob newTarget; + do newTarget = mobs.get(supertile.getWorldObj().rand.nextInt(mobs.size())); while(newTarget == mob); - if (newTarget instanceof EntityLivingBase) { - entity.setAttackTarget((EntityLivingBase) newTarget); + if(newTarget instanceof EntityLivingBase) { + entity.setAttackTarget((EntityLivingBase) newTarget); - List entries = new ArrayList(entity.tasks.taskEntries); - entries.addAll(new ArrayList(entity.targetTasks.taskEntries)); + List entries = new ArrayList(entity.tasks.taskEntries); + entries.addAll(new ArrayList(entity.targetTasks.taskEntries)); - for (EntityAITaskEntry entry : entries) - if (entry.action instanceof EntityAINearestAttackableTarget) - messWithGetTargetAI((EntityAINearestAttackableTarget) entry.action); - else if (entry.action instanceof EntityAIAttackOnCollide) - messWithAttackOnCollideAI((EntityAIAttackOnCollide) entry.action); + for(EntityAITaskEntry entry : entries) + if(entry.action instanceof EntityAINearestAttackableTarget) + messWithGetTargetAI((EntityAINearestAttackableTarget) entry.action); + else if(entry.action instanceof EntityAIAttackOnCollide) + messWithAttackOnCollideAI((EntityAIAttackOnCollide) entry.action); - mana -= cost; - sync(); - break; - } + mana -= cost; + sync(); + break; } } } + } } private void messWithGetTargetAI(EntityAINearestAttackableTarget aiEntry) { diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java index f4eda9dcc..155240527 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java @@ -40,9 +40,7 @@ public class SubTileHopperhock extends SubTileFunctional { int filterType = 0; - private static final ForgeDirection[] VALID_DIRS = new ForgeDirection[]{ - ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST - }; + private static final ForgeDirection[] VALID_DIRS = new ForgeDirection[]{ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST}; @Override public void onUpdate() { @@ -56,9 +54,8 @@ public class SubTileHopperhock extends SubTileFunctional { int z = supertile.zCoord; List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - 3, z - range, x + range + 1, y + 3, z + range + 1)); - for (EntityItem item : items) { - if (item.age < 60) - continue; + for(EntityItem item : items) { + if(item.age < 60) continue; ItemStack stack = item.getEntityItem(); @@ -66,25 +63,24 @@ public class SubTileHopperhock extends SubTileFunctional { ForgeDirection sideToPutItemIn = ForgeDirection.UNKNOWN; boolean priorityInv = false; - for (ForgeDirection dir : VALID_DIRS) { + for(ForgeDirection dir : VALID_DIRS) { int x_ = x + dir.offsetX; int y_ = y + dir.offsetY; int z_ = z + dir.offsetZ; IInventory inv = InventoryHelper.getInventory(supertile.getWorldObj(), x_, y_, z_); - if (inv != null) { + if(inv != null) { List filter = getFilterForInventory(inv, x_, y_, z_, true); boolean canAccept = canAcceptItem(stack, filter, filterType); int stackSize = InventoryHelper.testInventoryInsertion(inv, stack, dir); canAccept &= stackSize == stack.stackSize; - if (canAccept) { + if(canAccept) { boolean priority = !filter.isEmpty(); setInv: { - if (priorityInv && !priority) - break setInv; + if(priorityInv && !priority) break setInv; invToPutItemIn = inv; priorityInv = priority; @@ -94,33 +90,28 @@ public class SubTileHopperhock extends SubTileFunctional { } } - if (invToPutItemIn != null) { + if(invToPutItemIn != null) { InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.copy(), sideToPutItemIn, -1); - if (!supertile.getWorldObj().isRemote) - item.setDead(); + if(!supertile.getWorldObj().isRemote) item.setDead(); pulledAny = true; break; } } - if (pulledAny && mana > 1) - mana--; + if(pulledAny && mana > 1) mana--; } public boolean canAcceptItem(ItemStack stack, List filter, int filterType) { - if (stack == null) - return false; + if(stack == null) return false; - if (filter.isEmpty()) - return true; + if(filter.isEmpty()) return true; - switch (filterType) { + switch(filterType) { case 0: { // Accept items in frames only - for (ItemStack filterEntry : filter) { - if (filterEntry == null) - continue; + for(ItemStack filterEntry : filter) { + if(filterEntry == null) continue; - if (stack.isItemEqual(filterEntry) && ItemStack.areItemStackTagsEqual(filterEntry, stack)) + if(stack.isItemEqual(filterEntry) && ItemStack.areItemStackTagsEqual(filterEntry, stack)) return true; } @@ -136,28 +127,24 @@ public class SubTileHopperhock extends SubTileFunctional { public List getFilterForInventory(IInventory inv, int x, int y, int z, boolean recursiveForDoubleChests) { List filter = new ArrayList(); - if (recursiveForDoubleChests) { + if(recursiveForDoubleChests) { TileEntity tileEntity = supertile.getWorldObj().getTileEntity(x, y, z); Block chest = supertile.getWorldObj().getBlock(x, y, z); - if (tileEntity instanceof TileEntityChest) - for (ForgeDirection dir : VALID_DIRS) - if (supertile.getWorldObj().getBlock(x + dir.offsetX, y, z + dir.offsetZ) == chest) { - filter.addAll(getFilterForInventory((IInventory) supertile.getWorldObj().getTileEntity(x + dir.offsetX, y, z + dir.offsetZ), x + dir.offsetX, y, z + dir.offsetZ, false)); - break; - } + if(tileEntity instanceof TileEntityChest) for(ForgeDirection dir : VALID_DIRS) + if(supertile.getWorldObj().getBlock(x + dir.offsetX, y, z + dir.offsetZ) == chest) { + filter.addAll(getFilterForInventory((IInventory) supertile.getWorldObj().getTileEntity(x + dir.offsetX, y, z + dir.offsetZ), x + dir.offsetX, y, z + dir.offsetZ, false)); + break; + } } - final int[] orientationToDir = new int[]{ - 3, 4, 2, 5 - }; + final int[] orientationToDir = new int[]{3, 4, 2, 5}; - for (ForgeDirection dir : VALID_DIRS) { + for(ForgeDirection dir : VALID_DIRS) { List frames = supertile.getWorldObj().getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, x + dir.offsetX + 1, y + dir.offsetY + 1, z + dir.offsetZ + 1)); - for (EntityItemFrame frame : frames) { + for(EntityItemFrame frame : frames) { int orientation = frame.hangingDirection; - if (orientationToDir[orientation] == dir.ordinal()) - filter.add(frame.getDisplayedItem()); + if(orientationToDir[orientation] == dir.ordinal()) filter.add(frame.getDisplayedItem()); } } @@ -166,7 +153,7 @@ public class SubTileHopperhock extends SubTileFunctional { @Override public boolean onWanded(EntityPlayer player, ItemStack wand) { - if (player.isSneaking()) { + if(player.isSneaking()) { filterType = filterType == 2 ? 0 : filterType + 1; sync(); diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java index d8a816ab1..5b5368666 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java @@ -27,22 +27,22 @@ public class SubTileJadedAmaranthus extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if (cooldown > 0) { + if(cooldown > 0) { cooldown--; return; } - if (mana >= COST && !supertile.getWorldObj().isRemote) { + if(mana >= COST && !supertile.getWorldObj().isRemote) { int range = 4; int x = supertile.xCoord - range + supertile.getWorldObj().rand.nextInt(range * 2 + 1); int y = supertile.yCoord + range; int z = supertile.zCoord - range + supertile.getWorldObj().rand.nextInt(range * 2 + 1); - for (int i = 0; i < range * 2; i++) { + for(int i = 0; i < range * 2; i++) { Block block = supertile.getWorldObj().getBlock(x, y, z); - if ((block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland) && supertile.getWorldObj().isAirBlock(x, y + 1, z)) { + if((block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland) && supertile.getWorldObj().isAirBlock(x, y + 1, z)) { int color = supertile.getWorldObj().rand.nextInt(16); - if (ModBlocks.flower.canBlockStay(supertile.getWorldObj(), x, y + 1, z)) + if(ModBlocks.flower.canBlockStay(supertile.getWorldObj(), x, y + 1, z)) supertile.getWorldObj().setBlock(x, y + 1, z, ModBlocks.flower, color, 1 | 2); mana -= COST; diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java index db50ba036..2a3d0c5a4 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java @@ -29,7 +29,7 @@ public class SubTileTangleberrie extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if (mana > 0) { + if(mana > 0) { double x1 = supertile.xCoord + 0.5; double y1 = supertile.yCoord + 0.5; double z1 = supertile.zCoord + 0.5; @@ -40,9 +40,8 @@ public class SubTileTangleberrie extends SubTileFunctional { AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(x1 - range, y1 - range, z1 - range, x1 + range, y1 + range, z1 + range); List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); - for (EntityLivingBase entity : entities) { - if (entity instanceof EntityPlayer) - continue; + for(EntityLivingBase entity : entities) { + if(entity instanceof EntityPlayer) continue; double x2 = entity.posX; double y2 = entity.posY; @@ -50,14 +49,14 @@ public class SubTileTangleberrie extends SubTileFunctional { float distance = MathHelper.pointDistanceSpace(x1, y1, z1, x2, y2, z2); - if (distance > maxDist && distance < range) { + if(distance > maxDist && distance < range) { MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity()); - if (supertile.getWorldObj().rand.nextInt(3) == 0) + if(supertile.getWorldObj().rand.nextInt(3) == 0) Botania.proxy.sparkleFX(supertile.getWorldObj(), x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3); } } - if (supertile.getWorldObj().getTotalWorldTime() % 4 == 0) { + if(supertile.getWorldObj().getTotalWorldTime() % 4 == 0) { mana--; sync(); } diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java index f659741f3..572209734 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java @@ -43,26 +43,25 @@ public class SubTileTigerseye extends SubTileFunctional { List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - rangeY, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + rangeY, supertile.zCoord + range)); - for (EntityLiving entity : entities) { + for(EntityLiving entity : entities) { List entries = new ArrayList(entity.tasks.taskEntries); entries.addAll(new ArrayList(entity.targetTasks.taskEntries)); boolean avoidsOcelots = false; - if (shouldAfffect) - for (EntityAITaskEntry entry : entries) { - if (entry.action instanceof EntityAIAvoidEntity) - avoidsOcelots = messWithRunAwayAI((EntityAIAvoidEntity) entry.action) || avoidsOcelots; + if(shouldAfffect) for(EntityAITaskEntry entry : entries) { + if(entry.action instanceof EntityAIAvoidEntity) + avoidsOcelots = messWithRunAwayAI((EntityAIAvoidEntity) entry.action) || avoidsOcelots; - if (entry.action instanceof EntityAINearestAttackableTarget) - messWithGetTargetAI((EntityAINearestAttackableTarget) entry.action); - } + if(entry.action instanceof EntityAINearestAttackableTarget) + messWithGetTargetAI((EntityAINearestAttackableTarget) entry.action); + } - if (entity instanceof EntityCreeper) { + if(entity instanceof EntityCreeper) { ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper) entity, 2, LibObfuscation.TIME_SINCE_IGNITED); entity.setAttackTarget(null); } - if (avoidsOcelots) { + if(avoidsOcelots) { mana -= cost; sync(); shouldAfffect = false; @@ -71,7 +70,7 @@ public class SubTileTigerseye extends SubTileFunctional { } private boolean messWithRunAwayAI(EntityAIAvoidEntity aiEntry) { - if (ReflectionHelper.getPrivateValue(EntityAIAvoidEntity.class, aiEntry, LibObfuscation.TARGET_ENTITY_CLASS) == EntityOcelot.class) { + if(ReflectionHelper.getPrivateValue(EntityAIAvoidEntity.class, aiEntry, LibObfuscation.TARGET_ENTITY_CLASS) == EntityOcelot.class) { ReflectionHelper.setPrivateValue(EntityAIAvoidEntity.class, aiEntry, EntityPlayer.class, LibObfuscation.TARGET_ENTITY_CLASS); return true; } @@ -79,7 +78,7 @@ public class SubTileTigerseye extends SubTileFunctional { } private void messWithGetTargetAI(EntityAINearestAttackableTarget aiEntry) { - if (ReflectionHelper.getPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, LibObfuscation.TARGET_CLASS) == EntityPlayer.class) + if(ReflectionHelper.getPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, LibObfuscation.TARGET_CLASS) == EntityPlayer.class) ReflectionHelper.setPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, EntityEnderCrystal.class, LibObfuscation.TARGET_CLASS); // Something random that won't be around } diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java index 966c4ebdd..8d454f1e3 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubtileOrechid.java @@ -34,11 +34,11 @@ public class SubtileOrechid extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if (!supertile.getWorldObj().isRemote && mana >= COST && supertile.getWorldObj().getTotalWorldTime() % 100 == 0) { + if(!supertile.getWorldObj().isRemote && mana >= COST && supertile.getWorldObj().getTotalWorldTime() % 100 == 0) { ChunkCoordinates coords = getCoordsToPut(); - if (coords != null) { + if(coords != null) { ItemStack stack = getOreToPut(); - if (stack != null) { + if(stack != null) { supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1 | 2); mana -= COST; @@ -50,14 +50,13 @@ public class SubtileOrechid extends SubTileFunctional { public ItemStack getOreToPut() { Collection values = new ArrayList(); - for (String s : BotaniaAPI.oreWeights.keySet()) + for(String s : BotaniaAPI.oreWeights.keySet()) values.add(new StringRandomItem(BotaniaAPI.oreWeights.get(s), s)); String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.getWorldObj().rand, values)).s; List ores = OreDictionary.getOres(ore); - if (ores.isEmpty()) - return getOreToPut(); + if(ores.isEmpty()) return getOreToPut(); return ores.get(0); } @@ -67,19 +66,18 @@ public class SubtileOrechid extends SubTileFunctional { 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++) { + for(int i = -range; i < range; i++) + for(int j = -rangeY; j < rangeY; j++) + for(int k = -range; k < range; k++) { int x = supertile.xCoord + i; int y = supertile.yCoord + j; int z = supertile.zCoord + k; Block block = supertile.getWorldObj().getBlock(x, y, z); - if (block != null && block.isReplaceableOreGen(supertile.getWorldObj(), x, y, z, Blocks.stone)) + if(block != null && block.isReplaceableOreGen(supertile.getWorldObj(), x, y, z, Blocks.stone)) possibleCoords.add(new ChunkCoordinates(x, y, z)); } - if (possibleCoords.isEmpty()) - return null; + if(possibleCoords.isEmpty()) return null; return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size())); } diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java index 9b9135a4d..af884fd28 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java @@ -26,12 +26,11 @@ public class SubTileArcaneRose extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if (mana >= getMaxMana()) - return; + if(mana >= getMaxMana()) return; List players = supertile.getWorldObj().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) { + for(EntityPlayer player : players) + if(ExperienceHelper.getPlayerXP(player) >= 1 && player.onGround) { ExperienceHelper.drainPlayerXP(player, 1); mana += 10; sync(); diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java index c55e74c0f..4285d55e3 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java @@ -34,27 +34,25 @@ public class SubTileEndoflame extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if (linkedCollector != null) { - if (burnTime == 0) { - if (mana < getMaxMana() && !supertile.getWorldObj().isRemote) { + if(linkedCollector != null) { + if(burnTime == 0) { + if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) { final int range = 3; boolean didSomething = false; List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range)); - for (EntityItem item : items) { - if (item.age >= 60 && !item.isDead) { + for(EntityItem item : items) { + if(item.age >= 60 && !item.isDead) { ItemStack stack = item.getEntityItem(); - if (stack.getItem().hasContainerItem(stack)) - continue; + if(stack.getItem().hasContainerItem(stack)) continue; int burnTime = stack == null || stack.getItem() == Item.getItemFromBlock(ModBlocks.spreader) ? 0 : TileEntityFurnace.getItemBurnTime(stack); - if (burnTime > 0 && stack.stackSize > 0) { + if(burnTime > 0 && stack.stackSize > 0) { this.burnTime = burnTime / 2; stack.stackSize--; - if (stack.stackSize == 0) - item.setDead(); + if(stack.stackSize == 0) item.setDead(); didSomething = true; @@ -63,11 +61,10 @@ public class SubTileEndoflame extends SubTileGenerating { } } - if (didSomething) - sync(); + if(didSomething) sync(); } } else { - if (supertile.getWorldObj().rand.nextInt(8) == 0) + if(supertile.getWorldObj().rand.nextInt(8) == 0) Botania.proxy.wispFX(supertile.getWorldObj(), 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.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); burnTime--; diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java index b8a061ee8..06148f57f 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java +++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java @@ -33,27 +33,24 @@ public class SubTileHydroangeas extends SubTileGenerating { boolean didSomething = false; - if (burnTime == 0) { - if (supertile.getWorldObj().getWorldTime() % 40L == 0) { - if (mana < getMaxMana() && !supertile.getWorldObj().isRemote) - for (int i = -range; i <= range; i++) - for (int j = -range; j <= range; j++) { - if (supertile.getWorldObj().getBlock(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == getBlockToSearchFor() && supertile.getWorldObj().getBlockMetadata(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == 0) { - supertile.getWorldObj().setBlockToAir(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j); - didSomething = true; - burnTime += getBurnTime(); + if(burnTime == 0) { + if(supertile.getWorldObj().getWorldTime() % 40L == 0) { + if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) for(int i = -range; i <= range; i++) + for(int j = -range; j <= range; j++) { + if(supertile.getWorldObj().getBlock(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == getBlockToSearchFor() && supertile.getWorldObj().getBlockMetadata(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == 0) { + supertile.getWorldObj().setBlockToAir(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j); + didSomething = true; + burnTime += getBurnTime(); - break; + break; - } } + } - if (didSomething) - sync(); + if(didSomething) sync(); } } else { - if (supertile.getWorldObj().rand.nextInt(8) == 0) - doBurnParticles(); + if(supertile.getWorldObj().rand.nextInt(8) == 0) doBurnParticles(); burnTime--; } } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileAltar.java b/MODSRC/vazkii/botania/common/block/tile/TileAltar.java index 2e6e7818f..b107dfc4d 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileAltar.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileAltar.java @@ -34,11 +34,10 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory { public boolean collideEntityItem(EntityItem item) { ItemStack stack = item.getEntityItem(); - if (stack == null) - return false; + if(stack == null) return false; - if (!hasWater) { - if (stack.getItem() == Items.water_bucket) { + if(!hasWater) { + if(stack.getItem() == Items.water_bucket) { hasWater = true; worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); stack.func_150996_a(Items.bucket); // Set item @@ -48,17 +47,15 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory { boolean didChange = false; - if (stack.getItem() instanceof IFlowerComponent) { - if (getStackInSlot(getSizeInventory() - 1) != null) - return false; + if(stack.getItem() instanceof IFlowerComponent) { + if(getStackInSlot(getSizeInventory() - 1) != null) return false; - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { stack.stackSize--; - if (stack.stackSize == 0) - item.setDead(); + if(stack.stackSize == 0) item.setDead(); - for (int i = 0; i < getSizeInventory(); i++) - if (getStackInSlot(i) == null) { + for(int i = 0; i < getSizeInventory(); i++) + if(getStackInSlot(i) == null) { ItemStack stackToPut = stack.copy(); stackToPut.stackSize = 1; setInventorySlotContents(i, stackToPut); @@ -66,16 +63,15 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory { break; } } - } else if (stack.getItem() == Items.wheat_seeds) { - for (RecipePetals recipe : BotaniaAPI.petalRecipes) { - if (recipe.matches(this)) { - for (int i = 0; i < getSizeInventory(); i++) + } else if(stack.getItem() == Items.wheat_seeds) { + for(RecipePetals recipe : BotaniaAPI.petalRecipes) { + if(recipe.matches(this)) { + for(int i = 0; i < getSizeInventory(); i++) setInventorySlotContents(i, null); - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { stack.stackSize--; - if (stack.stackSize == 0) - item.setDead(); + if(stack.stackSize == 0) item.setDead(); ItemStack output = recipe.getOutput().copy(); EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output); @@ -96,7 +92,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory { public void craftingFanciness() { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.levelup", 1F, 1F); - for (int i = 0; i < 25; i++) { + for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); @@ -110,18 +106,16 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory { boolean didChange = false; - for (EntityItem item : items) + for(EntityItem item : items) didChange = collideEntityItem(item) || didChange; - if (didChange) - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if(didChange) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - for (int i = 0; i < getSizeInventory(); i++) { + for(int i = 0; i < getSizeInventory(); i++) { ItemStack stackAt = getStackInSlot(i); - if (stackAt == null) - break; + if(stackAt == null) break; - if (Math.random() >= 0.97) { + if(Math.random() >= 0.97) { Color color = new Color(((IFlowerComponent) stackAt.getItem()).getParticleColor(stackAt)); float red = color.getRed() / 255F; float green = color.getGreen() / 255F; diff --git a/MODSRC/vazkii/botania/common/block/tile/TileDistributor.java b/MODSRC/vazkii/botania/common/block/tile/TileDistributor.java index f3b85c229..73bfbc6b4 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileDistributor.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileDistributor.java @@ -23,19 +23,16 @@ public class TileDistributor extends TileMod implements IManaReceiver { List validPools = new ArrayList(); - static final ForgeDirection[] DIRECTIONS = new ForgeDirection[]{ - ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST - }; + static final ForgeDirection[] DIRECTIONS = new ForgeDirection[]{ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST}; @Override public void updateEntity() { validPools.clear(); - for (ForgeDirection dir : DIRECTIONS) { + for(ForgeDirection dir : DIRECTIONS) { TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ); - if (tileAt != null && tileAt instanceof IManaPool) { + if(tileAt != null && tileAt instanceof IManaPool) { IManaReceiver receiver = (IManaReceiver) tileAt; - if (!receiver.isFull()) - validPools.add(receiver); + if(!receiver.isFull()) validPools.add(receiver); } } } @@ -53,9 +50,9 @@ public class TileDistributor extends TileMod implements IManaReceiver { @Override public void recieveMana(int mana) { int tiles = validPools.size(); - if (tiles != 0) { + if(tiles != 0) { int manaForEach = mana / tiles; - for (IManaReceiver pool : validPools) { + for(IManaReceiver pool : validPools) { pool.recieveMana(manaForEach); TileEntity tile = (TileEntity) pool; worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); diff --git a/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java b/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java index 1dfc1f0b1..470965578 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileEnchanter.java @@ -51,40 +51,27 @@ public class TileEnchanter extends TileMod implements IManaReceiver { public ItemStack itemToEnchant = null; List enchants = new ArrayList(); - private static final int[][] OBSIDIAN_LOCATIONS = new int[][]{ - {0, -1, 0}, - {0, -1, 1}, {0, -1, -1}, {1, -1, 0}, {-1, -1, 0}, - {0, -1, 2}, {-1, -1, 2}, {1, -1, 2}, - {0, -1, -2}, {-1, -1, -2}, {1, -1, -2}, - {2, -1, 0}, {2, -1, 1}, {2, -1, -1}, - {-2, -1, 0}, {-2, -1, 1}, {-2, -1, -1} - }; + private static final int[][] OBSIDIAN_LOCATIONS = new int[][]{{0, -1, 0}, {0, -1, 1}, {0, -1, -1}, {1, -1, 0}, {-1, -1, 0}, {0, -1, 2}, {-1, -1, 2}, {1, -1, 2}, {0, -1, -2}, {-1, -1, -2}, {1, -1, -2}, {2, -1, 0}, {2, -1, 1}, {2, -1, -1}, {-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}}, - {{0, 1, -5}, {0, 1, 5}, {3, 1, -4}, {3, 1, 4}, {-3, 1, -4}, {-3, 1, 4}} - }; + 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} - }; + private static final int[][] FLOWER_LOCATIONS = new int[][]{{-1, 0, -1}, {1, 0, -1}, {-1, 0, 1}, {1, 0, 1}}; public void onWanded(EntityPlayer player, ItemStack wand) { - if (stage != 0 || itemToEnchant == null || !itemToEnchant.isItemEnchantable()) - return; + if(stage != 0 || itemToEnchant == null || !itemToEnchant.isItemEnchantable()) return; List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3)); int count = items.size(); - if (count > 0 && !worldObj.isRemote) { - for (EntityItem entity : items) { + if(count > 0 && !worldObj.isRemote) { + for(EntityItem entity : items) { ItemStack item = entity.getEntityItem(); - if (item.getItem() == Items.enchanted_book) { + if(item.getItem() == Items.enchanted_book) { NBTTagList enchants = Items.enchanted_book.func_92110_g(item); - if (enchants != null && enchants.tagCount() > 0) { + if(enchants != null && enchants.tagCount() > 0) { NBTTagCompound enchant = (NBTTagCompound) enchants.getCompoundTagAt(0); short id = enchant.getShort("id"); - if (isEnchantmentValid(id)) { + if(isEnchantmentValid(id)) { advanceStage(); return; } @@ -96,14 +83,13 @@ public class TileEnchanter extends TileMod implements IManaReceiver { @Override public void updateEntity() { - if (!canEnchanterExist(worldObj, xCoord, yCoord, zCoord, getBlockMetadata())) { - for (int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) { + if(!canEnchanterExist(worldObj, xCoord, yCoord, zCoord, getBlockMetadata())) { + for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) { TilePylon pylonTile = (TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]); - if (pylonTile != null) - pylonTile.activated = false; + if(pylonTile != null) pylonTile.activated = false; } worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.lapis_block, 0, 1 | 2); - for (int i = 0; i < 50; i++) { + for(int i = 0; i < 50; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); @@ -112,23 +98,23 @@ public class TileEnchanter extends TileMod implements IManaReceiver { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "mob.blaze.breathe", 0.5F, 10F); } - switch (stage) { + switch(stage) { case 1: { // Get books - if (stageTicks % 20 == 0) { + if(stageTicks % 20 == 0) { List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3)); int count = items.size(); boolean addedEnch = false; - if (count > 0 && !worldObj.isRemote) { - for (EntityItem entity : items) { + if(count > 0 && !worldObj.isRemote) { + for(EntityItem entity : items) { ItemStack item = entity.getEntityItem(); - if (item.getItem() == Items.enchanted_book) { + if(item.getItem() == Items.enchanted_book) { NBTTagList enchants = Items.enchanted_book.func_92110_g(item); - if (enchants != null && enchants.tagCount() > 0) { + if(enchants != null && enchants.tagCount() > 0) { NBTTagCompound enchant = (NBTTagCompound) enchants.getCompoundTagAt(0); short enchantId = enchant.getShort("id"); short enchantLvl = enchant.getShort("lvl"); - if (!hasEnchantAlready(enchantId)) { + if(!hasEnchantAlready(enchantId)) { this.enchants.add(new EnchantmentData(enchantId, enchantLvl)); worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.orb", 1F, 1F); addedEnch = true; @@ -139,18 +125,17 @@ public class TileEnchanter extends TileMod implements IManaReceiver { } } - if (!addedEnch) { - if (enchants.isEmpty()) - stage = 0; + if(!addedEnch) { + if(enchants.isEmpty()) stage = 0; else advanceStage(); } } break; } case 2: { // Get Mana - for (int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) { + for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) { TilePylon pylonTile = (TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]); - if (pylonTile != null) { + if(pylonTile != null) { pylonTile.activated = true; pylonTile.centerX = xCoord; pylonTile.centerY = yCoord; @@ -158,35 +143,34 @@ public class TileEnchanter extends TileMod implements IManaReceiver { } } - if (manaRequired == -1) { + if(manaRequired == -1) { manaRequired = 0; - for (EnchantmentData data : enchants) { + 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)); } - } else if (mana >= manaRequired) { + } else if(mana >= manaRequired) { manaRequired = 0; - for (int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) + for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) ((TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2])).activated = false; advanceStage(); } else { getManaFromPools: { - for (int i = -4; i < 5; i++) - for (int j = -4; j < 5; j++) { + for(int i = -4; i < 5; i++) + for(int j = -4; j < 5; j++) { TileEntity tile = worldObj.getTileEntity(xCoord + i, yCoord, zCoord + j); - if (tile instanceof IManaPool) { + if(tile instanceof IManaPool) { IManaPool pool = (IManaPool) tile; int manaToRemove = Math.min(pool.getCurrentMana(), Math.min(1000, manaRequired - mana + 1)); - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { pool.recieveMana(-manaToRemove); recieveMana((int) (manaToRemove * 0.9)); sync(); } - if (mana >= manaRequired) - break getManaFromPools; + if(mana >= manaRequired) break getManaFromPools; } } } @@ -195,8 +179,8 @@ public class TileEnchanter extends TileMod implements IManaReceiver { break; } case 3: { // Enchant - if (stageTicks >= 100) { - for (EnchantmentData data : enchants) + if(stageTicks >= 100) { + for(EnchantmentData data : enchants) itemToEnchant.addEnchantment(Enchantment.enchantmentsList[data.enchant], data.level); enchants.clear(); @@ -209,23 +193,20 @@ public class TileEnchanter extends TileMod implements IManaReceiver { break; } case 4: { // Reset - if (stageTicks >= 20) - advanceStage(); + if(stageTicks >= 20) advanceStage(); break; } } - if (stage != 0) - stageTicks++; + if(stage != 0) stageTicks++; } public void advanceStage() { stage++; - if (stage == 4) - stage3EndTicks = stageTicks; - else if (stage == 5) { + if(stage == 4) stage3EndTicks = stageTicks; + else if(stage == 5) { stage = 0; stage3EndTicks = 0; } @@ -236,7 +217,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver { public void craftingFanciness() { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.levelup", 1F, 1F); - for (int i = 0; i < 25; i++) { + for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); @@ -277,12 +258,11 @@ public class TileEnchanter extends TileMod implements IManaReceiver { cmp.setInteger(TAG_STAGE_3_END_TICKS, stage3EndTicks); NBTTagCompound itemCmp = new NBTTagCompound(); - if (itemToEnchant != null) - itemToEnchant.writeToNBT(itemCmp); + if(itemToEnchant != null) itemToEnchant.writeToNBT(itemCmp); cmp.setTag(TAG_ITEM, itemCmp); String enchStr = ""; - for (EnchantmentData data : enchants) + for(EnchantmentData data : enchants) enchStr = enchStr + data.enchant + ":" + data.level + ","; cmp.setString(TAG_ENCHANTS, enchStr.isEmpty() ? enchStr : enchStr.substring(0, enchStr.length() - 1)); } @@ -300,9 +280,9 @@ public class TileEnchanter extends TileMod implements IManaReceiver { enchants.clear(); String enchStr = cmp.getString(TAG_ENCHANTS); - if (!enchStr.isEmpty()) { + if(!enchStr.isEmpty()) { String[] enchTokens = enchStr.split(","); - for (String token : enchTokens) { + for(String token : enchTokens) { String[] entryTokens = token.split(":"); int id = Integer.parseInt(entryTokens[0]); int lvl = Integer.parseInt(entryTokens[1]); @@ -312,40 +292,34 @@ public class TileEnchanter extends TileMod implements IManaReceiver { } private boolean hasEnchantAlready(int enchant) { - for (EnchantmentData data : enchants) - if (data.enchant == enchant) - return true; + for(EnchantmentData data : enchants) + if(data.enchant == enchant) return true; return false; } public boolean isEnchantmentValid(short id) { Enchantment ench = Enchantment.enchantmentsList[id]; - if (!ench.canApply(itemToEnchant) || !ench.type.canEnchantItem(itemToEnchant.getItem())) - return false; + if(!ench.canApply(itemToEnchant) || !ench.type.canEnchantItem(itemToEnchant.getItem())) return false; - for (EnchantmentData data : enchants) { + for(EnchantmentData data : enchants) { Enchantment otherEnch = Enchantment.enchantmentsList[data.enchant]; - if (!otherEnch.canApplyTogether(ench) || !ench.canApplyTogether(otherEnch)) - return false; + if(!otherEnch.canApplyTogether(ench) || !ench.canApplyTogether(otherEnch)) return false; } return true; } public static boolean canEnchanterExist(World world, int x, int y, int z, int meta) { - for (int[] obsidian : OBSIDIAN_LOCATIONS) - if (world.getBlock(obsidian[0] + x, obsidian[1] + y, obsidian[2] + z) != Blocks.obsidian) + for(int[] obsidian : OBSIDIAN_LOCATIONS) + if(world.getBlock(obsidian[0] + x, obsidian[1] + y, obsidian[2] + z) != Blocks.obsidian) return false; + + for(int[] pylon : PYLON_LOCATIONS[meta]) + if(world.getBlock(pylon[0] + x, pylon[1] + y, pylon[2] + z) != ModBlocks.pylon || world.getBlock(pylon[0] + x, pylon[1] + y - 1, pylon[2] + z) != ModBlocks.flower) return false; - for (int[] pylon : PYLON_LOCATIONS[meta]) - if (world.getBlock(pylon[0] + x, pylon[1] + y, pylon[2] + z) != ModBlocks.pylon || - world.getBlock(pylon[0] + x, pylon[1] + y - 1, pylon[2] + z) != ModBlocks.flower) - return false; - - for (int[] flower : FLOWER_LOCATIONS) - if (world.getBlock(flower[0] + x, flower[1] + y, flower[2] + z) != ModBlocks.flower) - return false; + for(int[] flower : FLOWER_LOCATIONS) + if(world.getBlock(flower[0] + x, flower[1] + y, flower[2] + z) != ModBlocks.flower) return false; return true; } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileManaBeacon.java b/MODSRC/vazkii/botania/common/block/tile/TileManaBeacon.java index 000ae6833..36d3c46c3 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileManaBeacon.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileManaBeacon.java @@ -20,20 +20,19 @@ public class TileManaBeacon extends TileMod { @Override public void updateEntity() { boolean redstone = false; - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); - if (redstoneSide > 0) - redstone = true; + if(redstoneSide > 0) redstone = true; } - if (!redstone) { + if(!redstone) { float[] color = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(xCoord, yCoord, zCoord)]; Botania.proxy.setWispFXDistanceLimit(false); - for (int i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) Botania.proxy.wispFX(worldObj, xCoord + 0.5, yCoord, zCoord + 0.5, color[0], color[1], color[2], (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - yCoord)), (float) (Math.random() - 0.5F)); - for (int i = 0; i < 4; i++) + for(int i = 0; i < 4; i++) Botania.proxy.wispFX(worldObj, xCoord + 0.5, 256, zCoord + 0.5, color[0], color[1], color[2], (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F); Botania.proxy.setWispFXDistanceLimit(true); } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java b/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java index 28375a955..dd1726ab6 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileManaDetector.java @@ -19,11 +19,10 @@ public class TileManaDetector extends TileMod implements IManaCollisionGhost { @Override public void updateEntity() { - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { int meta = getBlockMetadata(); int expectedMeta = worldObj.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)).size() != 0 ? 1 : 0; - if (meta != expectedMeta) - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, expectedMeta, 1 | 2); + if(meta != expectedMeta) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, expectedMeta, 1 | 2); } } diff --git a/MODSRC/vazkii/botania/common/block/tile/TilePool.java b/MODSRC/vazkii/botania/common/block/tile/TilePool.java index ae0b7db99..52a31032b 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TilePool.java +++ b/MODSRC/vazkii/botania/common/block/tile/TilePool.java @@ -60,8 +60,7 @@ public class TilePool extends TileMod implements IManaPool { boolean full = this.mana >= MAX_MANA; this.mana = Math.min(this.mana + mana, MAX_MANA); - if (!full) - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + if(!full) worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); } @Override @@ -79,19 +78,17 @@ public class TilePool extends TileMod implements IManaPool { public boolean collideEntityItem(EntityItem item) { boolean didChange = false; ItemStack stack = item.getEntityItem(); - if (stack == null) - return false; + if(stack == null) return false; - for (RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { - if (recipe.matches(stack)) { + for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { + if(recipe.matches(stack)) { int mana = recipe.getManaToConsume(); - if (getCurrentMana() >= mana) { + if(getCurrentMana() >= mana) { recieveMana(-mana); - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { stack.stackSize--; - if (stack.stackSize == 0) - item.setDead(); + if(stack.stackSize == 0) item.setDead(); ItemStack output = recipe.getOutput().copy(); EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output); @@ -110,7 +107,7 @@ public class TilePool extends TileMod implements IManaPool { public void craftingFanciness() { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.levelup", 1F, 1F); - for (int i = 0; i < 25; i++) { + for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); @@ -120,44 +117,42 @@ public class TilePool extends TileMod implements IManaPool { @Override public void updateEntity() { - if (!added) { + if(!added) { ManaNetworkEvent.addPool(this); added = true; } - if (worldObj.isRemote) { + if(worldObj.isRemote) { double particleChance = 1F - (double) getCurrentMana() / (double) MAX_MANA * 0.1; Color color = new Color(0x00C6FF); - if (Math.random() > particleChance) + if(Math.random() > particleChance) Botania.proxy.wispFX(worldObj, xCoord + 0.3 + Math.random() * 0.5, yCoord + 0.6 + Math.random() * 0.25, zCoord + Math.random(), color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F); } List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)); - for (EntityItem item : items) { + for(EntityItem item : items) { ItemStack stack = item.getEntityItem(); - if (stack != null && stack.getItem() instanceof IManaItem) { + if(stack != null && stack.getItem() instanceof IManaItem) { IManaItem mana = (IManaItem) stack.getItem(); - if (outputting && mana.canReceiveManaFromPool(stack, this) || !outputting && mana.canExportManaToPool(stack, this)) { + if(outputting && mana.canReceiveManaFromPool(stack, this) || !outputting && mana.canExportManaToPool(stack, this)) { boolean didSomething = false; - if (outputting) { - if (this.mana > 0) - didSomething = true; + if(outputting) { + if(this.mana > 0) didSomething = true; int manaVal = Math.min(1000, Math.min(this.mana, mana.getMaxMana(stack) - mana.getMana(stack))); mana.addMana(stack, manaVal); recieveMana(-manaVal); } else { - if (mana.getMana(stack) > 0) - didSomething = true; + if(mana.getMana(stack) > 0) didSomething = true; int manaVal = Math.min(1000, Math.min(MAX_MANA - this.mana, mana.getMana(stack))); mana.addMana(stack, -manaVal); recieveMana(manaVal); } - if (didSomething) { + if(didSomething) { worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - if (worldObj.isRemote) { + if(worldObj.isRemote) { Color color = new Color(0x00C6FF); Botania.proxy.wispFX(worldObj, item.posX + Math.random() * 0.5 - 0.25, item.posY + Math.random() * 0.5 - (outputting ? 0.65 : 0.25), item.posZ + Math.random() * 0.5 - 0.25, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 15F, (outputting ? -1F : 1) * (float) Math.random() / 25F); } @@ -178,21 +173,20 @@ public class TilePool extends TileMod implements IManaPool { mana = cmp.getInteger(TAG_MANA); outputting = cmp.getBoolean(TAG_OUTPUTTING); - if (cmp.hasKey(TAG_KNOWN_MANA)) - knownMana = cmp.getInteger(TAG_KNOWN_MANA); + if(cmp.hasKey(TAG_KNOWN_MANA)) knownMana = cmp.getInteger(TAG_KNOWN_MANA); } public void onWanded(EntityPlayer player, ItemStack wand) { - if (player.isSneaking()) { + if(player.isSneaking()) { outputting = !outputting; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeCustomNBT(nbttagcompound); nbttagcompound.setInteger(TAG_KNOWN_MANA, getCurrentMana()); - if (player instanceof EntityPlayerMP) + if(player instanceof EntityPlayerMP) ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound)); } diff --git a/MODSRC/vazkii/botania/common/block/tile/TilePylon.java b/MODSRC/vazkii/botania/common/block/tile/TilePylon.java index 727e503d3..84694019c 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TilePylon.java +++ b/MODSRC/vazkii/botania/common/block/tile/TilePylon.java @@ -25,8 +25,8 @@ public class TilePylon extends TileEntity { @Override public void updateEntity() { - if (activated && worldObj.isRemote) { - if (worldObj.getBlock(centerX, centerY, centerZ) != ModBlocks.enchanter) { + if(activated && worldObj.isRemote) { + if(worldObj.getBlock(centerX, centerY, centerZ) != ModBlocks.enchanter) { activated = false; return; } @@ -34,11 +34,11 @@ public class TilePylon extends TileEntity { Vector3 centerBlock = new Vector3(centerX + 0.5, centerY + 0.75 + (Math.random() - 0.5 * 0.25), centerZ + 0.5); Block block = worldObj.getBlock(xCoord, yCoord - 1, zCoord); - if (block == ModBlocks.flower) { + if(block == ModBlocks.flower) { int meta = worldObj.getBlockMetadata(xCoord, yCoord - 1, zCoord); float[] color = EntitySheep.fleeceColorTable[meta]; - if (worldObj.rand.nextInt(4) == 0) + if(worldObj.rand.nextInt(4) == 0) Botania.proxy.sparkleFX(worldObj, centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, color[0], color[1], color[2], (float) Math.random(), 8); Botania.proxy.wispFX(worldObj, xCoord + 0.5 + (Math.random() - 0.5) * 0.25, yCoord - 0.5, zCoord + 0.5 + (Math.random() - 0.5) * 0.25, color[0], color[1], color[2], (float) Math.random() / 3F, -0.04F); @@ -50,7 +50,7 @@ public class TilePylon extends TileEntity { } } - if (worldObj.rand.nextBoolean() && worldObj.isRemote) + if(worldObj.rand.nextBoolean() && worldObj.isRemote) Botania.proxy.sparkleFX(worldObj, xCoord + Math.random(), yCoord + Math.random() * 1.5, zCoord + Math.random(), 0.5F, 0.5F, 1F, (float) Math.random(), 2); } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java b/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java index b4aa0a1fc..f7257863d 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -37,29 +37,27 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor int mana = 0; public boolean addItem(EntityPlayer player, ItemStack stack) { - if (stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0) - return false; + if(stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0) return false; boolean did = false; - for (int i = 0; i < getSizeInventory(); i++) - if (getStackInSlot(i) == null) { + for(int i = 0; i < getSizeInventory(); i++) + if(getStackInSlot(i) == null) { did = true; ItemStack stackToAdd = stack.copy(); stackToAdd.stackSize = 1; setInventorySlotContents(i, stackToAdd); - if (!player.capabilities.isCreativeMode) { + if(!player.capabilities.isCreativeMode) { stack.stackSize--; - if (stack.stackSize == 0) + if(stack.stackSize == 0) player.inventory.setInventorySlotContents(player.inventory.currentItem, null); } break; } - if (did) - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if(did) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); return true; } @@ -71,8 +69,8 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor // Update every tick. recieveMana(0); - if (worldObj.isRemote && manaToGet > 0 && mana >= manaToGet) { - if (worldObj.rand.nextInt(20) == 0) { + if(worldObj.isRemote && manaToGet > 0 && mana >= manaToGet) { + if(worldObj.rand.nextInt(20) == 0) { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "mob.creeper.live", 1F, 1F); Vector3 vec = Vector3.fromTileEntityCenter(this); @@ -88,15 +86,15 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor getMana: { - for (RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes) - if (recipe.matches(this)) { + for(RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes) + if(recipe.matches(this)) { this.manaToGet = recipe.getManaUsage(); break getMana; } this.manaToGet = 0; } - if (manaToGet != this.manaToGet) { + if(manaToGet != this.manaToGet) { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.orb", 1F, 1F); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @@ -107,39 +105,38 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor RecipeRuneAltar recipe = null; - for (RecipeRuneAltar recipe_ : BotaniaAPI.runeAltarRecipes) { - if (recipe_.matches(this)) { + for(RecipeRuneAltar recipe_ : BotaniaAPI.runeAltarRecipes) { + if(recipe_.matches(this)) { recipe = recipe_; break; } } - if (manaToGet > 0 && mana >= manaToGet) { + if(manaToGet > 0 && mana >= manaToGet) { List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)); EntityItem livingrock = null; - for (EntityItem item : items) - if (item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) { + for(EntityItem item : items) + if(item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) { livingrock = item; break; } - if (livingrock != null) { + if(livingrock != null) { int mana = recipe.getManaUsage(); recieveMana(-mana); - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { ItemStack output = recipe.getOutput().copy(); EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output); worldObj.spawnEntityInWorld(outputItem); } - for (int i = 0; i < getSizeInventory(); i++) + for(int i = 0; i < getSizeInventory(); i++) setInventorySlotContents(i, null); - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { ItemStack livingrockItem = livingrock.getEntityItem(); livingrockItem.stackSize--; - if (livingrockItem.stackSize == 0) - livingrock.setDead(); + if(livingrockItem.stackSize == 0) livingrock.setDead(); } craftingFanciness(); @@ -151,7 +148,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor public void craftingFanciness() { worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.levelup", 1F, 1F); - for (int i = 0; i < 25; i++) { + for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); @@ -191,9 +188,8 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor @Override public int[] getAccessibleSlotsFromSide(int var1) { int accessibleSlot = -1; - for (int i = 0; i < getSizeInventory(); i++) - if (getStackInSlot(i) != null) - accessibleSlot = i; + for(int i = 0; i < getSizeInventory(); i++) + if(getStackInSlot(i) != null) accessibleSlot = i; return accessibleSlot == -1 ? new int[0] : new int[]{accessibleSlot}; } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileSimpleInventory.java b/MODSRC/vazkii/botania/common/block/tile/TileSimpleInventory.java index af7ce2525..431e7e623 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileSimpleInventory.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileSimpleInventory.java @@ -25,19 +25,18 @@ public abstract class TileSimpleInventory extends TileMod implements IInventory public void readCustomNBT(NBTTagCompound par1NBTTagCompound) { NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10); inventorySlots = new ItemStack[getSizeInventory()]; - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + for(int var3 = 0; var3 < var2.tagCount(); ++var3) { NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3); byte var5 = var4.getByte("Slot"); - if (var5 >= 0 && var5 < inventorySlots.length) - inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4); + if(var5 >= 0 && var5 < inventorySlots.length) inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4); } } @Override public void writeCustomNBT(NBTTagCompound par1NBTTagCompound) { NBTTagList var2 = new NBTTagList(); - for (int var3 = 0; var3 < inventorySlots.length; ++var3) { - if (inventorySlots[var3] != null) { + for(int var3 = 0; var3 < inventorySlots.length; ++var3) { + if(inventorySlots[var3] != null) { NBTTagCompound var4 = new NBTTagCompound(); var4.setByte("Slot", (byte) var3); inventorySlots[var3].writeToNBT(var4); @@ -54,18 +53,17 @@ public abstract class TileSimpleInventory extends TileMod implements IInventory @Override public ItemStack decrStackSize(int i, int j) { - if (inventorySlots[i] != null) { + if(inventorySlots[i] != null) { ItemStack stackAt; - if (inventorySlots[i].stackSize <= j) { + if(inventorySlots[i].stackSize <= j) { stackAt = inventorySlots[i]; inventorySlots[i] = null; return stackAt; } else { stackAt = inventorySlots[i].splitStack(j); - if (inventorySlots[i].stackSize == 0) - inventorySlots[i] = null; + if(inventorySlots[i].stackSize == 0) inventorySlots[i] = null; return stackAt; } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileSpecialFlower.java b/MODSRC/vazkii/botania/common/block/tile/TileSpecialFlower.java index de4d6ab2d..c24b504fa 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileSpecialFlower.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileSpecialFlower.java @@ -49,15 +49,14 @@ public class TileSpecialFlower extends TileMod implements ITileBound { try { SubTileEntity tile = tileClass.newInstance(); setSubTile(tile); - } catch (Exception e) { + } catch(Exception e) { e.printStackTrace(); } } @Override public void updateEntity() { - if (subTile != null) - subTile.onUpdate(); + if(subTile != null) subTile.onUpdate(); } @Override @@ -82,7 +81,7 @@ public class TileSpecialFlower extends TileMod implements ITileBound { subTileName = cmp.getString(TAG_SUBTILE_NAME); NBTTagCompound subCmp = cmp.getCompoundTag(TAG_SUBTILE_CMP); - if (subTile == null || !BotaniaAPI.getSubTileStringMapping(subTile.getClass()).equals(subTileName)) + if(subTile == null || !BotaniaAPI.getSubTileStringMapping(subTile.getClass()).equals(subTileName)) provideSubTile(subTileName); subTile.readFromPacketNBT(subCmp); @@ -101,14 +100,12 @@ public class TileSpecialFlower extends TileMod implements ITileBound { } public void renderHUD(Minecraft mc, ScaledResolution res) { - if (subTile != null) - subTile.renderHUD(mc, res); + if(subTile != null) subTile.renderHUD(mc, res); } @Override public ChunkCoordinates getBinding() { - if (subTile == null) - return null; + if(subTile == null) return null; return subTile.getBinding(); } } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileSpiritShrine.java b/MODSRC/vazkii/botania/common/block/tile/TileSpiritShrine.java index 595476120..7033cc211 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileSpiritShrine.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileSpiritShrine.java @@ -19,16 +19,9 @@ public class TileSpiritShrine extends TileMod { @Override public void updateEntity() { - if (worldObj.isRemote) { - if (ticks >= 40) { - float[][] colors = new float[][]{ - {0F, 0.25F, 1F}, - {1F, 0F, 0.2F}, - {0F, 1F, 0.25F}, - {1F, 1F, 0.25F}, - {1F, 0.25F, 1F}, - {0.25F, 1F, 1F} - }; + if(worldObj.isRemote) { + if(ticks >= 40) { + float[][] colors = new float[][]{{0F, 0.25F, 1F}, {1F, 0F, 0.2F}, {0F, 1F, 0.25F}, {1F, 1F, 0.25F}, {1F, 0.25F, 1F}, {0.25F, 1F, 1F}}; int totalSpiritCount = 6; double tickIncrement = 360D / totalSpiritCount; @@ -37,13 +30,13 @@ public class TileSpiritShrine extends TileMod { int existTicks = liftTicks * 2; int lowerTicks = existTicks + liftTicks; - if (ticks < lowerTicks) { + if(ticks < lowerTicks) { int speed = 5; double wticks = ticks * speed - tickIncrement; double r = Math.sin((ticks >= liftTicks ? (ticks - liftTicks) * speed - tickIncrement : -tickIncrement) * Math.PI / 180 * 0.75) + 1 * 1.25 + 0.5; double g = Math.sin(wticks * Math.PI / 180 * 0.55); - for (int i = 0; i < totalSpiritCount; i++) { + for(int i = 0; i < totalSpiritCount; i++) { double x = xCoord + Math.sin(wticks * Math.PI / 180) * r + 0.5; double y = yCoord + ((ticks > existTicks ? 40 - (double) (ticks - existTicks) : Math.min(80 + 40 * i, ticks) - 40 * (i + 1)) * 0.1); double z = zCoord + Math.cos(wticks * Math.PI / 180) * r + 0.5; diff --git a/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java b/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java index 40c4884d1..4a951596e 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java @@ -88,19 +88,19 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, @Override public void updateEntity() { - if (!added) { + if(!added) { ManaNetworkEvent.addCollector(this); added = true; } boolean redstone = false; - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); - if (tileAt instanceof IManaPool) { + if(tileAt instanceof IManaPool) { IManaPool pool = (IManaPool) tileAt; int manaInPool = pool.getCurrentMana(); - if (manaInPool > 0 && !isFull()) { + if(manaInPool > 0 && !isFull()) { int manaMissing = MAX_MANA - mana; int manaToRemove = Math.min(manaInPool, manaMissing); pool.recieveMana(-manaToRemove); @@ -109,20 +109,16 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); - if (redstoneSide > 0) - redstone = true; + if(redstoneSide > 0) redstone = true; } - if (needsNewBurstSimulation()) - checkForReceiver(); + if(needsNewBurstSimulation()) checkForReceiver(); boolean shouldShoot = !redstone; - if (isRedstone()) - shouldShoot = redstone && !redstoneLastTick; + if(isRedstone()) shouldShoot = redstone && !redstoneLastTick; - if (shouldShoot) - tryShootBurst(); + if(shouldShoot) tryShootBurst(); redstoneLastTick = redstone; } @@ -145,11 +141,9 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, rotationY = cmp.getFloat(TAG_ROTATION_Y); requestsClientUpdate = cmp.getBoolean(TAG_REQUEST_UPDATE); - if (cmp.hasKey(TAG_KNOWN_MANA)) - knownMana = cmp.getInteger(TAG_KNOWN_MANA); + if(cmp.hasKey(TAG_KNOWN_MANA)) knownMana = cmp.getInteger(TAG_KNOWN_MANA); - if (worldObj != null && worldObj.isRemote) - hasReceivedInitialPacket = true; + if(worldObj != null && worldObj.isRemote) hasReceivedInitialPacket = true; } @Override @@ -163,30 +157,29 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } public void onWanded(EntityPlayer player, ItemStack wand) { - if (!player.isSneaking()) { - if (!worldObj.isRemote) { + if(!player.isSneaking()) { + if(!worldObj.isRemote) { NBTTagCompound nbttagcompound = new NBTTagCompound(); writeCustomNBT(nbttagcompound); nbttagcompound.setInteger(TAG_KNOWN_MANA, mana); - if (player instanceof EntityPlayerMP) + if(player instanceof EntityPlayerMP) ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound)); } worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1F); } else { MovingObjectPosition pos = raytraceFromEntity(worldObj, player, true, 5); - if (pos != null && pos.hitVec != null && !worldObj.isRemote) { + if(pos != null && pos.hitVec != null && !worldObj.isRemote) { double x = pos.hitVec.xCoord - xCoord - 0.5; double y = pos.hitVec.yCoord - yCoord - 0.5; double z = pos.hitVec.zCoord - zCoord - 0.5; - if (pos.sideHit != 0 && pos.sideHit != 1) { + if(pos.sideHit != 0 && pos.sideHit != 1) { Vector3 clickVector = new Vector3(x, 0, z); Vector3 relative = new Vector3(-0.5, 0, 0); double angle = Math.acos(clickVector.dotProduct(relative) / (relative.mag() * clickVector.mag())) * 180D / Math.PI; rotationX = (float) angle + 180F; - if (clickVector.z < 0) - rotationX = 360 - rotationX; + if(clickVector.z < 0) rotationX = 360 - rotationX; } double angle = y * 180; @@ -200,30 +193,27 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } private boolean needsNewBurstSimulation() { - if (worldObj.isRemote && !hasReceivedInitialPacket) - return false; + if(worldObj.isRemote && !hasReceivedInitialPacket) return false; - if (lastTentativeBurst == null) - return true; + if(lastTentativeBurst == null) return true; - if (requestsClientUpdate) { + if(requestsClientUpdate) { requestsClientUpdate = false; return true; } - for (PositionProperties props : lastTentativeBurst) - if (!props.contentsEqual(worldObj)) - return true; + for(PositionProperties props : lastTentativeBurst) + if(!props.contentsEqual(worldObj)) return true; return false; } public void tryShootBurst() { - if (receiver != null || isRedstone()) { - if (canShootBurst && (isRedstone() || (receiver.canRecieveManaFromBursts() && !receiver.isFull()))) { + if(receiver != null || isRedstone()) { + if(canShootBurst && (isRedstone() || (receiver.canRecieveManaFromBursts() && !receiver.isFull()))) { EntityManaBurst burst = getBurst(false); - if (burst != null) { - if (!worldObj.isRemote) { + if(burst != null) { + if(!worldObj.isRemote) { mana -= burst.getStartingMana(); worldObj.spawnEntityInWorld(burst); } @@ -244,8 +234,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, fakeBurst.setScanBeam(); TileEntity receiver = fakeBurst.getCollidedTile(true); - if (receiver != null && receiver instanceof IManaReceiver) - this.receiver = (IManaReceiver) receiver; + if(receiver != null && receiver instanceof IManaReceiver) this.receiver = (IManaReceiver) receiver; else this.receiver = null; lastTentativeBurst = fakeBurst.propsList; } @@ -262,11 +251,10 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, BurstProperties props = new BurstProperties(maxMana, ticksBeforeManaLoss, manaLossPerTick, gravity, motionModifier, color); ItemStack lens = getStackInSlot(0); - if (lens != null) - ((ILens) lens.getItem()).apply(lens, props); + if(lens != null) ((ILens) lens.getItem()).apply(lens, props); burst.setSourceLens(lens); - if (getCurrentMana() >= props.maxMana || fake) { + if(getCurrentMana() >= props.maxMana || fake) { burst.setColor(props.color); burst.setMana(props.maxMana); burst.setStartingMana(props.maxMana); @@ -286,8 +274,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f; double d0 = player.prevPosX + (player.posX - player.prevPosX) * f; double d1 = player.prevPosY + (player.posY - player.prevPosY) * f; - if (!world.isRemote && player instanceof EntityPlayer) - d1 += 1.62D; + if(!world.isRemote && player instanceof EntityPlayer) d1 += 1.62D; double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f; Vec3 vec3 = world.getWorldVec3Pool().getVecFromPool(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); @@ -297,7 +284,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, float f7 = f4 * f5; float f8 = f3 * f5; double d3 = range; - if (player instanceof EntityPlayerMP) + if(player instanceof EntityPlayerMP) d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance(); Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); return world.func_147447_a(vec3, vec31, par3, !par3, par3); @@ -309,7 +296,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, HUDHandler.drawSimpleManaHUD(color, knownMana, MAX_MANA, name, res); ItemStack lens = getStackInSlot(0); - if (lens != null) { + if(lens != null) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); String lensName = lens.getDisplayName(); @@ -325,12 +312,12 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, GL11.glDisable(GL11.GL_BLEND); } - if (receiver != null) { + if(receiver != null) { TileEntity receiverTile = (TileEntity) receiver; ItemStack recieverStack = new ItemStack(worldObj.getBlock(receiverTile.xCoord, receiverTile.yCoord, receiverTile.zCoord), 1, receiverTile.getBlockMetadata()); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - if (recieverStack != null && recieverStack.getItem() != null) { + if(recieverStack != null && recieverStack.getItem() != null) { String stackName = recieverStack.getDisplayName(); int width = 16 + mc.fontRenderer.getStringWidth(stackName) / 2; int x = res.getScaledWidth() / 2 - width; @@ -349,7 +336,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, @Override public void onClientDisplayTick() { - if (worldObj != null) { + if(worldObj != null) { EntityManaBurst burst = getBurst(true); burst.getCollidedTile(false); } @@ -388,8 +375,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, @Override public ChunkCoordinates getBinding() { - if (receiver == null) - return null; + if(receiver == null) return null; TileEntity tile = (TileEntity) receiver; return new ChunkCoordinates(tile.xCoord, tile.yCoord, tile.zCoord); diff --git a/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java b/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java index cc2606540..3a43cc1b2 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileTurntable.java @@ -33,19 +33,17 @@ public class TileTurntable extends TileMod { public void updateEntity() { boolean redstone = false; - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); - if (redstoneSide > 0) - redstone = true; + if(redstoneSide > 0) redstone = true; } - if (!redstone) { + if(!redstone) { TileEntity tile = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); - if (tile instanceof TileSpreader) { + if(tile instanceof TileSpreader) { TileSpreader spreader = (TileSpreader) tile; spreader.rotationX += speed * (backwards ? -1 : 1); - if (spreader.rotationX >= 360F) - spreader.rotationX -= 360F; + if(spreader.rotationX >= 360F) spreader.rotationX -= 360F; spreader.checkForReceiver(); } } @@ -64,8 +62,7 @@ public class TileTurntable extends TileMod { } public void onWanded(EntityPlayer player, ItemStack wand) { - if (player.isSneaking()) - backwards = !backwards; + if(player.isSneaking()) backwards = !backwards; else speed = speed == 6 ? 1 : speed + 1; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @@ -75,7 +72,7 @@ public class TileTurntable extends TileMod { char motion = backwards ? '<' : '>'; String speed = EnumChatFormatting.BOLD + ""; - for (int i = 0; i < this.speed; i++) + for(int i = 0; i < this.speed; i++) speed = speed + motion; int x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(speed) / 2; diff --git a/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java b/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java index a79f50759..a4c053f63 100644 --- a/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java @@ -22,18 +22,18 @@ public class BiomeDecorationHandler { @SubscribeEvent(priority = EventPriority.LOWEST) public void onWorldDecoration(DecorateBiomeEvent.Decorate event) { - if ((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS) - for (int i = 0; i < ConfigHandler.flowerQuantity; i++) { + if((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS) + for(int i = 0; i < ConfigHandler.flowerQuantity; i++) { int x = event.chunkX + event.rand.nextInt(16) + 8; int z = event.chunkZ + event.rand.nextInt(16) + 8; int y = event.world.getTopSolidOrLiquidBlock(x, z); - for (int j = 0; j < ConfigHandler.flowerDensity; j++) { + for(int j = 0; j < ConfigHandler.flowerDensity; j++) { int x1 = x + event.rand.nextInt(8) - event.rand.nextInt(8); int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4); int z1 = z + event.rand.nextInt(8) - event.rand.nextInt(8); - if (event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1)) + if(event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1)) event.world.setBlock(x1, y1, z1, ModBlocks.flower, event.rand.nextInt(16), 2); } } diff --git a/MODSRC/vazkii/botania/common/core/handler/CommonTickHandler.java b/MODSRC/vazkii/botania/common/core/handler/CommonTickHandler.java index f22f2a032..72298272a 100644 --- a/MODSRC/vazkii/botania/common/core/handler/CommonTickHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/CommonTickHandler.java @@ -29,24 +29,22 @@ public final class CommonTickHandler { @SubscribeEvent public void onTick(WorldTickEvent event) { - if (event.phase == Phase.END) { + if(event.phase == Phase.END) { List entities = new ArrayList(event.world.loadedEntityList); - for (Entity entity : entities) - if (entity instanceof EntityItem) - TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity); + for(Entity entity : entities) + if(entity instanceof EntityItem) TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity); } } @SideOnly(Side.CLIENT) @SubscribeEvent public void onTick(ClientTickEvent event) { - if (event.phase == Phase.END) { + if(event.phase == Phase.END) { World world = Minecraft.getMinecraft().theWorld; - if (world != null) { + if(world != null) { List entities = new ArrayList(world.loadedEntityList); - for (Entity entity : entities) - if (entity instanceof EntityItem) - TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity); + for(Entity entity : entities) + if(entity instanceof EntityItem) TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity); } } diff --git a/MODSRC/vazkii/botania/common/core/handler/ManaNetworkHandler.java b/MODSRC/vazkii/botania/common/core/handler/ManaNetworkHandler.java index 10733c202..f50641af4 100644 --- a/MODSRC/vazkii/botania/common/core/handler/ManaNetworkHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/ManaNetworkHandler.java @@ -35,8 +35,7 @@ public final class ManaNetworkHandler implements IManaNetwork { @SubscribeEvent public void onNetworkEvent(ManaNetworkEvent event) { Map> map = event.type == ManaBlockType.COLLECTOR ? manaCollectors : manaPools; - if (event.action == Action.ADD) - add(map, event.tile); + if(event.action == Action.ADD) add(map, event.tile); else remove(map, event.tile); } @@ -48,15 +47,13 @@ public final class ManaNetworkHandler implements IManaNetwork { @Override public TileEntity getClosestPool(ChunkCoordinates pos, int dimension, int limit) { - if (manaPools.containsKey(dimension)) - return getClosest(manaPools.get(dimension), pos, limit); + if(manaPools.containsKey(dimension)) return getClosest(manaPools.get(dimension), pos, limit); return null; } @Override public TileEntity getClosestCollector(ChunkCoordinates pos, int dimension, int limit) { - if (manaCollectors.containsKey(dimension)) - return getClosest(manaCollectors.get(dimension), pos, limit); + if(manaCollectors.containsKey(dimension)) return getClosest(manaCollectors.get(dimension), pos, limit); return null; } @@ -64,12 +61,11 @@ public final class ManaNetworkHandler implements IManaNetwork { float closest = Float.MAX_VALUE; TileEntity closestTile = null; - for (TileEntity tile : tiles) { + for(TileEntity tile : tiles) { float distance = MathHelper.pointDistanceSpace(tile.xCoord, tile.yCoord, tile.zCoord, pos.posX, pos.posY, pos.posZ); - if (distance > limit) - continue; + if(distance > limit) continue; - if (distance < closest) { + if(distance < closest) { closest = distance; closestTile = tile; } @@ -81,8 +77,7 @@ public final class ManaNetworkHandler implements IManaNetwork { private synchronized void remove(Map> map, TileEntity tile) { int dim = tile.getWorldObj().provider.dimensionId; - if (!map.containsKey(dim)) - return; + if(!map.containsKey(dim)) return; List tiles = map.get(dim); tiles.remove(tile); @@ -92,13 +87,11 @@ public final class ManaNetworkHandler implements IManaNetwork { int dim = tile.getWorldObj().provider.dimensionId; List tiles; - if (!map.containsKey(dim)) - map.put(dim, new ArrayList()); + if(!map.containsKey(dim)) map.put(dim, new ArrayList()); tiles = map.get(dim); - if (!tiles.contains(tile)) - tiles.add(tile); + if(!tiles.contains(tile)) tiles.add(tile); } @Override @@ -112,8 +105,7 @@ public final class ManaNetworkHandler implements IManaNetwork { } private List getAllInWorld(Map> map, int dim) { - if (!map.containsKey(dim)) - return new ArrayList(); + if(!map.containsKey(dim)) return new ArrayList(); return map.get(dim); } } diff --git a/MODSRC/vazkii/botania/common/core/handler/TerrasteelCraftingHandler.java b/MODSRC/vazkii/botania/common/core/handler/TerrasteelCraftingHandler.java index 8b0a9c3ce..e6fe84047 100644 --- a/MODSRC/vazkii/botania/common/core/handler/TerrasteelCraftingHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/TerrasteelCraftingHandler.java @@ -33,10 +33,10 @@ public final class TerrasteelCraftingHandler { public static void onEntityUpdate(EntityItem item) { ItemStack stack = item.getEntityItem(); - if (stack != null && stack.getItem() == ModItems.manaResource && stack.getItemDamage() == 0) { + if(stack != null && stack.getItem() == ModItems.manaResource && stack.getItemDamage() == 0) { int time = validateCraftingItem(item); - if (time != -1) { + if(time != -1) { doParticles(item, time); getManaFromPools: @@ -45,15 +45,15 @@ public final class TerrasteelCraftingHandler { int y = (int) item.posY; int z = (int) item.posZ; - for (int i = -4; i < 5; i++) - for (int j = -4; j < 5; j++) - for (int k = -4; k < 5; k++) { + for(int i = -4; i < 5; i++) + for(int j = -4; j < 5; j++) + for(int k = -4; k < 5; k++) { TileEntity tile = item.worldObj.getTileEntity(x + i, y + j, z + k); - if (tile instanceof IManaPool) { + if(tile instanceof IManaPool) { IManaPool pool = (IManaPool) tile; - if (!item.worldObj.isRemote && pool.getCurrentMana() >= MANA_PER_TICK) { + if(!item.worldObj.isRemote && pool.getCurrentMana() >= MANA_PER_TICK) { pool.recieveMana(-MANA_PER_TICK); item.worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); incrementCraftingTime(item, time); @@ -71,32 +71,29 @@ public final class TerrasteelCraftingHandler { int y = (int) item.posY; int z = (int) item.posZ; - if (item.worldObj.getBlock(x, y - 1, z) != Blocks.beacon) - return -1; + if(item.worldObj.getBlock(x, y - 1, z) != Blocks.beacon) return -1; TileEntityBeacon beacon = (TileEntityBeacon) item.worldObj.getTileEntity(x, y - 1, z); - if (beacon.getLevels() <= 0) - return -1; + if(beacon.getLevels() <= 0) return -1; List items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)); EntityItem diamond = null; EntityItem pearl = null; - for (EntityItem otherItem : items) { - if (otherItem == item) - continue; + for(EntityItem otherItem : items) { + if(otherItem == item) continue; ItemStack stack = otherItem.getEntityItem(); - if (stack.getItem() == ModItems.manaResource) { + if(stack.getItem() == ModItems.manaResource) { int meta = stack.getItemDamage(); - if (meta == 1) { - if (pearl == null) { + if(meta == 1) { + if(pearl == null) { pearl = otherItem; continue; } else return -1; - } else if (meta == 2) { - if (diamond == null) { + } else if(meta == 2) { + if(diamond == null) { diamond = otherItem; continue; } else return -1; @@ -104,9 +101,9 @@ public final class TerrasteelCraftingHandler { } else return -1; } - if (diamond != null && pearl != null) { + if(diamond != null && pearl != null) { int time = getTimeInCrafting(item); - if (time > 0) { + if(time > 0) { diamond.delayBeforeCanPickup = 1; diamond.age = 0; pearl.delayBeforeCanPickup = 1; @@ -126,12 +123,8 @@ public final class TerrasteelCraftingHandler { } static void doParticles(EntityItem item, int ticks) { - if (item.worldObj.isRemote) { - float[][] colors = new float[][]{ - {0F, 0F, 1F}, - {0F, 0.5F, 0.5F}, - {0F, 1F, 0F}, - }; + if(item.worldObj.isRemote) { + float[][] colors = new float[][]{{0F, 0F, 1F}, {0F, 0.5F, 0.5F}, {0F, 1F, 0F},}; int totalSpiritCount = 3; double tickIncrement = 360D / totalSpiritCount; @@ -142,7 +135,7 @@ public final class TerrasteelCraftingHandler { double r = Math.sin((double) (ticks - TIME) / 10D) * 2; double g = Math.sin(wticks * Math.PI / 180 * 0.55); - for (int i = 0; i < totalSpiritCount; i++) { + for(int i = 0; i < totalSpiritCount; i++) { double x = (int) item.posX + Math.sin(wticks * Math.PI / 180) * r + 0.5; double y = (int) item.posY + 0.25; double z = (int) item.posZ + Math.cos(wticks * Math.PI / 180) * r + 0.5; @@ -152,18 +145,15 @@ public final class TerrasteelCraftingHandler { Botania.proxy.wispFX(item.worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float) g * 0.05F, 0.25F); Botania.proxy.wispFX(item.worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F); - if (ticks == TIME) - for (int j = 0; j < 15; j++) - Botania.proxy.wispFX(item.worldObj, item.posX, item.posY, item.posZ, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F); + if(ticks == TIME) for(int j = 0; j < 15; j++) + Botania.proxy.wispFX(item.worldObj, item.posX, item.posY, item.posZ, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F); } - if (ticks == TIME) - item.worldObj.playSoundAtEntity(item, "random.levelup", 1F, 1F); + if(ticks == TIME) item.worldObj.playSoundAtEntity(item, "random.levelup", 1F, 1F); } } static void incrementCraftingTime(EntityItem item, int time) { - if (time >= TIME) - finalizeCraftingRecipe(item); + if(time >= TIME) finalizeCraftingRecipe(item); else { ItemStack stack = item.getEntityItem(); @@ -177,9 +167,8 @@ public final class TerrasteelCraftingHandler { int z = (int) item.posZ; List items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)); - for (EntityItem otherItem : items) - if (otherItem != item) - otherItem.setDead(); + for(EntityItem otherItem : items) + if(otherItem != item) otherItem.setDead(); else item.setEntityItemStack(new ItemStack(ModItems.manaResource, 1, 4)); } diff --git a/MODSRC/vazkii/botania/common/core/handler/WorldTreeGenerator.java b/MODSRC/vazkii/botania/common/core/handler/WorldTreeGenerator.java index 09ad4abdc..72ac25d2c 100644 --- a/MODSRC/vazkii/botania/common/core/handler/WorldTreeGenerator.java +++ b/MODSRC/vazkii/botania/common/core/handler/WorldTreeGenerator.java @@ -32,7 +32,7 @@ public class WorldTreeGenerator { } public void generate() { - for (int i = 0; i < 116; i++) + for(int i = 0; i < 116; i++) generateRing(i, (int) Math.sqrt(256 - (Math.min(i, 64) - 5) * 2)); System.out.println("Blocks Placed: " + blocksPlaced); @@ -42,17 +42,16 @@ public class WorldTreeGenerator { Block block = ModBlocks.livingwood; y = yoff; - for (int i = 0; i < 360; i++) { - if (i % 90 == 0) - continue; + for(int i = 0; i < 360; i++) { + if(i % 90 == 0) continue; int meta = world.rand.nextInt(200) == 0 ? 5 : 0; generateRingVal(radius, i, block, meta); } int mul = 4; - for (int i = 0; i < mul; i++) - for (int j = 0; j < mul; j++) { + for(int i = 0; i < mul; i++) + for(int j = 0; j < mul; j++) { int meta = world.rand.nextInt(4) == 0 ? 5 : 0; int angle = (y - j) * mul % 360; @@ -62,8 +61,8 @@ public class WorldTreeGenerator { mul = 3; - for (int i = 0; i < mul; i++) - for (int j = 0; j < mul; j++) { + for(int i = 0; i < mul; i++) + for(int j = 0; j < mul; j++) { int meta = world.rand.nextInt(20) == 0 ? 5 : 0; int angle = (y - j) * mul % 360; generateRingVal(radius + i - 1, angle + 90, block, meta); @@ -75,7 +74,7 @@ public class WorldTreeGenerator { int nx = (int) (Math.cos(angle * Math.PI / 180D) * radius); int nz = (int) (Math.sin(angle * Math.PI / 180D) * radius); - if (x != nx || z != nz) { + if(x != nx || z != nz) { x = nx; z = nz; place(srcx + x, srcy + y, srcz + z, block, meta); diff --git a/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java b/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java index 0df525a21..840f6473a 100644 --- a/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java +++ b/MODSRC/vazkii/botania/common/core/helper/ExperienceHelper.java @@ -33,20 +33,16 @@ public class ExperienceHelper { } public static int getExperienceForLevel(int level) { - if (level == 0) - return 0; + if(level == 0) return 0; - if (level > 0 && level < 16) - return level * 17; - else if (level > 15 && level < 31) - return (int) (1.5 * level * level - 29.5 * level + 360); - else - return (int) (3.5 * level * level - 151.5 * level + 2220); + if(level > 0 && level < 16) return level * 17; + else if(level > 15 && level < 31) return (int) (1.5 * level * level - 29.5 * level + 360); + else return (int) (3.5 * level * level - 151.5 * level + 2220); } public static int getLevelForExperience(int experience) { int i = 0; - while (getExperienceForLevel(i) <= experience) { + while(getExperienceForLevel(i) <= experience) { i++; } return i - 1; diff --git a/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java b/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java index 58c86cc5b..8496d6cde 100644 --- a/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java +++ b/MODSRC/vazkii/botania/common/core/helper/InventoryHelper.java @@ -34,13 +34,13 @@ import java.util.Set; public class InventoryHelper { public static void tryInsertStack(IInventory targetInventory, int slot, ItemStack stack, boolean canMerge) { - if (targetInventory.isItemValidForSlot(slot, stack)) { + if(targetInventory.isItemValidForSlot(slot, stack)) { ItemStack targetStack = targetInventory.getStackInSlot(slot); - if (targetStack == null) { + if(targetStack == null) { targetInventory.setInventorySlotContents(slot, stack.copy()); stack.stackSize = 0; - } else if (canMerge) { - if (targetInventory.isItemValidForSlot(slot, stack) && areMergeCandidates(stack, targetStack)) { + } else if(canMerge) { + if(targetInventory.isItemValidForSlot(slot, stack) && areMergeCandidates(stack, targetStack)) { int space = targetStack.getMaxStackSize() - targetStack.stackSize; int mergeAmount = Math.min(space, stack.stackSize); ItemStack copy = targetStack.copy(); @@ -69,11 +69,11 @@ public class InventoryHelper { } public static void insertItemIntoInventory(IInventory inventory, ItemStack stack, ForgeDirection side, int intoSlot, boolean doMove, boolean canStack) { - if (stack == null) return; + if(stack == null) return; IInventory targetInventory = inventory; - if (!doMove) { + if(!doMove) { targetInventory = new GenericInventory("temporary.inventory", false, targetInventory.getSizeInventory()); ((GenericInventory) targetInventory).copyFrom(inventory); } @@ -81,27 +81,25 @@ public class InventoryHelper { int i = 0; int[] attemptSlots = new int[0]; - if (inventory instanceof ISidedInventory && side != ForgeDirection.UNKNOWN) { + if(inventory instanceof ISidedInventory && side != ForgeDirection.UNKNOWN) { attemptSlots = ((ISidedInventory) inventory).getAccessibleSlotsFromSide(side.ordinal()); - if (attemptSlots == null) - attemptSlots = new int[0]; + if(attemptSlots == null) attemptSlots = new int[0]; } else { attemptSlots = new int[inventory.getSizeInventory()]; - for (int a = 0; a < inventory.getSizeInventory(); a++) + for(int a = 0; a < inventory.getSizeInventory(); a++) attemptSlots[a] = a; } - if (intoSlot > -1) { + if(intoSlot > -1) { Set x = new HashSet(); - for (int attemptedSlot : attemptSlots) + for(int attemptedSlot : attemptSlots) x.add(attemptedSlot); - if (x.contains(intoSlot)) - attemptSlots = new int[]{intoSlot}; + if(x.contains(intoSlot)) attemptSlots = new int[]{intoSlot}; else attemptSlots = new int[0]; } - while (stack.stackSize > 0 && i < attemptSlots.length) { - if (side != ForgeDirection.UNKNOWN && inventory instanceof ISidedInventory) - if (!((ISidedInventory) inventory).canInsertItem(intoSlot, stack, side.ordinal())) { + while(stack.stackSize > 0 && i < attemptSlots.length) { + if(side != ForgeDirection.UNKNOWN && inventory instanceof ISidedInventory) + if(!((ISidedInventory) inventory).canInsertItem(intoSlot, stack, side.ordinal())) { i++; continue; } @@ -112,33 +110,29 @@ public class InventoryHelper { } public static int testInventoryInsertion(IInventory inventory, ItemStack item, ForgeDirection side) { - if (item == null || item.stackSize == 0) - return 0; + if(item == null || item.stackSize == 0) return 0; item = item.copy(); - if (inventory == null) - return 0; + 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)) - continue; + for(int i = 0; i < slotCount && itemSizeCounter > 0; i++) { + if(!inventory.isItemValidForSlot(i, item)) continue; - if (side != ForgeDirection.UNKNOWN && inventory instanceof ISidedInventory) - if (!((ISidedInventory) inventory).canInsertItem(i, item, side.ordinal())) - 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) + if(inventorySlot == null) itemSizeCounter -= Math.min(Math.min(itemSizeCounter, inventory.getInventoryStackLimit()), item.getMaxStackSize()); - else if (areMergeCandidates(item, inventorySlot)) { + else if(areMergeCandidates(item, inventorySlot)) { int space = inventorySlot.getMaxStackSize() - inventorySlot.stackSize; itemSizeCounter -= Math.min(itemSizeCounter, space); } } - if (itemSizeCounter != item.stackSize) { + if(itemSizeCounter != item.stackSize) { itemSizeCounter = Math.max(itemSizeCounter, 0); return item.stackSize - itemSizeCounter; } @@ -148,22 +142,22 @@ public class InventoryHelper { public static IInventory getInventory(World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof TileEntityChest) { + if(tileEntity instanceof TileEntityChest) { Block chestBlock = world.getBlock(x, y, z); - if (world.getBlock(x - 1, y, z) == chestBlock) + if(world.getBlock(x - 1, y, z) == chestBlock) return new InventoryLargeChest("Large chest", (IInventory) world.getTileEntity(x - 1, y, z), (IInventory) tileEntity); - if (world.getBlock(x + 1, y, z) == chestBlock) + if(world.getBlock(x + 1, y, z) == chestBlock) return new InventoryLargeChest("Large chest", (IInventory) tileEntity, (IInventory) world.getTileEntity(x + 1, y, z)); - if (world.getBlock(x, y, z - 1) == chestBlock) + if(world.getBlock(x, y, z - 1) == chestBlock) return new InventoryLargeChest("Large chest", (IInventory) world.getTileEntity(x, y, z - 1), (IInventory) tileEntity); - if (world.getBlock(x, y, z + 1) == chestBlock) + if(world.getBlock(x, y, z + 1) == chestBlock) return new InventoryLargeChest("Large chest", (IInventory) tileEntity, (IInventory) world.getTileEntity(x, y, z + 1)); } return tileEntity instanceof IInventory ? (IInventory) tileEntity : null; } public static IInventory getInventory(World world, int x, int y, int z, ForgeDirection direction) { - if (direction != null && direction != ForgeDirection.UNKNOWN) { + if(direction != null && direction != ForgeDirection.UNKNOWN) { x += direction.offsetX; y += direction.offsetY; z += direction.offsetZ; @@ -173,7 +167,7 @@ public class InventoryHelper { } public static IInventory getInventory(IInventory inventory) { - if (inventory instanceof TileEntityChest) { + if(inventory instanceof TileEntityChest) { TileEntity te = (TileEntity) inventory; return getInventory(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord); } @@ -196,18 +190,17 @@ public class InventoryHelper { @Override public ItemStack decrStackSize(int par1, int par2) { - if (inventoryContents[par1] != null) { + if(inventoryContents[par1] != null) { ItemStack itemstack; - if (inventoryContents[par1].stackSize <= par2) { + if(inventoryContents[par1].stackSize <= par2) { itemstack = inventoryContents[par1]; inventoryContents[par1] = null; return itemstack; } itemstack = inventoryContents[par1].splitStack(par2); - if (inventoryContents[par1].stackSize == 0) - inventoryContents[par1] = null; + if(inventoryContents[par1].stackSize == 0) inventoryContents[par1] = null; return itemstack; } @@ -235,10 +228,9 @@ public class InventoryHelper { @Override public ItemStack getStackInSlotOnClosing(int i) { - if (i >= inventoryContents.length) - return null; + if(i >= inventoryContents.length) return null; - if (inventoryContents[i] != null) { + if(inventoryContents[i] != null) { ItemStack itemstack = inventoryContents[i]; inventoryContents[i] = null; return itemstack; @@ -267,15 +259,14 @@ public class InventoryHelper { } public void readFromNBT(NBTTagCompound tag) { - if (tag.hasKey("size")) - slotsCount = tag.getInteger("size"); + if(tag.hasKey("size")) slotsCount = tag.getInteger("size"); NBTTagList nbttaglist = tag.getTagList("Items", 10); inventoryContents = new ItemStack[slotsCount]; - for (int i = 0; i < nbttaglist.tagCount(); i++) { + for(int i = 0; i < nbttaglist.tagCount(); i++) { NBTTagCompound stacktag = (NBTTagCompound) nbttaglist.getCompoundTagAt(i); int j = stacktag.getByte("Slot"); - if (j >= 0 && j < inventoryContents.length) + if(j >= 0 && j < inventoryContents.length) inventoryContents[j] = ItemStack.loadItemStackFromNBT(stacktag); } } @@ -284,15 +275,15 @@ public class InventoryHelper { public void setInventorySlotContents(int i, ItemStack itemstack) { inventoryContents[i] = itemstack; - if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) + if(itemstack != null && itemstack.stackSize > getInventoryStackLimit()) itemstack.stackSize = getInventoryStackLimit(); } public void writeToNBT(NBTTagCompound tag) { tag.setInteger("size", getSizeInventory()); NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < inventoryContents.length; i++) { - if (inventoryContents[i] != null) { + for(int i = 0; i < inventoryContents.length; i++) { + if(inventoryContents[i] != null) { NBTTagCompound stacktag = new NBTTagCompound(); stacktag.setByte("Slot", (byte) i); inventoryContents[i].writeToNBT(stacktag); @@ -303,11 +294,10 @@ public class InventoryHelper { } public void copyFrom(IInventory inventory) { - for (int i = 0; i < inventory.getSizeInventory(); i++) - if (i < getSizeInventory()) { + for(int i = 0; i < inventory.getSizeInventory(); i++) + if(i < getSizeInventory()) { ItemStack stack = inventory.getStackInSlot(i); - if (stack != null) - setInventorySlotContents(i, stack.copy()); + if(stack != null) setInventorySlotContents(i, stack.copy()); else setInventorySlotContents(i, null); } } diff --git a/MODSRC/vazkii/botania/common/core/helper/ItemNBTHelper.java b/MODSRC/vazkii/botania/common/core/helper/ItemNBTHelper.java index 5c4c51fd8..878f9bd63 100644 --- a/MODSRC/vazkii/botania/common/core/helper/ItemNBTHelper.java +++ b/MODSRC/vazkii/botania/common/core/helper/ItemNBTHelper.java @@ -32,8 +32,7 @@ public final class ItemNBTHelper { * compound * */ public static void initNBT(ItemStack stack) { - if (!detectNBT(stack)) - injectNBT(stack, new NBTTagCompound()); + if(!detectNBT(stack)) injectNBT(stack, new NBTTagCompound()); } /** @@ -84,7 +83,7 @@ public final class ItemNBTHelper { } public static void setCompound(ItemStack stack, String tag, NBTTagCompound cmp) { - if (!tag.equalsIgnoreCase("ench")) // not override the enchantments + if(!tag.equalsIgnoreCase("ench")) // not override the enchantments getNBT(stack).setTag(tag, cmp); } diff --git a/MODSRC/vazkii/botania/common/core/helper/MathHelper.java b/MODSRC/vazkii/botania/common/core/helper/MathHelper.java index df74ceb3c..31654125b 100644 --- a/MODSRC/vazkii/botania/common/core/helper/MathHelper.java +++ b/MODSRC/vazkii/botania/common/core/helper/MathHelper.java @@ -23,8 +23,7 @@ public final class MathHelper { Vector3 entityVector = Vector3.fromEntityCenter(entity); Vector3 finalVector = originalPosVector.copy().subtract(entityVector); - if (finalVector.mag() > 1) - finalVector.normalize(); + if(finalVector.mag() > 1) finalVector.normalize(); entity.motionX = finalVector.x * modifier; entity.motionY = finalVector.y * modifier; diff --git a/MODSRC/vazkii/botania/common/core/helper/Quat.java b/MODSRC/vazkii/botania/common/core/helper/Quat.java index 4f850cdda..184eb179f 100644 --- a/MODSRC/vazkii/botania/common/core/helper/Quat.java +++ b/MODSRC/vazkii/botania/common/core/helper/Quat.java @@ -83,7 +83,7 @@ public class Quat { public void normalize() { double d = mag(); - if (d == 0.0D) { + if(d == 0.0D) { return; } else { d = 1.0D / d; diff --git a/MODSRC/vazkii/botania/common/core/helper/Vector3.java b/MODSRC/vazkii/botania/common/core/helper/Vector3.java index 513e571a1..0195e2ba1 100644 --- a/MODSRC/vazkii/botania/common/core/helper/Vector3.java +++ b/MODSRC/vazkii/botania/common/core/helper/Vector3.java @@ -91,10 +91,8 @@ public class Vector3 { public double dotProduct(Vector3 vec) { double d = vec.x * x + vec.y * y + vec.z * z; - if (d > 1 && d < 1.00001) - d = 1; - else if (d < -1 && d > -1.00001) - d = -1; + if(d > 1 && d < 1.00001) d = 1; + else if(d < -1 && d > -1.00001) d = -1; return d; } @@ -179,8 +177,7 @@ public class Vector3 { public Vector3 normalize() { double d = mag(); - if (d != 0) - multiply(1 / d); + if(d != 0) multiply(1 / d); return this; } @@ -192,8 +189,7 @@ public class Vector3 { } public Vector3 perpendicular() { - if (z == 0) - return zCrossProduct(); + if(z == 0) return zCrossProduct(); return xCrossProduct(); } @@ -269,7 +265,7 @@ public class Vector3 { public Vector3 project(Vector3 b) { double l = b.magSquared(); - if (l == 0) { + if(l == 0) { set(0, 0, 0); return this; } @@ -286,8 +282,7 @@ public class Vector3 { @Override public boolean equals(Object o) { - if (!(o instanceof Vector3)) - return false; + if(!(o instanceof Vector3)) return false; Vector3 v = (Vector3) o; return x == v.x && y == v.y && z == v.z; diff --git a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java index b60b95d88..0f02c380c 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java @@ -102,88 +102,61 @@ public final class ModCrafingRecipes { recipeLexicon = BotaniaAPI.getLatestAddedRecipe(); // Petal/Dye Recipes - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) addShapelessOreDictRecipe(new ItemStack(ModItems.petal, 2, i), LibOreDict.FLOWER[i]); recipesPetals = BotaniaAPI.getLatestAddedRecipes(16); - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) addShapelessOreDictRecipe(new ItemStack(ModItems.dye, 1, i), LibOreDict.PETAL[i], LibOreDict.PESTLE_AND_MORTAR); recipesDyes = BotaniaAPI.getLatestAddedRecipes(16); // Pestle and Mortar Recipe - addOreDictRecipe(new ItemStack(ModItems.pestleAndMortar), - " S", "W ", "B ", - 'S', "stickWood", - 'W', "plankWood", - 'B', Items.bowl); + addOreDictRecipe(new ItemStack(ModItems.pestleAndMortar), " S", "W ", "B ", 'S', "stickWood", 'W', "plankWood", 'B', Items.bowl); recipePestleAndMortar = BotaniaAPI.getLatestAddedRecipe(); // Wand of the Forest Recipes - for (int i = 0; i < 16; i++) - for (int j = 0; j < 16; j++) { - addOreDictRecipe(ItemTwigWand.forColors(i, j), - " AS", " SB", "S ", - 'A', LibOreDict.PETAL[i], - 'B', LibOreDict.PETAL[j], - 'S', "stickWood"); + for(int i = 0; i < 16; i++) + for(int j = 0; j < 16; j++) { + addOreDictRecipe(ItemTwigWand.forColors(i, j), " AS", " SB", "S ", 'A', LibOreDict.PETAL[i], 'B', LibOreDict.PETAL[j], 'S', "stickWood"); } recipesTwigWand = BotaniaAPI.getLatestAddedRecipes(256); // Petal Apothecary Recipes - for (int i = 0; i < 16; i++) - addOreDictRecipe(new ItemStack(ModBlocks.altar), - "SPS", " C ", "CCC", - 'S', new ItemStack(Blocks.stone_slab, 1, 3), - 'P', LibOreDict.PETAL[i], - 'C', "cobblestone"); + for(int i = 0; i < 16; i++) + addOreDictRecipe(new ItemStack(ModBlocks.altar), "SPS", " C ", "CCC", 'S', new ItemStack(Blocks.stone_slab, 1, 3), 'P', LibOreDict.PETAL[i], 'C', "cobblestone"); recipesApothecary = BotaniaAPI.getLatestAddedRecipes(16); // Mana Spreader Recipes - for (int i = 0; i < 16; i++) - addOreDictRecipe(new ItemStack(ModBlocks.spreader), - "WWW", "GP ", "WWW", - 'W', LibOreDict.LIVING_WOOD, - 'P', LibOreDict.PETAL[i], - 'G', "ingotGold"); + for(int i = 0; i < 16; i++) + addOreDictRecipe(new ItemStack(ModBlocks.spreader), "WWW", "GP ", "WWW", 'W', LibOreDict.LIVING_WOOD, 'P', LibOreDict.PETAL[i], 'G', "ingotGold"); recipesSpreader = BotaniaAPI.getLatestAddedRecipes(16); // Mana Lens Recipe - addOreDictRecipe(new ItemStack(ModItems.lens), - " S ", "SGS", " S ", - 'S', LibOreDict.MANA_STEEL, - 'G', new ItemStack(Blocks.glass_pane)); + addOreDictRecipe(new ItemStack(ModItems.lens), " S ", "SGS", " S ", 'S', LibOreDict.MANA_STEEL, 'G', new ItemStack(Blocks.glass_pane)); recipeManaLens = BotaniaAPI.getLatestAddedRecipe(); // Mana Lens Dying Recipes - for (int j = 0; j < 16; j++) + for(int j = 0; j < 16; j++) addShapelessOreDictRecipe(ItemLens.setLensColor(new ItemStack(ModItems.lens), j), new ItemStack(ModItems.lens), LibOreDict.DYE[j]); recipesLensDying = BotaniaAPI.getLatestAddedRecipes(16); - for (int i = 1; i < ItemLens.SUBTYPES; i++) - for (int j = 0; j < 16; j++) + for(int i = 1; i < ItemLens.SUBTYPES; i++) + for(int j = 0; j < 16; j++) addShapelessOreDictRecipe(ItemLens.setLensColor(new ItemStack(ModItems.lens, 1, i), j), new ItemStack(ModItems.lens, 1, i), LibOreDict.DYE[j]); // Rainbow Lens Recipe addShapelessOreDictRecipe(ItemLens.setLensColor(new ItemStack(ModItems.lens), 16), new ItemStack(ModItems.lens), LibOreDict.MANA_PEARL); recipeRainbowLens = BotaniaAPI.getLatestAddedRecipe(); - for (int i = 1; i < ItemLens.SUBTYPES; i++) + for(int i = 1; i < ItemLens.SUBTYPES; i++) addShapelessOreDictRecipe(ItemLens.setLensColor(new ItemStack(ModItems.lens, 1, i), 16), new ItemStack(ModItems.lens, 1, i), LibOreDict.MANA_PEARL); // Mana Pool Recipe - addOreDictRecipe(new ItemStack(ModBlocks.pool), - "R R", "RRR", - 'R', LibOreDict.LIVING_ROCK); + addOreDictRecipe(new ItemStack(ModBlocks.pool), "R R", "RRR", 'R', LibOreDict.LIVING_ROCK); recipePool = BotaniaAPI.getLatestAddedRecipe(); // Runic Altar Recipe - addOreDictRecipe(new ItemStack(ModBlocks.runeAltar), - "SSS", "SPS", - 'S', LibOreDict.LIVING_ROCK, - 'P', LibOreDict.MANA_PEARL); - addOreDictRecipe(new ItemStack(ModBlocks.runeAltar), - "SSS", "SDS", - 'S', LibOreDict.LIVING_ROCK, - 'D', LibOreDict.MANA_DIAMOND); + addOreDictRecipe(new ItemStack(ModBlocks.runeAltar), "SSS", "SPS", 'S', LibOreDict.LIVING_ROCK, 'P', LibOreDict.MANA_PEARL); + addOreDictRecipe(new ItemStack(ModBlocks.runeAltar), "SSS", "SDS", 'S', LibOreDict.LIVING_ROCK, 'D', LibOreDict.MANA_DIAMOND); recipesRuneAltar = BotaniaAPI.getLatestAddedRecipes(2); // Lens Recipes @@ -221,41 +194,26 @@ public final class ModCrafingRecipes { recipeLensExplosive = BotaniaAPI.getLatestAddedRecipe(); // Unstable Block Recipes - for (int i = 0; i < 16; i++) - addOreDictRecipe(new ItemStack(ModBlocks.unstableBlock, 2, i), - "OPO", "PMP", "OPO", - 'O', new ItemStack(Blocks.obsidian), - 'P', LibOreDict.PETAL[i], - 'M', new ItemStack(Items.ender_pearl)); + for(int i = 0; i < 16; i++) + addOreDictRecipe(new ItemStack(ModBlocks.unstableBlock, 2, i), "OPO", "PMP", "OPO", 'O', new ItemStack(Blocks.obsidian), 'P', LibOreDict.PETAL[i], 'M', new ItemStack(Items.ender_pearl)); recipesUnstableBlocks = BotaniaAPI.getLatestAddedRecipes(16); // Mana Pylon Recipe - addOreDictRecipe(new ItemStack(ModBlocks.pylon), - " G ", "MDM", " G ", - 'G', "ingotGold", - 'M', LibOreDict.MANA_STEEL, - 'D', LibOreDict.MANA_DIAMOND); + addOreDictRecipe(new ItemStack(ModBlocks.pylon), " G ", "MDM", " G ", 'G', "ingotGold", 'M', LibOreDict.MANA_STEEL, 'D', LibOreDict.MANA_DIAMOND); recipePylon = BotaniaAPI.getLatestAddedRecipe(); // Mana Distributor - addOreDictRecipe(new ItemStack(ModBlocks.distributor), - "RRR", "S S", "RRR", - 'R', LibOreDict.LIVING_ROCK, - 'S', LibOreDict.MANA_STEEL); + addOreDictRecipe(new ItemStack(ModBlocks.distributor), "RRR", "S S", "RRR", 'R', LibOreDict.LIVING_ROCK, 'S', LibOreDict.MANA_STEEL); recipeDistributor = BotaniaAPI.getLatestAddedRecipe(); // Livingrock Decorative Blocks - addOreDictRecipe(new ItemStack(ModBlocks.livingrock, 4, 1), - "RR", "RR", - 'R', LibOreDict.LIVING_ROCK); + addOreDictRecipe(new ItemStack(ModBlocks.livingrock, 4, 1), "RR", "RR", 'R', LibOreDict.LIVING_ROCK); recipeLivingrockDecor1 = BotaniaAPI.getLatestAddedRecipe(); addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 1, 2), new ItemStack(ModBlocks.livingrock, 1, 1), new ItemStack(Items.wheat_seeds)); recipeLivingrockDecor2 = BotaniaAPI.getLatestAddedRecipe(); addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 2, 3), new ItemStack(ModBlocks.livingrock, 1, 1), "cobblestone"); recipeLivingrockDecor3 = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModBlocks.livingrock, 4, 4), - "RR", "RR", - 'R', new ItemStack(ModBlocks.livingrock, 1, 1)); + addOreDictRecipe(new ItemStack(ModBlocks.livingrock, 4, 4), "RR", "RR", 'R', new ItemStack(ModBlocks.livingrock, 1, 1)); recipeLivingrockDecor4 = BotaniaAPI.getLatestAddedRecipe(); // Livingwood Decorative Blocks @@ -263,76 +221,42 @@ public final class ModCrafingRecipes { recipeLivingwoodDecor1 = BotaniaAPI.getLatestAddedRecipe(); addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 2), new ItemStack(ModBlocks.livingwood, 1, 1), new ItemStack(Items.wheat_seeds)); recipeLivingwoodDecor2 = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 3), - "WW", "WW", - 'W', new ItemStack(ModBlocks.livingwood, 1, 1)); + addOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 3), "WW", "WW", 'W', new ItemStack(ModBlocks.livingwood, 1, 1)); recipeLivingwoodDecor3 = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 4), - " W ", "W W", " W ", - 'W', new ItemStack(ModBlocks.livingwood, 1, 1)); + addOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 4), " W ", "W W", " W ", 'W', new ItemStack(ModBlocks.livingwood, 1, 1)); recipeLivingwoodDecor4 = BotaniaAPI.getLatestAddedRecipe(); - addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 5), - LibOreDict.LIVING_WOOD, new ItemStack(Items.glowstone_dust)); + addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 5), LibOreDict.LIVING_WOOD, new ItemStack(Items.glowstone_dust)); recipeLivingwoodDecor5 = BotaniaAPI.getLatestAddedRecipe(); // Mana Beacon Recipe - for (int i = 0; i < 16; i++) - addOreDictRecipe(new ItemStack(ModBlocks.manaBeacon, 1, i), - " B ", "BPB", " B ", - 'B', new ItemStack(ModBlocks.unstableBlock, 1, i), - 'P', LibOreDict.MANA_PEARL); + for(int i = 0; i < 16; i++) + addOreDictRecipe(new ItemStack(ModBlocks.manaBeacon, 1, i), " B ", "BPB", " B ", 'B', new ItemStack(ModBlocks.unstableBlock, 1, i), 'P', LibOreDict.MANA_PEARL); recipesManaBeacons = BotaniaAPI.getLatestAddedRecipes(16); // Signal Flare Recipe - for (int i = 0; i < 16; i++) - addOreDictRecipe(ItemSignalFlare.forColor(i), - "I ", " B", "W ", - 'B', new ItemStack(ModBlocks.manaBeacon, 1, i), - 'I', "ingotIron", - 'W', LibOreDict.LIVING_WOOD); + for(int i = 0; i < 16; i++) + addOreDictRecipe(ItemSignalFlare.forColor(i), "I ", " B", "W ", 'B', new ItemStack(ModBlocks.manaBeacon, 1, i), 'I', "ingotIron", 'W', LibOreDict.LIVING_WOOD); recipesSignalFlares = BotaniaAPI.getLatestAddedRecipes(16); // Mana Void Recipe - addOreDictRecipe(new ItemStack(ModBlocks.manaVoid), - "SSS", "O O", "SSS", - 'S', LibOreDict.LIVING_ROCK, - 'O', new ItemStack(Blocks.obsidian)); + addOreDictRecipe(new ItemStack(ModBlocks.manaVoid), "SSS", "O O", "SSS", 'S', LibOreDict.LIVING_ROCK, 'O', new ItemStack(Blocks.obsidian)); recipeManaVoid = BotaniaAPI.getLatestAddedRecipe(); // Mana Tablet Recipe - addOreDictRecipe(new ItemStack(ModItems.manaTablet, 1, 10000), - "SSS", "SPS", "SSS", - 'S', LibOreDict.LIVING_ROCK, - 'P', LibOreDict.MANA_PEARL); - addOreDictRecipe(new ItemStack(ModItems.manaTablet, 1, 10000), - "SSS", "SDS", "SSS", - 'S', LibOreDict.LIVING_ROCK, - 'D', LibOreDict.MANA_DIAMOND); + addOreDictRecipe(new ItemStack(ModItems.manaTablet, 1, 10000), "SSS", "SPS", "SSS", 'S', LibOreDict.LIVING_ROCK, 'P', LibOreDict.MANA_PEARL); + addOreDictRecipe(new ItemStack(ModItems.manaTablet, 1, 10000), "SSS", "SDS", "SSS", 'S', LibOreDict.LIVING_ROCK, 'D', LibOreDict.MANA_DIAMOND); recipesManaTablet = BotaniaAPI.getLatestAddedRecipes(2); // Mana Detector Recipe - addOreDictRecipe(new ItemStack(ModBlocks.manaDetector), - "RSR", "SCS", "RSR", - 'R', new ItemStack(Items.redstone), - 'C', new ItemStack(Items.comparator), - 'S', LibOreDict.LIVING_ROCK); + addOreDictRecipe(new ItemStack(ModBlocks.manaDetector), "RSR", "SCS", "RSR", 'R', new ItemStack(Items.redstone), 'C', new ItemStack(Items.comparator), 'S', LibOreDict.LIVING_ROCK); recipeManaDetector = BotaniaAPI.getLatestAddedRecipe(); // Mana Blaster Recipe - addOreDictRecipe(new ItemStack(ModItems.manaGun), - "SMD", " WT", " W", - 'S', new ItemStack(ModBlocks.spreader, 1, 1), - 'M', LibOreDict.RUNE[8], - 'D', LibOreDict.MANA_DIAMOND, - 'T', new ItemStack(Blocks.tnt), - 'W', LibOreDict.LIVING_WOOD); + addOreDictRecipe(new ItemStack(ModItems.manaGun), "SMD", " WT", " W", 'S', new ItemStack(ModBlocks.spreader, 1, 1), 'M', LibOreDict.RUNE[8], 'D', LibOreDict.MANA_DIAMOND, 'T', new ItemStack(Blocks.tnt), 'W', LibOreDict.LIVING_WOOD); recipeManaBlaster = BotaniaAPI.getLatestAddedRecipe(); // Spreader Turntable Recipe - addOreDictRecipe(new ItemStack(ModBlocks.turntable), - "WWW", "WPW", "WWW", - 'W', LibOreDict.LIVING_WOOD, - 'P', Blocks.sticky_piston); + addOreDictRecipe(new ItemStack(ModBlocks.turntable), "WWW", "WPW", "WWW", 'W', LibOreDict.LIVING_WOOD, 'P', Blocks.sticky_piston); recipeTurntable = BotaniaAPI.getLatestAddedRecipe(); // Fertilizer Recipes @@ -342,118 +266,61 @@ public final class ModCrafingRecipes { recipeFerilizerDye = BotaniaAPI.getLatestAddedRecipe(); // Livingwood Twig Recipe - addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 3), - "W", "W", - 'W', LibOreDict.LIVING_WOOD); + addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 3), "W", "W", 'W', LibOreDict.LIVING_WOOD); recipeLivingwoodTwig = BotaniaAPI.getLatestAddedRecipe(); // Rod of the Lands Recipe - addOreDictRecipe(new ItemStack(ModItems.dirtRod), - " D", " T ", "E ", - 'D', new ItemStack(Blocks.dirt), - 'T', LibOreDict.LIVINGWOOD_TWIG, - 'E', LibOreDict.RUNE[2]); + addOreDictRecipe(new ItemStack(ModItems.dirtRod), " D", " T ", "E ", 'D', new ItemStack(Blocks.dirt), 'T', LibOreDict.LIVINGWOOD_TWIG, 'E', LibOreDict.RUNE[2]); recipeDirtRod = BotaniaAPI.getLatestAddedRecipe(); // Terra Firma Rod Recipe - addOreDictRecipe(new ItemStack(ModItems.terraformRod), - " WT", "ARS", "GM ", - 'T', LibOreDict.TERRA_STEEL, - 'R', new ItemStack(ModItems.dirtRod), - 'G', new ItemStack(ModItems.grassSeeds), - 'W', LibOreDict.RUNE[7], - 'S', LibOreDict.RUNE[4], - 'M', LibOreDict.RUNE[5], - 'A', LibOreDict.RUNE[6]); + addOreDictRecipe(new ItemStack(ModItems.terraformRod), " WT", "ARS", "GM ", 'T', LibOreDict.TERRA_STEEL, 'R', new ItemStack(ModItems.dirtRod), 'G', new ItemStack(ModItems.grassSeeds), 'W', LibOreDict.RUNE[7], 'S', LibOreDict.RUNE[4], 'M', LibOreDict.RUNE[5], 'A', LibOreDict.RUNE[6]); recipeTerraformRod = BotaniaAPI.getLatestAddedRecipe(); // Redstone Mana Spreader Recipe - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.spreader, 1, 1), - new ItemStack(ModBlocks.spreader), new ItemStack(Items.redstone)); + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.spreader, 1, 1), new ItemStack(ModBlocks.spreader), new ItemStack(Items.redstone)); recipeRedstoneSpreader = BotaniaAPI.getLatestAddedRecipe(); // Mana Miror Recipe - addOreDictRecipe(new ItemStack(ModItems.manaMirror), - " PR", " SI", "T ", - 'P', LibOreDict.MANA_PEARL, - 'R', LibOreDict.LIVING_ROCK, - 'S', LibOreDict.LIVINGWOOD_TWIG, - 'I', LibOreDict.TERRA_STEEL, - 'T', new ItemStack(ModItems.manaTablet, 1, -1)); + addOreDictRecipe(new ItemStack(ModItems.manaMirror), " PR", " SI", "T ", 'P', LibOreDict.MANA_PEARL, 'R', LibOreDict.LIVING_ROCK, 'S', LibOreDict.LIVINGWOOD_TWIG, 'I', LibOreDict.TERRA_STEEL, 'T', new ItemStack(ModItems.manaTablet, 1, -1)); recipeManaMirror = BotaniaAPI.getLatestAddedRecipe(); // Mana Armor & Tools Recipes - addOreDictRecipe(new ItemStack(ModItems.manasteelHelm), - "SSS", "S S", - 'S', LibOreDict.MANA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.manasteelHelm), "SSS", "S S", 'S', LibOreDict.MANA_STEEL); recipeManasteelHelm = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelChest), - "S S", "SSS", "SSS", - 'S', LibOreDict.MANA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.manasteelChest), "S S", "SSS", "SSS", 'S', LibOreDict.MANA_STEEL); recipeManasteelChest = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelLegs), - "SSS", "S S", "S S", - 'S', LibOreDict.MANA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.manasteelLegs), "SSS", "S S", "S S", 'S', LibOreDict.MANA_STEEL); recipeManasteelLegs = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelBoots), - "S S", "S S", - 'S', LibOreDict.MANA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.manasteelBoots), "S S", "S S", 'S', LibOreDict.MANA_STEEL); recipeManasteelBoots = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelPick), - "SSS", " T ", " T ", - 'S', LibOreDict.MANA_STEEL, - 'T', LibOreDict.LIVINGWOOD_TWIG); + addOreDictRecipe(new ItemStack(ModItems.manasteelPick), "SSS", " T ", " T ", 'S', LibOreDict.MANA_STEEL, 'T', LibOreDict.LIVINGWOOD_TWIG); recipeManasteelPick = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelShovel), - "S", "T", "T", - 'S', LibOreDict.MANA_STEEL, - 'T', LibOreDict.LIVINGWOOD_TWIG); + addOreDictRecipe(new ItemStack(ModItems.manasteelShovel), "S", "T", "T", 'S', LibOreDict.MANA_STEEL, 'T', LibOreDict.LIVINGWOOD_TWIG); recipeManasteelShovel = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelAxe), - "SS", "TS", "T ", - 'S', LibOreDict.MANA_STEEL, - 'T', LibOreDict.LIVINGWOOD_TWIG); + addOreDictRecipe(new ItemStack(ModItems.manasteelAxe), "SS", "TS", "T ", 'S', LibOreDict.MANA_STEEL, 'T', LibOreDict.LIVINGWOOD_TWIG); recipeManasteelAxe = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelSword), - "S", "S", "T", - 'S', LibOreDict.MANA_STEEL, - 'T', LibOreDict.LIVINGWOOD_TWIG); + addOreDictRecipe(new ItemStack(ModItems.manasteelSword), "S", "S", "T", 'S', LibOreDict.MANA_STEEL, 'T', LibOreDict.LIVINGWOOD_TWIG); recipeManasteelSword = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.manasteelShears), - "S ", " S", - 'S', LibOreDict.MANA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.manasteelShears), "S ", " S", 'S', LibOreDict.MANA_STEEL); recipeManasteelShears = BotaniaAPI.getLatestAddedRecipe(); // Horn of the Wild Recipe - addOreDictRecipe(new ItemStack(ModItems.grassHorn), - " W ", "WSW", "WW ", - 'W', LibOreDict.LIVING_WOOD, - 'S', new ItemStack(ModItems.grassSeeds)); + addOreDictRecipe(new ItemStack(ModItems.grassHorn), " W ", "WSW", "WW ", 'W', LibOreDict.LIVING_WOOD, 'S', new ItemStack(ModItems.grassSeeds)); recipeGrassHorn = BotaniaAPI.getLatestAddedRecipe(); // Terrasteel Armor Recipes - addOreDictRecipe(new ItemStack(ModItems.terrasteelHelm), - "SSS", "S S", - 'S', LibOreDict.TERRA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.terrasteelHelm), "SSS", "S S", 'S', LibOreDict.TERRA_STEEL); recipeTerrasteelHelm = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.terrasteelChest), - "S S", "SSS", "SSS", - 'S', LibOreDict.TERRA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.terrasteelChest), "S S", "SSS", "SSS", 'S', LibOreDict.TERRA_STEEL); recipeTerrasteelChest = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.terrasteelLegs), - "SSS", "S S", "S S", - 'S', LibOreDict.TERRA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.terrasteelLegs), "SSS", "S S", "S S", 'S', LibOreDict.TERRA_STEEL); recipeTerrasteelLegs = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.terrasteelBoots), - "S S", "S S", - 'S', LibOreDict.TERRA_STEEL); + addOreDictRecipe(new ItemStack(ModItems.terrasteelBoots), "S S", "S S", 'S', LibOreDict.TERRA_STEEL); recipeTerrasteelBoots = BotaniaAPI.getLatestAddedRecipe(); // Terra Blade Recipe - addOreDictRecipe(new ItemStack(ModItems.terraSword), - "I", "I", "S", - 'I', LibOreDict.TERRA_STEEL, - 'S', LibOreDict.LIVINGWOOD_TWIG); + addOreDictRecipe(new ItemStack(ModItems.terraSword), "I", "I", "S", 'I', LibOreDict.TERRA_STEEL, 'S', LibOreDict.LIVINGWOOD_TWIG); recipeTerraSword = BotaniaAPI.getLatestAddedRecipe(); } diff --git a/MODSRC/vazkii/botania/common/crafting/ModManaInfusionRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModManaInfusionRecipes.java index 45e569570..8668232ee 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModManaInfusionRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModManaInfusionRecipes.java @@ -37,7 +37,7 @@ public final class ModManaInfusionRecipes { public static void init() { manaPetalRecipes = new ArrayList(); - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) manaPetalRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaPetal, 1, i), LibOreDict.PETAL[i], 1000)); manasteelRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 0), "ingotIron", 3000); diff --git a/MODSRC/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java b/MODSRC/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java index 4c2b4d7a3..2d4aaaac8 100644 --- a/MODSRC/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java +++ b/MODSRC/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java @@ -28,15 +28,13 @@ public class CompositeLensRecipe implements IRecipe { boolean foundSecondLens = false; boolean foundSlimeball = false; - for (int i = 0; i < var1.getSizeInventory(); i++) { + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); - if (stack != null) { - if (stack.getItem() instanceof ILens && !foundSecondLens) { - if (foundLens) - foundSecondLens = true; + if(stack != null) { + if(stack.getItem() instanceof ILens && !foundSecondLens) { + if(foundLens) foundSecondLens = true; else foundLens = true; - } else if (stack.getItem() == Items.slime_ball) - foundSlimeball = true; + } else if(stack.getItem() == Items.slime_ball) foundSlimeball = true; else return false; // Found an invalid item, breaking the recipe } } @@ -49,19 +47,17 @@ public class CompositeLensRecipe implements IRecipe { ItemStack lens = null; ItemStack secondLens = null; - for (int i = 0; i < var1.getSizeInventory(); i++) { + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); - if (stack != null) { - if (stack.getItem() instanceof ILens) - if (lens == null) - lens = stack; - else secondLens = stack; + if(stack != null) { + if(stack.getItem() instanceof ILens) if(lens == null) lens = stack; + else secondLens = stack; } } - if (lens.getItem() instanceof ILens) { + if(lens.getItem() instanceof ILens) { ILens lensItem = (ILens) lens.getItem(); - if (secondLens == null || !lensItem.canCombineLenses(lens, secondLens) || lensItem.getCompositeLens(lens) != null || lensItem.getCompositeLens(secondLens) != null) + if(secondLens == null || !lensItem.canCombineLenses(lens, secondLens) || lensItem.getCompositeLens(lens) != null || lensItem.getCompositeLens(secondLens) != null) return null; ItemStack lensCopy = lens.copy(); diff --git a/MODSRC/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java b/MODSRC/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java index 07bb4d218..6b0020d53 100644 --- a/MODSRC/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java +++ b/MODSRC/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java @@ -25,14 +25,12 @@ public class ManaGunLensRecipe implements IRecipe { boolean foundLens = false; boolean foundGun = false; - for (int i = 0; i < var1.getSizeInventory(); i++) { + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); - if (stack != null) { - if (stack.getItem() instanceof ItemManaGun && ItemManaGun.getLens(stack) == null) - foundGun = true; + if(stack != null) { + if(stack.getItem() instanceof ItemManaGun && ItemManaGun.getLens(stack) == null) foundGun = true; - else if (stack.getItem() instanceof ILens) - foundLens = true; + else if(stack.getItem() instanceof ILens) foundLens = true; else return false; // Found an invalid item, breaking the recipe } @@ -46,18 +44,15 @@ public class ManaGunLensRecipe implements IRecipe { ItemStack lens = null; ItemStack gun = null; - for (int i = 0; i < var1.getSizeInventory(); i++) { + for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); - if (stack != null) { - if (stack.getItem() instanceof ItemManaGun) - gun = stack; - else if (stack.getItem() instanceof ILens) - lens = stack; + if(stack != null) { + if(stack.getItem() instanceof ItemManaGun) gun = stack; + else if(stack.getItem() instanceof ILens) lens = stack; } } - if (lens == null || gun == null) - return null; + if(lens == null || gun == null) return null; ItemStack gunCopy = gun.copy(); ItemManaGun.setLens(gunCopy, lens); diff --git a/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java b/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java index d950c0855..f4345b598 100644 --- a/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java +++ b/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java @@ -67,12 +67,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { public EntityManaBurst(World world) { super(world); setSize(0F, 0F); - for (int i = 0; i < dataWatcherEntries; i++) { + for(int i = 0; i < dataWatcherEntries; i++) { int j = dataWatcherStart + i; - if (i == 4 || i == 5 || i == 10 || i == 11 || i == 12) - dataWatcher.addObject(j, 0F); - else if (i == 9) - dataWatcher.addObject(j, new ItemStack(Blocks.stone, 0, 0)); + if(i == 4 || i == 5 || i == 10 || i == 11 || i == 12) dataWatcher.addObject(j, 0F); + else if(i == 9) dataWatcher.addObject(j, new ItemStack(Blocks.stone, 0, 0)); else dataWatcher.addObject(j, 0); dataWatcher.setObjectWatched(j); @@ -125,34 +123,33 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { lastTickPosZ = posZ; onEntityUpdate(); - if (throwableShake > 0) - --throwableShake; + if(throwableShake > 0) --throwableShake; Vec3 vec3 = new Vector3(posX, posY, posZ).toVec3D(); Vec3 vec31 = new Vector3(posX + motionX, posY + motionY, posZ + motionZ).toVec3D(); MovingObjectPosition movingobjectposition = clip(vec3, vec31); - if (movingobjectposition != null) + if(movingobjectposition != null) vec31 = new Vector3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord).toVec3D(); - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { Entity entity = null; List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); double d0 = 0.0D; EntityLivingBase entitylivingbase = getThrower(); - for (int j = 0; j < list.size(); ++j) { + for(int j = 0; j < list.size(); ++j) { Entity entity1 = (Entity) list.get(j); - if (entity1.canBeCollidedWith() && (entity1 != entitylivingbase || ticksInAir >= 5)) { + if(entity1.canBeCollidedWith() && (entity1 != entitylivingbase || ticksInAir >= 5)) { float f = 0.3F; AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f); MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); - if (movingobjectposition1 != null) { + if(movingobjectposition1 != null) { double d1 = vec3.distanceTo(movingobjectposition1.hitVec); - if (d1 < d0 || d0 == 0.0D) { + if(d1 < d0 || d0 == 0.0D) { entity = entity1; d0 = d1; } @@ -160,12 +157,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } } - if (entity != null) - movingobjectposition = new MovingObjectPosition(entity); + if(entity != null) movingobjectposition = new MovingObjectPosition(entity); } - if (movingobjectposition != null) - onImpact(movingobjectposition); + if(movingobjectposition != null) onImpact(movingobjectposition); posX += motionX; posY += motionY; @@ -173,17 +168,14 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI); - for (rotationPitch = (float) (Math.atan2(motionY, f1) * 180.0D / Math.PI); rotationPitch - prevRotationPitch < -180.0F; prevRotationPitch -= 360.0F) + for(rotationPitch = (float) (Math.atan2(motionY, f1) * 180.0D / Math.PI); rotationPitch - prevRotationPitch < -180.0F; prevRotationPitch -= 360.0F) ; - while (rotationPitch - prevRotationPitch >= 180.0F) - prevRotationPitch += 360.0F; + while(rotationPitch - prevRotationPitch >= 180.0F) prevRotationPitch += 360.0F; - while (rotationYaw - prevRotationYaw < -180.0F) - prevRotationYaw -= 360.0F; + while(rotationYaw - prevRotationYaw < -180.0F) prevRotationYaw -= 360.0F; - while (rotationYaw - prevRotationYaw >= 180.0F) - prevRotationYaw += 360.0F; + while(rotationYaw - prevRotationYaw >= 180.0F) prevRotationYaw += 360.0F; rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F; rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F; @@ -196,8 +188,8 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { public MovingObjectPosition clip(Vec3 par1Vec3, Vec3 par2Vec3) { boolean par3 = false; boolean par4 = false; - if (!Double.isNaN(par1Vec3.xCoord) && !Double.isNaN(par1Vec3.yCoord) && !Double.isNaN(par1Vec3.zCoord)) { - if (!Double.isNaN(par2Vec3.xCoord) && !Double.isNaN(par2Vec3.yCoord) && !Double.isNaN(par2Vec3.zCoord)) { + if(!Double.isNaN(par1Vec3.xCoord) && !Double.isNaN(par1Vec3.yCoord) && !Double.isNaN(par1Vec3.zCoord)) { + if(!Double.isNaN(par2Vec3.xCoord) && !Double.isNaN(par2Vec3.yCoord) && !Double.isNaN(par2Vec3.zCoord)) { int i = MathHelper.floor_double(par2Vec3.xCoord); int j = MathHelper.floor_double(par2Vec3.yCoord); int k = MathHelper.floor_double(par2Vec3.zCoord); @@ -207,21 +199,19 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { Block block = worldObj.getBlock(l, i1, j1); int l1 = worldObj.getBlockMetadata(l, i1, j1); - if (block != null && (!par4 || block == null || block.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block != Blocks.air && block.canCollideCheck(l1, par3)) { + if(block != null && (!par4 || block == null || block.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block != Blocks.air && block.canCollideCheck(l1, par3)) { MovingObjectPosition movingobjectposition = block.collisionRayTrace(worldObj, l, i1, j1, par1Vec3, par2Vec3); - if (movingobjectposition != null) - return movingobjectposition; + if(movingobjectposition != null) return movingobjectposition; } int k1 = 200; - while (k1-- >= 0) { - if (Double.isNaN(par1Vec3.xCoord) || Double.isNaN(par1Vec3.yCoord) || Double.isNaN(par1Vec3.zCoord)) + while(k1-- >= 0) { + if(Double.isNaN(par1Vec3.xCoord) || Double.isNaN(par1Vec3.yCoord) || Double.isNaN(par1Vec3.zCoord)) return null; - if (l == i && i1 == j && j1 == k) - return null; + if(l == i && i1 == j && j1 == k) return null; boolean flag2 = true; boolean flag3 = true; @@ -230,22 +220,16 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { double d1 = 999.0D; double d2 = 999.0D; - if (i > l) - d0 = l + 1.0D; - else if (i < l) - d0 = l + 0.0D; + if(i > l) d0 = l + 1.0D; + else if(i < l) d0 = l + 0.0D; else flag2 = false; - if (j > i1) - d1 = i1 + 1.0D; - else if (j < i1) - d1 = i1 + 0.0D; + if(j > i1) d1 = i1 + 1.0D; + else if(j < i1) d1 = i1 + 0.0D; else flag3 = false; - if (k > j1) - d2 = j1 + 1.0D; - else if (k < j1) - d2 = j1 + 0.0D; + if(k > j1) d2 = j1 + 1.0D; + else if(k < j1) d2 = j1 + 0.0D; else flag4 = false; double d3 = 999.0D; @@ -255,36 +239,30 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { double d7 = par2Vec3.yCoord - par1Vec3.yCoord; double d8 = par2Vec3.zCoord - par1Vec3.zCoord; - if (flag2) - d3 = (d0 - par1Vec3.xCoord) / d6; + if(flag2) d3 = (d0 - par1Vec3.xCoord) / d6; - if (flag3) - d4 = (d1 - par1Vec3.yCoord) / d7; + if(flag3) d4 = (d1 - par1Vec3.yCoord) / d7; - if (flag4) - d5 = (d2 - par1Vec3.zCoord) / d8; + if(flag4) d5 = (d2 - par1Vec3.zCoord) / d8; byte b0; - if (d3 < d4 && d3 < d5) { - if (i > l) - b0 = 4; + if(d3 < d4 && d3 < d5) { + if(i > l) b0 = 4; else b0 = 5; par1Vec3.xCoord = d0; par1Vec3.yCoord += d7 * d3; par1Vec3.zCoord += d8 * d3; - } else if (d4 < d5) { - if (j > i1) - b0 = 0; + } else if(d4 < d5) { + if(j > i1) b0 = 0; else b0 = 1; par1Vec3.xCoord += d6 * d4; par1Vec3.yCoord = d1; par1Vec3.zCoord += d8 * d4; } else { - if (k > j1) - b0 = 2; + if(k > j1) b0 = 2; else b0 = 3; par1Vec3.xCoord += d6 * d5; @@ -295,21 +273,21 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { Vec3 vec32 = new Vector3(par1Vec3.xCoord, par1Vec3.yCoord, par1Vec3.zCoord).toVec3D(); l = (int) (vec32.xCoord = MathHelper.floor_double(par1Vec3.xCoord)); - if (b0 == 5) { + if(b0 == 5) { --l; ++vec32.xCoord; } i1 = (int) (vec32.yCoord = MathHelper.floor_double(par1Vec3.yCoord)); - if (b0 == 1) { + if(b0 == 1) { --i1; ++vec32.yCoord; } j1 = (int) (vec32.zCoord = MathHelper.floor_double(par1Vec3.zCoord)); - if (b0 == 3) { + if(b0 == 3) { --j1; ++vec32.zCoord; } @@ -317,11 +295,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { Block block1 = worldObj.getBlock(l, i1, j1); int j2 = worldObj.getBlockMetadata(l, i1, j1); - if ((!par4 || block1 == null || block1.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block1 != Blocks.air && block1.canCollideCheck(j2, par3)) { + if((!par4 || block1 == null || block1.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block1 != Blocks.air && block1.canCollideCheck(j2, par3)) { MovingObjectPosition movingobjectposition1 = block1.collisionRayTrace(worldObj, l, i1, j1, par1Vec3, par2Vec3); - if (movingobjectposition1 != null) - return movingobjectposition1; + if(movingobjectposition1 != null) return movingobjectposition1; } } @@ -335,18 +312,16 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { superUpdate(); ILensEffect lens = getLensInstance(); - if (lens != null) - lens.updateBurst(this, getSourceLens()); + if(lens != null) lens.updateBurst(this, getSourceLens()); int mana = getMana(); - if (ticksExisted >= getMinManaLoss()) { + if(ticksExisted >= getMinManaLoss()) { accumulatedManaLoss += getManaLossPerTick(); int loss = (int) accumulatedManaLoss; setMana(mana - loss); accumulatedManaLoss -= loss; - if (getMana() <= 0) - setDead(); + if(getMana() <= 0) setDead(); } particles(); @@ -355,14 +330,12 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { fullManaLastTick = getMana() == getStartingMana(); - if (scanBeam) { + if(scanBeam) { PositionProperties props = new PositionProperties(this); - if (propsList.isEmpty()) - propsList.add(props); + if(propsList.isEmpty()) propsList.add(props); else { PositionProperties lastProps = propsList.get(propsList.size() - 1); - if (!props.coordsEqual(lastProps)) - propsList.add(props); + if(!props.coordsEqual(lastProps)) propsList.add(props); } } } @@ -378,13 +351,12 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { public TileEntity getCollidedTile(boolean noParticles) { this.noParticles = noParticles; - while (!isDead) { + while(!isDead) { ++ticksExisted; onUpdate(); } - if (fake) - incrementFakeParticleTick(); + if(fake) incrementFakeParticleTick(); return collidedTile; } @@ -433,12 +405,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } public void particles() { - if (isDead || !worldObj.isRemote) - return; + if(isDead || !worldObj.isRemote) return; ILensEffect lens = getLensInstance(); - if (lens != null && !lens.doParticles(this, getSourceLens())) - return; + if(lens != null && !lens.doParticles(this, getSourceLens())) return; Color color = new Color(getColor()); float r = color.getRed() / 255F; @@ -449,18 +419,15 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { int maxMana = getStartingMana(); float size = (float) mana / (float) maxMana; - if (fake) { - if (getMana() == getStartingMana()) - size = 2F; - else if (fullManaLastTick) - size = 4F; + if(fake) { + if(getMana() == getStartingMana()) size = 2F; + else if(fullManaLastTick) size = 4F; - if (!noParticles && shouldDoFakeParticles()) + if(!noParticles && shouldDoFakeParticles()) Botania.proxy.sparkleFX(worldObj, posX, posY, posZ, r, g, b, 0.4F * size, 1, true); } else { - if (ConfigHandler.subtlePowerSystem) - for (int i = 0; i < 1; i++) - Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F); + if(ConfigHandler.subtlePowerSystem) for(int i = 0; i < 1; i++) + Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F); else { posX += motionX; posY += motionY; @@ -487,22 +454,21 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { boolean collided = false; boolean dead = false; - if (movingobjectposition.entityHit == null) { + if(movingobjectposition.entityHit == null) { TileEntity tile = worldObj.getTileEntity(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); Block block = worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); - if ((tile instanceof IManaCollisionGhost && ((IManaCollisionGhost) tile).isGhost()) || block instanceof BlockBush) + if((tile instanceof IManaCollisionGhost && ((IManaCollisionGhost) tile).isGhost()) || block instanceof BlockBush) return; ChunkCoordinates coords = getBurstSourceChunkCoordinates(); - if (tile != null && (tile.xCoord != coords.posX || tile.yCoord != coords.posY || tile.zCoord != coords.posZ)) + if(tile != null && (tile.xCoord != coords.posX || tile.yCoord != coords.posY || tile.zCoord != coords.posZ)) collidedTile = tile; - if (tile == null || tile.xCoord != coords.posX || tile.yCoord != coords.posY || tile.zCoord != coords.posZ) { - if (!fake && !noParticles && !worldObj.isRemote && tile != null && tile instanceof IManaReceiver && ((IManaReceiver) tile).canRecieveManaFromBursts()) { + if(tile == null || tile.xCoord != coords.posX || tile.yCoord != coords.posY || tile.zCoord != coords.posZ) { + if(!fake && !noParticles && !worldObj.isRemote && tile != null && tile instanceof IManaReceiver && ((IManaReceiver) tile).canRecieveManaFromBursts()) { int mana = getMana(); - if (tile instanceof IManaCollector) - mana *= ((IManaCollector) tile).getManaYieldMultiplier(this); + if(tile instanceof IManaCollector) mana *= ((IManaCollector) tile).getManaYieldMultiplier(this); ((IManaReceiver) tile).recieveMana(mana); worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); @@ -515,14 +481,14 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } ILensEffect lens = getLensInstance(); - if (lens != null) + if(lens != null) dead = lens.collideBurst(this, movingobjectposition, collidedTile != null && collidedTile instanceof IManaReceiver && ((IManaReceiver) collidedTile).canRecieveManaFromBursts(), dead, getSourceLens()); - if (collided && !hasAlreadyCollidedAt(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ)) + if(collided && !hasAlreadyCollidedAt(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ)) alreadyCollidedAt.add(getCollisionLocString(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ)); - if (dead && !isDead) { - if (!fake) { + if(dead && !isDead) { + if(!fake) { Color color = new Color(getColor()); float r = color.getRed() / 255F; float g = color.getGreen() / 255F; @@ -532,9 +498,8 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { int maxMana = getStartingMana(); float size = (float) mana / (float) maxMana; - if (!ConfigHandler.subtlePowerSystem) - for (int i = 0; i < 4; i++) - Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.15F * size, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F); + if(!ConfigHandler.subtlePowerSystem) for(int i = 0; i < 4; i++) + Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.15F * size, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F); Botania.proxy.sparkleFX(worldObj, (float) posX, (float) posY, (float) posZ, r, g, b, 4, 2); } @@ -546,11 +511,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { public void setDead() { super.setDead(); - if (!fake) { + if(!fake) { ChunkCoordinates coords = getBurstSourceChunkCoordinates(); TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ); - if (tile != null && tile instanceof TileSpreader) - ((TileSpreader) tile).canShootBurst = true; + if(tile != null && tile instanceof TileSpreader) ((TileSpreader) tile).canShootBurst = true; } else setDeathTicksForFakeParticle(); } @@ -658,8 +622,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { public ILensEffect getLensInstance() { ItemStack lens = getSourceLens(); - if (lens != null && lens.getItem() instanceof ILensEffect) - return (ILensEffect) lens.getItem(); + if(lens != null && lens.getItem() instanceof ILensEffect) return (ILensEffect) lens.getItem(); return null; } @@ -683,12 +646,11 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } private boolean shouldDoFakeParticles() { - if (ConfigHandler.staticWandBeam) - return true; + if(ConfigHandler.staticWandBeam) return true; ChunkCoordinates coords = getBurstSourceChunkCoordinates(); TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ); - if (tile != null && tile instanceof TileSpreader) + if(tile != null && tile instanceof TileSpreader) return getMana() != getStartingMana() && fullManaLastTick || Math.abs(((TileSpreader) tile).burstParticleTick - ticksExisted) < 4; return false; } @@ -696,10 +658,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { private void incrementFakeParticleTick() { ChunkCoordinates coords = getBurstSourceChunkCoordinates(); TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ); - if (tile != null && tile instanceof TileSpreader) { + if(tile != null && tile instanceof TileSpreader) { TileSpreader spreader = (TileSpreader) tile; spreader.burstParticleTick += 2; - if (spreader.lastBurstDeathTick != -1 && spreader.burstParticleTick > spreader.lastBurstDeathTick) + if(spreader.lastBurstDeathTick != -1 && spreader.burstParticleTick > spreader.lastBurstDeathTick) spreader.burstParticleTick = 0; } } @@ -707,8 +669,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { private void setDeathTicksForFakeParticle() { ChunkCoordinates coords = getBurstSourceChunkCoordinates(); TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ); - if (tile != null && tile instanceof TileSpreader) - ((TileSpreader) tile).lastBurstDeathTick = ticksExisted; + if(tile != null && tile instanceof TileSpreader) ((TileSpreader) tile).lastBurstDeathTick = ticksExisted; } public static class PositionProperties { diff --git a/MODSRC/vazkii/botania/common/entity/EntitySignalFlare.java b/MODSRC/vazkii/botania/common/entity/EntitySignalFlare.java index f41805a62..cc45d0497 100644 --- a/MODSRC/vazkii/botania/common/entity/EntitySignalFlare.java +++ b/MODSRC/vazkii/botania/common/entity/EntitySignalFlare.java @@ -36,22 +36,20 @@ public class EntitySignalFlare extends Entity { @Override public void onEntityUpdate() { super.onEntityUpdate(); - if (ticksExisted++ >= 100) - setDead(); + if(ticksExisted++ >= 100) setDead(); - if (!isDead) { - if (ticksExisted % 10 == 0) - playSound("creeper.primed", 1F, 1F); + if(!isDead) { + if(ticksExisted % 10 == 0) playSound("creeper.primed", 1F, 1F); int color = getColor(); - if (color < 16 && color >= 0) { + if(color < 16 && color >= 0) { float[] colorArray = EntitySheep.fleeceColorTable[color]; Botania.proxy.setWispFXDistanceLimit(false); - for (int i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) Botania.proxy.wispFX(worldObj, posX, posY, posZ + 0.5, colorArray[0], colorArray[1], colorArray[2], (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - (float) posY)), (float) (Math.random() - 0.5F)); - for (int i = 0; i < 4; i++) + for(int i = 0; i < 4; i++) Botania.proxy.wispFX(worldObj, posX + 0.5, 256, posZ + 0.5, colorArray[0], colorArray[1], colorArray[2], (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F); Botania.proxy.setWispFXDistanceLimit(true); } diff --git a/MODSRC/vazkii/botania/common/item/Item16Colors.java b/MODSRC/vazkii/botania/common/item/Item16Colors.java index 381a4e1d6..13e0202ca 100644 --- a/MODSRC/vazkii/botania/common/item/Item16Colors.java +++ b/MODSRC/vazkii/botania/common/item/Item16Colors.java @@ -35,7 +35,7 @@ public class Item16Colors extends ItemMod { @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) par3List.add(new ItemStack(item, 1, i)); } diff --git a/MODSRC/vazkii/botania/common/item/ItemDirtRod.java b/MODSRC/vazkii/botania/common/item/ItemDirtRod.java index d9872c441..1eeecfce7 100644 --- a/MODSRC/vazkii/botania/common/item/ItemDirtRod.java +++ b/MODSRC/vazkii/botania/common/item/ItemDirtRod.java @@ -32,14 +32,14 @@ public class ItemDirtRod extends ItemMod { @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if (ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, false)) { + if(ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, false)) { ItemStack stackToPlace = new ItemStack(Blocks.dirt); stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); - if (stackToPlace.stackSize == 0) { + if(stackToPlace.stackSize == 0) { ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, true); ForgeDirection dir = ForgeDirection.getOrientation(par7); - for (int i = 0; i < 6; i++) + for(int i = 0; i < 6; i++) Botania.proxy.sparkleFX(par3World, par4 + dir.offsetX + Math.random(), par5 + dir.offsetY + Math.random(), par6 + dir.offsetZ + Math.random(), 0.35F, 0.2F, 0.05F, 1F, 5); } } diff --git a/MODSRC/vazkii/botania/common/item/ItemFertilizer.java b/MODSRC/vazkii/botania/common/item/ItemFertilizer.java index 9214e50f8..a02f0ab32 100644 --- a/MODSRC/vazkii/botania/common/item/ItemFertilizer.java +++ b/MODSRC/vazkii/botania/common/item/ItemFertilizer.java @@ -32,29 +32,29 @@ public class ItemFertilizer extends ItemMod { @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { final int range = 3; - if (!par3World.isRemote) { + if(!par3World.isRemote) { List validCoords = new ArrayList(); - for (int i = -range - 1; i < range; i++) - for (int j = -range - 1; j < range; j++) { - for (int k = 2; k >= -2; k--) { + for(int i = -range - 1; i < range; i++) + for(int j = -range - 1; j < range; j++) { + for(int k = 2; k >= -2; k--) { int x = par4 + i + 1; int y = par5 + k + 1; int z = par6 + j + 1; - if (par3World.isAirBlock(x, y, z) && (!par3World.provider.hasNoSky || y < 255) && ModBlocks.flower.canBlockStay(par3World, x, y, z)) + if(par3World.isAirBlock(x, y, z) && (!par3World.provider.hasNoSky || y < 255) && ModBlocks.flower.canBlockStay(par3World, x, y, z)) validCoords.add(new ChunkCoordinates(x, y, z)); } } int flowerCount = Math.min(validCoords.size(), par3World.rand.nextBoolean() ? 2 : 3); - for (int i = 0; i < flowerCount; i++) { + for(int i = 0; i < flowerCount; i++) { ChunkCoordinates coords = validCoords.get(par3World.rand.nextInt(validCoords.size())); validCoords.remove(coords); par3World.setBlock(coords.posX, coords.posY, coords.posZ, ModBlocks.flower, par3World.rand.nextInt(16), 1 | 2); } par1ItemStack.stackSize--; } else { - for (int i = 0; i < 15; i++) { + for(int i = 0; i < 15; i++) { double x = par4 - range + par3World.rand.nextInt(range * 2 + 1) + Math.random(); double y = par5 + 1; double z = par6 - range + par3World.rand.nextInt(range * 2 + 1) + Math.random(); diff --git a/MODSRC/vazkii/botania/common/item/ItemGrassHorn.java b/MODSRC/vazkii/botania/common/item/ItemGrassHorn.java index 4f5fe332c..3ab4bc9ca 100644 --- a/MODSRC/vazkii/botania/common/item/ItemGrassHorn.java +++ b/MODSRC/vazkii/botania/common/item/ItemGrassHorn.java @@ -53,44 +53,43 @@ public class ItemGrassHorn extends ItemMod { @Override public void onUsingTick(ItemStack stack, EntityPlayer player, int time) { - if (time != getMaxItemUseDuration(stack) && time % 5 == 0) { + if(time != getMaxItemUseDuration(stack) && time % 5 == 0) { Random rand = new Random((int) player.posX ^ (int) player.posZ); int range = 12; List coords = new ArrayList(); - for (int i = -range; i < range + 1; i++) - for (int j = -range; j < range + 1; j++) - for (int k = -3; k < 4; k++) { + for(int i = -range; i < range + 1; i++) + for(int j = -range; j < range + 1; j++) + for(int k = -3; k < 4; k++) { int x = (int) player.posX + i; int y = (int) player.posY + k; int z = (int) player.posZ + j; Block block = player.worldObj.getBlock(x, y, z); - if (block instanceof BlockBush && !(block instanceof ISpecialFlower)) + if(block instanceof BlockBush && !(block instanceof ISpecialFlower)) coords.add(new ChunkCoordinates(x, y, z)); } Collections.shuffle(coords, rand); int count = Math.min(coords.size(), 32); - for (int i = 0; i < count; i++) { + for(int i = 0; i < count; i++) { ChunkCoordinates currCoords = coords.get(i); List items = new ArrayList(); Block block = player.worldObj.getBlock(currCoords.posX, currCoords.posY, currCoords.posZ); int meta = player.worldObj.getBlockMetadata(currCoords.posX, currCoords.posY, currCoords.posZ); items.addAll(block.getDrops(player.worldObj, currCoords.posX, currCoords.posY, currCoords.posZ, meta, 0)); - if (!player.worldObj.isRemote) { + if(!player.worldObj.isRemote) { player.worldObj.setBlockToAir(currCoords.posX, currCoords.posY, currCoords.posZ); player.worldObj.playAuxSFX(2001, currCoords.posX, currCoords.posY, currCoords.posZ, Block.getIdFromBlock(block) + (meta << 12)); - for (ItemStack stack_ : items) + for(ItemStack stack_ : items) player.worldObj.spawnEntityInWorld(new EntityItem(player.worldObj, currCoords.posX + 0.5, currCoords.posY + 0.5, currCoords.posZ + 0.5, stack_)); } } } - if (!player.worldObj.isRemote) - player.worldObj.playSoundAtEntity(player, "note.bassattack", 1F, 0.001F); + if(!player.worldObj.isRemote) player.worldObj.playSoundAtEntity(player, "note.bassattack", 1F, 0.001F); } } diff --git a/MODSRC/vazkii/botania/common/item/ItemGrassSeeds.java b/MODSRC/vazkii/botania/common/item/ItemGrassSeeds.java index 420bcfb26..5032ca665 100644 --- a/MODSRC/vazkii/botania/common/item/ItemGrassSeeds.java +++ b/MODSRC/vazkii/botania/common/item/ItemGrassSeeds.java @@ -49,7 +49,7 @@ public class ItemGrassSeeds extends ItemMod { @Override public void getSubItems(Item par1, CreativeTabs par2, List par3) { - for (int i = 0; i < types; i++) + for(int i = 0; i < types; i++) par3.add(new ItemStack(par1, 1, i)); } @@ -57,7 +57,7 @@ public class ItemGrassSeeds extends ItemMod { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[types]; - for (int i = 0; i < types; i++) + for(int i = 0; i < types; i++) icons[i] = IconHelper.forItem(par1IconRegister, this, i); } @@ -77,12 +77,12 @@ public class ItemGrassSeeds extends ItemMod { Block block = par3World.getBlock(par4, par5, par6); int bmeta = par3World.getBlockMetadata(par4, par5, par6); - if (block == Blocks.dirt && bmeta == 0) { + if(block == Blocks.dirt && bmeta == 0) { int meta = par1ItemStack.getItemDamage(); BlockSwapper swapper = addBlockSwapper(par3World, par4, par5, par6, meta); par3World.setBlock(par4, par5, par6, swapper.blockToSet, swapper.metaToSet, 1 | 2); - for (int i = 0; i < 50; i++) { + for(int i = 0; i < 50; i++) { double x = (Math.random() - 0.5) * 3; double y = (Math.random() - 0.5) + 1; double z = (Math.random() - 0.5) * 3; @@ -90,11 +90,11 @@ public class ItemGrassSeeds extends ItemMod { float r = 0F; float g = 0.4F; float b = 0F; - if (meta == 1) { + if(meta == 1) { r = 0.5F; g = 0.37F; b = 0F; - } else if (meta == 2) { + } else if(meta == 2) { r = 0.27F; g = 0F; b = 0.33F; @@ -113,13 +113,13 @@ public class ItemGrassSeeds extends ItemMod { @SubscribeEvent public void onTickEnd(TickEvent.WorldTickEvent event) { - if (event.phase == Phase.END) { + if(event.phase == Phase.END) { int dim = event.world.provider.dimensionId; - if (blockSwappers.containsKey(dim)) { + if(blockSwappers.containsKey(dim)) { List swappers = blockSwappers.get(dim); List swappersSafe = new ArrayList(swappers); - for (BlockSwapper s : swappersSafe) + for(BlockSwapper s : swappersSafe) s.tick(swappers); } } @@ -129,15 +129,14 @@ public class ItemGrassSeeds extends ItemMod { BlockSwapper swapper = swapperFromMeta(world, x, y, z, meta); int dim = world.provider.dimensionId; - if (!blockSwappers.containsKey(dim)) - blockSwappers.put(dim, new ArrayList()); + if(!blockSwappers.containsKey(dim)) blockSwappers.put(dim, new ArrayList()); blockSwappers.get(dim).add(swapper); return swapper; } private static BlockSwapper swapperFromMeta(World world, int x, int y, int z, int meta) { - switch (meta) { + switch(meta) { case 1: return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.dirt, 2); case 2: @@ -169,28 +168,28 @@ public class ItemGrassSeeds extends ItemMod { ++ticksExisted; int range = 3; - for (int i = -range; i < range + 1; i++) - for (int j = -range; j < range + 1; j++) { + for(int i = -range; i < range + 1; i++) + for(int j = -range; j < range + 1; j++) { int x = startCoords.posX + i; int y = startCoords.posY; int z = startCoords.posZ + j; Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); - if (block == blockToSet && meta == metaToSet) { - if (ticksExisted % 20 == 0) { + if(block == blockToSet && meta == metaToSet) { + if(ticksExisted % 20 == 0) { List validCoords = new ArrayList(); - for (int k = -1; k < 2; k++) - for (int l = -1; l < 2; l++) { + for(int k = -1; k < 2; k++) + for(int l = -1; l < 2; l++) { int x1 = x + k; int z1 = z + l; Block block1 = world.getBlock(x1, y, z1); int meta1 = world.getBlockMetadata(x1, y, z1); - if (block1 == Blocks.dirt && meta1 == 0) + if(block1 == Blocks.dirt && meta1 == 0) validCoords.add(new ChunkCoordinates(x1, y, z1)); } - if (!validCoords.isEmpty() && !world.isRemote) { + if(!validCoords.isEmpty() && !world.isRemote) { ChunkCoordinates coords = validCoords.get(rand.nextInt(validCoords.size())); world.setBlock(coords.posX, coords.posY, coords.posZ, blockToSet, metaToSet, 1 | 2); } @@ -198,8 +197,7 @@ public class ItemGrassSeeds extends ItemMod { } } - if (ticksExisted >= 80) - list.remove(this); + if(ticksExisted >= 80) list.remove(this); } } diff --git a/MODSRC/vazkii/botania/common/item/ItemLens.java b/MODSRC/vazkii/botania/common/item/ItemLens.java index f87fa6558..cc17e38e2 100644 --- a/MODSRC/vazkii/botania/common/item/ItemLens.java +++ b/MODSRC/vazkii/botania/common/item/ItemLens.java @@ -47,9 +47,7 @@ import java.util.Map; 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, - MAGNET = 10, EXPLOSIVE = 11; + private static final int NORMAL = 0, SPEED = 1, POWER = 2, TIME = 3, EFFICIENCY = 4, BOUNCE = 5, GRAVITY = 6, MINE = 7, DAMAGE = 8, PHANTOM = 9, MAGNET = 10, EXPLOSIVE = 11; private static final Map> blacklist = new HashMap(); @@ -83,13 +81,13 @@ public class ItemLens extends ItemMod implements ILens { iconGlass = IconHelper.forName(par1IconRegister, "lensInside"); ringIcons = new IIcon[SUBTYPES]; - for (int i = 0; i < ringIcons.length; i++) + for(int i = 0; i < ringIcons.length; i++) ringIcons[i] = IconHelper.forNameRaw(par1IconRegister, LibItemNames.LENS_NAMES[i]); } @Override public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < SUBTYPES; i++) + for(int i = 0; i < SUBTYPES; i++) par3List.add(new ItemStack(par1, 1, i)); } @@ -121,7 +119,7 @@ public class ItemLens extends ItemMod implements ILens { @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { int storedColor = getStoredColor(par1ItemStack); - if (storedColor != -1) + if(storedColor != -1) par3List.add(String.format(StatCollector.translateToLocal("botaniamisc.color"), StatCollector.translateToLocal("botania.color" + storedColor))); } @@ -133,18 +131,16 @@ public class ItemLens extends ItemMod implements ILens { @Override public String getItemStackDisplayName(ItemStack stack) { ItemStack compositeLens = getCompositeLens(stack); - if (compositeLens == null) - return super.getItemStackDisplayName(stack); + if(compositeLens == null) return super.getItemStackDisplayName(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); + if(storedColor != -1) props.color = getLensColor(stack); - switch (stack.getItemDamage()) { + switch(stack.getItemDamage()) { case SPEED: { props.motionModifier *= 2F; props.maxMana *= 0.75F; @@ -176,7 +172,7 @@ public class ItemLens extends ItemMod implements ILens { } ItemStack compositeLens = getCompositeLens(stack); - if (compositeLens != null && compositeLens.getItem() instanceof ILens) + if(compositeLens != null && compositeLens.getItem() instanceof ILens) ((ILens) compositeLens.getItem()).apply(compositeLens, props); } @@ -184,11 +180,11 @@ public class ItemLens extends ItemMod implements ILens { public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { EntityThrowable entity = (EntityThrowable) burst; - switch (stack.getItemDamage()) { + switch(stack.getItemDamage()) { case BOUNCE: { - if (!isManaBlock && pos.entityHit == null) { + if(!isManaBlock && pos.entityHit == null) { ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if (coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) { + if(coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) { Vector3 currentMovementVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ); ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit); Vector3 normalVector = new Vector3(dir.offsetX, dir.offsetY, dir.offsetZ).normalize(); @@ -212,17 +208,17 @@ public class ItemLens extends ItemMod implements ILens { int mana = burst.getMana(); ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if ((coords.posX != x || coords.posY != y || coords.posZ != z) && !isManaBlock && block != null && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) { + if((coords.posX != x || coords.posY != y || coords.posZ != z) && !isManaBlock && block != null && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) { List items = new ArrayList(); items.addAll(block.getDrops(world, x, y, z, meta, 0)); - if (!burst.hasAlreadyCollidedAt(x, y, z)) { - if (!burst.isFake() && !entity.worldObj.isRemote) { + if(!burst.hasAlreadyCollidedAt(x, y, z)) { + if(!burst.isFake() && !entity.worldObj.isRemote) { world.setBlockToAir(x, y, z); entity.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); - for (ItemStack stack_ : items) + for(ItemStack stack_ : items) world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack_)); burst.setMana(mana - 24); } @@ -233,29 +229,29 @@ public class ItemLens extends ItemMod implements ILens { break; } case DAMAGE: { - if (pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && !(pos.entityHit instanceof EntityPlayer)) { + if(pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && !(pos.entityHit instanceof EntityPlayer)) { EntityLivingBase living = (EntityLivingBase) pos.entityHit; - if (living.hurtTime == 0) { + if(living.hurtTime == 0) { int mana = burst.getMana(); - if (mana >= 16) { + if(mana >= 16) { burst.setMana(mana - 16); - if (!burst.isFake() && !entity.worldObj.isRemote) + if(!burst.isFake() && !entity.worldObj.isRemote) living.attackEntityFrom(DamageSource.magic, 4); } } } } case PHANTOM: { - if (!isManaBlock) { + if(!isManaBlock) { dead = false; burst.setMinManaLoss(Math.max(0, burst.getMinManaLoss() - 4)); } break; } case EXPLOSIVE: { - if (!burst.isFake()) { + 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)) + 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, burst.getMana() / 50F, true); } else dead = false; } @@ -263,7 +259,7 @@ public class ItemLens extends ItemMod implements ILens { } ItemStack compositeLens = getCompositeLens(stack); - if (compositeLens != null && compositeLens.getItem() instanceof ILens) + if(compositeLens != null && compositeLens.getItem() instanceof ILens) dead = ((ILens) compositeLens.getItem()).collideBurst(burst, pos, isManaBlock, dead, compositeLens); return dead; @@ -272,13 +268,12 @@ public class ItemLens extends ItemMod implements ILens { @Override public void updateBurst(IManaBurst burst, ItemStack stack) { int storedColor = getStoredColor(stack); - if (storedColor == 16) - burst.setColor(getLensColor(stack)); + if(storedColor == 16) burst.setColor(getLensColor(stack)); EntityThrowable entity = (EntityThrowable) burst; boolean magnetized = entity.getEntityData().hasKey("Botania:Magnetized"); - switch (stack.getItemDamage()) { + switch(stack.getItemDamage()) { case MAGNET: { int x = (int) entity.posX; int y = (int) entity.posY; @@ -287,25 +282,24 @@ public class ItemLens extends ItemMod implements ILens { magnetize: { - for (int i = -range; i < range; i++) - for (int j = -range; j < range; j++) - for (int k = -range; k < range; k++) - if (entity.worldObj.getTileEntity(i + x, j + y, k + z) instanceof IManaReceiver) { + for(int i = -range; i < range; i++) + for(int j = -range; j < range; j++) + for(int k = -range; k < range; k++) + if(entity.worldObj.getTileEntity(i + x, j + y, k + z) instanceof IManaReceiver) { TileEntity tile = entity.worldObj.getTileEntity(i + x, j + y, k + z); - if (magnetized) { + if(magnetized) { int magX = entity.getEntityData().getInteger("Botania:MagnetizedX"); int magY = entity.getEntityData().getInteger("Botania:MagnetizedY"); int magZ = entity.getEntityData().getInteger("Botania:MagnetizedZ"); - if (tile.xCoord != magX || tile.yCoord != magY || tile.zCoord != magZ) - continue; + if(tile.xCoord != magX || tile.yCoord != magY || tile.zCoord != magZ) continue; } IManaReceiver receiver = (IManaReceiver) tile; ChunkCoordinates srcCoords = burst.getBurstSourceChunkCoordinates(); - if (MathHelper.pointDistanceSpace(tile.xCoord, tile.yCoord, tile.zCoord, srcCoords.posX, srcCoords.posY, srcCoords.posZ) > 3 && receiver.canRecieveManaFromBursts() && !receiver.isFull()) { + if(MathHelper.pointDistanceSpace(tile.xCoord, tile.yCoord, tile.zCoord, srcCoords.posX, srcCoords.posY, srcCoords.posZ) > 3 && receiver.canRecieveManaFromBursts() && !receiver.isFull()) { Vector3 burstVec = Vector3.fromEntity(entity); Vector3 tileVec = Vector3.fromTileEntityCenter(tile).add(0, -0.1, 0); Vector3 motionVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ); @@ -315,7 +309,7 @@ public class ItemLens extends ItemMod implements ILens { Vector3 differenceVec = normalMotionVec.sub(magnetVec).multiply(motionVec.mag() * 0.1); Vector3 finalMotionVec = motionVec.sub(differenceVec); - if (!magnetized) { + if(!magnetized) { finalMotionVec.multiply(0.75); entity.getEntityData().setBoolean("Botania:Magnetized", true); entity.getEntityData().setInteger("Botania:MagnetizedX", tile.xCoord); @@ -332,7 +326,7 @@ public class ItemLens extends ItemMod implements ILens { } ItemStack compositeLens = getCompositeLens(stack); - if (compositeLens != null && compositeLens.getItem() instanceof ILens) + if(compositeLens != null && compositeLens.getItem() instanceof ILens) ((ILens) compositeLens.getItem()).updateBurst(burst, compositeLens); } @@ -340,11 +334,9 @@ public class ItemLens extends ItemMod implements ILens { public int getLensColor(ItemStack stack) { int storedColor = getStoredColor(stack); - if (storedColor == -1) - return 0xFFFFFF; + if(storedColor == -1) return 0xFFFFFF; - if (storedColor == 16) - return Color.HSBtoRGB(Botania.proxy.getWorldElapsedTicks() * 2 % 360 / 360F, 1F, 1F); + if(storedColor == 16) return Color.HSBtoRGB(Botania.proxy.getWorldElapsedTicks() * 2 % 360 / 360F, 1F, 1F); float[] color = EntitySheep.fleeceColorTable[storedColor]; return new Color(color[0], color[1], color[2]).getRGB(); @@ -362,8 +354,7 @@ public class ItemLens extends ItemMod implements ILens { @Override public boolean doParticles(IManaBurst burst, ItemStack stack) { int storedColor = getStoredColor(stack); - if (storedColor == 16 && !burst.isFake()) - return ((EntityThrowable) burst).ticksExisted > 5; + if(storedColor == 16 && !burst.isFake()) return ((EntityThrowable) burst).ticksExisted > 5; return true; } @@ -373,31 +364,25 @@ public class ItemLens extends ItemMod implements ILens { } public static void blacklistLenses(int lens1, int lens2, boolean recursive) { - if (!blacklist.containsKey(lens1)) - blacklist.put(lens1, new ArrayList()); + if(!blacklist.containsKey(lens1)) blacklist.put(lens1, new ArrayList()); blacklist.get(lens1).add(lens2); - if (recursive) - blacklistLenses(lens2, lens1, false); + if(recursive) blacklistLenses(lens2, lens1, false); } public static boolean isBlacklisted(int lens1, int lens2) { - if (!blacklist.containsKey(lens1)) - return false; + if(!blacklist.containsKey(lens1)) return false; return blacklist.get(lens1).contains(lens2); } @Override public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens) { - if (sourceLens.getItemDamage() == compositeLens.getItemDamage()) - return false; + if(sourceLens.getItemDamage() == compositeLens.getItemDamage()) return false; - if (sourceLens.getItemDamage() == NORMAL || compositeLens.getItemDamage() == NORMAL) - return false; + if(sourceLens.getItemDamage() == NORMAL || compositeLens.getItemDamage() == NORMAL) return false; - if (isBlacklisted(sourceLens.getItemDamage(), compositeLens.getItemDamage())) - return false; + if(isBlacklisted(sourceLens.getItemDamage(), compositeLens.getItemDamage())) return false; return true; } diff --git a/MODSRC/vazkii/botania/common/item/ItemLexicon.java b/MODSRC/vazkii/botania/common/item/ItemLexicon.java index 8e71e9329..bc43ef664 100644 --- a/MODSRC/vazkii/botania/common/item/ItemLexicon.java +++ b/MODSRC/vazkii/botania/common/item/ItemLexicon.java @@ -32,12 +32,12 @@ public class ItemLexicon extends ItemMod { @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if (par2EntityPlayer.isSneaking()) { + if(par2EntityPlayer.isSneaking()) { Block block = par3World.getBlock(par4, par5, par6); - if (block != null && block instanceof ILexiconable) { + if(block != null && block instanceof ILexiconable) { LexiconEntry entry = ((ILexiconable) block).getEntry(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); - if (entry != null) { + if(entry != null) { Botania.proxy.setEntryToOpen(entry); par2EntityPlayer.openGui(Botania.instance, LibGuiIDs.LEXICON, par3World, 0, 0, 0); return true; diff --git a/MODSRC/vazkii/botania/common/item/ItemManaGun.java b/MODSRC/vazkii/botania/common/item/ItemManaGun.java index 40a68a12a..72bd53705 100644 --- a/MODSRC/vazkii/botania/common/item/ItemManaGun.java +++ b/MODSRC/vazkii/botania/common/item/ItemManaGun.java @@ -46,23 +46,23 @@ public class ItemManaGun extends ItemMod { @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par3EntityPlayer.isSneaking()) { - if (par1ItemStack.getItemDamage() == 0) { + if(!par3EntityPlayer.isSneaking()) { + if(par1ItemStack.getItemDamage() == 0) { EntityManaBurst burst = getBurst(par3EntityPlayer, par1ItemStack); - if (burst != null && ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, burst.getMana(), true)) { - if (!par2World.isRemote) { + if(burst != null && ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, burst.getMana(), true)) { + if(!par2World.isRemote) { par2World.playSoundAtEntity(par3EntityPlayer, "random.explode", 0.9F, 3F); par2World.spawnEntityInWorld(burst); } else par3EntityPlayer.swingItem(); par1ItemStack.setItemDamage(COOLDOWN); - } else if (!par2World.isRemote) + } else if(!par2World.isRemote) par2World.playSoundAtEntity(par3EntityPlayer, "random.click", 0.6F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F); } } else { ItemStack lens = getLens(par1ItemStack); - if (lens != null) { - if (!par3EntityPlayer.inventory.addItemStackToInventory(lens.copy())) + if(lens != null) { + if(!par3EntityPlayer.inventory.addItemStackToInventory(lens.copy())) par3EntityPlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.invFull")); else setLens(par1ItemStack, null); } @@ -83,12 +83,11 @@ public class ItemManaGun extends ItemMod { BurstProperties props = new BurstProperties(maxMana, ticksBeforeManaLoss, manaLossPerTick, gravity, motionModifier, color); ItemStack lens = getLens(stack); - if (lens != null) - ((ILens) lens.getItem()).apply(lens, props); + if(lens != null) ((ILens) lens.getItem()).apply(lens, props); burst.setSourceLens(lens); - if (ManaItemHandler.requestManaExact(stack, player, props.maxMana, false)) { + if(ManaItemHandler.requestManaExact(stack, player, props.maxMana, false)) { burst.setColor(props.color); burst.setMana(props.maxMana); burst.setStartingMana(props.maxMana); @@ -105,10 +104,9 @@ public class ItemManaGun extends ItemMod { @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ItemStack lens = getLens(par1ItemStack); - if (lens != null) { + if(lens != null) { List tooltip = lens.getTooltip(par2EntityPlayer, false); - if (tooltip.size() > 1) - par3List.addAll(tooltip.subList(1, tooltip.size())); + if(tooltip.size() > 1) par3List.addAll(tooltip.subList(1, tooltip.size())); } } @@ -120,14 +118,13 @@ public class ItemManaGun extends ItemMod { public static void setLens(ItemStack stack, ItemStack lens) { NBTTagCompound cmp = new NBTTagCompound(); - if (lens != null) - lens.writeToNBT(cmp); + 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) { + if(cmp != null) { ItemStack lens = ItemStack.loadItemStackFromNBT(cmp); return lens; } @@ -141,7 +138,6 @@ public class ItemManaGun extends ItemMod { @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (par1ItemStack.isItemDamaged()) - par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); + if(par1ItemStack.isItemDamaged()) par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); } } diff --git a/MODSRC/vazkii/botania/common/item/ItemManaMirror.java b/MODSRC/vazkii/botania/common/item/ItemManaMirror.java index 6cc83d254..1ef9af7cd 100644 --- a/MODSRC/vazkii/botania/common/item/ItemManaMirror.java +++ b/MODSRC/vazkii/botania/common/item/ItemManaMirror.java @@ -67,7 +67,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem { @Override public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[2]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forItem(par1IconRegister, this, i); } @@ -84,8 +84,8 @@ public class ItemManaMirror extends ItemMod implements IManaItem { @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { IManaPool pool = getManaPool(par1ItemStack); - if (!(pool instanceof DummyPool)) { - if (pool == null) { + if(!(pool instanceof DummyPool)) { + if(pool == null) { bindPool(par1ItemStack, null); setManaForDisplay(par1ItemStack, 0); } else setManaForDisplay(par1ItemStack, pool.getCurrentMana()); @@ -94,9 +94,9 @@ public class ItemManaMirror extends ItemMod implements IManaItem { @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if (par2EntityPlayer.isSneaking() && !par3World.isRemote) { + if(par2EntityPlayer.isSneaking() && !par3World.isRemote) { TileEntity tile = par3World.getTileEntity(par4, par5, par6); - if (tile != null && tile instanceof IManaPool) { + if(tile != null && tile instanceof IManaPool) { bindPool(par1ItemStack, tile); par3World.playSoundAtEntity(par2EntityPlayer, "random.orb", 1F, 1F); return true; @@ -109,7 +109,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem { @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ChunkCoordinates coords = getPoolCoords(par1ItemStack); - if (coords.posY != -1) { + if(coords.posY != -1) { par3List.add("X: " + coords.posX); par3List.add("Y: " + coords.posY); par3List.add("Z: " + coords.posZ); @@ -143,8 +143,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem { @Override public void addMana(ItemStack stack, int mana) { IManaPool pool = getManaPool(stack); - if (pool != null) - pool.recieveMana(mana); + if(pool != null) pool.recieveMana(mana); } public void bindPool(ItemStack stack, TileEntity pool) { @@ -167,18 +166,15 @@ public class ItemManaMirror extends ItemMod implements IManaItem { public IManaPool getManaPool(ItemStack stack) { MinecraftServer server = MinecraftServer.getServer(); - if (server == null) - return new DummyPool(); + if(server == null) return new DummyPool(); ChunkCoordinates coords = getPoolCoords(stack); - if (coords.posY == -1) - return null; + if(coords.posY == -1) return null; int dim = getDimension(stack); - if (server.worldServers.length > dim && server.worldServers[dim] != null) { + if(server.worldServers.length > dim && server.worldServers[dim] != null) { TileEntity tile = server.worldServers[dim].getTileEntity(coords.posX, coords.posY, coords.posZ); - if (tile != null && tile instanceof IManaPool) - return (IManaPool) tile; + if(tile != null && tile instanceof IManaPool) return (IManaPool) tile; } return null; diff --git a/MODSRC/vazkii/botania/common/item/ItemManaResource.java b/MODSRC/vazkii/botania/common/item/ItemManaResource.java index dc6f8086b..7da76e5fe 100644 --- a/MODSRC/vazkii/botania/common/item/ItemManaResource.java +++ b/MODSRC/vazkii/botania/common/item/ItemManaResource.java @@ -34,14 +34,14 @@ public class ItemManaResource extends ItemMod { @Override public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < types; i++) + for(int i = 0; i < types; i++) par3List.add(new ItemStack(par1, 1, i)); } @Override public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[types]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forNameRaw(par1IconRegister, LibItemNames.MANA_RESOURCE_NAMES[i]); } diff --git a/MODSRC/vazkii/botania/common/item/ItemManaTablet.java b/MODSRC/vazkii/botania/common/item/ItemManaTablet.java index d44a87870..39bfa81f6 100644 --- a/MODSRC/vazkii/botania/common/item/ItemManaTablet.java +++ b/MODSRC/vazkii/botania/common/item/ItemManaTablet.java @@ -78,7 +78,7 @@ public class ItemManaTablet extends ItemMod implements IManaItem { @Override public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[2]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forItem(par1IconRegister, this, i); } @@ -89,8 +89,7 @@ public class ItemManaTablet extends ItemMod implements IManaItem { @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - if (isStackCreative(par1ItemStack)) - par3List.add(StatCollector.translateToLocal("botaniamisc.creative")); + if(isStackCreative(par1ItemStack)) par3List.add(StatCollector.translateToLocal("botaniamisc.creative")); } @Override @@ -127,8 +126,7 @@ public class ItemManaTablet extends ItemMod implements IManaItem { @Override public void addMana(ItemStack stack, int mana) { - if (!isStackCreative(stack)) - setMana(stack, Math.min(getMana(stack) + mana, MAX_MANA)); + if(!isStackCreative(stack)) setMana(stack, Math.min(getMana(stack) + mana, MAX_MANA)); } @Override diff --git a/MODSRC/vazkii/botania/common/item/ItemRune.java b/MODSRC/vazkii/botania/common/item/ItemRune.java index 4e2baf110..269bf4499 100644 --- a/MODSRC/vazkii/botania/common/item/ItemRune.java +++ b/MODSRC/vazkii/botania/common/item/ItemRune.java @@ -36,7 +36,7 @@ public class ItemRune extends ItemMod implements IFlowerComponent { @Override public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[16]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forItem(par1IconRegister, this, i); } @@ -47,7 +47,7 @@ public class ItemRune extends ItemMod implements IFlowerComponent { @Override public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) par3List.add(new ItemStack(par1, 1, i)); } diff --git a/MODSRC/vazkii/botania/common/item/ItemSignalFlare.java b/MODSRC/vazkii/botania/common/item/ItemSignalFlare.java index 84b4447b0..a065b4376 100644 --- a/MODSRC/vazkii/botania/common/item/ItemSignalFlare.java +++ b/MODSRC/vazkii/botania/common/item/ItemSignalFlare.java @@ -55,9 +55,8 @@ public class ItemSignalFlare extends ItemMod { @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par1ItemStack.getItemDamage() == 0) { - if (par2World.isRemote) - par3EntityPlayer.swingItem(); + if(par1ItemStack.getItemDamage() == 0) { + if(par2World.isRemote) par3EntityPlayer.swingItem(); else { EntitySignalFlare flare = new EntitySignalFlare(par2World); flare.setPosition(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ); @@ -68,8 +67,8 @@ public class ItemSignalFlare extends ItemMod { int range = 5; List entities = par2World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX - range, par3EntityPlayer.posY - range, par3EntityPlayer.posZ - range, par3EntityPlayer.posX + range, par3EntityPlayer.posY + range, par3EntityPlayer.posZ + range)); - for (EntityLivingBase entity : entities) - if (entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled())) + for(EntityLivingBase entity : entities) + if(entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled())) entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5)); } par1ItemStack.damageItem(200, par3EntityPlayer); @@ -80,14 +79,13 @@ public class ItemSignalFlare extends ItemMod { @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (par1ItemStack.isItemDamaged()) - par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); + if(par1ItemStack.isItemDamaged()) par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); } @Override public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[2]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forItem(par1IconRegister, this, i); } @@ -98,8 +96,7 @@ public class ItemSignalFlare extends ItemMod { @Override public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if (par2 == 0) - return 0xFFFFFF; + if(par2 == 0) return 0xFFFFFF; float[] color = EntitySheep.fleeceColorTable[getColor(par1ItemStack)]; return new Color(color[0], color[1], color[2]).getRGB(); @@ -107,7 +104,7 @@ public class ItemSignalFlare extends ItemMod { @Override public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) par3List.add(forColor(i)); } diff --git a/MODSRC/vazkii/botania/common/item/ItemTerraformRod.java b/MODSRC/vazkii/botania/common/item/ItemTerraformRod.java index 7cd860ab8..5764260c0 100644 --- a/MODSRC/vazkii/botania/common/item/ItemTerraformRod.java +++ b/MODSRC/vazkii/botania/common/item/ItemTerraformRod.java @@ -62,8 +62,7 @@ public class ItemTerraformRod extends ItemMod { @Override public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { - if (count != getMaxItemUseDuration(stack) && count % 10 == 0) - terraform(stack, player.worldObj, player); + if(count != getMaxItemUseDuration(stack) && count % 10 == 0) terraform(stack, player.worldObj, player); } @Override @@ -83,43 +82,39 @@ public class ItemTerraformRod extends ItemMod { List blocks = new ArrayList(); - for (int i = -range; i < range + 1; i++) - for (int j = -range; j < range + 1; j++) { + for(int i = -range; i < range + 1; i++) + for(int j = -range; j < range + 1; j++) { int k = 0; - while (true) { - if (yStart + k < 0) - break; + while(true) { + if(yStart + k < 0) break; int x = xCenter + i; int y = yStart + k; int z = zCenter + j; Block block = par2World.getBlock(x, y, z); - if (validBlocks.contains(block)) { + if(validBlocks.contains(block)) { boolean hasAir = false; List airBlocks = new ArrayList(); - final ForgeDirection[] dirs = new ForgeDirection[]{ - ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST - }; + final ForgeDirection[] dirs = new ForgeDirection[]{ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST}; - for (ForgeDirection dir : dirs) { + for(ForgeDirection dir : dirs) { int x_ = x + dir.offsetX; int y_ = y + dir.offsetY; int z_ = z + dir.offsetZ; Block block_ = par2World.getBlock(x_, y_, z_); - if (block_.isAir(par2World, x_, y_, z_) || block_.isReplaceable(par2World, x_, y_, z_) || (block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower)) || block_ == Blocks.double_plant) { + if(block_.isAir(par2World, x_, y_, z_) || block_.isReplaceable(par2World, x_, y_, z_) || (block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower)) || block_ == Blocks.double_plant) { airBlocks.add(new ChunkCoordinates(x_, y_, z_)); hasAir = true; } } - if (hasAir) { - if (y > yCenter) - blocks.add(new CoordsWithBlock(x, y, z, Blocks.air)); - else for (ChunkCoordinates coords : airBlocks) { - if (par2World.getBlock(coords.posX, coords.posY - 1, coords.posZ) != Blocks.air) + if(hasAir) { + if(y > yCenter) blocks.add(new CoordsWithBlock(x, y, z, Blocks.air)); + else for(ChunkCoordinates coords : airBlocks) { + if(par2World.getBlock(coords.posX, coords.posY - 1, coords.posZ) != Blocks.air) blocks.add(new CoordsWithBlock(coords.posX, coords.posY, coords.posZ, Blocks.dirt)); } } @@ -131,15 +126,14 @@ public class ItemTerraformRod extends ItemMod { int cost = COST_PER * blocks.size(); - if (par2World.isRemote || ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, cost, true)) { - if (!par2World.isRemote) - for (CoordsWithBlock block : blocks) - par2World.setBlock(block.posX, block.posY, block.posZ, block.block); + if(par2World.isRemote || ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, cost, true)) { + if(!par2World.isRemote) for(CoordsWithBlock block : blocks) + par2World.setBlock(block.posX, block.posY, block.posZ, block.block); - if (!blocks.isEmpty()) { - for (int i = 0; i < 10; i++) + if(!blocks.isEmpty()) { + for(int i = 0; i < 10; i++) par2World.playSoundAtEntity(par3EntityPlayer, "step.sand", 1F, 0.4F); - for (int i = 0; i < 120; i++) + for(int i = 0; i < 120; i++) Botania.proxy.sparkleFX(par2World, xCenter - range + range * 2 * Math.random(), yCenter + 2 + (Math.random() - 0.5) * 2, zCenter - range + range * 2 * Math.random(), 0.35F, 0.2F, 0.05F, 2F, 5); } } diff --git a/MODSRC/vazkii/botania/common/item/ItemTwigWand.java b/MODSRC/vazkii/botania/common/item/ItemTwigWand.java index cdb77ab6c..eb710634b 100644 --- a/MODSRC/vazkii/botania/common/item/ItemTwigWand.java +++ b/MODSRC/vazkii/botania/common/item/ItemTwigWand.java @@ -49,17 +49,15 @@ public class ItemTwigWand extends Item16Colors { @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { Block block = par3World.getBlock(par4, par5, par6); - if (block == Blocks.lapis_block) { + if(block == Blocks.lapis_block) { int meta = -1; - if (TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 0)) - meta = 0; - else if (TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 1)) - meta = 1; + if(TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 0)) meta = 0; + else if(TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 1)) meta = 1; - if (meta != -1 && !par3World.isRemote) { + if(meta != -1 && !par3World.isRemote) { par3World.setBlock(par4, par5, par6, ModBlocks.enchanter, meta, 1 | 2); par3World.playSoundEffect(par4, par5, par6, "random.levelup", 0.5F, 0.6F); - for (int i = 0; i < 50; i++) { + for(int i = 0; i < 50; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); @@ -73,14 +71,13 @@ public class ItemTwigWand extends Item16Colors { 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); } } - } else if (block instanceof IWandable) { + } else if(block instanceof IWandable) { boolean wanded = ((IWandable) block).onUsedByWand(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6, par7); - if (wanded && par3World.isRemote) - par2EntityPlayer.swingItem(); + if(wanded && par3World.isRemote) par2EntityPlayer.swingItem(); return wanded; - } else if (BlockPistonRelay.playerPositions.containsKey(par2EntityPlayer.getCommandSenderName())) { + } else if(BlockPistonRelay.playerPositions.containsKey(par2EntityPlayer.getCommandSenderName())) { String bindPos = BlockPistonRelay.playerPositions.get(par2EntityPlayer.getCommandSenderName()); String currentPos = BlockPistonRelay.getCoordsAsString(par3World.provider.dimensionId, par4, par5, par6); @@ -88,8 +85,7 @@ public class ItemTwigWand extends Item16Colors { BlockPistonRelay.mappedPositions.put(bindPos, currentPos); BlockPistonRelay.WorldData.get(par3World).markDirty(); - if (par3World.isRemote) - par2EntityPlayer.swingItem(); + if(par3World.isRemote) par2EntityPlayer.swingItem(); } return false; @@ -103,7 +99,7 @@ public class ItemTwigWand extends Item16Colors { @Override public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[3]; - for (int i = 0; i < icons.length; i++) + for(int i = 0; i < icons.length; i++) icons[i] = IconHelper.forItem(par1IconRegister, this, i); } @@ -114,8 +110,7 @@ public class ItemTwigWand extends Item16Colors { @Override public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if (par2 == 0) - return 0xFFFFFF; + if(par2 == 0) return 0xFFFFFF; float[] color = EntitySheep.fleeceColorTable[par2 == 1 ? getColor1(par1ItemStack) : getColor2(par1ItemStack)]; return new Color(color[0], color[1], color[2]).getRGB(); @@ -133,7 +128,7 @@ public class ItemTwigWand extends Item16Colors { @Override public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < 16; i++) + for(int i = 0; i < 16; i++) par3List.add(forColors(i, i)); } diff --git a/MODSRC/vazkii/botania/common/item/ModItems.java b/MODSRC/vazkii/botania/common/item/ModItems.java index 89b02611e..2f4698364 100644 --- a/MODSRC/vazkii/botania/common/item/ModItems.java +++ b/MODSRC/vazkii/botania/common/item/ModItems.java @@ -94,7 +94,7 @@ public final class ModItems { test = new ItemSimpleRing(); OreDictionary.registerOre(LibOreDict.LEXICON, lexicon); - for (int i = 0; i < 16; i++) { + for(int i = 0; i < 16; i++) { OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i)); OreDictionary.registerOre(LibOreDict.DYE[i], new ItemStack(dye, 1, i)); OreDictionary.registerOre(LibOreDict.MANA_PETAL[i], new ItemStack(manaPetal, 1, i)); diff --git a/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java b/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java index b3c5043c8..aaf0166dc 100644 --- a/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java +++ b/MODSRC/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java @@ -48,12 +48,11 @@ public class ItemBlockSpecialFlower extends ItemBlock implements IRecipeKeyProvi @Override public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { boolean placed = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); - if (placed) { + if(placed) { String type = getType(stack); TileSpecialFlower tile = (TileSpecialFlower) world.getTileEntity(x, y, z); tile.setSubTile(type); - if (!world.isRemote) - world.markBlockForUpdate(x, y, z); + if(!world.isRemote) world.markBlockForUpdate(x, y, z); } return placed; @@ -68,8 +67,7 @@ public class ItemBlockSpecialFlower extends ItemBlock implements IRecipeKeyProvi public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { String refUnlocalized = "tile." + LibBlockNames.SPECIAL_FLOWER_PREFIX + getType(par1ItemStack) + ".reference"; String refLocalized = StatCollector.translateToLocal(refUnlocalized); - if (!refLocalized.equals(refUnlocalized)) - par3List.add(EnumChatFormatting.ITALIC + refLocalized); + if(!refLocalized.equals(refUnlocalized)) par3List.add(EnumChatFormatting.ITALIC + refLocalized); } public static String getType(ItemStack stack) { diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelAxe.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelAxe.java index bf9941ea6..bad2b82b9 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelAxe.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelAxe.java @@ -56,7 +56,7 @@ public class ItemManasteelAxe extends ItemAxe { @Override public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if (block.getBlockHardness(world, x, y, z) != 0F) + if(block.getBlockHardness(world, x, y, z) != 0F) ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE); return true; diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelPick.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelPick.java index 906796f90..646758620 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelPick.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelPick.java @@ -56,7 +56,7 @@ public class ItemManasteelPick extends ItemPickaxe { @Override public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if (block.getBlockHardness(world, x, y, z) != 0F) + if(block.getBlockHardness(world, x, y, z) != 0F) ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE); return true; diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShears.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShears.java index 406346a0f..2c53d19d1 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShears.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShears.java @@ -56,16 +56,15 @@ public class ItemManasteelShears extends ItemShears { @Override public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) { - if (entity.worldObj.isRemote) - return false; + if(entity.worldObj.isRemote) return false; - if (entity instanceof IShearable) { + if(entity instanceof IShearable) { IShearable target = (IShearable) entity; - if (target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) { + if(target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) { ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); Random rand = new Random(); - for (ItemStack stack : drops) { + for(ItemStack stack : drops) { EntityItem ent = entity.entityDropItem(stack, 1.0F); ent.motionY += rand.nextFloat() * 0.05F; ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; @@ -83,17 +82,16 @@ public class ItemManasteelShears extends ItemShears { @Override public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) { - if (player.worldObj.isRemote) - return false; + if(player.worldObj.isRemote) return false; Block block = player.worldObj.getBlock(x, y, z); - if (block instanceof IShearable) { + if(block instanceof IShearable) { IShearable target = (IShearable) block; - if (target.isShearable(itemstack, player.worldObj, x, y, z)) { + if(target.isShearable(itemstack, player.worldObj, x, y, z)) { ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); Random rand = new Random(); - for (ItemStack stack : drops) { + for(ItemStack stack : drops) { float f = 0.7F; double d = rand.nextFloat() * f + (1D - f) * 0.5; double d1 = rand.nextFloat() * f + (1D - f) * 0.5; diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShovel.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShovel.java index 56b8c71a2..0a619db9e 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShovel.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelShovel.java @@ -56,7 +56,7 @@ public class ItemManasteelShovel extends ItemSpade { @Override public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if (block.getBlockHardness(world, x, y, z) != 0F) + if(block.getBlockHardness(world, x, y, z) != 0F) ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE); return true; diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelSword.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelSword.java index 2b599c776..33dafd555 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelSword.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemManasteelSword.java @@ -74,7 +74,7 @@ public class ItemManasteelSword extends ItemSword { @Override public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if (block.getBlockHardness(world, x, y, z) != 0F) + if(block.getBlockHardness(world, x, y, z) != 0F) ManasteelToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE); return true; diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemTerraSword.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemTerraSword.java index 7adaa32c9..2228329f1 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ItemTerraSword.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ItemTerraSword.java @@ -33,9 +33,9 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect { @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if (par3Entity instanceof EntityPlayer) { + if(par3Entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) par3Entity; - if (player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == 0.16666667F && !par2World.isRemote && par2World.rand.nextInt(2) == 0) { + if(player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == 0.16666667F && !par2World.isRemote && par2World.rand.nextInt(2) == 0) { EntityManaBurst burst = getBurst(player, par1ItemStack); par2World.spawnEntityInWorld(burst); ManasteelToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE); @@ -69,15 +69,15 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect { @Override public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { Entity entity = (Entity) burst; - if (pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && !(pos.entityHit instanceof EntityPlayer)) { + if(pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && !(pos.entityHit instanceof EntityPlayer)) { EntityLivingBase living = (EntityLivingBase) pos.entityHit; - if (living.hurtTime == 0) { + if(living.hurtTime == 0) { int cost = MANA_PER_DAMAGE / 3; int mana = burst.getMana(); - if (mana >= cost) { + if(mana >= cost) { burst.setMana(mana - cost); float damage = 4F + BotaniaAPI.terrasteelToolMaterial.getDamageVsEntity(); - if (!burst.isFake() && !entity.worldObj.isRemote) + if(!burst.isFake() && !entity.worldObj.isRemote) living.attackEntityFrom(DamageSource.magic, damage); } } diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ManasteelToolCommons.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ManasteelToolCommons.java index 05b5e7e9b..1357ce668 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ManasteelToolCommons.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ManasteelToolCommons.java @@ -23,8 +23,7 @@ public final class ManasteelToolCommons { int manaRequested = entity instanceof EntityPlayer ? ManaItemHandler.requestMana(stack, (EntityPlayer) entity, manaToRequest, true) : 0; int finalDamage = dmg - manaRequested / manaPerDamage; - if (finalDamage > 0) - stack.damageItem(finalDamage, entity); + if(finalDamage > 0) stack.damageItem(finalDamage, entity); } } diff --git a/MODSRC/vazkii/botania/common/lexicon/BLexiconEntry.java b/MODSRC/vazkii/botania/common/lexicon/BLexiconEntry.java index a250b38e0..8c6cadc9f 100644 --- a/MODSRC/vazkii/botania/common/lexicon/BLexiconEntry.java +++ b/MODSRC/vazkii/botania/common/lexicon/BLexiconEntry.java @@ -25,7 +25,7 @@ public class BLexiconEntry extends LexiconEntry { @Override public LexiconEntry setLexiconPages(LexiconPage... pages) { - for (LexiconPage page : pages) + for(LexiconPage page : pages) page.unlocalizedName = "botania.page." + getLazyUnlocalizedName() + page.unlocalizedName; return super.setLexiconPages(pages); diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index 8bb342fb1..a3a9aecb3 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -113,8 +113,7 @@ public final class LexiconData { // BASICS ENTRIES flowers = new BLexiconEntry(LibLexicon.BASICS_FLOWERS, categoryBasics); - flowers.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_FLOWERS), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipesPetals), new PageCraftingRecipe("4", ModCrafingRecipes.recipePestleAndMortar), new PageCraftingRecipe("5", ModCrafingRecipes.recipesDyes), - new PageText("6"), new PageCraftingRecipe("7", ModCrafingRecipes.recipeFertilizerPowder), new PageCraftingRecipe("8", ModCrafingRecipes.recipeFerilizerDye)); + flowers.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_FLOWERS), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipesPetals), new PageCraftingRecipe("4", ModCrafingRecipes.recipePestleAndMortar), new PageCraftingRecipe("5", ModCrafingRecipes.recipesDyes), new PageText("6"), new PageCraftingRecipe("7", ModCrafingRecipes.recipeFertilizerPowder), new PageCraftingRecipe("8", ModCrafingRecipes.recipeFerilizerDye)); apothecary = new BLexiconEntry(LibLexicon.BASICS_APOTHECARY, categoryBasics); apothecary.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_APOTHECARY), new PageText("2"), new PageText("3"), new PageCraftingRecipe("4", ModCrafingRecipes.recipesApothecary)); @@ -131,9 +130,7 @@ public final class LexiconData { LexiconRecipeMappings.map(new ItemStack(ModBlocks.livingrock), pureDaisy, 1); runicAltar = new BLexiconEntry(LibLexicon.BASICS_RUNE_ALTAR, categoryBasics); - runicAltar.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipesRuneAltar), new PageText("3"), new PageRuneRecipe("4", ModRuneRecipes.recipeWaterRune), new PageRuneRecipe("5", ModRuneRecipes.recipesEarthRune), new PageRuneRecipe("6", ModRuneRecipes.recipeAirRune), new PageRuneRecipe("7", ModRuneRecipes.recipeFireRune), - new PageRuneRecipe("8", ModRuneRecipes.recipeSpringRune), new PageRuneRecipe("9", ModRuneRecipes.recipeSummerRune), new PageRuneRecipe("10", ModRuneRecipes.recipeAutumnRune), new PageRuneRecipe("11", ModRuneRecipes.recipeWinterRune), new PageRuneRecipe("12", ModRuneRecipes.recipeManaRune), - new PageRuneRecipe("13", ModRuneRecipes.recipeLustRune), new PageRuneRecipe("14", ModRuneRecipes.recipeGluttonyRune), new PageRuneRecipe("15", ModRuneRecipes.recipeGreedRune), new PageRuneRecipe("16", ModRuneRecipes.recipeSlothRune), new PageRuneRecipe("17", ModRuneRecipes.recipeWrathRune), new PageRuneRecipe("18", ModRuneRecipes.recipeEnvyRune), new PageRuneRecipe("19", ModRuneRecipes.recipePrideRune)); + runicAltar.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipesRuneAltar), new PageText("3"), new PageRuneRecipe("4", ModRuneRecipes.recipeWaterRune), new PageRuneRecipe("5", ModRuneRecipes.recipesEarthRune), new PageRuneRecipe("6", ModRuneRecipes.recipeAirRune), new PageRuneRecipe("7", ModRuneRecipes.recipeFireRune), new PageRuneRecipe("8", ModRuneRecipes.recipeSpringRune), new PageRuneRecipe("9", ModRuneRecipes.recipeSummerRune), new PageRuneRecipe("10", ModRuneRecipes.recipeAutumnRune), new PageRuneRecipe("11", ModRuneRecipes.recipeWinterRune), new PageRuneRecipe("12", ModRuneRecipes.recipeManaRune), new PageRuneRecipe("13", ModRuneRecipes.recipeLustRune), new PageRuneRecipe("14", ModRuneRecipes.recipeGluttonyRune), new PageRuneRecipe("15", ModRuneRecipes.recipeGreedRune), new PageRuneRecipe("16", ModRuneRecipes.recipeSlothRune), new PageRuneRecipe("17", ModRuneRecipes.recipeWrathRune), new PageRuneRecipe("18", ModRuneRecipes.recipeEnvyRune), new PageRuneRecipe("19", ModRuneRecipes.recipePrideRune)); terrasteel = new BLexiconEntry(LibLexicon.BASICS_TERRASTEEL, categoryBasics); terrasteel.setLexiconPages(new PageText("0"), new PageTerrasteel("1")); @@ -188,8 +185,7 @@ public final class LexiconData { manaVoid.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManaVoid)); manaTransport = new BLexiconEntry(LibLexicon.MANA_TRANSPORT, categoryMana); - manaTransport.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipesManaTablet), - new PageText("3"), new PageCraftingRecipe("4", ModCrafingRecipes.recipeManaMirror)); + manaTransport.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipesManaTablet), new PageText("3"), new PageCraftingRecipe("4", ModCrafingRecipes.recipeManaMirror)); manaDetector = new BLexiconEntry(LibLexicon.MANA_DETECTOR, categoryMana); manaDetector.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManaDetector)); @@ -267,9 +263,7 @@ 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"), - 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")); + 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)); @@ -288,9 +282,7 @@ public final class LexiconData { terraformRod.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeTerraformRod)); manasteelGear = new BLexiconEntry(LibLexicon.TOOL_MANASTEEL_GEAR, categoryTools); - manasteelGear.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManasteelPick), new PageCraftingRecipe("2", ModCrafingRecipes.recipeManasteelShovel), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManasteelAxe), - new PageCraftingRecipe("4", ModCrafingRecipes.recipeManasteelShears), new PageCraftingRecipe("5", ModCrafingRecipes.recipeManasteelSword), - new PageCraftingRecipe("6", ModCrafingRecipes.recipeManasteelHelm), new PageCraftingRecipe("7", ModCrafingRecipes.recipeManasteelChest), new PageCraftingRecipe("8", ModCrafingRecipes.recipeManasteelLegs), new PageCraftingRecipe("9", ModCrafingRecipes.recipeManasteelBoots)); + manasteelGear.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManasteelPick), new PageCraftingRecipe("2", ModCrafingRecipes.recipeManasteelShovel), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManasteelAxe), new PageCraftingRecipe("4", ModCrafingRecipes.recipeManasteelShears), new PageCraftingRecipe("5", ModCrafingRecipes.recipeManasteelSword), new PageCraftingRecipe("6", ModCrafingRecipes.recipeManasteelHelm), new PageCraftingRecipe("7", ModCrafingRecipes.recipeManasteelChest), new PageCraftingRecipe("8", ModCrafingRecipes.recipeManasteelLegs), new PageCraftingRecipe("9", ModCrafingRecipes.recipeManasteelBoots)); terrasteelArmor = new BLexiconEntry(LibLexicon.TOOL_TERRASTEEL_ARMOR, categoryTools); terrasteelArmor.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTerrasteelHelm), new PageCraftingRecipe("2", ModCrafingRecipes.recipeTerrasteelChest), new PageCraftingRecipe("3", ModCrafingRecipes.recipeTerrasteelLegs), new PageCraftingRecipe("4", ModCrafingRecipes.recipeTerrasteelBoots)); @@ -306,7 +298,6 @@ public final class LexiconData { 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)); decorativeBlocks = new BLexiconEntry(LibLexicon.MISC_DECORATIVE_BLOCKS, categoryMisc); - decorativeBlocks.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLivingrockDecor1), new PageCraftingRecipe("2", ModCrafingRecipes.recipeLivingrockDecor2), new PageCraftingRecipe("3", ModCrafingRecipes.recipeLivingrockDecor3), new PageCraftingRecipe("4", ModCrafingRecipes.recipeLivingrockDecor4), - new PageCraftingRecipe("5", ModCrafingRecipes.recipeLivingwoodDecor1), new PageCraftingRecipe("6", ModCrafingRecipes.recipeLivingwoodDecor2), new PageCraftingRecipe("7", ModCrafingRecipes.recipeLivingwoodDecor3), new PageCraftingRecipe("8", ModCrafingRecipes.recipeLivingwoodDecor4), new PageCraftingRecipe("9", ModCrafingRecipes.recipeLivingwoodDecor5)); + decorativeBlocks.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLivingrockDecor1), new PageCraftingRecipe("2", ModCrafingRecipes.recipeLivingrockDecor2), new PageCraftingRecipe("3", ModCrafingRecipes.recipeLivingrockDecor3), new PageCraftingRecipe("4", ModCrafingRecipes.recipeLivingrockDecor4), new PageCraftingRecipe("5", ModCrafingRecipes.recipeLivingwoodDecor1), new PageCraftingRecipe("6", ModCrafingRecipes.recipeLivingwoodDecor2), new PageCraftingRecipe("7", ModCrafingRecipes.recipeLivingwoodDecor3), new PageCraftingRecipe("8", ModCrafingRecipes.recipeLivingwoodDecor4), new PageCraftingRecipe("9", ModCrafingRecipes.recipeLivingwoodDecor5)); } } diff --git a/MODSRC/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java b/MODSRC/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java index e5b545457..071483a21 100644 --- a/MODSRC/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java +++ b/MODSRC/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java @@ -57,7 +57,7 @@ public class PageCraftingRecipe extends PageRecipe { @Override public void onPageAdded(LexiconEntry entry, int index) { - for (IRecipe recipe : recipes) + for(IRecipe recipe : recipes) LexiconRecipeMappings.map(recipe.getRecipeOutput(), entry, index); } @@ -84,10 +84,10 @@ public class PageCraftingRecipe extends PageRecipe { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - if (shapelessRecipe) { + if(shapelessRecipe) { ((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 0, 16, 16); - if (mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) + if(mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) RenderHelper.renderTooltip(mx, my, Arrays.asList(StatCollector.translateToLocal("botaniamisc.shapeless"))); iconY += 20; @@ -96,10 +96,10 @@ public class PageCraftingRecipe extends PageRecipe { render.bindTexture(craftingOverlay); GL11.glEnable(GL11.GL_BLEND); - if (oreDictRecipe) { + if(oreDictRecipe) { ((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 16, 16, 16); - if (mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) + if(mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) RenderHelper.renderTooltip(mx, my, Arrays.asList(StatCollector.translateToLocal("botaniamisc.oredict"))); } GL11.glDisable(GL11.GL_BLEND); @@ -108,67 +108,64 @@ public class PageCraftingRecipe extends PageRecipe { @Override @SideOnly(Side.CLIENT) public void updateScreen() { - if (ticksElapsed % 20 == 0) { + if(ticksElapsed % 20 == 0) { recipeAt++; - if (recipeAt == recipes.size()) - recipeAt = 0; + if(recipeAt == recipes.size()) recipeAt = 0; } ++ticksElapsed; } @SideOnly(Side.CLIENT) public void renderCraftingRecipe(IGuiLexiconEntry gui, IRecipe recipe) { - if (recipe instanceof ShapedRecipes) { + if(recipe instanceof ShapedRecipes) { ShapedRecipes shaped = (ShapedRecipes) recipe; - for (int y = 0; y < shaped.recipeHeight; y++) - for (int x = 0; x < shaped.recipeWidth; x++) + for(int y = 0; y < shaped.recipeHeight; y++) + for(int x = 0; x < shaped.recipeWidth; x++) renderItemAtGridPos(gui, 1 + x, 1 + y, shaped.recipeItems[y * shaped.recipeWidth + x], true); - } else if (recipe instanceof ShapedOreRecipe) { + } else if(recipe instanceof ShapedOreRecipe) { ShapedOreRecipe shaped = (ShapedOreRecipe) recipe; int width = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 4); int height = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 5); - for (int y = 0; y < height; y++) - for (int x = 0; x < width; x++) { + for(int y = 0; y < height; y++) + for(int x = 0; x < width; x++) { Object input = shaped.getInput()[y * width + x]; - if (input != null) + if(input != null) renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((ArrayList) input).get(0), true); } oreDictRecipe = true; - } else if (recipe instanceof ShapelessRecipes) { + } else if(recipe instanceof ShapelessRecipes) { ShapelessRecipes shapeless = (ShapelessRecipes) recipe; drawGrid: { - for (int y = 0; y < 3; y++) - for (int x = 0; x < 3; x++) { + for(int y = 0; y < 3; y++) + for(int x = 0; x < 3; x++) { int index = y * 3 + x; - if (index >= shapeless.recipeItems.size()) - break drawGrid; + if(index >= shapeless.recipeItems.size()) break drawGrid; renderItemAtGridPos(gui, 1 + x, 1 + y, (ItemStack) shapeless.recipeItems.get(index), true); } } shapelessRecipe = true; - } else if (recipe instanceof ShapelessOreRecipe) { + } else if(recipe instanceof ShapelessOreRecipe) { ShapelessOreRecipe shapeless = (ShapelessOreRecipe) recipe; drawGrid: { - for (int y = 0; y < 3; y++) - for (int x = 0; x < 3; x++) { + for(int y = 0; y < 3; y++) + for(int x = 0; x < 3; x++) { int index = y * 3 + x; - if (index >= shapeless.getRecipeSize()) - break drawGrid; + if(index >= shapeless.getRecipeSize()) break drawGrid; Object input = shapeless.getInput().get(index); - if (input != null) + if(input != null) renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((ArrayList) input).get(0), true); } } diff --git a/MODSRC/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java b/MODSRC/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java index b6306cfa0..ab9a7c868 100644 --- a/MODSRC/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java +++ b/MODSRC/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java @@ -53,7 +53,7 @@ public class PageManaInfusionRecipe extends PageRecipe { @Override public void onPageAdded(LexiconEntry entry, int index) { - for (RecipeManaInfusion recipe : recipes) + for(RecipeManaInfusion recipe : recipes) LexiconRecipeMappings.map(recipe.getOutput(), entry, index); } @@ -65,8 +65,7 @@ public class PageManaInfusionRecipe extends PageRecipe { FontRenderer font = Minecraft.getMinecraft().fontRenderer; Object input = recipe.getInput(); - if (input instanceof String) - input = OreDictionary.getOres((String) input).get(0); + if(input instanceof String) input = OreDictionary.getOres((String) input).get(0); renderItemAtGridPos(gui, 1, 1, (ItemStack) input, false); renderItemAtGridPos(gui, 2, 1, new ItemStack(ModBlocks.pool), false); @@ -92,11 +91,10 @@ public class PageManaInfusionRecipe extends PageRecipe { @Override @SideOnly(Side.CLIENT) public void updateScreen() { - if (ticksElapsed % 20 == 0) { + if(ticksElapsed % 20 == 0) { recipeAt++; - if (recipeAt == recipes.size()) - recipeAt = 0; + if(recipeAt == recipes.size()) recipeAt = 0; } ++ticksElapsed; } diff --git a/MODSRC/vazkii/botania/common/lexicon/page/PagePetalRecipe.java b/MODSRC/vazkii/botania/common/lexicon/page/PagePetalRecipe.java index b97b69536..7cc12c751 100644 --- a/MODSRC/vazkii/botania/common/lexicon/page/PagePetalRecipe.java +++ b/MODSRC/vazkii/botania/common/lexicon/page/PagePetalRecipe.java @@ -50,7 +50,7 @@ public class PagePetalRecipe extends PageRecipe { @Override public void onPageAdded(LexiconEntry entry, int index) { - for (T recipe : recipes) + for(T recipe : recipes) LexiconRecipeMappings.map(recipe.getOutput(), entry, index); } @@ -67,10 +67,9 @@ public class PagePetalRecipe extends PageRecipe { int degreePerInput = (int) (360F / inputs.size()); int currentDegree = ConfigHandler.lexiconRotatingItems ? (int) Minecraft.getMinecraft().theWorld.getTotalWorldTime() : 0; - for (Object obj : inputs) { + for(Object obj : inputs) { Object input = obj; - if (input instanceof String) - input = OreDictionary.getOres((String) input).get(0); + if(input instanceof String) input = OreDictionary.getOres((String) input).get(0); renderItemAtAngle(gui, currentDegree, (ItemStack) input); @@ -100,11 +99,10 @@ public class PagePetalRecipe extends PageRecipe { @Override @SideOnly(Side.CLIENT) public void updateScreen() { - if (ticksElapsed % 20 == 0) { + if(ticksElapsed % 20 == 0) { recipeAt++; - if (recipeAt == recipes.size()) - recipeAt = 0; + if(recipeAt == recipes.size()) recipeAt = 0; } ++ticksElapsed; } diff --git a/MODSRC/vazkii/botania/common/lexicon/page/PageRecipe.java b/MODSRC/vazkii/botania/common/lexicon/page/PageRecipe.java index 593b2652d..894b52232 100644 --- a/MODSRC/vazkii/botania/common/lexicon/page/PageRecipe.java +++ b/MODSRC/vazkii/botania/common/lexicon/page/PageRecipe.java @@ -59,18 +59,18 @@ public class PageRecipe extends LexiconPage { int y = gui.getTop() + height - 40; PageText.renderText(x, y, width, height, getUnlocalizedName()); - if (tooltipStack != null) { + if(tooltipStack != null) { List tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); RenderHelper.renderTooltip(mx, my, tooltipData); int tooltipY = 8 + tooltipData.size() * 11; - if (tooltipEntry) { + if(tooltipEntry) { RenderHelper.renderTooltipOrange(mx, my + tooltipY, Arrays.asList(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.clickToRecipe"))); tooltipY += 18; } - if (tooltipContainerStack != null) + if(tooltipContainerStack != null) RenderHelper.renderTooltipGreen(mx, my + tooltipY, Arrays.asList(EnumChatFormatting.AQUA + StatCollector.translateToLocal("botaniamisc.craftingContainer"), tooltipContainerStack.getDisplayName())); } @@ -86,38 +86,32 @@ public class PageRecipe extends LexiconPage { @SideOnly(Side.CLIENT) public void renderItemAtAngle(IGuiLexiconEntry gui, int angle, ItemStack stack) { - if (stack == null || stack.getItem() == null) - return; + if(stack == null || stack.getItem() == null) return; stack = stack.copy(); - if (stack.getItemDamage() == Short.MAX_VALUE) - stack.setItemDamage(0); + if(stack.getItemDamage() == Short.MAX_VALUE) stack.setItemDamage(0); angle -= 90; int radius = 32; double xPos = gui.getLeft() + Math.cos(angle * Math.PI / 180D) * radius + gui.getWidth() / 2 - 8; double yPos = gui.getTop() + Math.sin(angle * Math.PI / 180D) * radius + 53; ItemStack stack1 = stack.copy(); - if (stack1.getItemDamage() == -1) - stack1.setItemDamage(0); + if(stack1.getItemDamage() == -1) stack1.setItemDamage(0); renderItem(gui, (int) xPos, (int) yPos, stack1, false); } @SideOnly(Side.CLIENT) public void renderItemAtGridPos(IGuiLexiconEntry gui, int x, int y, ItemStack stack, boolean accountForContainer) { - if (stack == null || stack.getItem() == null) - return; + if(stack == null || stack.getItem() == null) return; stack = stack.copy(); - if (stack.getItemDamage() == Short.MAX_VALUE) - stack.setItemDamage(0); + if(stack.getItemDamage() == Short.MAX_VALUE) stack.setItemDamage(0); int xPos = gui.getLeft() + x * 29 + 7 + (y == 0 && x == 3 ? 10 : 0); int yPos = gui.getTop() + y * 29 + 24 - (y == 0 ? 7 : 0); ItemStack stack1 = stack.copy(); - if (stack1.getItemDamage() == -1) - stack1.setItemDamage(0); + if(stack1.getItemDamage() == -1) stack1.setItemDamage(0); renderItem(gui, xPos, yPos, stack1, accountForContainer); } @@ -130,19 +124,19 @@ public class PageRecipe extends LexiconPage { // Translations required so the glint doesn't merge with the book texture GL11.glTranslatef(0F, 0F, 200F); - if (!ForgeHooksClient.renderInventoryItem(new RenderBlocks(), renderEngine, stack, render.renderWithColor, gui.getZLevel(), xPos, yPos)) + if(!ForgeHooksClient.renderInventoryItem(new RenderBlocks(), renderEngine, stack, render.renderWithColor, gui.getZLevel(), xPos, yPos)) render.renderItemIntoGUI(fontRenderer, renderEngine, stack, xPos, yPos); render.renderItemOverlayIntoGUI(fontRenderer, renderEngine, stack, xPos, yPos); GL11.glTranslatef(0F, 0F, -200F); - if (relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) { + if(relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) { tooltipStack = stack; EntryData data = LexiconRecipeMappings.getDataForStack(tooltipStack); - if (data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn())) { + if(data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn())) { tooltipEntry = true; - if (Mouse.isButtonDown(0) && GuiScreen.isShiftKeyDown()) { + if(Mouse.isButtonDown(0) && GuiScreen.isShiftKeyDown()) { GuiLexiconEntry newGui = new GuiLexiconEntry(data.entry, (GuiScreen) gui); newGui.page = data.page; Minecraft.getMinecraft().displayGuiScreen(newGui); @@ -150,10 +144,9 @@ public class PageRecipe extends LexiconPage { } - if (accountForContainer) { + if(accountForContainer) { ItemStack containerStack = stack.getItem().getContainerItem(stack); - if (containerStack != null && containerStack.getItem() != null) - tooltipContainerStack = containerStack; + if(containerStack != null && containerStack.getItem() != null) tooltipContainerStack = containerStack; } } diff --git a/MODSRC/vazkii/botania/common/lexicon/page/PageTerrasteel.java b/MODSRC/vazkii/botania/common/lexicon/page/PageTerrasteel.java index d81920581..51b990b66 100644 --- a/MODSRC/vazkii/botania/common/lexicon/page/PageTerrasteel.java +++ b/MODSRC/vazkii/botania/common/lexicon/page/PageTerrasteel.java @@ -33,9 +33,7 @@ public class PageTerrasteel extends PageRecipe { int ticksElapsed = 0; int index = 0; - static final Block[] blocks = new Block[]{ - Blocks.iron_block, Blocks.gold_block, Blocks.emerald_block, Blocks.diamond_block - }; + static final Block[] blocks = new Block[]{Blocks.iron_block, Blocks.gold_block, Blocks.emerald_block, Blocks.diamond_block}; public PageTerrasteel(String unlocalizedName) { super(unlocalizedName); @@ -86,11 +84,10 @@ public class PageTerrasteel extends PageRecipe { @Override @SideOnly(Side.CLIENT) public void updateScreen() { - if (ticksElapsed % 20 == 0) { + if(ticksElapsed % 20 == 0) { index++; - if (index == blocks.length) - index = 0; + if(index == blocks.length) index = 0; } ++ticksElapsed; } diff --git a/MODSRC/vazkii/botania/common/lexicon/page/PageText.java b/MODSRC/vazkii/botania/common/lexicon/page/PageText.java index c56874831..f95d6995d 100644 --- a/MODSRC/vazkii/botania/common/lexicon/page/PageText.java +++ b/MODSRC/vazkii/botania/common/lexicon/page/PageText.java @@ -50,44 +50,42 @@ public class PageText extends LexiconPage { String lastFormat = ""; String pendingFormat = ""; - for (String s : textEntries) { + for(String s : textEntries) { List wrappedLines = new ArrayList(); String workingOn = ""; int i = 0; String[] tokens = s.split(" "); - for (String s1 : tokens) { + for(String s1 : tokens) { boolean skipPending = false; String format = FontHelper.getFormatFromString(s1); - if (!format.isEmpty() && s1.length() > 0 && s1.charAt(0) != '\u00a7') { + if(!format.isEmpty() && s1.length() > 0 && s1.charAt(0) != '\u00a7') { skipPending = true; pendingFormat = format; format = ""; } - if (!pendingFormat.isEmpty() && !skipPending) { + if(!pendingFormat.isEmpty() && !skipPending) { format = pendingFormat; pendingFormat = ""; } - if (MathHelper.stringNullOrLengthZero(format)) - format = lastFormat; + if(MathHelper.stringNullOrLengthZero(format)) format = lastFormat; - if (renderer.getStringWidth(workingOn + " " + s1) >= width) { + if(renderer.getStringWidth(workingOn + " " + s1) >= width) { wrappedLines.add(workingOn); workingOn = ""; } workingOn = workingOn + format + " " + s1; - if (i == tokens.length - 1) - wrappedLines.add(workingOn); + if(i == tokens.length - 1) wrappedLines.add(workingOn); ++i; lastFormat = format; } - for (String s1 : wrappedLines) { + for(String s1 : wrappedLines) { y += 10; renderer.drawString(s1, x, y, 0); } diff --git a/MODSRC/vazkii/botania/common/lib/LibItemNames.java b/MODSRC/vazkii/botania/common/lib/LibItemNames.java index 7c41b3a9c..0bf08fe40 100644 --- a/MODSRC/vazkii/botania/common/lib/LibItemNames.java +++ b/MODSRC/vazkii/botania/common/lib/LibItemNames.java @@ -50,26 +50,7 @@ public final class LibItemNames { public static final String TERRA_SWORD = LibResources.PREFIX_MOD + "terraSword"; public static final String TEST = LibResources.PREFIX_MOD + "ring"; - public static final String[] LENS_NAMES = new String[]{ - LibResources.PREFIX_MOD + "lensNormal", - LibResources.PREFIX_MOD + "lensSpeed", - LibResources.PREFIX_MOD + "lensPower", - LibResources.PREFIX_MOD + "lensTime", - LibResources.PREFIX_MOD + "lensEfficiency", - LibResources.PREFIX_MOD + "lensBounce", - LibResources.PREFIX_MOD + "lensGravity", - LibResources.PREFIX_MOD + "lensMine", - LibResources.PREFIX_MOD + "lensDamage", - LibResources.PREFIX_MOD + "lensPhantom", - LibResources.PREFIX_MOD + "lensMagnet", - LibResources.PREFIX_MOD + "lensExplosive" - }; + public static final String[] LENS_NAMES = new String[]{LibResources.PREFIX_MOD + "lensNormal", LibResources.PREFIX_MOD + "lensSpeed", LibResources.PREFIX_MOD + "lensPower", LibResources.PREFIX_MOD + "lensTime", LibResources.PREFIX_MOD + "lensEfficiency", LibResources.PREFIX_MOD + "lensBounce", LibResources.PREFIX_MOD + "lensGravity", LibResources.PREFIX_MOD + "lensMine", LibResources.PREFIX_MOD + "lensDamage", LibResources.PREFIX_MOD + "lensPhantom", LibResources.PREFIX_MOD + "lensMagnet", LibResources.PREFIX_MOD + "lensExplosive"}; - public static final String[] MANA_RESOURCE_NAMES = new String[]{ - LibResources.PREFIX_MOD + "manasteel", - LibResources.PREFIX_MOD + "manaPearl", - LibResources.PREFIX_MOD + "manaDiamond", - LibResources.PREFIX_MOD + "livingwoodTwig", - LibResources.PREFIX_MOD + "terrasteel" - }; + public static final String[] MANA_RESOURCE_NAMES = new String[]{LibResources.PREFIX_MOD + "manasteel", LibResources.PREFIX_MOD + "manaPearl", LibResources.PREFIX_MOD + "manaDiamond", LibResources.PREFIX_MOD + "livingwoodTwig", LibResources.PREFIX_MOD + "terrasteel"}; } diff --git a/MODSRC/vazkii/botania/common/lib/LibOreDict.java b/MODSRC/vazkii/botania/common/lib/LibOreDict.java index f25066c47..a47d883f4 100644 --- a/MODSRC/vazkii/botania/common/lib/LibOreDict.java +++ b/MODSRC/vazkii/botania/common/lib/LibOreDict.java @@ -24,23 +24,13 @@ public final class LibOreDict { public static final String LIVINGWOOD_TWIG = "livingwoodTwig"; public static final String TERRA_STEEL = "ingotTerrasteel"; - public static final String[] FLOWER = new String[]{ - "mysticFlowerWhite", "mysticFlowerOrange", "mysticFlowerMagenta", "mysticFlowerLightBlue", "mysticFlowerYellow", "mysticFlowerLime", "mysticFlowerPink", "mysticFlowerGray", "mysticFlowerLightGray", "mysticFlowerCyan", "mysticFlowerPurple", "mysticFlowerBlue", "mysticFlowerBrown", "mysticFlowerGreen", "mysticFlowerRed", "mysticFlowerBlack", - }; + public static final String[] FLOWER = new String[]{"mysticFlowerWhite", "mysticFlowerOrange", "mysticFlowerMagenta", "mysticFlowerLightBlue", "mysticFlowerYellow", "mysticFlowerLime", "mysticFlowerPink", "mysticFlowerGray", "mysticFlowerLightGray", "mysticFlowerCyan", "mysticFlowerPurple", "mysticFlowerBlue", "mysticFlowerBrown", "mysticFlowerGreen", "mysticFlowerRed", "mysticFlowerBlack",}; - public static final String[] PETAL = new String[]{ - "petalWhite", "petalOrange", "petalMagenta", "petalLightBlue", "petalYellow", "petalLime", "petalPink", "petalGray", "petalLightGray", "petalCyan", "petalPurple", "petalBlue", "petalBrown", "petalGreen", "petalRed", "petalBlack", - }; + public static final String[] PETAL = new String[]{"petalWhite", "petalOrange", "petalMagenta", "petalLightBlue", "petalYellow", "petalLime", "petalPink", "petalGray", "petalLightGray", "petalCyan", "petalPurple", "petalBlue", "petalBrown", "petalGreen", "petalRed", "petalBlack",}; - public static final String[] DYE = new String[]{ - "dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", - }; + public static final String[] DYE = new String[]{"dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack",}; - public static final String[] MANA_PETAL = new String[]{ - "manaPetalWhite", "manaPetalOrange", "manaPetalMagenta", "manaPetalLightBlue", "manaPetalYellow", "manaPetalLime", "manaPetalPink", "manaPetalGray", "manaPetalLightGray", "manaPetalCyan", "manaPetalPurple", "manaPetalBlue", "manaPetalBrown", "manaPetalGreen", "manaPetalRed", "manaPetalBlack", - }; + public static final String[] MANA_PETAL = new String[]{"manaPetalWhite", "manaPetalOrange", "manaPetalMagenta", "manaPetalLightBlue", "manaPetalYellow", "manaPetalLime", "manaPetalPink", "manaPetalGray", "manaPetalLightGray", "manaPetalCyan", "manaPetalPurple", "manaPetalBlue", "manaPetalBrown", "manaPetalGreen", "manaPetalRed", "manaPetalBlack",}; - public static final String[] RUNE = new String[]{ - "runeWaterB", "runeFireB", "runeEarthB", "runeAirB", "runeSpringB", "runeSummerB", "runeAutumnB", "runeWinterB", "runeManaB", "runeLustB", "runeGluttonyB", "runeGreedB", "runeSlothB", "runeWrathB", "runeEnvyB", "runePrideB" - }; + public static final String[] RUNE = new String[]{"runeWaterB", "runeFireB", "runeEarthB", "runeAirB", "runeSpringB", "runeSummerB", "runeAutumnB", "runeWinterB", "runeManaB", "runeLustB", "runeGluttonyB", "runeGreedB", "runeSlothB", "runeWrathB", "runeEnvyB", "runePrideB"}; } diff --git a/MODSRC/vazkii/botania/common/network/GuiHandler.java b/MODSRC/vazkii/botania/common/network/GuiHandler.java index 4b81a154c..d5e7ff432 100644 --- a/MODSRC/vazkii/botania/common/network/GuiHandler.java +++ b/MODSRC/vazkii/botania/common/network/GuiHandler.java @@ -26,7 +26,7 @@ public class GuiHandler implements IGuiHandler { @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID) { + switch(ID) { case LibGuiIDs.LEXICON: return GuiLexicon.currentOpenLexicon; } diff --git a/idea/settings.jar b/idea/settings.jar index 898b6081a..2b45da1fb 100644 Binary files a/idea/settings.jar and b/idea/settings.jar differ