From 2488ad2826dc05ad874d1411389825f5e4106197 Mon Sep 17 00:00:00 2001 From: LexManos Date: Fri, 8 Mar 2013 18:48:42 -0800 Subject: [PATCH] Updated to 1.5 Pre-release Updated FML: MinecraftForge/FML@2d98835db8c6a7665ef55117d60ab4318876836b Scala support! It's still primitive, I hope that people will like it. I do :) MinecraftForge/FML@5bfaf7c1700191b6ed8f4752c9a95bf8c25323ef Global object registry, also, support the new itemblockwithmetadata constructor MinecraftForge/FML@80a40c03e644840d827eb7d67ff97f6558eaa2e4 Update to MCP 1.5 and minecraft 1.5. MinecraftForge/FML@b3e854a15d7c50b4967be8237df5fdace95a15ee Update for new MCP with srg reobf. --- fml | 2 +- .../net/minecraft/block/BlockCocoa.java.patch | 6 +- .../minecraft/block/BlockContainer.java.patch | 11 -- .../block/BlockPistonBase.java.patch | 6 +- .../minecraft/block/BlockRailBase.java.patch | 4 +- .../inventory/GuiContainerCreative.java.patch | 22 ++-- .../client/renderer/EntityRenderer.java.patch | 14 +- .../command/CommandHandler.java.patch | 2 +- .../net/minecraft/entity/Entity.java.patch | 14 +- .../minecraft/entity/EntityLiving.java.patch | 2 +- .../net/minecraft/item/Item.java.patch | 6 +- .../network/NetServerHandler.java.patch | 24 ++-- .../minecraft/potion/PotionEffect.java.patch | 20 +-- .../server/MinecraftServer.java.patch | 2 +- .../management/PlayerInstance.java.patch | 36 ++--- .../ServerConfigurationManager.java.patch | 10 +- .../net/minecraft/world/World.java.patch | 124 ++++++++++-------- .../minecraft/world/WorldProvider.java.patch | 4 +- .../minecraft/world/WorldServer.java.patch | 34 ++--- .../minecraft/world/chunk/Chunk.java.patch | 29 ++-- .../world/gen/ChunkProviderServer.java.patch | 10 +- 21 files changed, 192 insertions(+), 190 deletions(-) delete mode 100644 patches/minecraft/net/minecraft/block/BlockContainer.java.patch diff --git a/fml b/fml index 81c6421f8..b3e854a15 160000 --- a/fml +++ b/fml @@ -1 +1 @@ -Subproject commit 81c6421f84c1bff359dfe927974e8730b348806a +Subproject commit b3e854a15d7c50b4967be8237df5fdace95a15ee diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch index 3280df818..08b7bf4a7 100644 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -9,7 +9,7 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; -@@ -197,7 +199,14 @@ +@@ -202,7 +204,14 @@ */ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { @@ -25,7 +25,7 @@ byte b0 = 1; if (j1 >= 2) -@@ -207,8 +216,9 @@ +@@ -212,8 +221,9 @@ for (int k1 = 0; k1 < b0; ++k1) { @@ -37,7 +37,7 @@ } @SideOnly(Side.CLIENT) -@@ -239,4 +249,10 @@ +@@ -244,4 +254,10 @@ this.field_94469_b[i] = par1IconRegister.func_94245_a(field_94470_a[i]); } } diff --git a/patches/minecraft/net/minecraft/block/BlockContainer.java.patch b/patches/minecraft/net/minecraft/block/BlockContainer.java.patch deleted file mode 100644 index 032909443..000000000 --- a/patches/minecraft/net/minecraft/block/BlockContainer.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src_base/minecraft/net/minecraft/block/BlockContainer.java -+++ ../src_work/minecraft/net/minecraft/block/BlockContainer.java -@@ -18,7 +18,7 @@ - public void onBlockAdded(World par1World, int par2, int par3, int par4) - { - super.onBlockAdded(par1World, par2, par3, par4); -- par1World.setBlockTileEntity(par2, par3, par4, this.createNewTileEntity(par1World)); -+ par1World.setBlockTileEntity(par2, par3, par4, this.createTileEntity(par1World, par1World.getBlockMetadata(par2, par3, par4))); - } - - /** diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index 8a9195f1a..57b314c2c 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/block/BlockPistonBase.java +++ ../src_work/minecraft/net/minecraft/block/BlockPistonBase.java -@@ -435,7 +435,7 @@ +@@ -426,7 +426,7 @@ return false; } @@ -9,7 +9,7 @@ } } -@@ -453,7 +453,7 @@ +@@ -444,7 +444,7 @@ { if (l1 < 13) { @@ -18,7 +18,7 @@ { return false; } -@@ -503,7 +503,7 @@ +@@ -494,7 +494,7 @@ if (l1 < 13) { diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch index a75ab7c0d..02b9ccd42 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -26,8 +26,8 @@ } /** -@@ -236,4 +237,107 @@ - par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, par5); +@@ -242,4 +243,107 @@ + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, par5); } } + diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch index 5f6f41175..14dd0556f 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -@@ -55,6 +55,8 @@ +@@ -56,6 +56,8 @@ private Slot field_74235_v = null; private boolean field_74234_w = false; private CreativeCrafting field_82324_x; @@ -9,7 +9,7 @@ public GuiContainerCreative(EntityPlayer par1EntityPlayer) { -@@ -273,6 +275,13 @@ +@@ -274,6 +276,13 @@ this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]); this.field_82324_x = new CreativeCrafting(this.mc); this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x); @@ -23,7 +23,7 @@ } else { -@@ -407,7 +416,7 @@ +@@ -408,7 +417,7 @@ { CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; @@ -32,7 +32,7 @@ { this.fontRenderer.drawString(creativetabs.getTranslatedTabLabel(), 8, 6, 4210752); } -@@ -456,7 +465,7 @@ +@@ -457,7 +466,7 @@ { CreativeTabs creativetabs = acreativetabs[k1]; @@ -41,7 +41,7 @@ { this.setCurrentCreativeTab(creativetabs); return; -@@ -472,11 +481,17 @@ +@@ -473,11 +482,17 @@ */ private boolean needsScrollBars() { @@ -59,7 +59,7 @@ int i = selectedTabIndex; selectedTabIndex = par1CreativeTabs.getTabIndex(); ContainerCreative containercreative = (ContainerCreative)this.inventorySlots; -@@ -647,21 +662,42 @@ +@@ -648,21 +663,42 @@ super.drawScreen(par1, par2, par3); CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; @@ -107,7 +107,7 @@ } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -680,14 +716,32 @@ +@@ -681,14 +717,32 @@ int k = acreativetabs.length; int l; @@ -142,7 +142,7 @@ } } -@@ -705,6 +759,14 @@ +@@ -706,6 +760,14 @@ this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); } @@ -157,7 +157,7 @@ this.renderCreativeTab(creativetabs); if (creativetabs == CreativeTabs.tabInventory) -@@ -715,6 +777,15 @@ +@@ -716,6 +778,15 @@ protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3) { @@ -173,7 +173,7 @@ int k = par1CreativeTabs.getTabColumn(); int l = 28 * k; byte b0 = 0; -@@ -829,7 +900,7 @@ +@@ -830,7 +901,7 @@ i1 += 8 + (flag1 ? 1 : -1); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL12.GL_RESCALE_NORMAL); @@ -182,7 +182,7 @@ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, itemstack, l, i1); itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, itemstack, l, i1); GL11.glDisable(GL11.GL_LIGHTING); -@@ -851,6 +922,15 @@ +@@ -852,6 +923,15 @@ { this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); } diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index b86635459..21ee96ffd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -30,7 +30,7 @@ this.fovModifierHandPrev = this.fovModifierHand; this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; -@@ -361,7 +373,7 @@ +@@ -366,7 +378,7 @@ } else { @@ -39,7 +39,7 @@ float f1 = 70.0F; if (par2) -@@ -448,15 +460,7 @@ +@@ -453,15 +465,7 @@ if (!this.mc.gameSettings.debugCamEnable) { @@ -56,7 +56,7 @@ GL11.glRotatef(entityliving.prevRotationYaw + (entityliving.rotationYaw - entityliving.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F); GL11.glRotatef(entityliving.prevRotationPitch + (entityliving.rotationPitch - entityliving.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F); } -@@ -1131,7 +1135,9 @@ +@@ -1142,7 +1146,9 @@ { RenderHelper.enableStandardItemLighting(); this.mc.mcProfiler.endStartSection("entities"); @@ -66,7 +66,7 @@ this.enableLightmap((double)par1); this.mc.mcProfiler.endStartSection("litParticles"); effectrenderer.renderLitParticles(entityliving, par1); -@@ -1146,8 +1152,11 @@ +@@ -1157,8 +1163,11 @@ entityplayer = (EntityPlayer)entityliving; GL11.glDisable(GL11.GL_ALPHA_TEST); this.mc.mcProfiler.endStartSection("outline"); @@ -80,7 +80,7 @@ GL11.glEnable(GL11.GL_ALPHA_TEST); } } -@@ -1202,6 +1211,13 @@ +@@ -1213,6 +1222,13 @@ renderglobal.sortAndRender(entityliving, 1, (double)par1); } @@ -94,7 +94,7 @@ GL11.glDepthMask(true); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); -@@ -1211,15 +1227,18 @@ +@@ -1222,15 +1238,18 @@ entityplayer = (EntityPlayer)entityliving; GL11.glDisable(GL11.GL_ALPHA_TEST); this.mc.mcProfiler.endStartSection("outline"); @@ -116,7 +116,7 @@ GL11.glDisable(GL11.GL_BLEND); this.mc.mcProfiler.endStartSection("weather"); this.renderRainSnow(par1); -@@ -1232,6 +1251,9 @@ +@@ -1248,6 +1267,9 @@ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); this.renderHand(par1, j); } diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index 5df73acfa..a54a0df8b 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -10,7 +10,7 @@ public class CommandHandler implements ICommandManager { /** Map of Strings to the ICommand objects they represent */ -@@ -42,6 +45,16 @@ +@@ -44,6 +47,16 @@ if (icommand.canCommandSenderUseCommand(par1ICommandSender)) { diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index dd2230481..fde11d73b 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -42,7 +42,7 @@ public Entity(World par1World) { -@@ -547,7 +559,7 @@ +@@ -554,7 +566,7 @@ if (!this.worldObj.isRemote) { this.setFlag(0, this.fire > 0); @@ -51,7 +51,7 @@ } this.firstUpdate = false; -@@ -1527,6 +1539,10 @@ +@@ -1534,6 +1546,10 @@ par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal); par1NBTTagCompound.setLong("UUIDMost", this.field_96093_i.getMostSignificantBits()); par1NBTTagCompound.setLong("UUIDLeast", this.field_96093_i.getLeastSignificantBits()); @@ -62,7 +62,7 @@ this.writeEntityToNBT(par1NBTTagCompound); if (this.ridingEntity != null) -@@ -1597,6 +1613,15 @@ +@@ -1604,6 +1620,15 @@ this.setPosition(this.posX, this.posY, this.posZ); this.setRotation(this.rotationYaw, this.rotationPitch); @@ -78,7 +78,7 @@ this.readEntityFromNBT(par1NBTTagCompound); } catch (Throwable throwable) -@@ -1691,7 +1716,14 @@ +@@ -1698,7 +1723,14 @@ { EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); entityitem.delayBeforeCanPickup = 10; @@ -94,7 +94,7 @@ return entityitem; } -@@ -2049,7 +2081,7 @@ +@@ -2056,7 +2088,7 @@ */ public boolean isRiding() { @@ -103,7 +103,7 @@ } /** -@@ -2393,7 +2425,7 @@ +@@ -2400,7 +2432,7 @@ 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) -@@ -2448,4 +2480,89 @@ +@@ -2455,4 +2487,89 @@ { return this.getEntityName(); } diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index ce8df93be..050311ee9 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -160,7 +160,7 @@ /** * Remove the speified potion effect from this entity. */ -@@ -3057,4 +3104,42 @@ +@@ -3059,4 +3106,42 @@ { this.canPickUpLoot = par1; } diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index ff1cfcd29..237d95a9b 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -18,7 +18,7 @@ public class Item { -@@ -242,13 +245,16 @@ +@@ -238,13 +241,16 @@ /** Icon index in the icons table. */ protected Icon iconIndex; @@ -36,7 +36,7 @@ } itemsList[256 + par1] = this; -@@ -640,6 +646,10 @@ +@@ -636,6 +642,10 @@ float f7 = f4 * f5; float f8 = f3 * f5; double d3 = 5.0D; @@ -47,7 +47,7 @@ Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); } -@@ -720,4 +730,324 @@ +@@ -716,4 +726,324 @@ { StatList.initStats(); } diff --git a/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch b/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch index a027dee1b..50e8fbb83 100644 --- a/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch +++ b/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch @@ -14,7 +14,7 @@ public class NetServerHandler extends NetHandler { /** The underlying network manager for this server handler. */ -@@ -238,6 +245,11 @@ +@@ -233,6 +240,11 @@ if (this.playerEntity.ridingEntity != null) { this.playerEntity.ridingEntity.updateRiderPosition(); @@ -26,7 +26,7 @@ } this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); -@@ -310,9 +322,9 @@ +@@ -305,9 +317,9 @@ d4 = d1 - this.playerEntity.posX; double d6 = d2 - this.playerEntity.posY; double d7 = d3 - this.playerEntity.posZ; @@ -39,7 +39,7 @@ double d11 = d8 * d8 + d9 * d9 + d10 * d10; if (d11 > 100.0D && (!this.mcServer.isSinglePlayer() || !this.mcServer.getServerOwner().equals(this.playerEntity.username))) -@@ -328,6 +340,11 @@ +@@ -323,6 +335,11 @@ if (this.playerEntity.onGround && !par1Packet10Flying.onGround && d6 > 0.0D) { this.playerEntity.addExhaustion(0.2F); @@ -51,7 +51,7 @@ } this.playerEntity.moveEntity(d4, d6, d7); -@@ -352,10 +369,15 @@ +@@ -347,10 +364,15 @@ 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); return; -@@ -363,7 +385,7 @@ +@@ -358,7 +380,7 @@ 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) { -@@ -382,6 +404,11 @@ +@@ -377,6 +399,11 @@ this.ticksForFloatKick = 0; } @@ -89,7 +89,7 @@ this.playerEntity.onGround = par1Packet10Flying.onGround; this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); this.playerEntity.updateFlyingState(this.playerEntity.posY - d0, par1Packet10Flying.onGround); -@@ -448,7 +475,10 @@ +@@ -443,7 +470,10 @@ double d2 = this.playerEntity.posZ - ((double)k + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; @@ -101,7 +101,7 @@ { return; } -@@ -508,7 +538,11 @@ +@@ -503,7 +533,11 @@ return; } @@ -114,7 +114,7 @@ } else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit())) { -@@ -517,7 +551,9 @@ +@@ -512,7 +546,9 @@ } else { @@ -125,7 +125,7 @@ { this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset()); } -@@ -696,7 +732,14 @@ +@@ -691,7 +727,14 @@ return; } @@ -140,7 +140,7 @@ this.mcServer.func_98033_al().func_98233_a(s); this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(s, false)); } -@@ -827,7 +870,7 @@ +@@ -822,7 +865,7 @@ return; } @@ -149,7 +149,7 @@ } } } -@@ -1225,7 +1268,6 @@ +@@ -1220,7 +1263,6 @@ } } } diff --git a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch index 6a771602e..e13b709f1 100644 --- a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -1,20 +1,22 @@ --- ../src_base/minecraft/net/minecraft/potion/PotionEffect.java +++ ../src_work/minecraft/net/minecraft/potion/PotionEffect.java -@@ -1,6 +1,11 @@ +@@ -1,8 +1,13 @@ package net.minecraft.potion; - ++ +import java.util.ArrayList; +import java.util.List; -+ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLiving; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; public class PotionEffect -@@ -20,6 +25,9 @@ - /** Whether the potion effect came from a beacon */ - private boolean isAmbient; +@@ -24,6 +29,9 @@ + @SideOnly(Side.CLIENT) + private boolean field_100013_f; + /** List of ItemStack that can cure the potion effect **/ + private List curativeItems; @@ -22,7 +24,7 @@ public PotionEffect(int par1, int par2) { this(par1, par2, 0); -@@ -36,6 +44,8 @@ +@@ -40,6 +48,8 @@ this.duration = par2; this.amplifier = par3; this.isAmbient = par4; @@ -31,7 +33,7 @@ } public PotionEffect(PotionEffect par1PotionEffect) -@@ -43,6 +53,7 @@ +@@ -47,6 +57,7 @@ this.potionID = par1PotionEffect.potionID; this.duration = par1PotionEffect.duration; this.amplifier = par1PotionEffect.amplifier; @@ -39,7 +41,7 @@ } /** -@@ -87,6 +98,63 @@ +@@ -91,6 +102,63 @@ public int getAmplifier() { return this.amplifier; diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 5a7514fe1..3facdbead 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -162,7 +162,7 @@ } @SideOnly(Side.SERVER) -@@ -1105,6 +1103,7 @@ +@@ -1102,6 +1100,7 @@ if (worldserver != null) { diff --git a/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch index b625c85cd..161d1b172 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch @@ -18,51 +18,51 @@ public class PlayerInstance { -@@ -64,6 +68,8 @@ - this.players.remove(par1EntityPlayerMP); +@@ -56,6 +60,8 @@ + this.playersInChunk.remove(par1EntityPlayerMP); par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); + MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(chunkLocation, par1EntityPlayerMP)); + - if (this.players.isEmpty()) + if (this.playersInChunk.isEmpty()) { long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; -@@ -91,7 +97,7 @@ +@@ -80,7 +86,7 @@ this.field_73260_f |= 1 << (par2 >> 4); -- if (this.numBlocksToUpdate < 64) +- if (this.numberOfTilesToUpdate < 64) + //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run { short short1 = (short)(par1 << 12 | par3 << 8 | par2); -@@ -103,6 +109,10 @@ +@@ -92,6 +98,10 @@ } } -+ if (numBlocksToUpdate == blocksToUpdate.length) ++ if (numberOfTilesToUpdate == locationOfBlockChange.length) + { -+ blocksToUpdate = Arrays.copyOf(blocksToUpdate, blocksToUpdate.length << 1); ++ locationOfBlockChange = Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); + } - this.blocksToUpdate[this.numBlocksToUpdate++] = short1; + this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1; } } -@@ -147,12 +157,13 @@ +@@ -133,12 +143,13 @@ { int l; -- if (this.numBlocksToUpdate == 64) -+ if (this.numBlocksToUpdate >= ForgeDummyContainer.clumpingThreshold) +- if (this.numberOfTilesToUpdate == 64) ++ if (this.numberOfTilesToUpdate >= ForgeDummyContainer.clumpingThreshold)) { i = this.chunkLocation.chunkXPos * 16; j = this.chunkLocation.chunkZPos * 16; - this.sendPacketToPlayersInInstance(new Packet51MapChunk(PlayerManager.getWorldServer(this.myManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.field_73260_f)); + this.sendToAllPlayersWatchingChunk(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 for (k = 0; k < 16; ++k) { if ((this.field_73260_f & 1 << k) != 0) -@@ -166,11 +177,15 @@ +@@ -152,11 +163,14 @@ } } } @@ -70,11 +70,11 @@ } else { - this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.myManager))); - + this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, 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 - for (i = 0; i < this.numBlocksToUpdate; ++i) + for (i = 0; i < this.numberOfTilesToUpdate; ++i) { - j = this.chunkLocation.chunkXPos * 16 + (this.blocksToUpdate[i] >> 12 & 15); + j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15); diff --git a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch index e241a1b0d..b7657c7af 100644 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -40,8 +40,8 @@ entityplayermp1.entityId = par1EntityPlayerMP.entityId; WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver); -@@ -455,6 +470,11 @@ - */ +@@ -452,6 +467,11 @@ + public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2) { + transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).getDefaultTeleporter()); @@ -52,7 +52,7 @@ int j = par1EntityPlayerMP.dimension; WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); par1EntityPlayerMP.dimension = par2; -@@ -462,7 +482,7 @@ +@@ -459,7 +479,7 @@ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType())); worldserver.removePlayerEntityDangerously(par1EntityPlayerMP); par1EntityPlayerMP.isDead = false; @@ -61,7 +61,7 @@ this.func_72375_a(par1EntityPlayerMP, worldserver); par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1); -@@ -484,38 +504,23 @@ +@@ -481,38 +501,23 @@ */ public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) { @@ -111,7 +111,7 @@ { ChunkCoordinates chunkcoordinates; -@@ -552,7 +557,7 @@ +@@ -549,7 +554,7 @@ par4WorldServer.spawnEntityInWorld(par1Entity); par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); par4WorldServer.updateEntityWithOptionalForce(par1Entity, false); diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index b31082476..9ec54faf6 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -209,7 +209,7 @@ { float f1 = this.getCelestialAngle(par2); float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1803,6 +1882,12 @@ +@@ -1802,6 +1881,12 @@ @SideOnly(Side.CLIENT) public Vec3 getCloudColour(float par1) { @@ -222,7 +222,7 @@ float f1 = this.getCelestialAngle(par1); float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1881,7 +1966,7 @@ +@@ -1880,7 +1965,7 @@ { int l = chunk.getBlockID(par1, k, par2); @@ -231,7 +231,7 @@ { return k + 1; } -@@ -1896,6 +1981,12 @@ +@@ -1895,6 +1980,12 @@ * How bright are stars in the sky */ public float getStarBrightness(float par1) @@ -244,7 +244,7 @@ { float f1 = this.getCelestialAngle(par1); float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); -@@ -2031,16 +2122,8 @@ +@@ -2030,16 +2121,8 @@ if (entity.isDead) { @@ -263,7 +263,7 @@ } this.theProfiler.endSection(); -@@ -2079,7 +2162,7 @@ +@@ -2078,7 +2161,7 @@ if (chunk != null) { @@ -272,7 +272,7 @@ } } } -@@ -2088,6 +2171,10 @@ +@@ -2087,6 +2170,10 @@ if (!this.entityRemoval.isEmpty()) { @@ -283,7 +283,7 @@ this.loadedTileEntityList.removeAll(this.entityRemoval); this.entityRemoval.clear(); } -@@ -2108,18 +2195,18 @@ +@@ -2107,18 +2194,18 @@ { this.loadedTileEntityList.add(tileentity1); } @@ -306,7 +306,7 @@ } } -@@ -2132,13 +2219,13 @@ +@@ -2131,13 +2218,13 @@ public void addTileEntity(Collection par1Collection) { @@ -327,7 +327,7 @@ } } -@@ -2158,9 +2245,17 @@ +@@ -2157,9 +2244,17 @@ { int i = MathHelper.floor_double(par1Entity.posX); int j = MathHelper.floor_double(par1Entity.posZ); @@ -348,7 +348,7 @@ { par1Entity.lastTickPosX = par1Entity.posX; par1Entity.lastTickPosY = par1Entity.posY; -@@ -2393,6 +2488,14 @@ +@@ -2392,6 +2487,14 @@ { return true; } @@ -363,7 +363,7 @@ } } } -@@ -2698,25 +2801,21 @@ +@@ -2714,38 +2817,38 @@ */ public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) { @@ -374,10 +374,35 @@ - par4TileEntity.xCoord = par1; - par4TileEntity.yCoord = par2; - par4TileEntity.zCoord = par3; +- Iterator iterator = this.addedTileEntityList.iterator(); +- ++ if (par4TileEntity == null || par4TileEntity.isInvalid()) ++ { ++ return; ++ } ++ ++ if (par4TileEntity.canUpdate()) ++ { ++ if (scanningTileEntities) ++ { ++ Iterator iterator = addedTileEntityList.iterator(); + while (iterator.hasNext()) + { + TileEntity tileentity1 = (TileEntity)iterator.next(); +- ++ + if (tileentity1.xCoord == par1 && tileentity1.yCoord == par2 && tileentity1.zCoord == par3) + { + tileentity1.invalidate(); + iterator.remove(); + } + } +- - this.addedTileEntityList.add(par4TileEntity); -- } -- else -- { ++ addedTileEntityList.add(par4TileEntity); + } + else + { - this.loadedTileEntityList.add(par4TileEntity); - Chunk chunk = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); - @@ -386,25 +411,18 @@ - chunk.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); - } - } -+ if (par4TileEntity == null || par4TileEntity.isInvalid()) -+ { -+ return; ++ loadedTileEntityList.add(par4TileEntity); ++ } + } + -+ if (par4TileEntity.canUpdate()) -+ { -+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList; -+ dest.add(par4TileEntity); -+ } -+ -+ Chunk chunk = getChunkFromChunkCoords(par1 >> 4, par3 >> 4); ++ Chunk chunk = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); + if (chunk != null) + { + chunk.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); } } -@@ -2725,27 +2824,10 @@ +@@ -2754,27 +2857,10 @@ */ public void removeBlockTileEntity(int par1, int par2, int par3) { @@ -436,7 +454,7 @@ } } -@@ -2771,7 +2853,8 @@ +@@ -2800,7 +2886,8 @@ */ public boolean isBlockNormalCube(int par1, int par2, int par3) { @@ -446,7 +464,7 @@ } public boolean func_85174_u(int par1, int par2, int par3) -@@ -2794,8 +2877,7 @@ +@@ -2823,8 +2910,7 @@ */ public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3) { @@ -456,7 +474,7 @@ } /** -@@ -2811,7 +2893,7 @@ +@@ -2840,7 +2926,7 @@ if (chunk != null && !chunk.isEmpty()) { Block block = Block.blocksList[this.getBlockId(par1, par2, par3)]; @@ -465,7 +483,7 @@ } else { -@@ -2842,8 +2924,7 @@ +@@ -2871,8 +2957,7 @@ */ public void setAllowedSpawnTypes(boolean par1, boolean par2) { @@ -475,7 +493,7 @@ } /** -@@ -2859,6 +2940,11 @@ +@@ -2888,6 +2973,11 @@ */ private void calculateInitialWeather() { @@ -487,7 +505,7 @@ if (this.worldInfo.isRaining()) { this.rainingStrength = 1.0F; -@@ -2874,6 +2960,11 @@ +@@ -2903,6 +2993,11 @@ * Updates all weather states. */ protected void updateWeather() @@ -499,9 +517,9 @@ { if (!this.provider.hasNoSky) { -@@ -2974,12 +3065,14 @@ - */ - public void commandToggleDownfall() +@@ -3000,12 +3095,14 @@ + + public void toggleRain() { - this.worldInfo.setRainTime(1); + provider.toggleRain(); @@ -515,7 +533,7 @@ this.theProfiler.startSection("buildList"); int i; EntityPlayer entityplayer; -@@ -3086,6 +3179,11 @@ +@@ -3112,6 +3209,11 @@ */ public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) { @@ -527,7 +545,7 @@ BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); float f = biomegenbase.getFloatTemperature(); -@@ -3144,6 +3242,11 @@ +@@ -3170,6 +3272,11 @@ */ public boolean canSnowAt(int par1, int par2, int par3) { @@ -539,7 +557,7 @@ BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); float f = biomegenbase.getFloatTemperature(); -@@ -3187,10 +3290,12 @@ +@@ -3213,10 +3320,12 @@ else { int l = this.getBlockId(par1, par2, par3); @@ -556,7 +574,7 @@ { j1 = 1; } -@@ -3286,7 +3391,9 @@ +@@ -3312,7 +3421,9 @@ int j4 = i2 + Facing.offsetsXForSide[i4]; int k4 = j2 + Facing.offsetsYForSide[i4]; int l4 = k2 + Facing.offsetsZForSide[i4]; @@ -567,7 +585,7 @@ i3 = this.getSavedLightValue(par1EnumSkyBlock, j4, k4, l4); if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length) -@@ -3389,10 +3496,10 @@ +@@ -3415,10 +3526,10 @@ public List func_94576_a(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { ArrayList arraylist = new ArrayList(); @@ -582,7 +600,7 @@ for (int i1 = i; i1 <= j; ++i1) { -@@ -3418,10 +3525,10 @@ +@@ -3444,10 +3555,10 @@ public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { @@ -597,7 +615,7 @@ ArrayList arraylist = new ArrayList(); for (int i1 = i; i1 <= j; ++i1) -@@ -3514,11 +3621,14 @@ +@@ -3540,11 +3651,14 @@ */ public void addLoadedEntities(List par1List) { @@ -615,7 +633,7 @@ } } -@@ -3552,6 +3662,11 @@ +@@ -3578,6 +3692,11 @@ else { if (block != null && (block == Block.waterMoving || block == Block.waterStill || block == Block.lavaMoving || block == Block.lavaStill || block == Block.fire || block.blockMaterial.isReplaceable())) @@ -627,7 +645,7 @@ { block = null; } -@@ -3840,7 +3955,7 @@ +@@ -3866,7 +3985,7 @@ */ public long getSeed() { @@ -636,7 +654,7 @@ } public long getTotalWorldTime() -@@ -3850,7 +3965,7 @@ +@@ -3876,7 +3995,7 @@ public long getWorldTime() { @@ -645,7 +663,7 @@ } /** -@@ -3858,7 +3973,7 @@ +@@ -3884,7 +4003,7 @@ */ public void setWorldTime(long par1) { @@ -654,7 +672,7 @@ } /** -@@ -3866,13 +3981,13 @@ +@@ -3892,13 +4011,13 @@ */ public ChunkCoordinates getSpawnPoint() { @@ -670,7 +688,7 @@ } @SideOnly(Side.CLIENT) -@@ -3896,7 +4011,10 @@ +@@ -3922,7 +4041,10 @@ if (!this.loadedEntityList.contains(par1Entity)) { @@ -682,7 +700,7 @@ } } -@@ -3904,6 +4022,11 @@ +@@ -3930,6 +4052,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) @@ -694,7 +712,7 @@ { return true; } -@@ -4024,8 +4147,7 @@ +@@ -4050,8 +4177,7 @@ */ public boolean isBlockHighHumidity(int par1, int par2, int par3) { @@ -704,7 +722,7 @@ } /** -@@ -4100,7 +4222,7 @@ +@@ -4126,7 +4252,7 @@ */ public int getHeight() { @@ -713,7 +731,7 @@ } /** -@@ -4108,7 +4230,7 @@ +@@ -4134,7 +4260,7 @@ */ public int getActualHeight() { @@ -722,7 +740,7 @@ } public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart) -@@ -4151,7 +4273,7 @@ +@@ -4177,7 +4303,7 @@ */ public double getHorizon() { @@ -731,7 +749,7 @@ } /** -@@ -4254,4 +4376,98 @@ +@@ -4280,4 +4406,98 @@ { return this.field_98181_L; } diff --git a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch index a1ba6bb8d..3131361df 100644 --- a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch @@ -24,7 +24,7 @@ public abstract class WorldProvider { -@@ -198,7 +205,7 @@ +@@ -197,7 +204,7 @@ public static WorldProvider getProviderForDimension(int par0) { @@ -33,7 +33,7 @@ } @SideOnly(Side.CLIENT) -@@ -267,4 +274,277 @@ +@@ -266,4 +273,277 @@ * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". */ public abstract String getDimensionName(); diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index ef7233128..04df23f9e 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -124,17 +124,17 @@ { this.updateLCG = this.updateLCG * 3 + 1013904223; i1 = this.updateLCG >> 2; -@@ -430,7 +459,8 @@ +@@ -430,6 +459,9 @@ public void func_82740_a(int par1, int par2, int par3, int par4, int par5, int par6) { NextTickListEntry nextticklistentry = new NextTickListEntry(par1, par2, par3, par4); -- byte b0 = 8; -+ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); -+ byte b0 = isForced ? (byte)0 : 8; ++ //Keeping here as a note for future when it may be restored. ++ //boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); ++ //byte b0 = isForced ? 0 : 8; + byte b0 = 0; if (this.scheduledUpdatesAreImmediate && par4 > 0) - { -@@ -493,7 +523,7 @@ +@@ -493,7 +525,7 @@ */ public void updateEntities() { @@ -143,17 +143,17 @@ { if (this.updateEntityTick++ >= 1200) { -@@ -559,7 +589,8 @@ +@@ -559,6 +591,9 @@ { nextticklistentry = (NextTickListEntry)iterator.next(); iterator.remove(); -- byte b0 = 8; -+ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); -+ byte b0 = isForced ? (byte)0 : 8; ++ //Keeping here as a note for future when it may be restored. ++ //boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); ++ //byte b0 = isForced ? 0 : 8; + byte b0 = 0; if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0)) - { -@@ -698,16 +729,28 @@ +@@ -702,16 +737,28 @@ { ArrayList arraylist = new ArrayList(); @@ -192,7 +192,7 @@ return arraylist; } -@@ -715,6 +758,11 @@ +@@ -719,6 +766,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) @@ -204,7 +204,7 @@ { return !this.mcServer.func_96290_a(this, par2, par3, par4, par1EntityPlayer); } -@@ -799,7 +847,7 @@ +@@ -803,7 +855,7 @@ */ protected void createBonusChest() { @@ -213,7 +213,7 @@ for (int i = 0; i < 10; ++i) { -@@ -842,6 +890,7 @@ +@@ -846,6 +898,7 @@ } this.chunkProvider.saveChunks(par1, par2IProgressUpdate); @@ -221,7 +221,7 @@ } } -@@ -853,6 +902,7 @@ +@@ -857,6 +910,7 @@ this.checkSessionLock(); this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); this.mapStorage.saveAllData(); @@ -229,7 +229,7 @@ } /** -@@ -1066,4 +1116,9 @@ +@@ -1070,4 +1124,9 @@ { return this.field_85177_Q; } diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch index 6405acbd4..5903c5cb2 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -334,24 +334,17 @@ } } -@@ -938,8 +1036,14 @@ +@@ -938,7 +1036,8 @@ par4TileEntity.yCoord = par2; par4TileEntity.zCoord = this.zPosition * 16 + par3; - if (this.getBlockID(par1, par2, par3) != 0 && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof ITileEntityProvider) -- { + Block block = Block.blocksList[getBlockID(par1, par2, par3)]; + if (block != null && block.hasTileEntity(getBlockMetadata(par1, par2, par3))) -+ { -+ TileEntity old = (TileEntity)chunkTileEntityMap.get(chunkposition); -+ if (old != null) -+ { -+ old.invalidate(); -+ } - par4TileEntity.validate(); - this.chunkTileEntityMap.put(chunkposition, par4TileEntity); - } -@@ -975,6 +1079,7 @@ + { + if (this.chunkTileEntityMap.containsKey(chunkposition)) + { +@@ -980,6 +1079,7 @@ { this.worldObj.addLoadedEntities(this.entityLists[i]); } @@ -359,7 +352,7 @@ } /** -@@ -995,6 +1100,7 @@ +@@ -1000,6 +1100,7 @@ { this.worldObj.unloadEntities(this.entityLists[i]); } @@ -367,7 +360,7 @@ } /** -@@ -1011,8 +1117,8 @@ +@@ -1016,8 +1117,8 @@ */ public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { @@ -378,7 +371,7 @@ if (i < 0) { -@@ -1061,8 +1167,8 @@ +@@ -1066,8 +1167,8 @@ */ public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { @@ -389,7 +382,7 @@ if (i < 0) { -@@ -1245,6 +1351,15 @@ +@@ -1250,6 +1351,15 @@ */ public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) { @@ -405,7 +398,7 @@ int k = 0; boolean flag1 = !this.worldObj.provider.hasNoSky; int l; -@@ -1345,12 +1460,26 @@ +@@ -1350,12 +1460,26 @@ } this.generateHeightMap(); @@ -436,7 +429,7 @@ } } -@@ -1459,4 +1588,18 @@ +@@ -1464,4 +1588,18 @@ } } } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index b53679d81..5d1da1540 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -10,7 +10,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.crash.CrashReport; -@@ -74,7 +77,7 @@ +@@ -66,7 +69,7 @@ */ public void unloadChunksIfNotNearSpawn(int par1, int par2) { @@ -19,7 +19,7 @@ { ChunkCoordinates chunkcoordinates = this.worldObj.getSpawnPoint(); int k = par1 * 16 + 8 - chunkcoordinates.posX; -@@ -117,7 +120,11 @@ +@@ -109,7 +112,11 @@ if (chunk == null) { @@ -32,7 +32,7 @@ if (chunk == null) { -@@ -313,6 +320,11 @@ +@@ -305,6 +312,11 @@ { if (!this.worldObj.canNotSave) { @@ -44,9 +44,9 @@ for (int i = 0; i < 100; ++i) { if (!this.chunksToUnload.isEmpty()) -@@ -325,6 +337,11 @@ +@@ -317,6 +329,11 @@ this.chunksToUnload.remove(olong); - this.id2ChunkMap.remove(olong.longValue()); + this.loadedChunkHashMap.remove(olong.longValue()); this.loadedChunks.remove(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)) {