added mineable block configuration, for #6

This commit is contained in:
Space Toad committed 2011-07-29 17:55:34 +00:00
1 parent 20c30d541c
commit c51848db5b
3 files changed
+139 -21

No files matched your search

@@ -8,13 +8,17 @@ package net.minecraft.src.forge;
import java.util.LinkedList;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.Block;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.ItemTool;
import net.minecraft.src.World;
public class MinecraftForge {
private static LinkedList<IBucketHandler> bucketHandlers = new LinkedList<IBucketHandler>();
private static LinkedList<IBiomePopulator> biomePopulators = new LinkedList<IBiomePopulator>();
private static LinkedList<IHarvestHandler> harvestHandlers = new LinkedList<IHarvestHandler>();
public static void registerCustomBucketHander(IBucketHandler handler) {
bucketHandlers.add(handler);
@@ -23,6 +27,10 @@ public class MinecraftForge {
public static void registerBiomePopulate(IBiomePopulator populator) {
biomePopulators.add(populator);
}
public static void registerHarvestHandler(IHarvestHandler handler) {
harvestHandlers.add(handler);
}
public static ItemStack fillCustomBucket(World w, int i, int j, int k) {
for (IBucketHandler handler : bucketHandlers) {
@@ -43,4 +51,21 @@ public class MinecraftForge {
}
}
public static boolean canHarvestBlock(ItemTool item, Block block) {
for (IHarvestHandler handler : harvestHandlers) {
if (handler.canHarvestBlock(item, block)) {
return true;
}
}
return false;
}
public void addPixaxeBlockEffectiveAgainst (Block block) {
((ItemTool) Item.pickaxeWood).addBlockEffectiveAgainst(block);
((ItemTool) Item.pickaxeStone).addBlockEffectiveAgainst(block);
((ItemTool) Item.pickaxeSteel).addBlockEffectiveAgainst(block);
((ItemTool) Item.pickaxeGold).addBlockEffectiveAgainst(block);
((ItemTool) Item.pickaxeDiamond).addBlockEffectiveAgainst(block);
}
}