aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/item/base
diff options
context:
space:
mode:
author‭huajijam <strhuaji@gmail.com>2019-03-18 20:52:30 +0800
committer‭huajijam <strhuaji@gmail.com>2019-03-18 20:52:30 +0800
commit8b090e1fd20eb4c301996b5e1dfeb78353e595e4 (patch)
tree52152dd767d195c76baa8fd8bacb14b105aaa146 /src/Java/gtPlusPlus/core/item/base
parent40d7e5da9f5b84213e2c3e4596fdc69b94bd523e (diff)
downloadGT5-Unofficial-8b090e1fd20eb4c301996b5e1dfeb78353e595e4.tar.gz
GT5-Unofficial-8b090e1fd20eb4c301996b5e1dfeb78353e595e4.tar.bz2
GT5-Unofficial-8b090e1fd20eb4c301996b5e1dfeb78353e595e4.zip
fix a bug
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/base')
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java26
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java (renamed from src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java)29
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java48
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java71
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java77
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java7
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java30
-rw-r--r--src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java4
8 files changed, 238 insertions, 54 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index 4dbb5851f2..ceeff7e655 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -8,6 +8,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.TextureSet;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.Logger;
@@ -17,11 +18,12 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
-import gtPlusPlus.xmod.thaumcraft.aspect.GTPP_Aspects;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper;
import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -66,9 +68,9 @@ public class BaseItemComponent extends Item{
GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
if (LoadedMods.Thaumcraft) {
- ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.METALLUM, 1);
+ ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1);
if (componentMaterial.isRadioactive) {
- ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.RADIO, 2);
+ ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel);
}
}
registerComponent();
@@ -76,18 +78,28 @@ public class BaseItemComponent extends Item{
//For Cell Generation
public BaseItemComponent(final String unlocalName, final String localName, final short[] RGBA) {
+
+ // Handles .'s from fluid internal names.
+ String aFormattedNameForFluids;
+ if (unlocalName.contains(".")) {
+ aFormattedNameForFluids = StringUtils.splitAndUppercase(unlocalName, ".");
+ }
+ else {
+ aFormattedNameForFluids = unlocalName;
+ }
+
this.componentMaterial = null;
- this.unlocalName = "itemCell"+unlocalName;
+ this.unlocalName = "itemCell"+aFormattedNameForFluids;
this.materialName = localName;
this.componentType = ComponentTypes.CELL;
this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(unlocalName);
+ this.setUnlocalizedName(aFormattedNameForFluids);
this.setMaxStackSize(64);
this.componentColour = MathUtils.getRgbAsHex(RGBA);
this.extraData = RGBA;
this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME);
- GameRegistry.registerItem(this, unlocalName);
- GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+unlocalName, ItemUtils.getSimpleStack(this));
+ GameRegistry.registerItem(this, aFormattedNameForFluids);
+ GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+aFormattedNameForFluids, ItemUtils.getSimpleStack(this));
registerComponent();
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java
index 84fae41bb0..96b5425437 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java
@@ -13,38 +13,30 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-public class ItemBlockFluid extends ItemBlock{
+public class FluidItemBlock extends ItemBlock{
protected final int blockColour;
- protected final int sRadiation;
- protected Material thisFluid;
final BlockFluidBase baseBlock;
String name;
- public ItemBlockFluid(final Block block) {
+ public FluidItemBlock(final Block block) {
super(block);
this.baseBlock = (BlockFluidBase) block;
this.blockColour = this.baseBlock.getRenderColor(1);
- this.thisFluid = this.baseBlock.getFluidMaterial();
- this.sRadiation=ItemUtils.getRadioactivityLevel(this.baseBlock.getUnlocalizedName());
this.name = this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", "");
//GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this));
}
- public final Material setFluidMaterial(final Material M){
- return this.thisFluid=M;
- }
-
public int getRenderColor(final int aMeta) {
return this.blockColour;
}
@Override
public String getItemStackDisplayName(final ItemStack iStack) {
- if (this.thisFluid != null){
+ /*if (this.thisFluid != null){
this.name = "Molten "+this.thisFluid.getLocalizedName();
return this.name;
- }
+ }*/
this.name = "Molten "+this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", "");
return this.name;
}
@@ -55,24 +47,15 @@ public class ItemBlockFluid extends ItemBlock{
return MathUtils.generateSingularRandomHexValue();
}
return this.blockColour;
-
}
@Override
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("Temperature: "+MathUtils.celsiusToKelvin(this.thisFluid.getMeltingPointC())+"K");
+ /*list.add("Temperature: "+MathUtils.celsiusToKelvin(this.thisFluid.getMeltingPointC())+"K");
if (this.sRadiation > 0){
list.add(CORE.GT_Tooltip_Radioactive);
- }
+ }*/
super.addInformation(stack, aPlayer, list, bool);
}
- public String GetProperName() {
- String tempIngot;
-
- tempIngot = "Molten "+this.baseBlock.getLocalizedName();
-
- return tempIngot;
- }
-
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
index 517e3f7c1f..396689ef63 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
@@ -15,6 +15,7 @@ import gtPlusPlus.core.block.base.BlockBaseOre;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialStack;
+import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
@@ -44,7 +45,16 @@ public class ItemBlockGtBlock extends ItemBlock {
this.blockColour = block.getBlockColor();
} else {
this.blockColour = block.getBlockColor();
+ }
+
+ if (block instanceof BlockBaseModular){
+ BlockBaseModular g = (BlockBaseModular) block;
+ this.mMaterial = g.getMaterialEx();
+ }
+ else {
+ this.mMaterial = null;
}
+
// GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block",
// "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block",
// "").replace("-", "").replace("_", "").replace(" ", ""),
@@ -59,24 +69,32 @@ public class ItemBlockGtBlock extends ItemBlock {
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
if (this.mMaterial != null) {
- list.add(this.mMaterial.vChemicalFormula);
- if (this.mMaterial.vRadiationLevel > 0) {
- list.add(CORE.GT_Tooltip_Radioactive);
- }
+ list.add(this.mMaterial.vChemicalFormula);
} else {
- list.add("Material is Null.");
+
+ try {
+ BlockBaseModular g = (BlockBaseModular) thisBlock;
+ this.mMaterial = g.getMaterialEx();
+ }
+ catch (Throwable t) {
+
+ }
+
+
+ //list.add("Material is Null.");
}
+ if (this.isOre) {
if (KeyboardUtils.isCtrlKeyDown()) {
Block b = Block.getBlockFromItem(stack.getItem());
if (b != null) {
String aTool = b.getHarvestTool(stack.getItemDamage());
int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
- list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
if (this.mMaterial != null) {
- list.add("Ore contains: ");
+ list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
+ list.add("Contains: ");
if (mMaterial.getComposites().isEmpty()) {
list.add("- " + mMaterial.getLocalizedName());
} else {
@@ -89,6 +107,22 @@ public class ItemBlockGtBlock extends ItemBlock {
} else {
list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
}
+ }
+ else {
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+ list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
+ }
+ }
+
+ if (this.mMaterial != null) {
+ if (this.mMaterial.vRadiationLevel > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ }
+
super.addInformation(stack, aPlayer, list, bool);
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
index 74dd2f196c..0dd125bf7b 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
@@ -1,18 +1,45 @@
package gtPlusPlus.core.item.base.itemblock;
import net.minecraft.block.Block;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
+import java.util.List;
import gtPlusPlus.core.block.base.BlockBaseModular;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.material.MaterialStack;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
public class ItemBlockGtFrameBox extends ItemBlock{
protected int blockColour;
+ private Material mMaterial;
+ private int sRadiation;
public ItemBlockGtFrameBox(final Block block) {
super(block);
final BlockBaseModular baseBlock = (BlockBaseModular) block;
this.blockColour = baseBlock.getRenderColor(1);
+
+
+
+ if (block instanceof BlockBaseModular){
+ BlockBaseModular g = (BlockBaseModular) block;
+ this.mMaterial = g.getMaterialEx();
+ sRadiation = mMaterial.vRadiationLevel;
+ }
+ else {
+ this.mMaterial = null;
+ sRadiation = 0;
+ }
+
//GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), ItemUtils.getSimpleStack(this));
}
@@ -20,4 +47,48 @@ public class ItemBlockGtFrameBox extends ItemBlock{
return this.blockColour;
}
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ if (this.mMaterial != null) {
+ list.add(this.mMaterial.vChemicalFormula);
+ if (this.mMaterial.vRadiationLevel > 0) {
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ } else {
+ list.add("Material is Null.");
+ }
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+ list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
+ if (this.mMaterial != null) {
+ list.add("Contains: ");
+ if (mMaterial.getComposites().isEmpty()) {
+ list.add("- " + mMaterial.getLocalizedName());
+ } else {
+ for (MaterialStack m : mMaterial.getComposites()) {
+ list.add("- " + m.getStackMaterial().getLocalizedName() + " x" + m.getPartsPerOneHundred());
+ }
+ }
+ }
+ }
+ } else {
+ list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @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.sRadiation > 0) {
+ EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding);
+ }
+ }
+
+
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
index 1d48bbbbf9..b26ac67225 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java
@@ -1,8 +1,14 @@
package gtPlusPlus.core.item.base.itemblock;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlockWithMetadata;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@@ -10,13 +16,36 @@ import net.minecraft.util.IIcon;
public class ItemBlockMeta extends ItemBlockWithMetadata
{
private final Block mBlock;
+ private HashMap<Integer, AutoMap<String>> aTooltips = new LinkedHashMap<Integer, AutoMap<String>>();
- public ItemBlockMeta(final Block p_i45326_1_)
+ public ItemBlockMeta(final Block aBlock)
{
- super(p_i45326_1_, p_i45326_1_);
- this.mBlock = p_i45326_1_;
+ super(aBlock, aBlock);
+ this.mBlock = aBlock;
this.setMaxDamage(0);
this.setHasSubtypes(true);
+ if (aBlock instanceof ITileTooltip) {
+ ITileTooltip aTooltip = (ITileTooltip) aBlock;
+ //aTooltips.put(aTooltip.getTooltipID(), aTooltip.getTooltipMap());
+ }
+ }
+
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ Block aThis = Block.getBlockFromItem(stack.getItem());
+ if (aThis != null) {
+ if (!aTooltips.isEmpty()) {
+ AutoMap<String> h = aTooltips.get(stack.getItemDamage());
+ if (h != null && !h.isEmpty()) {
+ for (String s : h) {
+ list.add(s);
+ }
+ }
+ }
+ }
+ super.addInformation(stack, aPlayer, list, bool);
}
/**
@@ -42,4 +71,44 @@ public class ItemBlockMeta extends ItemBlockWithMetadata
public String getUnlocalizedName(final ItemStack stack) {
return this.getUnlocalizedName() + "." + stack.getItemDamage();
}
+
+ @Override
+ public boolean isDamageable() {
+ return false;
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
+ return false;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
+ return false;
+ }
+
+ @Override
+ public int getDisplayDamage(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getItemEnchantability(ItemStack stack) {
+ return 0;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
index 2b3f477c56..de47ed8225 100644
--- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
@@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TC_Aspects;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
@@ -26,7 +27,7 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.thaumcraft.aspect.GTPP_Aspects;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper;
import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils;
public class BaseOreComponent extends Item{
@@ -57,9 +58,9 @@ public class BaseOreComponent extends Item{
registerComponent();
GT_OreDictUnificator.registerOre(componentType.getComponent()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
if (LoadedMods.Thaumcraft) {
- ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.METALLUM, 2);
+ ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1);
if (componentMaterial.isRadioactive) {
- ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.RADIO, 4);
+ ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
index b6a5dff2ac..eaa0905c93 100644
--- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
+++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
@@ -14,22 +14,36 @@ public class BaseItemRod extends BaseItemComponent{
public BaseItemRod(final Material material) {
super(material, BaseItemComponent.ComponentTypes.ROD);
this.addExtruderRecipe();
+ this.addLatheRecipe();
}
private void addExtruderRecipe(){
Logger.WARNING("Adding cutter recipe for "+this.materialName+" Rods");
-
final ItemStack stackStick = this.componentMaterial.getRod(1);
final ItemStack stackBolt = this.componentMaterial.getBolt(4);
-
+
if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackBolt}))
- GT_Values.RA.addCutterRecipe(
- stackStick,
- stackBolt,
- null,
- (int) Math.max(this.componentMaterial.getMass() * 2L, 1L),
- 4);
+ GT_Values.RA.addCutterRecipe(
+ stackStick,
+ stackBolt,
+ null,
+ (int) Math.max(this.componentMaterial.getMass() * 2L, 1L),
+ 4);
+ }
+
+
+ private void addLatheRecipe(){
+ Logger.WARNING("Adding recipe for "+this.materialName+" Rod");
+ ItemStack boltStack = this.componentMaterial.getIngot(1);
+ if (ItemUtils.checkForInvalidItems(boltStack)){
+ GT_Values.RA.addLatheRecipe(
+ boltStack,
+ ItemUtils.getSimpleStack(this),
+ null,
+ (int) Math.max(this.componentMaterial.getMass() / 8L, 1L),
+ 4);
+ }
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
index af74c1d535..29e525ed10 100644
--- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
+++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
@@ -18,8 +18,8 @@ public class BaseItemScrew extends BaseItemComponent{
private void addLatheRecipe(){
Logger.WARNING("Adding recipe for "+this.materialName+" Screws");
- final ItemStack boltStack = ItemUtils.getItemStackOfAmountFromOreDict(this.unlocalName.replace("itemScrew", "bolt"), 1);
- if (null != boltStack){
+ ItemStack boltStack = this.componentMaterial.getBolt(1);
+ if (ItemUtils.checkForInvalidItems(boltStack)){
GT_Values.RA.addLatheRecipe(
boltStack,
ItemUtils.getSimpleStack(this),