diff --git a/client/net/minecraftforge/client/GuiControlsScrollPanel.java b/client/net/minecraftforge/client/GuiControlsScrollPanel.java index d5d69f8fe0..b9c5bb1dc6 100644 --- a/client/net/minecraftforge/client/GuiControlsScrollPanel.java +++ b/client/net/minecraftforge/client/GuiControlsScrollPanel.java @@ -9,6 +9,7 @@ import net.minecraft.client.gui.GuiControls; import net.minecraft.client.gui.GuiSlot; import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.EnumChatFormatting; public class GuiControlsScrollPanel extends GuiSlot { @@ -105,8 +106,9 @@ public class GuiControlsScrollPanel extends GuiSlot break; } } - String str = (conflict ? "\247c" : "") + options.getOptionDisplayString(index); - str = (index == selected ? "\247f> \247e??? \247f<" : str); + + String str = (conflict ? EnumChatFormatting.RED : "") + options.getOptionDisplayString(index); + str = (index == selected ? EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<" : str); controls.drawCenteredString(mc.fontRenderer, str, xPosition + (width / 2), yPosition + (height - 8) / 2, 0xFFFFFFFF); } diff --git a/common/forge_at.cfg b/common/forge_at.cfg index 53c5dbf682..be0a886940 100644 --- a/common/forge_at.cfg +++ b/common/forge_at.cfg @@ -1,128 +1,126 @@ #Main Forge Access Transformer configuration file -# RailLogic.getNAdjacentTracks -# -- MISSING MAPPING public als.a(Lals;)I #MD:RailLogic/func_73650_a # Tessellator -public-f bcc.a #FD:Tessellator/field_78398_a #instance -public bcc.u #FD:Tessellator/field_78409_u #drawMode -public bcc.v #FD:Tessellator/field_78408_v #xOffset -public bcc.w #FD:Tessellator/field_78407_w #yOffset -public bcc.x #FD:Tessellator/field_78417_x #zOffset -public bcc.z #FD:Tessellator/field_78415_z #isDrawing +public-f bfc.a #FD:Tessellator/field_78398_a #instance +public bfc.u #FD:Tessellator/field_78409_u #drawMode +public bfc.v #FD:Tessellator/field_78408_v #xOffset +public bfc.w #FD:Tessellator/field_78407_w #yOffset +public bfc.x #FD:Tessellator/field_78417_x #zOffset +public bfc.z #FD:Tessellator/field_78415_z #isDrawing # ItemPickaxe -public vj.(ILvb;)V #MD:ItemPickaxe/(ILnet/minecraft/src/EnumToolMaterial;) #constructor -public+f vj.c #FD:ItemPickaxe/field_77867_c #blocksEffectiveAgainst +public wf.(ILvw;)V #MD:ItemPickaxe/(ILnet/minecraft/src/EnumToolMaterial;) #constructor +public+f wf.c #FD:ItemPickaxe/field_77867_c #blocksEffectiveAgainst # ItemAxe -public uy.(ILvb;)V #MD:ItemAxe/(ILnet/minecraft/src/EnumToolMaterial;) #constructor -public+f uy.c #FD:ItemAxe/field_77868_c #blocksEffectiveAgainst +public vt.(ILvw;)V #MD:ItemAxe/(ILnet/minecraft/src/EnumToolMaterial;) #constructor +public+f vt.c #FD:ItemAxe/field_77868_c #blocksEffectiveAgainst # ItemSpade -public vu.(ILvb;)V #MD:ItemSpade/(ILnet/minecraft/src/EnumToolMaterial;) #constructor -public+f vu.c #FD:ItemSpade/field_77866_c #blocksEffectiveAgainst +public wq.(ILvw;)V #MD:ItemSpade/(ILnet/minecraft/src/EnumToolMaterial;) #constructor +public+f wq.c #FD:ItemSpade/field_77866_c #blocksEffectiveAgainst # ItemTool -public uh.a #FD:ItemTool/field_77864_a #efficiencyOnProperMaterial -public uh.d #FD:ItemTool/field_77865_bY #damageVsEntity +public vc.a #FD:ItemTool/field_77864_a #efficiencyOnProperMaterial +public vc.d #FD:ItemTool/field_77865_bY #damageVsEntity # EntityEnderman -public qn.d #FD:EntityEnderman/field_70827_d #carriableBlocks +public rg.d #FD:EntityEnderman/field_70827_d #carriableBlocks # RenderGlobal -public bbx.h #FD:RenderGlobal/field_72769_h #theWorld -public bbx.i #FD:RenderGlobal/field_72770_i #renderEngine -public bbx.q #FD:RenderGlobal/field_72777_q #mc -public bbx.r #FD:RenderGlobal/field_72776_r #globalRenderBlocks -public bbx.E #FD:RenderGlobal/field_72738_E #damagedBlocks +public bex.h #FD:RenderGlobal/field_72769_h #theWorld +public bex.i #FD:RenderGlobal/field_72770_i #renderEngine +public bex.q #FD:RenderGlobal/field_72777_q #mc +public bex.r #FD:RenderGlobal/field_72776_r #globalRenderBlocks +public bex.E #FD:RenderGlobal/field_72738_E #damagedBlocks # SoundManager -public bfz.a #FD:SoundManager/field_77381_a #sndSystem -public bfz.b #FD:SoundManager/field_77379_b #soundPoolSounds -public bfz.c #FD:SoundManager/field_77380_c #soundPoolStreaming -public bfz.d #FD:SoundManager/field_77377_d #soundPoolMusic +public biz.a #FD:SoundManager/field_77381_a #sndSystem +public biz.b #FD:SoundManager/field_77379_b #soundPoolSounds +public biz.c #FD:SoundManager/field_77380_c #soundPoolStreaming +public biz.d #FD:SoundManager/field_77377_d #soundPoolMusic # EntityMinecart -protected qe.* #FD:EntityMinecart/* # All private -> protected +protected qv.* #FD:EntityMinecart/* # All private -> protected # -- MISSING MAPPING public py.h()Z #MD:EntityMinecart/func_70490_h #isMinecartPowered # Block -public ank.(ILags;)V #MD:Block/(ILnet/minecraft/src/Material;) #Constructor -public ank.(IILags;)V #MD:Block/(IILnet/minecraft/src/Material;) #Constructor +public aoj.(ILahp;)V #MD:Block/(ILnet/minecraft/src/Material;) #Constructor +public aoj.(IILahp;)V #MD:Block/(IILnet/minecraft/src/Material;) #Constructor # -- MISSING MAPPING public amq.r()Lamq; #MD:Block/func_71912_p #setRequiresSelfNotify -public ank.a(Lano;)Lank; #MD:Block/func_71884_a #setStepSound -public ank.b(F)Lank; #MD:Block/func_71894_b #setResistance -public ank.c(F)Lank; #MD:Block/func_71848_c #setHardness -public ank.j(I)Lank; #MD:Block/func_71868_h #setLightOpacity -public ank.a(F)Lank; #MD:Block/func_71900_a #setLightValue -public ank.q()Lank; #MD:Block/func_71875_q #setBlockUnbreakable -public ank.b(Z)Lank; #MD:Block/func_71907_b #setTickRandomly -public ank.a(FFFFFF)V #MD:Block/func_71905_a #setBlockBounds +public aoj.a(Laon;)Laoj; #MD:Block/func_71884_a #setStepSound +public aoj.b(F)Laoj; #MD:Block/func_71894_b #setResistance +public aoj.c(F)Laoj; #MD:Block/func_71848_c #setHardness +public aoj.k(I)Laoj; #MD:Block/func_71868_h #setLightOpacity +public aoj.a(F)Laoj; #MD:Block/func_71900_a #setLightValue +public aoj.r()Laoj; #MD:Block/func_71875_q #setBlockUnbreakable +public aoj.b(Z)Laoj; #MD:Block/func_71907_b #setTickRandomly +public aoj.a(FFFFFF)V #MD:Block/func_71905_a #setBlockBounds # NetServerHandler -public iv.g #FD:NetServerHandler/field_72572_g #playerInAirTime +public jh.g #FD:NetServerHandler/field_72572_g #playerInAirTime # TileEntity -public aox.k #FD:TileEntity/field_70331_k #worldObj +public apy.k #FD:TileEntity/field_70331_k #worldObj # BlockLeavesBase -public ans.cO #FD:BlockLeavesBase/field_72131_c #graphicsLevel +public aor.d #FD:BlockLeavesBase/field_72131_c #graphicsLevel # Item -public va.(I)V #MD:Item/(I) #Constructor -public va.e(I)Lva; #MD:Item/func_77656_e #setMaxDamage +public vv.(I)V #MD:Item/(I) #Constructor +public vv.e(I)Lvv; #MD:Item/func_77656_e #setMaxDamage public-f up.h(Lur;)I #MD:Item/func_94580_h #getIconIndex -# RailLogic +# -- MISSING MAPPING# RailLogic # -- MISSING MAPPING public als #CL:RailLogic # -- MISSING MAPPING public als.a(Lals;)I #MD:RailLogic/func_73650_a #getNAdjacentTiles # EntityPlayer -public rh.a(Lqd;)V #MD:EntityPlayer/func_71012_a #joinEntityItemWithWorld -public rh.i()V #MD:EntityPlayer/func_71053_j #closeScreen +public sb.a(Lqu;)V #MD:EntityPlayer/func_71012_a #joinEntityItemWithWorld +public sb.h()V #MD:EntityPlayer/func_71053_j #closeScreen # EntityPlayerMP -public azu.a(Lqd;)V #MD:EntityClientPlayerMP/func_71012_a #joinEntityItemWithWorld +public bcu.a(Lqu;)V #MD:EntityClientPlayerMP/func_71012_a #joinEntityItemWithWorld # World Gen Chests Related -public kw.* #FD:WeightedRandomChestContent/* #all -public in.R #FD:WorldServer/field_73069_S #bonusChestContent -public acz.a #FD:StructureMineshaftPieces/field_78818_a #mineshaftChestContents -public aed.i #FD:ComponentScatteredFeatureDesertPyramid/field_74941_i #itemsToGenerateInTemple -public aee.l #FD:ComponentScatteredFeatureJunglePyramid/field_74943_l #junglePyramidsChestContents -public aee.m #FD:ComponentScatteredFeatureJunglePyramid/field_74944_m #junglePyramidsDispenserContents -public aeo.a #FD:ComponentStrongholdChestCorridor/field_75003_a #strongholdChestContents -public aes.b #FD:ComponentStrongholdLibrary/field_75007_b #strongholdLibraryChestContents -public aex.c #FD:ComponentStrongholdRoomCrossing/field_75014_c #strongholdCorridorChestContents -public afy.a #FD:ComponentVillageHouse2/field_74918_a #villageBlacksmithChestContents +public lj.* #FD:WeightedRandomChestContent/* #all +public iz.S #FD:WorldServer/field_73069_S #bonusChestContent +public adw.a #FD:StructureMineshaftPieces/field_78818_a #mineshaftChestContents +public afa.i #FD:ComponentScatteredFeatureDesertPyramid/field_74941_i #itemsToGenerateInTemple +public afb.l #FD:ComponentScatteredFeatureJunglePyramid/field_74943_l #junglePyramidsChestContents +public afb.m #FD:ComponentScatteredFeatureJunglePyramid/field_74944_m #junglePyramidsDispenserContents +public afl.a #FD:ComponentStrongholdChestCorridor/field_75003_a #strongholdChestContents +public afp.b #FD:ComponentStrongholdLibrary/field_75007_b #strongholdLibraryChestContents +public afu.c #FD:ComponentStrongholdRoomCrossing/field_75014_c #strongholdCorridorChestContents +public agv.a #FD:ComponentVillageHouse2/field_74918_a #villageBlacksmithChestContents # AnvilChunkLoader.chunkSaveLocation -public aaw.d #FD:AnvilChunkLoader/field_75825_d +public abt.d #FD:AnvilChunkLoader/field_75825_d # ChunkProviderServer.currentChunkLoader -public im.e #FD:ChunkProviderServer/field_73247_e +public iy.e #FD:ChunkProviderServer/field_73247_e # PlayerManager -public ik.a(IIZ)Lil; #MD:PlayerManager/func_72690_a #getOrCreateChunkWatcher +public iw.a(IIZ)Lix; #MD:PlayerManager/func_72690_a #getOrCreateChunkWatcher # PlayerInstance -public il #CL:PlayerInstance +public ix #CL:PlayerInstance # World -public-f yn.A #FD:World/field_72982_D #villageCollectionObj -public yn.F #FD:World/field_72993_I #activeChunkSet +public-f zk.A #FD:World/field_72982_D #villageCollectionObj +public zk.G #FD:World/field_72993_I #activeChunkSet # EntityLiving -public mj.bd #FD:EntityLiving/field_70728_aV #experienceValue +public na.bd #FD:EntityLiving/field_70728_aV #experienceValue # GuiFlatPresets -public avh.a(Ljava/lang/String;ILzi;Ljava/util/List;[Lacv;)V #MD:GuiFlatPresets/func_82294_a -public avh.a(Ljava/lang/String;ILzi;[Lacv;)V #MD:GuiFlatPresets/func_82297_a +public awt.a(Ljava/lang/String;ILaaf;Ljava/util/List;[Lads;)V #MD:GuiFlatPresets/func_82294_a +public awt.a(Ljava/lang/String;ILaaf;[Lads;)V #MD:GuiFlatPresets/func_82297_a # BiomeGenBase -public zi.*() #MD:BiomeGenBase/* #Everything protected->public +public aaf.*() #MD:BiomeGenBase/* #Everything protected->public # MapGenVillage -public-f afm.e #FD:MapGenVillage/field_75055_e #villageSpawnBiomes +public-f agj.e #FD:MapGenVillage/field_75055_e #villageSpawnBiomes # ShapedRecipes -public+f xb.d #FD:ShapedRecipes/field_77574_d #recipeItems -public+f xb.b #FD:ShapedRecipes/field_77576_b #recipeWidth -public+f xb.c #FD:ShapedRecipes/field_77577_c #recipeHeight +public+f xy.d #FD:ShapedRecipes/field_77574_d #recipeItems +public+f xy.b #FD:ShapedRecipes/field_77576_b #recipeWidth +public+f xy.c #FD:ShapedRecipes/field_77577_c #recipeHeight # ShapelessRecipes -public xc.b #FD:ShapelessRecipes/field_77579_b #recipeItems +public xz.b #FD:ShapelessRecipes/field_77579_b #recipeItems # GuiContainer -protected awg.a(Ltc;)V #MD:GuiContainer/func_74192_a #drawSlotInventory +protected axs.a(Ltw;)V #MD:GuiContainer/func_74192_a #drawSlotInventory # BlockButton -protected ajt.n(Lyn;III)V #MD:BlockButton/func_82535_o #checkActivation -protected-f ajt.a #FD:BlockButton/field_82537_a #sensible +protected akr.n(Lzk;III)V #MD:BlockButton/func_82535_o #checkActivation +protected-f akr.a #FD:BlockButton/field_82537_a #sensible # BiomeDecorator -public zm.* #FD:BiomeDecorator/* # All private -> protected +public aaj.* #FD:BiomeDecorator/* # All private -> protected # CreativeTabs -public-f tu.a #FD:CreativeTabs/field_78032_a # creativeTabArray non-final +public-f up.a #FD:CreativeTabs/field_78032_a # creativeTabArray non-final # Packet -public ef.a(IZZLjava/lang/Class;)V #MD:Packet/func_73285_a #addIdClassMapping +public eg.a(IZZLjava/lang/Class;)V #MD:Packet/func_73285_a #addIdClassMapping # SaveHandler -public aig.b()Ljava/io/File; #MD:SaveHandler/func_75765_b +public ajd.b()Ljava/io/File; #MD:SaveHandler/func_75765_b # World stuff -public yn.b(Llv;)V #MD:World/func_72847_b #releaseEntitySkin -public yn.m #FD:World/field_73003_n #prevRainingStrength -public yn.n #FD:World/field_73004_o #rainingStrength -public yn.p #FD:World/field_73017_q #thunderingStrength -public yn.o #FD:World/field_73018_p #prevThunderingStrength +public zk.b(Lmj;)V #MD:World/func_72847_b #releaseEntitySkin +public zk.m #FD:World/field_73003_n #prevRainingStrength +public zk.n #FD:World/field_73004_o #rainingStrength +public zk.p #FD:World/field_73017_q #thunderingStrength +public zk.o #FD:World/field_73018_p #prevThunderingStrength #WorldClient -public azr.b(Llv;)V #MD:WorldClient/func_72847_b #releaseEntitySkin +public bcr.b(Lmj;)V #MD:WorldClient/func_72847_b #releaseEntitySkin #WorldServer -public in.b(Llv;)V #MD:WorldServer/func_72847_b #releaseEntitySkin +public iz.b(Lmj;)V #MD:WorldServer/func_72847_b #releaseEntitySkin diff --git a/common/net/minecraftforge/common/FakePlayer.java b/common/net/minecraftforge/common/FakePlayer.java new file mode 100644 index 0000000000..2c118f9f87 --- /dev/null +++ b/common/net/minecraftforge/common/FakePlayer.java @@ -0,0 +1,22 @@ +package net.minecraftforge.common; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + +//Preliminary, simple Fake Player class +public class FakePlayer extends EntityPlayer +{ + public FakePlayer(World world, String name) + { + super(world); + this.username = name; + } + + public void sendChatToPlayer(String s){} + public boolean canCommandSenderUseCommand(int i, String s){ return false; } + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(0,0,0); + } +} diff --git a/common/net/minecraftforge/common/FakePlayerFactory.java b/common/net/minecraftforge/common/FakePlayerFactory.java new file mode 100644 index 0000000000..80b334c254 --- /dev/null +++ b/common/net/minecraftforge/common/FakePlayerFactory.java @@ -0,0 +1,18 @@ +package net.minecraftforge.common; + +import net.minecraft.world.World; + +//To be expanded for generic Mod fake players? +public class FakePlayerFactory +{ + private static FakePlayer MINECRAFT_PLAYER = null; + + public static FakePlayer getMinecraft(World world) + { + if (MINECRAFT_PLAYER == null) + { + MINECRAFT_PLAYER = new FakePlayer(world, "[Minecraft]"); + } + return MINECRAFT_PLAYER; + } +} diff --git a/common/net/minecraftforge/common/ForgeInternalHandler.java b/common/net/minecraftforge/common/ForgeInternalHandler.java index 91fb5d7776..0a46ff07e6 100644 --- a/common/net/minecraftforge/common/ForgeInternalHandler.java +++ b/common/net/minecraftforge/common/ForgeInternalHandler.java @@ -19,14 +19,7 @@ public class ForgeInternalHandler { if (!event.world.isRemote) { - if (event.entity.getPersistentID() == null) - { - event.entity.generatePersistentID(); - } - else - { - ForgeChunkManager.loadEntity(event.entity); - } + ForgeChunkManager.loadEntity(event.entity); } Entity entity = event.entity; diff --git a/common/net/minecraftforge/common/MinecraftForge.java b/common/net/minecraftforge/common/MinecraftForge.java index 48a6d22fae..a7ba9f0653 100644 --- a/common/net/minecraftforge/common/MinecraftForge.java +++ b/common/net/minecraftforge/common/MinecraftForge.java @@ -7,9 +7,12 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -33,8 +36,6 @@ public class MinecraftForge public static final EventBus EVENT_BUS = new EventBus(); public static final EventBus TERRAIN_GEN_BUS = new EventBus(); public static final EventBus ORE_GEN_BUS = new EventBus(); - @Deprecated //Vanilla feature now - public static boolean SPAWNER_ALLOW_ON_INVERTED = false; private static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler(); @@ -183,10 +184,14 @@ public class MinecraftForge System.out.printf("MinecraftForge v%s Initialized\n", ForgeVersion.getVersion()); FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion()); - Block filler = new Block(0, Material.air); + Block filler = new Block(0, Material.air) + { + @SideOnly(Side.CLIENT) public void func_94332_a(IconRegister register){} + }; Block.blocksList[0] = null; Block.opaqueCubeLookup[0] = false; Block.lightOpacity[0] = 0; + filler.setBlockName("ForgeFiller"); for (int x = 256; x < 4096; x++) { diff --git a/common/net/minecraftforge/transformers/EventTransformer.java b/common/net/minecraftforge/transformers/EventTransformer.java index ae04b08e40..149f30df2b 100644 --- a/common/net/minecraftforge/transformers/EventTransformer.java +++ b/common/net/minecraftforge/transformers/EventTransformer.java @@ -20,7 +20,7 @@ public class EventTransformer implements IClassTransformer } @Override - public byte[] transform(String name, byte[] bytes) + public byte[] transform(String name, String transformedName, byte[] bytes) { if (bytes == null || name.equals("net.minecraftforge.event.Event") || name.startsWith("net.minecraft.") || name.indexOf('.') == -1) { @@ -162,5 +162,4 @@ public class EventTransformer implements IClassTransformer classNode.methods.add(method); return true; } - } diff --git a/eclipse-workspace-dev.zip b/eclipse-workspace-dev.zip index 0b8057d66a..3567dfea5b 100644 Binary files a/eclipse-workspace-dev.zip and b/eclipse-workspace-dev.zip differ diff --git a/fml-src-13w02b-4.99.16.541-snapshot15.zip b/fml-src-13w05b-4.99.52.566-snapshot15.zip similarity index 86% rename from fml-src-13w02b-4.99.16.541-snapshot15.zip rename to fml-src-13w05b-4.99.52.566-snapshot15.zip index 85fb498f0f..0ec8986fed 100644 Binary files a/fml-src-13w02b-4.99.16.541-snapshot15.zip and b/fml-src-13w05b-4.99.52.566-snapshot15.zip differ diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 456e7233a3..468c933548 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -23,8 +23,8 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; -@@ -25,8 +30,10 @@ - import net.minecraft.item.ItemSlab; +@@ -26,8 +31,10 @@ + import net.minecraft.item.ItemSnow; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; @@ -34,7 +34,7 @@ import net.minecraft.util.Icon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; -@@ -34,9 +41,20 @@ +@@ -35,9 +42,20 @@ import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -55,7 +55,7 @@ /** * used as foreach item, if item.tab = current tab, display it on the screen */ -@@ -328,6 +346,7 @@ +@@ -330,6 +348,7 @@ lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0; canBlockGrass[par1] = !par2Material.getCanBlockGrass(); } @@ -63,7 +63,7 @@ } /** -@@ -450,9 +469,10 @@ +@@ -452,9 +471,10 @@ return this.needsRandomTick; } @@ -75,7 +75,7 @@ } /** -@@ -475,7 +495,7 @@ +@@ -477,7 +497,7 @@ */ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { @@ -84,7 +84,7 @@ } @SideOnly(Side.CLIENT) -@@ -485,7 +505,7 @@ +@@ -487,7 +507,7 @@ */ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { @@ -93,7 +93,7 @@ } @SideOnly(Side.CLIENT) -@@ -634,7 +654,13 @@ +@@ -636,7 +656,13 @@ /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ @@ -108,7 +108,7 @@ /** * Returns the quantity of items to drop on block destruction. -@@ -658,8 +684,7 @@ +@@ -660,8 +686,7 @@ */ public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5) { @@ -118,7 +118,7 @@ } /** -@@ -677,18 +702,13 @@ +@@ -679,18 +704,13 @@ { if (!par1World.isRemote) { @@ -141,7 +141,7 @@ } } } -@@ -1081,7 +1101,7 @@ +@@ -1083,7 +1103,7 @@ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); par2EntityPlayer.addExhaustion(0.025F); @@ -150,7 +150,7 @@ { ItemStack itemstack = this.createStackedBlock(par6); -@@ -1097,12 +1117,13 @@ +@@ -1099,12 +1119,13 @@ } } @@ -165,7 +165,7 @@ } /** -@@ -1398,4 +1419,870 @@ +@@ -1406,4 +1427,871 @@ canBlockGrass[0] = true; StatList.initBreakableStats(); } @@ -435,6 +435,7 @@ + blockFlammability[id] = flammability; + } + ++ private boolean isTileProvider = this instanceof ITileEntityProvider; + /** + * Called throughout the code as a replacement for block instanceof BlockContainer + * Moving this to the Block base class allows for mods that wish to extend vinella @@ -447,22 +448,22 @@ + */ + public boolean hasTileEntity(int metadata) + { -+ return isBlockContainer; ++ return isTileProvider; + } + + /** -+ * Called throughout the code as a replacement for BlockContainer.getBlockEntity ++ * Called throughout the code as a replacement for ITileEntityProvider.createNewTileEntity + * Return the same thing you would from that function. -+ * This will fall back to BlockContainer.getBlockEntity if this block is a BlockContainer. ++ * This will fall back to ITileEntityProvider.createNewTileEntity(World) if this block is a ITileEntityProvider + * + * @param metadata The Metadata of the current block + * @return A instance of a class extending TileEntity + */ + public TileEntity createTileEntity(World world, int metadata) + { -+ if (this instanceof BlockContainer) ++ if (isTileProvider) + { -+ return ((BlockContainer)this).createNewTileEntity(world, metadata); ++ return ((ITileEntityProvider)this).createNewTileEntity(world); + } + return null; + } @@ -960,7 +961,7 @@ + { + if (blockID == grass.blockID) + { -+ world.func_94575_c(x, y, z, dirt.blockID); ++ world.setBlockAndMetadataWithNotify(x, y, z, dirt.blockID, 0, 2); + } + } + diff --git a/patches/minecraft/net/minecraft/block/BlockContainer.java.patch b/patches/minecraft/net/minecraft/block/BlockContainer.java.patch index abd7b7d84f..0329094435 100644 --- a/patches/minecraft/net/minecraft/block/BlockContainer.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockContainer.java.patch @@ -9,16 +9,3 @@ } /** -@@ -34,6 +34,12 @@ - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - public abstract TileEntity createNewTileEntity(World world); -+ -+ -+ public TileEntity createNewTileEntity(World world, int metadata) -+ { -+ return createNewTileEntity(world); -+ } - - /** - * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile diff --git a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch index c2b6bdde07..66a57d1606 100644 --- a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch @@ -8,15 +8,15 @@ import java.util.Random; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; -@@ -9,6 +10,7 @@ - import net.minecraft.item.ItemStack; +@@ -10,6 +11,7 @@ import net.minecraft.util.Icon; + import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; public class BlockCrops extends BlockFlower { -@@ -95,11 +97,11 @@ +@@ -103,11 +105,11 @@ int j3 = par1World.getBlockId(l2, par3 - 1, i3); float f1 = 0.0F; @@ -30,7 +30,7 @@ { f1 = 3.0F; } -@@ -167,22 +169,25 @@ +@@ -175,22 +177,25 @@ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); diff --git a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch index 1deb1ee93e..89cc41566b 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/block/BlockDoor.java +++ ../src_work/minecraft/net/minecraft/block/BlockDoor.java -@@ -235,7 +235,7 @@ +@@ -296,7 +296,7 @@ { if (this.blockMaterial == Material.iron) { diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index 585eaf9af6..820da7a419 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -1,15 +1,15 @@ --- ../src_base/minecraft/net/minecraft/block/BlockPistonBase.java +++ ../src_work/minecraft/net/minecraft/block/BlockPistonBase.java -@@ -406,7 +406,7 @@ +@@ -413,7 +413,7 @@ return false; } -- return !(Block.blocksList[par0] instanceof BlockContainer); +- return !(Block.blocksList[par0] instanceof ITileEntityProvider); + return !par1World.blockHasTileEntity(par2, par3, par4); } } -@@ -424,7 +424,7 @@ +@@ -431,7 +431,7 @@ { if (l1 < 13) { @@ -18,7 +18,7 @@ { return false; } -@@ -474,7 +474,7 @@ +@@ -481,7 +481,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 700502a614..a75ab7c0d7 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -26,9 +26,9 @@ } /** -@@ -216,4 +217,107 @@ - { - return 0; +@@ -236,4 +237,107 @@ + par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, par5); + } } + + /** diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch index 54ae9d4ad3..c7eab92ecf 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/block/BlockRedstoneWire.java +++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java -@@ -521,7 +521,7 @@ +@@ -522,7 +522,7 @@ } else if (!Block.redstoneRepeaterIdle.func_94487_f(i1)) { diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch index 174d237dd2..59c0b4a06a 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -1,15 +1,15 @@ --- ../src_base/minecraft/net/minecraft/block/BlockSapling.java +++ ../src_work/minecraft/net/minecraft/block/BlockSapling.java -@@ -15,6 +15,8 @@ - import net.minecraft.world.gen.feature.WorldGenTaiga2; +@@ -16,6 +16,8 @@ import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; -+ -+import net.minecraftforge.event.terraingen.TerrainGen; ++import net.minecraftforge.event.terraingen.TerrainGen; ++ public class BlockSapling extends BlockFlower { -@@ -72,6 +74,8 @@ + public static final String[] WOOD_TYPES = new String[] {"oak", "spruce", "birch", "jungle"}; +@@ -77,6 +79,8 @@ */ public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch index 1c6e857d3e..4b4bbd0405 100644 --- a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch @@ -9,7 +9,7 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; -@@ -134,11 +136,6 @@ +@@ -135,11 +137,6 @@ } /** @@ -21,7 +21,7 @@ * Called when the block is attempted to be harvested */ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) -@@ -149,6 +146,8 @@ +@@ -150,6 +147,8 @@ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4); } @@ -30,7 +30,7 @@ super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); } -@@ -157,24 +156,30 @@ +@@ -158,24 +157,30 @@ */ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { diff --git a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch index 60db59c7d5..af0fb05f47 100644 --- a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch @@ -1,16 +1,21 @@ --- ../src_base/minecraft/net/minecraft/block/BlockSnow.java +++ ../src_work/minecraft/net/minecraft/block/BlockSnow.java -@@ -74,7 +74,8 @@ +@@ -88,8 +88,12 @@ + */ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { - int l = par1World.getBlockId(par2, par3 - 1, par4); -- return l != 0 && (l == Block.leaves.blockID || Block.blocksList[l].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false; +- int l = par1World.getBlockId(par2, par3 - 1, par4); +- return l == 0 ? false : (l == this.blockID && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7 ? true : (l != Block.leaves.blockID && !Block.blocksList[l].isOpaqueCube() ? false : par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement())); ++ int l = par1World.getBlockId(par2, par3 - 1, par4); + Block block = Block.blocksList[l]; -+ return block != null && (block.isLeaves(par1World, par2, par3 - 1, par4) || Block.blocksList[l].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false; ++ if (block == null) return false; ++ if (block == this && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7) return true; ++ if (block.isLeaves(par1World, par2, par3 - 1, par4) && Block.blocksList[l].isOpaqueCube()) return false; ++ return par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement(); } /** -@@ -93,7 +94,6 @@ +@@ -108,7 +112,6 @@ { if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { @@ -18,19 +23,20 @@ par1World.func_94571_i(par2, par3, par4); return false; } -@@ -109,10 +109,8 @@ +@@ -124,11 +127,8 @@ */ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { - int i1 = Item.snowball.itemID; -- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(i1, 1, 0)); +- int j1 = par6 & 7; +- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(i1, j1 + 1, 0)); + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); par1World.func_94571_i(par3, par4, par5); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); } /** -@@ -128,7 +126,7 @@ +@@ -144,7 +144,7 @@ */ public int quantityDropped(Random par1Random) { @@ -39,7 +45,7 @@ } /** -@@ -138,7 +136,6 @@ +@@ -154,7 +154,6 @@ { if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) { @@ -47,3 +53,14 @@ par1World.func_94571_i(par2, par3, par4); } } +@@ -169,4 +168,10 @@ + { + return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); + } ++ ++ @Override ++ public int quantityDropped(int meta, int fortune, Random random) ++ { ++ return (meta & 7) + 1; ++ } + } diff --git a/patches/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch index 30db19b8ae..3e8e0ad068 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStem.java.patch @@ -9,7 +9,7 @@ import java.util.Random; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; -@@ -11,6 +13,8 @@ +@@ -12,6 +14,8 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -18,7 +18,7 @@ public class BlockStem extends BlockFlower { /** Defines if it is a Melon or a Pumpkin that the stem is producing. */ -@@ -105,7 +109,8 @@ +@@ -106,7 +110,8 @@ int l1 = par1World.getBlockId(j1, par3 - 1, k1); @@ -28,7 +28,7 @@ { par1World.func_94575_c(j1, par3, k1, this.fruitType.blockID); } -@@ -141,11 +146,11 @@ +@@ -149,11 +154,11 @@ int j3 = par1World.getBlockId(l2, par3 - 1, i3); float f1 = 0.0F; @@ -42,12 +42,16 @@ { f1 = 3.0F; } -@@ -237,29 +242,22 @@ +@@ -245,29 +250,22 @@ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - - if (!par1World.isRemote) +- { +- Item item = null; +- +- if (this.fruitType == Block.pumpkin) + } + + @Override @@ -56,14 +60,12 @@ + ArrayList ret = new ArrayList(); + + for (int i = 0; i < 3; i++) - { -- Item item = null; -- -- if (this.fruitType == Block.pumpkin) ++ { + if (world.rand.nextInt(15) <= metadata) { - item = Item.pumpkinSeeds; -- } ++ ret.add(new ItemStack(fruitType == pumpkin ? Item.pumpkinSeeds : Item.melonSeeds)); + } - - if (this.fruitType == Block.melon) - { @@ -76,9 +78,9 @@ - { - this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(item)); - } -+ ret.add(new ItemStack(fruitType == pumpkin ? Item.pumpkinSeeds : Item.melonSeeds)); - } - } +- } +- } ++ } + + return ret; } diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 5768771e64..b86d86e32e 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -11,7 +11,7 @@ @SideOnly(Side.CLIENT) public abstract class Minecraft implements Runnable, IPlayerUsage { -@@ -1239,7 +1243,7 @@ +@@ -1240,7 +1244,7 @@ if (this.thePlayer.canCurrentToolHarvestBlock(j, k, l)) { @@ -20,7 +20,7 @@ this.thePlayer.swingItem(); } } -@@ -1305,7 +1309,8 @@ +@@ -1306,7 +1310,8 @@ { int j1 = itemstack != null ? itemstack.stackSize : 0; @@ -30,7 +30,7 @@ { flag = false; this.thePlayer.swingItem(); -@@ -1331,7 +1336,8 @@ +@@ -1332,7 +1337,8 @@ { ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); @@ -40,7 +40,7 @@ { this.entityRenderer.itemRenderer.resetEquippedProgress2(); } -@@ -2028,6 +2034,18 @@ +@@ -2029,6 +2035,18 @@ if (this.theIntegratedServer != null) { this.theIntegratedServer.initiateShutdown(); @@ -59,7 +59,7 @@ } this.theIntegratedServer = null; -@@ -2339,95 +2357,12 @@ +@@ -2340,103 +2358,12 @@ if (this.objectMouseOver != null) { boolean flag = this.thePlayer.capabilities.isCreativeMode; @@ -129,6 +129,14 @@ - { - j = Item.minecartCrate.itemID; - } +- else if (entityminecart.func_94087_l() == 3) +- { +- j = Item.field_94582_cb.itemID; +- } +- else if (entityminecart.func_94087_l() == 5) +- { +- j = Item.field_96600_cc.itemID; +- } - else - { - j = Item.minecartEmpty.itemID; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch index 2eb7aed6f0..ba4b64f601 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch @@ -1,15 +1,15 @@ --- ../src_base/minecraft/net/minecraft/client/gui/GuiControls.java +++ ../src_work/minecraft/net/minecraft/client/gui/GuiControls.java -@@ -5,6 +5,8 @@ - import net.minecraft.client.settings.GameSettings; +@@ -6,6 +6,8 @@ import net.minecraft.client.settings.KeyBinding; + import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringTranslate; + +import net.minecraftforge.client.GuiControlsScrollPanel; @SideOnly(Side.CLIENT) public class GuiControls extends GuiScreen -@@ -23,6 +25,8 @@ +@@ -24,6 +26,8 @@ /** The ID of the button that has been pressed. */ private int buttonId = -1; @@ -18,7 +18,7 @@ public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { this.parentScreen = par1GuiScreen; -@@ -39,15 +43,12 @@ +@@ -40,15 +44,12 @@ */ public void initGui() { @@ -37,7 +37,7 @@ this.screenTitle = stringtranslate.translateKey("controls.title"); } -@@ -56,19 +57,9 @@ +@@ -57,19 +58,9 @@ */ protected void actionPerformed(GuiButton par1GuiButton) { @@ -57,7 +57,7 @@ } } -@@ -77,17 +68,7 @@ +@@ -78,17 +69,7 @@ */ protected void mouseClicked(int par1, int par2, int par3) { @@ -76,7 +76,7 @@ } /** -@@ -95,14 +76,7 @@ +@@ -96,14 +77,7 @@ */ protected void keyTyped(char par1, int par2) { @@ -92,7 +92,7 @@ { super.keyTyped(par1, par2); } -@@ -114,47 +88,8 @@ +@@ -115,47 +89,8 @@ public void drawScreen(int par1, int par2, float par3) { this.drawDefaultBackground(); @@ -120,11 +120,11 @@ - - if (this.buttonId == l) - { -- ((GuiButton)this.controlList.get(l)).displayString = "\u00a7f> \u00a7e??? \u00a7f<"; +- ((GuiButton)this.controlList.get(l)).displayString = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<"; - } - else if (flag) - { -- ((GuiButton)this.controlList.get(l)).displayString = "\u00a7c" + this.options.getOptionDisplayString(l); +- ((GuiButton)this.controlList.get(l)).displayString = EnumChatFormatting.RED + this.options.getOptionDisplayString(l); - } - else - { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch index a0371e478c..e8fa229d83 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/gui/GuiIngame.java +++ ../src_work/minecraft/net/minecraft/client/gui/GuiIngame.java -@@ -27,6 +27,8 @@ +@@ -34,6 +34,8 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; @@ -9,10 +9,10 @@ @SideOnly(Side.CLIENT) public class GuiIngame extends Gui { -@@ -160,7 +162,7 @@ +@@ -170,7 +172,7 @@ - j3 = l - 39; - l2 = j3 - 10; + k3 = l - 39; + l2 = k3 - 10; - k2 = this.mc.thePlayer.getTotalArmorValue(); + k2 = ForgeHooks.getTotalArmorValue(mc.thePlayer); i3 = -1; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch index dab61b729e..332f3682b6 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java +++ ../src_work/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java -@@ -161,6 +161,11 @@ +@@ -172,6 +172,11 @@ import net.minecraft.world.storage.MapStorage; import org.lwjgl.input.Keyboard; @@ -12,7 +12,7 @@ @SideOnly(Side.CLIENT) public class NetClientHandler extends NetHandler { -@@ -737,7 +742,7 @@ +@@ -748,7 +753,7 @@ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) { @@ -21,7 +21,7 @@ this.disconnected = true; this.mc.loadWorld((WorldClient)null); this.mc.displayGuiScreen(new GuiDisconnected("disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason})); -@@ -803,7 +808,11 @@ +@@ -814,7 +819,11 @@ public void handleChat(Packet3Chat par1Packet3Chat) { par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat); @@ -34,7 +34,7 @@ } public void handleAnimation(Packet18Animation par1Packet18Animation) -@@ -1217,6 +1226,10 @@ +@@ -1248,6 +1257,10 @@ { tileentity.readFromNBT(par1Packet132TileEntityData.customParam1); } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index 9bdb0712e9..b4bbb42d60 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -33,7 +33,7 @@ if (flag) { -@@ -328,6 +338,12 @@ +@@ -336,6 +346,12 @@ float f2 = (float)par8Vec3.zCoord - (float)par6; boolean flag = false; int i1; @@ -46,7 +46,7 @@ if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) { -@@ -370,7 +386,15 @@ +@@ -378,7 +394,15 @@ } else { @@ -63,7 +63,7 @@ } } -@@ -392,9 +416,10 @@ +@@ -400,9 +424,10 @@ { par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = itemstack1; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch index 44a83b7587..28ed256cd2 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/multiplayer/WorldClient.java +++ ../src_work/minecraft/net/minecraft/client/multiplayer/WorldClient.java -@@ -27,6 +27,9 @@ +@@ -28,6 +28,9 @@ import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.storage.SaveHandlerMP; @@ -10,7 +10,7 @@ @SideOnly(Side.CLIENT) public class WorldClient extends World { -@@ -57,8 +60,11 @@ +@@ -58,8 +61,11 @@ super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler); this.sendQueue = par1NetClientHandler; this.difficultySetting = par4; @@ -23,7 +23,7 @@ } /** -@@ -289,6 +295,12 @@ +@@ -290,6 +296,12 @@ */ protected void updateWeather() { diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 8a47c8f3d4..ffc07cae93 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -12,7 +12,7 @@ @SideOnly(Side.CLIENT) public class EntityRenderer { -@@ -333,8 +338,15 @@ +@@ -339,8 +344,15 @@ */ private void updateFovModifierHand() { @@ -30,7 +30,7 @@ this.fovModifierHandPrev = this.fovModifierHand; this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; } -@@ -350,7 +362,7 @@ +@@ -356,7 +368,7 @@ } else { @@ -39,7 +39,7 @@ float f1 = 70.0F; if (par2) -@@ -437,15 +449,7 @@ +@@ -443,15 +455,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); } -@@ -1139,8 +1143,11 @@ +@@ -1145,8 +1149,11 @@ entityplayer = (EntityPlayer)entityliving; GL11.glDisable(GL11.GL_ALPHA_TEST); this.mc.mcProfiler.endStartSection("outline"); @@ -70,7 +70,7 @@ GL11.glEnable(GL11.GL_ALPHA_TEST); } } -@@ -1204,15 +1211,18 @@ +@@ -1210,15 +1217,18 @@ entityplayer = (EntityPlayer)entityliving; GL11.glDisable(GL11.GL_ALPHA_TEST); this.mc.mcProfiler.endStartSection("outline"); @@ -92,7 +92,7 @@ GL11.glDisable(GL11.GL_BLEND); this.mc.mcProfiler.endStartSection("weather"); this.renderRainSnow(par1); -@@ -1222,6 +1232,9 @@ +@@ -1228,6 +1238,9 @@ { this.renderCloudsCheck(renderglobal, par1); } diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index 5009606da5..9ffa109c5e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/renderer/ItemRenderer.java +++ ../src_work/minecraft/net/minecraft/client/renderer/ItemRenderer.java -@@ -15,6 +15,8 @@ +@@ -14,6 +14,8 @@ import net.minecraft.entity.EntityLiving; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; @@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; -@@ -22,6 +24,12 @@ +@@ -21,6 +23,12 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; @@ -22,7 +22,7 @@ @SideOnly(Side.CLIENT) public class ItemRenderer { -@@ -54,8 +62,21 @@ +@@ -53,8 +61,21 @@ public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) { GL11.glPushMatrix(); @@ -46,7 +46,7 @@ { GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png")); this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); -@@ -274,7 +295,7 @@ +@@ -272,7 +293,7 @@ Render render; RenderPlayer renderplayer; @@ -55,7 +55,7 @@ { GL11.glPushMatrix(); f4 = 0.8F; -@@ -341,11 +362,20 @@ +@@ -339,11 +360,20 @@ tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); tessellator.draw(); @@ -81,7 +81,7 @@ } GL11.glPopMatrix(); -@@ -448,12 +478,15 @@ +@@ -446,12 +476,15 @@ if (itemstack.getItem().requiresMultipleRenderPasses()) { this.renderItem(entityclientplayermp, itemstack, 0); diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch index 28a8268617..4f429d8725 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch @@ -9,7 +9,7 @@ @SideOnly(Side.CLIENT) public class RenderBlocks { -@@ -603,9 +605,8 @@ +@@ -604,9 +606,8 @@ public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4) { Tessellator tessellator = Tessellator.instance; @@ -21,7 +21,7 @@ float f = 0.5F; float f1 = 1.0F; float f2 = 0.8F; -@@ -614,6 +615,7 @@ +@@ -615,6 +616,7 @@ tessellator.setBrightness(j1); tessellator.setColorOpaque_F(f, f, f); Icon icon = this.func_94170_a(par1Block, this.blockAccess, par2, par3, par4, 0); @@ -29,7 +29,7 @@ double d0 = (double)icon.func_94209_e(); double d1 = (double)icon.func_94212_f(); double d2 = (double)icon.func_94206_g(); -@@ -630,6 +632,7 @@ +@@ -631,6 +633,7 @@ tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); tessellator.setColorOpaque_F(f1, f1, f1); icon = this.func_94170_a(par1Block, this.blockAccess, par2, par3, par4, 1); @@ -37,7 +37,7 @@ d0 = (double)icon.func_94209_e(); d1 = (double)icon.func_94212_f(); d2 = (double)icon.func_94206_g(); -@@ -2418,7 +2421,7 @@ +@@ -2421,7 +2424,7 @@ double d9; double d10; @@ -46,7 +46,7 @@ { float f1 = 0.2F; float f2 = 0.0625F; -@@ -2438,7 +2441,7 @@ +@@ -2441,7 +2444,7 @@ d0 = d5; } @@ -55,7 +55,7 @@ { tessellator.addVertexWithUV((double)((float)par2 + f1), (double)((float)par3 + f + f2), (double)(par4 + 1), d2, d1); tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 1), d2, d3); -@@ -2450,7 +2453,7 @@ +@@ -2453,7 +2456,7 @@ tessellator.addVertexWithUV((double)((float)par2 + f1), (double)((float)par3 + f + f2), (double)(par4 + 1), d2, d1); } @@ -64,7 +64,7 @@ { tessellator.addVertexWithUV((double)((float)(par2 + 1) - f1), (double)((float)par3 + f + f2), (double)(par4 + 0), d0, d1); tessellator.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 0), d0, d3); -@@ -2462,7 +2465,7 @@ +@@ -2465,7 +2468,7 @@ tessellator.addVertexWithUV((double)((float)(par2 + 1) - f1), (double)((float)par3 + f + f2), (double)(par4 + 0), d0, d1); } @@ -73,7 +73,7 @@ { tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + f + f2), (double)((float)par4 + f1), d2, d1); tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 0), d2, d3); -@@ -2474,7 +2477,7 @@ +@@ -2477,7 +2480,7 @@ tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + f + f2), (double)((float)par4 + f1), d2, d1); } @@ -82,7 +82,7 @@ { tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + f + f2), (double)((float)(par4 + 1) - f1), d0, d1); tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + f2), (double)(par4 + 1 - 0), d0, d3); -@@ -2486,7 +2489,7 @@ +@@ -2489,7 +2492,7 @@ tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + f + f2), (double)((float)(par4 + 1) - f1), d0, d1); } diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch index d62a1c0c38..aff5671d6e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/renderer/RenderEngine.java +++ ../src_work/minecraft/net/minecraft/client/renderer/RenderEngine.java -@@ -27,6 +27,8 @@ +@@ -28,6 +28,8 @@ import net.minecraft.util.IntHashMap; import org.lwjgl.opengl.GL11; @@ -9,7 +9,7 @@ @SideOnly(Side.CLIENT) public class RenderEngine { -@@ -199,6 +201,7 @@ +@@ -202,6 +204,7 @@ try { @@ -17,7 +17,7 @@ this.singleIntBuffer.clear(); GLAllocation.generateTextureNames(this.singleIntBuffer); int i = this.singleIntBuffer.get(0); -@@ -242,6 +245,7 @@ +@@ -247,6 +250,7 @@ } this.textureMap.put(par1Str, Integer.valueOf(i)); diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index 600fe0f71c..380c3b739f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/renderer/RenderGlobal.java +++ ../src_work/minecraft/net/minecraft/client/renderer/RenderGlobal.java -@@ -64,6 +64,8 @@ +@@ -65,6 +65,8 @@ import org.lwjgl.opengl.ARBOcclusionQuery; import org.lwjgl.opengl.GL11; @@ -9,7 +9,33 @@ @SideOnly(Side.CLIENT) public class RenderGlobal implements IWorldAccess { -@@ -932,6 +934,12 @@ +@@ -677,8 +679,8 @@ + this.sortedWorldRenderers[i1].isVisible = true; + } + +- + this.theWorld.theProfiler.endStartSection("render"); ++ System.out.println("1"+this.theWorld.theProfiler.getNameOfLastSection()); + k = b0 + this.renderSortedRenderers(b1, l, par2, par3); + + do +@@ -776,6 +778,7 @@ + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_FOG); + this.theWorld.theProfiler.endStartSection("render"); ++ System.out.println("2"+this.theWorld.theProfiler.getNameOfLastSection()); + k += this.renderSortedRenderers(j1, l, par2, par3); + } + while (l < this.sortedWorldRenderers.length); +@@ -783,6 +786,7 @@ + else + { + this.theWorld.theProfiler.endStartSection("render"); ++ System.out.println("3"+this.theWorld.theProfiler.getNameOfLastSection()); + k = b0 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, par2, par3); + } + +@@ -934,6 +938,12 @@ */ public void renderSky(float par1) { @@ -22,7 +48,7 @@ if (this.mc.theWorld.provider.dimensionId == 1) { GL11.glDisable(GL11.GL_FOG); -@@ -1170,6 +1178,13 @@ +@@ -1172,6 +1182,13 @@ public void renderClouds(float par1) { @@ -36,7 +62,7 @@ if (this.mc.theWorld.provider.isSurfaceWorld()) { if (this.mc.gameSettings.fancyGraphics) -@@ -1599,6 +1614,11 @@ +@@ -1601,6 +1618,11 @@ } public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch index 5a088cd374..10afe09f15 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch @@ -76,7 +76,7 @@ f8 = 1.0F; if (this.field_77024_a) -@@ -232,32 +223,26 @@ +@@ -238,32 +229,26 @@ f11 = 0.021875F; ItemStack itemstack = par1EntityItem.getEntityItem(); int j = itemstack.stackSize; @@ -124,7 +124,7 @@ { this.loadTexture("/terrain.png"); } -@@ -346,11 +331,12 @@ +@@ -352,11 +337,12 @@ float f; float f1; float f2; @@ -140,7 +140,7 @@ GL11.glPushMatrix(); GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel); GL11.glScalef(10.0F, 10.0F, 10.0F); -@@ -383,9 +369,9 @@ +@@ -389,9 +375,9 @@ GL11.glDisable(GL11.GL_LIGHTING); par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png")); @@ -153,7 +153,7 @@ int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); f = (float)(k1 >> 16 & 255) / 255.0F; f1 = (float)(k1 >> 8 & 255) / 255.0F; -@@ -439,7 +425,10 @@ +@@ -450,7 +436,10 @@ { if (par3ItemStack != null) { @@ -163,9 +163,9 @@ + this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5); + } - if (par3ItemStack != null && par3ItemStack.hasEffect()) + if (par3ItemStack.hasEffect()) { -@@ -576,4 +565,47 @@ +@@ -587,4 +576,47 @@ { this.doRenderItem((EntityItem)par1Entity, par2, par4, par6, par8, par9); } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch index c8ea67ad81..08c560b3cb 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java -@@ -216,12 +216,14 @@ +@@ -218,12 +218,14 @@ if (par4EntityLiving.isPlayerSleeping()) { diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch index 312daf22b9..04d9a6a73f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -1,24 +1,20 @@ --- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java +++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java -@@ -13,10 +13,17 @@ - import net.minecraft.item.EnumAction; - import net.minecraft.item.EnumArmorMaterial; - import net.minecraft.item.Item; -+import net.minecraft.item.ItemBlock; - import net.minecraft.item.ItemArmor; - import net.minecraft.item.ItemStack; +@@ -19,7 +19,13 @@ + import net.minecraft.scoreboard.ScoreObjective; + import net.minecraft.scoreboard.Scoreboard; import net.minecraft.util.MathHelper; - import org.lwjgl.opengl.GL11; -+ -+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; -+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; ++import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; -+import net.minecraftforge.client.ForgeHooksClient; + import org.lwjgl.opengl.GL11; ++import net.minecraft.item.ItemBlock; ++import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED; ++import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D; @SideOnly(Side.CLIENT) public class RenderPlayer extends RenderLiving -@@ -25,6 +32,8 @@ +@@ -28,6 +34,8 @@ private ModelBiped modelArmorChestplate; private ModelBiped modelArmor; public static String[] armorFilenamePrefix = new String[] {"cloth", "chain", "iron", "diamond", "gold"}; @@ -27,7 +23,7 @@ public RenderPlayer() { -@@ -48,7 +57,7 @@ +@@ -51,7 +59,7 @@ if (item instanceof ItemArmor) { ItemArmor itemarmor = (ItemArmor)item; @@ -36,7 +32,7 @@ ModelBiped modelbiped = par2 == 2 ? this.modelArmor : this.modelArmorChestplate; modelbiped.bipedHead.showModel = par2 == 0; modelbiped.bipedHeadwear.showModel = par2 == 0; -@@ -117,7 +126,7 @@ +@@ -120,7 +128,7 @@ if (item instanceof ItemArmor) { ItemArmor itemarmor = (ItemArmor)item; @@ -45,7 +41,7 @@ float f1 = 1.0F; GL11.glColor3f(f1, f1, f1); } -@@ -176,9 +185,12 @@ +@@ -179,9 +187,12 @@ this.modelBipedMain.bipedHead.postRender(0.0625F); float f2; @@ -61,7 +57,7 @@ { f2 = 0.625F; GL11.glTranslatef(0.0F, -0.25F, 0.0F); -@@ -296,7 +308,10 @@ +@@ -299,7 +310,10 @@ enumaction = itemstack1.getItemUseAction(); } @@ -73,7 +69,7 @@ { f3 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -@@ -353,7 +368,7 @@ +@@ -356,7 +370,7 @@ if (itemstack1.getItem().requiresMultipleRenderPasses()) { diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index eb04692974..5df73acfa2 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -1,8 +1,8 @@ --- ../src_base/minecraft/net/minecraft/command/CommandHandler.java +++ ../src_work/minecraft/net/minecraft/command/CommandHandler.java -@@ -10,6 +10,9 @@ - import java.util.Map.Entry; +@@ -11,6 +11,9 @@ import net.minecraft.entity.player.EntityPlayerMP; + import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.CommandEvent; @@ -10,7 +10,7 @@ public class CommandHandler implements ICommandManager { /** Map of Strings to the ICommand objects they represent */ -@@ -40,6 +43,16 @@ +@@ -42,6 +45,16 @@ if (icommand.canCommandSenderUseCommand(par1ICommandSender)) { @@ -21,7 +21,7 @@ + { + throw event.exception; + } -+ return; ++ return 1; + } + if (i > -1) diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index 6cdfb75797..90d7576609 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -1,19 +1,14 @@ --- ../src_base/minecraft/net/minecraft/entity/Entity.java +++ ../src_work/minecraft/net/minecraft/entity/Entity.java -@@ -2,8 +2,12 @@ +@@ -2,6 +2,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -+ +import java.util.ArrayList; import java.util.List; import java.util.Random; -+import java.util.UUID; -+ - import net.minecraft.block.Block; - import net.minecraft.block.BlockFluid; - import net.minecraft.block.StepSound; -@@ -12,8 +16,13 @@ + import java.util.UUID; +@@ -13,8 +14,13 @@ import net.minecraft.crash.CrashReportCategory; import net.minecraft.enchantment.EnchantmentProtection; import net.minecraft.entity.effect.EntityLightningBolt; @@ -27,7 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagDouble; -@@ -24,6 +33,7 @@ +@@ -25,6 +31,7 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.Direction; import net.minecraft.util.MathHelper; @@ -35,9 +30,9 @@ import net.minecraft.util.ReportedException; import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; -@@ -222,6 +232,11 @@ - protected int field_82152_aq; +@@ -224,6 +231,11 @@ private boolean invulnerable; + private UUID field_96093_i; public EnumEntitySize myEntitySize; + /** Forge: Used to store custom data for each entity. */ + private NBTTagCompound customEntityData; @@ -47,7 +42,7 @@ public Entity(World par1World) { -@@ -543,7 +558,7 @@ +@@ -546,7 +558,7 @@ if (!this.worldObj.isRemote) { this.setFlag(0, this.fire > 0); @@ -56,32 +51,10 @@ } this.firstUpdate = false; -@@ -847,6 +862,8 @@ - par5 = d11; - this.boundingBox.setBB(axisalignedbb1); - } -+ /* Fixes a vanilla bug where the player view would dip when stepping between certain blocks -+ * https://mojang.atlassian.net/browse/MC-1594 - else - { - double d13 = this.boundingBox.minY - (double)((int)this.boundingBox.minY); -@@ -856,6 +873,7 @@ - this.ySize = (float)((double)this.ySize + d13 + 0.01D); - } - } -+ */ - } - - this.worldObj.theProfiler.endSection(); -@@ -1514,6 +1532,15 @@ - par1NBTTagCompound.setInteger("Dimension", this.dimension); - par1NBTTagCompound.setBoolean("Invulnerable", this.invulnerable); +@@ -1510,6 +1522,10 @@ par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal); -+ if (persistentID != null) -+ { -+ par1NBTTagCompound.setLong("PersistentIDMSB", persistentID.getMostSignificantBits()); -+ par1NBTTagCompound.setLong("PersistentIDLSB", persistentID.getLeastSignificantBits()); -+ } + par1NBTTagCompound.setLong("UUIDMost", this.field_96093_i.getMostSignificantBits()); + par1NBTTagCompound.setLong("UUIDLeast", this.field_96093_i.getLeastSignificantBits()); + if (customEntityData != null) + { + par1NBTTagCompound.setCompoundTag("ForgeData", customEntityData); @@ -89,22 +62,23 @@ this.writeEntityToNBT(par1NBTTagCompound); } catch (Throwable throwable) -@@ -1568,6 +1595,14 @@ - this.timeUntilPortal = par1NBTTagCompound.getInteger("PortalCooldown"); +@@ -1570,6 +1586,15 @@ + this.setPosition(this.posX, this.posY, this.posZ); this.setRotation(this.rotationYaw, this.rotationPitch); + if (par1NBTTagCompound.hasKey("ForgeData")) + { + customEntityData = par1NBTTagCompound.getCompoundTag("ForgeData"); + } ++ //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly + if (par1NBTTagCompound.hasKey("PersistentIDMSB") && par1NBTTagCompound.hasKey("PersistentIDLSB")) + { -+ persistentID = new UUID(par1NBTTagCompound.getLong("PersistentIDMSB"), par1NBTTagCompound.getLong("PersistentIDLSB")); ++ this.field_96093_i = new UUID(par1NBTTagCompound.getLong("PersistentIDMSB"), par1NBTTagCompound.getLong("PersistentIDLSB")); + } this.readEntityFromNBT(par1NBTTagCompound); } catch (Throwable throwable) -@@ -1662,7 +1697,14 @@ +@@ -1664,7 +1689,14 @@ { EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); entityitem.delayBeforeCanPickup = 10; @@ -120,7 +94,7 @@ return entityitem; } -@@ -2021,7 +2063,7 @@ +@@ -2026,7 +2058,7 @@ */ public boolean isRiding() { @@ -129,18 +103,18 @@ } /** -@@ -2359,7 +2401,7 @@ +@@ -2364,7 +2396,7 @@ - public float func_82146_a(Explosion par1Explosion, Block par2Block, int par3, int par4, int par5) + public float func_82146_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) { -- return par2Block.getExplosionResistance(this); -+ return par2Block.getExplosionResistance(this, worldObj, par3, par4, par5, posX, posY + (double)getEyeHeight(), posZ); +- return par6Block.getExplosionResistance(this); ++ return par6Block.getExplosionResistance(this, par2World, par3, par4, par5, posX, posY + (double)getEyeHeight(), posZ); } - public int func_82143_as() -@@ -2399,4 +2441,92 @@ + public boolean func_96091_a(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7) +@@ -2419,4 +2451,84 @@ { - return this.isBurning(); + return this.getEntityName(); } + + /* ================================== Forge Start =====================================*/ @@ -212,15 +186,7 @@ + + public UUID getPersistentID() + { -+ return persistentID; -+ } -+ -+ public synchronized void generatePersistentID() -+ { -+ if (persistentID == null) -+ { -+ persistentID = UUID.randomUUID(); -+ } ++ return field_96093_i; + } + + /** diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index c36553b6a9..74a1f8fc02 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -20,7 +20,7 @@ public abstract class EntityLiving extends Entity { /** -@@ -390,6 +396,7 @@ +@@ -395,6 +401,7 @@ public void setAttackTarget(EntityLiving par1EntityLiving) { this.attackTarget = par1EntityLiving; @@ -28,7 +28,7 @@ } /** -@@ -486,6 +493,7 @@ +@@ -491,6 +498,7 @@ { this.entityLivingToAttack = par1EntityLiving; this.revengeTimer = this.entityLivingToAttack != null ? 100 : 0; @@ -36,7 +36,7 @@ } protected void entityInit() -@@ -797,6 +805,11 @@ +@@ -802,6 +810,11 @@ */ public void onUpdate() { @@ -48,7 +48,7 @@ super.onUpdate(); if (!this.worldObj.isRemote) -@@ -982,6 +995,11 @@ +@@ -987,6 +1000,11 @@ */ public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { @@ -60,7 +60,7 @@ if (this.isEntityInvulnerable()) { return false; -@@ -1193,6 +1211,11 @@ +@@ -1224,6 +1242,11 @@ { if (!this.isEntityInvulnerable()) { @@ -72,7 +72,7 @@ par2 = this.applyArmorCalculations(par1DamageSource, par2); par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); int j = this.getHealth(); -@@ -1259,6 +1282,11 @@ +@@ -1290,6 +1313,11 @@ */ public void onDeath(DamageSource par1DamageSource) { @@ -82,20 +82,20 @@ + } + Entity entity = par1DamageSource.getEntity(); + EntityLiving entityliving = this.func_94060_bK(); - if (this.scoreValue >= 0 && entity != null) -@@ -1281,6 +1309,10 @@ - { +@@ -1314,6 +1342,10 @@ i = EnchantmentHelper.getLootingModifier((EntityLiving)entity); } -+ + + captureDrops = true; + capturedDrops.clear(); + int j = 0; - ++ if (!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { -@@ -1289,7 +1321,7 @@ + this.dropFewItems(this.recentlyHit > 0, i); +@@ -1321,7 +1353,7 @@ if (this.recentlyHit > 0) { @@ -104,7 +104,7 @@ if (j < 5) { -@@ -1297,6 +1329,16 @@ +@@ -1329,6 +1361,16 @@ } } } @@ -121,7 +121,7 @@ } this.worldObj.setEntityState(this, (byte)3); -@@ -1341,6 +1383,12 @@ +@@ -1373,6 +1415,12 @@ */ protected void fall(float par1) { @@ -134,7 +134,7 @@ super.fall(par1); int i = MathHelper.ceiling_float_int(par1 - 3.0F); -@@ -1543,7 +1591,7 @@ +@@ -1575,7 +1623,7 @@ int j = MathHelper.floor_double(this.boundingBox.minY); int k = MathHelper.floor_double(this.posZ); int l = this.worldObj.getBlockId(i, j, k); @@ -143,7 +143,7 @@ } /** -@@ -1965,6 +2013,7 @@ +@@ -1997,6 +2045,7 @@ } this.isAirBorne = true; @@ -151,7 +151,7 @@ } /** -@@ -2502,8 +2551,6 @@ +@@ -2534,8 +2583,6 @@ return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; } @@ -160,9 +160,9 @@ /** * Remove the speified potion effect from this entity. */ -@@ -3004,4 +3051,42 @@ +@@ -3044,4 +3091,42 @@ { - return this.func_94062_bN(); + this.equipmentDropChances[par1] = par2; } + + /*** diff --git a/patches/minecraft/net/minecraft/entity/EntityMinecartChest.java.patch b/patches/minecraft/net/minecraft/entity/EntityMinecartContainer.java.patch similarity index 68% rename from patches/minecraft/net/minecraft/entity/EntityMinecartChest.java.patch rename to patches/minecraft/net/minecraft/entity/EntityMinecartContainer.java.patch index 66c05ad666..2fa6bd38f5 100644 --- a/patches/minecraft/net/minecraft/entity/EntityMinecartChest.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityMinecartContainer.java.patch @@ -1,5 +1,5 @@ ---- ../src_base/minecraft/net/minecraft/entity/EntityMinecartChest.java -+++ ../src_work/minecraft/net/minecraft/entity/EntityMinecartChest.java +--- ../src_base/minecraft/net/minecraft/entity/EntityMinecartContainer.java ++++ ../src_work/minecraft/net/minecraft/entity/EntityMinecartContainer.java @@ -10,6 +10,8 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.util.DamageSource; @@ -7,9 +7,9 @@ +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.minecart.MinecartInteractEvent; - public class EntityMinecartChest extends EntityMinecart implements IInventory + public abstract class EntityMinecartContainer extends EntityMinecart implements IInventory { -@@ -292,6 +294,10 @@ +@@ -277,6 +279,10 @@ */ public boolean interact(EntityPlayer par1EntityPlayer) { diff --git a/patches/minecraft/net/minecraft/entity/EntityMinecartFurnace.java.patch b/patches/minecraft/net/minecraft/entity/EntityMinecartFurnace.java.patch index d8dfaa3f6d..a7619dc59c 100644 --- a/patches/minecraft/net/minecraft/entity/EntityMinecartFurnace.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityMinecartFurnace.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft/net/minecraft/entity/EntityMinecartFurnace.java +++ ../src_work/minecraft/net/minecraft/entity/EntityMinecartFurnace.java -@@ -8,6 +8,8 @@ - import net.minecraft.nbt.NBTTagCompound; +@@ -9,6 +9,8 @@ + import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; @@ -9,7 +9,7 @@ public class EntityMinecartFurnace extends EntityMinecart { -@@ -116,6 +118,10 @@ +@@ -127,6 +129,10 @@ */ public boolean interact(EntityPlayer par1EntityPlayer) { diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index acdab7cb9d..9e50332d12 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/entity/item/EntityMinecart.java +++ ../src_work/minecraft/net/minecraft/entity/item/EntityMinecart.java -@@ -24,6 +24,10 @@ +@@ -25,6 +25,10 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.WorldServer; @@ -11,7 +11,7 @@ public abstract class EntityMinecart extends Entity { -@@ -48,6 +52,20 @@ +@@ -49,6 +53,20 @@ @SideOnly(Side.CLIENT) protected double velocityZ; @@ -32,7 +32,7 @@ public EntityMinecart(World par1World) { super(par1World); -@@ -99,6 +117,10 @@ +@@ -102,6 +120,10 @@ */ public AxisAlignedBB getCollisionBox(Entity par1Entity) { @@ -43,7 +43,7 @@ return par1Entity.canBePushed() ? par1Entity.boundingBox : null; } -@@ -107,6 +129,10 @@ +@@ -110,6 +132,10 @@ */ public AxisAlignedBB getBoundingBox() { @@ -54,7 +54,7 @@ return null; } -@@ -115,7 +141,7 @@ +@@ -118,7 +144,7 @@ */ public boolean canBePushed() { @@ -63,19 +63,25 @@ } public EntityMinecart(World par1World, double par2, double par4, double par6) -@@ -349,13 +375,16 @@ +@@ -350,10 +376,13 @@ double d5 = 0.0078125D; int l = this.worldObj.getBlockId(j, i, k); - if (BlockRailBase.isRailBlock(l)) - { -- this.func_94091_a(j, i, k, d4, d5, l, this.worldObj.getBlockMetadata(j, i, k)); +- int i1 = this.worldObj.getBlockMetadata(j, i, k); +- this.func_94091_a(j, i, k, d4, d5, l, i1); + if (canUseRail() && BlockRailBase.isRailBlock(l)) + { + BlockRailBase rail = (BlockRailBase)Block.blocksList[l]; + float railMaxSpeed = rail.getRailMaxSpeed(worldObj, this, j, i, k); + double maxSpeed = Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); -+ this.func_94091_a(j, i, k, maxSpeed, getSlopeAdjustment(), l, rail.getBasicRailMetadata(worldObj, this, j, i, k)); ++ int i1 = rail.getBasicRailMetadata(worldObj, this, j, i, k); ++ this.func_94091_a(j, i, k, maxSpeed, getSlopeAdjustment(), l, i1); + + if (l == Block.field_94337_cv.blockID) + { +@@ -362,7 +391,7 @@ } else { @@ -84,7 +90,7 @@ } this.doBlockCollisions(); -@@ -382,7 +411,18 @@ +@@ -389,7 +418,18 @@ } this.setRotation(this.rotationYaw, this.rotationPitch); @@ -104,7 +110,7 @@ if (list != null && !list.isEmpty()) { -@@ -406,6 +446,8 @@ +@@ -413,6 +453,8 @@ this.riddenByEntity = null; } @@ -113,7 +119,7 @@ } } -@@ -429,6 +471,17 @@ +@@ -438,6 +480,17 @@ if (this.motionZ > par1) { this.motionZ = par1; @@ -131,7 +137,7 @@ } if (this.onGround) -@@ -438,13 +491,13 @@ +@@ -447,13 +500,13 @@ this.motionZ *= 0.5D; } @@ -149,7 +155,7 @@ } } -@@ -458,7 +511,7 @@ +@@ -467,7 +520,7 @@ if (par8 == Block.railPowered.blockID) { @@ -158,7 +164,7 @@ flag1 = !flag; } -@@ -523,7 +576,7 @@ +@@ -532,7 +585,7 @@ } } @@ -167,7 +173,7 @@ { d7 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -@@ -571,36 +624,8 @@ +@@ -580,36 +633,8 @@ this.posX = d8 + d2 * d7; this.posZ = d9 + d3 * d7; this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); @@ -206,7 +212,7 @@ if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - par1 == aint[0][0] && MathHelper.floor_double(this.posZ) - par3 == aint[0][2]) { -@@ -638,7 +663,12 @@ +@@ -647,7 +672,12 @@ this.motionZ = d6 * (double)(k1 - par3); } @@ -220,7 +226,7 @@ { double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -@@ -709,12 +739,7 @@ +@@ -718,12 +748,7 @@ } else { @@ -234,7 +240,7 @@ par3 = (double)j; -@@ -760,13 +785,8 @@ +@@ -769,13 +794,8 @@ if (BlockRailBase.isRailBlock(l)) { @@ -249,7 +255,7 @@ if (i1 >= 2 && i1 <= 5) { -@@ -872,11 +892,17 @@ +@@ -881,11 +901,17 @@ */ public void applyEntityCollision(Entity par1Entity) { @@ -268,7 +274,7 @@ { par1Entity.mountEntity(this); } -@@ -922,7 +948,7 @@ +@@ -931,7 +957,7 @@ double d7 = par1Entity.motionX + this.motionX; double d8 = par1Entity.motionZ + this.motionZ; @@ -277,7 +283,7 @@ { this.motionX *= 0.20000000298023224D; this.motionZ *= 0.20000000298023224D; -@@ -930,7 +956,7 @@ +@@ -939,7 +965,7 @@ par1Entity.motionX *= 0.949999988079071D; par1Entity.motionZ *= 0.949999988079071D; } @@ -286,9 +292,9 @@ { par1Entity.motionX *= 0.20000000298023224D; par1Entity.motionZ *= 0.20000000298023224D; -@@ -1118,4 +1144,206 @@ +@@ -1142,4 +1168,211 @@ { - return this.field_94102_c != null ? this.field_94102_c : super.getEntityName(); + return this.field_94102_c; } + + /** @@ -354,19 +360,24 @@ + * but is not necessary the item the cart drops when destroyed. + * @return An ItemStack that can be used to place the cart. + */ -+ public ItemStack getCartItem() { ++ public ItemStack getCartItem() ++ { + if (this instanceof EntityMinecartChest) + { + return new ItemStack(Item.minecartCrate); + } -+ if (this instanceof EntityMinecartTNT) ++ else if (this instanceof EntityMinecartTNT) + { + return new ItemStack(Item.field_94582_cb); + } -+ if (this instanceof EntityMinecartFurnace) ++ else if (this instanceof EntityMinecartFurnace) + { + return new ItemStack(Item.minecartPowered); + } ++ else if (this instanceof EntityMinecartHopper) ++ { ++ return new ItemStack(Item.field_96600_cc); ++ } + return new ItemStack(Item.minecartEmpty); + } + diff --git a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch index 13c661c9cc..ee9c14bd71 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -20,7 +20,7 @@ { private final InventoryCrafting field_90016_e = new InventoryCrafting(new ContainerSheep(this), 2, 1); -@@ -139,28 +143,6 @@ +@@ -159,28 +163,6 @@ */ public boolean interact(EntityPlayer par1EntityPlayer) { diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index 84a8475693..14fad3e784 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/entity/player/EntityPlayer.java +++ ../src_work/minecraft/net/minecraft/entity/player/EntityPlayer.java -@@ -57,8 +57,21 @@ +@@ -64,8 +64,21 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; @@ -22,7 +22,7 @@ /** Inventory of the player */ public InventoryPlayer inventory = new InventoryPlayer(this); private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); -@@ -261,6 +274,7 @@ +@@ -268,6 +281,7 @@ if (itemstack == this.itemInUse) { @@ -30,7 +30,7 @@ if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { this.updateItemUse(itemstack, 5); -@@ -499,11 +513,11 @@ +@@ -506,11 +520,11 @@ this.cameraYaw = 0.0F; this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); @@ -44,7 +44,7 @@ } } -@@ -632,6 +646,9 @@ +@@ -639,6 +653,9 @@ this.setPosition(this.posX, this.posY, this.posZ); this.motionY = 0.10000000149011612D; @@ -54,7 +54,7 @@ if (this.username.equals("Notch")) { this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true); -@@ -640,6 +657,20 @@ +@@ -647,6 +664,20 @@ if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { this.inventory.dropAllItems(); @@ -75,7 +75,7 @@ } if (par1DamageSource != null) -@@ -679,7 +710,20 @@ +@@ -697,7 +728,20 @@ */ public EntityItem dropOneItem(boolean par1) { @@ -97,7 +97,7 @@ } /** -@@ -688,7 +732,7 @@ +@@ -706,7 +750,7 @@ */ public EntityItem dropPlayerItem(ItemStack par1ItemStack) { @@ -106,7 +106,7 @@ } /** -@@ -740,23 +784,39 @@ +@@ -758,23 +802,39 @@ */ public void joinEntityItemWithWorld(EntityItem par1EntityItem) { @@ -151,7 +151,7 @@ { f += f1 * 0.08F; } -@@ -786,7 +846,8 @@ +@@ -804,7 +864,8 @@ f /= 5.0F; } @@ -161,7 +161,7 @@ } /** -@@ -794,7 +855,7 @@ +@@ -812,7 +873,7 @@ */ public boolean canHarvestBlock(Block par1Block) { @@ -170,7 +170,7 @@ } /** -@@ -1083,12 +1144,22 @@ +@@ -1070,12 +1131,22 @@ { if (!this.isEntityInvulnerable()) { @@ -194,7 +194,7 @@ par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); this.addExhaustion(par1DamageSource.getHungerDamage()); int j = this.getHealth(); -@@ -1131,6 +1202,10 @@ +@@ -1118,6 +1189,10 @@ public boolean interactWith(Entity par1Entity) { @@ -205,7 +205,7 @@ if (par1Entity.interact(this)) { return true; -@@ -1174,7 +1249,9 @@ +@@ -1161,7 +1236,9 @@ */ public void destroyCurrentEquippedItem() { @@ -215,7 +215,7 @@ } /** -@@ -1191,6 +1268,15 @@ +@@ -1178,6 +1255,15 @@ */ public void attackTargetEntityWithCurrentItem(Entity par1Entity) { @@ -231,7 +231,7 @@ if (par1Entity.canAttackWithItem()) { if (!par1Entity.func_85031_j(this)) -@@ -1354,6 +1440,12 @@ +@@ -1341,6 +1427,12 @@ */ public EnumStatus sleepInBedAt(int par1, int par2, int par3) { @@ -244,7 +244,7 @@ if (!this.worldObj.isRemote) { if (this.isPlayerSleeping() || !this.isEntityAlive()) -@@ -1393,6 +1485,11 @@ +@@ -1380,6 +1472,11 @@ { int l = this.worldObj.getBlockMetadata(par1, par2, par3); int i1 = BlockBed.getDirection(l); @@ -256,7 +256,7 @@ float f = 0.5F; float f1 = 0.5F; -@@ -1463,10 +1560,12 @@ +@@ -1450,10 +1547,12 @@ ChunkCoordinates chunkcoordinates = this.playerLocation; ChunkCoordinates chunkcoordinates1 = this.playerLocation; @@ -273,7 +273,7 @@ if (chunkcoordinates1 == null) { -@@ -1503,7 +1602,9 @@ +@@ -1490,7 +1589,9 @@ */ private boolean isInBed() { @@ -284,7 +284,7 @@ } /** -@@ -1518,9 +1619,12 @@ +@@ -1505,9 +1606,12 @@ ichunkprovider.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); ichunkprovider.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); @@ -300,7 +300,7 @@ return chunkcoordinates1; } else -@@ -1542,10 +1646,13 @@ +@@ -1529,10 +1633,13 @@ { if (this.playerLocation != null) { @@ -318,7 +318,7 @@ { case 0: return 90.0F; -@@ -1852,7 +1959,7 @@ +@@ -1839,7 +1946,7 @@ { if (par1ItemStack.getItem().requiresMultipleRenderPasses()) { @@ -327,7 +327,7 @@ } if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID) -@@ -1874,6 +1981,7 @@ +@@ -1861,6 +1968,7 @@ return Item.bow.func_94599_c(0); } } @@ -335,7 +335,7 @@ } return icon; -@@ -2105,6 +2213,14 @@ +@@ -2092,6 +2200,14 @@ } this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest; @@ -350,7 +350,7 @@ } /** -@@ -2176,7 +2292,14 @@ +@@ -2163,7 +2279,14 @@ */ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { @@ -365,4 +365,4 @@ + } } - public ItemStack[] getLastActiveItems() + /** diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index 9387fe4b77..2d933cb0e3 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -1,14 +1,14 @@ --- ../src_base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java +++ ../src_work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java -@@ -9,6 +9,7 @@ - import java.util.List; - import net.minecraft.entity.Entity; +@@ -15,6 +15,7 @@ + import net.minecraft.entity.EntityLiving; + import net.minecraft.entity.EntityMinecartHopper; import net.minecraft.entity.IMerchant; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerBeacon; -@@ -76,6 +77,11 @@ +@@ -87,6 +88,11 @@ import net.minecraft.world.WorldServer; import net.minecraft.world.chunk.Chunk; @@ -20,7 +20,7 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting { private StringTranslate translator = new StringTranslate("en_US"); -@@ -147,18 +153,10 @@ +@@ -158,18 +164,10 @@ par4ItemInWorldManager.thisPlayerMP = this; this.theItemInWorldManager = par4ItemInWorldManager; this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance(); @@ -38,9 +38,9 @@ - k = par2World.getTopSolidOrLiquidBlock(i, j); - } - this.setLocationAndAngles((double)i + 0.5D, (double)k, (double)j + 0.5D, 0.0F, 0.0F); this.mcServer = par1MinecraftServer; -@@ -255,7 +253,10 @@ + this.stepHeight = 0.0F; +@@ -271,7 +269,10 @@ if (chunkcoordintpair != null && this.worldObj.blockExists(chunkcoordintpair.chunkXPos << 4, 0, chunkcoordintpair.chunkZPos << 4)) { arraylist.add(this.worldObj.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos)); @@ -52,7 +52,7 @@ } } -@@ -276,6 +277,7 @@ +@@ -292,6 +293,7 @@ { Chunk chunk = (Chunk)iterator2.next(); this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk); @@ -60,7 +60,7 @@ } } } -@@ -320,11 +322,29 @@ +@@ -359,11 +361,29 @@ */ public void onDeath(DamageSource par1DamageSource) { @@ -88,5 +88,5 @@ + } + } } - } + Collection collection = this.worldObj.func_96441_U().func_96520_a(ScoreObjectiveCriteria.field_96642_c); diff --git a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index 73de1c915d..acaddd6d2e 100644 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,17 +1,17 @@ --- ../src_base/minecraft/net/minecraft/entity/player/InventoryPlayer.java +++ ../src_work/minecraft/net/minecraft/entity/player/InventoryPlayer.java -@@ -337,6 +337,14 @@ +@@ -338,6 +338,14 @@ + if (this.mainInventory[i] != null) + { this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); - } - } ++ } ++ } + + for (int i = 0; i < this.armorInventory.length; i++) + { + if (this.armorInventory[i] != null) + { + this.armorInventory[i].getItem().onArmorTickUpdate(this.player.worldObj, this.player, this.armorInventory[i]); -+ } -+ } + } + } } - - /** diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index 9682bed500..c9de124fa0 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 { -@@ -237,13 +240,16 @@ +@@ -242,13 +245,16 @@ /** Icon index in the icons table. */ protected Icon iconIndex; @@ -36,7 +36,7 @@ } itemsList[256 + par1] = this; -@@ -625,6 +631,10 @@ +@@ -630,6 +636,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); } -@@ -705,4 +715,324 @@ +@@ -710,4 +720,324 @@ { StatList.initStats(); } diff --git a/patches/minecraft/net/minecraft/item/ItemDye.java.patch b/patches/minecraft/net/minecraft/item/ItemDye.java.patch index af67a8b396..3e01ca3ff6 100644 --- a/patches/minecraft/net/minecraft/item/ItemDye.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemDye.java.patch @@ -1,9 +1,10 @@ --- ../src_base/minecraft/net/minecraft/item/ItemDye.java +++ ../src_work/minecraft/net/minecraft/item/ItemDye.java -@@ -20,6 +20,11 @@ +@@ -21,6 +21,12 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; ++import net.minecraftforge.common.FakePlayerFactory; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.Event.Result; @@ -12,44 +13,50 @@ public class ItemDye extends Item { /** List of dye color names */ -@@ -73,6 +78,21 @@ - if (par1ItemStack.getItemDamage() == 15) - { - i1 = par3World.getBlockId(par4, par5, par6); -+ -+ BonemealEvent event = new BonemealEvent(par2EntityPlayer, par3World, i1, par4, par5, par6); -+ if (MinecraftForge.EVENT_BUS.post(event)) -+ { -+ return false; -+ } -+ -+ if (event.getResult() == Result.ALLOW) -+ { -+ if (!par3World.isRemote) -+ { -+ par1ItemStack.stackSize--; -+ } -+ return true; -+ } +@@ -137,7 +143,27 @@ - if (i1 == Block.sapling.blockID) - { -@@ -172,16 +192,9 @@ - par3World.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1, 3); + public static boolean func_96604_a(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4) + { ++ return applyBonemeal(par0ItemStack, par1World, par2, par3, par4, FakePlayerFactory.getMinecraft(par1World)); ++ } ++ ++ public static boolean applyBonemeal(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4, EntityPlayer player) ++ { + int l = par1World.getBlockId(par2, par3, par4); ++ ++ BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return false; ++ } ++ ++ if (event.getResult() == Result.ALLOW) ++ { ++ if (!par1World.isRemote) ++ { ++ par0ItemStack.stackSize--; ++ } ++ return true; ++ } + + if (l == Block.sapling.blockID) + { +@@ -240,16 +266,9 @@ + par1World.setBlockAndMetadataWithNotify(j1, k1, l1, Block.tallGrass.blockID, 1, 3); + } + } +- else if (itemRand.nextInt(3) != 0) ++ else + { +- if (Block.plantYellow.canBlockStay(par1World, j1, k1, l1)) +- { +- par1World.func_94575_c(j1, k1, l1, Block.plantYellow.blockID); +- } +- } +- else if (Block.plantRed.canBlockStay(par1World, j1, k1, l1)) +- { +- par1World.func_94575_c(j1, k1, l1, Block.plantRed.blockID); ++ ForgeHooks.plantGrass(par1World, j1, k1, l1); } } -- else if (itemRand.nextInt(3) != 0) -+ else - { -- if (Block.plantYellow.canBlockStay(par3World, k1, l1, i2)) -- { -- par3World.func_94575_c(k1, l1, i2, Block.plantYellow.blockID); -- } -- } -- else if (Block.plantRed.canBlockStay(par3World, k1, l1, i2)) -- { -- par3World.func_94575_c(k1, l1, i2, Block.plantRed.blockID); -+ ForgeHooks.plantGrass(par3World, k1, l1, i2); - } } - } diff --git a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch index fac09eff0a..9f78a316fe 100644 --- a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/item/crafting/CraftingManager.java +++ ../src_work/minecraft/net/minecraft/item/crafting/CraftingManager.java -@@ -279,7 +279,7 @@ +@@ -282,7 +282,7 @@ } } diff --git a/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch b/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch index 8af2109ea3..d445ac73e5 100644 --- a/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch +++ b/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft/net/minecraft/network/NetServerHandler.java +++ ../src_work/minecraft/net/minecraft/network/NetServerHandler.java -@@ -64,6 +64,13 @@ - import net.minecraft.util.MathHelper; +@@ -63,6 +63,13 @@ + import net.minecraft.util.IntHashMap; import net.minecraft.world.WorldServer; +import net.minecraftforge.common.MinecraftForge; @@ -14,7 +14,7 @@ public class NetServerHandler extends NetHandler { /** The logging system. */ -@@ -235,6 +242,11 @@ +@@ -239,6 +246,11 @@ if (this.playerEntity.ridingEntity != null) { this.playerEntity.ridingEntity.updateRiderPosition(); @@ -26,7 +26,7 @@ } this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); -@@ -307,9 +319,9 @@ +@@ -311,9 +323,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))) -@@ -325,6 +337,11 @@ +@@ -329,6 +341,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); -@@ -349,10 +366,15 @@ +@@ -353,10 +370,15 @@ logger.warning(this.playerEntity.username + " moved wrongly!"); } @@ -68,7 +68,7 @@ { this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f2, f3); return; -@@ -360,7 +382,7 @@ +@@ -364,7 +386,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) { -@@ -379,6 +401,11 @@ +@@ -383,6 +405,11 @@ this.ticksForFloatKick = 0; } @@ -89,8 +89,8 @@ this.playerEntity.onGround = par1Packet10Flying.onGround; this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); this.playerEntity.updateFlyingState(this.playerEntity.posY - d0, par1Packet10Flying.onGround); -@@ -447,7 +474,10 @@ - double d2 = this.playerEntity.posZ - ((double)l + 0.5D); +@@ -449,7 +476,10 @@ + double d2 = this.playerEntity.posZ - ((double)k + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (d3 > 36.0D) @@ -101,15 +101,7 @@ { return; } -@@ -471,6 +501,7 @@ - { - if (j1 <= i && !flag) - { -+ ForgeEventFactory.onPlayerInteract(playerEntity, Action.LEFT_CLICK_BLOCK, j, k, l, 0); - this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(j, k, l, worldserver)); - } - else -@@ -518,7 +549,11 @@ +@@ -509,7 +539,11 @@ return; } @@ -122,24 +114,23 @@ } else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit())) { -@@ -536,7 +571,9 @@ - k1 = j1; - } - -- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && (k1 > i1 || flag1)) +@@ -518,7 +552,9 @@ + } + else + { +- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.mcServer.func_96290_a(worldserver, i, j, k, this.playerEntity)) + double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; + dist *= dist; -+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && (k1 > i1 || flag1)) ++ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.mcServer.func_96290_a(worldserver, i, j, k, this.playerEntity)) { this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset()); } -@@ -703,8 +740,12 @@ - this.sendPacketToPlayer(new Packet3Chat("Cannot send chat message.")); +@@ -686,7 +722,12 @@ return; } -- -- s = "<" + this.playerEntity.username + "> " + s; -+ ServerChatEvent event = new ServerChatEvent(this.playerEntity, s, "<" + this.playerEntity.username + "> " + s); + +- s = "<" + this.playerEntity.func_96090_ax() + "> " + s; ++ ServerChatEvent event = new ServerChatEvent(this.playerEntity, s, "<" + this.playerEntity.func_96090_ax() + "> " + s); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; @@ -148,7 +139,7 @@ logger.info(s); this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(s, false)); } -@@ -835,7 +876,7 @@ +@@ -817,7 +858,7 @@ return; } @@ -157,12 +148,11 @@ } } } -@@ -1233,7 +1274,7 @@ +@@ -1215,7 +1256,6 @@ } } } - -+ @Override diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 661f95cf6c..a155e162a3 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -8,7 +8,7 @@ import java.util.Iterator; import java.util.List; import java.util.logging.Level; -@@ -66,6 +67,10 @@ +@@ -55,6 +56,10 @@ import net.minecraft.world.storage.ISaveHandler; import net.minecraft.world.storage.WorldInfo; @@ -19,7 +19,7 @@ public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage { /** The logging system. */ -@@ -146,7 +151,8 @@ +@@ -135,7 +140,8 @@ public final long[] tickTimeArray = new long[100]; /** Stats are [dimension][tick%100] system.nanoTime is stored. */ @@ -29,7 +29,7 @@ private KeyPair serverKeyPair; /** Username of the server owner (for integrated servers) */ -@@ -239,8 +245,6 @@ +@@ -211,8 +217,6 @@ { this.convertMapIfNeeded(par1Str); this.setUserMessage("menu.loadingLevel"); @@ -38,7 +38,7 @@ ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true); WorldInfo worldinfo = isavehandler.loadWorldInfo(); WorldSettings worldsettings; -@@ -260,46 +264,23 @@ +@@ -232,46 +236,23 @@ worldsettings.enableBonusChest(); } @@ -96,7 +96,7 @@ this.setDifficultyForAllWorlds(this.getDifficulty()); this.initialWorldChunkLoad(); } -@@ -428,7 +409,14 @@ +@@ -400,7 +381,14 @@ for (int i = 0; i < this.worldServers.length; ++i) { WorldServer worldserver = this.worldServers[i]; @@ -111,7 +111,7 @@ } if (this.usageSnooper != null && this.usageSnooper.isSnooperRunning()) -@@ -652,13 +640,15 @@ +@@ -624,13 +612,15 @@ this.theProfiler.startSection("levels"); int i; @@ -132,7 +132,7 @@ this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); this.theProfiler.startSection("pools"); worldserver.getWorldVec3Pool().clear(); -@@ -705,9 +695,11 @@ +@@ -677,9 +667,11 @@ this.theProfiler.endSection(); } @@ -147,7 +147,7 @@ this.theProfiler.endStartSection("connection"); this.getNetworkThread().networkTick(); this.theProfiler.endStartSection("players"); -@@ -761,7 +753,13 @@ +@@ -733,7 +725,13 @@ */ public WorldServer worldServerForDimension(int par1) { @@ -162,7 +162,7 @@ } @SideOnly(Side.SERVER) -@@ -1132,6 +1130,7 @@ +@@ -1107,6 +1105,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 de24ee48f2..02f1a84fe0 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerInstance.java.patch @@ -8,111 +8,79 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.packet.Packet; -@@ -10,9 +11,13 @@ +@@ -9,11 +10,14 @@ + import net.minecraft.network.packet.Packet53BlockChange; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.ChunkCoordIntPair; - +import net.minecraftforge.common.ForgeDummyContainer; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.ChunkWatchEvent; -+ + public class PlayerInstance { -- private final List playersInChunk; -+ public final List playersInChunk; + /** the list of all players in this instance (chunk) */ +- private final List players; ++ public final List players; /** note: this is final */ private final ChunkCoordIntPair chunkLocation; -@@ -56,6 +61,8 @@ - this.playersInChunk.remove(par1EntityPlayerMP); +@@ -64,6 +68,8 @@ + this.players.remove(par1EntityPlayerMP); par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); + 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; -@@ -80,20 +87,21 @@ +@@ -91,7 +97,7 @@ this.field_73260_f |= 1 << (par2 >> 4); -- if (this.numberOfTilesToUpdate < 64) -+ short var4 = (short)(par1 << 12 | par3 << 8 | par2); -+ -+ for (int var5 = 0; var5 < this.numberOfTilesToUpdate; ++var5) +- if (this.numBlocksToUpdate < 64) ++ //if (this.numBlocksToUpdate < 64) //Forge; Cache everything, so always run { -- short short1 = (short)(par1 << 12 | par3 << 8 | par2); -+ if (this.locationOfBlockChange[var5] == var4) + short short1 = (short)(par1 << 12 | par3 << 8 | par2); + +@@ -103,6 +109,10 @@ + } + } + ++ if (this.numBlocksToUpdate == blocksToUpdate.length) + { -+ return; ++ this.blocksToUpdate = Arrays.copyOf(this.blocksToUpdate, blocksToUpdate.length << 1); + } -+ } - -- for (int l = 0; l < this.numberOfTilesToUpdate; ++l) -- { -- if (this.locationOfBlockChange[l] == short1) -- { -- return; -- } -- } -- -- this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1; -+ if (this.numberOfTilesToUpdate == locationOfBlockChange.length) -+ { -+ this.locationOfBlockChange = Arrays.copyOf(this.locationOfBlockChange, locationOfBlockChange.length << 1); + this.blocksToUpdate[this.numBlocksToUpdate++] = short1; } -+ this.locationOfBlockChange[this.numberOfTilesToUpdate++] = var4; } - - public void sendToAllPlayersWatchingChunk(Packet par1Packet) -@@ -133,40 +141,26 @@ +@@ -147,12 +157,13 @@ { int l; -- if (this.numberOfTilesToUpdate == 64) -+ if (this.numberOfTilesToUpdate >= ForgeDummyContainer.clumpingThreshold) +- if (this.numBlocksToUpdate == 64) ++ if (this.numBlocksToUpdate >= ForgeDummyContainer.clumpingThreshold) { i = this.chunkLocation.chunkXPos * 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)); -- -- for (k = 0; k < 16; ++k) -- { -- if ((this.field_73260_f & 1 << k) != 0) -- { -- l = k << 4; -- List list = PlayerManager.getWorldServer(this.myManager).getAllTileEntityInBox(i, l, j, i + 16, l + 16, j + 16); -- -- for (int i1 = 0; i1 < list.size(); ++i1) -- { -- this.sendTileToAllPlayersWatchingChunk((TileEntity)list.get(i1)); -- } -- } -- } + 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 + for (k = 0; k < 16; ++k) + { + if ((this.field_73260_f & 1 << k) != 0) +@@ -166,11 +177,14 @@ + } + } + } ++ */ } else { - this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.myManager))); -+ } - -- for (i = 0; i < this.numberOfTilesToUpdate; ++i) -+ for (i = 0; i < this.numberOfTilesToUpdate; ++i) -+ { -+ j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15); -+ k = this.locationOfBlockChange[i] & 255; -+ l = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[i] >> 8 & 15); -+ -+ if (PlayerManager.getWorldServer(this.myManager).blockHasTileEntity(j, k, l)) - { -- j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15); -- k = this.locationOfBlockChange[i] & 255; -- l = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[i] >> 8 & 15); + this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.myManager))); - -- if (PlayerManager.getWorldServer(this.myManager).blockHasTileEntity(j, k, l)) -- { -- this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.myManager).getBlockTileEntity(j, k, l)); -- } -+ this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.myManager).getBlockTileEntity(j, k, l)); - } - } - } ++ } ++ ++ { //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) + { + j = this.chunkLocation.chunkXPos * 16 + (this.blocksToUpdate[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 c5693edd97..c1dea17640 100644 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java +++ ../src_work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java -@@ -38,10 +38,14 @@ - import net.minecraft.util.ChunkCoordinates; +@@ -47,10 +47,14 @@ + import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.EnumGameType; +import net.minecraft.world.Teleporter; @@ -15,7 +15,7 @@ public abstract class ServerConfigurationManager { -@@ -323,6 +327,16 @@ +@@ -364,6 +368,16 @@ */ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3) { @@ -32,7 +32,7 @@ par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeAllTrackingPlayers(par1EntityPlayerMP); par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(par1EntityPlayerMP); par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP); -@@ -345,6 +359,7 @@ +@@ -386,6 +400,7 @@ EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.username, (ItemInWorldManager)object); entityplayermp1.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler; entityplayermp1.clonePlayer(par1EntityPlayerMP, par3); @@ -40,8 +40,8 @@ entityplayermp1.entityId = par1EntityPlayerMP.entityId; WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver); -@@ -388,6 +403,11 @@ - +@@ -433,6 +448,11 @@ + */ public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2) { + transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).func_85176_s()); @@ -52,7 +52,7 @@ int j = par1EntityPlayerMP.dimension; WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); par1EntityPlayerMP.dimension = par2; -@@ -395,7 +415,7 @@ +@@ -440,7 +460,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); -@@ -417,38 +437,23 @@ +@@ -462,38 +482,23 @@ */ public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) { @@ -111,7 +111,7 @@ { ChunkCoordinates chunkcoordinates; -@@ -485,7 +490,7 @@ +@@ -530,7 +535,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/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 1f0c18984e..61cc40e908 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -1,7 +1,7 @@ --- ../src_base/minecraft/net/minecraft/tileentity/TileEntity.java +++ ../src_work/minecraft/net/minecraft/tileentity/TileEntity.java -@@ -11,7 +11,10 @@ - import net.minecraft.block.TileEntityRecordPlayer; +@@ -10,7 +10,10 @@ + import net.minecraft.block.Block; import net.minecraft.crash.CrashReportCategory; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.INetworkManager; @@ -11,9 +11,9 @@ import net.minecraft.world.World; public class TileEntity -@@ -300,4 +303,93 @@ - addMapping(TileEntityDaylightDetector.class, "DLDetector"); +@@ -304,4 +307,93 @@ addMapping(TileEntityHopper.class, "Hopper"); + addMapping(TileEntityComparator.class, "Comparator"); } + + // -- BEGIN FORGE PATCHES -- diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch index 748d5cd9de..eccb797389 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java -@@ -116,8 +116,9 @@ +@@ -117,8 +117,9 @@ for (int l = this.zCoord - i; l <= this.zCoord + i; ++l) { int i1 = this.worldObj.getBlockId(k, j, l); diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index dac9f7adc3..8c4cd178b2 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -4,8 +4,8 @@ if (k1 > 0) { Block block = Block.blocksList[k1]; -- float f3 = this.exploder != null ? this.exploder.func_82146_a(this, block, l, i1, j1) : block.getExplosionResistance(this.exploder); -+ float f3 = this.exploder != null ? this.exploder.func_82146_a(this, block, l, i1, j1) : block.getExplosionResistance(this.exploder, worldObj, l, i1, j1, explosionX, explosionY, explosionZ); +- float f3 = this.exploder != null ? this.exploder.func_82146_a(this, this.worldObj, l, i1, j1, block) : block.getExplosionResistance(this.exploder); ++ float f3 = this.exploder != null ? this.exploder.func_82146_a(this, this.worldObj, l, i1, j1, block) : block.getExplosionResistance(this.exploder, worldObj, l, i1, j1, explosionX, explosionY, explosionZ); f1 -= (f3 + 0.3F) * f2; } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 278afa9a1e..01f9033cb2 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -1,6 +1,6 @@ --- ../src_base/minecraft/net/minecraft/world/World.java +++ ../src_work/minecraft/net/minecraft/world/World.java -@@ -47,8 +47,30 @@ +@@ -50,8 +50,30 @@ import net.minecraft.world.storage.MapStorage; import net.minecraft.world.storage.WorldInfo; @@ -31,7 +31,7 @@ /** * boolean; if true updates scheduled by scheduleBlockUpdate happen immediately */ -@@ -162,6 +184,11 @@ +@@ -166,6 +188,11 @@ * Gets the biome for a given set of x/z coordinates */ public BiomeGenBase getBiomeGenForCoords(int par1, int par2) @@ -43,7 +43,7 @@ { if (this.blockExists(par1, 0, par2)) { -@@ -192,7 +219,13 @@ +@@ -196,7 +223,13 @@ this.theProfiler = par5Profiler; this.worldInfo = new WorldInfo(par4WorldSettings, par2Str); this.provider = par3WorldProvider; @@ -58,7 +58,7 @@ VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); if (villagecollection == null) -@@ -206,7 +239,7 @@ +@@ -210,7 +243,7 @@ this.villageCollectionObj.func_82566_a(this); } @@ -67,7 +67,7 @@ this.chunkProvider = this.createChunkProvider(); this.calculateInitialSkylight(); this.calculateInitialWeather(); -@@ -220,7 +253,7 @@ +@@ -224,7 +257,7 @@ this.isRemote = false; this.saveHandler = par1ISaveHandler; this.theProfiler = par5Profiler; @@ -76,7 +76,7 @@ this.worldInfo = par1ISaveHandler.loadWorldInfo(); if (par4WorldProvider != null) -@@ -273,12 +306,20 @@ +@@ -277,12 +310,20 @@ this.worldInfo.setServerInitialized(true); } @@ -99,7 +99,7 @@ } else { -@@ -288,6 +329,19 @@ +@@ -292,6 +333,19 @@ this.calculateInitialSkylight(); this.calculateInitialWeather(); @@ -119,7 +119,7 @@ } /** -@@ -376,7 +430,8 @@ +@@ -380,7 +434,8 @@ */ public boolean isAirBlock(int par1, int par2, int par3) { @@ -129,7 +129,7 @@ } /** -@@ -385,7 +440,8 @@ +@@ -389,7 +444,8 @@ public boolean blockHasTileEntity(int par1, int par2, int par3) { int l = this.getBlockId(par1, par2, par3); @@ -139,7 +139,7 @@ } /** -@@ -1085,7 +1141,7 @@ +@@ -1141,7 +1197,7 @@ */ public boolean isDaytime() { @@ -148,7 +148,7 @@ } /** -@@ -1117,7 +1173,7 @@ +@@ -1173,7 +1229,7 @@ int l1 = this.getBlockMetadata(l, i1, j1); Block block = Block.blocksList[k1]; @@ -157,7 +157,7 @@ { MovingObjectPosition movingobjectposition = block.collisionRayTrace(this, l, i1, j1, par1Vec3, par2Vec3); -@@ -1317,6 +1373,12 @@ +@@ -1373,6 +1429,12 @@ */ public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4) { @@ -170,7 +170,7 @@ if (par1Entity != null && par2Str != null) { for (int i = 0; i < this.worldAccesses.size(); ++i) -@@ -1331,6 +1393,12 @@ +@@ -1387,6 +1449,12 @@ */ public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4) { @@ -183,7 +183,7 @@ if (par1EntityPlayer != null && par2Str != null) { for (int i = 0; i < this.worldAccesses.size(); ++i) -@@ -1417,6 +1485,11 @@ +@@ -1473,6 +1541,11 @@ EntityPlayer entityplayer = (EntityPlayer)par1Entity; this.playerEntities.add(entityplayer); this.updateAllPlayersSleepingFlag(); @@ -195,7 +195,7 @@ } this.getChunkFromChunkCoords(i, j).addEntity(par1Entity); -@@ -1663,6 +1736,12 @@ +@@ -1719,6 +1792,12 @@ * Calculates the color for the skybox */ public Vec3 getSkyColor(Entity par1Entity, float par2) @@ -208,7 +208,7 @@ { float f1 = this.getCelestialAngle(par2); float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1756,6 +1835,12 @@ +@@ -1812,6 +1891,12 @@ @SideOnly(Side.CLIENT) public Vec3 drawClouds(float par1) { @@ -221,7 +221,7 @@ float f1 = this.getCelestialAngle(par1); float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1834,7 +1919,7 @@ +@@ -1890,7 +1975,7 @@ { int l = chunk.getBlockID(par1, k, par2); @@ -230,7 +230,7 @@ { return k + 1; } -@@ -1849,6 +1934,12 @@ +@@ -1905,6 +1990,12 @@ * How bright are stars in the sky */ public float getStarBrightness(float par1) @@ -243,7 +243,7 @@ { float f1 = this.getCelestialAngle(par1); float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); -@@ -1984,16 +2075,8 @@ +@@ -2040,16 +2131,8 @@ if (entity.isDead) { @@ -262,7 +262,7 @@ } this.theProfiler.endSection(); -@@ -2032,7 +2115,7 @@ +@@ -2088,7 +2171,7 @@ if (chunk != null) { @@ -271,7 +271,7 @@ } } } -@@ -2041,6 +2124,10 @@ +@@ -2097,6 +2180,10 @@ if (!this.entityRemoval.isEmpty()) { @@ -282,7 +282,7 @@ this.loadedTileEntityList.removeAll(this.entityRemoval); this.entityRemoval.clear(); } -@@ -2061,18 +2148,18 @@ +@@ -2117,18 +2204,18 @@ { this.loadedTileEntityList.add(tileentity1); } @@ -305,7 +305,7 @@ } } -@@ -2085,13 +2172,13 @@ +@@ -2141,13 +2228,13 @@ public void addTileEntity(Collection par1Collection) { @@ -326,7 +326,7 @@ } } -@@ -2111,9 +2198,17 @@ +@@ -2167,9 +2254,17 @@ { int i = MathHelper.floor_double(par1Entity.posX); int j = MathHelper.floor_double(par1Entity.posZ); @@ -347,7 +347,7 @@ { par1Entity.lastTickPosX = par1Entity.posX; par1Entity.lastTickPosY = par1Entity.posY; -@@ -2346,6 +2441,14 @@ +@@ -2402,6 +2497,14 @@ { return true; } @@ -362,7 +362,7 @@ } } } -@@ -2651,25 +2754,21 @@ +@@ -2707,25 +2810,21 @@ */ public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) { @@ -403,7 +403,7 @@ } } -@@ -2678,27 +2777,10 @@ +@@ -2734,27 +2833,10 @@ */ public void removeBlockTileEntity(int par1, int par2, int par3) { @@ -435,7 +435,7 @@ } } -@@ -2724,7 +2806,8 @@ +@@ -2780,7 +2862,8 @@ */ public boolean isBlockNormalCube(int par1, int par2, int par3) { @@ -445,17 +445,17 @@ } public boolean func_85174_u(int par1, int par2, int par3) -@@ -2747,8 +2830,7 @@ +@@ -2803,8 +2886,7 @@ */ public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3) { - Block block = Block.blocksList[this.getBlockId(par1, par2, par3)]; -- return block == null ? false : (block.blockMaterial.isOpaque() && block.renderAsNormalBlock() ? true : (block instanceof BlockStairs ? (this.getBlockMetadata(par1, par2, par3) & 4) == 4 : (block instanceof BlockHalfSlab ? (this.getBlockMetadata(par1, par2, par3) & 8) == 8 : block instanceof BlockHopper))); +- return block == null ? false : (block.blockMaterial.isOpaque() && block.renderAsNormalBlock() ? true : (block instanceof BlockStairs ? (this.getBlockMetadata(par1, par2, par3) & 4) == 4 : (block instanceof BlockHalfSlab ? (this.getBlockMetadata(par1, par2, par3) & 8) == 8 : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? (this.getBlockMetadata(par1, par2, par3) & 7) == 7 : false))))); + return isBlockSolidOnSide(par1, par2, par3, ForgeDirection.UP); } /** -@@ -2764,7 +2846,7 @@ +@@ -2820,7 +2902,7 @@ if (chunk != null && !chunk.isEmpty()) { Block block = Block.blocksList[this.getBlockId(par1, par2, par3)]; @@ -464,7 +464,7 @@ } else { -@@ -2795,8 +2877,7 @@ +@@ -2851,8 +2933,7 @@ */ public void setAllowedSpawnTypes(boolean par1, boolean par2) { @@ -474,7 +474,7 @@ } /** -@@ -2812,6 +2893,11 @@ +@@ -2868,6 +2949,11 @@ */ private void calculateInitialWeather() { @@ -486,7 +486,7 @@ if (this.worldInfo.isRaining()) { this.rainingStrength = 1.0F; -@@ -2827,6 +2913,11 @@ +@@ -2883,6 +2969,11 @@ * Updates all weather states. */ protected void updateWeather() @@ -498,9 +498,9 @@ { if (!this.provider.hasNoSky) { -@@ -2924,12 +3015,14 @@ - - public void toggleRain() +@@ -2983,12 +3074,14 @@ + */ + public void commandToggleDownfall() { - this.worldInfo.setRainTime(1); + provider.toggleRain(); @@ -514,7 +514,7 @@ this.theProfiler.startSection("buildList"); int i; EntityPlayer entityplayer; -@@ -3036,6 +3129,11 @@ +@@ -3095,6 +3188,11 @@ */ public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) { @@ -526,7 +526,7 @@ BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); float f = biomegenbase.getFloatTemperature(); -@@ -3093,6 +3191,11 @@ +@@ -3152,6 +3250,11 @@ * Tests whether or not snow can be placed at a given location */ public boolean canSnowAt(int par1, int par2, int par3) @@ -538,7 +538,7 @@ { BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); float f = biomegenbase.getFloatTemperature(); -@@ -3186,7 +3289,7 @@ +@@ -3245,7 +3348,7 @@ private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6) { @@ -547,7 +547,7 @@ int l1 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6; int i2 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6; int j2 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6; -@@ -3321,7 +3424,7 @@ +@@ -3380,7 +3483,7 @@ int k4 = i2 + (i4 / 2 + 1) % 3 / 2 * l3; int l4 = j2 + (i4 / 2 + 2) % 3 / 2 * l3; l2 = this.getSavedLightValue(par1EnumSkyBlock, j4, k4, l4); @@ -556,7 +556,7 @@ if (i5 == 0) { -@@ -3352,7 +3455,7 @@ +@@ -3411,7 +3514,7 @@ j2 = (k1 >> 12 & 63) - 32 + par4; k2 = this.getSavedLightValue(par1EnumSkyBlock, l1, i2, j2); l2 = this.getBlockId(l1, i2, j2); @@ -565,7 +565,7 @@ if (i3 == 0) { -@@ -3459,10 +3562,10 @@ +@@ -3518,10 +3621,10 @@ public List func_94576_a(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { this.entitiesWithinAABBExcludingEntity.clear(); @@ -580,7 +580,7 @@ for (int i1 = i; i1 <= j; ++i1) { -@@ -3488,10 +3591,10 @@ +@@ -3547,10 +3650,10 @@ public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { @@ -595,7 +595,7 @@ ArrayList arraylist = new ArrayList(); for (int i1 = i; i1 <= j; ++i1) -@@ -3584,11 +3687,14 @@ +@@ -3643,11 +3746,14 @@ */ public void addLoadedEntities(List par1List) { @@ -613,7 +613,7 @@ } } -@@ -3622,6 +3728,11 @@ +@@ -3681,6 +3787,11 @@ else { if (block != null && (block == Block.waterMoving || block == Block.waterStill || block == Block.lavaMoving || block == Block.lavaStill || block == Block.fire || block.blockMaterial.isReplaceable())) @@ -625,7 +625,7 @@ { block = null; } -@@ -3910,7 +4021,7 @@ +@@ -3969,7 +4080,7 @@ */ public long getSeed() { @@ -634,7 +634,7 @@ } public long getTotalWorldTime() -@@ -3920,7 +4031,7 @@ +@@ -3979,7 +4090,7 @@ public long getWorldTime() { @@ -643,7 +643,7 @@ } /** -@@ -3928,7 +4039,7 @@ +@@ -3987,7 +4098,7 @@ */ public void setWorldTime(long par1) { @@ -652,7 +652,7 @@ } /** -@@ -3936,13 +4047,13 @@ +@@ -3995,13 +4106,13 @@ */ public ChunkCoordinates getSpawnPoint() { @@ -668,7 +668,7 @@ } @SideOnly(Side.CLIENT) -@@ -3966,7 +4077,10 @@ +@@ -4025,7 +4136,10 @@ if (!this.loadedEntityList.contains(par1Entity)) { @@ -680,7 +680,7 @@ } } -@@ -3974,6 +4088,11 @@ +@@ -4033,6 +4147,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) @@ -692,7 +692,7 @@ { return true; } -@@ -4094,8 +4213,7 @@ +@@ -4153,8 +4272,7 @@ */ public boolean isBlockHighHumidity(int par1, int par2, int par3) { @@ -702,7 +702,7 @@ } /** -@@ -4170,7 +4288,7 @@ +@@ -4229,7 +4347,7 @@ */ public int getHeight() { @@ -711,7 +711,7 @@ } /** -@@ -4178,7 +4296,7 @@ +@@ -4237,7 +4355,7 @@ */ public int getActualHeight() { @@ -720,7 +720,7 @@ } public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart) -@@ -4221,7 +4339,7 @@ +@@ -4280,7 +4398,7 @@ */ public double getHorizon() { @@ -729,10 +729,11 @@ } /** -@@ -4282,4 +4400,75 @@ - - @SideOnly(Side.CLIENT) - public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) {} +@@ -4378,4 +4496,75 @@ + } + } + } +-} + + /** + * Adds a single TileEntity to the world. @@ -804,4 +805,4 @@ + { + return ForgeChunkManager.getPersistentChunksFor(this); + } - } ++} \ No newline at end of file diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index 1d8cc2505f..c5fc92e525 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; -@@ -45,11 +47,18 @@ +@@ -46,11 +48,18 @@ import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; @@ -28,7 +28,7 @@ public class WorldServer extends World { -@@ -86,6 +95,10 @@ +@@ -87,6 +96,10 @@ /** An IntHashMap of entity IDs (integers) to their Entity objects. */ private IntHashMap entityIdMap; @@ -39,15 +39,15 @@ public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler) { super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler); -@@ -109,6 +122,7 @@ - } +@@ -121,6 +134,7 @@ - this.field_85177_Q = new Teleporter(this); + scoreboardsavedata.func_96499_a(this.field_96442_D); + ((ServerScoreboard)this.field_96442_D).func_96547_a(scoreboardsavedata); + DimensionManager.setWorld(par4, this); } /** -@@ -172,6 +186,10 @@ +@@ -184,6 +198,10 @@ this.villageSiegeObj.tick(); this.theProfiler.endStartSection("portalForcer"); this.field_85177_Q.func_85189_a(this.getTotalWorldTime()); @@ -58,7 +58,7 @@ this.theProfiler.endSection(); this.sendAndApplyBlockEvents(); } -@@ -225,10 +243,7 @@ +@@ -237,10 +255,7 @@ private void resetRainAndThunder() { @@ -70,7 +70,7 @@ } public boolean areAllPlayersAsleep() -@@ -299,6 +314,14 @@ +@@ -311,6 +326,14 @@ int i = 0; int j = 0; Iterator iterator = this.activeChunkSet.iterator(); @@ -85,7 +85,7 @@ while (iterator.hasNext()) { -@@ -309,14 +332,18 @@ +@@ -321,14 +344,18 @@ Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); this.moodSoundAndLightCheck(k, l, chunk); this.theProfiler.endStartSection("tickChunk"); @@ -106,7 +106,7 @@ { this.updateLCG = this.updateLCG * 3 + 1013904223; i1 = this.updateLCG >> 2; -@@ -333,7 +360,7 @@ +@@ -345,7 +372,7 @@ this.theProfiler.endStartSection("iceandsnow"); int i2; @@ -115,7 +115,7 @@ { this.updateLCG = this.updateLCG * 3 + 1013904223; i1 = this.updateLCG >> 2; -@@ -418,7 +445,8 @@ +@@ -430,7 +457,8 @@ 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); @@ -125,7 +125,7 @@ if (this.scheduledUpdatesAreImmediate && par4 > 0) { -@@ -480,7 +508,7 @@ +@@ -492,7 +520,7 @@ */ public void updateEntities() { @@ -134,7 +134,7 @@ { if (this.updateEntityTick++ >= 1200) { -@@ -546,7 +574,8 @@ +@@ -558,7 +586,8 @@ { nextticklistentry = (NextTickListEntry)iterator.next(); iterator.remove(); @@ -144,7 +144,7 @@ if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0)) { -@@ -667,16 +696,28 @@ +@@ -679,16 +708,28 @@ { ArrayList arraylist = new ArrayList(); @@ -183,7 +183,7 @@ return arraylist; } -@@ -684,6 +725,11 @@ +@@ -696,6 +737,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) @@ -193,18 +193,9 @@ + + public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) { - int l = MathHelper.abs_int(par2 - this.worldInfo.getSpawnX()); - int i1 = MathHelper.abs_int(par4 - this.worldInfo.getSpawnZ()); -@@ -693,7 +739,7 @@ - i1 = l; - } - -- return i1 > 16 || this.mcServer.getConfigurationManager().areCommandsAllowed(par1EntityPlayer.username) || this.mcServer.isSinglePlayer(); -+ return i1 > mcServer.getSpawnProtectionSize() || this.mcServer.getConfigurationManager().areCommandsAllowed(par1EntityPlayer.username) || this.mcServer.isSinglePlayer(); + return !this.mcServer.func_96290_a(this, par2, par3, par4, par1EntityPlayer); } - - protected void initialize(WorldSettings par1WorldSettings) -@@ -776,7 +822,7 @@ +@@ -780,7 +826,7 @@ */ protected void createBonusChest() { @@ -213,7 +204,7 @@ for (int i = 0; i < 10; ++i) { -@@ -819,6 +865,7 @@ +@@ -823,6 +869,7 @@ } this.chunkProvider.saveChunks(par1, par2IProgressUpdate); @@ -221,7 +212,7 @@ } } -@@ -830,6 +877,7 @@ +@@ -834,6 +881,7 @@ this.checkSessionLock(); this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getTagsFromLastWrite()); this.mapStorage.saveAllData(); @@ -229,7 +220,7 @@ } /** -@@ -1052,4 +1100,9 @@ +@@ -1056,4 +1104,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 8aaaec25d2..1a5b104bd3 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -168,7 +168,7 @@ { Block.blocksList[l1].breakBlock(this.worldObj, j2, par2, k2, l1, i2); } -- else if (Block.blocksList[l1] instanceof BlockContainer && l1 != par4) +- else if (Block.blocksList[l1] instanceof ITileEntityProvider && l1 != par4) - { - this.worldObj.removeBlockTileEntity(j2, par2, k2); + else if (Block.blocksList[l1] != null && Block.blocksList[l1].hasTileEntity(i2)) @@ -194,14 +194,14 @@ Block.blocksList[par4].onBlockAdded(this.worldObj, j2, par2, k2); } -- if (Block.blocksList[par4] instanceof BlockContainer) +- if (Block.blocksList[par4] instanceof ITileEntityProvider) + if (Block.blocksList[par4] != null && Block.blocksList[par4].hasTileEntity(par5)) { tileentity = this.getChunkBlockTileEntity(par1, par2, par3); if (tileentity == null) { -- tileentity = ((BlockContainer)Block.blocksList[par4]).createNewTileEntity(this.worldObj); +- tileentity = ((ITileEntityProvider)Block.blocksList[par4]).createNewTileEntity(this.worldObj); + tileentity = Block.blocksList[par4].createTileEntity(this.worldObj, par5); this.worldObj.setBlockTileEntity(j2, par2, k2, tileentity); } @@ -213,7 +213,7 @@ } - } - } -- else if (l1 > 0 && Block.blocksList[l1] instanceof BlockContainer) +- else if (l1 > 0 && Block.blocksList[l1] instanceof ITileEntityProvider) - { - tileentity = this.getChunkBlockTileEntity(par1, par2, par3); - @@ -236,7 +236,7 @@ extendedblockstorage.setExtBlockMetadata(par1, par2 & 15, par3, par4); int j1 = extendedblockstorage.getExtBlockID(par1, par2 & 15, par3); -- if (j1 > 0 && Block.blocksList[j1] instanceof BlockContainer) +- if (j1 > 0 && Block.blocksList[j1] instanceof ITileEntityProvider) + if (j1 > 0 && Block.blocksList[j1] != null && Block.blocksList[j1].hasTileEntity(par4)) { TileEntity tileentity = this.getChunkBlockTileEntity(par1, par2, par3); @@ -280,7 +280,7 @@ par1Entity.addedToChunk = true; par1Entity.chunkCoordX = this.xPosition; par1Entity.chunkCoordY = k; -@@ -877,33 +976,33 @@ +@@ -877,33 +976,32 @@ ChunkPosition chunkposition = new ChunkPosition(par1, par2, par3); TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition); @@ -293,7 +293,7 @@ if (tileentity == null) { int l = this.getBlockID(par1, par2, par3); - +- - if (l <= 0 || !Block.blocksList[l].hasTileEntity()) + int meta = this.getBlockMetadata(par1, par2, par3); + @@ -304,7 +304,7 @@ if (tileentity == null) { -- tileentity = ((BlockContainer)Block.blocksList[l]).createNewTileEntity(this.worldObj); +- tileentity = ((ITileEntityProvider)Block.blocksList[l]).createNewTileEntity(this.worldObj); + tileentity = Block.blocksList[l].createTileEntity(this.worldObj, meta); this.worldObj.setBlockTileEntity(this.xPosition * 16 + par1, par2, this.zPosition * 16 + par3, tileentity); } @@ -325,7 +325,7 @@ } /** -@@ -918,7 +1017,7 @@ +@@ -918,7 +1016,7 @@ if (this.isChunkLoaded) { @@ -334,11 +334,11 @@ } } -@@ -933,8 +1032,14 @@ +@@ -933,8 +1031,14 @@ par4TileEntity.yCoord = par2; par4TileEntity.zCoord = this.zPosition * 16 + par3; -- if (this.getBlockID(par1, par2, par3) != 0 && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof BlockContainer) +- 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))) @@ -351,7 +351,7 @@ par4TileEntity.validate(); this.chunkTileEntityMap.put(chunkposition, par4TileEntity); } -@@ -970,6 +1075,7 @@ +@@ -970,6 +1074,7 @@ { this.worldObj.addLoadedEntities(this.entityLists[i]); } @@ -359,7 +359,7 @@ } /** -@@ -990,6 +1096,7 @@ +@@ -990,6 +1095,7 @@ { this.worldObj.unloadEntities(this.entityLists[i]); } @@ -367,7 +367,7 @@ } /** -@@ -1006,8 +1113,8 @@ +@@ -1006,8 +1112,8 @@ */ public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { @@ -378,7 +378,7 @@ if (i < 0) { -@@ -1054,8 +1161,8 @@ +@@ -1054,8 +1160,8 @@ */ public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { @@ -389,7 +389,7 @@ if (i < 0) { -@@ -1238,6 +1345,15 @@ +@@ -1238,6 +1344,15 @@ */ public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) { @@ -405,7 +405,7 @@ int k = 0; boolean flag1 = !this.worldObj.provider.hasNoSky; int l; -@@ -1338,12 +1454,26 @@ +@@ -1338,12 +1453,26 @@ } this.generateHeightMap(); @@ -436,7 +436,7 @@ } } -@@ -1452,4 +1582,18 @@ +@@ -1452,4 +1581,18 @@ } } } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index 7ea359b10a..d3bb3d6a5c 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; -@@ -66,7 +69,7 @@ +@@ -74,7 +77,7 @@ */ public void unloadChunksIfNotNearSpawn(int par1, int par2) { @@ -19,7 +19,7 @@ { ChunkCoordinates chunkcoordinates = this.worldObj.getSpawnPoint(); int k = par1 * 16 + 8 - chunkcoordinates.posX; -@@ -109,7 +112,11 @@ +@@ -117,7 +120,11 @@ if (chunk == null) { @@ -32,7 +32,7 @@ if (chunk == null) { -@@ -306,6 +313,11 @@ +@@ -314,6 +321,11 @@ { if (!this.worldObj.canNotSave) { @@ -44,14 +44,14 @@ for (int i = 0; i < 100; ++i) { if (!this.chunksToUnload.isEmpty()) -@@ -318,6 +330,11 @@ +@@ -326,6 +338,11 @@ this.chunksToUnload.remove(olong); - this.loadedChunkHashMap.remove(olong.longValue()); + this.id2ChunkMap.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)) { + DimensionManager.unloadWorld(this.worldObj.provider.dimensionId); -+ return currentChunkProvider.unload100OldestChunks(); ++ return serverChunkGenerator.unload100OldestChunks(); + } } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch index 0683b7ef82..e92dca08f7 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -31,10 +31,10 @@ - if ((i1 == Block.grass.blockID || i1 == Block.dirt.blockID) && par4 < 256 - l - 1) - { -- par1World.setBlockAndMetadataWithNotify(par3, par4 - 1, par5, Block.dirt.blockID, 0, 4); -- par1World.setBlockAndMetadataWithNotify(par3 + 1, par4 - 1, par5, Block.dirt.blockID, 0, 4); -- par1World.setBlockAndMetadataWithNotify(par3, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 4); -- par1World.setBlockAndMetadataWithNotify(par3 + 1, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 4); +- par1World.setBlockAndMetadataWithNotify(par3, par4 - 1, par5, Block.dirt.blockID, 0, 2); +- par1World.setBlockAndMetadataWithNotify(par3 + 1, par4 - 1, par5, Block.dirt.blockID, 0, 2); +- par1World.setBlockAndMetadataWithNotify(par3, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); +- par1World.setBlockAndMetadataWithNotify(par3 + 1, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); + Block soil = Block.blocksList[i1]; + boolean isValidSoil = soil != null && soil.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Block.sapling); + diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch index b796a897d4..494f8a2c46 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -29,8 +29,8 @@ + Block block = Block.blocksList[par1World.getBlockId(k2, l2, i3)]; + if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && (block != null && block.isGenMineableReplaceable(par1World, k2, l2, i3, field_94523_c))) { -- par1World.setBlockAndMetadataWithNotify(k2, l2, i3, this.minableBlockId, 0, 4); -+ par1World.setBlockAndMetadataWithNotify(k2, l2, i3, this.minableBlockId, minableBlockMeta, 4); +- par1World.setBlockAndMetadataWithNotify(k2, l2, i3, this.minableBlockId, 0, 2); ++ par1World.setBlockAndMetadataWithNotify(k2, l2, i3, this.minableBlockId, minableBlockMeta, 2); } } } diff --git a/updateasmdata.py b/updateasmdata.py new file mode 100644 index 0000000000..0bcc8929ca --- /dev/null +++ b/updateasmdata.py @@ -0,0 +1,107 @@ +import os, os.path, sys +import shutil, glob, fnmatch +import csv, re + +ctorsigre = re.compile('\((.*)\)') +ctorparamre = re.compile('(([ZBCSIJFD]|L([\w\/]+);))') + +def get_merged_info(): + mcp_dir = os.path.join(os.getcwd(), 'mcp') + joined = os.path.join(mcp_dir, 'conf', 'joined.srg') + values = {'PK:': {}, 'CL:': {}, 'FD:': {}, 'MD:': {}} + + if not os.path.isfile(joined): + sys.path.append('install') + from fml import gen_merged_srg + values = gen_merged_srg(mcp_dir, None) + else: + with open(joined, 'r') as fh: + for line in fh: + pts = line.rstrip('\r\n').split(' ') + if pts[0] == 'MD:': + values[pts[0]][pts[1] + ' ' + pts[2]] = pts[3] + ' ' + pts[4] + else: + values[pts[0]][pts[1]] = pts[2] + + return {t:{v.split(' ')[0]:k for k, v in m.items()} for t,m in values.items()} + +def process_file(file, srg): + name = os.path.basename(file) + print 'Processing: ' + name + + if name == 'mcp_merge.cfg': + with open(file + '-new','w') as nf: + with open(file) as f: + for line in f: + parts = line.split('#') + target = parts[1].strip() + newpart = '%s%s #%s\n' % (parts[0][0], srg['CL:'][target], target) + nf.write(newpart) + else: + with open(file + '-new', 'wb') as nf: + with open(file) as f: + for line in f: + parts = line.split('#') + if len(parts) < 2: + nf.write(line) + continue + if len(parts[1]) < 4: + nf.write(line) + continue + + typ = parts[1][0:3] + + if not srg.has_key(typ): + nf.write(line) + continue + + name = parts[1][3:].strip() + name = (name if name.startswith('net/minecraft/') else 'net/minecraft/src/' + name) + action = parts[0].split(' ') + + if name.endswith('/*'): + targ = srg['CL:'][name[:-2]] + wildcard = ('.*()' if typ == 'MD:' else '.*') + + newline = '%s %s%s #%s' % (action[0], targ, wildcard, '#'.join(parts[1:])) + nf.write(newline) + + elif name.find('/') >= 0: + targ = srg['CL:'][name[:name.find('/')]] + args = '(' + armatch = ctorsigre.search(name).group(1) + for bit in ctorparamre.findall(armatch): + if len(bit[2]) > 0 and srg['CL:'].has_key(bit[2]): + cl = 'L' + srg['CL:'][bit[2]] + ';' + else: + cl = bit[1] + args += cl + args += ')V' + newline = ('%s %s.%s #%s' % (action[0], targ, args, '#'.join(parts[1:]))) + nf.write(newline) + + else: + if name not in srg[typ]: + nf.write("%s # -- MISSING MAPPING" %( line )) + print("%s is missing a mapping"% name) + else: + targ = srg[typ][name] + args = targ.replace('/', '.', 1).replace(' ', '', 1) + newline = ('%s %s #%s' % (action[0], args, '#'.join(parts[1:]))) + nf.write(newline) + +def main(): + srg = get_merged_info() + for arg in sys.argv: + path = os.path.join(os.getcwd(), arg) + + if arg.endswith('_at.cfg') or arg == 'mcp_merge.cfg': + process_file(path, srg) + elif os.path.isdir(path): + for file in os.listdir(path): + if file.endswith('_at.cfg'): + process_file(os.path.join(path, file), srg) + +if __name__ == '__main__': + main() +