From 412c5a37a67473635376cded9a93d1e0ac80f0ca Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Fri, 13 Sep 2013 06:35:31 -0400 Subject: [PATCH] removing unused EBXL API --- src/extrabiomes/api/Api.java | 46 ---- src/extrabiomes/api/BiomeManager.java | 197 ------------------ src/extrabiomes/api/Biomes.java | 39 ---- .../api/DiscoverWorldTypesEvent.java | 38 ---- src/extrabiomes/api/PluginEvent.java | 31 --- src/extrabiomes/api/Stuff.java | 34 --- src/extrabiomes/api/UseLogTurnerEvent.java | 44 ---- .../api/events/GetBiomeIDEvent.java | 61 ------ 8 files changed, 490 deletions(-) delete mode 100644 src/extrabiomes/api/Api.java delete mode 100644 src/extrabiomes/api/BiomeManager.java delete mode 100644 src/extrabiomes/api/Biomes.java delete mode 100644 src/extrabiomes/api/DiscoverWorldTypesEvent.java delete mode 100644 src/extrabiomes/api/PluginEvent.java delete mode 100644 src/extrabiomes/api/Stuff.java delete mode 100644 src/extrabiomes/api/UseLogTurnerEvent.java delete mode 100644 src/extrabiomes/api/events/GetBiomeIDEvent.java diff --git a/src/extrabiomes/api/Api.java b/src/extrabiomes/api/Api.java deleted file mode 100644 index 23ca124c4c1..00000000000 --- a/src/extrabiomes/api/Api.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This work is licensed under the Creative Commons - * Attribution-ShareAlike 3.0 Unported License. To view a copy of this - * license, visit http://creativecommons.org/licenses/by-sa/3.0/. - */ - -package extrabiomes.api; - -import net.minecraftforge.event.EventBus; - -import com.google.common.base.Optional; - -/* - * @author ScottKillen - */ -public class Api { - - private static final EventBus eventBus = new EventBus(); - protected static Optional pluginBus = Optional.of(new EventBus()); - - public static EventBus getExtrabiomesXLEventBus() { - return eventBus; - } - - /** - * @return true if ExtrtabiomesXL is installed and active - * @deprecated Use {@link #isExtrabiomesXLActive()} instead - */ - @Deprecated - public static boolean isActive() { - return isExtrabiomesXLActive(); - } - - /** - * @return true if ExtrtabiomesXL is installed and active - */ - @SuppressWarnings("deprecation") - public static boolean isExtrabiomesXLActive() { - return BiomeManager.isActive(); - } - - public static void registerPlugin(Object plugin) { - if (pluginBus.isPresent()) pluginBus.get().register(plugin); - } - -} diff --git a/src/extrabiomes/api/BiomeManager.java b/src/extrabiomes/api/BiomeManager.java deleted file mode 100644 index dd51e117fec..00000000000 --- a/src/extrabiomes/api/BiomeManager.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * This work is licensed under the Creative Commons - * Attribution-ShareAlike 3.0 Unported License. To view a copy of this - * license, visit http://creativecommons.org/licenses/by-sa/3.0/. - */ - -package extrabiomes.api; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Collection; -import java.util.Random; - -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.feature.WorldGenerator; - -import com.google.common.base.Optional; - -/** - * Allows direct access to Extrabiome's biomes. This class' members will - * be populated during the @Init event. If a biome is absent after the - * Init event, then the Extrabiomes mod is not active or not installed. - *

