From 3cc9e9a347b320374858ee7cf4df89138d7d0941 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Tue, 27 Dec 2016 17:12:35 +1000 Subject: + Made Fluorite Ore drop from Sandstone mining and Limestone mining. + Added Ore Blocks. + Gave Ore Blocks an overlay texture. - Removed the old ZrF4 dust. --- .../core/handler/events/BlockEventHandler.java | 39 +++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (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 d01a259aaa..796d9fca77 100644 --- a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java @@ -1,17 +1,22 @@ package gtPlusPlus.core.handler.events; +import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; +import java.util.ArrayList; import java.util.Random; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.oredict.OreDictionary; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class BlockEventHandler { @@ -52,11 +57,18 @@ public class BlockEventHandler { } }*/ } + + @SubscribeEvent public void onBlockBreak(BlockEvent.BreakEvent event) { - + } + + + ArrayList oreLimestone = OreDictionary.getOres("oreLimestone"); + ArrayList blockLimestone = OreDictionary.getOres("limestone"); + ItemStack fluoriteOre = ItemUtils.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockOreFluorite)); //Used to handle Thaumcraft Shards when TC is not installed. @SubscribeEvent @@ -92,6 +104,31 @@ public class BlockEventHandler { Utils.LOG_INFO("invalid chance"); } } + + //Spawns Fluorite from Lime Stone + if (!oreLimestone.isEmpty() || !blockLimestone.isEmpty()){ + if (!oreLimestone.isEmpty()) + for (ItemStack temp : oreLimestone){ + if (ItemUtils.getSimpleStack(Item.getItemFromBlock(event.block)) == temp) { + if (MathUtils.randInt(1, 64) == 1){ + event.drops.add(fluoriteOre.copy()); + } + } + } + if (!oreLimestone.isEmpty()) + for (ItemStack temp : blockLimestone){ + if (ItemUtils.getSimpleStack(Item.getItemFromBlock(event.block)) == temp) { + if (MathUtils.randInt(1, 64) == 1){ + event.drops.add(fluoriteOre.copy()); + } + } + } + } + if (event.block == Blocks.sandstone){ + if (MathUtils.randInt(1, 640) == 1){ + event.drops.add(fluoriteOre.copy()); + } + } //} } -- cgit