Merge branch 'master' into snapshot15

Fix up compilation and patching errors

Conflicts:
	common/cpw/mods/fml/common/registry/GameRegistry.java
	conf/joined.srg
	conf/params.csv
	conf/version.cfg
	patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch
This commit is contained in:
Christian 2013-01-22 15:21:22 -05:00
commit 331e6bcf62
26 changed files with 181 additions and 75 deletions

View File

@ -1,7 +1,7 @@
This minecraft mod, Forge Mod Loader, including all parts herein, is licensed
under the GNU LGPL v2.1 or later.
This minecraft mod, Forge Mod Loader, including all parts herein except as noted below,
is licensed under the GNU LGPL v2.1 or later.
Homepage: https://github.com/cpw/FML
Homepage: https://github.com/MinecraftForge/FML
This software includes portions from the Apache Maven project at
http://maven.apache.org/ specifically the ComparableVersion.java code. It is
@ -9,6 +9,12 @@ included based on guidelines at
http://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
with notices intact. The only change is a non-functional change of package name.
=== MCP Data ===
This software includes data from the Minecraft Coder Pack (MCP), with kind permission
from them. The license to MCP data is not transitive - distribution of this data by
third parties requires independent licensing from the MCP team. This data is not
redistributable without permission from the MCP team.
========
GNU LESSER GENERAL PUBLIC LICENSE

View File

@ -2,7 +2,7 @@ package cpw.mods.fml.common;
/**
* A marker interface for retrieving a proxy to a bukkit plugin.
* Fields associated with {@link BukkitPluginRef} annotations should be should probably
* Fields associated with {@link BukkitPluginRef} annotations should
* declare this type and cast down if the target is available (not null)
* @author cpw
*

View File

@ -304,9 +304,14 @@ public class FMLCommonHandler
}
}
public void handleServerStarting(MinecraftServer server)
public boolean handleServerAboutToStart(MinecraftServer server)
{
Loader.instance().serverStarting(server);
return Loader.instance().serverAboutToStart(server);
}
public boolean handleServerStarting(MinecraftServer server)
{
return Loader.instance().serverStarting(server);
}
public void handleServerStarted()

View File

@ -51,8 +51,8 @@ public class FMLDummyContainer extends DummyModContainer implements WorldAccessC
"to cooperate and provide a good modding environment. " +
"The mod loading system is compatible with ModLoader, all your ModLoader " +
"mods should work.";
meta.url="https://github.com/cpw/FML/wiki";
meta.updateUrl="https://github.com/cpw/FML/wiki";
meta.url="https://github.com/MinecraftForge/FML/wiki";
meta.updateUrl="https://github.com/MinecraftForge/FML/wiki";
meta.screenshots=new String[0];
meta.logoFile="";
}

View File

@ -58,6 +58,7 @@ import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLFingerprintViolationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
@ -90,6 +91,7 @@ public class FMLModContainer implements ModContainer
.put(FMLPreInitializationEvent.class, Mod.PreInit.class)
.put(FMLInitializationEvent.class, Mod.Init.class)
.put(FMLPostInitializationEvent.class, Mod.PostInit.class)
.put(FMLServerAboutToStartEvent.class, Mod.ServerAboutToStart.class)
.put(FMLServerStartingEvent.class, Mod.ServerStarting.class)
.put(FMLServerStartedEvent.class, Mod.ServerStarted.class)
.put(FMLServerStoppingEvent.class, Mod.ServerStopping.class)

View File

@ -377,7 +377,7 @@ public class Loader
}
/**
* @return
*
*/
private void initializeLoader()
{
@ -695,10 +695,19 @@ public class Loader
return "Minecraft " + mccversion;
}
public void serverStarting(Object server)
public boolean serverStarting(Object server)
{
modController.distributeStateMessage(LoaderState.SERVER_STARTING, server);
modController.transition(LoaderState.SERVER_STARTING);
try
{
modController.distributeStateMessage(LoaderState.SERVER_STARTING, server);
modController.transition(LoaderState.SERVER_STARTING);
}
catch (Throwable t)
{
FMLLog.log(Level.SEVERE, t, "A fatal exception occurred during the server starting event");
return false;
}
return true;
}
public void serverStarted()
@ -752,4 +761,19 @@ public class Loader
modController.transition(LoaderState.SERVER_STOPPED);
modController.transition(LoaderState.AVAILABLE);
}
public boolean serverAboutToStart(MinecraftServer server)
{
try
{
modController.distributeStateMessage(LoaderState.SERVER_ABOUT_TO_START, server);
modController.transition(LoaderState.SERVER_ABOUT_TO_START);
}
catch (Throwable t)
{
FMLLog.log(Level.SEVERE, t, "A fatal exception occurred during the server about to start event");
return false;
}
return true;
}
}

