Initial patch update to FML and MC 1.2.5

This commit is contained in:
LexManos 2012-04-06 02:02:53 -07:00
parent 7c148ffa60
commit ab927fce55
31 changed files with 281 additions and 277 deletions

View file

@ -1,13 +1,13 @@
package net.minecraft.src.forge;
import net.minecraft.src.BaseModMp;
import net.minecraft.src.BaseMod;
/**
* This is for mods that are designed to be used on the server side alone,
* or both the client and server side. This class is used when registering
* various things relating to network traffic. Entity ID's, GUI Id's, etc..
*/
public abstract class NetworkMod extends BaseModMp
public abstract class NetworkMod extends BaseMod
{
/**
* Returns true if every client is required to have this
@ -22,9 +22,4 @@ public abstract class NetworkMod extends BaseModMp
* @return True if server is required, false if not.
*/
public abstract boolean serverSideRequired();
public boolean hasClientSide()
{
return clientSideRequired();
}
}

View file

@ -21,6 +21,14 @@ public class mod_MinecraftForge extends NetworkMod
public void load()
{
MinecraftForge.getDungeonLootTries(); //Random thing to make things Initialize
int x = 0;
for (BaseMod mod : ModLoader.getLoadedMods())
{
if (mod instanceof NetworkMod)
{
ForgeHooks.networkMods.put(x++, (NetworkMod)mod);
}
}
}
@Override

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
@@ -1972,86 +1972,54 @@
@@ -1949,86 +1949,54 @@
*/
public void usePortal(int par1)
{

View file

@ -75,12 +75,12 @@
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
par2EntityPlayer.addExhaustion(0.025F);
- if (this.func_50074_q() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
+ if (canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
{
ItemStack var8 = this.createStackedBlock(par6);
@@ -1051,6 +1051,396 @@
@@ -1054,6 +1054,396 @@
*/
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {}

View file

@ -172,7 +172,7 @@
}
public BiomeGenBase func_48490_a(int par1, int par2, WorldChunkManager par3WorldChunkManager)
@@ -1434,4 +1463,18 @@
@@ -1435,4 +1464,18 @@
}
}
}

View file

@ -9,7 +9,7 @@
/** Number of ticks since this EntityLiving last produced its sound */
private int livingSoundTime;
@@ -1330,7 +1330,7 @@
@@ -1333,7 +1333,7 @@
int var2 = MathHelper.floor_double(this.boundingBox.minY);
int var3 = MathHelper.floor_double(this.posZ);
int var4 = this.worldObj.getBlockId(var1, var2, var3);

View file

