ForgePatch/fml/server/net/minecraft/src/ModLoader.java

202 lines
6.5 KiB
Java
Raw Normal View History

2012-03-30 14:11:13 +00:00
/*
* The FML Forge Mod Loader suite.
2012-03-30 14:11:13 +00:00
* 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
*/
2012-03-30 05:12:59 +00:00
package net.minecraft.src;
2012-03-28 16:53:08 +00:00
import java.util.List;
import java.util.logging.Logger;
2012-03-30 14:11:13 +00:00
import fml.Loader;
import fml.ml.ModLoaderModContainer;
2012-03-31 02:26:16 +00:00
import fml.obf.FMLHandler;
2012-03-30 05:12:59 +00:00
2012-03-28 16:53:08 +00:00
import net.minecraft.src.Achievement;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.EnumCreatureType;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.IInventory;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
public class ModLoader {
2012-03-28 17:29:23 +00:00
static void addAchievementDesc(Achievement achievement, String name, String description) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static int addAllFuel(int id, int metadata) {
return 0;
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static int addArmor(String armor) {
return 0;
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addBiome(BiomeGenBase biome) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addLocalization(String key, String value) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addLocalization(String key, String lang, String value) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addName(Object instance, String name) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addName(Object instance, String lang, String name) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static int addOverride(String fileToOverride, String fileToAdd) {
return 0;
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addOverride(String path, String overlayPath, int index) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addRecipe(ItemStack output, Object... params) {
2012-03-31 02:26:16 +00:00
CraftingManager.getInstance().addRecipe(output, params);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addShapelessRecipe(ItemStack output, Object... params) {
2012-03-31 02:26:16 +00:00
CraftingManager.getInstance().addShapelessRecipe(output, params);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addSmelting(int input, ItemStack output) {
2012-03-31 02:26:16 +00:00
FurnaceRecipes.smelting().addSmelting(input, output);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList) {
2012-03-31 02:26:16 +00:00
CommonRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes) {
2012-03-31 02:26:16 +00:00
CommonRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, biomes);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList) {
2012-03-31 02:26:16 +00:00
CommonRegistry.addSpawn(entityName, weightedProb, min, max, spawnList);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes) {
2012-03-31 02:26:16 +00:00
CommonRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, biomes);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item) {
return false;
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void genericContainerRemoval(World world, int x, int y, int z) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static List<BaseMod> getLoadedMods() {
2012-03-31 02:26:16 +00:00
return ModLoaderModContainer.findAll();
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static Logger getLogger() {
2012-03-31 02:26:16 +00:00
return FMLHandler.getMinecraftLogger();
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, int fieldindex) {
return null;
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, String field) {
return null;
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static int getUniqueEntityId() {
return 0;
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static boolean isModLoaded(String modname) {
2012-03-31 02:26:16 +00:00
return Loader.isModLoaded(modname);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void receivePacket(Packet250CustomPayload packet) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void registerBlock(Block block) {
2012-03-30 05:12:59 +00:00
CommonRegistry.registerBlock(block);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void registerBlock(Block block, Class<? extends ItemBlock> itemclass) {
2012-03-30 05:12:59 +00:00
CommonRegistry.registerBlock(block, itemclass);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id) {
2012-03-30 05:12:59 +00:00
CommonRegistry.registerEntityID(entityClass, entityName, id);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id, int background, int foreground) {
2012-03-30 05:12:59 +00:00
CommonRegistry.registerEntityID(entityClass, entityName, id, background, foreground);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void registerPacketChannel(BaseMod mod, String channel) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id) {
2012-03-30 05:12:59 +00:00
CommonRegistry.registerTileEntity(tileEntityClass, id);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void removeBiome(BiomeGenBase biome) {
2012-03-30 05:12:59 +00:00
CommonRegistry.removeBiome(biome);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList) {
2012-03-30 05:12:59 +00:00
CommonRegistry.removeSpawn(entityClass, spawnList);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList, BiomeGenBase... biomes) {
2012-03-30 05:12:59 +00:00
CommonRegistry.removeSpawn(entityClass, spawnList, biomes);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void removeSpawn(String entityName, EnumCreatureType spawnList) {
2012-03-30 05:12:59 +00:00
CommonRegistry.removeSpawn(entityName, spawnList);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes) {
2012-03-30 05:12:59 +00:00
CommonRegistry.removeSpawn(entityName, spawnList, biomes);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void saveConfig() {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void serverChat(String text) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void setInGameHook(BaseMod mod, boolean enable, boolean useClock) {
2012-03-30 05:12:59 +00:00
ModLoaderModContainer mlmc=(ModLoaderModContainer) ModLoaderModContainer.findContainerFor(mod);
mlmc.setTicking(enable);
2012-03-28 17:29:23 +00:00
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, int fieldindex, E value) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, String field, E value) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void takenFromFurnace(EntityPlayer player, ItemStack item) {
}
2012-03-28 16:53:08 +00:00
2012-03-28 17:29:23 +00:00
static void throwException(String message, Throwable e) {
}
2012-03-30 05:12:59 +00:00
}