View File

@ -8,6 +8,7 @@ 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.FMLServerAboutToStartEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
@ -28,6 +29,7 @@ public enum LoaderState
INITIALIZATION("Initializing mods", FMLInitializationEvent.class),
POSTINITIALIZATION("Post-initializing mods", FMLPostInitializationEvent.class),
AVAILABLE("Mod loading complete", FMLLoadCompleteEvent.class),
SERVER_ABOUT_TO_START("Server about to start", FMLServerAboutToStartEvent.class),
SERVER_STARTING("Server starting", FMLServerStartingEvent.class),
SERVER_STARTED("Server started", FMLServerStartedEvent.class),
SERVER_STOPPING("Server stopping", FMLServerStoppingEvent.class),

View File

@ -144,6 +144,14 @@ public @interface Mod
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface PostInit {}
/**
* Mark the designated method as being called at the "server-about-to-start" phase
* @author cpw
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ServerAboutToStart {}
/**
* Mark the designated method as being called at the "server-starting" phase
* @author cpw

View File

@ -81,13 +81,13 @@ public interface ModContainer
/**
* A list of modids that should be loaded prior to this one. The special
* value <strong>*</strong> indicates to load <em>before</em> any other mod.
* value <strong>*</strong> indicates to load <em>after</em> any other mod.
*/
List<ArtifactVersion> getDependencies();
/**
* A list of modids that should be loaded <em>after</em> this one. The
* special value <strong>*</strong> indicates to load <em>after</em> any
* special value <strong>*</strong> indicates to load <em>before</em> any
* other mod.
*/
List<ArtifactVersion> getDependants();

View File

@ -0,0 +1,25 @@
package cpw.mods.fml.common.event;
import net.minecraft.server.MinecraftServer;
import cpw.mods.fml.common.LoaderState.ModState;
public class FMLServerAboutToStartEvent extends FMLStateEvent {
private MinecraftServer server;
public FMLServerAboutToStartEvent(Object... data)
{
super(data);
this.server = (MinecraftServer) data[0];
}
@Override
public ModState getModState()
{
return ModState.AVAILABLE;
}
public MinecraftServer getServer()
{
return server;
}
}

View File

@ -35,7 +35,7 @@ public @interface NetworkMod
Class<? extends IPacketHandler> packetHandler() default NULL.class;
/**
* A tiny packet handler implementation based on {@link Packet131MapData} for "small"
* A tiny packet handler implementation based on {@link net.minecraft.network.packet.Packet131MapData} for "small"
* data packet loads.
*/
Class<? extends ITinyPacketHandler> tinyPacketHandler() default NULL.class;

View File

