From fd1a411bfe1a9676527c07e75bcd9726a9de64de Mon Sep 17 00:00:00 2001 From: Lizbeth Rika Date: Thu, 31 Jul 2014 22:58:23 +0100 Subject: [PATCH] Cleanup... --- .../helper/TransientScaledResolution.java | 63 ------------------- .../botania/common/block/BlockEnderEye.java | 8 +-- .../common/block/BlockSpawnerClaw.java | 2 +- .../botania/common/block/ModBlocks.java | 2 +- .../common/block/tile/TileEnderEye.java | 10 +-- .../common/core/handler/ConfigHandler.java | 2 +- .../core/handler/SpawnerChangingHandler.java | 4 +- .../common/crafting/ModCrafingRecipes.java | 14 ++--- .../botania/common/entity/EntityPixie.java | 2 +- .../botania/common/item/ItemEnderHand.java | 2 +- .../item/equipment/bauble/ItemItemFinder.java | 20 +++--- .../equipment/bauble/ItemLavaPendant.java | 3 - .../item/equipment/tool/ToolCommons.java | 1 - .../tool/elementium/ItemElementiumShears.java | 1 + .../botania/common/lexicon/LexiconData.java | 10 +-- .../botania/common/lib/LibObfuscation.java | 2 +- 16 files changed, 39 insertions(+), 107 deletions(-) delete mode 100644 MODSRC/vazkii/botania/client/core/helper/TransientScaledResolution.java diff --git a/MODSRC/vazkii/botania/client/core/helper/TransientScaledResolution.java b/MODSRC/vazkii/botania/client/core/helper/TransientScaledResolution.java deleted file mode 100644 index 1438ab9cc..000000000 --- a/MODSRC/vazkii/botania/client/core/helper/TransientScaledResolution.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Jul 11, 2014, 2:18:35 PM (GMT)] - */ -package vazkii.botania.client.core.helper; - -import net.minecraft.client.settings.GameSettings; -import net.minecraft.util.MathHelper; - -// Copy of ScaledResolution with 1.7.2 and 1.7.10 support. Will drop once 1.7.10 is in full use -public class TransientScaledResolution { - - private int scaledWidth; - private int scaledHeight; - private double scaledWidthD; - private double scaledHeightD; - private int scaleFactor; - - public TransientScaledResolution(GameSettings par1GameSettings, int par2, int par3) { - scaledWidth = par2; - scaledHeight = par3; - scaleFactor = 1; - int k = par1GameSettings.guiScale; - - if (k == 0) - k = 1000; - - while (scaleFactor < k && scaledWidth / (scaleFactor + 1) >= 320 && scaledHeight / (scaleFactor + 1) >= 240) - ++scaleFactor; - - scaledWidthD = (double)scaledWidth / (double)scaleFactor; - scaledHeightD = (double)scaledHeight / (double)scaleFactor; - scaledWidth = MathHelper.ceiling_double_int(scaledWidthD); - scaledHeight = MathHelper.ceiling_double_int(scaledHeightD); - } - - public int getScaledWidth() { - return scaledWidth; - } - - public int getScaledHeight() { - return scaledHeight; - } - - public double getScaledWidth_double() { - return scaledWidthD; - } - - public double getScaledHeight_double() { - return scaledHeightD; - } - - public int getScaleFactor() { - return scaleFactor; - } -} \ No newline at end of file diff --git a/MODSRC/vazkii/botania/common/block/BlockEnderEye.java b/MODSRC/vazkii/botania/common/block/BlockEnderEye.java index 4930ea779..ff6fe3aae 100644 --- a/MODSRC/vazkii/botania/common/block/BlockEnderEye.java +++ b/MODSRC/vazkii/botania/common/block/BlockEnderEye.java @@ -29,7 +29,7 @@ import vazkii.botania.common.lib.LibBlockNames; public class BlockEnderEye extends BlockModContainer implements ILexiconable { IIcon iconOff, iconOn; - + protected BlockEnderEye() { super(Material.iron); setHardness(3F); @@ -43,17 +43,17 @@ public class BlockEnderEye extends BlockModContainer implements ILexiconable { iconOff = IconHelper.forBlock(par1IconRegister, this, 0); iconOn = IconHelper.forBlock(par1IconRegister, this, 1); } - + @Override public IIcon getIcon(int side, int meta) { return meta == 0 ? iconOff : iconOn; } - + @Override public boolean canProvidePower() { return true; } - + @Override public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { return world.getBlockMetadata(x, y, z); diff --git a/MODSRC/vazkii/botania/common/block/BlockSpawnerClaw.java b/MODSRC/vazkii/botania/common/block/BlockSpawnerClaw.java index 7707cf879..d1a4d7a31 100644 --- a/MODSRC/vazkii/botania/common/block/BlockSpawnerClaw.java +++ b/MODSRC/vazkii/botania/common/block/BlockSpawnerClaw.java @@ -46,7 +46,7 @@ public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable list.add(new ItemStack(item)); list.add(new ItemStack(Blocks.mob_spawner)); } - + @Override public void registerBlockIcons(IIconRegister par1IconRegister) { //NO-OP diff --git a/MODSRC/vazkii/botania/common/block/ModBlocks.java b/MODSRC/vazkii/botania/common/block/ModBlocks.java index d61d895f7..04b2903a4 100644 --- a/MODSRC/vazkii/botania/common/block/ModBlocks.java +++ b/MODSRC/vazkii/botania/common/block/ModBlocks.java @@ -284,7 +284,7 @@ public final class ModBlocks { thatch = new BlockThatch(); customBrick = new BlockCustomBrick(); enderEye = new BlockEnderEye(); - + livingwoodStairs = new BlockLivingwoodStairs(); livingwoodSlab = new BlockLivingwoodSlab(false); livingwoodSlabFull = new BlockLivingwoodSlab(true); diff --git a/MODSRC/vazkii/botania/common/block/tile/TileEnderEye.java b/MODSRC/vazkii/botania/common/block/tile/TileEnderEye.java index 13e7ae835..61b8a2bdd 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileEnderEye.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileEnderEye.java @@ -27,27 +27,27 @@ public class TileEnderEye extends TileMod { public void updateEntity() { if(worldObj.isRemote) return; - + int meta = getBlockMetadata(); int range = 80; List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range, yCoord + range, zCoord + range)); - + boolean looking = false; for(EntityPlayer player : players) { ItemStack helm = player.getCurrentArmor(3); if(helm != null && helm.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) continue; - + MovingObjectPosition pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64); if(pos != null && pos.blockX == xCoord && pos.blockY == yCoord && pos.blockZ == zCoord) { looking = true; break; } } - + int newMeta = looking ? 15 : 0; if(newMeta != meta) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2); } - + } diff --git a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java index 12cef171f..17c505fbb 100644 --- a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java @@ -135,7 +135,7 @@ public final class ConfigHandler { desc = "Set to false to disable the Mana Enchanter. Since some people find it OP or something. This only disables the entry and creation. Old ones that are already in the world will stay."; enchanterEnabled = loadPropBool("manaEnchanter.enabled", desc, enchanterEnabled); - + desc = "The average amount of ticks between a chicken randomly dropping a feather. Set to -1 to disable this feature"; shedRateChicken = loadPropInt("shedRate.chicken", desc, shedRateChicken); diff --git a/MODSRC/vazkii/botania/common/core/handler/SpawnerChangingHandler.java b/MODSRC/vazkii/botania/common/core/handler/SpawnerChangingHandler.java index 54b65fc71..c166d1105 100644 --- a/MODSRC/vazkii/botania/common/core/handler/SpawnerChangingHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/SpawnerChangingHandler.java @@ -11,10 +11,8 @@ */ package vazkii.botania.common.core.handler; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.init.Items; -import net.minecraft.item.ItemMonsterPlacer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityMobSpawner; @@ -39,5 +37,5 @@ public final class SpawnerChangingHandler { } } } - + } diff --git a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java index fed3618f9..bc539f159 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java @@ -1119,33 +1119,33 @@ public final class ModCrafingRecipes { 'E', new ItemStack(Items.ender_eye), 'O', new ItemStack(Blocks.obsidian)); recipeEnderEyeBlock = BotaniaAPI.getLatestAddedRecipe(); - + // The Spectator Recipe - addOreDictRecipe(new ItemStack(ModItems.itemFinder), + addOreDictRecipe(new ItemStack(ModItems.itemFinder), " I ", "IYI", "IEI", 'I', "ingotIron", 'Y', new ItemStack(Items.ender_eye), 'E', new ItemStack(Items.emerald)); recipeItemFinder = BotaniaAPI.getLatestAddedRecipe(); - + // Crimson Pendant Recipe - addOreDictRecipe(new ItemStack(ModItems.superLavaPendant), + addOreDictRecipe(new ItemStack(ModItems.superLavaPendant), "BBB", "BPB", "NGN", 'B', new ItemStack(Items.blaze_rod), 'P', new ItemStack(ModItems.lavaPendant), 'N', new ItemStack(Blocks.nether_brick), 'G', LibOreDict.LIFE_ESSENCE); recipeSuperLavaPendant = BotaniaAPI.getLatestAddedRecipe(); - + // Hand of Ender Recipe - addOreDictRecipe(new ItemStack(ModItems.enderHand), + addOreDictRecipe(new ItemStack(ModItems.enderHand), "PLO", "LEL", "OL ", 'P', LibOreDict.PIXIE_DUST, 'L', new ItemStack(Items.leather), 'E', new ItemStack(Blocks.ender_chest), 'O', new ItemStack(Blocks.obsidian)); recipeEnderHand = BotaniaAPI.getLatestAddedRecipe(); - + // Mana and Terrasteel Block Recipes addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0), "III", "III", "III", diff --git a/MODSRC/vazkii/botania/common/entity/EntityPixie.java b/MODSRC/vazkii/botania/common/entity/EntityPixie.java index a36d3ba12..e73ff9719 100644 --- a/MODSRC/vazkii/botania/common/entity/EntityPixie.java +++ b/MODSRC/vazkii/botania/common/entity/EntityPixie.java @@ -89,7 +89,7 @@ public class EntityPixie extends EntityFlyingCreature { @Override public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if((getType() == 0 && par1DamageSource.getEntity() != summoner) || (getType() == 1 && par1DamageSource.getDamageType().equals("player"))) + if(getType() == 0 && par1DamageSource.getEntity() != summoner || getType() == 1 && par1DamageSource.getDamageType().equals("player")) return super.attackEntityFrom(par1DamageSource, par2); return false; } diff --git a/MODSRC/vazkii/botania/common/item/ItemEnderHand.java b/MODSRC/vazkii/botania/common/item/ItemEnderHand.java index 7f65a9134..65c694ae5 100644 --- a/MODSRC/vazkii/botania/common/item/ItemEnderHand.java +++ b/MODSRC/vazkii/botania/common/item/ItemEnderHand.java @@ -48,7 +48,7 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem { iplayer.worldObj.playSoundAtEntity(iplayer, "mob.endermen.portal", 1F, 1F); return true; } - + return false; } diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java index be31c23ad..d8e06fa38 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java @@ -98,27 +98,27 @@ public class ItemItemFinder extends ItemBauble { if(e instanceof EntityItem) { EntityItem item = (EntityItem) e; ItemStack istack = item.getEntityItem(); - if(player.isSneaking() || (istack.isItemEqual(pstack) && ItemStack.areItemStackTagsEqual(istack, pstack))) + if(player.isSneaking() || istack.isItemEqual(pstack) && ItemStack.areItemStackTagsEqual(istack, pstack)) positionsBuilder.append(item.getEntityId()).append(";"); - + } else if(e instanceof IInventory) { IInventory inv = (IInventory) e; if(scanInventory(inv, pstack)) positionsBuilder.append(e.getEntityId()).append(";"); - + } else if(e instanceof EntityHorse) { EntityHorse horse = (EntityHorse) e; AnimalChest chest = ReflectionHelper.getPrivateValue(EntityHorse.class, horse, LibObfuscation.HORSE_CHEST); if(scanInventory(chest, pstack)) positionsBuilder.append(horse.getEntityId()).append(";"); - + } else if(e instanceof EntityPlayer) { EntityPlayer player_ = (EntityPlayer) e; InventoryPlayer inv = player_.inventory; InventoryBaubles binv = PlayerHandler.getPlayerBaubles(player_); if(scanInventory(inv, pstack) || scanInventory(binv, pstack)) positionsBuilder.append(player_.getEntityId()).append(";"); - + } else if(e instanceof EntityVillager) { EntityVillager villager = (EntityVillager) e; ArrayList recipes = villager.getRecipes(player); @@ -126,7 +126,7 @@ public class ItemItemFinder extends ItemBauble { for(MerchantRecipe recipe : recipes) if(!recipe.isRecipeDisabled() && (equalStacks(pstack, recipe.getItemToBuy()) || equalStacks(pstack, recipe.getItemToSell()))) positionsBuilder.append(villager.getEntityId()).append(";"); - + } else if(e instanceof EntityLivingBase) { EntityLivingBase living = (EntityLivingBase) e; ItemStack estack = living.getEquipmentInSlot(0); @@ -137,9 +137,9 @@ public class ItemItemFinder extends ItemBauble { if(pstack != null) { range = 12; - int x = (int) MathHelper.floor_double(player.posX); - int y = (int) MathHelper.floor_double(player.posY); - int z = (int) MathHelper.floor_double(player.posZ); + int x = MathHelper.floor_double(player.posX); + int y = MathHelper.floor_double(player.posY); + int z = MathHelper.floor_double(player.posZ); for(int i = -range; i < range + 1; i++) for(int j = -range; j < range + 1; j++) for(int k = -range; k < range + 1; k++) { @@ -163,7 +163,7 @@ public class ItemItemFinder extends ItemBauble { PacketHandler.INSTANCE.sendToAll(new PacketSyncBauble(player, 0)); } } - + boolean equalStacks(ItemStack stack1, ItemStack stack2) { return stack1.isItemEqual(stack2) && ItemStack.areItemStackTagsEqual(stack1, stack2); } diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java index bcbb75804..3fad823a3 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java @@ -11,13 +11,10 @@ */ package vazkii.botania.common.item.equipment.bauble; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import vazkii.botania.common.lib.LibItemNames; -import vazkii.botania.common.lib.LibObfuscation; import baubles.api.BaubleType; -import cpw.mods.fml.relauncher.ReflectionHelper; public class ItemLavaPendant extends ItemBauble { diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/ToolCommons.java b/MODSRC/vazkii/botania/common/item/equipment/tool/ToolCommons.java index 01fc96b6e..d206f0883 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/ToolCommons.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/ToolCommons.java @@ -18,7 +18,6 @@ import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; diff --git a/MODSRC/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java b/MODSRC/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java index d03794dd4..00d373f29 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java +++ b/MODSRC/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java @@ -47,6 +47,7 @@ public class ItemElementiumShears extends ItemManasteelShears { return par1ItemStack; } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { super.registerIcons(par1IconRegister); diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index ffc98735e..7d2c58cc0 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -378,7 +378,7 @@ public final class LexiconData { 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)); @@ -420,7 +420,7 @@ public final class LexiconData { enderEyeBlock = new BLexiconEntry(LibLexicon.DEVICE_ENDER_EYE_BLOCK, categoryDevices); enderEyeBlock.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeEnderEyeBlock)); - + // TOOLS ENTRIES manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools); manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManaBlaster)); @@ -491,7 +491,7 @@ public final class LexiconData { enderHand = new ALexiconEntry(LibLexicon.TOOL_ENDER_HAND, categoryTools); enderHand.setLexiconPages(new PageText(ConfigHandler.enderPickpocketEnabled ? "0" : "0a"), new PageCraftingRecipe(ConfigHandler.enderPickpocketEnabled ? "1" : "1a", ModCrafingRecipes.recipeEnderHand)); - + // BAUBLES ENTRIES baublesIntro = new BLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles); baublesIntro.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BAUBLES), new PageText("2")); @@ -546,10 +546,10 @@ public final class LexiconData { itemFinder = new BLexiconEntry(LibLexicon.BAUBLE_ITEM_FINDER, categoryBaubles); itemFinder.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeItemFinder)); - + superLavaPendant = new ALexiconEntry(LibLexicon.BAUBLE_SUPER_LAVA_PENDANT, categoryBaubles); superLavaPendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeSuperLavaPendant)); - + // ALFHOMANCY ENTRIES alfhomancyIntro = new BLexiconEntry(LibLexicon.ALF_INTRO, categoryAlfhomancy); alfhomancyIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeAlfPortal), new PageCraftingRecipe("3", ModCrafingRecipes.recipeNaturaPylon), diff --git a/MODSRC/vazkii/botania/common/lib/LibObfuscation.java b/MODSRC/vazkii/botania/common/lib/LibObfuscation.java index d9e961bf6..fc6a5a78f 100644 --- a/MODSRC/vazkii/botania/common/lib/LibObfuscation.java +++ b/MODSRC/vazkii/botania/common/lib/LibObfuscation.java @@ -35,7 +35,7 @@ public final class LibObfuscation { // Entity public static final String[] IS_IMMUNE_TO_FIRE = new String[] { "isImmuneToFire", "field_70178_ae", "ag" }; - + // ItemReed public static final String[] REED_ITEM = new String[] { "field_150935_a", "a" };