diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/ModItems.java | 9 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 3 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java | 138 | ||||
-rw-r--r-- | src/resources/assets/miscutils/textures/items/itemBottle.png | bin | 0 -> 262 bytes | |||
-rw-r--r-- | src/resources/assets/miscutils/textures/items/itemKeyBig.png | bin | 0 -> 293 bytes | |||
-rw-r--r-- | src/resources/assets/miscutils/textures/items/itemMushroom.png | bin | 273 -> 260 bytes | |||
-rw-r--r-- | src/resources/assets/miscutils/textures/items/itemMushroomRed.png | bin | 0 -> 273 bytes | |||
-rw-r--r-- | src/resources/assets/miscutils/textures/items/itemPotion.png | bin | 0 -> 271 bytes |
8 files changed, 149 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index d042fac201..a874177520 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -14,6 +14,8 @@ import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; import gtPlusPlus.core.item.base.foods.BaseItemFood; import gtPlusPlus.core.item.base.foods.BaseItemHotFood; import gtPlusPlus.core.item.base.ingots.BaseItemIngot_OLD; +import gtPlusPlus.core.item.base.misc.BaseItemMisc; +import gtPlusPlus.core.item.base.misc.BaseItemMisc.MiscTypes; import gtPlusPlus.core.item.base.plates.BaseItemPlate; import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble; import gtPlusPlus.core.item.effects.RarityRare; @@ -520,6 +522,13 @@ public final class ModItems { //Just an unusual plate needed for some black magic. itemPlateClay = new BaseItemPlate(MaterialUtils.generateMaterialFromGtENUM(Materials.Clay)); itemDoublePlateClay = new BaseItemPlateDouble(MaterialUtils.generateMaterialFromGtENUM(Materials.Clay)); + + //Misc Items + Item tI; + tI = new BaseItemMisc("Chilly", new short[]{0,64,196}, 32, MiscTypes.POTION, new String[]{"It's Blue"}); + tI = new BaseItemMisc("4000DC's", new short[]{180,100,30}, 1, MiscTypes.BIGKEY, new String[]{"It opens things."}); + tI = new BaseItemMisc("Dull", new short[]{64,64,64}, 64, MiscTypes.GEM, null); + tI = new BaseItemMisc("Forest", new short[]{130,164,96}, 64, MiscTypes.MUSHROOM, new String[]{"You Found this on the ground.", "Definitely not sure if it's worth eating."}); //EnderIO Resources if (LoadedMods.EnderIO || LOAD_ALL_CONTENT){ diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 8c6dc9a0c9..4729b2182a 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -187,7 +187,8 @@ public class BaseItemComponent extends Item{ RING("Ring", " Ring", "ring"), PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma"), CELL("Cell", " Cell", "cell"), - NUGGET("Nugget", " Nugget", "nugget"); + NUGGET("Nugget", " Nugget", "nugget"), + PLATEHEAVY("HeavyPlate", " Heavy Plate", "plateHeavy"); private String COMPONENT_NAME; private String DISPLAY_NAME; diff --git a/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java new file mode 100644 index 0000000000..effa81362b --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java @@ -0,0 +1,138 @@ +package gtPlusPlus.core.item.base.misc; + +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.util.Utils; +import gtPlusPlus.core.util.entity.EntityUtils; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class BaseItemMisc extends Item{ + + public final String displayName; + public final String unlocalName; + public final MiscTypes miscType; + public final Object componentColour; + public final String[] description; + + public BaseItemMisc( + final String displayName, + final short[] RGB, + final int maxStackSize, + final MiscTypes miscType, + String[] description) { + + //Set-up the Misc Generic Item + this.displayName = displayName; + String unlocalName = Utils.sanitizeString(displayName); + this.unlocalName = "item"+miscType.TYPE+unlocalName; + this.miscType = miscType; + this.setCreativeTab(AddToCreativeTab.tabMisc); + this.setUnlocalizedName(this.unlocalName); + this.setMaxStackSize(maxStackSize); + this.setTextureName(this.getCorrectTextures()); + if (RGB != null){ + this.componentColour = Utils.rgbtoHexValue(RGB[0], RGB[1], RGB[2]); + } + else { + this.componentColour = null; + } + this.description = description; + GameRegistry.registerItem(this, this.unlocalName); + GT_OreDictUnificator.registerOre(miscType.getOreDictPrefix()+unlocalName, ItemUtils.getSimpleStack(this)); + } + + @Override + public String getItemStackDisplayName(final ItemStack p_77653_1_) { + return this.displayName+miscType.DISPLAY_NAME_SUFFIX; + } + + private String getCorrectTextures(){ + return CORE.MODID + ":" + "item"+this.miscType.TYPE; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + if (this.description != null){ //Incase I don't add one + if (this.description.length > 0){ //Incase I somehow add a blank one + for (int x=0;x<this.description.length;x++){ + list.add(EnumChatFormatting.GRAY+description[x]); + } + } + } + super.addInformation(stack, aPlayer, list, bool); + } + + + @Override + public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { + //Returns default colour if a custom one is not set. + if (this.componentColour == null){ + return 16777215; + } + else { + return (int) 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_) { + //Nothing Fancy here yet. + } + + + + + + + + + public static enum MiscTypes { + POTION("Potion", " Potion", "potion"), + KEY("Key", " Key", "key"), + BIGKEY("KeyBig", " Big Key", "bosskey"), + BOTTLE("Bottle", " Bottle", "bottle"), + GEM("Gem", " Gemstone", "gem"), + MUSHROOM("Mushroom", " Mushroom", "mushroom"); + + private String TYPE; + private String DISPLAY_NAME_SUFFIX; + private String OREDICT_PREFIX; + + private MiscTypes (final String LocalName, final String DisplayNameSuffix, final String OreDictPrefix){ + this.TYPE = LocalName; + this.DISPLAY_NAME_SUFFIX = DisplayNameSuffix; + this.OREDICT_PREFIX = OreDictPrefix; + } + + public String getType(){ + return this.TYPE; + } + + public String getName(){ + return this.DISPLAY_NAME_SUFFIX; + } + + public String getOreDictPrefix(){ + return this.OREDICT_PREFIX; + } + + } + +} + + diff --git a/src/resources/assets/miscutils/textures/items/itemBottle.png b/src/resources/assets/miscutils/textures/items/itemBottle.png Binary files differnew file mode 100644 index 0000000000..942a9ffb5f --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemBottle.png diff --git a/src/resources/assets/miscutils/textures/items/itemKeyBig.png b/src/resources/assets/miscutils/textures/items/itemKeyBig.png Binary files differnew file mode 100644 index 0000000000..abfefc9aba --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemKeyBig.png diff --git a/src/resources/assets/miscutils/textures/items/itemMushroom.png b/src/resources/assets/miscutils/textures/items/itemMushroom.png Binary files differindex 2bbf1bcb00..d63f079f45 100644 --- a/src/resources/assets/miscutils/textures/items/itemMushroom.png +++ b/src/resources/assets/miscutils/textures/items/itemMushroom.png diff --git a/src/resources/assets/miscutils/textures/items/itemMushroomRed.png b/src/resources/assets/miscutils/textures/items/itemMushroomRed.png Binary files differnew file mode 100644 index 0000000000..2bbf1bcb00 --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemMushroomRed.png diff --git a/src/resources/assets/miscutils/textures/items/itemPotion.png b/src/resources/assets/miscutils/textures/items/itemPotion.png Binary files differnew file mode 100644 index 0000000000..a1ff53ef8d --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemPotion.png |