Update fml, impelemnted Diemsnion API stuff.

This commit is contained in:
LexManos 2012-08-10 18:15:10 -07:00
parent 3aa13d8640
commit f374723610
19 changed files with 577 additions and 110 deletions

View file

@ -1,20 +1,23 @@
package net.minecraftforge.common;
import java.util.Hashtable;
import java.util.Map.Entry;
import java.util.logging.Level;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.server.MinecraftServer;
import net.minecraft.src.*;
public class DimensionManager
{
private static Hashtable<Integer, WorldProvider> providers = new Hashtable<Integer, WorldProvider>();
private static Hashtable<Integer, Class<? extends WorldProvider>> providers = new Hashtable<Integer, Class<? extends WorldProvider>>();
private static Hashtable<Integer, Boolean> spawnSettings = new Hashtable<Integer, Boolean>();
private static Hashtable<Integer, World> worlds = new Hashtable<Integer, World>();
private static Hashtable<Integer, WorldServer> worlds = new Hashtable<Integer, WorldServer>();
private static boolean hasInit = false;
private static Hashtable<Integer, Integer> dimensions = new Hashtable<Integer, Integer>();
public static boolean registerDimension(int id, WorldProvider provider, boolean keepLoaded)
public static boolean registerProviderType(int id, Class<? extends WorldProvider> provider, boolean keepLoaded)
{
if (providers.containsValue(id))
{
@ -31,38 +34,79 @@ public class DimensionManager
{
return;
}
registerDimension( 0, new WorldProviderSurface(), true);
registerDimension(-1, new WorldProviderHell(), true);
registerDimension( 1, new WorldProviderEnd(), false);
registerProviderType( 0, WorldProviderSurface.class, true);
registerProviderType(-1, WorldProviderHell.class, true);
registerProviderType( 1, WorldProviderEnd.class, false);
registerDimension( 0, 0);
registerDimension(-1, -1);
registerDimension( 1, 1);
}
public static WorldProvider getProvider(int id)
public static void registerDimension(int id, int providerType)
{
return providers.get(id);
if (!providers.containsKey(providerType))
{
throw new IllegalArgumentException(String.format("Failed to register dimensiuon for id %d, provider type %d does not exist", id, providerType));
}
if (dimensions.containsKey(id))
{
throw new IllegalArgumentException(String.format("Failed to register dimensiuon for id %d, One is already registered", id));
}
dimensions.put(id, providerType);
}
public static int getProviderType(int dim)
{
if (!dimensions.containsKey(dim))
{
throw new IllegalArgumentException(String.format("Could not get provider type for dimension %d, does not exist", dim));
}
return dimensions.get(dim);
}
public static Integer[] getIDs()
{
return providers.keySet().toArray(new Integer[0]);
return dimensions.keySet().toArray(new Integer[0]);
}
public static void setWorld(int id, World world)
public static void setWorld(int id, WorldServer world)
{
worlds.put(id, world);
WorldServer[] tmp = new WorldServer[worlds.size() > 3 ? worlds.size() : 3];
for (int x = -1; x <= 1; x++)
{
tmp[(x == 0 ? 0 : x == -1 ? 1 : 2)] = worlds.get(x);
}
public static World getWorld(int id)
int x = 3;
for (Entry<Integer, WorldServer> entry : worlds.entrySet())
{
int dim = entry.getKey();
if (dim >= -1 && dim <= 1)
{
continue;
}
tmp[x++] = entry.getValue();
}
MinecraftServer.getServer().dimensionServerList = tmp;
MinecraftServer.getServer().worldTickTimes.put(id, new long[100]);
}
public static WorldServer getWorld(int id)
{
return worlds.get(id);
}
public static World[] getWorlds()
public static WorldServer[] getWorlds()
{
return worlds.values().toArray(new World[0]);
return worlds.values().toArray(new WorldServer[0]);
}
public static boolean shouldLoadSpawn(int id)
public static boolean shouldLoadSpawn(int dim)
{
int id = getProviderType(dim);
return spawnSettings.contains(id) && spawnSettings.get(id);
}
@ -71,14 +115,24 @@ public class DimensionManager
init();
}
public static WorldProvider createProviderFor(int i) {
try {
if (providers.containsKey(i))
return getProvider(i).getClass().newInstance();
public static WorldProvider createProviderFor(int dim)
{
try
{
if (dimensions.containsKey(dim))
{
return providers.get(getProviderType(dim)).newInstance();
}
else
{
return null;
} catch (Exception e) {
FMLCommonHandler.instance().getFMLLogger().log(Level.SEVERE,String.format("An error occured trying to create an instance of WorldProvider %d (%s)",i,getProvider(i).getClass().getSimpleName()),e);
}
}
catch (Exception e)
{
FMLCommonHandler.instance().getFMLLogger().log(Level.SEVERE,String.format("An error occured trying to create an instance of WorldProvider %d (%s)",
dim,
providers.get(getProviderType(dim)).getSimpleName()),e);
throw new RuntimeException(e);
}
}

View file

@ -0,0 +1,16 @@
package net.minecraftforge.event.entity.player;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityPlayer;
import net.minecraftforge.event.Cancelable;
@Cancelable
public class AttackEntityEvent extends PlayerEvent
{
public final Entity target;
public AttackEntityEvent(EntityPlayer player, Entity target)
{
super(player);
this.target = target;
}
}

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Forge-Server/src/net/minecraft/server/MinecraftServer.java"/>
<listEntry value="/Forge-Server/src-common/net/minecraft/server/MinecraftServer.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>

View file

@ -86,8 +86,8 @@
<children xsi:type="advanced:Placeholder" xmi:id="_9QwK2N4HEeGVeZPPN-V-EA" elementId="org.eclipse.egit.ui.RepositoriesView" toBeRendered="false" ref="_9QsgcN4HEeGVeZPPN-V-EA"/>
</children>
</children>
<children xsi:type="basic:PartSashContainer" xmi:id="_9QwK2d4HEeGVeZPPN-V-EA" containerData="8238" selectedElement="_9Qwx594HEeGVeZPPN-V-EA">
<children xsi:type="basic:PartSashContainer" xmi:id="_9QwK2t4HEeGVeZPPN-V-EA" containerData="5470" selectedElement="_9QwK294HEeGVeZPPN-V-EA" horizontal="true">
<children xsi:type="basic:PartSashContainer" xmi:id="_9QwK2d4HEeGVeZPPN-V-EA" containerData="8238" selectedElement="_9QwK2t4HEeGVeZPPN-V-EA">
<children xsi:type="basic:PartSashContainer" xmi:id="_9QwK2t4HEeGVeZPPN-V-EA" containerData="4770" selectedElement="_9QwK294HEeGVeZPPN-V-EA" horizontal="true">
<children xsi:type="advanced:Placeholder" xmi:id="_9QwK294HEeGVeZPPN-V-EA" elementId="org.eclipse.ui.editorss" containerData="8082" ref="_9PHzIN4HEeGVeZPPN-V-EA"/>
<children xsi:type="basic:PartSashContainer" xmi:id="_9QwK3N4HEeGVeZPPN-V-EA" containerData="1918" selectedElement="_9Qwx4t4HEeGVeZPPN-V-EA">
<children xsi:type="basic:PartStack" xmi:id="_9Qwx4N4HEeGVeZPPN-V-EA" elementId="org.eclipse.mylyn.tasks.ui.views.tasksMStack" toBeRendered="false" containerData="5000">
@ -104,7 +104,7 @@
</children>
</children>
</children>
<children xsi:type="basic:PartStack" xmi:id="_9Qwx594HEeGVeZPPN-V-EA" elementId="bottom" containerData="4530" selectedElement="_9Qwx6N4HEeGVeZPPN-V-EA">
<children xsi:type="basic:PartStack" xmi:id="_9Qwx594HEeGVeZPPN-V-EA" elementId="bottom" containerData="5230" selectedElement="_9Qwx694HEeGVeZPPN-V-EA">
<tags>newtablook</tags>
<tags>org.eclipse.e4.secondaryDataStack</tags>
<children xsi:type="advanced:Placeholder" xmi:id="_9Qwx6N4HEeGVeZPPN-V-EA" elementId="org.eclipse.ui.views.ProblemView" ref="_9QDnQ94HEeGVeZPPN-V-EA"/>
@ -216,72 +216,57 @@
<tags>categoryTag:Help</tags>
</sharedElements>
<sharedElements xsi:type="advanced:Area" xmi:id="_9PHzIN4HEeGVeZPPN-V-EA" elementId="org.eclipse.ui.editorss" selectedElement="_9PIaMN4HEeGVeZPPN-V-EA">
<children xsi:type="basic:PartStack" xmi:id="_9PIaMN4HEeGVeZPPN-V-EA" elementId="org.eclipse.e4.primaryDataStack" selectedElement="_sAA64OJ9EeGXDvTwhqcV7A">
<children xsi:type="basic:PartStack" xmi:id="_9PIaMN4HEeGVeZPPN-V-EA" elementId="org.eclipse.e4.primaryDataStack" selectedElement="_v7I7wOLBEeG-WveE-42ySA">
<tags>newtablook</tags>
<tags>org.eclipse.e4.primaryDataStack</tags>
<tags>EditorStack</tags>
<children xsi:type="basic:Part" xmi:id="_T5MeIOJ4EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="Minecraft.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-client/net/minecraft/client/Minecraft.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-client/net/minecraft/client/Minecraft.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;14305&quot; selectionTopPixel=&quot;5160&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_eNbEMOK-EeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="BlockButton.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/BlockButton.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/BlockButton.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;2060&quot; selectionTopPixel=&quot;630&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_qLTOQOJ4EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="RenderEngine.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-client/net/minecraft/src/RenderEngine.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-client/net/minecraft/src/RenderEngine.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;12133&quot; selectionTopPixel=&quot;5640&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_kFu7YOK-EeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="Orientation.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/forge-common/net/minecraftforge/common/Orientation.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/forge-common/net/minecraftforge/common/Orientation.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;332&quot; selectionTopPixel=&quot;0&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_I-wUYOJ5EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="TextureLoadEvent.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/forge-client/net/minecraftforge/client/event/TextureLoadEvent.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/forge-client/net/minecraftforge/client/event/TextureLoadEvent.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;327&quot; selectionTopPixel=&quot;0&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_6fDt0OK-EeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="PlayerControllerMP.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-client/net/minecraft/src/PlayerControllerMP.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-client/net/minecraft/src/PlayerControllerMP.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;37&quot; selectionOffset=&quot;10830&quot; selectionTopPixel=&quot;4365&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_ZT9BMOJ5EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="ForgeHooksClient.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/forge-client/net/minecraftforge/client/ForgeHooksClient.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/forge-client/net/minecraftforge/client/ForgeHooksClient.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;8299&quot; selectionTopPixel=&quot;3150&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_n4EdMOLBEeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="Block.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/Block.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/Block.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;686&quot; selectionOffset=&quot;84042&quot; selectionTopPixel=&quot;28080&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_bcfbAOJ5EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="EventBus.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/forge-common/net/minecraftforge/event/EventBus.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/forge-common/net/minecraftforge/event/EventBus.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;3372&quot; selectionTopPixel=&quot;1020&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_v7I7wOLBEeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="MapGenCaves.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/MapGenCaves.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/MapGenCaves.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;621&quot; selectionTopPixel=&quot;0&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_meS7kOJ5EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="Event.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/forge-common/net/minecraftforge/event/Event.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/forge-common/net/minecraftforge/event/Event.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;575&quot; selectionTopPixel=&quot;0&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="__-950OLDEeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="ForgeHooks.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/forge-common/net/minecraftforge/common/ForgeHooks.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/forge-common/net/minecraftforge/common/ForgeHooks.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;9181&quot; selectionTopPixel=&quot;3375&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_CFlAoOJ6EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="MinecraftServer.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/server/MinecraftServer.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/server/MinecraftServer.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;29&quot; selectionOffset=&quot;13428&quot; selectionTopPixel=&quot;4710&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_1o6koOLGEeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="EntityMinecart.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/EntityMinecart.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/EntityMinecart.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;41201&quot; selectionTopPixel=&quot;17400&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_DOxdUOJ6EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="BlockLeaves.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/BlockLeaves.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/BlockLeaves.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;3682&quot; selectionTopPixel=&quot;1170&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_Dld_EOLHEeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="MovingObjectPosition.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/MovingObjectPosition.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/MovingObjectPosition.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;747&quot; selectionTopPixel=&quot;75&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_Q9DLMOJ6EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="BlockLog.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/BlockLog.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/BlockLog.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;2038&quot; selectionTopPixel=&quot;585&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_EHMMEOLHEeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="Entity.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/Entity.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/Entity.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;68270&quot; selectionTopPixel=&quot;32032&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_d4SyQOJ9EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="PlaySoundAtEntityEvent.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/forge-common/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/forge-common/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;0&quot; selectionTopPixel=&quot;0&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_kJ4sIOJ9EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="PlaySoundAtEntityEvent.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Server/forge-common/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Server/forge-common/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;0&quot; selectionOffset=&quot;76&quot; selectionTopPixel=&quot;0&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_lYKdIOJ9EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="FMLServerHandler.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Server/src-server/cpw/mods/fml/server/FMLServerHandler.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Server/src-server/cpw/mods/fml/server/FMLServerHandler.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;16&quot; selectionOffset=&quot;2961&quot; selectionTopPixel=&quot;1415&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
<children xsi:type="basic:Part" xmi:id="_sAA64OJ9EeGXDvTwhqcV7A" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="FMLServerHandler.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Clean-Server/src/cpw/mods/fml/server/FMLServerHandler.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Clean-Server/src/cpw/mods/fml/server/FMLServerHandler.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;16&quot; selectionOffset=&quot;2961&quot; selectionTopPixel=&quot;1415&quot;/>&#xD;&#xA;&lt;/editor>"/>
<children xsi:type="basic:Part" xmi:id="_l59TQOLYEeG-WveE-42ySA" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="BiomeGenBase.java" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/obj16/jcu_obj.gif" tooltip="Forge-Client/src-common/net/minecraft/src/BiomeGenBase.java" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;editor id=&quot;org.eclipse.jdt.ui.CompilationUnitEditor&quot;>&#xD;&#xA;&lt;input factoryID=&quot;org.eclipse.ui.part.FileEditorInputFactory&quot; path=&quot;/Forge-Client/src-common/net/minecraft/src/BiomeGenBase.java&quot;/>&#xD;&#xA;&lt;editorState selectionHorizontalPixel=&quot;0&quot; selectionLength=&quot;8&quot; selectionOffset=&quot;6813&quot; selectionTopPixel=&quot;1575&quot;/>&#xD;&#xA;&lt;/editor>"/>
<tags>Editor</tags>
<tags>removeOnHide</tags>
</children>
@ -297,9 +282,14 @@
</menus>
<toolbar xmi:id="_9UpzYN4HEeGVeZPPN-V-EA" elementId="org.eclipse.jdt.ui.PackageExplorer" visible="false"/>
</sharedElements>
<sharedElements xsi:type="basic:Part" xmi:id="_9QDnQN4HEeGVeZPPN-V-EA" elementId="org.eclipse.jdt.ui.TypeHierarchy" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Type Hierarchy" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/eview16/class_hi.gif" closeable="true">
<sharedElements xsi:type="basic:Part" xmi:id="_9QDnQN4HEeGVeZPPN-V-EA" elementId="org.eclipse.jdt.ui.TypeHierarchy" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Type Hierarchy" iconURI="platform:/plugin/org.eclipse.jdt.ui//icons/full/eview16/class_hi.gif" tooltip="Type Hierarchy of 'Block - net.minecraft.src'" closeable="true">
<tags>View</tags>
<tags>categoryTag:Java</tags>
<menus xmi:id="_C4ZTIOLGEeG-WveE-42ySA" elementId="org.eclipse.jdt.ui.TypeHierarchy">
<tags>ViewMenu</tags>
<tags>menuContribution:menu</tags>
</menus>
<toolbar xmi:id="_C4Z6MOLGEeG-WveE-42ySA" elementId="org.eclipse.jdt.ui.TypeHierarchy" visible="false"/>
</sharedElements>
<sharedElements xsi:type="basic:Part" xmi:id="_9QDnQd4HEeGVeZPPN-V-EA" elementId="org.eclipse.ui.views.ResourceNavigator" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Navigator" iconURI="platform:/plugin/org.eclipse.ui.ide//icons/full/eview16/filenav_nav.gif" closeable="true">
<tags>View</tags>
@ -309,7 +299,7 @@
<tags>View</tags>
<tags>categoryTag:General</tags>
</sharedElements>
<sharedElements xsi:type="basic:Part" xmi:id="_9QDnQ94HEeGVeZPPN-V-EA" elementId="org.eclipse.ui.views.ProblemView" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Problems" iconURI="platform:/plugin/org.eclipse.ui.ide//icons/full/eview16/problems_view.gif" tooltip="1 error, 0 warnings, 0 others" closeable="true">
<sharedElements xsi:type="basic:Part" xmi:id="_9QDnQ94HEeGVeZPPN-V-EA" elementId="org.eclipse.ui.views.ProblemView" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Problems" iconURI="platform:/plugin/org.eclipse.ui.ide//icons/full/eview16/problems_view.gif" tooltip="0 items" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;view PRIMARY_SORT_FIELD=&quot;org.eclipse.ui.ide.severityAndDescriptionField&quot; categoryGroup=&quot;org.eclipse.ui.ide.severity&quot; markerContentGenerator=&quot;org.eclipse.ui.ide.problemsGenerator&quot; partName=&quot;Problems&quot;>&#xD;&#xA;&lt;expanded>&#xD;&#xA;&lt;category IMemento.internal.id=&quot;Warnings&quot;/>&#xD;&#xA;&lt;category IMemento.internal.id=&quot;Errors&quot;/>&#xD;&#xA;&lt;/expanded>&#xD;&#xA;&lt;columnWidths org.eclipse.ui.ide.locationField=&quot;90&quot; org.eclipse.ui.ide.markerType=&quot;90&quot; org.eclipse.ui.ide.pathField=&quot;120&quot; org.eclipse.ui.ide.resourceField=&quot;90&quot; org.eclipse.ui.ide.severityAndDescriptionField=&quot;778&quot;/>&#xD;&#xA;&lt;visible IMemento.internal.id=&quot;org.eclipse.ui.ide.severityAndDescriptionField&quot;/>&#xD;&#xA;&lt;visible IMemento.internal.id=&quot;org.eclipse.ui.ide.resourceField&quot;/>&#xD;&#xA;&lt;visible IMemento.internal.id=&quot;org.eclipse.ui.ide.pathField&quot;/>&#xD;&#xA;&lt;visible IMemento.internal.id=&quot;org.eclipse.ui.ide.locationField&quot;/>&#xD;&#xA;&lt;visible IMemento.internal.id=&quot;org.eclipse.ui.ide.markerType&quot;/>&#xD;&#xA;&lt;/view>"/>
<tags>View</tags>
<tags>categoryTag:General</tags>
@ -328,7 +318,7 @@
<tags>categoryTag:Java</tags>
</sharedElements>
<sharedElements xsi:type="basic:Part" xmi:id="_9QGDgN4HEeGVeZPPN-V-EA" elementId="org.eclipse.search.ui.views.SearchView" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Search" iconURI="platform:/plugin/org.eclipse.search//icons/full/eview16/searchres.gif" tooltip="" closeable="true">
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;view isPinned=&quot;false&quot;>&#xD;&#xA;&lt;view IMemento.internal.id=&quot;org.eclipse.search.text.FileSearchResultPage&quot; org.eclipse.search.lastActivation=&quot;2&quot; org.eclipse.search.resultpage.layout=&quot;2&quot; org.eclipse.search.resultpage.limit=&quot;1000&quot; org.eclipse.search.resultpage.sorting=&quot;2&quot;/>&#xD;&#xA;&lt;view IMemento.internal.id=&quot;org.eclipse.jdt.ui.JavaSearchResultPage&quot; org.eclipse.jdt.search.resultpage.grouping=&quot;3&quot; org.eclipse.jdt.search.resultpage.limit=&quot;1000&quot; org.eclipse.jdt.search.resultpage.limit_enabled=&quot;TRUE&quot; org.eclipse.jdt.search.resultpage.sorting=&quot;1&quot; org.eclipse.search.lastActivation=&quot;3&quot; org.eclipse.search.resultpage.layout=&quot;2&quot;/>&#xD;&#xA;&lt;view IMemento.internal.id=&quot;&quot; org.eclipse.search.lastActivation=&quot;0&quot;/>&#xD;&#xA;&lt;/view>"/>
<persistedState key="memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;view isPinned=&quot;false&quot;>&#xD;&#xA;&lt;view IMemento.internal.id=&quot;&quot; org.eclipse.search.lastActivation=&quot;0&quot;/>&#xD;&#xA;&lt;view IMemento.internal.id=&quot;org.eclipse.jdt.ui.JavaSearchResultPage&quot; org.eclipse.jdt.search.resultpage.grouping=&quot;3&quot; org.eclipse.jdt.search.resultpage.limit=&quot;1000&quot; org.eclipse.jdt.search.resultpage.limit_enabled=&quot;TRUE&quot; org.eclipse.jdt.search.resultpage.sorting=&quot;1&quot; org.eclipse.search.lastActivation=&quot;1&quot; org.eclipse.search.resultpage.layout=&quot;2&quot;/>&#xD;&#xA;&lt;/view>"/>
<tags>View</tags>
<tags>categoryTag:General</tags>
<menus xmi:id="_7bk4IOIIEeGXDvTwhqcV7A" elementId="org.eclipse.search.ui.views.SearchView">

View file

@ -0,0 +1,203 @@
--- ../src_base/common/net/minecraft/server/MinecraftServer.java
+++ ../src_work/common/net/minecraft/server/MinecraftServer.java
@@ -9,6 +9,7 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
+import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
@@ -58,6 +59,7 @@
import net.minecraft.src.WorldServerMulti;
import net.minecraft.src.WorldSettings;
import net.minecraft.src.WorldType;
+import net.minecraftforge.common.DimensionManager;
public abstract class MinecraftServer implements Runnable, IPlayerUsage, ICommandSender
{
@@ -81,6 +83,9 @@
private String hostname;
private int serverPort = -1;
public WorldServer[] dimensionServerList;
+ public List<WorldServer> worlds = new ArrayList<WorldServer>();
+ public Hashtable<Integer, long[]> worldTickTimes = new Hashtable<Integer, long[]>();
+ public int spawnProtectionSize = 16;
/** The ServerConfigurationManager instance. */
private ServerConfigurationManager serverConfigManager;
@@ -127,7 +132,7 @@
public final long[] tickTimeArray = new long[100];
/** stats are [dimension][tick%100] system.nanoTime is stored. */
- public long[][] timeOfLastDimenstionTick;
+ //public long[][] timeOfLastDimenstionTick;
private KeyPair serverKeyPair;
/** Username of the server owner (for integrated servers) */
@@ -194,8 +199,8 @@
{
this.convertMapIfNeeded(par1Str);
this.setUserMessage("menu.loadingLevel");
- this.dimensionServerList = new WorldServer[3];
- this.timeOfLastDimenstionTick = new long[this.dimensionServerList.length][100];
+ //this.dimensionServerList = new WorldServer[3];
+ //this.timeOfLastDimenstionTick = new long[this.dimensionServerList.length][100];
ISaveHandler var6 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
WorldInfo var8 = var6.loadWorldInfo();
WorldSettings var7;
@@ -214,46 +219,20 @@
var7.enableBonusChest();
}
- for (int var9 = 0; var9 < this.dimensionServerList.length; ++var9)
- {
- byte var10 = 0;
-
- if (var9 == 1)
- {
- var10 = -1;
- }
-
- if (var9 == 2)
- {
- var10 = 1;
- }
-
- if (var9 == 0)
- {
- if (this.isDemo())
- {
- this.dimensionServerList[var9] = new DemoWorldServer(this, var6, par2Str, var10, this.theProfiler);
- }
- else
- {
- this.dimensionServerList[var9] = new WorldServer(this, var6, par2Str, var10, var7, this.theProfiler);
- }
- }
- else
- {
- this.dimensionServerList[var9] = new WorldServerMulti(this, var6, par2Str, var10, var7, this.dimensionServerList[0], this.theProfiler);
- }
-
- this.dimensionServerList[var9].addWorldAccess(new WorldManager(this, this.dimensionServerList[var9]));
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, var6, par2Str, 0, theProfiler) : new WorldServer(this, var6, par2Str, 0, var7, theProfiler));
+ for (int dim : DimensionManager.getIDs())
+ {
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, var6, par2Str, dim, var7, overWorld, theProfiler));
+
+ world.addWorldAccess(new WorldManager(this, world));
if (!this.isSinglePlayer())
{
- this.dimensionServerList[var9].getWorldInfo().setGameType(this.getGameType());
- }
-
- this.serverConfigManager.setPlayerManager(this.dimensionServerList);
- }
-
+ world.getWorldInfo().setGameType(this.getGameType());
+ }
+ }
+
+ this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld });
this.setDifficultyForAllDimensions(this.getDifficulty());
this.initialWorldChunkLoad();
}
@@ -264,10 +243,10 @@
long var2 = System.currentTimeMillis();
this.setUserMessage("menu.generatingTerrain");
- for (int var4 = 0; var4 < 1; ++var4)
- {
- logger.info("Preparing start region for level " + var4);
- WorldServer var5 = this.dimensionServerList[var4];
+ for (Integer id : DimensionManager.getIDs())
+ {
+ logger.info("Preparing start region for level " + id);
+ WorldServer var5 = (WorldServer)DimensionManager.getWorld(id);
ChunkCoordinates var6 = var5.getSpawnPoint();
for (int var7 = -var1; var7 <= var1 && this.isServerRunning(); var7 += 16)
@@ -342,7 +321,7 @@
{
if (!this.worldIsBeingDeleted)
{
- WorldServer[] var2 = this.dimensionServerList;
+ WorldServer[] var2 = DimensionManager.getWorlds();
int var3 = var2.length;
for (int var4 = 0; var4 < var3; ++var4)
@@ -392,7 +371,7 @@
logger.info("Saving worlds");
this.saveAllDimensions(false);
- WorldServer[] var1 = this.dimensionServerList;
+ WorldServer[] var1 = DimensionManager.getWorlds();
int var2 = var1.length;
for (int var3 = 0; var3 < var2; ++var3)
@@ -440,7 +419,7 @@
FMLCommonHandler.instance().handleServerStarted();
long var1 = System.currentTimeMillis();
- FMLCommonHandler.instance().onWorldLoadTick(dimensionServerList);
+ FMLCommonHandler.instance().onWorldLoadTick(DimensionManager.getWorlds());
for (long var50 = 0L; this.serverShouldContinueRunning; this.serverIsRunning = true)
{
@@ -463,7 +442,7 @@
var50 += var7;
var1 = var5;
- if (this.dimensionServerList[0].areAllPlayersAsleep())
+ if (DimensionManager.getWorld(0).areAllPlayersAsleep())
{
this.tick();
var50 = 0L;
@@ -609,13 +588,13 @@
{
this.theProfiler.startSection("levels");
- for (int var1 = 0; var1 < this.dimensionServerList.length; ++var1)
+ for (Integer id : DimensionManager.getIDs())
{
long var2 = System.nanoTime();
- if (var1 == 0 || this.getAllowNether())
- {
- WorldServer var4 = this.dimensionServerList[var1];
+ if (id == 0 || this.getAllowNether())
+ {
+ WorldServer var4 = DimensionManager.getWorld(id);
this.theProfiler.startSection(var4.getWorldInfo().getWorldName());
if (this.tickCounter % 20 == 0)
@@ -651,7 +630,7 @@
}
}
- this.timeOfLastDimenstionTick[var1][this.tickCounter % 100] = System.nanoTime() - var2;
+ worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - var2;
}
this.theProfiler.endStartSection("connection");
@@ -700,7 +679,8 @@
public WorldServer worldServerForDimension(int par1)
{
- return par1 == -1 ? this.dimensionServerList[1] : (par1 == 1 ? this.dimensionServerList[2] : this.dimensionServerList[0]);
+ WorldServer ret = DimensionManager.getWorld(par1);
+ return (ret != null ? ret : DimensionManager.getWorld(0));
}
@SideOnly(Side.SERVER)
@@ -789,7 +769,7 @@
public String getServerModName()
{
- return "vanilla";
+ return "forge,fml";
}
/**

View file

@ -17,7 +17,7 @@
{
protected BlockTallGrass(int par1, int par2)
{
@@ -57,7 +62,7 @@
@@ -27,7 +32,7 @@
*/
public int idDropped(int par1, Random par2Random, int par3)
{
@ -26,7 +26,7 @@
}
/**
@@ -74,15 +79,7 @@
@@ -44,15 +49,7 @@
*/
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{

View file

@ -299,7 +299,7 @@
if (var4 < 0)
{
@@ -1225,6 +1282,15 @@
@@ -1227,6 +1284,15 @@
*/
public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
{
@ -315,7 +315,7 @@
int var5 = 0;
int var6;
@@ -1321,12 +1387,26 @@
@@ -1323,12 +1389,26 @@
}
this.generateHeightMap();

View file

@ -0,0 +1,10 @@
--- ../src_base/common/net/minecraft/src/DedicatedServer.java
+++ ../src_work/common/net/minecraft/src/DedicatedServer.java
@@ -66,6 +66,7 @@
this.setAllowFlight(this.settings.getOrSetBoolProperty("allow-flight", false));
this.setTexturePack(this.settings.getOrSetProperty("texture-pack", ""));
this.setMOTD(this.settings.getOrSetProperty("motd", "A Minecraft Server"));
+ spawnProtectionSize = this.settings.getOrSetIntProperty("spawn-protection-size", 16);
this.canSpawnStructures = this.settings.getOrSetBoolProperty("generate-structures", true);
int var2 = this.settings.getOrSetIntProperty("gamemode", EnumGameType.SURVIVAL.getID());
this.gameType = WorldSettings.getGameTypeById(var2);

View file

@ -416,7 +416,7 @@
}
}
@@ -717,12 +587,7 @@
@@ -718,12 +588,7 @@
}
else
{

View file

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/EntityPlayer.java
+++ ../src_work/common/net/minecraft/src/EntityPlayer.java
@@ -6,6 +6,13 @@
@@ -7,6 +7,14 @@
import java.util.Iterator;
import java.util.List;
@ -9,12 +9,13 @@
+import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.living.LivingHurtEvent;
+import net.minecraftforge.event.entity.player.AttackEntityEvent;
+import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
+import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
public abstract class EntityPlayer extends EntityLiving implements ICommandSender
{
@@ -220,6 +227,7 @@
@@ -222,6 +230,7 @@
if (var1 == this.itemInUse)
{
@ -22,7 +23,7 @@
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0)
{
this.updateItemUse(var1, 5);
@@ -624,7 +632,16 @@
@@ -627,7 +636,16 @@
*/
public EntityItem dropOneItem()
{
@ -40,7 +41,7 @@
}
/**
@@ -690,13 +707,21 @@
@@ -693,13 +711,21 @@
/**
* Returns how strong the player is against the specified block at this moment
@ -65,7 +66,7 @@
{
var2 += (float)(var3 * var3 + 1);
}
@@ -989,12 +1014,23 @@
@@ -992,12 +1018,23 @@
*/
protected void damageEntity(DamageSource par1DamageSource, int par2)
{
@ -90,7 +91,7 @@
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
this.addExhaustion(par1DamageSource.getHungerDamage());
this.health -= par2;
@@ -1029,6 +1065,10 @@
@@ -1032,6 +1069,10 @@
public boolean interactWith(Entity par1Entity)
{
@ -101,7 +102,7 @@
if (par1Entity.interact(this))
{
return true;
@@ -1072,7 +1112,9 @@
@@ -1075,7 +1116,9 @@
*/
public void destroyCurrentEquippedItem()
{
@ -111,11 +112,11 @@
}
/**
@@ -1101,6 +1143,15 @@
@@ -1104,6 +1147,15 @@
*/
public void attackTargetEntityWithCurrentItem(Entity par1Entity)
{
+ if (!ForgeHooks.onEntityInteract(this, par1Entity, true))
+ if (MinecraftForge.EVENT_BUS.post(new AttackEntityEvent(this, par1Entity)))
+ {
+ return;
+ }
@ -127,7 +128,7 @@
if (par1Entity.canAttackWithItem())
{
int var2 = this.inventory.getDamageVsEntity(par1Entity);
@@ -1244,6 +1295,12 @@
@@ -1247,6 +1299,12 @@
*/
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
{
@ -140,7 +141,7 @@
if (!this.worldObj.isRemote)
{
if (this.isPlayerSleeping() || !this.isEntityAlive())
@@ -1283,6 +1340,11 @@
@@ -1286,6 +1344,11 @@
{
int var9 = this.worldObj.getBlockMetadata(par1, par2, par3);
int var5 = BlockBed.getDirection(var9);
@ -152,7 +153,7 @@
float var10 = 0.5F;
float var7 = 0.5F;
@@ -1353,10 +1415,12 @@
@@ -1356,10 +1419,12 @@
ChunkCoordinates var4 = this.playerLocation;
ChunkCoordinates var5 = this.playerLocation;
@ -169,7 +170,7 @@
if (var5 == null)
{
@@ -1393,7 +1457,9 @@
@@ -1396,7 +1461,9 @@
*/
private boolean isInBed()
{
@ -180,7 +181,7 @@
}
/**
@@ -1408,13 +1474,15 @@
@@ -1411,13 +1478,15 @@
var2.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
var2.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
@ -198,7 +199,7 @@
return var3;
}
}
@@ -1428,8 +1496,11 @@
@@ -1431,8 +1500,11 @@
{
if (this.playerLocation != null)
{
@ -212,7 +213,7 @@
switch (var2)
{
@@ -1722,6 +1793,7 @@
@@ -1725,6 +1797,7 @@
return 101;
}
}

View file

@ -18,7 +18,7 @@
}
itemsList[256 + par1] = this;
@@ -651,4 +654,185 @@
@@ -650,4 +653,185 @@
{
StatList.initStats();
}

View file

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/ItemMap.java
+++ ../src_work/common/net/minecraft/src/ItemMap.java
@@ -87,7 +87,7 @@
@@ -88,7 +88,7 @@
byte var23 = 0;
byte var24 = 0;
byte var25 = 0;
@ -9,7 +9,7 @@
Chunk var27 = par1World.getChunkFromBlockCoords(var21, var22);
if (!var27.isEmpty())
@@ -186,7 +186,7 @@
@@ -187,7 +187,7 @@
var33 = 0;
var34 = 0;

View file

@ -1,15 +1,61 @@
--- ../src_base/common/net/minecraft/src/WorldServer.java
+++ ../src_work/common/net/minecraft/src/WorldServer.java
@@ -10,6 +10,8 @@
@@ -10,6 +10,9 @@
import java.util.Set;
import java.util.TreeSet;
import net.minecraft.server.MinecraftServer;
+import net.minecraftforge.common.DimensionManager;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.world.WorldEvent;
public class WorldServer extends World
{
@@ -689,6 +691,7 @@
@@ -70,6 +73,7 @@
{
this.pendingTickListEntries = new TreeSet();
}
+ DimensionManager.setWorld(par4, this);
}
/**
@@ -538,15 +542,27 @@
public List getAllTileEntityInBox(int par1, int par2, int par3, int par4, int par5, int par6)
{
ArrayList var7 = new ArrayList();
- Iterator var8 = this.loadedTileEntityList.iterator();
-
- while (var8.hasNext())
- {
- TileEntity var9 = (TileEntity)var8.next();
-
- if (var9.xCoord >= par1 && var9.yCoord >= par2 && var9.zCoord >= par3 && var9.xCoord < par4 && var9.yCoord < par5 && var9.zCoord < par6)
- {
- var7.add(var9);
+
+ for(int x = (par1 >> 4); x <= (par4 >> 4); x++)
+ {
+ for(int z = (par3 >> 4); z <= (par6 >> 4); z++)
+ {
+ Chunk chunk = getChunkFromChunkCoords(x, z);
+ if (chunk != null)
+ {
+ for(Object obj : chunk.chunkTileEntityMap.values())
+ {
+ TileEntity entity = (TileEntity)obj;
+ if (!entity.isInvalid())
+ {
+ if (entity.xCoord >= par1 && entity.yCoord >= par2 && entity.zCoord >= par3 &&
+ entity.xCoord <= par4 && entity.yCoord <= par5 && entity.zCoord <= par6)
+ {
+ var7.add(entity);
+ }
+ }
+ }
+ }
}
}
@@ -689,6 +705,7 @@
}
this.chunkProvider.saveChunks(par1, par2IProgressUpdate);

View file

@ -8,7 +8,7 @@
import org.lwjgl.LWJGLException;
import org.lwjgl.Sys;
@@ -2102,80 +2103,12 @@
@@ -2109,80 +2110,12 @@
if (this.objectMouseOver != null)
{
boolean var1 = this.thePlayer.capabilities.isCreativeMode;

View file

@ -0,0 +1,40 @@
--- ../src_base/minecraft/net/minecraft/src/GuiStatsComponent.java
+++ ../src_work/minecraft/net/minecraft/src/GuiStatsComponent.java
@@ -8,6 +8,7 @@
import java.text.DecimalFormat;
import javax.swing.JComponent;
import net.minecraft.server.MinecraftServer;
+import net.minecraftforge.common.DimensionManager;
@SideOnly(Side.SERVER)
public class GuiStatsComponent extends JComponent
@@ -41,6 +42,7 @@
*/
private void updateStats()
{
+ this.displayStrings = new String[5 + DimensionManager.getIDs().length];
long var1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.gc();
this.displayStrings[0] = "Memory use: " + var1 / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
@@ -51,14 +53,17 @@
if (this.field_79017_e.dimensionServerList != null)
{
- for (int var3 = 0; var3 < this.field_79017_e.dimensionServerList.length; ++var3)
+ int x = 0;
+ for (Integer id : DimensionManager.getIDs())
{
- this.displayStrings[5 + var3] = "Lvl " + var3 + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.timeOfLastDimenstionTick[var3]) * 1.0E-6D) + " ms";
+ this.displayStrings[5 + x] = "Lvl " + id + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.worldTickTimes.get(id)) * 1.0E-6D) + " ms";
- if (this.field_79017_e.dimensionServerList[var3] != null && this.field_79017_e.dimensionServerList[var3].theChunkProviderServer != null)
+ WorldServer world = DimensionManager.getWorld(id);
+ if (world != null && world.theChunkProviderServer != null)
{
- this.displayStrings[5 + var3] = this.displayStrings[5 + var3] + ", " + this.field_79017_e.dimensionServerList[var3].theChunkProviderServer.makeString();
+ this.displayStrings[5 + x] = this.displayStrings[5 + x] + ", " + world.theChunkProviderServer.makeString();
}
+ x++;
}
}

View file

@ -0,0 +1,67 @@
--- ../src_base/minecraft/net/minecraft/src/IntegratedServer.java
+++ ../src_work/minecraft/net/minecraft/src/IntegratedServer.java
@@ -6,6 +6,7 @@
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.server.MinecraftServer;
+import net.minecraftforge.common.DimensionManager;
public class IntegratedServer extends MinecraftServer
{
@@ -43,44 +44,22 @@
protected void loadAllDimensions(String par1Str, String par2Str, long par3, WorldType par5WorldType)
{
this.convertMapIfNeeded(par1Str);
- this.dimensionServerList = new WorldServer[3];
- this.timeOfLastDimenstionTick = new long[this.dimensionServerList.length][100];
ISaveHandler var6 = this.getActiveAnvilConverter().getSaveLoader(par1Str, true);
- for (int var7 = 0; var7 < this.dimensionServerList.length; ++var7)
- {
- byte var8 = 0;
-
- if (var7 == 1)
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, var6, par2Str, 0, theProfiler) : new WorldServer(this, var6, par2Str, 0, field_71350_m, theProfiler));
+ for (int dim : DimensionManager.getIDs())
+ {
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, var6, par2Str, dim, field_71350_m, overWorld, theProfiler));
+
+ world.addWorldAccess(new WorldManager(this, world));
+
+ if (!this.isSinglePlayer())
{
- var8 = -1;
+ world.getWorldInfo().setGameType(this.getGameType());
}
-
- if (var7 == 2)
- {
- var8 = 1;
- }
-
- if (var7 == 0)
- {
- if (this.isDemo())
- {
- this.dimensionServerList[var7] = new DemoWorldServer(this, var6, par2Str, var8, this.theProfiler);
- }
- else
- {
- this.dimensionServerList[var7] = new WorldServer(this, var6, par2Str, var8, this.field_71350_m, this.theProfiler);
- }
- }
- else
- {
- this.dimensionServerList[var7] = new WorldServerMulti(this, var6, par2Str, var8, this.field_71350_m, this.dimensionServerList[0], this.theProfiler);
- }
-
- this.dimensionServerList[var7].addWorldAccess(new WorldManager(this, this.dimensionServerList[var7]));
- this.getConfigurationManager().setPlayerManager(this.dimensionServerList);
- }
-
+ }
+
+ this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld });
this.setDifficultyForAllDimensions(this.getDifficulty());
this.initialWorldChunkLoad();
}

View file

@ -9,7 +9,7 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@@ -423,9 +425,8 @@
@@ -489,9 +491,8 @@
public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4)
{
Tessellator var5 = Tessellator.instance;
@ -21,7 +21,7 @@
float var9 = 0.5F;
float var10 = 1.0F;
float var11 = 0.8F;
@@ -1890,7 +1891,7 @@
@@ -1956,7 +1957,7 @@
double var30;
double var32;
@ -30,7 +30,7 @@
{
float var36 = 0.2F;
float var19 = 0.0625F;
@@ -1910,7 +1911,7 @@
@@ -1976,7 +1977,7 @@
var9 = var20;
}
@ -39,7 +39,7 @@
{
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
@@ -1922,7 +1923,7 @@
@@ -1988,7 +1989,7 @@
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
}
@ -48,7 +48,7 @@
{
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
@@ -1934,7 +1935,7 @@
@@ -2000,7 +2001,7 @@
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
}
@ -57,7 +57,7 @@
{
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15);
@@ -1946,7 +1947,7 @@
@@ -2012,7 +2013,7 @@
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
}
@ -66,7 +66,7 @@
{
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15);
@@ -1958,7 +1959,7 @@
@@ -2024,7 +2025,7 @@
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
}
@ -75,7 +75,7 @@
{
var20 = (double)par2 + 0.5D + 0.5D;
var22 = (double)par2 + 0.5D - 0.5D;
@@ -4142,7 +4143,7 @@
@@ -4208,7 +4209,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -84,7 +84,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4265,7 +4266,7 @@
@@ -4331,7 +4332,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
@ -93,7 +93,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4388,7 +4389,7 @@
@@ -4454,7 +4455,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -102,7 +102,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4511,7 +4512,7 @@
@@ -4577,7 +4578,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -111,7 +111,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4623,7 +4624,7 @@
@@ -4689,7 +4690,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -120,7 +120,7 @@
{
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -4639,7 +4640,7 @@
@@ -4705,7 +4706,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -129,7 +129,7 @@
{
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -4655,7 +4656,7 @@
@@ -4721,7 +4722,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -138,7 +138,7 @@
{
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -4671,7 +4672,7 @@
@@ -4737,7 +4738,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);

View file

@ -0,0 +1,40 @@
--- ../src_base/minecraft_server/net/minecraft/src/GuiStatsComponent.java
+++ ../src_work/minecraft_server/net/minecraft/src/GuiStatsComponent.java
@@ -9,6 +9,7 @@
import javax.swing.JComponent;
import javax.swing.Timer;
import net.minecraft.server.MinecraftServer;
+import net.minecraftforge.common.DimensionManager;
@SideOnly(Side.SERVER)
public class GuiStatsComponent extends JComponent
@@ -42,6 +43,7 @@
*/
private void updateStats()
{
+ this.displayStrings = new String[5 + DimensionManager.getIDs().length];
long var1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.gc();
this.displayStrings[0] = "Memory use: " + var1 / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
@@ -52,14 +54,17 @@
if (this.field_79017_e.dimensionServerList != null)
{
- for (int var3 = 0; var3 < this.field_79017_e.dimensionServerList.length; ++var3)
+ int x = 0;
+ for (Integer id : DimensionManager.getIDs())
{
- this.displayStrings[5 + var3] = "Lvl " + var3 + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.timeOfLastDimenstionTick[var3]) * 1.0E-6D) + " ms";
+ this.displayStrings[5 + x] = "Lvl " + id + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.worldTickTimes.get(id)) * 1.0E-6D) + " ms";
- if (this.field_79017_e.dimensionServerList[var3] != null && this.field_79017_e.dimensionServerList[var3].theChunkProviderServer != null)
+ WorldServer world = DimensionManager.getWorld(id);
+ if (world != null && world.theChunkProviderServer != null)
{
- this.displayStrings[5 + var3] = this.displayStrings[5 + var3] + ", " + this.field_79017_e.dimensionServerList[var3].theChunkProviderServer.makeString();
+ this.displayStrings[5 + x] = this.displayStrings[5 + x] + ", " + world.theChunkProviderServer.makeString();
}
+ x++;
}
}