From bf7527d3cdc57610271f7775e7055d0656e7c1f4 Mon Sep 17 00:00:00 2001 From: cpw Date: Mon, 29 Feb 2016 22:54:48 -0500 Subject: [PATCH] First few patches applied --- .../net/minecraft/block/Block.java.patch | 110 +-- .../minecraft/block/BlockBanner.java.patch | 27 +- .../net/minecraft/block/BlockBush.java.patch | 35 +- .../minecraft/block/BlockButton.java.patch | 12 - .../minecraft/block/BlockCactus.java.patch | 21 +- .../net/minecraft/block/BlockChest.java.patch | 11 - .../net/minecraft/block/BlockCocoa.java.patch | 6 +- .../net/minecraft/block/BlockCrops.java.patch | 46 +- .../minecraft/block/BlockDeadBush.java.patch | 28 +- .../net/minecraft/block/BlockDoor.java.patch | 11 +- .../block/BlockDoublePlant.java.patch | 23 +- .../minecraft/block/BlockFalling.java.patch | 10 - .../minecraft/block/BlockFarmland.java.patch | 2 +- .../net/minecraft/block/BlockFire.java.patch | 109 +-- .../minecraft/block/BlockFlowerPot.java.patch | 6 +- .../net/minecraft/block/BlockGrass.java.patch | 20 +- .../block/BlockHugeMushroom.java.patch | 4 +- .../net/minecraft/block/BlockIce.java.patch | 35 - .../minecraft/block/BlockLadder.java.patch | 25 +- .../minecraft/block/BlockLeaves.java.patch | 45 +- .../net/minecraft/block/BlockLever.java.patch | 4 +- .../net/minecraft/block/BlockLog.java.patch | 14 +- .../block/BlockMobSpawner.java.patch | 19 - .../minecraft/block/BlockMushroom.java.patch | 11 - .../minecraft/block/BlockMycelium.java.patch | 20 - .../block/BlockNetherWart.java.patch | 23 +- .../minecraft/block/BlockNewLeaf.java.patch | 24 - .../net/minecraft/block/BlockNote.java.patch | 8 +- .../minecraft/block/BlockOldLeaf.java.patch | 21 - .../net/minecraft/block/BlockOre.java.patch | 4 +- .../net/minecraft/block/BlockPane.java.patch | 21 +- .../block/BlockPistonBase.java.patch | 31 - .../block/BlockPistonMoving.java.patch | 22 +- .../minecraft/block/BlockPotato.java.patch | 25 - .../minecraft/block/BlockPumpkin.java.patch | 11 - .../minecraft/block/BlockQuartz.java.patch | 4 +- .../minecraft/block/BlockRailBase.java.patch | 24 +- .../block/BlockRedstoneComparator.java.patch | 4 +- .../block/BlockRedstoneDiode.java.patch | 4 +- .../block/BlockRedstoneOre.java.patch | 2 +- .../block/BlockRedstoneWire.java.patch | 59 -- .../net/minecraft/block/BlockReed.java.patch | 18 +- .../block/BlockRotatedPillar.java.patch | 10 +- .../minecraft/block/BlockSapling.java.patch | 2 +- .../net/minecraft/block/BlockSkull.java.patch | 17 +- .../net/minecraft/block/BlockSlab.java.patch | 20 +- .../net/minecraft/block/BlockSnow.java.patch | 36 +- .../minecraft/block/BlockStairs.java.patch | 22 - .../net/minecraft/block/BlockStem.java.patch | 6 +- .../minecraft/block/BlockTallGrass.java.patch | 29 +- .../net/minecraft/block/BlockTorch.java.patch | 8 +- .../minecraft/block/BlockTrapDoor.java.patch | 43 - .../block/BlockTripWireHook.java.patch | 28 - .../net/minecraft/block/BlockVine.java.patch | 18 +- .../BlockPistonStructureHelper.java.patch | 29 - .../block/state/BlockState.java.patch | 53 -- .../block/state/BlockStateBase.java.patch | 2 +- .../client/LoadingScreenRenderer.java.patch | 4 +- .../net/minecraft/client/Minecraft.java.patch | 366 +-------- .../client/audio/SoundManager.java.patch | 29 +- .../entity/AbstractClientPlayer.java.patch | 2 +- .../client/entity/EntityPlayerSP.java.patch | 17 +- .../client/gui/FontRenderer.java.patch | 52 +- .../minecraft/client/gui/GuiButton.java.patch | 4 +- .../minecraft/client/gui/GuiChat.java.patch | 39 - .../client/gui/GuiCreateWorld.java.patch | 13 +- .../client/gui/GuiMainMenu.java.patch | 8 +- .../client/gui/GuiOverlayDebug.java.patch | 8 +- .../minecraft/client/gui/GuiScreen.java.patch | 20 +- .../client/gui/GuiSelectWorld.java.patch | 11 - .../minecraft/client/gui/GuiSlot.java.patch | 20 +- .../gui/GuiUtilRenderComponents.java.patch | 10 - .../gui/ServerListEntryNormal.java.patch | 2 +- .../achievement/GuiAchievements.java.patch | 59 +- .../gui/achievement/GuiStats.java.patch | 60 +- .../gui/inventory/GuiContainer.java.patch | 12 +- .../inventory/GuiContainerCreative.java.patch | 53 +- .../client/model/ModelBox.java.patch | 8 - .../client/model/ModelRenderer.java.patch | 12 +- .../model/PositionTextureVertex.java.patch | 13 - .../client/model/TexturedQuad.java.patch | 13 - .../ChunkProviderClient.java.patch | 2 +- .../multiplayer/GuiConnecting.java.patch | 11 - .../multiplayer/PlayerControllerMP.java.patch | 74 +- .../client/multiplayer/WorldClient.java.patch | 4 +- .../network/NetHandlerLoginClient.java.patch | 4 +- .../network/NetHandlerPlayClient.java.patch | 31 +- .../client/network/OldServerPinger.java.patch | 10 - .../client/particle/EffectRenderer.java.patch | 19 +- .../renderer/BlockModelRenderer.java.patch | 24 - .../renderer/BlockModelShapes.java.patch | 2 +- .../BlockRendererDispatcher.java.patch | 49 -- .../client/renderer/EntityRenderer.java.patch | 88 +-- .../InventoryEffectRenderer.java.patch | 12 +- .../client/renderer/ItemRenderer.java.patch | 40 +- .../client/renderer/OpenGlHelper.java.patch | 4 +- .../client/renderer/RenderGlobal.java.patch | 69 +- .../client/renderer/WorldRenderer.java.patch | 41 - .../WorldVertexBufferUploader.java.patch | 66 -- .../renderer/block/model/BakedQuad.java.patch | 2 +- .../block/model/FaceBakery.java.patch | 68 -- .../model/ItemCameraTransforms.java.patch | 8 +- .../model/ModelBlockDefinition.java.patch | 22 +- .../block/statemap/StateMap.java.patch | 11 - .../renderer/chunk/RenderChunk.java.patch | 25 +- .../entity/RenderEntityItem.java.patch | 41 +- .../renderer/entity/RenderItem.java.patch | 90 --- .../renderer/entity/RenderManager.java.patch | 14 +- .../renderer/entity/RenderPlayer.java.patch | 6 +- .../entity/RendererLivingEntity.java.patch | 64 -- .../entity/layers/LayerArmorBase.java.patch | 93 +-- .../entity/layers/LayerBipedArmor.java.patch | 2 +- .../renderer/texture/Stitcher.java.patch | 12 +- .../texture/TextureAtlasSprite.java.patch | 2 +- .../renderer/texture/TextureMap.java.patch | 96 +-- .../renderer/texture/TextureUtil.java.patch | 4 +- .../tileentity/RenderItemFrame.java.patch | 8 +- .../TileEntityItemStackRenderer.java.patch | 2 +- .../TileEntityRendererDispatcher.java.patch | 19 +- .../FallbackResourceManager.java.patch | 2 +- .../resources/LanguageManager.java.patch | 10 - .../resources/model/IBakedModel.java.patch | 9 - .../resources/model/ModelBakery.java.patch | 124 --- .../resources/model/ModelManager.java.patch | 14 - .../resources/model/ModelRotation.java.patch | 21 - .../client/settings/GameSettings.java.patch | 2 +- .../client/shader/Framebuffer.java.patch | 4 +- .../minecraft/command/CommandBase.java.patch | 8 +- .../command/CommandEnchant.java.patch | 10 +- .../minecraft/command/CommandFill.java.patch | 20 +- .../command/CommandHandler.java.patch | 16 +- ...r.java.patch => EntitySelector.java.patch} | 6 +- .../command/server/CommandSetBlock.java.patch | 14 +- .../server/CommandTestForBlock.java.patch | 8 +- .../crash/CrashReportCategory.java.patch | 2 +- .../enchantment/Enchantment.java.patch | 57 +- .../enchantment/EnchantmentHelper.java.patch | 27 +- .../net/minecraft/entity/Entity.java.patch | 109 +-- .../minecraft/entity/EntityAgeable.java.patch | 11 - .../minecraft/entity/EntityHanging.java.patch | 12 - .../minecraft/entity/EntityList.java.patch | 24 +- .../minecraft/entity/EntityLiving.java.patch | 8 +- .../entity/EntityLivingBase.java.patch | 114 +-- .../EntityMinecartCommandBlock.java.patch | 10 - .../minecraft/entity/EntityTracker.java.patch | 12 +- .../entity/EntityTrackerEntry.java.patch | 34 +- .../ai/EntityAIAttackOnCollide.java.patch | 55 -- .../entity/boss/EntityDragon.java.patch | 14 - .../entity/boss/EntityWither.java.patch | 11 - .../entity/boss/IBossDisplayData.java.patch | 10 - .../effect/EntityLightningBolt.java.patch | 2 +- .../entity/item/EntityEnderPearl.java.patch | 6 +- .../entity/item/EntityItem.java.patch | 22 +- .../entity/item/EntityItemFrame.java.patch | 2 +- .../entity/item/EntityMinecart.java.patch | 306 +------ .../item/EntityMinecartContainer.java.patch | 16 +- .../item/EntityMinecartEmpty.java.patch | 10 - .../item/EntityMinecartFurnace.java.patch | 10 - .../item/EntityMinecartHopper.java.patch | 6 +- .../entity/item/EntityXPOrb.java.patch | 4 +- .../entity/monster/EntityEnderman.java.patch | 22 +- .../entity/monster/EntityMagmaCube.java.patch | 2 +- .../entity/monster/EntitySlime.java.patch | 10 +- .../entity/monster/EntityZombie.java.patch | 46 +- .../entity/passive/EntityHorse.java.patch | 2 +- .../entity/passive/EntityMooshroom.java.patch | 31 +- .../entity/passive/EntityOcelot.java.patch | 11 - .../entity/passive/EntitySheep.java.patch | 20 +- .../entity/passive/EntityVillager.java.patch | 24 +- .../entity/player/EntityPlayer.java.patch | 295 +------ .../entity/player/EntityPlayerMP.java.patch | 60 +- .../entity/player/InventoryPlayer.java.patch | 21 +- .../projectile/EntityFishHook.java.patch | 22 - .../net/minecraft/init/Bootstrap.java.patch | 11 +- .../minecraft/inventory/Container.java.patch | 2 +- .../ContainerBrewingStand.java.patch | 29 - .../inventory/ContainerEnchantment.java.patch | 12 +- .../inventory/ContainerPlayer.java.patch | 12 - .../inventory/ContainerRepair.java.patch | 25 +- .../inventory/SlotCrafting.java.patch | 2 +- .../inventory/SlotFurnaceOutput.java.patch | 2 +- .../net/minecraft/item/Item.java.patch | 745 +----------------- .../net/minecraft/item/ItemArmor.java.patch | 30 +- .../net/minecraft/item/ItemBlock.java.patch | 22 +- .../net/minecraft/item/ItemBow.java.patch | 22 - .../net/minecraft/item/ItemBucket.java.patch | 12 - .../minecraft/item/ItemBucketMilk.java.patch | 4 +- .../net/minecraft/item/ItemDye.java.patch | 17 +- .../minecraft/item/ItemEmptyMap.java.patch | 11 - .../item/ItemFlintAndSteel.java.patch | 11 - .../net/minecraft/item/ItemHoe.java.patch | 17 - .../net/minecraft/item/ItemLilyPad.java.patch | 17 - .../net/minecraft/item/ItemMap.java.patch | 11 - .../item/ItemMonsterPlacer.java.patch | 93 +-- .../net/minecraft/item/ItemRecord.java.patch | 12 +- .../minecraft/item/ItemSeedFood.java.patch | 17 +- .../net/minecraft/item/ItemSeeds.java.patch | 17 +- .../net/minecraft/item/ItemShears.java.patch | 21 +- .../net/minecraft/item/ItemSkull.java.patch | 31 - .../net/minecraft/item/ItemSnow.java.patch | 2 +- .../net/minecraft/item/ItemStack.java.patch | 124 +-- .../net/minecraft/item/ItemSword.java.patch | 4 +- .../net/minecraft/item/ItemTool.java.patch | 16 +- .../item/crafting/FurnaceRecipes.java.patch | 4 +- .../minecraft/nbt/NBTTagCompound.java.patch | 4 +- .../network/NetHandlerPlayServer.java.patch | 121 +-- .../network/NetworkManager.java.patch | 12 +- .../network/NetworkSystem.java.patch | 6 +- .../network/ServerStatusResponse.java.patch | 21 +- ....patch => CPacketCustomPayload.java.patch} | 4 +- ....patch => SPacketCustomPayload.java.patch} | 4 +- .../server/S00PacketServerInfo.java.patch | 11 - .../net/minecraft/potion/Potion.java.patch | 58 +- .../minecraft/potion/PotionEffect.java.patch | 37 +- .../minecraft/realms/RealmsConnect.java.patch | 9 - .../server/MinecraftServer.java.patch | 86 +- .../dedicated/DedicatedServer.java.patch | 38 +- .../server/gui/MinecraftServerGui.java.patch | 4 +- .../integrated/IntegratedServer.java.patch | 63 +- .../management/ItemInWorldManager.java.patch | 266 ------- .../management/PlayerManager.java.patch | 212 +---- .../ServerConfigurationManager.java.patch | 223 ------ .../network/NetHandlerLoginServer.java.patch | 16 +- .../net/minecraft/stats/StatList.java.patch | 24 +- .../tileentity/TileEntity.java.patch | 50 +- .../tileentity/TileEntityBeacon.java.patch | 4 +- .../TileEntityBrewingStand.java.patch | 77 +- .../tileentity/TileEntityChest.java.patch | 12 +- .../tileentity/TileEntityFurnace.java.patch | 14 +- .../tileentity/TileEntityHopper.java.patch | 8 +- .../tileentity/TileEntityLockable.java.patch | 2 +- .../tileentity/TileEntityNote.java.patch | 2 +- .../tileentity/TileEntityPiston.java.patch | 4 +- .../tileentity/TileEntitySign.java.patch | 2 +- .../net/minecraft/util/BlockPos.java.patch | 32 - .../util/ChatComponentStyle.java.patch | 10 - .../net/minecraft/util/ChatStyle.java.patch | 10 - .../net/minecraft/util/EnumFacing.java.patch | 23 +- .../util/EnumWorldBlockLayer.java.patch | 12 - .../minecraft/util/IChatComponent.java.patch | 10 - .../util/MovingObjectPosition.java.patch | 15 - .../util/ResourceLocation.java.patch | 26 - .../net/minecraft/util/Session.java.patch | 20 - .../minecraft/util/StringTranslate.java.patch | 54 -- .../net/minecraft/util/Vec3.java.patch | 35 - .../WeightedRandomChestContent.java.patch | 68 -- .../net/minecraft/world/ChunkCache.java.patch | 11 +- .../net/minecraft/world/Explosion.java.patch | 26 +- .../minecraft/world/SpawnerAnimals.java.patch | 51 -- .../net/minecraft/world/World.java.patch | 429 ++-------- .../minecraft/world/WorldProvider.java.patch | 57 +- .../minecraft/world/WorldServer.java.patch | 141 +--- .../world/WorldServerMulti.java.patch | 14 +- .../world/biome/BiomeColorHelper.java.patch | 11 - .../world/biome/BiomeDecorator.java.patch | 117 +-- .../world/biome/BiomeGenBase.java.patch | 116 +-- .../world/biome/BiomeGenForest.java.patch | 10 +- .../world/biome/BiomeGenHills.java.patch | 8 +- .../world/biome/BiomeGenPlains.java.patch | 6 +- .../world/biome/BiomeGenSwamp.java.patch | 2 +- .../world/biome/WorldChunkManager.java.patch | 45 -- .../minecraft/world/chunk/Chunk.java.patch | 117 +-- .../chunk/storage/AnvilChunkLoader.java.patch | 60 +- .../chunk/storage/AnvilSaveHandler.java.patch | 23 - .../world/chunk/storage/RegionFile.java.patch | 2 +- .../world/gen/ChunkProviderEnd.java.patch | 59 +- .../gen/ChunkProviderGenerate.java.patch | 110 --- .../world/gen/ChunkProviderHell.java.patch | 141 ---- .../world/gen/ChunkProviderServer.java.patch | 100 +-- .../world/gen/MapGenCaves.java.patch | 40 +- .../world/gen/MapGenRavine.java.patch | 35 +- .../feature/WorldGenBigMushroom.java.patch | 33 - .../gen/feature/WorldGenBigTree.java.patch | 12 - .../gen/feature/WorldGenCanopyTree.java.patch | 32 - .../gen/feature/WorldGenDeadBush.java.patch | 17 - .../gen/feature/WorldGenDungeons.java.patch | 16 +- .../gen/feature/WorldGenForest.java.patch | 50 -- .../gen/feature/WorldGenHugeTrees.java.patch | 24 - .../feature/WorldGenMegaPineTree.java.patch | 63 -- .../feature/WorldGenSavannaTree.java.patch | 36 - .../gen/feature/WorldGenShrub.java.patch | 31 - .../gen/feature/WorldGenSwamp.java.patch | 79 +- .../gen/feature/WorldGenTaiga1.java.patch | 22 - .../gen/feature/WorldGenTaiga2.java.patch | 50 -- .../gen/feature/WorldGenTallGrass.java.patch | 17 - .../gen/feature/WorldGenTrees.java.patch | 83 -- .../WorldGeneratorBonusChest.java.patch | 17 - .../world/gen/layer/GenLayer.java.patch | 13 +- .../world/gen/layer/GenLayerBiome.java.patch | 81 +- ...ComponentScatteredFeaturePieces.java.patch | 54 +- .../gen/structure/MapGenStronghold.java.patch | 22 - .../gen/structure/MapGenStructure.java.patch | 2 +- .../structure/StructureComponent.java.patch | 4 +- .../StructureMineshaftPieces.java.patch | 20 +- .../StructureNetherBridgePieces.java.patch | 28 - .../gen/structure/StructureStart.java.patch | 4 +- .../StructureStrongholdPieces.java.patch | 44 +- .../StructureVillagePieces.java.patch | 31 +- .../world/storage/MapData.java.patch | 15 +- .../world/storage/SaveHandler.java.patch | 86 +- .../world/storage/WorldInfo.java.patch | 14 +- .../command/CommandBase.java.patch.rej | 10 - .../command/CommandEnchant.java.patch.rej | 10 - .../command/CommandFill.java.patch.rej | 20 - .../command/CommandHandler.java.patch.rej | 10 - .../command/PlayerSelector.java.patch.rej | 13 - .../server/CommandSetBlock.java.patch.rej | 20 - .../server/CommandTestForBlock.java.patch.rej | 10 - .../minecraft/init/Bootstrap.java.patch.rej | 10 - .../ContainerEnchantment.java.patch.rej | 10 - .../inventory/ContainerRepair.java.patch.rej | 20 - .../network/NetworkSystem.java.patch.rej | 10 - .../C17PacketCustomPayload.java.patch.rej | 13 - .../S3FPacketCustomPayload.java.patch.rej | 13 - .../server/MinecraftServer.java.patch.rej | 46 -- .../NetHandlerLoginServer.java.patch.rej | 26 - 316 files changed, 1052 insertions(+), 9968 deletions(-) delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockButton.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockChest.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockFalling.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockIce.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockMobSpawner.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockMushroom.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockMycelium.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockNewLeaf.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockOldLeaf.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockPistonBase.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockPotato.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockPumpkin.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockStairs.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockTrapDoor.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/BlockTripWireHook.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/block/state/BlockState.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/gui/GuiChat.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/model/TexturedQuad.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/network/OldServerPinger.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/resources/LanguageManager.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch rename patches.mcp/minecraft/net/minecraft/command/{PlayerSelector.java.patch => EntitySelector.java.patch} (84%) delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/EntityAgeable.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/EntityHanging.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/boss/EntityWither.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemBow.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemBucket.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemEmptyMap.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemHoe.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemLilyPad.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemMap.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/item/ItemSkull.java.patch rename patches.mcp/minecraft/net/minecraft/network/play/client/{C17PacketCustomPayload.java.patch => CPacketCustomPayload.java.patch} (71%) rename patches.mcp/minecraft/net/minecraft/network/play/server/{S3FPacketCustomPayload.java.patch => SPacketCustomPayload.java.patch} (71%) delete mode 100644 patches.mcp/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/BlockPos.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/ChatComponentStyle.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/ChatStyle.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/IChatComponent.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/MovingObjectPosition.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/ResourceLocation.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/StringTranslate.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/Vec3.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/SpawnerAnimals.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch delete mode 100644 patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch delete mode 100644 rejects/minecraft/net/minecraft/command/CommandBase.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/command/CommandEnchant.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/command/CommandFill.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/command/CommandHandler.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/command/PlayerSelector.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/init/Bootstrap.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/inventory/ContainerRepair.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/network/NetworkSystem.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/server/MinecraftServer.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch.rej diff --git a/patches.mcp/minecraft/net/minecraft/block/Block.java.patch b/patches.mcp/minecraft/net/minecraft/block/Block.java.patch index c62a56071d..0b22ac7d6e 100644 --- a/patches.mcp/minecraft/net/minecraft/block/Block.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/Block.java.patch @@ -1,18 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/Block.java +++ ../src-work/minecraft/net/minecraft/block/Block.java -@@ -38,8 +38,9 @@ - public class Block - { - private static final ResourceLocation AIR_ID = new ResourceLocation("air"); -- public static final RegistryNamespacedDefaultedByKey blockRegistry = new RegistryNamespacedDefaultedByKey(AIR_ID); -- public static final ObjectIntIdentityMap BLOCK_STATE_IDS = new ObjectIntIdentityMap(); -+ public static final RegistryNamespacedDefaultedByKey blockRegistry = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry(); -+ @Deprecated //Modders: DO NOT use this! Use GameRegistry -+ public static final ObjectIntIdentityMap BLOCK_STATE_IDS = net.minecraftforge.fml.common.registry.GameData.getBlockStateIDMap(); - private CreativeTabs displayOnCreativeTab; - public static final Block.SoundType soundTypeStone = new Block.SoundType("stone", 1.0F, 1.0F); - public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F); -@@ -119,6 +120,9 @@ +@@ -70,6 +70,9 @@ private IBlockState defaultBlockState; private String unlocalizedName; @@ -22,7 +10,7 @@ public static int getIdFromBlock(Block blockIn) { return blockRegistry.getIDForObject(blockIn); -@@ -132,7 +136,8 @@ +@@ -83,7 +86,8 @@ public static Block getBlockById(int id) { @@ -32,16 +20,16 @@ } public static IBlockState getStateById(int id) -@@ -303,7 +308,7 @@ +@@ -268,7 +272,7 @@ - public boolean isReplaceable(World worldIn, BlockPos pos) + public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos) { - return false; + return getMaterial().isReplaceable(); } public Block setHardness(float hardness) -@@ -340,9 +345,10 @@ +@@ -305,9 +309,10 @@ return this.needsRandomTick; } @@ -52,33 +40,8 @@ + return hasTileEntity(getDefaultState()); } - public final void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) -@@ -359,13 +365,13 @@ - public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) - { - Block block = worldIn.getBlockState(pos).getBlock(); -- int i = worldIn.getCombinedLight(pos, block.getLightValue()); -+ int i = worldIn.getCombinedLight(pos, block.getLightValue(worldIn, pos)); - - if (i == 0 && block instanceof BlockSlab) - { - pos = pos.down(); - block = worldIn.getBlockState(pos).getBlock(); -- return worldIn.getCombinedLight(pos, block.getLightValue()); -+ return worldIn.getCombinedLight(pos, block.getLightValue(worldIn, pos)); - } - else - { -@@ -376,7 +382,7 @@ - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) - { -- return side == EnumFacing.DOWN && this.minY > 0.0D ? true : (side == EnumFacing.UP && this.maxY < 1.0D ? true : (side == EnumFacing.NORTH && this.minZ > 0.0D ? true : (side == EnumFacing.SOUTH && this.maxZ < 1.0D ? true : (side == EnumFacing.WEST && this.minX > 0.0D ? true : (side == EnumFacing.EAST && this.maxX < 1.0D ? true : !worldIn.getBlockState(pos).getBlock().isOpaqueCube()))))); -+ return side == EnumFacing.DOWN && this.minY > 0.0D ? true : (side == EnumFacing.UP && this.maxY < 1.0D ? true : (side == EnumFacing.NORTH && this.minZ > 0.0D ? true : (side == EnumFacing.SOUTH && this.maxZ < 1.0D ? true : (side == EnumFacing.WEST && this.minX > 0.0D ? true : (side == EnumFacing.EAST && this.maxX < 1.0D ? true : !worldIn.getBlockState(pos).getBlock().doesSideBlockRendering(worldIn, pos, side)))))); - } - - public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) -@@ -453,6 +459,10 @@ + public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_) +@@ -472,6 +477,10 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { @@ -89,17 +52,7 @@ } public int quantityDropped(Random random) -@@ -467,8 +477,7 @@ - - public float getPlayerRelativeBlockHardness(EntityPlayer playerIn, World worldIn, BlockPos pos) - { -- float f = this.getBlockHardness(worldIn, pos); -- return f < 0.0F ? 0.0F : (!playerIn.canHarvestBlock(this) ? playerIn.getToolDigEfficiency(this) / f / 100.0F : playerIn.getToolDigEfficiency(this) / f / 30.0F); -+ return net.minecraftforge.common.ForgeHooks.blockStrength(worldIn.getBlockState(pos), playerIn, worldIn, pos); - } - - public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int forture) -@@ -478,20 +487,16 @@ +@@ -497,20 +506,16 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { @@ -125,7 +78,7 @@ } } } -@@ -499,8 +504,13 @@ +@@ -518,8 +523,13 @@ public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack) { @@ -140,7 +93,7 @@ float f = 0.5F; double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -@@ -687,7 +697,7 @@ +@@ -588,7 +598,7 @@ public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { @@ -148,47 +101,8 @@ + return worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos); } - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) -@@ -799,25 +809,35 @@ - player.triggerAchievement(StatList.mineBlockStatArray[getIdFromBlock(this)]); - player.addExhaustion(0.025F); - -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) -+ if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getSilkTouchModifier(player)) - { -+ java.util.ArrayList items = new java.util.ArrayList(); - ItemStack itemstack = this.createStackedBlock(state); - - if (itemstack != null) - { -- spawnAsEntity(worldIn, pos, itemstack); -+ items.add(itemstack); - } -+ -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player); -+ for (ItemStack stack : items) -+ { -+ spawnAsEntity(worldIn, pos, stack); -+ } - } - else - { -+ harvesters.set(player); - int i = EnchantmentHelper.getFortuneModifier(player); - this.dropBlockAsItem(worldIn, pos, state, i); -+ harvesters.set(null); - } - } - -+ @Deprecated //Forge: State sensitive version - protected boolean canSilkHarvest() - { -- return this.isFullCube() && !this.isBlockContainer; -+ return this.isFullCube() && !this.hasTileEntity(silk_check_state.get()); - } - - protected ItemStack createStackedBlock(IBlockState state) -@@ -1010,6 +1030,1147 @@ + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand side, ItemStack hitX, EnumFacing hitY, float hitZ, float p_180639_9_, float p_180639_10_) +@@ -844,6 +854,1147 @@ return "Block{" + blockRegistry.getNameForObject(this) + "}"; } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockBanner.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockBanner.java.patch index 09cf5e0464..820a9b6727 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockBanner.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockBanner.java.patch @@ -1,29 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockBanner.java +++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java -@@ -85,22 +85,7 @@ - - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) - { -- TileEntity tileentity = worldIn.getTileEntity(pos); -- -- if (tileentity instanceof TileEntityBanner) - { -- ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)tileentity).getBaseColor()); -- NBTTagCompound nbttagcompound = new NBTTagCompound(); -- tileentity.writeToNBT(nbttagcompound); -- nbttagcompound.removeTag("x"); -- nbttagcompound.removeTag("y"); -- nbttagcompound.removeTag("z"); -- nbttagcompound.removeTag("id"); -- itemstack.setTagInfo("BlockEntityTag", nbttagcompound); -- spawnAsEntity(worldIn, pos, itemstack); -- } -- else -- { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); - } - } -@@ -133,6 +118,28 @@ +@@ -138,6 +138,28 @@ } } @@ -51,4 +28,4 @@ + public static class BlockBannerHanging extends BlockBanner { - public BlockBannerHanging() + protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockBush.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockBush.java.patch index 26af27af21..04d7d6910b 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockBush.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockBush.java.patch @@ -1,40 +1,18 @@ --- ../src-base/minecraft/net/minecraft/block/BlockBush.java +++ ../src-work/minecraft/net/minecraft/block/BlockBush.java -@@ -13,7 +13,7 @@ +@@ -14,7 +14,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class BlockBush extends Block +public class BlockBush extends Block implements net.minecraftforge.common.IPlantable { - protected BlockBush() - { -@@ -36,7 +36,7 @@ + protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D); - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) - { -- return super.canPlaceBlockAt(worldIn, pos) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return super.canPlaceBlockAt(worldIn, pos) && worldIn.getBlockState(pos.down()).getBlock().canSustainPlant(worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this); +@@ -90,6 +90,35 @@ + return false; } - protected boolean canPlaceBlockOn(Block ground) -@@ -66,7 +66,10 @@ - - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) - { -- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ BlockPos down = pos.down(); -+ Block soil = worldIn.getBlockState(down).getBlock(); -+ if (state.getBlock() != this) return this.canPlaceBlockOn(soil); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. -+ return soil.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, this); - } - - public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) -@@ -89,4 +92,33 @@ - { - return EnumWorldBlockLayer.CUTOUT; - } -+ + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) + { @@ -63,4 +41,7 @@ + if (state.getBlock() != this) return getDefaultState(); + return state; + } - } ++ + @SideOnly(Side.CLIENT) + public BlockRenderLayer getBlockLayer() + { diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockButton.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockButton.java.patch deleted file mode 100644 index ef2527c7b0..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockButton.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockButton.java -+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java -@@ -74,8 +74,7 @@ - - protected static boolean func_181088_a(World p_181088_0_, BlockPos p_181088_1_, EnumFacing p_181088_2_) - { -- BlockPos blockpos = p_181088_1_.offset(p_181088_2_); -- return p_181088_2_ == EnumFacing.DOWN ? World.doesBlockHaveSolidTopSurface(p_181088_0_, blockpos) : p_181088_0_.getBlockState(blockpos).getBlock().isNormalCube(); -+ return p_181088_2_ == EnumFacing.DOWN && World.doesBlockHaveSolidTopSurface(p_181088_0_, p_181088_1_.down()) ? true : p_181088_0_.isSideSolid(p_181088_1_.offset(p_181088_2_), p_181088_2_.getOpposite()); - } - - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockCactus.java.patch index 04f56d2171..656fa2cacf 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockCactus.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockCactus.java.patch @@ -8,21 +8,11 @@ +public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable { public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); - -@@ -109,7 +109,7 @@ - } - - Block block = worldIn.getBlockState(pos.down()).getBlock(); -- return block == Blocks.cactus || block == Blocks.sand; -+ return block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this); + protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D); +@@ -135,6 +135,18 @@ + return ((Integer)state.getValue(AGE)).intValue(); } - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) -@@ -137,4 +137,16 @@ - { - return new BlockState(this, new IProperty[] {AGE}); - } -+ + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) + { @@ -34,4 +24,7 @@ + { + return getDefaultState(); + } - } ++ + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, new IProperty[] {AGE}); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockChest.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockChest.java.patch deleted file mode 100644 index af39114510..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockChest.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockChest.java -+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java -@@ -527,7 +527,7 @@ - - private boolean isBelowSolidBlock(World worldIn, BlockPos pos) - { -- return worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); -+ return worldIn.isSideSolid(pos.up(), EnumFacing.DOWN, false); - } - - private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockCocoa.java.patch index e5f3922b4a..b3bd5f03ef 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java +++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java -@@ -137,6 +137,13 @@ +@@ -131,6 +131,13 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { @@ -14,7 +14,7 @@ int i = ((Integer)state.getValue(AGE)).intValue(); int j = 1; -@@ -147,8 +154,9 @@ +@@ -141,8 +148,9 @@ for (int k = 0; k < j; ++k) { @@ -24,4 +24,4 @@ + return dropped; } - @SideOnly(Side.CLIENT) + public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockCrops.java.patch index 3d2a7232a0..1295dd5070 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockCrops.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockCrops.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockCrops.java +++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java -@@ -81,11 +81,11 @@ +@@ -116,11 +116,11 @@ float f1 = 0.0F; IBlockState iblockstate = worldIn.getBlockState(blockpos.add(i, 0, j)); @@ -14,45 +14,10 @@ { f1 = 3.0F; } -@@ -126,7 +126,7 @@ - - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) - { -- return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && worldIn.getBlockState(pos.down()).getBlock().canSustainPlant(worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this); +@@ -174,6 +174,28 @@ + return Items.wheat; } - protected Item getSeed() -@@ -142,24 +142,6 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) - { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0); -- -- if (!worldIn.isRemote) -- { -- int i = ((Integer)state.getValue(AGE)).intValue(); -- -- if (i >= 7) -- { -- int j = 3 + fortune; -- -- for (int k = 0; k < j; ++k) -- { -- if (worldIn.rand.nextInt(15) <= i) -- { -- spawnAsEntity(worldIn, pos, new ItemStack(this.getSeed(), 1, 0)); -- } -- } -- } -- } - } - - public Item getItemDropped(IBlockState state, Random rand, int fortune) -@@ -202,4 +184,26 @@ - { - return new BlockState(this, new IProperty[] {AGE}); - } -+ + @Override + public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { @@ -74,4 +39,7 @@ + } + return ret; + } - } ++ + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockDeadBush.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockDeadBush.java.patch index c0c9491c97..6fe72a39d4 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockDeadBush.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockDeadBush.java.patch @@ -1,33 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java +++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java -@@ -14,7 +14,7 @@ - import net.minecraft.util.BlockPos; +@@ -16,7 +16,7 @@ + import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class BlockDeadBush extends BlockBush +public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable { - protected BlockDeadBush() - { -@@ -45,14 +45,15 @@ + protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D); - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) - { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) - { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.deadbush, 1, 0)); -- } -- else -- { - super.harvestBlock(worldIn, player, pos, state, te); - } - } -+ -+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } -+ @Override -+ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(Blocks.deadbush))); -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockDoor.java.patch index ec621d11fe..66d7698e9e 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockDoor.java.patch +++ b/patches.mcp/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 -@@ -154,7 +154,7 @@ +@@ -107,7 +107,7 @@ { if (this.blockMaterial == Material.iron) { @@ -9,12 +9,3 @@ } else { -@@ -272,7 +272,7 @@ - - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) - { -- return pos.getY() >= 255 ? false : World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up()); -+ return pos.getY() >= worldIn.getHeight() - 1 ? false : World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up()); - } - - public int getMobilityFlag() diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockDoublePlant.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockDoublePlant.java.patch index 8cbc62e73a..58d4de4515 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockDoublePlant.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockDoublePlant.java.patch @@ -9,7 +9,7 @@ { public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockDoublePlant.EnumPlantType.class); public static final PropertyEnum HALF = PropertyEnum.create("half", BlockDoublePlant.EnumBlockHalf.class); -@@ -90,6 +90,8 @@ +@@ -88,6 +88,8 @@ Block block = (Block)(flag ? this : worldIn.getBlockState(blockpos).getBlock()); Block block1 = (Block)(flag ? worldIn.getBlockState(blockpos1).getBlock() : this); @@ -18,7 +18,7 @@ if (block == this) { worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2); -@@ -98,17 +100,13 @@ +@@ -96,17 +98,13 @@ if (block1 == this) { worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 3); @@ -37,24 +37,7 @@ if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { return worldIn.getBlockState(pos.down()).getBlock() == this; -@@ -158,7 +156,6 @@ - - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) - { -- if (worldIn.isRemote || player.getCurrentEquippedItem() == null || player.getCurrentEquippedItem().getItem() != Items.shears || state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.onHarvest(worldIn, pos, state, player)) - { - super.harvestBlock(worldIn, player, pos, state, te); - } -@@ -221,8 +218,6 @@ - else - { - player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).getMeta(); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 2, i)); - return true; - } - } -@@ -293,6 +288,32 @@ +@@ -284,6 +282,32 @@ return Block.EnumOffsetType.XZ; } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockFalling.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockFalling.java.patch deleted file mode 100644 index 4ac1d28471..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockFalling.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockFalling.java -+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java -@@ -86,6 +86,7 @@ - - public static boolean canFallInto(World worldIn, BlockPos pos) - { -+ if (worldIn.isAirBlock(pos)) return true; - Block block = worldIn.getBlockState(pos).getBlock(); - Material material = block.blockMaterial; - return block == Blocks.fire || material == Material.air || material == Material.water || material == Material.lava; diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockFarmland.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockFarmland.java.patch index b94b5429ec..0ebf66806f 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockFarmland.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockFarmland.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java +++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java -@@ -89,7 +89,7 @@ +@@ -87,7 +87,7 @@ private boolean hasCrops(World worldIn, BlockPos pos) { Block block = worldIn.getBlockState(pos.up()).getBlock(); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockFire.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockFire.java.patch index 287e8d5dd9..29ff54bf65 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockFire.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockFire.java.patch @@ -1,34 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFire.java +++ ../src-work/minecraft/net/minecraft/block/BlockFire.java -@@ -41,18 +41,24 @@ - int j = pos.getY(); - int k = pos.getZ(); - -- if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down())) -+ if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down(), EnumFacing.UP)) - { - boolean flag = (i + j + k & 1) == 1; - boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1; - int l = 0; - -- if (this.canCatchFire(worldIn, pos.up())) -+ if (this.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN)) - { - l = flag ? 1 : 2; - } - -- return state.withProperty(NORTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canCatchFire(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canCatchFire(worldIn, pos.west()))).withProperty(UPPER, Integer.valueOf(l)).withProperty(FLIP, Boolean.valueOf(flag1)).withProperty(ALT, Boolean.valueOf(flag)); -+ return state.withProperty(NORTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH))) -+ .withProperty(EAST, Boolean.valueOf(this.canCatchFire(worldIn, pos.east(), EnumFacing.EAST ))) -+ .withProperty(SOUTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH))) -+ .withProperty(WEST, Boolean.valueOf(this.canCatchFire(worldIn, pos.west(), EnumFacing.EAST ))) -+ .withProperty(UPPER, Integer.valueOf(l)) -+ .withProperty(FLIP, Boolean.valueOf(flag1)) -+ .withProperty(ALT, Boolean.valueOf(flag)); - } - else - { -@@ -108,6 +114,7 @@ +@@ -90,6 +90,7 @@ public void setFireInfo(Block blockIn, int encouragement, int flammability) { @@ -36,22 +8,7 @@ this.encouragements.put(blockIn, Integer.valueOf(encouragement)); this.flammabilities.put(blockIn, Integer.valueOf(flammability)); } -@@ -147,13 +154,8 @@ - } - - Block block = worldIn.getBlockState(pos.down()).getBlock(); -- boolean flag = block == Blocks.netherrack; -+ boolean flag = block.isFireSource(worldIn, pos.down(), EnumFacing.UP); - -- if (worldIn.provider instanceof WorldProviderEnd && block == Blocks.bedrock) -- { -- flag = true; -- } -- - if (!flag && worldIn.isRaining() && this.canDie(worldIn, pos)) - { - worldIn.setBlockToAir(pos); -@@ -182,7 +184,7 @@ +@@ -164,7 +165,7 @@ return; } @@ -60,7 +17,7 @@ { worldIn.setBlockToAir(pos); return; -@@ -197,12 +199,12 @@ +@@ -179,12 +180,12 @@ j = -50; } @@ -79,7 +36,7 @@ for (int k = -1; k <= 1; ++k) { -@@ -261,22 +263,30 @@ +@@ -243,22 +244,30 @@ return false; } @@ -111,7 +68,7 @@ if (random.nextInt(chance) < i) { IBlockState iblockstate = worldIn.getBlockState(pos); -@@ -308,7 +318,7 @@ +@@ -290,7 +299,7 @@ { for (EnumFacing enumfacing : EnumFacing.values()) { @@ -120,7 +77,7 @@ { return true; } -@@ -329,7 +339,7 @@ +@@ -311,7 +320,7 @@ for (EnumFacing enumfacing : EnumFacing.values()) { @@ -129,7 +86,7 @@ } return i; -@@ -341,9 +351,10 @@ +@@ -323,9 +332,10 @@ return false; } @@ -141,57 +98,9 @@ } public boolean canPlaceBlockAt(World worldIn, BlockPos pos) -@@ -382,9 +393,9 @@ - worldIn.playSound((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), "fire.fire", 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false); - } - -- if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down())) -+ if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down(), EnumFacing.UP)) - { -- if (Blocks.fire.canCatchFire(worldIn, pos.west())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.west(), EnumFacing.EAST)) - { - for (int j = 0; j < 2; ++j) - { -@@ -395,7 +406,7 @@ - } - } - -- if (Blocks.fire.canCatchFire(worldIn, pos.east())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.east(), EnumFacing.WEST)) - { - for (int k = 0; k < 2; ++k) - { -@@ -406,7 +417,7 @@ - } - } - -- if (Blocks.fire.canCatchFire(worldIn, pos.north())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH)) - { - for (int l = 0; l < 2; ++l) - { -@@ -417,7 +428,7 @@ - } - } - -- if (Blocks.fire.canCatchFire(worldIn, pos.south())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH)) - { - for (int i1 = 0; i1 < 2; ++i1) - { -@@ -428,7 +439,7 @@ - } - } - -- if (Blocks.fire.canCatchFire(worldIn, pos.up())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN)) - { - for (int j1 = 0; j1 < 2; ++j1) - { -@@ -476,4 +487,19 @@ +@@ -458,4 +468,19 @@ { - return new BlockState(this, new IProperty[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT}); + return new BlockStateContainer(this, new IProperty[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER}); } + + /*================================= Forge Start ======================================*/ diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch index d4e12c92cb..526fd1507a 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java +++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java -@@ -169,13 +169,6 @@ +@@ -148,13 +148,6 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { @@ -14,8 +14,8 @@ super.breakBlock(worldIn, pos, state); } -@@ -395,6 +388,31 @@ - return EnumWorldBlockLayer.CUTOUT; +@@ -374,6 +367,31 @@ + return BlockRenderLayer.CUTOUT; } + diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockGrass.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockGrass.java.patch index b373fbe3aa..086230b680 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockGrass.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockGrass.java.patch @@ -1,24 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockGrass.java +++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java -@@ -58,7 +58,7 @@ - { - if (!worldIn.isRemote) - { -- if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity() > 2) -+ if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity(worldIn, pos.up()) > 2) - { - worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); - } -@@ -72,7 +72,7 @@ - Block block = worldIn.getBlockState(blockpos.up()).getBlock(); - IBlockState iblockstate = worldIn.getBlockState(blockpos); - -- if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) -+ if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity(worldIn, blockpos.up()) <= 2) - { - worldIn.setBlockState(blockpos, Blocks.grass.getDefaultState()); - } -@@ -110,7 +110,7 @@ +@@ -96,7 +96,7 @@ { if (j >= i / 16) { diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch index 4034822ae1..63bf78539d 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java +++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java -@@ -79,6 +79,20 @@ - return new BlockState(this, new IProperty[] {VARIANT}); +@@ -221,6 +221,20 @@ + return new BlockStateContainer(this, new IProperty[] {VARIANT}); } + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockIce.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockIce.java.patch deleted file mode 100644 index c1631128c5..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockIce.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockIce.java -+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java -@@ -38,14 +38,17 @@ - player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); - player.addExhaustion(0.025F); - -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) -+ if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getSilkTouchModifier(player)) - { -+ java.util.List items = new java.util.ArrayList(); - ItemStack itemstack = this.createStackedBlock(state); - -- if (itemstack != null) -- { -- spawnAsEntity(worldIn, pos, itemstack); -- } -+ if (itemstack != null) items.add(itemstack); -+ -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player); -+ -+ for (ItemStack is : items) -+ spawnAsEntity(worldIn, pos, is); - } - else - { -@@ -56,7 +59,9 @@ - } - - int i = EnchantmentHelper.getFortuneModifier(player); -+ harvesters.set(player); - this.dropBlockAsItem(worldIn, pos, state, i); -+ harvesters.set(null); - Material material = worldIn.getBlockState(pos.down()).getBlock().getMaterial(); - - if (material.blocksMovement() || material.isLiquid()) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch index a6e6780658..f43e36d344 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -1,29 +1,8 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLadder.java +++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java -@@ -78,7 +78,10 @@ - - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) +@@ -139,4 +139,6 @@ { -- return worldIn.getBlockState(pos.west()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.east()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.north()).getBlock().isNormalCube() ? true : worldIn.getBlockState(pos.south()).getBlock().isNormalCube())); -+ return worldIn.isSideSolid(pos.west(), EnumFacing.EAST, true) || -+ worldIn.isSideSolid(pos.east(), EnumFacing.WEST, true) || -+ worldIn.isSideSolid(pos.north(), EnumFacing.SOUTH, true) || -+ worldIn.isSideSolid(pos.south(), EnumFacing.NORTH, true); - } - - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) -@@ -116,7 +119,7 @@ - - protected boolean canBlockStay(World worldIn, BlockPos pos, EnumFacing facing) - { -- return worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock().isNormalCube(); -+ return worldIn.isSideSolid(pos.offset(facing.getOpposite()), facing, true); - } - - public IBlockState getStateFromMeta(int meta) -@@ -146,4 +149,6 @@ - { - return new BlockState(this, new IProperty[] {FACING}); + return new BlockStateContainer(this, new IProperty[] {FACING}); } + + @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockLeaves.java.patch index e1c41a698a..0b1bfbd37b 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockLeaves.java.patch @@ -1,39 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java +++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java -@@ -18,7 +18,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public abstract class BlockLeaves extends BlockLeavesBase -+public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable - { - public static final PropertyBool DECAYABLE = PropertyBool.create("decayable"); - public static final PropertyBool CHECK_DECAY = PropertyBool.create("check_decay"); -@@ -75,9 +75,9 @@ - BlockPos blockpos = pos.add(j1, k1, l1); - IBlockState iblockstate = worldIn.getBlockState(blockpos); - -- if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(CHECK_DECAY)).booleanValue()) -+ if (iblockstate.getBlock().isLeaves(worldIn, blockpos)) - { -- worldIn.setBlockState(blockpos, iblockstate.withProperty(CHECK_DECAY, Boolean.valueOf(true)), 4); -+ iblockstate.getBlock().beginLeavesDecay(worldIn, blockpos); - } - } - } -@@ -117,9 +117,9 @@ - { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(k + i2, l + j2, i1 + k2)).getBlock(); - -- if (block != Blocks.log && block != Blocks.log2) -+ if (!block.canSustainLeaves(worldIn, blockpos$mutableblockpos.set(k + i2, l + j2, i1 + k2))) - { -- if (block.getMaterial() == Material.leaves) -+ if (block.isLeaves(worldIn, blockpos$mutableblockpos.set(k + i2, l + j2, i1 + k2))) - { - this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2; - } -@@ -226,40 +226,7 @@ +@@ -205,40 +205,7 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { @@ -75,11 +42,10 @@ } protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) -@@ -296,4 +263,48 @@ - } +@@ -274,6 +241,50 @@ public abstract BlockPlanks.EnumType getWoodType(int meta); -+ + + @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } + @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; } + @@ -123,4 +89,7 @@ + return ret; + } + - } ++ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockState worldIn, IBlockAccess pos, BlockPos side, EnumFacing p_176225_4_) + { diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockLever.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockLever.java.patch index 21869253d1..66b146bb03 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockLever.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockLever.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLever.java +++ ../src-work/minecraft/net/minecraft/block/BlockLever.java -@@ -237,6 +237,12 @@ - return new BlockState(this, new IProperty[] {FACING, POWERED}); +@@ -295,6 +295,12 @@ + return new BlockStateContainer(this, new IProperty[] {FACING, POWERED}); } + diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockLog.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockLog.java.patch index e1ad4d6e70..ef4cbd840f 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockLog.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockLog.java.patch @@ -1,19 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLog.java +++ ../src-work/minecraft/net/minecraft/block/BlockLog.java -@@ -33,9 +33,9 @@ - { - IBlockState iblockstate = worldIn.getBlockState(blockpos); - -- if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(BlockLeaves.CHECK_DECAY)).booleanValue()) -+ if (iblockstate.getBlock().isLeaves(worldIn, blockpos)) - { -- worldIn.setBlockState(blockpos, iblockstate.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4); -+ iblockstate.getBlock().beginLeavesDecay(worldIn, blockpos); - } - } +@@ -69,6 +69,9 @@ } -@@ -46,6 +46,9 @@ - return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(LOG_AXIS, BlockLog.EnumAxis.fromFacingAxis(facing.getAxis())); } + @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockMobSpawner.java.patch deleted file mode 100644 index 1ea021a24c..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java -+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java -@@ -37,10 +37,14 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) - { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); -- int i = 15 + worldIn.rand.nextInt(15) + worldIn.rand.nextInt(15); -- this.dropXpOnBlockBreak(worldIn, pos, i); - } - -+ @Override -+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); -+ } -+ - public boolean isOpaqueCube() - { - return false; diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockMushroom.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockMushroom.java.patch deleted file mode 100644 index c8f6e6acd2..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockMushroom.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java -+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java -@@ -71,7 +71,7 @@ - if (pos.getY() >= 0 && pos.getY() < 256) - { - IBlockState iblockstate = worldIn.getBlockState(pos.down()); -- return iblockstate.getBlock() == Blocks.mycelium ? true : (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && this.canPlaceBlockOn(iblockstate.getBlock())); -+ return iblockstate.getBlock() == Blocks.mycelium ? true : (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && iblockstate.getBlock().canSustainPlant(worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this)); - } - else - { diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockMycelium.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockMycelium.java.patch deleted file mode 100644 index 774ac70798..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockMycelium.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java -+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java -@@ -39,7 +39,7 @@ - { - if (!worldIn.isRemote) - { -- if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity() > 2) -+ if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity(worldIn, pos.up()) > 2) - { - worldIn.setBlockState(pos, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); - } -@@ -53,7 +53,7 @@ - IBlockState iblockstate = worldIn.getBlockState(blockpos); - Block block = worldIn.getBlockState(blockpos.up()).getBlock(); - -- if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) -+ if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity(worldIn, blockpos.up()) <= 2) - { - worldIn.setBlockState(blockpos, this.getDefaultState()); - } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockNetherWart.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockNetherWart.java.patch index 1640b0ea13..3231eb30fe 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockNetherWart.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockNetherWart.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java +++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java -@@ -38,7 +38,7 @@ - - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) - { -- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return super.canBlockStay(worldIn, pos, state); - } - - public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) -@@ -54,9 +54,11 @@ +@@ -58,9 +58,11 @@ super.updateTick(worldIn, pos, state, rand); } @@ -22,11 +13,10 @@ { int i = 1; -@@ -107,4 +109,24 @@ - { - return new BlockState(this, new IProperty[] {AGE}); +@@ -106,6 +108,26 @@ + return ((Integer)state.getValue(AGE)).intValue(); } -+ + + @Override + public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { @@ -46,4 +36,7 @@ + + return ret; + } - } ++ + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, new IProperty[] {AGE}); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockNewLeaf.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockNewLeaf.java.patch deleted file mode 100644 index 4696ecb981..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockNewLeaf.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java -+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java -@@ -99,14 +99,15 @@ - - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) - { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) - { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4)); -- } -- else -- { - super.harvestBlock(worldIn, player, pos, state, te); - } - } -+ -+ @Override -+ public List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ IBlockState state = world.getBlockState(pos); -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4))); -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockNote.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockNote.java.patch index f93eeb4289..ac733338cb 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockNote.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockNote.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockNote.java +++ ../src-work/minecraft/net/minecraft/block/BlockNote.java -@@ -58,7 +58,9 @@ +@@ -64,7 +64,9 @@ if (tileentity instanceof TileEntityNote) { TileEntityNote tileentitynote = (TileEntityNote)tileentity; @@ -8,9 +8,9 @@ tileentitynote.changePitch(); + if (old == tileentitynote.note) return false; tileentitynote.triggerNote(worldIn, pos); - playerIn.triggerAchievement(StatList.field_181735_S); + playerIn.triggerAchievement(StatList.field_188087_U); } -@@ -98,6 +100,10 @@ +@@ -104,6 +106,10 @@ public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) { @@ -19,5 +19,5 @@ + eventID = e.instrument.ordinal(); + eventParam = e.getVanillaNoteId(); float f = (float)Math.pow(2.0D, (double)(eventParam - 12) / 12.0D); - worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "note." + this.getInstrument(eventID), 3.0F, f); + worldIn.func_184133_a((EntityPlayer)null, pos, this.func_185576_e(eventID), SoundCategory.BLOCKS, 3.0F, f); worldIn.spawnParticle(EnumParticleTypes.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)eventParam / 24.0D, 0.0D, 0.0D, new int[0]); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockOldLeaf.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockOldLeaf.java.patch deleted file mode 100644 index efca433f42..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockOldLeaf.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java -+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java -@@ -142,11 +142,17 @@ - if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) - { - player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata())); - } - else - { - super.harvestBlock(worldIn, player, pos, state, te); - } - } -+ -+ @Override -+ public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) -+ { -+ IBlockState state = world.getBlockState(pos); -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata()))); -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockOre.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockOre.java.patch index 28763cd3ca..c5808a94b5 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockOre.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockOre.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockOre.java -@@ -58,34 +58,40 @@ +@@ -59,34 +59,40 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); @@ -48,4 +48,4 @@ + return 0; } - public int getDamageValue(World worldIn, BlockPos pos) + public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockPane.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockPane.java.patch index c5061c08f0..b8055f42b3 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockPane.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockPane.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPane.java +++ ../src-work/minecraft/net/minecraft/block/BlockPane.java -@@ -38,7 +38,10 @@ +@@ -105,7 +105,10 @@ public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { @@ -12,24 +12,9 @@ } public Item getItemDropped(IBlockState state, Random rand, int fortune) -@@ -64,10 +67,10 @@ - - public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) +@@ -182,4 +185,11 @@ { -- boolean flag = this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock()); -- boolean flag1 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock()); -- boolean flag2 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock()); -- boolean flag3 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock()); -+ boolean flag = this.canPaneConnectTo(worldIn, pos, EnumFacing.NORTH); -+ boolean flag1 = this.canPaneConnectTo(worldIn, pos, EnumFacing.SOUTH); -+ boolean flag2 = this.canPaneConnectTo(worldIn, pos, EnumFacing.WEST); -+ boolean flag3 = this.canPaneConnectTo(worldIn, pos, EnumFacing.EAST); - - if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) - { -@@ -186,4 +189,11 @@ - { - return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH}); + return new BlockStateContainer(this, new IProperty[] {NORTH, EAST, WEST, SOUTH}); } + + public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockPistonBase.java.patch deleted file mode 100644 index c696444afe..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java -@@ -189,7 +189,7 @@ - } - } - -- if (!flag1 && block.getMaterial() != Material.air && canPush(block, worldIn, blockpos, enumfacing.getOpposite(), false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston)) -+ if (!flag1 && !block.isAir(worldIn, blockpos) && canPush(block, worldIn, blockpos, enumfacing.getOpposite(), false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston)) - { - this.doMove(worldIn, pos, enumfacing, false); - } -@@ -333,7 +333,7 @@ - return false; - } - -- return !(blockIn instanceof ITileEntityProvider); -+ return !(blockIn.hasTileEntity(worldIn.getBlockState(pos))); - } - else - { -@@ -371,7 +371,9 @@ - { - BlockPos blockpos = (BlockPos)list1.get(j); - Block block = worldIn.getBlockState(blockpos).getBlock(); -- block.dropBlockAsItem(worldIn, blockpos, worldIn.getBlockState(blockpos), 0); -+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior. -+ float chance = block instanceof BlockSnow ? -1.0f : 1.0f; -+ block.dropBlockAsItemWithChance(worldIn, blockpos, worldIn.getBlockState(blockpos), chance, 0); - worldIn.setBlockToAir(blockpos); - --i; - ablock[i] = block; diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockPistonMoving.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockPistonMoving.java.patch index c1bf64fbd4..7cb52f548b 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockPistonMoving.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockPistonMoving.java.patch @@ -1,26 +1,8 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java +++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java -@@ -109,16 +109,7 @@ - - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) +@@ -190,4 +190,16 @@ { -- if (!worldIn.isRemote) -- { -- TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos); -- -- if (tileentitypiston != null) -- { -- IBlockState iblockstate = tileentitypiston.getPistonState(); -- iblockstate.getBlock().dropBlockAsItem(worldIn, pos, iblockstate, 0); -- } -- } -+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); - } - - public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) -@@ -282,4 +273,16 @@ - { - return new BlockState(this, new IProperty[] {FACING, TYPE}); + return new BlockStateContainer(this, new IProperty[] {FACING, TYPE}); } + + @Override diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockPotato.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockPotato.java.patch deleted file mode 100644 index 7c4e2d1991..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockPotato.java.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPotato.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java -@@ -22,13 +22,14 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) - { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); -- -- if (!worldIn.isRemote) -- { -- if (((Integer)state.getValue(AGE)).intValue() >= 7 && worldIn.rand.nextInt(50) == 0) -- { -- spawnAsEntity(worldIn, pos, new ItemStack(Items.poisonous_potato)); -- } -- } - } -+ @Override -+ public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ java.util.List ret = super.getDrops(world, pos, state, fortune); -+ java.util.Random rand = world instanceof World ? ((World)world).rand : new java.util.Random(); -+ if (((Integer)state.getValue(AGE)) >= 7 && rand.nextInt(50) == 0) -+ ret.add(new ItemStack(Items.poisonous_potato)); -+ return ret; -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockPumpkin.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockPumpkin.java.patch deleted file mode 100644 index 6d75c0f947..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockPumpkin.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java -@@ -115,7 +115,7 @@ - - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) - { -- return worldIn.getBlockState(pos).getBlock().blockMaterial.isReplaceable() && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); -+ return worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); - } - - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockQuartz.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockQuartz.java.patch index 413d42a6f4..14c8cb0545 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockQuartz.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockQuartz.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java +++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java -@@ -90,6 +90,26 @@ - return new BlockState(this, new IProperty[] {VARIANT}); +@@ -113,6 +113,26 @@ + return new BlockStateContainer(this, new IProperty[] {VARIANT}); } + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockRailBase.java.patch index 8dea2624ef..835fdb0489 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java +++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java -@@ -31,7 +31,7 @@ +@@ -32,7 +32,7 @@ public static boolean isRailBlock(IBlockState state) { Block block = state.getBlock(); @@ -9,7 +9,7 @@ } protected BlockRailBase(boolean isPowered) -@@ -175,6 +175,81 @@ +@@ -160,6 +160,81 @@ public abstract IProperty getShapeProperty(); @@ -91,7 +91,7 @@ public static enum EnumRailDirection implements IStringSerializable { NORTH_SOUTH(0, "north_south"), -@@ -245,6 +320,7 @@ +@@ -230,6 +305,7 @@ private IBlockState state; private final boolean isPowered; private final List field_150657_g = Lists.newArrayList(); @@ -99,17 +99,7 @@ public Rail(World worldIn, BlockPos pos, IBlockState state) { -@@ -253,7 +329,8 @@ - this.state = state; - this.block = (BlockRailBase)state.getBlock(); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(BlockRailBase.this.getShapeProperty()); -- this.isPowered = this.block.isPowered; -+ this.isPowered = !this.block.isFlexibleRail(worldIn, pos); -+ canMakeSlopes = this.block.canMakeSlopes(worldIn, pos); - this.func_180360_a(blockrailbase$enumraildirection); - } - -@@ -439,7 +516,7 @@ +@@ -429,7 +505,7 @@ } } @@ -118,7 +108,7 @@ { if (BlockRailBase.isRailBlock(this.world, blockpos.up())) { -@@ -452,7 +529,7 @@ +@@ -442,7 +518,7 @@ } } @@ -127,7 +117,7 @@ { if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) { -@@ -595,7 +672,7 @@ +@@ -585,7 +661,7 @@ } } @@ -136,7 +126,7 @@ { if (BlockRailBase.isRailBlock(this.world, blockpos.up())) { -@@ -608,7 +685,7 @@ +@@ -598,7 +674,7 @@ } } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch index 6799d4271b..68cb203840 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java -@@ -295,6 +295,21 @@ - return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE); +@@ -310,6 +310,21 @@ + return this.getDefaultState().withProperty(field_185512_D, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE); } + @Override diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch index f165b66c88..0b5a254905 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java -@@ -198,6 +198,8 @@ +@@ -204,6 +204,8 @@ { - EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + EnumFacing enumfacing = (EnumFacing)state.getValue(field_185512_D); BlockPos blockpos = pos.offset(enumfacing.getOpposite()); + if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldIn, pos, worldIn.getBlockState(pos), java.util.EnumSet.of(enumfacing.getOpposite())).isCanceled()) + return; diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch index 61ff6434e5..8acd40ee8d 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java -@@ -91,12 +91,16 @@ +@@ -92,12 +92,16 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch deleted file mode 100644 index 9e635ef051..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java -@@ -58,10 +58,10 @@ - BlockPos blockpos = pos.offset(direction); - Block block = worldIn.getBlockState(pos.offset(direction)).getBlock(); - -- if (!canConnectTo(worldIn.getBlockState(blockpos), direction) && (block.isBlockNormalCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.down())))) -+ if (!canRestoneConnect(worldIn, blockpos, direction) && (block.isBlockNormalCube() || !canRestoneConnect(worldIn, blockpos.down(), null))) - { - Block block1 = worldIn.getBlockState(pos.up()).getBlock(); -- return !block1.isBlockNormalCube() && block.isBlockNormalCube() && canConnectUpwardsTo(worldIn.getBlockState(blockpos.up())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; -+ return !block1.isBlockNormalCube() && block.isBlockNormalCube() && canRestoneConnect(worldIn, blockpos.up(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; - } - else - { -@@ -359,35 +359,24 @@ - Block block = iblockstate.getBlock(); - boolean flag = block.isNormalCube(); - boolean flag1 = worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); -- return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down()))); -+ return !flag1 && flag && canRestoneConnect(worldIn, blockpos.up(), null) ? true : (canRestoneConnect(worldIn, blockpos, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canRestoneConnect(worldIn, blockpos.down(), null))); - } - -- protected static boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) -+ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side) - { -- return canConnectUpwardsTo(worldIn.getBlockState(pos)); -- } -- -- protected static boolean canConnectUpwardsTo(IBlockState state) -- { -- return canConnectTo(state, (EnumFacing)null); -- } -- -- protected static boolean canConnectTo(IBlockState blockState, EnumFacing side) -- { -- Block block = blockState.getBlock(); -- -- if (block == Blocks.redstone_wire) -+ IBlockState state = world.getBlockState(pos); -+ if (state.getBlock() == Blocks.redstone_wire) - { - return true; - } -- else if (Blocks.unpowered_repeater.isAssociated(block)) -+ else if (Blocks.unpowered_repeater.isAssociated(state.getBlock())) - { -- EnumFacing enumfacing = (EnumFacing)blockState.getValue(BlockRedstoneRepeater.FACING); -- return enumfacing == side || enumfacing.getOpposite() == side; -+ EnumFacing direction = (EnumFacing)state.getValue(BlockRedstoneRepeater.FACING); -+ return direction == side || direction.getOpposite() == side; - } - else - { -- return block.canProvidePower() && side != null; -+ return state.getBlock().canConnectRedstone(world, pos, side); - } - } - diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockReed.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockReed.java.patch index a6e2c2ae8b..73e2c0206c 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockReed.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockReed.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockReed.java +++ ../src-work/minecraft/net/minecraft/block/BlockReed.java -@@ -18,7 +18,7 @@ +@@ -19,7 +19,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -8,8 +8,8 @@ +public class BlockReed extends Block implements net.minecraftforge.common.IPlantable { public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); - -@@ -65,6 +65,7 @@ + protected static final AxisAlignedBB field_185701_b = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D); +@@ -70,6 +70,7 @@ public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { Block block = worldIn.getBlockState(pos.down()).getBlock(); @@ -17,11 +17,10 @@ if (block == this) { -@@ -164,4 +165,15 @@ - { - return new BlockState(this, new IProperty[] {AGE}); +@@ -162,6 +163,17 @@ + return ((Integer)state.getValue(AGE)).intValue(); } -+ + + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) + { @@ -32,4 +31,7 @@ + { + return this.getDefaultState(); + } - } ++ + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, new IProperty[] {AGE}); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch index e450bf9074..f7f921a9e8 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch @@ -1,10 +1,9 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRotatedPillar.java +++ ../src-work/minecraft/net/minecraft/block/BlockRotatedPillar.java -@@ -18,4 +18,18 @@ - { +@@ -28,6 +28,20 @@ super(p_i46385_1_, p_i46385_2_); } -+ + + public boolean rotateBlock(net.minecraft.world.World world, net.minecraft.util.BlockPos pos, EnumFacing axis) + { + net.minecraft.block.state.IBlockState state = world.getBlockState(pos); @@ -18,4 +17,7 @@ + } + return false; + } - } ++ + public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) + { + switch (p_185499_2_) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockSapling.java.patch index ce119c1ba8..559b05cb5c 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSapling.java +++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java -@@ -71,6 +71,7 @@ +@@ -77,6 +77,7 @@ public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) { diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockSkull.java.patch index abe2893df2..6eba91dd92 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockSkull.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockSkull.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSkull.java +++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java -@@ -121,10 +121,6 @@ - return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).getSkullType() : super.getDamageValue(worldIn, pos); +@@ -116,10 +116,6 @@ + return new ItemStack(Items.skull, 1, i); } - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) @@ -11,7 +11,7 @@ public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) { if (player.capabilities.isCreativeMode) -@@ -132,13 +128,18 @@ +@@ -127,13 +123,18 @@ state = state.withProperty(NODROP, Boolean.valueOf(true)); worldIn.setBlockState(pos, state, 4); } @@ -31,16 +31,7 @@ { if (!((Boolean)state.getValue(NODROP)).booleanValue()) { -@@ -147,7 +148,7 @@ - if (tileentity instanceof TileEntitySkull) - { - TileEntitySkull tileentityskull = (TileEntitySkull)tileentity; -- ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(worldIn, pos)); -+ ItemStack itemstack = new ItemStack(Items.skull, 1, tileentityskull.getSkullType()); - - if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null) - { -@@ -157,12 +158,11 @@ +@@ -152,12 +153,11 @@ itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound); } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockSlab.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockSlab.java.patch index f6b830de37..7b088c7379 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockSlab.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockSlab.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSlab.java +++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java -@@ -91,6 +91,17 @@ +@@ -50,6 +50,17 @@ return this.isDouble(); } @@ -18,21 +18,3 @@ public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { IBlockState iblockstate = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); -@@ -118,15 +129,8 @@ - { - return false; - } -- else -- { -- BlockPos blockpos = pos.offset(side.getOpposite()); -- IBlockState iblockstate = worldIn.getBlockState(pos); -- IBlockState iblockstate1 = worldIn.getBlockState(blockpos); -- boolean flag = isSlab(iblockstate.getBlock()) && iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; -- boolean flag1 = isSlab(iblockstate1.getBlock()) && iblockstate1.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; -- return flag1 ? (side == EnumFacing.DOWN ? true : (side == EnumFacing.UP && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || !flag)) : (side == EnumFacing.UP ? true : (side == EnumFacing.DOWN && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || flag)); -- } -+ // additional logic breaks doesSideBlockRendering and is no longer useful. -+ return super.shouldSideBeRendered(worldIn, pos, side); - } - - @SideOnly(Side.CLIENT) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockSnow.java.patch index 99b5ece864..3fd57bfd7d 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockSnow.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockSnow.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSnow.java +++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java -@@ -79,7 +79,7 @@ - { - IBlockState iblockstate = worldIn.getBlockState(pos.down()); - Block block = iblockstate.getBlock(); -- return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; -+ return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(worldIn, pos.down()) ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; - } - - public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) -@@ -91,7 +91,6 @@ +@@ -85,7 +85,6 @@ { if (!this.canPlaceBlockAt(worldIn, pos)) { @@ -17,18 +8,7 @@ worldIn.setBlockToAir(pos); return false; } -@@ -103,9 +102,8 @@ - - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) - { -- spawnAsEntity(worldIn, pos, new ItemStack(Items.snowball, ((Integer)state.getValue(LAYERS)).intValue() + 1, 0)); -+ super.harvestBlock(worldIn, player, pos, state, te); - worldIn.setBlockToAir(pos); -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); - } - - public Item getItemDropped(IBlockState state, Random rand, int fortune) -@@ -115,14 +113,13 @@ +@@ -109,14 +108,13 @@ public int quantityDropped(Random random) { @@ -44,10 +24,12 @@ worldIn.setBlockToAir(pos); } } -@@ -152,4 +149,6 @@ - { - return new BlockState(this, new IProperty[] {LAYERS}); +@@ -150,6 +148,8 @@ + return ((Integer)state.getValue(LAYERS)).intValue() - 1; } -+ + + @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.getValue(LAYERS)) + 1; } - } ++ + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, new IProperty[] {LAYERS}); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockStairs.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockStairs.java.patch deleted file mode 100644 index 33a74a3c22..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockStairs.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockStairs.java -+++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java -@@ -68,6 +68,19 @@ - return false; - } - -+ @Override -+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ if ( isOpaqueCube() ) -+ return true; -+ -+ // face is on the block being rendered, not this block. -+ IBlockState iblockstate = world.getBlockState(pos); -+ EnumHalf half = iblockstate.getValue(HALF); -+ EnumFacing side = iblockstate.getValue(FACING); -+ return side == face.getOpposite() || (half == EnumHalf.TOP && face == EnumFacing.DOWN) || (half == EnumHalf.BOTTOM && face == EnumFacing.UP); -+ } -+ - public boolean isFullCube() - { - return false; diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockStem.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockStem.java.patch index 41d70ce17d..c68f85e424 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockStem.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockStem.java +++ ../src-work/minecraft/net/minecraft/block/BlockStem.java -@@ -94,7 +94,7 @@ +@@ -91,7 +91,7 @@ pos = pos.offset(EnumFacing.Plane.HORIZONTAL.random(rand)); Block block = worldIn.getBlockState(pos.down()).getBlock(); @@ -9,7 +9,7 @@ { worldIn.setBlockState(pos, this.crop.getDefaultState()); } -@@ -148,8 +148,12 @@ +@@ -109,8 +109,12 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); @@ -23,7 +23,7 @@ { Item item = this.getSeedItem(); -@@ -159,13 +163,14 @@ +@@ -120,13 +124,14 @@ for (int j = 0; j < 3; ++j) { diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockTallGrass.java.patch index d0a3b75f39..f53bcd4ba0 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockTallGrass.java.patch @@ -8,17 +8,8 @@ +public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable { public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockTallGrass.EnumType.class); - -@@ -43,7 +43,7 @@ - - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) - { -- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return super.canBlockStay(worldIn, pos, state); - } - - public boolean isReplaceable(World worldIn, BlockPos pos) -@@ -53,7 +53,7 @@ + protected static final AxisAlignedBB field_185522_c = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D); +@@ -51,7 +51,7 @@ public Item getItemDropped(IBlockState state, Random rand, int fortune) { @@ -27,21 +18,7 @@ } public int quantityDroppedWithBonus(int fortune, Random random) -@@ -63,13 +63,7 @@ - - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) - { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) - { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 1, ((BlockTallGrass.EnumType)state.getValue(TYPE)).getMeta())); -- } -- else -- { - super.harvestBlock(worldIn, player, pos, state, te); - } - } -@@ -204,4 +198,22 @@ +@@ -181,4 +181,22 @@ } } } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockTorch.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockTorch.java.patch index 83c0fc29c7..9eba3ac141 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockTorch.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockTorch.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockTorch.java +++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java -@@ -63,7 +63,7 @@ +@@ -86,7 +86,7 @@ else { Block block = worldIn.getBlockState(pos).getBlock(); @@ -9,7 +9,7 @@ } } -@@ -84,7 +84,7 @@ +@@ -107,7 +107,7 @@ { BlockPos blockpos = pos.offset(facing.getOpposite()); boolean flag = facing.getAxis().isHorizontal(); @@ -18,7 +18,7 @@ } public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) -@@ -97,7 +97,7 @@ +@@ -120,7 +120,7 @@ { for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { @@ -27,7 +27,7 @@ { return this.getDefaultState().withProperty(FACING, enumfacing); } -@@ -130,7 +130,7 @@ +@@ -153,7 +153,7 @@ EnumFacing enumfacing1 = enumfacing.getOpposite(); boolean flag = false; diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockTrapDoor.java.patch deleted file mode 100644 index 7de11cc755..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockTrapDoor.java.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java -+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java -@@ -25,6 +25,8 @@ - - public class BlockTrapDoor extends Block - { -+ /** Set this to allow trapdoors to remain free-floating */ -+ public static boolean disableValidation = false; - public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); - public static final PropertyBool OPEN = PropertyBool.create("open"); - public static final PropertyEnum HALF = PropertyEnum.create("half", BlockTrapDoor.DoorHalf.class); -@@ -140,9 +142,10 @@ - { - if (!worldIn.isRemote) - { -+ EnumFacing direction = (EnumFacing)state.getValue(FACING); - BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); - -- if (!isValidSupportBlock(worldIn.getBlockState(blockpos).getBlock())) -+ if (!(isValidSupportBlock(worldIn.getBlockState(blockpos).getBlock()) || worldIn.isSideSolid(blockpos, direction, true))) - { - worldIn.setBlockToAir(pos); - this.dropBlockAsItem(worldIn, pos, state, 0); -@@ -186,7 +189,10 @@ - - public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) - { -- return !side.getAxis().isVertical() && isValidSupportBlock(worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock()); -+ if (disableValidation) return true; -+ EnumFacing dir = side.getOpposite(); -+ pos = pos.offset(dir); -+ return !side.getAxis().isVertical() && (isValidSupportBlock(worldIn.getBlockState(pos).getBlock()) || worldIn.isSideSolid(pos, side, true)); - } - - protected static EnumFacing getFacing(int meta) -@@ -223,6 +229,7 @@ - - private static boolean isValidSupportBlock(Block blockIn) - { -+ if (disableValidation) return true; - return blockIn.blockMaterial.isOpaque() && blockIn.isFullCube() || blockIn == Blocks.glowstone || blockIn instanceof BlockSlab || blockIn instanceof BlockStairs; - } - diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockTripWireHook.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockTripWireHook.java.patch deleted file mode 100644 index a8de6b96ff..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/BlockTripWireHook.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java -+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java -@@ -58,14 +58,14 @@ - - public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) - { -- return side.getAxis().isHorizontal() && worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock().isNormalCube(); -+ return side.getAxis().isHorizontal() && worldIn.isSideSolid(pos.offset(side.getOpposite()), side, true); - } - - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) - { - for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) - { -- if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().isNormalCube()) -+ if (worldIn.isSideSolid(pos.offset(enumfacing), enumfacing.getOpposite(), true)) - { - return true; - } -@@ -99,7 +99,7 @@ - { - EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); - -- if (!worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock().isNormalCube()) -+ if (!worldIn.isSideSolid(pos.offset(enumfacing.getOpposite()), enumfacing, true)) - { - this.dropBlockAsItem(worldIn, pos, state, 0); - worldIn.setBlockToAir(pos); diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch index a3536a8504..cc09afa923 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockVine.java +++ ../src-work/minecraft/net/minecraft/block/BlockVine.java -@@ -25,7 +25,7 @@ +@@ -26,7 +26,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -9,21 +9,7 @@ { public static final PropertyBool UP = PropertyBool.create("up"); public static final PropertyBool NORTH = PropertyBool.create("north"); -@@ -387,13 +387,7 @@ - - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) - { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) - { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.vine, 1, 0)); -- } -- else -- { - super.harvestBlock(worldIn, player, pos, state, te); - } - } -@@ -474,4 +468,14 @@ +@@ -457,4 +457,14 @@ return i; } diff --git a/patches.mcp/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch b/patches.mcp/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch deleted file mode 100644 index a9bcee491d..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java -+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java -@@ -78,7 +78,7 @@ - { - Block block = this.world.getBlockState(origin).getBlock(); - -- if (block.getMaterial() == Material.air) -+ if (block.isAir(world, origin)) - { - return true; - } -@@ -109,7 +109,7 @@ - BlockPos blockpos = origin.offset(this.moveDirection.getOpposite(), i); - block = this.world.getBlockState(blockpos).getBlock(); - -- if (block.getMaterial() == Material.air || !BlockPistonBase.canPush(block, this.world, blockpos, this.moveDirection, false) || blockpos.equals(this.pistonPos)) -+ if (block.isAir(world, blockpos)|| !BlockPistonBase.canPush(block, this.world, blockpos, this.moveDirection, false) || blockpos.equals(this.pistonPos)) - { - break; - } -@@ -156,7 +156,7 @@ - - block = this.world.getBlockState(blockpos1).getBlock(); - -- if (block.getMaterial() == Material.air) -+ if (block.isAir(world, blockpos1)) - { - return true; - } diff --git a/patches.mcp/minecraft/net/minecraft/block/state/BlockState.java.patch b/patches.mcp/minecraft/net/minecraft/block/state/BlockState.java.patch deleted file mode 100644 index 3572047363..0000000000 --- a/patches.mcp/minecraft/net/minecraft/block/state/BlockState.java.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/state/BlockState.java -+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java -@@ -38,6 +38,16 @@ - - public BlockState(Block blockIn, IProperty... properties) - { -+ this(blockIn, properties, null); -+ } -+ -+ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) -+ { -+ return new StateImplementation(block, properties); -+ } -+ -+ protected BlockState(Block blockIn, IProperty[] properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) -+ { - this.block = blockIn; - Arrays.sort(properties, new Comparator() - { -@@ -53,7 +63,7 @@ - for (List list1 : Cartesian.cartesianProduct(this.getAllowedValues())) - { - Map map1 = MapPopulator.createMap(this.properties, list1); -- BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(blockIn, ImmutableMap.copyOf(map1)); -+ BlockState.StateImplementation blockstate$stateimplementation = createState(blockIn, ImmutableMap.copyOf(map1), unlistedProperties); - map.put(map1, blockstate$stateimplementation); - list.add(blockstate$stateimplementation); - } -@@ -132,6 +142,13 @@ - } - } - -+ protected StateImplementation(Block blockIn, ImmutableMap propertiesIn, ImmutableTable propertyValueTable) -+ { -+ this.block = blockIn; -+ this.properties = propertiesIn; -+ this.propertyValueTable = propertyValueTable; -+ } -+ - public , V extends T> IBlockState withProperty(IProperty property, V value) - { - if (!this.properties.containsKey(property)) -@@ -199,5 +216,10 @@ - map.put(property, value); - return map; - } -+ -+ public ImmutableTable getPropertyValueTable() -+ { -+ return propertyValueTable; -+ } - } - } diff --git a/patches.mcp/minecraft/net/minecraft/block/state/BlockStateBase.java.patch b/patches.mcp/minecraft/net/minecraft/block/state/BlockStateBase.java.patch index a8c5028636..1391fcbe52 100644 --- a/patches.mcp/minecraft/net/minecraft/block/state/BlockStateBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/state/BlockStateBase.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/state/BlockStateBase.java +++ ../src-work/minecraft/net/minecraft/block/state/BlockStateBase.java -@@ -67,4 +67,9 @@ +@@ -71,4 +71,9 @@ return stringbuilder.toString(); } diff --git a/patches.mcp/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch index 093758d5b0..c4f3c5cdb2 100644 --- a/patches.mcp/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch @@ -9,10 +9,10 @@ + if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering + { Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + VertexBuffer vertexbuffer = tessellator.getWorldRenderer(); this.mc.getTextureManager().bindTexture(Gui.optionsBackground); @@ -174,6 +178,12 @@ - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); this.mc.fontRendererObj.drawStringWithShadow(this.currentlyDisplayedText, (float)((k - this.mc.fontRendererObj.getStringWidth(this.currentlyDisplayedText)) / 2), (float)(l / 2 - 4 - 16), 16777215); this.mc.fontRendererObj.drawStringWithShadow(this.message, (float)((k - this.mc.fontRendererObj.getStringWidth(this.message)) / 2), (float)(l / 2 - 4 + 8), 16777215); + } diff --git a/patches.mcp/minecraft/net/minecraft/client/Minecraft.java.patch b/patches.mcp/minecraft/net/minecraft/client/Minecraft.java.patch index 352354a013..caba83d8c0 100644 --- a/patches.mcp/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/Minecraft.java.patch @@ -1,27 +1,14 @@ --- ../src-base/minecraft/net/minecraft/client/Minecraft.java +++ ../src-work/minecraft/net/minecraft/client/Minecraft.java -@@ -301,7 +301,6 @@ - this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); +@@ -318,7 +318,6 @@ + this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); this.session = gameConfig.userInfo.session; logger.info("Setting user: " + this.session.getUsername()); - logger.info("(Session ID is " + this.session.getSessionID() + ")"); this.isDemo = gameConfig.gameInfo.isDemo; this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; -@@ -415,10 +414,10 @@ - this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); - this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); - this.mcResourceManager.registerReloadListener(this.mcLanguageManager); -- this.refreshResources(); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().beginMinecraftLoading(this, this.defaultResourcePacks, this.mcResourceManager); - this.renderEngine = new TextureManager(this.mcResourceManager); - this.mcResourceManager.registerReloadListener(this.renderEngine); -- this.drawSplashScreen(this.renderEngine); -+ net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.renderEngine); - this.initStream(); - this.skinManager = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.sessionService); - this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); -@@ -453,6 +452,8 @@ +@@ -469,6 +468,8 @@ } }); this.mouseHelper = new MouseHelper(); @@ -30,59 +17,7 @@ this.checkGLError("Pre startup"); GlStateManager.enableTexture2D(); GlStateManager.shadeModel(7425); -@@ -466,17 +467,21 @@ - GlStateManager.loadIdentity(); - GlStateManager.matrixMode(5888); - this.checkGLError("Startup"); -- this.textureMapBlocks = new TextureMap("textures"); -+ bar.step("Loading Texture Map"); -+ this.textureMapBlocks = new TextureMap("textures",true); - this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels); - this.renderEngine.loadTickableTexture(TextureMap.locationBlocksTexture, this.textureMapBlocks); - this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - this.textureMapBlocks.setBlurMipmapDirect(false, this.gameSettings.mipmapLevels > 0); -+ bar.step("Loading Model Manager"); - this.modelManager = new ModelManager(this.textureMapBlocks); - this.mcResourceManager.registerReloadListener(this.modelManager); -+ bar.step("Loading Item Renderer"); - this.renderItem = new RenderItem(this.renderEngine, this.modelManager); - this.renderManager = new RenderManager(this.renderEngine, this.renderItem); - this.itemRenderer = new ItemRenderer(this); - this.mcResourceManager.registerReloadListener(this.renderItem); -+ bar.step("Loading Entity Renderer"); - this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); - this.mcResourceManager.registerReloadListener(this.entityRenderer); - this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), this.gameSettings); -@@ -486,22 +491,25 @@ - this.guiAchievement = new GuiAchievement(this); - GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight); - this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); -+ net.minecraftforge.fml.common.ProgressManager.pop(bar); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().finishMinecraftLoading(); - this.checkGLError("Post startup"); -- this.ingameGUI = new GuiIngame(this); -+ this.ingameGUI = new net.minecraftforge.client.GuiIngameForge(this); - - if (this.serverName != null) - { -- this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServerAtStartup(this.serverName, this.serverPort); - } - else - { - this.displayGuiScreen(new GuiMainMenu()); - } - -- this.renderEngine.deleteTexture(this.mojangLogo); -+ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(renderEngine, mojangLogo); - this.mojangLogo = null; - this.loadingScreen = new LoadingScreenRenderer(this); - -+ net.minecraftforge.fml.client.FMLClientHandler.instance().onInitializationComplete(); - if (this.gameSettings.fullScreen && !this.fullscreen) - { - this.toggleFullscreen(); -@@ -681,21 +689,23 @@ +@@ -692,21 +693,23 @@ File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport()); @@ -109,7 +44,7 @@ } public boolean isUnicode() -@@ -883,11 +893,6 @@ +@@ -899,11 +902,6 @@ public void displayGuiScreen(GuiScreen guiScreenIn) { @@ -121,25 +56,7 @@ if (guiScreenIn == null && this.theWorld == null) { guiScreenIn = new GuiMainMenu(); -@@ -897,6 +902,17 @@ - guiScreenIn = new GuiGameOver(); - } - -+ GuiScreen old = this.currentScreen; -+ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(guiScreenIn); -+ -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; -+ -+ guiScreenIn = event.gui; -+ if (old != null && guiScreenIn != old) -+ { -+ old.onGuiClosed(); -+ } -+ - if (guiScreenIn instanceof GuiMainMenu) - { - this.gameSettings.showDebugInfo = false; -@@ -1030,9 +1046,11 @@ +@@ -1051,9 +1049,11 @@ if (!this.skipRenderWorld) { @@ -151,47 +68,7 @@ } this.mcProfiler.endSection(); -@@ -1377,7 +1395,7 @@ - - if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockpos, this.objectMouseOver.sideHit)) - { -- this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit); -+ this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver); - this.thePlayer.swingItem(); - } - } -@@ -1463,15 +1481,19 @@ - case BLOCK: - BlockPos blockpos = this.objectMouseOver.getBlockPos(); - -- if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) -+ if (!this.theWorld.isAirBlock(blockpos)) - { - int i = itemstack != null ? itemstack.stackSize : 0; - -+ -+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.theWorld, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec).isCanceled(); -+ if (result) { //Forge: Kept separate to simplify patch - if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) - { - flag = false; - this.thePlayer.swingItem(); - } -+ } - - if (itemstack == null) - { -@@ -1494,7 +1516,8 @@ - { - ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); - -- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) -+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, theWorld, null, null, null).isCanceled(); -+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) - { - this.entityRenderer.itemRenderer.resetEquippedProgress2(); - } -@@ -1598,6 +1621,8 @@ +@@ -1623,6 +1623,8 @@ --this.rightClickDelayTimer; } @@ -200,48 +77,23 @@ this.mcProfiler.startSection("gui"); if (!this.isGamePaused) -@@ -1690,6 +1715,8 @@ - - while (Mouse.next()) - { -+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; -+ - int i = Mouse.getEventButton(); - KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState()); - -@@ -1745,6 +1772,7 @@ - this.currentScreen.handleMouseInput(); - } +@@ -1734,6 +1736,7 @@ + this.joinPlayerCounter = 0; + this.theWorld.joinEntityInSurroundings(this.thePlayer); } + net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput(); } - if (this.leftClickCounter > 0) -@@ -1923,6 +1951,7 @@ - } + this.mcProfiler.endStartSection("gameRenderer"); +@@ -1926,6 +1929,7 @@ + this.gameSettings.showLagometer = this.gameSettings.showDebugInfo && GuiScreen.isAltKeyDown(); } } + net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput(); } - - for (int l = 0; l < 9; ++l) -@@ -2119,12 +2148,15 @@ - this.myNetworkManager.processReceivedPackets(); } -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostClientTick(); -+ - this.mcProfiler.endSection(); - this.systemTime = getSystemTime(); - } - - public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) - { -+ net.minecraftforge.fml.client.FMLClientHandler.instance().startIntegratedServer(folderName, worldName, worldSettingsIn); - this.loadWorld((WorldClient)null); - System.gc(); - ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false); -@@ -2160,6 +2192,12 @@ +@@ -2273,6 +2277,12 @@ while (!this.theIntegratedServer.serverIsInRunLoop()) { @@ -254,24 +106,7 @@ String s = this.theIntegratedServer.getUserMessage(); if (s != null) -@@ -2185,8 +2223,14 @@ - SocketAddress socketaddress = this.theIntegratedServer.getNetworkSystem().addLocalEndpoint(); - NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress); - networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null)); -- networkmanager.sendPacket(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN)); -- networkmanager.sendPacket(new C00PacketLoginStart(this.getSession().getProfile())); -+ networkmanager.sendPacket(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true)); -+ com.mojang.authlib.GameProfile gameProfile = this.getSession().getProfile(); -+ if (!this.getSession().hasCachedProperties()) -+ { -+ gameProfile = sessionService.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974. -+ this.getSession().setProperties(gameProfile.getProperties()); -+ } -+ networkmanager.sendPacket(new C00PacketLoginStart(gameProfile)); - this.myNetworkManager = networkmanager; - } - -@@ -2197,6 +2241,8 @@ +@@ -2310,6 +2320,8 @@ public void loadWorld(WorldClient worldClientIn, String loadingMessage) { @@ -280,26 +115,7 @@ if (worldClientIn == null) { NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); -@@ -2210,6 +2256,18 @@ - { - this.theIntegratedServer.initiateShutdown(); - this.theIntegratedServer.setStaticInstance(); -+ if (loadingScreen != null) -+ { -+ this.loadingScreen.displayLoadingString(I18n.format("forge.client.shutdown.internal")); -+ } -+ while (!theIntegratedServer.isServerStopped()) -+ { -+ try -+ { -+ Thread.sleep(10); -+ } -+ catch (InterruptedException ie) {} -+ } - } - - this.theIntegratedServer = null; -@@ -2232,6 +2290,7 @@ +@@ -2345,6 +2357,7 @@ this.ingameGUI.func_181029_i(); this.setServerData((ServerData)null); this.integratedServerIsRunning = false; @@ -307,153 +123,3 @@ } this.mcSoundHandler.stopSounds(); -@@ -2336,126 +2395,10 @@ - if (this.objectMouseOver != null) - { - boolean flag = this.thePlayer.capabilities.isCreativeMode; -- int i = 0; -- boolean flag1 = false; -- TileEntity tileentity = null; -- Item item; -- -- if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) -- { -- BlockPos blockpos = this.objectMouseOver.getBlockPos(); -- Block block = this.theWorld.getBlockState(blockpos).getBlock(); -- -- if (block.getMaterial() == Material.air) -- { -- return; -- } -- -- item = block.getItem(this.theWorld, blockpos); -- -- if (item == null) -- { -- return; -- } -- -- if (flag && GuiScreen.isCtrlKeyDown()) -- { -- tileentity = this.theWorld.getTileEntity(blockpos); -- } -- -- Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block; -- i = block1.getDamageValue(this.theWorld, blockpos); -- flag1 = item.getHasSubtypes(); -- } -- else -- { -- if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) -- { -- return; -- } -- -- if (this.objectMouseOver.entityHit instanceof EntityPainting) -- { -- item = Items.painting; -- } -- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) -- { -- item = Items.lead; -- } -- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) -- { -- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit; -- ItemStack itemstack = entityitemframe.getDisplayedItem(); -- -- if (itemstack == null) -- { -- item = Items.item_frame; -- } -- else -- { -- item = itemstack.getItem(); -- i = itemstack.getMetadata(); -- flag1 = true; -- } -- } -- else if (this.objectMouseOver.entityHit instanceof EntityMinecart) -- { -- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit; -- -- switch (entityminecart.getMinecartType()) -- { -- case FURNACE: -- item = Items.furnace_minecart; -- break; -- case CHEST: -- item = Items.chest_minecart; -- break; -- case TNT: -- item = Items.tnt_minecart; -- break; -- case HOPPER: -- item = Items.hopper_minecart; -- break; -- case COMMAND_BLOCK: -- item = Items.command_block_minecart; -- break; -- default: -- item = Items.minecart; -- } -- } -- else if (this.objectMouseOver.entityHit instanceof EntityBoat) -- { -- item = Items.boat; -- } -- else if (this.objectMouseOver.entityHit instanceof EntityArmorStand) -- { -- item = Items.armor_stand; -- } -- else -- { -- item = Items.spawn_egg; -- i = EntityList.getEntityID(this.objectMouseOver.entityHit); -- flag1 = true; -- -- if (!EntityList.entityEggs.containsKey(Integer.valueOf(i))) -- { -- return; -- } -- } -- } -- - InventoryPlayer inventoryplayer = this.thePlayer.inventory; - -- if (tileentity == null) -- { -- inventoryplayer.setCurrentItem(item, i, flag1, flag); -- } -- else -- { -- ItemStack itemstack1 = this.func_181036_a(item, i, tileentity); -- inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1); -- } -- -+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) return; -+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions - if (flag) - { - int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem; -@@ -2756,18 +2699,8 @@ - - public static int getGLMaximumTextureSize() - { -- for (int i = 16384; i > 0; i >>= 1) -- { -- GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null)); -- int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); -- -- if (j != 0) -- { -- return i; -- } -- } -- -- return -1; -+ //Forge we redirect this to our code which caches the value before any splash screen stuff is done. -+ return net.minecraftforge.fml.client.SplashProgress.getMaxTextureSize(); - } - - public boolean isSnooperEnabled() diff --git a/patches.mcp/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches.mcp/minecraft/net/minecraft/client/audio/SoundManager.java.patch index 3d4c138169..2afdefe87f 100644 --- a/patches.mcp/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/audio/SoundManager.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java +++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java -@@ -69,6 +69,7 @@ +@@ -76,6 +76,7 @@ { SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); @@ -8,34 +8,11 @@ } catch (SoundSystemException soundsystemexception) { -@@ -80,6 +81,7 @@ - { +@@ -100,6 +101,7 @@ + this.unloadSoundSystem(); this.loadSoundSystem(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this)); } private synchronized void loadSoundSystem() -@@ -316,6 +318,9 @@ - } - else - { -+ sound = net.minecraftforge.client.ForgeHooksClient.playSound(this, sound); -+ if (sound == null) return; -+ - SoundEventAccessorComposite soundeventaccessorcomposite = this.sndHandler.getSound(sound.getSoundLocation()); - - if (soundeventaccessorcomposite == null) -@@ -357,10 +362,12 @@ - if (soundpoolentry.isStreamingSound()) - { - this.sndSystem.newStreamingSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, sound.getXPosF(), sound.getYPosF(), sound.getZPosF(), sound.getAttenuationType().getTypeInt(), f1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, sound, s)); - } - else - { - this.sndSystem.newSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, sound.getXPosF(), sound.getYPosF(), sound.getZPosF(), sound.getAttenuationType().getTypeInt(), f1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, sound, s)); - } - - logger.debug(LOG_MARKER, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.getSoundPoolEntryLocation(), soundeventaccessorcomposite.getSoundEventLocation(), s}); diff --git a/patches.mcp/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch b/patches.mcp/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch index 840d193e0f..74fca0297a 100644 --- a/patches.mcp/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java +++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java -@@ -128,6 +128,6 @@ +@@ -148,6 +148,6 @@ f *= 1.0F - f1 * 0.15F; } diff --git a/patches.mcp/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches.mcp/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch index 42c1d46058..88eedb390b 100644 --- a/patches.mcp/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java -@@ -345,6 +345,15 @@ +@@ -400,6 +400,15 @@ this.mc.ingameGUI.getChatGUI().printChatMessage(chatComponent); } @@ -16,7 +16,7 @@ protected boolean pushOutOfBlocks(double x, double y, double z) { if (this.noClip) -@@ -357,30 +366,34 @@ +@@ -412,30 +421,34 @@ double d0 = x - (double)blockpos.getX(); double d1 = z - (double)blockpos.getZ(); @@ -56,16 +56,3 @@ { d2 = 1.0D - d1; i = 5; -@@ -448,6 +461,12 @@ - - public void playSound(String name, float volume, float pitch) - { -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, name, volume, pitch); -+ if (event.isCanceled() || event.name == null) return; -+ name = event.name; -+ volume = event.newVolume; -+ pitch = event.newPitch; -+ - this.worldObj.playSound(this.posX, this.posY, this.posZ, name, volume, pitch, false); - } - diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch index dff19271b4..7c4ef0a8e5 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch @@ -17,25 +17,7 @@ } private void readFontTexture() -@@ -105,7 +106,7 @@ - - try - { -- bufferedimage = TextureUtil.readBufferedImage(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream()); -+ bufferedimage = TextureUtil.readBufferedImage(getResourceInputStream(this.locationFontTexture)); - } - catch (IOException ioexception) - { -@@ -165,7 +166,7 @@ - - try - { -- inputstream = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")).getInputStream(); -+ inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); - inputstream.read(this.glyphWidth); - } - catch (IOException ioexception) -@@ -196,7 +197,7 @@ +@@ -202,7 +203,7 @@ int i = ch % 16 * 8; int j = ch / 16 * 8; int k = italic ? 1 : 0; @@ -43,8 +25,8 @@ + bindTexture(this.locationFontTexture); int l = this.charWidth[ch]; float f = (float)l - 0.01F; - GL11.glBegin(GL11.GL_TRIANGLE_STRIP); -@@ -224,7 +225,7 @@ + GlStateManager.func_187447_r(5); +@@ -230,7 +231,7 @@ private void loadGlyphTexture(int page) { @@ -53,7 +35,7 @@ } protected float renderUnicodeChar(char ch, boolean italic) -@@ -271,7 +272,7 @@ +@@ -279,7 +280,7 @@ public int drawString(String text, float x, float y, int color, boolean dropShadow) { @@ -62,7 +44,7 @@ this.resetStyles(); int i; -@@ -341,7 +342,7 @@ +@@ -349,7 +350,7 @@ int j1 = this.colorCode[i1]; this.textColor = j1; @@ -71,7 +53,7 @@ } else if (i1 == 16) { -@@ -370,7 +371,7 @@ +@@ -378,7 +379,7 @@ this.strikethroughStyle = false; this.underlineStyle = false; this.italicStyle = false; @@ -80,7 +62,7 @@ } ++i; -@@ -398,7 +399,7 @@ +@@ -406,7 +407,7 @@ c0 = c1; } @@ -89,7 +71,7 @@ boolean flag = (c0 == 0 || j == -1 || this.unicodeFlag) && shadow; if (flag) -@@ -436,7 +437,16 @@ +@@ -444,7 +445,16 @@ ++f; } @@ -106,7 +88,7 @@ if (this.strikethroughStyle) { Tessellator tessellator = Tessellator.getInstance(); -@@ -509,7 +519,7 @@ +@@ -517,7 +527,7 @@ this.blue = (float)(color >> 8 & 255) / 255.0F; this.green = (float)(color & 255) / 255.0F; this.alpha = (float)(color >> 24 & 255) / 255.0F; @@ -115,19 +97,7 @@ this.posX = x; this.posY = y; this.renderStringAtPos(text, dropShadow); -@@ -588,11 +598,6 @@ - int j = this.glyphWidth[character] >>> 4; - int k = this.glyphWidth[character] & 15; - -- if (k > 7) -- { -- k = 15; -- j = 0; -- } - - ++k; - return (k - j) / 2 + 1; -@@ -846,6 +851,26 @@ +@@ -848,6 +858,26 @@ return this.bidiFlag; } @@ -153,4 +123,4 @@ + public int getColorCode(char character) { - return this.colorCode["0123456789abcdef".indexOf(character)]; + int i = "0123456789abcdef".indexOf(character); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiButton.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiButton.java.patch index ee9c091800..fa7fb1ca1e 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiButton.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/GuiButton.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java -@@ -21,6 +21,7 @@ +@@ -22,6 +22,7 @@ public boolean enabled; public boolean visible; protected boolean hovered; @@ -8,7 +8,7 @@ public GuiButton(int buttonId, int x, int y, String buttonText) { -@@ -74,6 +75,11 @@ +@@ -75,6 +76,11 @@ this.mouseDragged(mc, mouseX, mouseY); int j = 14737632; diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiChat.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiChat.java.patch deleted file mode 100644 index 56a8b7f493..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiChat.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java -@@ -215,13 +215,14 @@ - this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1); - } - -- this.inputField.writeText((String)this.foundPlayerNames.get(this.autocompleteIndex++)); -+ this.inputField.writeText(net.minecraft.util.EnumChatFormatting.getTextWithoutFormattingCodes((String)this.foundPlayerNames.get(this.autocompleteIndex++))); - } - - private void sendAutocompleteRequest(String p_146405_1_, String p_146405_2_) - { - if (p_146405_1_.length() >= 1) - { -+ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_); - BlockPos blockpos = null; - - if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) -@@ -281,6 +282,12 @@ - this.playerNamesFound = false; - this.foundPlayerNames.clear(); - -+ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; -+ if (complete != null) -+ { -+ p_146406_1_ = com.google.common.collect.ObjectArrays.concat(complete, p_146406_1_, String.class); -+ } -+ - for (String s : p_146406_1_) - { - if (s.length() > 0) -@@ -291,6 +298,7 @@ - - String s1 = this.inputField.getText().substring(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false)); - String s2 = StringUtils.getCommonPrefix(p_146406_1_); -+ s2 = net.minecraft.util.EnumChatFormatting.getTextWithoutFormattingCodes(s2); - - if (s2.length() > 0 && !s1.equalsIgnoreCase(s2)) - { diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch index a0dc53077d..714e647b52 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java -@@ -205,6 +205,8 @@ - } - } - -+ WorldType.worldTypes[this.selectedIndex].onGUICreateWorldPress(); -+ - WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.getByName(this.gameMode); - WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.field_146341_s, this.field_146337_w, WorldType.worldTypes[this.selectedIndex]); - worldsettings.setWorldName(this.chunkProviderSettingsJson); -@@ -312,14 +314,7 @@ +@@ -311,14 +311,7 @@ } else if (button.id == 8) { @@ -25,7 +16,7 @@ } } } -@@ -371,7 +366,7 @@ +@@ -370,7 +363,7 @@ this.btnBonusItems.visible = this.field_146344_y; this.btnMapType.visible = this.field_146344_y; this.btnAllowCommands.visible = this.field_146344_y; diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch index 264eb0ac2a..74df3b87b5 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java -@@ -223,7 +223,8 @@ +@@ -216,7 +216,8 @@ { this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format("menu.singleplayer", new Object[0]))); this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format("menu.multiplayer", new Object[0]))); @@ -10,7 +10,7 @@ } private void addDemoButtons(int p_73972_1_, int p_73972_2_) -@@ -271,6 +272,11 @@ +@@ -264,6 +265,11 @@ this.mc.shutdown(); } @@ -22,8 +22,8 @@ if (button.id == 11) { this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); -@@ -516,7 +522,16 @@ - s = s + " Demo"; +@@ -512,7 +518,16 @@ + s = s + ("release".equalsIgnoreCase(this.mc.func_184123_d()) ? "" : "/" + this.mc.func_184123_d()); } - this.drawString(this.fontRendererObj, s, 2, this.height - 10, -1); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch index e0dae1287d..92f2f908c6 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java -@@ -176,6 +176,9 @@ - long l = j - k; - List list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.getCpu()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)}); +@@ -108,6 +108,9 @@ + { + BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ); + list.add(""); + list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false)); + if (this.isReducedDebug()) { - return list; + return Lists.newArrayList(new String[] {"Minecraft 1.9 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")", this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), this.mc.renderGlobal.getDebugInfoEntities(), "P: " + this.mc.effectRenderer.getStatistics() + ". T: " + this.mc.theWorld.getDebugLoadedEntities(), this.mc.theWorld.getProviderName(), "", String.format("Chunk-relative: %d %d %d", new Object[]{Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15)})}); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiScreen.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiScreen.java.patch index 7503750725..302b4e3bb0 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiScreen.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/GuiScreen.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java -@@ -143,7 +143,8 @@ +@@ -141,7 +141,8 @@ } } @@ -10,7 +10,7 @@ } protected void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY) -@@ -153,6 +154,11 @@ +@@ -151,6 +152,11 @@ protected void drawHoveringText(List textLines, int x, int y) { @@ -22,7 +22,7 @@ if (!textLines.isEmpty()) { GlStateManager.disableRescaleNormal(); -@@ -163,7 +169,7 @@ +@@ -161,7 +167,7 @@ for (String s : textLines) { @@ -31,7 +31,7 @@ if (j > i) { -@@ -208,7 +214,7 @@ +@@ -206,7 +212,7 @@ for (int k1 = 0; k1 < textLines.size(); ++k1) { String s1 = (String)textLines.get(k1); @@ -40,7 +40,7 @@ if (k1 == 0) { -@@ -436,6 +442,7 @@ +@@ -421,6 +427,7 @@ { this.mc.ingameGUI.getChatGUI().addToSentMessages(msg); } @@ -48,7 +48,7 @@ this.mc.thePlayer.sendChatMessage(msg); } -@@ -450,9 +457,15 @@ +@@ -435,9 +442,15 @@ if (guibutton.mousePressed(this.mc, mouseX, mouseY)) { @@ -64,7 +64,7 @@ } } } -@@ -482,8 +495,12 @@ +@@ -467,8 +480,12 @@ this.fontRendererObj = mc.fontRendererObj; this.width = width; this.height = height; @@ -77,7 +77,7 @@ } public void func_183500_a(int p_183500_1_, int p_183500_2_) -@@ -502,7 +519,9 @@ +@@ -487,7 +504,9 @@ { while (Mouse.next()) { @@ -87,7 +87,7 @@ } } -@@ -510,7 +529,9 @@ +@@ -495,7 +514,9 @@ { while (Keyboard.next()) { @@ -97,7 +97,7 @@ } } } -@@ -570,6 +591,7 @@ +@@ -557,6 +578,7 @@ public void drawDefaultBackground() { this.drawWorldBackground(0); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch deleted file mode 100644 index 8327deb5fb..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiSelectWorld.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java -@@ -186,7 +186,7 @@ - - if (this.mc.getSaveLoader().canLoadWorld(s)) - { -- this.mc.launchIntegratedServer(s, s1, (WorldSettings)null); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1); - } - } - } diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiSlot.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiSlot.java.patch index f370344408..326e92388e 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiSlot.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/GuiSlot.java.patch @@ -1,24 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java -@@ -181,15 +181,8 @@ - GlStateManager.disableFog(); - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); -- this.mc.getTextureManager().bindTexture(Gui.optionsBackground); -- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); -- float f = 32.0F; -- worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); -- worldrenderer.pos((double)this.left, (double)this.bottom, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); -- worldrenderer.pos((double)this.right, (double)this.bottom, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); -- worldrenderer.pos((double)this.right, (double)this.top, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); -- worldrenderer.pos((double)this.left, (double)this.top, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); -- tessellator.draw(); -+ // Forge: background rendering moved into separate method. -+ this.drawContainerBackground(tessellator); - int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2; - int l = this.top + 4 - (int)this.amountScrolled; - -@@ -458,4 +451,18 @@ +@@ -458,4 +458,18 @@ { return this.slotHeight; } diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch deleted file mode 100644 index abc8964e46..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java -@@ -73,6 +73,7 @@ - s3 = s4; - } - -+ s3 = FontRenderer.getFormatFromString(s2) + s3; //Forge: Fix chat formatting not surviving line wrapping. - ChatComponentText chatcomponenttext2 = new ChatComponentText(s3); - chatcomponenttext2.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); - list1.add(j + 1, chatcomponenttext2); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch index eaedd5e00c..9a197d3925 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java +++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java @@ -82,7 +82,7 @@ - boolean flag1 = this.field_148301_e.version < 47; + boolean flag1 = this.field_148301_e.version < 107; boolean flag2 = flag || flag1; this.mc.fontRendererObj.drawString(this.field_148301_e.serverName, x + 32 + 3, y + 1, 16777215); - List list = this.mc.fontRendererObj.listFormattedStringToWidth(this.field_148301_e.serverMOTD, listWidth - 32 - 2); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch index 628bd5b875..391e1aa7c0 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch @@ -11,30 +11,15 @@ public GuiAchievements(GuiScreen parentScreenIn, StatFileWriter statFileWriterIn) { this.parentScreen = parentScreenIn; -@@ -57,6 +61,14 @@ - int j = 141; - this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - i / 2 - 12); - this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - j / 2); -+ minecraftAchievements.clear(); -+ for (Achievement achievement : AchievementList.achievementList) -+ { -+ if (!net.minecraftforge.common.AchievementPage.isAchievementInPages(achievement)) -+ { -+ minecraftAchievements.add(achievement); -+ } -+ } - } - - public void initGui() -@@ -64,6 +76,7 @@ - this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); +@@ -64,6 +68,7 @@ + this.mc.getNetHandler().addToSendQueue(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS)); this.buttonList.clear(); this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(button = new GuiButton(2, (width - field_146555_f) / 2 + 24, height / 2 + 74, 125, 20, net.minecraftforge.common.AchievementPage.getTitle(currentPage))); } protected void actionPerformed(GuiButton button) throws IOException -@@ -74,6 +87,16 @@ +@@ -74,6 +79,16 @@ { this.mc.displayGuiScreen(this.parentScreen); } @@ -51,7 +36,7 @@ } } -@@ -257,7 +280,9 @@ +@@ -257,7 +272,9 @@ GlStateManager.depthFunc(518); GlStateManager.pushMatrix(); GlStateManager.translate((float)i1, (float)j1, -200.0F); @@ -62,35 +47,7 @@ GlStateManager.enableTexture2D(); GlStateManager.disableLighting(); GlStateManager.enableRescaleNormal(); -@@ -331,11 +356,12 @@ - GlStateManager.depthFunc(515); - this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BACKGROUND); - -- for (int j5 = 0; j5 < AchievementList.achievementList.size(); ++j5) -+ java.util.List achievementList = (currentPage == -1 ? minecraftAchievements : net.minecraftforge.common.AchievementPage.getAchievementPage(currentPage).getAchievements()); -+ for (int j5 = 0; j5 < achievementList.size(); ++j5) - { -- Achievement achievement1 = (Achievement)AchievementList.achievementList.get(j5); -+ Achievement achievement1 = achievementList.get(j5); - -- if (achievement1.parentAchievement != null) -+ if (achievement1.parentAchievement != null && achievementList.contains(achievement1.parentAchievement)) - { - int k5 = achievement1.displayColumn * 24 - i + 11; - int l5 = achievement1.displayRow * 24 - j + 11; -@@ -389,9 +415,9 @@ - GlStateManager.enableRescaleNormal(); - GlStateManager.enableColorMaterial(); - -- for (int i6 = 0; i6 < AchievementList.achievementList.size(); ++i6) -+ for (int i6 = 0; i6 < achievementList.size(); ++i6) - { -- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(i6); -+ Achievement achievement2 = achievementList.get(i6); - int l6 = achievement2.displayColumn * 24 - i; - int j7 = achievement2.displayRow * 24 - j; - -@@ -432,6 +458,7 @@ +@@ -432,6 +449,7 @@ this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BACKGROUND); @@ -98,7 +55,7 @@ if (achievement2.getSpecial()) { this.drawTexturedModalRect(l6 - 2, j7 - 2, 26, 202, 26, 26); -@@ -440,6 +467,7 @@ +@@ -440,6 +458,7 @@ { this.drawTexturedModalRect(l6 - 2, j7 - 2, 0, 202, 26, 26); } @@ -106,7 +63,7 @@ if (!this.statFileWriter.canUnlockAchievement(achievement2)) { -@@ -448,7 +476,7 @@ +@@ -448,7 +467,7 @@ this.itemRender.func_175039_a(false); } @@ -114,4 +71,4 @@ + GlStateManager.disableLighting(); //Forge: Make sure Lighting is disabled. Fixes MC-33065 GlStateManager.enableCull(); this.itemRender.renderItemAndEffectIntoGUI(achievement2.theItemStack, l6 + 3, j7 + 3); - GlStateManager.blendFunc(770, 771); + GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch index 7cffb600f4..d120f752da 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch @@ -1,55 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiStats.java +++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiStats.java -@@ -5,6 +5,8 @@ - import java.util.Collections; - import java.util.Comparator; - import java.util.List; -+ -+import net.minecraft.block.Block; - import net.minecraft.client.Minecraft; - import net.minecraft.client.audio.PositionedSoundRecord; - import net.minecraft.client.gui.GuiButton; -@@ -443,17 +445,18 @@ - for (StatCrafting statcrafting : StatList.objectMineStats) - { - boolean flag = false; -- int i = Item.getIdFromItem(statcrafting.func_150959_a()); -+ int i = Block.getIdFromBlock(Block.getBlockFromItem(statcrafting.func_150959_a())); -+ int itemId = Item.getIdFromItem(statcrafting.func_150959_a()); - - if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) - { - flag = true; - } -- else if (StatList.objectUseStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[i]) > 0) -+ else if (StatList.objectUseStats[itemId] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[itemId]) > 0) - { - flag = true; - } -- else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[i]) > 0) -+ else if (StatList.objectCraftStats[itemId] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[itemId]) > 0) - { - flag = true; - } -@@ -468,8 +471,15 @@ - { - public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) - { -- int j = Item.getIdFromItem(p_compare_1_.func_150959_a()); -- int k = Item.getIdFromItem(p_compare_2_.func_150959_a()); -+ int j; -+ int k; -+ if (StatsBlock.this.field_148217_o == 2) { -+ j = Block.getIdFromBlock(Block.getBlockFromItem(p_compare_1_.func_150959_a())); -+ k = Block.getIdFromBlock(Block.getBlockFromItem(p_compare_2_.func_150959_a())); -+ } else { -+ j = Item.getIdFromItem(p_compare_1_.func_150959_a()); -+ k = Item.getIdFromItem(p_compare_2_.func_150959_a()); -+ } - StatBase statbase = null; - StatBase statbase1 = null; - -@@ -748,7 +758,7 @@ +@@ -877,7 +877,7 @@ super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4); this.setShowSelectionBox(false); @@ -58,12 +9,3 @@ { if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0) { -@@ -784,7 +794,7 @@ - protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) - { - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID); -- String s = I18n.format("entity." + EntityList.getStringFromID(entitylist$entityegginfo.spawnedID) + ".name", new Object[0]); -+ String s = I18n.format("entity." + entitylist$entityegginfo.name + ".name", new Object[0]); - int i = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d); - int j = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e); - String s1 = I18n.format("stat.entityKills", new Object[] {Integer.valueOf(i), s}); diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch index 2f5400a117..7e30615cfa 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java -@@ -175,8 +175,11 @@ +@@ -176,8 +176,11 @@ GlStateManager.translate(0.0F, 0.0F, 32.0F); this.zLevel = 200.0F; this.itemRender.zLevel = 200.0F; @@ -13,9 +13,9 @@ this.zLevel = 0.0F; this.itemRender.zLevel = 0.0F; } -@@ -239,13 +242,12 @@ +@@ -240,13 +243,12 @@ - if (itemstack == null) + if (itemstack == null && slotIn.canBeHovered()) { - String s1 = slotIn.getSlotTexture(); + TextureAtlasSprite textureatlassprite = slotIn.getBackgroundSprite(); @@ -30,7 +30,7 @@ this.drawTexturedModalRect(i, j, textureatlassprite, 16, 16); GlStateManager.enableLighting(); flag1 = true; -@@ -326,6 +328,7 @@ +@@ -327,6 +329,7 @@ int j = this.guiLeft; int k = this.guiTop; boolean flag1 = mouseX < j || mouseY < k || mouseX >= j + this.xSize || mouseY >= k + this.ySize; @@ -38,7 +38,7 @@ int l = -1; if (slot != null) -@@ -463,10 +466,12 @@ +@@ -464,10 +467,12 @@ protected void mouseReleased(int mouseX, int mouseY, int state) { @@ -51,7 +51,7 @@ int k = -1; if (slot != null) -@@ -685,4 +690,16 @@ +@@ -686,4 +691,16 @@ this.mc.thePlayer.closeScreen(); } } diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch index 9faeb7374d..b752bda1d5 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -@@ -48,6 +48,8 @@ +@@ -49,6 +49,8 @@ private Slot field_147064_C; private boolean field_147057_D; private CreativeCrafting field_147059_E; @@ -9,16 +9,7 @@ public GuiContainerCreative(EntityPlayer p_i1088_1_) { -@@ -175,7 +177,7 @@ - return; - } - -- if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2)) -+ if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2) && ItemStack.areItemStackTagsEqual(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770 - { - if (clickedButton == 0) - { -@@ -259,6 +261,13 @@ +@@ -258,6 +260,13 @@ this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]); this.field_147059_E = new CreativeCrafting(this.mc); this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_147059_E); @@ -32,7 +23,7 @@ } else { -@@ -280,7 +289,7 @@ +@@ -279,7 +288,7 @@ protected void keyTyped(char typedChar, int keyCode) throws IOException { @@ -41,7 +32,7 @@ { if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) { -@@ -318,6 +327,14 @@ +@@ -317,6 +326,14 @@ GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; guicontainercreative$containercreative.itemList.clear(); @@ -56,21 +47,7 @@ for (Item item : Item.itemRegistry) { if (item != null && item.getCreativeTab() != null) -@@ -325,7 +342,13 @@ - item.getSubItems(item, (CreativeTabs)null, guicontainercreative$containercreative.itemList); - } - } -+ updateFilteredItems(guicontainercreative$containercreative); -+ } - -+ //split from above for custom search tabs -+ private void updateFilteredItems(GuiContainerCreative.ContainerCreative guicontainercreative$containercreative) -+ { -+ if (CreativeTabs.creativeTabArray[selectedTabIndex] == CreativeTabs.tabAllSearch) // FORGE: Only add enchanted books to the regular search - for (Enchantment enchantment : Enchantment.enchantmentsBookList) - { - if (enchantment != null && enchantment.type != null) -@@ -333,7 +356,6 @@ +@@ -332,7 +349,6 @@ Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList); } } @@ -78,7 +55,7 @@ Iterator iterator = guicontainercreative$containercreative.itemList.iterator(); String s1 = this.searchField.getText().toLowerCase(); -@@ -365,7 +387,7 @@ +@@ -364,7 +380,7 @@ { CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; @@ -87,7 +64,7 @@ { GlStateManager.disableBlend(); this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752); -@@ -400,7 +422,7 @@ +@@ -399,7 +415,7 @@ for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) { @@ -96,7 +73,7 @@ { this.setCurrentCreativeTab(creativetabs); return; -@@ -413,11 +435,13 @@ +@@ -412,11 +428,13 @@ private boolean needsScrollBars() { @@ -110,7 +87,7 @@ int i = selectedTabIndex; selectedTabIndex = p_147050_1_.getTabIndex(); GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; -@@ -483,12 +507,14 @@ +@@ -487,12 +505,14 @@ if (this.searchField != null) { @@ -126,7 +103,7 @@ this.updateCreativeSearch(); } else -@@ -558,20 +584,43 @@ +@@ -562,20 +582,43 @@ } super.drawScreen(mouseX, mouseY, partialTicks); @@ -171,7 +148,7 @@ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableLighting(); } -@@ -633,16 +682,35 @@ +@@ -637,16 +680,35 @@ RenderHelper.enableGUIStandardItemLighting(); CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; @@ -208,7 +185,7 @@ this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName())); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); this.searchField.drawTextBox(); -@@ -657,6 +725,14 @@ +@@ -661,6 +723,14 @@ this.drawTexturedModalRect(i, j + (int)((float)(k - j - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); } @@ -223,7 +200,7 @@ this.func_147051_a(creativetabs); if (creativetabs == CreativeTabs.tabInventory) -@@ -667,6 +743,14 @@ +@@ -671,6 +741,14 @@ protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) { @@ -238,7 +215,7 @@ int i = p_147049_1_.getTabColumn(); int j = 28 * i; int k = 0; -@@ -763,6 +847,8 @@ +@@ -767,6 +845,8 @@ } GlStateManager.disableLighting(); @@ -247,7 +224,7 @@ this.drawTexturedModalRect(l, i1, j, k, 28, j1); this.zLevel = 100.0F; this.itemRender.zLevel = 100.0F; -@@ -789,6 +875,15 @@ +@@ -793,6 +873,15 @@ { this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); } diff --git a/patches.mcp/minecraft/net/minecraft/client/model/ModelBox.java.patch b/patches.mcp/minecraft/net/minecraft/client/model/ModelBox.java.patch index e3afbc8713..a1f4c6a456 100644 --- a/patches.mcp/minecraft/net/minecraft/client/model/ModelBox.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/model/ModelBox.java.patch @@ -8,11 +8,3 @@ public class ModelBox { private PositionTextureVertex[] vertexPositions; -@@ -81,6 +80,7 @@ - } - } - -+ @SideOnly(Side.CLIENT) - public void render(WorldRenderer renderer, float scale) - { - for (int i = 0; i < this.quadList.length; ++i) diff --git a/patches.mcp/minecraft/net/minecraft/client/model/ModelRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/model/ModelRenderer.java.patch index b67e508a85..5e9ccffa83 100644 --- a/patches.mcp/minecraft/net/minecraft/client/model/ModelRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/model/ModelRenderer.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java +++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java -@@ -10,7 +10,6 @@ +@@ -9,7 +9,6 @@ + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; - import org.lwjgl.opengl.GL11; -@SideOnly(Side.CLIENT) public class ModelRenderer { public float textureWidth; -@@ -109,6 +108,7 @@ +@@ -108,6 +107,7 @@ this.rotationPointZ = rotationPointZIn; } @@ -16,7 +16,7 @@ public void render(float p_78785_1_) { if (!this.isHidden) -@@ -190,6 +190,7 @@ +@@ -189,6 +189,7 @@ } } @@ -24,7 +24,7 @@ public void renderWithRotation(float p_78791_1_) { if (!this.isHidden) -@@ -225,6 +226,7 @@ +@@ -224,6 +225,7 @@ } } @@ -32,7 +32,7 @@ public void postRender(float scale) { if (!this.isHidden) -@@ -266,6 +268,7 @@ +@@ -265,6 +267,7 @@ } } diff --git a/patches.mcp/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch b/patches.mcp/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch deleted file mode 100644 index c3d2571d6f..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/model/PositionTextureVertex.java -+++ ../src-work/minecraft/net/minecraft/client/model/PositionTextureVertex.java -@@ -1,10 +1,7 @@ - package net.minecraft.client.model; - - import net.minecraft.util.Vec3; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --@SideOnly(Side.CLIENT) - public class PositionTextureVertex - { - public Vec3 vector3D; diff --git a/patches.mcp/minecraft/net/minecraft/client/model/TexturedQuad.java.patch b/patches.mcp/minecraft/net/minecraft/client/model/TexturedQuad.java.patch deleted file mode 100644 index 321941a6b1..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/model/TexturedQuad.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java -+++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java -@@ -4,10 +4,7 @@ - import net.minecraft.client.renderer.WorldRenderer; - import net.minecraft.client.renderer.vertex.DefaultVertexFormats; - import net.minecraft.util.Vec3; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --@SideOnly(Side.CLIENT) - public class TexturedQuad - { - public PositionTextureVertex[] vertexPositions; diff --git a/patches.mcp/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches.mcp/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch index dd87a5fddc..2fbae2903d 100644 --- a/patches.mcp/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java -@@ -55,6 +55,7 @@ +@@ -52,6 +52,7 @@ Chunk chunk = new Chunk(this.worldObj, p_73158_1_, p_73158_2_); this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), chunk); this.chunkListing.add(chunk); diff --git a/patches.mcp/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch b/patches.mcp/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch deleted file mode 100644 index d19712b436..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java -+++ ../src-work/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java -@@ -67,7 +67,7 @@ - inetaddress = InetAddress.getByName(ip); - GuiConnecting.this.networkManager = NetworkManager.func_181124_a(inetaddress, port, GuiConnecting.this.mc.gameSettings.func_181148_f()); - GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen)); -- GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN)); -+ GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN, true)); - GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile())); - } - catch (UnknownHostException unknownhostexception) diff --git a/patches.mcp/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches.mcp/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index 404b94ff21..258c41f477 100644 --- a/patches.mcp/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -1,33 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java -@@ -111,6 +111,12 @@ - } - } - -+ ItemStack stack = mc.thePlayer.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem() != null && stack.getItem().onBlockStartBreak(stack, pos, mc.thePlayer)) -+ { -+ return false; -+ } -+ - if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) - { - return false; -@@ -128,13 +134,7 @@ - else - { - world.playAuxSFX(2001, pos, Block.getStateId(iblockstate)); -- boolean flag = world.setBlockToAir(pos); - -- if (flag) -- { -- block1.onBlockDestroyedByPlayer(world, pos, iblockstate); -- } -- - this.currentBlock = new BlockPos(this.currentBlock.getX(), -1, this.currentBlock.getZ()); - - if (!this.currentGameType.isCreative()) -@@ -152,6 +152,12 @@ +@@ -167,6 +167,12 @@ } } @@ -40,48 +13,3 @@ return flag; } } -@@ -356,11 +362,19 @@ - { - if (this.currentGameType != WorldSettings.GameType.SPECTATOR) - { -+ -+ if (heldStack != null && -+ heldStack.getItem() != null && -+ heldStack.getItem().onItemUseFirst(heldStack, player, worldIn, hitPos, side, f, f1, f2)) -+ { -+ return true; -+ } -+ - IBlockState iblockstate = worldIn.getBlockState(hitPos); - -- if ((!player.isSneaking() || player.getHeldItem() == null) && iblockstate.getBlock().onBlockActivated(worldIn, hitPos, iblockstate, player, side, f, f1, f2)) -+ if ((!player.isSneaking() || player.getHeldItem() == null || player.getHeldItem().getItem().doesSneakBypassUse(worldIn, hitPos, player))) - { -- flag = true; -+ flag = iblockstate.getBlock().onBlockActivated(worldIn, hitPos, iblockstate, player, side, f, f1, f2); - } - - if (!flag && heldStack != null && heldStack.getItem() instanceof ItemBlock) -@@ -393,7 +407,9 @@ - } - else - { -- return heldStack.onItemUse(player, worldIn, hitPos, side, f, f1, f2); -+ if (!heldStack.onItemUse(player, worldIn, hitPos, side, f, f1, f2)) return false; -+ if (heldStack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(player, heldStack); -+ return true; - } - } - else -@@ -420,9 +436,10 @@ - { - playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack; - -- if (itemstack.stackSize == 0) -+ if (itemstack.stackSize <= 0) - { - playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null; -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(playerIn, itemstack); - } - - return true; diff --git a/patches.mcp/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches.mcp/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch index a0e81d0547..2d73af7075 100644 --- a/patches.mcp/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java -@@ -52,12 +52,13 @@ - super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_5_, true); +@@ -63,12 +63,13 @@ + this.field_184157_a = Sets.newHashSet(); this.sendQueue = p_i45063_1_; this.getWorldInfo().setDifficulty(p_i45063_4_); - this.setSpawnPoint(new BlockPos(8, 64, 8)); diff --git a/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch b/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch index 2c10876e58..2aff2e5ca0 100644 --- a/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java +++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java -@@ -104,7 +104,10 @@ +@@ -106,7 +106,10 @@ { this.gameProfile = packetIn.getProfile(); this.networkManager.setConnectionState(EnumConnectionState.PLAY); @@ -11,4 +11,4 @@ + net.minecraftforge.fml.client.FMLClientHandler.instance().setPlayClient(nhpc); } - public void onDisconnect(IChatComponent reason) + public void onDisconnect(ITextComponent reason) diff --git a/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index 601a6a7967..131b84df66 100644 --- a/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java +++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java -@@ -246,7 +246,7 @@ +@@ -267,7 +267,7 @@ { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); this.gameController.playerController = new PlayerControllerMP(this.gameController, this); @@ -9,8 +9,8 @@ this.gameController.gameSettings.difficulty = packetIn.getDifficulty(); this.gameController.loadWorld(this.clientWorldController); this.gameController.thePlayer.dimension = packetIn.getDimension(); -@@ -750,14 +750,16 @@ - public void handleChat(S02PacketChat packetIn) +@@ -785,14 +785,16 @@ + public void handleChat(SPacketChat packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(packetIn.getType(), packetIn.getChatComponent()); @@ -28,21 +28,9 @@ } } -@@ -808,6 +810,11 @@ - float f = (float)(packetIn.getYaw() * 360) / 256.0F; - float f1 = (float)(packetIn.getPitch() * 360) / 256.0F; - EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld); -+ if (entitylivingbase == null) -+ { -+ net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", packetIn.getEntityType(), d0, d1, d2); -+ return; -+ } - entitylivingbase.serverPosX = packetIn.getX(); - entitylivingbase.serverPosY = packetIn.getY(); - entitylivingbase.serverPosZ = packetIn.getZ(); -@@ -1133,6 +1140,10 @@ +@@ -1082,6 +1084,10 @@ { - tileentity.readFromNBT(packetIn.getNbtCompound()); + entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e()); } + else + { @@ -51,12 +39,3 @@ } } -@@ -1341,7 +1352,7 @@ - - if (entity instanceof EntityLivingBase) - { -- PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f()); -+ PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId() & 0xff, packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f()); - potioneffect.setPotionDurationMax(packetIn.func_149429_c()); - ((EntityLivingBase)entity).addPotionEffect(potioneffect); - } diff --git a/patches.mcp/minecraft/net/minecraft/client/network/OldServerPinger.java.patch b/patches.mcp/minecraft/net/minecraft/client/network/OldServerPinger.java.patch deleted file mode 100644 index 5631206e36..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/network/OldServerPinger.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java -+++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java -@@ -150,6 +150,7 @@ - server.setBase64EncodedIconData((String)null); - } - -+ net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(server, serverstatusresponse); - this.field_175092_e = Minecraft.getSystemTime(); - networkmanager.sendPacket(new C01PacketPing(this.field_175092_e)); - this.field_147403_d = true; diff --git a/patches.mcp/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch index 2cb6442033..6aca35860d 100644 --- a/patches.mcp/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch @@ -1,23 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java +++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java -@@ -133,6 +133,7 @@ - - public void addEffect(EntityFX effect) - { -+ if (effect == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs. - int i = effect.getFXLayer(); - int j = effect.getAlpha() != 1.0F ? 0 : 1; - -@@ -351,7 +352,7 @@ - - public void addBlockDestroyEffects(BlockPos pos, IBlockState state) - { -- if (state.getBlock().getMaterial() != Material.air) -+ if (!state.getBlock().isAir(worldObj, pos) && !state.getBlock().addDestroyEffects(worldObj, pos, this)) - { - state = state.getBlock().getActualState(state, this.worldObj, pos); - int i = 4; -@@ -457,4 +458,13 @@ +@@ -460,4 +460,13 @@ return "" + i; } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch deleted file mode 100644 index 39f2cb1698..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java -@@ -533,8 +533,19 @@ - @SideOnly(Side.CLIENT) - public static enum EnumNeighborInfo - { -- DOWN(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.5F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), -- UP(new EnumFacing[]{EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH}, 1.0F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), -+ // -- Forge Patch to Fix Top/Bottom Lighting Interpolation -- -+ // Forge PR - https://github.com/MinecraftForge/MinecraftForge/pull/1892 -+ // Mojang Bug - https://bugs.mojang.com/browse/MC-80148 -+ DOWN( new EnumFacing[]{ EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH }, 0.5F, true, -+ new Orientation[]{ Orientation.FLIP_WEST, Orientation.SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.SOUTH }, -+ new Orientation[]{ Orientation.FLIP_WEST, Orientation.NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.FLIP_EAST, Orientation.NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.FLIP_EAST, Orientation.SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.SOUTH } ), -+ UP( new EnumFacing[]{ EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH }, 1.0F, true, -+ new Orientation[]{ Orientation.EAST, Orientation.SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.SOUTH }, -+ new Orientation[]{ Orientation.EAST, Orientation.NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.WEST, Orientation.NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.NORTH }, -+ new Orientation[]{ Orientation.WEST, Orientation.SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.SOUTH } ), - NORTH(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.WEST}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST}), - SOUTH(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST}), - WEST(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH}), diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch index af6ec831d7..6ff9d53b7f 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelShapes.java +++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelShapes.java -@@ -309,5 +309,6 @@ +@@ -307,5 +307,6 @@ return new ModelResourceLocation(s + "_double_slab", s1); } }); diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch deleted file mode 100644 index fe9f2c0563..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java -@@ -24,7 +24,7 @@ - { - private BlockModelShapes blockModelShapes; - private final GameSettings gameSettings; -- private final BlockModelRenderer blockModelRenderer = new BlockModelRenderer(); -+ private final BlockModelRenderer blockModelRenderer = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(); - private final ChestRenderer chestRenderer = new ChestRenderer(); - private final BlockFluidRenderer fluidRenderer = new BlockFluidRenderer(); - -@@ -48,6 +48,24 @@ - { - state = block.getActualState(state, blockAccess, pos); - IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state); -+ -+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) -+ { -+ IBlockState extendedState = block.getExtendedState(state, blockAccess, pos); -+ for ( net.minecraft.util.EnumWorldBlockLayer layer : net.minecraft.util.EnumWorldBlockLayer.values() ) -+ { -+ if ( block.canRenderInLayer( layer ) ) -+ { -+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(layer); -+ -+ IBakedModel targetLayer = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState); -+ IBakedModel damageModel = (new SimpleBakedModel.Builder(targetLayer, texture)).makeBakedModel(); -+ this.blockModelRenderer.renderModel(blockAccess, damageModel, state, pos, Tessellator.getInstance().getWorldRenderer()); -+ } -+ } -+ return; -+ } -+ - IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, texture)).makeBakedModel(); - this.blockModelRenderer.renderModel(blockAccess, ibakedmodel1, state, pos, Tessellator.getInstance().getWorldRenderer()); - } -@@ -128,6 +146,12 @@ - ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(pos)); - } - -+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) -+ { -+ IBlockState extendedState = block.getExtendedState(state, worldIn, pos); -+ ibakedmodel = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState); -+ } -+ - return ibakedmodel; - } - diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 7b5b273156..acb32c3587 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java -@@ -200,6 +200,7 @@ +@@ -207,6 +207,7 @@ { this.loadShader(new ResourceLocation("shaders/post/invert.json")); } @@ -8,16 +8,7 @@ } } -@@ -419,7 +420,7 @@ - - if (d3 < d2 || d2 == 0.0D) - { -- if (entity1 == entity.ridingEntity) -+ if (entity1 == entity.ridingEntity && !entity.canRiderInteract()) - { - if (d2 == 0.0D) - { -@@ -512,7 +513,7 @@ +@@ -491,7 +492,7 @@ f = f * 60.0F / 70.0F; } @@ -26,23 +17,7 @@ } } -@@ -576,14 +577,8 @@ - { - BlockPos blockpos = new BlockPos(entity); - IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos); -- Block block = iblockstate.getBlock(); -+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.mc.theWorld, blockpos, iblockstate, entity); - -- if (block == Blocks.bed) -- { -- int j = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); -- GlStateManager.rotate((float)(j * 90), 0.0F, 1.0F, 0.0F); -- } -- - GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F); - GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F); - } -@@ -650,17 +645,20 @@ +@@ -629,17 +630,20 @@ if (!this.mc.gameSettings.debugCamEnable) { @@ -70,7 +45,7 @@ } GlStateManager.translate(0.0F, -f, 0.0F); -@@ -1103,7 +1101,7 @@ +@@ -1092,7 +1096,7 @@ try { @@ -79,7 +54,7 @@ } catch (Throwable throwable) { -@@ -1164,7 +1162,7 @@ +@@ -1187,7 +1191,7 @@ if (this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.SPECTATOR) { @@ -88,7 +63,7 @@ } else { -@@ -1314,7 +1312,9 @@ +@@ -1312,7 +1316,9 @@ GlStateManager.pushMatrix(); RenderHelper.enableStandardItemLighting(); this.mc.mcProfiler.endStartSection("entities"); @@ -97,40 +72,8 @@ + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); RenderHelper.disableStandardItemLighting(); this.disableLightmap(); - GlStateManager.matrixMode(5888); -@@ -1326,6 +1326,7 @@ - EntityPlayer entityplayer = (EntityPlayer)entity; - GlStateManager.disableAlpha(); - this.mc.mcProfiler.endStartSection("outline"); -+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.getHeldItem(), partialTicks)) - renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks); - GlStateManager.enableAlpha(); - } -@@ -1339,6 +1340,7 @@ - EntityPlayer entityplayer1 = (EntityPlayer)entity; - GlStateManager.disableAlpha(); - this.mc.mcProfiler.endStartSection("outline"); -+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, mc.objectMouseOver, 0, entityplayer1.getHeldItem(), partialTicks)) - renderglobal.drawSelectionBox(entityplayer1, this.mc.objectMouseOver, 0, partialTicks); - GlStateManager.enableAlpha(); } -@@ -1380,6 +1382,15 @@ - GlStateManager.shadeModel(7425); - this.mc.mcProfiler.endStartSection("translucent"); - renderglobal.renderBlockLayer(EnumWorldBlockLayer.TRANSLUCENT, (double)partialTicks, pass, entity); -+ if (!this.debugView) //Only render if render pass 0 happens as well. -+ { -+ RenderHelper.enableStandardItemLighting(); -+ this.mc.mcProfiler.endStartSection("entities"); -+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1); -+ renderglobal.renderEntities(entity, icamera, partialTicks); -+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1); -+ RenderHelper.disableStandardItemLighting(); -+ } - GlStateManager.shadeModel(7424); - GlStateManager.depthMask(true); - GlStateManager.enableCull(); -@@ -1392,8 +1403,12 @@ +@@ -1378,8 +1384,12 @@ this.renderCloudsCheck(renderglobal, partialTicks, pass); } @@ -143,7 +86,7 @@ if (this.renderHand) { GlStateManager.clear(256); -@@ -1505,6 +1520,13 @@ +@@ -1490,6 +1500,13 @@ protected void renderRainSnow(float partialTicks) { @@ -157,7 +100,7 @@ float f = this.mc.theWorld.getRainStrength(partialTicks); if (f > 0.0F) -@@ -1830,6 +1852,13 @@ +@@ -1820,6 +1837,13 @@ this.fogColorBlue = f7; } @@ -171,18 +114,7 @@ GlStateManager.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); } -@@ -1848,6 +1877,10 @@ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); - -+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, partialTicks, 0.1F); -+ if (hook >= 0) -+ GlStateManager.setFogDensity(hook); -+ else - if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(Potion.blindness)) - { - float f1 = 5.0F; -@@ -1925,6 +1958,7 @@ +@@ -1915,6 +1939,7 @@ GlStateManager.setFogStart(f * 0.05F); GlStateManager.setFogEnd(Math.min(f, 192.0F) * 0.5F); } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch index d6f61cabd4..db8cbd4b78 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java -@@ -27,7 +27,12 @@ +@@ -28,7 +28,12 @@ protected void updateActivePotionEffects() { @@ -14,15 +14,7 @@ { this.guiLeft = 160 + (this.width - this.xSize - 200) / 2; this.hasActivePotionEffects = true; -@@ -70,6 +75,7 @@ - for (PotionEffect potioneffect : this.mc.thePlayer.getActivePotionEffects()) - { - Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; -+ if(!potion.shouldRender(potioneffect)) continue; - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(inventoryBackground); - this.drawTexturedModalRect(i, j, 0, 166, 140, 32); -@@ -80,6 +86,8 @@ +@@ -81,6 +86,8 @@ this.drawTexturedModalRect(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18); } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index 4d51db24c7..208eda40c1 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java -@@ -313,7 +313,7 @@ - - if (this.itemToRender != null) - { -- if (this.itemToRender.getItem() == Items.filled_map) -+ if (this.itemToRender.getItem() instanceof net.minecraft.item.ItemMap) - { - this.renderItemMap(abstractclientplayer, f2, f, f1); - } -@@ -365,6 +365,7 @@ +@@ -444,6 +444,7 @@ if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) { IBlockState iblockstate = this.mc.theWorld.getBlockState(new BlockPos(this.mc.thePlayer)); @@ -17,21 +8,7 @@ EntityPlayer entityplayer = this.mc.thePlayer; for (int i = 0; i < 8; ++i) -@@ -378,11 +379,13 @@ - if (iblockstate1.getBlock().isVisuallyOpaque()) - { - iblockstate = iblockstate1; -+ overlayPos = blockpos; - } - } - - if (iblockstate.getBlock().getRenderType() != -1) - { -+ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(mc.thePlayer, partialTicks, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos)) - this.func_178108_a(partialTicks, this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(iblockstate)); - } - } -@@ -391,11 +394,13 @@ +@@ -470,11 +471,13 @@ { if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { @@ -45,16 +22,3 @@ this.renderFireInFirstPerson(partialTicks); } } -@@ -512,6 +517,12 @@ - { - if (!this.itemToRender.getIsItemStackEqual(itemstack)) - { -+ if (!this.itemToRender.getItem().shouldCauseReequipAnimation(this.itemToRender, itemstack, equippedItemSlot != entityplayer.inventory.currentItem)) -+ { -+ this.itemToRender = itemstack; -+ this.equippedItemSlot = entityplayer.inventory.currentItem; -+ return; -+ } - flag = true; - } - } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch index ae77f90371..4dddb26481 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java -@@ -83,6 +83,10 @@ +@@ -92,6 +92,10 @@ public static int GL_ARRAY_BUFFER; public static int GL_STATIC_DRAW; @@ -11,7 +11,7 @@ public static void initializeTextures() { ContextCapabilities contextcapabilities = GLContext.getCapabilities(); -@@ -843,6 +847,12 @@ +@@ -852,6 +856,12 @@ { GL13.glMultiTexCoord2f(target, p_77475_1_, p_77475_2_); } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index 2b7737d4bb..887b5b0cb1 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches.mcp/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 -@@ -525,8 +525,10 @@ +@@ -547,8 +547,10 @@ public void renderEntities(Entity renderViewEntity, ICamera camera, float partialTicks) { @@ -11,7 +11,7 @@ --this.renderEntitiesStartupCounter; } else -@@ -537,9 +539,12 @@ +@@ -559,9 +561,12 @@ this.theWorld.theProfiler.startSection("prepare"); TileEntityRendererDispatcher.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRendererObj, this.mc.getRenderViewEntity(), partialTicks); this.renderManager.cacheActiveRenderInfo(this.theWorld, this.mc.fontRendererObj, this.mc.getRenderViewEntity(), this.mc.pointedEntity, this.mc.gameSettings, partialTicks); @@ -24,7 +24,7 @@ Entity entity = this.mc.getRenderViewEntity(); double d3 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; double d4 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; -@@ -551,11 +556,15 @@ +@@ -573,11 +578,15 @@ this.mc.entityRenderer.enableLightmap(); this.theWorld.theProfiler.endStartSection("global"); List list = this.theWorld.getLoadedEntityList(); @@ -40,39 +40,23 @@ ++this.countEntitiesRendered; if (entity1.isInRangeToRender3d(d0, d1, d2)) -@@ -577,6 +586,7 @@ - for (int j = 0; j < list.size(); ++j) - { - Entity entity3 = (Entity)list.get(j); -+ if (!entity3.shouldRenderInPass(pass)) continue; - boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping(); - boolean flag1 = entity3.isInRangeToRender3d(d0, d1, d2) && (entity3.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(entity3.getEntityBoundingBox()) || entity3.riddenByEntity == this.mc.thePlayer) && entity3 instanceof EntityPlayer; - -@@ -626,6 +636,7 @@ - } - - entity2 = (Entity)iterator.next(); -+ if (!entity2.shouldRenderInPass(pass)) continue; - flag2 = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.riddenByEntity == this.mc.thePlayer; - - if (!flag2) -@@ -654,6 +665,7 @@ +@@ -672,6 +681,7 @@ this.theWorld.theProfiler.endStartSection("blockentities"); RenderHelper.enableStandardItemLighting(); + TileEntityRendererDispatcher.instance.preDrawBatch(); for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.renderInfos) { - List list1 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk().getTileEntities(); -@@ -662,6 +674,7 @@ + List list3 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk().getTileEntities(); +@@ -680,6 +690,7 @@ { - for (TileEntity tileentity2 : list1) + for (TileEntity tileentity2 : list3) { + if (!tileentity2.shouldRenderInPass(pass) || !camera.isBoundingBoxInFrustum(tileentity2.getRenderBoundingBox())) continue; TileEntityRendererDispatcher.instance.renderTileEntity(tileentity2, partialTicks, -1); } } -@@ -671,9 +684,11 @@ +@@ -689,9 +700,11 @@ { for (TileEntity tileentity : this.setTileEntities) { @@ -84,7 +68,7 @@ this.preRenderDamagedBlocks(); -@@ -700,7 +715,7 @@ +@@ -718,7 +731,7 @@ Block block = this.theWorld.getBlockState(blockpos).getBlock(); @@ -93,20 +77,7 @@ { TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, destroyblockprogress.getPartialBlockDamage()); } -@@ -1161,6 +1176,12 @@ - - public void renderSky(float partialTicks, int pass) - { -+ net.minecraftforge.client.IRenderHandler renderer = this.theWorld.provider.getSkyRenderer(); -+ if (renderer != null) -+ { -+ renderer.render(partialTicks, theWorld, mc); -+ return; -+ } - if (this.mc.theWorld.provider.getDimensionId() == 1) - { - this.renderSkyEnd(); -@@ -1378,6 +1399,12 @@ +@@ -1427,6 +1440,12 @@ public void renderClouds(float partialTicks, int pass) { @@ -119,7 +90,7 @@ if (this.mc.theWorld.provider.isSurfaceWorld()) { if (this.mc.gameSettings.func_181147_e() == 2) -@@ -1793,8 +1820,11 @@ +@@ -1854,8 +1873,11 @@ double d4 = (double)blockpos.getY() - d1; double d5 = (double)blockpos.getZ() - d2; Block block = this.theWorld.getBlockState(blockpos).getBlock(); @@ -132,21 +103,3 @@ { if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) { -@@ -1949,13 +1979,16 @@ - if (recordName != null) - { - ItemRecord itemrecord = ItemRecord.getRecord(recordName); -+ ResourceLocation resource = null; - - if (itemrecord != null) - { - this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); -+ resource = itemrecord.getRecordResource(recordName); - } - -- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.create(new ResourceLocation(recordName), (float)blockPosIn.getX(), (float)blockPosIn.getY(), (float)blockPosIn.getZ()); -+ if (resource == null) resource = new ResourceLocation(recordName); -+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.create(resource, (float)blockPosIn.getX(), (float)blockPosIn.getY(), (float)blockPosIn.getZ()); - this.mapSoundPositions.put(blockPosIn, positionedsoundrecord); - this.mc.getSoundHandler().playSound(positionedsoundrecord); - } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch deleted file mode 100644 index 112e541b52..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java -@@ -506,15 +506,15 @@ - break; - case USHORT: - case SHORT: -- this.byteBuffer.putShort(i, (short)((int)p_181663_1_ * 32767 & 65535)); -- this.byteBuffer.putShort(i + 2, (short)((int)p_181663_2_ * 32767 & 65535)); -- this.byteBuffer.putShort(i + 4, (short)((int)p_181663_3_ * 32767 & 65535)); -+ this.byteBuffer.putShort(i, (short)((int)(p_181663_1_ * 32767) & 65535)); -+ this.byteBuffer.putShort(i + 2, (short)((int)(p_181663_2_ * 32767) & 65535)); -+ this.byteBuffer.putShort(i + 4, (short)((int)(p_181663_3_ * 32767) & 65535)); - break; - case UBYTE: - case BYTE: -- this.byteBuffer.put(i, (byte)((int)p_181663_1_ * 127 & 255)); -- this.byteBuffer.put(i + 1, (byte)((int)p_181663_2_ * 127 & 255)); -- this.byteBuffer.put(i + 2, (byte)((int)p_181663_3_ * 127 & 255)); -+ this.byteBuffer.put(i, (byte)((int)(p_181663_1_ * 127) & 255)); -+ this.byteBuffer.put(i + 1, (byte)((int)(p_181663_2_ * 127) & 255)); -+ this.byteBuffer.put(i + 2, (byte)((int)(p_181663_3_ * 127) & 255)); - } - - this.nextVertexFormatIndex(); -@@ -578,6 +578,16 @@ - } - } - -+ public void checkAndGrow() -+ { -+ this.growBuffer(vertexFormat.getNextOffset()/* / 4 * 4 */); -+ } -+ -+ public boolean isColorDisabled() -+ { -+ return noColor; -+ } -+ - @SideOnly(Side.CLIENT) - public class State - { diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch deleted file mode 100644 index 2551f52b99..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java -@@ -23,32 +23,9 @@ - - for (int j = 0; j < list.size(); ++j) - { -+ // moved to VertexFormatElement.preDraw - VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j); -- VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage(); -- int k = vertexformatelement.getType().getGlConstant(); -- int l = vertexformatelement.getIndex(); -- bytebuffer.position(vertexformat.func_181720_d(j)); -- -- switch (vertexformatelement$enumusage) -- { -- case POSITION: -- GL11.glVertexPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); -- break; -- case UV: -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + l); -- GL11.glTexCoordPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); -- break; -- case COLOR: -- GL11.glColorPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); -- break; -- case NORMAL: -- GL11.glNormalPointer(k, i, bytebuffer); -- GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); -- } -+ vertexformatelement.getUsage().preDraw(vertexformat, j, i, bytebuffer); - } - - GL11.glDrawArrays(p_181679_1_.getDrawMode(), 0, p_181679_1_.getVertexCount()); -@@ -57,26 +34,8 @@ - for (int j1 = list.size(); i1 < j1; ++i1) - { - VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1); -- VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.getUsage(); -- int k1 = vertexformatelement1.getIndex(); -- -- switch (vertexformatelement$enumusage1) -- { -- case POSITION: -- GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); -- break; -- case UV: -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + k1); -- GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); -- break; -- case COLOR: -- GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); -- GlStateManager.resetColor(); -- break; -- case NORMAL: -- GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); -- } -+ // moved to VertexFormatElement.postDraw -+ vertexformatelement1.getUsage().postDraw(vertexformat, i1, i, bytebuffer); - } - } - diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch index 97dc4cd38c..2c9e531fee 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java -@@ -5,8 +5,9 @@ +@@ -6,8 +6,9 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch deleted file mode 100644 index b9543da5ae..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java -@@ -20,6 +20,11 @@ - - public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) - { -+ return makeBakedQuad(posFrom, posTo, face, sprite, facing, (net.minecraftforge.client.model.ITransformation)modelRotationIn, partRotation, uvLocked, shade); -+ } -+ -+ public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) -+ { - int[] aint = this.makeQuadVertexData(face, sprite, facing, this.getPositionsDiv16(posFrom, posTo), modelRotationIn, partRotation, uvLocked, shade); - EnumFacing enumfacing = getFacingFromVertexData(aint); - -@@ -33,11 +38,17 @@ - this.func_178408_a(aint, enumfacing); - } - -+ net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing); - return new BakedQuad(aint, face.tintIndex, enumfacing); - } - - private int[] makeQuadVertexData(BlockPartFace partFace, TextureAtlasSprite sprite, EnumFacing facing, float[] p_178405_4_, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) - { -+ return makeQuadVertexData(partFace, sprite, facing, p_178405_4_, modelRotationIn, partRotation, uvLocked, shade); -+ } -+ -+ private int[] makeQuadVertexData(BlockPartFace partFace, TextureAtlasSprite sprite, EnumFacing facing, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) -+ { - int[] aint = new int[28]; - - for (int i = 0; i < 4; ++i) -@@ -88,7 +99,12 @@ - - private void fillVertexData(int[] faceData, int vertexIndex, EnumFacing facing, BlockPartFace partFace, float[] p_178402_5_, TextureAtlasSprite sprite, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) - { -- EnumFacing enumfacing = modelRotationIn.rotateFace(facing); -+ fillVertexData(faceData, vertexIndex, facing, partFace, p_178402_5_, sprite, modelRotationIn, partRotation, uvLocked, shade); -+ } -+ -+ private void fillVertexData(int[] faceData, int vertexIndex, EnumFacing facing, BlockPartFace partFace, float[] p_178402_5_, TextureAtlasSprite sprite, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) -+ { -+ EnumFacing enumfacing = modelRotationIn.rotate(facing); - int i = shade ? this.getFaceShadeColor(enumfacing) : -1; - EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(facing).func_179025_a(vertexIndex); - Vector3f vector3f = new Vector3f(p_178402_5_[enumfacedirection$vertexinformation.field_179184_a], p_178402_5_[enumfacedirection$vertexinformation.field_179182_b], p_178402_5_[enumfacedirection$vertexinformation.field_179183_c]); -@@ -154,14 +170,19 @@ - - public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, ModelRotation modelRotationIn, boolean uvLocked) - { -+ return rotateVertex(position, facing, vertexIndex, modelRotationIn, uvLocked); -+ } -+ -+ public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) -+ { - if (modelRotationIn == ModelRotation.X0_Y0) - { - return vertexIndex; - } - else - { -- this.rotateScale(position, new Vector3f(0.5F, 0.5F, 0.5F), modelRotationIn.getMatrix4d(), new Vector3f(1.0F, 1.0F, 1.0F)); -- return modelRotationIn.rotateVertex(facing, vertexIndex); -+ net.minecraftforge.client.ForgeHooksClient.transform(position, modelRotationIn.getMatrix()); -+ return modelRotationIn.rotate(facing, vertexIndex); - } - } - diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch index a953b5c380..fd1bef036c 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java -@@ -10,7 +10,11 @@ - import net.minecraftforge.fml.relauncher.Side; +@@ -12,7 +12,11 @@ import net.minecraftforge.fml.relauncher.SideOnly; + import org.lwjgl.util.vector.Quaternion; +/* + * @deprecated use {@link net.minecraftforge.client.model.IPerspectiveAwareModel} instead @@ -12,7 +12,7 @@ public class ItemCameraTransforms { public static final ItemCameraTransforms DEFAULT = new ItemCameraTransforms(); -@@ -117,7 +121,7 @@ +@@ -169,7 +173,7 @@ } @SideOnly(Side.CLIENT) @@ -20,4 +20,4 @@ + public static enum TransformType implements net.minecraftforge.client.model.IModelPart { NONE, - THIRD_PERSON, + THIRD_PERSON_LEFT_HAND, diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch index f336ff667c..5b8ebe4cd1 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java -@@ -29,7 +29,7 @@ +@@ -31,7 +31,7 @@ public static ModelBlockDefinition parseFromReader(Reader p_178331_0_) { @@ -8,22 +8,4 @@ + return net.minecraftforge.client.model.BlockStateLoader.load(p_178331_0_, GSON); } - public ModelBlockDefinition(Collection p_i46221_1_) -@@ -155,11 +155,17 @@ - return this.modelLocation; - } - -+ @Deprecated - public ModelRotation getRotation() - { - return this.modelRotation; - } - -+ public net.minecraftforge.client.model.IModelState getState() -+ { -+ return this.modelRotation; -+ } -+ - public boolean isUvLocked() - { - return this.uvLock; + public ModelBlockDefinition(Map p_i46572_1_, Multipart p_i46572_2_) diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch deleted file mode 100644 index 649bea3448..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java -@@ -38,7 +38,7 @@ - } - else - { -- s = ((IProperty)this.name).getName((Comparable)map.remove(this.name)); -+ s = String.format("%s:%s", ((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock())).getResourceDomain(), ((IProperty)this.name).getName((Comparable)map.remove(this.name))); - } - - if (this.suffix != null) diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch index 521b0958b6..33082d5943 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java +++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java -@@ -131,7 +131,9 @@ +@@ -133,7 +133,9 @@ return; } @@ -11,7 +11,7 @@ generator.setCompiledChunk(compiledchunk); } finally -@@ -158,7 +160,7 @@ +@@ -160,7 +162,7 @@ lvt_10_1_.func_178606_a(blockpos$mutableblockpos); } @@ -20,27 +20,16 @@ { TileEntity tileentity = iblockaccess.getTileEntity(new BlockPos(blockpos$mutableblockpos)); TileEntitySpecialRenderer tileentityspecialrenderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(tileentity); -@@ -174,7 +176,9 @@ - } - } +@@ -191,6 +193,7 @@ -- EnumWorldBlockLayer enumworldblocklayer1 = block.getBlockLayer(); -+ for(EnumWorldBlockLayer enumworldblocklayer1 : EnumWorldBlockLayer.values()) { -+ if(!block.canRenderInLayer(enumworldblocklayer1)) continue; -+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(enumworldblocklayer1); - int j = enumworldblocklayer1.ordinal(); - - if (block.getRenderType() != -1) -@@ -189,6 +193,7 @@ - - aboolean[j] |= blockrendererdispatcher.renderBlock(iblockstate, blockpos$mutableblockpos, iblockaccess, worldrenderer); + aboolean[j] |= blockrendererdispatcher.renderBlock(iblockstate, blockpos$mutableblockpos, iblockaccess, vertexbuffer); } + } } - for (EnumWorldBlockLayer enumworldblocklayer : EnumWorldBlockLayer.values()) -@@ -385,6 +390,26 @@ - return this.needsUpdate; + for (BlockRenderLayer blockrenderlayer : BlockRenderLayer.values()) +@@ -413,6 +416,26 @@ + return this.needsUpdate && this.field_188284_q; } + /* ======================================== FORGE START =====================================*/ diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch index 4aea0952a7..a7d80ed880 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java -@@ -41,7 +41,7 @@ +@@ -44,7 +44,7 @@ boolean flag = p_177077_9_.isGui3d(); int i = this.func_177078_a(itemstack); float f = 0.25F; @@ -9,44 +9,7 @@ float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y; GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); -@@ -110,7 +110,6 @@ - - for (int j = 0; j < i; ++j) - { -- if (ibakedmodel.isGui3d()) - { - GlStateManager.pushMatrix(); - -@@ -119,25 +118,15 @@ - float f = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; - float f1 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; - float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; -- GlStateManager.translate(f, f1, f2); -+ GlStateManager.translate(shouldSpreadItems() ? f : 0.0F, shouldSpreadItems() ? f1 : 0.0F, f2); - } - -+ if (ibakedmodel.isGui3d()) - GlStateManager.scale(0.5F, 0.5F, 0.5F); -- ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GROUND); -+ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND); - this.itemRenderer.renderItem(itemstack, ibakedmodel); - GlStateManager.popMatrix(); - } -- else -- { -- GlStateManager.pushMatrix(); -- ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GROUND); -- this.itemRenderer.renderItem(itemstack, ibakedmodel); -- GlStateManager.popMatrix(); -- float f3 = ibakedmodel.getItemCameraTransforms().ground.scale.x; -- float f4 = ibakedmodel.getItemCameraTransforms().ground.scale.y; -- float f5 = ibakedmodel.getItemCameraTransforms().ground.scale.z; -- GlStateManager.translate(0.0F * f3, 0.0F * f4, 0.046875F * f5); -- } - } - - GlStateManager.popMatrix(); -@@ -157,4 +146,25 @@ +@@ -192,4 +192,25 @@ { return TextureMap.locationBlocksTexture; } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch deleted file mode 100644 index 4a76f02129..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java -@@ -72,7 +72,7 @@ - public RenderItem(TextureManager textureManager, ModelManager modelManager) - { - this.textureManager = textureManager; -- this.itemModelMesher = new ItemModelMesher(modelManager); -+ this.itemModelMesher = new net.minecraftforge.client.ItemModelMesherForge(modelManager); - this.registerItems(); - } - -@@ -226,7 +226,7 @@ - k = k | -16777216; - } - -- this.renderQuad(renderer, bakedquad, k); -+ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k); - } - } - -@@ -296,6 +296,11 @@ - modelresourcelocation = new ModelResourceLocation("bow_pulling_0", "inventory"); - } - } -+ else -+ { -+ // TODO: maybe switch to the smart player model / normal smart item model? -+ modelresourcelocation = item.getModel(stack, entityplayer, entityplayer.getItemInUseCount()); -+ } - - if (modelresourcelocation != null) - { -@@ -317,14 +322,9 @@ - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GlStateManager.pushMatrix(); -- ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms(); -- itemcameratransforms.applyTransform(cameraTransformType); -+ // TODO: check if negative scale is a thing -+ model = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(model, cameraTransformType); - -- if (this.func_183005_a(itemcameratransforms.getTransform(cameraTransformType))) -- { -- GlStateManager.cullFace(1028); -- } -- - this.renderItem(stack, model); - GlStateManager.cullFace(1029); - GlStateManager.popMatrix(); -@@ -352,7 +352,7 @@ - GlStateManager.blendFunc(770, 771); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.setupGuiTransform(x, y, ibakedmodel.isGui3d()); -- ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI); -+ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GUI); - this.renderItem(stack, ibakedmodel); - GlStateManager.disableAlpha(); - GlStateManager.disableRescaleNormal(); -@@ -459,10 +459,11 @@ - GlStateManager.enableDepth(); - } - -- if (stack.isItemDamaged()) -+ if (stack.getItem().showDurabilityBar(stack)) - { -- int j = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage()); -- int i = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage()); -+ double health = stack.getItem().getDurabilityForDisplay(stack); -+ int j = (int)Math.round(13.0D - health * 13.0D); -+ int i = (int)Math.round(255.0D - health * 255.0D); - GlStateManager.disableLighting(); - GlStateManager.disableDepth(); - GlStateManager.disableTexture2D(); -@@ -473,7 +474,7 @@ - this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); - this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - i) / 4, 64, 0, 255); - this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, j, 1, 255 - i, i, 0, 255); -- GlStateManager.enableBlend(); -+ //GlStateManager.enableBlend(); // Forge: Disable Blend because it screws with a lot of things down the line. - GlStateManager.enableAlpha(); - GlStateManager.enableTexture2D(); - GlStateManager.enableLighting(); -@@ -1038,6 +1039,7 @@ - this.registerBlock(Blocks.brown_mushroom_block, BlockHugeMushroom.EnumType.ALL_INSIDE.getMetadata(), "brown_mushroom_block"); - this.registerBlock(Blocks.red_mushroom_block, BlockHugeMushroom.EnumType.ALL_INSIDE.getMetadata(), "red_mushroom_block"); - this.registerBlock(Blocks.dragon_egg, "dragon_egg"); -+ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.itemModelMesher); - } - - public void onResourceManagerReload(IResourceManager resourceManager) diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch index d075ecd19f..a0f8a7aeaf 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches.mcp/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 -@@ -192,7 +192,12 @@ +@@ -204,7 +204,12 @@ this.playerRenderer = new RenderPlayer(this); this.skinMap.put("default", this.playerRenderer); this.skinMap.put("slim", new RenderPlayer(this, true)); @@ -13,15 +13,3 @@ public void setRenderPosition(double renderPosXIn, double renderPosYIn, double renderPosZIn) { -@@ -241,9 +246,9 @@ - IBlockState iblockstate = worldIn.getBlockState(new BlockPos(livingPlayerIn)); - Block block = iblockstate.getBlock(); - -- if (block == Blocks.bed) -+ if (block.isBed(worldIn, new BlockPos(livingPlayerIn), (EntityLivingBase)livingPlayerIn)) - { -- int i = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); -+ int i = block.getBedDirection(worldIn, new BlockPos(livingPlayerIn)).getHorizontalIndex(); - this.playerViewY = (float)(i * 90 + 180); - this.playerViewX = 0.0F; - } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch index 9e48e16214..77c0de3c6f 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java -@@ -49,6 +49,7 @@ +@@ -55,6 +55,7 @@ public void doRender(AbstractClientPlayer entity, double x, double y, double z, float entityYaw, float partialTicks) { @@ -8,9 +8,9 @@ if (!entity.isUser() || this.renderManager.livingPlayer == entity) { double d0 = y; -@@ -61,6 +62,7 @@ - this.setModelVisibilities(entity); +@@ -69,6 +70,7 @@ super.doRender(entity, x, d0, z, entityYaw, partialTicks); + GlStateManager.func_187440_b(GlStateManager.Profile.PLAYER_SKIN); } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(entity, this, partialTicks, x, y, z)); } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch deleted file mode 100644 index 22636f0721..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java -@@ -38,6 +38,9 @@ - protected List> layerRenderers = Lists.>newArrayList(); - protected boolean renderOutlines = false; - -+ public static float NAME_TAG_RANGE = 64.0f; -+ public static float NAME_TAG_RANGE_SNEAK = 32.0f; -+ - public RendererLivingEntity(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) - { - super(renderManagerIn); -@@ -83,10 +86,12 @@ - - public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) - { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(entity, this, x, y, z))) return; - GlStateManager.pushMatrix(); - GlStateManager.disableCull(); - this.mainModel.swingProgress = this.getSwingProgress(entity, partialTicks); -- this.mainModel.isRiding = entity.isRiding(); -+ boolean shouldSit = entity.isRiding() && (entity.ridingEntity != null && entity.ridingEntity.shouldRiderSit()); -+ this.mainModel.isRiding = shouldSit; - this.mainModel.isChild = entity.isChild(); - - try -@@ -95,7 +100,7 @@ - float f1 = this.interpolateRotation(entity.prevRotationYawHead, entity.rotationYawHead, partialTicks); - float f2 = f1 - f; - -- if (entity.isRiding() && entity.ridingEntity instanceof EntityLivingBase) -+ if (shouldSit && entity.ridingEntity instanceof EntityLivingBase) - { - EntityLivingBase entitylivingbase = (EntityLivingBase)entity.ridingEntity; - f = this.interpolateRotation(entitylivingbase.prevRenderYawOffset, entitylivingbase.renderYawOffset, partialTicks); -@@ -191,6 +196,7 @@ - { - super.doRender(entity, x, y, z, entityYaw, partialTicks); - } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(entity, this, x, y, z)); - } - - protected boolean setScoreTeamColor(T entityLivingBaseIn) -@@ -469,10 +475,11 @@ - - public void renderName(T entity, double x, double y, double z) - { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(entity, this, x, y, z))) return; - if (this.canRenderName(entity)) - { - double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer); -- float f = entity.isSneaking() ? 32.0F : 64.0F; -+ float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; - - if (d0 < (double)(f * f)) - { -@@ -518,6 +525,7 @@ - } - } - } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(entity, this, x, y, z)); - } - - protected boolean canRenderName(T entity) diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch index d499c73f25..9f01b1daa7 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch @@ -1,47 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java -@@ -55,29 +55,28 @@ - T t = this.func_177175_a(armorSlot); - t.setModelAttributes(this.renderer.getMainModel()); - t.setLivingAnimations(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_4_); -+ t = getArmorModelHook(entitylivingbaseIn, itemstack, armorSlot, t); - this.func_177179_a(t, armorSlot); - boolean flag = this.isSlotForLeggings(armorSlot); -- this.renderer.bindTexture(this.getArmorResource(itemarmor, flag)); -+ this.renderer.bindTexture(this.getArmorResource(entitylivingbaseIn, itemstack, flag ? 2 : 1, null)); - -- switch (itemarmor.getArmorMaterial()) -- { -- case LEATHER: - int i = itemarmor.getColor(itemstack); -+ { -+ if (i != -1) // Allow this for anything, not only cloth. -+ { - float f = (float)(i >> 16 & 255) / 255.0F; - float f1 = (float)(i >> 8 & 255) / 255.0F; - float f2 = (float)(i & 255) / 255.0F; - GlStateManager.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha); - t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); -- this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, "overlay")); -- case CHAIN: -- case IRON: -- case GOLD: -- case DIAMOND: -+ this.renderer.bindTexture(this.getArmorResource(entitylivingbaseIn, itemstack, flag ? 2 : 1, "overlay")); -+ } -+ { // Non-colored - GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha); - t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); -- default: -- -- if (!this.field_177193_i && itemstack.isItemEnchanted()) -+ } -+ // Default -+ if (!this.field_177193_i && itemstack.hasEffect()) - { - this.func_177183_a(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, p_177182_4_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); - } -@@ -135,11 +134,13 @@ +@@ -140,11 +140,13 @@ GlStateManager.disableBlend(); } @@ -55,53 +14,3 @@ private ResourceLocation getArmorResource(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) { String s = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {p_177178_1_.getArmorMaterial().getName(), Integer.valueOf(p_177178_2_ ? 2 : 1), p_177178_3_ == null ? "" : String.format("_%s", new Object[]{p_177178_3_})}); -@@ -157,4 +158,49 @@ - protected abstract void initArmor(); - - protected abstract void func_177179_a(T p_177179_1_, int p_177179_2_); -+ -+ /*=================================== FORGE START =========================================*/ -+ -+ /** -+ * Hook to allow item-sensitive armor model. for LayerBipedArmor. -+ */ -+ protected T getArmorModelHook(EntityLivingBase entity, ItemStack itemStack, int slot, T model) -+ { -+ return model; -+ } -+ -+ /** -+ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide. -+ * -+ * @param entity Entity wearing the armor -+ * @param stack ItemStack for the armor -+ * @param slot Slot ID that the item is in -+ * @param type Subtype, can be null or "overlay" -+ * @return ResourceLocation pointing at the armor's texture -+ */ -+ public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, int slot, String type) -+ { -+ ItemArmor item = (ItemArmor)stack.getItem(); -+ String texture = item.getArmorMaterial().getName(); -+ String domain = "minecraft"; -+ int idx = texture.indexOf(':'); -+ if (idx != -1) -+ { -+ domain = texture.substring(0, idx); -+ texture = texture.substring(idx + 1); -+ } -+ String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); -+ -+ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type); -+ ResourceLocation resourcelocation = (ResourceLocation)ARMOR_TEXTURE_RES_MAP.get(s1); -+ -+ if (resourcelocation == null) -+ { -+ resourcelocation = new ResourceLocation(s1); -+ ARMOR_TEXTURE_RES_MAP.put(s1, resourcelocation); -+ } -+ -+ return resourcelocation; -+ } -+ /*=================================== FORGE END ===========================================*/ - } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch index 50001b7701..9990cb44ad 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java -@@ -49,4 +49,10 @@ +@@ -51,4 +51,10 @@ { p_177194_1_.setInvisible(false); } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch index fdbf34c9e6..93f14a3cb3 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java -@@ -58,12 +58,17 @@ +@@ -56,12 +56,17 @@ { Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()]); Arrays.sort((Object[])astitcher$holder); @@ -18,15 +18,15 @@ throw new StitcherException(stitcher$holder, s); } } -@@ -73,6 +78,7 @@ - this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); - this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); +@@ -182,6 +187,7 @@ + this.stitchSlots.add(stitcher$slot); + return true; } + net.minecraftforge.fml.common.ProgressManager.pop(bar); } - public List getStichSlots() -@@ -260,7 +266,7 @@ + @SideOnly(Side.CLIENT) +@@ -238,7 +244,7 @@ public String toString() { diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch index fb734bf696..8ca6b9f2f3 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java -@@ -402,4 +402,30 @@ +@@ -398,4 +398,30 @@ { return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch index a731967169..e0a4f35e60 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java -@@ -28,6 +28,7 @@ +@@ -26,6 +26,7 @@ @SideOnly(Side.CLIENT) public class TextureMap extends AbstractTexture implements ITickableTextureObject { @@ -8,7 +8,7 @@ private static final Logger logger = LogManager.getLogger(); public static final ResourceLocation LOCATION_MISSING_TEXTURE = new ResourceLocation("missingno"); public static final ResourceLocation locationBlocksTexture = new ResourceLocation("textures/atlas/blocks.png"); -@@ -38,6 +39,7 @@ +@@ -36,6 +37,7 @@ private final IIconCreator iconCreator; private int mipmapLevels; private final TextureAtlasSprite missingImage; @@ -16,7 +16,7 @@ public TextureMap(String p_i46099_1_) { -@@ -46,12 +48,23 @@ +@@ -44,12 +46,23 @@ public TextureMap(String p_i46100_1_, IIconCreator iconCreatorIn) { @@ -40,73 +40,7 @@ } private void initMissingImage() -@@ -90,12 +103,28 @@ - int j = Integer.MAX_VALUE; - int k = 1 << this.mipmapLevels; - -+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this); -+ net.minecraftforge.fml.common.FMLLog.info("Max texture size: %d", i); -+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", skipFirst ? 0 : this.mapRegisteredSprites.size()); -+ -+ if(!skipFirst) - for (Entry entry : this.mapRegisteredSprites.entrySet()) - { - TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue(); - ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.getIconName()); - ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation, 0); -+ bar.step(resourcelocation1.getResourcePath()); - -+ if (textureatlassprite.hasCustomLoader(resourceManager, resourcelocation)) -+ { -+ if (!textureatlassprite.load(resourceManager, resourcelocation)) -+ { -+ j = Math.min(j, Math.min(textureatlassprite.getIconWidth(), textureatlassprite.getIconHeight())); -+ stitcher.addSprite(textureatlassprite); -+ } -+ continue; -+ } -+ - try - { - IResource iresource = resourceManager.getResource(resourcelocation1); -@@ -145,12 +174,14 @@ - } - catch (RuntimeException runtimeexception) - { -- logger.error((String)("Unable to parse metadata from " + resourcelocation1), (Throwable)runtimeexception); -+ //logger.error((String)("Unable to parse metadata from " + resourcelocation1), (Throwable)runtimeexception); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation1, runtimeexception.getMessage()); - continue; - } - catch (IOException ioexception1) - { -- logger.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); -+ //logger.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1); - continue; - } - -@@ -166,6 +197,7 @@ - stitcher.addSprite(textureatlassprite); - } - -+ net.minecraftforge.fml.common.ProgressManager.pop(bar); - int j1 = Math.min(j, k); - int k1 = MathHelper.calculateLogBaseTwo(j1); - -@@ -175,8 +207,11 @@ - this.mipmapLevels = k1; - } - -+ bar = net.minecraftforge.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.mapRegisteredSprites.size()); - for (final TextureAtlasSprite textureatlassprite1 : this.mapRegisteredSprites.values()) - { -+ if (skipFirst) break; -+ bar.step(textureatlassprite1.getIconName()); - try - { - textureatlassprite1.generateMipmaps(this.mipmapLevels); -@@ -213,9 +248,13 @@ +@@ -139,9 +152,13 @@ this.missingImage.generateMipmaps(this.mipmapLevels); stitcher.addSprite(this.missingImage); @@ -120,21 +54,9 @@ stitcher.doStitch(); } catch (StitcherException stitcherexception) -@@ -224,9 +263,11 @@ - } - - logger.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.getCurrentWidth()), Integer.valueOf(stitcher.getCurrentHeight()), this.basePath}); -+ bar.step("Allocating GL texture"); - TextureUtil.allocateTextureImpl(this.getGlTextureId(), this.mipmapLevels, stitcher.getCurrentWidth(), stitcher.getCurrentHeight()); - Map map = Maps.newHashMap(this.mapRegisteredSprites); - -+ bar.step("Uploading GL texture"); - for (TextureAtlasSprite textureatlassprite2 : stitcher.getStichSlots()) - { - String s = textureatlassprite2.getIconName(); -@@ -256,6 +297,13 @@ - { - textureatlassprite3.copyFrom(this.missingImage); +@@ -253,6 +270,13 @@ + crashreportcategory.addCrashSection("Mipmap levels", Integer.valueOf(this.mipmapLevels)); + throw new ReportedException(crashreport); } + + net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this); @@ -145,8 +67,8 @@ + net.minecraftforge.fml.common.ProgressManager.pop(bar); } - private ResourceLocation completeResourceLocation(ResourceLocation location, int p_147634_2_) -@@ -319,4 +367,37 @@ + private ResourceLocation func_184396_a(TextureAtlasSprite p_184396_1_) +@@ -317,4 +341,37 @@ { return this.missingImage; } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch index d067a7ffb1..b561d5a3df 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java -@@ -197,9 +197,11 @@ +@@ -202,9 +202,11 @@ public static void allocateTextureImpl(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_) { @@ -12,4 +12,4 @@ + } if (p_180600_1_ >= 0) { - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_180600_1_); + GlStateManager.func_187421_b(3553, 33085, p_180600_1_); diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch index 2ffb2ffa54..0b6520ff84 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java -@@ -99,15 +99,18 @@ +@@ -105,15 +105,18 @@ GlStateManager.disableLighting(); int i = itemFrame.getRotation(); @@ -21,9 +21,9 @@ this.renderManager.renderEngine.bindTexture(mapBackgroundTextures); GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); float f = 0.0078125F; -@@ -165,6 +168,7 @@ - textureatlassprite.updateAnimation(); - } +@@ -142,6 +145,7 @@ + RenderHelper.disableStandardItemLighting(); + GlStateManager.popAttrib(); } + } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch index 709342ac46..bd351608ec 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java -@@ -78,6 +78,7 @@ +@@ -98,6 +98,7 @@ { TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F); } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch index 1f47f6fb49..0f22cecab2 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch @@ -1,21 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java -@@ -102,11 +102,14 @@ - { - if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared()) - { -+ if(!tileentityIn.hasFastRenderer()) -+ { - int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0); - int j = i % 65536; - int k = i / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); -+ } - BlockPos blockpos = tileentityIn.getPos(); - this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage); - } -@@ -125,6 +128,11 @@ +@@ -129,6 +129,11 @@ { try { @@ -27,7 +12,7 @@ tileentityspecialrenderer.renderTileEntityAt(tileEntityIn, x, y, z, partialTicks, destroyStage); } catch (Throwable throwable) -@@ -146,4 +154,49 @@ +@@ -155,4 +160,49 @@ { return this.fontRenderer; } diff --git a/patches.mcp/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch b/patches.mcp/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch index 3c23434d3e..89b1adcad7 100644 --- a/patches.mcp/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/resources/FallbackResourceManager.java +++ ../src-work/minecraft/net/minecraft/client/resources/FallbackResourceManager.java -@@ -67,6 +67,7 @@ +@@ -68,6 +68,7 @@ throw new FileNotFoundException(location.toString()); } diff --git a/patches.mcp/minecraft/net/minecraft/client/resources/LanguageManager.java.patch b/patches.mcp/minecraft/net/minecraft/client/resources/LanguageManager.java.patch deleted file mode 100644 index fa44d5f1b7..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/resources/LanguageManager.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/LanguageManager.java -+++ ../src-work/minecraft/net/minecraft/client/resources/LanguageManager.java -@@ -73,6 +73,7 @@ - } - - currentLocale.loadLocaleDataFiles(resourceManager, list); -+ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(currentLocale.properties, this.currentLanguage); - StringTranslate.replaceWith(currentLocale.properties); - } - diff --git a/patches.mcp/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch b/patches.mcp/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch deleted file mode 100644 index 327276eb4b..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/IBakedModel.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/IBakedModel.java -@@ -23,5 +23,6 @@ - - TextureAtlasSprite getParticleTexture(); - -+ @Deprecated - ItemCameraTransforms getItemCameraTransforms(); - } diff --git a/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch b/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch deleted file mode 100644 index cdc15c69cd..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch +++ /dev/null @@ -1,124 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/ModelBakery.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/ModelBakery.java -@@ -114,7 +114,7 @@ - } - catch (Exception var6) - { -- LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation); -+ LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation, var6); - } - } - catch (Exception exception) -@@ -294,6 +294,7 @@ - - protected void registerVariantNames() - { -+ this.variantNames.clear(); //FML clear this to prevent double ups. - this.variantNames.put(Item.getItemFromBlock(Blocks.stone), Lists.newArrayList(new String[] {"stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.dirt), Lists.newArrayList(new String[] {"dirt", "coarse_dirt", "podzol"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.planks), Lists.newArrayList(new String[] {"oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"})); -@@ -336,6 +337,10 @@ - this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence_gate), Lists.newArrayList(new String[] {"oak_fence_gate"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence), Lists.newArrayList(new String[] {"oak_fence"})); - this.variantNames.put(Items.oak_door, Lists.newArrayList(new String[] {"oak_door"})); -+ for (Entry, Set> e : customVariantNames.entrySet()) -+ { -+ this.variantNames.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); -+ } - } - - protected List getVariantNames(Item p_177596_1_) -@@ -352,7 +357,7 @@ - - protected ResourceLocation getItemLocation(String p_177583_1_) - { -- ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_); -+ ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", "")); - return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath()); - } - -@@ -395,7 +400,7 @@ - for (Entry entry : this.itemLocations.entrySet()) - { - ResourceLocation resourcelocation = (ResourceLocation)entry.getValue(); -- ModelResourceLocation modelresourcelocation1 = new ModelResourceLocation((String)entry.getKey(), "inventory"); -+ ModelResourceLocation modelresourcelocation1 = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey()); - ModelBlock modelblock1 = (ModelBlock)this.models.get(resourcelocation); - - if (modelblock1 != null && modelblock1.isResolved()) -@@ -453,6 +458,11 @@ - - private IBakedModel bakeModel(ModelBlock modelBlockIn, ModelRotation modelRotationIn, boolean uvLocked) - { -+ return bakeModel(modelBlockIn, (net.minecraftforge.client.model.ITransformation)modelRotationIn, uvLocked); -+ } -+ -+ protected IBakedModel bakeModel(ModelBlock modelBlockIn, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) -+ { - TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName("particle"))); - SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(modelBlockIn)).setTexture(textureatlassprite); - -@@ -463,13 +473,13 @@ - BlockPartFace blockpartface = (BlockPartFace)blockpart.mapFaces.get(enumfacing); - TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName(blockpartface.texture))); - -- if (blockpartface.cullFace == null) -+ if (blockpartface.cullFace == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(modelRotationIn.getMatrix())) - { - simplebakedmodel$builder.addGeneralQuad(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); - } - else - { -- simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotateFace(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); -+ simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotate(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); - } - } - } -@@ -479,6 +489,11 @@ - - private BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_) - { -+ return makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, (net.minecraftforge.client.model.ITransformation)p_177589_5_, p_177589_6_); -+ } -+ -+ protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, net.minecraftforge.client.model.ITransformation p_177589_5_, boolean p_177589_6_) -+ { - return this.faceBakery.makeBakedQuad(p_177589_1_.positionFrom, p_177589_1_.positionTo, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.partRotation, p_177589_6_, p_177589_1_.shade); - } - -@@ -722,4 +737,35 @@ - MODEL_CLOCK.name = "class generation marker"; - MODEL_ENTITY.name = "block entity marker"; - } -+ -+ /*********************************************************** -+ * FML Start -+ ***********************************************************/ -+ private static Map, Set> customVariantNames = Maps.newHashMap(); -+ /** -+ * @deprecated use registerItemVariants -+ */ -+ @Deprecated -+ public static void addVariantName(Item item, String... names) -+ { -+ if (customVariantNames.containsKey(item.delegate)) -+ customVariantNames.get(item.delegate).addAll(Lists.newArrayList(names)); -+ else -+ customVariantNames.put(item.delegate, Sets.newHashSet(names)); -+ } -+ -+ public static void registerItemVariants(Item item, T... names) -+ { -+ if (!customVariantNames.containsKey(item.delegate)) -+ { -+ customVariantNames.put(item.delegate, Sets.newHashSet()); -+ } -+ for(ResourceLocation name : names) -+ { -+ customVariantNames.get(item.delegate).add(name.toString()); -+ } -+ } -+ /*********************************************************** -+ * FML End -+ ***********************************************************/ - } diff --git a/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch b/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch deleted file mode 100644 index 62b6e2b6ee..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/ModelManager.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/ModelManager.java -@@ -24,9 +24,10 @@ - - public void onResourceManagerReload(IResourceManager resourceManager) - { -- ModelBakery modelbakery = new ModelBakery(resourceManager, this.texMap, this.modelProvider); -+ ModelBakery modelbakery = new net.minecraftforge.client.model.ModelLoader(resourceManager, this.texMap, this.modelProvider); - this.modelRegistry = modelbakery.setupModelRegistry(); - this.defaultModel = (IBakedModel)this.modelRegistry.getObject(ModelBakery.MODEL_MISSING); -+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.modelRegistry, modelbakery); - this.modelProvider.reloadModels(); - } - diff --git a/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch b/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch deleted file mode 100644 index c3643e8c62..0000000000 --- a/patches.mcp/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/resources/model/ModelRotation.java -+++ ../src-work/minecraft/net/minecraft/client/resources/model/ModelRotation.java -@@ -10,7 +10,7 @@ - import org.lwjgl.util.vector.Vector3f; - - @SideOnly(Side.CLIENT) --public enum ModelRotation -+public enum ModelRotation implements net.minecraftforge.client.model.IModelState, net.minecraftforge.client.model.ITransformation - { - X0_Y0(0, 0), - X0_Y90(0, 90), -@@ -116,4 +116,9 @@ - mapRotations.put(Integer.valueOf(modelrotation.combinedXY), modelrotation); - } - } -+ -+ public com.google.common.base.Optional apply(com.google.common.base.Optional part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(getMatrix(), part); } -+ public javax.vecmath.Matrix4f getMatrix() { return net.minecraftforge.client.ForgeHooksClient.getMatrix(this); } -+ public EnumFacing rotate(EnumFacing facing) { return rotateFace(facing); } -+ public int rotate(EnumFacing facing, int vertexIndex) { return rotateVertex(facing, vertexIndex); } - } diff --git a/patches.mcp/minecraft/net/minecraft/client/settings/GameSettings.java.patch b/patches.mcp/minecraft/net/minecraft/client/settings/GameSettings.java.patch index 10da977f0c..df746d5ea9 100644 --- a/patches.mcp/minecraft/net/minecraft/client/settings/GameSettings.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/settings/GameSettings.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/settings/GameSettings.java +++ ../src-work/minecraft/net/minecraft/client/settings/GameSettings.java -@@ -994,6 +994,7 @@ +@@ -887,6 +887,7 @@ public void saveOptions() { diff --git a/patches.mcp/minecraft/net/minecraft/client/shader/Framebuffer.java.patch b/patches.mcp/minecraft/net/minecraft/client/shader/Framebuffer.java.patch index ec5e56034d..a32bd143cb 100644 --- a/patches.mcp/minecraft/net/minecraft/client/shader/Framebuffer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/shader/Framebuffer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/shader/Framebuffer.java +++ ../src-work/minecraft/net/minecraft/client/shader/Framebuffer.java -@@ -119,8 +119,17 @@ +@@ -118,8 +118,17 @@ if (this.useDepth) { OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer); @@ -18,7 +18,7 @@ } this.framebufferClear(); -@@ -280,4 +289,36 @@ +@@ -279,4 +288,36 @@ GlStateManager.clear(i); this.unbindFramebuffer(); } diff --git a/patches.mcp/minecraft/net/minecraft/command/CommandBase.java.patch b/patches.mcp/minecraft/net/minecraft/command/CommandBase.java.patch index 5355ef914b..008a1bb217 100644 --- a/patches.mcp/minecraft/net/minecraft/command/CommandBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/command/CommandBase.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/command/CommandBase.java +++ ../src-work/minecraft/net/minecraft/command/CommandBase.java -@@ -329,7 +329,7 @@ - ichatcomponent.appendText(" "); +@@ -369,7 +369,7 @@ + itextcomponent.appendText(" "); } -- IChatComponent ichatcomponent1 = new ChatComponentText(args[i]); -+ IChatComponent ichatcomponent1 = net.minecraftforge.common.ForgeHooks.newChatWithLinks(args[i]); // Forge: links for messages +- ITextComponent itextcomponent1 = new TextComponentString(args[i]); ++ ITextComponent itextcomponent1 = net.minecraftforge.common.ForgeHooks.newChatWithLinks(args[i]); // Forge: links for messages if (p_147176_3_) { diff --git a/patches.mcp/minecraft/net/minecraft/command/CommandEnchant.java.patch b/patches.mcp/minecraft/net/minecraft/command/CommandEnchant.java.patch index 630385eaab..20f6093fd5 100644 --- a/patches.mcp/minecraft/net/minecraft/command/CommandEnchant.java.patch +++ b/patches.mcp/minecraft/net/minecraft/command/CommandEnchant.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/command/CommandEnchant.java +++ ../src-work/minecraft/net/minecraft/command/CommandEnchant.java -@@ -93,7 +93,7 @@ +@@ -85,7 +85,7 @@ { - Enchantment enchantment2 = Enchantment.getEnchantmentById(l); + Enchantment enchantment1 = Enchantment.func_185262_c(k); -- if (!enchantment2.canApplyTogether(enchantment1)) -+ if (!enchantment2.canApplyTogether(enchantment1) || !enchantment1.canApplyTogether(enchantment2)) //Forge BugFix: Let Both enchantments veto being together +- if (!enchantment.canApplyTogether(enchantment1)) ++ if (!enchantment.canApplyTogether(enchantment1) || !enchantment1.canApplyTogether(enchantment)) //Forge BugFix: Let Both enchantments veto being together { - throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment1.getTranslatedName(j), enchantment2.getTranslatedName(nbttaglist.getCompoundTagAt(k).getShort("lvl"))}); + throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment.getTranslatedName(i), enchantment1.getTranslatedName(nbttaglist.getCompoundTagAt(j).getShort("lvl"))}); } diff --git a/patches.mcp/minecraft/net/minecraft/command/CommandFill.java.patch b/patches.mcp/minecraft/net/minecraft/command/CommandFill.java.patch index 777a3d0617..94ffd1431c 100644 --- a/patches.mcp/minecraft/net/minecraft/command/CommandFill.java.patch +++ b/patches.mcp/minecraft/net/minecraft/command/CommandFill.java.patch @@ -1,28 +1,28 @@ --- ../src-base/minecraft/net/minecraft/command/CommandFill.java +++ ../src-work/minecraft/net/minecraft/command/CommandFill.java -@@ -48,6 +48,7 @@ +@@ -50,6 +50,7 @@ { - i = parseInt(args[7], 0, 15); + i = parseInt(p_184881_3_[7], 0, 15); } + IBlockState state = block.getStateFromMeta(i); BlockPos blockpos2 = new BlockPos(Math.min(blockpos.getX(), blockpos1.getX()), Math.min(blockpos.getY(), blockpos1.getY()), Math.min(blockpos.getZ(), blockpos1.getZ())); BlockPos blockpos3 = new BlockPos(Math.max(blockpos.getX(), blockpos1.getX()), Math.max(blockpos.getY(), blockpos1.getY()), Math.max(blockpos.getZ(), blockpos1.getZ())); -@@ -75,7 +76,7 @@ +@@ -77,7 +78,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (args.length >= 10 && block.hasTileEntity()) -+ if (args.length >= 10 && block.hasTileEntity(state)) +- if (p_184881_3_.length >= 10 && block.hasTileEntity()) ++ if (p_184881_3_.length >= 10 && block.hasTileEntity(state)) { - String s = getChatComponentFromNthArg(sender, args, 9).getUnformattedText(); + String s = getChatComponentFromNthArg(p_184881_2_, p_184881_3_, 9).getUnformattedText(); -@@ -116,7 +117,7 @@ +@@ -118,7 +119,7 @@ continue; } } -- else if (args[8].equals("replace") && !block.hasTileEntity()) -+ else if (args[8].equals("replace") && !block.hasTileEntity(state)) +- else if (p_184881_3_[8].equals("replace") && !block.hasTileEntity()) ++ else if (p_184881_3_[8].equals("replace") && !block.hasTileEntity(state)) { - if (args.length > 9) + if (p_184881_3_.length > 9) { diff --git a/patches.mcp/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches.mcp/minecraft/net/minecraft/command/CommandHandler.java.patch index dc2cf60369..7afcafd3c1 100644 --- a/patches.mcp/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches.mcp/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 -@@ -44,6 +44,16 @@ +@@ -46,6 +46,16 @@ } - else if (icommand.canCommandSenderUseCommand(sender)) + else if (icommand.func_184882_a(this.func_184879_a(), sender)) { + net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(icommand, sender, astring); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) @@ -16,13 +16,13 @@ + if (i > -1) { - List list = PlayerSelector.matchEntities(sender, astring[i], Entity.class); -@@ -107,7 +117,7 @@ - ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.exception", new Object[0]); - chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); - sender.addChatMessage(chatcomponenttranslation); + List list = EntitySelector.matchEntities(sender, astring[i], Entity.class); +@@ -109,7 +119,7 @@ + TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("commands.generic.exception", new Object[0]); + textcomponenttranslation.getChatStyle().setColor(TextFormatting.RED); + sender.addChatMessage(textcomponenttranslation); - logger.warn("Couldn\'t process command: \'" + input + "\'"); -+ logger.warn("Couldn\'t process command: \'" + input + "\'", var9); // Forge: Log stacktrace of unknown exceptions ++ logger.warn("Couldn\'t process command: \'" + input + "\'", var9); } return false; diff --git a/patches.mcp/minecraft/net/minecraft/command/PlayerSelector.java.patch b/patches.mcp/minecraft/net/minecraft/command/EntitySelector.java.patch similarity index 84% rename from patches.mcp/minecraft/net/minecraft/command/PlayerSelector.java.patch rename to patches.mcp/minecraft/net/minecraft/command/EntitySelector.java.patch index 2a904ba288..0d8cb8557e 100644 --- a/patches.mcp/minecraft/net/minecraft/command/PlayerSelector.java.patch +++ b/patches.mcp/minecraft/net/minecraft/command/EntitySelector.java.patch @@ -1,8 +1,8 @@ ---- ../src-base/minecraft/net/minecraft/command/PlayerSelector.java -+++ ../src-work/minecraft/net/minecraft/command/PlayerSelector.java +--- ../src-base/minecraft/net/minecraft/command/EntitySelector.java ++++ ../src-work/minecraft/net/minecraft/command/EntitySelector.java @@ -36,9 +36,9 @@ - public class PlayerSelector + public class EntitySelector { - private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w=,!-]*)\\])?$"); + private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w\\.=,!-]*)\\])?$"); // FORGE: allow . in entity selectors diff --git a/patches.mcp/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch b/patches.mcp/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch index b672663398..07a4ff3943 100644 --- a/patches.mcp/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch +++ b/patches.mcp/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/command/server/CommandSetBlock.java +++ ../src-work/minecraft/net/minecraft/command/server/CommandSetBlock.java -@@ -52,6 +52,8 @@ - i = parseInt(args[4], 0, 15); +@@ -54,6 +54,8 @@ + i = parseInt(p_184881_3_[4], 0, 15); } + IBlockState state = block.getStateFromMeta(i); + - World world = sender.getEntityWorld(); + World world = p_184881_2_.getEntityWorld(); if (!world.isBlockLoaded(blockpos)) -@@ -63,7 +65,7 @@ +@@ -65,7 +67,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (args.length >= 7 && block.hasTileEntity()) -+ if (args.length >= 7 && block.hasTileEntity(state)) +- if (p_184881_3_.length >= 7 && block.hasTileEntity()) ++ if (p_184881_3_.length >= 7 && block.hasTileEntity(state)) { - String s = getChatComponentFromNthArg(sender, args, 6).getUnformattedText(); + String s = getChatComponentFromNthArg(p_184881_2_, p_184881_3_, 6).getUnformattedText(); diff --git a/patches.mcp/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch b/patches.mcp/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch index be6dce5388..e5f4feaa62 100644 --- a/patches.mcp/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch +++ b/patches.mcp/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/command/server/CommandTestForBlock.java +++ ../src-work/minecraft/net/minecraft/command/server/CommandTestForBlock.java -@@ -70,7 +70,7 @@ +@@ -72,7 +72,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (args.length >= 6 && block.hasTileEntity()) -+ if (args.length >= 6 && block.hasTileEntity(block.getStateFromMeta(i))) +- if (p_184881_3_.length >= 6 && block.hasTileEntity()) ++ if (p_184881_3_.length >= 6 && block.hasTileEntity(block.getStateFromMeta(i))) { - String s = getChatComponentFromNthArg(sender, args, 5).getUnformattedText(); + String s = getChatComponentFromNthArg(p_184881_2_, p_184881_3_, 5).getUnformattedText(); diff --git a/patches.mcp/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches.mcp/minecraft/net/minecraft/crash/CrashReportCategory.java.patch index 3918b6866f..babe95608a 100644 --- a/patches.mcp/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ b/patches.mcp/minecraft/net/minecraft/crash/CrashReportCategory.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/crash/CrashReportCategory.java +++ ../src-work/minecraft/net/minecraft/crash/CrashReportCategory.java -@@ -117,8 +117,11 @@ +@@ -122,8 +122,11 @@ } else { diff --git a/patches.mcp/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches.mcp/minecraft/net/minecraft/enchantment/Enchantment.java.patch index f3dc07bd21..950a1f5b80 100644 --- a/patches.mcp/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ b/patches.mcp/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/enchantment/Enchantment.java +++ ../src-work/minecraft/net/minecraft/enchantment/Enchantment.java -@@ -61,7 +61,7 @@ - - if (enchantmentsList[enchID] != null) - { -- throw new IllegalArgumentException("Duplicate enchantment id!"); -+ throw new IllegalArgumentException("Duplicate enchantment id! " + this.getClass() + " and " + enchantmentsList[enchID].getClass() + " Enchantment ID:" + enchID); - } - else - { -@@ -139,7 +139,7 @@ +@@ -118,7 +118,7 @@ public boolean canApply(ItemStack stack) { @@ -18,49 +9,3 @@ } public void onEntityDamaged(EntityLivingBase user, Entity target, int level) -@@ -150,6 +150,45 @@ - { - } - -+ /** -+ * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} -+ * applies for all possible enchantments. -+ * @param stack -+ * @return -+ */ -+ public boolean canApplyAtEnchantingTable(ItemStack stack) -+ { -+ return this.type.canEnchantItem(stack.getItem()); -+ } -+ -+ private static final java.lang.reflect.Field bookSetter = Enchantment.class.getDeclaredFields()[1]; -+ /** -+ * Add to the list of enchantments applicable by the anvil from a book -+ * -+ * @param enchantment -+ */ -+ public static void addToBookList(Enchantment enchantment) -+ { -+ try -+ { -+ net.minecraftforge.common.util.EnumHelper.setFailsafeFieldValue(bookSetter, null, -+ com.google.common.collect.ObjectArrays.concat(enchantmentsBookList, enchantment)); -+ } -+ catch (Exception e) -+ { -+ throw new RuntimeException(e); //Rethrow see what happens -+ } -+ } -+ -+ /** -+ * Is this enchantment allowed to be enchanted on books via Enchantment Table -+ * @return false to disable the vanilla feature -+ */ -+ public boolean isAllowedOnBooks() -+ { -+ return true; -+ } -+ - static - { - List list = Lists.newArrayList(); diff --git a/patches.mcp/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches.mcp/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index 854ea8d5d5..1cdc06c02d 100644 --- a/patches.mcp/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches.mcp/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java -@@ -296,7 +296,7 @@ +@@ -292,7 +292,7 @@ public static int calcItemStackEnchantability(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) { Item item = p_77514_3_.getItem(); @@ -9,33 +9,12 @@ if (i <= 0) { -@@ -345,7 +345,7 @@ - public static List buildEnchantmentList(Random randomIn, ItemStack itemStackIn, int p_77513_2_) +@@ -339,7 +339,7 @@ { + List list = Lists.newArrayList(); Item item = itemStackIn.getItem(); - int i = item.getItemEnchantability(); + int i = item.getItemEnchantability(itemStackIn); if (i <= 0) { -@@ -387,7 +387,9 @@ - - for (EnchantmentData enchantmentdata1 : list) - { -- if (!enchantmentdata1.enchantmentobj.canApplyTogether(Enchantment.getEnchantmentById(integer.intValue()))) -+ Enchantment e1 = enchantmentdata1.enchantmentobj; -+ Enchantment e2 = Enchantment.getEnchantmentById(integer.intValue()); -+ if (!e1.canApplyTogether(e2) || !e2.canApplyTogether(e1)) //Forge BugFix: Let Both enchantments veto being together - { - flag = false; - break; -@@ -421,7 +423,8 @@ - - for (Enchantment enchantment : Enchantment.enchantmentsBookList) - { -- if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag)) -+ if (enchantment == null) continue; -+ if (enchantment.canApplyAtEnchantingTable(p_77505_1_) || (flag && enchantment.isAllowedOnBooks())) - { - for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); ++i) - { diff --git a/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch b/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch index 2691d82dfc..cfdd777961 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch @@ -1,17 +1,22 @@ --- ../src-base/minecraft/net/minecraft/entity/Entity.java +++ ../src-work/minecraft/net/minecraft/entity/Entity.java -@@ -49,7 +49,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; +@@ -76,7 +76,7 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; -public abstract class Entity implements ICommandSender +public abstract class Entity implements ICommandSender, net.minecraftforge.common.capabilities.ICapabilitySerializable { + private static final Logger field_184243_a = LogManager.getLogger(); private static final AxisAlignedBB ZERO_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); - private static int nextEntityID; -@@ -129,6 +129,15 @@ - protected UUID entityUniqueID; - private final CommandResultStats cmdResultStats; +@@ -195,8 +195,20 @@ + this.dataWatcher.func_187214_a(field_184242_az, ""); + this.dataWatcher.func_187214_a(field_184234_aB, Boolean.valueOf(false)); + this.entityInit(); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this)); ++ for (net.minecraftforge.common.IExtendedEntityProperties props : extendedProperties.values()) props.init(this, worldIn); ++ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); + } + /** Forge: Used to store custom data for each entity. */ + private NBTTagCompound customEntityData; @@ -25,35 +30,8 @@ public int getEntityId() { return this.entityId; -@@ -172,6 +181,9 @@ - this.dataWatcher.addObject(2, ""); - this.dataWatcher.addObject(4, Byte.valueOf((byte)0)); - this.entityInit(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this)); -+ for (net.minecraftforge.common.IExtendedEntityProperties props : extendedProperties.values()) props.init(this, worldIn); -+ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); - } - - protected abstract void entityInit(); -@@ -996,12 +1008,12 @@ - IBlockState iblockstate = this.worldObj.getBlockState(blockpos); - Block block = iblockstate.getBlock(); - -+ Boolean result = block.isEntityInsideMaterial(this.worldObj, blockpos, iblockstate, this, d0, materialIn, true); -+ if (result != null) return result; -+ - if (block.getMaterial() == materialIn) - { -- float f = BlockLiquid.getLiquidHeightPercent(iblockstate.getBlock().getMetaFromState(iblockstate)) - 0.11111111F; -- float f1 = (float)(blockpos.getY() + 1) - f; -- boolean flag = d0 < (double)f1; -- return !flag && this instanceof EntityPlayer ? false : flag; -+ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(materialIn, this, blockpos); - } - else - { -@@ -1356,6 +1368,23 @@ - tagCompund.setBoolean("Silent", this.isSilent()); +@@ -1534,6 +1546,23 @@ + tagCompund.setTag("Tags", nbttaglist); } + if (customEntityData != null) tagCompund.setTag("ForgeData", customEntityData); @@ -75,39 +53,8 @@ + this.writeEntityToNBT(tagCompund); - if (this.ridingEntity != null) -@@ -1438,6 +1467,30 @@ - this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible")); - this.cmdResultStats.readStatsFromNBT(tagCompund); - this.setSilent(tagCompund.getBoolean("Silent")); -+ -+ if (tagCompund.hasKey("ForgeData")) customEntityData = tagCompund.getCompoundTag("ForgeData"); -+ for (String identifier : this.extendedProperties.keySet()) -+ { -+ try -+ { -+ net.minecraftforge.common.IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.loadNBTData(tagCompund); -+ } -+ catch (Throwable t) -+ { -+ net.minecraftforge.fml.common.FMLLog.severe("Failed to load extended properties for %s. This is a mod issue.", identifier); -+ t.printStackTrace(); -+ } -+ } -+ -+ //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly TODO: Remove in 1.9 -+ if (tagCompund.hasKey("PersistentIDMSB") && tagCompund.hasKey("PersistentIDLSB")) -+ { -+ this.entityUniqueID = new UUID(tagCompund.getLong("PersistentIDMSB"), tagCompund.getLong("PersistentIDLSB")); -+ } -+ -+ if (this.capabilities != null && tagCompund.hasKey("ForgeCaps")) this.capabilities.deserializeNBT(tagCompund.getCompoundTag("ForgeCaps")); -+ - this.readEntityFromNBT(tagCompund); - - if (this.shouldSetPosAfterLoading()) -@@ -1512,7 +1565,10 @@ + if (this.func_184207_aI()) +@@ -1715,7 +1744,10 @@ { EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, itemStackIn); entityitem.setDefaultPickupDelay(); @@ -119,23 +66,15 @@ return entityitem; } else -@@ -1655,6 +1711,7 @@ - - public void mountEntity(Entity entityIn) - { -+ if(!(this instanceof EntityLivingBase) && !net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, entityIn, true)){ return; } - this.entityRiderPitchDelta = 0.0D; - this.entityRiderYawDelta = 0.0D; - -@@ -2049,6 +2106,7 @@ +@@ -2279,6 +2311,7 @@ { if (!this.worldObj.isRemote && !this.isDead) { + if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, dimensionId)) return; this.worldObj.theProfiler.startSection("changeDimension"); - MinecraftServer minecraftserver = MinecraftServer.getServer(); + MinecraftServer minecraftserver = this.func_184102_h(); int i = this.dimension; -@@ -2092,7 +2150,7 @@ +@@ -2372,7 +2405,7 @@ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { @@ -144,11 +83,10 @@ } public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) -@@ -2353,4 +2411,209 @@ - +@@ -2662,6 +2695,211 @@ EnchantmentHelper.applyArthropodEnchantments(entityLivingBaseIn, entityIn); } -+ + + /* ================================== Forge Start =====================================*/ + /** + * Returns a NBTTagCompound that can be used to store custom data for this entity. @@ -353,4 +291,7 @@ + return ret; + } + /* ================================== Forge End =====================================*/ - } ++ + public void func_184178_b(EntityPlayerMP p_184178_1_) + { + } diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityAgeable.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityAgeable.java.patch deleted file mode 100644 index 7fa218dc7f..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityAgeable.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/EntityAgeable.java -+++ ../src-work/minecraft/net/minecraft/entity/EntityAgeable.java -@@ -31,7 +31,7 @@ - { - if (!this.worldObj.isRemote) - { -- Class oclass = EntityList.getClassFromID(itemstack.getMetadata()); -+ Class oclass = EntityList.stringToClassMapping.get(net.minecraft.item.ItemMonsterPlacer.getEntityName(itemstack)); - - if (oclass != null && this.getClass() == oclass) - { diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityHanging.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityHanging.java.patch deleted file mode 100644 index a249f305a0..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityHanging.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/EntityHanging.java -+++ ../src-work/minecraft/net/minecraft/entity/EntityHanging.java -@@ -123,6 +123,9 @@ - { - BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l); - Block block = this.worldObj.getBlockState(blockpos1).getBlock(); -+ -+ if ( block.isSideSolid( this.worldObj, blockpos1, this.facingDirection )) -+ continue; - - if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block)) - { diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityList.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityList.java.patch index 7b099fb5e7..4fe4eddce7 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityList.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityList.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityList.java +++ ../src-work/minecraft/net/minecraft/entity/EntityList.java -@@ -88,6 +88,7 @@ +@@ -91,6 +91,7 @@ public static void addMapping(Class entityClass, String entityName, int id) { @@ -8,9 +8,9 @@ if (stringToClassMapping.containsKey(entityName)) { throw new IllegalArgumentException("ID is already registered: " + entityName); -@@ -151,9 +152,10 @@ - nbt.removeTag("Type"); - } +@@ -148,9 +149,10 @@ + { + Entity entity = null; + Class oclass = null; try @@ -20,7 +20,7 @@ if (oclass != null) { -@@ -167,7 +169,17 @@ +@@ -164,7 +166,17 @@ if (entity != null) { @@ -38,18 +38,8 @@ } else { -@@ -343,7 +355,9 @@ - - public static class EntityEggInfo - { -+ @Deprecated // This is not always a valid number in the global ID list. - public final int spawnedID; -+ public final String name; - public final int primaryColor; - public final int secondaryColor; - public final StatBase field_151512_d; -@@ -356,6 +370,17 @@ - this.secondaryColor = spotColor; +@@ -362,6 +374,17 @@ + this.secondaryColor = p_i47076_3_; this.field_151512_d = StatList.getStatKillEntity(this); this.field_151513_e = StatList.getStatEntityKilledBy(this); + this.name = EntityList.getStringFromID(id); diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityLiving.java.patch index 319c8d88ad..ab82bb636b 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java +++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java -@@ -121,6 +121,7 @@ +@@ -171,6 +171,7 @@ public void setAttackTarget(EntityLivingBase entitylivingbaseIn) { this.attackTarget = entitylivingbaseIn; @@ -8,7 +8,7 @@ } public boolean canAttackClass(Class cls) -@@ -498,10 +499,22 @@ +@@ -699,10 +700,22 @@ protected void despawnEntity() { @@ -31,8 +31,8 @@ else { Entity entity = this.worldObj.getClosestPlayerToEntity(this, -1.0D); -@@ -621,7 +634,6 @@ - return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); +@@ -835,7 +848,6 @@ + return !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()) && this.worldObj.func_184144_a(this, this.getEntityBoundingBox()).isEmpty() && this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this); } - @SideOnly(Side.CLIENT) diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index 4dc1946473..535927f319 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -1,24 +1,7 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityLivingBase.java +++ ../src-work/minecraft/net/minecraft/entity/EntityLivingBase.java -@@ -170,6 +170,7 @@ - } - - int i = (int)(150.0D * d0); -+ if ( !block.addLandingEffects( (WorldServer)this.worldObj, pos, iblockstate, this, i ) ) - ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, this.posY, this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, new int[] {Block.getStateId(iblockstate)}); - } - } -@@ -237,7 +238,7 @@ - } - } - -- if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) -+ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity != null && ridingEntity.shouldDismountInWater(this)) - { - this.mountEntity((Entity)null); - } -@@ -319,7 +320,7 @@ - if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot")) +@@ -363,7 +363,7 @@ + if (!this.worldObj.isRemote && (this.isPlayer() || this.recentlyHit > 0 && this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot"))) { int i = this.getExperiencePoints(this.attackingPlayer); - @@ -26,7 +9,7 @@ while (i > 0) { int j = EntityXPOrb.getXPSplit(i); -@@ -380,6 +381,7 @@ +@@ -424,6 +424,7 @@ { this.entityLivingToAttack = livingBase; this.revengeTimer = this.ticksExisted; @@ -34,15 +17,7 @@ } public EntityLivingBase getLastAttacker() -@@ -663,7 +665,6 @@ - return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; - } - -- @SideOnly(Side.CLIENT) - public void removePotionEffectClient(int potionId) - { - this.activePotionsMap.remove(Integer.valueOf(potionId)); -@@ -712,6 +713,8 @@ +@@ -775,6 +776,8 @@ public void heal(float healAmount) { @@ -51,7 +26,7 @@ float f = this.getHealth(); if (f > 0.0F) -@@ -732,6 +735,7 @@ +@@ -795,6 +798,7 @@ public boolean attackEntityFrom(DamageSource source, float amount) { @@ -59,7 +34,7 @@ if (this.isEntityInvulnerable(source)) { return false; -@@ -797,9 +801,9 @@ +@@ -883,9 +887,9 @@ this.recentlyHit = 100; this.attackingPlayer = (EntityPlayer)entity; } @@ -71,26 +46,8 @@ if (entitywolf.isTamed()) { -@@ -883,6 +887,7 @@ - - public void onDeath(DamageSource cause) - { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; - Entity entity = cause.getEntity(); - EntityLivingBase entitylivingbase = this.func_94060_bK(); - -@@ -908,6 +913,9 @@ - i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity); - } - -+ captureDrops = true; -+ capturedDrops.clear(); -+ - if (this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot")) - { - this.dropFewItems(this.recentlyHit > 0, i); -@@ -918,6 +926,16 @@ - this.addRandomDrop(); +@@ -982,6 +986,16 @@ + return true; } } + @@ -105,17 +62,8 @@ + } } - this.worldObj.setEntityState(this, (byte)3); -@@ -972,7 +990,7 @@ - int j = MathHelper.floor_double(this.getEntityBoundingBox().minY); - int k = MathHelper.floor_double(this.posZ); - Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock(); -- return (block == Blocks.ladder || block == Blocks.vine) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).isSpectator()); -+ return net.minecraftforge.common.ForgeHooks.isLivingOnLadder(block, worldObj, new BlockPos(i, j, k), this); - } - - public boolean isEntityAlive() -@@ -982,6 +1000,9 @@ + return false; +@@ -1139,6 +1153,9 @@ public void fall(float distance, float damageMultiplier) { @@ -123,9 +71,9 @@ + if (ret == null) return; + distance = ret[0]; damageMultiplier = ret[1]; super.fall(distance, damageMultiplier); - PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump); - float f = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F; -@@ -1094,6 +1115,8 @@ + PotionEffect potioneffect = this.getActivePotionEffect(MobEffects.jump); + float f = potioneffect == null ? 0.0F : (float)(potioneffect.getAmplifier() + 1); +@@ -1231,6 +1248,8 @@ { if (!this.isEntityInvulnerable(damageSrc)) { @@ -134,9 +82,9 @@ damageAmount = this.applyArmorCalculations(damageSrc, damageAmount); damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount); float f = damageAmount; -@@ -1142,6 +1165,11 @@ +@@ -1279,6 +1298,11 @@ - public void swingItem() + public void func_184609_a(EnumHand p_184609_1_) { + ItemStack stack = this.getHeldItem(); + if (stack != null && stack.getItem() != null) @@ -146,15 +94,7 @@ if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { this.swingProgressInt = -1; -@@ -1281,6 +1309,7 @@ - - public void dismountEntity(Entity p_110145_1_) - { -+ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_110145_1_, false)){ return; } - double d0 = p_110145_1_.posX; - double d1 = p_110145_1_.getEntityBoundingBox().minY + (double)p_110145_1_.height; - double d2 = p_110145_1_.posZ; -@@ -1346,6 +1375,7 @@ +@@ -1586,6 +1610,7 @@ } this.isAirBorne = true; @@ -162,27 +102,18 @@ } protected void updateAITick() -@@ -1530,6 +1560,7 @@ +@@ -1845,6 +1870,7 @@ public void onUpdate() { + if (net.minecraftforge.common.ForgeHooks.onLivingUpdate(this)) return; super.onUpdate(); + this.func_184608_ct(); - if (!this.worldObj.isRemote) -@@ -1817,6 +1848,7 @@ - - public void mountEntity(Entity entityIn) - { -+ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, entityIn, true)){ return; } - if (this.ridingEntity != null && entityIn == null) - { - if (!this.worldObj.isRemote) -@@ -1998,4 +2030,39 @@ - { +@@ -2351,6 +2377,41 @@ this.potionsNeedUpdate = true; } -+ + + /*** + * Removes all potion effects that have curativeItem as a curative item for its effect + * @param curativeItem The itemstack we are using to cure potion effects @@ -217,4 +148,7 @@ + { + return this instanceof net.minecraft.entity.passive.EntityPig; + } - } ++ + public abstract EnumHandSide func_184591_cq(); + + public boolean func_184587_cr() diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch deleted file mode 100644 index 20ea69bf3a..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java -+++ ../src-work/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java -@@ -109,6 +109,7 @@ - - public boolean interactFirst(EntityPlayer playerIn) - { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - this.commandBlockLogic.tryOpenEditCommandBlock(playerIn); - return false; - } diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityTracker.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityTracker.java.patch index d3e15e11d6..8901784d44 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityTracker.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityTracker.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java +++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java -@@ -56,6 +56,8 @@ +@@ -75,6 +75,8 @@ public void trackEntity(Entity p_72786_1_) { @@ -9,11 +9,10 @@ if (p_72786_1_ instanceof EntityPlayerMP) { this.trackEntity(p_72786_1_, 512, 2); -@@ -331,4 +333,23 @@ - } +@@ -329,6 +331,25 @@ } } -+ + + /* ======================================== FORGE START =====================================*/ + + // don't expose the EntityTrackerEntry directly so mods can't mess with the data in there as easily @@ -32,4 +31,7 @@ + } + + /* ======================================== FORGE END =====================================*/ - } ++ + public void func_151248_b(Entity entityIn, Packet p_151248_2_) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(entityIn.getEntityId()); diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch index 8f9273e0ee..8375c44cf6 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch @@ -1,36 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityTrackerEntry.java +++ ../src-work/minecraft/net/minecraft/entity/EntityTrackerEntry.java -@@ -379,6 +379,14 @@ - this.lastTrackedEntityMotionY = this.trackedEntity.motionY; - this.motionZ = this.trackedEntity.motionZ; - -+ int posX = MathHelper.floor_double(this.trackedEntity.posX * 32.0D); -+ int posY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); -+ int posZ = MathHelper.floor_double(this.trackedEntity.posZ * 32.0D); -+ if (posX != this.encodedPosX || posY != this.encodedPosY || posZ != this.encodedPosZ) -+ { -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.makeEntitySpawnAdjustment(this.trackedEntity, playerMP, this.encodedPosX, this.encodedPosY, this.encodedPosZ); -+ } -+ - if (this.sendVelocityUpdates && !(packet instanceof S0FPacketSpawnMob)) - { - playerMP.playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(this.trackedEntity.getEntityId(), this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); -@@ -426,12 +434,14 @@ - playerMP.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.trackedEntity.getEntityId(), potioneffect)); - } - } -+ net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(trackedEntity, playerMP); - } - } - else if (this.trackingPlayers.contains(playerMP)) - { - this.trackingPlayers.remove(playerMP); - playerMP.removeEntity(this.trackedEntity); -+ net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(trackedEntity, playerMP); - } - } - } -@@ -463,6 +473,9 @@ +@@ -477,6 +477,9 @@ logger.warn("Fetching addPacket for removed entity"); } @@ -39,4 +9,4 @@ + if (this.trackedEntity instanceof EntityItem) { - return new S0EPacketSpawnObject(this.trackedEntity, 2, 1); + return new SPacketSpawnObject(this.trackedEntity, 2, 1); diff --git a/patches.mcp/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch b/patches.mcp/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch deleted file mode 100644 index 81f1b497ae..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java -+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java -@@ -20,6 +20,8 @@ - private double targetX; - private double targetY; - private double targetZ; -+ private int failedPathFindingPenalty = 0; -+ private boolean canPenalize = false; - - public EntityAIAttackOnCollide(EntityCreature creature, Class targetClass, double speedIn, boolean useLongMemory) - { -@@ -54,6 +56,19 @@ - } - else - { -+ if (canPenalize) -+ { -+ if (--this.delayCounter <= 0) -+ { -+ this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); -+ this.targetX = 4 + this.attacker.getRNG().nextInt(7); -+ return this.entityPathEntity != null; -+ } -+ else -+ { -+ return true; -+ } -+ } - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); - return this.entityPathEntity != null; - } -@@ -91,6 +106,23 @@ - this.targetZ = entitylivingbase.posZ; - this.delayCounter = 4 + this.attacker.getRNG().nextInt(7); - -+ if (this.canPenalize) -+ { -+ this.targetX += failedPathFindingPenalty; -+ if (this.attacker.getNavigator().getPath() != null) -+ { -+ net.minecraft.pathfinding.PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); -+ if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) -+ failedPathFindingPenalty = 0; -+ else -+ failedPathFindingPenalty += 10; -+ } -+ else -+ { -+ failedPathFindingPenalty += 10; -+ } -+ } -+ - if (d0 > 1024.0D) - { - this.delayCounter += 10; diff --git a/patches.mcp/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches.mcp/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch deleted file mode 100644 index b7daaa8b7b..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/boss/EntityDragon.java -+++ ../src-work/minecraft/net/minecraft/entity/boss/EntityDragon.java -@@ -479,9 +479,9 @@ - BlockPos blockpos = new BlockPos(k1, l1, i2); - Block block = this.worldObj.getBlockState(blockpos).getBlock(); - -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(worldObj, new BlockPos(k1, l1, i2))) - { -- if (block != Blocks.barrier && block != Blocks.obsidian && block != Blocks.end_stone && block != Blocks.bedrock && block != Blocks.command_block && this.worldObj.getGameRules().getBoolean("mobGriefing")) -+ if (block.canEntityDestroy(worldObj, new BlockPos(k1, l1, i2), this) && this.worldObj.getGameRules().getBoolean("mobGriefing")) - { - flag1 = this.worldObj.setBlockToAir(blockpos) || flag1; - } diff --git a/patches.mcp/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches.mcp/minecraft/net/minecraft/entity/boss/EntityWither.java.patch deleted file mode 100644 index c999b9d328..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/boss/EntityWither.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/boss/EntityWither.java -+++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java -@@ -343,7 +343,7 @@ - BlockPos blockpos = new BlockPos(i3, k, l); - Block block = this.worldObj.getBlockState(blockpos).getBlock(); - -- if (block.getMaterial() != Material.air && func_181033_a(block)) -+ if (!block.isAir(worldObj,blockpos) && func_181033_a(block) && block.canEntityDestroy(worldObj, blockpos, this)) - { - flag = this.worldObj.destroyBlock(blockpos, true) || flag; - } diff --git a/patches.mcp/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch b/patches.mcp/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch deleted file mode 100644 index 98bf842696..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/boss/IBossDisplayData.java -+++ ../src-work/minecraft/net/minecraft/entity/boss/IBossDisplayData.java -@@ -4,7 +4,6 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --@SideOnly(Side.CLIENT) - public interface IBossDisplayData - { - float getMaxHealth(); diff --git a/patches.mcp/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/patches.mcp/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch index 662a54e4d7..e461fad3cc 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java +++ ../src-work/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java -@@ -90,7 +90,8 @@ +@@ -104,7 +104,8 @@ for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity)list.get(i); diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index 8829569eeb..4244d13761 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityEnderPearl.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java -@@ -61,6 +61,9 @@ +@@ -84,6 +84,9 @@ if (entityplayermp.playerNetServerHandler.getNetworkManager().isChannelOpen() && entityplayermp.worldObj == this.worldObj && !entityplayermp.isPlayerSleeping()) { @@ -10,8 +10,8 @@ if (this.rand.nextFloat() < 0.05F && this.worldObj.getGameRules().getBoolean("doMobSpawning")) { EntityEndermite entityendermite = new EntityEndermite(this.worldObj); -@@ -74,9 +77,10 @@ - entitylivingbase.mountEntity((Entity)null); +@@ -97,9 +100,10 @@ + this.func_184210_p(); } - entitylivingbase.setPositionAndUpdate(this.posX, this.posY, this.posZ); diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityItem.java.patch index 65666ecaac..e78393fac3 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityItem.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityItem.java -@@ -29,6 +29,11 @@ +@@ -37,6 +37,11 @@ private String owner; public float hoverStart; @@ -12,7 +12,7 @@ public EntityItem(World worldIn, double x, double y, double z) { super(worldIn); -@@ -46,6 +51,7 @@ +@@ -54,6 +59,7 @@ { this(worldIn, x, y, z); this.setEntityItemStack(stack); @@ -20,7 +20,7 @@ } protected boolean canTriggerWalking() -@@ -69,6 +75,8 @@ +@@ -77,6 +83,8 @@ public void onUpdate() { @@ -29,7 +29,7 @@ if (this.getEntityItem() == null) { this.setDead(); -@@ -129,8 +137,16 @@ +@@ -137,8 +145,16 @@ this.handleWaterMovement(); @@ -47,15 +47,15 @@ this.setDead(); } } -@@ -271,6 +287,7 @@ - tagCompound.setShort("Health", (short)((byte)this.health)); +@@ -279,6 +295,7 @@ + tagCompound.setShort("Health", (short)this.health); tagCompound.setShort("Age", (short)this.age); tagCompound.setShort("PickupDelay", (short)this.delayBeforeCanPickup); + tagCompound.setInteger("Lifespan", lifespan); if (this.getThrower() != null) { -@@ -311,20 +328,23 @@ +@@ -319,20 +336,23 @@ NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("Item"); this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound)); @@ -84,15 +84,15 @@ { if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log)) { -@@ -361,6 +381,7 @@ +@@ -369,6 +389,7 @@ } } + net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerItemPickupEvent(entityIn, this); if (!this.isSilent()) { - this.worldObj.playSoundAtEntity(entityIn, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); -@@ -402,11 +423,6 @@ + this.worldObj.func_184148_a((EntityPlayer)null, entityIn.posX, entityIn.posY, entityIn.posZ, SoundEvents.field_187638_cR, SoundCategory.PLAYERS, 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); +@@ -414,11 +435,6 @@ if (itemstack == null) { @@ -104,7 +104,7 @@ return new ItemStack(Blocks.stone); } else -@@ -480,6 +496,6 @@ +@@ -492,6 +508,6 @@ public void func_174870_v() { this.setInfinitePickupDelay(); diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch index dce70c355e..a01a4c93ab 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityItemFrame.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityItemFrame.java -@@ -122,7 +122,7 @@ +@@ -137,7 +137,7 @@ { if (p_110131_1_ != null) { diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index 5ceb361afd..4a0a53dd36 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches.mcp/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 -@@ -50,6 +50,20 @@ +@@ -54,6 +54,20 @@ @SideOnly(Side.CLIENT) private double velocityZ; @@ -21,7 +21,7 @@ public EntityMinecart(World worldIn) { super(worldIn); -@@ -95,17 +109,19 @@ +@@ -99,17 +113,19 @@ public AxisAlignedBB getCollisionBox(Entity entityIn) { @@ -42,7 +42,7 @@ } public EntityMinecart(World worldIn, double x, double y, double z) -@@ -309,7 +325,7 @@ +@@ -315,7 +331,7 @@ BlockPos blockpos = new BlockPos(k, l, i1); IBlockState iblockstate = this.worldObj.getBlockState(blockpos); @@ -51,7 +51,7 @@ { this.func_180460_a(blockpos, iblockstate); -@@ -348,7 +364,10 @@ +@@ -354,7 +370,10 @@ this.setRotation(this.rotationYaw, this.rotationPitch); @@ -61,9 +61,9 @@ + else box = this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D); + for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box)) { - if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityMinecart) + if (!this.func_184196_w(entity) && entity.canBePushed() && entity instanceof EntityMinecart) { -@@ -367,6 +386,7 @@ +@@ -363,6 +382,7 @@ } this.handleWaterMovement(); @@ -71,7 +71,7 @@ } } -@@ -381,10 +401,21 @@ +@@ -377,10 +397,21 @@ protected void moveDerailedMinecart() { @@ -94,7 +94,7 @@ if (this.onGround) { this.motionX *= 0.5D; -@@ -392,13 +423,13 @@ +@@ -388,13 +419,13 @@ this.motionZ *= 0.5D; } @@ -112,7 +112,7 @@ } } -@@ -418,25 +449,25 @@ +@@ -414,25 +445,25 @@ flag1 = !flag; } @@ -143,7 +143,7 @@ ++this.posY; } -@@ -481,7 +512,7 @@ +@@ -478,7 +509,7 @@ } } @@ -152,29 +152,7 @@ { double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -@@ -527,20 +558,8 @@ - this.posX = d19 + d1 * d18; - this.posZ = d20 + d2 * d18; - this.setPosition(this.posX, this.posY, this.posZ); -- double d22 = this.motionX; -- double d23 = this.motionZ; -+ this.moveMinecartOnRail(p_180460_1_); - -- if (this.riddenByEntity != null) -- { -- d22 *= 0.75D; -- d23 *= 0.75D; -- } -- -- double d13 = this.getMaximumSpeed(); -- d22 = MathHelper.clamp_double(d22, -d13, d13); -- d23 = MathHelper.clamp_double(d23, -d13, d13); -- this.moveEntity(d22, 0.0D, d23); -- - if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[0][0] && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[0][2]) - { - this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); -@@ -577,8 +596,14 @@ +@@ -574,8 +605,14 @@ this.motionZ = d5 * (double)(i - p_180460_1_.getZ()); } @@ -190,265 +168,3 @@ double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); if (d15 > 0.01D) -@@ -817,13 +842,20 @@ - - public void applyEntityCollision(Entity entityIn) - { -+ -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, entityIn)); -+ if (getCollisionHandler() != null) -+ { -+ getCollisionHandler().onEntityCollision(this, entityIn); -+ return; -+ } - if (!this.worldObj.isRemote) - { - if (!entityIn.noClip && !this.noClip) - { - if (entityIn != this.riddenByEntity) - { -- if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null) -+ if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null) - { - entityIn.mountEntity(this); - } -@@ -869,7 +901,7 @@ - double d7 = entityIn.motionX + this.motionX; - double d8 = entityIn.motionZ + this.motionZ; - -- if (((EntityMinecart)entityIn).getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE) -+ if (((EntityMinecart)entityIn).isPoweredCart() && !isPoweredCart()) - { - this.motionX *= 0.20000000298023224D; - this.motionZ *= 0.20000000298023224D; -@@ -877,7 +909,7 @@ - entityIn.motionX *= 0.949999988079071D; - entityIn.motionZ *= 0.949999988079071D; - } -- else if (((EntityMinecart)entityIn).getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE) -+ else if (((EntityMinecart)entityIn).isPoweredCart() && isPoweredCart()) - { - entityIn.motionX *= 0.20000000298023224D; - entityIn.motionZ *= 0.20000000298023224D; -@@ -1042,6 +1074,221 @@ - } - } - -+ /* =================================== FORGE START ===========================================*/ -+ private BlockPos getCurrentRailPosition() -+ { -+ int x = MathHelper.floor_double(this.posX); -+ int y = MathHelper.floor_double(this.posY); -+ int z = MathHelper.floor_double(this.posZ); -+ -+ if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(x, y - 1, z))) y--; -+ return new BlockPos(x, y, z); -+ } -+ -+ protected double getMaxSpeed() -+ { -+ if (!canUseRail()) return getMaximumSpeed(); -+ BlockPos pos = this.getCurrentRailPosition(); -+ IBlockState state = this.worldObj.getBlockState(pos); -+ if (!BlockRailBase.isRailBlock(state)) return getMaximumSpeed(); -+ -+ float railMaxSpeed = ((BlockRailBase)state.getBlock()).getRailMaxSpeed(worldObj, this, pos); -+ return Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code handles minecart movement and speed capping when on a rail. -+ */ -+ public void moveMinecartOnRail(BlockPos pos) -+ { -+ double mX = this.motionX; -+ double mZ = this.motionZ; -+ -+ if (this.riddenByEntity != null) -+ { -+ mX *= 0.75D; -+ mZ *= 0.75D; -+ } -+ -+ double max = this.getMaxSpeed(); -+ mX = MathHelper.clamp_double(mX, -max, max); -+ mZ = MathHelper.clamp_double(mZ, -max, max); -+ this.moveEntity(mX, 0.0D, mZ); -+ } -+ -+ /** -+ * Gets the current global Minecart Collision handler if none -+ * is registered, returns null -+ * @return The collision handler or null -+ */ -+ public static net.minecraftforge.common.IMinecartCollisionHandler getCollisionHandler() -+ { -+ return collisionHandler; -+ } -+ -+ /** -+ * Sets the global Minecart Collision handler, overwrites any -+ * that is currently set. -+ * @param handler The new handler -+ */ -+ public static void setCollisionHandler(net.minecraftforge.common.IMinecartCollisionHandler handler) -+ { -+ collisionHandler = handler; -+ } -+ -+ /** -+ * This function returns an ItemStack that represents this cart. -+ * This should be an ItemStack that can be used by the player to place the cart, -+ * 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() -+ { -+ if (this instanceof EntityMinecartFurnace) -+ { -+ return new ItemStack(Items.furnace_minecart); -+ } -+ else if (this instanceof EntityMinecartChest) -+ { -+ return new ItemStack(Items.chest_minecart); -+ } -+ else if (this instanceof EntityMinecartTNT) -+ { -+ return new ItemStack(Items.tnt_minecart); -+ } -+ else if (this instanceof EntityMinecartHopper) -+ { -+ return new ItemStack(Items.hopper_minecart); -+ } -+ else if (this instanceof EntityMinecartCommandBlock) -+ { -+ return new ItemStack(Items.command_block_minecart); -+ } -+ return new ItemStack(Items.minecart); -+ } -+ -+ /** -+ * Returns true if this cart can currently use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @return True if the minecart can use rails. -+ */ -+ public boolean canUseRail() -+ { -+ return canUseRail; -+ } -+ -+ /** -+ * Set whether the minecart can use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @param use Whether the minecart can currently use rails. -+ */ -+ public void setCanUseRail(boolean use) -+ { -+ canUseRail = use; -+ } -+ -+ /** -+ * Return false if this cart should not call onMinecartPass() and should ignore Powered Rails. -+ * @return True if this cart should call onMinecartPass(). -+ */ -+ public boolean shouldDoRailFunctions() -+ { -+ return true; -+ } -+ -+ /** -+ * Returns true if this cart is self propelled. -+ * @return True if powered. -+ */ -+ public boolean isPoweredCart() -+ { -+ return getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE; -+ } -+ -+ /** -+ * Returns true if this cart can be ridden by an Entity. -+ * @return True if this cart can be ridden. -+ */ -+ public boolean canBeRidden() -+ { -+ return this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE; -+ } -+ -+ /** -+ * Getters/setters for physics variables -+ */ -+ -+ /** -+ * Returns the carts max speed when traveling on rails. Carts going faster -+ * than 1.1 cause issues with chunk loading. Carts cant traverse slopes or -+ * corners at greater than 0.5 - 0.6. This value is compared with the rails -+ * max speed and the carts current speed cap to determine the carts current -+ * max speed. A normal rail's max speed is 0.4. -+ * -+ * @return Carts max speed. -+ */ -+ public float getMaxCartSpeedOnRail() -+ { -+ return 1.2f; -+ } -+ -+ /** -+ * Returns the current speed cap for the cart when traveling on rails. This -+ * functions differs from getMaxCartSpeedOnRail() in that it controls -+ * current movement and cannot be overridden. The value however can never be -+ * higher than getMaxCartSpeedOnRail(). -+ * -+ * @return -+ */ -+ public final float getCurrentCartSpeedCapOnRail() -+ { -+ return currentSpeedRail; -+ } -+ -+ public final void setCurrentCartSpeedCapOnRail(float value) -+ { -+ value = Math.min(value, getMaxCartSpeedOnRail()); -+ currentSpeedRail = value; -+ } -+ -+ public float getMaxSpeedAirLateral() -+ { -+ return maxSpeedAirLateral; -+ } -+ -+ public void setMaxSpeedAirLateral(float value) -+ { -+ maxSpeedAirLateral = value; -+ } -+ -+ public float getMaxSpeedAirVertical() -+ { -+ return maxSpeedAirVertical; -+ } -+ -+ public void setMaxSpeedAirVertical(float value) -+ { -+ maxSpeedAirVertical = value; -+ } -+ -+ public double getDragAir() -+ { -+ return dragAir; -+ } -+ -+ public void setDragAir(double value) -+ { -+ dragAir = value; -+ } -+ -+ public double getSlopeAdjustment() -+ { -+ return 0.0078125D; -+ } -+ -+ /* =================================== FORGE END ===========================================*/ -+ - public static enum EnumMinecartType - { - RIDEABLE(0, "MinecartRideable"), diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch index 9ac57f9f40..5b38ca3984 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -1,18 +1,17 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java -@@ -180,6 +180,7 @@ +@@ -200,6 +200,7 @@ - public boolean interactFirst(EntityPlayer playerIn) + public boolean func_184230_a(EntityPlayer p_184230_1_, ItemStack p_184230_2_, EnumHand p_184230_3_) { + if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; if (!this.worldObj.isRemote) { - playerIn.displayGUIChest(this); -@@ -232,4 +233,22 @@ - this.minecartContainerItems[i] = null; + p_184230_1_.displayGUIChest(this); +@@ -279,6 +280,24 @@ } } -+ + + public net.minecraftforge.items.IItemHandler itemHandler = new net.minecraftforge.items.wrapper.InvWrapper(this); + + @Override @@ -30,4 +29,7 @@ + { + return capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); + } - } ++ + public void clear() + { + this.func_184288_f((EntityPlayer)null); diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch deleted file mode 100644 index e262844ee4..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java -@@ -18,6 +18,7 @@ - - public boolean interactFirst(EntityPlayer playerIn) - { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != playerIn) - { - return true; diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch deleted file mode 100644 index 6c351329fe..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java -@@ -131,6 +131,7 @@ - - public boolean interactFirst(EntityPlayer playerIn) - { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - ItemStack itemstack = playerIn.inventory.getCurrentItem(); - - if (itemstack != null && itemstack.getItem() == Items.coal) diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch index 79d7a4a279..12c782abdb 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java -@@ -54,6 +54,7 @@ +@@ -56,6 +56,7 @@ - public boolean interactFirst(EntityPlayer playerIn) + public boolean func_184230_a(EntityPlayer p_184230_1_, ItemStack p_184230_2_, EnumHand p_184230_3_) { + if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; if (!this.worldObj.isRemote) { - playerIn.displayGUIChest(this); + p_184230_1_.displayGUIChest(this); diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch index 1a1ae19dc3..733ef29822 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityXPOrb.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityXPOrb.java -@@ -199,6 +199,7 @@ +@@ -204,6 +204,7 @@ { if (this.delayBeforeCanPickup == 0 && entityIn.xpCooldown == 0) { + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerPickupXpEvent(entityIn, this))) return; entityIn.xpCooldown = 2; - this.worldObj.playSoundAtEntity(entityIn, "random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); + this.worldObj.func_184148_a((EntityPlayer)null, entityIn.posX, entityIn.posY, entityIn.posZ, SoundEvents.field_187607_bg, SoundCategory.PLAYERS, 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); entityIn.onItemPickup(this, 1); diff --git a/patches.mcp/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch b/patches.mcp/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch index e401e46a65..acbdcde24b 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -1,24 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntityEnderman.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEnderman.java -@@ -198,12 +198,14 @@ - - protected boolean teleportTo(double x, double y, double z) - { -+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, x, y, z, 0); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false; - double d0 = this.posX; - double d1 = this.posY; - double d2 = this.posZ; -- this.posX = x; -- this.posY = y; -- this.posZ = z; -+ this.posX = event.targetX; -+ this.posY = event.targetY; -+ this.posZ = event.targetZ; - boolean flag = false; - BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ); - -@@ -364,6 +366,18 @@ +@@ -342,6 +342,18 @@ } } @@ -36,4 +18,4 @@ + public boolean isScreaming() { - return this.dataWatcher.getWatchableObjectByte(18) > 0; + return ((Boolean)this.dataWatcher.func_187225_a(field_184719_bw)).booleanValue(); diff --git a/patches.mcp/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch b/patches.mcp/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch index 722b948e03..a8959be684 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java -@@ -103,6 +103,7 @@ +@@ -86,6 +86,7 @@ { this.motionY = (double)(0.42F + (float)this.getSlimeSize() * 0.1F); this.isAirBorne = true; diff --git a/patches.mcp/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch b/patches.mcp/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch index d7c70c78c3..07ef5a4644 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntitySlime.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySlime.java -@@ -111,7 +111,7 @@ +@@ -125,7 +125,7 @@ if (this.onGround && !this.wasOnGround) { int i = this.getSlimeSize(); @@ -8,8 +8,8 @@ + if (spawnCustomParticles()) { i = 0; } // don't spawn particles if it's handled by the implementation itself for (int j = 0; j < i * 8; ++j) { - float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; -@@ -271,7 +271,7 @@ + float f = this.rand.nextFloat() * ((float)Math.PI * 2F); +@@ -291,7 +291,7 @@ BlockPos blockpos = new BlockPos(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ)); Chunk chunk = this.worldObj.getChunkFromBlockCoords(blockpos); @@ -18,8 +18,8 @@ { return false; } -@@ -336,6 +336,14 @@ - return super.onInitialSpawn(difficulty, livingdata); +@@ -356,6 +356,14 @@ + return this.func_189101_db() ? SoundEvents.field_189110_fE : SoundEvents.field_187882_fq; } + /* ======================================== FORGE START =====================================*/ diff --git a/patches.mcp/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches.mcp/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index cafe8f8f1b..f62c7284ab 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -1,47 +1,7 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntityZombie.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityZombie.java -@@ -87,7 +87,7 @@ - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(35.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); -- this.getAttributeMap().registerAttribute(reinforcementChance).setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); -+ this.getAttributeMap().registerAttribute(reinforcementChance).setBaseValue(this.rand.nextDouble() * net.minecraftforge.common.ForgeModContainer.zombieSummonBaseChance); - } - - protected void entityInit() -@@ -229,12 +229,25 @@ - entitylivingbase = (EntityLivingBase)source.getEntity(); - } - -- if (entitylivingbase != null && this.worldObj.getDifficulty() == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(reinforcementChance).getAttributeValue()) -+ int i = MathHelper.floor_double(this.posX); -+ int j = MathHelper.floor_double(this.posY); -+ int k = MathHelper.floor_double(this.posZ); -+ -+ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent summonAid = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, worldObj, i, j, k, entitylivingbase, this.getEntityAttribute(reinforcementChance).getAttributeValue()); -+ if (summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return true; -+ -+ if (summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || -+ entitylivingbase != null && this.worldObj.getDifficulty() == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(reinforcementChance).getAttributeValue()) - { -- int i = MathHelper.floor_double(this.posX); -- int j = MathHelper.floor_double(this.posY); -- int k = MathHelper.floor_double(this.posZ); -- EntityZombie entityzombie = new EntityZombie(this.worldObj); -+ EntityZombie entityzombie; -+ if (summonAid.customSummonedAid != null && summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) -+ { -+ entityzombie = summonAid.customSummonedAid; -+ } -+ else -+ { -+ entityzombie = new EntityZombie(this.worldObj); -+ } - - for (int l = 0; l < 50; ++l) - { -@@ -249,7 +262,7 @@ - if (!this.worldObj.isAnyPlayerWithinRangeAt((double)i1, (double)j1, (double)k1, 7.0D) && this.worldObj.checkNoEntityCollision(entityzombie.getEntityBoundingBox(), entityzombie) && this.worldObj.getCollidingBoundingBoxes(entityzombie, entityzombie.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(entityzombie.getEntityBoundingBox())) +@@ -279,7 +279,7 @@ + if (!this.worldObj.isAnyPlayerWithinRangeAt((double)i1, (double)j1, (double)k1, 7.0D) && this.worldObj.checkNoEntityCollision(entityzombie.getEntityBoundingBox(), entityzombie) && this.worldObj.func_184144_a(entityzombie, entityzombie.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(entityzombie.getEntityBoundingBox())) { this.worldObj.spawnEntityInWorld(entityzombie); - entityzombie.setAttackTarget(entitylivingbase); @@ -49,7 +9,7 @@ entityzombie.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), (IEntityLivingData)null); this.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); entityzombie.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); -@@ -465,7 +478,7 @@ +@@ -483,7 +483,7 @@ if (livingdata == null) { diff --git a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch b/patches.mcp/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch index 172f84a75b..23074bd5b6 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityHorse.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityHorse.java -@@ -1247,6 +1247,7 @@ +@@ -1200,6 +1200,7 @@ } this.jumpPower = 0.0F; diff --git a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches.mcp/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch index fe79857772..10eafe85ac 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -1,36 +1,18 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityMooshroom.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityMooshroom.java -@@ -9,7 +9,7 @@ - import net.minecraft.util.EnumParticleTypes; +@@ -13,7 +13,7 @@ import net.minecraft.world.World; + import net.minecraft.world.storage.loot.LootTableList; -public class EntityMooshroom extends EntityCow +public class EntityMooshroom extends EntityCow implements net.minecraftforge.common.IShearable { public EntityMooshroom(World worldIn) { -@@ -18,6 +18,7 @@ - this.spawnableBlock = Blocks.mycelium; - } - -+ @SuppressWarnings("unused") - public boolean interact(EntityPlayer player) - { - ItemStack itemstack = player.inventory.getCurrentItem(); -@@ -37,7 +38,7 @@ - } - } - -- if (itemstack != null && itemstack.getItem() == Items.shears && this.getGrowingAge() >= 0) -+ if (false && itemstack != null && itemstack.getItem() == Items.shears && this.getGrowingAge() >= 0) //Forge Disable, Moved to onSheared - { - this.setDead(); - this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); -@@ -77,4 +78,33 @@ - { +@@ -78,6 +78,35 @@ return new EntityMooshroom(this.worldObj); } -+ + + @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.BlockPos pos){ return getGrowingAge() >= 0; } + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.BlockPos pos, int fortune) @@ -59,4 +41,7 @@ + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + return ret; + } - } ++ + protected ResourceLocation func_184647_J() + { + return LootTableList.field_186400_H; diff --git a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches.mcp/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch deleted file mode 100644 index 247ecdbad1..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/passive/EntityOcelot.java -+++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java -@@ -279,7 +279,7 @@ - - Block block = this.worldObj.getBlockState(blockpos.down()).getBlock(); - -- if (block == Blocks.grass || block.getMaterial() == Material.leaves) -+ if (block == Blocks.grass || block.isLeaves(worldObj, blockpos.down())) - { - return true; - } diff --git a/patches.mcp/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches.mcp/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch index 97fe930d79..762f03bcda 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -1,29 +1,15 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntitySheep.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntitySheep.java -@@ -35,7 +35,7 @@ +@@ -42,7 +42,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class EntitySheep extends EntityAnimal +public class EntitySheep extends EntityAnimal implements net.minecraftforge.common.IShearable { + private static final DataParameter field_184774_bv = EntityDataManager.func_187226_a(EntitySheep.class, DataSerializers.field_187191_a); private final InventoryCrafting inventoryCrafting = new InventoryCrafting(new Container() - { -@@ -140,11 +140,12 @@ - } - } - -+ @SuppressWarnings("unused") - public boolean interact(EntityPlayer player) - { - ItemStack itemstack = player.inventory.getCurrentItem(); - -- if (itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) -+ if (false && itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) //Forge: Moved to onSheared - { - if (!this.worldObj.isRemote) - { -@@ -327,4 +328,19 @@ +@@ -356,4 +356,19 @@ DYE_TO_RGB.put(EnumDyeColor.RED, new float[] {0.6F, 0.2F, 0.2F}); DYE_TO_RGB.put(EnumDyeColor.BLACK, new float[] {0.1F, 0.1F, 0.1F}); } diff --git a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch b/patches.mcp/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch index e744501189..53207949d7 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch @@ -1,23 +1,15 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java -@@ -81,6 +81,7 @@ - private boolean isLookingForHome; - private boolean areAdditionalTasksSet; - private InventoryBasic villagerInventory; -+ @Deprecated //Use VillagerRegistry - private static final EntityVillager.ITradeList[][][][] DEFAULT_TRADE_LIST_MAP = new EntityVillager.ITradeList[][][][] {{{{new EntityVillager.EmeraldForItems(Items.wheat, new EntityVillager.PriceInfo(18, 22)), new EntityVillager.EmeraldForItems(Items.potato, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.EmeraldForItems(Items.carrot, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.ListItemForEmeralds(Items.bread, new EntityVillager.PriceInfo(-4, -2))}, {new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), new EntityVillager.PriceInfo(8, 13)), new EntityVillager.ListItemForEmeralds(Items.pumpkin_pie, new EntityVillager.PriceInfo(-3, -2))}, {new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), new EntityVillager.PriceInfo(7, 12)), new EntityVillager.ListItemForEmeralds(Items.apple, new EntityVillager.PriceInfo(-5, -7))}, {new EntityVillager.ListItemForEmeralds(Items.cookie, new EntityVillager.PriceInfo(-6, -10)), new EntityVillager.ListItemForEmeralds(Items.cake, new EntityVillager.PriceInfo(1, 1))}}, {{new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ItemAndEmeraldToItem(Items.fish, new EntityVillager.PriceInfo(6, 6), Items.cooked_fish, new EntityVillager.PriceInfo(6, 6))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.fishing_rod, new EntityVillager.PriceInfo(7, 8))}}, {{new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.wool), new EntityVillager.PriceInfo(16, 22)), new EntityVillager.ListItemForEmeralds(Items.shears, new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 1), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 2), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 3), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 4), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 5), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 6), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 7), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 8), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 9), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 10), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 11), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 12), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 13), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 14), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 15), new EntityVillager.PriceInfo(1, 2))}}, {{new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.ListItemForEmeralds(Items.arrow, new EntityVillager.PriceInfo(-12, -8))}, {new EntityVillager.ListItemForEmeralds(Items.bow, new EntityVillager.PriceInfo(2, 3)), new EntityVillager.ItemAndEmeraldToItem(Item.getItemFromBlock(Blocks.gravel), new EntityVillager.PriceInfo(10, 10), Items.flint, new EntityVillager.PriceInfo(6, 10))}}}, {{{new EntityVillager.EmeraldForItems(Items.paper, new EntityVillager.PriceInfo(24, 36)), new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.EmeraldForItems(Items.book, new EntityVillager.PriceInfo(8, 10)), new EntityVillager.ListItemForEmeralds(Items.compass, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.bookshelf), new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.EmeraldForItems(Items.written_book, new EntityVillager.PriceInfo(2, 2)), new EntityVillager.ListItemForEmeralds(Items.clock, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glass), new EntityVillager.PriceInfo(-5, -3))}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListItemForEmeralds(Items.name_tag, new EntityVillager.PriceInfo(20, 22))}}}, {{{new EntityVillager.EmeraldForItems(Items.rotten_flesh, new EntityVillager.PriceInfo(36, 40)), new EntityVillager.EmeraldForItems(Items.gold_ingot, new EntityVillager.PriceInfo(8, 10))}, {new EntityVillager.ListItemForEmeralds(Items.redstone, new EntityVillager.PriceInfo(-4, -1)), new EntityVillager.ListItemForEmeralds(new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new EntityVillager.PriceInfo(-2, -1))}, {new EntityVillager.ListItemForEmeralds(Items.ender_eye, new EntityVillager.PriceInfo(7, 11)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glowstone), new EntityVillager.PriceInfo(-3, -1))}, {new EntityVillager.ListItemForEmeralds(Items.experience_bottle, new EntityVillager.PriceInfo(3, 11))}}}, {{{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.iron_helmet, new EntityVillager.PriceInfo(4, 6))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListItemForEmeralds(Items.iron_chestplate, new EntityVillager.PriceInfo(10, 14))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_chestplate, new EntityVillager.PriceInfo(16, 19))}, {new EntityVillager.ListItemForEmeralds(Items.chainmail_boots, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.chainmail_leggings, new EntityVillager.PriceInfo(9, 11)), new EntityVillager.ListItemForEmeralds(Items.chainmail_helmet, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.chainmail_chestplate, new EntityVillager.PriceInfo(11, 15))}}, {{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.iron_axe, new EntityVillager.PriceInfo(6, 8))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_sword, new EntityVillager.PriceInfo(9, 10))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_sword, new EntityVillager.PriceInfo(12, 15)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_axe, new EntityVillager.PriceInfo(9, 12))}}, {{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_shovel, new EntityVillager.PriceInfo(5, 7))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_pickaxe, new EntityVillager.PriceInfo(9, 11))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_pickaxe, new EntityVillager.PriceInfo(12, 15))}}}, {{{new EntityVillager.EmeraldForItems(Items.porkchop, new EntityVillager.PriceInfo(14, 18)), new EntityVillager.EmeraldForItems(Items.chicken, new EntityVillager.PriceInfo(14, 18))}, {new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.cooked_porkchop, new EntityVillager.PriceInfo(-7, -5)), new EntityVillager.ListItemForEmeralds(Items.cooked_chicken, new EntityVillager.PriceInfo(-8, -6))}}, {{new EntityVillager.EmeraldForItems(Items.leather, new EntityVillager.PriceInfo(9, 12)), new EntityVillager.ListItemForEmeralds(Items.leather_leggings, new EntityVillager.PriceInfo(2, 4))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.leather_chestplate, new EntityVillager.PriceInfo(7, 12))}, {new EntityVillager.ListItemForEmeralds(Items.saddle, new EntityVillager.PriceInfo(8, 10))}}}}; - - public EntityVillager(World worldIn) -@@ -210,7 +211,7 @@ - ItemStack itemstack = player.inventory.getCurrentItem(); - boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg; +@@ -221,7 +221,7 @@ + { + boolean flag = p_184645_3_ != null && p_184645_3_.getItem() == Items.spawn_egg; - if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild()) + if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !player.isSneaking()) { - if (!this.worldObj.isRemote && (this.buyingList == null || this.buyingList.size() > 0)) + if (!this.worldObj.isRemote && (this.buyingList == null || !this.buyingList.isEmpty())) { -@@ -522,6 +523,7 @@ +@@ -533,6 +533,7 @@ private void populateBuyingList() { @@ -25,15 +17,15 @@ EntityVillager.ITradeList[][][] aentityvillager$itradelist = DEFAULT_TRADE_LIST_MAP[this.getProfession()]; if (this.careerId != 0 && this.careerLevel != 0) -@@ -635,6 +637,7 @@ +@@ -647,6 +648,7 @@ } } + //TODO: Hook into VillagerRegistry to get name if (s1 != null) { - ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("entity.Villager." + s1, new Object[0]); -@@ -697,7 +700,7 @@ + TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("entity.Villager." + s1, new Object[0]); +@@ -708,7 +710,7 @@ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) { livingdata = super.onInitialSpawn(difficulty, livingdata); diff --git a/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index 66f4725bfb..913f63e486 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -1,28 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayer.java +++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayer.java -@@ -80,6 +80,11 @@ - @SuppressWarnings("incomplete-switch") - public abstract class EntityPlayer extends EntityLivingBase - { -+ public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; -+ private java.util.HashMap spawnChunkMap = new java.util.HashMap(); -+ private java.util.HashMap spawnForcedMap = new java.util.HashMap(); -+ public float eyeHeight = this.getDefaultEyeHeight(); -+ - public InventoryPlayer inventory = new InventoryPlayer(this); - private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); - public Container inventoryContainer; -@@ -175,7 +180,8 @@ - { - if (this.itemInUse != null) - { -- this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); -+ if (!net.minecraftforge.event.ForgeEventFactory.onUseItemStop(this, itemInUse, this.itemInUseCount)) -+ this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); - } - - this.clearItemInUse(); -@@ -199,6 +205,7 @@ +@@ -174,6 +174,7 @@ public void onUpdate() { @@ -30,30 +8,15 @@ this.noClip = this.isSpectator(); if (this.isSpectator()) -@@ -212,6 +219,14 @@ - - if (itemstack == this.itemInUse) - { -+ itemInUseCount = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, itemInUse, itemInUseCount); -+ if (itemInUseCount <= 0) -+ { -+ this.onItemUseFinish(); -+ } -+ else -+ { // Forge Keep unindented to lower patch -+ itemInUse.getItem().onUsingTick(itemInUse, this, itemInUseCount); //Forge Added - if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) +@@ -205,6 +206,7 @@ { - this.updateItemUse(itemstack, 5); -@@ -221,6 +236,7 @@ - { - this.onItemUseFinish(); + this.wakeUpPlayer(false, true, true); } + } } - else - { -@@ -266,7 +282,7 @@ + } + else if (this.sleepTimer > 0) +@@ -219,7 +221,7 @@ super.onUpdate(); @@ -62,43 +25,15 @@ { this.closeScreen(); this.openContainer = this.inventoryContainer; -@@ -343,6 +359,7 @@ - { - this.setPosition(d3, this.posY, d4); +@@ -360,6 +362,7 @@ + this.setSize(f, f1); + } } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPlayerPostTick(this); } public int getMaxInPortalTime() -@@ -412,11 +429,12 @@ - int i = this.itemInUse.stackSize; - ItemStack itemstack = this.itemInUse.onItemUseFinish(this.worldObj, this); - -+ itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, itemInUse, itemInUseCount, itemstack); - if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i) - { - this.inventory.mainInventory[this.inventory.currentItem] = itemstack; - -- if (itemstack.stackSize == 0) -+ if (itemstack != null && itemstack.stackSize == 0) - { - this.inventory.mainInventory[this.inventory.currentItem] = null; - } -@@ -476,11 +494,11 @@ - this.cameraYaw = 0.0F; - this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); - -- if (this.ridingEntity instanceof EntityPig) -+ if (this.ridingEntity instanceof EntityLivingBase && ((EntityLivingBase)ridingEntity).shouldRiderFaceForward(this)) - { - this.rotationPitch = f1; - this.rotationYaw = f; -- this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; -+ this.renderYawOffset = ((EntityLivingBase)this.ridingEntity).renderYawOffset; - } - } - } -@@ -610,11 +628,15 @@ +@@ -576,11 +579,15 @@ public void onDeath(DamageSource cause) { @@ -114,7 +49,7 @@ if (this.getName().equals("Notch")) { this.dropItem(new ItemStack(Items.apple, 1), true, false); -@@ -625,6 +647,9 @@ +@@ -591,6 +598,9 @@ this.inventory.dropAllItems(); } @@ -123,8 +58,8 @@ + if (cause != null) { - this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); -@@ -707,12 +732,25 @@ + this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * 0.017453292F) * 0.1F); +@@ -678,12 +688,25 @@ public EntityItem dropOneItem(boolean dropAll) { @@ -152,50 +87,7 @@ } public EntityItem dropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem) -@@ -770,13 +808,25 @@ - - public void joinEntityItemWithWorld(EntityItem itemIn) - { -+ if (captureDrops) -+ { -+ capturedDrops.add(itemIn); -+ return; -+ } -+ - this.worldObj.spawnEntityInWorld(itemIn); - } - -+ @Deprecated //Use location sensitive version below - public float getToolDigEfficiency(Block p_180471_1_) - { -- float f = this.inventory.getStrVsBlock(p_180471_1_); -+ return getBreakSpeed(p_180471_1_.getDefaultState(), new BlockPos(0, -1, 0)); -+ } - -+ public float getBreakSpeed(IBlockState state, BlockPos pos) -+ { -+ ItemStack stack = inventory.getCurrentItem(); -+ float f = (stack == null ? 1.0F : stack.getItem().getDigSpeed(stack, state)); - if (f > 1.0F) - { - int i = EnchantmentHelper.getEfficiencyModifier(this); -@@ -826,12 +876,13 @@ - f /= 5.0F; - } - -- return f; -+ f = net.minecraftforge.event.ForgeEventFactory.getBreakSpeed(this, state, f, pos); -+ return (f < 0 ? 0 : f); - } - - public boolean canHarvestBlock(Block blockToHarvest) - { -- return this.inventory.canHeldItemHarvest(blockToHarvest); -+ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, blockToHarvest, this.inventory.canHeldItemHarvest(blockToHarvest)); - } - - public void readEntityFromNBT(NBTTagCompound tagCompund) -@@ -867,6 +918,16 @@ +@@ -845,6 +868,16 @@ this.spawnForced = tagCompund.getBoolean("SpawnForced"); } @@ -212,7 +104,7 @@ this.foodStats.readNBT(tagCompund); this.capabilities.readCapabilitiesFromNBT(tagCompund); -@@ -898,6 +959,23 @@ +@@ -877,6 +910,23 @@ tagCompound.setBoolean("SpawnForced", this.spawnForced); } @@ -236,7 +128,7 @@ this.foodStats.writeNBT(tagCompound); this.capabilities.writeCapabilitiesToNBT(tagCompound); tagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); -@@ -911,6 +989,7 @@ +@@ -884,6 +934,7 @@ public boolean attackEntityFrom(DamageSource source, float amount) { @@ -244,42 +136,7 @@ if (this.isEntityInvulnerable(source)) { return false; -@@ -1007,12 +1086,15 @@ - { - if (!this.isEntityInvulnerable(damageSrc)) - { -+ damageAmount = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, damageSrc, damageAmount); -+ if (damageAmount <= 0) return; - if (!damageSrc.isUnblockable() && this.isBlocking() && damageAmount > 0.0F) - { - damageAmount = (1.0F + damageAmount) * 0.5F; - } - -- damageAmount = this.applyArmorCalculations(damageSrc, damageAmount); -+ damageAmount = net.minecraftforge.common.ISpecialArmor.ArmorProperties.applyArmor(this, inventory.armorInventory, damageSrc, damageAmount); -+ if (damageAmount <= 0) return; - damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount); - float f = damageAmount; - damageAmount = Math.max(damageAmount - this.getAbsorptionAmount(), 0.0F); -@@ -1074,6 +1156,7 @@ - } - else - { -+ if (!net.minecraftforge.event.ForgeEventFactory.canInteractWith(this, targetEntity)) return false; - ItemStack itemstack = this.getCurrentEquippedItem(); - ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; - -@@ -1125,7 +1208,9 @@ - - public void destroyCurrentEquippedItem() - { -+ ItemStack orig = getCurrentEquippedItem(); - this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, orig); - } - - public double getYOffset() -@@ -1135,6 +1220,7 @@ +@@ -1123,6 +1174,7 @@ public void attackTargetEntityWithCurrentItem(Entity targetEntity) { @@ -287,7 +144,7 @@ if (targetEntity.canAttackWithItem()) { if (!targetEntity.hitByEntity(this)) -@@ -1311,6 +1397,8 @@ +@@ -1410,6 +1462,8 @@ public EntityPlayer.EnumStatus trySleep(BlockPos bedLocation) { @@ -296,19 +153,7 @@ if (!this.worldObj.isRemote) { if (this.isPlayerSleeping() || !this.isEntityAlive()) -@@ -1350,9 +1438,9 @@ - - this.setSize(0.2F, 0.2F); - -- if (this.worldObj.isBlockLoaded(bedLocation)) -+ if (this.worldObj.isBlockLoaded(bedLocation) && worldObj.getBlockState(bedLocation).getBlock().isBed(worldObj, bedLocation, this)) - { -- EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(bedLocation).getValue(BlockDirectional.FACING); -+ EnumFacing enumfacing = this.worldObj.getBlockState(bedLocation).getBlock().getBedDirection(worldObj, bedLocation); - float f = 0.5F; - float f1 = 0.5F; - -@@ -1415,13 +1503,14 @@ +@@ -1514,13 +1568,14 @@ public void wakeUpPlayer(boolean p_70999_1_, boolean updateWorldFlag, boolean setSpawn) { @@ -326,7 +171,7 @@ if (blockpos == null) { -@@ -1430,6 +1519,10 @@ +@@ -1529,6 +1584,10 @@ this.setPosition((double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.1F), (double)((float)blockpos.getZ() + 0.5F)); } @@ -337,7 +182,7 @@ this.sleeping = false; -@@ -1448,14 +1541,14 @@ +@@ -1547,14 +1606,14 @@ private boolean isInBed() { @@ -354,27 +199,7 @@ { if (!forceSpawn) { -@@ -1470,16 +1563,16 @@ - } - else - { -- return BlockBed.getSafeExitLocation(worldIn, bedLocation, 0); -+ return worldIn.getBlockState(bedLocation).getBlock().getBedSpawnPosition(worldIn, bedLocation, null); - } - } - - @SideOnly(Side.CLIENT) - public float getBedOrientationInDegrees() - { -- if (this.playerLocation != null) -+ if (this.playerLocation != null && worldObj.getBlockState(playerLocation).getBlock().isBed(worldObj, playerLocation, this)) - { -- EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(this.playerLocation).getValue(BlockDirectional.FACING); -+ EnumFacing enumfacing = this.worldObj.getBlockState(this.playerLocation).getBlock().getBedDirection(worldObj, playerLocation); - - switch (enumfacing) - { -@@ -1519,16 +1612,24 @@ +@@ -1618,16 +1677,24 @@ public BlockPos getBedLocation() { @@ -401,7 +226,7 @@ if (pos != null) { this.spawnChunk = pos; -@@ -1712,6 +1813,10 @@ +@@ -1822,6 +1889,10 @@ super.fall(distance, damageMultiplier); } @@ -412,24 +237,7 @@ } protected void resetHeight() -@@ -1735,6 +1840,7 @@ - } - - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entityLivingIn))); -+ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.getEntityString(entityLivingIn)); - - if (entitylist$entityegginfo != null) - { -@@ -1847,6 +1953,8 @@ - { - if (stack != this.itemInUse) - { -+ duration = net.minecraftforge.event.ForgeEventFactory.onItemUseStart(this, stack, duration); -+ if (duration <= 0) return; - this.itemInUse = stack; - this.itemInUseCount = duration; - -@@ -1918,6 +2026,10 @@ +@@ -2009,6 +2080,10 @@ this.field_181016_an = oldPlayer.field_181016_an; this.field_181017_ao = oldPlayer.field_181017_ao; this.field_181018_ap = oldPlayer.field_181018_ap; @@ -438,56 +246,9 @@ + for (net.minecraftforge.common.IExtendedEntityProperties p : this.extendedProperties.values()) + p.init(this, this.worldObj); } - else if (this.worldObj.getGameRules().getBoolean("keepInventory")) + else if (this.worldObj.getGameRules().getBoolean("keepInventory") || oldPlayer.isSpectator()) { -@@ -1931,6 +2043,18 @@ - this.xpSeed = oldPlayer.xpSeed; - this.theInventoryEnderChest = oldPlayer.theInventoryEnderChest; - this.getDataWatcher().updateObject(10, Byte.valueOf(oldPlayer.getDataWatcher().getWatchableObjectByte(10))); -+ -+ this.spawnChunkMap = oldPlayer.spawnChunkMap; -+ this.spawnForcedMap = oldPlayer.spawnForcedMap; -+ -+ //Copy over a section of the Entity Data from the old player. -+ //Allows mods to specify data that persists after players respawn. -+ NBTTagCompound old = oldPlayer.getEntityData(); -+ if (old.hasKey(PERSISTED_NBT_TAG)) -+ { -+ getEntityData().setTag(PERSISTED_NBT_TAG, old.getCompoundTag(PERSISTED_NBT_TAG)); -+ } -+ net.minecraftforge.event.ForgeEventFactory.onPlayerClone(this, oldPlayer, !respawnFromEnd); - } - - protected boolean canTriggerWalking() -@@ -1968,7 +2092,14 @@ - - public void setCurrentItemOrArmor(int slotIn, ItemStack stack) - { -- this.inventory.armorInventory[slotIn] = stack; -+ if (slotIn == 0) //Forge: Fix issue in Player where it doen't take into account selected item -+ { -+ this.inventory.mainInventory[this.inventory.currentItem] = stack; -+ } -+ else -+ { -+ this.inventory.armorInventory[slotIn - 1] = stack; -+ } - } - - @SideOnly(Side.CLIENT) -@@ -2013,7 +2144,10 @@ - - public IChatComponent getDisplayName() - { -- IChatComponent ichatcomponent = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getName())); -+ IChatComponent ichatcomponent = new ChatComponentText(""); -+ if (!prefixes.isEmpty()) for (net.minecraft.util.IChatComponent prefix : prefixes) ichatcomponent.appendSibling(prefix); -+ ichatcomponent.appendSibling(new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getDisplayNameString()))); -+ if (!suffixes.isEmpty()) for (net.minecraft.util.IChatComponent suffix : suffixes) ichatcomponent.appendSibling(suffix); - ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getName() + " ")); - ichatcomponent.getChatStyle().setChatHoverEvent(this.getHoverEvent()); - ichatcomponent.getChatStyle().setInsertion(this.getName()); -@@ -2022,7 +2156,7 @@ +@@ -2129,7 +2204,7 @@ public float getEyeHeight() { @@ -496,8 +257,8 @@ if (this.isPlayerSleeping()) { -@@ -2155,6 +2289,136 @@ - this.hasReducedDebug = reducedDebug; +@@ -2340,6 +2415,136 @@ + return (float)this.getEntityAttribute(SharedMonsterAttributes.field_188792_h).getAttributeValue(); } + /** diff --git a/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index 0adab5b6c7..e5c9a28a24 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -1,24 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java +++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java -@@ -123,14 +123,15 @@ - public int ping; - public boolean playerConqueredTheEnd; - -+ @SuppressWarnings("unused") - public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, ItemInWorldManager interactionManager) - { - super(worldIn, profile); - interactionManager.thisPlayerMP = this; - this.theItemInWorldManager = interactionManager; -- BlockPos blockpos = worldIn.getSpawnPoint(); -+ BlockPos blockpos = worldIn.provider.getRandomizedSpawnPoint(); - -- if (!worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) -+ if (false && !worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) - { - int i = Math.max(5, server.getSpawnProtectionSize() - 6); - int j = MathHelper.floor_double(worldIn.getWorldBorder().getClosestDistance((double)blockpos.getX(), (double)blockpos.getZ())); -@@ -223,7 +224,7 @@ +@@ -250,7 +250,7 @@ this.openContainer.detectAndSendChanges(); @@ -27,25 +9,9 @@ { this.closeScreen(); this.openContainer = this.inventoryContainer; -@@ -294,6 +295,7 @@ - for (Chunk chunk1 : list) - { - this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(chunk1.getChunkCoordIntPair(), this)); - } - } - } -@@ -424,6 +426,7 @@ +@@ -459,7 +459,20 @@ - public void onDeath(DamageSource cause) - { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; - if (this.worldObj.getGameRules().getBoolean("showDeathMessages")) - { - Team team = this.getTeam(); -@@ -447,7 +450,20 @@ - - if (!this.worldObj.getGameRules().getBoolean("keepInventory")) + if (!this.worldObj.getGameRules().getBoolean("keepInventory") && !this.isSpectator()) { + captureDrops = true; + capturedDrops.clear(); @@ -63,24 +29,8 @@ + } } - for (ScoreObjective scoreobjective : this.worldObj.getScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.deathCount)) -@@ -461,6 +477,7 @@ - if (entitylivingbase != null) - { - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase))); -+ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.getEntityString(entitylivingbase)); - - if (entitylist$entityegginfo != null) - { -@@ -528,6 +545,7 @@ - - public void travelToDimension(int dimensionId) - { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, dimensionId)) return; - if (this.dimension == 1 && dimensionId == 1) - { - this.triggerAchievement(AchievementList.theEnd2); -@@ -831,6 +849,7 @@ + for (ScoreObjective scoreobjective : this.worldObj.getScoreboard().getObjectivesFromCriteria(IScoreCriteria.deathCount)) +@@ -921,6 +934,7 @@ { if (stat != null) { diff --git a/patches.mcp/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches.mcp/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index 7639ca0cc9..26b44efcd6 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,22 +1,7 @@ --- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java +++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java -@@ -272,12 +272,8 @@ - { - if (this.mainInventory[j] == null) - { -- this.mainInventory[j] = new ItemStack(item, 0, itemStackIn.getMetadata()); -- -- if (itemStackIn.hasTagCompound()) -- { -- this.mainInventory[j].setTagCompound((NBTTagCompound)itemStackIn.getTagCompound().copy()); -- } -+ this.mainInventory[j] = itemStackIn.copy(); // Forge: Replace Item clone above to preserve item capabilities when picking the item up. -+ this.mainInventory[j].stackSize = 0; - } - - int k = i; -@@ -315,6 +311,14 @@ - this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); +@@ -304,6 +304,14 @@ + return i; } } + @@ -29,4 +14,4 @@ + } } - public boolean consumeInventoryItem(Item itemIn) + private int storeItemStack(ItemStack itemStackIn) diff --git a/patches.mcp/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch b/patches.mcp/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch deleted file mode 100644 index fa1e0f4b7c..0000000000 --- a/patches.mcp/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/projectile/EntityFishHook.java -+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityFishHook.java -@@ -567,11 +567,19 @@ - } - } - -+ @SuppressWarnings("unused") - private ItemStack getFishingResult() - { - float f = this.worldObj.rand.nextFloat(); - int i = EnchantmentHelper.getLuckOfSeaModifier(this.angler); - int j = EnchantmentHelper.getLureModifier(this.angler); -+ -+ if (true) -+ { -+ this.angler.addStat(net.minecraftforge.common.FishingHooks.getFishableCategory(f, i, j).stat, 1); -+ return net.minecraftforge.common.FishingHooks.getRandomFishable(this.rand, f, i, j); -+ } -+ - float f1 = 0.1F - (float)i * 0.025F - (float)j * 0.01F; - float f2 = 0.05F + (float)i * 0.01F - (float)j * 0.01F; - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); diff --git a/patches.mcp/minecraft/net/minecraft/init/Bootstrap.java.patch b/patches.mcp/minecraft/net/minecraft/init/Bootstrap.java.patch index c1ce77797c..7033d745ae 100644 --- a/patches.mcp/minecraft/net/minecraft/init/Bootstrap.java.patch +++ b/patches.mcp/minecraft/net/minecraft/init/Bootstrap.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/init/Bootstrap.java +++ ../src-work/minecraft/net/minecraft/init/Bootstrap.java -@@ -65,6 +65,7 @@ +@@ -74,6 +74,7 @@ return alreadyRegistered; } @@ -8,12 +8,3 @@ static void registerDispenserBehaviors() { BlockDispenser.dispenseBehaviorRegistry.putObject(Items.arrow, new BehaviorProjectileDispense() -@@ -135,7 +136,7 @@ - double d0 = source.getX() + (double)enumfacing.getFrontOffsetX(); - double d1 = (double)((float)source.getBlockPos().getY() + 0.2F); - double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); -- Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), stack.getMetadata(), d0, d1, d2); -+ Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), ItemMonsterPlacer.getEntityName(stack), d0, d1, d2); - - if (entity instanceof EntityLivingBase && stack.hasDisplayName()) - { diff --git a/patches.mcp/minecraft/net/minecraft/inventory/Container.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/Container.java.patch index 84a24da4df..0c7a86b06c 100644 --- a/patches.mcp/minecraft/net/minecraft/inventory/Container.java.patch +++ b/patches.mcp/minecraft/net/minecraft/inventory/Container.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/Container.java +++ ../src-work/minecraft/net/minecraft/inventory/Container.java -@@ -608,7 +608,7 @@ +@@ -646,7 +646,7 @@ Slot slot1 = (Slot)this.inventorySlots.get(i); ItemStack itemstack1 = slot1.getStack(); diff --git a/patches.mcp/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch deleted file mode 100644 index fa6d5d0171..0000000000 --- a/patches.mcp/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/inventory/ContainerBrewingStand.java -+++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java -@@ -154,7 +154,7 @@ - - public boolean isItemValid(ItemStack stack) - { -- return stack != null ? stack.getItem().isPotionIngredient(stack) : false; -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(stack); - } - - public int getSlotStackLimit() -@@ -185,7 +185,7 @@ - - public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) - { -- if (stack.getItem() == Items.potionitem && stack.getMetadata() > 0) -+ if (stack.getItem() instanceof net.minecraft.item.ItemPotion && stack.getMetadata() > 0) - { - this.player.triggerAchievement(AchievementList.potion); - } -@@ -195,7 +195,7 @@ - - public static boolean canHoldPotion(ItemStack stack) - { -- return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle); -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(stack); - } - } - } diff --git a/patches.mcp/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch index 292d16a78e..41a1e9c6f1 100644 --- a/patches.mcp/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ b/patches.mcp/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerEnchantment.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerEnchantment.java -@@ -65,9 +65,12 @@ +@@ -68,9 +68,12 @@ }); this.addSlotToContainer(new Slot(this.tableInventory, 1, 35, 47) { @@ -14,7 +14,7 @@ } }); -@@ -146,6 +149,7 @@ +@@ -155,6 +158,7 @@ if (!this.worldPointer.isRemote) { int l = 0; @@ -22,7 +22,7 @@ for (int j = -1; j <= 1; ++j) { -@@ -153,37 +157,14 @@ +@@ -162,37 +166,14 @@ { if ((j != 0 || k != 0) && this.worldPointer.isAirBlock(this.position.add(k, 0, j)) && this.worldPointer.isAirBlock(this.position.add(k, 1, j))) { @@ -66,12 +66,12 @@ } } } -@@ -193,7 +174,7 @@ +@@ -202,7 +183,7 @@ for (int i1 = 0; i1 < 3; ++i1) { - this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, l, itemstack); + this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, (int)power, itemstack); - this.field_178151_h[i1] = -1; + this.field_185001_h[i1] = -1; + this.field_185002_i[i1] = -1; - if (this.enchantLevels[i1] < i1 + 1) diff --git a/patches.mcp/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch deleted file mode 100644 index 2b87f8433e..0000000000 --- a/patches.mcp/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/inventory/ContainerPlayer.java -+++ ../src-work/minecraft/net/minecraft/inventory/ContainerPlayer.java -@@ -43,7 +43,8 @@ - } - public boolean isItemValid(ItemStack stack) - { -- return stack == null ? false : (stack.getItem() instanceof ItemArmor ? ((ItemArmor)stack.getItem()).armorType == k_f : (stack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull ? false : k_f == 0)); -+ if (stack == null) return false; -+ return stack.getItem().isValidArmor(stack, k_f, thePlayer); - } - @SideOnly(Side.CLIENT) - public String getSlotTexture() diff --git a/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch index 8ca672062a..3d5e67896d 100644 --- a/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ b/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java -@@ -70,6 +70,8 @@ +@@ -69,6 +69,8 @@ playerIn.addExperienceLevel(-ContainerRepair.this.maximumCost); } @@ -9,7 +9,7 @@ ContainerRepair.this.inputSlots.setInventorySlotContents(0, (ItemStack)null); if (ContainerRepair.this.materialCost > 0) -@@ -94,7 +96,7 @@ +@@ -93,7 +95,7 @@ ContainerRepair.this.maximumCost = 0; IBlockState iblockstate = worldIn.getBlockState(blockPosIn); @@ -18,25 +18,24 @@ { int l = ((Integer)iblockstate.getValue(BlockAnvil.DAMAGE)).intValue(); ++l; -@@ -172,6 +174,7 @@ +@@ -163,6 +165,7 @@ if (itemstack2 != null) { -+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, outputSlot, repairedItemName, i2)) return; - flag = itemstack2.getItem() == Items.enchanted_book && Items.enchanted_book.getEnchantments(itemstack2).tagCount() > 0; ++ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, outputSlot, repairedItemName, j)) return; + boolean flag = itemstack2.getItem() == Items.enchanted_book && !Items.enchanted_book.getEnchantments(itemstack2).hasNoTags(); if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) -@@ -264,7 +267,8 @@ - { - int i4 = ((Integer)iterator.next()).intValue(); +@@ -235,7 +238,7 @@ -- if (i4 != i5 && !enchantment.canApplyTogether(Enchantment.getEnchantmentById(i4))) -+ Enchantment e2 = Enchantment.getEnchantmentById(i4); -+ if (i4 != i5 && !(enchantment.canApplyTogether(e2) && e2.canApplyTogether(enchantment))) //Forge BugFix: Let Both enchantments veto being together + for (Enchantment enchantment : map.keySet()) + { +- if (enchantment != enchantment1 && !enchantment1.canApplyTogether(enchantment)) ++ if (enchantment != enchantment1 && !(enchantment1.canApplyTogether(enchantment) && enchantment.canApplyTogether(enchantment1))) //Forge BugFix: Let Both enchantments veto being together { flag1 = false; - ++l1; -@@ -315,6 +319,8 @@ + ++i; +@@ -279,6 +282,8 @@ } } diff --git a/patches.mcp/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/SlotCrafting.java.patch index 59cf4f6175..e4aff0d46a 100644 --- a/patches.mcp/minecraft/net/minecraft/inventory/SlotCrafting.java.patch +++ b/patches.mcp/minecraft/net/minecraft/inventory/SlotCrafting.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/inventory/SlotCrafting.java +++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java -@@ -112,8 +112,11 @@ +@@ -107,8 +107,11 @@ public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) { diff --git a/patches.mcp/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch index 5de127a2d0..c184789a0b 100644 --- a/patches.mcp/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch +++ b/patches.mcp/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch @@ -8,4 +8,4 @@ + if (stack.getItem() == Items.iron_ingot) { - this.thePlayer.triggerAchievement(AchievementList.acquireIron); + this.thePlayer.triggerAchievement(AchievementList.field_187987_k); diff --git a/patches.mcp/minecraft/net/minecraft/item/Item.java.patch b/patches.mcp/minecraft/net/minecraft/item/Item.java.patch index 518fc5a37b..39507cbe8b 100644 --- a/patches.mcp/minecraft/net/minecraft/item/Item.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/Item.java.patch @@ -1,18 +1,7 @@ --- ../src-base/minecraft/net/minecraft/item/Item.java +++ ../src-work/minecraft/net/minecraft/item/Item.java -@@ -48,8 +48,8 @@ - - public class Item - { -- public static final RegistryNamespaced itemRegistry = new RegistryNamespaced(); -- private static final Map BLOCK_TO_ITEM = Maps.newHashMap(); -+ public static final RegistryNamespaced itemRegistry = net.minecraftforge.fml.common.registry.GameData.getItemRegistry(); -+ private static final Map BLOCK_TO_ITEM = net.minecraftforge.fml.common.registry.GameData.getBlockItemMap(); - protected static final UUID itemModifierUUID = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); - private CreativeTabs tabToDisplayOn; - protected static Random itemRand = new Random(); -@@ -61,6 +61,9 @@ - private String potionEffect; +@@ -104,6 +104,9 @@ + private Item containerItem; private String unlocalizedName; + public final net.minecraftforge.fml.common.registry.RegistryDelegate delegate = @@ -21,7 +10,7 @@ public static int getIdFromItem(Item itemIn) { return itemIn == null ? 0 : itemRegistry.getIDForObject(itemIn); -@@ -126,6 +129,7 @@ +@@ -192,6 +195,7 @@ return stack; } @@ -29,7 +18,7 @@ public int getItemStackLimit() { return this.maxStackSize; -@@ -239,6 +243,7 @@ +@@ -312,6 +316,7 @@ return this.containerItem; } @@ -37,7 +26,7 @@ public boolean hasContainerItem() { return this.containerItem != null; -@@ -316,7 +321,7 @@ +@@ -367,7 +372,7 @@ public boolean isItemTool(ItemStack stack) { @@ -45,690 +34,8 @@ + return this.getItemStackLimit(stack) == 1 && this.isDamageable(); } - protected MovingObjectPosition getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer playerIn, boolean useLiquids) -@@ -334,6 +339,10 @@ - float f6 = f3 * f4; - float f7 = f2 * f4; - double d3 = 5.0D; -+ if (playerIn instanceof net.minecraft.entity.player.EntityPlayerMP) -+ { -+ d3 = ((net.minecraft.entity.player.EntityPlayerMP)playerIn).theItemInWorldManager.getBlockReachDistance(); -+ } - Vec3 vec31 = vec3.addVector((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); - return worldIn.rayTraceBlocks(vec3, vec31, useLiquids, !useLiquids, false); - } -@@ -371,11 +380,670 @@ - return false; - } - -+ @Deprecated // Use ItemStack sensitive version below. - public Multimap getItemAttributeModifiers() - { - return HashMultimap.create(); - } - -+ /* ======================================== FORGE START =====================================*/ -+ /** -+ * ItemStack sensitive version of getItemAttributeModifiers -+ */ -+ public Multimap getAttributeModifiers(ItemStack stack) -+ { -+ return this.getItemAttributeModifiers(); -+ } -+ -+ /** -+ * Called when a player drops the item into the world, -+ * returning false from this will prevent the item from -+ * being removed from the players inventory and spawning -+ * in the world -+ * -+ * @param player The player that dropped the item -+ * @param item The item stack, before the item is removed. -+ */ -+ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) -+ { -+ return true; -+ } -+ -+ /** -+ * Allow the item one last chance to modify its name used for the -+ * tool highlight useful for adding something extra that can't be removed -+ * by a user in the displayed name, such as a mode of operation. -+ * -+ * @param item the ItemStack for the item. -+ * @param the name that will be displayed unless it is changed in this method. -+ */ -+ public String getHighlightTip( ItemStack item, String displayName ) -+ { -+ return displayName; -+ } -+ -+ /** -+ * This is called when the item is used, before the block is activated. -+ * @param stack The Item Stack -+ * @param player The Player that used the item -+ * @param world The Current World -+ * @param pos Target position -+ * @param side The side of the target hit -+ * @return Return true to prevent any further processing. -+ */ -+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) -+ { -+ return false; -+ } -+ -+ /** -+ * Metadata-sensitive version of getStrVsBlock -+ * @param itemstack The Item Stack -+ * @param state The block state -+ * @return The damage strength -+ */ -+ public float getDigSpeed(ItemStack itemstack, net.minecraft.block.state.IBlockState state) -+ { -+ return getStrVsBlock(itemstack, state.getBlock()); -+ } -+ -+ -+ protected boolean canRepair = true; -+ /** -+ * Called by CraftingManager to determine if an item is reparable. -+ * @return True if reparable -+ */ -+ public boolean isRepairable() -+ { -+ return canRepair && isDamageable(); -+ } -+ -+ /** -+ * Call to disable repair recipes. -+ * @return The current Item instance -+ */ -+ public Item setNoRepair() -+ { -+ canRepair = false; -+ return this; -+ } -+ -+ /** -+ * Called before a block is broken. Return true to prevent default block harvesting. -+ * -+ * Note: In SMP, this is called on both client and server sides! -+ * -+ * @param itemstack The current ItemStack -+ * @param pos Block's position in world -+ * @param player The Player that is wielding the item -+ * @return True to prevent harvesting, false to continue as normal -+ */ -+ public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player) -+ { -+ return false; -+ } -+ -+ /** -+ * Called each tick while using an item. -+ * @param stack The Item being used -+ * @param player The Player using the item -+ * @param count The amount of time in tick the item has been used for continuously -+ */ -+ public void onUsingTick(ItemStack stack, EntityPlayer player, int count) -+ { -+ } -+ -+ /** -+ * Called when the player Left Clicks (attacks) an entity. -+ * Processed before damage is done, if return value is true further processing is canceled -+ * and the entity is not attacked. -+ * -+ * @param stack The Item being used -+ * @param player The player that is attacking -+ * @param entity The entity being attacked -+ * @return True to cancel the rest of the interaction. -+ */ -+ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) -+ { -+ return false; -+ } -+ -+ /** -+ * Player, Render pass, and item usage sensitive version of getIconIndex. -+ * -+ * @param stack The item stack to get the icon for. -+ * @param player The player holding the item -+ * @param useRemaining The ticks remaining for the active item. -+ * @return Null to use default model, or a custom ModelResourceLocation for the stage of use. -+ */ -+ @SideOnly(Side.CLIENT) -+ public net.minecraft.client.resources.model.ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) -+ { -+ return null; -+ } -+ -+ /** -+ * ItemStack sensitive version of getContainerItem. -+ * Returns a full ItemStack instance of the result. -+ * -+ * @param itemStack The current ItemStack -+ * @return The resulting ItemStack -+ */ -+ public ItemStack getContainerItem(ItemStack itemStack) -+ { -+ if (!hasContainerItem(itemStack)) -+ { -+ return null; -+ } -+ return new ItemStack(getContainerItem()); -+ } -+ -+ /** -+ * ItemStack sensitive version of hasContainerItem -+ * @param stack The current item stack -+ * @return True if this item has a 'container' -+ */ -+ public boolean hasContainerItem(ItemStack stack) -+ { -+ return hasContainerItem(); -+ } -+ -+ /** -+ * Retrieves the normal 'lifespan' of this item when it is dropped on the ground as a EntityItem. -+ * This is in ticks, standard result is 6000, or 5 mins. -+ * -+ * @param itemStack The current ItemStack -+ * @param world The world the entity is in -+ * @return The normal lifespan in ticks. -+ */ -+ public int getEntityLifespan(ItemStack itemStack, World world) -+ { -+ return 6000; -+ } -+ -+ /** -+ * Determines if this Item has a special entity for when they are in the world. -+ * Is called when a EntityItem is spawned in the world, if true and Item#createCustomEntity -+ * returns non null, the EntityItem will be destroyed and the new Entity will be added to the world. -+ * -+ * @param stack The current item stack -+ * @return True of the item has a custom entity, If true, Item#createCustomEntity will be called -+ */ -+ public boolean hasCustomEntity(ItemStack stack) -+ { -+ return false; -+ } -+ -+ /** -+ * This function should return a new entity to replace the dropped item. -+ * Returning null here will not kill the EntityItem and will leave it to function normally. -+ * Called when the item it placed in a world. -+ * -+ * @param world The world object -+ * @param location The EntityItem object, useful for getting the position of the entity -+ * @param itemstack The current item stack -+ * @return A new Entity object to spawn or null -+ */ -+ public Entity createEntity(World world, Entity location, ItemStack itemstack) -+ { -+ return null; -+ } -+ -+ /** -+ * Called by the default implemetation of EntityItem's onUpdate method, allowing for cleaner -+ * control over the update of the item without having to write a subclass. -+ * -+ * @param entityItem The entity Item -+ * @return Return true to skip any further update code. -+ */ -+ public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem) -+ { -+ return false; -+ } -+ -+ /** -+ * Gets a list of tabs that items belonging to this class can display on, -+ * combined properly with getSubItems allows for a single item to span -+ * many sub-items across many tabs. -+ * -+ * @return A list of all tabs that this item could possibly be one. -+ */ -+ public CreativeTabs[] getCreativeTabs() -+ { -+ return new CreativeTabs[]{ getCreativeTab() }; -+ } -+ -+ /** -+ * Determines the base experience for a player when they remove this item from a furnace slot. -+ * This number must be between 0 and 1 for it to be valid. -+ * This number will be multiplied by the stack size to get the total experience. -+ * -+ * @param item The item stack the player is picking up. -+ * @return The amount to award for each item. -+ */ -+ public float getSmeltingExperience(ItemStack item) -+ { -+ return -1; //-1 will default to the old lookups. -+ } -+ -+ /** -+ * Return the correct icon for rendering based on the supplied ItemStack and render pass. -+ * -+ * Defers to {@link #getIconFromDamageForRenderPass(int, int)} -+ * @param stack to render for -+ * @param pass the multi-render pass -+ * @return the icon -+ * / -+ public IIcon getIcon(ItemStack stack, int pass) -+ { -+ return func_77618_c(stack.getMetadata(), pass); -+ } -+ */ -+ -+ /** -+ * Generates the base Random item for a specific instance of the chest gen, -+ * Enchanted books use this to pick a random enchantment. -+ * -+ * @param chest The chest category to generate for -+ * @param rnd World RNG -+ * @param original Original result registered with the chest gen hooks. -+ * @return New values to use as the random item, typically this will be original -+ */ -+ public net.minecraft.util.WeightedRandomChestContent getChestGenBase(net.minecraftforge.common.ChestGenHooks chest, Random rnd, net.minecraft.util.WeightedRandomChestContent original) -+ { -+ if (this instanceof ItemEnchantedBook) -+ { -+ return ((ItemEnchantedBook)this).getRandom(rnd, -+ original.minStackSize, -+ original.maxStackSize, original.itemWeight); -+ } -+ return original; -+ } -+ -+ /** -+ * -+ * Should this item, when held, allow sneak-clicks to pass through to the underlying block? -+ * -+ * @param world The world -+ * @param pos Block position in world -+ * @param player The Player that is wielding the item -+ * @return -+ */ -+ public boolean doesSneakBypassUse(World world, BlockPos pos, EntityPlayer player) -+ { -+ return false; -+ } -+ -+ /** -+ * Called to tick armor in the armor slot. Override to do something -+ */ -+ public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack){} -+ -+ /** -+ * Determines if the specific ItemStack can be placed in the specified armor slot. -+ * -+ * @param stack The ItemStack -+ * @param armorType Armor slot ID: 0: Helmet, 1: Chest, 2: Legs, 3: Boots -+ * @param entity The entity trying to equip the armor -+ * @return True if the given ItemStack can be inserted in the slot -+ */ -+ public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) -+ { -+ if (this instanceof ItemArmor) -+ { -+ return ((ItemArmor)this).armorType == armorType; -+ } -+ -+ if (armorType == 0) -+ { -+ return this == Item.getItemFromBlock(Blocks.pumpkin) || this == Items.skull; -+ } -+ -+ return false; -+ } -+ -+ /** -+ * Allow or forbid the specific book/item combination as an anvil enchant -+ * -+ * @param stack The item -+ * @param book The book -+ * @return if the enchantment is allowed -+ */ -+ public boolean isBookEnchantable(ItemStack stack, ItemStack book) -+ { -+ return true; -+ } -+ -+ /** -+ * Called by RenderBiped and RenderPlayer to determine the armor texture that -+ * should be use for the currently equipped item. -+ * This will only be called on instances of ItemArmor. -+ * -+ * Returning null from this function will use the default value. -+ * -+ * @param stack ItemStack for the equipped armor -+ * @param entity The entity wearing the armor -+ * @param slot The slot the armor is in -+ * @param type The subtype, can be null or "overlay" -+ * @return Path of texture to bind, or null to use default -+ */ -+ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) -+ { -+ return null; -+ } -+ -+ /** -+ * Returns the font renderer used to render tooltips and overlays for this item. -+ * Returning null will use the standard font renderer. -+ * -+ * @param stack The current item stack -+ * @return A instance of FontRenderer or null to use default -+ */ -+ @SideOnly(Side.CLIENT) -+ public net.minecraft.client.gui.FontRenderer getFontRenderer(ItemStack stack) -+ { -+ return null; -+ } -+ -+ /** -+ * @deprecated Use 4-argument version. -+ */ -+ // remove 1.9 -+ @SideOnly(Side.CLIENT) -+ @Deprecated -+ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) -+ { -+ return null; -+ } -+ -+ /** -+ * Override this method to have an item handle its own armor rendering. -+ * -+ * @param entityLiving The entity wearing the armor -+ * @param itemStack The itemStack to render the model of -+ * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet -+ * @param _default Original armor model. Will have attributes set. -+ * @return A ModelBiped to render instead of the default -+ */ -+ @SideOnly(Side.CLIENT) -+ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot, net.minecraft.client.model.ModelBiped _default) -+ { -+ return getArmorModel(entityLiving, itemStack, armorSlot); -+ } -+ -+ /** -+ * Called when a entity tries to play the 'swing' animation. -+ * -+ * @param entityLiving The entity swinging the item. -+ * @param stack The Item stack -+ * @return True to cancel any further processing by EntityLiving -+ */ -+ public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) -+ { -+ return false; -+ } -+ -+ /** -+ * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. -+ * This is where pumpkins would render there overlay. -+ * -+ * @param stack The ItemStack that is equipped -+ * @param player Reference to the current client entity -+ * @param resolution Resolution information about the current viewport and configured GUI Scale -+ * @param partialTicks Partial ticks for the renderer, useful for interpolation -+ */ -+ @SideOnly(Side.CLIENT) -+ public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, net.minecraft.client.gui.ScaledResolution resolution, float partialTicks){} -+ -+ /** -+ * Return the itemDamage represented by this ItemStack. Defaults to the itemDamage field on ItemStack, but can be overridden here for other sources such as NBT. -+ * -+ * @param stack The itemstack that is damaged -+ * @return the damage value -+ */ -+ public int getDamage(ItemStack stack) -+ { -+ return stack.itemDamage; -+ } -+ -+ /** -+ * This used to be 'display damage' but its really just 'aux' data in the ItemStack, usually shares the same variable as damage. -+ * @param stack -+ * @return -+ */ -+ public int getMetadata(ItemStack stack) -+ { -+ return stack.itemDamage; -+ } -+ -+ /** -+ * Determines if the durability bar should be rendered for this item. -+ * Defaults to vanilla stack.isDamaged behavior. -+ * But modders can use this for any data they wish. -+ * -+ * @param stack The current Item Stack -+ * @return True if it should render the 'durability' bar. -+ */ -+ public boolean showDurabilityBar(ItemStack stack) -+ { -+ return stack.isItemDamaged(); -+ } -+ -+ /** -+ * Queries the percentage of the 'Durability' bar that should be drawn. -+ * -+ * @param stack The current ItemStack -+ * @return 1.0 for 100% 0 for 0% -+ */ -+ public double getDurabilityForDisplay(ItemStack stack) -+ { -+ return (double)stack.getItemDamage() / (double)stack.getMaxDamage(); -+ } -+ -+ /** -+ * Return the maxDamage for this ItemStack. Defaults to the maxDamage field in this item, -+ * but can be overridden here for other sources such as NBT. -+ * -+ * @param stack The itemstack that is damaged -+ * @return the damage value -+ */ -+ public int getMaxDamage(ItemStack stack) -+ { -+ return getMaxDamage(); -+ } -+ -+ /** -+ * Return if this itemstack is damaged. Note only called if {@link #isDamageable()} is true. -+ * @param stack the stack -+ * @return if the stack is damaged -+ */ -+ public boolean isDamaged(ItemStack stack) -+ { -+ return stack.itemDamage > 0; -+ } -+ -+ /** -+ * Set the damage for this itemstack. Note, this method is responsible for zero checking. -+ * @param stack the stack -+ * @param damage the new damage value -+ */ -+ public void setDamage(ItemStack stack, int damage) -+ { -+ stack.itemDamage = damage; -+ -+ if (stack.itemDamage < 0) -+ { -+ stack.itemDamage = 0; -+ } -+ } -+ -+ /** -+ * ItemStack sensitive version of {@link #canHarvestBlock(Block)} -+ * @param par1Block The block trying to harvest -+ * @param itemStack The itemstack used to harvest the block -+ * @return true if can harvest the block -+ */ -+ public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) -+ { -+ return canHarvestBlock(par1Block); -+ } -+ -+ /** -+ * Gets the maximum number of items that this stack should be able to hold. -+ * This is a ItemStack (and thus NBT) sensitive version of Item.getItemStackLimit() -+ * -+ * @param stack The ItemStack -+ * @return THe maximum number this item can be stacked to -+ */ -+ public int getItemStackLimit(ItemStack stack) -+ { -+ return this.getItemStackLimit(); -+ } -+ -+ private java.util.Map toolClasses = new java.util.HashMap(); -+ /** -+ * Sets or removes the harvest level for the specified tool class. -+ * -+ * @param toolClass Class -+ * @param level Harvest level: -+ * Wood: 0 -+ * Stone: 1 -+ * Iron: 2 -+ * Diamond: 3 -+ * Gold: 0 -+ */ -+ public void setHarvestLevel(String toolClass, int level) -+ { -+ if (level < 0) -+ toolClasses.remove(toolClass); -+ else -+ toolClasses.put(toolClass, level); -+ } -+ -+ public java.util.Set getToolClasses(ItemStack stack) -+ { -+ return toolClasses.keySet(); -+ } -+ -+ /** -+ * Queries the harvest level of this item stack for the specifred tool class, -+ * Returns -1 if this tool is not of the specified type -+ * -+ * @param stack This item stack instance -+ * @param toolClass Tool Class -+ * @return Harvest level, or -1 if not the specified tool type. -+ */ -+ public int getHarvestLevel(ItemStack stack, String toolClass) -+ { -+ Integer ret = toolClasses.get(toolClass); -+ return ret == null ? -1 : ret; -+ } -+ -+ /** -+ * ItemStack sensitive version of getItemEnchantability -+ * -+ * @param stack The ItemStack -+ * @return the item echantability value -+ */ -+ public int getItemEnchantability(ItemStack stack) -+ { -+ return getItemEnchantability(); -+ } -+ -+ /** -+ * Whether this Item can be used as a payment to activate the vanilla beacon. -+ * @param stack the ItemStack -+ * @return true if this Item can be used -+ */ -+ public boolean isBeaconPayment(ItemStack stack) -+ { -+ return this == Items.emerald || this == Items.diamond || this == Items.gold_ingot || this == Items.iron_ingot; -+ } -+ -+ -+ /** -+ * Determine if the player switching between these two item stacks -+ * @param oldStack The old stack that was equipped -+ * @param newStack The new stack -+ * @param slotChanged If the current equipped slot was changed, -+ * Vanilla does not play the animation if you switch between two -+ * slots that hold the exact same item. -+ * @return True to play the item change animation -+ */ -+ public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) -+ { -+ return !ItemStack.areItemStacksEqual(oldStack, newStack); -+ } -+ -+ -+ private ResourceLocation registryName = null; -+ /** -+ * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item. -+ * This is the valid replacement for the atrocious 'getUnlocalizedName().substring(6)' stuff that everyone does. -+ * Unlocalized names have NOTHING to do with unique identifiers. As demonstrated by vanilla blocks and items. -+ * -+ * The supplied name will be prefixed with the currently active mod's modId. -+ * If the supplied name already has a prefix that is different, it will be used and a warning will be logged. -+ * -+ * If a name already exists, or this Item is already registered in a registry, then an IllegalStateException is thrown. -+ * -+ * Returns 'this' to allow for chaining. -+ * -+ * @param name Unique registry name -+ * @return This instance -+ */ -+ public final Item setRegistryName(String name) -+ { -+ if (getRegistryName() != null) -+ throw new IllegalStateException("Attempted to set registry name on block with exisiting registry name! New: " + name + " Old: " + getRegistryName()); -+ int index = name.lastIndexOf(':'); -+ String oldPrefix = index == -1 ? "" : name.substring(0, index); -+ name = index == -1 ? name : name.substring(index + 1); -+ net.minecraftforge.fml.common.ModContainer mc = net.minecraftforge.fml.common.Loader.instance().activeModContainer(); -+ String prefix = mc == null ? "minecraft" : mc.getModId(); -+ if (!oldPrefix.equals(prefix) && oldPrefix.length() > 0) -+ { -+ net.minecraftforge.fml.common.FMLLog.bigWarning("Dangerous alternative prefix %s for name %s, invalid registry invocation/invalid name?", oldPrefix, name); -+ prefix = oldPrefix; -+ } -+ this.registryName = new ResourceLocation(prefix, name); -+ return this; -+ } -+ public final Item setRegistryName(ResourceLocation name){ return setRegistryName(name.toString()); } -+ public final Item setRegistryName(String modID, String name){ return setRegistryName(modID + ":" + name); } -+ -+ /** -+ * A unique identifier for this block, if this block is registered in the game registry it will return that name. -+ * Otherwise it will return the name set in setRegistryName(). -+ * If neither are valid null is returned. -+ * -+ * @return Unique identifier or null. -+ */ -+ public final String getRegistryName() -+ { -+ if (delegate.getResourceName() != null) return delegate.getResourceName().toString(); -+ return registryName != null ? registryName.toString() : null; -+ } -+ -+ /** -+ * Called from ItemStack.setItem, will hold extra data for the life of this ItemStack. -+ * Can be retrieved from stack.getCapabilities() -+ * The NBT can be null if this is not called from readNBT or if the item the stack is -+ * changing FROM is different then this item, or the previous item had no capabilities. -+ * -+ * This is called BEFORE the stacks item is set so you can use stack.getItem() to see the OLD item. -+ * Remember that getItem CAN return null. -+ * -+ * @param stack The ItemStack -+ * @param nbt NBT of this item serialized, or null. -+ * @return A holder instance associated with this ItemStack where you can hold capabilities for the life of this item. -+ */ -+ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) -+ { -+ return null; -+ } -+ /* ======================================== FORGE END =====================================*/ -+ - public static void registerItems() - { - registerItemBlock(Blocks.stone, (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function() -@@ -855,6 +1523,10 @@ + protected RayTraceResult getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer playerIn, boolean useLiquids) +@@ -935,6 +940,10 @@ private final float damageVsEntity; private final int enchantability; @@ -739,41 +46,3 @@ private ToolMaterial(int harvestLevel, int maxUses, float efficiency, float damageVsEntity, int enchantability) { this.harvestLevel = harvestLevel; -@@ -889,9 +1561,36 @@ - return this.enchantability; - } - -+ @Deprecated // Use getRepairItemStack below - public Item getRepairItem() - { -- return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); -+ switch (this) -+ { -+ case WOOD: return Item.getItemFromBlock(Blocks.planks); -+ case STONE: return Item.getItemFromBlock(Blocks.cobblestone); -+ case GOLD: return Items.gold_ingot; -+ case IRON: return Items.iron_ingot; -+ case EMERALD: return Items.diamond; -+ default: return customCraftingMaterial; -+ } - } -+ -+ public ToolMaterial setRepairItem(ItemStack stack) -+ { -+ if (this.repairMaterial != null || customCraftingMaterial != null) throw new RuntimeException("Can not change already set repair material"); -+ if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == EMERALD) throw new RuntimeException("Can not change vanilla tool repair materials"); -+ this.repairMaterial = stack; -+ this.customCraftingMaterial = stack.getItem(); -+ return this; -+ } -+ -+ public ItemStack getRepairItemStack() -+ { -+ if (repairMaterial != null) return repairMaterial; -+ Item ret = this.getRepairItem(); -+ if (ret == null) return null; -+ repairMaterial = new ItemStack(ret, 1, net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); -+ return repairMaterial; -+ } - } - } diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemArmor.java.patch index 1c97a02e1a..b8191a6915 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemArmor.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -1,34 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemArmor.java +++ ../src-work/minecraft/net/minecraft/item/ItemArmor.java -@@ -37,7 +37,7 @@ - if (list.size() > 0) - { - EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0); -- int l = entitylivingbase instanceof EntityPlayer ? 1 : 0; -+ int l = 0;// Forge: We fix the indexes. Mojang Stop hard coding this! - int i1 = EntityLiving.getArmorPosition(stack); - ItemStack itemstack = stack.copy(); - itemstack.stackSize = 1; -@@ -190,7 +190,7 @@ - - if (itemstack == null) - { -- playerIn.setCurrentItemOrArmor(i, itemStackIn.copy()); -+ playerIn.setCurrentItemOrArmor(i + 1, itemStackIn.copy()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players. - itemStackIn.stackSize = 0; - } - -@@ -210,6 +210,9 @@ - private final int[] damageReductionAmountArray; - private final int enchantability; - -+ //Added by forge for custom Armor materials. -+ public Item customCraftingMaterial = null; -+ - private ArmorMaterial(String name, int maxDamage, int[] reductionAmounts, int enchantability) - { - this.name = name; -@@ -235,7 +238,15 @@ +@@ -267,7 +267,15 @@ public Item getRepairItem() { diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemBlock.java.patch index 6ee6336091..20c49cd78f 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemBlock.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemBlock.java.patch @@ -1,24 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBlock.java +++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java -@@ -54,16 +54,8 @@ - int i = this.getMetadata(stack.getMetadata()); - IBlockState iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, i, playerIn); - -- if (worldIn.setBlockState(pos, iblockstate1, 3)) -+ if (placeBlockAt(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ, iblockstate1)) - { -- iblockstate1 = worldIn.getBlockState(pos); -- -- if (iblockstate1.getBlock() == this.block) -- { -- setTileEntityNBT(worldIn, playerIn, pos, stack); -- this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); -- } -- - worldIn.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F); - --stack.stackSize; - } -@@ -124,7 +116,7 @@ +@@ -121,7 +121,7 @@ { Block block = worldIn.getBlockState(pos).getBlock(); @@ -27,7 +9,7 @@ { side = EnumFacing.UP; } -@@ -162,4 +154,26 @@ +@@ -159,4 +159,26 @@ { return this.block; } diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemBow.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemBow.java.patch deleted file mode 100644 index 751ab83674..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemBow.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemBow.java -+++ ../src-work/minecraft/net/minecraft/item/ItemBow.java -@@ -27,6 +27,9 @@ - if (flag || playerIn.inventory.hasItem(Items.arrow)) - { - int i = this.getMaxItemUseDuration(stack) - timeLeft; -+ net.minecraftforge.event.entity.player.ArrowLooseEvent event = new net.minecraftforge.event.entity.player.ArrowLooseEvent(playerIn, stack, i); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; -+ i = event.charge; - float f = (float)i / 20.0F; - f = (f * f + f * 2.0F) / 3.0F; - -@@ -104,6 +107,9 @@ - - public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) - { -+ net.minecraftforge.event.entity.player.ArrowNockEvent event = new net.minecraftforge.event.entity.player.ArrowNockEvent(playerIn, itemStackIn); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return event.result; -+ - if (playerIn.capabilities.isCreativeMode || playerIn.inventory.hasItem(Items.arrow)) - { - playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemBucket.java.patch deleted file mode 100644 index 490b216773..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemBucket.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemBucket.java -+++ ../src-work/minecraft/net/minecraft/item/ItemBucket.java -@@ -36,6 +36,9 @@ - } - else - { -+ ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(playerIn, worldIn, itemStackIn, movingobjectposition); -+ if (ret != null) return ret; -+ - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) - { - BlockPos blockpos = movingobjectposition.getBlockPos(); diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemBucketMilk.java.patch index e1b1013f42..02318fa887 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemBucketMilk.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemBucketMilk.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBucketMilk.java +++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java -@@ -23,7 +23,7 @@ +@@ -27,7 +27,7 @@ if (!worldIn.isRemote) { @@ -8,4 +8,4 @@ + playerIn.curePotionEffects(stack); } - playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + if (playerIn instanceof EntityPlayer) diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemDye.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemDye.java.patch index fa9033555e..94f89322ff 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemDye.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemDye.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemDye.java +++ ../src-work/minecraft/net/minecraft/item/ItemDye.java -@@ -47,7 +47,7 @@ +@@ -50,7 +50,7 @@ if (enumdyecolor == EnumDyeColor.WHITE) { @@ -28,17 +28,8 @@ if (iblockstate.getBlock() instanceof IGrowable) { IGrowable igrowable = (IGrowable)iblockstate.getBlock(); -@@ -132,7 +142,7 @@ - - Block block = worldIn.getBlockState(pos).getBlock(); - -- if (block.getMaterial() != Material.air) -+ if (block.isAir(worldIn, pos)) - { - block.setBlockBoundsBasedOnState(worldIn, pos); - -@@ -144,6 +154,16 @@ - worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)pos.getX() + itemRand.nextFloat()), (double)pos.getY() + (double)itemRand.nextFloat() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); +@@ -142,6 +152,16 @@ + worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)pos.getX() + itemRand.nextFloat()), (double)pos.getY() + (double)itemRand.nextFloat() * iblockstate.func_185900_c(worldIn, pos).maxY, (double)((float)pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); } } + else @@ -53,4 +44,4 @@ + } } - public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target, EnumHand p_111207_4_) diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemEmptyMap.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemEmptyMap.java.patch deleted file mode 100644 index 6fc09d1de6..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemEmptyMap.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemEmptyMap.java -+++ ../src-work/minecraft/net/minecraft/item/ItemEmptyMap.java -@@ -22,7 +22,7 @@ - worldIn.setItemData(s, mapdata); - mapdata.scale = 0; - mapdata.calculateMapCenter(playerIn.posX, playerIn.posZ, mapdata.scale); -- mapdata.dimension = (byte)worldIn.provider.getDimensionId(); -+ mapdata.dimension = worldIn.provider.getDimensionId(); - mapdata.markDirty(); - --itemStackIn.stackSize; - diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch deleted file mode 100644 index 17bd77146c..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemFlintAndSteel.java -+++ ../src-work/minecraft/net/minecraft/item/ItemFlintAndSteel.java -@@ -27,7 +27,7 @@ - } - else - { -- if (worldIn.getBlockState(pos).getBlock().getMaterial() == Material.air) -+ if (worldIn.isAirBlock(pos)) - { - worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - worldIn.setBlockState(pos, Blocks.fire.getDefaultState()); diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemHoe.java.patch deleted file mode 100644 index 28920005fb..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemHoe.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemHoe.java -+++ ../src-work/minecraft/net/minecraft/item/ItemHoe.java -@@ -34,10 +34,13 @@ - } - else - { -+ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(stack, playerIn, worldIn, pos); -+ if (hook != 0) return hook > 0; -+ - IBlockState iblockstate = worldIn.getBlockState(pos); - Block block = iblockstate.getBlock(); - -- if (side != EnumFacing.DOWN && worldIn.getBlockState(pos.up()).getBlock().getMaterial() == Material.air) -+ if (side != EnumFacing.DOWN && worldIn.isAirBlock(pos.up())) - { - if (block == Blocks.grass) - { diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemLilyPad.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemLilyPad.java.patch deleted file mode 100644 index 86d27a4436..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemLilyPad.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemLilyPad.java -+++ ../src-work/minecraft/net/minecraft/item/ItemLilyPad.java -@@ -49,7 +49,14 @@ - - if (iblockstate.getBlock().getMaterial() == Material.water && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) - { -+ // special case for handling block placement with water lilies -+ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1); - worldIn.setBlockState(blockpos1, Blocks.waterlily.getDefaultState()); -+ if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(playerIn, blocksnapshot, net.minecraft.util.EnumFacing.UP).isCanceled()) -+ { -+ blocksnapshot.restore(true, false); -+ return itemStackIn; -+ } - - if (!playerIn.capabilities.isCreativeMode) - { diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemMap.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemMap.java.patch deleted file mode 100644 index 4df592c19b..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemMap.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemMap.java -+++ ../src-work/minecraft/net/minecraft/item/ItemMap.java -@@ -57,7 +57,7 @@ - mapdata = new MapData(s); - mapdata.scale = 3; - mapdata.calculateMapCenter((double)worldIn.getWorldInfo().getSpawnX(), (double)worldIn.getWorldInfo().getSpawnZ(), mapdata.scale); -- mapdata.dimension = (byte)worldIn.provider.getDimensionId(); -+ mapdata.dimension = worldIn.provider.getDimensionId(); - mapdata.markDirty(); - worldIn.setItemData(s, mapdata); - } diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch index ba116ba1e7..dd7b0ff031 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch @@ -1,90 +1,8 @@ --- ../src-base/minecraft/net/minecraft/item/ItemMonsterPlacer.java +++ ../src-work/minecraft/net/minecraft/item/ItemMonsterPlacer.java -@@ -36,7 +36,7 @@ - public String getItemStackDisplayName(ItemStack stack) - { - String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); -- String s1 = EntityList.getStringFromID(stack.getMetadata()); -+ String s1 = ItemMonsterPlacer.getEntityName(stack); - - if (s1 != null) - { -@@ -49,7 +49,7 @@ - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int renderPass) - { -- EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(stack.getMetadata())); -+ EntityList.EntityEggInfo entitylist$entityegginfo = ItemMonsterPlacer.getEggInfo(stack); - return entitylist$entityegginfo != null ? (renderPass == 0 ? entitylist$entityegginfo.primaryColor : entitylist$entityegginfo.secondaryColor) : 16777215; - } - -@@ -74,7 +74,7 @@ - if (tileentity instanceof TileEntityMobSpawner) - { - MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic(); -- mobspawnerbaselogic.setEntityName(EntityList.getStringFromID(stack.getMetadata())); -+ mobspawnerbaselogic.setEntityName(ItemMonsterPlacer.getEntityName(stack)); - tileentity.markDirty(); - worldIn.markBlockForUpdate(pos); - -@@ -90,12 +90,12 @@ - pos = pos.offset(side); - double d0 = 0.0D; - -- if (side == EnumFacing.UP && iblockstate instanceof BlockFence) -+ if (side == EnumFacing.UP && iblockstate.getBlock() instanceof BlockFence) //Forge: Fix Vanilla bug comparing state instead of block - { - d0 = 0.5D; +@@ -193,8 +193,31 @@ + return new ActionResult(EnumActionResult.PASS, itemStackIn); } - -- Entity entity = spawnCreature(worldIn, stack.getMetadata(), (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D); -+ Entity entity = spawnCreature(worldIn, ItemMonsterPlacer.getEntityName(stack), (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D); - - if (entity != null) - { -@@ -146,7 +146,7 @@ - - if (worldIn.getBlockState(blockpos).getBlock() instanceof BlockLiquid) - { -- Entity entity = spawnCreature(worldIn, itemStackIn.getMetadata(), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D); -+ Entity entity = spawnCreature(worldIn, ItemMonsterPlacer.getEntityName(itemStackIn), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D); - - if (entity != null) - { -@@ -170,19 +170,29 @@ - } - } - -+ @Deprecated // Use string version below. - public static Entity spawnCreature(World worldIn, int entityID, double x, double y, double z) - { - if (!EntityList.entityEggs.containsKey(Integer.valueOf(entityID))) - { - return null; - } -+ return spawnCreature(worldIn, EntityList.getStringFromID(entityID), x, y, z); -+ } -+ -+ public static Entity spawnCreature(World worldIn, String name, double x, double y, double z) -+ { -+ if (!EntityList.stringToClassMapping.containsKey(name)) -+ { -+ return null; -+ } - else - { - Entity entity = null; - - for (int i = 0; i < 1; ++i) - { -- entity = EntityList.createEntityByID(entityID, worldIn); -+ entity = EntityList.createEntityByName(name, worldIn); - - if (entity instanceof EntityLivingBase) - { -@@ -207,5 +217,28 @@ - { - subItems.add(new ItemStack(itemIn, 1, entitylist$entityegginfo.spawnedID)); } + + for (String name : net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().keySet()) @@ -96,7 +14,7 @@ + subItems.add(stack); + } } -+ + + public static String getEntityName(ItemStack stack) + { + if (stack.hasTagCompound() && stack.getTagCompound().hasKey("entity_name", 8)) @@ -110,4 +28,7 @@ + return net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(stack.getTagCompound().getString("entity_name")); + return (EntityList.EntityEggInfo)EntityList.entityEggs.get(stack.getMetadata()); + } - } ++ + public static Entity spawnCreature(World worldIn, String entityID, double x, double y, double z) + { + if (entityID != null && EntityList.entityEggs.containsKey(entityID)) diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemRecord.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemRecord.java.patch index e6bf3bf5d1..16e050b5be 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemRecord.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemRecord.java.patch @@ -1,10 +1,9 @@ --- ../src-base/minecraft/net/minecraft/item/ItemRecord.java +++ ../src-work/minecraft/net/minecraft/item/ItemRecord.java -@@ -76,4 +76,15 @@ - { - return (ItemRecord)RECORDS.get(name); +@@ -73,6 +73,17 @@ + return EnumRarity.RARE; } -+ + + /** + * Retrieves the resource location of the sound to play for this record. + * @@ -15,4 +14,7 @@ + { + return new net.minecraft.util.ResourceLocation(name); + } - } ++ + @SideOnly(Side.CLIENT) + public static ItemRecord func_185074_a(SoundEvent p_185074_0_) + { diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemSeedFood.java.patch index 53391bf0b0..ade0e57383 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSeedFood.java +++ ../src-work/minecraft/net/minecraft/item/ItemSeedFood.java -@@ -6,7 +6,7 @@ - import net.minecraft.util.EnumFacing; +@@ -8,7 +8,7 @@ + import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class ItemSeedFood extends ItemFood @@ -9,17 +9,8 @@ { private Block crops; private Block soilId; -@@ -28,7 +28,7 @@ - { - return false; - } -- else if (worldIn.getBlockState(pos).getBlock() == this.soilId && worldIn.isAirBlock(pos.up())) -+ else if (worldIn.getBlockState(pos).getBlock().canSustainPlant(worldIn, pos, EnumFacing.UP, this) && worldIn.isAirBlock(pos.up())) - { - worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); - --stack.stackSize; -@@ -39,4 +39,16 @@ - return false; +@@ -33,4 +33,16 @@ + return EnumActionResult.FAIL; } } + diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemSeeds.java.patch index 053649392d..1d5d89be8b 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSeeds.java +++ ../src-work/minecraft/net/minecraft/item/ItemSeeds.java -@@ -7,7 +7,7 @@ - import net.minecraft.util.EnumFacing; +@@ -9,7 +9,7 @@ + import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class ItemSeeds extends Item @@ -9,17 +9,8 @@ { private Block crops; private Block soilBlockID; -@@ -29,7 +29,7 @@ - { - return false; - } -- else if (worldIn.getBlockState(pos).getBlock() == this.soilBlockID && worldIn.isAirBlock(pos.up())) -+ else if (worldIn.getBlockState(pos).getBlock().canSustainPlant(worldIn, pos, EnumFacing.UP, this) && worldIn.isAirBlock(pos.up())) - { - worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); - --stack.stackSize; -@@ -40,4 +40,16 @@ - return false; +@@ -34,4 +34,16 @@ + return EnumActionResult.FAIL; } } + diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemShears.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemShears.java.patch index 6c0e839312..8ec9fd7fae 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemShears.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemShears.java.patch @@ -1,23 +1,8 @@ --- ../src-base/minecraft/net/minecraft/item/ItemShears.java +++ ../src-work/minecraft/net/minecraft/item/ItemShears.java -@@ -19,13 +19,12 @@ - - public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) - { -- if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool) -+ if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool && !(blockIn instanceof net.minecraftforge.common.IShearable)) - { - return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn); - } - else - { -- stack.damageItem(1, playerIn); - return true; - } - } -@@ -39,4 +38,71 @@ - { - return block != Blocks.web && block.getMaterial() != Material.leaves ? (block == Blocks.wool ? 5.0F : super.getStrVsBlock(stack, block)) : 15.0F; +@@ -36,4 +36,71 @@ + Block block = block.getBlock(); + return block != Blocks.web && block.func_185904_a() != Material.leaves ? (block == Blocks.wool ? 5.0F : super.getStrVsBlock(stack, block)) : 15.0F; } + + diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemSkull.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemSkull.java.patch deleted file mode 100644 index 4e8acb4a5a..0000000000 --- a/patches.mcp/minecraft/net/minecraft/item/ItemSkull.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemSkull.java -+++ ../src-work/minecraft/net/minecraft/item/ItemSkull.java -@@ -34,6 +34,11 @@ - - public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) - { -+ if (worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) && side != EnumFacing.DOWN) -+ { -+ side = EnumFacing.UP; -+ pos = pos.down(); -+ } - if (side == EnumFacing.DOWN) - { - return false; -@@ -46,7 +51,7 @@ - - if (!flag) - { -- if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid()) -+ if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid() && !worldIn.isSideSolid(pos, side, true)) - { - return false; - } -@@ -66,6 +71,7 @@ - { - if (!worldIn.isRemote) - { -+ if (!Blocks.skull.canPlaceBlockOnSide(worldIn, pos, side)) return false; - worldIn.setBlockState(pos, Blocks.skull.getDefaultState().withProperty(BlockSkull.FACING, side), 3); - int i = 0; - diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemSnow.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemSnow.java.patch index 3d986ba7ba..951947b54e 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemSnow.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemSnow.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSnow.java +++ ../src-work/minecraft/net/minecraft/item/ItemSnow.java -@@ -67,4 +67,10 @@ +@@ -68,4 +68,10 @@ { return damage; } diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemStack.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemStack.java.patch index 0414b92f39..b05c2b68a0 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemStack.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/item/ItemStack.java +++ ../src-work/minecraft/net/minecraft/item/ItemStack.java -@@ -35,7 +35,7 @@ +@@ -41,7 +41,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public final class ItemStack +public final class ItemStack implements net.minecraftforge.common.capabilities.ICapabilitySerializable { - public static final DecimalFormat DECIMALFORMAT = new DecimalFormat("#.###"); + public static final DecimalFormat DECIMALFORMAT = new DecimalFormat("#.##"); public int stackSize; -@@ -49,6 +49,10 @@ +@@ -55,6 +55,10 @@ private Block canPlaceOnCacheBlock; private boolean canPlaceOnCacheResult; @@ -20,7 +20,7 @@ public ItemStack(Block blockIn) { this((Block)blockIn, 1); -@@ -74,13 +78,15 @@ +@@ -80,13 +84,15 @@ this((Item)itemIn, amount, 0); } @@ -38,56 +38,7 @@ this.stackSize = amount; this.itemDamage = meta; -@@ -107,7 +113,7 @@ - - public ItemStack splitStack(int amount) - { -- ItemStack itemstack = new ItemStack(this.item, amount, this.itemDamage); -+ ItemStack itemstack = new ItemStack(this.item, amount, this.itemDamage, this.capabilities != null ? this.capabilities.serializeNBT() : null); - - if (this.stackTagCompound != null) - { -@@ -120,11 +126,12 @@ - - public Item getItem() - { -- return this.item; -+ return this.delegate != null ? this.delegate.get() : null; - } - - public boolean onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) - { -+ if (!worldIn.isRemote) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, playerIn, worldIn, pos, side, hitX, hitY, hitZ); - boolean flag = this.getItem().onItemUse(this, playerIn, worldIn, pos, side, hitX, hitY, hitZ); - - if (flag) -@@ -162,19 +169,23 @@ - nbt.setTag("tag", this.stackTagCompound); - } - -+ if (this.capabilities != null) nbt.setTag("ForgeCaps", this.capabilities.serializeNBT()); -+ - return nbt; - } - - public void readFromNBT(NBTTagCompound nbt) - { -+ this.capNBT = nbt.hasKey("ForgeCaps") ? nbt.getCompoundTag("ForgeCaps") : null; - if (nbt.hasKey("id", 8)) - { -- this.item = Item.getByNameOrId(nbt.getString("id")); -+ this.setItem(Item.getByNameOrId(nbt.getString("id"))); - } - else - { -- this.item = Item.getItemById(nbt.getShort("id")); -+ this.setItem(Item.getItemById(nbt.getShort("id"))); - } -+ this.capNBT = null; - - this.stackSize = nbt.getByte("Count"); - this.itemDamage = nbt.getShort("Damage"); -@@ -197,7 +208,7 @@ +@@ -196,7 +202,7 @@ public int getMaxStackSize() { @@ -96,7 +47,7 @@ } public boolean isStackable() -@@ -207,7 +218,7 @@ +@@ -206,7 +212,7 @@ public boolean isItemStackDamageable() { @@ -105,45 +56,7 @@ } public boolean getHasSubtypes() -@@ -217,32 +228,27 @@ - - public boolean isItemDamaged() - { -- return this.isItemStackDamageable() && this.itemDamage > 0; -+ return this.isItemStackDamageable() && getItem().isDamaged(this); - } - - public int getItemDamage() - { -- return this.itemDamage; -+ return getItem().getDamage(this); - } - - public int getMetadata() - { -- return this.itemDamage; -+ return getItem().getMetadata(this); - } - - public void setItemDamage(int meta) - { -- this.itemDamage = meta; -- -- if (this.itemDamage < 0) -- { -- this.itemDamage = 0; -- } -+ getItem().setDamage(this, meta); - } - - public int getMaxDamage() - { -- return this.item.getMaxDamage(); -+ return this.item.getMaxDamage(this); - } - - public boolean attemptDamageItem(int amount, Random rand) -@@ -274,8 +280,8 @@ +@@ -273,8 +279,8 @@ } } @@ -154,16 +67,16 @@ } } -@@ -334,7 +340,7 @@ +@@ -328,7 +334,7 @@ - public boolean canHarvestBlock(Block blockIn) + public boolean canHarvestBlock(IBlockState blockIn) { - return this.item.canHarvestBlock(blockIn); + return getItem().canHarvestBlock(blockIn, this); } - public boolean interactWithEntity(EntityPlayer playerIn, EntityLivingBase entityIn) -@@ -344,7 +350,7 @@ + public boolean interactWithEntity(EntityPlayer playerIn, EntityLivingBase entityIn, EnumHand p_111282_3_) +@@ -338,7 +344,7 @@ public ItemStack copy() { @@ -172,7 +85,7 @@ if (this.stackTagCompound != null) { -@@ -742,6 +748,7 @@ +@@ -759,6 +765,7 @@ } } @@ -180,16 +93,7 @@ return list; } -@@ -852,7 +859,7 @@ - } - else - { -- multimap = this.getItem().getItemAttributeModifiers(); -+ multimap = this.getItem().getAttributeModifiers(this); - } - - return multimap; -@@ -860,6 +867,18 @@ +@@ -901,6 +908,18 @@ public void setItem(Item newItem) { @@ -208,7 +112,7 @@ this.item = newItem; } -@@ -946,4 +965,26 @@ +@@ -987,4 +1006,26 @@ return false; } } diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemSword.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemSword.java.patch index 3b7d5e0e08..f52fd59428 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemSword.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemSword.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/ItemSword.java +++ ../src-work/minecraft/net/minecraft/item/ItemSword.java -@@ -101,7 +101,9 @@ +@@ -88,7 +88,9 @@ public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { @@ -10,4 +10,4 @@ + return super.getIsRepairable(toRepair, repair); } - public Multimap getItemAttributeModifiers() + public Multimap getItemAttributeModifiers(EntityEquipmentSlot p_111205_1_) diff --git a/patches.mcp/minecraft/net/minecraft/item/ItemTool.java.patch b/patches.mcp/minecraft/net/minecraft/item/ItemTool.java.patch index cb93922328..7ddec241ba 100644 --- a/patches.mcp/minecraft/net/minecraft/item/ItemTool.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/ItemTool.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/item/ItemTool.java +++ ../src-work/minecraft/net/minecraft/item/ItemTool.java -@@ -28,6 +28,18 @@ - this.efficiencyOnProperMaterial = material.getEfficiencyOnProperMaterial(); - this.damageVsEntity = attackDamage + material.getDamageVsEntity(); +@@ -33,6 +33,18 @@ + this.damageVsEntity = p_i46745_1_ + p_i46745_3_.getDamageVsEntity(); + this.field_185065_c = p_i46745_2_; this.setCreativeTab(CreativeTabs.tabTools); + if (this instanceof ItemPickaxe) + { @@ -18,8 +18,8 @@ + } } - public float getStrVsBlock(ItemStack stack, Block block) -@@ -74,7 +86,9 @@ + protected ItemTool(Item.ToolMaterial p_i46746_1_, Set p_i46746_2_) +@@ -84,7 +96,9 @@ public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { @@ -29,9 +29,9 @@ + return super.getIsRepairable(toRepair, repair); } - public Multimap getItemAttributeModifiers() -@@ -83,4 +97,38 @@ - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Tool modifier", (double)this.damageVsEntity, 0)); + public Multimap getItemAttributeModifiers(EntityEquipmentSlot p_111205_1_) +@@ -99,4 +113,38 @@ + return multimap; } + diff --git a/patches.mcp/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/patches.mcp/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch index 7275586224..5f38ff6047 100644 --- a/patches.mcp/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java +++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java -@@ -72,6 +72,7 @@ +@@ -73,6 +73,7 @@ public void addSmeltingRecipe(ItemStack input, ItemStack stack, float experience) { @@ -8,7 +8,7 @@ this.smeltingList.put(input, stack); this.experienceList.put(stack, Float.valueOf(experience)); } -@@ -101,6 +102,9 @@ +@@ -102,6 +103,9 @@ public float getSmeltingExperience(ItemStack stack) { diff --git a/patches.mcp/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch b/patches.mcp/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch index a5014d15a5..8b17ab96cb 100644 --- a/patches.mcp/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch +++ b/patches.mcp/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/nbt/NBTTagCompound.java +++ ../src-work/minecraft/net/minecraft/nbt/NBTTagCompound.java -@@ -395,6 +395,7 @@ +@@ -454,6 +454,7 @@ private static byte readType(DataInput input, NBTSizeTracker sizeTracker) throws IOException { @@ -8,7 +8,7 @@ return input.readByte(); } -@@ -405,6 +406,7 @@ +@@ -464,6 +465,7 @@ static NBTBase readNBT(byte id, String key, DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException { diff --git a/patches.mcp/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches.mcp/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch index 91465a327f..e61c493305 100644 --- a/patches.mcp/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -1,51 +1,6 @@ --- ../src-base/minecraft/net/minecraft/network/NetHandlerPlayServer.java +++ ../src-work/minecraft/net/minecraft/network/NetHandlerPlayServer.java -@@ -254,6 +254,8 @@ - this.playerEntity.ridingEntity.updateRiderPosition(); - } - -+ if (!this.hasMoved) return; //Fixes teleportation kick while riding entities -+ - this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); - - if (this.playerEntity.ridingEntity != null) -@@ -350,6 +352,8 @@ - this.playerEntity.jump(); - } - -+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving -+ - this.playerEntity.moveEntity(d11, d12, d13); - this.playerEntity.onGround = packetIn.isOnGround(); - d11 = d8 - this.playerEntity.posX; -@@ -370,6 +374,8 @@ - logger.warn(this.playerEntity.getName() + " moved wrongly!"); - } - -+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving -+ - this.playerEntity.setPositionAndRotation(d8, d9, d10, f1, f2); - this.playerEntity.addMovementStat(this.playerEntity.posX - d0, this.playerEntity.posY - d1, this.playerEntity.posZ - d2); - -@@ -377,7 +383,7 @@ - { - boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.getEntityBoundingBox().contract((double)f3, (double)f3, (double)f3)).isEmpty(); - -- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping()) -+ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip) - { - this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); - return; -@@ -405,6 +411,8 @@ - this.floatingTickCount = 0; - } - -+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving -+ - this.playerEntity.onGround = packetIn.isOnGround(); - this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); - this.playerEntity.handleFalling(this.playerEntity.posY - d7, packetIn.isOnGround()); -@@ -497,7 +505,10 @@ +@@ -612,7 +612,10 @@ double d2 = this.playerEntity.posZ - ((double)blockpos.getZ() + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; @@ -57,77 +12,3 @@ { return; } -@@ -549,6 +560,7 @@ - WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); - ItemStack itemstack = this.playerEntity.inventory.getCurrentItem(); - boolean flag = false; -+ boolean placeResult = true; - BlockPos blockpos = packetIn.getPosition(); - EnumFacing enumfacing = EnumFacing.getFront(packetIn.getPlacedBlockDirection()); - this.playerEntity.markPlayerActive(); -@@ -560,13 +572,20 @@ - return; - } - -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(playerEntity, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, worldserver, new BlockPos(0, 0, 0), null, new net.minecraft.util.Vec3(packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ())); -+ if (event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) -+ { - this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); -+ } - } - else if (blockpos.getY() < this.serverController.getBuildLimit() - 1 || enumfacing != EnumFacing.UP && blockpos.getY() < this.serverController.getBuildLimit()) - { -- if (this.hasMoved && this.playerEntity.getDistanceSq((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D) < 64.0D && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos)) -+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 3; -+ dist *= dist; -+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D) < dist && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos)) - { -- this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ()); -+ // record block place result so we can update client itemstack size if place event was cancelled. -+ placeResult = this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ()); - } - - flag = true; -@@ -598,12 +617,18 @@ - this.playerEntity.isChangingQuantityOnly = true; - this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); - Slot slot = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); -+ int windowId = this.playerEntity.openContainer.windowId; -+ if (slot == null) // Forge: Fix 'slotless' inventories not selecting a valid slot to update -+ { -+ slot = this.playerEntity.inventoryContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); -+ windowId = this.playerEntity.inventoryContainer.windowId; -+ } - this.playerEntity.openContainer.detectAndSendChanges(); - this.playerEntity.isChangingQuantityOnly = false; - -- if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.getStack())) -+ if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.getStack()) || !placeResult) // force client itemstack update if place event was cancelled - { -- this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); -+ this.sendPacket(new S2FPacketSetSlot(windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); - } - } - } -@@ -770,8 +795,10 @@ - } - else - { -- IChatComponent ichatcomponent = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.getDisplayName(), s}); -- this.serverController.getConfigurationManager().sendChatMsgImpl(ichatcomponent, false); -+ ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", this.playerEntity.getDisplayName(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s)); -+ IChatComponent chat = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); -+ if (chat == null) return; -+ this.serverController.getConfigurationManager().sendChatMsgImpl(chat, false); - } - - this.chatSpamThresholdCount += 20; -@@ -916,7 +943,7 @@ - return; - } - -- this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false); -+ this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, playerEntity.dimension, false); - } - - break; diff --git a/patches.mcp/minecraft/net/minecraft/network/NetworkManager.java.patch b/patches.mcp/minecraft/net/minecraft/network/NetworkManager.java.patch index 6578510e08..454485ec47 100644 --- a/patches.mcp/minecraft/net/minecraft/network/NetworkManager.java.patch +++ b/patches.mcp/minecraft/net/minecraft/network/NetworkManager.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/network/NetworkManager.java +++ ../src-work/minecraft/net/minecraft/network/NetworkManager.java -@@ -93,6 +93,11 @@ +@@ -89,6 +89,11 @@ this.direction = packetDirection; } @@ -12,7 +12,7 @@ public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception { super.channelActive(p_channelActive_1_); -@@ -208,7 +213,7 @@ +@@ -205,7 +210,7 @@ final EnumConnectionState enumconnectionstate = EnumConnectionState.getFromPacket(inPacket); final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.channel.attr(attrKeyConnectionState).get(); @@ -21,7 +21,7 @@ { logger.debug("Disabled auto read"); this.channel.config().setAutoRead(false); -@@ -216,7 +221,7 @@ +@@ -213,7 +218,7 @@ if (this.channel.eventLoop().inEventLoop()) { @@ -30,7 +30,7 @@ { this.setConnectionState(enumconnectionstate); } -@@ -236,7 +241,7 @@ +@@ -233,7 +238,7 @@ { public void run() { @@ -39,7 +39,7 @@ { NetworkManager.this.setConnectionState(enumconnectionstate); } -@@ -455,6 +460,11 @@ +@@ -452,6 +457,11 @@ } } @@ -50,4 +50,4 @@ + static class InboundHandlerTuplePacketListener { - private final Packet packet; + private final Packet packet; diff --git a/patches.mcp/minecraft/net/minecraft/network/NetworkSystem.java.patch b/patches.mcp/minecraft/net/minecraft/network/NetworkSystem.java.patch index 218327728f..2f2e97b705 100644 --- a/patches.mcp/minecraft/net/minecraft/network/NetworkSystem.java.patch +++ b/patches.mcp/minecraft/net/minecraft/network/NetworkSystem.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/network/NetworkSystem.java +++ ../src-work/minecraft/net/minecraft/network/NetworkSystem.java -@@ -115,7 +115,7 @@ +@@ -111,7 +111,7 @@ ; } -- p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); -+ p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.READ_TIMEOUT))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); +- p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"legacy_query", (ChannelHandler)(new LegacyPingHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new NettyVarint21FrameDecoder())).addLast((String)"decoder", (ChannelHandler)(new NettyPacketDecoder(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new NettyVarint21FrameEncoder())).addLast((String)"encoder", (ChannelHandler)(new NettyPacketEncoder(EnumPacketDirection.CLIENTBOUND))); ++ p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.READ_TIMEOUT))).addLast((String)"legacy_query", (ChannelHandler)(new LegacyPingHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new NettyVarint21FrameDecoder())).addLast((String)"decoder", (ChannelHandler)(new NettyPacketDecoder(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new NettyVarint21FrameEncoder())).addLast((String)"encoder", (ChannelHandler)(new NettyPacketEncoder(EnumPacketDirection.CLIENTBOUND))); NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); NetworkSystem.this.networkManagers.add(networkmanager); p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); diff --git a/patches.mcp/minecraft/net/minecraft/network/ServerStatusResponse.java.patch b/patches.mcp/minecraft/net/minecraft/network/ServerStatusResponse.java.patch index b46a1356ff..e893acae61 100644 --- a/patches.mcp/minecraft/net/minecraft/network/ServerStatusResponse.java.patch +++ b/patches.mcp/minecraft/net/minecraft/network/ServerStatusResponse.java.patch @@ -1,23 +1,23 @@ --- ../src-base/minecraft/net/minecraft/network/ServerStatusResponse.java +++ ../src-work/minecraft/net/minecraft/network/ServerStatusResponse.java @@ -29,6 +29,7 @@ - public void setServerDescription(IChatComponent motd) + public void setServerDescription(ITextComponent motd) { this.serverMotd = motd; + invalidateJson(); } - public ServerStatusResponse.PlayerCountData getPlayerCountData() + public ServerStatusResponse.Players getPlayerCountData() @@ -39,6 +40,7 @@ - public void setPlayerCountData(ServerStatusResponse.PlayerCountData countData) + public void setPlayerCountData(ServerStatusResponse.Players countData) { this.playerCount = countData; + invalidateJson(); } - public ServerStatusResponse.MinecraftProtocolVersionIdentifier getProtocolVersionInfo() + public ServerStatusResponse.Version getProtocolVersionInfo() @@ -49,11 +51,13 @@ - public void setProtocolVersionInfo(ServerStatusResponse.MinecraftProtocolVersionIdentifier protocolVersionData) + public void setProtocolVersionInfo(ServerStatusResponse.Version protocolVersionData) { this.protocolVersion = protocolVersionData; + invalidateJson(); @@ -30,7 +30,7 @@ } public String getFavicon() -@@ -215,6 +219,7 @@ +@@ -176,6 +180,7 @@ serverstatusresponse.setFavicon(JsonUtils.getString(jsonobject, "favicon")); } @@ -38,7 +38,7 @@ return serverstatusresponse; } -@@ -242,7 +247,47 @@ +@@ -203,10 +208,50 @@ jsonobject.addProperty("favicon", p_serialize_1_.getFavicon()); } @@ -46,7 +46,7 @@ return jsonobject; } } -+ + + private java.util.concurrent.Semaphore mutex = new java.util.concurrent.Semaphore(1); + private String json = null; + /** @@ -85,4 +85,7 @@ + { + this.json = null; + } - } ++ + public static class Version + { + private final String name; diff --git a/patches.mcp/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch b/patches.mcp/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch similarity index 71% rename from patches.mcp/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch rename to patches.mcp/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch index 331306c787..1e6382e7d3 100644 --- a/patches.mcp/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch +++ b/patches.mcp/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java -+++ ../src-work/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java +--- ../src-base/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java ++++ ../src-work/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java @@ -47,7 +47,11 @@ public void writePacketData(PacketBuffer buf) throws IOException { diff --git a/patches.mcp/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch b/patches.mcp/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch similarity index 71% rename from patches.mcp/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch rename to patches.mcp/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch index 8218d2cac5..3ec2e8b499 100644 --- a/patches.mcp/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch +++ b/patches.mcp/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch @@ -1,5 +1,5 @@ ---- ../src-base/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java -+++ ../src-work/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java +--- ../src-base/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java @@ -46,7 +46,11 @@ public void writePacketData(PacketBuffer buf) throws IOException { diff --git a/patches.mcp/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch b/patches.mcp/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch deleted file mode 100644 index 086221d574..0000000000 --- a/patches.mcp/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java -+++ ../src-work/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java -@@ -34,7 +34,7 @@ - - public void writePacketData(PacketBuffer buf) throws IOException - { -- buf.writeString(GSON.toJson((Object)this.response)); -+ buf.writeString(this.response.getJson()); - } - - public void processPacket(INetHandlerStatusClient handler) diff --git a/patches.mcp/minecraft/net/minecraft/potion/Potion.java.patch b/patches.mcp/minecraft/net/minecraft/potion/Potion.java.patch index ed45cdb843..98abf7344b 100644 --- a/patches.mcp/minecraft/net/minecraft/potion/Potion.java.patch +++ b/patches.mcp/minecraft/net/minecraft/potion/Potion.java.patch @@ -1,49 +1,6 @@ --- ../src-base/minecraft/net/minecraft/potion/Potion.java +++ ../src-work/minecraft/net/minecraft/potion/Potion.java -@@ -21,7 +21,7 @@ - - public class Potion - { -- public static final Potion[] potionTypes = new Potion[32]; -+ public static final Potion[] potionTypes = new Potion[256]; - private static final Map field_180150_I = Maps.newHashMap(); - public static final Potion field_180151_b = null; - public static final Potion moveSpeed = (new Potion(1, new ResourceLocation("speed"), false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); -@@ -64,10 +64,10 @@ - private double effectiveness; - private boolean usable; - -+ @Deprecated // use the Constructor without potion ID or everything will explode. - protected Potion(int potionID, ResourceLocation location, boolean badEffect, int potionColor) - { -- this.id = potionID; -- potionTypes[potionID] = this; -+ net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().register(potionID, location, this); - field_180150_I.put(location, this); - this.isBadEffect = badEffect; - -@@ -83,14 +83,18 @@ - this.liquidColor = potionColor; - } - -+ protected Potion(ResourceLocation location, boolean badEffect, int potionColor) { -+ this(-1, location, badEffect, potionColor); -+ } -+ - public static Potion getPotionFromResourceLocation(String location) - { -- return (Potion)field_180150_I.get(new ResourceLocation(location)); -+ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().getObject(new ResourceLocation(location)); - } - - public static Set getPotionLocations() - { -- return field_180150_I.keySet(); -+ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().getKeys(); - } - - protected Potion setIconIndex(int p_76399_1_, int p_76399_2_) -@@ -230,7 +234,6 @@ +@@ -195,7 +195,6 @@ return this.statusIconIndex; } @@ -51,11 +8,10 @@ public boolean isBadEffect() { return this.isBadEffect; -@@ -310,4 +313,34 @@ - { +@@ -266,7 +265,37 @@ return modifier.getAmount() * (double)(p_111183_1_ + 1); } -+ + + /* ======================================== FORGE START =====================================*/ + + /** @@ -83,6 +39,10 @@ + * @param effect the active PotionEffect + * @param mc the Minecraft instance, for convenience + */ -+ @SideOnly(Side.CLIENT) + @SideOnly(Side.CLIENT) + public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { } - } ++ ++ @SideOnly(Side.CLIENT) + public boolean func_188408_i() + { + return this.field_188415_h; diff --git a/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch index 9ba184d035..ce1861eb1d 100644 --- a/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ b/patches.mcp/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -1,41 +1,6 @@ --- ../src-base/minecraft/net/minecraft/potion/PotionEffect.java +++ ../src-work/minecraft/net/minecraft/potion/PotionEffect.java -@@ -18,6 +18,8 @@ - @SideOnly(Side.CLIENT) - private boolean isPotionDurationMax; - private boolean showParticles; -+ /** List of ItemStack that can cure the potion effect **/ -+ private java.util.List curativeItems; - - public PotionEffect(int id, int effectDuration) - { -@@ -36,6 +38,8 @@ - this.amplifier = effectAmplifier; - this.isAmbient = ambient; - this.showParticles = showParticles; -+ this.curativeItems = new java.util.ArrayList(); -+ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.milk_bucket)); - } - - public PotionEffect(PotionEffect other) -@@ -45,6 +49,7 @@ - this.amplifier = other.amplifier; - this.isAmbient = other.isAmbient; - this.showParticles = other.showParticles; -+ this.curativeItems = other.curativeItems; - } - - public void combine(PotionEffect other) -@@ -190,7 +195,7 @@ - - public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt) - { -- int i = nbt.getByte("Id"); -+ int i = nbt.getByte("Id") & 0xff; - - if (i >= 0 && i < Potion.potionTypes.length && Potion.potionTypes[i] != null) - { -@@ -223,4 +228,53 @@ +@@ -240,4 +240,53 @@ { return this.isPotionDurationMax; } diff --git a/patches.mcp/minecraft/net/minecraft/realms/RealmsConnect.java.patch b/patches.mcp/minecraft/net/minecraft/realms/RealmsConnect.java.patch index 2aab40a377..43111345ac 100644 --- a/patches.mcp/minecraft/net/minecraft/realms/RealmsConnect.java.patch +++ b/patches.mcp/minecraft/net/minecraft/realms/RealmsConnect.java.patch @@ -8,12 +8,3 @@ inetaddress = InetAddress.getByName(p_connect_1_); if (RealmsConnect.this.aborted) -@@ -59,7 +60,7 @@ - return; - } - -- RealmsConnect.this.connection.sendPacket(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); -+ RealmsConnect.this.connection.sendPacket(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN, true)); - - if (RealmsConnect.this.aborted) - { diff --git a/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch index 8fe34998e9..00b9ef570d 100644 --- a/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java +++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java -@@ -98,7 +98,7 @@ +@@ -100,7 +100,7 @@ @SideOnly(Side.SERVER) private String hostname; private int serverPort = -1; - public WorldServer[] worldServers; + public WorldServer[] worldServers = new WorldServer[0]; - private ServerConfigurationManager serverConfigManager; + private PlayerList serverConfigManager; private boolean serverRunning = true; private boolean serverStopped; -@@ -115,7 +115,8 @@ +@@ -117,7 +117,8 @@ private int buildLimit; private int maxPlayerIdleMinutes = 0; public final long[] tickTimeArray = new long[100]; @@ -19,7 +19,7 @@ private KeyPair serverKeyPair; private String serverOwner; private String folderName; -@@ -227,8 +228,6 @@ +@@ -215,8 +216,6 @@ { this.convertMapIfNeeded(p_71247_1_); this.setUserMessage("menu.loadingLevel"); @@ -28,7 +28,7 @@ ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(p_71247_1_, true); this.setResourcePackFromWorld(this.getFolderName(), isavehandler); WorldInfo worldinfo = isavehandler.loadWorldInfo(); -@@ -259,47 +258,21 @@ +@@ -247,47 +246,21 @@ worldsettings = new WorldSettings(worldinfo); } @@ -84,7 +84,7 @@ this.setDifficultyForAllWorlds(this.getDifficulty()); this.initialWorldChunkLoad(); } -@@ -314,7 +287,7 @@ +@@ -302,7 +275,7 @@ this.setUserMessage("menu.generatingTerrain"); int j1 = 0; logger.info("Preparing start region for level " + j1); @@ -93,40 +93,32 @@ BlockPos blockpos = worldserver.getSpawnPoint(); long k1 = getCurrentTimeMillis(); -@@ -403,7 +376,7 @@ - - public void stopServer() - { -- if (!this.worldIsBeingDeleted) -+ if (!this.worldIsBeingDeleted && net.minecraftforge.fml.common.Loader.instance().hasReachedState(net.minecraftforge.fml.common.LoaderState.SERVER_STARTED) && !serverStopped) // make sure the save is valid and we don't save twice - { - logger.info("Stopping server"); - -@@ -427,8 +400,15 @@ - for (int i = 0; i < this.worldServers.length; ++i) +@@ -420,9 +393,15 @@ + { + if (this.worldServers[j] != null) { - WorldServer worldserver = this.worldServers[i]; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.flush(); - } -+ -+ WorldServer[] tmp = worldServers; -+ for (WorldServer world : tmp) -+ { -+ net.minecraftforge.common.DimensionManager.setWorld(world.provider.getDimensionId(), null); -+ } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(this.worldServers[j])); } + this.worldServers[j].flush(); +- } } ++ ++ WorldServer[] tmp = worldServers; ++ for (WorldServer world : tmp) ++ { ++ net.minecraftforge.common.DimensionManager.setWorld(world.provider.getDimensionId(), null); ++ } + } - if (this.usageSnooper.isSnooperRunning()) -@@ -460,6 +440,7 @@ + if (this.usageSnooper.isSnooperRunning()) +@@ -447,6 +426,7 @@ { if (this.startServer()) { + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarted(); this.currentTime = getCurrentTimeMillis(); long i = 0L; - this.statusResponse.setServerDescription(new ChatComponentText(this.motd)); -@@ -504,12 +485,20 @@ + this.statusResponse.setServerDescription(new TextComponentString(this.motd)); +@@ -491,12 +471,20 @@ Thread.sleep(Math.max(1L, 50L - i)); this.serverIsRunning = true; } @@ -147,7 +139,7 @@ catch (Throwable throwable1) { logger.error("Encountered an unexpected exception", throwable1); -@@ -535,14 +524,15 @@ +@@ -522,14 +510,15 @@ logger.error("We were unable to save this crash report to disk."); } @@ -164,7 +156,7 @@ } catch (Throwable throwable) { -@@ -550,6 +540,8 @@ +@@ -537,6 +526,8 @@ } finally { @@ -173,7 +165,7 @@ this.systemExitNow(); } } -@@ -599,6 +591,7 @@ +@@ -604,6 +595,7 @@ public void tick() { long i = System.nanoTime(); @@ -181,7 +173,7 @@ ++this.tickCounter; if (this.startProfiling) -@@ -625,6 +618,7 @@ +@@ -630,6 +622,7 @@ Collections.shuffle(Arrays.asList(agameprofile)); this.statusResponse.getPlayerCountData().setPlayers(agameprofile); @@ -189,7 +181,7 @@ } if (this.tickCounter % 900 == 0) -@@ -652,6 +646,7 @@ +@@ -657,6 +650,7 @@ this.theProfiler.endSection(); this.theProfiler.endSection(); @@ -197,7 +189,7 @@ } public void updateTimeLightAndEntities() -@@ -667,14 +662,17 @@ +@@ -672,14 +666,17 @@ } this.theProfiler.endStartSection("levels"); @@ -218,7 +210,7 @@ this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); if (this.tickCounter % 20 == 0) -@@ -685,6 +683,7 @@ +@@ -690,6 +687,7 @@ } this.theProfiler.startSection("tick"); @@ -226,7 +218,7 @@ try { -@@ -708,6 +707,7 @@ +@@ -713,6 +711,7 @@ throw new ReportedException(crashreport1); } @@ -234,7 +226,7 @@ this.theProfiler.endSection(); this.theProfiler.startSection("tracker"); worldserver.getEntityTracker().updateTrackedEntities(); -@@ -715,9 +715,11 @@ +@@ -720,9 +719,11 @@ this.theProfiler.endSection(); } @@ -247,7 +239,7 @@ this.theProfiler.endStartSection("connection"); this.getNetworkSystem().networkTick(); this.theProfiler.endStartSection("players"); -@@ -739,6 +741,7 @@ +@@ -744,6 +745,7 @@ public void startServerThread() { @@ -255,7 +247,7 @@ this.serverThread = new Thread(this, "Server thread"); this.serverThread.start(); } -@@ -755,7 +758,13 @@ +@@ -760,7 +762,13 @@ public WorldServer worldServerForDimension(int dimension) { @@ -270,7 +262,7 @@ } public String getMinecraftVersion() -@@ -785,7 +794,7 @@ +@@ -790,7 +798,7 @@ public String getServerModName() { @@ -279,11 +271,3 @@ } public CrashReport addServerInfoToCrashReport(CrashReport report) -@@ -996,6 +1005,7 @@ - - if (worldserver != null) - { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.flush(); - } - } diff --git a/patches.mcp/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches.mcp/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch index 770752bbb7..f2415104a2 100644 --- a/patches.mcp/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/server/dedicated/DedicatedServer.java +++ ../src-work/minecraft/net/minecraft/server/dedicated/DedicatedServer.java -@@ -49,6 +49,7 @@ +@@ -56,6 +56,7 @@ private boolean canSpawnStructures; private WorldSettings.GameType gameType; private boolean guiIsEnabled; + public static boolean allowPlayerLogins = false; - public DedicatedServer(File workDir) + public DedicatedServer(File p_i47086_1_, DataFixer p_i47086_2_, YggdrasilAuthenticationService p_i47086_3_, MinecraftSessionService p_i47086_4_, GameProfileRepository p_i47086_5_, PlayerProfileCache p_i47086_6_) { -@@ -82,6 +83,7 @@ +@@ -89,6 +90,7 @@ { public void run() { @@ -16,7 +16,7 @@ BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in)); String s4; -@@ -107,6 +109,8 @@ +@@ -114,6 +116,8 @@ logger.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } @@ -25,23 +25,7 @@ logger.info("Loading properties"); this.settings = new PropertyManager(new File("server.properties")); this.eula = new ServerEula(new File("eula.txt")); -@@ -198,6 +202,7 @@ - } - else - { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onServerStarted(); - this.setConfigManager(new DedicatedPlayerList(this)); - long j = System.nanoTime(); - -@@ -244,6 +249,7 @@ - this.setBuildLimit((this.getBuildLimit() + 8) / 16 * 16); - this.setBuildLimit(MathHelper.clamp_int(this.getBuildLimit(), 64, 256)); - this.settings.setProperty("max-build-height", Integer.valueOf(this.getBuildLimit())); -+ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerAboutToStart(this)) return false; - logger.info("Preparing level \"" + this.getFolderName() + "\""); - this.loadAllWorlds(this.getFolderName(), this.getFolderName(), k, worldtype, s2); - long i1 = System.nanoTime() - j; -@@ -272,7 +278,7 @@ +@@ -282,7 +286,7 @@ thread1.start(); } @@ -50,11 +34,13 @@ } } } -@@ -621,4 +627,7 @@ - this.commandManager.executeCommand(RConConsoleSource.getInstance(), command); - return RConConsoleSource.getInstance().getLogContents(); +@@ -580,6 +584,9 @@ + return this.settings.getIntProperty("network-compression-threshold", super.getNetworkCompressionTreshold()); } -+ + + //Forge: Enable formated text for colors in console. + @Override public void addChatMessage(net.minecraft.util.IChatComponent message) { logger.info(message.getFormattedText()); } - } ++ + protected boolean convertFiles() throws IOException + { + boolean flag = false; diff --git a/patches.mcp/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch b/patches.mcp/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch index 1aca6a5bcf..36c6157638 100644 --- a/patches.mcp/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch +++ b/patches.mcp/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/server/gui/MinecraftServerGui.java +++ ../src-work/minecraft/net/minecraft/server/gui/MinecraftServerGui.java -@@ -78,6 +78,7 @@ +@@ -77,6 +77,7 @@ System.exit(0); } }); @@ -8,7 +8,7 @@ } public MinecraftServerGui(DedicatedServer serverIn) -@@ -162,8 +163,13 @@ +@@ -161,8 +162,13 @@ return jpanel; } diff --git a/patches.mcp/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches.mcp/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index 6b4e353d1e..51bc84dfe0 100644 --- a/patches.mcp/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java +++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java -@@ -71,8 +71,6 @@ +@@ -68,8 +68,6 @@ protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long seed, WorldType type, String p_71247_6_) { this.convertMapIfNeeded(p_71247_1_); @@ -9,64 +9,7 @@ ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(p_71247_1_, true); this.setResourcePackFromWorld(this.getFolderName(), isavehandler); WorldInfo worldinfo = isavehandler.loadWorldInfo(); -@@ -86,44 +84,24 @@ - worldinfo.setWorldName(p_71247_2_); - } - -- for (int i = 0; i < this.worldServers.length; ++i) -- { -- int j = 0; -+ WorldServer overWorld = (isDemo() ? (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init() : -+ (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init()); -+ overWorld.initialize(this.theWorldSettings); - -- if (i == 1) -+ for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) -+ { -+ WorldServer world = (dim == 0 ? overWorld : (WorldServer)(new WorldServerMulti(this, isavehandler, dim, overWorld, this.theProfiler)).init()); -+ world.addWorldAccess(new WorldManager(this, world)); -+ if (!this.isSinglePlayer()) - { -- j = -1; -+ world.getWorldInfo().setGameType(getGameType()); - } -- -- if (i == 2) -- { -- j = 1; -- } -- -- if (i == 0) -- { -- if (this.isDemo()) -- { -- this.worldServers[i] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); -- } -- else -- { -- this.worldServers[i] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); -- } -- -- this.worldServers[i].initialize(this.theWorldSettings); -- } -- else -- { -- this.worldServers[i] = (WorldServer)(new WorldServerMulti(this, isavehandler, j, this.worldServers[0], this.theProfiler)).init(); -- } -- -- this.worldServers[i].addWorldAccess(new WorldManager(this, this.worldServers[i])); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(world)); - } - -- this.getConfigurationManager().setPlayerManager(this.worldServers); -+ this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld }); - -- if (this.worldServers[0].getWorldInfo().getDifficulty() == null) -+ if (overWorld.getWorldInfo().getDifficulty() == null) - { - this.setDifficultyForAllWorlds(this.mc.gameSettings.difficulty); - } -@@ -141,9 +119,10 @@ +@@ -138,9 +136,10 @@ this.setAllowFlight(true); logger.info("Generating keypair"); this.setKeyPair(CryptManager.generateKeyPair()); @@ -78,7 +21,7 @@ } public void tick() -@@ -216,6 +195,7 @@ +@@ -213,6 +212,7 @@ public EnumDifficulty getDifficulty() { diff --git a/patches.mcp/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch b/patches.mcp/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch deleted file mode 100644 index 6d0ff4dda3..0000000000 --- a/patches.mcp/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch +++ /dev/null @@ -1,266 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/server/management/ItemInWorldManager.java -+++ ../src-work/minecraft/net/minecraft/server/management/ItemInWorldManager.java -@@ -22,6 +22,8 @@ - - public class ItemInWorldManager - { -+ /** Forge reach distance */ -+ private double blockReachDistance = 5.0d; - public World theWorld; - public EntityPlayerMP thisPlayerMP; - private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; -@@ -116,7 +118,7 @@ - else - { - int k = this.curblockDamage - this.initialDamage; -- float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180241_i) * (float)(k + 1); -+ float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180240_f) * (float)(k + 1); //Forge: Fix network break progress using wrong position - int l = (int)(f1 * 10.0F); - - if (l != this.durabilityRemainingOnBlock) -@@ -130,6 +132,14 @@ - - public void onBlockClicked(BlockPos pos, EnumFacing side) - { -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thisPlayerMP, -+ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, theWorld, pos, side, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(thisPlayerMP, getBlockReachDistance() + 1)); -+ if (event.isCanceled()) -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ return; -+ } -+ - if (this.isCreative()) - { - if (!this.theWorld.extinguishFire((EntityPlayer)null, pos, side)) -@@ -164,18 +174,35 @@ - } - } - -- this.theWorld.extinguishFire((EntityPlayer)null, pos, side); -+ // - this.initialDamage = this.curblockDamage; - float f = 1.0F; - -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(theWorld, pos)) - { -- block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); -+ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) -+ { -+ block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); -+ this.theWorld.extinguishFire((EntityPlayer)null, pos, side); -+ } -+ else -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ } - f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos); - } - -- if (block.getMaterial() != Material.air && f >= 1.0F) -+ if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) - { -+ if (f >= 1.0F) -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ } -+ return; -+ } -+ -+ if (!block.isAir(theWorld, pos) && f >= 1.0F) -+ { - this.tryHarvestBlock(pos); - } - else -@@ -196,7 +223,7 @@ - int i = this.curblockDamage - this.initialDamage; - Block block = this.theWorld.getBlockState(pos).getBlock(); - -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(theWorld, pos)) - { - float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos) * (float)(i + 1); - -@@ -225,9 +252,13 @@ - - private boolean removeBlock(BlockPos pos) - { -+ return removeBlock(pos, false); -+ } -+ private boolean removeBlock(BlockPos pos, boolean canHarvest) -+ { - IBlockState iblockstate = this.theWorld.getBlockState(pos); - iblockstate.getBlock().onBlockHarvested(this.theWorld, pos, iblockstate, this.thisPlayerMP); -- boolean flag = this.theWorld.setBlockToAir(pos); -+ boolean flag = iblockstate.getBlock().removedByPlayer(theWorld, pos, thisPlayerMP, canHarvest); - - if (flag) - { -@@ -239,7 +270,8 @@ - - public boolean tryHarvestBlock(BlockPos pos) - { -- if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) -+ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(theWorld, gameType, thisPlayerMP, pos); -+ if (exp == -1) - { - return false; - } -@@ -248,40 +280,21 @@ - IBlockState iblockstate = this.theWorld.getBlockState(pos); - TileEntity tileentity = this.theWorld.getTileEntity(pos); - -- if (this.gameType.isAdventure()) -- { -- if (this.gameType == WorldSettings.GameType.SPECTATOR) -- { -- return false; -- } -+ ItemStack stack = thisPlayerMP.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onBlockStartBreak(stack, pos, thisPlayerMP)) return false; - -- if (!this.thisPlayerMP.isAllowEdit()) -- { -- ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); -- -- if (itemstack == null) -- { -- return false; -- } -- -- if (!itemstack.canDestroy(iblockstate.getBlock())) -- { -- return false; -- } -- } -- } -- - this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, pos, Block.getStateId(iblockstate)); -- boolean flag1 = this.removeBlock(pos); -+ boolean flag1 = false; - - if (this.isCreative()) - { -+ flag1 = this.removeBlock(pos); - this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(this.theWorld, pos)); - } - else - { - ItemStack itemstack1 = this.thisPlayerMP.getCurrentEquippedItem(); -- boolean flag = this.thisPlayerMP.canHarvestBlock(iblockstate.getBlock()); -+ boolean flag = iblockstate.getBlock().canHarvestBlock(theWorld, pos, thisPlayerMP); - - if (itemstack1 != null) - { -@@ -293,12 +306,18 @@ - } - } - -+ flag1 = this.removeBlock(pos, flag); - if (flag1 && flag) - { - iblockstate.getBlock().harvestBlock(this.theWorld, this.thisPlayerMP, pos, iblockstate, tileentity); - } - } - -+ // Drop experiance -+ if (!this.isCreative() && flag1 && exp > 0) -+ { -+ iblockstate.getBlock().dropXpOnBlockBreak(theWorld, pos, exp); -+ } - return flag1; - } - } -@@ -332,6 +351,7 @@ - if (itemstack.stackSize == 0) - { - player.inventory.mainInventory[player.inventory.currentItem] = null; -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(player, itemstack); - } - - if (!player.isUsingItem()) -@@ -380,33 +400,51 @@ - } - else - { -- if (!player.isSneaking() || player.getHeldItem() == null) -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(player, -+ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, worldIn, pos, side, new net.minecraft.util.Vec3(offsetX, offsetY, offsetZ)); -+ if (event.isCanceled()) - { -- IBlockState iblockstate = worldIn.getBlockState(pos); -- -- if (iblockstate.getBlock().onBlockActivated(worldIn, pos, iblockstate, player, side, offsetX, offsetY, offsetZ)) -- { -- return true; -- } -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ return false; - } - -- if (stack == null) -+ if (stack != null && stack.getItem().onItemUseFirst(stack, player, worldIn, pos, side, offsetX, offsetY, offsetZ)) - { -- return false; -+ if (stack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); -+ return true; - } -- else if (this.isCreative()) -+ -+ IBlockState iblockstate = worldIn.getBlockState(pos); -+ boolean isAir = worldIn.isAirBlock(pos); -+ boolean useBlock = !player.isSneaking() || player.getHeldItem() == null; -+ if (!useBlock) useBlock = player.getHeldItem().getItem().doesSneakBypassUse(worldIn, pos, player); -+ boolean result = false; -+ -+ if (useBlock) - { -- int j = stack.getMetadata(); -- int i = stack.stackSize; -- boolean flag = stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); -- stack.setItemDamage(j); -- stack.stackSize = i; -- return flag; -+ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) -+ { -+ result = iblockstate.getBlock().onBlockActivated(worldIn, pos, iblockstate, player, side, offsetX, offsetY, offsetZ); -+ } -+ else -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ result = event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW; -+ } - } -- else -+ if (stack != null && !result && event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) - { -- return stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); -+ int meta = stack.getMetadata(); -+ int size = stack.stackSize; -+ result = stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); -+ if (isCreative()) -+ { -+ stack.setItemDamage(meta); -+ stack.stackSize = size; -+ } -+ if (stack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); - } -+ return result; - } - } - -@@ -414,4 +452,13 @@ - { - this.theWorld = serverWorld; - } -+ -+ public double getBlockReachDistance() -+ { -+ return blockReachDistance; -+ } -+ public void setBlockReachDistance(double distance) -+ { -+ blockReachDistance = distance; -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/server/management/PlayerManager.java.patch b/patches.mcp/minecraft/net/minecraft/server/management/PlayerManager.java.patch index d0bc684553..a4e9541950 100644 --- a/patches.mcp/minecraft/net/minecraft/server/management/PlayerManager.java.patch +++ b/patches.mcp/minecraft/net/minecraft/server/management/PlayerManager.java.patch @@ -1,32 +1,6 @@ --- ../src-base/minecraft/net/minecraft/server/management/PlayerManager.java +++ ../src-work/minecraft/net/minecraft/server/management/PlayerManager.java -@@ -117,15 +117,24 @@ - int j = (int)player.posZ >> 4; - player.managedPosX = player.posX; - player.managedPosZ = player.posZ; -+ // Load nearby chunks first -+ List chunkList = Lists.newArrayList(); - - for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) - { - for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) - { -- this.getPlayerInstance(k, l, true).addPlayer(player); -+ chunkList.add(new ChunkCoordIntPair(k, l)); - } - } - -+ java.util.Collections.sort(chunkList, new net.minecraftforge.common.util.ChunkCoordComparator(player)); -+ -+ for (ChunkCoordIntPair pair : chunkList) -+ { -+ this.getPlayerInstance(pair.chunkXPos, pair.chunkZPos, true).addPlayer(player); -+ } -+ - this.players.add(player); - this.filterChunkLoadQueue(player); - } -@@ -225,6 +234,7 @@ +@@ -338,6 +338,7 @@ int i1 = this.playerViewRadius; int j1 = i - k; int k1 = j - l; @@ -34,187 +8,3 @@ if (j1 != 0 || k1 != 0) { -@@ -234,7 +244,7 @@ - { - if (!this.overlaps(l1, i2, k, l, i1)) - { -- this.getPlayerInstance(l1, i2, true).addPlayer(player); -+ chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); - } - - if (!this.overlaps(l1 - j1, i2 - k1, i, j, i1)) -@@ -252,6 +262,18 @@ - this.filterChunkLoadQueue(player); - player.managedPosX = player.posX; - player.managedPosZ = player.posZ; -+ // send nearest chunks first -+ java.util.Collections.sort(chunksToLoad, new net.minecraftforge.common.util.ChunkCoordComparator(player)); -+ -+ for (ChunkCoordIntPair pair : chunksToLoad) -+ { -+ this.getPlayerInstance(pair.chunkXPos, pair.chunkZPos, true).addPlayer(player); -+ } -+ -+ if (i1 > 1 || i1 < -1 || j1 > 1 || j1 < -1) -+ { -+ java.util.Collections.sort(player.loadedChunks, new net.minecraftforge.common.util.ChunkCoordComparator(player)); -+ } - } - } - } -@@ -322,11 +344,20 @@ - private int numBlocksToUpdate; - private int flagsYAreasToUpdate; - private long previousWorldTime; -+ private final java.util.HashMap players = new java.util.HashMap(); -+ private boolean loaded = false; -+ private Runnable loadedRunnable = new Runnable() -+ { -+ public void run() -+ { -+ PlayerInstance.this.loaded = true; -+ } -+ }; - - public PlayerInstance(int chunkX, int chunkZ) - { - this.chunkCoords = new ChunkCoordIntPair(chunkX, chunkZ); -- PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(chunkX, chunkZ); -+ PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(chunkX, chunkZ, this.loadedRunnable); - } - - public void addPlayer(EntityPlayerMP player) -@@ -343,7 +374,24 @@ - } - - this.playersWatchingChunk.add(player); -+ Runnable playerRunnable = null; -+ if (this.loaded) -+ { - player.loadedChunks.add(this.chunkCoords); -+ } -+ else -+ { -+ final EntityPlayerMP tmp = player; -+ playerRunnable = new Runnable() -+ { -+ public void run() -+ { -+ tmp.loadedChunks.add(PlayerInstance.this.chunkCoords); -+ } -+ }; -+ PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, playerRunnable); -+ } -+ this.players.put(player, playerRunnable); - } - } - -@@ -351,6 +399,24 @@ - { - if (this.playersWatchingChunk.contains(player)) - { -+ // If we haven't loaded yet don't load the chunk just so we can clean it up -+ if (!this.loaded) -+ { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.getWorldServer(), this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, this.players.get(player)); -+ this.playersWatchingChunk.remove(player); -+ this.players.remove(player); -+ -+ if (this.playersWatchingChunk.isEmpty()) -+ { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.getWorldServer(), this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, this.loadedRunnable); -+ long i = (long) this.chunkCoords.chunkXPos + 2147483647L | (long) this.chunkCoords.chunkZPos + 2147483647L << 32; -+ PlayerManager.this.playerInstances.remove(i); -+ PlayerManager.this.playerInstanceList.remove(this); -+ } -+ -+ return; -+ } -+ - Chunk chunk = PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos); - - if (chunk.isPopulated()) -@@ -358,9 +424,12 @@ - player.playerNetServerHandler.sendPacket(new S21PacketChunkData(chunk, true, 0)); - } - -+ this.players.remove(player); - this.playersWatchingChunk.remove(player); - player.loadedChunks.remove(this.chunkCoords); - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(chunkCoords, player)); -+ - if (this.playersWatchingChunk.isEmpty()) - { - long i = (long)this.chunkCoords.chunkXPos + 2147483647L | (long)this.chunkCoords.chunkZPos + 2147483647L << 32; -@@ -398,7 +467,7 @@ - - this.flagsYAreasToUpdate |= 1 << (y >> 4); - -- if (this.numBlocksToUpdate < 64) -+ //Forge; Cache everything, so always run - { - short short1 = (short)(x << 12 | z << 8 | y); - -@@ -410,6 +479,10 @@ - } - } - -+ if (numBlocksToUpdate == locationOfBlockChange.length) -+ { -+ locationOfBlockChange = java.util.Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); -+ } - this.locationOfBlockChange[this.numBlocksToUpdate++] = short1; - } - } -@@ -427,6 +500,7 @@ - } - } - -+ @SuppressWarnings("unused") - public void onUpdate() - { - if (this.numBlocksToUpdate != 0) -@@ -439,18 +513,19 @@ - BlockPos blockpos = new BlockPos(i, j, k); - this.sendToAllPlayersWatchingChunk(new S23PacketBlockChange(PlayerManager.this.theWorldServer, blockpos)); - -- if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity()) -+ if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity(PlayerManager.this.theWorldServer.getBlockState(blockpos))) - { - this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos)); - } - } -- else if (this.numBlocksToUpdate == 64) -+ else if (this.numBlocksToUpdate >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) - { - int i1 = this.chunkCoords.chunkXPos * 16; - int k1 = this.chunkCoords.chunkZPos * 16; - this.sendToAllPlayersWatchingChunk(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos), false, this.flagsYAreasToUpdate)); - -- for (int i2 = 0; i2 < 16; ++i2) -+ // Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones -+ for (int i2 = 0; false && i2 < 16; ++i2) - { - if ((this.flagsYAreasToUpdate & 1 << i2) != 0) - { -@@ -467,7 +542,9 @@ - else - { - this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numBlocksToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos))); -- -+ } -+ { // Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small -+ WorldServer world = PlayerManager.this.theWorldServer; - for (int j1 = 0; j1 < this.numBlocksToUpdate; ++j1) - { - int l1 = (this.locationOfBlockChange[j1] >> 12 & 15) + this.chunkCoords.chunkXPos * 16; -@@ -475,7 +552,7 @@ - int l2 = (this.locationOfBlockChange[j1] >> 8 & 15) + this.chunkCoords.chunkZPos * 16; - BlockPos blockpos1 = new BlockPos(l1, j2, l2); - -- if (PlayerManager.this.theWorldServer.getBlockState(blockpos1).getBlock().hasTileEntity()) -+ if (world.getBlockState(blockpos1).getBlock().hasTileEntity(world.getBlockState(blockpos1))) - { - this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos1)); - } diff --git a/patches.mcp/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches.mcp/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch deleted file mode 100644 index 14c98b3ca8..0000000000 --- a/patches.mcp/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ /dev/null @@ -1,223 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java -+++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java -@@ -99,7 +99,7 @@ - this.maxPlayers = 8; - } - -- public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn) -+ public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn, NetHandlerPlayServer nethandlerplayserver) - { - GameProfile gameprofile = playerIn.getGameProfile(); - PlayerProfileCache playerprofilecache = this.mcServer.getPlayerProfileCache(); -@@ -108,6 +108,17 @@ - playerprofilecache.addEntry(gameprofile); - NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(playerIn); - playerIn.setWorld(this.mcServer.worldServerForDimension(playerIn.dimension)); -+ -+ World playerWorld = this.mcServer.worldServerForDimension(playerIn.dimension); -+ if (playerWorld == null) -+ { -+ playerIn.dimension=0; -+ playerWorld=this.mcServer.worldServerForDimension(0); -+ BlockPos spawnPoint = playerWorld.provider.getRandomizedSpawnPoint(); -+ playerIn.setPosition(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ()); -+ } -+ -+ playerIn.setWorld(playerWorld); - playerIn.theItemInWorldManager.setWorld((WorldServer)playerIn.worldObj); - String s1 = "local"; - -@@ -121,7 +132,7 @@ - WorldInfo worldinfo = worldserver.getWorldInfo(); - BlockPos blockpos = worldserver.getSpawnPoint(); - this.setPlayerGameTypeBasedOnOther(playerIn, (EntityPlayerMP)null, worldserver); -- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.mcServer, netManager, playerIn); -+ playerIn.playerNetServerHandler = nethandlerplayserver; - nethandlerplayserver.sendPacket(new S01PacketJoinGame(playerIn.getEntityId(), playerIn.theItemInWorldManager.getGameType(), worldinfo.isHardcoreModeEnabled(), worldserver.provider.getDimensionId(), worldserver.getDifficulty(), this.getMaxPlayers(), worldinfo.getTerrainType(), worldserver.getGameRules().getBoolean("reducedDebugInfo"))); - nethandlerplayserver.sendPacket(new S3FPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(this.getServerInstance().getServerModName()))); - nethandlerplayserver.sendPacket(new S41PacketServerDifficulty(worldinfo.getDifficulty(), worldinfo.isDifficultyLocked())); -@@ -161,6 +172,7 @@ - - playerIn.addSelfToInternalCraftingInventory(); - -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedIn(playerIn); - if (nbttagcompound != null && nbttagcompound.hasKey("Riding", 10)) - { - Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver); -@@ -262,6 +274,7 @@ - playerIn.readFromNBT(nbttagcompound); - nbttagcompound1 = nbttagcompound; - logger.debug("loading single player"); -+ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(playerIn, this.playerNBTManagerObj, playerIn.getUniqueID().toString()); - } - else - { -@@ -271,8 +284,23 @@ - return nbttagcompound1; - } - -+ public NBTTagCompound getPlayerNBT(EntityPlayerMP player) -+ { -+ // Hacky method to allow loading the NBT for a player prior to login -+ NBTTagCompound nbttagcompound = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); -+ if (player.getName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null) -+ { -+ return nbttagcompound; -+ } -+ else -+ { -+ return ((net.minecraft.world.storage.SaveHandler)this.playerNBTManagerObj).getPlayerNBT(player); -+ } -+ } - protected void writePlayerData(EntityPlayerMP playerIn) - { -+ if (playerIn.playerNetServerHandler == null) return; -+ - this.playerNBTManagerObj.writePlayerData(playerIn); - StatisticsFile statisticsfile = (StatisticsFile)this.playerStatFiles.get(playerIn.getUniqueID()); - -@@ -288,6 +316,7 @@ - this.uuidToPlayerMap.put(playerIn.getUniqueID(), playerIn); - this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {playerIn})); - WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.getCurrentPlayerCount()); - worldserver.spawnEntityInWorld(playerIn); - this.preparePlayer(playerIn, (WorldServer)null); - -@@ -305,6 +334,7 @@ - - public void playerLoggedOut(EntityPlayerMP playerIn) - { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedOut(playerIn); - playerIn.triggerAchievement(StatList.leaveGameStat); - this.writePlayerData(playerIn); - WorldServer worldserver = playerIn.getServerForPlayer(); -@@ -326,6 +356,7 @@ - this.uuidToPlayerMap.remove(uuid); - this.playerStatFiles.remove(uuid); - } -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.getCurrentPlayerCount()); - - this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {playerIn})); - } -@@ -409,13 +440,23 @@ - - public EntityPlayerMP recreatePlayerEntity(EntityPlayerMP playerIn, int dimension, boolean conqueredEnd) - { -+ World world = mcServer.worldServerForDimension(dimension); -+ if (world == null) -+ { -+ dimension = 0; -+ } -+ else if (!world.provider.canRespawnHere()) -+ { -+ dimension = world.provider.getRespawnDimension(playerIn); -+ } -+ - playerIn.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(playerIn); - playerIn.getServerForPlayer().getEntityTracker().untrackEntity(playerIn); - playerIn.getServerForPlayer().getPlayerManager().removePlayer(playerIn); - this.playerEntityList.remove(playerIn); - this.mcServer.worldServerForDimension(playerIn.dimension).removePlayerEntityDangerously(playerIn); -- BlockPos blockpos = playerIn.getBedLocation(); -- boolean flag = playerIn.isSpawnForced(); -+ BlockPos blockpos = playerIn.getBedLocation(dimension); -+ boolean flag = playerIn.isSpawnForced(dimension); - playerIn.dimension = dimension; - ItemInWorldManager iteminworldmanager; - -@@ -431,6 +472,7 @@ - EntityPlayerMP entityplayermp = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(playerIn.dimension), playerIn.getGameProfile(), iteminworldmanager); - entityplayermp.playerNetServerHandler = playerIn.playerNetServerHandler; - entityplayermp.clonePlayer(playerIn, conqueredEnd); -+ entityplayermp.dimension = dimension; - entityplayermp.setEntityId(playerIn.getEntityId()); - entityplayermp.func_174817_o(playerIn); - WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); -@@ -470,19 +512,25 @@ - this.uuidToPlayerMap.put(entityplayermp.getUniqueID(), entityplayermp); - entityplayermp.addSelfToInternalCraftingInventory(); - entityplayermp.setHealth(entityplayermp.getHealth()); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp); - return entityplayermp; - } - - public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension) - { -+ transferPlayerToDimension(playerIn, dimension, mcServer.worldServerForDimension(dimension).getDefaultTeleporter()); -+ } -+ -+ public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension, net.minecraft.world.Teleporter teleporter) -+ { - int i = playerIn.dimension; - WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); - playerIn.dimension = dimension; - WorldServer worldserver1 = this.mcServer.worldServerForDimension(playerIn.dimension); -- playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, playerIn.worldObj.getDifficulty(), playerIn.worldObj.getWorldInfo().getTerrainType(), playerIn.theItemInWorldManager.getGameType())); -+ playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, worldserver1.getDifficulty(), worldserver1.getWorldInfo().getTerrainType(), playerIn.theItemInWorldManager.getGameType())); - worldserver.removePlayerEntityDangerously(playerIn); - playerIn.isDead = false; -- this.transferEntityToWorld(playerIn, i, worldserver, worldserver1); -+ this.transferEntityToWorld(playerIn, i, worldserver, worldserver1, teleporter); - this.preparePlayer(playerIn, worldserver); - playerIn.playerNetServerHandler.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, playerIn.rotationPitch); - playerIn.theItemInWorldManager.setWorld(worldserver1); -@@ -493,17 +541,27 @@ - { - playerIn.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect)); - } -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerChangedDimensionEvent(playerIn, i, dimension); - } - - public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) - { -- double d0 = entityIn.posX; -- double d1 = entityIn.posZ; -+ transferEntityToWorld(entityIn, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.getDefaultTeleporter()); -+ } -+ -+ @SuppressWarnings("unused") -+ public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraft.world.Teleporter teleporter) -+ { -+ net.minecraft.world.WorldProvider pOld = p_82448_3_.provider; -+ net.minecraft.world.WorldProvider pNew = p_82448_4_.provider; -+ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); -+ double d0 = entityIn.posX * moveFactor; -+ double d1 = entityIn.posZ * moveFactor; - double d2 = 8.0D; - float f = entityIn.rotationYaw; - p_82448_3_.theProfiler.startSection("moving"); - -- if (entityIn.dimension == -1) -+ if (false && entityIn.dimension == -1) //Forge Kill it but dont comment out so we can rename it. - { - d0 = MathHelper.clamp_double(d0 / d2, p_82448_4_.getWorldBorder().minX() + 16.0D, p_82448_4_.getWorldBorder().maxX() - 16.0D); - d1 = MathHelper.clamp_double(d1 / d2, p_82448_4_.getWorldBorder().minZ() + 16.0D, p_82448_4_.getWorldBorder().maxZ() - 16.0D); -@@ -514,7 +572,7 @@ - p_82448_3_.updateEntityWithOptionalForce(entityIn, false); - } - } -- else if (entityIn.dimension == 0) -+ else if (false && entityIn.dimension == 0) //Forge Kill it but dont comment out so we can rename it. - { - d0 = MathHelper.clamp_double(d0 * d2, p_82448_4_.getWorldBorder().minX() + 16.0D, p_82448_4_.getWorldBorder().maxX() - 16.0D); - d1 = MathHelper.clamp_double(d1 * d2, p_82448_4_.getWorldBorder().minZ() + 16.0D, p_82448_4_.getWorldBorder().maxZ() - 16.0D); -@@ -525,7 +583,8 @@ - p_82448_3_.updateEntityWithOptionalForce(entityIn, false); - } - } -- else -+ -+ if (entityIn.dimension == 1) - { - BlockPos blockpos; - -@@ -560,7 +619,7 @@ - if (entityIn.isEntityAlive()) - { - entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); -- p_82448_4_.getDefaultTeleporter().placeInPortal(entityIn, f); -+ teleporter.placeInPortal(entityIn, f); - p_82448_4_.spawnEntityInWorld(entityIn); - p_82448_4_.updateEntityWithOptionalForce(entityIn, false); - } diff --git a/patches.mcp/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/patches.mcp/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch index 207663b904..eab396c8e8 100644 --- a/patches.mcp/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch @@ -1,26 +1,20 @@ --- ../src-base/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java +++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java -@@ -66,12 +66,12 @@ +@@ -66,7 +66,7 @@ if (entityplayermp == null) { this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -- this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.field_181025_l); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.getConfigurationManager(), this.networkManager, this.field_181025_l); +- this.server.func_184103_al().initializeConnectionToPlayer(this.networkManager, this.field_181025_l); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.func_184103_al(), this.networkManager, this.field_181025_l); this.field_181025_l = null; } } - -- if (this.connectionTimer++ == 600) -+ if (this.connectionTimer++ == net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.LOGIN_TIMEOUT) - { - this.closeConnection("Took too long to log in"); - } @@ -130,7 +130,7 @@ } else { -- this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile)); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.getConfigurationManager(), this.networkManager, this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile)); +- this.server.func_184103_al().initializeConnectionToPlayer(this.networkManager, this.server.func_184103_al().createPlayerForUser(this.loginGameProfile)); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.func_184103_al(), this.networkManager, this.server.func_184103_al().createPlayerForUser(this.loginGameProfile)); } } } diff --git a/patches.mcp/minecraft/net/minecraft/stats/StatList.java.patch b/patches.mcp/minecraft/net/minecraft/stats/StatList.java.patch index 1a464c5e9a..07dbb29fe2 100644 --- a/patches.mcp/minecraft/net/minecraft/stats/StatList.java.patch +++ b/patches.mcp/minecraft/net/minecraft/stats/StatList.java.patch @@ -1,24 +1,6 @@ --- ../src-base/minecraft/net/minecraft/stats/StatList.java +++ ../src-work/minecraft/net/minecraft/stats/StatList.java -@@ -119,7 +119,7 @@ - } - } - -- replaceAllSimilarBlocks(objectCraftStats); -+ replaceAllSimilarBlocks(objectCraftStats, true); - } - - private static void initMiningStats() -@@ -141,7 +141,7 @@ - } - } - -- replaceAllSimilarBlocks(mineBlockStatArray); -+ replaceAllSimilarBlocks(mineBlockStatArray, false); - } - - private static void initStats() -@@ -165,7 +165,7 @@ +@@ -201,7 +201,7 @@ } } @@ -27,7 +9,7 @@ } private static void initItemDepleteStats() -@@ -184,7 +184,7 @@ +@@ -240,7 +240,7 @@ } } @@ -36,7 +18,7 @@ } private static String func_180204_a(Item p_180204_0_) -@@ -193,28 +193,35 @@ +@@ -249,28 +249,35 @@ return resourcelocation != null ? resourcelocation.toString().replace(':', '.') : null; } diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 241001f4b5..61a5ea7079 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java -@@ -17,7 +17,7 @@ +@@ -18,7 +18,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ { private static final Logger logger = LogManager.getLogger(); private static Map < String, Class > nameToClassMap = Maps. < String, Class > newHashMap(); -@@ -59,6 +59,8 @@ +@@ -60,6 +60,8 @@ public void readFromNBT(NBTTagCompound compound) { this.pos = new BlockPos(compound.getInteger("x"), compound.getInteger("y"), compound.getInteger("z")); @@ -18,7 +18,7 @@ } public void writeToNBT(NBTTagCompound compound) -@@ -75,6 +77,8 @@ +@@ -76,6 +78,8 @@ compound.setInteger("x", this.pos.getX()); compound.setInteger("y", this.pos.getY()); compound.setInteger("z", this.pos.getZ()); @@ -27,37 +27,7 @@ } } -@@ -82,9 +86,10 @@ - { - TileEntity tileentity = null; - -+ Class oclass = null; - try - { -- Class oclass = (Class)nameToClassMap.get(nbt.getString("id")); -+ oclass = (Class)nameToClassMap.get(nbt.getString("id")); - - if (oclass != null) - { -@@ -102,7 +107,17 @@ - } - else - { -+ try -+ { - logger.warn("Skipping BlockEntity with id " + nbt.getString("id")); -+ } -+ catch (Exception ex) -+ { -+ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, -+ "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", -+ nbt.getString("id"), oclass.getName()); -+ tileentity = null; -+ } - } - - return tileentity; -@@ -134,7 +149,6 @@ +@@ -144,7 +148,6 @@ } } @@ -65,11 +35,10 @@ public double getDistanceSq(double x, double y, double z) { double d0 = (double)this.pos.getX() + 0.5D - x; -@@ -279,4 +293,183 @@ - addMapping(TileEntityFlowerPot.class, "FlowerPot"); - addMapping(TileEntityBanner.class, "Banner"); +@@ -271,6 +274,185 @@ + return false; } -+ + + // -- BEGIN FORGE PATCHES -- + /** + * Called when you receive a TileEntityData packet for the location this @@ -248,4 +217,7 @@ + this.writeToNBT(ret); + return ret; + } - } ++ + static + { + addMapping(TileEntityFurnace.class, "Furnace"); diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch index f6606e0c9d..9323da9f29 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ b/patches.mcp/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 -@@ -169,7 +169,7 @@ +@@ -179,7 +179,7 @@ { Block block = this.worldObj.getBlockState(new BlockPos(j1, i2, k1)).getBlock(); @@ -9,7 +9,7 @@ { flag1 = false; break; -@@ -368,7 +368,7 @@ +@@ -371,7 +371,7 @@ public boolean isItemValidForSlot(int index, ItemStack stack) { diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch index 099972726e..6c21afb925 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java -@@ -104,7 +104,7 @@ +@@ -140,7 +140,7 @@ private boolean canBrew() { @@ -9,78 +9,18 @@ { ItemStack itemstack = this.brewingItemStacks[3]; -@@ -118,7 +118,7 @@ - - for (int i = 0; i < 3; ++i) - { -- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) -+ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) - { - int j = this.brewingItemStacks[i].getMetadata(); - int k = this.getPotionResult(j, itemstack); -@@ -145,19 +145,22 @@ - } - else - { -- return false; -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.canBrew(brewingItemStacks, brewingItemStacks[3], outputSlots); - } - } - - private void brewPotions() - { -+ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(brewingItemStacks)) return; - if (this.canBrew()) - { -+ net.minecraftforge.common.brewing.BrewingRecipeRegistry.brewPotions(brewingItemStacks, brewingItemStacks[3], outputSlots); - ItemStack itemstack = this.brewingItemStacks[3]; - -+ if (false) { // Code moved to net.minecraftforge.common.brewing.VanillaBrewingRecipe - for (int i = 0; i < 3; ++i) +@@ -193,6 +193,7 @@ { -- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) -+ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) - { - int j = this.brewingItemStacks[i].getMetadata(); - int k = this.getPotionResult(j, itemstack); -@@ -177,10 +180,11 @@ - } - } - } -+ } - -- if (itemstack.getItem().hasContainerItem()) -+ if (itemstack.getItem().hasContainerItem(itemstack)) - { -- this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem()); -+ this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack); - } - else - { -@@ -191,6 +195,7 @@ - this.brewingItemStacks[3] = null; - } + InventoryHelper.spawnItemStack(this.worldObj, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ(), itemstack1); } + net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(brewingItemStacks); } - } -@@ -310,7 +315,9 @@ - - public boolean isItemValidForSlot(int index, ItemStack stack) - { -- return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle; -+ if (index == 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(stack)) return true; -+ else if (index != 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(stack)) return true; -+ return false; - } - - public boolean[] func_174902_m() -@@ -386,4 +393,18 @@ - this.brewingItemStacks[i] = null; + if (itemstack.stackSize <= 0) +@@ -362,6 +363,20 @@ } } -+ + + net.minecraftforge.items.IItemHandler handlerInput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.UP); + net.minecraftforge.items.IItemHandler handlerOutput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.DOWN); + @@ -94,4 +34,7 @@ + return (T) handlerOutput; + return super.getCapability(capability, facing); + } - } ++ + public int getFieldCount() + { + return 2; diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch index 3e3327995d..7fb580f300 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityChest.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityChest.java -@@ -186,6 +186,7 @@ +@@ -171,6 +171,7 @@ { super.updateContainingBlockInfo(); this.adjacentChestChecked = false; @@ -8,11 +8,10 @@ } @SuppressWarnings("incomplete-switch") -@@ -468,4 +469,24 @@ - this.chestContents[i] = null; +@@ -457,6 +458,26 @@ } } -+ + + public net.minecraftforge.items.VanillaDoubleChestItemHandler doubleChestHandler; + + @Override @@ -32,4 +31,7 @@ + { + return super.getCapability(net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + } - } ++ + public void func_184287_a(ResourceLocation p_184287_1_, long p_184287_2_) + { + this.field_184284_m = p_184287_1_; diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch index 3fcdeb5ebd..32746de74a 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java -@@ -141,9 +141,9 @@ +@@ -110,9 +110,9 @@ } } @@ -13,7 +13,7 @@ this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); if (compound.hasKey("CustomName", 8)) -@@ -155,9 +155,9 @@ +@@ -124,9 +124,9 @@ public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); @@ -26,7 +26,7 @@ NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.furnaceItemStacks.length; ++i) -@@ -223,8 +223,7 @@ +@@ -192,8 +192,7 @@ if (this.furnaceItemStacks[1].stackSize == 0) { @@ -36,7 +36,7 @@ } } } -@@ -279,7 +278,11 @@ +@@ -248,7 +247,11 @@ else { ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks[0]); @@ -49,7 +49,7 @@ } } -@@ -295,7 +298,7 @@ +@@ -264,7 +267,7 @@ } else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem()) { @@ -58,7 +58,7 @@ } if (this.furnaceItemStacks[0].getItem() == Item.getItemFromBlock(Blocks.sponge) && this.furnaceItemStacks[0].getMetadata() == 1 && this.furnaceItemStacks[1] != null && this.furnaceItemStacks[1].getItem() == Items.bucket) -@@ -342,7 +345,15 @@ +@@ -311,7 +314,15 @@ } } @@ -75,7 +75,7 @@ } } -@@ -451,4 +462,21 @@ +@@ -432,4 +443,21 @@ this.furnaceItemStacks[i] = null; } } diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch index b74a494e6c..2b856f03d0 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java -@@ -260,6 +260,7 @@ +@@ -237,6 +237,7 @@ private boolean transferItemsOut() { @@ -8,7 +8,7 @@ IInventory iinventory = this.getInventoryForHopperTransfer(); if (iinventory == null) -@@ -366,6 +367,7 @@ +@@ -343,6 +344,7 @@ public static boolean captureDroppedItems(IHopper p_145891_0_) { @@ -16,7 +16,7 @@ IInventory iinventory = getHopperInventory(p_145891_0_); if (iinventory != null) -@@ -515,17 +517,31 @@ +@@ -492,17 +494,31 @@ if (itemstack == null) { @@ -49,7 +49,7 @@ } if (flag) -@@ -668,4 +684,10 @@ +@@ -648,4 +664,10 @@ this.inventory[i] = null; } } diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch index d62f80aaf4..1c12efd06f 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityLockable.java @@ -47,4 +47,25 @@ { - return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + return (ITextComponent)(this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName(), new Object[0])); } + + private net.minecraftforge.items.IItemHandler itemHandler; diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch index 01099d4508..b1c9e4aa44 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityNote.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityNote.java -@@ -27,7 +27,9 @@ +@@ -29,7 +29,9 @@ public void changePitch() { diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch index 4595567a7b..d571436407 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityPiston.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityPiston.java -@@ -148,7 +148,8 @@ +@@ -201,7 +201,8 @@ if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) { this.worldObj.setBlockState(this.pos, this.pistonState, 3); @@ -10,7 +10,7 @@ } } } -@@ -166,7 +167,8 @@ +@@ -219,7 +220,8 @@ if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) { this.worldObj.setBlockState(this.pos, this.pistonState, 3); diff --git a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch index b95942d3ed..4c4f169df7 100644 --- a/patches.mcp/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch +++ b/patches.mcp/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntitySign.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntitySign.java -@@ -61,7 +61,7 @@ +@@ -60,7 +60,7 @@ } public boolean canCommandSenderUseCommand(int permLevel, String commandName) { diff --git a/patches.mcp/minecraft/net/minecraft/util/BlockPos.java.patch b/patches.mcp/minecraft/net/minecraft/util/BlockPos.java.patch deleted file mode 100644 index d8fbe33d7e..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/BlockPos.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/BlockPos.java -+++ ../src-work/minecraft/net/minecraft/util/BlockPos.java -@@ -257,6 +257,21 @@ - }; - } - -+ /** -+ * Returns a version of this BlockPos that is guaranteed to be Immutable. -+ * In most cases this will return 'this', but if 'this' is an instance of -+ * MutableBlockPos it will return a new instance of BlockPos with the same values. -+ * -+ * When storing a parameter given to you for an extended period of time, make sure you -+ * use this in case the value is changed internally. -+ * -+ * @return An immutable BlockPos. -+ */ -+ public BlockPos getImmutable() -+ { -+ return this; -+ } -+ - public static final class MutableBlockPos extends BlockPos - { - private int x; -@@ -298,5 +313,7 @@ - this.z = zIn; - return this; - } -+ -+ @Override public BlockPos getImmutable() { return new BlockPos(this); } - } - } diff --git a/patches.mcp/minecraft/net/minecraft/util/ChatComponentStyle.java.patch b/patches.mcp/minecraft/net/minecraft/util/ChatComponentStyle.java.patch deleted file mode 100644 index a694725b19..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/ChatComponentStyle.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/ChatComponentStyle.java -+++ ../src-work/minecraft/net/minecraft/util/ChatComponentStyle.java -@@ -74,7 +74,6 @@ - return stringbuilder.toString(); - } - -- @SideOnly(Side.CLIENT) - public final String getFormattedText() - { - StringBuilder stringbuilder = new StringBuilder(); diff --git a/patches.mcp/minecraft/net/minecraft/util/ChatStyle.java.patch b/patches.mcp/minecraft/net/minecraft/util/ChatStyle.java.patch deleted file mode 100644 index f9f7a30098..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/ChatStyle.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/ChatStyle.java -+++ ../src-work/minecraft/net/minecraft/util/ChatStyle.java -@@ -229,7 +229,6 @@ - return this; - } - -- @SideOnly(Side.CLIENT) - public String getFormattingCode() - { - if (this.isEmpty()) diff --git a/patches.mcp/minecraft/net/minecraft/util/EnumFacing.java.patch b/patches.mcp/minecraft/net/minecraft/util/EnumFacing.java.patch index 5f5717bf96..fecbe4e748 100644 --- a/patches.mcp/minecraft/net/minecraft/util/EnumFacing.java.patch +++ b/patches.mcp/minecraft/net/minecraft/util/EnumFacing.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/util/EnumFacing.java +++ ../src-work/minecraft/net/minecraft/util/EnumFacing.java -@@ -6,8 +6,6 @@ - import java.util.Iterator; - import java.util.Map; - import java.util.Random; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - - public enum EnumFacing implements IStringSerializable - { -@@ -60,7 +58,6 @@ +@@ -62,7 +62,6 @@ return getFront(this.opposite); } @@ -17,7 +8,7 @@ public EnumFacing rotateAround(EnumFacing.Axis axis) { switch (axis) -@@ -111,7 +108,6 @@ +@@ -113,7 +112,6 @@ } } @@ -25,7 +16,7 @@ private EnumFacing rotateX() { switch (this) -@@ -131,7 +127,6 @@ +@@ -133,7 +131,6 @@ } } @@ -33,7 +24,7 @@ private EnumFacing rotateZ() { switch (this) -@@ -192,7 +187,6 @@ +@@ -194,7 +191,6 @@ return this.axis; } @@ -41,7 +32,7 @@ public static EnumFacing byName(String name) { return name == null ? null : (EnumFacing)NAME_LOOKUP.get(name.toLowerCase()); -@@ -218,7 +212,6 @@ +@@ -225,7 +221,6 @@ return values()[rand.nextInt(values().length)]; } @@ -49,7 +40,7 @@ public static EnumFacing getFacingFromVector(float p_176737_0_, float p_176737_1_, float p_176737_2_) { EnumFacing enumfacing = NORTH; -@@ -261,7 +254,6 @@ +@@ -268,7 +263,6 @@ throw new IllegalArgumentException("No such direction: " + p_181076_0_ + " " + p_181076_1_); } @@ -57,7 +48,7 @@ public Vec3i getDirectionVec() { return this.directionVec; -@@ -297,7 +289,6 @@ +@@ -304,7 +298,6 @@ this.plane = plane; } diff --git a/patches.mcp/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch b/patches.mcp/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch deleted file mode 100644 index 7bb192c6d1..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/EnumWorldBlockLayer.java -+++ ../src-work/minecraft/net/minecraft/util/EnumWorldBlockLayer.java -@@ -1,9 +1,5 @@ - package net.minecraft.util; - --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; -- --@SideOnly(Side.CLIENT) - public enum EnumWorldBlockLayer - { - SOLID("Solid"), diff --git a/patches.mcp/minecraft/net/minecraft/util/IChatComponent.java.patch b/patches.mcp/minecraft/net/minecraft/util/IChatComponent.java.patch deleted file mode 100644 index 6a73ab2ebb..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/IChatComponent.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/IChatComponent.java -+++ ../src-work/minecraft/net/minecraft/util/IChatComponent.java -@@ -31,7 +31,6 @@ - - String getUnformattedText(); - -- @SideOnly(Side.CLIENT) - String getFormattedText(); - - List getSiblings(); diff --git a/patches.mcp/minecraft/net/minecraft/util/MovingObjectPosition.java.patch b/patches.mcp/minecraft/net/minecraft/util/MovingObjectPosition.java.patch deleted file mode 100644 index 56494d05e6..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/MovingObjectPosition.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/MovingObjectPosition.java -+++ ../src-work/minecraft/net/minecraft/util/MovingObjectPosition.java -@@ -10,6 +10,12 @@ - public Vec3 hitVec; - public Entity entityHit; - -+ /** Used to determine what sub-segment is hit */ -+ public int subHit = -1; -+ -+ /** Used to add extra hit info */ -+ public Object hitInfo = null; -+ - public MovingObjectPosition(Vec3 hitVecIn, EnumFacing facing, BlockPos blockPosIn) - { - this(MovingObjectPosition.MovingObjectType.BLOCK, hitVecIn, facing, blockPosIn); diff --git a/patches.mcp/minecraft/net/minecraft/util/ResourceLocation.java.patch b/patches.mcp/minecraft/net/minecraft/util/ResourceLocation.java.patch deleted file mode 100644 index 737a367859..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/ResourceLocation.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/ResourceLocation.java -+++ ../src-work/minecraft/net/minecraft/util/ResourceLocation.java -@@ -1,7 +1,5 @@ - package net.minecraft.util; - --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - import org.apache.commons.lang3.Validate; - - public class ResourceLocation -@@ -21,7 +19,6 @@ - this(0, splitObjectName(resourceName)); - } - -- @SideOnly(Side.CLIENT) - public ResourceLocation(String resourceDomainIn, String resourcePathIn) - { - this(0, new String[] {resourceDomainIn, resourcePathIn}); -@@ -50,7 +47,6 @@ - return this.resourcePath; - } - -- @SideOnly(Side.CLIENT) - public String getResourceDomain() - { - return this.resourceDomain; diff --git a/patches.mcp/minecraft/net/minecraft/util/Session.java.patch b/patches.mcp/minecraft/net/minecraft/util/Session.java.patch index 48492d58dc..b0432b81ec 100644 --- a/patches.mcp/minecraft/net/minecraft/util/Session.java.patch +++ b/patches.mcp/minecraft/net/minecraft/util/Session.java.patch @@ -50,23 +50,3 @@ } } -@@ -62,6 +81,19 @@ - return this.sessionType; - } - -+ /* ======================================== FORGE START ===================================== */ -+ //For internal use only. Modders should never need to use this. -+ public void setProperties(com.mojang.authlib.properties.PropertyMap properties) -+ { -+ if(this.properties == null) this.properties = properties; -+ } -+ -+ public boolean hasCachedProperties() -+ { -+ return properties != null; -+ } -+ /* ========================================= FORGE END ====================================== */ -+ - @SideOnly(Side.CLIENT) - public static enum Type - { diff --git a/patches.mcp/minecraft/net/minecraft/util/StringTranslate.java.patch b/patches.mcp/minecraft/net/minecraft/util/StringTranslate.java.patch deleted file mode 100644 index f6d51a843f..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/StringTranslate.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/StringTranslate.java -+++ ../src-work/minecraft/net/minecraft/util/StringTranslate.java -@@ -23,9 +23,29 @@ - - public StringTranslate() - { -+ InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); -+ inject(this, inputstream); -+ } -+ -+ public static void inject(InputStream inputstream) -+ { -+ inject(instance, inputstream); -+ } -+ -+ private static void inject(StringTranslate inst, InputStream inputstream) -+ { -+ java.util.HashMap map = parseLangFile(inputstream); -+ inst.languageList.putAll(map); -+ inst.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); -+ } -+ -+ public static java.util.HashMap parseLangFile(InputStream inputstream) -+ { -+ java.util.HashMap table = Maps.newHashMap(); - try - { -- InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); -+ inputstream = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(table, inputstream); -+ if (inputstream == null) return table; - - for (String s : IOUtils.readLines(inputstream, Charsets.UTF_8)) - { -@@ -37,17 +57,17 @@ - { - String s1 = astring[0]; - String s2 = numericVariablePattern.matcher(astring[1]).replaceAll("%$1s"); -- this.languageList.put(s1, s2); -+ table.put(s1, s2); - } - } - } - -- this.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); - } -- catch (IOException var7) -+ catch (Exception var7) - { - ; - } -+ return table; - } - - static StringTranslate getInstance() diff --git a/patches.mcp/minecraft/net/minecraft/util/Vec3.java.patch b/patches.mcp/minecraft/net/minecraft/util/Vec3.java.patch deleted file mode 100644 index 43a23f3c84..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/Vec3.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/Vec3.java -+++ ../src-work/minecraft/net/minecraft/util/Vec3.java -@@ -1,8 +1,5 @@ - package net.minecraft.util; - --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; -- - public class Vec3 - { - public final double xCoord; -@@ -36,7 +33,6 @@ - this((double)p_i46377_1_.getX(), (double)p_i46377_1_.getY(), (double)p_i46377_1_.getZ()); - } - -- @SideOnly(Side.CLIENT) - public Vec3 subtractReverse(Vec3 vec) - { - return new Vec3(vec.xCoord - this.xCoord, vec.yCoord - this.yCoord, vec.zCoord - this.zCoord); -@@ -53,7 +49,6 @@ - return this.xCoord * vec.xCoord + this.yCoord * vec.yCoord + this.zCoord * vec.zCoord; - } - -- @SideOnly(Side.CLIENT) - public Vec3 crossProduct(Vec3 vec) - { - return new Vec3(this.yCoord * vec.zCoord - this.zCoord * vec.yCoord, this.zCoord * vec.xCoord - this.xCoord * vec.zCoord, this.xCoord * vec.yCoord - this.yCoord * vec.xCoord); -@@ -79,7 +74,6 @@ - return new Vec3(this.xCoord + x, this.yCoord + y, this.zCoord + z); - } - -- @SideOnly(Side.CLIENT) - public double distanceTo(Vec3 vec) - { - double d0 = vec.xCoord - this.xCoord; diff --git a/patches.mcp/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch b/patches.mcp/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch deleted file mode 100644 index 5c01e52079..0000000000 --- a/patches.mcp/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/util/WeightedRandomChestContent.java -+++ ../src-work/minecraft/net/minecraft/util/WeightedRandomChestContent.java -@@ -36,48 +36,39 @@ - for (int i = 0; i < max; ++i) - { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, listIn); -- int j = weightedrandomchestcontent.minStackSize + random.nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); -+ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(random, inv); - -- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) -+ for (ItemStack itemstack1 : stacks) - { -- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); -- itemstack1.stackSize = j; - inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack1); - } -- else -- { -- for (int k = 0; k < j; ++k) -- { -- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); -- itemstack.stackSize = 1; -- inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack); -- } -- } - } - } - -+ // -- Forge hooks -+ /** -+ * Allow a mod to submit a custom implementation that can delegate item stack generation beyond simple stack lookup -+ * -+ * @param random The current random for generation -+ * @param newInventory The inventory being generated (do not populate it, but you can refer to it) -+ * @return An array of {@link ItemStack} to put into the chest -+ */ -+ protected ItemStack[] generateChestContent(Random random, IInventory newInventory) -+ { -+ return net.minecraftforge.common.ChestGenHooks.generateStacks(random, theItemId, minStackSize, maxStackSize); -+ } -+ - public static void generateDispenserContents(Random random, List listIn, TileEntityDispenser dispenser, int max) - { - for (int i = 0; i < max; ++i) - { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, listIn); -- int j = weightedrandomchestcontent.minStackSize + random.nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); -+ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(random, dispenser); - -- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) -+ for (ItemStack itemstack1 : stacks) - { -- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); -- itemstack1.stackSize = j; - dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack1); - } -- else -- { -- for (int k = 0; k < j; ++k) -- { -- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); -- itemstack.stackSize = 1; -- dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack); -- } -- } - } - } - diff --git a/patches.mcp/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches.mcp/minecraft/net/minecraft/world/ChunkCache.java.patch index c8595ac68b..3f5cc6f748 100644 --- a/patches.mcp/minecraft/net/minecraft/world/ChunkCache.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/ChunkCache.java.patch @@ -18,15 +18,6 @@ return this.chunkArray[i][j].getLightFor(p_175629_1_, pos); } } -@@ -150,7 +154,7 @@ - - public boolean isAirBlock(BlockPos pos) - { -- return this.getBlockState(pos).getBlock().getMaterial() == Material.air; -+ return this.getBlockState(pos).getBlock().isAir(this, pos); - } - - @SideOnly(Side.CLIENT) @@ -160,6 +164,7 @@ { int i = (pos.getX() >> 4) - this.chunkX; @@ -35,7 +26,7 @@ return this.chunkArray[i][j].getLightFor(p_175628_1_, pos); } else -@@ -179,4 +184,16 @@ +@@ -178,4 +183,16 @@ { return this.worldObj.getWorldType(); } diff --git a/patches.mcp/minecraft/net/minecraft/world/Explosion.java.patch b/patches.mcp/minecraft/net/minecraft/world/Explosion.java.patch index 5e8458644a..3a8d6d929d 100644 --- a/patches.mcp/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/Explosion.java.patch @@ -1,14 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/Explosion.java +++ ../src-work/minecraft/net/minecraft/world/Explosion.java -@@ -38,6 +38,7 @@ - private final float explosionSize; - private final List affectedBlockPositions; - private final Map playerKnockbackMap; -+ private final Vec3 position; - - @SideOnly(Side.CLIENT) - public Explosion(World worldIn, Entity p_i45752_2_, double p_i45752_3_, double p_i45752_5_, double p_i45752_7_, float p_i45752_9_, List p_i45752_10_) -@@ -65,6 +66,7 @@ +@@ -67,6 +67,7 @@ this.explosionZ = p_i45754_7_; this.isFlaming = p_i45754_10_; this.isSmoking = p_i45754_11_; @@ -16,24 +8,16 @@ } public void doExplosionA() -@@ -99,7 +101,7 @@ +@@ -101,7 +102,7 @@ - if (iblockstate.getBlock().getMaterial() != Material.air) + if (iblockstate.func_185904_a() != Material.air) { - float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance((Entity)null); + float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(worldObj, blockpos, (Entity)null, this); f -= (f2 + 0.3F) * 0.3F; } -@@ -126,6 +128,7 @@ - int j2 = MathHelper.floor_double(this.explosionZ - (double)f3 - 1.0D); - int j1 = MathHelper.floor_double(this.explosionZ + (double)f3 + 1.0D); - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, new AxisAlignedBB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); -+ net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.worldObj, this, list, f3); - Vec3 vec3 = new Vec3(this.explosionX, this.explosionY, this.explosionZ); - - for (int k2 = 0; k2 < list.size(); ++k2) -@@ -213,8 +216,7 @@ +@@ -227,8 +228,7 @@ block.dropBlockAsItemWithChance(this.worldObj, blockpos, this.worldObj.getBlockState(blockpos), 1.0F / this.explosionSize, 0); } @@ -43,7 +27,7 @@ } } } -@@ -250,4 +252,6 @@ +@@ -264,4 +264,6 @@ { return this.affectedBlockPositions; } diff --git a/patches.mcp/minecraft/net/minecraft/world/SpawnerAnimals.java.patch b/patches.mcp/minecraft/net/minecraft/world/SpawnerAnimals.java.patch deleted file mode 100644 index 135ef3d399..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/SpawnerAnimals.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/SpawnerAnimals.java -+++ ../src-work/minecraft/net/minecraft/world/SpawnerAnimals.java -@@ -69,14 +69,15 @@ - { - if ((!enumcreaturetype.getPeacefulCreature() || spawnPeacefulMobs) && (enumcreaturetype.getPeacefulCreature() || spawnHostileMobs) && (!enumcreaturetype.getAnimal() || p_77192_4_)) - { -- int j4 = worldServerIn.countEntities(enumcreaturetype.getCreatureClass()); -+ int j4 = worldServerIn.countEntities(enumcreaturetype, true); - int k4 = enumcreaturetype.getMaxNumberOfCreature() * i / MOB_COUNT_DIV; - - if (j4 <= k4) - { -+ java.util.ArrayList shuffled = com.google.common.collect.Lists.newArrayList(this.eligibleChunksForSpawning); -+ java.util.Collections.shuffle(shuffled); - label374: -- -- for (ChunkCoordIntPair chunkcoordintpair1 : this.eligibleChunksForSpawning) -+ for (ChunkCoordIntPair chunkcoordintpair1 : shuffled) - { - BlockPos blockpos = getRandomChunkPosition(worldServerIn, chunkcoordintpair1.chunkXPos, chunkcoordintpair1.chunkZPos); - int k1 = blockpos.getX(); -@@ -134,8 +135,10 @@ - - entityliving.setLocationAndAngles((double)f, (double)i3, (double)f1, worldServerIn.rand.nextFloat() * 360.0F, 0.0F); - -- if (entityliving.getCanSpawnHere() && entityliving.isNotColliding()) -+ net.minecraftforge.fml.common.eventhandler.Event.Result canSpawn = net.minecraftforge.event.ForgeEventFactory.canEntitySpawn(entityliving, worldServerIn, f, i3, f1); -+ if (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT && (entityliving.getCanSpawnHere() && entityliving.isNotColliding()))) - { -+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, worldServerIn, f, l3, f1)) - ientitylivingdata = entityliving.onInitialSpawn(worldServerIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); - - if (entityliving.isNotColliding()) -@@ -144,7 +147,7 @@ - worldServerIn.spawnEntityInWorld(entityliving); - } - -- if (j2 >= entityliving.getMaxSpawnedInChunk()) -+ if (i2 >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(entityliving)) - { - continue label374; - } -@@ -193,7 +196,7 @@ - { - BlockPos blockpos = pos.down(); - -- if (!World.doesBlockHaveSolidTopSurface(worldIn, blockpos)) -+ if (!worldIn.getBlockState(blockpos).getBlock().canCreatureSpawn(worldIn, blockpos, spawnPlacementTypeIn)) - { - return false; - } diff --git a/patches.mcp/minecraft/net/minecraft/world/World.java.patch b/patches.mcp/minecraft/net/minecraft/world/World.java.patch index 273dc98c57..4b28a89dfe 100644 --- a/patches.mcp/minecraft/net/minecraft/world/World.java.patch +++ b/patches.mcp/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 -@@ -57,6 +57,13 @@ +@@ -60,6 +60,13 @@ public abstract class World implements IBlockAccess { @@ -14,7 +14,7 @@ private int seaLevel = 63; protected boolean scheduledUpdatesAreImmediate; public final List loadedEntityList = Lists.newArrayList(); -@@ -98,6 +105,10 @@ +@@ -101,6 +108,10 @@ private final WorldBorder worldBorder; int[] lightUpdateBlockList; @@ -24,8 +24,8 @@ + protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client) { - this.ambientTickCountdown = this.rand.nextInt(12000); -@@ -110,6 +121,7 @@ + this.worldAccesses = Lists.newArrayList(new IWorldEventListener[] {this.field_184152_t}); +@@ -115,6 +126,7 @@ this.provider = providerIn; this.isRemote = client; this.worldBorder = providerIn.getWorldBorder(); @@ -33,7 +33,7 @@ } public World init() -@@ -119,6 +131,11 @@ +@@ -124,6 +136,11 @@ public BiomeGenBase getBiomeGenForCoords(final BlockPos pos) { @@ -45,88 +45,7 @@ if (this.isBlockLoaded(pos)) { Chunk chunk = this.getChunkFromBlockCoords(pos); -@@ -184,7 +201,7 @@ - - public boolean isAirBlock(BlockPos pos) - { -- return this.getBlockState(pos).getBlock().getMaterial() == Material.air; -+ return this.getBlockState(pos).getBlock().isAir(this, pos); - } - - public boolean isBlockLoaded(BlockPos pos) -@@ -284,39 +301,63 @@ - { - Chunk chunk = this.getChunkFromBlockCoords(pos); - Block block = newState.getBlock(); -+ -+ net.minecraftforge.common.util.BlockSnapshot blockSnapshot = null; -+ if (this.captureBlockSnapshots && !this.isRemote) -+ { -+ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, pos, flags); -+ this.capturedBlockSnapshots.add(blockSnapshot); -+ } -+ Block oldBlock = getBlockState(pos).getBlock(); -+ int oldLight = oldBlock.getLightValue(this, pos); -+ int oldOpacity = oldBlock.getLightOpacity(this, pos); -+ - IBlockState iblockstate = chunk.setBlockState(pos, newState); - - if (iblockstate == null) - { -+ if (blockSnapshot != null) this.capturedBlockSnapshots.remove(blockSnapshot); - return false; - } - else - { - Block block1 = iblockstate.getBlock(); - -- if (block.getLightOpacity() != block1.getLightOpacity() || block.getLightValue() != block1.getLightValue()) -+ if (block.getLightOpacity(this, pos) != oldOpacity || block.getLightValue(this, pos) != oldLight) - { - this.theProfiler.startSection("checkLight"); - this.checkLight(pos); - this.theProfiler.endSection(); - } - -- if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && chunk.isPopulated()) -+ if (blockSnapshot == null) // Don't notify clients or update physics while capturing blockstates - { -- this.markBlockForUpdate(pos); -+ this.markAndNotifyBlock(pos, chunk, iblockstate, newState, flags); // Modularize client and physic updates - } - -+ return true; -+ } -+ } -+ } -+ -+ // Split off from original setBlockState(BlockPos, IBlockState Block p_147465_4_, int) method in order to directly send client and physic updates -+ public void markAndNotifyBlock(BlockPos pos, Chunk chunk, IBlockState old, IBlockState new_, int flags) -+ { -+ if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && (chunk == null || chunk.isPopulated())) -+ { -+ this.markBlockForUpdate(pos); -+ } -+ { -+ { - if (!this.isRemote && (flags & 1) != 0) - { -- this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock()); -+ this.notifyNeighborsRespectDebug(pos, new_.getBlock()); - -- if (block.hasComparatorInputOverride()) -+ if (new_.getBlock().hasComparatorInputOverride()) - { -- this.updateComparatorOutputLevel(pos, block); -+ this.updateComparatorOutputLevel(pos, new_.getBlock()); - } - } -- -- return true; - } - } - } -@@ -404,6 +445,9 @@ +@@ -409,6 +426,9 @@ public void notifyNeighborsOfStateChange(BlockPos pos, Block blockType) { @@ -136,7 +55,7 @@ this.notifyBlockOfStateChange(pos.west(), blockType); this.notifyBlockOfStateChange(pos.east(), blockType); this.notifyBlockOfStateChange(pos.down(), blockType); -@@ -414,6 +458,11 @@ +@@ -419,6 +439,11 @@ public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide) { @@ -148,7 +67,7 @@ if (skipSide != EnumFacing.WEST) { this.notifyBlockOfStateChange(pos.west(), blockType); -@@ -777,7 +826,7 @@ +@@ -782,7 +807,7 @@ public boolean isDaytime() { @@ -156,10 +75,10 @@ + return this.provider.isDaytime(); } - public MovingObjectPosition rayTraceBlocks(Vec3 p_72933_1_, Vec3 p_72933_2_) -@@ -972,6 +1021,12 @@ + public RayTraceResult rayTraceBlocks(Vec3d p_72933_1_, Vec3d p_72933_2_) +@@ -994,6 +1019,12 @@ - public void playSoundAtEntity(Entity entityIn, String name, float volume, float pitch) + public void func_184149_a(BlockPos p_184149_1_, SoundEvent p_184149_2_) { + net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(entityIn, name, volume, pitch); + if (event.isCanceled() || event.name == null) return; @@ -169,10 +88,10 @@ + for (int i = 0; i < this.worldAccesses.size(); ++i) { - ((IWorldAccess)this.worldAccesses.get(i)).playSound(name, entityIn.posX, entityIn.posY, entityIn.posZ, volume, pitch); -@@ -980,6 +1035,12 @@ + ((IWorldEventListener)this.worldAccesses.get(i)).func_184377_a(p_184149_2_, p_184149_1_); +@@ -1013,6 +1044,12 @@ - public void playSoundToNearExcept(EntityPlayer player, String name, float volume, float pitch) + private void spawnParticle(int particleID, boolean p_175720_2_, double xCood, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... p_175720_15_) { + net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(player, name, volume, pitch); + if (event.isCanceled() || event.name == null) return; @@ -182,8 +101,8 @@ + for (int i = 0; i < this.worldAccesses.size(); ++i) { - ((IWorldAccess)this.worldAccesses.get(i)).playSoundToNearExcept(player, name, player.posX, player.posY, player.posZ, volume, pitch); -@@ -1033,6 +1094,9 @@ + ((IWorldEventListener)this.worldAccesses.get(i)).spawnParticle(particleID, p_175720_2_, xCood, yCoord, zCoord, xOffset, yOffset, zOffset, p_175720_15_); +@@ -1027,6 +1064,9 @@ public boolean spawnEntityInWorld(Entity entityIn) { @@ -193,7 +112,7 @@ int i = MathHelper.floor_double(entityIn.posX / 16.0D); int j = MathHelper.floor_double(entityIn.posZ / 16.0D); boolean flag = entityIn.forceSpawn; -@@ -1055,6 +1119,8 @@ +@@ -1049,6 +1089,8 @@ this.updateAllPlayersSleepingFlag(); } @@ -202,40 +121,7 @@ this.getChunkFromChunkCoords(i, j).addEntity(entityIn); this.loadedEntityList.add(entityIn); this.onEntityAdded(entityIn); -@@ -1267,17 +1333,29 @@ - - public int calculateSkylightSubtracted(float p_72967_1_) - { -+ float f = provider.getSunBrightnessFactor(p_72967_1_); -+ f = 1 - f; -+ return (int)(f * 11); -+ } -+ -+ /** -+ * The current sun brightness factor for this dimension. -+ * 0.0f means no light at all, and 1.0f means maximum sunlight. -+ * Highly recommended for sunlight detection like solar panel. -+ * -+ * @return The current brightness factor -+ * */ -+ public float getSunBrightnessFactor(float p_72967_1_) -+ { - float f = this.getCelestialAngle(p_72967_1_); - float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F); - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); - f1 = 1.0F - f1; - f1 = (float)((double)f1 * (1.0D - (double)(this.getRainStrength(p_72967_1_) * 5.0F) / 16.0D)); - f1 = (float)((double)f1 * (1.0D - (double)(this.getThunderStrength(p_72967_1_) * 5.0F) / 16.0D)); -- f1 = 1.0F - f1; -- return (int)(f1 * 11.0F); -+ return f1; - } - -- @SideOnly(Side.CLIENT) - public void removeWorldAccess(IWorldAccess worldAccess) - { - this.worldAccesses.remove(worldAccess); -@@ -1286,6 +1364,12 @@ +@@ -1361,6 +1403,12 @@ @SideOnly(Side.CLIENT) public float getSunBrightness(float p_72971_1_) { @@ -246,11 +132,11 @@ + public float getSunBrightnessBody(float p_72971_1_) + { float f = this.getCelestialAngle(p_72971_1_); - float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F); + float f1 = 1.0F - (MathHelper.cos(f * ((float)Math.PI * 2F)) * 2.0F + 0.2F); f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); -@@ -1298,6 +1382,12 @@ +@@ -1373,6 +1421,12 @@ @SideOnly(Side.CLIENT) - public Vec3 getSkyColor(Entity entityIn, float partialTicks) + public Vec3d getSkyColor(Entity entityIn, float partialTicks) { + return this.provider.getSkyColor(entityIn, partialTicks); + } @@ -259,9 +145,9 @@ + public Vec3 getSkyColorBody(Entity entityIn, float partialTicks) + { float f = this.getCelestialAngle(partialTicks); - float f1 = MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + float f1 = MathHelper.cos(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F; f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); -@@ -1305,9 +1395,7 @@ +@@ -1380,9 +1434,7 @@ int j = MathHelper.floor_double(entityIn.posY); int k = MathHelper.floor_double(entityIn.posZ); BlockPos blockpos = new BlockPos(i, j, k); @@ -272,7 +158,7 @@ float f3 = (float)(l >> 16 & 255) / 255.0F; float f4 = (float)(l >> 8 & 255) / 255.0F; float f5 = (float)(l & 255) / 255.0F; -@@ -1367,6 +1455,11 @@ +@@ -1442,11 +1494,22 @@ public float getCurrentMoonPhaseFactor() { @@ -284,9 +170,7 @@ return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; } -@@ -1379,6 +1472,12 @@ - @SideOnly(Side.CLIENT) - public Vec3 getCloudColour(float partialTicks) + public float getCelestialAngleRadians(float partialTicks) { + return this.provider.drawClouds(partialTicks); + } @@ -295,23 +179,11 @@ + public Vec3 drawCloudsBody(float partialTicks) + { float f = this.getCelestialAngle(partialTicks); - float f1 = MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); -@@ -1434,9 +1533,9 @@ - for (blockpos = new BlockPos(pos.getX(), chunk.getTopFilledSegment() + 16, pos.getZ()); blockpos.getY() >= 0; blockpos = blockpos1) - { - blockpos1 = blockpos.down(); -- Material material = chunk.getBlock(blockpos1).getMaterial(); -+ Block block = chunk.getBlock(blockpos1); - -- if (material.blocksMovement() && material != Material.leaves) -+ if (block.getMaterial().blocksMovement() && !block.isLeaves(this, blockpos1) && !block.isFoliage(this, blockpos1)) - { - break; - } -@@ -1448,6 +1547,12 @@ + return f * ((float)Math.PI * 2F); + } +@@ -1454,6 +1517,12 @@ @SideOnly(Side.CLIENT) - public float getStarBrightness(float partialTicks) + public Vec3d getCloudColour(float partialTicks) { + return this.provider.getStarBrightness(partialTicks); + } @@ -320,9 +192,9 @@ + public float getStarBrightnessBody(float partialTicks) + { float f = this.getCelestialAngle(partialTicks); - float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + float f1 = MathHelper.cos(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F; f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); -@@ -1494,7 +1599,15 @@ +@@ -1574,7 +1643,15 @@ entity.addEntityCrashInfo(crashreportcategory); } @@ -339,42 +211,7 @@ } if (entity.isDead) -@@ -1554,7 +1667,15 @@ - CrashReport crashreport1 = CrashReport.makeCrashReport(throwable1, "Ticking entity"); - CrashReportCategory crashreportcategory2 = crashreport1.makeCategory("Entity being ticked"); - entity2.addEntityCrashInfo(crashreportcategory2); -- throw new ReportedException(crashreport1); -+ if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) -+ { -+ net.minecraftforge.fml.common.FMLLog.severe(crashreport1.getCompleteReport()); -+ removeEntity(entity2); -+ } -+ else -+ { -+ throw new ReportedException(crashreport1); -+ } - } - } - -@@ -1601,7 +1722,16 @@ - CrashReport crashreport2 = CrashReport.makeCrashReport(throwable, "Ticking block entity"); - CrashReportCategory crashreportcategory1 = crashreport2.makeCategory("Block entity being ticked"); - tileentity.addInfoToCrashReport(crashreportcategory1); -- throw new ReportedException(crashreport2); -+ if (net.minecraftforge.common.ForgeModContainer.removeErroringTileEntities) -+ { -+ net.minecraftforge.fml.common.FMLLog.severe(crashreport2.getCompleteReport()); -+ tileentity.invalidate(); -+ this.removeTileEntity(tileentity.getPos()); -+ } -+ else -+ { -+ throw new ReportedException(crashreport2); -+ } - } - } - } -@@ -1618,15 +1748,20 @@ +@@ -1701,15 +1778,20 @@ } } @@ -397,7 +234,7 @@ this.theProfiler.endStartSection("pendingBlockEntities"); if (!this.addedTileEntityList.isEmpty()) -@@ -1660,7 +1795,8 @@ +@@ -1748,7 +1830,8 @@ public boolean addTileEntity(TileEntity tile) { @@ -407,7 +244,7 @@ if (flag && tile instanceof ITickable) { -@@ -1699,9 +1835,13 @@ +@@ -1782,9 +1865,13 @@ { int i = MathHelper.floor_double(entityIn.posX); int j = MathHelper.floor_double(entityIn.posZ); @@ -423,17 +260,8 @@ { entityIn.lastTickPosX = entityIn.posX; entityIn.lastTickPosY = entityIn.posY; -@@ -1829,7 +1969,7 @@ - { - Block block = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)).getBlock(); - -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(this, new BlockPos(k1, l1, i2))) - { - return true; - } -@@ -1894,6 +2034,10 @@ - { +@@ -1983,6 +2070,10 @@ + blockpos$pooledmutableblockpos.func_185344_t(); return true; } + else if (block.isBurning(this, new BlockPos(k1, l1, i2))) @@ -443,9 +271,9 @@ } } } -@@ -1930,6 +2074,16 @@ - blockpos$mutableblockpos.set(k1, l1, i2); - IBlockState iblockstate = this.getBlockState(blockpos$mutableblockpos); +@@ -2021,6 +2112,16 @@ + blockpos$pooledmutableblockpos.func_185343_d(k1, l1, i2); + IBlockState iblockstate = this.getBlockState(blockpos$pooledmutableblockpos); Block block = iblockstate.getBlock(); + + Boolean result = block.isEntityInsideMaterial(this, blockpos$mutableblockpos, iblockstate, entityIn, (double)l, materialIn, false); @@ -458,19 +286,9 @@ + } + else if (result != null && result == false) continue; - if (block.getMaterial() == materialIn) + if (iblockstate.func_185904_a() == materialIn) { -@@ -2004,6 +2158,9 @@ - IBlockState iblockstate = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)); - Block block = iblockstate.getBlock(); - -+ Boolean result = block.isAABBInsideMaterial(this, blockpos$mutableblockpos, bb, materialIn); -+ if (result != null) return result; -+ - if (block.getMaterial() == materialIn) - { - int j2 = ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue(); -@@ -2034,6 +2191,7 @@ +@@ -2130,6 +2231,7 @@ public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) { Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking); @@ -478,7 +296,7 @@ explosion.doExplosionA(); explosion.doExplosionB(true); return explosion; -@@ -2180,19 +2338,27 @@ +@@ -2276,19 +2378,27 @@ else { this.addTileEntity(tileEntityIn); @@ -507,7 +325,7 @@ } else { -@@ -2205,6 +2371,7 @@ +@@ -2301,6 +2411,7 @@ this.getChunkFromBlockCoords(pos).removeTileEntity(pos); } @@ -515,25 +333,7 @@ } public void markTileEntityForRemoval(TileEntity tileEntityIn) -@@ -2223,7 +2390,7 @@ - { - IBlockState iblockstate = blockAccess.getBlockState(pos); - Block block = iblockstate.getBlock(); -- return block.getMaterial().isOpaque() && block.isFullCube() ? true : (block instanceof BlockStairs ? iblockstate.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP : (block instanceof BlockSlab ? iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue() == 7 : false)))); -+ return block.isSideSolid(blockAccess, pos, EnumFacing.UP); - } - - public boolean isBlockNormalCube(BlockPos pos, boolean _default) -@@ -2243,7 +2410,7 @@ - else - { - Block block = this.getBlockState(pos).getBlock(); -- return block.getMaterial().isOpaque() && block.isFullCube(); -+ return block.isNormalCube(this, pos); - } - } - } -@@ -2262,6 +2429,7 @@ +@@ -2350,6 +2461,7 @@ { this.spawnHostileMobs = hostile; this.spawnPeacefulMobs = peaceful; @@ -541,7 +341,7 @@ } public void tick() -@@ -2271,6 +2439,11 @@ +@@ -2359,6 +2471,11 @@ protected void calculateInitialWeather() { @@ -553,7 +353,7 @@ if (this.worldInfo.isRaining()) { this.rainingStrength = 1.0F; -@@ -2284,6 +2457,11 @@ +@@ -2372,6 +2489,11 @@ protected void updateWeather() { @@ -565,26 +365,7 @@ if (!this.provider.getHasNoSky()) { if (!this.isRemote) -@@ -2378,6 +2556,7 @@ - { - this.activeChunkSet.clear(); - this.theProfiler.startSection("buildList"); -+ this.activeChunkSet.addAll(getPersistentChunks().keySet()); - - for (int i = 0; i < this.playerEntities.size(); ++i) - { -@@ -2434,8 +2613,9 @@ - Block block = chunkIn.getBlock(blockpos); - j = j + p_147467_1_; - k = k + p_147467_2_; -+ BlockPos worldpos = blockpos.add(p_147467_1_, 0, p_147467_2_); - -- if (block.getMaterial() == Material.air && this.getLight(blockpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, blockpos) <= 0) -+ if (block.isAir(this, worldpos) && this.getLight(worldpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, worldpos) <= 0) //Forge: isAir, and fix arguments to world positions instead of chunk position - { - EntityPlayer entityplayer = this.getClosestPlayer((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, 8.0D); - -@@ -2475,6 +2655,11 @@ +@@ -2491,6 +2613,11 @@ public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj) { @@ -596,7 +377,7 @@ BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); float f = biomegenbase.getFloatTemperature(pos); -@@ -2516,6 +2701,11 @@ +@@ -2532,6 +2659,11 @@ public boolean canSnowAt(BlockPos pos, boolean checkLight) { @@ -608,31 +389,7 @@ BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); float f = biomegenbase.getFloatTemperature(pos); -@@ -2533,7 +2723,7 @@ - { - Block block = this.getBlockState(pos).getBlock(); - -- if (block.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, pos)) -+ if (block.isAir(this, pos) && Blocks.snow_layer.canPlaceBlockAt(this, pos)) - { - return true; - } -@@ -2565,10 +2755,11 @@ - else - { - Block block = this.getBlockState(pos).getBlock(); -- int i = lightType == EnumSkyBlock.SKY ? 0 : block.getLightValue(); -- int j = block.getLightOpacity(); -+ int blockLight = block.getLightValue(this, pos); -+ int i = lightType == EnumSkyBlock.SKY ? 0 : blockLight; -+ int j = block.getLightOpacity(this, pos); - -- if (j >= 15 && block.getLightValue() > 0) -+ if (j >= 15 && blockLight > 0) - { - j = 1; - } -@@ -2768,10 +2959,10 @@ +@@ -2789,10 +2921,10 @@ public List getEntitiesInAABBexcluding(Entity entityIn, AxisAlignedBB boundingBox, Predicate predicate) { List list = Lists.newArrayList(); @@ -647,22 +404,7 @@ for (int i1 = i; i1 <= j; ++i1) { -@@ -2824,10 +3015,10 @@ - - public List getEntitiesWithinAABB(Class clazz, AxisAlignedBB aabb, Predicate filter) - { -- int i = MathHelper.floor_double((aabb.minX - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((aabb.maxX + 2.0D) / 16.0D); -- int k = MathHelper.floor_double((aabb.minZ - 2.0D) / 16.0D); -- int l = MathHelper.floor_double((aabb.maxZ + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((aabb.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((aabb.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int k = MathHelper.floor_double((aabb.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int l = MathHelper.floor_double((aabb.maxZ + MAX_ENTITY_RADIUS) / 16.0D); - List list = Lists.newArrayList(); - - for (int i1 = i; i1 <= j; ++i1) -@@ -2905,11 +3096,13 @@ +@@ -2926,11 +3058,13 @@ public void loadEntities(Collection entityCollection) { @@ -679,27 +421,7 @@ } } -@@ -2922,7 +3115,9 @@ - { - Block block = this.getBlockState(pos).getBlock(); - AxisAlignedBB axisalignedbb = p_175716_3_ ? null : blockIn.getCollisionBoundingBox(this, pos, blockIn.getDefaultState()); -- return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, entityIn) ? false : (block.getMaterial() == Material.circuits && blockIn == Blocks.anvil ? true : block.getMaterial().isReplaceable() && blockIn.canReplace(this, pos, side, itemStackIn)); -+ if (axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, entityIn)) return false; -+ if (block.getMaterial() == Material.circuits && blockIn == Blocks.anvil) return true; -+ return block.isReplaceable(this, pos) && blockIn.canReplace(this, pos, side, itemStackIn); - } - - public int getSeaLevel() -@@ -3007,7 +3202,7 @@ - { - IBlockState iblockstate = this.getBlockState(pos); - Block block = iblockstate.getBlock(); -- return block.isNormalCube() ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing); -+ return block.shouldCheckWeakPower(this, pos, facing) ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing); - } - - public boolean isBlockPowered(BlockPos pos) -@@ -3134,7 +3329,7 @@ +@@ -3215,7 +3349,7 @@ public long getSeed() { @@ -708,7 +430,7 @@ } public long getTotalWorldTime() -@@ -3144,17 +3339,17 @@ +@@ -3225,17 +3359,17 @@ public long getWorldTime() { @@ -729,7 +451,7 @@ if (!this.getWorldBorder().contains(blockpos)) { -@@ -3166,7 +3361,7 @@ +@@ -3247,7 +3381,7 @@ public void setSpawnPoint(BlockPos pos) { @@ -738,7 +460,7 @@ } @SideOnly(Side.CLIENT) -@@ -3186,12 +3381,18 @@ +@@ -3267,12 +3401,18 @@ if (!this.loadedEntityList.contains(entityIn)) { @@ -757,7 +479,7 @@ return true; } -@@ -3285,8 +3486,7 @@ +@@ -3366,8 +3506,7 @@ public boolean isBlockinHighHumidity(BlockPos pos) { @@ -767,7 +489,7 @@ } public MapStorage getMapStorage() -@@ -3345,12 +3545,12 @@ +@@ -3426,12 +3565,12 @@ public int getHeight() { @@ -782,7 +504,7 @@ } public Random setRandomSeed(int p_72843_1_, int p_72843_2_, int p_72843_3_) -@@ -3405,7 +3605,7 @@ +@@ -3481,7 +3620,7 @@ @SideOnly(Side.CLIENT) public double getHorizon() { @@ -791,7 +513,7 @@ } public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) -@@ -3439,7 +3639,7 @@ +@@ -3515,7 +3654,7 @@ public void updateComparatorOutputLevel(BlockPos pos, Block blockIn) { @@ -800,36 +522,10 @@ { BlockPos blockpos = pos.offset(enumfacing); -@@ -3447,18 +3647,14 @@ - { - IBlockState iblockstate = this.getBlockState(blockpos); - -- if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) -+ iblockstate.getBlock().onNeighborChange(this, blockpos, pos); -+ if (iblockstate.getBlock().isNormalCube(this, blockpos)) - { -- iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); -- } -- else if (iblockstate.getBlock().isNormalCube()) -- { -- blockpos = blockpos.offset(enumfacing); -- iblockstate = this.getBlockState(blockpos); -- -- if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) -+ BlockPos posOther = blockpos.offset(enumfacing); -+ Block other = getBlockState(posOther).getBlock(); -+ if (other.getWeakChanges(this, posOther)) - { -- iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); -+ other.onNeighborChange(this, posOther, pos); - } - } - } -@@ -3528,4 +3724,81 @@ - int k = 128; +@@ -3600,6 +3739,83 @@ return i >= -k && i <= k && j >= -k && j <= k; } -+ + + /* ======================================== FORGE START =====================================*/ + /** + * Determine if the given block is considered solid on the @@ -906,4 +602,7 @@ + { + return perWorldStorage; + } - } ++ + public void func_184135_a(Packet p_184135_1_) + { + throw new UnsupportedOperationException("Can\'t send packets to server unless you\'re on the client."); diff --git a/patches.mcp/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches.mcp/minecraft/net/minecraft/world/WorldProvider.java.patch index d281192b68..3995f98c23 100644 --- a/patches.mcp/minecraft/net/minecraft/world/WorldProvider.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/WorldProvider.java.patch @@ -1,51 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/WorldProvider.java +++ ../src-work/minecraft/net/minecraft/world/WorldProvider.java -@@ -51,26 +51,12 @@ - - protected void registerWorldChunkManager() - { -- WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType(); -- -- if (worldtype == WorldType.FLAT) -- { -- FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); -- this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.getBiomeFromBiomeList(flatgeneratorinfo.getBiome(), BiomeGenBase.field_180279_ad), 0.5F); -- } -- else if (worldtype == WorldType.DEBUG_WORLD) -- { -- this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.plains, 0.0F); -- } -- else -- { -- this.worldChunkMgr = new WorldChunkManager(this.worldObj); -- } -+ this.worldChunkMgr = terrainType.getChunkManager(worldObj); - } - - public IChunkProvider createChunkGenerator() - { -- return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) : (this.terrainType == WorldType.CUSTOMIZED ? new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings)))); -+ return terrainType.getChunkGenerator(worldObj, generatorSettings); - } - - public boolean canCoordinateBeSpawn(int x, int z) -@@ -153,13 +139,13 @@ - - public static WorldProvider getProviderForDimension(int dimension) - { -- return (WorldProvider)(dimension == -1 ? new WorldProviderHell() : (dimension == 0 ? new WorldProviderSurface() : (dimension == 1 ? new WorldProviderEnd() : null))); -+ return net.minecraftforge.common.DimensionManager.createProviderFor(dimension); - } - - @SideOnly(Side.CLIENT) - public float getCloudHeight() - { -- return 128.0F; -+ return this.terrainType.getCloudHeight(); - } - - @SideOnly(Side.CLIENT) -@@ -175,13 +161,13 @@ +@@ -172,13 +172,13 @@ public int getAverageGroundLevel() { @@ -61,11 +16,10 @@ } @SideOnly(Side.CLIENT) -@@ -223,4 +209,319 @@ - { +@@ -212,6 +212,321 @@ return new WorldBorder(); } -+ + + /*======================================= Forge Start =========================================*/ + private net.minecraftforge.client.IRenderHandler skyRenderer = null; + private net.minecraftforge.client.IRenderHandler cloudRenderer = null; @@ -380,4 +334,7 @@ + { + return true; + } - } ++ + public void func_186061_a(EntityPlayerMP p_186061_1_) + { + } diff --git a/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch b/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch index a37fdd7e46..3e6d94c700 100644 --- a/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch @@ -1,55 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/WorldServer.java +++ ../src-work/minecraft/net/minecraft/world/WorldServer.java -@@ -94,30 +94,46 @@ - private static final List bonusChestContent = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.stick, 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.planks), 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log), 0, 1, 3, 10), new WeightedRandomChestContent(Items.stone_axe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_axe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.stone_pickaxe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.apple, 0, 2, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 2, 3, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log2), 0, 1, 3, 10)}); - private List pendingTickListEntriesThisTick = Lists.newArrayList(); - -+ /** Stores the recently processed (lighting) chunks */ -+ protected Set doneChunks = new java.util.HashSet(); -+ public List customTeleporters = new ArrayList(); -+ private static boolean initChest = false; -+ public static void fillChestHook() -+ { -+ if (!initChest) -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.BONUS_CHEST, bonusChestContent, 10, 10); -+ initChest = true; -+ } -+ - public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn) - { - super(saveHandlerIn, info, WorldProvider.getProviderForDimension(dimensionId), profilerIn, false); - this.mcServer = server; - this.theEntityTracker = new EntityTracker(this); - this.thePlayerManager = new PlayerManager(this); -+ // Guarantee the dimension ID was not reset by the provider -+ int providerDim = this.provider.dimensionId; - this.provider.registerWorld(this); -+ this.provider.dimensionId = providerDim; - this.chunkProvider = this.createChunkProvider(); -+ perWorldStorage = new MapStorage(new net.minecraftforge.common.WorldSpecificSaveHandler((WorldServer)this, saveHandlerIn)); - this.worldTeleporter = new Teleporter(this); - this.calculateInitialSkylight(); - this.calculateInitialWeather(); - this.getWorldBorder().setSize(server.getMaxWorldSize()); -+ net.minecraftforge.common.DimensionManager.setWorld(dimensionId, this); - } - - public World init() - { - this.mapStorage = new MapStorage(this.saveHandler); - String s = VillageCollection.fileNameForProvider(this.provider); -- VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, s); -+ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.loadData(VillageCollection.class, s); - - if (villagecollection == null) - { - this.villageCollectionObj = new VillageCollection(this); -- this.mapStorage.setData(s, this.villageCollectionObj); -+ this.perWorldStorage.setData(s, this.villageCollectionObj); - } - else - { -@@ -210,6 +226,10 @@ +@@ -214,6 +214,10 @@ this.villageSiege.tick(); this.theProfiler.endStartSection("portalForcer"); this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime()); @@ -60,7 +11,7 @@ this.theProfiler.endSection(); this.sendQueuedBlockEvents(); } -@@ -217,12 +237,14 @@ +@@ -221,12 +225,14 @@ public BiomeGenBase.SpawnListEntry getSpawnListEntryForTypeAt(EnumCreatureType creatureType, BlockPos pos) { List list = this.getChunkProvider().getPossibleCreatures(creatureType, pos); @@ -75,7 +26,7 @@ return list != null && !list.isEmpty() ? list.contains(spawnListEntry) : false; } -@@ -268,10 +290,7 @@ +@@ -272,10 +278,7 @@ private void resetRainAndThunder() { @@ -87,16 +38,7 @@ } public boolean areAllPlayersAsleep() -@@ -349,7 +368,7 @@ - chunk.func_150804_b(false); - this.theProfiler.endStartSection("thunder"); - -- if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) -+ if (this.provider.canDoLightning(chunk) && this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) - { - this.updateLCG = this.updateLCG * 3 + 1013904223; - int i1 = this.updateLCG >> 2; -@@ -363,7 +382,7 @@ +@@ -409,7 +412,7 @@ this.theProfiler.endStartSection("iceandsnow"); @@ -104,8 +46,8 @@ + if (this.provider.canDoRainSnowIce(chunk) && this.rand.nextInt(16) == 0) { this.updateLCG = this.updateLCG * 3 + 1013904223; - int k2 = this.updateLCG >> 2; -@@ -456,6 +475,9 @@ + int j2 = this.updateLCG >> 2; +@@ -527,6 +530,9 @@ if (blockIn.requiresUpdates()) { i = 8; @@ -113,18 +55,18 @@ + boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.position.getX() >> 4, nextticklistentry.position.getZ() >> 4)); + i = isForced ? 0 : 8; - if (this.isAreaLoaded(nextticklistentry.position.add(-i, -i, -i), nextticklistentry.position.add(i, i, i))) + if (this.isAreaLoaded(pos.add(-i, -i, -i), pos.add(i, i, i))) { -@@ -508,7 +530,7 @@ +@@ -588,7 +594,7 @@ public void updateEntities() { - if (this.playerEntities.isEmpty()) + if (this.playerEntities.isEmpty() && getPersistentChunks().isEmpty()) { - if (this.updateEntityTick++ >= 1200) + if (this.updateEntityTick++ >= 300) { -@@ -573,6 +595,9 @@ +@@ -712,6 +718,9 @@ { NextTickListEntry nextticklistentry1 = (NextTickListEntry)iterator.next(); iterator.remove(); @@ -134,7 +76,7 @@ int k = 0; if (this.isAreaLoaded(nextticklistentry1.position.add(-k, -k, -k), nextticklistentry1.position.add(k, k, k))) -@@ -696,22 +721,40 @@ +@@ -838,22 +847,40 @@ { List list = Lists.newArrayList(); @@ -182,40 +124,23 @@ return !this.mcServer.isBlockProtected(this, pos, player) && this.getWorldBorder().contains(pos); } -@@ -777,6 +820,7 @@ +@@ -919,6 +946,7 @@ } else { + if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(this, p_73052_1_)) return; this.findingSpawnPoint = true; - WorldChunkManager worldchunkmanager = this.provider.getWorldChunkManager(); - List list = worldchunkmanager.getBiomesToSpawnIn(); -@@ -822,7 +866,7 @@ - - protected void createBonusChest() - { -- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10); -+ WorldGeneratorBonusChest worldgeneratorbonuschest = net.minecraftforge.common.ForgeHooks.getBonusChest(rand); - - for (int i = 0; i < 10; ++i) - { -@@ -859,6 +903,7 @@ - } - - this.chunkProvider.saveChunks(p_73044_1_, progressCallback); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Save(this)); - - for (Chunk chunk : Lists.newArrayList(this.theChunkProviderServer.func_152380_a())) - { -@@ -892,6 +937,7 @@ + BiomeProvider biomeprovider = this.provider.getWorldChunkManager(); + List list = biomeprovider.getBiomesToSpawnIn(); +@@ -1047,6 +1075,7 @@ this.worldInfo.setBorderLerpTime(this.getWorldBorder().getTimeUntilTarget()); - this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); + this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.func_184103_al().getHostPlayerData()); this.mapStorage.saveAllData(); + this.perWorldStorage.saveAllData(); } - public void onEntityAdded(Entity entityIn) -@@ -947,6 +993,7 @@ + public boolean spawnEntityInWorld(Entity entityIn) +@@ -1161,6 +1190,7 @@ public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) { Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking); @@ -223,35 +148,7 @@ explosion.doExplosionA(); explosion.doExplosionB(false); -@@ -1026,19 +1073,23 @@ - this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.getDimensionId()); - } - -+ /* The function in use here has been replaced in order to only send the weather info to players in the correct dimension, -+ * rather than to all players on the server. This is what causes the client-side rain, as the -+ * client believes that it has started raining locally, rather than in another dimension. -+ */ - if (flag != this.isRaining()) - { - if (flag) - { -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(2, 0.0F)); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(2, 0.0F), this.provider.dimensionId); - } - else - { -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(1, 0.0F)); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(1, 0.0F), this.provider.dimensionId); - } - -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(7, this.rainingStrength)); -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(8, this.thunderingStrength)); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId); - } - } - -@@ -1104,6 +1155,11 @@ +@@ -1329,6 +1359,11 @@ return this.mcServer.isCallingFromMinecraftThread(); } diff --git a/patches.mcp/minecraft/net/minecraft/world/WorldServerMulti.java.patch b/patches.mcp/minecraft/net/minecraft/world/WorldServerMulti.java.patch index 92ad1ae538..e99624d765 100644 --- a/patches.mcp/minecraft/net/minecraft/world/WorldServerMulti.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/WorldServerMulti.java.patch @@ -30,9 +30,9 @@ } public World init() -@@ -58,12 +61,12 @@ - this.mapStorage = this.delegate.getMapStorage(); +@@ -59,12 +62,12 @@ this.worldScoreboard = this.delegate.getScoreboard(); + this.field_184151_B = this.delegate.func_184146_ak(); String s = VillageCollection.fileNameForProvider(this.provider); - VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, s); + VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.loadData(VillageCollection.class, s); @@ -45,11 +45,10 @@ } else { -@@ -73,4 +76,12 @@ - +@@ -75,6 +78,14 @@ return this; } -+ + + + @Override + public void flush() @@ -57,4 +56,7 @@ + super.flush(); + this.delegate.getWorldBorder().removeListener(this.borderListener); // Unlink ourselves, to prevent world leak. + } - } ++ + public void func_184166_c() + { + this.provider.func_186057_q(); diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch deleted file mode 100644 index 87ff307bcc..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/biome/BiomeColorHelper.java -+++ ../src-work/minecraft/net/minecraft/world/biome/BiomeColorHelper.java -@@ -26,7 +26,7 @@ - { - public int getColorAtPos(BiomeGenBase p_180283_1_, BlockPos blockPosition) - { -- return p_180283_1_.waterColorMultiplier; -+ return p_180283_1_.getWaterColorMultiplier(); - } - }; - diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch index 9d510ede63..95281792f3 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -1,81 +1,70 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeDecorator.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeDecorator.java -@@ -105,8 +105,10 @@ - - protected void genDecorations(BiomeGenBase biomeGenBaseIn) - { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(currentWorld, randomGenerator, field_180294_c)); - this.generateOres(); - -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND)) - for (int i = 0; i < this.sandPerChunk2; ++i) - { - int j = this.randomGenerator.nextInt(16) + 8; -@@ -114,6 +116,7 @@ - this.sandGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(j, 0, k))); +@@ -100,6 +100,7 @@ + this.sandGen.generate(p_150513_2_, p_150513_3_, p_150513_2_.getTopSolidOrLiquidBlock(this.field_180294_c.add(j, 0, k))); } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY)) for (int i1 = 0; i1 < this.clayPerChunk; ++i1) { - int l1 = this.randomGenerator.nextInt(16) + 8; -@@ -121,6 +124,7 @@ - this.clayGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(l1, 0, i6))); + int l1 = p_150513_3_.nextInt(16) + 8; +@@ -107,6 +108,7 @@ + this.clayGen.generate(p_150513_2_, p_150513_3_, p_150513_2_.getTopSolidOrLiquidBlock(this.field_180294_c.add(l1, 0, i6))); } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2)) for (int j1 = 0; j1 < this.sandPerChunk; ++j1) { - int i2 = this.randomGenerator.nextInt(16) + 8; -@@ -135,6 +139,7 @@ + int i2 = p_150513_3_.nextInt(16) + 8; +@@ -121,6 +123,7 @@ ++k1; } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)) for (int j2 = 0; j2 < k1; ++j2) { - int k6 = this.randomGenerator.nextInt(16) + 8; -@@ -149,6 +154,7 @@ + int k6 = p_150513_3_.nextInt(16) + 8; +@@ -135,6 +138,7 @@ } } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) for (int k2 = 0; k2 < this.bigMushroomsPerChunk; ++k2) { - int l6 = this.randomGenerator.nextInt(16) + 8; -@@ -156,6 +162,7 @@ - this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getHeight(this.field_180294_c.add(l6, 0, k10))); + int l6 = p_150513_3_.nextInt(16) + 8; +@@ -142,6 +146,7 @@ + this.bigMushroomGen.generate(p_150513_2_, p_150513_3_, p_150513_2_.getHeight(this.field_180294_c.add(l6, 0, k10))); } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) for (int l2 = 0; l2 < this.flowersPerChunk; ++l2) { - int i7 = this.randomGenerator.nextInt(16) + 8; -@@ -177,6 +184,7 @@ + int i7 = p_150513_3_.nextInt(16) + 8; +@@ -163,6 +168,7 @@ } } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) for (int i3 = 0; i3 < this.grassPerChunk; ++i3) { - int j7 = this.randomGenerator.nextInt(16) + 8; -@@ -190,6 +198,7 @@ + int j7 = p_150513_3_.nextInt(16) + 8; +@@ -176,6 +182,7 @@ } } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)) for (int j3 = 0; j3 < this.deadBushPerChunk; ++j3) { - int k7 = this.randomGenerator.nextInt(16) + 8; -@@ -203,6 +212,7 @@ + int k7 = p_150513_3_.nextInt(16) + 8; +@@ -189,6 +196,7 @@ } } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD)) for (int k3 = 0; k3 < this.waterlilyPerChunk; ++k3) { - int l7 = this.randomGenerator.nextInt(16) + 8; -@@ -229,6 +239,8 @@ + int l7 = p_150513_3_.nextInt(16) + 8; +@@ -215,6 +223,8 @@ } } @@ -83,9 +72,9 @@ + { for (int l3 = 0; l3 < this.mushroomsPerChunk; ++l3) { - if (this.randomGenerator.nextInt(4) == 0) -@@ -279,7 +291,9 @@ - this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j4, l15, l8)); + if (p_150513_3_.nextInt(4) == 0) +@@ -265,7 +275,9 @@ + this.mushroomRedGen.generate(p_150513_2_, p_150513_3_, this.field_180294_c.add(j4, l15, l8)); } } - @@ -94,76 +83,36 @@ + { for (int k4 = 0; k4 < this.reedsPerChunk; ++k4) { - int i9 = this.randomGenerator.nextInt(16) + 8; -@@ -305,7 +319,8 @@ - this.reedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j9, i19, i13)); - } - } -- -+ } // End of Reed generation -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) - if (this.randomGenerator.nextInt(32) == 0) - { - int i5 = this.randomGenerator.nextInt(16) + 8; -@@ -319,6 +334,7 @@ + int i9 = p_150513_3_.nextInt(16) + 8; +@@ -305,6 +317,7 @@ } } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS)) for (int j5 = 0; j5 < this.cactiPerChunk; ++j5) { - int l9 = this.randomGenerator.nextInt(16) + 8; -@@ -334,6 +350,7 @@ + int l9 = p_150513_3_.nextInt(16) + 8; +@@ -320,6 +333,7 @@ if (this.generateLakes) { + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) for (int k5 = 0; k5 < 50; ++k5) { - int i10 = this.randomGenerator.nextInt(16) + 8; -@@ -348,6 +365,7 @@ + int i10 = p_150513_3_.nextInt(16) + 8; +@@ -334,6 +348,7 @@ } } + if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) for (int l5 = 0; l5 < 20; ++l5) { - int j10 = this.randomGenerator.nextInt(16) + 8; -@@ -357,6 +375,7 @@ - (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, blockpos3); + int j10 = p_150513_3_.nextInt(16) + 8; +@@ -343,6 +358,7 @@ + (new WorldGenLiquids(Blocks.flowing_lava)).generate(p_150513_2_, p_150513_3_, blockpos3); } } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(currentWorld, randomGenerator, field_180294_c)); } - protected void genStandardOre1(int blockCount, WorldGenerator generator, int minHeight, int maxHeight) -@@ -397,16 +416,29 @@ - - protected void generateOres() - { -+ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(currentWorld, randomGenerator, field_180294_c)); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT)) - this.genStandardOre1(this.chunkProviderSettings.dirtCount, this.dirtGen, this.chunkProviderSettings.dirtMinHeight, this.chunkProviderSettings.dirtMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL)) - this.genStandardOre1(this.chunkProviderSettings.gravelCount, this.gravelGen, this.chunkProviderSettings.gravelMinHeight, this.chunkProviderSettings.gravelMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, dioriteGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIORITE)) - this.genStandardOre1(this.chunkProviderSettings.dioriteCount, this.dioriteGen, this.chunkProviderSettings.dioriteMinHeight, this.chunkProviderSettings.dioriteMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, graniteGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRANITE)) - this.genStandardOre1(this.chunkProviderSettings.graniteCount, this.graniteGen, this.chunkProviderSettings.graniteMinHeight, this.chunkProviderSettings.graniteMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, andesiteGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.ANDESITE)) - this.genStandardOre1(this.chunkProviderSettings.andesiteCount, this.andesiteGen, this.chunkProviderSettings.andesiteMinHeight, this.chunkProviderSettings.andesiteMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL)) - this.genStandardOre1(this.chunkProviderSettings.coalCount, this.coalGen, this.chunkProviderSettings.coalMinHeight, this.chunkProviderSettings.coalMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON)) - this.genStandardOre1(this.chunkProviderSettings.ironCount, this.ironGen, this.chunkProviderSettings.ironMinHeight, this.chunkProviderSettings.ironMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) - this.genStandardOre1(this.chunkProviderSettings.goldCount, this.goldGen, this.chunkProviderSettings.goldMinHeight, this.chunkProviderSettings.goldMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE)) - this.genStandardOre1(this.chunkProviderSettings.redstoneCount, this.redstoneGen, this.chunkProviderSettings.redstoneMinHeight, this.chunkProviderSettings.redstoneMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND)) - this.genStandardOre1(this.chunkProviderSettings.diamondCount, this.diamondGen, this.chunkProviderSettings.diamondMinHeight, this.chunkProviderSettings.diamondMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS)) - this.genStandardOre2(this.chunkProviderSettings.lapisCount, this.lapisGen, this.chunkProviderSettings.lapisCenterHeight, this.chunkProviderSettings.lapisSpread); -+ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(currentWorld, randomGenerator, field_180294_c)); - } - } + protected void generateOres(World p_76797_1_, Random p_76797_2_) diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index e06baf0cab..59181c502c 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -1,25 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenBase.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenBase.java -@@ -138,6 +138,10 @@ - - public BiomeGenBase(int id) - { -+ this(id, true); -+ } -+ public BiomeGenBase(int id, boolean register) -+ { - this.minHeight = height_Default.rootHeight; - this.maxHeight = height_Default.variation; - this.temperature = 0.5F; -@@ -152,6 +156,7 @@ - this.worldGeneratorBigTree = new WorldGenBigTree(false); - this.worldGeneratorSwamp = new WorldGenSwamp(); - this.biomeID = id; -+ if (register) - biomeList[id] = this; - this.theBiomeDecorator = this.createBiomeDecorator(); - this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); -@@ -168,11 +173,12 @@ +@@ -128,11 +128,12 @@ this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); @@ -32,8 +13,8 @@ + return getModdedBiomeDecorator(new BiomeDecorator()); } - public BiomeGenBase setTemperatureRainfall(float temperatureIn, float rainfallIn) -@@ -342,7 +348,7 @@ + public boolean func_185363_b() +@@ -228,7 +229,7 @@ { double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F); double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); @@ -41,8 +22,8 @@ + return getModdedBiomeGrassColor(ColorizerGrass.getGrassColor(d0, d1)); } - @SideOnly(Side.CLIENT) -@@ -350,7 +356,7 @@ + public final void generateBiomeTerrain(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180628_4_, int p_180628_5_, double p_180628_6_) +@@ -321,7 +322,7 @@ { double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F); double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); @@ -50,89 +31,4 @@ + return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1)); } - public boolean isSnowyBiome() -@@ -497,6 +503,84 @@ - } - } - -+ /* ========================================= FORGE START ======================================*/ -+ protected List flowers = new java.util.ArrayList(); -+ -+ public BiomeDecorator getModdedBiomeDecorator(BiomeDecorator original) -+ { -+ return new net.minecraftforge.event.terraingen.DeferredBiomeDecorator(original); -+ } -+ -+ public int getWaterColorMultiplier() -+ { -+ net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor(this, waterColorMultiplier); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.newColor; -+ } -+ -+ public int getModdedBiomeGrassColor(int original) -+ { -+ net.minecraftforge.event.terraingen.BiomeEvent.GetGrassColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetGrassColor(this, original); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.newColor; -+ } -+ -+ public int getModdedBiomeFoliageColor(int original) -+ { -+ net.minecraftforge.event.terraingen.BiomeEvent.GetFoliageColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetFoliageColor(this, original); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ return event.newColor; -+ } -+ -+ /** -+ * Weighted random holder class used to hold possible flowers -+ * that can spawn in this biome when bonemeal is used on grass. -+ */ -+ public static class FlowerEntry extends WeightedRandom.Item -+ { -+ public final net.minecraft.block.state.IBlockState state; -+ public FlowerEntry(net.minecraft.block.state.IBlockState state, int weight) -+ { -+ super(weight); -+ this.state = state; -+ } -+ } -+ -+ /** -+ * Adds the default flowers, as of 1.7, it is 2 yellow, and 1 red. I chose 10 to allow some wiggle room in the numbers. -+ */ -+ public void addDefaultFlowers() -+ { -+ addFlower(Blocks.yellow_flower.getDefaultState().withProperty(Blocks.yellow_flower.getTypeProperty(), BlockFlower.EnumFlowerType.DANDELION), 20); -+ addFlower(Blocks.red_flower.getDefaultState().withProperty(Blocks.red_flower.getTypeProperty(), BlockFlower.EnumFlowerType.POPPY), 20); -+ } -+ -+ /** Register a new plant to be planted when bonemeal is used on grass. -+ * @param state The block to place. -+ * @param weight The weight of the plant, where red flowers are -+ * 10 and yellow flowers are 20. -+ */ -+ public void addFlower(IBlockState state, int weight) -+ { -+ this.flowers.add(new FlowerEntry(state, weight)); -+ } -+ -+ public void plantFlower(World world, Random rand, BlockPos pos) -+ { -+ FlowerEntry flower = (FlowerEntry)WeightedRandom.getRandomItem(rand, flowers); -+ if (flower == null || flower.state == null || -+ (flower.state.getBlock() instanceof net.minecraft.block.BlockBush && -+ !((net.minecraft.block.BlockBush)flower.state.getBlock()).canBlockStay(world, pos, flower.state))) -+ { -+ return; -+ } -+ -+ world.setBlockState(pos, flower.state, 3); -+ } -+ -+ -+ /* ========================================= FORGE END ======================================*/ -+ - static - { - plains.createMutation(); + public Class getBiomeClass() diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch index 4ec3410dc6..5b14837f4e 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch @@ -1,10 +1,9 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenForest.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenForest.java -@@ -201,4 +201,20 @@ - }; +@@ -147,6 +147,22 @@ } } -+ + + @Override + public void addDefaultFlowers() + { @@ -20,4 +19,7 @@ + addFlower(net.minecraft.init.Blocks.red_flower.getDefaultState().withProperty(net.minecraft.init.Blocks.red_flower.getTypeProperty(), type), 10); + } + } - } ++ + public Class getBiomeClass() + { + return BiomeGenForest.class; diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch index 0f57bd0731..c349e0c2e9 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenHills.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenHills.java -@@ -40,28 +40,20 @@ +@@ -37,28 +37,20 @@ public void decorate(World worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); @@ -36,9 +36,9 @@ } public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_) -@@ -97,4 +89,23 @@ - { - return (new BiomeGenHills(p_180277_1_, false)).mutateHills(this); +@@ -86,4 +78,23 @@ + EXTRA_TREES, + MUTATED; } + + private static class EmeraldGenerator extends WorldGenerator diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch index db3f9dfa0b..af1488b9c4 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenPlains.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenPlains.java -@@ -103,4 +103,19 @@ - biomegenplains.field_150609_ah = 14273354; - return biomegenplains; +@@ -92,4 +92,19 @@ + + super.decorate(worldIn, rand, pos); } + + @Override diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch index 298d372c22..c4cea2dc19 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java -@@ -84,4 +84,10 @@ +@@ -86,4 +86,10 @@ { return 6975545; } diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch deleted file mode 100644 index 34cb9dd866..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/biome/WorldChunkManager.java -+++ ../src-work/minecraft/net/minecraft/world/biome/WorldChunkManager.java -@@ -16,6 +16,7 @@ - - public class WorldChunkManager - { -+ public static List allowedBiomes = Lists.newArrayList(BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.taigaHills, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills); - private GenLayer genBiomes; - private GenLayer biomeIndexLayer; - private BiomeCache biomeCache; -@@ -27,13 +28,7 @@ - this.biomeCache = new BiomeCache(this); - this.field_180301_f = ""; - this.biomesToSpawnIn = Lists.newArrayList(); -- this.biomesToSpawnIn.add(BiomeGenBase.forest); -- this.biomesToSpawnIn.add(BiomeGenBase.plains); -- this.biomesToSpawnIn.add(BiomeGenBase.taiga); -- this.biomesToSpawnIn.add(BiomeGenBase.taigaHills); -- this.biomesToSpawnIn.add(BiomeGenBase.forestHills); -- this.biomesToSpawnIn.add(BiomeGenBase.jungle); -- this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); -+ this.biomesToSpawnIn.addAll(allowedBiomes); - } - - public WorldChunkManager(long seed, WorldType p_i45744_3_, String p_i45744_4_) -@@ -41,6 +36,7 @@ - this(); - this.field_180301_f = p_i45744_4_; - GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, p_i45744_3_, p_i45744_4_); -+ agenlayer = getModdedBiomeGenerators(p_i45744_3_, seed, agenlayer); - this.genBiomes = agenlayer[0]; - this.biomeIndexLayer = agenlayer[1]; - } -@@ -249,4 +245,11 @@ - { - this.biomeCache.cleanupCache(); - } -+ -+ public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) -+ { -+ net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens event = new net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens(worldType, seed, original); -+ net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); -+ return event.newBiomeGens; -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches.mcp/minecraft/net/minecraft/world/chunk/Chunk.java.patch index b3437136c0..c9ec58283a 100644 --- a/patches.mcp/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -1,30 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/Chunk.java +++ ../src-work/minecraft/net/minecraft/world/chunk/Chunk.java -@@ -167,7 +167,7 @@ - { - Block block = this.getBlock0(j, l - 1, k); - -- if (block.getLightOpacity() != 0) -+ if (getBlockLightOpacity(j, l - 1, k) != 0) - { - this.heightMap[k << 4 | j] = l; - -@@ -440,12 +440,12 @@ - - public int getBlockLightOpacity(BlockPos pos) - { -- return this.getBlock(pos).getLightOpacity(); -+ return this.getBlock(pos).getLightOpacity(worldObj, pos); - } - - private int getBlockLightOpacity(int x, int y, int z) - { -- return this.getBlock0(x, y, z).getLightOpacity(); -+ return getBlockLightOpacity(new BlockPos((xPosition << 4) + x, y, (zPosition << 4) + z)); - } - - private Block getBlock0(int x, int y, int z) -@@ -607,6 +607,7 @@ +@@ -534,6 +534,7 @@ { Block block = state.getBlock(); Block block1 = iblockstate.getBlock(); @@ -32,7 +8,7 @@ ExtendedBlockStorage extendedblockstorage = this.storageArrays[j >> 4]; boolean flag = false; -@@ -623,14 +624,19 @@ +@@ -550,14 +551,19 @@ extendedblockstorage.set(i, j & 15, k, state); @@ -54,17 +30,7 @@ this.worldObj.removeTileEntity(pos); } } -@@ -647,8 +653,7 @@ - } - else - { -- int j1 = block.getLightOpacity(); -- int k1 = block1.getLightOpacity(); -+ int j1 = block.getLightOpacity(this.worldObj, pos); - - if (j1 > 0) - { -@@ -668,28 +673,18 @@ +@@ -595,28 +601,18 @@ } } @@ -95,7 +61,7 @@ this.worldObj.setTileEntity(pos, tileentity1); } -@@ -792,6 +787,7 @@ +@@ -719,6 +715,7 @@ k = this.entityLists.length - 1; } @@ -103,29 +69,7 @@ entityIn.addedToChunk = true; entityIn.chunkCoordX = this.xPosition; entityIn.chunkCoordY = k; -@@ -830,13 +826,20 @@ - private TileEntity createNewTileEntity(BlockPos pos) - { - Block block = this.getBlock(pos); -- return !block.hasTileEntity() ? null : ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, this.getBlockMetadata(pos)); -+ IBlockState state = block.getStateFromMeta(this.getBlockMetadata(pos)); -+ return !block.hasTileEntity(state) ? null : block.createTileEntity(this.worldObj, state); - } - - public TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType p_177424_2_) - { - TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(pos); - -+ if (tileentity != null && tileentity.isInvalid()) -+ { -+ chunkTileEntityMap.remove(pos); -+ tileentity = null; -+ } -+ - if (tileentity == null) - { - if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE) -@@ -846,14 +849,9 @@ +@@ -774,14 +771,9 @@ } else if (p_177424_2_ == Chunk.EnumCreateEntityType.QUEUED) { @@ -141,16 +85,7 @@ return tileentity; } -@@ -873,7 +871,7 @@ - tileEntityIn.setWorldObj(this.worldObj); - tileEntityIn.setPos(pos); - -- if (this.getBlock(pos) instanceof ITileEntityProvider) -+ if (this.getBlock(pos).hasTileEntity(getBlock(pos).getStateFromMeta(this.getBlockMetadata(pos)))) - { - if (this.chunkTileEntityMap.containsKey(pos)) - { -@@ -882,6 +880,7 @@ +@@ -810,6 +802,7 @@ tileEntityIn.validate(); this.chunkTileEntityMap.put(pos, tileEntityIn); @@ -158,7 +93,7 @@ } } -@@ -910,8 +909,9 @@ +@@ -838,8 +831,9 @@ entity.onChunkLoad(); } @@ -169,7 +104,7 @@ } public void onChunkUnload() -@@ -927,6 +927,7 @@ +@@ -855,6 +849,7 @@ { this.worldObj.unloadEntities(this.entityLists[i]); } @@ -177,7 +112,7 @@ } public void setChunkModified() -@@ -936,8 +937,8 @@ +@@ -864,8 +859,8 @@ public void getEntitiesWithinAABBForEntity(Entity entityIn, AxisAlignedBB aabb, List listToFill, Predicate p_177414_4_) { @@ -188,7 +123,7 @@ i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); -@@ -976,8 +977,8 @@ +@@ -904,8 +899,8 @@ public void getEntitiesOfTypeWithinAAAB(Class entityClass, AxisAlignedBB aabb, List listToFill, Predicate p_177430_4_) { @@ -199,33 +134,7 @@ i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); -@@ -1137,8 +1138,10 @@ - while (!this.tileEntityPosQueue.isEmpty()) - { - BlockPos blockpos = (BlockPos)this.tileEntityPosQueue.poll(); -+ Block block = this.getBlock(blockpos); -+ IBlockState state = block.getStateFromMeta(this.getBlockMetadata(blockpos)); - -- if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.getBlock(blockpos).hasTileEntity()) -+ if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && block.hasTileEntity(state)) - { - TileEntity tileentity = this.createNewTileEntity(blockpos); - this.worldObj.setTileEntity(blockpos, tileentity); -@@ -1200,6 +1203,13 @@ - @SideOnly(Side.CLIENT) - public void fillChunk(byte[] p_177439_1_, int p_177439_2_, boolean p_177439_3_) - { -+ for(TileEntity tileEntity : chunkTileEntityMap.values()) -+ { -+ tileEntity.updateContainingBlockInfo(); -+ tileEntity.getBlockMetadata(); -+ tileEntity.getBlockType(); -+ } -+ - int i = 0; - boolean flag = !this.worldObj.provider.getHasNoSky(); - -@@ -1267,10 +1277,16 @@ +@@ -1162,10 +1157,16 @@ this.isTerrainPopulated = true; this.generateHeightMap(); @@ -241,8 +150,8 @@ + for (TileEntity te : invalidList) te.invalidate(); } - public BiomeGenBase getBiome(BlockPos pos, WorldChunkManager chunkManager) -@@ -1583,4 +1599,20 @@ + public BiomeGenBase getBiome(BlockPos pos, BiomeProvider chunkManager) +@@ -1481,4 +1482,20 @@ QUEUED, CHECK; } diff --git a/patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch index 2be4b4a6a9..0b1799fd46 100644 --- a/patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java -@@ -42,8 +42,41 @@ - this.chunkSaveLocation = chunkSaveLocationIn; +@@ -46,8 +46,41 @@ + this.field_186055_e = p_i46673_2_; } + public boolean chunkExists(World world, int x, int z) @@ -42,8 +42,8 @@ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); NBTTagCompound nbttagcompound = (NBTTagCompound)this.chunksToRemove.get(chunkcoordintpair); -@@ -59,11 +92,17 @@ - nbttagcompound = CompressedStreamTools.read(datainputstream); +@@ -63,11 +96,17 @@ + nbttagcompound = this.field_186055_e.func_188257_a(FixTypes.CHUNK, CompressedStreamTools.read(datainputstream)); } - return this.checkedReadChunkFromNBT(worldIn, x, z, nbttagcompound); @@ -61,7 +61,7 @@ if (!p_75822_4_.hasKey("Level", 10)) { logger.error("Chunk file at " + x + "," + z + " is missing level data, skipping"); -@@ -87,10 +126,29 @@ +@@ -91,10 +130,29 @@ logger.error("Chunk file at " + x + "," + z + " is in the wrong location; relocating. (Expected " + x + ", " + z + ", got " + chunk.xPosition + ", " + chunk.zPosition + ")"); nbttagcompound.setInteger("xPos", x); nbttagcompound.setInteger("zPos", z); @@ -92,54 +92,15 @@ } } } -@@ -105,6 +163,7 @@ - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); +@@ -110,6 +168,7 @@ nbttagcompound.setTag("Level", nbttagcompound1); + nbttagcompound.setInteger("DataVersion", 169); this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(chunkIn, nbttagcompound)); this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound); } catch (Exception exception) -@@ -281,11 +340,20 @@ - { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - -+ try -+ { - if (entity.writeToNBTOptional(nbttagcompound1)) - { - chunkIn.setHasEntities(true); - nbttaglist1.appendTag(nbttagcompound1); - } -+ } -+ catch (Exception e) -+ { -+ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, e, -+ "An Entity type %s has thrown an exception trying to write state. It will not persist. Report this to the mod author", -+ entity.getClass().getName()); -+ } - } - } - -@@ -295,8 +363,17 @@ - for (TileEntity tileentity : chunkIn.getTileEntityMap().values()) - { - NBTTagCompound nbttagcompound2 = new NBTTagCompound(); -+ try -+ { - tileentity.writeToNBT(nbttagcompound2); - nbttaglist2.appendTag(nbttagcompound2); -+ } -+ catch (Exception e) -+ { -+ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, e, -+ "A TileEntity type %s has throw an exception trying to write state. It will not persist. Report this to the mod author", -+ tileentity.getClass().getName()); -+ } - } - - p_75820_3_.setTag("TileEntities", nbttaglist2); -@@ -376,6 +453,12 @@ +@@ -347,6 +406,12 @@ chunk.setBiomeArray(p_75823_2_.getByteArray("Biomes")); } @@ -152,11 +113,12 @@ NBTTagList nbttaglist1 = p_75823_2_.getTagList("Entities", 10); if (nbttaglist1 != null) -@@ -447,7 +530,5 @@ +@@ -399,8 +464,6 @@ } } } - - return chunk; } - } + + public static Entity func_186050_a(NBTTagCompound p_186050_0_, World p_186050_1_, Chunk p_186050_2_) diff --git a/patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch b/patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch deleted file mode 100644 index 8252f45490..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -+++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -@@ -20,18 +20,12 @@ - { - File file1 = this.getWorldDirectory(); - -- if (provider instanceof WorldProviderHell) -+ if (provider.getSaveFolder() != null) - { -- File file3 = new File(file1, "DIM-1"); -+ File file3 = new File(file1, provider.getSaveFolder()); - file3.mkdirs(); - return new AnvilChunkLoader(file3); - } -- else if (provider instanceof WorldProviderEnd) -- { -- File file2 = new File(file1, "DIM1"); -- file2.mkdirs(); -- return new AnvilChunkLoader(file2); -- } - else - { - return new AnvilChunkLoader(file1); diff --git a/patches.mcp/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch b/patches.mcp/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch index 01c861ed3d..bb5d0c2111 100644 --- a/patches.mcp/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/storage/RegionFile.java +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/RegionFile.java -@@ -101,6 +101,39 @@ +@@ -94,6 +94,39 @@ } } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch index 45b2a8d71a..9f87f08fa4 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -1,33 +1,8 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java -@@ -32,6 +32,9 @@ - double[] noiseData3; - double[] noiseData4; - double[] noiseData5; -+ // temporary variables used during event handling -+ private int chunkX = 0; -+ private int chunkZ = 0; +@@ -123,6 +123,9 @@ - public ChunkProviderEnd(World worldIn, long p_i2007_2_) - { -@@ -42,6 +45,14 @@ - this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); - this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); - this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); -+ -+ NoiseGenerator[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5}; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(worldIn, this.endRNG, noiseGens); -+ this.noiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; -+ this.noiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; -+ this.noiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; -+ this.noiseGen4 = (NoiseGeneratorOctaves)noiseGens[3]; -+ this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; - } - - public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer p_180520_3_) -@@ -114,6 +125,9 @@ - - public void func_180519_a(ChunkPrimer p_180519_1_) + public void func_185962_a(ChunkPrimer p_185962_1_) { + net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, chunkX, chunkZ, p_180519_1_, this.endWorld); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); @@ -35,33 +10,3 @@ for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) -@@ -165,6 +179,7 @@ - - public Chunk provideChunk(int x, int z) - { -+ chunkX = x; chunkZ = z; - this.endRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L); - ChunkPrimer chunkprimer = new ChunkPrimer(); - this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16); -@@ -184,6 +199,10 @@ - - private double[] initializeNoiseField(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) - { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField(this, p_73187_1_, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; -+ - if (p_73187_1_ == null) - { - p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; -@@ -273,8 +292,10 @@ - public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) - { - BlockFalling.fallInstantly = true; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false)); - BlockPos blockpos = new BlockPos(p_73153_2_ * 16, 0, p_73153_3_ * 16); - this.endWorld.getBiomeGenForCoords(blockpos.add(16, 0, 16)).decorate(this.endWorld, this.endWorld.rand, blockpos); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false)); - BlockFalling.fallInstantly = false; - } - diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch deleted file mode 100644 index e1cdf2321c..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java -+++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java -@@ -58,6 +58,15 @@ - - public ChunkProviderGenerate(World worldIn, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) - { -+ { -+ caveGenerator = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(caveGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); -+ strongholdGenerator = (MapGenStronghold)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(strongholdGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD); -+ villageGenerator = (MapGenVillage)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(villageGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); -+ mineshaftGenerator = (MapGenMineshaft)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(mineshaftGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); -+ scatteredFeatureGenerator = (MapGenScatteredFeature)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(scatteredFeatureGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); -+ ravineGenerator = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(ravineGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); -+ oceanMonumentGenerator = (StructureOceanMonument)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(oceanMonumentGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.OCEAN_MONUMENT); -+ } - this.worldObj = worldIn; - this.mapFeaturesEnabled = p_i45636_4_; - this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); -@@ -87,6 +96,16 @@ - this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; - worldIn.setSeaLevel(this.settings.seaLevel); - } -+ -+ NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, noiseGen5, noiseGen6, mobSpawnerNoise}; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(worldIn, this.rand, noiseGens); -+ this.field_147431_j = (NoiseGeneratorOctaves)noiseGens[0]; -+ this.field_147432_k = (NoiseGeneratorOctaves)noiseGens[1]; -+ this.field_147429_l = (NoiseGeneratorOctaves)noiseGens[2]; -+ this.field_147430_m = (NoiseGeneratorPerlin)noiseGens[3]; -+ this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; -+ this.noiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; -+ this.mobSpawnerNoise = (NoiseGeneratorOctaves)noiseGens[6]; - } - - public void setBlocksInChunk(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) -@@ -160,6 +179,10 @@ - - public void replaceBlocksForBiome(int p_180517_1_, int p_180517_2_, ChunkPrimer p_180517_3_, BiomeGenBase[] p_180517_4_) - { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180517_1_, p_180517_2_, p_180517_3_, this.worldObj); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; -+ - double d0 = 0.03125D; - this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_180517_1_ * 16), (double)(p_180517_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); - -@@ -366,6 +389,8 @@ - boolean flag = false; - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_); - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); -+ - if (this.settings.useMineShafts && this.mapFeaturesEnabled) - { - this.mineshaftGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); -@@ -391,7 +416,8 @@ - this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); - } - -- if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.settings.useWaterLakes && !flag && this.rand.nextInt(this.settings.waterLakeChance) == 0) -+ if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.settings.useWaterLakes && !flag && this.rand.nextInt(this.settings.waterLakeChance) == 0 -+ && net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) - { - int i1 = this.rand.nextInt(16) + 8; - int j1 = this.rand.nextInt(256); -@@ -399,7 +425,8 @@ - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, blockpos.add(i1, j1, k1)); - } - -- if (!flag && this.rand.nextInt(this.settings.lavaLakeChance / 10) == 0 && this.settings.useLavaLakes) -+ if (!flag && this.rand.nextInt(this.settings.lavaLakeChance / 10) == 0 && this.settings.useLavaLakes && -+ net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA)) - { - int i2 = this.rand.nextInt(16) + 8; - int l2 = this.rand.nextInt(this.rand.nextInt(248) + 8); -@@ -413,7 +440,8 @@ - - if (this.settings.useDungeons) - { -- for (int j2 = 0; j2 < this.settings.dungeonChance; ++j2) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON); -+ for (int j2 = 0; doGen && j2 < this.settings.dungeonChance; ++j2) - { - int i3 = this.rand.nextInt(16) + 8; - int l3 = this.rand.nextInt(256); -@@ -423,10 +451,14 @@ - } - - biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(i, 0, j)); -+ if (net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS)) -+ { - SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, i + 8, j + 8, 16, 16, this.rand); -+ } - blockpos = blockpos.add(8, 0, 8); - -- for (int k2 = 0; k2 < 16; ++k2) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE); -+ for (int k2 = 0; doGen && k2 < 16; ++k2) - { - for (int j3 = 0; j3 < 16; ++j3) - { -@@ -445,6 +477,8 @@ - } - } - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); -+ - BlockFalling.fallInstantly = false; - } - diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch deleted file mode 100644 index 1e86f817c1..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch +++ /dev/null @@ -1,141 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderHell.java -+++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderHell.java -@@ -49,8 +49,8 @@ - private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.flowing_lava, false); - private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.brown_mushroom); - private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.red_mushroom); -- private final MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); -- private final MapGenBase netherCaveGenerator = new MapGenCavesHell(); -+ private final MapGenNetherBridge genNetherBridge; -+ private final MapGenBase netherCaveGenerator; - double[] noiseData1; - double[] noiseData2; - double[] noiseData3; -@@ -59,16 +59,29 @@ - - public ChunkProviderHell(World worldIn, boolean p_i45637_2_, long p_i45637_3_) - { -+ this.genNetherBridge = (MapGenNetherBridge) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenNetherBridge(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_BRIDGE); -+ this.netherCaveGenerator = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenCavesHell(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_CAVE); - this.worldObj = worldIn; - this.field_177466_i = p_i45637_2_; - this.hellRNG = new Random(p_i45637_3_); -- this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); -- this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); -- this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); -- this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -- this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -- this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); -- this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ NoiseGeneratorOctaves netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ NoiseGeneratorOctaves netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ NoiseGeneratorOctaves netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); -+ NoiseGeneratorOctaves slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -+ NoiseGeneratorOctaves netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -+ NoiseGeneratorOctaves netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); -+ NoiseGeneratorOctaves netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ NoiseGenerator[] noiseGens = new NoiseGenerator[] { -+ netherNoiseGen1, netherNoiseGen2, netherNoiseGen3, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, netherNoiseGen6, netherNoiseGen7 -+ }; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(worldIn, this.hellRNG, noiseGens); -+ this.netherNoiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; -+ this.netherNoiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; -+ this.netherNoiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; -+ this.slowsandGravelNoiseGen = (NoiseGeneratorOctaves)noiseGens[3]; -+ this.netherrackExculsivityNoiseGen = (NoiseGeneratorOctaves)noiseGens[4]; -+ this.netherNoiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; -+ this.netherNoiseGen7 = (NoiseGeneratorOctaves)noiseGens[6]; - worldIn.setSeaLevel(63); - } - -@@ -148,6 +161,10 @@ - - public void func_180516_b(int p_180516_1_, int p_180516_2_, ChunkPrimer p_180516_3_) - { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180516_1_, p_180516_2_, p_180516_3_, this.worldObj); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; -+ - int i = this.worldObj.getSeaLevel() + 1; - double d0 = 0.03125D; - this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); -@@ -265,6 +282,10 @@ - - private double[] initializeNoiseField(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) - { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField(this, p_73164_1_, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; -+ - if (p_73164_1_ == null) - { - p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; -@@ -356,50 +377,60 @@ - public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) - { - BlockFalling.fallInstantly = true; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false)); - BlockPos blockpos = new BlockPos(p_73153_2_ * 16, 0, p_73153_3_ * 16); - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_); - this.genNetherBridge.generateStructure(this.worldObj, this.hellRNG, chunkcoordintpair); - -- for (int i = 0; i < 8; ++i) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA); -+ for (int i = 0; doGen && i < 8; ++i) - { - this.field_177472_y.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); - } - -- for (int j = 0; j < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; ++j) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.FIRE); -+ for (int j = 0; doGen && j < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; ++j) - { - this.field_177470_t.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); - } - -- for (int k = 0; k < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++k) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.GLOWSTONE); -+ for (int k = 0; doGen && k < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++k) - { - this.field_177469_u.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); - } - -- for (int l = 0; l < 10; ++l) -+ for (int l = 0; doGen && l < 10; ++l) - { - this.field_177468_v.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); - } - -- if (this.hellRNG.nextBoolean()) -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(worldObj, hellRNG, blockpos)); -+ -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.decorate(worldObj, hellRNG, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM); -+ if (doGen && this.hellRNG.nextBoolean()) - { - this.field_177471_z.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); - } - -- if (this.hellRNG.nextBoolean()) -+ if (doGen && this.hellRNG.nextBoolean()) - { - this.field_177465_A.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); - } - -- for (int i1 = 0; i1 < 16; ++i1) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.generateOre(worldObj, hellRNG, field_177467_w, blockpos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.QUARTZ); -+ for (int i1 = 0; doGen && i1 < 16; ++i1) - { - this.field_177467_w.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); - } - -- for (int j1 = 0; j1 < 16; ++j1) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA2); -+ for (int j1 = 0; doGen && j1 < 16; ++j1) - { - this.field_177473_x.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); - } - -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false)); - BlockFalling.fallInstantly = false; - } - diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index fa818727df..3899f6d81e 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -1,104 +1,22 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java -@@ -36,6 +36,7 @@ - public LongHashMap id2ChunkMap = new LongHashMap(); - public List loadedChunks = Lists.newArrayList(); - public WorldServer worldObj; +@@ -33,6 +33,7 @@ + public final LongHashMap id2ChunkMap = new LongHashMap(); + public final List loadedChunks = Lists.newArrayList(); + public final WorldServer worldObj; + private Set loadingChunks = com.google.common.collect.Sets.newHashSet(); - public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_) + public ChunkProviderServer(WorldServer p_i46838_1_, IChunkLoader p_i46838_2_, IChunkGenerator p_i46838_3_) { -@@ -57,7 +58,7 @@ - - public void dropChunk(int x, int z) - { -- if (this.worldObj.provider.canRespawnHere()) -+ if (this.worldObj.provider.canRespawnHere() && net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.worldObj.provider.getDimensionId())) - { - if (!this.worldObj.isSpawnChunk(x, z)) - { -@@ -80,12 +81,64 @@ - - public Chunk loadChunk(int p_73158_1_, int p_73158_2_) - { -+ return loadChunk(p_73158_1_, p_73158_2_, null); -+ } -+ -+ public Chunk loadChunk(int par1, int par2, Runnable runnable) -+ { -+ long k = ChunkCoordIntPair.chunkXZ2Int(par1, par2); -+ this.droppedChunksSet.remove(Long.valueOf(k)); -+ Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(k); -+ net.minecraft.world.chunk.storage.AnvilChunkLoader loader = null; -+ -+ if (this.chunkLoader instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader) -+ { -+ loader = (net.minecraft.world.chunk.storage.AnvilChunkLoader) this.chunkLoader; -+ } -+ -+ // We can only use the queue for already generated chunks -+ if (chunk == null && loader != null && loader.chunkExists(this.worldObj, par1, par2)) -+ { -+ if (runnable != null) -+ { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.worldObj, loader, this, par1, par2, runnable); -+ return null; -+ } -+ else -+ { -+ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.worldObj, loader, this, par1, par2); -+ } -+ } -+ else if (chunk == null) -+ { -+ chunk = this.originalLoadChunk(par1, par2); -+ } -+ -+ // If we didn't load the chunk async and have a callback run it now -+ if (runnable != null) -+ { -+ runnable.run(); -+ } -+ -+ return chunk; -+ } -+ -+ public Chunk originalLoadChunk(int p_73158_1_, int p_73158_2_) -+ { - long i = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_); - this.droppedChunksSet.remove(Long.valueOf(i)); - Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(i); - - if (chunk == null) - { -+ boolean added = loadingChunks.add(i); -+ if (!added) -+ { -+ net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk (%d,%d) in di >mension %d that is already being loaded. This will cause weird chunk breakages.", p_73158_1_, p_73158_2_, worldObj.provider.getDimensionId()); -+ } -+ chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(i, this.worldObj); -+ -+ if (chunk == null) - chunk = this.loadChunkFromFile(p_73158_1_, p_73158_2_); - - if (chunk == null) -@@ -114,6 +167,7 @@ +@@ -118,6 +119,7 @@ this.id2ChunkMap.add(i, chunk); this.loadedChunks.add(chunk); + loadingChunks.remove(i); chunk.onChunkLoad(); - chunk.populateChunk(this, this, p_73158_1_, p_73158_2_); + chunk.func_186030_a(this, this.field_186029_c); } -@@ -205,6 +259,7 @@ - if (this.serverChunkGenerator != null) - { - this.serverChunkGenerator.populate(p_73153_1_, p_73153_2_, p_73153_3_); -+ net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(p_73153_2_, p_73153_3_, worldObj, serverChunkGenerator, p_73153_1_); - chunk.setChunkModified(); - } - } -@@ -266,6 +321,11 @@ +@@ -214,6 +216,11 @@ { if (!this.worldObj.disableLevelSaving) { @@ -110,7 +28,7 @@ for (int i = 0; i < 100; ++i) { if (!this.droppedChunksSet.isEmpty()) -@@ -280,6 +340,12 @@ +@@ -228,6 +235,12 @@ this.saveChunkExtraData(chunk); this.id2ChunkMap.remove(olong.longValue()); this.loadedChunks.remove(chunk); diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch index 61a4e86c32..432cee4847 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/MapGenCaves.java +++ ../src-work/minecraft/net/minecraft/world/gen/MapGenCaves.java -@@ -138,7 +138,7 @@ +@@ -143,7 +143,7 @@ { IBlockState iblockstate = p_180702_5_.getBlockState(j1, l1, k1); @@ -9,43 +9,7 @@ { flag3 = true; } -@@ -176,33 +176,12 @@ - IBlockState iblockstate1 = p_180702_5_.getBlockState(j3, j2, i2); - IBlockState iblockstate2 = (IBlockState)Objects.firstNonNull(p_180702_5_.getBlockState(j3, j2 + 1, i2), Blocks.air.getDefaultState()); - -- if (iblockstate1.getBlock() == Blocks.grass || iblockstate1.getBlock() == Blocks.mycelium) -+ if (isTopBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_)) - { - flag1 = true; - } - -- if (this.func_175793_a(iblockstate1, iblockstate2)) -- { -- if (j2 - 1 < 10) -- { -- p_180702_5_.setBlockState(j3, j2, i2, Blocks.lava.getDefaultState()); -- } -- else -- { -- p_180702_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); -- -- if (iblockstate2.getBlock() == Blocks.sand) -- { -- p_180702_5_.setBlockState(j3, j2 + 1, i2, iblockstate2.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.red_sandstone.getDefaultState() : Blocks.sandstone.getDefaultState()); -- } -- -- if (flag1 && p_180702_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) -- { -- blockpos$mutableblockpos.set(j3 + p_180702_3_ * 16, 0, i2 + p_180702_4_ * 16); -- p_180702_5_.setBlockState(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock.getBlock().getDefaultState()); -- } -- } -- } -+ digBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_, flag1, iblockstate1, iblockstate2); - } - } - } -@@ -261,4 +240,71 @@ +@@ -266,4 +266,71 @@ } } } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch index c8b15c2be3..030975e7fe 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/MapGenRavine.java +++ ../src-work/minecraft/net/minecraft/world/gen/MapGenRavine.java -@@ -128,7 +128,7 @@ +@@ -130,7 +130,7 @@ { IBlockState iblockstate = p_180707_5_.getBlockState(j1, l1, k1); @@ -9,38 +9,7 @@ { flag2 = true; } -@@ -165,28 +165,12 @@ - { - IBlockState iblockstate1 = p_180707_5_.getBlockState(j3, j2, i2); - -- if (iblockstate1.getBlock() == Blocks.grass) -+ if (isTopBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_)) - { - flag = true; - } - -- if (iblockstate1.getBlock() == Blocks.stone || iblockstate1.getBlock() == Blocks.dirt || iblockstate1.getBlock() == Blocks.grass) -- { -- if (j2 - 1 < 10) -- { -- p_180707_5_.setBlockState(j3, j2, i2, Blocks.flowing_lava.getDefaultState()); -- } -- else -- { -- p_180707_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); -- -- if (flag && p_180707_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) -- { -- blockpos$mutableblockpos.set(j3 + p_180707_3_ * 16, 0, i2 + p_180707_4_ * 16); -- p_180707_5_.setBlockState(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock); -- } -- } -- } -+ digBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_, flag); - } - } - } -@@ -221,4 +205,68 @@ +@@ -223,4 +223,68 @@ } } } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch deleted file mode 100644 index 692f00c09b..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java -@@ -54,7 +54,7 @@ - { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock(); - -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!block.isAir(worldIn, blockpos$mutableblockpos) && !block.isLeaves(worldIn, blockpos$mutableblockpos)) - { - flag = false; - } -@@ -190,7 +190,7 @@ - { - BlockPos blockpos = new BlockPos(l1, l2, i2); - -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, blockhugemushroom$enumtype)); - } -@@ -201,9 +201,10 @@ - - for (int i3 = 0; i3 < i; ++i3) - { -- Block block2 = worldIn.getBlockState(position.up(i3)).getBlock(); -+ BlockPos upN = position.up(i3); -+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(upN); - -- if (!block2.isFullBlock()) -+ if (state.getBlock().canBeReplacedByLeaves(worldIn, upN)) - { - this.setBlockAndNotifyAdequately(worldIn, position.up(i3), this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM)); - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch index 02e90923a2..00b08fad2a 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -1,17 +1,5 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java -@@ -99,9 +99,9 @@ - if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_181631_2_ * p_181631_2_)) - { - BlockPos blockpos = p_181631_1_.add(j, 0, k); -- Material material = this.world.getBlockState(blockpos).getBlock().getMaterial(); -+ net.minecraft.block.state.IBlockState state = this.world.getBlockState(blockpos); - -- if (material == Material.air || material == Material.leaves) -+ if (state.getBlock().isAir(this.world, blockpos) || state.getBlock().isLeaves(this.world, blockpos)) - { - this.setBlockAndNotifyAdequately(this.world, blockpos, p_181631_3_); - } @@ -254,7 +254,7 @@ { BlockPos blockpos1 = posOne.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch index 34b0130e80..6d4ac28c88 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch @@ -28,18 +28,6 @@ EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(rand); int i1 = i - rand.nextInt(4); int j1 = 2 - rand.nextInt(3); -@@ -67,9 +68,9 @@ - - int k2 = k + j2; - BlockPos blockpos1 = new BlockPos(k1, k2, l1); -- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); -+ state = worldIn.getBlockState(blockpos1); - -- if (material == Material.air || material == Material.leaves) -+ if (state.getBlock().isAir(worldIn, blockpos1) || state.getBlock().isLeaves(worldIn, blockpos1)) - { - this.func_181639_b(worldIn, blockpos1); - this.func_181639_b(worldIn, blockpos1.east()); @@ -187,7 +188,7 @@ { for (int k1 = -i1; k1 <= i1; ++k1) @@ -49,23 +37,3 @@ { return false; } -@@ -209,11 +210,17 @@ - private void func_150526_a(World worldIn, int p_150526_2_, int p_150526_3_, int p_150526_4_) - { - BlockPos blockpos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_); -- Block block = worldIn.getBlockState(blockpos).getBlock(); -+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos); - -- if (block.getMaterial() == Material.air) -+ if (state.getBlock().isAir(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181641_b); - } - } -+ -+ //Just a helper macro -+ private void onPlantGrow(World world, BlockPos pos, BlockPos source) -+ { -+ world.getBlockState(pos).getBlock().onPlantGrow(world, pos, source); -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch deleted file mode 100644 index a31133713a..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java -@@ -13,10 +13,12 @@ - { - Block block; - -- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) -+ do - { -+ block = worldIn.getBlockState(position).getBlock(); -+ if (!block.isLeaves(worldIn, position) && !block.isLeaves(worldIn, position)) break; - position = position.down(); -- } -+ } while (position.getY() > 0); - - for (int i = 0; i < 4; ++i) - { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch index 90ee807b75..32a26829cf 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -1,20 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java -@@ -123,12 +123,11 @@ - if (j3 == 1) - { - worldIn.setBlockState(blockpos2, Blocks.chest.correctFacing(worldIn, blockpos2, Blocks.chest.getDefaultState()), 2); -- List list = WeightedRandomChestContent.func_177629_a(CHESTCONTENT, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(rand)}); - TileEntity tileentity1 = worldIn.getTileEntity(blockpos2); - - if (tileentity1 instanceof TileEntityChest) - { -- WeightedRandomChestContent.generateChestContents(rand, list, (TileEntityChest)tileentity1, 8); -+ WeightedRandomChestContent.generateChestContents(rand, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, rand), (TileEntityChest)tileentity1, 8); - } - - break; -@@ -159,6 +158,12 @@ +@@ -154,6 +154,12 @@ private String pickMobSpawner(Random p_76543_1_) { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch deleted file mode 100644 index 5c7ad93a54..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java -@@ -58,7 +58,7 @@ - { - if (j >= 0 && j < 256) - { -- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock())) -+ if (!this.isReplaceable(worldIn, blockpos$mutableblockpos.set(l, j, i1))) - { - flag = false; - } -@@ -77,11 +77,13 @@ - } - else - { -- Block block1 = worldIn.getBlockState(position.down()).getBlock(); -+ BlockPos down = position.down(); -+ Block block1 = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); - -- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) -+ if (isSoil && position.getY() < 256 - i - 1) - { -- this.func_175921_a(worldIn, position.down()); -+ block1.onPlantGrow(worldIn, down, position); - - for (int i2 = position.getY() - 3 + i; i2 <= position.getY() + i; ++i2) - { -@@ -101,7 +103,7 @@ - BlockPos blockpos = new BlockPos(i3, i2, k1); - Block block = worldIn.getBlockState(blockpos).getBlock(); - -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181630_b); - } -@@ -112,9 +114,9 @@ - - for (int j2 = 0; j2 < i; ++j2) - { -- Block block2 = worldIn.getBlockState(position.up(j2)).getBlock(); -- -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) -+ BlockPos upN = position.up(j2); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN)) - { - this.setBlockAndNotifyAdequately(worldIn, position.up(j2), field_181629_a); - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch index dd3577bbdc..fde943faa8 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -29,30 +29,6 @@ return true; } else -@@ -113,9 +114,9 @@ - if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i) - { - BlockPos blockpos = p_175925_2_.add(j, 0, k); -- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); -+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos); - -- if (material == Material.air || material == Material.leaves) -+ if (state.getBlock().isAir(worldIn, blockpos) || state.getBlock().isLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); - } -@@ -135,9 +136,9 @@ - if (j * j + k * k <= i) - { - BlockPos blockpos = p_175928_2_.add(j, 0, k); -- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); -+ Block block = worldIn.getBlockState(blockpos).getBlock(); - -- if (material == Material.air || material == Material.leaves) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); - } @@ -145,4 +146,10 @@ } } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch deleted file mode 100644 index 91e7fe7bb0..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java -@@ -43,30 +43,24 @@ - { - Block block = worldIn.getBlockState(position.up(j)).getBlock(); - -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,position.up(j))) - { - this.setBlockAndNotifyAdequately(worldIn, position.up(j), this.woodMetadata); - } - - if (j < i - 1) - { -- block = worldIn.getBlockState(position.add(1, j, 0)).getBlock(); -- -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,position.add(1, j, 0))) - { - this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 0), this.woodMetadata); - } - -- block = worldIn.getBlockState(position.add(1, j, 1)).getBlock(); -- -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,position.add(1, j, 1))) - { - this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 1), this.woodMetadata); - } - -- block = worldIn.getBlockState(position.add(0, j, 1)).getBlock(); -- -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,position.add(0, j, 1))) - { - this.setBlockAndNotifyAdequately(worldIn, position.add(0, j, 1), this.woodMetadata); - } -@@ -132,16 +126,23 @@ - BlockPos blockpos = p_175934_2_.up(i); - Block block = worldIn.getBlockState(blockpos).getBlock(); - -- if (block == Blocks.grass || block == Blocks.dirt) -+ if (block.canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling))) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181635_g); - break; - } - -- if (block.getMaterial() != Material.air && i < 0) -+ if (!block.isAir(worldIn, blockpos) && i < 0) - { - break; - } - } - } -+ -+ //Helper macro -+ private boolean isAirLeaves(World world, BlockPos pos) -+ { -+ net.minecraft.block.Block block = world.getBlockState(pos).getBlock(); -+ return block.isAir(world, pos) || block.isLeaves(world, pos); -+ } - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch index 6309e7413f..474cdd7db7 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch @@ -26,39 +26,3 @@ EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(rand); int k2 = i - rand.nextInt(4) - 1; int l2 = 3 - rand.nextInt(3); -@@ -95,9 +97,9 @@ - } - - BlockPos blockpos = new BlockPos(i3, i2, j1); -- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); -+ block = worldIn.getBlockState(blockpos).getBlock(); - -- if (material == Material.air || material == Material.leaves) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) - { - this.func_181642_b(worldIn, blockpos); - k1 = i2; -@@ -149,9 +151,9 @@ - i3 += enumfacing1.getFrontOffsetX(); - j1 += enumfacing1.getFrontOffsetZ(); - BlockPos blockpos1 = new BlockPos(i3, j2, j1); -- Material material1 = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); -+ block = worldIn.getBlockState(blockpos1).getBlock(); - -- if (material1 == Material.air || material1 == Material.leaves) -+ if (block.isAir(worldIn, blockpos2) || block.isLeaves(worldIn, blockpos2)) - { - this.func_181642_b(worldIn, blockpos1); - k1 = j2; -@@ -209,9 +211,9 @@ - - private void func_175924_b(World worldIn, BlockPos p_175924_2_) - { -- Material material = worldIn.getBlockState(p_175924_2_).getBlock().getMaterial(); -+ Block block = worldIn.getBlockState(p_175924_2_).getBlock(); - -- if (material == Material.air || material == Material.leaves) -+ if (block.isAir(worldIn, p_175924_2_) || block.isLeaves(worldIn, p_175924_2_)) - { - this.setBlockAndNotifyAdequately(worldIn, p_175924_2_, field_181644_b); - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch deleted file mode 100644 index c2f9fa4309..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java -@@ -24,14 +24,16 @@ - { - Block block; - -- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) -+ do - { -+ block = worldIn.getBlockState(position).getBlock(); -+ if (!block.isAir(worldIn, position) && !block.isLeaves(worldIn, position)) break; - position = position.down(); -- } -+ } while (position.getY() > 0); - - Block block1 = worldIn.getBlockState(position).getBlock(); - -- if (block1 == Blocks.dirt || block1 == Blocks.grass) -+ if (block1.canSustainPlant(worldIn, position, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling))) - { - position = position.up(); - this.setBlockAndNotifyAdequately(worldIn, position, this.woodMetadata); -@@ -53,7 +55,7 @@ - { - BlockPos blockpos = new BlockPos(l, i, j1); - -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch index 83021d5b60..6f44c997b1 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java -@@ -60,7 +60,7 @@ - { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock(); - -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!block.isAir(worldIn, blockpos$mutableblockpos.set(l, j, i1)) && !block.isLeaves(worldIn, blockpos$mutableblockpos.set(l, j, i1))) - { - if (block != Blocks.water && block != Blocks.flowing_water) - { -@@ -86,11 +86,13 @@ +@@ -87,11 +87,13 @@ } else { @@ -24,71 +15,5 @@ - this.func_175921_a(worldIn, position.down()); + block1.onPlantGrow(worldIn, position.down(),position); - for (int l1 = position.getY() - 3 + i; l1 <= position.getY() + i; ++l1) + for (int k1 = position.getY() - 3 + i; k1 <= position.getY() + i; ++k1) { -@@ -109,7 +111,7 @@ - { - BlockPos blockpos = new BlockPos(k3, l1, j1); - -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181649_b); - } -@@ -120,9 +122,10 @@ - - for (int i2 = 0; i2 < i; ++i2) - { -- Block block2 = worldIn.getBlockState(position.up(i2)).getBlock(); -+ BlockPos upN = position.up(i2); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); - -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water) -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2 == Blocks.flowing_water || block2 == Blocks.water) - { - this.setBlockAndNotifyAdequately(worldIn, position.up(i2), field_181648_a); - } -@@ -140,29 +143,29 @@ - { - blockpos$mutableblockpos1.set(i4, j2, j4); - -- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) -+ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn, blockpos$mutableblockpos1)) - { - BlockPos blockpos3 = blockpos$mutableblockpos1.west(); - BlockPos blockpos4 = blockpos$mutableblockpos1.east(); - BlockPos blockpos1 = blockpos$mutableblockpos1.north(); - BlockPos blockpos2 = blockpos$mutableblockpos1.south(); - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3)) - { - this.func_181647_a(worldIn, blockpos3, BlockVine.EAST); - } - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4)) - { - this.func_181647_a(worldIn, blockpos4, BlockVine.WEST); - } - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1)) - { - this.func_181647_a(worldIn, blockpos1, BlockVine.SOUTH); - } - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2)) - { - this.func_181647_a(worldIn, blockpos2, BlockVine.NORTH); - } -@@ -191,7 +194,7 @@ - this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate); - int i = 4; - -- for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().getMaterial() == Material.air && i > 0; --i) -+ for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().isAir(p_181647_1_,p_181647_2_) && i > 0; --i) - { - this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate); - p_181647_2_ = p_181647_2_.down(); diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch index ae9752c7f3..e6b3a7d26a 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -26,25 +26,3 @@ int k2 = 0; for (int l2 = position.getY() + i; l2 >= position.getY() + j; --l2) -@@ -93,7 +95,7 @@ - { - BlockPos blockpos = new BlockPos(j3, l2, i2); - -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181637_b); - } -@@ -113,9 +115,10 @@ - - for (int i3 = 0; i3 < i - 1; ++i3) - { -- Block block1 = worldIn.getBlockState(position.up(i3)).getBlock(); -+ BlockPos upN = position.up(i3); -+ Block block1 = worldIn.getBlockState(upN).getBlock(); - -- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) -+ if (block1.isAir(worldIn, upN) || block1.isLeaves(worldIn, upN)) - { - this.setBlockAndNotifyAdequately(worldIn, position.up(i3), field_181636_a); - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch deleted file mode 100644 index f30f960d23..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java -@@ -55,7 +55,7 @@ - { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(k1, i1, l1)).getBlock(); - -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!block.isAir(worldIn, blockpos$mutableblockpos) && !block.isLeaves(worldIn, blockpos$mutableblockpos)) - { - flag = false; - } -@@ -74,11 +74,13 @@ - } - else - { -- Block block1 = worldIn.getBlockState(position.down()).getBlock(); -+ BlockPos down = position.down(); -+ Block block1 = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); - -- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) -+ if (isSoil && position.getY() < 256 - i - 1) - { -- this.func_175921_a(worldIn, position.down()); -+ block1.onPlantGrow(worldIn, down, position); - int i3 = rand.nextInt(2); - int j3 = 1; - int k3 = 0; -@@ -99,7 +101,7 @@ - { - BlockPos blockpos = new BlockPos(i2, j4, k2); - -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181646_b); - } -@@ -128,9 +130,10 @@ - - for (int k4 = 0; k4 < i - i4; ++k4) - { -- Block block2 = worldIn.getBlockState(position.up(k4)).getBlock(); -+ BlockPos upN = position.up(k4); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); - -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN)) - { - this.setBlockAndNotifyAdequately(worldIn, position.up(k4), field_181645_a); - } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch deleted file mode 100644 index 92401d444d..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java -@@ -22,10 +22,12 @@ - { - Block block; - -- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) -+ do - { -+ block = worldIn.getBlockState(position).getBlock(); -+ if (!block.isAir(worldIn, position) && !block.isLeaves(worldIn, position)) break; - position = position.down(); -- } -+ } while (position.getY() > 0); - - for (int i = 0; i < 128; ++i) - { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch index b8493e86d1..bddc8b598a 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -9,86 +9,3 @@ { flag = false; } -@@ -87,11 +87,13 @@ - } - else - { -- Block block1 = worldIn.getBlockState(position.down()).getBlock(); -+ BlockPos down = position.down(); -+ Block block1 = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); - -- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) -+ if (isSoil && position.getY() < 256 - i - 1) - { -- this.func_175921_a(worldIn, position.down()); -+ block1.onPlantGrow(worldIn, down, position); - int k2 = 3; - int l2 = 0; - -@@ -113,7 +115,7 @@ - BlockPos blockpos = new BlockPos(k1, i3, i2); - Block block = worldIn.getBlockState(blockpos).getBlock(); - -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos) || block.getMaterial() == Material.vine) - { - this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves); - } -@@ -124,9 +126,10 @@ - - for (int j3 = 0; j3 < i; ++j3) - { -- Block block2 = worldIn.getBlockState(position.up(j3)).getBlock(); -+ BlockPos upN = position.up(j3); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); - -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2.getMaterial() == Material.vine) -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2.getMaterial() == Material.vine) - { - this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood); - -@@ -169,29 +172,29 @@ - { - blockpos$mutableblockpos1.set(l4, k3, i5); - -- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) -+ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn,blockpos$mutableblockpos1)) - { - BlockPos blockpos2 = blockpos$mutableblockpos1.west(); - BlockPos blockpos3 = blockpos$mutableblockpos1.east(); - BlockPos blockpos4 = blockpos$mutableblockpos1.north(); - BlockPos blockpos1 = blockpos$mutableblockpos1.south(); - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2)) - { - this.func_181650_b(worldIn, blockpos2, BlockVine.EAST); - } - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3)) - { - this.func_181650_b(worldIn, blockpos3, BlockVine.WEST); - } - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4)) - { - this.func_181650_b(worldIn, blockpos4, BlockVine.SOUTH); - } - -- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) -+ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1)) - { - this.func_181650_b(worldIn, blockpos1, BlockVine.NORTH); - } -@@ -245,7 +248,7 @@ - this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); - int i = 4; - -- for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().getMaterial() == Material.air && i > 0; --i) -+ for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().isAir(p_181650_1_,p_181650_2_) && i > 0; --i) - { - this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); - p_181650_2_ = p_181650_2_.down(); diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch deleted file mode 100644 index 389e5a4de2..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java -+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java -@@ -26,10 +26,12 @@ - { - Block block; - -- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 1) -+ do - { -+ block = worldIn.getBlockState(position).getBlock(); -+ if (!block.isAir(worldIn, position) && !block.isLeaves(worldIn, position)) break; - position = position.down(); -- } -+ } while (position.getY() > 0); - - if (position.getY() < 1) - { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch index a159c3ec14..8bd908b08a 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayer.java +++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayer.java -@@ -52,12 +52,12 @@ +@@ -49,12 +49,12 @@ i = 6; } @@ -16,16 +16,7 @@ GenLayer genlayerhills = new GenLayerHills(1000L, genlayerbiomeedge, lvt_10_1_); GenLayer genlayer5 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); genlayer5 = GenLayerZoom.magnify(1000L, genlayer5, j); -@@ -191,7 +191,7 @@ - - protected static boolean isBiomeOceanic(int p_151618_0_) - { -- return p_151618_0_ == BiomeGenBase.ocean.biomeID || p_151618_0_ == BiomeGenBase.deepOcean.biomeID || p_151618_0_ == BiomeGenBase.frozenOcean.biomeID; -+ return net.minecraftforge.common.BiomeManager.oceanBiomes.contains(BiomeGenBase.getBiome(p_151618_0_)); - } - - protected int selectRandom(int... p_151619_1_) -@@ -203,4 +203,27 @@ +@@ -171,4 +171,27 @@ { return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch index 28a968bdde..91c084e9cf 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch @@ -1,85 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java +++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java -@@ -6,10 +6,9 @@ - - public class GenLayerBiome extends GenLayer - { -- private BiomeGenBase[] field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.savanna, BiomeGenBase.savanna, BiomeGenBase.plains}; -- private BiomeGenBase[] field_151621_d = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.roofedForest, BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.birchForest, BiomeGenBase.swampland}; -- private BiomeGenBase[] field_151622_e = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.taiga, BiomeGenBase.plains}; -- private BiomeGenBase[] field_151620_f = new BiomeGenBase[] {BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.coldTaiga}; -+ @SuppressWarnings("unchecked") -+ private java.util.List[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType.values().length]; -+ - private final ChunkProviderSettings field_175973_g; - - public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_) -@@ -17,9 +16,30 @@ - super(p_i45560_1_); - this.parent = p_i45560_3_; - -+ for (net.minecraftforge.common.BiomeManager.BiomeType type : net.minecraftforge.common.BiomeManager.BiomeType.values()) -+ { -+ com.google.common.collect.ImmutableList biomesToAdd = net.minecraftforge.common.BiomeManager.getBiomes(type); -+ int idx = type.ordinal(); -+ -+ if (biomes[idx] == null) biomes[idx] = new java.util.ArrayList(); -+ if (biomesToAdd != null) biomes[idx].addAll(biomesToAdd); -+ } -+ -+ int desertIdx = net.minecraftforge.common.BiomeManager.BiomeType.DESERT.ordinal(); -+ -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.desert, 30)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.savanna, 20)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.plains, 10)); -+ - if (p_i45560_4_ == WorldType.DEFAULT_1_1) - { -- this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; -+ biomes[desertIdx].clear(); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.desert, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.forest, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.extremeHills, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.swampland, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.plains, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.taiga, 10)); - this.field_175973_g = null; - } - else if (p_i45560_4_ == WorldType.CUSTOMIZED) -@@ -73,7 +93,7 @@ - } - else - { -- aint1[j + i * areaWidth] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT).biome.biomeID; - } - } - else if (k == 2) -@@ -84,7 +104,7 @@ - } - else - { -- aint1[j + i * areaWidth] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM).biome.biomeID; - } - } - else if (k == 3) -@@ -95,12 +115,12 @@ - } - else - { -- aint1[j + i * areaWidth] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL).biome.biomeID; - } - } - else if (k == 4) - { -- aint1[j + i * areaWidth] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY).biome.biomeID; - } - else - { -@@ -111,4 +131,12 @@ +@@ -112,4 +112,12 @@ return aint1; } diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch index a32b6d0c99..1bcaeb316e 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java -@@ -40,6 +40,12 @@ +@@ -57,6 +57,12 @@ { } @@ -13,16 +13,7 @@ public DesertPyramid(Random p_i2062_1_, int p_i2062_2_, int p_i2062_3_) { super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21); -@@ -258,7 +264,7 @@ - { - int l1 = enumfacing.getFrontOffsetX() * 2; - int i2 = enumfacing.getFrontOffsetZ() * 2; -- this.field_74940_h[enumfacing.getHorizontalIndex()] = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 10 + l1, -11, 10 + i2, WeightedRandomChestContent.func_177629_a(itemsToGenerateInTemple, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); -+ this.field_74940_h[enumfacing.getHorizontalIndex()] = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 10 + l1, -11, 10 + i2, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, randomIn)); - } - } - -@@ -362,6 +368,13 @@ +@@ -451,6 +457,13 @@ private static final List field_175815_j = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.arrow, 0, 2, 7, 30)}); private static ComponentScatteredFeaturePieces.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(); @@ -36,44 +27,3 @@ public JunglePyramid() { } -@@ -518,9 +531,12 @@ - this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 4, -3, 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 3, -3, 1, structureBoundingBoxIn); - -+ net.minecraftforge.common.ChestGenHooks dispenser = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_DISPENSER); -+ net.minecraftforge.common.ChestGenHooks chest = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST); -+ - if (!this.field_74945_j) - { -- this.field_74945_j = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 3, -2, 1, EnumFacing.NORTH.getIndex(), field_175815_j, 2); -+ this.field_74945_j = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 3, -2, 1, EnumFacing.NORTH.getIndex(), dispenser.getItems(randomIn), dispenser.getCount(randomIn)); - } - - this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 3, -2, 2, structureBoundingBoxIn); -@@ -537,7 +553,7 @@ - - if (!this.field_74946_k) - { -- this.field_74946_k = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 9, -2, 3, EnumFacing.WEST.getIndex(), field_175815_j, 2); -+ this.field_74946_k = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 9, -2, 3, EnumFacing.WEST.getIndex(), dispenser.getItems(randomIn), dispenser.getCount(randomIn)); - } - - this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 8, -1, 3, structureBoundingBoxIn); -@@ -545,7 +561,7 @@ - - if (!this.field_74947_h) - { -- this.field_74947_h = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 8, -3, 3, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); -+ this.field_74947_h = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 8, -3, 3, chest.getItems(randomIn), chest.getCount(randomIn)); - } - - this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 9, -3, 2, structureBoundingBoxIn); -@@ -578,7 +594,7 @@ - - if (!this.field_74948_i) - { -- this.field_74948_i = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 9, -3, 10, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); -+ this.field_74948_i = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 9, -3, 10, chest.getItems(randomIn), chest.getCount(randomIn)); - } - - return true; diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch deleted file mode 100644 index d64cd44000..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java -+++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java -@@ -28,11 +28,18 @@ - - for (BiomeGenBase biomegenbase : BiomeGenBase.getBiomeGenArray()) - { -- if (biomegenbase != null && biomegenbase.minHeight > 0.0F) -+ if (biomegenbase != null && biomegenbase.minHeight > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) - { - this.field_151546_e.add(biomegenbase); - } - } -+ for (BiomeGenBase biome : net.minecraftforge.common.BiomeManager.strongHoldBiomes) -+ { -+ if (!this.field_151546_e.contains(biome)) -+ { -+ this.field_151546_e.add(biome); -+ } -+ } - } - - public MapGenStronghold(Map p_i2068_1_) diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch index 9e0994ba85..ee60e931b9 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java -@@ -217,12 +217,12 @@ +@@ -221,12 +221,12 @@ { if (this.structureData == null) { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch index 3763ac470f..53fa790aea 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureComponent.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureComponent.java -@@ -35,6 +35,10 @@ +@@ -38,6 +38,10 @@ - public NBTTagCompound createStructureBaseNBT() + public final NBTTagCompound createStructureBaseNBT() { + if (MapGenStructureIO.getStructureComponentName(this) == null) // Friendlier error then the Null String error below. + { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch index f7d5fa0b94..34db35ce02 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java -@@ -32,6 +32,12 @@ +@@ -31,6 +31,12 @@ MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Stairs.class, "MSStairs"); } @@ -13,21 +13,3 @@ private static StructureComponent func_175892_a(List listIn, Random rand, int x, int y, int z, EnumFacing facing, int type) { int i = rand.nextInt(100); -@@ -351,14 +357,15 @@ - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 - 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 + 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); - -+ net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR); - if (randomIn.nextInt(100) == 0) - { -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 2, 0, k1 - 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 3 + randomIn.nextInt(4)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 2, 0, k1 - 1, info.getItems(randomIn), info.getCount(randomIn)); - } - - if (randomIn.nextInt(100) == 0) - { -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 0, 0, k1 + 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 3 + randomIn.nextInt(4)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 0, 0, k1 + 1, info.getItems(randomIn), info.getCount(randomIn)); - } - - if (this.hasSpiders && !this.spawnerPlaced) diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch deleted file mode 100644 index 75826c803f..0000000000 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java -+++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java -@@ -154,7 +154,7 @@ - if (this.field_111021_b && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) - { - this.field_111021_b = false; -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, field_111019_a, 2 + randomIn.nextInt(4)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn)); - } - - this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); -@@ -225,7 +225,7 @@ - if (this.field_111020_b && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(1, 3), this.getYWithOffset(2), this.getZWithOffset(1, 3)))) - { - this.field_111020_b = false; -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 1, 2, 3, field_111019_a, 2 + randomIn.nextInt(4)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 1, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn)); - } - - this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); -@@ -943,6 +943,7 @@ - abstract static class Piece extends StructureComponent - { - protected static final List field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 2, 4, 2)}); -+ static { net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, field_111019_a, 2, 5); } - - public Piece() - { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch index 04a7017a0f..1d7352db01 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStart.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStart.java -@@ -62,6 +62,10 @@ +@@ -63,6 +63,10 @@ public NBTTagCompound writeStructureComponentsToNBT(int chunkX, int chunkZ) { @@ -11,7 +11,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.setString("id", MapGenStructureIO.getStructureStartName(this)); nbttagcompound.setInteger("ChunkX", chunkX); -@@ -97,7 +101,8 @@ +@@ -98,7 +102,8 @@ for (int i = 0; i < nbttaglist.tagCount(); ++i) { diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch index 63362a9378..7ebeaa9a79 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java -@@ -240,6 +240,12 @@ +@@ -244,6 +244,12 @@ { } @@ -13,17 +13,8 @@ public ChestCorridor(int p_i45582_1_, Random p_i45582_2_, StructureBoundingBox p_i45582_3_, EnumFacing p_i45582_4_) { super(p_i45582_1_); -@@ -296,7 +302,7 @@ - if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) - { - this.hasMadeChest = true; -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, WeightedRandomChestContent.func_177629_a(strongholdChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(2)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, randomIn)); - } - - return true; -@@ -592,6 +598,12 @@ - private static final List strongholdLibraryChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.book, 0, 1, 3, 20), new WeightedRandomChestContent(Items.paper, 0, 2, 7, 20), new WeightedRandomChestContent(Items.map, 0, 1, 1, 1), new WeightedRandomChestContent(Items.compass, 0, 1, 1, 1)}); +@@ -599,6 +605,12 @@ + { private boolean isLargeRoom; + static @@ -35,24 +26,8 @@ public Library() { } -@@ -736,12 +748,13 @@ - this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1, 8, j1 + 1, structureBoundingBoxIn); - } - -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4)); -+ net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, info.getItems(randomIn), info.getCount(randomIn)); - - if (this.isLargeRoom) - { - this.setBlockState(worldIn, Blocks.air.getDefaultState(), 12, 9, 1, structureBoundingBoxIn); -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 12, 8, 1, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 12, 8, 1, info.getItems(randomIn), info.getCount(randomIn)); - } - - return true; -@@ -1013,6 +1026,12 @@ - private static final List strongholdRoomCrossingChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1)}); +@@ -1025,6 +1037,12 @@ + { protected int roomType; + static @@ -64,12 +39,3 @@ public RoomCrossing() { } -@@ -1151,7 +1170,7 @@ - this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 1, 3, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 2, 3, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 3, 3, structureBoundingBoxIn); -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 4, 8, WeightedRandomChestContent.func_177629_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 1 + randomIn.nextInt(4)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 4, 8, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, randomIn)); - } - - return true; diff --git a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch index 0491f7afe0..8dc9017c25 100644 --- a/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java -@@ -57,6 +57,7 @@ +@@ -58,6 +58,7 @@ list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.getRandomIntegerInRange(random, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.getRandomIntegerInRange(random, 0, 1 + p_75084_1_))); list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.getRandomIntegerInRange(random, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); @@ -8,7 +8,7 @@ Iterator iterator = list.iterator(); while (iterator.hasNext()) -@@ -129,6 +130,10 @@ +@@ -130,6 +131,10 @@ { structurevillagepieces$village = StructureVillagePieces.House3.func_175849_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); } @@ -19,7 +19,7 @@ return structurevillagepieces$village; } -@@ -833,6 +838,11 @@ +@@ -875,6 +880,11 @@ { } @@ -31,16 +31,7 @@ public House2(StructureVillagePieces.Start start, int p_i45563_2_, Random rand, StructureBoundingBox p_i45563_4_, EnumFacing facing) { super(start, p_i45563_2_); -@@ -911,7 +921,7 @@ - if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(5, 5), this.getYWithOffset(1), this.getZWithOffset(5, 5)))) - { - this.hasMadeChest = true; -- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 5, 1, 5, villageBlacksmithChestContents, 3 + randomIn.nextInt(6)); -+ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 5, 1, 5, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, randomIn)); - } - - for (int i = 6; i <= 8; ++i) -@@ -1403,6 +1413,7 @@ +@@ -1447,6 +1457,7 @@ public List structureVillageWeightedPieceList; public List field_74932_i = Lists.newArrayList(); public List field_74930_j = Lists.newArrayList(); @@ -48,15 +39,7 @@ public Start() { -@@ -1416,6 +1427,7 @@ - this.terrainType = p_i2104_7_; - BiomeGenBase biomegenbase = chunkManagerIn.getBiomeGenerator(new BlockPos(p_i2104_4_, 0, p_i2104_5_), BiomeGenBase.field_180279_ad); - this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; -+ this.biome = biomegenbase; - this.func_175846_a(this.inDesert); - } - -@@ -1477,6 +1489,7 @@ +@@ -1520,6 +1531,7 @@ protected int field_143015_k = -1; private int villagersSpawned; private boolean isDesertVillage; @@ -64,7 +47,7 @@ public Village() { -@@ -1489,6 +1502,7 @@ +@@ -1532,6 +1544,7 @@ if (start != null) { this.isDesertVillage = start.inDesert; @@ -72,7 +55,7 @@ } } -@@ -1613,6 +1627,9 @@ +@@ -1660,6 +1673,9 @@ protected IBlockState func_175847_a(IBlockState p_175847_1_) { diff --git a/patches.mcp/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches.mcp/minecraft/net/minecraft/world/storage/MapData.java.patch index f354ddc7b3..c6a72a010d 100644 --- a/patches.mcp/minecraft/net/minecraft/world/storage/MapData.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -1,15 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/storage/MapData.java +++ ../src-work/minecraft/net/minecraft/world/storage/MapData.java -@@ -21,7 +21,7 @@ - { - public int xCenter; - public int zCenter; -- public byte dimension; -+ public int dimension; //FML byte -> int - public byte scale; - public byte[] colors = new byte[16384]; - public List playersArrayList = Lists.newArrayList(); -@@ -44,7 +44,17 @@ +@@ -45,7 +45,17 @@ public void readFromNBT(NBTTagCompound nbt) { @@ -28,7 +19,7 @@ this.xCenter = nbt.getInteger("xCenter"); this.zCenter = nbt.getInteger("zCenter"); this.scale = nbt.getByte("scale"); -@@ -85,7 +95,7 @@ +@@ -96,7 +106,7 @@ public void writeToNBT(NBTTagCompound nbt) { @@ -37,7 +28,7 @@ nbt.setInteger("xCenter", this.xCenter); nbt.setInteger("zCenter", this.zCenter); nbt.setByte("scale", this.scale); -@@ -164,7 +174,7 @@ +@@ -176,7 +186,7 @@ rotation = rotation + (rotation < 0.0D ? -8.0D : 8.0D); b2 = (byte)((int)(rotation * 16.0D / 360.0D)); diff --git a/patches.mcp/minecraft/net/minecraft/world/storage/SaveHandler.java.patch b/patches.mcp/minecraft/net/minecraft/world/storage/SaveHandler.java.patch index c42cfe274e..9e57e2d0be 100644 --- a/patches.mcp/minecraft/net/minecraft/world/storage/SaveHandler.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/storage/SaveHandler.java.patch @@ -1,88 +1,34 @@ --- ../src-base/minecraft/net/minecraft/world/storage/SaveHandler.java +++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java -@@ -104,20 +104,29 @@ +@@ -135,6 +135,8 @@ + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("Data", nbttagcompound); + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, worldInformation, nbttagcompound1); ++ + try + { + File file1 = new File(this.worldDirectory, "level.dat_new"); +@@ -199,6 +201,8 @@ { - File file1 = new File(this.worldDirectory, "level.dat"); - -+ WorldInfo worldInfo = null; -+ - if (file1.exists()) - { - try - { - NBTTagCompound nbttagcompound2 = CompressedStreamTools.readCompressed(new FileInputStream(file1)); - NBTTagCompound nbttagcompound3 = nbttagcompound2.getCompoundTag("Data"); -- return new WorldInfo(nbttagcompound3); -+ worldInfo = new WorldInfo(nbttagcompound3); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound2); -+ return worldInfo; - } -+ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) -+ { -+ throw e; -+ } - catch (Exception exception1) - { - exception1.printStackTrace(); - } - } - -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().confirmBackupLevelDatUse(this); - file1 = new File(this.worldDirectory, "level.dat_old"); - - if (file1.exists()) -@@ -126,7 +135,13 @@ - { - NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); - NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); -- return new WorldInfo(nbttagcompound1); -+ worldInfo = new WorldInfo(nbttagcompound1); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); -+ return worldInfo; -+ } -+ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) -+ { -+ throw e; - } - catch (Exception exception) - { -@@ -143,6 +158,8 @@ - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setTag("Data", nbttagcompound); + NBTTagCompound nbttagcompound = null; + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, worldInformation, nbttagcompound1); + try { - File file1 = new File(this.worldDirectory, "level.dat_new"); -@@ -181,6 +198,8 @@ - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setTag("Data", nbttagcompound); - -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, worldInformation, nbttagcompound1); -+ - try - { - File file1 = new File(this.worldDirectory, "level.dat_new"); -@@ -229,6 +248,7 @@ - } - - file1.renameTo(file2); -+ net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(player, this.playersDirectory, player.getUniqueID().toString()); - } - catch (Exception var5) - { -@@ -259,6 +279,7 @@ - player.readFromNBT(nbttagcompound); + File file1 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat"); +@@ -218,6 +222,7 @@ + player.readFromNBT(this.field_186341_a.func_188257_a(FixTypes.PLAYER, nbttagcompound)); } + net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(player, playersDirectory, player.getUniqueID().toString()); return nbttagcompound; } -@@ -300,4 +321,22 @@ +@@ -259,4 +264,22 @@ { - return this.saveDirectoryName; + return this.field_186342_h; } + + public NBTTagCompound getPlayerNBT(net.minecraft.entity.player.EntityPlayerMP player) diff --git a/patches.mcp/minecraft/net/minecraft/world/storage/WorldInfo.java.patch b/patches.mcp/minecraft/net/minecraft/world/storage/WorldInfo.java.patch index a95b7f74e6..f0459b69cf 100644 --- a/patches.mcp/minecraft/net/minecraft/world/storage/WorldInfo.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/storage/WorldInfo.java.patch @@ -1,18 +1,17 @@ --- ../src-base/minecraft/net/minecraft/world/storage/WorldInfo.java +++ ../src-work/minecraft/net/minecraft/world/storage/WorldInfo.java -@@ -51,6 +51,7 @@ - private int borderWarningDistance = 5; +@@ -60,6 +60,7 @@ private int borderWarningTime = 15; + private final Map field_186348_N = Maps.newEnumMap(DimensionType.class); private GameRules theGameRules = new GameRules(); + private java.util.Map additionalProperties; protected WorldInfo() { -@@ -745,4 +746,24 @@ - } +@@ -785,6 +786,26 @@ }); } -+ + + /** + * Allow access to additional mod specific world based properties + * Used by FML to store mod list associated with a world, and maybe an id map @@ -32,4 +31,7 @@ + { + return this.additionalProperties!=null? this.additionalProperties.get(additionalProperty) : null; + } - } ++ + public NBTTagCompound func_186347_a(DimensionType p_186347_1_) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_186348_N.get(p_186347_1_); diff --git a/rejects/minecraft/net/minecraft/command/CommandBase.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandBase.java.patch.rej deleted file mode 100644 index d826d8eee0..0000000000 --- a/rejects/minecraft/net/minecraft/command/CommandBase.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 1 - ichatcomponent.appendText(" "); - } - -- IChatComponent ichatcomponent1 = new ChatComponentText(args[i]); -+ IChatComponent ichatcomponent1 = net.minecraftforge.common.ForgeHooks.newChatWithLinks(args[i]); // Forge: links for messages - - if (p_147176_3_) - { -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/CommandEnchant.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandEnchant.java.patch.rej deleted file mode 100644 index 9af81aea04..0000000000 --- a/rejects/minecraft/net/minecraft/command/CommandEnchant.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 1 - { - Enchantment enchantment2 = Enchantment.getEnchantmentById(l); - -- if (!enchantment2.canApplyTogether(enchantment1)) -+ if (!enchantment2.canApplyTogether(enchantment1) || !enchantment1.canApplyTogether(enchantment2)) //Forge BugFix: Let Both enchantments veto being together - { - throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment1.getTranslatedName(j), enchantment2.getTranslatedName(nbttaglist.getCompoundTagAt(k).getShort("lvl"))}); - } -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/CommandFill.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandFill.java.patch.rej deleted file mode 100644 index 3d13d0aa63..0000000000 --- a/rejects/minecraft/net/minecraft/command/CommandFill.java.patch.rej +++ /dev/null @@ -1,20 +0,0 @@ -++++ REJECTED PATCH 2 - NBTTagCompound nbttagcompound = new NBTTagCompound(); - boolean flag = false; - -- if (args.length >= 10 && block.hasTileEntity()) -+ if (args.length >= 10 && block.hasTileEntity(state)) - { - String s = getChatComponentFromNthArg(sender, args, 9).getUnformattedText(); - -++++ END PATCH -++++ REJECTED PATCH 3 - continue; - } - } -- else if (args[8].equals("replace") && !block.hasTileEntity()) -+ else if (args[8].equals("replace") && !block.hasTileEntity(state)) - { - if (args.length > 9) - { -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/CommandHandler.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandHandler.java.patch.rej deleted file mode 100644 index 92101609e9..0000000000 --- a/rejects/minecraft/net/minecraft/command/CommandHandler.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 2 - ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.exception", new Object[0]); - chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); - sender.addChatMessage(chatcomponenttranslation); -- logger.warn("Couldn\'t process command: \'" + input + "\'"); -+ logger.warn("Couldn\'t process command: \'" + input + "\'", var9); // Forge: Log stacktrace of unknown exceptions - } - - return false; -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/PlayerSelector.java.patch.rej b/rejects/minecraft/net/minecraft/command/PlayerSelector.java.patch.rej deleted file mode 100644 index 673621f250..0000000000 --- a/rejects/minecraft/net/minecraft/command/PlayerSelector.java.patch.rej +++ /dev/null @@ -1,13 +0,0 @@ -++++ REJECTED PATCH 1 - - public class PlayerSelector - { -- private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w=,!-]*)\\])?$"); -+ private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w\\.=,!-]*)\\])?$"); // FORGE: allow . in entity selectors - private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); -- private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); -+ private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w\\.-]*)(?:$|,)"); // FORGE: allow . in entity selectors - private static final Set WORLD_BINDING_ARGS = Sets.newHashSet(new String[] {"x", "y", "z", "dx", "dy", "dz", "rm", "r"}); - - public static EntityPlayerMP matchOnePlayer(ICommandSender sender, String token) -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch.rej b/rejects/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch.rej deleted file mode 100644 index d7dd3fdf88..0000000000 --- a/rejects/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch.rej +++ /dev/null @@ -1,20 +0,0 @@ -++++ REJECTED PATCH 1 - i = parseInt(args[4], 0, 15); - } - -+ IBlockState state = block.getStateFromMeta(i); -+ - World world = sender.getEntityWorld(); - - if (!world.isBlockLoaded(blockpos)) -++++ END PATCH -++++ REJECTED PATCH 2 - NBTTagCompound nbttagcompound = new NBTTagCompound(); - boolean flag = false; - -- if (args.length >= 7 && block.hasTileEntity()) -+ if (args.length >= 7 && block.hasTileEntity(state)) - { - String s = getChatComponentFromNthArg(sender, args, 6).getUnformattedText(); - -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch.rej b/rejects/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch.rej deleted file mode 100644 index 1af151dc0a..0000000000 --- a/rejects/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 1 - NBTTagCompound nbttagcompound = new NBTTagCompound(); - boolean flag = false; - -- if (args.length >= 6 && block.hasTileEntity()) -+ if (args.length >= 6 && block.hasTileEntity(block.getStateFromMeta(i))) - { - String s = getChatComponentFromNthArg(sender, args, 5).getUnformattedText(); - -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/init/Bootstrap.java.patch.rej b/rejects/minecraft/net/minecraft/init/Bootstrap.java.patch.rej deleted file mode 100644 index f5b2d3aa16..0000000000 --- a/rejects/minecraft/net/minecraft/init/Bootstrap.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 2 - double d0 = source.getX() + (double)enumfacing.getFrontOffsetX(); - double d1 = (double)((float)source.getBlockPos().getY() + 0.2F); - double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); -- Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), stack.getMetadata(), d0, d1, d2); -+ Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), ItemMonsterPlacer.getEntityName(stack), d0, d1, d2); - - if (entity instanceof EntityLivingBase && stack.hasDisplayName()) - { -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch.rej deleted file mode 100644 index 35057e9a1a..0000000000 --- a/rejects/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 4 - - for (int i1 = 0; i1 < 3; ++i1) - { -- this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, l, itemstack); -+ this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, (int)power, itemstack); - this.field_178151_h[i1] = -1; - - if (this.enchantLevels[i1] < i1 + 1) -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/inventory/ContainerRepair.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerRepair.java.patch.rej deleted file mode 100644 index 323e886d4f..0000000000 --- a/rejects/minecraft/net/minecraft/inventory/ContainerRepair.java.patch.rej +++ /dev/null @@ -1,20 +0,0 @@ -++++ REJECTED PATCH 3 - - if (itemstack2 != null) - { -+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, outputSlot, repairedItemName, i2)) return; - flag = itemstack2.getItem() == Items.enchanted_book && Items.enchanted_book.getEnchantments(itemstack2).tagCount() > 0; - - if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) -++++ END PATCH -++++ REJECTED PATCH 4 - { - int i4 = ((Integer)iterator.next()).intValue(); - -- if (i4 != i5 && !enchantment.canApplyTogether(Enchantment.getEnchantmentById(i4))) -+ Enchantment e2 = Enchantment.getEnchantmentById(i4); -+ if (i4 != i5 && !(enchantment.canApplyTogether(e2) && e2.canApplyTogether(enchantment))) //Forge BugFix: Let Both enchantments veto being together - { - flag1 = false; - ++l1; -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/NetworkSystem.java.patch.rej b/rejects/minecraft/net/minecraft/network/NetworkSystem.java.patch.rej deleted file mode 100644 index 9763848eae..0000000000 --- a/rejects/minecraft/net/minecraft/network/NetworkSystem.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 1 - ; - } - -- p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); -+ p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.READ_TIMEOUT))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); - NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); - NetworkSystem.this.networkManagers.add(networkmanager); - p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch.rej b/rejects/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch.rej deleted file mode 100644 index 6302df167d..0000000000 --- a/rejects/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch.rej +++ /dev/null @@ -1,13 +0,0 @@ -++++ REJECTED PATCH 1 - public void writePacketData(PacketBuffer buf) throws IOException - { - buf.writeString(this.channel); -+ synchronized(this.data) { //This may be access multiple times, from multiple threads, lets be safe. -+ this.data.markReaderIndex(); - buf.writeBytes((ByteBuf)this.data); -+ this.data.resetReaderIndex(); -+ } - } - - public void processPacket(INetHandlerPlayServer handler) -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch.rej b/rejects/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch.rej deleted file mode 100644 index 01dcefc10b..0000000000 --- a/rejects/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch.rej +++ /dev/null @@ -1,13 +0,0 @@ -++++ REJECTED PATCH 1 - public void writePacketData(PacketBuffer buf) throws IOException - { - buf.writeString(this.channel); -+ synchronized(this.data) { //This may be access multiple times, from multiple threads, lets be safe. -+ this.data.markReaderIndex(); - buf.writeBytes((ByteBuf)this.data); -+ this.data.resetReaderIndex(); -+ } - } - - public void processPacket(INetHandlerPlayClient handler) -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/MinecraftServer.java.patch.rej b/rejects/minecraft/net/minecraft/server/MinecraftServer.java.patch.rej deleted file mode 100644 index 7c9e8ee299..0000000000 --- a/rejects/minecraft/net/minecraft/server/MinecraftServer.java.patch.rej +++ /dev/null @@ -1,46 +0,0 @@ -++++ REJECTED PATCH 1 - @SideOnly(Side.SERVER) - private String hostname; - private int serverPort = -1; -- public WorldServer[] worldServers; -+ public WorldServer[] worldServers = new WorldServer[0]; - private ServerConfigurationManager serverConfigManager; - private boolean serverRunning = true; - private boolean serverStopped; -++++ END PATCH -++++ REJECTED PATCH 6 - - public void stopServer() - { -- if (!this.worldIsBeingDeleted) -+ if (!this.worldIsBeingDeleted && net.minecraftforge.fml.common.Loader.instance().hasReachedState(net.minecraftforge.fml.common.LoaderState.SERVER_STARTED) && !serverStopped) // make sure the save is valid and we don't save twice - { - logger.info("Stopping server"); - -++++ END PATCH -++++ REJECTED PATCH 7 - for (int i = 0; i < this.worldServers.length; ++i) - { - WorldServer worldserver = this.worldServers[i]; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.flush(); - } -+ -+ WorldServer[] tmp = worldServers; -+ for (WorldServer world : tmp) -+ { -+ net.minecraftforge.common.DimensionManager.setWorld(world.provider.getDimensionId(), null); -+ } - } - - if (this.usageSnooper.isSnooperRunning()) -++++ END PATCH -++++ REJECTED PATCH 22 - - if (worldserver != null) - { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.flush(); - } - } -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch.rej b/rejects/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch.rej deleted file mode 100644 index befc820c02..0000000000 --- a/rejects/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch.rej +++ /dev/null @@ -1,26 +0,0 @@ -++++ REJECTED PATCH 1 - if (entityplayermp == null) - { - this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -- this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.field_181025_l); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.getConfigurationManager(), this.networkManager, this.field_181025_l); - this.field_181025_l = null; - } - } - -- if (this.connectionTimer++ == 600) -+ if (this.connectionTimer++ == net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.LOGIN_TIMEOUT) - { - this.closeConnection("Took too long to log in"); - } -++++ END PATCH -++++ REJECTED PATCH 2 - } - else - { -- this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile)); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.getConfigurationManager(), this.networkManager, this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile)); - } - } - } -++++ END PATCH