aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/item
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-12-01 02:07:37 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-12-01 02:07:37 +1000
commitaf0fde5a27ba28b744d56085e1399ed95d4c5ee9 (patch)
treee8194630b339c4a9252b3ed083ea609b3c947e8c /src/Java/gtPlusPlus/core/item
parent3b03ee38c1c8dbd034202d2c4bb0f2dc4fb82170 (diff)
downloadGT5-Unofficial-af0fde5a27ba28b744d56085e1399ed95d4c5ee9.tar.gz
GT5-Unofficial-af0fde5a27ba28b744d56085e1399ed95d4c5ee9.tar.bz2
GT5-Unofficial-af0fde5a27ba28b744d56085e1399ed95d4c5ee9.zip
+ Basic Fire Maker. (1/4 change to light a fire, can also set you on fire if it fails)
+ Maceration recipes for the non-TC shards into non-TC shard dust. (Which GT then oreDicts into it's own, for making Energy Crystal) + Recipes for the Multi-tank Controller and it's frame blocks. (Fixes #40) + 4 new pipe types. Now there are 5 sizes of Tungsten, Dark Steel, Lead and Clay. - Hydrogen Blobs no longer get registered as dustHydrogen. (Broke many things without intention) $ Hopefully made a fix to the Multi-Tank, where it would reset it's storage multiplier to 0 or 1 when a world reloaded. % Enabled a previously disabled logging feature. + Put extra logging into getItemStackOfAmountFromOreDictNoBroken() during debug mode. $ Cleaned up ReflectionUtils.java and added a new method getMethodName() which will show where a method was called from.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java78
2 files changed, 83 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index adaab20738..c97401bd1d 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -159,6 +159,8 @@ public final class ModItems {
public static BaseItemTCShard shardAqua;
public static BaseItemTCShard shardDull;
+
+ public static Item itemBasicFireMaker;
//@SuppressWarnings("unused")
@@ -186,10 +188,12 @@ public final class ModItems {
//Register Hydrogen Blobs first, so we can replace old helium blobs.
itemHydrogenBlob = new CoreItem("itemHydrogenBlob", tabMisc).setTextureName(CORE.MODID + ":itemHydrogenBlob");
- GT_OreDictUnificator.registerOre("dustHydrogen", new ItemStack(ModItems.itemHydrogenBlob));
+ //GT_OreDictUnificator.registerOre("dustHydrogen", new ItemStack(ModItems.itemHydrogenBlob));
//Register Old Helium Blob, this will be replaced when held by a player.
itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc, ItemUtils.getSimpleStack(itemHydrogenBlob)).setTextureName(CORE.MODID + ":itemHeliumBlob");
+ //Register this neato device, for making some fires.
+ itemBasicFireMaker = new ItemBasicFirestarter();
//Make some backpacks
//Primary colours
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java b/src/Java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java
new file mode 100644
index 0000000000..b4d0ca9233
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java
@@ -0,0 +1,78 @@
+package gtPlusPlus.core.item.general;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.CoreItem;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.player.PlayerUtils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class ItemBasicFirestarter extends CoreItem {
+
+ public ItemBasicFirestarter() {
+ super("itemSimpleFiremaker", AddToCreativeTab.tabTools, 1, 5, "Can probably make you a fire");
+ this.setTextureName("flint_and_steel");
+ }
+
+ @Override
+ public boolean onItemUse(
+ ItemStack thisItem, EntityPlayer thisPlayer, World thisWorld,
+ int blockX, int blockY, int blockZ,
+ int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
+ if (p_77648_7_ == 0) {
+ --blockY;
+ }
+ if (p_77648_7_ == 1) {
+ ++blockY;
+ }
+ if (p_77648_7_ == 2) {
+ --blockZ;
+ }
+ if (p_77648_7_ == 3) {
+ ++blockZ;
+ }
+ if (p_77648_7_ == 4) {
+ --blockX;
+ }
+ if (p_77648_7_ == 5) {
+ ++blockX;
+ }
+ if (!thisPlayer.canPlayerEdit(blockX, blockY, blockZ, p_77648_7_, thisItem)) {
+ return false;
+ }
+ if (thisWorld.isAirBlock(blockX, blockY, blockZ))
+ {
+ int random = MathUtils.randInt(0, 3);
+ //Explode, lol.
+ if (random == 0){
+ PlayerUtils.messagePlayer(thisPlayer, "You somehow managed to set yourself on fire... ");
+ thisWorld.playSoundEffect((double)thisPlayer.posX + 0.5D, (double)thisPlayer.posY + 0.5D, (double)thisPlayer.posZ + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
+ thisPlayer.setFire(4);
+ thisItem.damageItem(thisItem.getMaxDamage(), thisPlayer);
+ }
+
+ //Create a fire
+ else if (random == 2){
+ PlayerUtils.messagePlayer(thisPlayer, "You created a fire!");
+ thisWorld.playSoundEffect((double)blockX + 0.5D, (double)blockY + 0.5D, (double)blockZ + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
+ thisWorld.setBlock(blockX, blockY, blockZ, Blocks.fire);
+ }
+
+ //Do nothing
+ else {
+ PlayerUtils.messagePlayer(thisPlayer, "Your attemp does nothing.");
+ thisItem.damageItem(1, thisPlayer);
+ return false;
+ }
+ }
+ thisItem.damageItem(1, thisPlayer);
+ return true;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack thisItem) {
+ return "Basic Firemaker";
+ }
+} \ No newline at end of file