aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/item
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java34
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java21
2 files changed, 19 insertions, 36 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
index 2ba52eda6b..78013e9c70 100644
--- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
+++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
@@ -4,10 +4,8 @@ import net.minecraft.item.ItemStack;
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.minecraft.ItemUtils;
public class BaseItemIngot extends BaseItemComponent{
@@ -22,34 +20,18 @@ public class BaseItemIngot extends BaseItemComponent{
super(material, type);
this.materialName = material.getLocalizedName();
this.unlocalName = material.getUnlocalizedName();
- this.generateCompressorRecipe();
+ if (type != ComponentTypes.HOTINGOT) {
+ this.generateCompressorRecipe();
+ }
}
private void generateCompressorRecipe(){
- if (this.unlocalName.contains("itemIngot")){
- final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9);
- ItemStack tempOutput = null;
- String temp = this.getUnlocalizedName().replace("item.itemIngot", "block");
- Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")){
- temp = this.getUnlocalizedName().replace("item.", "");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- temp = temp.replace("itemIngot", "block");
- Logger.WARNING("Generating OreDict Name: "+temp);
- if ((temp != null) && !temp.equals("")){
- tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1);
- if (tempOutput != null){
- GT_ModHandler.addCompressionRecipe(tempStack, tempOutput);
- }
-
- }
- }
- else if (this.unlocalName.contains("itemHotIngot")){
- return;
+ final ItemStack tempStack = componentMaterial.getIngot(9);
+ final ItemStack tempOutput = componentMaterial.getBlock(1);
+ if (tempStack != null && tempOutput != null){
+ GT_ModHandler.addCompressionRecipe(tempStack, tempOutput);
}
-
-
}
+
}
diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
index 555164229b..f9acdded7e 100644
--- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
+++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
@@ -5,18 +5,21 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-
+import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
-
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
public class BaseItemIngotHot extends BaseItemIngot{
@@ -55,15 +58,13 @@ public class BaseItemIngotHot extends BaseItemIngot{
@Override
public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (!world.isRemote){
- if(this.tickCounter < this.tickCounterMax){
- this.tickCounter++;
+ if (this.componentMaterial != null){
+ if (entityHolding != null && entityHolding instanceof EntityPlayer){
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
+ EntityUtils.applyHeatDamageToEntity(1, world, entityHolding);
+ }
}
- else if(this.tickCounter == this.tickCounterMax){
- entityHolding.attackEntityFrom(DamageSource.onFire, 1);
- this.tickCounter = 0;
- }
- }
+ }
super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
}