Fix up patches for FML, also, add in FML as a submodule rather than a zip

This commit is contained in:
Christian 2013-03-03 14:05:34 -05:00
parent 9bd8f2697c
commit 72e013fb66
13 changed files with 79 additions and 99 deletions

3
.gitignore vendored
View File

@ -1,8 +1,7 @@
*.DS_Store *.DS_Store
/fml/
/logs/ /logs/
/*.pyc /*.pyc
/forge-*/ /forge-*/
/patches-old/ /patches-old/
/mcp/ /mcp/
/eclipse/ /eclipse/

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "fml"]
path = fml
url = git@github.com:MinecraftForge/FML.git

1
fml Submodule

@ -0,0 +1 @@
Subproject commit 33cd9ad0fe662531bb4f82b5c73462bf6425ea04

View File

@ -94,7 +94,7 @@
return entityitem; return entityitem;
} }
@@ -2046,7 +2078,7 @@ @@ -2049,7 +2081,7 @@
*/ */
public boolean isRiding() public boolean isRiding()
{ {
@ -103,7 +103,7 @@
} }
/** /**
@@ -2390,7 +2422,7 @@ @@ -2393,7 +2425,7 @@
public float func_82146_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) public float func_82146_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block)
{ {
@ -112,7 +112,7 @@
} }
public boolean func_96091_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7) public boolean func_96091_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7)
@@ -2445,4 +2477,84 @@ @@ -2448,4 +2480,84 @@
{ {
return this.getEntityName(); return this.getEntityName();
} }

View File

@ -160,7 +160,7 @@
/** /**
* Remove the speified potion effect from this entity. * Remove the speified potion effect from this entity.
*/ */
@@ -3054,4 +3101,42 @@ @@ -3057,4 +3104,42 @@
{ {
this.canPickUpLoot = par1; this.canPickUpLoot = par1;
} }

View File

@ -18,7 +18,7 @@
public class Item public class Item
{ {
@@ -238,13 +241,16 @@ @@ -242,13 +245,16 @@
/** Icon index in the icons table. */ /** Icon index in the icons table. */
protected Icon iconIndex; protected Icon iconIndex;
@ -36,7 +36,7 @@
} }
itemsList[256 + par1] = this; itemsList[256 + par1] = this;
@@ -636,6 +642,10 @@ @@ -640,6 +646,10 @@
float f7 = f4 * f5; float f7 = f4 * f5;
float f8 = f3 * f5; float f8 = f3 * f5;
double d3 = 5.0D; double d3 = 5.0D;
@ -47,7 +47,7 @@
Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3);
} }
@@ -716,4 +726,324 @@ @@ -720,4 +730,324 @@
{ {
StatList.initStats(); StatList.initStats();
} }

View File

@ -14,7 +14,7 @@
public class NetServerHandler extends NetHandler public class NetServerHandler extends NetHandler
{ {
/** The underlying network manager for this server handler. */ /** The underlying network manager for this server handler. */
@@ -233,6 +240,11 @@ @@ -238,6 +245,11 @@
if (this.playerEntity.ridingEntity != null) if (this.playerEntity.ridingEntity != null)
{ {
this.playerEntity.ridingEntity.updateRiderPosition(); this.playerEntity.ridingEntity.updateRiderPosition();
@ -26,7 +26,7 @@
} }
this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
@@ -305,9 +317,9 @@ @@ -310,9 +322,9 @@
d4 = d1 - this.playerEntity.posX; d4 = d1 - this.playerEntity.posX;
double d6 = d2 - this.playerEntity.posY; double d6 = d2 - this.playerEntity.posY;
double d7 = d3 - this.playerEntity.posZ; double d7 = d3 - this.playerEntity.posZ;
@ -39,7 +39,7 @@
double d11 = d8 * d8 + d9 * d9 + d10 * d10; double d11 = d8 * d8 + d9 * d9 + d10 * d10;
if (d11 > 100.0D && (!this.mcServer.isSinglePlayer() || !this.mcServer.getServerOwner().equals(this.playerEntity.username))) if (d11 > 100.0D && (!this.mcServer.isSinglePlayer() || !this.mcServer.getServerOwner().equals(this.playerEntity.username)))
@@ -323,6 +335,11 @@ @@ -328,6 +340,11 @@
if (this.playerEntity.onGround && !par1Packet10Flying.onGround && d6 > 0.0D) if (this.playerEntity.onGround && !par1Packet10Flying.onGround && d6 > 0.0D)
{ {
this.playerEntity.addExhaustion(0.2F); this.playerEntity.addExhaustion(0.2F);
@ -51,7 +51,7 @@
} }
this.playerEntity.moveEntity(d4, d6, d7); this.playerEntity.moveEntity(d4, d6, d7);
@@ -347,10 +364,15 @@ @@ -352,10 +369,15 @@
this.mcServer.func_98033_al().func_98236_b(this.playerEntity.username + " moved wrongly!"); this.mcServer.func_98033_al().func_98236_b(this.playerEntity.username + " moved wrongly!");
} }
@ -68,7 +68,7 @@
{ {
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f2, f3); this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f2, f3);
return; return;
@@ -358,7 +380,7 @@ @@ -363,7 +385,7 @@
AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f4, (double)f4, (double)f4).addCoord(0.0D, -0.55D, 0.0D); AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f4, (double)f4, (double)f4).addCoord(0.0D, -0.55D, 0.0D);
@ -77,7 +77,7 @@
{ {
if (d12 >= -0.03125D) if (d12 >= -0.03125D)
{ {
@@ -377,6 +399,11 @@ @@ -382,6 +404,11 @@
this.ticksForFloatKick = 0; this.ticksForFloatKick = 0;
} }
@ -89,7 +89,7 @@
this.playerEntity.onGround = par1Packet10Flying.onGround; this.playerEntity.onGround = par1Packet10Flying.onGround;
this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
this.playerEntity.updateFlyingState(this.playerEntity.posY - d0, par1Packet10Flying.onGround); this.playerEntity.updateFlyingState(this.playerEntity.posY - d0, par1Packet10Flying.onGround);
@@ -443,7 +470,10 @@ @@ -448,7 +475,10 @@
double d2 = this.playerEntity.posZ - ((double)k + 0.5D); double d2 = this.playerEntity.posZ - ((double)k + 0.5D);
double d3 = d0 * d0 + d1 * d1 + d2 * d2; double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@ -101,7 +101,7 @@
{ {
return; return;
} }
@@ -503,7 +533,11 @@ @@ -508,7 +538,11 @@
return; return;
} }
@ -114,7 +114,7 @@
} }
else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit())) else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit()))
{ {
@@ -512,7 +546,9 @@ @@ -517,7 +551,9 @@
} }
else else
{ {
@ -125,7 +125,7 @@
{ {
this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset()); this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset());
} }
@@ -691,7 +727,14 @@ @@ -696,7 +732,14 @@
return; return;
} }
@ -140,7 +140,7 @@
this.mcServer.func_98033_al().func_98233_a(s); this.mcServer.func_98033_al().func_98233_a(s);
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(s, false)); this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(s, false));
} }
@@ -822,7 +865,7 @@ @@ -827,7 +870,7 @@
return; return;
} }
@ -149,7 +149,7 @@
} }
} }
} }
@@ -1220,7 +1263,6 @@ @@ -1225,7 +1268,6 @@
} }
} }
} }

View File

