aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/item/general
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-12-20 23:39:49 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-12-20 23:39:49 +1000
commit5715a32d2901922503fd850f3a68503fb77467c3 (patch)
tree7e12520fbc23844e99493d55af4410a785538e35 /src/Java/gtPlusPlus/core/item/general
parent2a4795f65d98ff60a177d7d6a5552fd687d9f6e8 (diff)
downloadGT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.gz
GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.bz2
GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.zip
- Disabled some logging.
% Minor Project Clean-up, added missing Override annotations to 100+ methods & removed pointless casts. % Moved Logging to it's own class. $ Fixed Multi-block handling of Pollution. $ Fixed the GT 5.09 material enabler system. (From My Side, it's still borked on GTs). + Added a Dynamic Proxy invocation for IMaterialHandler. + Added an AutoMap data type, which is a Auto-incremental ID'd Hashmap wrapper.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/general')
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java12
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java58
-rw-r--r--src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java1
-rw-r--r--src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java1
6 files changed, 40 insertions, 40 deletions
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java
index c3187ba92c..ea4d8f5a1b 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java
@@ -2,10 +2,10 @@ package gtPlusPlus.core.item.general;
import java.util.List;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.array.BlockPos;
import gtPlusPlus.core.util.entity.EntityUtils;
import gtPlusPlus.core.util.math.MathUtils;
@@ -182,7 +182,7 @@ public class ItemAreaClear extends CoreItem {
removeBlocks(world, groundBlock);
}
else {
- Utils.LOG_INFO("Filling.");
+ Logger.INFO("Filling.");
fillBlocks(world, groundBlock);
}
return super.onItemRightClick(thisItem, world, parEntity);
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
index 65aa618cb3..720005f6ae 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
@@ -3,10 +3,10 @@ package gtPlusPlus.core.item.general;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.interfaces.IItemBlueprint;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.player.PlayerUtils;
@@ -224,19 +224,19 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
if (itemStack.hasTagCompound()){
if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
//No Blueprint and no name Set
- Utils.LOG_WARNING("No Blueprint and no name Set");
+ Logger.WARNING("No Blueprint and no name Set");
return false;
}
else if (itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
//Has Blueprint but invalid name set
- Utils.LOG_WARNING("Has Blueprint but invalid name set");
+ Logger.WARNING("Has Blueprint but invalid name set");
//itemStack.stackTagCompound = null;
//createNBT(itemStack);
return false;
}
else if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && itemStack.stackTagCompound.getString("mName").equals("")){
//Has no Blueprint, but strangely has a name
- Utils.LOG_WARNING("Has no Blueprint, but strangely has a name");
+ Logger.WARNING("Has no Blueprint, but strangely has a name");
//itemStack.stackTagCompound = null;
//createNBT(itemStack);
return false;
@@ -247,7 +247,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
final int bpID = MathUtils.randInt(0, 1000);
final boolean hasRecipe = false;
final String recipeName = "";
- Utils.LOG_WARNING("Creating Blueprint, setting up it's NBT data. "+bpID);
+ Logger.WARNING("Creating Blueprint, setting up it's NBT data. "+bpID);
itemStack.stackTagCompound = new NBTTagCompound();
itemStack.stackTagCompound.setInteger("mID", bpID);
itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
@@ -258,7 +258,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
final int bpID = MathUtils.randInt(0, 1000);
final boolean hasRecipe = false;
final String recipeName = "";
- Utils.LOG_WARNING("Creating a Blueprint, setting up it's NBT data. "+bpID);
+ Logger.WARNING("Creating a Blueprint, setting up it's NBT data. "+bpID);
itemStack.stackTagCompound = new NBTTagCompound();
itemStack.stackTagCompound.setInteger("mID", bpID);
itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
index 63e0abb238..a3a8a98e6a 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
@@ -6,9 +6,9 @@ import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.player.PlayerUtils;
@@ -215,7 +215,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
if (this.getCharge(arg0) >= (1638400/4)){
if (arg1.getHealth() < arg1.getMaxHealth()){
final float rx = arg1.getMaxHealth()-arg1.getHealth();
- Utils.LOG_INFO("rx:"+rx);
+ Logger.INFO("rx:"+rx);
arg1.heal(rx*2);
this.discharge(arg0, (1638400/4)*rx, 6, true, true, false);
PlayerUtils.messagePlayer((EntityPlayer) arg1, "Your NanoBooster Whirs! Leaving you feeling stronger. It Healed "+rx+" hp.");
diff --git a/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java b/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
index e74a3f8851..1b8ab947e5 100644
--- a/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
+++ b/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
@@ -5,16 +5,14 @@ import java.util.UUID;
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.interfaces.IEntityCatcher;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.array.BlockPos;
import gtPlusPlus.core.util.nbt.NBTUtils;
import gtPlusPlus.core.util.player.PlayerUtils;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityList;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -49,22 +47,22 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
@Override
public Entity getStoredEntity(World aWorld, ItemStack aStack) {
if (aStack == null || !hasEntity(aStack)) {
- Utils.LOG_INFO("Cannot get stored entity.");
+ Logger.INFO("Cannot get stored entity.");
return null;
}
Entity mEntityToSpawn;
int mEntityID;
- Utils.LOG_WARNING("getStoredEntity(1)");
+ Logger.WARNING("getStoredEntity(1)");
mEntityID = NBTUtils.getInteger(aStack, "mEntityID");
mEntityToSpawn = EntityList.createEntityByID(mEntityID, aWorld);
if (mEntityToSpawn != null) {
- Utils.LOG_WARNING("getStoredEntity(2)");
+ Logger.WARNING("getStoredEntity(2)");
return mEntityToSpawn;
}
- Utils.LOG_INFO("Failed to get stored entity. - getStoredEntity()");
+ Logger.INFO("Failed to get stored entity. - getStoredEntity()");
return null;
}
@@ -72,11 +70,11 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity) {
if (aEntity == null) {
NBTUtils.setBoolean(aStack, "mHasEntity", false);
- Utils.LOG_INFO("Bad Entity being stored.");
+ Logger.INFO("Bad Entity being stored.");
return false;
}
- Utils.LOG_WARNING("setStoredEntity(1)");
+ Logger.WARNING("setStoredEntity(1)");
NBTTagCompound mEntityData;
Class<? extends Entity> mEntityClass;
@@ -84,7 +82,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
String mEntityName;
int mEntityID, mEntityHashcode;
UUID mUuidPersistent, mUuidUnique;
- Utils.LOG_WARNING("setStoredEntity(2)");
+ Logger.WARNING("setStoredEntity(2)");
mEntityData = aEntity.getEntityData();
mEntityClass = aEntity.getClass();
@@ -95,7 +93,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
mEntityHashcode = aEntity.hashCode();
mUuidPersistent = aEntity.getPersistentID();
mUuidUnique = aEntity.getUniqueID();
- Utils.LOG_WARNING("setStoredEntity(3)");
+ Logger.WARNING("setStoredEntity(3)");
NBTUtils.createTagCompound(aStack, "mEntityData", mEntityData);
NBTUtils.setString(aStack,"mEntityName", mEntityName);
@@ -105,7 +103,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
NBTUtils.setString(aStack,"mUuidUnique", mUuidUnique.toString());
NBTUtils.setInteger(aStack,"mEntityHashcode", mEntityHashcode);
NBTUtils.setBoolean(aStack,"mHasEntity", true);
- Utils.LOG_WARNING("setStoredEntity(4)");
+ Logger.WARNING("setStoredEntity(4)");
return true;
}
@@ -132,7 +130,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
@Override
public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos) {
if (aStack == null || !hasEntity(aStack)) {
- Utils.LOG_INFO("Cannot release, either invalid Itemstack or no entity stored.");
+ Logger.INFO("Cannot release, either invalid Itemstack or no entity stored.");
return false;
}
@@ -147,31 +145,31 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
EntityLiving mEntityToSpawn = (EntityLiving) getStoredEntity(aWorld, aStack);
Class<? extends Entity> mEntityClass = getStoredEntityClass(aStack);
- Utils.LOG_WARNING("spawnStoredEntity(1)");
+ Logger.WARNING("spawnStoredEntity(1)");
if (mEntityToSpawn != null && mEntityClass != null) {
- Utils.LOG_WARNING("spawnStoredEntity(2)");
+ Logger.WARNING("spawnStoredEntity(2)");
if (mEntityToSpawn.getEntityData() != mEntityData) {
- Utils.LOG_WARNING("spawnStoredEntity(x)");
+ Logger.WARNING("spawnStoredEntity(x)");
NBTUtils.setEntityCustomData(mEntityToSpawn, mEntityData);
}
mEntityToSpawn.setLocationAndAngles(aPos.xPos, aPos.yPos, aPos.zPos, aWorld.rand.nextFloat() * 360.0F,
0.0F);
- if (mEntityToSpawn instanceof EntityLiving) {
- ((EntityLiving) mEntityToSpawn).onSpawnWithEgg(null);
+ if (mEntityToSpawn != null) {
+ mEntityToSpawn.onSpawnWithEgg(null);
aWorld.spawnEntityInWorld(mEntityToSpawn);
- Utils.LOG_WARNING("spawnStoredEntity(3)");
+ Logger.WARNING("spawnStoredEntity(3)");
}
- if (mEntityToSpawn instanceof EntityLiving) {
- ((EntityLiving) mEntityToSpawn).playLivingSound();
- Utils.LOG_WARNING("spawnStoredEntity(4)");
+ if (mEntityToSpawn != null) {
+ mEntityToSpawn.playLivingSound();
+ Logger.WARNING("spawnStoredEntity(4)");
}
- Utils.LOG_WARNING("spawnStoredEntity(5)");
+ Logger.WARNING("spawnStoredEntity(5)");
NBTUtils.setBoolean(aStack,"mHasEntity", false);
return true;
}
- Utils.LOG_INFO("Failed to spawn stored entity. - spawnStoredEntity()");
+ Logger.INFO("Failed to spawn stored entity. - spawnStoredEntity()");
return false;
}
@@ -202,10 +200,10 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side,
float xOffset, float yOffset, float zOffset) {
if (Utils.isServer()) {
- Utils.LOG_WARNING("Trying to release (1)");
+ Logger.WARNING("Trying to release (1)");
if (NBTUtils.hasKey(itemstack,"mHasEntity")
&& NBTUtils.getBoolean(itemstack,"mHasEntity")) {
- Utils.LOG_WARNING("Trying to release (2)");
+ Logger.WARNING("Trying to release (2)");
boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y+1, z));
if (!mDidSpawn){
@@ -223,12 +221,12 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher {
@Override
public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer aPlayer, EntityLivingBase aEntity) {
if (Utils.isServer()) {
- Utils.LOG_WARNING("Trying to catch (1)");
+ Logger.WARNING("Trying to catch (1)");
if (!hasEntity(aStack)) {
- Utils.LOG_WARNING("Trying to catch (2)");
+ Logger.WARNING("Trying to catch (2)");
boolean mStored = setStoredEntity(aPlayer.worldObj, aStack, aEntity);
if (mStored) {
- Utils.LOG_WARNING("Trying to catch (3)");
+ Logger.WARNING("Trying to catch (3)");
aEntity.setDead();
PlayerUtils.messagePlayer(aPlayer, "You have captured a "+NBTUtils.getString(aStack,"mEntityName")+" in the Jar.");
//NBTUtils.tryIterateNBTData(aStack);
diff --git a/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java b/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java
index 1ed49760c0..2a98a0a13f 100644
--- a/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java
+++ b/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java
@@ -15,6 +15,7 @@ public class ItemHydrofluoricAcidPotion extends CoreItem {
super(unlocalizedName, displayName, AddToCreativeTab.tabMisc, 16, 0, description, EnumRarity.uncommon, EnumChatFormatting.GRAY, false, null);
}
+ @Override
public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
if (!player.capabilities.isCreativeMode) {
--item.stackSize;
diff --git a/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java b/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java
index 60e3550b5c..dd5db807b6 100644
--- a/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java
+++ b/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java
@@ -15,6 +15,7 @@ public class ItemSulfuricAcidPotion extends CoreItem {
super(unlocalizedName, displayName, AddToCreativeTab.tabMisc, 16, 0, description, EnumRarity.common, EnumChatFormatting.GRAY, false, null);
}
+ @Override
public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
if (!player.capabilities.isCreativeMode) {
--item.stackSize;