diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-12-20 16:35:33 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-12-20 16:35:33 +1000 |
commit | e4e40d86c0c868846cf20098dc1481f3ee3703b5 (patch) | |
tree | 7b6a2b79f1a7a7478b7dc63e196294a5c421851c /src/Java/gtPlusPlus/core/handler | |
parent | e5f2534b8d40d3c810dcc84b4fda77a513c6d3f6 (diff) | |
download | GT5-Unofficial-e4e40d86c0c868846cf20098dc1481f3ee3703b5.tar.gz GT5-Unofficial-e4e40d86c0c868846cf20098dc1481f3ee3703b5.tar.bz2 GT5-Unofficial-e4e40d86c0c868846cf20098dc1481f3ee3703b5.zip |
+ 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.
Diffstat (limited to 'src/Java/gtPlusPlus/core/handler')
-rw-r--r-- | src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java | 59 |
1 files changed, 30 insertions, 29 deletions
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 |