Updated for MLMP 1.2.3 v1
This commit is contained in:
parent
5f7d00e6ba
commit
3d53e59d73
9 changed files with 64 additions and 70 deletions
|
@ -1,24 +1,17 @@
|
|||
--- ../src_base/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -5,6 +5,7 @@
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
+import java.io.UnsupportedEncodingException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
@@ -15,6 +16,9 @@
|
||||
@@ -16,6 +16,10 @@
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
+import net.minecraft.src.forge.MessageManager;
|
||||
+import net.minecraft.src.forge.packets.ForgePacket;
|
||||
+import java.io.UnsupportedEncodingException;
|
||||
|
||||
public class NetClientHandler extends NetHandler
|
||||
{
|
||||
@@ -46,6 +50,8 @@
|
||||
@@ -47,6 +51,8 @@
|
||||
this.mc = par1Minecraft;
|
||||
Socket var4 = new Socket(InetAddress.getByName(par2Str), par3);
|
||||
this.netManager = new NetworkManager(var4, "Client", this);
|
||||
|
@ -27,7 +20,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +79,29 @@
|
||||
@@ -74,6 +80,29 @@
|
||||
this.mc.thePlayer.entityId = par1Packet1Login.protocolVersion;
|
||||
this.currentServerMaxPlayers = par1Packet1Login.maxPlayers;
|
||||
((PlayerControllerMP)this.mc.playerController).setCreative(par1Packet1Login.serverMode == 1);
|
||||
|
@ -57,7 +50,7 @@
|
|||
}
|
||||
|
||||
public void handlePickupSpawn(Packet21PickupSpawn par1Packet21PickupSpawn)
|
||||
@@ -630,7 +659,19 @@
|
||||
@@ -674,7 +703,19 @@
|
||||
}
|
||||
else if (par1Packet2Handshake.username.equals("-"))
|
||||
{
|
||||
|
@ -78,7 +71,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
@@ -643,7 +684,19 @@
|
||||
@@ -687,7 +728,19 @@
|
||||
|
||||
if (var6.equalsIgnoreCase("ok"))
|
||||
{
|
||||
|
@ -99,7 +92,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
@@ -1074,4 +1127,44 @@
|
||||
@@ -1122,4 +1175,44 @@
|
||||
{
|
||||
this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId));
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -42,11 +43,13 @@
|
||||
@@ -43,11 +44,13 @@
|
||||
import net.minecraft.src.ThreadServerApplication;
|
||||
import net.minecraft.src.ThreadServerSleep;
|
||||
import net.minecraft.src.Vec3D;
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
public class MinecraftServer implements Runnable, ICommandListener, IServer
|
||||
{
|
||||
@@ -67,9 +70,10 @@
|
||||
@@ -68,9 +71,10 @@
|
||||
public PropertyManager propertyManagerObj;
|
||||
|
||||
/** The server world manager. */
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
/** the server config manager for this server */
|
||||
public ServerConfigurationManager configManager;
|
||||
@@ -97,7 +101,7 @@
|
||||
@@ -98,7 +102,7 @@
|
||||
|
||||
/** A list containing all the commands entered. */
|
||||
private List commands = Collections.synchronizedList(new ArrayList());
|
||||
|
@ -44,7 +44,7 @@
|
|||
|
||||
/** True if the server is in online mode. */
|
||||
public boolean onlineMode;
|
||||
@@ -189,9 +193,11 @@
|
||||
@@ -191,9 +195,11 @@
|
||||
}
|
||||
|
||||
this.configManager = new ServerConfigurationManager(this);
|
||||
|
@ -56,7 +56,7 @@
|
|||
long var3 = System.nanoTime();
|
||||
String var5 = this.propertyManagerObj.getStringProperty("level-name", "world");
|
||||
String var6 = this.propertyManagerObj.getStringProperty("level-seed", "");
|
||||
@@ -257,53 +263,36 @@
|
||||
@@ -259,53 +265,36 @@
|
||||
logger.info("Converting map!");
|
||||
par1ISaveFormat.convertMapFormat(par2Str, new ConvertProgressUpdater(this));
|
||||
}
|
||||
|
@ -126,7 +126,7 @@
|
|||
ChunkCoordinates var15 = var14.getSpawnPoint();
|
||||
|
||||
for (int var16 = -var22; var16 <= var22 && this.serverRunning; var16 += 16)
|
||||
@@ -364,9 +353,9 @@
|
||||
@@ -366,9 +355,9 @@
|
||||
{
|
||||
logger.info("Saving chunks");
|
||||
|
||||
|
@ -138,7 +138,7 @@
|
|||
var2.saveWorld(true, (IProgressUpdate)null);
|
||||
var2.func_30006_w();
|
||||
}
|
||||
@@ -384,13 +373,14 @@
|
||||
@@ -386,13 +375,14 @@
|
||||
this.configManager.savePlayerStates();
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -431,7 +421,7 @@
|
||||
@@ -434,7 +424,7 @@
|
||||
var3 += var7;
|
||||
var1 = var5;
|
||||
|
||||
|
@ -164,7 +164,7 @@
|
|||
{
|
||||
this.doTick();
|
||||
var3 = 0L;
|
||||
@@ -532,13 +522,13 @@
|
||||
@@ -535,13 +525,13 @@
|
||||
Vec3D.initialize();
|
||||
++this.deathTime;
|
||||
|
||||
|
@ -181,7 +181,7 @@
|
|||
|
||||
if (this.deathTime % 20 == 0)
|
||||
{
|
||||
@@ -557,15 +547,15 @@
|
||||
@@ -560,15 +550,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@
|
|||
}
|
||||
|
||||
for (var9 = 0; var9 < this.playersOnline.size(); ++var9)
|
||||
@@ -679,7 +669,8 @@
|
||||
@@ -682,7 +672,8 @@
|
||||
*/
|
||||
public WorldServer getWorldManager(int par1)
|
||||
{
|
||||
|
@ -210,7 +210,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -687,7 +678,7 @@
|
||||
@@ -690,7 +681,7 @@
|
||||
*/
|
||||
public EntityTracker getEntityTracker(int par1)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
+
|
||||
+ if (delayBeforeCanPickup == 0 && !ForgeHooks.onItemPickup(par1EntityPlayer, this))
|
||||
+ {
|
||||
+ ModLoader.onItemPickup(par1EntityPlayer, item);
|
||||
+ ModLoader.OnItemPickup(par1EntityPlayer, item);
|
||||
+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
+ par1EntityPlayer.onItemPickup(this, var2);
|
||||
+ if (item.stackSize <= 0)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft_server/net/minecraft/src/EntityTrackerEntry.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/EntityTrackerEntry.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -5,6 +5,8 @@
|
||||
@@ -6,6 +6,8 @@
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
|||
public class EntityTrackerEntry
|
||||
{
|
||||
/** The entity that this EntityTrackerEntry tracks. */
|
||||
@@ -286,6 +288,11 @@
|
||||
@@ -287,6 +289,11 @@
|
||||
{
|
||||
System.out.println("Fetching addPacket for removed entity");
|
||||
}
|
||||
|
@ -19,5 +19,5 @@
|
|||
+ return pkt;
|
||||
+ }
|
||||
|
||||
if (this.trackedEntity instanceof EntityItem)
|
||||
{
|
||||
EntityTrackerEntry2 var1 = ModLoaderMp.HandleEntityTrackerEntries(this.trackedEntity);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- ../src_base/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -10,6 +10,9 @@
|
||||
@@ -27,6 +27,9 @@
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
@ -10,10 +10,10 @@
|
|||
|
||||
public final class ModLoader
|
||||
{
|
||||
@@ -626,6 +629,17 @@
|
||||
readFromClassPath(file);
|
||||
@@ -675,6 +678,17 @@
|
||||
readFromModFolder(modDir);
|
||||
readFromClassPath(var17);
|
||||
System.out.println("Done.");
|
||||
props.setProperty("loggingLevel", cfgLoggingLevel.getName());
|
||||
+ /*
|
||||
+ * Gather up a list of network mods and assign them an id
|
||||
+ */
|
||||
|
@ -25,27 +25,27 @@
|
|||
+ ForgeHooks.networkMods.put(x++, (NetworkMod)mod);
|
||||
+ }
|
||||
+ }
|
||||
Iterator iterator = modList.iterator();
|
||||
do
|
||||
{
|
||||
@@ -793,9 +807,10 @@
|
||||
logger.fine("Initialized");
|
||||
}
|
||||
long l = 0L;
|
||||
- if (minecraftserver.worldMngr != null && minecraftserver.worldMngr[0] != null)
|
||||
props.setProperty("loggingLevel", cfgLoggingLevel.getName());
|
||||
Iterator var19 = modList.iterator();
|
||||
|
||||
@@ -838,9 +852,10 @@
|
||||
|
||||
long var1 = 0L;
|
||||
|
||||
- if (var0.worldMngr != null && var0.worldMngr[0] != null)
|
||||
+ WorldServer world = (WorldServer)DimensionManager.getWorld(0);
|
||||
+ if (world != null)
|
||||
{
|
||||
- l = minecraftserver.worldMngr[0].getWorldTime();
|
||||
+ l = world.getWorldTime();
|
||||
Iterator iterator = inGameHooks.entrySet().iterator();
|
||||
do
|
||||
- var1 = var0.worldMngr[0].getWorldTime();
|
||||
+ var1 = world.getWorldTime();
|
||||
Iterator var3 = inGameHooks.entrySet().iterator();
|
||||
|
||||
while (var3.hasNext())
|
||||
@@ -1385,6 +1400,7 @@
|
||||
{
|
||||
@@ -1325,6 +1340,7 @@
|
||||
{
|
||||
method_getNextWindowId.invoke(entityplayermp, new Object[0]);
|
||||
int j = field_currentWindowId.getInt(entityplayermp);
|
||||
+ entityplayermp.closeCraftingGui();
|
||||
entityplayermp.playerNetServerHandler.sendPacket(new Packet100OpenWindow(j, i, iinventory.getInvName(), iinventory.getSizeInventory()));
|
||||
entityplayermp.craftingInventory = container;
|
||||
entityplayermp.craftingInventory.windowId = j;
|
||||
method_getNextWindowId.invoke(var4, new Object[0]);
|
||||
int var5 = field_currentWindowId.getInt(var4);
|
||||
+ var4.closeCraftingGui();
|
||||
var4.playerNetServerHandler.sendPacket(new Packet100OpenWindow(var5, var1, var2.getInvName(), var2.getSizeInventory()));
|
||||
var4.craftingInventory = var3;
|
||||
var4.craftingInventory.windowId = var5;
|
||||
|
|
|
@ -1,25 +1,26 @@
|
|||
--- ../src_base/minecraft_server/net/minecraft/src/ModLoaderMp.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ModLoaderMp.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -6,6 +6,7 @@
|
||||
import java.util.*;
|
||||
@@ -16,6 +16,7 @@
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.src.forge.DimensionManager;
|
||||
|
||||
public class ModLoaderMp
|
||||
{
|
||||
@@ -220,12 +221,11 @@
|
||||
@@ -231,13 +232,11 @@
|
||||
|
||||
public static World GetPlayerWorld(EntityPlayer entityplayer)
|
||||
public static World GetPlayerWorld(EntityPlayer var0)
|
||||
{
|
||||
- WorldServer aworldserver[] = ModLoader.getMinecraftServerInstance().worldMngr;
|
||||
- for (int i = 0; i < aworldserver.length; i++)
|
||||
- WorldServer[] var1 = ModLoader.getMinecraftServerInstance().worldMngr;
|
||||
-
|
||||
- for (int var2 = 0; var2 < var1.length; ++var2)
|
||||
+ for (World world : DimensionManager.getWorlds())
|
||||
{
|
||||
- if (((World) (aworldserver[i])).playerEntities.contains(entityplayer))
|
||||
+ if (world.playerEntities.contains(entityplayer))
|
||||
- if (var1[var2].playerEntities.contains(var0))
|
||||
+ if (world.playerEntities.contains(var0))
|
||||
{
|
||||
- return aworldserver[i];
|
||||
- return var1[var2];
|
||||
+ return world;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -163,6 +167,38 @@
|
||||
@@ -163,7 +167,37 @@
|
||||
}
|
||||
|
||||
var2.func_20057_k();
|
||||
+
|
||||
- ModLoaderMp.HandleAllLogins(var2);
|
||||
+ if (packet1login.serverMode == ForgePacket.FORGE_ID)
|
||||
+ {
|
||||
+ //Pretty hackish place to put it, but it needs to go somewhere
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
{
|
||||
this.playerEntity.itemInWorldManager.activeBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8);
|
||||
}
|
||||
@@ -950,4 +956,49 @@
|
||||
@@ -954,4 +960,49 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
public class SlotCrafting extends Slot
|
||||
{
|
||||
/** The craft matrix inventory linked to this result slot. */
|
||||
@@ -87,6 +89,7 @@
|
||||
{
|
||||
this.thePlayer.addStat(AchievementList.bookcase, 1);
|
||||
@@ -89,6 +91,7 @@
|
||||
}
|
||||
|
||||
ModLoader.TakenFromCrafting(this.thePlayer, par1ItemStack);
|
||||
+ ForgeHooks.onTakenFromCrafting(thePlayer, par1ItemStack, craftMatrix);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue