aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/core/item/base
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-07-27 20:26:08 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-07-27 20:26:08 +1000
commitc3d3a7e4e48cbed27ca5b56967e1593b30dbfd3b (patch)
tree08d6cf925acc309150a10fbcdf52d32bccf09c24 /src/Java/miscutil/core/item/base
parent70fb3475418db0048c39db1479b62a92be041314 (diff)
downloadGT5-Unofficial-c3d3a7e4e48cbed27ca5b56967e1593b30dbfd3b.tar.gz
GT5-Unofficial-c3d3a7e4e48cbed27ca5b56967e1593b30dbfd3b.tar.bz2
GT5-Unofficial-c3d3a7e4e48cbed27ca5b56967e1593b30dbfd3b.zip
+ Added Base classes for meta blocks.
+ Added Base classes for ItemBlocks. % Changed a Few tooltips for newly generated material items.
Diffstat (limited to 'src/Java/miscutil/core/item/base')
-rw-r--r--src/Java/miscutil/core/item/base/dusts/BaseItemDust.java135
-rw-r--r--src/Java/miscutil/core/item/base/foods/BaseItemHotFood.java3
-rw-r--r--src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java2
-rw-r--r--src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java3
-rw-r--r--src/Java/miscutil/core/item/base/itemblock/ItemBlockBase.java22
-rw-r--r--src/Java/miscutil/core/item/base/itemblock/ItemBlockGtFrameBox.java17
-rw-r--r--src/Java/miscutil/core/item/base/plates/BaseItemPlate.java4
7 files changed, 179 insertions, 7 deletions
diff --git a/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java b/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java
index e4dab2a72e..bd9853d715 100644
--- a/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java
@@ -1,9 +1,15 @@
package miscutil.core.item.base.dusts;
+import static miscutil.core.creative.AddToCreativeTab.tabMisc;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+
import java.util.List;
import miscutil.core.lib.CORE;
import miscutil.core.util.Utils;
+import miscutil.core.util.item.UtilsItems;
+import miscutil.core.util.recipe.UtilsRecipe;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -15,6 +21,7 @@ public class BaseItemDust extends Item{
protected int colour;
protected String materialName;
protected String pileType;
+ String name = "";
public BaseItemDust(String unlocalizedName, String materialName, int colour, String pileSize) {
setUnlocalizedName(unlocalizedName);
@@ -25,9 +32,51 @@ public class BaseItemDust extends Item{
else{
this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);}
this.setMaxStackSize(64);
+ this.setCreativeTab(tabMisc);
this.colour = colour;
this.materialName = materialName;
GameRegistry.registerItem(this, unlocalizedName);
+
+ String temp = "";
+ Utils.LOG_INFO("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = getUnlocalizedName();
+ }
+ if (temp.contains("DustTiny")){
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ else if (temp.contains("DustSmall")){
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ if (temp != null && temp != ""){
+ GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this));
+ }
+ addMacerationRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack iStack) {
+
+ if (getUnlocalizedName().contains("DustTiny")){
+ name = "Tiny Pile of "+materialName + " Dust";
+ }
+ else if (getUnlocalizedName().contains("DustSmall")){
+ name = "Small Pile of "+materialName + " Dust";
+ }
+ else {
+ name = materialName + " Dust";
+ }
+ return name;
}
@Override
@@ -56,4 +105,90 @@ public class BaseItemDust extends Item{
}
+ private void addMixerRecipe(){
+ ItemStack tempStack = UtilsItems.getSimpleStack(this);
+ ItemStack tempOutput = null;
+ String temp = "";
+ Utils.LOG_INFO("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = getUnlocalizedName();
+ }
+ if (temp.contains("DustTiny")){
+ temp = temp.replace("itemDustTiny", "dust");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ else if (temp.contains("DustSmall")){
+ temp = temp.replace("itemDustSmall", "dust");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_INFO("Generating OreDict Name: "+temp);
+ }
+ if (temp != null && temp != ""){
+ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ }
+
+ if (tempOutput != null){
+ if (getUnlocalizedName().contains("DustTiny")){
+ Utils.LOG_INFO("Generating a 9 Tiny dust to 1 Dust recipe for "+materialName);
+ UtilsRecipe.addShapelessGregtechRecipe(tempOutput,
+ tempStack, tempStack, tempStack,
+ tempStack, tempStack, tempStack,
+ tempStack, tempStack, tempStack);
+ }
+ else if (getUnlocalizedName().contains("DustSmall")){
+ Utils.LOG_INFO("Generating a 4 Small dust to 1 Dust recipe for "+materialName);
+ UtilsRecipe.addShapelessGregtechRecipe(tempOutput,
+ tempStack, tempStack, null,
+ tempStack, tempStack, null,
+ null, null, null);
+ }
+ else {
+ Utils.LOG_INFO("Generating a shapeless Dust recipe for "+materialName);
+ UtilsRecipe.addShapelessGregtechRecipe(tempOutput,
+ "dustTungsten", "dustTantalum", "dustTantalum",
+ "dustTantalum", "dustTantalum", "dustTantalum",
+ "dustTantalum", "dustTantalum", "dustTantalum");
+ }
+ }
+
+ }
+
+ private void addMacerationRecipe(){
+
+ String tempIngot = getUnlocalizedName().replace("item.itemDust", "ingot");
+ String tempDust = getUnlocalizedName().replace("item.itemDust", "dust");
+ ItemStack tempInputStack;
+ ItemStack tempOutputStack;
+
+ if (getUnlocalizedName().contains("DustSmall") || getUnlocalizedName().contains("DustTiny")){
+ return;
+ }
+
+ Utils.LOG_INFO("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ tempIngot = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_INFO("Generating OreDict Name: "+tempIngot);
+ }
+ else {
+ tempIngot = getUnlocalizedName();
+ }
+
+ tempIngot = tempIngot.replace("itemDust", "ingot");
+ Utils.LOG_INFO("Generating OreDict Name: "+tempIngot);
+
+ if (tempIngot != null && tempIngot != ""){
+ tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1);
+ if (null != tempOutputStack && null != tempInputStack){
+ GT_ModHandler.addPulverisationRecipe(tempInputStack, tempOutputStack);
+ }
+ }
+ }
+
}
diff --git a/src/Java/miscutil/core/item/base/foods/BaseItemHotFood.java b/src/Java/miscutil/core/item/base/foods/BaseItemHotFood.java
index 1632df582a..7a0e162eec 100644
--- a/src/Java/miscutil/core/item/base/foods/BaseItemHotFood.java
+++ b/src/Java/miscutil/core/item/base/foods/BaseItemHotFood.java
@@ -3,7 +3,6 @@ package miscutil.core.item.base.foods;
import java.util.List;
import miscutil.core.util.Utils;
-import miscutil.core.util.UtilsText;
import miscutil.core.util.item.UtilsItems;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -59,7 +58,7 @@ public class BaseItemHotFood extends BaseItemFood{
@Override
public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
if (materialName != null && materialName != "" && !materialName.equals("")){
- list.add(EnumChatFormatting.GRAY+"Warning: "+UtilsText.red.colour()+"Very hot!"+UtilsText.lightGray.colour()+" Avoid direct handling..");
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot!"+EnumChatFormatting.GRAY+" Avoid direct handling..");
list.add(EnumChatFormatting.GRAY+"This food has "+((cooldownTime-(int) stack.getItemDamage())/20)+" seconds left, until it is cool.");
}
super.addInformation(stack, aPlayer, list, bool);
diff --git a/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java b/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java
index bdd374d4c7..8a3e8a60b0 100644
--- a/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java
+++ b/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java
@@ -58,7 +58,7 @@ public class BaseItemIngot extends Item{
list.add(EnumChatFormatting.GRAY+"A solid ingot of " + materialName + ".");
}
else if (materialName != null && materialName != "" && !materialName.equals("") && unlocalName.toLowerCase().contains("ingothot")){
- list.add(EnumChatFormatting.GRAY+"Warning: Very hot! Avoid direct handling..");
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling..");
}
super.addInformation(stack, aPlayer, list, bool);
}
diff --git a/src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java
index 4ec6e9891d..46d9d83dc7 100644
--- a/src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java
+++ b/src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java
@@ -6,7 +6,6 @@ import java.util.List;
import miscutil.core.lib.CORE;
import miscutil.core.util.Utils;
-import miscutil.core.util.UtilsText;
import miscutil.core.util.item.UtilsItems;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -37,7 +36,7 @@ public class BaseItemIngotHot extends BaseItemIngot{
@Override
public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
if (materialName != null && materialName != "" && !materialName.equals("")){
- list.add(EnumChatFormatting.GRAY+"A "+UtilsText.red.colour()+"burning hot"+UtilsText.lightGray.colour()+" ingot of " + materialName + ".");
+ list.add(EnumChatFormatting.GRAY+"A "+EnumChatFormatting.RED+"burning hot"+EnumChatFormatting.GRAY+" ingot of " + materialName + ".");
}
super.addInformation(stack, aPlayer, list, bool);
}
diff --git a/src/Java/miscutil/core/item/base/itemblock/ItemBlockBase.java b/src/Java/miscutil/core/item/base/itemblock/ItemBlockBase.java
new file mode 100644
index 0000000000..df01123923
--- /dev/null
+++ b/src/Java/miscutil/core/item/base/itemblock/ItemBlockBase.java
@@ -0,0 +1,22 @@
+package miscutil.core.item.base.itemblock;
+
+import miscutil.core.creative.AddToCreativeTab;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemBlockWithMetadata;
+import net.minecraft.item.ItemStack;
+
+public class ItemBlockBase extends ItemBlockWithMetadata {
+
+ public ItemBlockBase(Block block) {
+ super(block, block);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) {
+
+ return super.getColorFromItemStack(p_82790_1_, p_82790_2_);
+ }
+
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtFrameBox.java b/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtFrameBox.java
new file mode 100644
index 0000000000..ca28daf232
--- /dev/null
+++ b/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtFrameBox.java
@@ -0,0 +1,17 @@
+package miscutil.core.item.base.itemblock;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+
+public class ItemBlockGtFrameBox extends ItemBlockBase{
+
+ public ItemBlockGtFrameBox(Block block) {
+ super(block);
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack iStack, int colour) {
+ return super.getColorFromItemStack(iStack, colour);
+ }
+
+}
diff --git a/src/Java/miscutil/core/item/base/plates/BaseItemPlate.java b/src/Java/miscutil/core/item/base/plates/BaseItemPlate.java
index 07c5a99f11..e38771ee75 100644
--- a/src/Java/miscutil/core/item/base/plates/BaseItemPlate.java
+++ b/src/Java/miscutil/core/item/base/plates/BaseItemPlate.java
@@ -67,8 +67,8 @@ public class BaseItemPlate extends Item{
String tempIngot = unlocalName.replace("itemPlate", "ingot");
ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
if (null != tempOutputStack){
- GT_Values.RA.addBenderRecipe(UtilsItems.getSimpleStack(this),
- tempOutputStack,
+ GT_Values.RA.addBenderRecipe(tempOutputStack,
+ UtilsItems.getSimpleStack(this),
1200, 24);
}
}