diff options
| author | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-24 11:54:30 +1000 |
|---|---|---|
| committer | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-24 11:54:30 +1000 |
| commit | ecf908e98ccee72a713091e8ab547e35a41d7436 (patch) | |
| tree | f0dade1481aa02fd0ac4fcf8a672cc7a761a0547 /src/Java/gtPlusPlus/core/item/base | |
| parent | b9fe3352840abe0846834cefd578895ec6f5e520 (diff) | |
| parent | fa5de3584ce7bc97ce6f32b31f6062b5b6e89e75 (diff) | |
| download | GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.gz GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.bz2 GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.zip | |
> Why does Git make me do these? arghhh...
Merge branch 'master' of https://github.com/draknyte1/GTplusplus
# Conflicts:
# src/Java/gtPlusPlus/core/material/ALLOY.java
# src/Java/gtPlusPlus/core/material/ELEMENT.java
# src/Java/gtPlusPlus/core/material/Material.java
# src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/base')
16 files changed, 215 insertions, 52 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java b/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java index c85eea4bed..8ae28fc343 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java @@ -5,8 +5,8 @@ import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -159,7 +159,7 @@ public class BaseItemDamageable extends Item { @Override public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) { - Utils.LOG_INFO("Does Leave Table? "+stack.getDisplayName()); + Logger.INFO("Does Leave Table? "+stack.getDisplayName()); return true; } @@ -175,7 +175,7 @@ public class BaseItemDamageable extends Item { @Override public boolean hasContainerItem(ItemStack stack) { - Utils.LOG_INFO("hasContainerItem? "+stack.getDisplayName()); + Logger.INFO("hasContainerItem? "+stack.getDisplayName()); return true; } diff --git a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java index 4bff33493e..04bb1d59d8 100644 --- a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java +++ b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java @@ -5,8 +5,8 @@ import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.client.renderer.texture.IIconRegister; @@ -44,7 +44,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer this.entityMODID = MODID; // DEBUG - Utils.LOG_WARNING("Spawn egg constructor for "+this.entityToSpawnName); + Logger.WARNING("Spawn egg constructor for "+this.entityToSpawnName); } /** @@ -174,7 +174,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer else { //DEBUG - Utils.LOG_WARNING("Entity not found "+this.entityToSpawnName); + Logger.WARNING("Entity not found "+this.entityToSpawnName); } } diff --git a/src/Java/gtPlusPlus/core/item/base/CoreItem.java b/src/Java/gtPlusPlus/core/item/base/CoreItem.java index 951d2050f5..8baf909af7 100644 --- a/src/Java/gtPlusPlus/core/item/base/CoreItem.java +++ b/src/Java/gtPlusPlus/core/item/base/CoreItem.java @@ -5,8 +5,8 @@ import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -175,7 +175,7 @@ public class CoreItem extends Item if (this.turnsInto != null){ if (entityHolding instanceof EntityPlayer){ - Utils.LOG_INFO("Replacing "+iStack.getDisplayName()+" with "+this.turnsInto.getDisplayName()+"."); + Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+this.turnsInto.getDisplayName()+"."); final ItemStack tempTransform = this.turnsInto; if (iStack.stackSize == 64){ tempTransform.stackSize=64; diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 6aa1f54cc8..e75d2a69e8 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -8,9 +8,9 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -48,25 +48,25 @@ public class BaseItemDust extends Item{ GameRegistry.registerItem(this, unlocalizedName); String temp = ""; - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = this.getUnlocalizedName(); } if (temp.contains("DustTiny")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else if (temp.contains("DustSmall")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } if ((temp != null) && !temp.equals("")){ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); @@ -157,7 +157,7 @@ public class BaseItemDust extends Item{ } private void addMacerationRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Dusts"); + Logger.WARNING("Adding recipe for "+this.materialName+" Dusts"); String tempIngot = this.getUnlocalizedName().replace("item.itemDust", "ingot"); final String tempDust = this.getUnlocalizedName().replace("item.itemDust", "dust"); @@ -168,17 +168,17 @@ public class BaseItemDust extends Item{ return; } - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ tempIngot = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); + Logger.WARNING("Generating OreDict Name: "+tempIngot); } else { tempIngot = this.getUnlocalizedName(); } tempIngot = tempIngot.replace("itemDust", "ingot"); - Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); + Logger.WARNING("Generating OreDict Name: "+tempIngot); final ItemStack[] outputStacks = {this.dustInfo.getDust(1)}; if ((tempIngot != null) && !tempIngot.equals("")){ tempInputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); @@ -224,30 +224,30 @@ public class BaseItemDust extends Item{ if ((temp != null) && !temp.equals("")){ if (this.dustInfo.requiresBlastFurnace()){ - Utils.LOG_WARNING("Adding recipe for Hot "+this.materialName+" Ingots in a Blast furnace."); + Logger.WARNING("Adding recipe for Hot "+this.materialName+" Ingots in a Blast furnace."); final String tempIngot = temp.replace("ingot", "ingotHot"); final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); if (null != tempOutputStack){ - Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot); + Logger.WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot); this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); } return; } - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Ingots in a furnace."); + Logger.WARNING("Adding recipe for "+this.materialName+" Ingots in a furnace."); final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); //Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); if (null != tempOutputStack){ if ((this.mTier < 5) || !this.dustInfo.requiresBlastFurnace()){ if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){ - Utils.LOG_WARNING("Successfully added a furnace recipe for "+this.materialName); + Logger.WARNING("Successfully added a furnace recipe for "+this.materialName); } else { - Utils.LOG_WARNING("Failed to add a furnace recipe for "+this.materialName); + Logger.WARNING("Failed to add a furnace recipe for "+this.materialName); } } else if ((this.mTier >= 5) || this.dustInfo.requiresBlastFurnace()){ - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Ingots in a Blast furnace."); - Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName()); + Logger.WARNING("Adding recipe for "+this.materialName+" Ingots in a Blast furnace."); + Logger.WARNING("This will produce "+tempOutputStack.getDisplayName()); if (null != tempOutputStack){ this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java index f19aaff4b3..2c32c0c8af 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java @@ -6,9 +6,9 @@ import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.StringUtils; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.entity.player.EntityPlayer; @@ -54,25 +54,25 @@ public class BaseItemDustUnique extends Item{ } String temp = ""; - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = this.getUnlocalizedName(); } if (temp.contains("DustTiny")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else if (temp.contains("DustSmall")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } if ((temp != null) && !temp.equals("")){ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java index 0467d2647e..5f737b47a0 100644 --- a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java +++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.item.base.foods; import java.util.List; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -40,7 +41,7 @@ public class BaseItemHotFood extends BaseItemFood{ if (!world.isRemote){ if(iStack.getItemDamage() == this.cooldownTime) { if (entityHolding instanceof EntityPlayer){ - Utils.LOG_INFO("Foods Done."); + Logger.INFO("Foods Done."); ((EntityPlayer) entityHolding).inventory.addItemStackToInventory(ItemUtils.getSimpleStack(this.output)); ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this); } diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java index 0933790de1..26b3ff2ce7 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.ingots; import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -28,13 +28,13 @@ public class BaseItemIngot extends BaseItemComponent{ final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9); ItemStack tempOutput = null; String temp = this.getUnlocalizedName().replace("item.itemIngot", "block"); - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } temp = temp.replace("itemIngot", "block"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); if ((temp != null) && !temp.equals("")){ tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); if (tempOutput != null){ diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java index b6f139b74a..329fae509a 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.item.base.ingots; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; @@ -44,7 +45,7 @@ public class BaseItemIngotHot extends BaseItemIngot{ } private void generateRecipe(){ - Utils.LOG_WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); + Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), 60*this.mTier); } diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java index e821258d8e..8534172bbb 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java @@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.ingots; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -67,13 +67,13 @@ public class BaseItemIngot_OLD extends Item{ final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9); ItemStack tempOutput = null; String temp = this.getUnlocalizedName().replace("item.itemIngot", "block"); - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } temp = temp.replace("itemIngot", "block"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); if ((temp != null) && !temp.equals("")){ tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); if (tempOutput != null){ diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java index 44ec66c47b..4ac7c7f5ff 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java @@ -1,8 +1,8 @@ package gtPlusPlus.core.item.base.itemblock; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.tileentities.base.TileEntityBase; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -73,7 +73,7 @@ public class ItemBlockNBT extends ItemBlock { TileEntityBase tTileEntity = (TileEntityBase) aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity != null && aPlayer != null) { if (tTileEntity.isServerSide()){ - Utils.LOG_INFO("Setting Tile Entity information"); + Logger.INFO("Setting Tile Entity information"); NBTTagCompound aNBT = GT_Utility.ItemNBT.getNBT(aStack); tTileEntity.setOwnerInformation(aNBT.getString("mOwner"), aNBT.getString("mUUID"), aNBT.getBoolean("mOP")); } diff --git a/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java index 27059e8fde..96dd2c5a16 100644 --- a/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java +++ b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java @@ -9,11 +9,8 @@ import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; -import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -80,6 +77,7 @@ public class BaseItemMisc extends Item{ @SideOnly(Side.CLIENT) private IIcon secondIcon; + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { if (this.miscType == MiscTypes.DROP && LoadedMods.Forestry){ diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java new file mode 100644 index 0000000000..f2ca40334f --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCrushedOre.java @@ -0,0 +1,10 @@ +package gtPlusPlus.core.item.base.ore; + +import gtPlusPlus.core.material.Material; + +public class BaseItemCrushedOre extends BaseOreComponent{ + + public BaseItemCrushedOre(final Material material) { + super(material, BaseOreComponent.ComponentTypes.CRUSHED); + } +} diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java new file mode 100644 index 0000000000..d06f1c912a --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -0,0 +1,153 @@ +package gtPlusPlus.core.item.base.ore; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.state.MaterialState; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.entity.EntityUtils; +import gtPlusPlus.core.util.item.ItemUtils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BaseOreComponent extends Item{ + + public final Material componentMaterial; + public final String materialName; + public final String unlocalName; + public final ComponentTypes componentType; + public final int componentColour; + public Object extraData; + + public BaseOreComponent(final Material material, final ComponentTypes componentType) { + this.componentMaterial = material; + this.unlocalName = "item"+componentType.COMPONENT_NAME+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); + this.componentType = componentType; + this.setCreativeTab(AddToCreativeTab.tabMisc); + this.setUnlocalizedName(this.unlocalName); + this.setMaxStackSize(64); + this.setTextureName(this.getCorrectTextures()); + this.componentColour = material.getRgbAsHex(); + GameRegistry.registerItem(this, this.unlocalName); + GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); + } + + public String getCorrectTextures(){ + if (!CORE.ConfigSwitches.useGregtechTextures){ + return CORE.MODID + ":" + "item"+this.componentType.COMPONENT_NAME; + } + + /*if (this.componentType == ComponentTypes.GEAR){ + return "gregtech" + ":" + "materialicons/METALLIC/" + "gearGt"; + } + else if (this.componentType == ComponentTypes.SMALLGEAR){ + return "gregtech" + ":" + "materialicons/METALLIC/" + "gearGtSmall"; + }*/ + + return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME.toLowerCase(); + } + + @Override + public String getItemStackDisplayName(final ItemStack p_77653_1_) { + if (this.componentMaterial != null) { + return (this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME); + } + return this.materialName+" Cell"; + } + + public final String getMaterialName() { + return this.materialName; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + + if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && (this.componentMaterial != null)){ + + if (this.componentMaterial != null){ + if (!this.componentMaterial.vChemicalFormula.equals("??") && !this.componentMaterial.vChemicalFormula.equals("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); + } + + if (this.componentMaterial.isRadioactive){ + list.add(CORE.GT_Tooltip_Radioactive); + } + } + + } + + super.addInformation(stack, aPlayer, list, bool); + } + + + @Override + public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { + return this.componentColour; + } + + @Override + public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { + if (this.componentMaterial != null){ + if (entityHolding instanceof EntityPlayer){ + if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){ + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.componentMaterial.vRadiationLevel, world, entityHolding); + } + } + } + } + + + + + + + + + + public static enum ComponentTypes { + DUST("Dust", " Dust", "dust"), + DUSTDIRTY("Ingot", " Ingot", "ingot"), + DUSTIMPURE("Ingot", " Ingot", "ingot"), + DUSTPURE("Ingot", " Ingot", "ingot"), + DUSTREFINED("Ingot", " Ingot", "ingot"), + CRUSHED("Ingot", " Ingot", "ingot"), + CRUSHEDCENTRIFUGED("Ingot", " Ingot", "ingot"), + CRUSHEDPURIFIED("Ingot", " Ingot", "ingot"); + + private String COMPONENT_NAME; + private String DISPLAY_NAME; + private String OREDICT_NAME; + private ComponentTypes (final String LocalName, final String DisplayName, final String OreDictName){ + this.COMPONENT_NAME = LocalName; + this.DISPLAY_NAME = DisplayName; + this.OREDICT_NAME = OreDictName; + // dust + Dirty, Impure, Pure, Refined + // crushed + centrifuged, purified + } + + public String getComponent(){ + return this.COMPONENT_NAME; + } + + public String getName(){ + return this.DISPLAY_NAME; + } + + public String getOreDictName(){ + return this.OREDICT_NAME; + } + + } + +} + + diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index 5fe7ca6424..0259a6c6f3 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.rods; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; public class BaseItemRod extends BaseItemComponent{ @@ -15,7 +15,7 @@ public class BaseItemRod extends BaseItemComponent{ private void addExtruderRecipe(){ - Utils.LOG_WARNING("Adding cutter recipe for "+this.materialName+" Rods"); + Logger.WARNING("Adding cutter recipe for "+this.materialName+" Rods"); final ItemStack stackStick = this.componentMaterial.getRod(1); final ItemStack stackBolt = this.componentMaterial.getBolt(4); diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 84d7d00472..1ac307d68c 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.rods; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -20,7 +20,7 @@ public class BaseItemRodLong extends BaseItemComponent{ } private void addExtruderRecipe(){ - Utils.LOG_WARNING("Adding recipe for Long "+this.materialName+" Rods"); + Logger.WARNING("Adding recipe for Long "+this.materialName+" Rods"); final String tempStick = this.unlocalName.replace("itemRodLong", "stick"); final String tempStickLong = this.unlocalName.replace("itemRodLong", "stickLong"); diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index f35e4834cc..733a8aa9d7 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.screws; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -15,7 +15,7 @@ public class BaseItemScrew extends BaseItemComponent{ } private void addLatheRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Screws"); + Logger.WARNING("Adding recipe for "+this.materialName+" Screws"); final ItemStack boltStack = ItemUtils.getItemStackOfAmountFromOreDict(this.unlocalName.replace("itemScrew", "bolt"), 1); if (null != boltStack){ GT_Values.RA.addLatheRecipe( |