@ -193,7 +193,7 @@ public class NetworkModHandler
}
}
/**
* @return
* @return the default {@link NetworkMod#connectionHandler()} annotation value
*/
private Object getConnectionHandlerDefaultValue()
{
@ -211,7 +211,7 @@ public class NetworkModHandler
}
/**
* @return
* @return the default {@link NetworkMod#packetHandler()} annotation value
*/
private Object getPacketHandlerDefaultValue()
{
@ -228,6 +228,9 @@ public class NetworkModHandler
}
}
/**
* @return the default {@link NetworkMod#tinyPacketHandler()} annotation value
*/
private Object getTinyPacketHandlerDefaultValue()
{
try {
@ -243,7 +246,7 @@ public class NetworkModHandler
}
}
/**
* @return
* @return the {@link NetworkMod#clientPacketHandlerSpec()} default annotation value
*/
private Object getClientHandlerSpecDefaultValue()
{
@ -260,7 +263,7 @@ public class NetworkModHandler
}
}
/**
* @return
* @return the default {@link NetworkMod#serverPacketHandlerSpec()} annotation value
*/
private Object getServerHandlerSpecDefaultValue()
{

View File

@ -64,7 +64,7 @@ public class NetworkRegistry
}
/**
* Get the packet 250 channel registration string
* @return
* @return the {@link Packet250CustomPayload} channel registration string
*/
byte[] getPacketRegistry(Side side)
{
@ -81,8 +81,8 @@ public class NetworkRegistry
}
/**
* register a channel to a mod
* @param container
* @param channelName
* @param handler the packet handler
* @param channelName the channel name to register it with
*/
public void registerChannel(IPacketHandler handler, String channelName)
{

View File

@ -45,6 +45,7 @@ import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.LoaderException;
import cpw.mods.fml.common.LoaderState;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.Mod.Block;
import cpw.mods.fml.common.ModContainer;
@ -145,7 +146,7 @@ public class GameRegistry
/**
* Private and not yet working properly
*
* @return
* @return a block id
*/
private static int findSpareBlockId()
{
@ -250,7 +251,12 @@ public class GameRegistry
public static void addRecipe(ItemStack output, Object... params)
{
CraftingManager.func_77594_a().func_92103_a(output, params);
addShapedRecipe(output, params);
}
public static IRecipe addShapedRecipe(ItemStack output, Object... params)
{
return CraftingManager.func_77594_a().func_92103_a(output, params);
}
public static void addShapelessRecipe(ItemStack output, Object... params)
@ -273,6 +279,27 @@ public class GameRegistry
TileEntity.func_70306_a(tileEntityClass, id);
}
/**
* Register a tile entity, with alternative TileEntity identifiers. Use with caution!
* This method allows for you to "rename" the 'id' of the tile entity.
*
* @param tileEntityClass The tileEntity class to register
* @param id The primary ID, this will be the ID that the tileentity saves as
* @param alternatives A list of alternative IDs that will also map to this class. These will never save, but they will load
*/
public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)
{
TileEntity.func_70306_a(tileEntityClass, id);
Map<String,Class> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_70326_a", "a");
for (String s: alternatives)
{
if (!teMappings.containsKey(s))
{
teMappings.put(s, tileEntityClass);
}
}
}
public static void addBiome(BiomeGenBase biome)
{
WorldType.field_77137_b.addNewBiome(biome);

View File

@ -58,8 +58,8 @@ public class TickRegistry
}
/**
* @param side
* @return
* @param side the side to get the tick queue for
* @return the queue for the effective side
*/
private static PriorityQueue<TickQueueElement> getQueue(Side side)
{

View File

@ -37,7 +37,7 @@ public class VillagerRegistry
private List<Integer> newVillagerIds = Lists.newArrayList();
/**
* Allow access to the {@link StructureVillagePieces} array controlling new village
* Allow access to the {@link net.minecraft.world.gen.structure.StructureVillagePieces} array controlling new village
* creation so you can insert your own new village pieces
*
* @author cpw
@ -46,7 +46,7 @@ public class VillagerRegistry
public interface IVillageCreationHandler
{
/**
* Called when {@link MapGenVillage} is creating a new village
* Called when {@link net.minecraft.world.gen.structure.MapGenVillage} is creating a new village
*
* @param random
* @param i
@ -60,7 +60,7 @@ public class VillagerRegistry
/**
* Build an instance of the village component {@link StructureVillagePieces}
* Build an instance of the village component {@link net.minecraft.world.gen.structure.StructureVillagePieces}
* @param villagePiece
* @param startPiece
* @param pieces
@ -150,10 +150,10 @@ public class VillagerRegistry
}
return defaultSkin;
}
/**
* Returns a list of all added villager types
*
*
* @return newVillagerIds
*/
public static Collection<Integer> getRegisteredVillagers()

View File

@ -22,33 +22,19 @@ final class FMLLogFormatter extends Formatter
msg.append(this.dateFormat.format(Long.valueOf(record.getMillis())));
Level lvl = record.getLevel();
if (lvl == Level.FINEST)
String name = lvl.getLocalizedName();
if ( name == null )
{
msg.append(" [FINEST] ");
name = lvl.getName();
}
else if (lvl == Level.FINER)
if ( ( name != null ) && ( name.length() > 0 ) )
{
msg.append(" [FINER] ");
msg.append(" [" + name + "] ");
}
else if (lvl == Level.FINE)
else
{
msg.append(" [FINE] ");
}
else if (lvl == Level.INFO)
{
msg.append(" [INFO] ");
}
else if (lvl == Level.WARNING)
{
msg.append(" [WARNING] ");
}
else if (lvl == Level.SEVERE)
{
msg.append(" [SEVERE] ");
}
else if (lvl == Level.SEVERE)
{
msg.append(" [" + lvl.getLocalizedName() + "] ");
msg.append(" ");
}
if (record.getLoggerName() != null)

View File

@ -177,7 +177,7 @@ public class FMLRelauncher
}
/**
* @return
* @return the location of the client home
*/
private File computeExistingClientHome()
{

View File

@ -401,8 +401,8 @@ public class RelaunchLibraryManager
}
/**
* @param mcDir
* @return
* @param mcDir the minecraft home directory
* @return the lib directory
*/
private static File setupLibDir(File mcDir)
{
@ -427,8 +427,8 @@ public class RelaunchLibraryManager
}
/**
* @param mcDir
* @return
* @param mcDir the minecraft home directory
* @return the coremod directory
*/
private static File setupCoreModDir(File mcDir)
{

View File

@ -42,7 +42,7 @@ import cpw.mods.fml.relauncher.Side;
* Handles primary communication from hooked code into the system
*
* The FML entry point is {@link #beginServerLoading(MinecraftServer)} called from
* {@link net.minecraft.shared.DedicatedServer}
* {@link net.minecraft.server.dedicated.DedicatedServer}
*
* Obfuscated code should focus on this class and other members of the "server"
* (or "client") code

View File

@ -3,8 +3,8 @@
"modid": "mcp",
"name": "Minecraft Coder Pack",
"description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.",
"version": "7.26",
"mcversion": "1.4.7",
"version": "7.30c",
"mcversion": "13w02b",
"logoFile": "/mcp.png",
"url": "http://mcp.ocean-labs.de/",
"updateUrl": "",

View File

@ -1,6 +1,6 @@
This is Forge Mod Loader.
You can find the source code at all times at https://github.com/cpw/FML
You can find the source code at all times at https://github.com/MinecraftForge/FML
This minecraft mod is a clean open source implementation of a mod loader for
minecraft servers, minecraft bukkit servers, and minecraft clients.
@ -11,8 +11,14 @@ It implements API defined by the client side ModLoader, authored by Risugami.
http://www.minecraftforum.net/topic/75440-
It also contains suggestions and hints from LexManos, author of MinecraftForge.
http://www.mod-buildcraft.com/forums/forum/minecraft-forge/
http://www.minecraftforge.net/
Finally, it contains an implementation of topological sort based on that
Additionally, it contains an implementation of topological sort based on that
published at http://keithschwarz.com/interesting/code/?dir=topological-sort
It also contains code from the Maven project for performing versioned dependency
resolution. http://maven.apache.org/
Forge Mod Loader downloads components from the Minecraft Coder Pack
(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team.

View File

@ -1,6 +1,6 @@
This is Forge Mod Loader, or FML for short, by cpw.
More information can be found at https://github.com/cpw/FML/wiki
More information can be found at https://github.com/MinecraftForge/FML/wiki
It is a clean reimplementation of a mod loading system for client, server and
bukkit use, incorporating API implementations of client side ModLoader by

View File

@ -36,9 +36,9 @@ client_url = http://assets.minecraft.net/1_4_7/minecraft.jar
server_url = http://assets.minecraft.net/1_4_7/minecraft_server.jar
client_md5 = 8e80fb01b321c6b3c7efca397a3eea35
server_md5 = f69ac4bfce2dfbce03fe872518f75a05
mcp_ver = 7.26
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp726.zip
mcp_md5 = 5320353829c2906bd032649085721d1d
mcp_ver = 7.26a
mcp_url = http://mcp.ocean-labs.de/files/archive/mcp726a.zip
mcp_md5 = 5f11fbccd857b43a0f54117253b3e4dd
[s13w02b]
client_url = http://assets.minecraft.net/13w02b/minecraft.jar

View File

@ -25,12 +25,20 @@
this.func_71210_a(new DedicatedPlayerList(this));
long j = System.nanoTime();
@@ -187,6 +192,8 @@
@@ -167,6 +172,7 @@
this.func_71191_d((this.func_71207_Z() + 8) / 16 * 16);
this.func_71191_d(MathHelper.func_76125_a(this.func_71207_Z(), 64, 256));
this.field_71340_o.func_73667_a("max-build-height", Integer.valueOf(this.func_71207_Z()));
+ if (!FMLCommonHandler.instance().handleServerAboutToStart(this)) { return false; }
field_71306_a.info("Preparing level \"" + this.func_71270_I() + "\"");
this.func_71247_a(this.func_71270_I(), this.func_71270_I(), k, worldtype, s2);
long i1 = System.nanoTime() - j;
@@ -187,7 +193,7 @@
this.field_71339_n.func_72602_a();
}
+ FMLCommonHandler.instance().handleServerStarting(this);
+
return true;
- return true;
+ return FMLCommonHandler.instance().handleServerStarting(this);
}
public boolean func_71225_e()

View File

@ -7,11 +7,15 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.io.File;
@@ -110,6 +111,7 @@
@@ -108,9 +109,10 @@
this.func_71245_h(true);
field_71306_a.info("Generating keypair");
this.func_71253_a(CryptManager.func_75891_b());
+ if (!FMLCommonHandler.instance().handleServerAboutToStart(this)) { return false; }
this.func_71247_a(this.func_71270_I(), this.func_71221_J(), this.field_71350_m.func_77160_d(), this.field_71350_m.func_77165_h(), this.field_71350_m.func_82749_j());
this.func_71205_p(this.func_71214_G() + " - " + this.field_71305_c[0].func_72912_H().func_76065_j());
+ FMLCommonHandler.instance().handleServerStarting(this);
return true;
- return true;
+ return FMLCommonHandler.instance().handleServerStarting(this);
}
public void func_71217_p()