This update fixes some world corrupting vanilla error handling, mostly caused by

mods doing something derpy. Hopefully, your world saves will thank me.
Note that if the mod does derp, it's data is lost. It's not FML or Minecraft Forge's
responsibility if "DirtChest 2000 Mk5" can't write their TileEntity method correctly
and you lose your 100000 diamonds.

Update FML: a3a93f3
a3a93f3 Fix some whitespace issues, handle possibly bugged entities as well
a7eb5dc Vanilla/mod bug fixes: CME on entity processing, TileEntity resetting chunk on save/load.
This commit is contained in:
Christian committed 2012-10-30 09:27:34 -04:00
1 parent 64354382d4
commit 418a47976a
4 files changed
+61 -61

No files matched your search

Binary file not shown.
@@ -1,8 +1,8 @@
--- ../src_base/common/net/minecraft/src/AnvilChunkLoader.java
+++ ../src_work/common/net/minecraft/src/AnvilChunkLoader.java
@@ -10,6 +10,9 @@
import java.util.List;
import java.util.Set;
@@ -13,6 +13,9 @@
import cpw.mods.fml.common.FMLLog;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.world.ChunkDataEvent;
@@ -10,7 +10,7 @@
public class AnvilChunkLoader implements IThreadedFileIO, IChunkLoader
{
private List chunksToRemove = new ArrayList();
@@ -94,6 +97,7 @@
@@ -97,6 +100,7 @@
var5 = this.readChunkFromNBT(par1World, par4NBTTagCompound.getCompoundTag("Level"));
}
@@ -18,7 +18,7 @@
return var5;
}
}
@@ -109,6 +113,7 @@
@@ -112,6 +116,7 @@
var3.setTag("Level", var4);
this.writeChunkToNBT(par2Chunk, par1World, var4);
this.func_75824_a(par2Chunk.getChunkCoordIntPair(), var3);
@@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/TileEntity.java
+++ ../src_work/common/net/minecraft/src/TileEntity.java
@@ -264,4 +264,33 @@
@@ -276,4 +276,33 @@
addMapping(TileEntityBeacon.class, "Beacon");
addMapping(TileEntitySkull.class, "Skull");
}
@@ -1,8 +1,8 @@
--- ../src_base/common/net/minecraft/src/World.java
+++ ../src_work/common/net/minecraft/src/World.java
@@ -11,8 +11,30 @@
import java.util.Random;
import java.util.Set;
@@ -13,8 +13,30 @@
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSetMultimap;
+
@@ -31,7 +31,7 @@
/**
* boolean; if true updates scheduled by scheduleBlockUpdate happen immediately
*/
@@ -136,6 +158,11 @@
@@ -138,6 +160,11 @@
*/
public BiomeGenBase getBiomeGenForCoords(int par1, int par2)
{
@@ -43,7 +43,7 @@
if (this.blockExists(par1, 0, par2))
{
Chunk var3 = this.getChunkFromBlockCoords(par1, par2);
@@ -165,7 +192,13 @@
@@ -167,7 +194,13 @@
this.theProfiler = par5Profiler;
this.worldInfo = new WorldInfo(par4WorldSettings, par2Str);
this.provider = par3WorldProvider;
@@ -58,7 +58,7 @@
VillageCollection var6 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages");
if (var6 == null)
@@ -179,7 +212,7 @@
@@ -181,7 +214,7 @@
this.villageCollectionObj.func_82566_a(this);
}
@@ -67,7 +67,7 @@
this.chunkProvider = this.createChunkProvider();
this.calculateInitialSkylight();
this.calculateInitialWeather();
@@ -193,7 +226,7 @@
@@ -195,7 +228,7 @@
this.isRemote = false;
this.saveHandler = par1ISaveHandler;
this.theProfiler = par5Profiler;
@@ -76,7 +76,7 @@
this.worldInfo = par1ISaveHandler.loadWorldInfo();
if (par4WorldProvider != null)
@@ -227,12 +260,20 @@
@@ -229,12 +262,20 @@
this.worldInfo.setServerInitialized(true);
}
@@ -99,7 +99,7 @@
}
else
{
@@ -244,6 +285,19 @@
@@ -246,6 +287,19 @@
this.calculateInitialWeather();
}
@@ -119,7 +119,7 @@
/**
* Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
*/
@@ -298,7 +352,8 @@
@@ -300,7 +354,8 @@
*/
public boolean isAirBlock(int par1, int par2, int par3)
{
@@ -129,7 +129,7 @@
}
/**
@@ -307,7 +362,8 @@
@@ -309,7 +364,8 @@
public boolean blockHasTileEntity(int par1, int par2, int par3)
{
int var4 = this.getBlockId(par1, par2, par3);
@@ -139,7 +139,7 @@
}
/**
@@ -1029,7 +1085,7 @@
@@ -1031,7 +1087,7 @@
*/
public boolean isDaytime()
{
@@ -148,7 +148,7 @@
}
/**
@@ -1061,7 +1117,7 @@
@@ -1063,7 +1119,7 @@
int var12 = this.getBlockMetadata(var8, var9, var10);
Block var13 = Block.blocksList[var11];
@@ -157,7 +157,7 @@
{
MovingObjectPosition var14 = var13.collisionRayTrace(this, var8, var9, var10, par1Vec3, par2Vec3);
@@ -1261,6 +1317,12 @@
@@ -1263,6 +1319,12 @@
*/
public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4)
{
@@ -170,7 +170,7 @@
if (par1Entity != null && par2Str != null)
{
Iterator var5 = this.worldAccesses.iterator();
@@ -1359,6 +1421,11 @@
@@ -1361,6 +1423,11 @@
EntityPlayer var5 = (EntityPlayer)par1Entity;
this.playerEntities.add(var5);
this.updateAllPlayersSleepingFlag();
@@ -182,7 +182,7 @@
}
this.getChunkFromChunkCoords(var2, var3).addEntity(par1Entity);
@@ -1610,6 +1677,12 @@
@@ -1612,6 +1679,12 @@
* Calculates the color for the skybox
*/
public Vec3 getSkyColor(Entity par1Entity, float par2)
@@ -195,7 +195,7 @@
{
float var3 = this.getCelestialAngle(par2);
float var4 = MathHelper.cos(var3 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1705,6 +1778,12 @@
@@ -1707,6 +1780,12 @@
@SideOnly(Side.CLIENT)
public Vec3 drawClouds(float par1)
{
@@ -208,7 +208,7 @@
float var2 = this.getCelestialAngle(par1);
float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1783,7 +1862,7 @@
@@ -1785,7 +1864,7 @@
{
int var5 = var3.getBlockID(par1, var4, par2);
@@ -217,7 +217,7 @@
{
return var4 + 1;
}
@@ -1798,6 +1877,12 @@
@@ -1800,6 +1879,12 @@
* How bright are stars in the sky
*/
public float getStarBrightness(float par1)
@@ -230,7 +230,7 @@
{
float var2 = this.getCelestialAngle(par1);
float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.25F);
@@ -1942,7 +2027,7 @@
@@ -1945,7 +2030,7 @@
if (var8 != null)
{
@@ -239,7 +239,7 @@
}
}
}
@@ -1952,6 +2037,10 @@
@@ -1955,6 +2040,10 @@
if (!this.entityRemoval.isEmpty())
{
@@ -250,7 +250,7 @@
this.loadedTileEntityList.removeAll(this.entityRemoval);
this.entityRemoval.clear();
}
@@ -1972,7 +2061,9 @@
@@ -1975,7 +2064,9 @@
{
this.loadedTileEntityList.add(var9);
}
@@ -261,7 +261,7 @@
if (this.chunkExists(var9.xCoord >> 4, var9.zCoord >> 4))
{
Chunk var10 = this.getChunkFromChunkCoords(var9.xCoord >> 4, var9.zCoord >> 4);
@@ -1982,8 +2073,6 @@
@@ -1985,8 +2076,6 @@
var10.setChunkBlockTileEntity(var9.xCoord & 15, var9.yCoord, var9.zCoord & 15, var9);
}
}
@@ -270,7 +270,7 @@
}
}
@@ -1996,13 +2085,13 @@
@@ -1999,13 +2088,13 @@
public void addTileEntity(Collection par1Collection)
{
@@ -291,7 +291,7 @@
}
}
@@ -2022,9 +2111,17 @@
@@ -2025,9 +2114,17 @@
{
int var3 = MathHelper.floor_double(par1Entity.posX);
int var4 = MathHelper.floor_double(par1Entity.posZ);
@@ -312,7 +312,7 @@
{
par1Entity.lastTickPosX = par1Entity.posX;
par1Entity.lastTickPosY = par1Entity.posY;
@@ -2259,6 +2356,14 @@
@@ -2262,6 +2359,14 @@
{
return true;
}
@@ -327,7 +327,7 @@
}
}
}
@@ -2566,25 +2671,21 @@
@@ -2569,25 +2674,21 @@
*/
public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
{
@@ -368,7 +368,7 @@
}
}
@@ -2593,27 +2694,10 @@
@@ -2596,27 +2697,10 @@
*/
public void removeBlockTileEntity(int par1, int par2, int par3)
{
@@ -400,7 +400,7 @@
}
}
@@ -2639,7 +2723,8 @@
@@ -2642,7 +2726,8 @@
*/
public boolean isBlockNormalCube(int par1, int par2, int par3)
{
@@ -410,7 +410,7 @@
}
/**
@@ -2647,8 +2732,7 @@
@@ -2650,8 +2735,7 @@
*/
public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3)
{
@@ -420,7 +420,7 @@
}
/**
@@ -2664,7 +2748,7 @@
@@ -2667,7 +2751,7 @@
if (var5 != null && !var5.isEmpty())
{
Block var6 = Block.blocksList[this.getBlockId(par1, par2, par3)];
@@ -429,7 +429,7 @@
}
else
{
@@ -2695,8 +2779,7 @@
@@ -2698,8 +2782,7 @@
*/
public void setAllowedSpawnTypes(boolean par1, boolean par2)
{
@@ -439,7 +439,7 @@
}
/**
@@ -2712,6 +2795,11 @@
@@ -2715,6 +2798,11 @@
*/
private void calculateInitialWeather()
{
@@ -451,7 +451,7 @@
if (this.worldInfo.isRaining())
{
this.rainingStrength = 1.0F;
@@ -2727,6 +2815,11 @@
@@ -2730,6 +2818,11 @@
* Updates all weather states.
*/
protected void updateWeather()
@@ -463,7 +463,7 @@
{
if (!this.provider.hasNoSky)
{
@@ -2829,12 +2922,14 @@
@@ -2832,12 +2925,14 @@
public void toggleRain()
{
@@ -479,7 +479,7 @@
this.theProfiler.startSection("buildList");
int var1;
EntityPlayer var2;
@@ -2941,6 +3036,11 @@
@@ -2944,6 +3039,11 @@
*/
public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4)
{
@@ -491,7 +491,7 @@
BiomeGenBase var5 = this.getBiomeGenForCoords(par1, par3);
float var6 = var5.getFloatTemperature();
@@ -2998,6 +3098,11 @@
@@ -3001,6 +3101,11 @@
* Tests whether or not snow can be placed at a given location
*/
public boolean canSnowAt(int par1, int par2, int par3)
@@ -503,7 +503,7 @@
{
BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3);
float var5 = var4.getFloatTemperature();
@@ -3091,7 +3196,7 @@
@@ -3094,7 +3199,7 @@
private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6)
{
@@ -512,7 +512,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;
@@ -3226,7 +3331,7 @@
@@ -3229,7 +3334,7 @@
int var21 = var24 + (var18 / 2 + 1) % 3 / 2 * var19;
int var22 = var12 + (var18 / 2 + 2) % 3 / 2 * var19;
var14 = this.getSavedLightValue(par1EnumSkyBlock, var20, var21, var22);
@@ -521,7 +521,7 @@
if (var23 == 0)
{
@@ -3257,7 +3362,7 @@
@@ -3260,7 +3365,7 @@
var12 = (var9 >> 12 & 63) - 32 + par4;
var13 = this.getSavedLightValue(par1EnumSkyBlock, var10, var24, var12);
var14 = this.getBlockId(var10, var24, var12);
@@ -530,7 +530,7 @@
if (var15 == 0)
{
@@ -3359,10 +3464,10 @@
@@ -3362,10 +3467,10 @@
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB)
{
this.entitiesWithinAABBExcludingEntity.clear();
@@ -545,7 +545,7 @@
for (int var7 = var3; var7 <= var4; ++var7)
{
@@ -3388,10 +3493,10 @@
@@ -3391,10 +3496,10 @@
public List func_82733_a(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
@@ -560,7 +560,7 @@
ArrayList var8 = new ArrayList();
for (int var9 = var4; var9 <= var5; ++var9)
@@ -3485,11 +3590,14 @@
@@ -3488,11 +3593,14 @@
*/
public void addLoadedEntities(List par1List)
{
@@ -578,7 +578,7 @@
}
}
@@ -3523,6 +3631,11 @@
@@ -3526,6 +3634,11 @@
else
{
if (var9 != null && (var9 == Block.waterMoving || var9 == Block.waterStill || var9 == Block.lavaMoving || var9 == Block.lavaStill || var9 == Block.fire || var9.blockMaterial.isGroundCover()))
@@ -590,7 +590,7 @@
{
var9 = null;
}
@@ -3740,7 +3853,7 @@
@@ -3743,7 +3856,7 @@
*/
public long getSeed()
{
@@ -599,7 +599,7 @@
}
public long func_82737_E()
@@ -3750,7 +3863,7 @@
@@ -3753,7 +3866,7 @@
public long getWorldTime()
{
@@ -608,7 +608,7 @@
}
/**
@@ -3758,7 +3871,7 @@
@@ -3761,7 +3874,7 @@
*/
public void setWorldTime(long par1)
{
@@ -617,7 +617,7 @@
}
/**
@@ -3766,13 +3879,13 @@
@@ -3769,13 +3882,13 @@
*/
public ChunkCoordinates getSpawnPoint()
{
@@ -633,7 +633,7 @@
}
@SideOnly(Side.CLIENT)
@@ -3796,7 +3909,10 @@
@@ -3799,7 +3912,10 @@
if (!this.loadedEntityList.contains(par1Entity))
{
@@ -645,7 +645,7 @@
}
}
@@ -3804,6 +3920,11 @@
@@ -3807,6 +3923,11 @@
* 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)
@@ -657,7 +657,7 @@
{
return true;
}
@@ -3921,8 +4042,7 @@
@@ -3924,8 +4045,7 @@
*/
public boolean isBlockHighHumidity(int par1, int par2, int par3)
{
@@ -667,7 +667,7 @@
}
/**
@@ -3984,7 +4104,7 @@
@@ -3987,7 +4107,7 @@
*/
public int getHeight()
{
@@ -676,7 +676,7 @@
}
/**
@@ -3992,7 +4112,7 @@
@@ -3995,7 +4115,7 @@
*/
public int getActualHeight()
{
@@ -685,7 +685,7 @@
}
public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart)
@@ -4035,7 +4155,7 @@
@@ -4038,7 +4158,7 @@
*/
public double getHorizon()
{
@@ -694,7 +694,7 @@
}
/**
@@ -4074,4 +4194,75 @@
@@ -4077,4 +4197,75 @@
this.field_83016_L.setTimeInMillis(System.currentTimeMillis());
return this.field_83016_L;
}