diff --git a/.gitignore b/.gitignore index 1a05e24..743f7dd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ # for kde users *.directory + +#Mac OS X +.DS_Store diff --git a/powercraft/api/PC_3DRotationFull.java b/powercraft/api/PC_3DRotationFull.java index e64720a..1561942 100644 --- a/powercraft/api/PC_3DRotationFull.java +++ b/powercraft/api/PC_3DRotationFull.java @@ -8,12 +8,10 @@ public class PC_3DRotationFull implements PC_3DRotation { - @SuppressWarnings("unused") public PC_3DRotationFull(PC_Direction side, Entity entity) { // TODO Auto-generated constructor stub } - @SuppressWarnings("unused") public PC_3DRotationFull(NBTTagCompound nbtTagCompound, Flag flag){ // TODO Auto-generated constructor stub } diff --git a/powercraft/api/PC_3DRotationY.java b/powercraft/api/PC_3DRotationY.java index 67cd61a..69d1e00 100644 --- a/powercraft/api/PC_3DRotationY.java +++ b/powercraft/api/PC_3DRotationY.java @@ -17,8 +17,7 @@ public PC_3DRotationY(int rotation){ public PC_3DRotationY(Entity entity){ this.rotation = PC_Utils.getRotation(entity); } - - @SuppressWarnings("unused") + public PC_3DRotationY(NBTTagCompound nbtTagCompound, Flag flag){ this.rotation = nbtTagCompound.getByte("rotation"); } diff --git a/powercraft/api/PC_Api.java b/powercraft/api/PC_Api.java index 0b80f48..c1a2c95 100644 --- a/powercraft/api/PC_Api.java +++ b/powercraft/api/PC_Api.java @@ -34,9 +34,9 @@ @Mod(modid = PC_Api.NAME, name = PC_Api.NAME, version = PC_Api.VERSION, dependencies=PC_Api.DEPENDENCIES) public final class PC_Api extends PC_Module { - public static final String NAME = POWERCRAFT+"-Api"; + public static final String NAME = POWERCRAFT + "-Api"; public static final String VERSION = PC_Build.BUILD_VERSION; - public static final String DEPENDENCIES = "required-before:"+PCco_Core.NAME+"@"+PCco_Core.VERSION; + public static final String DEPENDENCIES = "required-before:" + PCco_Core.NAME + "@" + PCco_Core.VERSION; static{ PC_Bootstrap.prepare(); @@ -56,10 +56,9 @@ private PC_Api(){ showPreversions = getConfig().get("options", "showPreversions", false).getBoolean(false); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @EventHandler public void preInit(FMLPreInitializationEvent event) { - PC_Modules.construct(); PC_PacketHandler.register(); @@ -86,28 +85,27 @@ public void preInit(FMLPreInitializationEvent event) { } - @SuppressWarnings("unused") @EventHandler public void init(FMLInitializationEvent event) { // } - @SuppressWarnings({ "unused", "static-method" }) + @SuppressWarnings({ "static-method" }) @EventHandler public void postInit(FMLPostInitializationEvent event) { PC_Miniscript.loadDefaultReplacements(); PC_Modules.saveConfig(); } - @SuppressWarnings({ "unused", "static-method" }) + @SuppressWarnings({ "static-method" }) @EventHandler public void serverStarted(FMLServerAboutToStartEvent start) { PC_Utils.markThreadAsServer(); PC_PacketHandler.setupPackets(); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @EventHandler public void onServerStopping(FMLServerStoppedEvent serverStoppedEvent){ PC_WorldSaveData.onServerStopping(); diff --git a/powercraft/api/PC_Bootstrap.java b/powercraft/api/PC_Bootstrap.java index 8364377..eb77a28 100644 --- a/powercraft/api/PC_Bootstrap.java +++ b/powercraft/api/PC_Bootstrap.java @@ -18,7 +18,6 @@ public final class PC_Bootstrap { /** * initialize Utils and Registry and logger */ - @SuppressWarnings("unused") static void prepare() { try{ if(FMLCommonHandler.instance().getSide()==Side.CLIENT){ diff --git a/powercraft/api/PC_ClientRegistry.java b/powercraft/api/PC_ClientRegistry.java index 25a164b..607785e 100644 --- a/powercraft/api/PC_ClientRegistry.java +++ b/powercraft/api/PC_ClientRegistry.java @@ -26,7 +26,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -@SuppressWarnings("unused") @SideOnly(Side.CLIENT) public final class PC_ClientRegistry extends PC_Registry { diff --git a/powercraft/api/PC_ClientUtils.java b/powercraft/api/PC_ClientUtils.java index acfc1eb..c4feff3 100644 --- a/powercraft/api/PC_ClientUtils.java +++ b/powercraft/api/PC_ClientUtils.java @@ -24,7 +24,6 @@ * @author XOR * */ -@SuppressWarnings("unused") @SideOnly(Side.CLIENT) public final class PC_ClientUtils extends PC_Utils { @@ -84,7 +83,6 @@ GameType iGetGameTypeFor(EntityPlayer player) { * is this game running on client * @return always yes */ - @SuppressWarnings("hiding") @Override PC_Side iGetSide(){ Boolean isClient = PC_ClientUtils.isClient.get(); diff --git a/powercraft/api/PC_ImmutableArrayList.java b/powercraft/api/PC_ImmutableArrayList.java index 3d5cc97..c52c28c 100644 --- a/powercraft/api/PC_ImmutableArrayList.java +++ b/powercraft/api/PC_ImmutableArrayList.java @@ -103,7 +103,6 @@ public ListIterator listIterator() { return listIterator(0); } - @SuppressWarnings("hiding") @Override public ListIterator listIterator(int start) { return new ImmutableListIterator(start); @@ -194,7 +193,6 @@ public int size() { return this.end-this.start; } - @SuppressWarnings("hiding") @Override public List subList(int start, int end) { if(end>size()) diff --git a/powercraft/api/PC_ImmutableList.java b/powercraft/api/PC_ImmutableList.java index a0f1314..ec64ece 100644 --- a/powercraft/api/PC_ImmutableList.java +++ b/powercraft/api/PC_ImmutableList.java @@ -101,7 +101,6 @@ public ListIterator listIterator() { return listIterator(0); } - @SuppressWarnings("hiding") @Override public ListIterator listIterator(int start) { return new ImmutableListIterator(start); @@ -192,7 +191,6 @@ public int size() { return this.end-this.start; } - @SuppressWarnings("hiding") @Override public List subList(int start, int end) { if(end>size()) diff --git a/powercraft/api/PC_Keyboard.java b/powercraft/api/PC_Keyboard.java index 3880e53..7d57214 100644 --- a/powercraft/api/PC_Keyboard.java +++ b/powercraft/api/PC_Keyboard.java @@ -7,6 +7,7 @@ import org.lwjgl.input.Keyboard; +import powercraft.api.PC_TickHandler.PC_ITickHandler; import powercraft.api.reflect.PC_Security; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -15,7 +16,7 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public final class PC_Keyboard { +public final class PC_Keyboard implements PC_ITickHandler{ static List handlers = new ArrayList(); @@ -25,6 +26,7 @@ public final class PC_Keyboard { static void register(){ PC_Security.allowedCaller("PC_Keyboard.register()", PC_ClientUtils.class); FMLCommonHandler.instance().bus().register(INSTANCE); + PC_TickHandler.registerTickHandler(INSTANCE); } private PC_Keyboard(){ @@ -32,7 +34,7 @@ private PC_Keyboard(){ } @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unused", "static-method" }) + @SuppressWarnings({ "static-method" }) @SubscribeEvent public void onKeyEvent(KeyInputEvent inputEvent){ int key = Keyboard.getEventKey(); @@ -53,7 +55,6 @@ public PC_KeyHandler(String sKey, int key, String desk) { handlers.add(this); } - @SuppressWarnings("hiding") void onEvent(boolean state) { if(this.state && state){ onTick(); @@ -75,7 +76,26 @@ public boolean isPressed() { public abstract void onPressed(); public abstract void onRelease(); + + void checkUnpressed() { + if(!getIsKeyPressed() && this.state){ + onRelease(); + this.state = false; + } + } } + + @Override + public void onStartTick(PC_Side side) { + // + } + + @Override + public void onEndTick(PC_Side side) { + for(PC_KeyHandler handler:handlers){ + handler.checkUnpressed(); + } + } } diff --git a/powercraft/api/PC_OreDictionary.java b/powercraft/api/PC_OreDictionary.java index 005e091..5afef37 100644 --- a/powercraft/api/PC_OreDictionary.java +++ b/powercraft/api/PC_OreDictionary.java @@ -30,7 +30,7 @@ public static String[] getOreNames(){ } public static List getOres(int id){ - return getOres(getOreName(id)); + return OreDictionary.getOres(Integer.valueOf(id)); } public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict){ diff --git a/powercraft/api/PC_Registry.java b/powercraft/api/PC_Registry.java index 5854413..b6a1ff7 100644 --- a/powercraft/api/PC_Registry.java +++ b/powercraft/api/PC_Registry.java @@ -49,7 +49,7 @@ public static void registerEntity(Classvoid iRegisterEntity(Class entity, String name, int entityTypeID, PC_Module module, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates, PC_EntityType type){ EntityRegistry.registerModEntity(entity, name, entityTypeID, module, trackingRange, updateFrequency, sendsVelocityUpdates); } @@ -58,7 +58,6 @@ static void playSound(double x, double y, double z, String sound, float soundVol INSTANCE.iPlaySound(x, y, z, sound, soundVolume, pitch); } - @SuppressWarnings("unused") void iPlaySound(double x, double y, double z, String sound, float soundVolume, float pitch) { // } diff --git a/powercraft/api/PC_Utils.java b/powercraft/api/PC_Utils.java index cdabedf..fd84d5c 100644 --- a/powercraft/api/PC_Utils.java +++ b/powercraft/api/PC_Utils.java @@ -581,7 +581,6 @@ public static String getMD5(String s) { return new String(digest.digest(s.getBytes())); } - @SuppressWarnings("unused") public static int getSideRotation(IBlockAccess world, int x, int y, int z, PC_Direction side, int faceSide) { notImplementedYet("getSideRotation"); // TODO Auto-generated method stub @@ -624,7 +623,7 @@ public static boolean isEntityFX(Entity entity) { return INSTANCE.iIsEntityFX(entity); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) boolean iIsEntityFX(Entity entity) { return false; } diff --git a/powercraft/api/PC_Vec2I.java b/powercraft/api/PC_Vec2I.java index 8b01a4f..db1eebb 100644 --- a/powercraft/api/PC_Vec2I.java +++ b/powercraft/api/PC_Vec2I.java @@ -6,47 +6,35 @@ public class PC_Vec2I { public int x; public int y; - - public PC_Vec2I() { - - } - + public PC_Vec2I() {} public PC_Vec2I(int x, int y) { - this.x = x; this.y = y; } public PC_Vec2I(PC_Vec2I vec) { - this(vec.x, vec.y); } - public PC_Vec2I(String attribute) { - String[] attributes = attribute.split(","); if (attributes.length != 2) throw new NumberFormatException(); this.x = Integer.parseInt(attributes[0].trim()); this.y = Integer.parseInt(attributes[1].trim()); } - public PC_Vec2I(PC_Vec2 vec) { this.x = (int) (vec.x+0.5); this.y = (int) (vec.y+0.5); } - public void setTo(PC_Vec2I vec) { - this.x = vec.x; this.y = vec.y; } - @Override public boolean equals(Object obj) { @@ -64,89 +52,60 @@ public int hashCode() { return this.x ^ 34 + this.y; } - @Override public String toString() { - return "Vec2I[" + this.x + ", " + this.y + "]"; } - public PC_Vec2I add(int n) { - return new PC_Vec2I(this.x + n, this.y + n); } - - @SuppressWarnings("hiding") public PC_Vec2I add(int x, int y) { - return new PC_Vec2I(this.x + x, this.y + y); } - public PC_Vec2I add(PC_Vec2I vec) { - return new PC_Vec2I(this.x + vec.x, this.y + vec.y); } - public PC_Vec2I sub(int n) { - return new PC_Vec2I(this.x - n, this.y - n); } - - @SuppressWarnings("hiding") public PC_Vec2I sub(int x, int y) { - return new PC_Vec2I(this.x - x, this.y - y); } - public PC_Vec2I sub(PC_Vec2I vec) { - return new PC_Vec2I(this.x - vec.x, this.y - vec.y); } - public PC_Vec2I max(int n) { - return new PC_Vec2I(this.x > n ? this.x : n, this.y > n ? this.y : n); } - - @SuppressWarnings("hiding") public PC_Vec2I max(int x, int y) { - return new PC_Vec2I(this.x > x ? this.x : x, this.y > y ? this.y : y); } public PC_Vec2I max(PC_Vec2I vec) { - return new PC_Vec2I(this.x > vec.x ? this.x : vec.x, this.y > vec.y ? this.y : vec.y); } public PC_Vec2I min(int n) { - return new PC_Vec2I(this.x < n ? this.x : n, this.y < n ? this.y : n); } - - @SuppressWarnings("hiding") public PC_Vec2I min(int x, int y) { - return new PC_Vec2I(this.x < x ? this.x : x, this.y < y ? this.y : y); } - public PC_Vec2I min(PC_Vec2I vec) { - return new PC_Vec2I(this.x < vec.x ? this.x : vec.x, this.y < vec.y ? this.y : vec.y); } - public PC_Vec2I mul(float v) { return new PC_Vec2I((int)(this.x * v), (int)(this.y * v)); } @@ -154,5 +113,4 @@ public PC_Vec2I mul(float v) { public PC_Vec2I div(float v) { return new PC_Vec2I((int)(this.x / v), (int)(this.y / v)); } - } diff --git a/powercraft/api/PC_Vec3.java b/powercraft/api/PC_Vec3.java index 634f838..f01170b 100644 --- a/powercraft/api/PC_Vec3.java +++ b/powercraft/api/PC_Vec3.java @@ -10,27 +10,20 @@ public class PC_Vec3 implements PC_INBT { public double y; public double z; - - public PC_Vec3() { - - } - + public PC_Vec3() {} public PC_Vec3(double x, double y, double z) { - this.x = x; this.y = y; this.z = z; } public PC_Vec3(PC_Vec3 vec) { - this.x = vec.x; this.y = vec.y; this.z = vec.z; } - @SuppressWarnings("unused") public PC_Vec3(NBTTagCompound nbtTagCompound, Flag flag) { this.x = nbtTagCompound.getDouble("x"); this.y = nbtTagCompound.getDouble("y"); @@ -39,7 +32,6 @@ public PC_Vec3(NBTTagCompound nbtTagCompound, Flag flag) { @Override public boolean equals(Object obj) { - if (obj instanceof PC_Vec3) { PC_Vec3 vec = (PC_Vec3) obj; return vec.x == this.x && vec.y == this.y && vec.z == this.z; @@ -49,14 +41,12 @@ public boolean equals(Object obj) { @Override public int hashCode() { - return ((int)this.x) ^ 34 + ((int)this.y) ^ 12 + ((int)this.z); } @Override public String toString() { - return "Vec3[" + this.x + ", " + this.y + ", " + this.z + "]"; } @@ -94,18 +84,15 @@ public double length() { return PC_MathHelper.sqrt_double(this.x*this.x+this.y*this.y+this.z*this.z); } - public PC_Vec3 normalize() { double l = length(); return new PC_Vec3(this.x/l, this.y/l, this.z/l); } - public double dot(PC_Vec3 vec) { - return this.x*vec.x+this.y*vec.y+this.z*vec.z; + return this.x * vec.x + this.y * vec.y + this.z * vec.z; } - @Override public void saveToNBT(NBTTagCompound tag, Flag flag) { tag.setDouble("x", this.x); @@ -113,9 +100,8 @@ public void saveToNBT(NBTTagCompound tag, Flag flag) { tag.setDouble("z", this.z); } - public PC_Vec3 cross(PC_Vec3 other) { - return new PC_Vec3(this.y*other.z-this.z*other.y, this.z*other.x-this.x*other.z, this.x*other.y-this.y*other.x); + return new PC_Vec3(this.y * other.z - this.z * other.y, this.z * other.x - this.x * other.z, this.x * other.y - this.y * other.x); } } diff --git a/powercraft/api/PC_Vec3I.java b/powercraft/api/PC_Vec3I.java index 6fd327b..b164a4b 100644 --- a/powercraft/api/PC_Vec3I.java +++ b/powercraft/api/PC_Vec3I.java @@ -7,23 +7,16 @@ public class PC_Vec3I { public int y; public int z; - - public PC_Vec3I() { - - } - + public PC_Vec3I() {} public PC_Vec3I(int x, int y, int z) { - this.x = x; this.y = y; this.z = z; } - @Override public boolean equals(Object obj) { - if (obj instanceof PC_Vec3I) { PC_Vec3I vec = (PC_Vec3I) obj; return vec.x == this.x && vec.y == this.y && vec.z == this.z; @@ -31,22 +24,16 @@ public boolean equals(Object obj) { return false; } - @Override public int hashCode() { - return this.x ^ 34 + this.y ^ 12 + this.z; } - @Override public String toString() { - return "Vec3I[" + this.x + ", " + this.y + ", " + this.z + "]"; } - - @SuppressWarnings("hiding") public PC_Vec3I offset(int x, int y, int z) { return new PC_Vec3I(this.x+x, this.y+y, this.z+z); } @@ -59,34 +46,32 @@ public PC_Vec3I offset(PC_Direction other) { return new PC_Vec3I(this.x+other.offsetX, this.y+other.offsetY, this.z+other.offsetZ); } - public PC_Vec3I rotate(PC_Direction pcDir, int times){ - int tmpX=0, tmpY=0, tmpZ=0; + int tmpX = 0, tmpY = 0, tmpZ = 0; PC_Direction tmp; PC_Direction[] sides = {PC_Direction.DOWN, PC_Direction.NORTH, PC_Direction.EAST}; for(PC_Direction dir:sides){ tmp=dir.rotate(pcDir, times); if(dir==tmp||dir==tmp.getOpposite()){ - tmpX+=tmp.offsetX*(dir.offsetX*this.x); - tmpY+=tmp.offsetY*(dir.offsetY*this.y); - tmpZ+=tmp.offsetZ*(dir.offsetZ*this.z); + tmpX+=tmp.offsetX * (dir.offsetX * this.x); + tmpY+=tmp.offsetY * (dir.offsetY * this.y); + tmpZ+=tmp.offsetZ * (dir.offsetZ * this.z); }else{ - tmpX+=tmp.offsetX*(dir.offsetX*this.x+dir.offsetY*this.y+dir.offsetZ*this.z); - tmpY+=tmp.offsetY*(dir.offsetX*this.x+dir.offsetY*this.y+dir.offsetZ*this.z); - tmpZ+=tmp.offsetZ*(dir.offsetX*this.x+dir.offsetY*this.y+dir.offsetZ*this.z); + tmpX+=tmp.offsetX * (dir.offsetX * this.x + dir.offsetY * this.y + dir.offsetZ * this.z); + tmpY+=tmp.offsetY * (dir.offsetX * this.x + dir.offsetY * this.y + dir.offsetZ * this.z); + tmpZ+=tmp.offsetZ * (dir.offsetX * this.x + dir.offsetY * this.y + dir.offsetZ * this.z); } } return new PC_Vec3I(tmpX, tmpY, tmpZ); } public PC_Vec3I mirror(PC_Direction pcDir){ - return new PC_Vec3I(pcDir.offsetX==0?this.x:-this.x, pcDir.offsetY==0?this.y:-this.y, pcDir.offsetZ==0?this.z:-this.z); + return new PC_Vec3I(pcDir.offsetX == 0 ? this.x : -this.x, pcDir.offsetY == 0 ? this.y: - this.y, pcDir.offsetZ == 0 ? this.z : - this.z); } - public PC_Vec3I mul(int v) { - return new PC_Vec3I(this.x*v,this.y*v,this.z*v); + return new PC_Vec3I(this.x * v, this.y * v, this.z * v); } } diff --git a/powercraft/api/PC_Vec4I.java b/powercraft/api/PC_Vec4I.java index c4e1565..976c954 100644 --- a/powercraft/api/PC_Vec4I.java +++ b/powercraft/api/PC_Vec4I.java @@ -10,12 +10,9 @@ public class PC_Vec4I implements PC_INBT { public int z; public int w; - public PC_Vec4I() { - - } + public PC_Vec4I() {} public PC_Vec4I(int _x, int _y, int _z, int _w) { - this.x = _x; this.y = _y; this.z = _z; @@ -23,14 +20,12 @@ public PC_Vec4I(int _x, int _y, int _z, int _w) { } public PC_Vec4I(PC_Vec4I vec) { - this.x = vec.x; this.y = vec.y; this.z = vec.z; this.w = vec.w; } - @SuppressWarnings("unused") public PC_Vec4I(NBTTagCompound tag, Flag flag) { this.x = tag.getInteger("x"); this.y = tag.getInteger("y"); @@ -48,7 +43,6 @@ public void saveToNBT(NBTTagCompound tag, Flag flag) { @Override public boolean equals(Object obj) { - if (obj instanceof PC_Vec4I) { PC_Vec4I vec = (PC_Vec4I) obj; return vec.x == this.x && vec.y == this.y && vec.z == this.z && vec.w == this.w; @@ -58,13 +52,11 @@ public boolean equals(Object obj) { @Override public int hashCode() { - return (this.x) ^ 78 + (this.x) ^ 34 + (this.y) ^ 12 + (this.z); } @Override public String toString() { - return "Vec4I[" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + "]"; } @@ -85,9 +77,10 @@ public void add(PC_Vec4I vec) throws NullPointerException { public static PC_Vec4I sum(PC_Vec4I... vec) { PC_Vec4I result = new PC_Vec4I(0, 0, 0, 0); for (PC_Vec4I cvec : vec) { - try { + try{ result.add(cvec); - } catch (NullPointerException e) {// + }catch (NullPointerException e){ + ; } } return result; diff --git a/powercraft/api/block/PC_AbstractBlockBase.java b/powercraft/api/block/PC_AbstractBlockBase.java index e5085e1..a806d13 100644 --- a/powercraft/api/block/PC_AbstractBlockBase.java +++ b/powercraft/api/block/PC_AbstractBlockBase.java @@ -144,7 +144,7 @@ public final IIcon getIcon(int side, int metadata) { return getIcon(PC_Direction.fromSide(side), metadata); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public List getCollisionBoundingBoxes(World world, int x, int y, int z, Entity entity){ return null; } @@ -197,7 +197,7 @@ public final AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, in return PC_Utils.rotateAABB(world, x, y, z, box).offset(x, y, z); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, PC_Direction side) { return false; } @@ -221,12 +221,11 @@ public final int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, return 0; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canProvideStrongPower(IBlockAccess world, int x, int y, int z, PC_Direction side){ return true; } - @SuppressWarnings("unused") public boolean canRedstoneConnect(IBlockAccess world, int x, int y, int z, PC_Direction side, int faceSide){ return canProvidePower(); } @@ -236,7 +235,7 @@ public final boolean canRedstoneConnectTo(World world, int x, int y, int z, PC_D return canRedstoneConnect(world, x, y, z, PC_Utils.getSidePosition(world, x, y, z, side), PC_Utils.getSideRotation(world, x, y, z, side, faceSide)); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public int getRedstonePowerValue(IBlockAccess world, int x, int y, int z, PC_Direction side, int faceSide){ return 0; } @@ -246,7 +245,6 @@ public final int getRedstonePower(World world, int x, int y, int z, PC_Direction return getRedstonePowerValue(world, x, y, z, PC_Utils.getSidePosition(world, x, y, z, side), PC_Utils.getSideRotation(world, x, y, z, side, faceSide)); } - @SuppressWarnings("unused") public void setRedstonePowerValue(World world, int x, int y, int z, PC_Direction side, int faceSide, int value){ // } @@ -256,7 +254,7 @@ public final void setRedstonePower(World world, int x, int y, int z, PC_Directio setRedstonePowerValue(world, x, y, z, PC_Utils.getSidePosition(world, x, y, z, side), PC_Utils.getSideRotation(world, x, y, z, side, faceSide), value); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public int getComparatorInput(World world, int x, int y, int z, PC_Direction side) { return 0; } @@ -272,7 +270,6 @@ public final void registerBlockIcons(IIconRegister iconRegister) { registerIcons(PC_ClientRegistry.getIconRegistry(iconRegister, this)); } - @SuppressWarnings("unused") public void registerIcons(PC_IconRegistry iconRegistry){ // } @@ -327,7 +324,7 @@ public final boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, return canRedstoneConnect(world, x, y, z, PC_Utils.getSidePosition(world, x, y, z, side), -1); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, PC_Direction side, IPlantable plantable) { return false; } @@ -347,7 +344,7 @@ public final ForgeDirection[] getValidRotations(World world, int x, int y, int z return PC_Utils.getValidRotations(world, x, y, z); } - @SuppressWarnings({ "unused", "static-method" }) + @SuppressWarnings({ "static-method" }) public boolean recolourBlock(World world, int x, int y, int z, PC_Direction side, int colour) { return false; } @@ -357,7 +354,6 @@ public final boolean recolourBlock(World world, int x, int y, int z, ForgeDirect return recolourBlock(world, x, y, z, PC_Utils.getSidePosition(world, x, y, z, side), colour); } - @SuppressWarnings("unused") public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, PC_Direction side) { return isNormalCube(); } @@ -393,7 +389,6 @@ public int getRenderType() { return PC_Renderer.getInstance().getRenderId(); } - @SuppressWarnings("unused") public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { // } @@ -402,7 +397,7 @@ public CreativeTabs[] getCreativeTabs() { return this.creativeTabs; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public int getTemperature(World world, int x, int y, int z) { return PC_BlockTemperatures.DEFAULT_TEMPERATURE; } @@ -424,17 +419,16 @@ public boolean canPlaceBlockAt(World world, int x, int y, int z){ return canBlockStay(world, x, y, z) && super.canPlaceBlockAt(world, x, y, z); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public PC_BeamHitResult onHitByBeam(World world, int x, int y, int z, PC_IBeam beam){ return PC_BeamHitResult.STANDARD; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canBeHarvested(World world, int x, int y, int z) { return false; } - @SuppressWarnings("unused") public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean advancedItemTooltips) { // } diff --git a/powercraft/api/block/PC_BlockTileEntity.java b/powercraft/api/block/PC_BlockTileEntity.java index c2e1d30..2006730 100644 --- a/powercraft/api/block/PC_BlockTileEntity.java +++ b/powercraft/api/block/PC_BlockTileEntity.java @@ -546,7 +546,7 @@ public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, i int metadata = PC_Utils.getMetadata(world, x, y, z); if(canHarvestBlock(player, metadata)){ onHarvestBlock(world, player, x, y, z); - return super.removedByPlayer(world, player, x, y, z, false); + return super.removedByPlayer(world, player, x, y, z); } return false; } diff --git a/powercraft/api/block/PC_GuiPasswordInput.java b/powercraft/api/block/PC_GuiPasswordInput.java index bcd4f92..594b71c 100644 --- a/powercraft/api/block/PC_GuiPasswordInput.java +++ b/powercraft/api/block/PC_GuiPasswordInput.java @@ -32,7 +32,6 @@ final class PC_GuiPasswordInput implements PC_IGresGui, PC_IGresEventListener { this.tileEntity = tileEntity; } - @SuppressWarnings("hiding") @Override public void initGui(PC_GresGuiHandler gui) { this.gui = gui; diff --git a/powercraft/api/block/PC_ItemBlock.java b/powercraft/api/block/PC_ItemBlock.java index 4cd8193..4bf4923 100644 --- a/powercraft/api/block/PC_ItemBlock.java +++ b/powercraft/api/block/PC_ItemBlock.java @@ -78,7 +78,6 @@ public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, return false; } - @SuppressWarnings("unused") public int getMetadata(World world, ItemStack itemStack) { return getMetadata(itemStack); } @@ -124,7 +123,6 @@ public final void registerIcons(IIconRegister iconRegister) { registerIcons(PC_ClientRegistry.getIconRegistry(iconRegister, this)); } - @SuppressWarnings("unused") public void registerIcons(PC_IconRegistry iconRegistry){ // } diff --git a/powercraft/api/block/PC_TileEntity.java b/powercraft/api/block/PC_TileEntity.java index 043c1ea..0cc360a 100644 --- a/powercraft/api/block/PC_TileEntity.java +++ b/powercraft/api/block/PC_TileEntity.java @@ -125,7 +125,6 @@ public void randomDisplayTick() { // } - @SuppressWarnings("unused") public void onNeighborBlockChange(Block neighbor) { int newRedstoneValue = PC_Utils.getRedstoneValue(this.worldObj, this.xCoord, this.yCoord, this.zCoord); updateRedstone(newRedstoneValue); @@ -243,22 +242,19 @@ public void lightUpdate() { this.worldObj.func_147451_t(this.xCoord, this.yCoord, this.zCoord); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public float getPlayerRelativeHardness(EntityPlayer player) { return Float.NaN; } - @SuppressWarnings("unused") public void onEntityWalking(Entity entity) { // } - @SuppressWarnings("unused") public void onBlockClicked(EntityPlayer player) { // } - @SuppressWarnings("unused") public void velocityToAddToEntity(Entity entity, Vec3 velocity) { // } @@ -268,12 +264,10 @@ public int getColorMultiplier() { return 16777215; } - @SuppressWarnings("unused") public void onEntityCollidedWithBlock(Entity entity) { // } - @SuppressWarnings("unused") public void onFallenUpon(Entity entity, float fallDistance) { // } @@ -291,7 +285,7 @@ public int getLightValue() { return -1; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean isLadder(EntityLivingBase entity) { return false; } @@ -301,12 +295,12 @@ public boolean isBurning() { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public ArrayList getDrops(int fortune) { return null; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canCreatureSpawn(EnumCreatureType type) { return false; } @@ -316,23 +310,22 @@ public boolean canSustainLeaves() { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public float getExplosionResistance(Entity entity, double explosionX, double explosionY, double explosionZ) { return Float.NaN; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public ItemStack getPickBlock(MovingObjectPosition target) { return null; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @SideOnly(Side.CLIENT) public boolean addDestroyEffects(EffectRenderer effectRenderer) { return false; } - @SuppressWarnings("unused") public void onPlantGrow(int sourceX, int sourceY, int sourceZ) { // } @@ -347,12 +340,12 @@ public int getLightOpacity() { return -1; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canEntityDestroy(Entity entity) { return true; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean isBeaconBase(int beaconX, int beaconY, int beaconZ) { return false; } @@ -362,12 +355,10 @@ public float getEnchantPowerBonus() { return 0; } - @SuppressWarnings("unused") public void onNeighborTEChange(int tileX, int tileY, int tileZ) { // } - @SuppressWarnings("unused") public void onBlockPostSet(PC_Direction side, ItemStack stack, EntityPlayer player, float hitX, float hitY, float hitZ) { // @@ -378,12 +369,12 @@ public PC_3DRotation get3DRotation() { return null; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public IIcon getIcon(PC_Direction side) { return null; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public List getCollisionBoundingBoxes(Entity entity) { return null; } @@ -399,7 +390,6 @@ public AxisAlignedBB getSelectedBoundingBox() { return null; } - @SuppressWarnings("unused") public boolean onBlockActivated(EntityPlayer player, PC_Direction side) { if (this instanceof PC_IGresGuiOpenHandler) { @@ -425,52 +415,50 @@ public boolean onBlockActivated(EntityPlayer player, PC_Direction side) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public int getComparatorInput(PC_Direction side) { return 0; } - @SuppressWarnings("unused") public boolean isSideSolid(PC_Direction side) { return getBlockType().isNormalCube(this.worldObj, this.xCoord, this.yCoord, this.zCoord); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public int getFlammability(PC_Direction side) { return 0; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean isFlammable(PC_Direction side) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public int getFireSpreadSpeed(PC_Direction side) { return 0; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean isFireSource(PC_Direction side) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canSilkHarvest(EntityPlayer player) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canSustainPlant(PC_Direction side, IPlantable plantable) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean recolourBlock(PC_Direction side, int colour) { return false; } - @SuppressWarnings("unused") public boolean shouldCheckWeakPower(PC_Direction side) { return getBlockType().isNormalCube(); } @@ -485,17 +473,15 @@ public boolean canRotate() { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean set3DRotation(PC_3DRotation rotation) { return false; } - @SuppressWarnings("unused") public void openContainer(Container container) { // } - @SuppressWarnings("unused") public void closeContainer(Container container) { // } @@ -613,7 +599,6 @@ public void writeToNBT(NBTTagCompound nbtTagCompound) { super.writeToNBT(nbtTagCompound); } - @SuppressWarnings("unused") public void onLoadedFromNBT(Flag flag) { // } @@ -626,7 +611,6 @@ public final boolean canDoWithPassword(EntityPlayer player) { return this.owner == null || this.owner.equals(player.getGameProfile().getName()) || this.password != null; } - @SuppressWarnings("hiding") public final boolean checkPassword(EntityPlayer player, String password) { return canDoWithoutPassword(player) || (this.password != null && this.password.equals(password)); } @@ -644,7 +628,6 @@ public final boolean setPassword(EntityPlayer player, String newPassword) { return false; } - @SuppressWarnings("hiding") public final boolean guiOpenPasswordReply(EntityPlayer player, String password) { String md5password = PC_Utils.getMD5(password); if (checkPassword(player, md5password)) { @@ -665,7 +648,6 @@ public void setSession(long session) { this.session = session; } - @SuppressWarnings("hiding") public long getNewSession(EntityPlayer player) { if (isClient()) return 0; @@ -715,22 +697,19 @@ public boolean renderWorldBlock(int modelId, RenderBlocks renderer) { modelId, renderer); } - @SuppressWarnings("unused") public boolean canRedstoneConnect(PC_Direction side, int faceSide) { return getBlockType().canProvidePower(); } - @SuppressWarnings({ "unused", "static-method" }) + @SuppressWarnings({ "static-method" }) public int getRedstonePowerValue(PC_Direction side, int faceSide) { return 0; } - @SuppressWarnings("unused") public void setRedstonePowerValue(PC_Direction side, int faceSide, int value) { updateRedstone(value); } - @SuppressWarnings("hiding") public final void onClientMessageCheck(EntityPlayer player, NBTTagCompound nbtTagCompound, long session, boolean intern) { Session pSession = sessions.get(player); @@ -752,7 +731,6 @@ public void onClientMessage(EntityPlayer player, NBTTagCompound nbtTagCompound) onMessage(player, nbtTagCompound); } - @SuppressWarnings("unused") public void onInternMessage(EntityPlayer player, NBTTagCompound nbtTagCompound) { if (nbtTagCompound.getInteger("type") == 0) { if (nbtTagCompound.hasKey("workWhen")) { @@ -763,7 +741,6 @@ public void onInternMessage(EntityPlayer player, NBTTagCompound nbtTagCompound) } } - @SuppressWarnings("unused") public void onMessage(EntityPlayer player, NBTTagCompound nbtTagCompound) { // } @@ -810,7 +787,6 @@ public PC_RedstoneWorkType getRedstoneWorkType() { return this.workWhen; } - @SuppressWarnings("unused") public void onAdded(EntityPlayer player) { if (this instanceof PC_IGridHolder) { ((PC_IGridHolder) this).getGridIfNull(); @@ -829,17 +805,16 @@ public int getTemperature() { return PC_BlockTemperatures.DEFAULT_TEMPERATURE; } - @SuppressWarnings("unused") public void onPreAdded(EntityPlayer player) { // } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canProvideStrongPower(PC_Direction side) { return true; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public PC_BeamHitResult onHitByBeam(PC_IBeam beam) { return PC_BeamHitResult.STANDARD; } diff --git a/powercraft/api/block/PC_TileEntityScriptable.java b/powercraft/api/block/PC_TileEntityScriptable.java index e70321b..e9fe0cc 100644 --- a/powercraft/api/block/PC_TileEntityScriptable.java +++ b/powercraft/api/block/PC_TileEntityScriptable.java @@ -54,8 +54,7 @@ protected int entryIndex(String name){ int x = Arrays.asList(vec).indexOf(name); return x==-1?0:x; } - - @SuppressWarnings("hiding") + public void setSource(String source){ this.diagnostic = null; this.script = null; @@ -91,8 +90,7 @@ public String getSource(){ protected int[] getExt(){ return this.ext; } - - @SuppressWarnings("hiding") + protected void invoke(int entryVector){ if(this.e!=null || this.script==null || isClient()) return; diff --git a/powercraft/api/building/PC_BlockDamage.java b/powercraft/api/building/PC_BlockDamage.java index a06aa31..d4662f5 100644 --- a/powercraft/api/building/PC_BlockDamage.java +++ b/powercraft/api/building/PC_BlockDamage.java @@ -25,7 +25,7 @@ import cpw.mods.fml.relauncher.SideOnly; -public final class PC_BlockDamage extends PC_WorldSaveData implements PC_ITickHandler { +public class PC_BlockDamage extends PC_WorldSaveData implements PC_ITickHandler { private static final String NAME = "powercraft-blockdamage"; diff --git a/powercraft/api/building/PC_CropHarvesting.java b/powercraft/api/building/PC_CropHarvesting.java index d9a72b9..17d775e 100644 --- a/powercraft/api/building/PC_CropHarvesting.java +++ b/powercraft/api/building/PC_CropHarvesting.java @@ -163,7 +163,6 @@ public boolean accept(File arg0, String arg1) { * * @param file the file to load */ - @SuppressWarnings("hiding") private static void parseFile(File file) { PC_XMLNode node = PC_XMLLoader.load(file); diff --git a/powercraft/api/energy/PC_EnergyNode.java b/powercraft/api/energy/PC_EnergyNode.java index f19711f..bb9fae1 100644 --- a/powercraft/api/energy/PC_EnergyNode.java +++ b/powercraft/api/energy/PC_EnergyNode.java @@ -27,12 +27,12 @@ public void onTickEnd(){ public abstract float takeEnergy(); - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public float useEnergy(float energy, float p) { return energy; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public float notUsing(float energy, float p) { return energy; } diff --git a/powercraft/api/entity/PC_Entity.java b/powercraft/api/entity/PC_Entity.java index 85df0ce..b16a0ca 100644 --- a/powercraft/api/entity/PC_Entity.java +++ b/powercraft/api/entity/PC_Entity.java @@ -113,7 +113,6 @@ public void process(Field field, Object value, }); } - @SuppressWarnings("unused") protected void onLoadedFromNBT(Flag flag) { // } @@ -147,7 +146,6 @@ public void onClientMessage(EntityPlayer player, onMessage(player, nbtTagCompound); } - @SuppressWarnings("unused") public void onMessage(EntityPlayer player, NBTTagCompound nbtTagCompound) { // } @@ -168,8 +166,7 @@ public boolean isClient() { return PC_Utils.isClient(); return this.worldObj.isRemote; } - - @SuppressWarnings("hiding") + @Override public void onClientMessageCheck(EntityPlayer player, NBTTagCompound nbtTagCompound, long session) { @@ -195,7 +192,6 @@ public final boolean canDoWithPassword(EntityPlayer player) { || this.password != null; } - @SuppressWarnings("hiding") public final boolean checkPassword(EntityPlayer player, String password) { return canDoWithoutPassword(player) || (this.password != null && this.password.equals(password)); @@ -214,7 +210,6 @@ public final boolean setPassword(EntityPlayer player, String newPassword) { return false; } - @SuppressWarnings("hiding") @Override public final boolean guiOpenPasswordReply(EntityPlayer player, String password) { @@ -238,7 +233,6 @@ public void setSession(long session) { this.session = session; } - @SuppressWarnings("hiding") @Override public long getNewSession(EntityPlayer player) { if (isClient()) diff --git a/powercraft/api/entity/PC_EntityType.java b/powercraft/api/entity/PC_EntityType.java index 4b8870a..3a28bac 100644 --- a/powercraft/api/entity/PC_EntityType.java +++ b/powercraft/api/entity/PC_EntityType.java @@ -15,8 +15,7 @@ public abstract class PC_EntityType { private final ModContainer module; - - @SuppressWarnings("unused") + private boolean constructed; private int entityTypeID; @@ -44,7 +43,6 @@ public String getRegisterName() { return getEntity().getSimpleName(); } - @SuppressWarnings("hiding") void construct() { PC_Module module = getModule(); this.entityTypeID = EntityRegistry.findGlobalUniqueEntityId(); @@ -63,7 +61,6 @@ public String getTextureFolderName() { return getEntity().getSimpleName().replaceAll("PC.*_(Entity)?", ""); } - @SuppressWarnings("unused") public void registerIcons(PC_IconRegistry iconRegistry) { // } diff --git a/powercraft/api/entity/PC_GuiPasswordInput.java b/powercraft/api/entity/PC_GuiPasswordInput.java index c6c8829..707620d 100644 --- a/powercraft/api/entity/PC_GuiPasswordInput.java +++ b/powercraft/api/entity/PC_GuiPasswordInput.java @@ -32,7 +32,6 @@ final class PC_GuiPasswordInput implements PC_IGresGui, PC_IGresEventListener { this.entity = entity; } - @SuppressWarnings("hiding") @Override public void initGui(PC_GresGuiHandler gui) { this.gui = gui; @@ -82,7 +81,6 @@ private void send(){ PC_PacketHandler.sendToServer(new PC_PacketPasswordReply2(this.entity, this.password.getText())); } - @SuppressWarnings("hiding") void wrongPassword(PC_Entity entity) { if(this.entity==entity){ this.gui.removeWorking(); diff --git a/powercraft/api/gres/PC_GresAutoCompleteWindow.java b/powercraft/api/gres/PC_GresAutoCompleteWindow.java index a28fdaf..4b1047b 100644 --- a/powercraft/api/gres/PC_GresAutoCompleteWindow.java +++ b/powercraft/api/gres/PC_GresAutoCompleteWindow.java @@ -139,7 +139,6 @@ protected void onScaleChanged(int newScale) { super.onScaleChanged(newScale); } - @SuppressWarnings("hiding") void makeAdd(PC_GresHistory history){ String text = this.listBox.getSelected(); if(text==null){ @@ -150,7 +149,6 @@ void makeAdd(PC_GresHistory history){ } } - @SuppressWarnings("hiding") private void makeAdd(String text, PC_GresHistory history){ this.textEdit.autoComplete(text.substring(this.done), history); if(!text.endsWith(".")) @@ -267,7 +265,6 @@ private static void addLabel(PC_GresContainer container, String[] s){ private static class Listener implements PC_IGresEventListener{ - @SuppressWarnings("hiding") private PC_GresAutoCompleteWindow completeWindow; Listener(PC_GresAutoCompleteWindow completeWindow) { diff --git a/powercraft/api/gres/PC_GresBaseWithInventory.java b/powercraft/api/gres/PC_GresBaseWithInventory.java index be1c71f..4713d27 100644 --- a/powercraft/api/gres/PC_GresBaseWithInventory.java +++ b/powercraft/api/gres/PC_GresBaseWithInventory.java @@ -294,7 +294,6 @@ public void markDirty() { } - @SuppressWarnings("hiding") @Override public boolean isUseableByPlayer(EntityPlayer player) { return this.inventory.isUseableByPlayer(player); @@ -389,7 +388,6 @@ protected void func_94533_d(){ this.dragSlots.clear(); } - @SuppressWarnings("hiding") @Override public ItemStack slotClick(int slotNumber, int mouseButton, int transfer, EntityPlayer player){ ItemStack itemstack = null; diff --git a/powercraft/api/gres/PC_GresCheckBox.java b/powercraft/api/gres/PC_GresCheckBox.java index 512714d..5438bd8 100644 --- a/powercraft/api/gres/PC_GresCheckBox.java +++ b/powercraft/api/gres/PC_GresCheckBox.java @@ -51,7 +51,6 @@ protected boolean handleMouseButtonDown(PC_Vec2I mouse, int buttons, int eventBu return true; } - @SuppressWarnings("hiding") public void check(boolean state) { this.state = state; } diff --git a/powercraft/api/gres/PC_GresComponent.java b/powercraft/api/gres/PC_GresComponent.java index 732d89b..afcb0da 100644 --- a/powercraft/api/gres/PC_GresComponent.java +++ b/powercraft/api/gres/PC_GresComponent.java @@ -1,6 +1,5 @@ package powercraft.api.gres; - import java.util.ArrayList; import java.util.List; @@ -37,8 +36,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -@SuppressWarnings("unused") @SideOnly(Side.CLIENT) public abstract class PC_GresComponent { @@ -510,8 +507,6 @@ protected static PC_Rect setDrawRect(PC_Rect old, PC_Rect _new, double scale, in return rect; } - - @SuppressWarnings("hiding") protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int displayHeight, float timeStamp, float zoom) { if (this.visible) { @@ -885,26 +880,20 @@ protected PC_Vec2I getTextureDefaultSize(String textureName) { return texture.getDefaultSize(); } - - @SuppressWarnings("hiding") protected void drawString(String text, int x, int y, boolean shadow) { PC_Vec2I size = fontRenderer.getStringSize(text); drawString(text, x, y, size.x, size.y, PC_GresAlign.H.LEFT, PC_GresAlign.V.TOP, shadow); } - - @SuppressWarnings("hiding") protected void drawString(String text, int x, int y, int width, PC_GresAlign.H alignH, boolean shadow) { PC_Vec2I size = fontRenderer.getStringSize(text); drawString(text, x, y, width, size.y, alignH, PC_GresAlign.V.TOP, shadow); } - @SuppressWarnings("hiding") protected void drawString(String text, int x, int y, int width, int height, PC_GresAlign.H alignH, PC_GresAlign.V alignV, boolean shadow) { drawString(text, x, y, width, height, alignH, alignV, shadow, getCState()); } - @SuppressWarnings("hiding") protected void drawString(String text, int x, int y, int width, int height, PC_GresAlign.H alignH, PC_GresAlign.V alignV, boolean shadow, int state) { int nx = x, ny = y; PC_Vec2I size = fontRenderer.getStringSize(text); diff --git a/powercraft/api/gres/PC_GresContainer.java b/powercraft/api/gres/PC_GresContainer.java index 583e57f..e61de3f 100644 --- a/powercraft/api/gres/PC_GresContainer.java +++ b/powercraft/api/gres/PC_GresContainer.java @@ -1,6 +1,5 @@ package powercraft.api.gres; - import java.util.ArrayList; import java.util.List; import java.util.ListIterator; @@ -21,8 +20,6 @@ import powercraft.api.gres.layout.PC_IGresLayout; import powercraft.api.renderer.PC_OpenGL; - -@SuppressWarnings("unused") @SideOnly(Side.CLIENT) public abstract class PC_GresContainer extends PC_GresComponent { @@ -291,8 +288,6 @@ protected void setParentEnabled(boolean enabled) { } } - - @SuppressWarnings("hiding") @Override protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int displayHeight, float timeStamp, float zoom) { @@ -342,7 +337,6 @@ protected void postPaint(PC_Rect scissor, double scale, int displayHeight, float // } - @SuppressWarnings("hiding") @Override public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { @@ -364,7 +358,6 @@ public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { return null; } - @SuppressWarnings("hiding") @Override public void getComponentsAtPosition(PC_Vec2I position, List list) { @@ -400,8 +393,6 @@ protected void onDrawTick(float timeStamp) { } } - - @SuppressWarnings("hiding") @Override public Slot getSlotAtPosition(PC_Vec2I position) { diff --git a/powercraft/api/gres/PC_GresGuiHandler.java b/powercraft/api/gres/PC_GresGuiHandler.java index a40702b..37423c3 100644 --- a/powercraft/api/gres/PC_GresGuiHandler.java +++ b/powercraft/api/gres/PC_GresGuiHandler.java @@ -195,7 +195,6 @@ protected PC_Vec2I calculatePrefSize() { } - @SuppressWarnings("hiding") @Override protected void paint(PC_Rect scissor, double scale, int displayHeight, float timeStamp, float zoom) { @@ -258,8 +257,6 @@ protected void eventUpdateScreen() { } } - - @SuppressWarnings("unused") protected void eventDrawScreen(PC_Vec2I mouse, float timeStamp) { long t = System.currentTimeMillis(); float ts = (t-this.last)/1000.0f; @@ -418,8 +415,7 @@ public void setFocus(PC_GresComponent focusedComponent) { private ItemStack getMouseItemStack(){ return this.mc.thePlayer.inventory.getItemStack(); } - - @SuppressWarnings("hiding") + private void drawMouseItemStack(PC_Vec2I mouse){ ItemStack holdItemStack = getMouseItemStack(); if (holdItemStack == null) { @@ -437,8 +433,7 @@ private void drawMouseItemStack(PC_Vec2I mouse){ PC_GresRenderer.drawItemStackAllreadyLighting(mouse.x-8, mouse.y-8, holdItemStack, text); } } - - @SuppressWarnings("unused") + private void inventoryMouseMove(PC_Vec2I mouse, int buttons){ this.slotOver = getSlotAtPosition(mouse); if(!this.takeAll && this.slotOver!=null && getMouseItemStack()!=null && this.stackSize!=-1 && this.slotClickButton!=-1 && isItemStacksCompatibleForSlot(getMouseItemStack(), this.slotOver) && canDragIntoSlot(this.slotOver)){ @@ -527,8 +522,7 @@ private void onSlotClicked(){ sendMouseClickToServer(this.slotOver.slotNumber, this.slotClickButton, 0); } } - - @SuppressWarnings("unused") + private void inventoryMouseUp(PC_Vec2I mouse, int buttons, int eventButton){ if(this.slotClickButton==eventButton && this.slotOver!=null && this.slotOver.getHasStack() && this.selectedSlots.size()<=1){ onSlotClicked(); @@ -582,8 +576,7 @@ private void sendMouseClickToServer(int slotNumber, int mouseButton, int transfe PC_PacketHandler.sendToServer(new PC_PacketClickWindow(((PC_GresBaseWithInventory)this.gui).windowId, slotNumber, mouseButton, transfer, transactionID, itemstack)); } } - - @SuppressWarnings("hiding") + protected void renderSlot(int x, int y, Slot slot) { boolean renderGray = false; String text = null; diff --git a/powercraft/api/gres/PC_GresGuiScreen.java b/powercraft/api/gres/PC_GresGuiScreen.java index 6aacde1..b64967c 100644 --- a/powercraft/api/gres/PC_GresGuiScreen.java +++ b/powercraft/api/gres/PC_GresGuiScreen.java @@ -58,26 +58,19 @@ public void handleMouseInput() { eventMouseWheel(mouse, this.buttons, eventWheel>0?1:-1); } } - - @SuppressWarnings("hiding") + private void eventMouseButtonDown(PC_Vec2I mouse, int buttons, int eventButton, boolean doubleClick) { this.guiHandler.eventMouseButtonDown(mouse, buttons, eventButton, doubleClick); } - - @SuppressWarnings("hiding") private void eventMouseButtonUp(PC_Vec2I mouse, int buttons, int eventButton) { this.guiHandler.eventMouseButtonUp(mouse, buttons, eventButton); } - - @SuppressWarnings("hiding") private void eventMouseMove(PC_Vec2I mouse, int buttons) { this.guiHandler.eventMouseMove(mouse, buttons); } - - @SuppressWarnings("hiding") private void eventMouseWheel(PC_Vec2I mouse, int buttons, int wheel) { this.guiHandler.eventMouseWheel(mouse, buttons, wheel); } diff --git a/powercraft/api/gres/PC_GresListBox.java b/powercraft/api/gres/PC_GresListBox.java index db67dba..1b76266 100644 --- a/powercraft/api/gres/PC_GresListBox.java +++ b/powercraft/api/gres/PC_GresListBox.java @@ -106,7 +106,6 @@ private int getStateForBar(int bar){ return this.enabled && this.parentEnabled ? this.mouseDown && selectBar==bar ? 2 : this.mouseOver && overBar==bar ? 1 : 0 : 3; } - @SuppressWarnings("hiding") private int drawElement(int element, int x, int y){ String text = this.elements.get(element); int state = this.enabled && this.parentEnabled ? this.selected==element ? 2 : this.mouseOverElement==element ? 1 : 0 : 3; diff --git a/powercraft/api/gres/PC_GresMultilineHighlightingTextEdit.java b/powercraft/api/gres/PC_GresMultilineHighlightingTextEdit.java index 828e5b1..dcebf2b 100644 --- a/powercraft/api/gres/PC_GresMultilineHighlightingTextEdit.java +++ b/powercraft/api/gres/PC_GresMultilineHighlightingTextEdit.java @@ -85,7 +85,6 @@ protected PC_Vec2I calculatePrefSize() { return new PC_Vec2I(300, 200); } - @SuppressWarnings("hiding") @Override protected void paint(PC_Rect scissor, double scale, int displayHeight, float timeStamp, float zoom) { @@ -199,8 +198,7 @@ private static PC_Vec2I[] sort(PC_Vec2I start, PC_Vec2I end){ return new PC_Vec2I[]{start, end}; return new PC_Vec2I[]{end, start}; } - - @SuppressWarnings("hiding") + private int drawLine(int lineNum, PC_GresDocumentLine line, int x, int y){ PC_Vec2I[] selected = sort(this.mouseSelectStart, this.mouseSelectEnd); String text = line.getHighlightedString(); @@ -426,8 +424,7 @@ private int getPixelPositionFromString(PC_Vec2I pos){ PC_GresDocumentLine line = this.document.getLine(pos.y); return PC_FontRenderer.getStringSize(PC_Formatter.substring(line.getHighlightedString(), 0, pos.x), this.fontTexture, 1.0f/this.scale).x; } - - @SuppressWarnings("hiding") + private int getPositionFromString(PC_Vec2I pos){ if(pos.y>=this.document.getLines()){ pos.y=this.document.getLines()-1; @@ -466,8 +463,7 @@ public void autoComplete(String with, PC_GresHistory history){ showCompleteWindow(history); } } - - @SuppressWarnings("hiding") + @Override protected boolean handleKeyTyped(char key, int keyCode, boolean repeat, PC_GresHistory history) { super.handleKeyTyped(key, keyCode, repeat, history); @@ -741,7 +737,6 @@ protected boolean handleKeyTyped(char key, int keyCode, boolean repeat, PC_GresH return true; } - @SuppressWarnings("hiding") private void moveViewToSelect(){ int d1 = getTextureDefaultSize(scrollHFrame).y; int d2 = getTextureDefaultSize(scrollVFrame).x; @@ -900,7 +895,6 @@ public void onLineChange(PC_GresDocumentLine line) { this.docLength -= size.y; } - @SuppressWarnings("hiding") @Override public void onLineChanged(PC_GresDocumentLine line) { String text = line.getHighlightedString(); @@ -1050,18 +1044,17 @@ private PC_Vec2I getMousePositionInStringAsCharPos(PC_Vec2I mouse){ return null; return new PC_Vec2I(x, y); } - - @SuppressWarnings("hiding") + private int getPositionFromStringAsCharPos(PC_Vec2I pos){ - if(pos.y>=this.document.getLines()){ - pos.y=this.document.getLines()-1; + if(pos.y >= this.document.getLines()){ + pos.y = this.document.getLines() - 1; } PC_GresDocumentLine line = this.document.getLine(pos.y); String text = line.getHighlightedString(); int length = PC_Formatter.removeFormatting(text).length(); - for(int i=1; i<=length; i++){ - int l = PC_FontRenderer.getStringSize(PC_Formatter.substring(text, 0, i), this.fontTexture, 1.0f/this.scale).x; - if(l>pos.x){ + for(int i = 1; i <= length; i++){ + int l = PC_FontRenderer.getStringSize(PC_Formatter.substring(text, 0, i), this.fontTexture, 1.0f / this.scale).x; + if(l > pos.x){ return i-1; } } @@ -1071,21 +1064,18 @@ private int getPositionFromStringAsCharPos(PC_Vec2I pos){ @Override protected List getTooltip(PC_Vec2I position) { PC_Vec2I pos = getMousePositionInStringAsCharPos(position); - if(pos==null) - return null; + if(pos==null) return null; PC_GresDocumentLine line = this.document.getLine(pos.y); - if(line.errors==null) + if(line.errors == null) return null; Message s = line.errors[pos.x]; - if(s==null) + if(s == null) return null; List list = new ArrayList(); String sl[] = s.getMessage().split("\n"); for(String ss:sl){ ss = ss.trim(); - if(!ss.isEmpty()){ - list.add(ss); - } + if(!ss.isEmpty()) list.add(ss); } return list; } diff --git a/powercraft/api/gres/PC_GresNeedFocusFrame.java b/powercraft/api/gres/PC_GresNeedFocusFrame.java index bbc0954..ed8e9ee 100644 --- a/powercraft/api/gres/PC_GresNeedFocusFrame.java +++ b/powercraft/api/gres/PC_GresNeedFocusFrame.java @@ -69,12 +69,11 @@ public void removeOtherAllowed(PC_GresComponent component){ this.allowedOthers.remove(component); } - @SuppressWarnings("hiding") public boolean isFocusAllowed(PC_GresComponent focus){ if(isParentOf(this, focus)) return true; for(PC_GresComponent c:this.allowedOthers){ - if(c==focus){ + if(c == focus){ return true; }else if(c instanceof PC_GresContainer){ if(isParentOf((PC_GresContainer)c, focus)) diff --git a/powercraft/api/gres/PC_GresScrollArea.java b/powercraft/api/gres/PC_GresScrollArea.java index d430cf1..f971c03 100644 --- a/powercraft/api/gres/PC_GresScrollArea.java +++ b/powercraft/api/gres/PC_GresScrollArea.java @@ -110,7 +110,6 @@ protected void setParentEnabled(boolean enabled) { this.container.setParentVisible(this.visible); } - @SuppressWarnings("hiding") @Override protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int displayHeight, float timeStamp, float zoom) { if (this.visible) { @@ -134,8 +133,6 @@ protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int dis } } - - @SuppressWarnings("hiding") @Override public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { if (this.visible) { @@ -149,7 +146,6 @@ public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { return null; } - @SuppressWarnings("hiding") @Override public void getComponentsAtPosition(PC_Vec2I position, List list) { @@ -172,7 +168,6 @@ protected void onDrawTick(float timeStamp) { this.container.onDrawTick(timeStamp); } - @SuppressWarnings("hiding") @Override public Slot getSlotAtPosition(PC_Vec2I position) { if (this.visible) { diff --git a/powercraft/api/gres/PC_GresScrollAreaZoomable.java b/powercraft/api/gres/PC_GresScrollAreaZoomable.java index d1436c5..6a05316 100644 --- a/powercraft/api/gres/PC_GresScrollAreaZoomable.java +++ b/powercraft/api/gres/PC_GresScrollAreaZoomable.java @@ -54,7 +54,6 @@ protected PC_Vec2I calculatePrefSize() { return this.container.getPrefSize().add(12); } - @SuppressWarnings("hiding") @Override protected void paint(PC_Rect scissor, double scale, int displayHeight, float timeStamp, float zoom) { if(!this.mouseDown){ @@ -96,7 +95,6 @@ protected void setParentEnabled(boolean enabled) { this.container.setParentVisible(this.visible); } - @SuppressWarnings("hiding") @Override protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int displayHeight, float timeStamp, float zoom) { if (this.visible) { @@ -121,8 +119,6 @@ protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int dis } } - - @SuppressWarnings("hiding") @Override public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { if (this.visible) { @@ -135,21 +131,19 @@ public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { } return null; } - - @SuppressWarnings("hiding") + @Override public void getComponentsAtPosition(PC_Vec2I position, List list) { if (this.visible) { PC_RectI rect = this.container.getRectScaled(); - if (rect.contains(position)&& position.x < this.rect.width-getTextureDefaultSize(scrollVFrame).x && position.y < this.rect.height-getTextureDefaultSize(scrollHFrame).y){ + if (rect.contains(position) && position.x < this.rect.width - getTextureDefaultSize(scrollVFrame).x && position.y < this.rect.height-getTextureDefaultSize(scrollHFrame).y){ this.container.getComponentsAtPosition(position.sub(rect.getLocation()), list); } list.add(this); } } - @Override protected void onTick() { this.container.onTick(); @@ -160,12 +154,11 @@ protected void onDrawTick(float timeStamp) { this.container.onDrawTick(timeStamp); } - @SuppressWarnings("hiding") @Override public Slot getSlotAtPosition(PC_Vec2I position) { if (this.visible) { PC_RectI rect = this.container.getRect(); - if (rect.contains(position) && position.x < this.rect.width-getTextureDefaultSize(scrollVFrame).x && position.y < this.rect.height-getTextureDefaultSize(scrollHFrame).y){ + if (rect.contains(position) && position.x < this.rect.width - getTextureDefaultSize(scrollVFrame).x && position.y < this.rect.height-getTextureDefaultSize(scrollHFrame).y){ Slot slot = this.container.getSlotAtPosition(position.sub(rect.getLocation())); if (slot != null) return slot; } diff --git a/powercraft/api/gres/PC_GresTab.java b/powercraft/api/gres/PC_GresTab.java index 420eed1..7c40657 100644 --- a/powercraft/api/gres/PC_GresTab.java +++ b/powercraft/api/gres/PC_GresTab.java @@ -80,7 +80,6 @@ protected PC_Vec2I calculatePrefSize() { return this.children.size()>0?this.children.get(0).getPrefSize():new PC_Vec2I(-1, -1); } - @SuppressWarnings("hiding") @Override protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int displayHeight, float timeStamp, float zoom) { @@ -139,7 +138,6 @@ private float getTabScrollProz(){ return this.tabsScroll/(float)over; } - @SuppressWarnings("hiding") @Override public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { @@ -156,7 +154,6 @@ public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { return null; } - @SuppressWarnings("hiding") @Override public void getComponentsAtPosition(PC_Vec2I position, List list) { @@ -170,12 +167,11 @@ public void getComponentsAtPosition(PC_Vec2I position, List li list.add(this); } } - - @SuppressWarnings("hiding") + @Override public Slot getSlotAtPosition(PC_Vec2I position) { - if (this.visible && this.children.size()>0) { + if (this.visible && this.children.size() > 0) { PC_Vec2I nposition = position.sub(this.frame.getLocation()); PC_GresComponent child = this.children.get(0); PC_RectI rect = child.getRect(); @@ -196,7 +192,7 @@ protected void tryActionOnKeyTyped(char key, int keyCode, boolean repeat, PC_Gre } private void clampTabScroll(){ - if(this.tabsScroll<0){ + if(this.tabsScroll < 0){ this.tabsScroll = 0; }else{ int width = 0; @@ -204,7 +200,7 @@ private void clampTabScroll(){ width += fontRenderer.getStringSize(tab.tab).x+4; } int over = width-(this.rect.width-2); - if(over<0){ + if(over < 0){ this.tabsScroll = 0; }else{ if(this.tabsScroll>over){ diff --git a/powercraft/api/gres/PC_GresWindow.java b/powercraft/api/gres/PC_GresWindow.java index 5d8682c..2f0f0b9 100644 --- a/powercraft/api/gres/PC_GresWindow.java +++ b/powercraft/api/gres/PC_GresWindow.java @@ -120,7 +120,6 @@ protected void paint(PC_Rect scissor, double scale, int displayHeight, float tim drawString(this.text, this.frame.x, 4, this.rect.width - this.frame.width - this.frame.x, PC_GresAlign.H.CENTER, false); } - @SuppressWarnings("hiding") @Override protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int displayHeight, float timeStamp, float zoom) { if (this.visible) { @@ -158,7 +157,6 @@ protected void doPaint(PC_Vec2 offset, PC_Rect scissorOld, double scale, int dis } } - @SuppressWarnings("hiding") @Override public PC_GresComponent getComponentAtPosition(PC_Vec2I position) { PC_GresComponent component = super.getComponentAtPosition(position); @@ -198,7 +196,6 @@ protected void onDrawTick(float timeStamp) { } } - @SuppressWarnings("hiding") @Override public Slot getSlotAtPosition(PC_Vec2I position) { Slot slot = super.getSlotAtPosition(position); diff --git a/powercraft/api/gres/nodesys/PC_GresNodesysEntry.java b/powercraft/api/gres/nodesys/PC_GresNodesysEntry.java index 7540a6b..f517ada 100644 --- a/powercraft/api/gres/nodesys/PC_GresNodesysEntry.java +++ b/powercraft/api/gres/nodesys/PC_GresNodesysEntry.java @@ -51,7 +51,6 @@ public void add(PC_GresComponent component){ } } - @SuppressWarnings("hiding") @Override protected PC_Vec2I calculateMinSize() { PC_Vec2I min = new PC_Vec2I(PC_GresNodesysConnection.RADIUS_DETECTION*4, PC_GresNodesysConnection.RADIUS_DETECTION*2); @@ -98,7 +97,6 @@ protected PC_Vec2I calculatePrefSize() { return calculateMinSize(); } - @SuppressWarnings("hiding") @Override public void updateLayout() { if(this.rv){ @@ -116,7 +114,6 @@ public void updateLayout() { } } - @SuppressWarnings("hiding") @Override protected void paint(PC_Rect scissor, double scale, int displayHeight, float timeStamp, float zoom) { if(!this.rv) diff --git a/powercraft/api/gres/nodesys/PC_GresNodesysNode.java b/powercraft/api/gres/nodesys/PC_GresNodesysNode.java index d8dc72e..0dd8558 100644 --- a/powercraft/api/gres/nodesys/PC_GresNodesysNode.java +++ b/powercraft/api/gres/nodesys/PC_GresNodesysNode.java @@ -231,7 +231,6 @@ public int getCState(){ return this.enabled && this.parentEnabled ? selected.contains(this) ? selected.get(selected.size()-1)==this ? 1 : 2 : 0 : 3; } - @SuppressWarnings("hiding") @Override protected boolean handleMouseButtonDown(PC_Vec2I mouse, int buttons, int eventButton, boolean doubleClick, PC_GresHistory history) { PC_Vec2I max = new PC_Vec2I(); diff --git a/powercraft/api/grid/PC_Grid.java b/powercraft/api/grid/PC_Grid.java index 6347c56..e21b025 100644 --- a/powercraft/api/grid/PC_Grid.java +++ b/powercraft/api/grid/PC_Grid.java @@ -71,7 +71,7 @@ protected void destroy(){ // } - @SuppressWarnings({ "unchecked", "hiding" }) + @SuppressWarnings({ "unchecked" }) protected void addAll(List nodes, List edges){ this.nodes.addAll(nodes); this.edges.addAll(edges); @@ -134,7 +134,6 @@ protected void splitGridsIfAble(){ } } - @SuppressWarnings({ "unused", "hiding" }) protected void moveToOtherGrid(List nodes, List edges){ // } diff --git a/powercraft/api/grid/PC_Node.java b/powercraft/api/grid/PC_Node.java index bf0c15c..23dd5f2 100644 --- a/powercraft/api/grid/PC_Node.java +++ b/powercraft/api/grid/PC_Node.java @@ -18,7 +18,6 @@ protected boolean canBecomeEdge(){ return true; } - @SuppressWarnings("hiding") @Override protected boolean hasTile(T tile) { return this.tile==tile; @@ -28,7 +27,7 @@ protected void replaceEdge(E edge, E replace){ this.edges.set(this.edges.indexOf(edge), replace); } - @SuppressWarnings({ "unchecked", "hiding" }) + @SuppressWarnings({ "unchecked" }) @Override protected N getAsNode(T tile) { return (N) this; diff --git a/powercraft/api/inventory/PC_Inventory.java b/powercraft/api/inventory/PC_Inventory.java index f65c6dc..1f56d47 100644 --- a/powercraft/api/inventory/PC_Inventory.java +++ b/powercraft/api/inventory/PC_Inventory.java @@ -23,7 +23,6 @@ public class PC_Inventory implements IInventory, Iterable, PC_INBT { private final int flags; private IInventory parentInventory; - @SuppressWarnings("unused") public PC_Inventory(NBTTagCompound tag, Flag flag){ this.name = tag.getString("name"); this.stackLimit = tag.getInteger("stackLimit"); diff --git a/powercraft/api/item/PC_Item.java b/powercraft/api/item/PC_Item.java index a063577..5dea17c 100644 --- a/powercraft/api/item/PC_Item.java +++ b/powercraft/api/item/PC_Item.java @@ -73,7 +73,6 @@ public Item setCreativeTab(CreativeTabs creativeTab) { } @Override - @SuppressWarnings("hiding") public final void construct() { PC_Module module = getModule(); setUnlocalizedName(getRegisterName()); @@ -105,7 +104,6 @@ public final void registerIcons(IIconRegister iconRegister) { registerIcons(PC_ClientRegistry.getIconRegistry(iconRegister, this)); } - @SuppressWarnings("unused") public void registerIcons(PC_IconRegistry iconRegistry){ // } @@ -130,19 +128,18 @@ public float updateDigSpeed(ItemStack itemStack, float speed, int x, int y, int return speed; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @SideOnly(Side.CLIENT) public boolean handleRenderType(ItemStack itemStack, ItemRenderType type) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @SideOnly(Side.CLIENT) public boolean shouldUseRenderHelper(ItemStack itemStack, ItemRenderType type, ItemRendererHelper helper) { return false; } - @SuppressWarnings("unused") @SideOnly(Side.CLIENT) public void renderItem(ItemStack itemStack, ItemRenderType type, Object[] data) { // diff --git a/powercraft/api/item/PC_ItemArmor.java b/powercraft/api/item/PC_ItemArmor.java index 42b836a..3abd82e 100644 --- a/powercraft/api/item/PC_ItemArmor.java +++ b/powercraft/api/item/PC_ItemArmor.java @@ -82,7 +82,6 @@ public Item setCreativeTab(CreativeTabs creativeTab) { } @Override - @SuppressWarnings("hiding") public final void construct() { PC_Module module = getModule(); setUnlocalizedName(getRegisterName()); @@ -109,7 +108,6 @@ public final void registerIcons(IIconRegister iconRegister) { registerIcons(PC_ClientRegistry.getIconRegistry(iconRegister, this)); } - @SuppressWarnings("unused") public void registerIcons(PC_IconRegistry iconRegistry){ // } @@ -134,19 +132,18 @@ public float updateDigSpeed(ItemStack itemStack, float speed, int x, int y, int return speed; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @SideOnly(Side.CLIENT) public boolean handleRenderType(ItemStack itemStack, ItemRenderType type) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @SideOnly(Side.CLIENT) public boolean shouldUseRenderHelper(ItemStack itemStack, ItemRenderType type, ItemRendererHelper helper) { return false; } - @SuppressWarnings("unused") @SideOnly(Side.CLIENT) public void renderItem(ItemStack itemStack, ItemRenderType type, Object[] data) { // @@ -172,7 +169,6 @@ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String t return getModule().getName()+":textures/items/"+getTextureFolderName()+"/"+this.textureName+".png"; } - @SuppressWarnings("hiding") @Override public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { return this.armorType==armorType; diff --git a/powercraft/api/item/PC_ItemTool.java b/powercraft/api/item/PC_ItemTool.java index b7a3ba1..914906d 100644 --- a/powercraft/api/item/PC_ItemTool.java +++ b/powercraft/api/item/PC_ItemTool.java @@ -102,7 +102,6 @@ public Item setCreativeTab(CreativeTabs creativeTab) { } @Override - @SuppressWarnings("hiding") public final void construct() { PC_Module module = getModule(); setUnlocalizedName(getRegisterName()); @@ -134,7 +133,6 @@ public final void registerIcons(IIconRegister iconRegister) { registerIcons(PC_ClientRegistry.getIconRegistry(iconRegister, this)); } - @SuppressWarnings("unused") public void registerIcons(PC_IconRegistry iconRegistry){ // } @@ -159,19 +157,18 @@ public float updateDigSpeed(ItemStack itemStack, float speed, int x, int y, int return speed; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @SideOnly(Side.CLIENT) public boolean handleRenderType(ItemStack itemStack, ItemRenderType type) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) @SideOnly(Side.CLIENT) public boolean shouldUseRenderHelper(ItemStack itemStack, ItemRenderType type, ItemRendererHelper helper) { return false; } - @SuppressWarnings("unused") @SideOnly(Side.CLIENT) public void renderItem(ItemStack itemStack, ItemRenderType type, Object[] data) { // diff --git a/powercraft/api/multiblock/PC_BlockMultiblock.java b/powercraft/api/multiblock/PC_BlockMultiblock.java index 7d5dc9d..7133c0c 100644 --- a/powercraft/api/multiblock/PC_BlockMultiblock.java +++ b/powercraft/api/multiblock/PC_BlockMultiblock.java @@ -74,8 +74,7 @@ public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, } return best; } - - @SuppressWarnings("unused") + private static MovingObjectPosition doRay(World world, int x, int y, int z, Vec3 inpos, Vec3 inray, AxisAlignedBB aabb) { Vec3 pos = inpos.addVector(-x, -y, -z); Vec3 ray = inray.addVector(-x, -y, -z); @@ -86,24 +85,18 @@ private static MovingObjectPosition doRay(World world, int x, int y, int z, Vec3 Vec3 vecZmin = pos.getIntermediateWithZValue(ray, aabb.minZ); Vec3 vecZmax = pos.getIntermediateWithZValue(ray, aabb.maxZ); - if (!isVecInsideYZBounds(vecXmin, aabb)){ + if (!isVecInsideYZBounds(vecXmin, aabb)) vecXmin = null; - } - if (!isVecInsideYZBounds(vecXmax, aabb)){ + if (!isVecInsideYZBounds(vecXmax, aabb)) vecXmax = null; - } - if (!isVecInsideXZBounds(vecYmin, aabb)){ + if (!isVecInsideXZBounds(vecYmin, aabb)) vecYmin = null; - } - if (!isVecInsideXZBounds(vecYmax, aabb)){ + if (!isVecInsideXZBounds(vecYmax, aabb)) vecYmax = null; - } - if (!isVecInsideXYBounds(vecZmin, aabb)){ + if (!isVecInsideXYBounds(vecZmin, aabb)) vecZmin = null; - } - if (!isVecInsideXYBounds(vecZmax, aabb)){ + if (!isVecInsideXYBounds(vecZmax, aabb)) vecZmax = null; - } Vec3 shortestVec = vecXmin; diff --git a/powercraft/api/multiblock/PC_MultiblockItem.java b/powercraft/api/multiblock/PC_MultiblockItem.java index 43f112b..46200c1 100644 --- a/powercraft/api/multiblock/PC_MultiblockItem.java +++ b/powercraft/api/multiblock/PC_MultiblockItem.java @@ -112,8 +112,6 @@ public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World w return false; } - - @SuppressWarnings("unused") public int handleMultiblockClick(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, PC_Direction side, float xHit, float yHit, float zHit, boolean secoundTry) { PC_Direction s = side; @@ -196,7 +194,6 @@ public int handleMultiblockClick(ItemStack itemStack, EntityPlayer entityPlayer, return 0; } - @SuppressWarnings("unused") public void loadMultiblockIcons(PC_IconRegistry iconRegistry) { // } diff --git a/powercraft/api/multiblock/PC_MultiblockObject.java b/powercraft/api/multiblock/PC_MultiblockObject.java index 8c41b80..bd28eb7 100644 --- a/powercraft/api/multiblock/PC_MultiblockObject.java +++ b/powercraft/api/multiblock/PC_MultiblockObject.java @@ -102,7 +102,6 @@ public void onRemoved() { // } - @SuppressWarnings("unused") public void onClicked(EntityPlayer player) { // } @@ -111,17 +110,16 @@ public ItemStack getPickBlock() { return new ItemStack(PC_Multiblocks.getItem(this), 1, 0); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean onBlockActivated(EntityPlayer player) { return false; } - @SuppressWarnings("unused") public void onNeighborBlockChange(Block neighbor) { onChange(); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public float getPlayerRelativeHardness(EntityPlayer player) { return 0; } @@ -135,7 +133,7 @@ public int getLightValue() { return 0; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean isLadder(EntityLivingBase entity) { return false; } @@ -150,12 +148,10 @@ public float getEnchantPowerBonus() { return 0; } - @SuppressWarnings("unused") public void onNeighborTEChange(int tileX, int tileY, int tileZ) { onChange(); } - @SuppressWarnings("unused") public void renderWorldBlock(RenderBlocks renderer) { // } @@ -165,17 +161,17 @@ public boolean isSolid() { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canConnectRedstone(PC_Direction side) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canMixWith(PC_MultiblockObject multiblockObject) { return false; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public PC_MultiblockObject mixWith(PC_MultiblockObject multiblockObject) { return null; } @@ -215,7 +211,6 @@ public void markDirty(){ this.multiblock.markDirty(); } - @SuppressWarnings({ "hiding" }) public boolean isUsing(PC_MultiblockIndex index, PC_MultiblockObject multiblockObject){ return this.index == index && !canMixWith(multiblockObject); } @@ -255,7 +250,6 @@ public void process(Field field, Object value, EnumMap results) onLoadedFromNBT(flag); } - @SuppressWarnings("unused") protected void onLoadedFromNBT(Flag flag){ // } @@ -297,17 +291,16 @@ public void onChange(){ // } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public int getRedstonePowerValue(PC_Direction side) { return 0; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) public boolean canProvideStrongPower(PC_Direction side) { return true; } - - @SuppressWarnings("unused") + public > T getGridTile(int flags, Class tileClass){ if(tileClass.isAssignableFrom(getClass())){ return tileClass.cast(this); diff --git a/powercraft/api/multiblock/cable/PC_MultiblockObjectCable.java b/powercraft/api/multiblock/cable/PC_MultiblockObjectCable.java index b1d2c1a..5dc7428 100644 --- a/powercraft/api/multiblock/cable/PC_MultiblockObjectCable.java +++ b/powercraft/api/multiblock/cable/PC_MultiblockObjectCable.java @@ -49,8 +49,7 @@ public PC_MultiblockObjectCable(NBTTagCompound tagCompound, Flag flag) { protected abstract IIcon getCableCornerIcon(); protected abstract IIcon getCableSideIcon(); - - @SuppressWarnings("hiding") + protected abstract IIcon getCableLineIcon(int index); @@ -71,7 +70,6 @@ public int getSpecialConnections(int n) { return (this.specialConnection>>>(n*2))&0x3; } - @SuppressWarnings("hiding") protected int canConnectToMultiblock(PC_MultiblockObject multiblock, PC_Direction dir, PC_Direction dir2) { if (multiblock.getClass() != getClass()) return 0; PC_MultiblockObjectCable cable = (PC_MultiblockObjectCable)multiblock; @@ -83,14 +81,11 @@ protected int canConnectToMultiblock(PC_MultiblockObject multiblock, PC_Directio return cable.getMask(); } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) protected int canConnectToBlock(World world, int x, int y, int z, Block block, PC_Direction dir, PC_Direction dir2) { - return 0; } - - @SuppressWarnings("hiding") private int canConnectToBlock(World world, int x, int y, int z, PC_Direction dir, PC_Direction dir2) { Block block = PC_Utils.getBlock(world, x, y, z); @@ -109,7 +104,7 @@ private int canConnectToBlock(World world, int x, int y, int z, PC_Direction dir return 0; } - @SuppressWarnings({ "static-method", "unused" }) + @SuppressWarnings({ "static-method" }) protected boolean canConnectThrough(World world, int x, int y, int z, PC_Direction dir, PC_Direction dir2){ Block block = PC_Utils.getBlock(world, x, y, z); if (block == null || block.isAir(world, x, y, z) || block instanceof PC_BlockMultiblock){ @@ -117,8 +112,7 @@ protected boolean canConnectThrough(World world, int x, int y, int z, PC_Directi } return false; } - - @SuppressWarnings("unused") + private int canConnectTo(PC_Direction dir, PC_Direction dir2, int oldConnection, int oldSpecialConnection) { World world = getWorld(); @@ -279,7 +273,6 @@ public void updateObject() { } } - @SuppressWarnings("hiding") @Override public void renderWorldBlock(RenderBlocks renderer) { int[] connections = new int[4]; diff --git a/powercraft/api/multiblock/conduit/PC_MultiblockObjectConduit.java b/powercraft/api/multiblock/conduit/PC_MultiblockObjectConduit.java index 65195de..b7706d9 100644 --- a/powercraft/api/multiblock/conduit/PC_MultiblockObjectConduit.java +++ b/powercraft/api/multiblock/conduit/PC_MultiblockObjectConduit.java @@ -62,12 +62,11 @@ public void reconnect(){ // } - @SuppressWarnings({ "unused", "static-method" }) + @SuppressWarnings({ "static-method" }) public int canConnectToBlock(World world, int x, int y, int z, PC_Direction side, Block block, int oldConnectionInfo){ return 0; } - - @SuppressWarnings("unused") + public int canConnectToMultiblock(World world, int x, int y, int z, PC_Direction side, PC_MultiblockObject multiblockObject, int oldConnectionInfo){ return multiblockObject.getClass() == getClass()?1:0; } diff --git a/powercraft/api/network/packet/PC_PacketSelectMultiblockTile2.java b/powercraft/api/network/packet/PC_PacketSelectMultiblockTile2.java index 7a93ffc..6d82ca0 100644 --- a/powercraft/api/network/packet/PC_PacketSelectMultiblockTile2.java +++ b/powercraft/api/network/packet/PC_PacketSelectMultiblockTile2.java @@ -32,8 +32,7 @@ public PC_PacketSelectMultiblockTile2(int x, int y, int z, PC_MultiblockIndex ti this.tile = tile.ordinal(); this.player = player.getEntityId(); } - - @SuppressWarnings("hiding") + @Override @SideOnly(Side.CLIENT) protected PC_Packet doAndReply(NetHandlerPlayClient iNetHandler, World world, EntityPlayer player) { diff --git a/powercraft/api/redstone/PC_RedstoneGrid.java b/powercraft/api/redstone/PC_RedstoneGrid.java index 6334622..be64f3c 100644 --- a/powercraft/api/redstone/PC_RedstoneGrid.java +++ b/powercraft/api/redstone/PC_RedstoneGrid.java @@ -12,15 +12,12 @@ public class PC_RedstoneGrid extends PC_Grid{ - Factory() { - - } + Factory(){} @Override public PC_RedstoneGrid make(PC_IRedstoneGridTile tile) { return new PC_RedstoneGrid(tile); } - } protected boolean firstTick = true; @@ -65,7 +62,6 @@ protected void removeTile(PC_IRedstoneGridTile tile) { } - @SuppressWarnings("hiding") @Override protected void addAll(List nodes, List edges) { super.addAll(nodes, edges); diff --git a/powercraft/api/reflect/PC_Reflection.java b/powercraft/api/reflect/PC_Reflection.java index ccb4383..d92b78b 100644 --- a/powercraft/api/reflect/PC_Reflection.java +++ b/powercraft/api/reflect/PC_Reflection.java @@ -347,8 +347,7 @@ public static T newInstance(Class c, Class[] types, Object...values) { } return null; } - - @SuppressWarnings("unused") + static void onSecurityException(SecurityException e){ if(!thrownSecurityExceptionBefore){ PC_Logger.warning("PowerCraft has no permission for reflection"); diff --git a/powercraft/api/renderer/PC_Renderer.java b/powercraft/api/renderer/PC_Renderer.java index 530b0fc..39ade91 100644 --- a/powercraft/api/renderer/PC_Renderer.java +++ b/powercraft/api/renderer/PC_Renderer.java @@ -107,7 +107,6 @@ public int getRenderId() { return this.renderID; } - @SuppressWarnings("unused") public static void renderBlockInInventory(Block block, int metadata, int modelId, RenderBlocks renderer){ Tessellator tessellator = Tessellator.instance; @@ -148,8 +147,7 @@ public static void renderBlockInInventory(Block block, int metadata, int modelId GL11.glTranslatef(0.5F, 0.5F, 0.5F); renderer.unlockBlockBounds(); } - - @SuppressWarnings("unused") + public static boolean renderBlockInWorld(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer){ renderer.renderStandardBlock(block, x, y, z); return true; @@ -170,8 +168,7 @@ public static void resetRotation(RenderBlocks renderer){ renderer.uvRotateWest = 0; renderer.uvRotateEast = 0; } - - @SuppressWarnings("unused") + public static void renderStandardBlockInWorld(IBlockAccess world, int x, int y, int z, IIcon[] icons, int colorMultipier, int lightValue, RenderBlocks renderer){ fakeBlock.icons = icons; fakeBlock.colorMultiplier = colorMultipier; diff --git a/powercraft/api/renderer/model/ms3d/PC_MS3DJoint.java b/powercraft/api/renderer/model/ms3d/PC_MS3DJoint.java index 27f209d..794ba52 100644 --- a/powercraft/api/renderer/model/ms3d/PC_MS3DJoint.java +++ b/powercraft/api/renderer/model/ms3d/PC_MS3DJoint.java @@ -40,8 +40,7 @@ public class PC_MS3DJoint { void setComment(String comment) { this.comment = comment; } - - @SuppressWarnings("unused") + void patch(int jointSubVersion, PC_MS3DInputStream loaderInputStream) throws IOException { this.color = loaderInputStream.readVec3(); } diff --git a/powercraft/api/renderer/model/ms3d/PC_MS3DModel.java b/powercraft/api/renderer/model/ms3d/PC_MS3DModel.java index 5531f05..e627a41 100644 --- a/powercraft/api/renderer/model/ms3d/PC_MS3DModel.java +++ b/powercraft/api/renderer/model/ms3d/PC_MS3DModel.java @@ -351,8 +351,7 @@ public void render(Entity entity, float time, float par3, float par4, float par5 renderGroup(i, matrixes); } } - - @SuppressWarnings("hiding") + private void renderGroup(int groupID, PC_Matrix[] matrixes){ PC_MS3DGroup group = this.groups[groupID]; PC_MS3DMaterial material; diff --git a/powercraft/api/script/weasel/PC_Weasel.java b/powercraft/api/script/weasel/PC_Weasel.java index 17aae7c..0fc21ce 100644 --- a/powercraft/api/script/weasel/PC_Weasel.java +++ b/powercraft/api/script/weasel/PC_Weasel.java @@ -37,7 +37,6 @@ public String translate(String message, String[] args, Locale locale) { private static PC_WeaselModule weaselModule; - @SuppressWarnings("hiding") public static void register(PC_WeaselModule weaselModule){ PC_Weasel.weaselModule = weaselModule; } diff --git a/powercraft/api/script/weasel/PC_WeaselGresEdit.java b/powercraft/api/script/weasel/PC_WeaselGresEdit.java index a912852..d2bf5a0 100644 --- a/powercraft/api/script/weasel/PC_WeaselGresEdit.java +++ b/powercraft/api/script/weasel/PC_WeaselGresEdit.java @@ -115,7 +115,6 @@ public PC_WeaselContainer getContainer(){ return this.container; } - @SuppressWarnings("hiding") @Override public void onEvent(PC_GresEvent event) { PC_GresComponent component = event.getComponent(); diff --git a/powercraft/api/script/weasel/grid/PC_WeaselGrid.java b/powercraft/api/script/weasel/grid/PC_WeaselGrid.java index ee56267..0f3ccc9 100644 --- a/powercraft/api/script/weasel/grid/PC_WeaselGrid.java +++ b/powercraft/api/script/weasel/grid/PC_WeaselGrid.java @@ -95,7 +95,6 @@ protected void removeTile(PC_IWeaselGridTile tile) { super.removeTile(tile); } - @SuppressWarnings("hiding") @Override protected void moveToOtherGrid(List nodes, List edges) { for(PC_WeaselNode node:nodes){ @@ -113,8 +112,7 @@ protected void moveToOtherGrid(List nodes, List ed } } } - - @SuppressWarnings("hiding") + @Override protected void addAll(List nodes, List edges) { for(PC_WeaselNode node:nodes){ diff --git a/powercraft/api/script/weasel/source/PC_WeaselSourceIterator.java b/powercraft/api/script/weasel/source/PC_WeaselSourceIterator.java index cbef4de..8ea5361 100644 --- a/powercraft/api/script/weasel/source/PC_WeaselSourceIterator.java +++ b/powercraft/api/script/weasel/source/PC_WeaselSourceIterator.java @@ -423,13 +423,11 @@ private void setStartLineAndPos(){ private void parserMessage(String key, Object...args){ parserMessage(key, new PC_WeaselLineDesk(this.startline, this.startlinepos, this.line, this.pos), args); } - - @SuppressWarnings("unused") + private void parserMessage(String key, PC_WeaselLineDesk lineDesk, Object...args){ // } - - @SuppressWarnings("unused") + private char preview(int p){ if(this.lineString.length()>this.pos+p){ return this.lineString.charAt(this.pos+p); diff --git a/powercraft/api/village/PC_Building.java b/powercraft/api/village/PC_Building.java index 4846561..f98c09d 100644 --- a/powercraft/api/village/PC_Building.java +++ b/powercraft/api/village/PC_Building.java @@ -25,12 +25,10 @@ public PC_Building(Class pieceClass, int pieceWeight, int pieceLimit){ this.pieceLimit = pieceLimit; } - @SuppressWarnings("unused") public int getPieceWeight(Random random, int terrainType){ return this.pieceWeight; } - @SuppressWarnings("unused") public int getPieceLimit(Random random, int terrainType){ return this.pieceLimit; }