mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Change some stuff around - begin launching the server through the wrapper too.
A lot of patches went in - the client and server both launch and start up mods.
This commit is contained in:
1 parent
153eafdcb0
commit
719bea515e
39 files changed
+1005
-771
No files matched your search
@@ -50,7 +50,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.BaseMod;
|
||||
import net.minecraft.src.BiomeGenBase;
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.ClientRegistry;
|
||||
import net.minecraft.src.CrashReport;
|
||||
import net.minecraft.src.EntityItem;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
@@ -84,6 +83,7 @@ import net.minecraft.src.World;
|
||||
import net.minecraft.src.WorldType;
|
||||
import argo.jdom.JdomParser;
|
||||
import argo.jdom.JsonNode;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
||||
import cpw.mods.fml.common.DummyModContainer;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -168,7 +168,6 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
client = minecraft;
|
||||
ObfuscationReflectionHelper.detectObfuscation(World.class);
|
||||
FMLCommonHandler.instance().beginLoading(this);
|
||||
FMLRegistry.registerRegistry(new ClientRegistry());
|
||||
try
|
||||
{
|
||||
Class<?> optifineConfig = Class.forName("Config", false, Loader.instance().getModClassLoader());
|
||||
@@ -204,7 +203,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
* Also initializes key bindings
|
||||
*
|
||||
*/
|
||||
public void onLoadComplete()
|
||||
public void finishMinecraftLoading()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package cpw.mods.fml.client.registry;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.src.BiomeGenBase;
|
||||
import net.minecraft.src.TileEntity;
|
||||
import net.minecraft.src.TileEntityRenderer;
|
||||
import net.minecraft.src.TileEntitySpecialRenderer;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.registry.FMLRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.IMinecraftRegistry;
|
||||
|
||||
public class ClientRegistry
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Utility method for registering a tile entity and it's renderer at once - generally you should register them separately
|
||||
*
|
||||
* @param tileEntityClass
|
||||
* @param id
|
||||
* @param specialRenderer
|
||||
*/
|
||||
public static void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id, TileEntitySpecialRenderer specialRenderer)
|
||||
{
|
||||
GameRegistry.registerTileEntity(tileEntityClass, id);
|
||||
bindTileEntitySpecialRenderer(tileEntityClass, specialRenderer);
|
||||
}
|
||||
|
||||
public static void bindTileEntitySpecialRenderer(Class <? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer)
|
||||
{
|
||||
TileEntityRenderer.field_76963_a.field_76966_m.put(tileEntityClass, specialRenderer);
|
||||
specialRenderer.func_76893_a(TileEntityRenderer.field_76963_a);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package cpw.mods.fml.client.registry;
|
||||
|
||||
public class RenderingRegistry
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.registry.FMLRegistry;
|
||||
import cpw.mods.fml.common.registry.IMinecraftRegistry;
|
||||
|
||||
public class ClientRegistry implements IMinecraftRegistry
|
||||
{
|
||||
|
||||
public static ClientRegistry instance() {
|
||||
return (ClientRegistry) FMLRegistry.instance();
|
||||
}
|
||||
@Override
|
||||
public void addRecipe(ItemStack output, Object... params)
|
||||
{
|
||||
CraftingManager.func_77594_a().func_77595_a(output, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapelessRecipe(ItemStack output, Object... params)
|
||||
{
|
||||
CraftingManager.func_77594_a().func_77596_b(output, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe(IRecipe recipe)
|
||||
{
|
||||
CraftingManager.func_77594_a().func_77592_b().add(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSmelting(int input, ItemStack output, float xp)
|
||||
{
|
||||
FurnaceRecipes.func_77602_a().func_77600_a(input, output, xp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlock(Block block)
|
||||
{
|
||||
registerBlock(block, ItemBlock.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlock(Block block, Class <? extends ItemBlock > itemclass)
|
||||
{
|
||||
try
|
||||
{
|
||||
assert block != null : "registerBlock: block cannot be null";
|
||||
assert itemclass != null : "registerBlock: itemclass cannot be null";
|
||||
int blockItemId = block.field_71990_ca - 256;
|
||||
itemclass.getConstructor(int.class).newInstance(blockItemId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//HMMM
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id)
|
||||
{
|
||||
EntityList.addNewEntityListMapping(entityClass, entityName, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
|
||||
{
|
||||
EntityList.addNewEntityListMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id)
|
||||
{
|
||||
TileEntity.addNewTileEntityMapping(tileEntityClass, id);
|
||||
}
|
||||
|
||||
public void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id, TileEntitySpecialRenderer specialRenderer)
|
||||
{
|
||||
registerTileEntity(tileEntityClass, id);
|
||||
TileEntityRenderer.setTileEntityRenderer(tileEntityClass, specialRenderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBiome(BiomeGenBase biome)
|
||||
{
|
||||
FMLClientHandler.instance().addBiomeToDefaultWorldGenerator(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
for (BiomeGenBase biome : biomes)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<SpawnListEntry> spawns = biome.func_25063_a(typeOfCreature);
|
||||
|
||||
for (SpawnListEntry entry : spawns)
|
||||
{
|
||||
//Adjusting an existing spawn entry
|
||||
if (entry.field_25212_a == entityClass)
|
||||
{
|
||||
entry.field_35590_d = weightedProb;
|
||||
entry.field_35591_b = min;
|
||||
entry.field_35592_c = max;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = EntityList.getEntityToClassMapping().get(entityName);
|
||||
|
||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||
{
|
||||
addSpawn((Class <? extends EntityLiving >) entityClazz, weightedProb, min, max, spawnList, biomes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBiome(BiomeGenBase biome)
|
||||
{
|
||||
FMLClientHandler.instance().removeBiomeFromDefaultWorldGenerator(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
for (BiomeGenBase biome : biomes)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
Iterator<SpawnListEntry> spawns = biome.func_25063_a(typeOfCreature).iterator();
|
||||
|
||||
while (spawns.hasNext())
|
||||
{
|
||||
SpawnListEntry entry = spawns.next();
|
||||
if (entry.field_25212_a == entityClass)
|
||||
{
|
||||
spawns.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = EntityList.getEntityToClassMapping().get(entityName);
|
||||
|
||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||
{
|
||||
removeSpawn((Class <? extends EntityLiving >) entityClazz, spawnList, biomes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import cpw.mods.fml.client.BlockRenderManager;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.SpriteHelper;
|
||||
import cpw.mods.fml.client.TextureFXManager;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.modloader.ModLoaderHelper;
|
||||
|
||||
@@ -38,6 +38,8 @@ import java.util.zip.ZipException;
|
||||
import java.util.zip.ZipFile;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
@@ -529,4 +531,19 @@ public class FMLCommonHandler
|
||||
{
|
||||
tickStart(EnumSet.of(TickType.WORLDLOAD));
|
||||
}
|
||||
|
||||
public void handleServerStarting(MinecraftServer server)
|
||||
{
|
||||
Loader.instance().serverStarting(server);
|
||||
}
|
||||
|
||||
public void handleServerStarted()
|
||||
{
|
||||
Loader.instance().serverStarted();
|
||||
}
|
||||
|
||||
public void handleServerStopping()
|
||||
{
|
||||
Loader.instance().serverStopping();
|
||||
}
|
||||
}
|
||||
@@ -61,16 +61,11 @@ public class LoadController
|
||||
|
||||
eventChannels = eventBus.build();
|
||||
|
||||
state = LoaderState.CONSTRUCTING;
|
||||
state = LoaderState.NOINIT;
|
||||
}
|
||||
|
||||
public void distributeStateMessage(Object... eventData)
|
||||
public void distributeStateMessage(LoaderState state, Object... eventData)
|
||||
{
|
||||
if (state==LoaderState.ERRORED)
|
||||
{
|
||||
throw new LoaderException();
|
||||
}
|
||||
|
||||
if (state.hasEvent())
|
||||
{
|
||||
masterChannel.post(state.getEvent(eventData));
|
||||
|
||||
@@ -31,6 +31,8 @@ import java.util.concurrent.Callable;
|
||||
import java.util.logging.Level;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Joiner;
|
||||
@@ -101,10 +103,6 @@ public class Loader
|
||||
private static String mccversion;
|
||||
private static String mcsversion;
|
||||
|
||||
/**
|
||||
* The {@link LoaderState} of the loader
|
||||
*/
|
||||
private LoaderState state;
|
||||
/**
|
||||
* The class loader we load the mods into.
|
||||
*/
|
||||
@@ -337,20 +335,18 @@ public class Loader
|
||||
public void loadMods()
|
||||
{
|
||||
initializeLoader();
|
||||
state = LoaderState.NOINIT;
|
||||
mods = new ArrayList<ModContainer>();
|
||||
namedMods = new HashMap<String, ModContainer>();
|
||||
state = LoaderState.LOADING;
|
||||
mods = Lists.newArrayList();
|
||||
namedMods = Maps.newHashMap();
|
||||
modController = new LoadController(this);
|
||||
modController.transition(LoaderState.LOADING);
|
||||
identifyMods();
|
||||
disableRequestedMods();
|
||||
sortModList();
|
||||
mods = ImmutableList.copyOf(mods);
|
||||
// Mod controller state : CONSTRUCTION
|
||||
modController.distributeStateMessage(modClassLoader);
|
||||
modController.transition(LoaderState.CONSTRUCTING);
|
||||
modController.distributeStateMessage(LoaderState.CONSTRUCTING, modClassLoader);
|
||||
modController.transition(LoaderState.PREINITIALIZATION);
|
||||
// Mod controller state : PREINITIALIZATION
|
||||
modController.distributeStateMessage();
|
||||
modController.distributeStateMessage(LoaderState.PREINITIALIZATION);
|
||||
modController.transition(LoaderState.INITIALIZATION);
|
||||
}
|
||||
|
||||
@@ -530,11 +526,11 @@ public class Loader
|
||||
public void initializeMods()
|
||||
{
|
||||
// Mod controller should be in the initialization state here
|
||||
modController.distributeStateMessage();
|
||||
modController.distributeStateMessage(LoaderState.INITIALIZATION);
|
||||
modController.transition(LoaderState.POSTINITIALIZATION);
|
||||
modController.distributeStateMessage();
|
||||
modController.transition(LoaderState.LOADCOMPLETE);
|
||||
modController.distributeStateMessage();
|
||||
modController.distributeStateMessage(LoaderState.POSTINITIALIZATION);
|
||||
modController.transition(LoaderState.AVAILABLE);
|
||||
modController.distributeStateMessage(LoaderState.AVAILABLE);
|
||||
FMLLog.info("Forge Mod Loader has successfully loaded %d mod%s", mods.size(), mods.size()==1 ? "" : "s");
|
||||
}
|
||||
|
||||
@@ -563,4 +559,24 @@ public class Loader
|
||||
{
|
||||
return "Minecraft " + mccversion;
|
||||
}
|
||||
|
||||
public void serverStarting(Object server)
|
||||
{
|
||||
modController.distributeStateMessage(LoaderState.SERVER_STARTING, server);
|
||||
modController.transition(LoaderState.SERVER_STARTING);
|
||||
}
|
||||
|
||||
public void serverStarted()
|
||||
{
|
||||
modController.distributeStateMessage(LoaderState.SERVER_STARTED);
|
||||
modController.transition(LoaderState.SERVER_STARTED);
|
||||
}
|
||||
|
||||
public void serverStopping()
|
||||
{
|
||||
modController.distributeStateMessage(LoaderState.SERVER_STOPPING);
|
||||
modController.transition(LoaderState.SERVER_STOPPING);
|
||||
modController.transition(LoaderState.AVAILABLE);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStarted;
|
||||
import cpw.mods.fml.common.event.FMLServerStarting;
|
||||
import cpw.mods.fml.common.event.FMLServerStopping;
|
||||
import cpw.mods.fml.common.event.FMLStateEvent;
|
||||
|
||||
/**
|
||||
@@ -22,9 +25,13 @@ public enum LoaderState
|
||||
PREINITIALIZATION("Pre-initializing mods", FMLPreInitializationEvent.class),
|
||||
INITIALIZATION("Initializing mods", FMLInitializationEvent.class),
|
||||
POSTINITIALIZATION("Post-initializing mods", FMLPostInitializationEvent.class),
|
||||
LOADCOMPLETE("Mod loading complete", FMLLoadCompleteEvent.class),
|
||||
AVAILABLE("Mod loading complete", FMLLoadCompleteEvent.class),
|
||||
SERVER_STARTING("Server starting", FMLServerStarting.class),
|
||||
SERVER_STARTED("Server started", FMLServerStarted.class),
|
||||
SERVER_STOPPING("Server stopping", FMLServerStopping.class),
|
||||
ERRORED("Mod Loading errored",null);
|
||||
|
||||
|
||||
private Class<? extends FMLStateEvent> eventClass;
|
||||
private String name;
|
||||
|
||||
@@ -40,6 +47,11 @@ public enum LoaderState
|
||||
{
|
||||
return ERRORED;
|
||||
}
|
||||
// stopping -> available
|
||||
if (this == SERVER_STOPPING)
|
||||
{
|
||||
return AVAILABLE;
|
||||
}
|
||||
return values()[ordinal() < values().length ? ordinal()+1 : ordinal()];
|
||||
}
|
||||
|
||||
@@ -59,6 +71,11 @@ public enum LoaderState
|
||||
throw Throwables.propagate(e);
|
||||
}
|
||||
}
|
||||
public LoaderState requiredState()
|
||||
{
|
||||
if (this == NOINIT) return NOINIT;
|
||||
return LoaderState.values()[this.ordinal()-1];
|
||||
}
|
||||
public enum ModState
|
||||
{
|
||||
UNLOADED("Unloaded"),
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.logging.Level;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import cpw.mods.fml.common.discovery.ModCandidate;
|
||||
import cpw.mods.fml.relauncher.FMLEmbeddingRelauncher;
|
||||
import cpw.mods.fml.relauncher.FMLRelauncher;
|
||||
import cpw.mods.fml.relauncher.RelaunchClassLoader;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package cpw.mods.fml.common.event;
|
||||
|
||||
import cpw.mods.fml.common.LoaderState;
|
||||
import cpw.mods.fml.common.LoaderState.ModState;
|
||||
|
||||
public class FMLServerStarted extends FMLStateEvent
|
||||
{
|
||||
|
||||
public FMLServerStarted(Object... data)
|
||||
{
|
||||
super(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModState getModState()
|
||||
{
|
||||
return ModState.AVAILABLE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cpw.mods.fml.common.event;
|
||||
|
||||
import cpw.mods.fml.common.LoaderState;
|
||||
import cpw.mods.fml.common.LoaderState.ModState;
|
||||
|
||||
public class FMLServerStarting extends FMLStateEvent
|
||||
{
|
||||
|
||||
private Object server;
|
||||
|
||||
public FMLServerStarting(Object... data)
|
||||
{
|
||||
super(data);
|
||||
this.server = data[0];
|
||||
}
|
||||
@Override
|
||||
public ModState getModState()
|
||||
{
|
||||
return ModState.AVAILABLE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cpw.mods.fml.common.event;
|
||||
|
||||
import cpw.mods.fml.common.LoaderState;
|
||||
import cpw.mods.fml.common.LoaderState.ModState;
|
||||
|
||||
public class FMLServerStopping extends FMLStateEvent
|
||||
{
|
||||
|
||||
public FMLServerStopping(Object... data)
|
||||
{
|
||||
super(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModState getModState()
|
||||
{
|
||||
return ModState.AVAILABLE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package cpw.mods.fml.common.registry;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.src.BiomeGenBase;
|
||||
import net.minecraft.src.Entity;
|
||||
import net.minecraft.src.EntityList;
|
||||
import net.minecraft.src.EntityLiving;
|
||||
import net.minecraft.src.EnumCreatureType;
|
||||
import net.minecraft.src.SpawnListEntry;
|
||||
|
||||
public class EntityRegistry
|
||||
{
|
||||
|
||||
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id)
|
||||
{
|
||||
EntityList.func_75618_a(entityClass, entityName, id);
|
||||
}
|
||||
|
||||
public void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
|
||||
{
|
||||
EntityList.func_75614_a(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
|
||||
}
|
||||
|
||||
public void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
for (BiomeGenBase biome : biomes)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<SpawnListEntry> spawns = biome.func_76747_a(typeOfCreature);
|
||||
|
||||
for (SpawnListEntry entry : spawns)
|
||||
{
|
||||
//Adjusting an existing spawn entry
|
||||
if (entry.field_76300_b == entityClass)
|
||||
{
|
||||
entry.field_76292_a = weightedProb;
|
||||
entry.field_76301_c = min;
|
||||
entry.field_76299_d = max;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
|
||||
}
|
||||
}
|
||||
|
||||
public void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = (Class<? extends Entity>) EntityList.field_75625_b.get(entityName);
|
||||
|
||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||
{
|
||||
addSpawn((Class <? extends EntityLiving >) entityClazz, weightedProb, min, max, spawnList, biomes);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
for (BiomeGenBase biome : biomes)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
Iterator<SpawnListEntry> spawns = biome.func_76747_a(typeOfCreature).iterator();
|
||||
|
||||
while (spawns.hasNext())
|
||||
{
|
||||
SpawnListEntry entry = spawns.next();
|
||||
if (entry.field_76300_b == entityClass)
|
||||
{
|
||||
spawns.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = (Class<? extends Entity>) EntityList.field_75625_b.get(entityName);
|
||||
|
||||
if (EntityLiving.class.isAssignableFrom(entityClazz))
|
||||
{
|
||||
removeSpawn((Class <? extends EntityLiving >) entityClazz, spawnList, biomes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,26 +36,6 @@ public class FMLRegistry
|
||||
|
||||
instance = registry;
|
||||
}
|
||||
public static void registerBlock(Block block)
|
||||
{
|
||||
GameRegistry.registerBlock((BlockProxy)block);
|
||||
instance.registerBlock(block);
|
||||
}
|
||||
|
||||
public static void registerBlock(Block block, Class <? extends ItemBlock > itemclass)
|
||||
{
|
||||
instance.registerBlock(block, itemclass);
|
||||
}
|
||||
|
||||
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id)
|
||||
{
|
||||
instance.registerEntityID(entityClass, entityName, id);
|
||||
}
|
||||
|
||||
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
|
||||
{
|
||||
instance.registerEntityID(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
|
||||
}
|
||||
|
||||
public static void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id)
|
||||
{
|
||||
|
||||
@@ -3,30 +3,37 @@ package cpw.mods.fml.common.registry;
|
||||
import java.util.HashSet;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraft.src.BiomeGenBase;
|
||||
import net.minecraft.src.CraftingManager;
|
||||
import net.minecraft.src.FurnaceRecipes;
|
||||
import net.minecraft.src.IRecipe;
|
||||
import net.minecraft.src.ItemBlock;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.TileEntity;
|
||||
import net.minecraft.src.WorldType;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import cpw.mods.fml.common.LoaderException;
|
||||
import cpw.mods.fml.common.Mod.Block;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
|
||||
public class GameRegistry
|
||||
{
|
||||
private static Multimap<ModContainer,BlockProxy> blockRegistry = ArrayListMultimap.create();
|
||||
private static Multimap<ModContainer,ItemProxy> itemRegistry = ArrayListMultimap.create();
|
||||
private static Multimap<ModContainer, BlockProxy> blockRegistry = ArrayListMultimap.create();
|
||||
private static Multimap<ModContainer, ItemProxy> itemRegistry = ArrayListMultimap.create();
|
||||
private static Set<IWorldGenerator> worldGenerators = new HashSet<IWorldGenerator>();
|
||||
|
||||
public static void registerWorldGenerator(IWorldGenerator generator)
|
||||
{
|
||||
worldGenerators.add(generator);
|
||||
}
|
||||
|
||||
|
||||
public static void generateWorld(int chunkX, int chunkZ, long worldSeed, Object... data)
|
||||
{
|
||||
Random fmlRandom = new Random(worldSeed);
|
||||
@@ -43,29 +50,50 @@ public class GameRegistry
|
||||
|
||||
public static Object buildBlock(ModContainer container, Class<?> type, Block annotation) throws Exception
|
||||
{
|
||||
Object o = type.getConstructor(int.class).newInstance(250);
|
||||
registerBlock((BlockProxy)o);
|
||||
Object o = type.getConstructor(int.class).newInstance(findSpareBlockId());
|
||||
registerBlock((net.minecraft.src.Block) o);
|
||||
return o;
|
||||
}
|
||||
|
||||
public static void registerBlock(BlockProxy block)
|
||||
private static int findSpareBlockId()
|
||||
{
|
||||
|
||||
return 250;
|
||||
}
|
||||
|
||||
public static void registerBlock(net.minecraft.src.Block block)
|
||||
{
|
||||
registerBlock(block, ItemBlock.class);
|
||||
}
|
||||
|
||||
public static void registerBlock(net.minecraft.src.Block block, Class<? extends ItemBlock> itemclass)
|
||||
{
|
||||
try
|
||||
{
|
||||
assert block != null : "registerBlock: block cannot be null";
|
||||
assert itemclass != null : "registerBlock: itemclass cannot be null";
|
||||
int blockItemId = block.field_71990_ca - 256;
|
||||
itemclass.getConstructor(int.class).newInstance(blockItemId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FMLLog.log(Level.SEVERE, e, "Caught an exception during block registration");
|
||||
throw new LoaderException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addRecipe(ItemStack output, Object... params)
|
||||
{
|
||||
CraftingManager.func_77594_a().addRecipe(output, params);
|
||||
CraftingManager.func_77594_a().func_77595_a(output, params);
|
||||
}
|
||||
|
||||
public static void addShapelessRecipe(ItemStack output, Object... params)
|
||||
{
|
||||
FMLRegistry.instance.addShapelessRecipe(output, params);
|
||||
CraftingManager.func_77594_a().func_77596_b(output, params);
|
||||
}
|
||||
|
||||
public static void addRecipe(IRecipe recipe)
|
||||
{
|
||||
FMLRegistry.instance.addRecipe(recipe);
|
||||
CraftingManager.func_77594_a().func_77592_b().add(recipe);
|
||||
}
|
||||
|
||||
public static void addSmelting(int input, ItemStack output, float xp)
|
||||
@@ -73,4 +101,18 @@ public class GameRegistry
|
||||
FurnaceRecipes.func_77602_a().func_77600_a(input, output, xp);
|
||||
}
|
||||
|
||||
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id)
|
||||
{
|
||||
TileEntity.func_70306_a(tileEntityClass, id);
|
||||
}
|
||||
|
||||
public static void addBiome(BiomeGenBase biome)
|
||||
{
|
||||
WorldType.field_77137_b.addNewBiome(biome);
|
||||
}
|
||||
|
||||
public static void removeBiome(BiomeGenBase biome)
|
||||
{
|
||||
WorldType.field_77137_b.removeBiome(biome);
|
||||
}
|
||||
}
|
||||
+78
-40
@@ -21,36 +21,44 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.ProgressMonitorInputStream;
|
||||
|
||||
public class FMLEmbeddingRelauncher
|
||||
public class FMLRelauncher
|
||||
{
|
||||
private static FMLEmbeddingRelauncher INSTANCE;
|
||||
private RelaunchClassLoader clientLoader;
|
||||
private static FMLRelauncher INSTANCE;
|
||||
private RelaunchClassLoader classLoader;
|
||||
private Object newApplet;
|
||||
private Class<? super Object> appletClass;
|
||||
|
||||
private JDialog popupWindow;
|
||||
|
||||
public static void relaunch(ArgsWrapper wrap)
|
||||
public static void handleClientRelaunch(ArgsWrapper wrap)
|
||||
{
|
||||
instance().relaunchClient(wrap);
|
||||
}
|
||||
|
||||
static FMLEmbeddingRelauncher instance()
|
||||
public static void handleServerRelaunch(ArgsWrapper wrap)
|
||||
{
|
||||
instance().relaunchServer(wrap);
|
||||
}
|
||||
|
||||
static FMLRelauncher instance()
|
||||
{
|
||||
if (INSTANCE == null)
|
||||
{
|
||||
INSTANCE = new FMLEmbeddingRelauncher();
|
||||
INSTANCE = new FMLRelauncher();
|
||||
}
|
||||
return INSTANCE;
|
||||
|
||||
}
|
||||
|
||||
private FMLEmbeddingRelauncher()
|
||||
private FMLRelauncher()
|
||||
{
|
||||
URLClassLoader ucl = (URLClassLoader)getClass().getClassLoader();
|
||||
|
||||
clientLoader = new RelaunchClassLoader(ucl.getURLs());
|
||||
classLoader = new RelaunchClassLoader(ucl.getURLs());
|
||||
|
||||
}
|
||||
private void showWindow()
|
||||
{
|
||||
try
|
||||
{
|
||||
popupWindow = new JDialog(null, "FML Initial Setup", ModalityType.MODELESS);
|
||||
@@ -68,13 +76,15 @@ public class FMLEmbeddingRelauncher
|
||||
|
||||
private void relaunchClient(ArgsWrapper wrap)
|
||||
{
|
||||
showWindow();
|
||||
// Now we re-inject the home into the "new" minecraft under our control
|
||||
Class<? super Object> client;
|
||||
try
|
||||
{
|
||||
File minecraftHome = setupHome();
|
||||
File minecraftHome = computeExistingClientHome();
|
||||
setupHome(minecraftHome);
|
||||
|
||||
client = ReflectionHelper.getClass(clientLoader, "net.minecraft.client.Minecraft");
|
||||
client = ReflectionHelper.getClass(classLoader, "net.minecraft.client.Minecraft");
|
||||
ReflectionHelper.setPrivateValue(client, null, minecraftHome, "field_71463_am", "am", "minecraftDir");
|
||||
}
|
||||
finally
|
||||
@@ -97,7 +107,60 @@ public class FMLEmbeddingRelauncher
|
||||
}
|
||||
}
|
||||
|
||||
private File setupHome()
|
||||
private void relaunchServer(ArgsWrapper wrap)
|
||||
{
|
||||
// Now we re-inject the home into the "new" minecraft under our control
|
||||
Class<? super Object> server;
|
||||
File minecraftHome = new File(".");
|
||||
setupHome(minecraftHome);
|
||||
|
||||
server = ReflectionHelper.getClass(classLoader, "net.minecraft.server.MinecraftServer");
|
||||
try
|
||||
{
|
||||
ReflectionHelper.findMethod(server, null, new String[] { "fmlReentry" }, ArgsWrapper.class).invoke(null, wrap);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
// Hmmm
|
||||
}
|
||||
}
|
||||
|
||||
private void setupHome(File minecraftHome)
|
||||
{
|
||||
FMLVersionData.build(minecraftHome, classLoader);
|
||||
FMLLog.info("Forge Mod Loader version %s.%s.%s.%s for Minecraft client:%s, server:%s loading", FMLVersionData.major, FMLVersionData.minor, FMLVersionData.rev, FMLVersionData.build, FMLVersionData.mccversion, FMLVersionData.mcsversion);
|
||||
|
||||
try
|
||||
{
|
||||
RelaunchLibraryManager.handleLaunch(minecraftHome, classLoader);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
if (popupWindow != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
String logFile = new File(minecraftHome,"ForgeModLoader-0.log").getCanonicalPath();
|
||||
JOptionPane.showMessageDialog(popupWindow,
|
||||
String.format("<html><div align=\"center\"><font size=\"+1\">There was a fatal error starting up minecraft and FML</font></div><br/>" +
|
||||
"Minecraft cannot launch in it's current configuration<br/>" +
|
||||
"Please consult the file <i><a href=\"file:///%s\">%s</a></i> for further information</html>", logFile, logFile
|
||||
), "Fatal FML error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// ah well, we tried
|
||||
}
|
||||
}
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
private File computeExistingClientHome()
|
||||
{
|
||||
Class<? super Object> mcMaster = ReflectionHelper.getClass(getClass().getClassLoader(), "net.minecraft.client.Minecraft");
|
||||
// We force minecraft to setup it's homedir very early on so we can inject stuff into it
|
||||
@@ -111,31 +174,6 @@ public class FMLEmbeddingRelauncher
|
||||
// Hmmm
|
||||
}
|
||||
File minecraftHome = ReflectionHelper.getPrivateValue(mcMaster, null, "field_71463_am", "am", "minecraftDir");
|
||||
FMLVersionData.build(minecraftHome, clientLoader);
|
||||
FMLLog.info("Forge Mod Loader version %s.%s.%s.%s for Minecraft client:%s, server:%s loading", FMLVersionData.major, FMLVersionData.minor, FMLVersionData.rev, FMLVersionData.build, FMLVersionData.mccversion, FMLVersionData.mcsversion);
|
||||
|
||||
try
|
||||
{
|
||||
RelaunchLibraryManager.handleLaunch(minecraftHome, clientLoader);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
try
|
||||
{
|
||||
String logFile = new File(minecraftHome,"ForgeModLoader-0.log").getCanonicalPath();
|
||||
JOptionPane.showMessageDialog(popupWindow,
|
||||
String.format("<html><div align=\"center\"><font size=\"+1\">There was a fatal error starting up minecraft and FML</font></div><br/>" +
|
||||
"Minecraft cannot launch in it's current configuration<br/>" +
|
||||
"Please consult the file <i><a href=\"file:///%s\">%s</a></i> for further information</html>", logFile, logFile
|
||||
), "Fatal FML error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// ah well, we tried
|
||||
}
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
|
||||
return minecraftHome;
|
||||
}
|
||||
|
||||
@@ -146,8 +184,8 @@ public class FMLEmbeddingRelauncher
|
||||
|
||||
private void relaunchApplet(Applet minecraftApplet)
|
||||
{
|
||||
appletClass = ReflectionHelper.getClass(clientLoader, "net.minecraft.client.MinecraftApplet");
|
||||
if (minecraftApplet.getClass().getClassLoader() == clientLoader)
|
||||
appletClass = ReflectionHelper.getClass(classLoader, "net.minecraft.client.MinecraftApplet");
|
||||
if (minecraftApplet.getClass().getClassLoader() == classLoader)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -161,7 +199,7 @@ public class FMLEmbeddingRelauncher
|
||||
}
|
||||
}
|
||||
|
||||
setupHome();
|
||||
setupHome(computeExistingClientHome());
|
||||
|
||||
Class<? super Object> parentAppletClass = ReflectionHelper.getClass(getClass().getClassLoader(), "java.applet.Applet");
|
||||
|
||||
@@ -203,7 +241,7 @@ public class FMLEmbeddingRelauncher
|
||||
|
||||
private void startApplet(Applet applet)
|
||||
{
|
||||
if (applet.getClass().getClassLoader() == clientLoader)
|
||||
if (applet.getClass().getClassLoader() == classLoader)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -382,7 +382,7 @@ public class RelaunchLibraryManager
|
||||
String infoString = String.format("Downloading file %s", libDownload.toString());
|
||||
FMLLog.info(infoString);
|
||||
InputStream urlStream = libDownload.openStream();
|
||||
urlStream = FMLEmbeddingRelauncher.instance().wrapStream(urlStream, infoString);
|
||||
urlStream = FMLRelauncher.instance().wrapStream(urlStream, infoString);
|
||||
ReadableByteChannel urlChannel = Channels.newChannel(urlStream);
|
||||
FileOutputStream libFileStream = new FileOutputStream(libFile);
|
||||
FileChannel libFileChannel = libFileStream.getChannel();
|
||||
|
||||
@@ -168,3 +168,8 @@ public axr.m
|
||||
# CraftingManager - make the add recipe methods public
|
||||
public tc.a(Lri;[Ljava/lang/Object;)V
|
||||
public tc.b(Lri;[Ljava/lang/Object;)V
|
||||
# WeightedRandomItem - make the "probability" public
|
||||
public ir.a
|
||||
# ItemStack - make itemId final
|
||||
#public+f ri.c
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="common"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="src-common"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="transformers"/>
|
||||
<classpathentry kind="src" path="client"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
@@ -23,7 +23,7 @@
|
||||
</classpathentry>
|
||||
<classpathentry exported="true" kind="lib" path="jars/bin/minecraft.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/argo-2.25.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/asm-all-4.0.jar" sourcepath="lib/asm-4.0"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/guava-12.0.jar" sourcepath="lib/guava-12.0-sources.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/asm-all-4.0.jar" sourcepath="libref/asm-4.0"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/guava-12.0.jar" sourcepath="libref/guava-12.0-sources.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -40,6 +40,11 @@
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/lib</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>libref</name>
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/libref</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src</name>
|
||||
<type>2</type>
|
||||
|
||||
@@ -6,3 +6,6 @@ java.io.FileInputStream fis = new java.io.FileInputStream(new java.io.File("/hom
|
||||
|
||||
System.out.println(new cpw.mods.fml.common.asm.ASMModParser(fis));
|
||||
|
||||
|
||||
|
||||
org.objectweb.asm.Type.getDescriptor(net.minecraft.src.CraftingManager.class.getDeclaredMethods()[1])
|
||||
@@ -1,10 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="src-common"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="common"/>
|
||||
<classpathentry kind="src" path="server"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="lib" path="jars/minecraft_server.jar"/>
|
||||
<classpathentry kind="lib" path="lib/argo-2.25.jar"/>
|
||||
<classpathentry kind="lib" path="lib/asm-all-4.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/guava-12.0.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -30,6 +30,11 @@
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/jars</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>lib</name>
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/lib</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>server</name>
|
||||
<type>2</type>
|
||||
|
||||
+1
-1
@@ -336,7 +336,7 @@ def fix_patch(in_file, out_file, find=None, rep=None):
|
||||
for line in inpatch:
|
||||
line = line.rstrip('\r\n')
|
||||
if line[:3] in ['+++', '---', 'Onl', 'dif']:
|
||||
if not find == None and not replace == None:
|
||||
if not find == None and not rep == None:
|
||||
line = line.replace('\\', '/').replace(find, rep).replace('/', os.sep)
|
||||
else:
|
||||
line = line.replace('\\', '/').replace('/', os.sep)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/common/net/minecraft/src/EntitySlime.java
|
||||
+++ ../src-work/common/net/minecraft/src/EntitySlime.java
|
||||
@@ -223,7 +223,7 @@
|
||||
public boolean func_70601_bi()
|
||||
{
|
||||
Chunk var1 = this.field_70170_p.func_72938_d(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70161_v));
|
||||
- return this.field_70170_p.func_72912_H().func_76067_t() == WorldType.field_77138_c && this.field_70146_Z.nextInt(4) != 1 ? false : ((this.func_70809_q() == 1 || this.field_70170_p.field_73013_u > 0) && this.field_70146_Z.nextInt(10) == 0 && var1.func_76617_a(987234911L).nextInt(10) == 0 && this.field_70163_u < 40.0D ? super.func_70601_bi() : false);
|
||||
+ return this.field_70170_p.func_72912_H().func_76067_t().handleSlimeSpawnReduction(field_70146_Z, field_70170_p) ? false : ((this.func_70809_q() == 1 || this.field_70170_p.field_73013_u > 0) && this.field_70146_Z.nextInt(10) == 0 && var1.func_76617_a(987234911L).nextInt(10) == 0 && this.field_70163_u < 40.0D ? super.func_70601_bi() : false);
|
||||
}
|
||||
|
||||
protected float func_70599_aP()
|
||||
@@ -0,0 +1,17 @@
|
||||
--- ../src-base/common/net/minecraft/src/GenLayerBiome.java
|
||||
+++ ../src-work/common/net/minecraft/src/GenLayerBiome.java
|
||||
@@ -7,13 +7,8 @@
|
||||
public GenLayerBiome(long p_i3888_1_, GenLayer p_i3888_3_, WorldType p_i3888_4_)
|
||||
{
|
||||
super(p_i3888_1_);
|
||||
- this.field_75914_b = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g, BiomeGenBase.field_76782_w};
|
||||
+ this.field_75914_b = p_i3888_4_.getBiomesForWorldType();
|
||||
this.field_75909_a = p_i3888_3_;
|
||||
-
|
||||
- if (p_i3888_4_ == WorldType.field_77136_e)
|
||||
- {
|
||||
- this.field_75914_b = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g};
|
||||
- }
|
||||
}
|
||||
|
||||
public int[] func_75904_a(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_)
|
||||
@@ -1,17 +1,129 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -126,6 +126,10 @@
|
||||
@@ -13,107 +13,11 @@
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
+
|
||||
import javax.swing.JPanel;
|
||||
-import net.minecraft.src.AchievementList;
|
||||
-import net.minecraft.src.AnvilSaveConverter;
|
||||
-import net.minecraft.src.AxisAlignedBB;
|
||||
-import net.minecraft.src.Block;
|
||||
-import net.minecraft.src.CallableClientProfiler;
|
||||
-import net.minecraft.src.CallableGLInfo;
|
||||
-import net.minecraft.src.CallableLWJGLVersion;
|
||||
-import net.minecraft.src.CallableModded;
|
||||
-import net.minecraft.src.CallableTexturePack;
|
||||
-import net.minecraft.src.CallableType2;
|
||||
-import net.minecraft.src.ColorizerFoliage;
|
||||
-import net.minecraft.src.ColorizerGrass;
|
||||
-import net.minecraft.src.ColorizerWater;
|
||||
-import net.minecraft.src.CrashReport;
|
||||
-import net.minecraft.src.EffectRenderer;
|
||||
-import net.minecraft.src.EntityBoat;
|
||||
-import net.minecraft.src.EntityClientPlayerMP;
|
||||
-import net.minecraft.src.EntityList;
|
||||
-import net.minecraft.src.EntityLiving;
|
||||
-import net.minecraft.src.EntityMinecart;
|
||||
-import net.minecraft.src.EntityPainting;
|
||||
-import net.minecraft.src.EntityRenderer;
|
||||
-import net.minecraft.src.EnumMovingObjectType;
|
||||
-import net.minecraft.src.EnumOS;
|
||||
-import net.minecraft.src.EnumOSHelper;
|
||||
-import net.minecraft.src.EnumOptions;
|
||||
-import net.minecraft.src.FontRenderer;
|
||||
-import net.minecraft.src.GLAllocation;
|
||||
-import net.minecraft.src.GameSettings;
|
||||
-import net.minecraft.src.GameWindowListener;
|
||||
-import net.minecraft.src.GuiAchievement;
|
||||
-import net.minecraft.src.GuiChat;
|
||||
-import net.minecraft.src.GuiConnecting;
|
||||
-import net.minecraft.src.GuiErrorScreen;
|
||||
-import net.minecraft.src.GuiGameOver;
|
||||
-import net.minecraft.src.GuiIngame;
|
||||
-import net.minecraft.src.GuiIngameMenu;
|
||||
-import net.minecraft.src.GuiInventory;
|
||||
-import net.minecraft.src.GuiMainMenu;
|
||||
-import net.minecraft.src.GuiMemoryErrorScreen;
|
||||
-import net.minecraft.src.GuiScreen;
|
||||
-import net.minecraft.src.GuiSleepMP;
|
||||
-import net.minecraft.src.IPlayerUsage;
|
||||
-import net.minecraft.src.ISaveFormat;
|
||||
-import net.minecraft.src.ISaveHandler;
|
||||
-import net.minecraft.src.IntegratedServer;
|
||||
-import net.minecraft.src.Item;
|
||||
-import net.minecraft.src.ItemRenderer;
|
||||
-import net.minecraft.src.ItemStack;
|
||||
-import net.minecraft.src.KeyBinding;
|
||||
-import net.minecraft.src.LoadingScreenRenderer;
|
||||
-import net.minecraft.src.MathHelper;
|
||||
-import net.minecraft.src.MemoryConnection;
|
||||
-import net.minecraft.src.MinecraftError;
|
||||
-import net.minecraft.src.MinecraftFakeLauncher;
|
||||
-import net.minecraft.src.MouseHelper;
|
||||
-import net.minecraft.src.MovementInputFromOptions;
|
||||
-import net.minecraft.src.MovingObjectPosition;
|
||||
-import net.minecraft.src.NetClientHandler;
|
||||
-import net.minecraft.src.NetworkManager;
|
||||
-import net.minecraft.src.OpenGlHelper;
|
||||
-import net.minecraft.src.Packet3Chat;
|
||||
-import net.minecraft.src.PlayerControllerMP;
|
||||
-import net.minecraft.src.PlayerUsageSnooper;
|
||||
-import net.minecraft.src.Profiler;
|
||||
-import net.minecraft.src.ProfilerResult;
|
||||
-import net.minecraft.src.RenderBlocks;
|
||||
-import net.minecraft.src.RenderEngine;
|
||||
-import net.minecraft.src.RenderGlobal;
|
||||
-import net.minecraft.src.RenderManager;
|
||||
-import net.minecraft.src.ReportedException;
|
||||
-import net.minecraft.src.ScaledResolution;
|
||||
-import net.minecraft.src.ScreenShotHelper;
|
||||
-import net.minecraft.src.ServerData;
|
||||
-import net.minecraft.src.Session;
|
||||
-import net.minecraft.src.SoundManager;
|
||||
-import net.minecraft.src.StatCollector;
|
||||
-import net.minecraft.src.StatFileWriter;
|
||||
-import net.minecraft.src.StatList;
|
||||
-import net.minecraft.src.StatStringFormatKeyInv;
|
||||
-import net.minecraft.src.StringTranslate;
|
||||
-import net.minecraft.src.Tessellator;
|
||||
-import net.minecraft.src.TextureCompassFX;
|
||||
-import net.minecraft.src.TextureFlamesFX;
|
||||
-import net.minecraft.src.TextureLavaFX;
|
||||
-import net.minecraft.src.TextureLavaFlowFX;
|
||||
-import net.minecraft.src.TexturePackList;
|
||||
-import net.minecraft.src.TexturePortalFX;
|
||||
-import net.minecraft.src.TextureWatchFX;
|
||||
-import net.minecraft.src.TextureWaterFX;
|
||||
-import net.minecraft.src.TextureWaterFlowFX;
|
||||
-import net.minecraft.src.ThreadClientSleep;
|
||||
-import net.minecraft.src.ThreadDownloadResources;
|
||||
-import net.minecraft.src.ThreadShutdown;
|
||||
-import net.minecraft.src.Timer;
|
||||
-import net.minecraft.src.Vec3;
|
||||
-import net.minecraft.src.WorldClient;
|
||||
-import net.minecraft.src.WorldInfo;
|
||||
-import net.minecraft.src.WorldRenderer;
|
||||
-import net.minecraft.src.WorldSettings;
|
||||
+
|
||||
+import net.minecraft.src.*;
|
||||
+
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
@@ -125,6 +29,10 @@
|
||||
import org.lwjgl.opengl.GLContext;
|
||||
import org.lwjgl.opengl.PixelFormat;
|
||||
import org.lwjgl.util.glu.GLU;
|
||||
|
||||
+
|
||||
+import cpw.mods.fml.client.FMLClientHandler;
|
||||
+import cpw.mods.fml.relauncher.ArgsWrapper;
|
||||
+import cpw.mods.fml.relauncher.FMLEmbeddingRelauncher;
|
||||
+
|
||||
+import cpw.mods.fml.relauncher.FMLRelauncher;
|
||||
|
||||
public abstract class Minecraft implements Runnable, IPlayerUsage
|
||||
{
|
||||
public static byte[] field_71444_a = new byte[10485760];
|
||||
@@ -305,7 +309,7 @@
|
||||
@@ -305,7 +213,7 @@
|
||||
this.func_71357_I();
|
||||
this.field_71466_p = new FontRenderer(this.field_71474_y, "/font/default.png", this.field_71446_o, false);
|
||||
this.field_71464_q = new FontRenderer(this.field_71474_y, "/font/alternate.png", this.field_71446_o, false);
|
||||
@@ -20,11 +132,20 @@
|
||||
if (this.field_71474_y.field_74363_ab != null)
|
||||
{
|
||||
StringTranslate.func_74808_a().func_74810_a(this.field_71474_y.field_74363_ab);
|
||||
@@ -1883,6 +1887,12 @@
|
||||
@@ -350,6 +258,8 @@
|
||||
GL11.glViewport(0, 0, this.field_71443_c, this.field_71440_d);
|
||||
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
|
||||
|
||||
+ FMLClientHandler.instance().finishMinecraftLoading();
|
||||
+
|
||||
try
|
||||
{
|
||||
this.field_71430_V = new ThreadDownloadResources(this.field_71412_D, this);
|
||||
@@ -1883,6 +1793,12 @@
|
||||
|
||||
public static void main(String[] p_main_0_)
|
||||
{
|
||||
+ FMLEmbeddingRelauncher.relaunch(new ArgsWrapper(p_main_0_));
|
||||
+ FMLRelauncher.handleClientRelaunch(new ArgsWrapper(p_main_0_));
|
||||
+ }
|
||||
+
|
||||
+ public static void fmlReentry(ArgsWrapper wrapper)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Canvas;
|
||||
+
|
||||
+import cpw.mods.fml.relauncher.FMLEmbeddingRelauncher;
|
||||
+import cpw.mods.fml.relauncher.FMLRelauncher;
|
||||
import net.minecraft.src.CanvasMinecraftApplet;
|
||||
import net.minecraft.src.MinecraftAppletImpl;
|
||||
import net.minecraft.src.Session;
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
public void init()
|
||||
+ {
|
||||
+ FMLEmbeddingRelauncher.appletEntry(this);
|
||||
+ FMLRelauncher.appletEntry(this);
|
||||
+ }
|
||||
+
|
||||
+ public void fmlInitReentry()
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
public void start()
|
||||
{
|
||||
+ FMLEmbeddingRelauncher.appletStart(this);
|
||||
+ FMLRelauncher.appletStart(this);
|
||||
+ }
|
||||
+
|
||||
+ public void fmlStartReentry()
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java
|
||||
@@ -11,6 +11,8 @@
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
+
|
||||
+import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.src.AnvilSaveConverter;
|
||||
import net.minecraft.src.AxisAlignedBB;
|
||||
import net.minecraft.src.CallableIsServerModded;
|
||||
@@ -354,8 +356,10 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
+ FMLCommonHandler.instance().handleServerStarting(this);
|
||||
if (this.func_71197_b())
|
||||
{
|
||||
+ FMLCommonHandler.instance().handleServerStarted();
|
||||
long var1 = System.currentTimeMillis();
|
||||
|
||||
for (long var50 = 0L; this.field_71317_u; this.field_71296_Q = true)
|
||||
@@ -395,6 +399,7 @@
|
||||
|
||||
Thread.sleep(1L);
|
||||
}
|
||||
+ FMLCommonHandler.instance().handleServerStopping();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1,34 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/src/StatFileWriter.java
|
||||
+++ ../src-work/minecraft/net/minecraft/src/StatFileWriter.java
|
||||
@@ -124,17 +124,17 @@
|
||||
{
|
||||
String var2 = "local";
|
||||
StringBuilder var3 = new StringBuilder();
|
||||
- JsonRootNode var4 = (new JdomParser()).func_74789_a(p_77453_0_);
|
||||
- List var5 = var4.func_74612_b(new Object[] {"stats-change"});
|
||||
+ JsonRootNode var4 = (new JdomParser()).parse(p_77453_0_);
|
||||
+ List var5 = var4.getArrayNode(new Object[] {"stats-change"});
|
||||
Iterator var6 = var5.iterator();
|
||||
|
||||
while (var6.hasNext())
|
||||
{
|
||||
JsonNode var7 = (JsonNode)var6.next();
|
||||
- Map var8 = var7.func_74614_d();
|
||||
+ Map var8 = var7.getFields();
|
||||
Entry var9 = (Entry)var8.entrySet().iterator().next();
|
||||
- int var10 = Integer.parseInt(((JsonStringNode)var9.getKey()).func_74615_c());
|
||||
- int var11 = Integer.parseInt(((JsonNode)var9.getValue()).func_74615_c());
|
||||
+ int var10 = Integer.parseInt(((JsonStringNode)var9.getKey()).getText());
|
||||
+ int var11 = Integer.parseInt(((JsonNode)var9.getValue()).getText());
|
||||
StatBase var12 = StatList.func_75923_a(var10);
|
||||
|
||||
if (var12 == null)
|
||||
@@ -152,7 +152,7 @@
|
||||
MD5String var14 = new MD5String(var2);
|
||||
String var15 = var14.func_75899_a(var3.toString());
|
||||
|
||||
- if (!var15.equals(var4.func_74611_a(new Object[] {"checksum"})))
|
||||
+ if (!var15.equals(var4.getStringValue(new Object[] {"checksum"})))
|
||||
{
|
||||
System.out.println("CHECKSUM MISMATCH");
|
||||
return null;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/src/World.java
|
||||
+++ ../src-work/minecraft/net/minecraft/src/World.java
|
||||
@@ -3350,7 +3350,7 @@
|
||||
|
||||
public double func_72919_O()
|
||||
{
|
||||
- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c ? 0.0D : 63.0D;
|
||||
+ return this.field_72986_A.func_76067_t().getHorizon(this);
|
||||
}
|
||||
|
||||
public CrashReport func_72914_a(CrashReport p_72914_1_)
|
||||
@@ -0,0 +1,45 @@
|
||||
--- ../src-base/minecraft/net/minecraft/src/WorldProvider.java
|
||||
+++ ../src-work/minecraft/net/minecraft/src/WorldProvider.java
|
||||
@@ -32,19 +32,12 @@
|
||||
|
||||
protected void func_76572_b()
|
||||
{
|
||||
- if (this.field_76579_a.func_72912_H().func_76067_t() == WorldType.field_77138_c)
|
||||
- {
|
||||
- this.field_76578_c = new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.5F, 0.5F);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.field_76578_c = new WorldChunkManager(this.field_76579_a);
|
||||
- }
|
||||
+ this.field_76578_c = this.field_76577_b.getChunkManager(this.field_76579_a);
|
||||
}
|
||||
|
||||
public IChunkProvider func_76555_c()
|
||||
{
|
||||
- return (IChunkProvider)(this.field_76577_b == WorldType.field_77138_c ? new ChunkProviderFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r()) : new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r()));
|
||||
+ return this.field_76577_b.getChunkGenerator(this.field_76579_a);
|
||||
}
|
||||
|
||||
public boolean func_76566_a(int p_76566_1_, int p_76566_2_)
|
||||
@@ -157,17 +150,17 @@
|
||||
|
||||
public int func_76557_i()
|
||||
{
|
||||
- return this.field_76577_b == WorldType.field_77138_c ? 4 : 64;
|
||||
+ return this.field_76577_b.getMinimumSpawnHeight(this.field_76579_a);
|
||||
}
|
||||
|
||||
public boolean func_76564_j()
|
||||
{
|
||||
- return this.field_76577_b != WorldType.field_77138_c && !this.field_76576_e;
|
||||
+ return this.field_76577_b.hasVoidParticles(this.field_76576_e);
|
||||
}
|
||||
|
||||
public double func_76565_k()
|
||||
{
|
||||
- return this.field_76577_b == WorldType.field_77138_c ? 1.0D : 0.03125D;
|
||||
+ return this.field_76577_b.voidFadeMagnitude();
|
||||
}
|
||||
|
||||
public boolean func_76568_b(int p_76568_1_, int p_76568_2_)
|
||||
@@ -0,0 +1,108 @@
|
||||
--- ../src-base/minecraft/net/minecraft/src/WorldType.java
|
||||
+++ ../src-work/minecraft/net/minecraft/src/WorldType.java
|
||||
@@ -1,4 +1,14 @@
|
||||
package net.minecraft.src;
|
||||
+
|
||||
+import java.util.Arrays;
|
||||
+import java.util.List;
|
||||
+import java.util.Random;
|
||||
+import java.util.Set;
|
||||
+
|
||||
+import com.google.common.base.Objects;
|
||||
+import com.google.common.collect.Lists;
|
||||
+import com.google.common.collect.ObjectArrays;
|
||||
+import com.google.common.collect.Sets;
|
||||
|
||||
public class WorldType
|
||||
{
|
||||
@@ -12,6 +22,11 @@
|
||||
private boolean field_77140_h;
|
||||
private boolean field_77141_i;
|
||||
|
||||
+ protected BiomeGenBase[] biomesForWorldType;
|
||||
+
|
||||
+ BiomeGenBase[] base12Biomes = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g, BiomeGenBase.field_76782_w};
|
||||
+ BiomeGenBase[] base11Biomes = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g};
|
||||
+
|
||||
private WorldType(int p_i3737_1_, String p_i3737_2_)
|
||||
{
|
||||
this(p_i3737_1_, p_i3737_2_, 0);
|
||||
@@ -23,6 +38,14 @@
|
||||
this.field_77134_g = p_i3738_3_;
|
||||
this.field_77140_h = true;
|
||||
field_77139_a[p_i3738_1_] = this;
|
||||
+ switch (p_i3738_1_)
|
||||
+ {
|
||||
+ case 8:
|
||||
+ biomesForWorldType = base11Biomes;
|
||||
+ break;
|
||||
+ default:
|
||||
+ biomesForWorldType = base12Biomes;
|
||||
+ }
|
||||
}
|
||||
|
||||
public String func_77127_a()
|
||||
@@ -84,4 +107,63 @@
|
||||
|
||||
return null;
|
||||
}
|
||||
+
|
||||
+ public WorldChunkManager getChunkManager(World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.5F, 0.5F) : new WorldChunkManager(world);
|
||||
+ }
|
||||
+
|
||||
+ public IChunkProvider getChunkGenerator(World world)
|
||||
+ {
|
||||
+ return (this == field_77138_c ? new ChunkProviderFlat(world, world.func_72905_C(), world.func_72912_H().func_76089_r()) : new ChunkProviderGenerate(world, world.func_72905_C(), world.func_72912_H().func_76089_r()));
|
||||
+ }
|
||||
+
|
||||
+ public int getMinimumSpawnHeight(World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? 4 : 64;
|
||||
+ }
|
||||
+
|
||||
+ public double getHorizon(World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? 0.0D : 63.0D;
|
||||
+ }
|
||||
+
|
||||
+ public boolean hasVoidParticles(boolean var1)
|
||||
+ {
|
||||
+ return this != field_77138_c && !var1;
|
||||
+ }
|
||||
+
|
||||
+ public double voidFadeMagnitude()
|
||||
+ {
|
||||
+ return this == field_77138_c ? 1.0D : 0.03125D;
|
||||
+ }
|
||||
+
|
||||
+ public BiomeGenBase[] getBiomesForWorldType() {
|
||||
+ return biomesForWorldType;
|
||||
+ }
|
||||
+
|
||||
+ public void addNewBiome(BiomeGenBase biome)
|
||||
+ {
|
||||
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newIdentityHashSet();
|
||||
+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType));
|
||||
+ newBiomesForWorld.add(biome);
|
||||
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
||||
+ }
|
||||
+
|
||||
+ public void removeBiome(BiomeGenBase biome)
|
||||
+ {
|
||||
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newIdentityHashSet();
|
||||
+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType));
|
||||
+ newBiomesForWorld.remove(biome);
|
||||
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
||||
+ }
|
||||
+
|
||||
+ public boolean handleSlimeSpawnReduction(Random random, World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? random.nextInt(4) != 1 : false;
|
||||
+ }
|
||||
+ /**
|
||||
+ * Called when 'Create New World' button is pressed before starting game
|
||||
+ */
|
||||
+ public void onGUICreateWorldPress() { }
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
--- ../src-base/minecraft_server/net/minecraft/server/MinecraftServer.java
|
||||
+++ ../src-work/minecraft_server/net/minecraft/server/MinecraftServer.java
|
||||
@@ -11,6 +11,11 @@
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
+
|
||||
+import cpw.mods.fml.common.FMLCommonHandler;
|
||||
+import cpw.mods.fml.relauncher.ArgsWrapper;
|
||||
+import cpw.mods.fml.relauncher.FMLRelauncher;
|
||||
+import cpw.mods.fml.server.FMLServerHandler;
|
||||
import net.minecraft.src.AnvilSaveConverter;
|
||||
import net.minecraft.src.AxisAlignedBB;
|
||||
import net.minecraft.src.CallableIsServerModded;
|
||||
@@ -351,8 +356,12 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
+ FMLServerHandler.instance().beginServerLoading(this);
|
||||
+ FMLServerHandler.instance().finishServerLoading();
|
||||
+ FMLCommonHandler.instance().handleServerStarting(this);
|
||||
if (this.func_71197_b())
|
||||
{
|
||||
+ FMLCommonHandler.instance().handleServerStarted();
|
||||
long var1 = System.currentTimeMillis();
|
||||
|
||||
for (long var50 = 0L; this.field_71317_u; this.field_71296_Q = true)
|
||||
@@ -392,6 +401,7 @@
|
||||
|
||||
Thread.sleep(1L);
|
||||
}
|
||||
+ FMLCommonHandler.instance().handleServerStopping();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -580,6 +590,11 @@
|
||||
|
||||
public static void main(String[] p_main_0_)
|
||||
{
|
||||
+ FMLRelauncher.handleServerRelaunch(new ArgsWrapper(p_main_0_));
|
||||
+ }
|
||||
+ public static void fmlReentry(ArgsWrapper wrap)
|
||||
+ {
|
||||
+ String[] p_main_0_ = wrap.args;
|
||||
StatList.func_75919_a();
|
||||
|
||||
try
|
||||
@@ -0,0 +1,32 @@
|
||||
--- ../src-base/minecraft_server/net/minecraft/src/WorldProvider.java
|
||||
+++ ../src-work/minecraft_server/net/minecraft/src/WorldProvider.java
|
||||
@@ -32,19 +32,12 @@
|
||||
|
||||
protected void func_76572_b()
|
||||
{
|
||||
- if (this.field_76579_a.func_72912_H().func_76067_t() == WorldType.field_77138_c)
|
||||
- {
|
||||
- this.field_76578_c = new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.5F, 0.5F);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.field_76578_c = new WorldChunkManager(this.field_76579_a);
|
||||
- }
|
||||
+ this.field_76578_c = this.field_76577_b.getChunkManager(this.field_76579_a);
|
||||
}
|
||||
|
||||
public IChunkProvider func_76555_c()
|
||||
{
|
||||
- return (IChunkProvider)(this.field_76577_b == WorldType.field_77138_c ? new ChunkProviderFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r()) : new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r()));
|
||||
+ return this.field_76577_b.getChunkGenerator(this.field_76579_a);
|
||||
}
|
||||
|
||||
public boolean func_76566_a(int p_76566_1_, int p_76566_2_)
|
||||
@@ -96,6 +89,6 @@
|
||||
|
||||
public int func_76557_i()
|
||||
{
|
||||
- return this.field_76577_b == WorldType.field_77138_c ? 4 : 64;
|
||||
+ return this.field_76577_b.getMinimumSpawnHeight(this.field_76579_a);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
--- ../src-base/minecraft_server/net/minecraft/src/WorldType.java
|
||||
+++ ../src-work/minecraft_server/net/minecraft/src/WorldType.java
|
||||
@@ -1,4 +1,14 @@
|
||||
package net.minecraft.src;
|
||||
+
|
||||
+import java.util.Arrays;
|
||||
+import java.util.List;
|
||||
+import java.util.Random;
|
||||
+import java.util.Set;
|
||||
+
|
||||
+import com.google.common.base.Objects;
|
||||
+import com.google.common.collect.Lists;
|
||||
+import com.google.common.collect.ObjectArrays;
|
||||
+import com.google.common.collect.Sets;
|
||||
|
||||
public class WorldType
|
||||
{
|
||||
@@ -12,6 +22,11 @@
|
||||
private boolean field_77140_h;
|
||||
private boolean field_77141_i;
|
||||
|
||||
+ protected BiomeGenBase[] biomesForWorldType;
|
||||
+
|
||||
+ BiomeGenBase[] base12Biomes = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g, BiomeGenBase.field_76782_w};
|
||||
+ BiomeGenBase[] base11Biomes = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g};
|
||||
+
|
||||
private WorldType(int p_i3737_1_, String p_i3737_2_)
|
||||
{
|
||||
this(p_i3737_1_, p_i3737_2_, 0);
|
||||
@@ -23,6 +38,14 @@
|
||||
this.field_77134_g = p_i3738_3_;
|
||||
this.field_77140_h = true;
|
||||
field_77139_a[p_i3738_1_] = this;
|
||||
+ switch (p_i3738_1_)
|
||||
+ {
|
||||
+ case 8:
|
||||
+ biomesForWorldType = base11Biomes;
|
||||
+ break;
|
||||
+ default:
|
||||
+ biomesForWorldType = base12Biomes;
|
||||
+ }
|
||||
}
|
||||
|
||||
public String func_77127_a()
|
||||
@@ -74,4 +97,63 @@
|
||||
|
||||
return null;
|
||||
}
|
||||
+
|
||||
+ public WorldChunkManager getChunkManager(World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.5F, 0.5F) : new WorldChunkManager(world);
|
||||
+ }
|
||||
+
|
||||
+ public IChunkProvider getChunkGenerator(World world)
|
||||
+ {
|
||||
+ return (this == field_77138_c ? new ChunkProviderFlat(world, world.func_72905_C(), world.func_72912_H().func_76089_r()) : new ChunkProviderGenerate(world, world.func_72905_C(), world.func_72912_H().func_76089_r()));
|
||||
+ }
|
||||
+
|
||||
+ public int getMinimumSpawnHeight(World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? 4 : 64;
|
||||
+ }
|
||||
+
|
||||
+ public double getHorizon(World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? 0.0D : 63.0D;
|
||||
+ }
|
||||
+
|
||||
+ public boolean hasVoidParticles(boolean var1)
|
||||
+ {
|
||||
+ return this != field_77138_c && !var1;
|
||||
+ }
|
||||
+
|
||||
+ public double voidFadeMagnitude()
|
||||
+ {
|
||||
+ return this == field_77138_c ? 1.0D : 0.03125D;
|
||||
+ }
|
||||
+
|
||||
+ public BiomeGenBase[] getBiomesForWorldType() {
|
||||
+ return biomesForWorldType;
|
||||
+ }
|
||||
+
|
||||
+ public void addNewBiome(BiomeGenBase biome)
|
||||
+ {
|
||||
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newIdentityHashSet();
|
||||
+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType));
|
||||
+ newBiomesForWorld.add(biome);
|
||||
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
||||
+ }
|
||||
+
|
||||
+ public void removeBiome(BiomeGenBase biome)
|
||||
+ {
|
||||
+ Set<BiomeGenBase> newBiomesForWorld = Sets.newIdentityHashSet();
|
||||
+ newBiomesForWorld.addAll(Arrays.asList(biomesForWorldType));
|
||||
+ newBiomesForWorld.remove(biome);
|
||||
+ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
|
||||
+ }
|
||||
+
|
||||
+ public boolean handleSlimeSpawnReduction(Random random, World world)
|
||||
+ {
|
||||
+ return this == field_77138_c ? random.nextInt(4) != 1 : false;
|
||||
+ }
|
||||
+ /**
|
||||
+ * Called when 'Create New World' button is pressed before starting game
|
||||
+ */
|
||||
+ public void onGUICreateWorldPress() { }
|
||||
}
|
||||
@@ -51,8 +51,8 @@ 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.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.ProxyInjector;
|
||||
import cpw.mods.fml.common.ReflectionHelper;
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
|
||||
import cpw.mods.fml.common.modloader.ModProperty;
|
||||
@@ -89,49 +89,16 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
*/
|
||||
private MinecraftServer server;
|
||||
|
||||
/**
|
||||
* A handy list of the default overworld biomes
|
||||
*/
|
||||
private BiomeGenBase[] defaultOverworldBiomes;
|
||||
|
||||
/**
|
||||
* Called to start the whole game off from
|
||||
* {@link MinecraftServer#startServer}
|
||||
*
|
||||
* @param minecraftServer
|
||||
*/
|
||||
public void onPreLoad(MinecraftServer minecraftServer)
|
||||
public void beginServerLoading(MinecraftServer minecraftServer)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class.forName("BaseModMp", false, getClass().getClassLoader());
|
||||
MinecraftServer.field_6038_a.severe(""
|
||||
+ "Forge Mod Loader has detected that this server has an ModLoaderMP installed alongside Forge Mod Loader.\n"
|
||||
+ "This will cause a serious problem with compatibility. To protect your worlds, this minecraft server will now shutdown.\n"
|
||||
+ "You should follow the installation instructions of either Minecraft Forge of Forge Mod Loader and NOT install ModLoaderMP \n"
|
||||
+ "into the minecraft_server.jar file "
|
||||
+ "before this server will be allowed to start up.\n\nFailure to do so will simply result in more startup failures.\n\n"
|
||||
+ "The authors of Minecraft Forge and Forge Mod Loader strongly suggest you talk to your mod's authors and get them to\nupdate their "
|
||||
+ "requirements. ModLoaderMP is not compatible with Minecraft Forge on the server and they will need to update their mod\n"
|
||||
+ "for Minecraft Forge and other server compatibility, unless they are Minecraft Forge mods, in which case they already\n"
|
||||
+ "don't need ModLoaderMP and the mod author simply has failed to update his requirements and should be informed appropriately.\n\n"
|
||||
+ "The authors of Forge Mod Loader would like to be compatible with ModLoaderMP but it is closed source and owned by SDK.\n"
|
||||
+ "SDK, the author of ModLoaderMP, has a standing invitation to submit compatibility patches \n"
|
||||
+ "to the open source community project that is Forge Mod Loader so that this incompatibility doesn't last. \n"
|
||||
+ "Users who wish to enjoy mods of both types are "
|
||||
+ "encouraged to request of SDK that he submit a\ncompatibility patch to the Forge Mod Loader project at \n"
|
||||
+ "http://github.com/cpw/FML.\nPosting on the minecraft forums at\nhttp://www.minecraftforum.net/topic/86765- (the MLMP thread)\n"
|
||||
+ "may encourage him in this effort. However, I ask that your requests be polite.\n"
|
||||
+ "Now, the server has to shutdown so you can reinstall your minecraft_server.jar\nproperly, until such time as we can work together.");
|
||||
throw new RuntimeException(
|
||||
"This FML based server has detected an installation of ModLoaderMP alongside. This will cause serious compatibility issues, so the server will now shut down.");
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
// We're safe. continue
|
||||
}
|
||||
server = minecraftServer;
|
||||
ReflectionHelper.detectObfuscation(World.class);
|
||||
ObfuscationReflectionHelper.detectObfuscation(World.class);
|
||||
FMLCommonHandler.instance().beginLoading(this);
|
||||
FMLRegistry.registerRegistry(new ServerRegistry());
|
||||
Loader.instance().loadMods();
|
||||
@@ -140,7 +107,7 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
/**
|
||||
* Called a bit later on during server initialization to finish loading mods
|
||||
*/
|
||||
public void onLoadComplete()
|
||||
public void finishServerLoading()
|
||||
{
|
||||
Loader.instance().initializeMods();
|
||||
}
|
||||
@@ -161,125 +128,6 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
return server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a handle to the server's logger instance
|
||||
*/
|
||||
public Logger getMinecraftLogger()
|
||||
{
|
||||
return MinecraftServer.field_6038_a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from ChunkProviderServer when a chunk needs to be populated
|
||||
*
|
||||
* To avoid polluting the worldgen seed, we generate a new random from the
|
||||
* world seed and generate a seed from that
|
||||
*
|
||||
* @param chunkProvider
|
||||
* @param chunkX
|
||||
* @param chunkZ
|
||||
* @param world
|
||||
* @param generator
|
||||
*/
|
||||
public void onChunkPopulate(IChunkProvider chunkProvider, int chunkX, int chunkZ, World world, IChunkProvider generator)
|
||||
{
|
||||
FMLCommonHandler.instance().handleWorldGeneration(chunkX, chunkZ, world.func_22079_j(), world, generator, chunkProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from the furnace to lookup fuel values
|
||||
*
|
||||
* @param itemId
|
||||
* @param itemDamage
|
||||
* @return
|
||||
*/
|
||||
public int fuelLookup(int itemId, int itemDamage)
|
||||
{
|
||||
int fv = 0;
|
||||
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
fv = Math.max(fv, mod.lookupFuelValue(itemId, itemDamage));
|
||||
}
|
||||
|
||||
return fv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the offered class and instance of BaseMod and therefore a ModLoader
|
||||
* mod?
|
||||
*/
|
||||
public boolean isModLoaderMod(Class<?> clazz)
|
||||
{
|
||||
return BaseMod.class.isAssignableFrom(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the supplied mod class into a mod container
|
||||
*/
|
||||
public ModContainer loadBaseModMod(Class<?> clazz, File canonicalFile)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends BaseMod> bmClazz = (Class<? extends BaseMod>) clazz;
|
||||
return new ModLoaderModContainer(bmClazz, canonicalFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to notify that an item was picked up from the world
|
||||
*
|
||||
* @param entityItem
|
||||
* @param entityPlayer
|
||||
*/
|
||||
public void notifyItemPickup(EntityItem entityItem, EntityPlayer entityPlayer)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPickupNotification())
|
||||
{
|
||||
mod.getPickupNotifier().notifyPickup(entityItem, entityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Raise an exception
|
||||
*
|
||||
* @param exception
|
||||
* @param message
|
||||
* @param stopGame
|
||||
*/
|
||||
public void raiseException(Throwable exception, String message, boolean stopGame)
|
||||
{
|
||||
FMLCommonHandler.instance().getFMLLogger().throwing("FMLHandler", "raiseException", exception);
|
||||
throw new RuntimeException(exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to dispense the item as an entity other than just as a the item
|
||||
* itself
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param xVelocity
|
||||
* @param zVelocity
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
public boolean tryDispensingEntity(World world, double x, double y, double z, int xVelocity, int zVelocity, ItemStack item)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsToDispense() && mod.getDispenseHandler().dispense(x, y, z, xVelocity, zVelocity, world, item))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the instance
|
||||
*/
|
||||
@@ -288,294 +136,12 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a list of default overworld biomes
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public BiomeGenBase[] getDefaultOverworldBiomes()
|
||||
{
|
||||
if (defaultOverworldBiomes == null)
|
||||
{
|
||||
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(20);
|
||||
|
||||
for (int i = 0; i < 23; i++)
|
||||
{
|
||||
if ("Sky".equals(BiomeGenBase.field_35521_a[i].field_6163_m) || "Hell".equals(BiomeGenBase.field_35521_a[i].field_6163_m))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
biomes.add(BiomeGenBase.field_35521_a[i]);
|
||||
}
|
||||
|
||||
defaultOverworldBiomes = new BiomeGenBase[biomes.size()];
|
||||
biomes.toArray(defaultOverworldBiomes);
|
||||
}
|
||||
|
||||
return defaultOverworldBiomes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an item is crafted
|
||||
*
|
||||
* @param player
|
||||
* @param craftedItem
|
||||
* @param craftingGrid
|
||||
*/
|
||||
public void onItemCrafted(EntityPlayer player, ItemStack craftedItem, IInventory craftingGrid)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsCraftingNotification())
|
||||
{
|
||||
mod.getCraftingHandler().onCrafting(player, craftedItem, craftingGrid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an item is smelted
|
||||
*
|
||||
* @param player
|
||||
* @param smeltedItem
|
||||
*/
|
||||
public void onItemSmelted(EntityPlayer player, ItemStack smeltedItem)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsCraftingNotification())
|
||||
{
|
||||
mod.getCraftingHandler().onSmelting(player, smeltedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a chat packet is received
|
||||
*
|
||||
* @param chat
|
||||
* @param player
|
||||
* @return true if you want the packet to stop processing and not echo to
|
||||
* the rest of the world
|
||||
*/
|
||||
public boolean handleChatPacket(Packet3Chat chat, EntityPlayer player)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsNetworkPackets() && mod.getNetworkHandler().onChat(chat, player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a packet 250 packet is received from the player
|
||||
*
|
||||
* @param packet
|
||||
* @param player
|
||||
*/
|
||||
public void handlePacket250(Packet250CustomPayload packet, EntityPlayer player)
|
||||
{
|
||||
if ("REGISTER".equals(packet.field_44005_a) || "UNREGISTER".equals(packet.field_44005_a))
|
||||
{
|
||||
handleClientRegistration(packet, player);
|
||||
return;
|
||||
}
|
||||
|
||||
ModContainer mod = FMLCommonHandler.instance().getModForChannel(packet.field_44005_a);
|
||||
|
||||
if (mod != null)
|
||||
{
|
||||
mod.getNetworkHandler().onPacket250Packet(packet, player);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle register requests for packet 250 channels
|
||||
*
|
||||
* @param packet
|
||||
*/
|
||||
private void handleClientRegistration(Packet250CustomPayload packet, EntityPlayer player)
|
||||
{
|
||||
if (packet.field_44004_c == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
for (String channel : new String(packet.field_44004_c, "UTF8").split("\0"))
|
||||
{
|
||||
// Skip it if we don't know it
|
||||
if (FMLCommonHandler.instance().getModForChannel(channel) == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ("REGISTER".equals(packet.field_44005_a))
|
||||
{
|
||||
FMLCommonHandler.instance().activateChannel(player, channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLCommonHandler.instance().deactivateChannel(player, channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
getMinecraftLogger().warning("Received invalid registration packet");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a login
|
||||
*
|
||||
* @param loginPacket
|
||||
* @param networkManager
|
||||
*/
|
||||
public void handleClientLogin(NetworkManager networkManager)
|
||||
{
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.field_44005_a = "REGISTER";
|
||||
packet.field_44004_c = FMLCommonHandler.instance().getPacketRegistry();
|
||||
packet.field_44003_b = packet.field_44004_c.length;
|
||||
if (packet.field_44003_b > 0)
|
||||
{
|
||||
networkManager.func_745_a(packet);
|
||||
}
|
||||
}
|
||||
|
||||
public void announceLogin(EntityPlayer player)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPlayerTracking())
|
||||
{
|
||||
mod.getPlayerTracker().onPlayerLogin(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getMinecraftRootDirectory()
|
||||
{
|
||||
try
|
||||
{
|
||||
return server.func_6009_a(".").getCanonicalFile();
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
return new File(".");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param var2
|
||||
* @return
|
||||
*/
|
||||
public boolean handleServerCommand(String command, String player, ICommandManager listener)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsConsoleCommands() && mod.getConsoleHandler().handleCommand(command, player, listener))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param player
|
||||
*/
|
||||
public void announceLogout(EntityPlayer player)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPlayerTracking())
|
||||
{
|
||||
mod.getPlayerTracker().onPlayerLogout(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param p_28168_1_
|
||||
*/
|
||||
public void announceDimensionChange(EntityPlayer player)
|
||||
{
|
||||
for (ModContainer mod : Loader.getModList())
|
||||
{
|
||||
if (mod.wantsPlayerTracking())
|
||||
{
|
||||
mod.getPlayerTracker().onPlayerChangedDimension(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param biome
|
||||
*/
|
||||
public void addBiomeToDefaultWorldGenerator(BiomeGenBase biome)
|
||||
{
|
||||
WorldType.field_48457_b.addNewBiome(biome);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param biome
|
||||
*/
|
||||
public void removeBiomeFromDefaultWorldGenerator(BiomeGenBase biome)
|
||||
{
|
||||
WorldType.field_48457_b.removeBiome(biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getMinecraftInstance()
|
||||
{
|
||||
return server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrentLanguage()
|
||||
{
|
||||
return StringTranslate.func_25079_a().getCurrentLanguage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Properties getCurrentLanguageTable()
|
||||
{
|
||||
return StringTranslate.func_25079_a().getCurrentLanguageTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectName(Object instance)
|
||||
{
|
||||
String objectName;
|
||||
if (instance instanceof Item) {
|
||||
objectName=((Item)instance).func_20106_a();
|
||||
} else if (instance instanceof Block) {
|
||||
objectName=((Block)instance).func_20036_e();
|
||||
} else if (instance instanceof ItemStack) {
|
||||
objectName=Item.field_176_c[((ItemStack)instance).field_855_c].func_35407_a((ItemStack)instance);
|
||||
} else {
|
||||
throw new IllegalArgumentException(String.format("Illegal object for naming %s",instance));
|
||||
}
|
||||
objectName+=".name";
|
||||
return objectName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see cpw.mods.fml.common.IFMLSidedHandler#readMetadataFrom(java.io.InputStream, cpw.mods.fml.common.ModContainer)
|
||||
*/
|
||||
@Override
|
||||
public ModMetadata readMetadataFrom(InputStream input, ModContainer mod) throws Exception
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see cpw.mods.fml.common.IFMLSidedHandler#profileStart(java.lang.String)
|
||||
@@ -583,7 +149,7 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
@Override
|
||||
public void profileStart(String profileLabel)
|
||||
{
|
||||
Profiler.func_40518_a(profileLabel);
|
||||
server.field_71304_b.func_76320_a(profileLabel);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -592,21 +158,7 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
@Override
|
||||
public void profileEnd()
|
||||
{
|
||||
Profiler.func_40517_a();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see cpw.mods.fml.common.IFMLSidedHandler#getModLoaderPropertyFor(java.lang.reflect.Field)
|
||||
*/
|
||||
@Override
|
||||
public ModProperty getModLoaderPropertyFor(Field f)
|
||||
{
|
||||
if (f.isAnnotationPresent(MLProp.class))
|
||||
{
|
||||
MLProp prop = f.getAnnotation(MLProp.class);
|
||||
return new ModProperty(prop.info(), prop.min(), prop.max(), prop.name());
|
||||
}
|
||||
return null;
|
||||
server.field_71304_b.func_76317_a();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -643,4 +195,39 @@ public class FMLServerHandler implements IFMLSidedHandler
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Logger getMinecraftLogger()
|
||||
{
|
||||
// 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 ModProperty getModLoaderPropertyFor(Field f)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class AccessTransformer implements IClassTransformer
|
||||
if (parenIdx>0)
|
||||
{
|
||||
m.desc = nameReference.substring(parenIdx);
|
||||
m.name = nameReference.substring(0,parenIdx-1);
|
||||
m.name = nameReference.substring(0,parenIdx);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user