- * NOTE: Make sure to only reference members of this class in the - * PostInit event or later. - * - * @author ScottKillen - * - */ - -// The BiomeManager will be removed following release 3.6.0. Use extrabiomes.api.Biomes instead - -@Deprecated -public abstract class BiomeManager { - - protected enum GenType { - TREE, GRASS; - } - - public static Optional alpine = Optional.absent(); - public static Optional autumnwoods = Optional.absent(); - public static Optional birchforest = Optional.absent(); - public static Optional extremejungle = Optional.absent(); - public static Optional forestedisland = Optional.absent(); - public static Optional forestedhills = Optional.absent(); - public static Optional glacier = Optional.absent(); - public static Optional greenhills = Optional.absent(); - public static Optional icewasteland = Optional.absent(); - public static Optional greenswamp = Optional.absent(); - public static Optional marsh = Optional.absent(); - public static Optional meadow = Optional.absent(); - public static Optional minijungle = Optional.absent(); - public static Optional mountaindesert = Optional.absent(); - public static Optional mountainridge = Optional.absent(); - public static Optional mountaintaiga = Optional.absent(); - public static Optional pineforest = Optional.absent(); - public static Optional rainforest = Optional.absent(); - public static Optional redwoodforest = Optional.absent(); - public static Optional redwoodlush = Optional.absent(); - public static Optional savanna = Optional.absent(); - public static Optional shrubland = Optional.absent(); - public static Optional snowforest = Optional.absent(); - public static Optional snowyrainforest = Optional.absent(); - public static Optional temperaterainforest = Optional.absent(); - public static Optional tundra = Optional.absent(); - public static Optional wasteland = Optional.absent(); - public static Optional woodlands = Optional.absent(); - - protected static Optional instance = Optional.absent(); - - /** - * This method allows the addition of grasses to custom biomes by - * weight. - * - * @param biome - * the biomes to add the tree to. - * @param grassGen - * the grass generator - * @param weight - * the relative probabilty of picking this grass to - * generate. To establish a relative priority, some - * function should be applied to the current total weight - * for a biome. - */ - public static void addWeightedGrassGenForBiome(BiomeGenBase biome, - WorldGenerator grassGen, int weight) - { - checkArgument(instance.isPresent(), - "Cannot add weighted grass gens until after API is initialized."); - checkNotNull(biome, "Biome is required."); - checkNotNull(grassGen, "Grass generator is required."); - checkArgument(weight > 0, "Weight must be greater than zero."); - instance.get().addBiomeGen(GenType.GRASS, biome, grassGen, - weight); - } - - /** - * This method allows the addition of trees to custom biomes by - * weight. - * - * @param biome - * the biomes to add the tree to. - * @param treeGen - * the tree generator - * @param weight - * the relative probabilty of picking this tree to - * generate. To establish a relative priority, some - * function should be applied to the current total weight - * for a biome. - */ - public static void addWeightedTreeGenForBiome(BiomeGenBase biome, - WorldGenerator treeGen, int weight) - { - checkArgument(instance.isPresent(), - "Cannot add weighted tree gens until after API is initialized."); - checkNotNull(biome, "Biome is required."); - checkNotNull(treeGen, "Tree Generator is required."); - checkArgument(weight > 0, "Weight must be greater than zero."); - instance.get() - .addBiomeGen(GenType.TREE, biome, treeGen, weight); - } - - /** - * Returns a random choice from the weighted list of grass - * generators - * - * @param biome - * The biome for which to select a grass gen - * @return the selected grass generator. - */ - public static Optional chooseRandomGrassGenforBiome( - Random rand, BiomeGenBase biome) - { - return instance.get().chooseBiomeRandomGen(GenType.GRASS, rand, - biome); - } - - /** - * Returns a random choice from the weighted list of tree generators - * - * @param biome - * The biome for which to select a tree gen - * @return the selected tree generator. - */ - public static Optional chooseRandomTreeGenforBiome( - Random rand, BiomeGenBase biome) - { - return instance.get().chooseBiomeRandomGen(GenType.TREE, rand, - biome); - } - - /** - * @return An immutable collection of this mod's biomes. - */ - public static Collection getBiomes() { - checkArgument(instance.isPresent(), - "Biome list not available until after API is initialized."); - return instance.get().getBiomeCollection(); - } - - /** - * @param biome - * The biome for which to calculate the total weight. - * @return the total weight of all grassGen choices for a given - * biome - */ - public static int getTotalGrassWeightForBiome(BiomeGenBase biome) { - checkNotNull(biome, "Biome is required."); - return instance.get().getBiomeTotalWeight(GenType.GRASS, biome); - } - - /** - * @param biome - * The biome for which to calculate the total weight. - * @return the total weight of all treeGen choices for a given biome - */ - public static int getTotalTreeWeightForBiome(BiomeGenBase biome) { - checkNotNull(biome, "Biome is required."); - return instance.get().getBiomeTotalWeight(GenType.TREE, biome); - } - - static boolean isActive() { - return instance.isPresent(); - } - - protected abstract void addBiomeGen(GenType genType, - BiomeGenBase biome, WorldGenerator treeGen, int weight); - - protected abstract Optional chooseBiomeRandomGen( - GenType genType, Random rand, BiomeGenBase biome); - - protected abstract Collection getBiomeCollection(); - - protected abstract int getBiomeTotalWeight(GenType genType, - BiomeGenBase biome); -} diff --git a/src/extrabiomes/api/Biomes.java b/src/extrabiomes/api/Biomes.java deleted file mode 100644 index d90be191a69..00000000000 --- a/src/extrabiomes/api/Biomes.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This work is licensed under the Creative Commons - * Attribution-ShareAlike 3.0 Unported License. To view a copy of this - * license, visit http://creativecommons.org/licenses/by-sa/3.0/. - */ - -package extrabiomes.api; - -import net.minecraft.world.biome.BiomeGenBase; - -import com.google.common.base.Optional; - -import extrabiomes.api.events.GetBiomeIDEvent; - -/** - * Provides access to custom biomes. Reference implementation. - * - * @author Scott - * - */ -public abstract class Biomes { - - /** - * Retrieves a custom biome - * - * @param targetBiome - * The string name of the targertBiome. See - * {@link GetBiomeIDEvent#targetBiome} for valid values. - * @return The requested biome. If the biome does not exist, the - * Optional value will not be present. - */ - public static Optional getBiome(String targetBiome) { - final GetBiomeIDEvent event = new GetBiomeIDEvent(targetBiome); - Api.getExtrabiomesXLEventBus().post(event); - if (event.biomeID <= 0) return Optional.absent(); - return Optional.of(BiomeGenBase.biomeList[event.biomeID]); - } - -} diff --git a/src/extrabiomes/api/DiscoverWorldTypesEvent.java b/src/extrabiomes/api/DiscoverWorldTypesEvent.java deleted file mode 100644 index 836e9f42947..00000000000 --- a/src/extrabiomes/api/DiscoverWorldTypesEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This work is licensed under the Creative Commons - * Attribution-ShareAlike 3.0 Unported License. To view a copy of this - * license, visit http://creativecommons.org/licenses/by-sa/3.0/. - */ - -package extrabiomes.api; - -import java.util.Collection; - -import net.minecraft.world.WorldType; -import net.minecraftforge.event.Event; - -/** - * This event fires on the ExtrabiomesXL event bus when biomes are added - * to WorldTypes. - */ -public class DiscoverWorldTypesEvent extends Event { - - private final Collection worldTypes; - - public DiscoverWorldTypesEvent(Collection worldTypes) { - this.worldTypes = worldTypes; - } - - /** - * Adds a WorldType to the list of WorldTypes to which ExtrabiomesXL - * will add its enabled biomes. - * - * @param worldType - * The WorldType to Add - * @return true if worldType was successfully added - */ - public boolean addWorldType(WorldType worldType) { - if (worldTypes.contains(worldType)) return false; - return worldTypes.add(worldType); - } -} diff --git a/src/extrabiomes/api/PluginEvent.java b/src/extrabiomes/api/PluginEvent.java deleted file mode 100644 index e27b21ef77e..00000000000 --- a/src/extrabiomes/api/PluginEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This work is licensed under the Creative Commons - * Attribution-ShareAlike 3.0 Unported License. To view a copy of this - * license, visit http://creativecommons.org/licenses/by-sa/3.0/. - */ - -package extrabiomes.api; - -import net.minecraftforge.event.Event; - -/** - * These events are fired during FML @PostInit to manage plugins - */ -public class PluginEvent extends Event { - - /** - * Fired before any ExtrabiomesXL plugin is initialized - */ - public static class Pre extends PluginEvent {} - - /** - * Fired to initialize ExtrabiomesXL plugins - */ - public static class Init extends PluginEvent {} - - /** - * Fired after every ExtrabiomesXL plugin is initialized - */ - public static class Post extends PluginEvent {} - -} diff --git a/src/extrabiomes/api/Stuff.java b/src/extrabiomes/api/Stuff.java deleted file mode 100644 index 6d9a0421dbf..00000000000 --- a/src/extrabiomes/api/Stuff.java +++ /dev/null @@ -1,34 +0,0 @@ - -package extrabiomes.api; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; - -import com.google.common.base.Optional; - -/** - * This class contains all of the custom items and blocks. - * - * @author ScottKillen - * - */ -public enum Stuff { - INSTANCE; - - public static Optional scarecrow = Optional.absent(); - public static Optional paste = Optional.absent(); - - public static Optional planks = Optional.absent(); - public static Optional quickSand = Optional.absent(); - public static Optional slabRedRock = Optional.absent(); - public static Optional slabRedRockDouble = Optional.absent(); - public static Optional slabWood = Optional.absent(); - public static Optional slabWoodDouble = Optional.absent(); - public static Optional stairsAcacia = Optional.absent(); - public static Optional stairsFir = Optional.absent(); - public static Optional stairsRedCobble = Optional.absent(); - public static Optional stairsRedRockBrick = Optional.absent(); - public static Optional stairsRedwood = Optional.absent(); - public static Optional wall = Optional.absent(); - -} diff --git a/src/extrabiomes/api/UseLogTurnerEvent.java b/src/extrabiomes/api/UseLogTurnerEvent.java deleted file mode 100644 index 3a839274daf..00000000000 --- a/src/extrabiomes/api/UseLogTurnerEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This work is licensed under the Creative Commons - * Attribution-ShareAlike 3.0 Unported License. To view a copy of this - * license, visit http://creativecommons.org/licenses/by-sa/3.0/. - */ - -package extrabiomes.api; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.event.Cancelable; -import net.minecraftforge.event.entity.player.PlayerEvent; - -@Cancelable -public class UseLogTurnerEvent extends PlayerEvent { - - public final ItemStack current; - public final World world; - public final int x; - public final int y; - public final int z; - - private boolean handled = false; - - public UseLogTurnerEvent(EntityPlayer player, ItemStack current, - World world, int x, int y, int z) - { - super(player); - this.current = current; - this.world = world; - this.x = x; - this.y = y; - this.z = z; - } - - public boolean isHandled() { - return handled; - } - - public void setHandled() { - handled = true; - } -} diff --git a/src/extrabiomes/api/events/GetBiomeIDEvent.java b/src/extrabiomes/api/events/GetBiomeIDEvent.java deleted file mode 100644 index b67fb623405..00000000000 --- a/src/extrabiomes/api/events/GetBiomeIDEvent.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * This work is licensed under the Creative Commons - * Attribution-ShareAlike 3.0 Unported License. To view a copy of this - * license, visit http://creativecommons.org/licenses/by-sa/3.0/. - */ - -package extrabiomes.api.events; - -import net.minecraftforge.event.Event; - - -/** - * Used by the API to retrieve a biomeID - * - * @author Scott - * - */ -public class GetBiomeIDEvent extends Event { - - /** - * Valid values: - * - *

-     *     ALPINE
-     *     AUTUMNWOODS
-     *     BIRCHFOREST
-     *     EXTREMEJUNGLE
-     *     FORESTEDHILLS
-     *     FORESTEDISLAND
-     *     GLACIER
-     *     GREENHILLS
-     *     GREENSWAMP
-     *     ICEWASTELAND
-     *     MARSH
-     *     MEADOW
-     *     MINIJUNGLE
-     *     MOUNTAINDESERT
-     *     MOUNTAINRIDGE
-     *     MOUNTAINTAIGA
-     *     PINEFOREST
-     *     RAINFOREST
-     *     REDWOODFOREST
-     *     REDWOODLUSH
-     *     SAVANNA
-     *     SHRUBLAND
-     *     SNOWYFOREST
-     *     SNOWYRAINFOREST
-     *     TEMPORATERAINFOREST
-     *     TUNDRA
-     *     WASTELAND
-     *     WOODLANDS
-     * 
- */ - public final String targetBiome; - public int biomeID; - - public GetBiomeIDEvent(String targetBiome) { - this.targetBiome = targetBiome; - } - -}