@ -12,11 +12,12 @@
{
public EntityMooshroom(World par1World)
{
@@ -21,27 +25,6 @@
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bowlSoup));
return true;
@@ -30,32 +34,7 @@
return true;
}
}
- else if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0)
-
- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0)
- {
- this.setDead();
- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D);
@ -37,10 +38,15 @@
-
- return true;
- }
else
{
return super.interact(par1EntityPlayer);
@@ -55,4 +38,29 @@
- else
- {
- return super.interact(par1EntityPlayer);
- }
+ return super.interact(par1EntityPlayer);
}
/**
@@ -65,4 +44,29 @@
{
return new EntityMooshroom(this.worldObj);
}

View file

@ -36,7 +36,7 @@
float var4 = 70.0F;
if (par2)
@@ -1102,8 +1111,11 @@
@@ -1095,8 +1104,11 @@
var20 = (EntityPlayer)var4;
GL11.glDisable(GL11.GL_ALPHA_TEST);
Profiler.endStartSection("outline");
@ -50,7 +50,7 @@
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
}
@@ -1167,8 +1179,12 @@
@@ -1160,8 +1172,12 @@
var20 = (EntityPlayer)var4;
GL11.glDisable(GL11.GL_ALPHA_TEST);
Profiler.endStartSection("outline");
@ -65,7 +65,7 @@
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
@@ -1192,6 +1208,9 @@
@@ -1185,6 +1201,9 @@
this.setupFog(1, par1);
GL11.glPopMatrix();
}

View file

@ -92,42 +92,51 @@
{
super.keyTyped(par1, par2);
}
@@ -107,37 +81,9 @@
@@ -107,47 +81,8 @@
public void drawScreen(int par1, int par2, float par3)
{
this.drawDefaultBackground();
- this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
- int var4 = this.func_20080_j();
- int var5 = 0;
-
- for (int var5 = 0; var5 < this.options.keyBindings.length; ++var5)
- while (var5 < this.options.keyBindings.length)
- {
- boolean var6 = false;
- int var7 = 0;
-
- for (int var7 = 0; var7 < this.options.keyBindings.length; ++var7)
- while (true)
- {
- if (var7 != var5 && this.options.keyBindings[var5].keyCode == this.options.keyBindings[var7].keyCode)
- if (var7 < this.options.keyBindings.length)
- {
- if (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode)
- {
- ++var7;
- continue;
- }
-
- var6 = true;
- }
- }
-
- if (this.buttonId == var5)
- {
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7f> \u00a7e??? \u00a7f<";
- }
- else if (var6)
- {
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7c" + this.options.getOptionDisplayString(var5);
- }
- else
- {
- ((GuiButton)this.controlList.get(var5)).displayString = this.options.getOptionDisplayString(var5);
- }
- if (this.buttonId == var5)
- {
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7f> \u00a7e??? \u00a7f<";
- }
- else if (var6)
- {
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7c" + this.options.getOptionDisplayString(var5);
- }
- else
- {
- ((GuiButton)this.controlList.get(var5)).displayString = this.options.getOptionDisplayString(var5);
- }
-
- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1);
- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1);
- ++var5;
- break;
- }
- }
-
+
+ scrollPane.drawScreen(par1, par2, par3);
+ drawCenteredString(fontRenderer, screenTitle, width / 2, 4, 0xffffff);
super.drawScreen(par1, par2, par3);

View file

@ -9,10 +9,10 @@
public class GuiIngame extends Gui
{
private static RenderItem itemRenderer = new RenderItem();
@@ -140,7 +142,19 @@
@@ -142,7 +144,19 @@
int var50 = var7 - 39;
var22 = var50 - 10;
var46 = var7 - 39;
var22 = var46 - 10;
- var23 = this.mc.thePlayer.getTotalArmorValue();
+ var23 = 0;
+ for (int x = 0; x < mc.thePlayer.inventory.armorInventory.length; x++)

View file

@ -1,6 +1,6 @@
--- ../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
@@ -16,6 +16,10 @@
@@ -15,6 +15,10 @@
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
@ -11,7 +11,7 @@
public class NetClientHandler extends NetHandler
{
@@ -47,6 +51,8 @@
@@ -46,6 +50,8 @@
this.mc = par1Minecraft;
Socket var4 = new Socket(InetAddress.getByName(par2Str), par3);
this.netManager = new NetworkManager(var4, "Client", this);
@ -20,12 +20,13 @@
}
/**
@@ -74,6 +80,29 @@
@@ -73,6 +79,30 @@
this.mc.thePlayer.entityId = par1Packet1Login.protocolVersion;
this.currentServerMaxPlayers = par1Packet1Login.maxPlayers;
((PlayerControllerMP)this.mc.playerController).setCreative(par1Packet1Login.serverMode == 1);
+
+ ForgeHooks.onLogin(netManager, par1Packet1Login);
+
+
+ String[] channels = MessageManager.getInstance().getRegisteredChannels(netManager);
+ StringBuilder tmp = new StringBuilder();
+ tmp.append("Forge");
@ -47,10 +48,10 @@
+ pkt.length = pkt.data.length;
+ addToSendQueue(pkt);
+
ModLoader.serverLogin(this, par1Packet1Login);
ModLoader.serverConnect(this, par1Packet1Login);
}
@@ -587,8 +616,12 @@
@@ -545,8 +575,12 @@
public void handleChat(Packet3Chat par1Packet3Chat)
{
@ -65,7 +66,7 @@
}
public void handleAnimation(Packet18Animation par1Packet18Animation)
@@ -675,7 +708,19 @@
@@ -633,7 +667,19 @@
}
else if (par1Packet2Handshake.username.equals("-"))
{
@ -86,7 +87,7 @@
}
else
{
@@ -688,7 +733,19 @@
@@ -646,7 +692,19 @@
if (var6.equalsIgnoreCase("ok"))
{
@ -107,7 +108,7 @@
}
else
{
@@ -1156,5 +1213,40 @@
@@ -1114,5 +1172,40 @@
public void handleCustomPayload(Packet250CustomPayload var1)
{
ModLoader.receivePacket(var1);

View file

@ -15,7 +15,7 @@
- boolean var8 = var5.setBlockWithNotify(par1, par2, par3, 0);
+ boolean var8 = var6.removeBlockByPlayer(var5, mc.thePlayer, par1, par2, par3);
if (var6 != null && var8)
if (var8)
{
@@ -86,6 +87,7 @@
if (var5.stackSize == 0)

View file

@ -41,16 +41,7 @@
{
this.furnaceItemStacks[2].stackSize += var1.stackSize;
}
@@ -322,7 +328,7 @@
* Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
* fuel
*/
- private int getItemBurnTime(ItemStack par1ItemStack)
+ public int getItemBurnTime(ItemStack par1ItemStack)
{
if (par1ItemStack == null)
{
@@ -346,4 +352,18 @@
@@ -351,4 +357,18 @@
public void openChest() {}
public void closeChest() {}

View file

@ -28,7 +28,7 @@
}
/**
@@ -2066,7 +2069,7 @@
@@ -2067,7 +2070,7 @@
if (var7 != null)
{
@ -37,7 +37,7 @@
}
}
}
@@ -2096,18 +2099,18 @@
@@ -2097,18 +2100,18 @@
{
this.loadedTileEntityList.add(var8);
}
@ -60,7 +60,7 @@
}
}
@@ -2120,13 +2123,13 @@
@@ -2121,13 +2124,13 @@
public void addTileEntity(Collection par1Collection)
{
@ -80,7 +80,7 @@
}
}
@@ -2148,7 +2151,7 @@
@@ -2149,7 +2152,7 @@
int var4 = MathHelper.floor_double(par1Entity.posZ);
byte var5 = 32;
@ -89,7 +89,7 @@
{
par1Entity.lastTickPosX = par1Entity.posX;
par1Entity.lastTickPosY = par1Entity.posY;
@@ -2325,7 +2328,14 @@
@@ -2326,7 +2329,14 @@
if (var11 == Block.fire.blockID || var11 == Block.lavaMoving.blockID || var11 == Block.lavaStill.blockID)
{
return true;
@ -105,7 +105,7 @@
}
}
}
@@ -2629,25 +2639,19 @@
@@ -2630,25 +2640,19 @@
*/
public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
{
@ -143,7 +143,7 @@
}
}
@@ -2656,27 +2660,10 @@
@@ -2657,27 +2661,10 @@
*/
public void removeBlockTileEntity(int par1, int par2, int par3)
{
@ -174,7 +174,7 @@
}
}
@@ -2702,7 +2689,8 @@
@@ -2703,7 +2690,8 @@
*/
public boolean isBlockNormalCube(int par1, int par2, int par3)
{
@ -184,7 +184,7 @@
}
/**
@@ -2983,6 +2971,7 @@
@@ -2984,6 +2972,7 @@
}
}
}
@ -192,7 +192,7 @@
Profiler.endSection();
@@ -3305,7 +3294,7 @@
@@ -3307,7 +3296,7 @@
private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6)
{
@ -201,7 +201,7 @@
int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6;
int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6;
int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6;
@@ -3837,7 +3826,10 @@
@@ -3839,7 +3828,10 @@
{
var8 = null;
}
@ -213,7 +213,7 @@
return par1 > 0 && var8 == null && var9.canPlaceBlockOnSide(this, par2, par3, par4, par6);
}
}
@@ -4441,4 +4433,39 @@
@@ -4443,4 +4435,39 @@
{
return this.worldInfo.getTerrainType() == WorldType.FLAT ? 0.0D : 63.0D;
}

View file

@ -8,7 +8,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Random;
@@ -43,11 +44,13 @@
@@ -44,11 +45,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
{
@@ -68,9 +71,10 @@
@@ -69,9 +72,10 @@
public PropertyManager propertyManagerObj;
/** The server world manager. */
@ -35,7 +35,7 @@
/** the server config manager for this server */
public ServerConfigurationManager configManager;
@@ -98,7 +102,7 @@
@@ -99,7 +103,7 @@
/** A list containing all the commands entered. */
private List commands = Collections.synchronizedList(new ArrayList());
@ -44,9 +44,9 @@
/** True if the server is in online mode. */
public boolean onlineMode;
@@ -193,9 +197,11 @@
}
@@ -195,9 +199,11 @@
FMLServerHandler.instance().onLoadComplete();
this.configManager = new ServerConfigurationManager(this);
+ /*
this.entityTracker[0] = new EntityTracker(this, 0);
@ -56,7 +56,7 @@
long var3 = System.nanoTime();
String var5 = this.propertyManagerObj.getStringProperty("level-name", "world");
String var6 = this.propertyManagerObj.getStringProperty("level-seed", "");
@@ -261,53 +267,36 @@
@@ -265,53 +271,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)
@@ -368,9 +357,9 @@
@@ -372,9 +361,9 @@
{
logger.info("Saving chunks");
@ -138,7 +138,7 @@
var2.saveWorld(true, (IProgressUpdate)null);
var2.func_30006_w();
}
@@ -388,13 +377,14 @@
@@ -392,13 +381,14 @@
this.configManager.savePlayerStates();
}
@ -155,7 +155,7 @@
}
}
}
@@ -436,7 +426,7 @@
@@ -440,7 +430,7 @@
var3 += var7;
var1 = var5;
@ -164,7 +164,7 @@
{
this.doTick();
var3 = 0L;
@@ -537,13 +527,13 @@
@@ -542,13 +532,13 @@
Vec3D.initialize();
++this.deathTime;
@ -181,7 +181,7 @@
if (this.deathTime % 20 == 0)
{
@@ -562,15 +552,15 @@
@@ -567,15 +557,15 @@
}
}
@ -200,7 +200,7 @@
}
for (var9 = 0; var9 < this.playersOnline.size(); ++var9)
@@ -684,7 +674,8 @@
@@ -689,7 +679,8 @@
*/
public WorldServer getWorldManager(int par1)
{
@ -210,7 +210,7 @@
}
/**
@@ -692,7 +683,7 @@
@@ -697,7 +688,7 @@
*/
public EntityTracker getEntityTracker(int par1)
{

View file

@ -63,12 +63,12 @@
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
par2EntityPlayer.addExhaustion(0.025F);
- if (this.func_50008_h() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
+ if (canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
{
ItemStack var8 = this.createStackedBlock(par6);
@@ -967,6 +969,396 @@
@@ -970,6 +972,396 @@
*/
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {}

View file

@ -1,15 +1,15 @@
--- ../src_base/minecraft_server/net/minecraft/src/ChunkProviderServer.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/ChunkProviderServer.java 0000-00-00 00:00:00.000000000 -0000
@@ -7,6 +7,8 @@
import java.util.List;
import java.util.Set;
@@ -9,6 +9,8 @@
import cpw.mods.fml.server.FMLServerHandler;
+import net.minecraft.src.forge.ForgeHooks;
+
public class ChunkProviderServer implements IChunkProvider
{
private Set droppedChunksSet = new HashSet();
@@ -49,6 +51,11 @@
@@ -51,6 +53,11 @@
public void dropChunk(int par1, int par2)
{

View file

@ -9,100 +9,100 @@
public class ConsoleCommandHandler
{
@@ -52,9 +54,9 @@
var5.savePlayerStates();
@@ -55,9 +57,9 @@
var8.savePlayerStates();
}
- for (var6 = 0; var6 < this.minecraftServer.worldMngr.length; ++var6)
- for (var9 = 0; var9 < this.minecraftServer.worldMngr.length; ++var9)
+ for (World world : DimensionManager.getWorlds())
{
- var7 = this.minecraftServer.worldMngr[var6];
+ var7 = (WorldServer)world;
boolean var8 = var7.levelSaving;
var7.levelSaving = false;
var7.saveWorld(true, (IProgressUpdate)null);
@@ -67,20 +69,18 @@
- var10 = this.minecraftServer.worldMngr[var9];
+ var10 = (WorldServer)world;
boolean var11 = var10.levelSaving;
var10.levelSaving = false;
var10.saveWorld(true, (IProgressUpdate)null);
@@ -70,20 +72,18 @@
{
this.sendNoticeToOps(var4, "Disabling level saving..");
this.sendNoticeToOps(var7, "Disabling level saving..");
- for (var6 = 0; var6 < this.minecraftServer.worldMngr.length; ++var6)
- for (var9 = 0; var9 < this.minecraftServer.worldMngr.length; ++var9)
+ for (World world : DimensionManager.getWorlds())
{
- var7 = this.minecraftServer.worldMngr[var6];
- var7.levelSaving = true;
- var10 = this.minecraftServer.worldMngr[var9];
- var10.levelSaving = true;
+ ((WorldServer)world).levelSaving = true;
}
}
else if (var2.toLowerCase().startsWith("save-on"))
else if (var4.equalsIgnoreCase("save-on"))
{
this.sendNoticeToOps(var4, "Enabling level saving..");
this.sendNoticeToOps(var7, "Enabling level saving..");
- for (var6 = 0; var6 < this.minecraftServer.worldMngr.length; ++var6)
- for (var9 = 0; var9 < this.minecraftServer.worldMngr.length; ++var9)
+ for (World world : DimensionManager.getWorlds())
{
- var7 = this.minecraftServer.worldMngr[var6];
- var7.levelSaving = false;
- var10 = this.minecraftServer.worldMngr[var9];
- var10.levelSaving = false;
+ ((WorldServer)world).levelSaving = false;
}
}
else
@@ -356,20 +356,18 @@
else if (var4.equalsIgnoreCase("op"))
@@ -330,20 +330,18 @@
if ("add".equalsIgnoreCase(var20))
{
- for (var19 = 0; var19 < this.minecraftServer.worldMngr.length; ++var19)
+ for (World world : DimensionManager.getWorlds())
{
- var23 = this.minecraftServer.worldMngr[var19];
- var23.advanceTime(var23.getWorldTime() + (long)var18);
+ world.advanceTime(world.getWorldTime() + (long)var18);
}
if ("add".equalsIgnoreCase(var19))
{
- for (var21 = 0; var21 < this.minecraftServer.worldMngr.length; ++var21)
+ for (World world : DimensionManager.getWorlds())
{
- var24 = this.minecraftServer.worldMngr[var21];
- var24.advanceTime(var24.getWorldTime() + (long)var23);
+ world.advanceTime(world.getWorldTime() + (long)var23);
}
this.sendNoticeToOps(var4, "Added " + var18 + " to time");
}
else if ("set".equalsIgnoreCase(var20))
{
- for (var19 = 0; var19 < this.minecraftServer.worldMngr.length; ++var19)
+ for (World world : DimensionManager.getWorlds())
{
- var23 = this.minecraftServer.worldMngr[var19];
- var23.advanceTime((long)var18);
+ world.advanceTime((long)var18);
}
this.sendNoticeToOps(var7, "Added " + var23 + " to time");
}
else if ("set".equalsIgnoreCase(var19))
{
- for (var21 = 0; var21 < this.minecraftServer.worldMngr.length; ++var21)
+ for (World world : DimensionManager.getWorlds())
{
- var24 = this.minecraftServer.worldMngr[var21];
- var24.advanceTime((long)var23);
+ world.advanceTime((long)var23);
}
this.sendNoticeToOps(var4, "Set time to " + var18);
@@ -387,8 +385,12 @@
else if (var2.toLowerCase().startsWith("say "))
{
var2 = var2.substring(var2.indexOf(" ")).trim();
- minecraftLogger.info("[" + var4 + "] " + var2);
- var5.sendPacketToAllPlayers(new Packet3Chat("\u00a7d[Server] " + var2));
+ var2 = ForgeHooks.onServerCommandSay(var3, var3.getUsername(), var2);
+ if (var2 != null)
+ {
+ minecraftLogger.info("[" + var4 + "] " + var2);
+ var5.sendPacketToAllPlayers(new Packet3Chat("\u00a7d[Server] " + var2));
+ }
}
else if (var2.toLowerCase().startsWith("tell "))
{
@@ -414,7 +416,7 @@
}
else if (var2.toLowerCase().startsWith("toggledownfall"))
{
- this.minecraftServer.worldMngr[0].commandToggleDownfall();
+ ((WorldServer)DimensionManager.getWorld(0)).commandToggleDownfall();
var3.log("Toggling rain and snow, hold on...");
}
else if (var2.toLowerCase().startsWith("banlist"))
@@ -433,6 +435,10 @@
var3.log("Ban list:" + this.func_40648_a(this.minecraftServer.getBannedPlayersList(), ", "));
}
}
+ else if (ForgeHooks.onServerCommand(var3, var3.getUsername(), var2))
+ {
+ //Nom Nom Nom, Do we need to log anything, Let the command handle it themselves.
+ }
else
{
minecraftLogger.info("Unknown console command. Type \"help\" for help.");
this.sendNoticeToOps(var7, "Set time to " + var23);
@@ -360,8 +358,12 @@
}
else if (var4.equalsIgnoreCase("say") && var5.length() > 0)
{
- minecraftLogger.info("[" + var7 + "] " + var5);
- var8.sendPacketToAllPlayers(new Packet3Chat("\u00a7d[Server] " + var5));
+ var5 = ForgeHooks.onServerCommandSay(var6, var6.getUsername(), var5);
+ if (var5 != null)
+ {
+ minecraftLogger.info("[" + var7 + "] " + var5);
+ var8.sendPacketToAllPlayers(new Packet3Chat("\u00a7d[Server] " + var5));
+ }
}
else if (var4.equalsIgnoreCase("tell"))
{
@@ -385,7 +387,7 @@
}
else if (var4.equalsIgnoreCase("toggledownfall"))
{
- this.minecraftServer.worldMngr[0].commandToggleDownfall();
+ ((WorldServer)DimensionManager.getWorld(0)).commandToggleDownfall();
var6.log("Toggling rain and snow, hold on...");
}
else if (var4.equalsIgnoreCase("banlist"))
@@ -402,6 +404,10 @@
var6.log("Ban list:" + this.func_40648_a(this.minecraftServer.getBannedPlayersList(), ", "));
}
}
+ else if (ForgeHooks.onServerCommand(var6, var6.getUsername(), var2))
+ {
+ //Nom Nom Nom, Do we need to log anything, Let the command handle it themselves.
+ }
else
{
minecraftLogger.info("Unknown console command. Type \"help\" for help.");

View file

@ -1,21 +1,22 @@
--- ../src_base/minecraft_server/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000
@@ -1,5 +1,7 @@
package net.minecraft.src;
@@ -2,6 +2,8 @@
import cpw.mods.fml.server.FMLServerHandler;
+import net.minecraft.src.forge.ForgeHooks;
+
public class EntityItem extends Entity
{
/** The item stack of this EntityItem. */
@@ -175,6 +177,20 @@
@@ -177,6 +179,20 @@
if (!this.worldObj.isRemote)
{
int var2 = this.item.stackSize;
+
+ if (delayBeforeCanPickup == 0 && !ForgeHooks.onItemPickup(par1EntityPlayer, this))
+ {
+ ModLoader.onItemPickup(par1EntityPlayer, item);
+ FMLServerHandler.instance().notifyItemPickup(this,par1EntityPlayer);
+ 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)
@ -29,11 +30,3 @@
if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(this.item))
{
@@ -198,6 +214,7 @@
par1EntityPlayer.triggerAchievement(AchievementList.blazeRod);
}
+ ModLoader.onItemPickup(par1EntityPlayer, item);
this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
par1EntityPlayer.onItemPickup(this, var2);

View file

@ -9,7 +9,7 @@
/** Number of ticks since this EntityLiving last produced its sound */
private int livingSoundTime;
@@ -1298,7 +1298,7 @@
@@ -1301,7 +1301,7 @@
int var2 = MathHelper.floor_double(this.boundingBox.minY);
int var3 = MathHelper.floor_double(this.posZ);
int var4 = this.worldObj.getBlockId(var1, var2, var3);

View file

@ -12,11 +12,12 @@
{
public EntityMooshroom(World par1World)
{
@@ -21,27 +25,6 @@
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bowlSoup));
return true;
@@ -30,32 +34,7 @@
return true;
}
}
- else if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0)
-
- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0)
- {
- this.setDead();
- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D);
@ -37,10 +38,15 @@
-
- return true;
- }
else
{
return super.interact(par1EntityPlayer);
@@ -55,4 +38,29 @@
- else
- {
- return super.interact(par1EntityPlayer);
- }
+ return super.interact(par1EntityPlayer);
}
/**
@@ -65,4 +44,29 @@
{
return new EntityMooshroom(this.worldObj);
}

View file

@ -15,7 +15,7 @@
public abstract class EntityPlayer extends EntityLiving
{
/** Inventory of the player */
@@ -172,6 +180,7 @@
@@ -177,6 +185,7 @@
}
else
{
@ -23,7 +23,7 @@
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0)
{
this.updateItemUse(var1, 5);
@@ -361,6 +370,10 @@
@@ -366,6 +375,10 @@
*/
protected void closeScreen()
{
@ -34,7 +34,7 @@
this.craftingInventory = this.inventorySlots;
}
@@ -544,7 +557,16 @@
@@ -549,7 +562,16 @@
*/
public EntityItem dropOneItem()
{
@ -52,7 +52,7 @@
}
/**
@@ -609,10 +631,18 @@
@@ -615,10 +637,18 @@
/**
* Returns how strong the player is against the specified block at this moment
@ -72,7 +72,7 @@
float var3 = var2;
int var4 = EnchantmentHelper.getEfficiencyModifier(this.inventory);
@@ -908,7 +938,11 @@
@@ -914,7 +944,11 @@
par2 = 1 + par2 >> 1;
}
@ -85,7 +85,7 @@
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
this.addExhaustion(par1DamageSource.getHungerDamage());
this.health -= par2;
@@ -939,6 +973,10 @@
@@ -945,6 +979,10 @@
*/
public void useCurrentItemOnEntity(Entity par1Entity)
{
@ -96,7 +96,7 @@
if (!par1Entity.interact(this))
{
ItemStack var2 = this.getCurrentEquippedItem();
@@ -969,7 +1007,9 @@
@@ -975,7 +1013,9 @@
*/
public void destroyCurrentEquippedItem()
{
@ -106,7 +106,7 @@
}
/**
@@ -998,6 +1038,16 @@
@@ -1004,6 +1044,16 @@
*/
public void attackTargetEntityWithCurrentItem(Entity par1Entity)
{
@ -123,7 +123,7 @@
if (par1Entity.canAttackWithItem())
{
int var2 = this.inventory.getDamageVsEntity(par1Entity);
@@ -1136,6 +1186,12 @@
@@ -1142,6 +1192,12 @@
*/
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
{
@ -136,7 +136,7 @@
if (!this.worldObj.isRemote)
{
if (this.isPlayerSleeping() || !this.isEntityAlive())
@@ -1719,4 +1775,45 @@
@@ -1725,4 +1781,45 @@
}
public void func_50022_L() {}

View file

@ -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
@@ -6,6 +6,8 @@
@@ -5,6 +5,8 @@
import java.util.List;
import java.util.Set;
@ -9,7 +9,7 @@
public class EntityTrackerEntry
{
/** The entity that this EntityTrackerEntry tracks. */
@@ -287,6 +289,11 @@
@@ -286,6 +288,11 @@
{
System.out.println("Fetching addPacket for removed entity");
}
@ -19,5 +19,5 @@
+ return pkt;
+ }
EntityTrackerEntry2 var1 = ModLoaderMp.handleEntityTrackerEntries(this.trackedEntity);
if (this.trackedEntity instanceof EntityItem)
{

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft_server/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000
@@ -25,6 +25,9 @@
@@ -26,6 +26,9 @@
/** The hit entity */
public Entity entityHit;

View file

@ -18,18 +18,17 @@
}
/**
@@ -164,7 +168,37 @@
@@ -164,6 +168,36 @@
}
var2.func_20057_k();
- ModLoaderMp.handleAllLogins(var2);
+ if (par1Packet1Login.serverMode == ForgePacket.FORGE_ID)
+ {
+ //Pretty hackish place to put it, but it needs to go somewhere
+ ForgeHooksServer.init();
+ //pkt.mapSeed = ForgeHooks.buildVersion;
+ ForgeHooks.onLogin(netManager, par1Packet1Login);
+
+ ForgeHooks.onLogin(netManager, par1Packet1Login);
+
+ String[] channels = MessageManager.getInstance().getRegisteredChannels(netManager);
+ StringBuilder tmp = new StringBuilder();
+ tmp.append("Forge");
@ -47,8 +46,7 @@
+ }
+ pkt.length = pkt.data.length;
+ var5.sendPacket(pkt);
+ ForgeHooksServer.sendModListRequest(netManager);
+ ModLoaderMp.handleAllLogins(var2);
+ ForgeHooksServer.sendModListRequest(netManager);
+ }
+ else
+ {

View file

@ -1,8 +1,8 @@
--- ../src_base/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000
@@ -4,6 +4,9 @@
import java.util.Random;
import java.util.logging.Logger;
@@ -6,6 +6,9 @@
import cpw.mods.fml.server.FMLServerHandler;
import net.minecraft.server.MinecraftServer;
+import net.minecraft.src.forge.ForgeHooks;
+import net.minecraft.src.forge.MessageManager;
@ -10,7 +10,7 @@
public class NetServerHandler extends NetHandler implements ICommandListener
{
@@ -372,8 +375,11 @@
@@ -374,8 +377,11 @@
double var10 = this.playerEntity.posY - ((double)var6 + 0.5D) + 1.5D;
double var12 = this.playerEntity.posZ - ((double)var7 + 0.5D);
double var14 = var8 * var8 + var10 * var10 + var12 * var12;
@ -23,7 +23,7 @@
{
return;
}
@@ -465,8 +471,9 @@
@@ -467,8 +473,9 @@
{
var12 = var11;
}
@ -35,7 +35,7 @@
{
this.playerEntity.itemInWorldManager.activeBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8);
}
@@ -597,9 +604,13 @@
@@ -602,9 +609,13 @@
}
else
{
@ -52,9 +52,9 @@
}
this.field_45001_m += 20;
@@ -647,6 +658,10 @@
{
logger.info("ModLoaderMP : " + this.playerEntity.username + " issued command: " + par1Str.substring(1));
@@ -648,6 +659,10 @@
}
}
}
+ else if (ForgeHooks.onChatCommand(this.playerEntity, this.mcServer.configManager.isOp(playerEntity.username), par1Str.substring(1)))
+ {
@ -63,7 +63,7 @@
else
{
String var3;
@@ -764,9 +779,10 @@
@@ -765,9 +780,10 @@
*/
public void handleRespawn(Packet9Respawn par1Packet9Respawn)
{
@ -75,7 +75,7 @@
}
else
{
@@ -775,7 +791,7 @@
@@ -776,7 +792,7 @@
return;
}
@ -84,19 +84,23 @@
}
}
@@ -965,4 +981,49 @@
@@ -969,9 +985,50 @@
{
this.playerEntity.capabilities.isFlying = par1Packet202PlayerAbilities.field_50005_b && this.playerEntity.capabilities.allowFlying;
this.playerEntity.capabilities.isFlying = par1Packet202PlayerAbilities.isFlying && this.playerEntity.capabilities.allowFlying;
}
-
+
+ public EntityPlayerMP getPlayerEntity()
+ {
+ return playerEntity;
+ }
+
+ @Override
@Override
- public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) {
- FMLServerHandler.instance().handlePacket250(par1Packet250CustomPayload, playerEntity);
+ public void handleCustomPayload(Packet250CustomPayload pkt)
+ {
+ FMLServerHandler.instance().handlePacket250(pkt, playerEntity);
+ MessageManager inst = MessageManager.getInstance();
+ if (pkt.channel.equals("REGISTER"))
+ {
@ -132,5 +136,5 @@
+ {
+ inst.dispatchIncomingMessage(netManager, pkt.channel, pkt.data);
+ }
+ }
}
}

View file

@ -62,7 +62,7 @@
}
/**
@@ -285,6 +290,10 @@
@@ -286,6 +291,10 @@
*/
public void sendPlayerToOtherDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
{
@ -73,7 +73,7 @@
int var3 = par1EntityPlayerMP.dimension;
WorldServer var4 = this.mcServer.getWorldManager(par1EntityPlayerMP.dimension);
par1EntityPlayerMP.dimension = par2;
@@ -292,33 +301,14 @@
@@ -293,33 +302,14 @@
par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.itemInWorldManager.getGameType()));
var4.removePlayer(par1EntityPlayerMP);
par1EntityPlayerMP.isDead = false;
@ -113,7 +113,7 @@
{
ChunkCoordinates var12 = var5.getEntrancePortalLocation();
var6 = (double)var12.posX;
@@ -338,7 +328,7 @@
@@ -339,7 +329,7 @@
par1EntityPlayerMP.setLocationAndAngles(var6, par1EntityPlayerMP.posY, var8, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
var5.updateEntityWithOptionalForce(par1EntityPlayerMP, false);
var5.chunkProviderServer.chunkLoadOverride = true;
@ -122,7 +122,7 @@
var5.chunkProviderServer.chunkLoadOverride = false;
}
@@ -366,9 +356,9 @@
@@ -367,9 +357,9 @@
this.sendPacketToAllPlayers(new Packet201PlayerInfo(var1.username, true, var1.ping));
}
@ -134,3 +134,12 @@
}
}
@@ -902,7 +892,7 @@
public String[] func_52019_t()
{
- return this.mcServer.worldMngr[0].getSaveHandler().getPlayerNBTManager().func_52007_g();
+ return DimensionManager.getWorld(0).getSaveHandler().getPlayerNBTManager().func_52007_g();
}
private void func_52018_u()

