Import cleanup

Eclipse source cleanup is NOT RECURSIVE !
This commit is contained in:
Thomas Guimbretiere committed 2013-06-15 16:50:14 +02:00
1 parent cbd8b81f90
commit db75285bc5
19 files changed
+42 -57

No files matched your search

@@ -40,7 +40,7 @@ public class HUDHandlerBetterBarrels implements IHighlightHandler {
try {
stack = (ItemStack) IBarrelStorage_getItem.invoke(TileEntityBarrel_Storage.get(entity));
} catch (Exception e){
mod_Waila.instance.log.log(Level.SEVERE, "[BB] Unhandled exception trying to access a barrel storage for display !.\n" + String.valueOf(e));
mod_Waila.log.log(Level.SEVERE, "[BB] Unhandled exception trying to access a barrel storage for display !.\n" + String.valueOf(e));
currenttip.add("<ERROR!>");
return currenttip;
}
@@ -62,15 +62,15 @@ public class HUDHandlerBetterBarrels implements IHighlightHandler {
IBarrelStorage_getItem = IBarrelStorage.getMethod("getItem");
} catch (ClassNotFoundException e){
mod_Waila.instance.log.log(Level.WARNING, "[BB] BetterBarrel classes not found.");
mod_Waila.log.log(Level.WARNING, "[BB] BetterBarrel classes not found.");
} catch (NoSuchFieldException e){
mod_Waila.instance.log.log(Level.WARNING, "[BB] Storage field not found.");
mod_Waila.log.log(Level.WARNING, "[BB] Storage field not found.");
} catch (NoSuchMethodException e){
mod_Waila.instance.log.log(Level.WARNING, "[BB] getItem() not found.");
mod_Waila.log.log(Level.WARNING, "[BB] getItem() not found.");
}
if (IBarrelStorage_getItem != null){
mod_Waila.instance.log.log(Level.INFO, "Waila module BetterBarrel succefully hooked.");
mod_Waila.log.log(Level.INFO, "Waila module BetterBarrel succefully hooked.");
API.registerHighlightHandler(new HUDHandlerBetterBarrels(), ItemInfo.Layout.BODY);
}
}
@@ -41,7 +41,7 @@ public class HUDHandlerBCTanks implements IHighlightHandler {
try{
tank = ((ILiquidTank[])TileTank_GetTanks.invoke(TileTank.cast(entity), ForgeDirection.UNKNOWN))[0];
} catch (Exception e){
mod_Waila.instance.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
mod_Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
return currenttip;
}
@@ -77,13 +77,13 @@ public class HUDHandlerBCTanks implements IHighlightHandler {
TileTank_GetTanks = TileTank.getMethod("getTanks", ForgeDirection.class);
} catch (ClassNotFoundException e){
mod_Waila.instance.log.log(Level.WARNING, "[BC] TileTank class not found.");
mod_Waila.log.log(Level.WARNING, "[BC] TileTank class not found.");
} catch (NoSuchMethodException e){
mod_Waila.instance.log.log(Level.WARNING, "[BB] getTanks() not found.");
mod_Waila.log.log(Level.WARNING, "[BB] getTanks() not found.");
}
if (TileTank_GetTanks != null){
mod_Waila.instance.log.log(Level.INFO, "Waila module BuildcraftTank succefully hooked.");
mod_Waila.log.log(Level.INFO, "Waila module BuildcraftTank succefully hooked.");
API.registerHighlightHandler(new HUDHandlerBCTanks(), Layout.HEADER);
API.registerHighlightHandler(new HUDHandlerBCTanks(), Layout.BODY);
}
@@ -37,7 +37,7 @@ public class HUDHandlerIC2Generator implements IHighlightHandler {
try{
maxinput = (Integer)(TEBaseGenerator_GetMaxOutput.invoke(TEBaseGenerator.cast(entity)));
} catch (Exception e){
mod_Waila.instance.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an TEBaseGenerator for display !.\n" + String.valueOf(e));
mod_Waila.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an TEBaseGenerator for display !.\n" + String.valueOf(e));
return currenttip;
}
currenttip.add(String.format("OUT : %s EU/t", maxinput));
@@ -52,13 +52,13 @@ public class HUDHandlerIC2Generator implements IHighlightHandler {
TEBaseGenerator = Class.forName("ic2.core.block.generator.tileentity.TileEntityBaseGenerator");
TEBaseGenerator_GetMaxOutput = TEBaseGenerator.getMethod("getMaxEnergyOutput");
} catch (ClassNotFoundException e){
mod_Waila.instance.log.log(Level.WARNING, "[IC2] TEBaseGenerator class not found.");
mod_Waila.log.log(Level.WARNING, "[IC2] TEBaseGenerator class not found.");
} catch (NoSuchMethodException e){
mod_Waila.instance.log.log(Level.WARNING, "[IC2] One method was not found.");
mod_Waila.log.log(Level.WARNING, "[IC2] One method was not found.");
}
if (TEBaseGenerator_GetMaxOutput != null){
mod_Waila.instance.log.log(Level.INFO, "Waila module IndustrialCraft|Generator succefully hooked.");
mod_Waila.log.log(Level.INFO, "Waila module IndustrialCraft|Generator succefully hooked.");
API.registerHighlightHandler(new HUDHandlerIC2Generator(), Layout.BODY);
}
}
@@ -1,6 +1,5 @@
package mcp.mobius.waila.addons.ic2;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.List;
import java.util.logging.Level;
@@ -38,7 +37,7 @@ public class HUDHandlerIC2Machine implements IHighlightHandler {
try{
maxinput = (Integer)(TEElectricMachine_GetMaxSafeInput.invoke(TEElectricMachine.cast(entity)));
} catch (Exception e){
mod_Waila.instance.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergyStorage for display !.\n" + String.valueOf(e));
mod_Waila.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergyStorage for display !.\n" + String.valueOf(e));
return currenttip;
}
currenttip.add(String.format("IN : %s EU/t", maxinput));
@@ -53,13 +52,13 @@ public class HUDHandlerIC2Machine implements IHighlightHandler {
TEElectricMachine = Class.forName("ic2.core.block.machine.tileentity.TileEntityElectricMachine");
TEElectricMachine_GetMaxSafeInput = TEElectricMachine.getMethod("getMaxSafeInput");
} catch (ClassNotFoundException e){
mod_Waila.instance.log.log(Level.WARNING, "[IC2] TileEntityElectricMachine class not found.");
mod_Waila.log.log(Level.WARNING, "[IC2] TileEntityElectricMachine class not found.");
} catch (NoSuchMethodException e){
mod_Waila.instance.log.log(Level.WARNING, "[IC2] One method was not found.");
mod_Waila.log.log(Level.WARNING, "[IC2] One method was not found.");
}
if (TEElectricMachine_GetMaxSafeInput != null){
mod_Waila.instance.log.log(Level.INFO, "Waila module IndustrialCraft|Machine succefully hooked.");
mod_Waila.log.log(Level.INFO, "Waila module IndustrialCraft|Machine succefully hooked.");
API.registerHighlightHandler(new HUDHandlerIC2Machine(), Layout.BODY);
}
}
@@ -7,13 +7,11 @@ import java.util.logging.Level;
import mcp.mobius.waila.mod_Waila;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.addons.buildcraft.HUDHandlerBCTanks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import codechicken.nei.api.API;
import codechicken.nei.api.IHighlightHandler;
import codechicken.nei.api.ItemInfo.Layout;
@@ -47,7 +45,7 @@ public class HUDHandlerIC2Storage implements IHighlightHandler {
output = (Integer)(TEElectricBlock_GetOutput.invoke(TEElectricBlock.cast(entity)));
maxinput = (Integer)(TEElectricBlock_GetMaxSafeInput.invoke(TEElectricBlock.cast(entity)));
} catch (Exception e){
mod_Waila.instance.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergyStorage for display !.\n" + String.valueOf(e));
mod_Waila.log.log(Level.SEVERE, "[IC2] Unhandled exception trying to access an IEnergyStorage for display !.\n" + String.valueOf(e));
return currenttip;
}
if (ConfigHandler.instance().getConfig("ic2.outputeu") && ConfigHandler.instance().getConfig("ic2.inputeu"))
@@ -72,16 +70,16 @@ public class HUDHandlerIC2Storage implements IHighlightHandler {
TEElectricBlock_GetMaxSafeInput = TEElectricBlock.getMethod("getMaxSafeInput");
TEElectricBlock_Energy = TEElectricBlock.getField("energy");
} catch (ClassNotFoundException e){
mod_Waila.instance.log.log(Level.WARNING, "[IC2] IEnergyStorage class not found.");
mod_Waila.log.log(Level.WARNING, "[IC2] IEnergyStorage class not found.");
} catch (NoSuchMethodException e){
mod_Waila.instance.log.log(Level.WARNING, "[IC2] One method was not found.");
mod_Waila.log.log(Level.WARNING, "[IC2] One method was not found.");
} catch (NoSuchFieldException e){
mod_Waila.instance.log.log(Level.WARNING, "[IC2] One field was not found.");
mod_Waila.log.log(Level.WARNING, "[IC2] One field was not found.");
}
if (TEElectricBlock_Energy != null){
mod_Waila.instance.log.log(Level.INFO, "Waila module IndustrialCraft|Storage succefully hooked.");
mod_Waila.log.log(Level.INFO, "Waila module IndustrialCraft|Storage succefully hooked.");
API.registerHighlightHandler(new HUDHandlerIC2Storage(), Layout.BODY);
}
}
-2
View File
@@ -2,8 +2,6 @@ package mcp.mobius.waila.api;
import java.util.List;
import codechicken.nei.api.ItemInfo.Layout;
import mcp.mobius.waila.addons.ConfigHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
@@ -3,8 +3,6 @@ package mcp.mobius.waila.api;
import java.util.HashMap;
import java.util.Set;
import mcp.mobius.waila.addons.ConfigModule;
public interface IWailaConfigHandler {
/* Returns a set of all the currently loaded modules in the config handler */
public Set<String> getModuleNames();
@@ -1,10 +1,7 @@
package mcp.mobius.waila.gui;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import mcp.mobius.waila.gui.widget.Button2States;
import mcp.mobius.waila.gui.widget.ButtonChangeScreen;
import mcp.mobius.waila.gui.widget.ButtonConfigOption;
import mcp.mobius.waila.gui.widget.ContainerButtons;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@@ -15,6 +15,7 @@ public class GuiModuleOptions extends GuiBaseConfigScreen {
this.modName = _modName;
}
@Override
public void initGui()
{
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
+1
View File
@@ -18,6 +18,7 @@ public class GuiModules extends GuiBaseConfigScreen {
}
@Override
public void initGui()
{
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
+1 -1
View File
@@ -1,6 +1,5 @@
package mcp.mobius.waila.gui;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.gui.widget.ButtonChangeScreen;
import mcp.mobius.waila.gui.widget.ButtonConfigNEI;
import mcp.mobius.waila.gui.widget.ButtonConfigOption;
@@ -14,6 +13,7 @@ public class GuiWailaConfig extends GuiBaseConfigScreen {
// TODO Auto-generated constructor stub
}
@Override
public void initGui()
{
buttonList.add(new ButtonChangeScreen(200, width / 2 - 100, height / 6 + 168, "Back", this.parentGui));
@@ -44,7 +44,8 @@ public class Button2States extends GuiButton {
this.displayString = state ? stateTrue:stateFalse;
}
public void drawButton(Minecraft par1Minecraft, int par2, int par3)
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3)
{
if (this.drawButton)
{
@@ -86,7 +87,8 @@ public class Button2States extends GuiButton {
return state;
}
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3)
@Override
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3)
{
return this.enabled && this.drawButton && par2 >= this.xPosition + this.labelSize && par3 >= this.yPosition && par2 < this.xPosition + this.labelSize + this.width && par3 < this.yPosition + this.height;
}
@@ -22,12 +22,14 @@ public class ButtonConfigNEI extends ButtonConfigOption {
_labelSize, _state, _configKey);
}
@Override
public void setupInitialState(String _configKey){
this.configKey = _configKey;
this.state = NEIClientConfig.getSetting(this.configKey).getBooleanValue();
this.displayString = state ? stateTrue:stateFalse;
}
@Override
public void pressButton(){
super.pressButton();
this.state = !NEIClientConfig.getSetting(this.configKey).getBooleanValue();
@@ -1,6 +1,5 @@
package mcp.mobius.waila.gui.widget;
import mcp.mobius.health.mod_Health;
import mcp.mobius.waila.mod_Waila;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
@@ -30,6 +29,7 @@ public class ButtonConfigOption extends Button2States {
this.displayString = state ? stateTrue:stateFalse;
}
@Override
public void pressButton(){
super.pressButton();
this.writeConfigKey(this.configKey, this.state);
@@ -2,9 +2,6 @@ package mcp.mobius.waila.gui.widget;
import java.util.ArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@@ -44,9 +44,9 @@ public class EnchantementHandler implements IContainerInputHandler {
int meanItemEnchantability = 1 + itemEnchantability/4;
int maxItemEnchantability = 1 + itemEnchantability/2;
int minModifiedEnchantability = (int)(0.85*(float)minItemEnchantability + 0.5);
int meanModifiedEnchantability = (int)(1.00*(float)meanItemEnchantability + 0.5);
int maxModifiedEnchantability = (int)(1.15*(float)maxItemEnchantability + 0.5);
int minModifiedEnchantability = (int)(0.85*minItemEnchantability + 0.5);
int meanModifiedEnchantability = (int)(1.00*meanItemEnchantability + 0.5);
int maxModifiedEnchantability = (int)(1.15*maxItemEnchantability + 0.5);
int minLevel = (int) ((minEnchantEnchantability - minModifiedEnchantability)/1.15);
int maxLevel = (int) ((maxEnchantEnchantability - maxModifiedEnchantability)/0.85);
@@ -4,7 +4,6 @@ import java.util.List;
import mcp.mobius.waila.addons.ConfigHandler;
import mcp.mobius.waila.addons.ExternalModulesHandler;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaBlock;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.block.Block;
@@ -22,11 +21,11 @@ public class HUDHandlerExternal implements IHighlightHandler {
Block block = Block.blocksList[blockID];
if (IWailaBlock.class.isInstance(block))
return ((IWailaBlock)block).getWailaStack(world, player, mop, (IWailaConfigHandler)ConfigHandler.instance());
return ((IWailaBlock)block).getWailaStack(world, player, mop, ConfigHandler.instance());
if(ExternalModulesHandler.instance().hasStackProviders(blockID))
for (IWailaDataProvider dataProvider : ExternalModulesHandler.instance().getStackProviders(blockID)){
ItemStack retval = dataProvider.getWailaStack(world, player, mop, (IWailaConfigHandler)ConfigHandler.instance());
ItemStack retval = dataProvider.getWailaStack(world, player, mop, ConfigHandler.instance());
if (retval != null)
return retval;
}
@@ -41,17 +40,17 @@ public class HUDHandlerExternal implements IHighlightHandler {
if (IWailaBlock.class.isInstance(block))
if (layout == Layout.HEADER)
return ((IWailaBlock)block).getWailaHead(itemStack, world, player, mop, currenttip, (IWailaConfigHandler)ConfigHandler.instance());
return ((IWailaBlock)block).getWailaHead(itemStack, world, player, mop, currenttip, ConfigHandler.instance());
else if (layout == Layout.BODY)
return ((IWailaBlock)block).getWailaBody(itemStack, world, player, mop, currenttip, (IWailaConfigHandler)ConfigHandler.instance());
return ((IWailaBlock)block).getWailaBody(itemStack, world, player, mop, currenttip, ConfigHandler.instance());
if (layout == Layout.HEADER && ExternalModulesHandler.instance().hasHeadProviders(blockID))
for (IWailaDataProvider dataProvider : ExternalModulesHandler.instance().getHeadProviders(blockID))
currenttip = dataProvider.getWailaHead(itemStack, world, player, mop, currenttip, (IWailaConfigHandler)ConfigHandler.instance());
currenttip = dataProvider.getWailaHead(itemStack, world, player, mop, currenttip, ConfigHandler.instance());
if (layout == Layout.BODY && ExternalModulesHandler.instance().hasBodyProviders(blockID))
for (IWailaDataProvider dataProvider : ExternalModulesHandler.instance().getBodyProviders(blockID))
currenttip = dataProvider.getWailaBody(itemStack, world, player, mop, currenttip, (IWailaConfigHandler)ConfigHandler.instance());
currenttip = dataProvider.getWailaBody(itemStack, world, player, mop, currenttip, ConfigHandler.instance());
return currenttip;
}
@@ -1,14 +1,9 @@
package mcp.mobius.waila.handlers;
import static net.minecraftforge.common.Property.Type.STRING;
import java.util.List;
import java.util.Set;
import mcp.mobius.waila.mod_Waila;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Property;
import codechicken.nei.forge.IContainerTooltipHandler;
public class TooltipHandlerWaila implements IContainerTooltipHandler {
+1 -3
View File
@@ -11,7 +11,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import codechicken.core.CommonUtils;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.IMCCallback;
@@ -26,11 +25,10 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.ItemData;
@Mod(modid="Waila", name="Waila", version="1.1.0")
@Mod(modid="Waila", name="Waila", version="1.2.0_RC1")
//@NetworkMod(channels = {"Waila"},clientSideRequired=true, serverSideRequired=false)
public class mod_Waila {