aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/handler
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-12-20 16:35:33 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-12-20 16:35:33 +1000
commite4e40d86c0c868846cf20098dc1481f3ee3703b5 (patch)
tree7b6a2b79f1a7a7478b7dc63e196294a5c421851c /src/Java/gtPlusPlus/core/handler
parente5f2534b8d40d3c810dcc84b4fda77a513c6d3f6 (diff)
downloadGT5-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.java59
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