View file

@ -1,27 +1,19 @@
--- ../src_base/minecraft_server/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/SlotCrafting.java 0000-00-00 00:00:00.000000000 -0000
@@ -1,5 +1,7 @@
@@ -1,5 +1,8 @@
package net.minecraft.src;
+import cpw.mods.fml.server.FMLServerHandler;
+import net.minecraft.src.forge.ForgeHooks;
+
public class SlotCrafting extends Slot
{
/** The craft matrix inventory linked to this result slot. */
@@ -89,8 +91,6 @@
{
this.thePlayer.addStat(AchievementList.bookcase, 1);
}
-
- ModLoader.takenFromCrafting(this.thePlayer, par1ItemStack, this.craftMatrix);
}
/**
@@ -98,6 +98,9 @@
@@ -96,6 +99,9 @@
*/
public void onPickupFromSlot(ItemStack par1ItemStack)
{
+ ModLoader.takenFromCrafting(this.thePlayer, par1ItemStack, this.craftMatrix);
+ FMLServerHandler.instance().onItemCrafted(thePlayer, par1ItemStack, craftMatrix);
+ ForgeHooks.onTakenFromCrafting(thePlayer, par1ItemStack, craftMatrix);
+
this.func_48416_b(par1ItemStack);

View file

@ -1,8 +1,8 @@
--- ../src_base/minecraft_server/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000
@@ -200,4 +200,13 @@
addMapping(TileEntityEnchantmentTable.class, "EnchantTable");
addMapping(TileEntityEndPortal.class, "Airportal");
@@ -204,4 +204,13 @@
public static void addNewTileEntityMapping(Class<? extends TileEntity> tileEntityClass, String id) {
addMapping(tileEntityClass, id);
}
+
+ /**

View file

@ -1,7 +1,8 @@
--- ../src_base/minecraft_server/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000
@@ -1,6 +1,8 @@
package net.minecraft.src;
@@ -2,7 +2,9 @@
import cpw.mods.fml.server.FMLServerHandler;
-public class TileEntityFurnace extends TileEntity implements IInventory
+import net.minecraft.src.forge.ISidedInventory;
@ -10,7 +11,7 @@
{
/**
* The ItemStacks that hold the items currently being used in the furnace
@@ -249,8 +251,12 @@
@@ -251,8 +253,12 @@
}
else
{
@ -25,7 +26,7 @@
}
}
@@ -261,13 +267,13 @@
@@ -263,13 +269,13 @@
{
if (this.canSmelt())
{
@ -41,16 +42,7 @@
{
++this.furnaceItemStacks[2].stackSize;
}
@@ -285,7 +291,7 @@
* Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
* fuel
*/
- private int getItemBurnTime(ItemStack par1ItemStack)
+ public int getItemBurnTime(ItemStack par1ItemStack)
{
if (par1ItemStack == null)
{
@@ -309,4 +315,18 @@
@@ -316,4 +322,18 @@
public void openChest() {}
public void closeChest() {}

View file

@ -18,7 +18,7 @@
/** Whether monsters are enabled or not. (1 = on, 0 = off) */
public int difficultySetting;
@@ -352,7 +354,8 @@
@@ -354,7 +356,8 @@
*/
public boolean isAirBlock(int par1, int par2, int par3)
{
@ -28,7 +28,7 @@
}
public boolean func_48084_h(int par1, int par2, int par3)
@@ -1598,7 +1601,7 @@
@@ -1600,7 +1603,7 @@
if (var7 != null)
{
@ -37,7 +37,7 @@
}
}
}
@@ -1628,14 +1631,16 @@
@@ -1630,14 +1633,16 @@
{
this.loadedTileEntityList.add(var8);
}
@ -56,7 +56,7 @@
}
}
@@ -1652,13 +1657,13 @@
@@ -1654,13 +1659,13 @@
public void addTileEntity(Collection par1Collection)
{
@ -76,7 +76,7 @@
}
}
@@ -1680,7 +1685,7 @@
@@ -1682,7 +1687,7 @@
int var4 = MathHelper.floor_double(par1Entity.posZ);
byte var5 = 32;
@ -85,7 +85,7 @@
{
par1Entity.lastTickPosX = par1Entity.posX;
par1Entity.lastTickPosY = par1Entity.posY;
@@ -1903,6 +1908,13 @@
@@ -1905,6 +1910,13 @@
if (var11 == Block.fire.blockID || var11 == Block.lavaMoving.blockID || var11 == Block.lavaStill.blockID)
{
return true;
@ -99,7 +99,7 @@
}
}
}
@@ -2186,25 +2198,21 @@
@@ -2188,25 +2200,21 @@
*/
public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
{
@ -138,7 +138,7 @@
}
}
@@ -2213,27 +2221,10 @@
@@ -2215,27 +2223,10 @@
*/
public void removeBlockTileEntity(int par1, int par2, int par3)
{
@ -169,7 +169,7 @@
}
}
@@ -2259,7 +2250,8 @@
@@ -2261,7 +2252,8 @@
*/
public boolean isBlockNormalCube(int par1, int par2, int par3)
{
@ -179,7 +179,7 @@
}
/**
@@ -2534,6 +2526,7 @@
@@ -2536,6 +2528,7 @@
}
}
}
@ -187,7 +187,7 @@
Profiler.endSection();
@@ -2856,7 +2849,7 @@
@@ -2859,7 +2852,7 @@
private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6)
{
@ -196,7 +196,7 @@
int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6;
int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6;
int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6;
@@ -3342,6 +3335,11 @@
@@ -3345,6 +3338,11 @@
{
var8 = null;
}
@ -208,7 +208,7 @@
return par1 > 0 && var8 == null && var9.canPlaceBlockOnSide(this, par2, par3, par4, par6);
}
@@ -3849,4 +3847,38 @@
@@ -3855,4 +3853,38 @@
{
return this.getChunkProvider().findClosestStructure(this, par1Str, par2, par3, par4);
}