From af0fde5a27ba28b744d56085e1399ed95d4c5ee9 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 1 Dec 2016 02:07:37 +1000 Subject: + 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. --- src/Java/gtPlusPlus/core/item/ModItems.java | 6 +- .../core/item/general/ItemBasicFirestarter.java | 78 ++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 src/Java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java (limited to 'src/Java/gtPlusPlus/core/item') 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 -- cgit