fixed style, added biome population support, for #2

This commit is contained in:
Space Toad committed 2011-07-15 21:17:33 +00:00
1 parent 341cfc0cf7
commit a7e950e7c2
4 files changed
+94 -29

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
package net.minecraft.src.forge;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.World;
public interface IBiomePopulator {
public void populate(World world, BiomeGenBase biomegenbase, int x, int z);
}
@@ -5,6 +5,6 @@ import net.minecraft.src.World;
public interface IBucketHandler {
public ItemStack fillCustomBucket (World w, int i, int j, int k);
public ItemStack fillCustomBucket(World w, int i, int j, int k);
}
@@ -2,27 +2,40 @@ package net.minecraft.src.forge;
import java.util.LinkedList;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;
public class MinecraftForge {
private static LinkedList<IBucketHandler> bucketHandlers = new LinkedList<IBucketHandler>();
public static ItemStack fillCustomBucket (World w, int i, int j, int k) {
for (IBucketHandler handler : bucketHandlers) {
ItemStack stack = handler.fillCustomBucket(w, i, j, k);
if (stack != null) {
return stack;
}
}
return null;
}
public static void registerCustomBucketHander (IBucketHandler handler) {
bucketHandlers.add(handler);
}
private static LinkedList<IBucketHandler> bucketHandlers = new LinkedList<IBucketHandler>();
private static LinkedList<IBiomePopulator> biomePopulators = new LinkedList<IBiomePopulator>();
public static void registerCustomBucketHander(IBucketHandler handler) {
bucketHandlers.add(handler);
}
public static void registerBiomePopulate(IBiomePopulator populator) {
biomePopulators.add(populator);
}
public static ItemStack fillCustomBucket(World w, int i, int j, int k) {
for (IBucketHandler handler : bucketHandlers) {
ItemStack stack = handler.fillCustomBucket(w, i, j, k);
if (stack != null) {
return stack;
}
}
return null;
}
public static void populateBiome(World world, BiomeGenBase biomegenbase,
int x, int z) {
for (IBiomePopulator populator : biomePopulators) {
populator.populate(world, biomegenbase, x, z);
}
}
}