From e4e40d86c0c868846cf20098dc1481f3ee3703b5 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Tue, 20 Dec 2016 16:35:33 +1000 Subject: + Added a fire pit, which will go out in the rain and ignite from a nearby fire source. + Added capability to the fire starter, to ignite the fire pit directly. % Changed Shard handling event. --- .../core/handler/events/BlockEventHandler.java | 59 +++++++++++----------- 1 file changed, 30 insertions(+), 29 deletions(-) (limited to 'src/Java/gtPlusPlus/core/handler') diff --git a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java index d59072d066..d01a259aaa 100644 --- a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.handler.events; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import java.util.Random; @@ -60,38 +61,38 @@ public class BlockEventHandler { //Used to handle Thaumcraft Shards when TC is not installed. @SubscribeEvent public void harvestDrops(BlockEvent.HarvestDropsEvent event) { - if (event.harvester != null){ - //Spawn Dull Shards (Can spawn from Tree Logs, Grass or Stone. Stone going to be the most common source.) - if ((event.block == Blocks.stone || event.block == Blocks.log || event.block == Blocks.log2 || event.block == Blocks.grass) - && !LoadedMods.Thaumcraft) { - //small chance for one to spawn per stone mined. 1 per 4 stacks~ //TODO MAKE A CONFIG OPTION - if (MathUtils.randInt(1, 256) == 1){ - if (event.harvester.canHarvestBlock(event.block)){ - //Let's sort out a lucky charm for the player. - int FancyChance = MathUtils.randInt(1, 4); - if (MathUtils.randInt(1, 100) > 90){ - event.drops.add(new ItemStack(ModItems.shardDull)); - } - //Make a Fire Shard - else if (FancyChance == 1){ - event.drops.add(new ItemStack(ModItems.shardIgnis)); - } - //Make a Water Shard. - else if (FancyChance == 2){ - event.drops.add(new ItemStack(ModItems.shardAqua)); - } - //Make an Earth Shard. - else if (FancyChance == 3){ - event.drops.add(new ItemStack(ModItems.shardTerra)); - } - //Make an Air Shard. - else if (FancyChance == 4){ - event.drops.add(new ItemStack(ModItems.shardAer)); - } - } + //Spawn Dull Shards (Can spawn from Tree Logs, Grass or Stone. Stone going to be the most common source.) + if ((event.block == Blocks.stone || event.block == Blocks.sandstone || event.block == Blocks.log || event.block == Blocks.log2 || event.block == Blocks.grass) + && !LoadedMods.Thaumcraft) { + //small chance for one to spawn per stone mined. 1 per 3 stacks~ //TODO MAKE A CONFIG OPTION + if (MathUtils.randInt(1, 196) == 1){ + //Let's sort out a lucky charm for the player. + int FancyChance = MathUtils.randInt(1, 4); + if (MathUtils.randInt(1, 100) < 90){ + event.drops.add(new ItemStack(ModItems.shardDull)); + } + //Make a Fire Shard + else if (FancyChance == 1){ + event.drops.add(new ItemStack(ModItems.shardIgnis)); + } + //Make a Water Shard. + else if (FancyChance == 2){ + event.drops.add(new ItemStack(ModItems.shardAqua)); + } + //Make an Earth Shard. + else if (FancyChance == 3){ + event.drops.add(new ItemStack(ModItems.shardTerra)); + } + //Make an Air Shard. + else if (FancyChance == 4){ + event.drops.add(new ItemStack(ModItems.shardAer)); } + } + else { + Utils.LOG_INFO("invalid chance"); } } + //} } @SubscribeEvent -- cgit