diff --git a/fml/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java b/fml/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java index 5e0286bb5..84faa5478 100644 --- a/fml/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java +++ b/fml/bukkit/cpw/mods/fml/server/FMLBukkitHandler.java @@ -14,15 +14,17 @@ package cpw.mods.fml.server; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.Properties; import java.util.Random; import java.util.logging.Logger; import net.minecraft.server.MinecraftServer; import net.minecraft.server.BaseMod; import net.minecraft.server.BiomeBase; -import net.minecraft.server.CommonRegistry; import net.minecraft.server.EntityItem; import net.minecraft.server.EntityHuman; import net.minecraft.server.IChunkProvider; @@ -39,6 +41,10 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.IFMLSidedHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.modloader.ModLoaderModContainer; +import cpw.mods.fml.common.modloader.ModProperty; +import cpw.mods.fml.common.registry.FMLRegistry; /** * Handles primary communication from hooked code into the system @@ -109,7 +115,7 @@ public class FMLBukkitHandler implements IFMLSidedHandler } server = minecraftServer; FMLCommonHandler.instance().registerSidedDelegate(this); - CommonRegistry.registerRegistry(new BukkitRegistry()); + FMLRegistry.registerRegistry(new BukkitRegistry()); Loader.instance().loadMods(); } @@ -126,7 +132,7 @@ public class FMLBukkitHandler implements IFMLSidedHandler */ public void onPreTick() { - FMLCommonHandler.instance().gameTickStart(); + FMLCommonHandler.instance().worldTickStart(); } /** @@ -134,7 +140,7 @@ public class FMLBukkitHandler implements IFMLSidedHandler */ public void onPostTick() { - FMLCommonHandler.instance().gameTickEnd(); + FMLCommonHandler.instance().worldTickEnd(); } /** @@ -511,4 +517,52 @@ public class FMLBukkitHandler implements IFMLSidedHandler } } } + + @Override + public Object getMinecraftInstance() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getCurrentLanguage() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Properties getCurrentLanguageTable() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getObjectName(Object minecraftObject) { + // TODO Auto-generated method stub + return null; + } + + @Override + public ModMetadata readMetadataFrom(InputStream input, ModContainer mod) throws Exception { + // TODO Auto-generated method stub + return null; + } + + @Override + public void profileStart(String profileLabel) { + // TODO Auto-generated method stub + + } + + @Override + public void profileEnd() { + // TODO Auto-generated method stub + + } + + @Override + public ModProperty getModLoaderPropertyFor(Field f) { + // TODO Auto-generated method stub + return null; + } } diff --git a/fml/bukkit/cpw/mods/fml/server/ModLoaderModContainer.java b/fml/bukkit/cpw/mods/fml/server/ModLoaderModContainer.java deleted file mode 100644 index 58491887a..000000000 --- a/fml/bukkit/cpw/mods/fml/server/ModLoaderModContainer.java +++ /dev/null @@ -1,529 +0,0 @@ -/* - * The FML Forge Mod Loader suite. - * Copyright (C) 2012 cpw - * - * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -package cpw.mods.fml.server; - -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import java.util.StringTokenizer; - -import net.minecraft.server.BaseMod; -import net.minecraft.server.MLProp; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.IConsoleHandler; -import cpw.mods.fml.common.ICraftingHandler; -import cpw.mods.fml.common.IDispenseHandler; -import cpw.mods.fml.common.INetworkHandler; -import cpw.mods.fml.common.IPickupNotifier; -import cpw.mods.fml.common.IPlayerTracker; -import cpw.mods.fml.common.IWorldGenerator; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.LoaderException; -import cpw.mods.fml.common.ModContainer; - -public class ModLoaderModContainer implements ModContainer -{ - private Class modClazz; - private BaseMod mod; - private boolean isTicking; - private File modSource ; - private ArrayList dependencies; - private ArrayList preDependencies; - private ArrayList postDependencies; - public ModLoaderModContainer(Class modClazz, File modSource) - { - this.modClazz = modClazz; - this.modSource = modSource; - } - - @Override - public boolean wantsPreInit() - { - return true; - } - - @Override - public boolean wantsPostInit() - { - return true; - } - - @Override - public void preInit() - { - try - { - configureMod(); - mod = modClazz.newInstance(); - } - catch (Exception e) - { - throw new LoaderException(e); - } - } - - /** - * - */ - private void configureMod() - { - File configDir = Loader.instance().getConfigDir(); - String modConfigName = modClazz.getSimpleName(); - File modConfig = new File(configDir, String.format("%s.cfg", modConfigName)); - Properties props = new Properties(); - - if (modConfig.exists()) - { - try - { - Loader.log.fine(String.format("Reading existing configuration file for %s : %s", modConfigName, modConfig.getName())); - FileReader configReader = new FileReader(modConfig); - props.load(configReader); - configReader.close(); - } - catch (Exception e) - { - Loader.log.severe(String.format("Error occured reading mod configuration file %s", modConfig.getName())); - Loader.log.throwing("ModLoaderModContainer", "configureMod", e); - throw new LoaderException(e); - } - } - - StringBuffer comments = new StringBuffer(); - comments.append("MLProperties: name (type:default) min:max -- information\n"); - - try - { - for (Field f : modClazz.getDeclaredFields()) - { - if (!Modifier.isStatic(f.getModifiers())) - { - continue; - } - - if (!f.isAnnotationPresent(MLProp.class)) - { - continue; - } - - MLProp property = f.getAnnotation(MLProp.class); - String propertyName = property.name().length() > 0 ? property.name() : f.getName(); - String propertyValue = null; - Object defaultValue = null; - - try - { - defaultValue = f.get(null); - propertyValue = props.getProperty(propertyName, extractValue(defaultValue)); - Object currentValue = parseValue(propertyValue, property, f.getType(), propertyName, modConfigName); - Loader.log.finest(String.format("Configuration for %s.%s found values default: %s, configured: %s, interpreted: %s", modConfigName, propertyName, defaultValue, propertyValue, currentValue)); - - if (currentValue != null && !currentValue.equals(defaultValue)) - { - Loader.log.finest(String.format("Configuration for %s.%s value set to: %s", modConfigName, propertyName, currentValue)); - f.set(null, currentValue); - } - } - catch (Exception e) - { - Loader.log.severe(String.format("Invalid configuration found for %s in %s", propertyName, modConfig.getName())); - Loader.log.throwing("ModLoaderModContainer", "configureMod", e); - throw new LoaderException(e); - } - finally - { - comments.append(String.format("MLProp : %s (%s:%s", propertyName, f.getType().getName(), defaultValue)); - - if (property.min() != Double.MIN_VALUE) - { - comments.append(",>=").append(String.format("%.1f", property.min())); - } - - if (property.max() != Double.MAX_VALUE) - { - comments.append(",<=").append(String.format("%.1f", property.max())); - } - - comments.append(")"); - - if (property.info().length() > 0) - { - comments.append(" -- ").append(property.info()); - } - - if (propertyValue != null) - { - props.setProperty(propertyName, extractValue(propertyValue)); - } - comments.append("\n"); - } - } - } - finally - { - try - { - FileWriter configWriter = new FileWriter(modConfig); - props.store(configWriter, comments.toString()); - configWriter.close(); - Loader.log.fine(String.format("Configuration for %s written to %s", modConfigName, modConfig.getName())); - } - catch (IOException e) - { - Loader.log.warning(String.format("Error trying to write the config file %s", modConfig.getName())); - Loader.log.throwing("ModLoaderModContainer", "configureMod", e); - throw new LoaderException(e); - } - } - } - - private Object parseValue(String val, MLProp property, Class type, String propertyName, String modConfigName) - { - if (type.isAssignableFrom(String.class)) - { - return (String)val; - } - else if (type.isAssignableFrom(Boolean.TYPE) || type.isAssignableFrom(Boolean.class)) - { - return Boolean.parseBoolean(val); - } - else if (Number.class.isAssignableFrom(type) || type.isPrimitive()) - { - Number n = null; - - if (type.isAssignableFrom(Double.TYPE) || Double.class.isAssignableFrom(type)) - { - n = Double.parseDouble(val); - } - else if (type.isAssignableFrom(Float.TYPE) || Float.class.isAssignableFrom(type)) - { - n = Float.parseFloat(val); - } - else if (type.isAssignableFrom(Long.TYPE) || Long.class.isAssignableFrom(type)) - { - n = Long.parseLong(val); - } - else if (type.isAssignableFrom(Integer.TYPE) || Integer.class.isAssignableFrom(type)) - { - n = Integer.parseInt(val); - } - else if (type.isAssignableFrom(Short.TYPE) || Short.class.isAssignableFrom(type)) - { - n = Short.parseShort(val); - } - else if (type.isAssignableFrom(Byte.TYPE) || Byte.class.isAssignableFrom(type)) - { - n = Byte.parseByte(val); - } - else - { - throw new IllegalArgumentException(String.format("MLProp declared on %s of type %s, an unsupported type",propertyName, type.getName())); - } - - if (n.doubleValue() < property.min() || n.doubleValue() > property.max()) - { - Loader.log.warning(String.format("Configuration for %s.%s found value %s outside acceptable range %s,%s", modConfigName,propertyName, n, property.min(), property.max())); - return null; - } - else - { - return n; - } - } - - throw new IllegalArgumentException(String.format("MLProp declared on %s of type %s, an unsupported type",propertyName, type.getName())); - } - private String extractValue(Object value) - { - if (String.class.isInstance(value)) - { - return (String)value; - } - else if (Number.class.isInstance(value) || Boolean.class.isInstance(value)) - { - return String.valueOf(value); - } - else - { - throw new IllegalArgumentException("MLProp declared on non-standard type"); - } - } - @Override - public void init() - { - mod.load(); - } - - @Override - public void postInit() - { - mod.modsLoaded(); - } - - @Override - public void tickStart() - { - if (isTicking) - { - isTicking = mod.onTickInGame(FMLBukkitHandler.instance().getServer()); - } - } - @Override - public void tickEnd() - { - // NOOP for modloader - } - - @Override - public String getName() - { - return mod != null ? mod.getName() : null; - } - - public static ModContainer findContainerFor(BaseMod mod) - { - for (ModContainer mc : Loader.getModList()) - { - if (mc.matches(mod)) - { - return mc; - } - } - - return null; - } - - @Override - public boolean matches(Object mod) - { - return modClazz.isInstance(mod); - } - - public void setTicking(boolean enable) - { - isTicking = enable; - } - - /** - * Find all the BaseMods in the system - * @return - */ - public static List findAll() - { - ArrayList modList = new ArrayList(); - - for (ModContainer mc : Loader.getModList()) - { - if (mc instanceof ModLoaderModContainer) - { - modList.add(((ModLoaderModContainer)mc).mod); - } - } - - return modList; - } - - @Override - public File getSource() - { - return modSource; - } - - @Override - public Object getMod() - { - return mod; - } - - @Override - public boolean generatesWorld() - { - return true; - } - - @Override - public IWorldGenerator getWorldGenerator() - { - return mod; - } - - @Override - public int lookupFuelValue(int itemId, int itemDamage) - { - return mod.addFuel(itemId, itemDamage); - } - - @Override - public boolean wantsPickupNotification() - { - return true; - } - - @Override - public IPickupNotifier getPickupNotifier() - { - return mod; - } - - @Override - public boolean wantsToDispense() - { - return true; - } - - @Override - public IDispenseHandler getDispenseHandler() - { - return mod; - } - - @Override - public boolean wantsCraftingNotification() - { - return true; - } - - @Override - public ICraftingHandler getCraftingHandler() - { - return mod; - } - - private void computeDependencies() - { - dependencies = new ArrayList(); - preDependencies = new ArrayList(); - postDependencies = new ArrayList(); - - if (mod.getPriorities() == null || mod.getPriorities().length() == 0) - { - return; - } - - StringTokenizer st = new StringTokenizer(mod.getPriorities(), ";"); - - for (; st.hasMoreTokens();) - { - String dep = st.nextToken(); - String[] depparts = dep.split(":"); - - if (depparts.length < 2) - { - throw new LoaderException(); - } - - if ("required-before".equals(depparts[0]) || "required-after".equals(depparts[0])) - { - dependencies.add(depparts[1]); - } - - if ("required-before".equals(depparts[0]) || "before".equals(depparts[0])) - { - postDependencies.add(depparts[1]); - } - - if ("required-after".equals(depparts[0]) || "after".equals(depparts[0])) - { - preDependencies.add(depparts[1]); - } - - } - } - - @Override - public List getDependencies() - { - if (dependencies == null) - { - computeDependencies(); - } - - return dependencies; - } - - @Override - public List getPostDepends() - { - if (dependencies == null) - { - computeDependencies(); - } - - return postDependencies; - } - - @Override - public List getPreDepends() - { - if (dependencies == null) - { - computeDependencies(); - } - return preDependencies; - } - - - public String toString() - { - return modSource.getName(); - } - - @Override - public boolean wantsNetworkPackets() - { - return true; - } - - @Override - public INetworkHandler getNetworkHandler() - { - return mod; - } - - @Override - public boolean ownsNetworkChannel(String channel) - { - return FMLCommonHandler.instance().getChannelListFor(this).contains(channel); - } - - @Override - public boolean wantsConsoleCommands() - { - return true; - } - - @Override - public IConsoleHandler getConsoleHandler() - { - return mod; - } - - @Override - public boolean wantsPlayerTracking() - { - return true; - } - - @Override - public IPlayerTracker getPlayerTracker() - { - return mod; - } -} diff --git a/fml/bukkit/net/minecraft/server/BaseMod.java b/fml/bukkit/net/minecraft/server/BaseMod.java index 47c8641e5..121818131 100644 --- a/fml/bukkit/net/minecraft/server/BaseMod.java +++ b/fml/bukkit/net/minecraft/server/BaseMod.java @@ -25,7 +25,7 @@ import cpw.mods.fml.common.IPickupNotifier; import cpw.mods.fml.common.IPlayerTracker; import cpw.mods.fml.common.IWorldGenerator; -public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDispenseHandler, ICraftingHandler, INetworkHandler, IConsoleHandler, IPlayerTracker +public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseMod { // CALLBACK MECHANISMS @Override diff --git a/fml/bukkit/net/minecraft/server/BukkitRegistry.java b/fml/bukkit/net/minecraft/server/BukkitRegistry.java index 541fe66df..bc113cac8 100644 --- a/fml/bukkit/net/minecraft/server/BukkitRegistry.java +++ b/fml/bukkit/net/minecraft/server/BukkitRegistry.java @@ -3,41 +3,45 @@ package net.minecraft.server; import java.util.Collections; import java.util.List; +import net.minecraft.src.BiomeGenBase; + +import cpw.mods.fml.common.registry.IMinecraftRegistry; + public class BukkitRegistry implements IMinecraftRegistry { @Override - public void addRecipe(ItemStack output, Object... params) + public void addRecipe(net.minecraft.src.ItemStack output, Object... params) { - CraftingManager.getInstance().registerShapedRecipe(output, params); + CraftingManager.getInstance().registerShapedRecipe((ItemStack) output, params); } @Override - public void addShapelessRecipe(ItemStack output, Object... params) + public void addShapelessRecipe(net.minecraft.src.ItemStack output, Object... params) { - CraftingManager.getInstance().registerShapelessRecipe(output, params); + CraftingManager.getInstance().registerShapelessRecipe((ItemStack) output, params); } @Override - public void addSmelting(int input, ItemStack output) + public void addSmelting(int input, net.minecraft.src.ItemStack output) { - FurnaceRecipes.getInstance().registerRecipe(input, output); + FurnaceRecipes.getInstance().registerRecipe(input, (ItemStack) output); } @Override - public void registerBlock(Block block) + public void registerBlock(net.minecraft.src.Block block) { registerBlock(block, ItemBlock.class); } @Override - public void registerBlock(Block block, Class itemclass) + public void registerBlock(net.minecraft.src.Block block, Class itemclass) { try { assert block != null : "registerBlock: block cannot be null"; assert itemclass != null : "registerBlock: itemclass cannot be null"; - int blockItemId = block.id - 256; + int blockItemId = ((Block)block).id - 256; itemclass.getConstructor(int.class).newInstance(blockItemId); } catch (Exception e) @@ -47,37 +51,37 @@ public class BukkitRegistry implements IMinecraftRegistry } @Override - public void registerEntityID(Class entityClass, String entityName, int id) + public void registerEntityID(Class entityClass, String entityName, int id) { - EntityTypes.addNewEntityListMapping(entityClass, entityName, id); + EntityTypes.addNewEntityListMapping((Class) entityClass, entityName, id); } @Override - public void registerEntityID(Class entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour) + public void registerEntityID(Class entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour) { - EntityTypes.addNewEntityListMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour); + EntityTypes.addNewEntityListMapping((Class) entityClass, entityName, id, backgroundEggColour, foregroundEggColour); } @Override - public void registerTileEntity(Class tileEntityClass, String id) + public void registerTileEntity(Class tileEntityClass, String id) { - TileEntity.addNewTileEntityMapping(tileEntityClass, id); + TileEntity.addNewTileEntityMapping((Class) tileEntityClass, id); } @Override - public void addBiome(Object biome) + public void addBiome(BiomeGenBase biome) { - //NOOP because the implementation idea is broken. Creating a BiomeGenBase adds the biome already. + //TODO } @Override - public void addSpawn(Class entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, Object... biomes) + public void addSpawn(Class entityClass, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomes) { BiomeBase[] realBiomes=(BiomeBase[]) biomes; for (BiomeBase biome : realBiomes) { @SuppressWarnings("unchecked") - List spawns = biome.getMobs(typeOfCreature); + List spawns = ((BiomeBase)biome).getMobs((EnumCreatureType)typeOfCreature); for (BiomeMeta entry : spawns) { @@ -97,30 +101,30 @@ public class BukkitRegistry implements IMinecraftRegistry @Override @SuppressWarnings("unchecked") - public void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, Object... biomes) + public void addSpawn(String entityName, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes) { Class entityClazz = EntityTypes.getEntityToClassMapping().get(entityName); if (EntityLiving.class.isAssignableFrom(entityClazz)) { - addSpawn((Class ) entityClazz, weightedProb, min, max, spawnList, biomes); + addSpawn((Class ) entityClazz, weightedProb, min, max, spawnList, biomes); } } @Override - public void removeBiome(Object biome) + public void removeBiome(BiomeGenBase biome) { - // NOOP because broken + // TODO } @Override - public void removeSpawn(Class entityClass, EnumCreatureType typeOfCreature, Object... biomesO) + public void removeSpawn(Class entityClass, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomesO) { BiomeBase[] biomes=(BiomeBase[]) biomesO; for (BiomeBase biome : biomes) { @SuppressWarnings("unchecked") - List spawns = biome.getMobs(typeOfCreature); + List spawns = ((BiomeBase)biome).getMobs((EnumCreatureType) typeOfCreature); for (BiomeMeta entry : Collections.unmodifiableList(spawns)) { @@ -134,13 +138,13 @@ public class BukkitRegistry implements IMinecraftRegistry @Override @SuppressWarnings("unchecked") - public void removeSpawn(String entityName, EnumCreatureType spawnList, Object... biomes) + public void removeSpawn(String entityName, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes) { Class entityClazz = EntityTypes.getEntityToClassMapping().get(entityName); if (EntityLiving.class.isAssignableFrom(entityClazz)) { - removeSpawn((Class ) entityClazz, spawnList, biomes); + removeSpawn((Class ) entityClazz, spawnList, biomes); } } diff --git a/fml/bukkit/net/minecraft/server/ModLoader.java b/fml/bukkit/net/minecraft/server/ModLoader.java index 13c69810c..69fd90af5 100644 --- a/fml/bukkit/net/minecraft/server/ModLoader.java +++ b/fml/bukkit/net/minecraft/server/ModLoader.java @@ -18,8 +18,10 @@ import java.util.logging.Logger; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ReflectionHelper; +import cpw.mods.fml.common.modloader.ModLoaderHelper; +import cpw.mods.fml.common.modloader.ModLoaderModContainer; +import cpw.mods.fml.common.registry.FMLRegistry; import cpw.mods.fml.server.FMLBukkitHandler; -import cpw.mods.fml.server.ModLoaderModContainer; public class ModLoader { @@ -142,7 +144,7 @@ public class ModLoader */ public static void addRecipe(ItemStack output, Object... params) { - CommonRegistry.addRecipe(output, params); + FMLRegistry.addRecipe(output, params); } /** @@ -152,7 +154,7 @@ public class ModLoader */ public static void addShapelessRecipe(ItemStack output, Object... params) { - CommonRegistry.addShapelessRecipe(output, params); + FMLRegistry.addShapelessRecipe(output, params); } /** @@ -162,7 +164,7 @@ public class ModLoader */ public static void addSmelting(int input, ItemStack output) { - CommonRegistry.addSmelting(input, output); + FMLRegistry.addSmelting(input, output); } /** @@ -175,7 +177,7 @@ public class ModLoader */ public static void addSpawn(Class entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList) { - CommonRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); + FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); } /** @@ -189,7 +191,7 @@ public class ModLoader */ public static void addSpawn(Class entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeBase... biomes) { - CommonRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, biomes); + FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, biomes); } /** @@ -202,7 +204,7 @@ public class ModLoader */ public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList) { - CommonRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); + FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); } /** @@ -216,7 +218,7 @@ public class ModLoader */ public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeBase... biomes) { - CommonRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, biomes); + FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, biomes); } /** @@ -301,7 +303,7 @@ public class ModLoader */ public static List getLoadedMods() { - return ModLoaderModContainer.findAll(); + return ModLoaderModContainer.findAll(BaseMod.class); } /** @@ -377,7 +379,7 @@ public class ModLoader */ public static void registerBlock(Block block) { - CommonRegistry.registerBlock(block); + FMLRegistry.registerBlock(block); } /** @@ -387,7 +389,7 @@ public class ModLoader */ public static void registerBlock(Block block, Class itemclass) { - CommonRegistry.registerBlock(block, itemclass); + FMLRegistry.registerBlock(block, itemclass); } /** @@ -398,7 +400,7 @@ public class ModLoader */ public static void registerEntityID(Class entityClass, String entityName, int id) { - CommonRegistry.registerEntityID(entityClass, entityName, id); + FMLRegistry.registerEntityID(entityClass, entityName, id); } /** @@ -411,7 +413,7 @@ public class ModLoader */ public static void registerEntityID(Class entityClass, String entityName, int id, int background, int foreground) { - CommonRegistry.registerEntityID(entityClass, entityName, id, background, foreground); + FMLRegistry.registerEntityID(entityClass, entityName, id, background, foreground); } /** @@ -433,7 +435,7 @@ public class ModLoader */ public static void registerTileEntity(Class tileEntityClass, String id) { - CommonRegistry.registerTileEntity(tileEntityClass, id); + FMLRegistry.registerTileEntity(tileEntityClass, id); } /** @@ -443,7 +445,7 @@ public class ModLoader @Deprecated public static void removeBiome(BiomeBase biome) { - CommonRegistry.removeBiome(biome); + FMLRegistry.removeBiome(biome); } /** @@ -453,7 +455,7 @@ public class ModLoader */ public static void removeSpawn(Class entityClass, EnumCreatureType spawnList) { - CommonRegistry.removeSpawn(entityClass, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); + FMLRegistry.removeSpawn(entityClass, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); } /** @@ -464,7 +466,7 @@ public class ModLoader */ public static void removeSpawn(Class entityClass, EnumCreatureType spawnList, BiomeBase... biomes) { - CommonRegistry.removeSpawn(entityClass, spawnList, biomes); + FMLRegistry.removeSpawn(entityClass, spawnList, biomes); } /** @@ -474,7 +476,7 @@ public class ModLoader */ public static void removeSpawn(String entityName, EnumCreatureType spawnList) { - CommonRegistry.removeSpawn(entityName, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); + FMLRegistry.removeSpawn(entityName, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes()); } /** @@ -485,7 +487,7 @@ public class ModLoader */ public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeBase... biomes) { - CommonRegistry.removeSpawn(entityName, spawnList, biomes); + FMLRegistry.removeSpawn(entityName, spawnList, biomes); } /** @@ -519,8 +521,7 @@ public class ModLoader */ public static void setInGameHook(BaseMod mod, boolean enable, boolean useClock) { - ModLoaderModContainer mlmc = (ModLoaderModContainer) ModLoaderModContainer.findContainerFor(mod); - mlmc.setTicking(enable); + ModLoaderHelper.updateStandardTicks(mod, enable, useClock); } /** diff --git a/fml/bukkit/net/minecraft/src/BiomeGenBase.java b/fml/bukkit/net/minecraft/src/BiomeGenBase.java new file mode 100644 index 000000000..bf1a123a3 --- /dev/null +++ b/fml/bukkit/net/minecraft/src/BiomeGenBase.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface BiomeGenBase { + +} diff --git a/fml/bukkit/net/minecraft/src/Block.java b/fml/bukkit/net/minecraft/src/Block.java new file mode 100644 index 000000000..446833760 --- /dev/null +++ b/fml/bukkit/net/minecraft/src/Block.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface Block { + +} diff --git a/fml/bukkit/net/minecraft/src/Entity.java b/fml/bukkit/net/minecraft/src/Entity.java new file mode 100644 index 000000000..2ffd2feac --- /dev/null +++ b/fml/bukkit/net/minecraft/src/Entity.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface Entity { + +} diff --git a/fml/bukkit/net/minecraft/src/EntityLiving.java b/fml/bukkit/net/minecraft/src/EntityLiving.java new file mode 100644 index 000000000..bb0ead942 --- /dev/null +++ b/fml/bukkit/net/minecraft/src/EntityLiving.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface EntityLiving { + +} diff --git a/fml/bukkit/net/minecraft/src/EnumCreatureType.java b/fml/bukkit/net/minecraft/src/EnumCreatureType.java new file mode 100644 index 000000000..cce43da20 --- /dev/null +++ b/fml/bukkit/net/minecraft/src/EnumCreatureType.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface EnumCreatureType { + +} diff --git a/fml/bukkit/net/minecraft/src/ItemBlock.java b/fml/bukkit/net/minecraft/src/ItemBlock.java new file mode 100644 index 000000000..0ed5ab5b7 --- /dev/null +++ b/fml/bukkit/net/minecraft/src/ItemBlock.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface ItemBlock { + +} diff --git a/fml/bukkit/net/minecraft/src/ItemStack.java b/fml/bukkit/net/minecraft/src/ItemStack.java new file mode 100644 index 000000000..533c19451 --- /dev/null +++ b/fml/bukkit/net/minecraft/src/ItemStack.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface ItemStack { + +} diff --git a/fml/bukkit/net/minecraft/src/TileEntity.java b/fml/bukkit/net/minecraft/src/TileEntity.java new file mode 100644 index 000000000..e29d6a48d --- /dev/null +++ b/fml/bukkit/net/minecraft/src/TileEntity.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface TileEntity { + +}