@ -162,7 +162,7 @@
} }
@SideOnly(Side.SERVER) @SideOnly(Side.SERVER)
@@ -1102,6 +1100,7 @@ @@ -1105,6 +1103,7 @@
if (worldserver != null) if (worldserver != null)
{ {

View File

@ -8,7 +8,7 @@
import java.util.List; import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet;
@@ -9,10 +10,13 @@ @@ -9,6 +10,9 @@
import net.minecraft.network.packet.Packet53BlockChange; import net.minecraft.network.packet.Packet53BlockChange;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkCoordIntPair;
@ -18,56 +18,51 @@
public class PlayerInstance public class PlayerInstance
{ {
- private final List playersInChunk; @@ -64,6 +68,8 @@
+ public final List playersInChunk; this.players.remove(par1EntityPlayerMP);
/** note: this is final */
private final ChunkCoordIntPair chunkLocation;
@@ -56,6 +60,8 @@
this.playersInChunk.remove(par1EntityPlayerMP);
par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation);
+ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(chunkLocation, par1EntityPlayerMP)); + MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(chunkLocation, par1EntityPlayerMP));
+ +
if (this.playersInChunk.isEmpty()) if (this.players.isEmpty())
{ {
long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32;
@@ -80,7 +86,7 @@ @@ -91,7 +97,7 @@
this.field_73260_f |= 1 << (par2 >> 4); this.field_73260_f |= 1 << (par2 >> 4);
- if (this.numberOfTilesToUpdate < 64) - if (this.numBlocksToUpdate < 64)
+ //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run + //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run
{ {
short short1 = (short)(par1 << 12 | par3 << 8 | par2); short short1 = (short)(par1 << 12 | par3 << 8 | par2);
@@ -92,6 +98,10 @@ @@ -103,6 +109,10 @@
} }
} }
+ if (numberOfTilesToUpdate == locationOfBlockChange.length) + if (numBlocksToUpdate == blocksToUpdate.length)
+ { + {
+ locationOfBlockChange = Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); + blocksToUpdate = Arrays.copyOf(blocksToUpdate, blocksToUpdate.length << 1);
+ } + }
this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1; this.blocksToUpdate[this.numBlocksToUpdate++] = short1;
} }
} }
@@ -133,12 +143,13 @@ @@ -147,12 +157,13 @@
{ {
int l; int l;
- if (this.numberOfTilesToUpdate == 64) - if (this.numBlocksToUpdate == 64)
+ if (this.numberOfTilesToUpdate >= ForgeDummyContainer.clumpingThreshold) + if (this.numBlocksToUpdate >= ForgeDummyContainer.clumpingThreshold)
{ {
i = this.chunkLocation.chunkXPos * 16; i = this.chunkLocation.chunkXPos * 16;
j = this.chunkLocation.chunkZPos * 16; j = this.chunkLocation.chunkZPos * 16;
this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.myManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.field_73260_f)); this.sendPacketToPlayersInInstance(new Packet51MapChunk(PlayerManager.getWorldServer(this.myManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.field_73260_f));
+ /* Forge: Grabings ALL tile entities is costly on a modded server, only send needed ones + /* Forge: Grabings ALL tile entities is costly on a modded server, only send needed ones
for (k = 0; k < 16; ++k) for (k = 0; k < 16; ++k)
{ {
if ((this.field_73260_f & 1 << k) != 0) if ((this.field_73260_f & 1 << k) != 0)
@@ -152,11 +163,14 @@ @@ -166,11 +177,15 @@
} }
} }
} }
@ -75,11 +70,11 @@
} }
else else
{ {
this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.myManager))); this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.myManager)));
-
+ } + }
+ +
+ { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small + { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small
for (i = 0; i < this.numberOfTilesToUpdate; ++i) for (i = 0; i < this.numBlocksToUpdate; ++i)
{ {
j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15); j = this.chunkLocation.chunkXPos * 16 + (this.blocksToUpdate[i] >> 12 & 15);

View File

@ -40,8 +40,8 @@
entityplayermp1.entityId = par1EntityPlayerMP.entityId; entityplayermp1.entityId = par1EntityPlayerMP.entityId;
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver); this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver);
@@ -452,6 +467,11 @@ @@ -455,6 +470,11 @@
*/
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2) public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
{ {
+ transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).getDefaultTeleporter()); + transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).getDefaultTeleporter());
@ -52,7 +52,7 @@
int j = par1EntityPlayerMP.dimension; int j = par1EntityPlayerMP.dimension;
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
par1EntityPlayerMP.dimension = par2; par1EntityPlayerMP.dimension = par2;
@@ -459,7 +479,7 @@ @@ -462,7 +482,7 @@
par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType())); par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
worldserver.removePlayerEntityDangerously(par1EntityPlayerMP); worldserver.removePlayerEntityDangerously(par1EntityPlayerMP);
par1EntityPlayerMP.isDead = false; par1EntityPlayerMP.isDead = false;
@ -61,7 +61,7 @@
this.func_72375_a(par1EntityPlayerMP, worldserver); this.func_72375_a(par1EntityPlayerMP, worldserver);
par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1); par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1);
@@ -481,38 +501,23 @@ @@ -484,38 +504,23 @@
*/ */
public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer)
{ {
@ -111,7 +111,7 @@
{ {
ChunkCoordinates chunkcoordinates; ChunkCoordinates chunkcoordinates;
@@ -549,7 +554,7 @@ @@ -552,7 +557,7 @@
par4WorldServer.spawnEntityInWorld(par1Entity); par4WorldServer.spawnEntityInWorld(par1Entity);
par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch);
par4WorldServer.updateEntityWithOptionalForce(par1Entity, false); par4WorldServer.updateEntityWithOptionalForce(par1Entity, false);

View File

@ -499,9 +499,9 @@
{ {
if (!this.provider.hasNoSky) if (!this.provider.hasNoSky)
{ {
@@ -2971,12 +3062,14 @@ @@ -2974,12 +3065,14 @@
*/
public void toggleRain() public void commandToggleDownfall()
{ {
- this.worldInfo.setRainTime(1); - this.worldInfo.setRainTime(1);
+ provider.toggleRain(); + provider.toggleRain();
@ -515,7 +515,7 @@
this.theProfiler.startSection("buildList"); this.theProfiler.startSection("buildList");
int i; int i;
EntityPlayer entityplayer; EntityPlayer entityplayer;
@@ -3083,6 +3176,11 @@ @@ -3086,6 +3179,11 @@
*/ */
public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4)
{ {
@ -527,7 +527,7 @@
BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3);
float f = biomegenbase.getFloatTemperature(); float f = biomegenbase.getFloatTemperature();
@@ -3141,6 +3239,11 @@ @@ -3144,6 +3242,11 @@
*/ */
public boolean canSnowAt(int par1, int par2, int par3) public boolean canSnowAt(int par1, int par2, int par3)
{ {
@ -539,7 +539,7 @@
BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3);
float f = biomegenbase.getFloatTemperature(); float f = biomegenbase.getFloatTemperature();
@@ -3184,10 +3287,12 @@ @@ -3187,10 +3290,12 @@
else else
{ {
int l = this.getBlockId(par1, par2, par3); int l = this.getBlockId(par1, par2, par3);
@ -556,7 +556,7 @@
{ {
j1 = 1; j1 = 1;
} }
@@ -3283,7 +3388,9 @@ @@ -3286,7 +3391,9 @@
int j4 = i2 + Facing.offsetsXForSide[i4]; int j4 = i2 + Facing.offsetsXForSide[i4];
int k4 = j2 + Facing.offsetsYForSide[i4]; int k4 = j2 + Facing.offsetsYForSide[i4];
int l4 = k2 + Facing.offsetsZForSide[i4]; int l4 = k2 + Facing.offsetsZForSide[i4];
@ -567,7 +567,7 @@
i3 = this.getSavedLightValue(par1EnumSkyBlock, j4, k4, l4); i3 = this.getSavedLightValue(par1EnumSkyBlock, j4, k4, l4);
if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length) if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length)
@@ -3386,10 +3493,10 @@ @@ -3389,10 +3496,10 @@
public List func_94576_a(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) public List func_94576_a(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{ {
ArrayList arraylist = new ArrayList(); ArrayList arraylist = new ArrayList();
@ -582,7 +582,7 @@
for (int i1 = i; i1 <= j; ++i1) for (int i1 = i; i1 <= j; ++i1)
{ {
@@ -3415,10 +3522,10 @@ @@ -3418,10 +3525,10 @@
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{ {
@ -597,7 +597,7 @@
ArrayList arraylist = new ArrayList(); ArrayList arraylist = new ArrayList();
for (int i1 = i; i1 <= j; ++i1) for (int i1 = i; i1 <= j; ++i1)
@@ -3511,11 +3618,14 @@ @@ -3514,11 +3621,14 @@
*/ */
public void addLoadedEntities(List par1List) public void addLoadedEntities(List par1List)
{ {
@ -615,7 +615,7 @@
} }
} }
@@ -3549,6 +3659,11 @@ @@ -3552,6 +3662,11 @@
else else
{ {
if (block != null && (block == Block.waterMoving || block == Block.waterStill || block == Block.lavaMoving || block == Block.lavaStill || block == Block.fire || block.blockMaterial.isReplaceable())) if (block != null && (block == Block.waterMoving || block == Block.waterStill || block == Block.lavaMoving || block == Block.lavaStill || block == Block.fire || block.blockMaterial.isReplaceable()))
@ -627,7 +627,7 @@
{ {
block = null; block = null;
} }
@@ -3837,7 +3952,7 @@ @@ -3840,7 +3955,7 @@
*/ */
public long getSeed() public long getSeed()
{ {
@ -636,7 +636,7 @@
} }
public long getTotalWorldTime() public long getTotalWorldTime()
@@ -3847,7 +3962,7 @@ @@ -3850,7 +3965,7 @@
public long getWorldTime() public long getWorldTime()
{ {
@ -645,7 +645,7 @@
} }
/** /**
@@ -3855,7 +3970,7 @@ @@ -3858,7 +3973,7 @@
*/ */
public void setWorldTime(long par1) public void setWorldTime(long par1)
{ {
@ -654,7 +654,7 @@
} }
/** /**
@@ -3863,13 +3978,13 @@ @@ -3866,13 +3981,13 @@
*/ */
public ChunkCoordinates getSpawnPoint() public ChunkCoordinates getSpawnPoint()
{ {
@ -670,7 +670,7 @@
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@@ -3893,7 +4008,10 @@ @@ -3896,7 +4011,10 @@
if (!this.loadedEntityList.contains(par1Entity)) if (!this.loadedEntityList.contains(par1Entity))
{ {
@ -682,7 +682,7 @@
} }
} }
@@ -3901,6 +4019,11 @@ @@ -3904,6 +4022,11 @@
* Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
*/ */
public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
@ -694,7 +694,7 @@
{ {
return true; return true;
} }
@@ -4021,8 +4144,7 @@ @@ -4024,8 +4147,7 @@
*/ */
public boolean isBlockHighHumidity(int par1, int par2, int par3) public boolean isBlockHighHumidity(int par1, int par2, int par3)
{ {
@ -704,7 +704,7 @@
} }
/** /**
@@ -4097,7 +4219,7 @@ @@ -4100,7 +4222,7 @@
*/ */
public int getHeight() public int getHeight()
{ {
@ -713,7 +713,7 @@
} }
/** /**
@@ -4105,7 +4227,7 @@ @@ -4108,7 +4230,7 @@
*/ */
public int getActualHeight() public int getActualHeight()
{ {
@ -722,7 +722,7 @@
} }
public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart) public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart)
@@ -4148,7 +4270,7 @@ @@ -4151,7 +4273,7 @@
*/ */
public double getHorizon() public double getHorizon()
{ {
@ -731,7 +731,7 @@
} }
/** /**
@@ -4251,4 +4373,98 @@ @@ -4254,4 +4376,98 @@
{ {
return this.field_98181_L; return this.field_98181_L;
} }

View File

@ -10,7 +10,7 @@
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.crash.CrashReport; import net.minecraft.crash.CrashReport;
@@ -66,7 +69,7 @@ @@ -74,7 +77,7 @@
*/ */
public void unloadChunksIfNotNearSpawn(int par1, int par2) public void unloadChunksIfNotNearSpawn(int par1, int par2)
{ {
@ -19,7 +19,7 @@
{ {
ChunkCoordinates chunkcoordinates = this.worldObj.getSpawnPoint(); ChunkCoordinates chunkcoordinates = this.worldObj.getSpawnPoint();
int k = par1 * 16 + 8 - chunkcoordinates.posX; int k = par1 * 16 + 8 - chunkcoordinates.posX;
@@ -109,7 +112,11 @@ @@ -117,7 +120,11 @@
if (chunk == null) if (chunk == null)
{ {
@ -32,7 +32,7 @@
if (chunk == null) if (chunk == null)
{ {
@@ -305,6 +312,11 @@ @@ -313,6 +320,11 @@
{ {
if (!this.worldObj.canNotSave) if (!this.worldObj.canNotSave)
{ {
@ -44,14 +44,14 @@
for (int i = 0; i < 100; ++i) for (int i = 0; i < 100; ++i)
{ {
if (!this.chunksToUnload.isEmpty()) if (!this.chunksToUnload.isEmpty())
@@ -317,6 +329,11 @@ @@ -325,6 +337,11 @@
this.chunksToUnload.remove(olong); this.chunksToUnload.remove(olong);
this.loadedChunkHashMap.remove(olong.longValue()); this.id2ChunkMap.remove(olong.longValue());
this.loadedChunks.remove(chunk); this.loadedChunks.remove(chunk);
+ ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition), chunk); + ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition), chunk);
+ if(loadedChunks.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)) { + if(loadedChunks.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)) {
+ DimensionManager.unloadWorld(this.worldObj.provider.dimensionId); + DimensionManager.unloadWorld(this.worldObj.provider.dimensionId);
+ return currentChunkProvider.unloadQueuedChunks(); + return serverChunkGenerator.unloadQueuedChunks();
+ } + }
} }
} }

View File

@ -47,25 +47,7 @@ def main():
def setup_fml(mcp_dir, fml_dir, dont_extract=False): def setup_fml(mcp_dir, fml_dir, dont_extract=False):
print 'Setting up Forge ModLoader' print 'Setting up Forge ModLoader'
if not dont_extract: sys.path.append(os.path.join(fml_dir,'install')os.path.join(forge_dir, 'fml'))
fml = glob.glob(os.path.join(forge_dir, 'fml-src-*.zip'))
if not len(fml) == 1:
if len(fml) == 0:
print 'Missing FML source zip, should be named fml-src-*.zip inside your forge folder, obtain it from the repo'
else:
print 'To many FML source zips found, we should only have one. Check the Forge Git for the latest FML version supported'
sys.exit(1)
if os.path.isdir(fml_dir):
shutil.rmtree(fml_dir)
print 'Extracting: %s' % os.path.basename(fml[0])
zf = zipfile.ZipFile(fml[0])
zf.extractall(forge_dir)
zf.close()
sys.path.append(fml_dir)
from install import fml_main from install import fml_main
fml_main(fml_dir, mcp_dir, True) fml_main(fml_dir, mcp_dir, True)
@ -80,4 +62,4 @@ def setup_eclipse(forge_dir):
zf.close() zf.close()
if __name__ == '__main__': if __name__ == '__main__':
main() main()