aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/item
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-01-20 02:07:40 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-01-20 02:07:40 +1000
commita6bb1b33da251f4a2ec7a6d6facb4864e9905341 (patch)
tree84d47440794cadd5c64598355903b123e18e0662 /src/Java/gtPlusPlus/core/item
parent142fe00070526484862f15f3a125400a22a2fe96 (diff)
downloadGT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.gz
GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.bz2
GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.zip
+ Added a power cost of 32eu/action for the Tree Farmer. (Will eventually get a config option).
% Moved the internal power buffer variable out of the cut method into the class. % Massive project tidy up, lots of old unused code removed or tidied up. $ Fixed lots of String comparisons that used == instead of .equals(). $ Fixed Double/Triple/Quad null checks in certain places. $ Fixed returns that set values at the same time. $ Swapped 3.14 and 1.57 to Math.PI and Math.PI/2. $ Fixed possible cases where a NPE may be thrown, by calling logging outside of null checks. + Added PI to CORE.java, since it's a double and MC uses it as a float in each instance. - Stripped 95% of the useless code out of Meta_GT_Proxy.java
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
-rw-r--r--src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java7
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java8
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java8
10 files changed, 16 insertions, 33 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
index b9345f6f57..17af462a0f 100644
--- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
+++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
@@ -14,13 +14,11 @@ public class BaseItemCell extends BaseItemComponent{
private IIcon base;
private IIcon overlay;
- private final Material cellMaterial;
ComponentTypes Cell = ComponentTypes.CELL;
public BaseItemCell(Material material) {
super(material, BaseItemComponent.ComponentTypes.CELL);
- this.cellMaterial = material;
- fluidColour = (short[]) ((cellMaterial == null) ? extraData : cellMaterial.getRGBA());
+ fluidColour = (short[]) ((material == null) ? extraData : material.getRGBA());
}
@Override
@@ -36,8 +34,6 @@ public class BaseItemCell extends BaseItemComponent{
//this.overlay = cellMaterial.getFluid(1000).getFluid().get
}
- private int fluidBright = 0;
- private int tickValue;
private short[] fluidColour;
boolean upwards = true;
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index 696f497afc..42a610641e 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -28,14 +28,13 @@ public class BaseItemDust extends Item{
String name = "";
private int mTier;
private Material dustInfo;
- private String oredictName;
public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, int sRadioactivity) {
setUnlocalizedName(unlocalizedName);
this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(64);
this.setTextureName(getCorrectTexture(pileSize));
-
+
this.setCreativeTab(tabMisc);
this.colour = colour;
this.mTier = tier;
@@ -66,7 +65,6 @@ public class BaseItemDust extends Item{
Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
if (temp != null && !temp.equals("")){
- oredictName = temp;
GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
addFurnaceRecipe();
@@ -111,6 +109,7 @@ public class BaseItemDust extends Item{
EntityUtils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
//if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){
@@ -222,8 +221,8 @@ public class BaseItemDust extends Item{
Utils.LOG_WARNING("Adding recipe for Hot "+materialName+" Ingots in a Blast furnace.");
String tempIngot = temp.replace("ingot", "ingotHot");
ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1);
- Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot);
if (null != tempOutputStack){
+ Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot);
addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*mTier);
}
return;
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
index a49dc58188..3eab83f812 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
@@ -18,7 +18,7 @@ public abstract class BaseItemDustAbstract extends Item{
public BaseItemDustAbstract(String unlocalizedName, String materialName, int colour, String pileSize) {
this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(64);
- if (pileSize == "dust" || pileSize == "Dust"){
+ if (pileSize.toLowerCase().equals("dust")){
this.setTextureName(CORE.MODID + ":" + "dust");
}
else{
@@ -31,6 +31,7 @@ public abstract class BaseItemDustAbstract extends Item{
GameRegistry.registerItem(this, unlocalizedName);
}
+ @SuppressWarnings("rawtypes")
@Override
public abstract void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool);
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
index c90499c1ca..a4e8c1cadc 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
@@ -59,7 +59,7 @@ public class BaseItemDustUnique extends Item{
temp = temp.replace("itemD", "d");
Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
- if (temp != null && temp != ""){
+ if (temp != null && !temp.equals("")){
GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
index 3c8e09e9e5..0458a38110 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
@@ -177,7 +177,8 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
if (output != null){
setBlueprintName(stack, output.getDisplayName());
- return (hasBP = true);
+ hasBP = true;
+ return true;
}
return false;
} catch (Throwable t){
diff --git a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
index 146af86302..3f51db7047 100644
--- a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
+++ b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
@@ -8,7 +8,6 @@ import ic2.api.item.*;
import java.util.List;
-import cofh.energy.ItemEnergyContainer;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -19,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
+import cofh.energy.ItemEnergyContainer;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -125,7 +125,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem,
{
int i = 30;
- float f13 = (float)(Minecraft.getSystemTime() % 6000L) / 3000.0F * 3.141592F * 2.0F;
+ float f13 = ((float)(Minecraft.getSystemTime() % 6000L) / 3000.0F * CORE.PI * 2.0F);
float t = 0.9F + 0.1F * MathHelper.cos(f13);
diff --git a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
index 36e6c66df8..2a94456c2a 100644
--- a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
+++ b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
@@ -147,7 +147,7 @@ public class FuelRod_Base extends Item{
int r = maximumFuel - i;
return r;
}
- return getFuelRemaining(stack);
+ return 0;
}
public boolean setFuelRemainingExplicitly(int i){
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
index e278c258ba..a0b884f97d 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
@@ -27,12 +27,6 @@ public class MultiPickaxeBase extends StaballoyPickaxe{
return 0;
}
- protected Boolean FACING_HORIZONTAL = true;
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- protected ItemStack thisPickaxe = null;
protected final int colour;
protected final String materialName;
protected final String displayName;
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
index bfe78b1866..627108f509 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
@@ -6,10 +6,8 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -26,12 +24,6 @@ public class MultiSpadeBase extends StaballoySpade{
return 0;
}
- protected Boolean FACING_HORIZONTAL = true;
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- protected ItemStack thisPickaxe = null;
protected final int colour;
protected final String materialName;
protected final String displayName;
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
index 81fc2cc05e..301671fc24 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
@@ -46,7 +46,7 @@ public class StaballoyAxe extends ItemAxe{
super.addInformation(stack, aPlayer, list, bool);
}
- public boolean canIgnore(Block bit){
+ public static boolean canIgnore(Block bit){
if (bit instanceof BlockAir)return true;
if (bit instanceof BlockGrass)return true;
if (bit instanceof BlockSand)return true;
@@ -105,7 +105,7 @@ public class StaballoyAxe extends ItemAxe{
for(int x=19;x>=0;x--){
int r=check(par1World,x,y,z,xo,yo,zo);
if (r==2) return 3;
- if (r==2) return 2;
+ //if (r==2) return 2;
if (r==1) f=true;
}
}
@@ -154,7 +154,7 @@ public class StaballoyAxe extends ItemAxe{
for(int x=19;x>=0;x--){
int r=check2(par1World,x,y,z,xo,yo,zo);
if (r==2) return 3;
- if (r==2) return 2;
+ //if (r==2) return 2;
if (r==1) f=true;
}
}
@@ -178,7 +178,7 @@ public class StaballoyAxe extends ItemAxe{
}
}
- private void breakMushroom(World wld, Block bit, EntityPlayer plr, boolean silk, int x, int y, int z, int met) {
+ private static void breakMushroom(World wld, Block bit, EntityPlayer plr, boolean silk, int x, int y, int z, int met) {
if (silk){
ItemStack stk = null; //TODO
/*if (bit==Blocks.brown_mushroom_block) stk = new ItemStack(LoonToolItems.brown_mushroom_block,1,met);