From b687180e12f6b8292b406e26447c6fcfd9bd7317 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 22 Nov 2018 13:43:16 -0800 Subject: [PATCH] Add my 'patches_old' directory, so that people can see my "progress". Once the old folder is done, then patches are done. Want to know whats still to do? Look in that folder. Now stop asking. --- .gitignore | 4 - .../net/minecraft/client/Minecraft.java.patch | 606 +++++++++ .../client/model/ModelBase.java.patch | 10 + .../client/model/ModelBox.java.patch | 18 + .../client/model/ModelRenderer.java.patch | 42 + .../model/PositionTextureVertex.java.patch | 13 + .../client/model/TexturedQuad.java.patch | 18 + .../ChunkProviderClient.java.patch | 10 + .../multiplayer/GuiConnecting.java.patch | 11 + .../multiplayer/PlayerControllerMP.java.patch | 214 +++ .../client/multiplayer/WorldClient.java.patch | 24 + .../NetHandlerHandshakeMemory.java.patch | 10 + .../network/NetHandlerLoginClient.java.patch | 14 + .../network/NetHandlerPlayClient.java.patch | 101 ++ .../client/network/ServerPinger.java.patch | 19 + .../client/particle/Particle.java.patch | 40 + .../particle/ParticleManager.java.patch | 33 + .../renderer/ActiveRenderInfo.java.patch | 38 + .../renderer/BlockFluidRenderer.java.patch | 14 + .../renderer/BlockModelRenderer.java.patch | 54 + .../renderer/BlockModelShapes.java.patch | 9 + .../BlockRendererDispatcher.java.patch | 31 + .../client/renderer/BufferBuilder.java.patch | 70 + .../client/renderer/ChestRenderer.java.patch | 11 + .../client/renderer/EntityRenderer.java.patch | 296 +++++ .../InventoryEffectRenderer.java.patch | 40 + .../renderer/ItemModelMesher.java.patch | 13 + .../client/renderer/ItemRenderer.java.patch | 101 ++ .../client/renderer/OpenGlHelper.java.patch | 26 + .../client/renderer/RenderGlobal.java.patch | 158 +++ .../client/renderer/RenderItem.java.patch | 120 ++ .../WorldVertexBufferUploader.java.patch | 57 + .../renderer/block/model/BakedQuad.java.patch | 54 + .../model/BakedQuadRetextured.java.patch | 31 + .../block/model/FaceBakery.java.patch | 105 ++ .../block/model/IBakedModel.java.patch | 22 + .../model/ItemCameraTransforms.java.patch | 45 + .../block/model/ItemOverrideList.java.patch | 33 + .../block/model/ItemTransformVec3f.java.patch | 18 + .../block/model/ModelBakery.java.patch | 180 +++ .../model/ModelBlockDefinition.java.patch | 20 + .../block/model/ModelManager.java.patch | 14 + .../model/ModelResourceLocation.java.patch | 14 + .../block/model/ModelRotation.java.patch | 21 + .../block/model/SimpleBakedModel.java.patch | 11 + .../renderer/block/model/Variant.java.patch | 39 + .../block/model/WeightedBakedModel.java.patch | 11 + .../block/statemap/StateMap.java.patch | 11 + .../chunk/ChunkRenderDispatcher.java.patch | 19 + .../renderer/chunk/RenderChunk.java.patch | 80 ++ .../renderer/color/BlockColors.java.patch | 47 + .../renderer/color/ItemColors.java.patch | 49 + .../entity/RenderEntityItem.java.patch | 86 ++ .../renderer/entity/RenderFish.java.patch | 11 + .../entity/RenderItemFrame.java.patch | 43 + .../entity/RenderLivingBase.java.patch | 72 + .../renderer/entity/RenderManager.java.patch | 28 + .../renderer/entity/RenderPlayer.java.patch | 30 + .../renderer/entity/RenderVillager.java.patch | 26 + .../entity/RenderZombieVillager.java.patch | 10 + .../entity/layers/LayerArmorBase.java.patch | 107 ++ .../entity/layers/LayerBipedArmor.java.patch | 13 + .../entity/layers/LayerHeldItem.java.patch | 18 + .../renderer/texture/Stitcher.java.patch | 45 + .../texture/TextureAtlasSprite.java.patch | 59 + .../texture/TextureManager.java.patch | 30 + .../renderer/texture/TextureMap.java.patch | 246 ++++ .../renderer/texture/TextureUtil.java.patch | 39 + .../TileEntityItemStackRenderer.java.patch | 10 + .../TileEntityPistonRenderer.java.patch | 15 + .../TileEntityRendererDispatcher.java.patch | 91 ++ .../TileEntitySpecialRenderer.java.patch | 11 + .../renderer/vertex/VertexFormat.java.patch | 38 + .../vertex/VertexFormatElement.java.patch | 21 + .../FallbackResourceManager.java.patch | 10 + .../IResourceManagerReloadListener.java.patch | 14 + .../client/resources/Language.java.patch | 24 + .../client/resources/Locale.java.patch | 11 + ...SimpleReloadableResourceManager.java.patch | 44 + .../client/shader/Framebuffer.java.patch | 57 + .../client/shader/ShaderGroup.java.patch | 12 + .../client/shader/ShaderLoader.java.patch | 12 + .../client/shader/ShaderManager.java.patch | 12 + .../client/util/RecipeBookClient.java.patch | 17 + .../client/util/RecipeItemHelper.java.patch | 19 + .../minecraft/command/CommandBase.java.patch | 11 + .../minecraft/command/CommandFill.java.patch | 20 + .../command/CommandHandler.java.patch | 20 + .../command/EntitySelector.java.patch | 46 + .../command/server/CommandSetBlock.java.patch | 11 + .../enchantment/Enchantment.java.patch | 50 + .../EnchantmentFrostWalker.java.patch | 11 + .../enchantment/EnchantmentHelper.java.patch | 57 + .../enchantment/EnchantmentThorns.java.patch | 43 + .../EnumEnchantmentType.java.patch | 17 + .../minecraft/entity/EntityAgeable.java.patch | 20 + .../minecraft/entity/EntityFlying.java.patch | 24 + .../minecraft/entity/EntityHanging.java.patch | 12 + .../minecraft/entity/EntityList.java.patch | 183 +++ .../minecraft/entity/EntityLiving.java.patch | 88 ++ .../entity/EntityLivingBase.java.patch | 482 +++++++ .../EntitySpawnPlacementRegistry.java.patch | 18 + .../minecraft/entity/EntityTracker.java.patch | 37 + .../entity/EntityTrackerEntry.java.patch | 44 + .../entity/SharedMonsterAttributes.java.patch | 11 + .../entity/ai/EntityAIAttackMelee.java.patch | 55 + .../entity/ai/EntityAIBreakDoor.java.patch | 11 + .../entity/ai/EntityAIEatGrass.java.patch | 20 + .../ai/EntityAIHarvestFarmland.java.patch | 24 + .../entity/ai/EntityAIMate.java.patch | 21 + .../ai/EntityAIRunAroundLikeCrazy.java.patch | 11 + .../entity/ai/EntityAIVillagerMate.java.patch | 19 + .../entity/boss/EntityDragon.java.patch | 19 + .../entity/boss/EntityWither.java.patch | 29 + .../phase/PhaseSittingFlaming.java.patch | 11 + .../effect/EntityLightningBolt.java.patch | 12 + .../entity/item/EntityEnderPearl.java.patch | 41 + .../entity/item/EntityFallingBlock.java.patch | 19 + .../entity/item/EntityItem.java.patch | 139 ++ .../item/EntityMinecartContainer.java.patch | 63 + .../entity/monster/EntityCreeper.java.patch | 11 + .../entity/monster/EntityEnderman.java.patch | 50 + .../entity/monster/EntityEvoker.java.patch | 11 + .../entity/monster/EntityIronGolem.java.patch | 11 + .../entity/monster/EntityMagmaCube.java.patch | 10 + .../entity/monster/EntityMob.java.patch | 18 + .../entity/monster/EntityShulker.java.patch | 16 + .../monster/EntitySilverfish.java.patch | 20 + .../entity/monster/EntitySlime.java.patch | 35 + .../entity/monster/EntitySnowman.java.patch | 44 + .../entity/monster/EntityZombie.java.patch | 67 + .../monster/EntityZombieVillager.java.patch | 86 ++ .../entity/passive/AbstractHorse.java.patch | 33 + .../entity/passive/EntityHorse.java.patch | 80 ++ .../entity/passive/EntityMooshroom.java.patch | 56 + .../entity/passive/EntityOcelot.java.patch | 20 + .../entity/passive/EntityParrot.java.patch | 134 ++ .../entity/passive/EntityRabbit.java.patch | 11 + .../entity/passive/EntitySheep.java.patch | 42 + .../entity/passive/EntityVillager.java.patch | 204 +++ .../entity/passive/EntityWolf.java.patch | 11 + .../entity/passive/HorseArmorType.java.patch | 53 + .../entity/player/EntityPlayer.java.patch | 672 ++++++++++ .../entity/player/EntityPlayerMP.java.patch | 146 +++ .../entity/player/InventoryPlayer.java.patch | 35 + .../entity/projectile/EntityArrow.java.patch | 11 + .../projectile/EntityFireball.java.patch | 11 + .../projectile/EntityFishHook.java.patch | 74 ++ .../projectile/EntityLargeFireball.java.patch | 11 + .../projectile/EntityLlamaSpit.java.patch | 11 + .../projectile/EntityShulkerBullet.java.patch | 11 + .../projectile/EntitySmallFireball.java.patch | 11 + .../projectile/EntityThrowable.java.patch | 11 + .../projectile/EntityWitherSkull.java.patch | 20 + .../minecraft/inventory/Container.java.patch | 47 + .../inventory/ContainerBeacon.java.patch | 27 + .../ContainerBrewingStand.java.patch | 29 + .../inventory/ContainerEnchantment.java.patch | 98 ++ .../inventory/ContainerPlayer.java.patch | 11 + .../inventory/ContainerRepair.java.patch | 51 + .../inventory/SlotCrafting.java.patch | 20 + .../inventory/SlotFurnaceOutput.java.patch | 9 + .../net/minecraft/item/Item.java.patch | 867 +++++++++++++ .../net/minecraft/item/ItemArmor.java.patch | 72 + .../net/minecraft/item/ItemArrow.java.patch | 13 + .../net/minecraft/item/ItemAxe.java.patch | 16 + .../net/minecraft/item/ItemBed.java.patch | 11 + .../net/minecraft/item/ItemBlock.java.patch | 76 ++ .../item/ItemBlockSpecial.java.patch | 35 + .../net/minecraft/item/ItemBow.java.patch | 37 + .../net/minecraft/item/ItemBucket.java.patch | 28 + .../minecraft/item/ItemBucketMilk.java.patch | 34 + .../net/minecraft/item/ItemDoor.java.patch | 11 + .../net/minecraft/item/ItemDye.java.patch | 56 + .../item/ItemFlintAndSteel.java.patch | 11 + .../net/minecraft/item/ItemHoe.java.patch | 17 + .../net/minecraft/item/ItemLilyPad.java.patch | 18 + .../net/minecraft/item/ItemMap.java.patch | 46 + .../minecraft/item/ItemMinecart.java.patch | 29 + .../minecraft/item/ItemSeedFood.java.patch | 39 + .../net/minecraft/item/ItemSeeds.java.patch | 39 + .../net/minecraft/item/ItemShears.java.patch | 86 ++ .../net/minecraft/item/ItemSkull.java.patch | 22 + .../net/minecraft/item/ItemSlab.java.patch | 20 + .../net/minecraft/item/ItemSnow.java.patch | 22 + .../net/minecraft/item/ItemSword.java.patch | 13 + .../net/minecraft/item/ItemTool.java.patch | 73 ++ .../item/crafting/Ingredient.java.patch | 21 + .../nbt/CompressedStreamTools.java.patch | 53 + .../minecraft/nbt/NBTSizeTracker.java.patch | 37 + .../minecraft/nbt/NBTTagCompound.java.patch | 18 + .../net/minecraft/nbt/NBTTagList.java.patch | 17 + .../net/minecraft/nbt/NBTTagString.java.patch | 11 + .../network/NetHandlerPlayServer.java.patch | 62 + .../network/NettyPacketEncoder.java.patch | 11 + .../network/NetworkManager.java.patch | 61 + .../network/NetworkSystem.java.patch | 44 + .../minecraft/network/PacketBuffer.java.patch | 20 + .../handshake/client/C00Handshake.java.patch | 48 + .../server/SPacketLoginSuccess.java.patch | 11 + .../play/client/CPacketClickWindow.java.patch | 11 + .../CPacketCreativeInventoryAction.java.patch | 11 + .../client/CPacketCustomPayload.java.patch | 14 + .../server/SPacketCustomPayload.java.patch | 21 + .../play/server/SPacketSpawnMob.java.patch | 11 + .../pathfinding/WalkNodeProcessor.java.patch | 20 + .../minecraft/potion/PotionEffect.java.patch | 138 ++ .../minecraft/potion/PotionType.java.patch | 16 + .../minecraft/profiler/Profiler.java.patch | 19 + .../minecraft/realms/RealmsConnect.java.patch | 19 + .../dedicated/DedicatedServer.java.patch | 78 ++ .../dedicated/ServerHangWatchdog.java.patch | 11 + .../server/gui/MinecraftServerGui.java.patch | 24 + .../management/PlayerChunkMapEntry.java.patch | 162 +++ .../PlayerInteractionManager.java.patch | 286 ++++ .../server/management/PlayerList.java.patch | 253 ++++ .../network/NetHandlerHandshakeTCP.java.patch | 11 + .../network/NetHandlerLoginServer.java.patch | 29 + .../net/minecraft/stats/RecipeBook.java.patch | 21 + .../stats/RecipeBookServer.java.patch | 19 + .../net/minecraft/stats/StatList.java.patch | 138 ++ .../tileentity/TileEntity.java.patch | 282 ++++ .../tileentity/TileEntityBeacon.java.patch | 45 + .../tileentity/TileEntityChest.java.patch | 48 + .../tileentity/TileEntityHopper.java.patch | 52 + .../tileentity/TileEntityLockable.java.patch | 30 + .../TileEntityLockableLoot.java.patch | 11 + .../tileentity/TileEntityNote.java.patch | 12 + .../tileentity/TileEntityPiston.java.patch | 11 + .../TileEntityShulkerBox.java.patch | 12 + .../tileentity/TileEntitySign.java.patch | 11 + .../minecraft/util/ActionResult.java.patch | 13 + .../util/BlockRenderLayer.java.patch | 12 + .../util/ChatAllowedCharacters.java.patch | 10 + .../util/ClassInheritanceMultiMap.java.patch | 12 + .../net/minecraft/util/EnumFacing.java.patch | 67 + .../util/IntIdentityHashBiMap.java.patch | 10 + .../net/minecraft/util/MouseHelper.java.patch | 10 + .../util/ScreenShotHelper.java.patch | 17 + .../util/ServerRecipeBookHelper.java.patch | 30 + .../net/minecraft/util/Session.java.patch | 60 + .../net/minecraft/util/SoundEvent.java.patch | 14 + .../minecraft/util/TabCompleter.java.patch | 39 + .../util/datafix/DataFixesManager.java.patch | 10 + .../util/math/RayTraceResult.java.patch | 15 + .../net/minecraft/util/math/Vec3d.java.patch | 42 + .../util/text/ITextComponent.java.patch | 10 + .../net/minecraft/util/text/Style.java.patch | 10 + .../util/text/TextComponentBase.java.patch | 10 + .../text/translation/LanguageMap.java.patch | 54 + .../net/minecraft/village/Village.java.patch | 209 +++ .../village/VillageCollection.java.patch | 10 + .../net/minecraft/world/BossInfo.java.patch | 27 + .../minecraft/world/BossInfoServer.java.patch | 27 + .../net/minecraft/world/ChunkCache.java.patch | 75 ++ .../minecraft/world/DimensionType.java.patch | 39 + .../net/minecraft/world/Explosion.java.patch | 52 + .../minecraft/world/IBlockAccess.java.patch | 17 + .../world/ServerWorldEventHandler.java.patch | 20 + .../net/minecraft/world/Teleporter.java.patch | 25 + .../net/minecraft/world/World.java.patch | 1153 +++++++++++++++++ .../world/WorldEntitySpawner.java.patch | 94 ++ .../minecraft/world/WorldProvider.java.patch | 439 +++++++ .../world/WorldProviderEnd.java.patch | 43 + .../world/WorldProviderSurface.java.patch | 10 + .../minecraft/world/WorldServer.java.patch | 304 +++++ .../world/WorldServerMulti.java.patch | 66 + .../net/minecraft/world/WorldType.java.patch | 115 ++ .../minecraft/world/biome/Biome.java.patch | 201 +++ .../world/biome/BiomeDecorator.java.patch | 168 +++ .../world/biome/BiomeDesert.java.patch | 18 + .../world/biome/BiomeForest.java.patch | 58 + .../world/biome/BiomeHills.java.patch | 63 + .../world/biome/BiomeJungle.java.patch | 18 + .../world/biome/BiomeMesa.java.patch | 26 + .../world/biome/BiomePlains.java.patch | 41 + .../world/biome/BiomeProvider.java.patch | 38 + .../world/biome/BiomeSavanna.java.patch | 10 + .../world/biome/BiomeSnow.java.patch | 11 + .../world/biome/BiomeSwamp.java.patch | 31 + .../world/biome/BiomeTaiga.java.patch | 19 + .../world/border/WorldBorder.java.patch | 12 + .../chunk/BlockStateContainer.java.patch | 39 + .../minecraft/world/chunk/Chunk.java.patch | 372 ++++++ .../chunk/storage/AnvilChunkLoader.java.patch | 191 +++ .../chunk/storage/AnvilSaveHandler.java.patch | 23 + .../storage/ExtendedBlockStorage.java.patch | 11 + .../world/chunk/storage/RegionFile.java.patch | 15 + .../world/end/DragonFightManager.java.patch | 33 + .../world/gen/ChunkGeneratorEnd.java.patch | 73 ++ .../world/gen/ChunkGeneratorFlat.java.patch | 29 + .../world/gen/ChunkGeneratorHell.java.patch | 120 ++ .../gen/ChunkGeneratorOverworld.java.patch | 102 ++ .../world/gen/ChunkProviderServer.java.patch | 91 ++ .../world/gen/MapGenCaves.java.patch | 111 ++ .../world/gen/MapGenRavine.java.patch | 124 ++ .../feature/WorldGenAbstractTree.java.patch | 13 + .../feature/WorldGenBigMushroom.java.patch | 34 + .../gen/feature/WorldGenBigTree.java.patch | 52 + .../gen/feature/WorldGenBirchTree.java.patch | 56 + .../world/gen/feature/WorldGenBush.java.patch | 11 + .../gen/feature/WorldGenCanopyTree.java.patch | 72 + .../gen/feature/WorldGenDeadBush.java.patch | 11 + .../gen/feature/WorldGenDungeons.java.patch | 10 + .../gen/feature/WorldGenGlowStone1.java.patch | 11 + .../gen/feature/WorldGenGlowStone2.java.patch | 11 + .../gen/feature/WorldGenHellLava.java.patch | 11 + .../gen/feature/WorldGenHugeTrees.java.patch | 69 + .../gen/feature/WorldGenIceSpike.java.patch | 29 + .../gen/feature/WorldGenLakes.java.patch | 12 + .../gen/feature/WorldGenLiquids.java.patch | 11 + .../gen/feature/WorldGenMegaJungle.java.patch | 50 + .../feature/WorldGenMegaPineTree.java.patch | 60 + .../gen/feature/WorldGenMinable.java.patch | 12 + .../feature/WorldGenSavannaTree.java.patch | 64 + .../gen/feature/WorldGenShrub.java.patch | 32 + .../gen/feature/WorldGenSwamp.java.patch | 89 ++ .../gen/feature/WorldGenTaiga1.java.patch | 52 + .../gen/feature/WorldGenTaiga2.java.patch | 66 + .../gen/feature/WorldGenTallGrass.java.patch | 11 + .../gen/feature/WorldGenTrees.java.patch | 108 ++ .../gen/feature/WorldGenerator.java.patch | 12 + .../WorldGeneratorBonusChest.java.patch | 47 + .../world/gen/layer/GenLayer.java.patch | 52 + .../world/gen/layer/GenLayerBiome.java.patch | 93 ++ .../gen/structure/MapGenStronghold.java.patch | 23 + .../gen/structure/MapGenStructure.java.patch | 17 + .../structure/StructureComponent.java.patch | 13 + .../gen/structure/StructureStart.java.patch | 23 + .../StructureVillagePieces.java.patch | 93 ++ .../structure/template/Template.java.patch | 19 + .../world/storage/DerivedWorldInfo.java.patch | 28 + .../world/storage/MapData.java.patch | 41 + .../world/storage/SaveFormatOld.java.patch | 27 + .../world/storage/SaveHandler.java.patch | 70 + .../world/storage/WorldInfo.java.patch | 103 ++ .../world/storage/WorldSavedData.java.patch | 26 + .../BlockDynamicLiquid.java.patch | 60 + patches_old_unknown/BlockFlowerPot.java.patch | 64 + patches_old_unknown/BlockLeaves.java.patch | 51 + patches_old_unknown/BlockLiquid.java.patch | 49 + patches_old_unknown/BlockLog.java.patch | 24 + patches_old_unknown/BlockObserver.java.patch | 15 + patches_old_unknown/BlockSlab.java.patch | 39 + patches_old_unknown/BlockStairs.java.patch | 32 + .../BlockStaticLiquid.java.patch | 39 + patches_old_unknown/CrashReport.java.patch | 18 + patches_old_unknown/EntityMinecart.java.patch | 19 + patches_old_unknown/EntityPlayerSP.java.patch | 68 + patches_old_unknown/FontRenderer.java.patch | 152 +++ patches_old_unknown/GuiIngameMenu.java.patch | 32 + patches_old_unknown/GuiMultiplayer.java.patch | 19 + .../GuiOverlayDebug.java.patch | 12 + patches_old_unknown/GuiScreen.java.patch | 40 + .../LoadingScreenRenderer.java.patch | 26 + .../ServerListEntryNormal.java.patch | 23 + 356 files changed, 19939 insertions(+), 4 deletions(-) create mode 100644 patches_old/minecraft/net/minecraft/client/Minecraft.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/model/ModelBase.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/model/ModelBox.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/model/ModelRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/model/TexturedQuad.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/network/ServerPinger.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/particle/Particle.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/particle/ParticleManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/ChestRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/RenderItem.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/resources/IResourceManagerReloadListener.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/resources/Language.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/resources/Locale.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/shader/Framebuffer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/shader/ShaderManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch create mode 100644 patches_old/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/command/CommandBase.java.patch create mode 100644 patches_old/minecraft/net/minecraft/command/CommandFill.java.patch create mode 100644 patches_old/minecraft/net/minecraft/command/CommandHandler.java.patch create mode 100644 patches_old/minecraft/net/minecraft/command/EntitySelector.java.patch create mode 100644 patches_old/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch create mode 100644 patches_old/minecraft/net/minecraft/enchantment/Enchantment.java.patch create mode 100644 patches_old/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch create mode 100644 patches_old/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch create mode 100644 patches_old/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityAgeable.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityFlying.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityHanging.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityList.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityLiving.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityLivingBase.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityTracker.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/boss/EntityWither.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/item/EntityItem.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityCreeper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityMob.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntitySilverfish.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch create mode 100644 patches_old/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/Container.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/ContainerRepair.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/SlotCrafting.java.patch create mode 100644 patches_old/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/Item.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemArmor.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemArrow.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemAxe.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemBed.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemBlock.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemBow.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemBucket.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemBucketMilk.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemDoor.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemDye.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemHoe.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemLilyPad.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemMap.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemMinecart.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemSeedFood.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemSeeds.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemShears.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemSkull.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemSlab.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemSnow.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemSword.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/ItemTool.java.patch create mode 100644 patches_old/minecraft/net/minecraft/item/crafting/Ingredient.java.patch create mode 100644 patches_old/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch create mode 100644 patches_old/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch create mode 100644 patches_old/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch create mode 100644 patches_old/minecraft/net/minecraft/nbt/NBTTagList.java.patch create mode 100644 patches_old/minecraft/net/minecraft/nbt/NBTTagString.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/NetworkManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/NetworkSystem.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/PacketBuffer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch create mode 100644 patches_old/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch create mode 100644 patches_old/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch create mode 100644 patches_old/minecraft/net/minecraft/potion/PotionEffect.java.patch create mode 100644 patches_old/minecraft/net/minecraft/potion/PotionType.java.patch create mode 100644 patches_old/minecraft/net/minecraft/profiler/Profiler.java.patch create mode 100644 patches_old/minecraft/net/minecraft/realms/RealmsConnect.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/management/PlayerList.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch create mode 100644 patches_old/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/stats/RecipeBook.java.patch create mode 100644 patches_old/minecraft/net/minecraft/stats/RecipeBookServer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/stats/StatList.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntity.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch create mode 100644 patches_old/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/ActionResult.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/BlockRenderLayer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/ChatAllowedCharacters.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/EnumFacing.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/MouseHelper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/ScreenShotHelper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/Session.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/SoundEvent.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/TabCompleter.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/math/RayTraceResult.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/math/Vec3d.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/text/ITextComponent.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/text/Style.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/text/TextComponentBase.java.patch create mode 100644 patches_old/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch create mode 100644 patches_old/minecraft/net/minecraft/village/Village.java.patch create mode 100644 patches_old/minecraft/net/minecraft/village/VillageCollection.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/BossInfo.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/BossInfoServer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/ChunkCache.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/DimensionType.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/Explosion.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/IBlockAccess.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/Teleporter.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/World.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/WorldProvider.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/WorldProviderEnd.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/WorldProviderSurface.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/WorldServer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/WorldServerMulti.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/WorldType.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/Biome.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeForest.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeHills.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomePlains.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/border/WorldBorder.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/chunk/Chunk.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/end/DragonFightManager.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/storage/MapData.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/storage/SaveHandler.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/storage/WorldInfo.java.patch create mode 100644 patches_old/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch create mode 100644 patches_old_unknown/BlockDynamicLiquid.java.patch create mode 100644 patches_old_unknown/BlockFlowerPot.java.patch create mode 100644 patches_old_unknown/BlockLeaves.java.patch create mode 100644 patches_old_unknown/BlockLiquid.java.patch create mode 100644 patches_old_unknown/BlockLog.java.patch create mode 100644 patches_old_unknown/BlockObserver.java.patch create mode 100644 patches_old_unknown/BlockSlab.java.patch create mode 100644 patches_old_unknown/BlockStairs.java.patch create mode 100644 patches_old_unknown/BlockStaticLiquid.java.patch create mode 100644 patches_old_unknown/CrashReport.java.patch create mode 100644 patches_old_unknown/EntityMinecart.java.patch create mode 100644 patches_old_unknown/EntityPlayerSP.java.patch create mode 100644 patches_old_unknown/FontRenderer.java.patch create mode 100644 patches_old_unknown/GuiIngameMenu.java.patch create mode 100644 patches_old_unknown/GuiMultiplayer.java.patch create mode 100644 patches_old_unknown/GuiOverlayDebug.java.patch create mode 100644 patches_old_unknown/GuiScreen.java.patch create mode 100644 patches_old_unknown/LoadingScreenRenderer.java.patch create mode 100644 patches_old_unknown/ServerListEntryNormal.java.patch diff --git a/.gitignore b/.gitignore index 3ad106c0b..5681190c6 100644 --- a/.gitignore +++ b/.gitignore @@ -29,10 +29,6 @@ # FML changelog changelog.txt -/patches_old/ -/patches_old_bak/ -/patches/minecraft.old/ -/projects.old/ *.py *.7z /logs/ diff --git a/patches_old/minecraft/net/minecraft/client/Minecraft.java.patch b/patches_old/minecraft/net/minecraft/client/Minecraft.java.patch new file mode 100644 index 000000000..86476fd5e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/Minecraft.java.patch @@ -0,0 +1,606 @@ +--- ../src-base/minecraft/net/minecraft/client/Minecraft.java ++++ ../src-work/minecraft/net/minecraft/client/Minecraft.java +@@ -344,7 +344,6 @@ + this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService(); + this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a; + field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a()); +- field_147123_G.debug("(Session ID is {})", (Object)this.field_71449_j.func_111286_b()); + this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a; + this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0 ? p_i45547_1_.field_178743_b.field_178764_a : 1; + this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0 ? p_i45547_1_.field_178743_b.field_178762_b : 1; +@@ -464,10 +463,10 @@ + this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an); + this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab); + this.field_110451_am.func_110542_a(this.field_135017_as); +- this.func_110436_a(); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().beginMinecraftLoading(this, this.field_110449_ao, this.field_110451_am, this.field_110452_an); + this.field_71446_o = new TextureManager(this.field_110451_am); + this.field_110451_am.func_110542_a(this.field_71446_o); +- this.func_180510_a(this.field_71446_o); ++ net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.field_71446_o); + this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az); + this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"), this.field_184131_U); + this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y); +@@ -487,6 +486,8 @@ + this.field_110451_am.func_110542_a(new GrassColorReloadListener()); + this.field_110451_am.func_110542_a(new FoliageColorReloadListener()); + this.field_71417_B = new MouseHelper(); ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar= net.minecraftforge.fml.common.ProgressManager.push("Rendering Setup", 5, true); ++ bar.step("GL Setup"); + this.func_71361_d("Pre startup"); + GlStateManager.func_179098_w(); + GlStateManager.func_179103_j(7425); +@@ -500,19 +501,24 @@ + GlStateManager.func_179096_D(); + GlStateManager.func_179128_n(5888); + this.func_71361_d("Startup"); ++ bar.step("Loading Texture Map"); + this.field_147128_au = new TextureMap("textures"); + this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I); + this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au); + this.field_71446_o.func_110577_a(TextureMap.field_110575_b); + this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0); ++ bar.step("Loading Model Manager"); + this.field_175617_aL = new ModelManager(this.field_147128_au); + this.field_110451_am.func_110542_a(this.field_175617_aL); + this.field_184127_aH = BlockColors.func_186723_a(); + this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH); ++ bar.step("Loading Item Renderer"); + this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL, this.field_184128_aI); + this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X); + this.field_175620_Y = new ItemRenderer(this); + this.field_110451_am.func_110542_a(this.field_175621_X); ++ bar.step("Loading Entity Renderer"); ++ net.minecraftforge.fml.client.SplashProgress.pause(); + this.field_71460_t = new EntityRenderer(this, this.field_110451_am); + this.field_110451_am.func_110542_a(this.field_71460_t); + this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH); +@@ -523,23 +529,27 @@ + this.field_110451_am.func_110542_a(this.field_193995_ae); + GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d); + this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o); ++ net.minecraftforge.fml.client.SplashProgress.resume(); ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().finishMinecraftLoading(); + this.func_71361_d("Post startup"); +- this.field_71456_v = new GuiIngame(this); ++ this.field_71456_v = new net.minecraftforge.client.GuiIngameForge(this); + + if (this.field_71475_ae != null) + { +- this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af)); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServerAtStartup(this.field_71475_ae, this.field_71477_af); + } + else + { + this.func_147108_a(new GuiMainMenu()); + } + +- this.field_71446_o.func_147645_c(this.field_152354_ay); ++ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(field_71446_o, field_152354_ay); + this.field_152354_ay = null; + this.field_71461_s = new LoadingScreenRenderer(this); + this.field_184132_p = new DebugRenderer(this); + ++ net.minecraftforge.fml.client.FMLClientHandler.instance().onInitializationComplete(); + if (this.field_71474_y.field_74353_u && !this.field_71431_Q) + { + this.func_71352_k(); +@@ -748,21 +758,23 @@ + File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); + Bootstrap.func_179870_a(p_71377_1_.func_71502_e()); + ++ int retVal; + if (p_71377_1_.func_71497_f() != null) + { + Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f()); +- System.exit(-1); ++ retVal = -1; + } + else if (p_71377_1_.func_147149_a(file2)) + { + Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath()); +- System.exit(-1); ++ retVal = -1; + } + else + { + Bootstrap.func_179870_a("#@?@# Game crashed! Crash report could not be saved. #@?@#"); +- System.exit(-2); ++ retVal = -2; + } ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleExit(retVal); + } + + public boolean func_152349_b() +@@ -770,6 +782,7 @@ + return this.field_135017_as.func_135042_a() || this.field_71474_y.field_151455_aw; + } + ++ @Deprecated // Forge: Use selective refreshResources method in FMLClientHandler + public void func_110436_a() + { + List list = Lists.newArrayList(this.field_110449_ao); +@@ -955,11 +968,6 @@ + + public void func_147108_a(@Nullable GuiScreen p_147108_1_) + { +- if (this.field_71462_r != null) +- { +- this.field_71462_r.func_146281_b(); +- } +- + if (p_147108_1_ == null && this.field_71441_e == null) + { + p_147108_1_ = new GuiMainMenu(); +@@ -969,6 +977,17 @@ + p_147108_1_ = new GuiGameOver((ITextComponent)null); + } + ++ GuiScreen old = this.field_71462_r; ++ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_147108_1_); ++ ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; ++ ++ p_147108_1_ = event.getGui(); ++ if (old != null && p_147108_1_ != old) ++ { ++ old.func_146281_b(); ++ } ++ + if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) + { + this.field_71474_y.field_74330_P = false; +@@ -1082,7 +1101,7 @@ + long i1 = System.nanoTime() - l; + this.func_71361_d("Pre render"); + this.field_71424_I.func_76318_c("sound"); +- this.field_147127_av.func_147691_a(this.field_71439_g, this.field_71428_T.field_194147_b); ++ this.field_147127_av.setListener(this.func_175606_aa(), this.field_71428_T.field_194147_b); //Forge: MC-46445 Spectator mode particles and sounds computed from where you have been before + this.field_71424_I.func_76319_b(); + this.field_71424_I.func_76320_a("render"); + GlStateManager.func_179094_E(); +@@ -1094,11 +1113,13 @@ + + if (!this.field_71454_w) + { ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickStart(this.field_71428_T.field_194147_b); + this.field_71424_I.func_76318_c("gameRenderer"); + this.field_71460_t.func_181560_a(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b, i); + this.field_71424_I.func_76318_c("toasts"); + this.field_193034_aS.func_191783_a(new ScaledResolution(this)); + this.field_71424_I.func_76319_b(); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickEnd(this.field_71428_T.field_194147_b); + } + + this.field_71424_I.func_76319_b(); +@@ -1455,9 +1476,9 @@ + { + BlockPos blockpos = this.field_71476_x.func_178782_a(); + +- if (this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) ++ if (!this.field_71441_e.func_175623_d(blockpos) && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) + { +- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b); ++ this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x); + this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND); + } + } +@@ -1491,7 +1512,7 @@ + case BLOCK: + BlockPos blockpos = this.field_71476_x.func_178782_a(); + +- if (this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a) ++ if (!this.field_71441_e.func_175623_d(blockpos)) + { + this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b); + break; +@@ -1505,6 +1526,7 @@ + } + + this.field_71439_g.func_184821_cY(); ++ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.field_71439_g); + } + + this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND); +@@ -1570,6 +1592,7 @@ + } + } + ++ if (itemstack.func_190926_b() && (this.field_71476_x == null || this.field_71476_x.field_72313_a == RayTraceResult.Type.MISS)) net.minecraftforge.common.ForgeHooks.onEmptyClick(this.field_71439_g, enumhand); + if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) + { + this.field_71460_t.field_78516_c.func_187460_a(enumhand); +@@ -1630,6 +1653,11 @@ + } + + Display.setFullscreen(this.field_71431_Q); ++ if (!this.field_71431_Q) //Forge: Fix MC-68754, Screen is not resizeable after exiting fullscreen due to LWJGL bug https://github.com/LWJGL/lwjgl/issues/142 which is fixed, but not in the version MC ships ++ { ++ Display.setResizable(false); ++ Display.setResizable(true); ++ } + Display.setVSyncEnabled(this.field_71474_y.field_74352_v); + this.func_175601_h(); + } +@@ -1676,6 +1704,8 @@ + --this.field_71467_ac; + } + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreClientTick(); ++ + this.field_71424_I.func_76320_a("gui"); + + if (!this.field_71445_n) +@@ -1877,6 +1907,7 @@ + } + + this.field_71424_I.func_76319_b(); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostClientTick(); + this.field_71423_H = func_71386_F(); + } + +@@ -1982,6 +2013,7 @@ + } + } + } ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput(); + } + + this.func_184117_aA(); +@@ -2239,6 +2271,8 @@ + { + while (Mouse.next()) + { ++ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; ++ + int i = Mouse.getEventButton(); + KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState()); + +@@ -2294,6 +2328,7 @@ + this.field_71462_r.func_146274_d(); + } + } ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput(); + } + } + +@@ -2304,6 +2339,7 @@ + + public void func_71371_a(String p_71371_1_, String p_71371_2_, @Nullable WorldSettings p_71371_3_) + { ++ net.minecraftforge.fml.client.FMLClientHandler.instance().startIntegratedServer(p_71371_1_, p_71371_2_, p_71371_3_); + this.func_71403_a((WorldClient)null); + System.gc(); + ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false); +@@ -2344,8 +2380,14 @@ + + this.field_71461_s.func_73720_a(I18n.func_135052_a("menu.loadingLevel")); + +- while (!this.field_71437_Z.func_71200_ad()) ++ while (!this.field_71437_Z.func_71200_ad() && !this.field_71437_Z.func_71241_aa()) + { ++ if (!net.minecraftforge.fml.common.StartupQuery.check()) ++ { ++ func_71403_a(null); ++ func_147108_a(null); ++ return; ++ } + String s = this.field_71437_Z.func_71195_b_(); + + if (s != null) +@@ -2371,8 +2413,14 @@ + SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a(); + NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress); + networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null)); +- networkmanager.func_179290_a(new C00Handshake(socketaddress.toString(), 0, EnumConnectionState.LOGIN)); +- networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e())); ++ networkmanager.func_179290_a(new C00Handshake(socketaddress.toString(), 0, EnumConnectionState.LOGIN, true)); ++ com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e(); ++ if (!this.func_110432_I().hasCachedProperties()) ++ { ++ gameProfile = field_152355_az.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974. ++ this.func_110432_I().setProperties(gameProfile.getProperties()); ++ } ++ networkmanager.func_179290_a(new CPacketLoginStart(gameProfile)); + this.field_71453_ak = networkmanager; + } + +@@ -2383,6 +2431,8 @@ + + public void func_71353_a(@Nullable WorldClient p_71353_1_, String p_71353_2_) + { ++ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e)); ++ + if (p_71353_1_ == null) + { + NetHandlerPlayClient nethandlerplayclient = this.func_147114_u(); +@@ -2395,6 +2445,18 @@ + if (this.field_71437_Z != null && this.field_71437_Z.func_175578_N()) + { + this.field_71437_Z.func_71263_m(); ++ if (field_71461_s != null && this.field_71425_J) ++ { ++ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal")); ++ } ++ while (!field_71437_Z.func_71241_aa()) ++ { ++ try ++ { ++ Thread.sleep(10); ++ } ++ catch (InterruptedException ie) {} ++ } + } + + this.field_71437_Z = null; +@@ -2418,6 +2480,7 @@ + this.field_71456_v.func_181029_i(); + this.func_71351_a((ServerData)null); + this.field_71455_al = false; ++ net.minecraftforge.fml.client.FMLClientHandler.instance().handleClientWorldClosing(this.field_71441_e); + } + + this.field_147127_av.func_147690_c(); +@@ -2434,6 +2497,7 @@ + } + + TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_71353_1_); ++ net.minecraftforge.client.MinecraftForgeClient.clearRenderCache(); + + if (p_71353_1_ != null) + { +@@ -2488,6 +2552,7 @@ + EntityPlayerSP entityplayersp = this.field_71439_g; + this.field_71439_g = this.field_71442_b.func_192830_a(this.field_71441_e, this.field_71439_g == null ? new StatisticsManager() : this.field_71439_g.func_146107_m(), this.field_71439_g == null ? new RecipeBook() : this.field_71439_g.func_192035_E()); + this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c()); ++ this.field_71439_g.updateSyncFields(entityplayersp); // Forge: fix MC-10657 + this.field_71439_g.field_71093_bK = p_71354_1_; + this.field_175622_Z = this.field_71439_g; + this.field_71439_g.func_70065_x(); +@@ -2535,159 +2600,8 @@ + { + if (this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) + { +- boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d; +- TileEntity tileentity = null; +- ItemStack itemstack; +- +- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) +- { +- BlockPos blockpos = this.field_71476_x.func_178782_a(); +- IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos); +- Block block = iblockstate.func_177230_c(); +- +- if (iblockstate.func_185904_a() == Material.field_151579_a) +- { +- return; +- } +- +- itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate); +- +- if (itemstack.func_190926_b()) +- { +- return; +- } +- +- if (flag && GuiScreen.func_146271_m() && block.func_149716_u()) +- { +- tileentity = this.field_71441_e.func_175625_s(blockpos); +- } +- } +- else +- { +- if (this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !flag) +- { +- return; +- } +- +- if (this.field_71476_x.field_72308_g instanceof EntityPainting) +- { +- itemstack = new ItemStack(Items.field_151159_an); +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot) +- { +- itemstack = new ItemStack(Items.field_151058_ca); +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame) +- { +- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g; +- ItemStack itemstack1 = entityitemframe.func_82335_i(); +- +- if (itemstack1.func_190926_b()) +- { +- itemstack = new ItemStack(Items.field_151160_bD); +- } +- else +- { +- itemstack = itemstack1.func_77946_l(); +- } +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityMinecart) +- { +- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g; +- Item item1; +- +- switch (entityminecart.func_184264_v()) +- { +- case FURNACE: +- item1 = Items.field_151109_aJ; +- break; +- case CHEST: +- item1 = Items.field_151108_aI; +- break; +- case TNT: +- item1 = Items.field_151142_bV; +- break; +- case HOPPER: +- item1 = Items.field_151140_bW; +- break; +- case COMMAND_BLOCK: +- item1 = Items.field_151095_cc; +- break; +- default: +- item1 = Items.field_151143_au; +- } +- +- itemstack = new ItemStack(item1); +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityBoat) +- { +- itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j()); +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand) +- { +- itemstack = new ItemStack(Items.field_179565_cj); +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityEnderCrystal) +- { +- itemstack = new ItemStack(Items.field_185158_cP); +- } +- else +- { +- ResourceLocation resourcelocation = EntityList.func_191301_a(this.field_71476_x.field_72308_g); +- +- if (resourcelocation == null || !EntityList.field_75627_a.containsKey(resourcelocation)) +- { +- return; +- } +- +- itemstack = new ItemStack(Items.field_151063_bx); +- ItemMonsterPlacer.func_185078_a(itemstack, resourcelocation); +- } +- } +- +- if (itemstack.func_190926_b()) +- { +- String s = ""; +- +- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) +- { +- s = ((ResourceLocation)Block.field_149771_c.func_177774_c(this.field_71441_e.func_180495_p(this.field_71476_x.func_178782_a()).func_177230_c())).toString(); +- } +- else if (this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY) +- { +- s = EntityList.func_191301_a(this.field_71476_x.field_72308_g).toString(); +- } +- +- field_147123_G.warn("Picking on: [{}] {} gave null item", this.field_71476_x.field_72313_a, s); +- } +- else +- { +- InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by; +- +- if (tileentity != null) +- { +- this.func_184119_a(itemstack, tileentity); +- } +- +- int i = inventoryplayer.func_184429_b(itemstack); +- +- if (flag) +- { +- inventoryplayer.func_184434_a(itemstack); +- this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c); +- } +- else if (i != -1) +- { +- if (InventoryPlayer.func_184435_e(i)) +- { +- inventoryplayer.field_70461_c = i; +- } +- else +- { +- this.field_71442_b.func_187100_a(i); +- } +- } +- } ++ net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e); ++ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions + } + } + +@@ -2834,6 +2748,7 @@ + return field_71432_P; + } + ++ @Deprecated // Forge: Use selective scheduleResourceRefresh method in FMLClientHandler + public ListenableFuture func_175603_A() + { + return this.func_152344_a(new Runnable() +@@ -3009,18 +2924,8 @@ + + public static int func_71369_N() + { +- for (int i = 16384; i > 0; i >>= 1) +- { +- GlStateManager.func_187419_a(32868, 0, 6408, i, i, 0, 6408, 5121, (IntBuffer)null); +- int j = GlStateManager.func_187411_c(32868, 0, 4096); +- +- 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 func_70002_Q() +@@ -3152,6 +3057,9 @@ + } + else if (this.field_71439_g != null) + { ++ MusicTicker.MusicType type = this.field_71441_e.field_73011_w.getMusicType(); ++ if (type != null) return type; ++ + if (this.field_71439_g.field_70170_p.field_73011_w instanceof WorldProviderHell) + { + return MusicTicker.MusicType.NETHER; +@@ -3181,11 +3089,11 @@ + { + if (Keyboard.getEventKeyState()) + { +- if (i == this.field_71474_y.field_152395_am.func_151463_i()) ++ if (this.field_71474_y.field_152395_am.isActiveAndMatches(i)) + { + this.func_71352_k(); + } +- else if (i == this.field_71474_y.field_151447_Z.func_151463_i()) ++ else if (this.field_71474_y.field_151447_Z.isActiveAndMatches(i)) + { + this.field_71456_v.func_146158_b().func_146227_a(ScreenShotHelper.func_148260_a(this.field_71412_D, this.field_71443_c, this.field_71440_d, this.field_147124_at)); + } +@@ -3199,6 +3107,7 @@ + } + } + } ++ else if (this.field_71462_r instanceof GuiControls) ((GuiControls)this.field_71462_r).field_146491_f = null; + } + } + } +@@ -3328,6 +3237,12 @@ + return this.field_184127_aH; + } + ++ // FORGE ++ public ItemColors getItemColors() ++ { ++ return this.field_184128_aI; ++ } ++ + public boolean func_189648_am() + { + return this.field_71439_g != null && this.field_71439_g.func_175140_cp() || this.field_71474_y.field_178879_v; +@@ -3342,4 +3257,9 @@ + { + return this.field_193035_aW; + } ++ ++ public SearchTreeManager getSearchTreeManager() ++ { ++ return this.field_193995_ae; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/model/ModelBase.java.patch b/patches_old/minecraft/net/minecraft/client/model/ModelBase.java.patch new file mode 100644 index 000000000..04667710a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/model/ModelBase.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java +@@ -10,7 +10,6 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public abstract class ModelBase + { + public float field_78095_p; diff --git a/patches_old/minecraft/net/minecraft/client/model/ModelBox.java.patch b/patches_old/minecraft/net/minecraft/client/model/ModelBox.java.patch new file mode 100644 index 000000000..7995ccb23 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/model/ModelBox.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java +@@ -4,7 +4,6 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public class ModelBox + { + private final PositionTextureVertex[] field_78253_h; +@@ -81,6 +80,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + public void func_178780_a(BufferBuilder p_178780_1_, float p_178780_2_) + { + for (TexturedQuad texturedquad : this.field_78254_i) diff --git a/patches_old/minecraft/net/minecraft/client/model/ModelRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/model/ModelRenderer.java.patch new file mode 100644 index 000000000..4962d8769 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/model/ModelRenderer.java.patch @@ -0,0 +1,42 @@ +--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java +@@ -9,7 +9,6 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public class ModelRenderer + { + public float field_78801_a; +@@ -108,6 +107,7 @@ + this.field_78798_e = p_78793_3_; + } + ++ @SideOnly(Side.CLIENT) + public void func_78785_a(float p_78785_1_) + { + if (!this.field_78807_k) +@@ -189,6 +189,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + public void func_78791_b(float p_78791_1_) + { + if (!this.field_78807_k) +@@ -224,6 +225,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + public void func_78794_c(float p_78794_1_) + { + if (!this.field_78807_k) +@@ -265,6 +267,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + private void func_78788_d(float p_78788_1_) + { + this.field_78811_r = GLAllocation.func_74526_a(1); diff --git a/patches_old/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch b/patches_old/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch new file mode 100644 index 000000000..307bb90b3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch @@ -0,0 +1,13 @@ +--- ../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.math.Vec3d; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public class PositionTextureVertex + { + public Vec3d field_78243_a; diff --git a/patches_old/minecraft/net/minecraft/client/model/TexturedQuad.java.patch b/patches_old/minecraft/net/minecraft/client/model/TexturedQuad.java.patch new file mode 100644 index 000000000..9712d2d3d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/model/TexturedQuad.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java ++++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java +@@ -7,7 +7,6 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public class TexturedQuad + { + public PositionTextureVertex[] field_78239_a; +@@ -43,6 +42,7 @@ + this.field_78239_a = apositiontexturevertex; + } + ++ @SideOnly(Side.CLIENT) + public void func_178765_a(BufferBuilder p_178765_1_, float p_178765_2_) + { + Vec3d vec3d = this.field_78239_a[1].field_78243_a.func_72444_a(this.field_78239_a[0].field_78243_a); diff --git a/patches_old/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches_old/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch new file mode 100644 index 000000000..f6725fc12 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +@@ -60,6 +60,7 @@ + { + Chunk chunk = new Chunk(this.field_73235_d, p_73158_1_, p_73158_2_); + this.field_73236_b.put(ChunkPos.func_77272_a(p_73158_1_, p_73158_2_), chunk); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk)); + chunk.func_177417_c(true); + return chunk; + } diff --git a/patches_old/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch b/patches_old/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch new file mode 100644 index 000000000..c618ed9fa --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch @@ -0,0 +1,11 @@ +--- ../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(p_146367_1_); + GuiConnecting.this.field_146371_g = NetworkManager.func_181124_a(inetaddress, p_146367_2_, GuiConnecting.this.field_146297_k.field_71474_y.func_181148_f()); + GuiConnecting.this.field_146371_g.func_150719_a(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.field_146297_k, GuiConnecting.this.field_146374_i)); +- GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN)); ++ GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN, true)); + GuiConnecting.this.field_146371_g.func_179290_a(new CPacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e())); + } + catch (UnknownHostException unknownhostexception) diff --git a/patches_old/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches_old/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch new file mode 100644 index 000000000..46556c38d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -0,0 +1,214 @@ +--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java +@@ -126,10 +126,16 @@ + } + } + +- if (this.field_78779_k.func_77145_d() && !this.field_78776_a.field_71439_g.func_184614_ca().func_190926_b() && this.field_78776_a.field_71439_g.func_184614_ca().func_77973_b() instanceof ItemSword) ++ ItemStack stack = field_78776_a.field_71439_g.func_184614_ca(); ++ if (!stack.func_190926_b() && stack.func_77973_b().onBlockStartBreak(stack, p_187103_1_, field_78776_a.field_71439_g)) + { + return false; + } ++ ++ if (this.field_78779_k.func_77145_d() && !stack.func_190926_b() && !stack.func_77973_b().canDestroyBlockInCreative(field_78776_a.field_71441_e, p_187103_1_, stack, field_78776_a.field_71439_g)) ++ { ++ return false; ++ } + else + { + World world = this.field_78776_a.field_71441_e; +@@ -147,19 +153,13 @@ + else + { + world.func_175718_b(2001, p_187103_1_, Block.func_176210_f(iblockstate)); +- block.func_176208_a(world, p_187103_1_, iblockstate, this.field_78776_a.field_71439_g); +- boolean flag = world.func_180501_a(p_187103_1_, Blocks.field_150350_a.func_176223_P(), 11); + +- if (flag) +- { +- block.func_176206_d(world, p_187103_1_, iblockstate); +- } +- + this.field_178895_c = new BlockPos(this.field_178895_c.func_177958_n(), -1, this.field_178895_c.func_177952_p()); + + if (!this.field_78779_k.func_77145_d()) + { + ItemStack itemstack1 = this.field_78776_a.field_71439_g.func_184614_ca(); ++ ItemStack copyBeforeUse = itemstack1.func_77946_l(); + + if (!itemstack1.func_190926_b()) + { +@@ -167,11 +167,18 @@ + + if (itemstack1.func_190926_b()) + { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.field_78776_a.field_71439_g, copyBeforeUse, EnumHand.MAIN_HAND); + this.field_78776_a.field_71439_g.func_184611_a(EnumHand.MAIN_HAND, ItemStack.field_190927_a); + } + } + } + ++ boolean flag = block.removedByPlayer(iblockstate, world, p_187103_1_, field_78776_a.field_71439_g, false); ++ ++ if (flag) ++ { ++ block.func_176206_d(world, p_187103_1_, iblockstate); ++ } + return flag; + } + } +@@ -212,6 +219,7 @@ + { + this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180511_1_, this.field_78776_a.field_71441_e.func_180495_p(p_180511_1_), 1.0F); + this.field_78774_b.func_147297_a(new CPacketPlayerDigging(CPacketPlayerDigging.Action.START_DESTROY_BLOCK, p_180511_1_, p_180511_2_)); ++ if (!net.minecraftforge.common.ForgeHooks.onLeftClickBlock(this.field_78776_a.field_71439_g, p_180511_1_, p_180511_2_, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(this.field_78776_a.field_71439_g, func_78757_d() + 1)).isCanceled()) + func_178891_a(this.field_78776_a, this, p_180511_1_, p_180511_2_); + this.field_78781_i = 5; + } +@@ -221,6 +229,7 @@ + { + this.field_78774_b.func_147297_a(new CPacketPlayerDigging(CPacketPlayerDigging.Action.ABORT_DESTROY_BLOCK, this.field_178895_c, p_180511_2_)); + } ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.LeftClickBlock event = net.minecraftforge.common.ForgeHooks.onLeftClickBlock(this.field_78776_a.field_71439_g, p_180511_1_, p_180511_2_, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(this.field_78776_a.field_71439_g, func_78757_d() + 1)); + + IBlockState iblockstate = this.field_78776_a.field_71441_e.func_180495_p(p_180511_1_); + this.field_78776_a.func_193032_ao().func_193294_a(this.field_78776_a.field_71441_e, p_180511_1_, iblockstate, 0.0F); +@@ -229,9 +238,11 @@ + + if (flag && this.field_78770_f == 0.0F) + { ++ if (event.getUseBlock() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + iblockstate.func_177230_c().func_180649_a(this.field_78776_a.field_71441_e, p_180511_1_, this.field_78776_a.field_71439_g); + } + ++ if (event.getUseItem() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return true; + if (flag && iblockstate.func_185903_a(this.field_78776_a.field_71439_g, this.field_78776_a.field_71439_g.field_70170_p, p_180511_1_) >= 1.0F) + { + this.func_187103_a(p_180511_1_); +@@ -297,7 +308,7 @@ + + if (this.field_78780_h % 4.0F == 0.0F) + { +- SoundType soundtype = block.func_185467_w(); ++ SoundType soundtype = block.getSoundType(iblockstate, field_78776_a.field_71441_e, p_180512_1_, field_78776_a.field_71439_g); + this.field_78776_a.func_147118_V().func_147682_a(new PositionedSoundRecord(soundtype.func_185846_f(), SoundCategory.NEUTRAL, (soundtype.func_185843_a() + 1.0F) / 8.0F, soundtype.func_185847_b() * 0.5F, p_180512_1_)); + } + +@@ -326,7 +337,8 @@ + + public float func_78757_d() + { +- return this.field_78779_k.func_77145_d() ? 5.0F : 4.5F; ++ float attrib = (float) field_78776_a.field_71439_g.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111126_e(); ++ return this.field_78779_k.func_77145_d() ? attrib : attrib - 0.5F; + } + + public void func_78765_e() +@@ -350,7 +362,7 @@ + + if (!this.field_85183_f.func_190926_b() && !itemstack.func_190926_b()) + { +- flag = itemstack.func_77973_b() == this.field_85183_f.func_77973_b() && ItemStack.func_77970_a(itemstack, this.field_85183_f) && (itemstack.func_77984_f() || itemstack.func_77960_j() == this.field_85183_f.func_77960_j()); ++ flag = !net.minecraftforge.client.ForgeHooksClient.shouldCauseBlockBreakReset(this.field_85183_f, itemstack); + } + + return p_178893_1_.equals(this.field_178895_c) && flag; +@@ -382,13 +394,34 @@ + } + else + { ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock event = net.minecraftforge.common.ForgeHooks ++ .onRightClickBlock(p_187099_1_, p_187099_6_, p_187099_3_, p_187099_4_, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(p_187099_1_, func_78757_d() + 1)); ++ if (event.isCanceled()) ++ { ++ // Give the server a chance to fire event as well. That way server event is not dependant on client event. ++ this.field_78774_b.func_147297_a(new CPacketPlayerTryUseItemOnBlock(p_187099_3_, p_187099_4_, p_187099_6_, f, f1, f2)); ++ return event.getCancellationResult(); ++ } ++ EnumActionResult result = EnumActionResult.PASS; ++ + if (this.field_78779_k != GameType.SPECTATOR) + { ++ EnumActionResult ret = itemstack.onItemUseFirst(p_187099_1_, p_187099_2_, p_187099_3_, p_187099_6_, p_187099_4_, f, f1, f2); ++ if (ret != EnumActionResult.PASS) ++ { ++ // The server needs to process the item use as well. Otherwise onItemUseFirst won't ever be called on the server without causing weird bugs ++ this.field_78774_b.func_147297_a(new CPacketPlayerTryUseItemOnBlock(p_187099_3_, p_187099_4_, p_187099_6_, f, f1, f2)); ++ return ret; ++ } ++ + IBlockState iblockstate = p_187099_2_.func_180495_p(p_187099_3_); ++ boolean bypass = p_187099_1_.func_184614_ca().doesSneakBypassUse(p_187099_2_, p_187099_3_, p_187099_1_) && p_187099_1_.func_184592_cb().doesSneakBypassUse(p_187099_2_, p_187099_3_, p_187099_1_); + +- if ((!p_187099_1_.func_70093_af() || p_187099_1_.func_184614_ca().func_190926_b() && p_187099_1_.func_184592_cb().func_190926_b()) && iblockstate.func_177230_c().func_180639_a(p_187099_2_, p_187099_3_, iblockstate, p_187099_1_, p_187099_6_, p_187099_4_, f, f1, f2)) ++ if ((!p_187099_1_.func_70093_af() || bypass || event.getUseBlock() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW)) + { +- flag = true; ++ if (event.getUseBlock() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ flag = iblockstate.func_177230_c().func_180639_a(p_187099_2_, p_187099_3_, iblockstate, p_187099_1_, p_187099_6_, p_187099_4_, f, f1, f2); ++ if (flag) result = EnumActionResult.SUCCESS; + } + + if (!flag && itemstack.func_77973_b() instanceof ItemBlock) +@@ -404,7 +437,7 @@ + + this.field_78774_b.func_147297_a(new CPacketPlayerTryUseItemOnBlock(p_187099_3_, p_187099_4_, p_187099_6_, f, f1, f2)); + +- if (!flag && this.field_78779_k != GameType.SPECTATOR) ++ if (!flag && this.field_78779_k != GameType.SPECTATOR || event.getUseItem() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) + { + if (itemstack.func_190926_b()) + { +@@ -430,14 +463,20 @@ + { + int i = itemstack.func_77960_j(); + int j = itemstack.func_190916_E(); ++ if (event.getUseItem() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) { + EnumActionResult enumactionresult = itemstack.func_179546_a(p_187099_1_, p_187099_2_, p_187099_3_, p_187099_6_, p_187099_4_, f, f1, f2); + itemstack.func_77964_b(i); + itemstack.func_190920_e(j); + return enumactionresult; ++ } else return result; + } + else + { +- return itemstack.func_179546_a(p_187099_1_, p_187099_2_, p_187099_3_, p_187099_6_, p_187099_4_, f, f1, f2); ++ ItemStack copyForUse = itemstack.func_77946_l(); ++ if (event.getUseItem() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ result = itemstack.func_179546_a(p_187099_1_, p_187099_2_, p_187099_3_, p_187099_6_, p_187099_4_, f, f1, f2); ++ if (itemstack.func_190926_b()) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187099_1_, copyForUse, p_187099_6_); ++ return result; + } + } + } +@@ -466,6 +505,8 @@ + } + else + { ++ EnumActionResult cancelResult = net.minecraftforge.common.ForgeHooks.onItemRightClick(p_187101_1_, p_187101_3_); ++ if (cancelResult != null) return cancelResult; + int i = itemstack.func_190916_E(); + ActionResult actionresult = itemstack.func_77957_a(p_187101_2_, p_187101_1_, p_187101_3_); + ItemStack itemstack1 = actionresult.func_188398_b(); +@@ -473,6 +514,10 @@ + if (itemstack1 != itemstack || itemstack1.func_190916_E() != i) + { + p_187101_1_.func_184611_a(p_187101_3_, itemstack1); ++ if (itemstack1.func_190926_b()) ++ { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187101_1_, itemstack, p_187101_3_); ++ } + } + + return actionresult.func_188397_a(); +@@ -509,6 +554,9 @@ + this.func_78750_j(); + Vec3d vec3d = new Vec3d(p_187102_3_.field_72307_f.field_72450_a - p_187102_2_.field_70165_t, p_187102_3_.field_72307_f.field_72448_b - p_187102_2_.field_70163_u, p_187102_3_.field_72307_f.field_72449_c - p_187102_2_.field_70161_v); + this.field_78774_b.func_147297_a(new CPacketUseEntity(p_187102_2_, p_187102_4_, vec3d)); ++ if (this.field_78779_k == GameType.SPECTATOR) return EnumActionResult.PASS; // don't fire for spectators to match non-specific EntityInteract ++ EnumActionResult cancelResult = net.minecraftforge.common.ForgeHooks.onInteractEntityAt(p_187102_1_, p_187102_2_, p_187102_3_, p_187102_4_); ++ if(cancelResult != null) return cancelResult; + return this.field_78779_k == GameType.SPECTATOR ? EnumActionResult.PASS : p_187102_2_.func_184199_a(p_187102_1_, vec3d, p_187102_4_); + } + diff --git a/patches_old/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches_old/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch new file mode 100644 index 000000000..b2931d8d3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java +@@ -60,17 +60,19 @@ + + public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_) + { +- super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), DimensionType.func_186069_a(p_i45063_3_).func_186070_d(), p_i45063_5_, true); ++ super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), net.minecraftforge.common.DimensionManager.createProviderFor(p_i45063_3_), p_i45063_5_, true); + this.field_184158_M = this.field_73012_v.nextInt(12000); + this.field_184157_a = Sets.newHashSet(); + this.field_73035_a = p_i45063_1_; + this.func_72912_H().func_176144_a(p_i45063_4_); +- this.func_175652_B(new BlockPos(8, 64, 8)); + this.field_73011_w.func_76558_a(this); ++ this.func_175652_B(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect. + this.field_73020_y = this.func_72970_h(); + this.field_72988_C = new SaveDataMemoryStorage(); + this.func_72966_v(); + this.func_72947_a(); ++ this.initCapabilities(); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(this)); + } + + public void func_72835_b() diff --git a/patches_old/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch b/patches_old/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch new file mode 100644 index 000000000..a09e9fe7b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java ++++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java +@@ -23,6 +23,7 @@ + + public void func_147383_a(C00Handshake p_147383_1_) + { ++ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerHandshake(p_147383_1_, this.field_147384_b)) return; + this.field_147384_b.func_150723_a(p_147383_1_.func_149594_c()); + this.field_147384_b.func_150719_a(new NetHandlerLoginServer(this.field_147385_a, this.field_147384_b)); + } diff --git a/patches_old/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch b/patches_old/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch new file mode 100644 index 000000000..e3eb85706 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java ++++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java +@@ -108,7 +108,10 @@ + { + this.field_175091_e = p_147390_1_.func_179730_a(); + this.field_147393_d.func_150723_a(EnumConnectionState.PLAY); +- this.field_147393_d.func_150719_a(new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e)); ++ NetHandlerPlayClient nhpc = new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e); ++ this.field_147393_d.func_150719_a(nhpc); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().setPlayClient(nhpc); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlClientHandshake(this.field_147393_d); + } + + public void func_147231_a(ITextComponent p_147231_1_) diff --git a/patches_old/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches_old/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch new file mode 100644 index 000000000..36e36090a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -0,0 +1,101 @@ +--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java ++++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java +@@ -295,7 +295,7 @@ + { + PacketThreadUtil.func_180031_a(p_147282_1_, this, this.field_147299_f); + this.field_147299_f.field_71442_b = new PlayerControllerMP(this.field_147299_f, this); +- this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), p_147282_1_.func_149194_f(), p_147282_1_.func_149192_g(), this.field_147299_f.field_71424_I); ++ this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(func_147298_b()).getOverrideDimension(p_147282_1_), p_147282_1_.func_149192_g(), this.field_147299_f.field_71424_I); + this.field_147299_f.field_71474_y.field_74318_M = p_147282_1_.func_149192_g(); + this.field_147299_f.func_71403_a(this.field_147300_g); + this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f(); +@@ -745,7 +745,7 @@ + chunk.func_186033_a(p_147263_1_.func_186946_a(), p_147263_1_.func_149276_g(), p_147263_1_.func_149274_i()); + this.field_147300_g.func_147458_c(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15); + +- if (!p_147263_1_.func_149274_i() || !(this.field_147300_g.field_73011_w instanceof WorldProviderSurface)) ++ if (!p_147263_1_.func_149274_i() || this.field_147300_g.field_73011_w.shouldClientCheckLighting()) + { + chunk.func_76613_n(); + } +@@ -757,7 +757,7 @@ + + if (tileentity != null) + { +- tileentity.func_145839_a(nbttagcompound); ++ tileentity.handleUpdateTag(nbttagcompound); + } + } + } +@@ -840,7 +840,9 @@ + public void func_147251_a(SPacketChat p_147251_1_) + { + PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f); +- this.field_147299_f.field_71456_v.func_191742_a(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c()); ++ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_192590_c(), p_147251_1_.func_148915_c()); ++ if (message == null) return; ++ this.field_147299_f.field_71456_v.func_191742_a(p_147251_1_.func_192590_c(), message); + } + + public void func_147279_a(SPacketAnimation p_147279_1_) +@@ -971,7 +973,7 @@ + + if (entity1 == this.field_147299_f.field_71439_g && !flag) + { +- this.field_147299_f.field_71456_v.func_110326_a(I18n.func_135052_a("mount.onboard", GameSettings.func_74298_c(this.field_147299_f.field_71474_y.field_74311_E.func_151463_i())), false); ++ this.field_147299_f.field_71456_v.func_110326_a(I18n.func_135052_a("mount.onboard", this.field_147299_f.field_71474_y.field_74311_E.getDisplayName()), false); + } + } + } +@@ -1219,6 +1221,15 @@ + { + tileentity.func_145839_a(p_147273_1_.func_148857_g()); + } ++ else ++ { ++ if(tileentity == null) ++ { ++ field_147301_d.error("Received invalid update packet for null tile entity at {} with data: {}", p_147273_1_.func_179823_a(), p_147273_1_.func_148857_g()); ++ return; ++ } ++ tileentity.onDataPacket(field_147302_e, p_147273_1_); ++ } + + if (flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock) + { +@@ -1319,15 +1330,15 @@ + } + else if (f == 101.0F) + { +- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.movement", new Object[] {GameSettings.func_74298_c(gamesettings.field_74351_w.func_151463_i()), GameSettings.func_74298_c(gamesettings.field_74370_x.func_151463_i()), GameSettings.func_74298_c(gamesettings.field_74368_y.func_151463_i()), GameSettings.func_74298_c(gamesettings.field_74366_z.func_151463_i())})); ++ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.movement", new Object[] {gamesettings.field_74351_w.getDisplayName(), gamesettings.field_74370_x.getDisplayName(), gamesettings.field_74368_y.getDisplayName(), gamesettings.field_74366_z.getDisplayName()})); + } + else if (f == 102.0F) + { +- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.jump", new Object[] {GameSettings.func_74298_c(gamesettings.field_74314_A.func_151463_i())})); ++ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.jump", new Object[] {gamesettings.field_74314_A.getDisplayName()})); + } + else if (f == 103.0F) + { +- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.inventory", new Object[] {GameSettings.func_74298_c(gamesettings.field_151445_Q.func_151463_i())})); ++ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(new TextComponentTranslation("demo.help.inventory", new Object[] {gamesettings.field_151445_Q.getDisplayName()})); + } + } + else if (i == 6) +@@ -1489,7 +1500,7 @@ + + if (entity instanceof EntityLivingBase) + { +- Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e()); ++ Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e() & 0xFF); + + if (potion != null) + { +@@ -1856,6 +1867,7 @@ + } + finally + { ++ if (false) // Forge: let packet handle releasing buffer + packetbuffer.release(); + } + } diff --git a/patches_old/minecraft/net/minecraft/client/network/ServerPinger.java.patch b/patches_old/minecraft/net/minecraft/client/network/ServerPinger.java.patch new file mode 100644 index 000000000..da8135c50 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/network/ServerPinger.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/network/ServerPinger.java ++++ ../src-work/minecraft/net/minecraft/client/network/ServerPinger.java +@@ -150,6 +150,7 @@ + p_147224_1_.func_147407_a((String)null); + } + ++ net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(p_147224_1_, serverstatusresponse); + this.field_175092_e = Minecraft.func_71386_F(); + networkmanager.func_179290_a(new CPacketPing(this.field_175092_e)); + this.field_147403_d = true; +@@ -176,7 +177,7 @@ + + try + { +- networkmanager.func_179290_a(new C00Handshake(serveraddress.func_78861_a(), serveraddress.func_78864_b(), EnumConnectionState.STATUS)); ++ networkmanager.func_179290_a(new C00Handshake(serveraddress.func_78861_a(), serveraddress.func_78864_b(), EnumConnectionState.STATUS, true)); + networkmanager.func_179290_a(new CPacketServerQuery()); + } + catch (Throwable throwable) diff --git a/patches_old/minecraft/net/minecraft/client/particle/Particle.java.patch b/patches_old/minecraft/net/minecraft/client/particle/Particle.java.patch new file mode 100644 index 000000000..8dd3ac9a7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/particle/Particle.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/client/particle/Particle.java ++++ ../src-work/minecraft/net/minecraft/client/particle/Particle.java +@@ -265,8 +265,8 @@ + { + this.field_187134_n = p_187115_1_; + this.field_187135_o = p_187115_2_; +- AxisAlignedBB axisalignedbb = this.func_187116_l(); +- this.func_187108_a(new AxisAlignedBB(axisalignedbb.field_72340_a, axisalignedbb.field_72338_b, axisalignedbb.field_72339_c, axisalignedbb.field_72340_a + (double)this.field_187134_n, axisalignedbb.field_72338_b + (double)this.field_187135_o, axisalignedbb.field_72339_c + (double)this.field_187134_n)); ++ // FORGE: Fix MC-12269 - Glitchy movement when setSize is called without setPosition ++ func_187109_b(field_187126_f, field_187127_g, field_187128_h); + } + } + +@@ -283,6 +283,8 @@ + public void func_187110_a(double p_187110_1_, double p_187110_3_, double p_187110_5_) + { + double d0 = p_187110_3_; ++ double origX = p_187110_1_; ++ double origZ = p_187110_5_; + + if (this.field_190017_n) + { +@@ -315,14 +317,14 @@ + } + + this.func_187118_j(); +- this.field_187132_l = p_187110_3_ != p_187110_3_ && d0 < 0.0D; ++ this.field_187132_l = d0 != p_187110_3_ && d0 < 0.0D; + +- if (p_187110_1_ != p_187110_1_) ++ if (origX != p_187110_1_) + { + this.field_187129_i = 0.0D; + } + +- if (p_187110_5_ != p_187110_5_) ++ if (origZ != p_187110_5_) + { + this.field_187131_k = 0.0D; + } diff --git a/patches_old/minecraft/net/minecraft/client/particle/ParticleManager.java.patch b/patches_old/minecraft/net/minecraft/client/particle/ParticleManager.java.patch new file mode 100644 index 000000000..d90b99b15 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/particle/ParticleManager.java.patch @@ -0,0 +1,33 @@ +--- ../src-base/minecraft/net/minecraft/client/particle/ParticleManager.java ++++ ../src-work/minecraft/net/minecraft/client/particle/ParticleManager.java +@@ -153,6 +153,7 @@ + + public void func_78873_a(Particle p_78873_1_) + { ++ if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs. + this.field_187241_h.add(p_78873_1_); + } + +@@ -409,7 +410,7 @@ + + public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_) + { +- if (p_180533_2_.func_185904_a() != Material.field_151579_a) ++ if (!p_180533_2_.func_177230_c().isAir(p_180533_2_, this.field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this)) + { + p_180533_2_ = p_180533_2_.func_185899_b(this.field_78878_a, p_180533_1_); + int i = 4; +@@ -493,4 +494,13 @@ + + return "" + i; + } ++ ++ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.math.RayTraceResult target) ++ { ++ IBlockState state = field_78878_a.func_180495_p(pos); ++ if (state != null && !state.func_177230_c().addHitEffects(state, field_78878_a, target, this)) ++ { ++ func_180532_a(pos, target.field_178784_b); ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch new file mode 100644 index 000000000..61eb06afb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch @@ -0,0 +1,38 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java +@@ -30,6 +30,11 @@ + + public static void func_74583_a(EntityPlayer p_74583_0_, boolean p_74583_1_) + { ++ updateRenderInfo((Entity) p_74583_0_, p_74583_1_); ++ } ++ ++ public static void updateRenderInfo(Entity p_74583_0_, boolean p_74583_1_) ++ { + GlStateManager.func_179111_a(2982, field_178812_b); + GlStateManager.func_179111_a(2983, field_178813_c); + GlStateManager.func_187445_a(2978, field_178814_a); +@@ -81,7 +86,7 @@ + } + } + +- return iblockstate; ++ return iblockstate.func_177230_c().getStateAtViewpoint(iblockstate, p_186703_0_, blockpos, vec3d); + } + + public static float func_178808_b() +@@ -108,4 +113,14 @@ + { + return field_74596_h; + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ ++ /** ++ * Vector from render view entity position (corrected for partialTickTime) to the middle of screen ++ */ ++ public static Vec3d getCameraPosition() ++ { ++ return field_178811_e; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch new file mode 100644 index 000000000..2e03252c5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java +@@ -184,9 +184,9 @@ + + if (!flag) + { +- Block block = p_178270_1_.func_180495_p(blockpos).func_177230_c(); ++ IBlockState state = p_178270_1_.func_180495_p(blockpos); + +- if (block == Blocks.field_150359_w || block == Blocks.field_150399_cn) ++ if (state.func_193401_d(p_178270_1_, blockpos, EnumFacing.field_82609_l[i1+2].func_176734_d()) == net.minecraft.block.state.BlockFaceShape.SOLID) + { + textureatlassprite1 = this.field_187501_d; + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch new file mode 100644 index 000000000..fc77349fc --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch @@ -0,0 +1,54 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java +@@ -40,7 +40,7 @@ + + public boolean func_187493_a(IBlockAccess p_187493_1_, IBakedModel p_187493_2_, IBlockState p_187493_3_, BlockPos p_187493_4_, BufferBuilder p_187493_5_, boolean p_187493_6_, long p_187493_7_) + { +- boolean flag = Minecraft.func_71379_u() && p_187493_3_.func_185906_d() == 0 && p_187493_2_.func_177555_b(); ++ boolean flag = Minecraft.func_71379_u() && p_187493_3_.getLightValue(p_187493_1_, p_187493_4_) == 0 && p_187493_2_.isAmbientOcclusion(p_187493_3_); + + try + { +@@ -128,7 +128,14 @@ + p_187492_8_.func_187491_a(p_187492_1_, p_187492_2_, p_187492_3_, bakedquad.func_178210_d(), p_187492_6_, p_187492_7_); + p_187492_4_.func_178981_a(bakedquad.func_178209_a()); + p_187492_4_.func_178962_a(p_187492_8_.field_178207_c[0], p_187492_8_.field_178207_c[1], p_187492_8_.field_178207_c[2], p_187492_8_.field_178207_c[3]); +- ++ if(bakedquad.shouldApplyDiffuseLighting()) ++ { ++ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d()); ++ p_187492_8_.field_178206_b[0] *= diffuse; ++ p_187492_8_.field_178206_b[1] *= diffuse; ++ p_187492_8_.field_178206_b[2] *= diffuse; ++ p_187492_8_.field_178206_b[3] *= diffuse; ++ } + if (bakedquad.func_178212_b()) + { + int k = this.field_187499_a.func_186724_a(p_187492_2_, p_187492_1_, p_187492_3_, bakedquad.func_178211_c()); +@@ -262,11 +269,26 @@ + float f = (float)(k >> 16 & 255) / 255.0F; + float f1 = (float)(k >> 8 & 255) / 255.0F; + float f2 = (float)(k & 255) / 255.0F; ++ if(bakedquad.shouldApplyDiffuseLighting()) ++ { ++ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d()); ++ f *= diffuse; ++ f1 *= diffuse; ++ f2 *= diffuse; ++ } + p_187496_6_.func_178978_a(f, f1, f2, 4); + p_187496_6_.func_178978_a(f, f1, f2, 3); + p_187496_6_.func_178978_a(f, f1, f2, 2); + p_187496_6_.func_178978_a(f, f1, f2, 1); + } ++ else if(bakedquad.shouldApplyDiffuseLighting()) ++ { ++ float diffuse = net.minecraftforge.client.model.pipeline.LightUtil.diffuseLight(bakedquad.func_178210_d()); ++ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 4); ++ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 3); ++ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 2); ++ p_187496_6_.func_178978_a(diffuse, diffuse, diffuse, 1); ++ } + + p_187496_6_.func_178987_a(d0, d1, d2); + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch new file mode 100644 index 000000000..f4b9120b6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch @@ -0,0 +1,9 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelShapes.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelShapes.java +@@ -391,5 +391,6 @@ + return new ModelResourceLocation(s + "_double_slab", s1); + } + }); ++ net.minecraftforge.client.model.ModelLoader.onRegisterAllBlocks(this); + } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch new file mode 100644 index 000000000..884649bcd --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java +@@ -28,7 +28,7 @@ + public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_) + { + this.field_175028_a = p_i46577_1_; +- this.field_175027_c = new BlockModelRenderer(p_i46577_2_); ++ this.field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(p_i46577_2_); + this.field_175025_e = new BlockFluidRenderer(p_i46577_2_); + } + +@@ -43,7 +43,7 @@ + { + p_175020_1_ = p_175020_1_.func_185899_b(p_175020_4_, p_175020_2_); + IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_); +- IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(p_175020_1_, ibakedmodel, p_175020_3_, p_175020_2_)).func_177645_b(); ++ IBakedModel ibakedmodel1 = net.minecraftforge.client.ForgeHooksClient.getDamageModel(ibakedmodel, p_175020_3_, p_175020_1_, p_175020_4_, p_175020_2_); + this.field_175027_c.func_178267_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true); + } + } +@@ -75,7 +75,9 @@ + switch (enumblockrendertype) + { + case MODEL: +- return this.field_175027_c.func_178267_a(p_175018_3_, this.func_184389_a(p_175018_1_), p_175018_1_, p_175018_2_, p_175018_4_, true); ++ IBakedModel model = this.func_184389_a(p_175018_1_); ++ p_175018_1_ = p_175018_1_.func_177230_c().getExtendedState(p_175018_1_, p_175018_3_, p_175018_2_); ++ return this.field_175027_c.func_178267_a(p_175018_3_, model, p_175018_1_, p_175018_2_, p_175018_4_, true); + case ENTITYBLOCK_ANIMATED: + return false; + case LIQUID: diff --git a/patches_old/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch new file mode 100644 index 000000000..fab959546 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch @@ -0,0 +1,70 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/BufferBuilder.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/BufferBuilder.java +@@ -123,6 +123,8 @@ + + bitset.set(i1); + } ++ this.field_178999_b.limit(this.field_178999_b.capacity()); ++ this.field_178999_b.position(this.func_181664_j()); + } + + public BufferBuilder.State func_181672_a() +@@ -415,7 +417,7 @@ + + public void func_178981_a(int[] p_178981_1_) + { +- this.func_181670_b(p_178981_1_.length * 4); ++ this.func_181670_b(p_178981_1_.length * 4 + this.field_179011_q.func_177338_f());//Forge, fix MC-122110 + this.field_178999_b.position(this.func_181664_j()); + this.field_178999_b.put(p_178981_1_); + this.field_178997_d += p_178981_1_.length / this.field_179011_q.func_181719_f(); +@@ -506,15 +508,15 @@ + break; + case USHORT: + case SHORT: +- this.field_179001_a.putShort(i, (short)((int)p_181663_1_ * 32767 & 65535)); +- this.field_179001_a.putShort(i + 2, (short)((int)p_181663_2_ * 32767 & 65535)); +- this.field_179001_a.putShort(i + 4, (short)((int)p_181663_3_ * 32767 & 65535)); ++ this.field_179001_a.putShort(i, (short)((int)(p_181663_1_ * 32767) & 65535)); ++ this.field_179001_a.putShort(i + 2, (short)((int)(p_181663_2_ * 32767) & 65535)); ++ this.field_179001_a.putShort(i + 4, (short)((int)(p_181663_3_ * 32767) & 65535)); + break; + case UBYTE: + case BYTE: +- this.field_179001_a.put(i, (byte)((int)p_181663_1_ * 127 & 255)); +- this.field_179001_a.put(i + 1, (byte)((int)p_181663_2_ * 127 & 255)); +- this.field_179001_a.put(i + 2, (byte)((int)p_181663_3_ * 127 & 255)); ++ this.field_179001_a.put(i, (byte)((int)(p_181663_1_ * 127) & 255)); ++ this.field_179001_a.put(i + 1, (byte)((int)(p_181663_2_ * 127) & 255)); ++ this.field_179001_a.put(i + 2, (byte)((int)(p_181663_3_ * 127) & 255)); + } + + this.func_181667_k(); +@@ -605,4 +607,27 @@ + return this.field_179018_e; + } + } ++ ++ ++ //For some unknown reason Mojang changed the vanilla function to hardcode alpha as 255.... So lets re-add the parameter -.- ++ public void putColorRGBA(int index, int red, int green, int blue, int alpha) ++ { ++ if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) ++ this.field_178999_b.put(index, alpha << 24 | blue << 16 | green << 8 | red); ++ else ++ this.field_178999_b.put(index, red << 24 | green << 16 | blue << 8 | alpha); ++ } ++ ++ public boolean isColorDisabled() ++ { ++ return this.field_78939_q; ++ } ++ ++ public void putBulkData(ByteBuffer buffer) ++ { ++ func_181670_b(buffer.limit() + this.field_179011_q.func_177338_f()); ++ this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f()); ++ this.field_179001_a.put(buffer); ++ this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f(); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/ChestRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/ChestRenderer.java.patch new file mode 100644 index 000000000..049173937 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/ChestRenderer.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/ChestRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/ChestRenderer.java +@@ -13,6 +13,7 @@ + { + GlStateManager.func_179131_c(p_178175_2_, p_178175_2_, p_178175_2_, 1.0F); + GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F); +- TileEntityItemStackRenderer.field_147719_a.func_179022_a(new ItemStack(p_178175_1_)); ++ ItemStack stack = new ItemStack(p_178175_1_); ++ stack.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(stack); + } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch new file mode 100644 index 000000000..7bd4682b8 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -0,0 +1,296 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java +@@ -211,6 +211,7 @@ + { + this.func_175069_a(new ResourceLocation("shaders/post/invert.json")); + } ++ else net.minecraftforge.client.ForgeHooksClient.loadEntityShader(p_175066_1_, this); + } + } + +@@ -290,7 +291,7 @@ + this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g); + } + +- float f3 = this.field_78531_r.field_71441_e.func_175724_o(new BlockPos(this.field_78531_r.func_175606_aa())); ++ float f3 = this.field_78531_r.field_71441_e.func_175724_o(new BlockPos(this.field_78531_r.func_175606_aa().func_174824_e(1F))); // Forge: fix MC-51150 + float f4 = (float)this.field_78531_r.field_71474_y.field_151451_c / 32.0F; + float f2 = f3 * (1.0F - f4) + f4; + this.field_78539_ae += (f2 - this.field_78539_ae) * 0.1F; +@@ -412,7 +413,7 @@ + + if (d3 < d2 || d2 == 0.0D) + { +- if (entity1.func_184208_bv() == entity.func_184208_bv()) ++ if (entity1.func_184208_bv() == entity.func_184208_bv() && !entity1.canRiderInteract()) + { + if (d2 == 0.0D) + { +@@ -505,7 +506,7 @@ + f = f * 60.0F / 70.0F; + } + +- return f; ++ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, iblockstate, p_78481_1_, f); + } + } + +@@ -569,14 +570,8 @@ + { + BlockPos blockpos = new BlockPos(entity); + IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos); +- Block block = iblockstate.func_177230_c(); ++ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.field_78531_r.field_71441_e, blockpos, iblockstate, entity); + +- if (block == Blocks.field_150324_C) +- { +- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b(); +- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F); +- } +- + GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); + GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F); + } +@@ -643,17 +638,20 @@ + + if (!this.field_78531_r.field_71474_y.field_74325_U) + { +- GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, 1.0F, 0.0F, 0.0F); +- ++ float yaw = entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F; ++ float pitch = entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_; ++ float roll = 0.0F; + if (entity instanceof EntityAnimal) + { + EntityAnimal entityanimal = (EntityAnimal)entity; +- GlStateManager.func_179114_b(entityanimal.field_70758_at + (entityanimal.field_70759_as - entityanimal.field_70758_at) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); ++ yaw = entityanimal.field_70758_at + (entityanimal.field_70759_as - entityanimal.field_70758_at) * p_78467_1_ + 180.0F; + } +- else +- { +- GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); +- } ++ IBlockState state = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78467_1_); ++ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, p_78467_1_, yaw, pitch, roll); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ GlStateManager.func_179114_b(event.getRoll(), 0.0F, 0.0F, 1.0F); ++ GlStateManager.func_179114_b(event.getPitch(), 1.0F, 0.0F, 0.0F); ++ GlStateManager.func_179114_b(event.getYaw(), 0.0F, 1.0F, 0.0F); + } + + GlStateManager.func_179109_b(0.0F, -f, 0.0F); +@@ -771,6 +769,7 @@ + + boolean flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn(); + ++ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(field_78531_r.field_71438_f, p_78476_1_, p_78476_2_)) + if (this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71442_b.func_78747_a()) + { + this.func_180436_i(); +@@ -875,6 +874,15 @@ + f10 = 0.25F + f7 * 0.75F; + } + ++ float[] colors = {f8, f9, f10}; ++ world.field_73011_w.getLightmapColors(p_78472_1_, f, f2, f3, colors); ++ f8 = colors[0]; f9 = colors[1]; f10 = colors[2]; ++ ++ // Forge: fix MC-58177 ++ f8 = MathHelper.func_76131_a(f8, 0f, 1f); ++ f9 = MathHelper.func_76131_a(f9, 0f, 1f); ++ f10 = MathHelper.func_76131_a(f10, 0f, 1f); ++ + if (this.field_78531_r.field_71439_g.func_70644_a(MobEffects.field_76439_r)) + { + float f15 = this.func_180438_a(this.field_78531_r.field_71439_g, p_78472_1_); +@@ -1101,6 +1109,10 @@ + GlStateManager.func_179096_D(); + this.func_78478_c(); + this.field_78510_Z = System.nanoTime(); ++ // Forge: Fix MC-112292 ++ net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.field_147556_a.field_147553_e = this.field_78531_r.func_110434_K(); ++ // Forge: also fix rendering text before entering world (not part of MC-112292, but the same reason) ++ net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.field_147556_a.field_147557_n = this.field_78531_r.field_71466_p; + } + + if (this.field_78531_r.field_71462_r != null) +@@ -1109,7 +1121,7 @@ + + try + { +- this.field_78531_r.field_71462_r.func_73863_a(k1, l1, this.field_78531_r.func_193989_ak()); ++ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, k1, l1, this.field_78531_r.func_193989_ak()); + } + catch (Throwable throwable) + { +@@ -1204,7 +1216,7 @@ + + if (this.field_78531_r.field_71442_b.func_178889_l() == GameType.SPECTATOR) + { +- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; ++ flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; + } + else + { +@@ -1262,7 +1274,7 @@ + GlStateManager.func_179086_m(16640); + this.field_78531_r.field_71424_I.func_76318_c("camera"); + this.func_78479_a(p_175068_2_, p_175068_1_); +- ActiveRenderInfo.func_74583_a(this.field_78531_r.field_71439_g, this.field_78531_r.field_71474_y.field_74320_O == 2); ++ ActiveRenderInfo.updateRenderInfo(this.field_78531_r.func_175606_aa(), this.field_78531_r.field_71474_y.field_74320_O == 2); //Forge: MC-46445 Spectator mode particles and sounds computed from where you have been before + this.field_78531_r.field_71424_I.func_76318_c("frustum"); + ClippingHelperImpl.func_78558_a(); + this.field_78531_r.field_71424_I.func_76318_c("culling"); +@@ -1315,7 +1327,9 @@ + GlStateManager.func_179118_c(); + renderglobal.func_174977_a(BlockRenderLayer.SOLID, (double)p_175068_2_, p_175068_1_, entity); + GlStateManager.func_179141_d(); ++ this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, this.field_78531_r.field_71474_y.field_151442_I > 0); // FORGE: fix flickering leaves when mods mess up the blurMipmap settings + renderglobal.func_174977_a(BlockRenderLayer.CUTOUT_MIPPED, (double)p_175068_2_, p_175068_1_, entity); ++ this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a(); + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false); + renderglobal.func_174977_a(BlockRenderLayer.CUTOUT, (double)p_175068_2_, p_175068_1_, entity); + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a(); +@@ -1329,7 +1343,9 @@ + GlStateManager.func_179094_E(); + RenderHelper.func_74519_b(); + this.field_78531_r.field_71424_I.func_76318_c("entities"); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); + renderglobal.func_180446_a(entity, icamera, p_175068_2_); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); + RenderHelper.func_74518_a(); + this.func_175072_h(); + } +@@ -1342,6 +1358,7 @@ + EntityPlayer entityplayer = (EntityPlayer)entity; + GlStateManager.func_179118_c(); + this.field_78531_r.field_71424_I.func_76318_c("outline"); ++ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, p_175068_2_)) + renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_); + GlStateManager.func_179141_d(); + } +@@ -1388,6 +1405,17 @@ + GlStateManager.func_179103_j(7425); + this.field_78531_r.field_71424_I.func_76318_c("translucent"); + renderglobal.func_174977_a(BlockRenderLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity); ++ if (!this.field_175078_W) //Only render if render pass 0 happens as well. ++ { ++ RenderHelper.func_74519_b(); ++ this.field_78531_r.field_71424_I.func_76318_c("entities"); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1); ++ renderglobal.func_180446_a(entity, icamera, p_175068_2_); ++ // restore blending function changed by RenderGlobal.preRenderDamagedBlocks ++ GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1); ++ RenderHelper.func_74518_a(); ++ } + GlStateManager.func_179103_j(7424); + GlStateManager.func_179132_a(true); + GlStateManager.func_179089_o(); +@@ -1400,6 +1428,9 @@ + this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_, d0, d1, d2); + } + ++ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last"); ++ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_); ++ + this.field_78531_r.field_71424_I.func_76318_c("hand"); + + if (this.field_175074_C) +@@ -1515,6 +1546,13 @@ + + protected void func_78474_d(float p_78474_1_) + { ++ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer(); ++ if (renderer != null) ++ { ++ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r); ++ return; ++ } ++ + float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); + + if (f > 0.0F) +@@ -1749,30 +1787,17 @@ + this.field_175082_R = (float)vec3d3.field_72448_b; + this.field_175081_S = (float)vec3d3.field_72449_c; + } +- else if (iblockstate.func_185904_a() == Material.field_151586_h) ++ else + { +- float f12 = 0.0F; +- +- if (entity instanceof EntityLivingBase) +- { +- f12 = (float)EnchantmentHelper.func_185292_c((EntityLivingBase)entity) * 0.2F; +- +- if (((EntityLivingBase)entity).func_70644_a(MobEffects.field_76427_o)) +- { +- f12 = f12 * 0.3F + 0.6F; +- } +- } +- +- this.field_175080_Q = 0.02F + f12; +- this.field_175082_R = 0.02F + f12; +- this.field_175081_S = 0.2F + f12; ++ //Forge Moved to Block. ++ Vec3d viewport = ActiveRenderInfo.func_178806_a(entity, p_78466_1_); ++ BlockPos viewportPos = new BlockPos(viewport); ++ IBlockState viewportState = this.field_78531_r.field_71441_e.func_180495_p(viewportPos); ++ Vec3d inMaterialColor = viewportState.func_177230_c().getFogColor(this.field_78531_r.field_71441_e, viewportPos, viewportState, entity, new Vec3d(field_175080_Q, field_175082_R, field_175081_S), p_78466_1_); ++ this.field_175080_Q = (float)inMaterialColor.field_72450_a; ++ this.field_175082_R = (float)inMaterialColor.field_72448_b; ++ this.field_175081_S = (float)inMaterialColor.field_72449_c; + } +- else if (iblockstate.func_185904_a() == Material.field_151587_i) +- { +- this.field_175080_Q = 0.6F; +- this.field_175082_R = 0.1F; +- this.field_175081_S = 0.0F; +- } + + float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_; + this.field_175080_Q *= f13; +@@ -1830,6 +1855,9 @@ + f6 = 1.0F / this.field_175081_S; + } + ++ // Forge: fix MC-4647 and MC-10480 ++ if (Float.isInfinite(f6)) f6 = Math.nextAfter(f6, 0.0); ++ + this.field_175080_Q = this.field_175080_Q * (1.0F - f15) + this.field_175080_Q * f6 * f15; + this.field_175082_R = this.field_175082_R * (1.0F - f15) + this.field_175082_R * f6 * f15; + this.field_175081_S = this.field_175081_S * (1.0F - f15) + this.field_175081_S * f6 * f15; +@@ -1845,6 +1873,13 @@ + this.field_175081_S = f7; + } + ++ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, iblockstate, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ ++ this.field_175080_Q = event.getRed(); ++ this.field_175082_R = event.getGreen(); ++ this.field_175081_S = event.getBlue(); ++ + GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F); + } + +@@ -1855,7 +1890,9 @@ + GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78468_2_); +- ++ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, iblockstate, p_78468_2_, 0.1F); ++ if (hook >= 0) GlStateManager.func_179095_a(hook); ++ else + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) + { + float f1 = 5.0F; +@@ -1940,6 +1977,7 @@ + GlStateManager.func_179102_b(f * 0.05F); + GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F); + } ++ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, iblockstate, p_78468_2_, p_78468_1_, f); + } + + GlStateManager.func_179142_g(); diff --git a/patches_old/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch new file mode 100644 index 000000000..8279ca875 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java +@@ -28,13 +28,19 @@ + + protected void func_175378_g() + { +- if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty()) ++ boolean hasVisibleEffect = false; ++ for(PotionEffect potioneffect : this.field_146297_k.field_71439_g.func_70651_bq()) { ++ Potion potion = potioneffect.func_188419_a(); ++ if(potion.shouldRender(potioneffect)) { hasVisibleEffect = true; break; } ++ } ++ if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty() || !hasVisibleEffect) + { + this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2; + this.field_147045_u = false; + } + else + { ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.PotionShiftEvent(this))) this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2; else + this.field_147003_i = 160 + (this.field_146294_l - this.field_146999_f - 200) / 2; + this.field_147045_u = true; + } +@@ -71,6 +77,7 @@ + for (PotionEffect potioneffect : Ordering.natural().sortedCopy(collection)) + { + Potion potion = potioneffect.func_188419_a(); ++ if(!potion.shouldRender(potioneffect)) continue; + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + this.field_146297_k.func_110434_K().func_110577_a(field_147001_a); + this.func_73729_b(i, j, 0, 166, 140, 32); +@@ -81,6 +88,8 @@ + this.func_73729_b(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18); + } + ++ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k); ++ if (!potion.shouldRenderInvText(potioneffect)) { j += l; continue; } + String s1 = I18n.func_135052_a(potion.func_76393_a()); + + if (potioneffect.func_76458_c() == 1) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch new file mode 100644 index 000000000..d8b6f3ce0 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/ItemModelMesher.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/ItemModelMesher.java +@@ -33,7 +33,9 @@ + + public TextureAtlasSprite func_178087_a(Item p_178087_1_, int p_178087_2_) + { +- return this.func_178089_a(new ItemStack(p_178087_1_, 1, p_178087_2_)).func_177554_e(); ++ ItemStack stack = new ItemStack(p_178087_1_, 1, p_178087_2_); ++ IBakedModel model = this.func_178089_a(stack); ++ return model.func_188617_f().handleItemState(model, stack, null, null).func_177554_e(); + } + + public IBakedModel func_178089_a(ItemStack p_178089_1_) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch new file mode 100644 index 000000000..c258eb713 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -0,0 +1,101 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java +@@ -216,7 +216,7 @@ + bufferbuilder.func_181662_b(135.0D, -7.0D, 0.0D).func_187315_a(1.0D, 0.0D).func_181675_d(); + bufferbuilder.func_181662_b(-7.0D, -7.0D, 0.0D).func_187315_a(0.0D, 0.0D).func_181675_d(); + tessellator.func_78381_a(); +- MapData mapdata = Items.field_151098_aY.func_77873_a(p_187461_1_, this.field_78455_a.field_71441_e); ++ MapData mapdata = ((net.minecraft.item.ItemMap) p_187461_1_.func_77973_b()).func_77873_a(p_187461_1_, this.field_78455_a.field_71441_e); + + if (mapdata != null) + { +@@ -312,7 +312,7 @@ + { + ItemStack itemstack = abstractclientplayer.func_184607_cu(); + +- if (itemstack.func_77973_b() == Items.field_151031_f) ++ if (!itemstack.func_190926_b() && itemstack.func_77973_b() == Items.field_151031_f) //Forge: Data watcher can desync and cause this to NPE... + { + EnumHand enumhand1 = abstractclientplayer.func_184600_cs(); + flag = enumhand1 == EnumHand.MAIN_HAND; +@@ -329,6 +329,7 @@ + { + float f3 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F; + float f5 = 1.0F - (this.field_187470_g + (this.field_187469_f - this.field_187470_g) * p_78440_1_); ++ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.MAIN_HAND, p_78440_1_, f1, f3, f5, this.field_187467_d)) + this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.MAIN_HAND, f3, this.field_187467_d, f5); + } + +@@ -336,6 +337,7 @@ + { + float f4 = enumhand == EnumHand.OFF_HAND ? f : 0.0F; + float f6 = 1.0F - (this.field_187472_i + (this.field_187471_h - this.field_187472_i) * p_78440_1_); ++ if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.OFF_HAND, p_78440_1_, f1, f4, f6, this.field_187468_e)) + this.func_187457_a(abstractclientplayer, p_78440_1_, f1, EnumHand.OFF_HAND, f4, this.field_187468_e, f6); + } + +@@ -356,7 +358,7 @@ + this.func_187456_a(p_187457_7_, p_187457_5_, enumhandside); + } + } +- else if (p_187457_6_.func_77973_b() == Items.field_151098_aY) ++ else if (p_187457_6_.func_77973_b() instanceof net.minecraft.item.ItemMap) + { + if (flag && this.field_187468_e.func_190926_b()) + { +@@ -440,6 +442,7 @@ + if (this.field_78455_a.field_71439_g.func_70094_T()) + { + IBlockState iblockstate = this.field_78455_a.field_71441_e.func_180495_p(new BlockPos(this.field_78455_a.field_71439_g)); ++ BlockPos overlayPos = new BlockPos(this.field_78455_a.field_71439_g); + EntityPlayer entityplayer = this.field_78455_a.field_71439_g; + + for (int i = 0; i < 8; ++i) +@@ -453,11 +456,13 @@ + if (iblockstate1.func_191058_s()) + { + iblockstate = iblockstate1; ++ overlayPos = blockpos; + } + } + + if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos)) + this.func_178108_a(this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(iblockstate)); + } + } +@@ -466,11 +471,13 @@ + { + if (this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h)) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.renderWaterOverlay(field_78455_a.field_71439_g, p_78447_1_)) + this.func_78448_c(p_78447_1_); + } + + if (this.field_78455_a.field_71439_g.func_70027_ad()) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(field_78455_a.field_71439_g, p_78447_1_)) + this.func_78442_d(); + } + } +@@ -592,8 +599,17 @@ + else + { + float f = entityplayersp.func_184825_o(1.0F); +- this.field_187469_f += MathHelper.func_76131_a((Objects.equals(this.field_187467_d, itemstack) ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F); +- this.field_187471_h += MathHelper.func_76131_a((float)(Objects.equals(this.field_187468_e, itemstack1) ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F); ++ ++ boolean requipM = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187467_d, itemstack, entityplayersp.field_71071_by.field_70461_c); ++ boolean requipO = net.minecraftforge.client.ForgeHooksClient.shouldCauseReequipAnimation(this.field_187468_e, itemstack1, -1); ++ ++ if (!requipM && !Objects.equals(this.field_187467_d, itemstack)) ++ this.field_187467_d = itemstack; ++ if (!requipM && !Objects.equals(this.field_187468_e, itemstack1)) ++ this.field_187468_e = itemstack1; ++ ++ this.field_187469_f += MathHelper.func_76131_a((!requipM ? f * f * f : 0.0F) - this.field_187469_f, -0.4F, 0.4F); ++ this.field_187471_h += MathHelper.func_76131_a((float)(!requipO ? 1 : 0) - this.field_187471_h, -0.4F, 0.4F); + } + + if (this.field_187469_f < 0.1F) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch new file mode 100644 index 000000000..52a6d1ecf --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +@@ -93,6 +93,10 @@ + public static int field_176089_P; + public static int field_148826_e; + ++ /* Stores the last values sent into setLightmapTextureCoords */ ++ public static float lastBrightnessX = 0.0f; ++ public static float lastBrightnessY = 0.0f; ++ + public static void func_77474_a() + { + ContextCapabilities contextcapabilities = GLContext.getCapabilities(); +@@ -853,6 +857,12 @@ + { + GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_); + } ++ ++ if (p_77475_0_ == field_77476_b) ++ { ++ lastBrightnessX = p_77475_1_; ++ lastBrightnessY = p_77475_2_; ++ } + } + + public static void func_148821_a(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch new file mode 100644 index 000000000..e9cf61400 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -0,0 +1,158 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java +@@ -553,8 +553,10 @@ + + public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_) + { ++ int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass(); + if (this.field_72740_G > 0) + { ++ if (pass > 0) return; + --this.field_72740_G; + } + else +@@ -565,9 +567,12 @@ + this.field_72769_h.field_72984_F.func_76320_a("prepare"); + TileEntityRendererDispatcher.field_147556_a.func_190056_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_71476_x, p_180446_3_); + this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_); ++ if(pass == 0) ++ { + this.field_72748_H = 0; + this.field_72749_I = 0; + this.field_72750_J = 0; ++ } + Entity entity = this.field_72777_q.func_175606_aa(); + double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_; + double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_; +@@ -579,11 +584,15 @@ + this.field_72777_q.field_71460_t.func_180436_i(); + this.field_72769_h.field_72984_F.func_76318_c("global"); + List list = this.field_72769_h.func_72910_y(); ++ if (pass == 0) ++ { + this.field_72748_H = list.size(); ++ } + + for (int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) + { + Entity entity1 = this.field_72769_h.field_73007_j.get(i); ++ if (!entity1.shouldRenderInPass(pass)) continue; + ++this.field_72749_I; + + if (entity1.func_145770_h(d0, d1, d2)) +@@ -606,6 +615,7 @@ + { + for (Entity entity2 : classinheritancemultimap) + { ++ if(!entity2.shouldRenderInPass(pass)) continue; + boolean flag = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.func_184215_y(this.field_72777_q.field_71439_g); + + if (flag) +@@ -642,6 +652,7 @@ + } + } + ++ if(pass == 0) + if (this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad)) + { + this.field_72769_h.field_72984_F.func_76318_c("entityOutlines"); +@@ -681,6 +692,7 @@ + this.field_72769_h.field_72984_F.func_76318_c("blockentities"); + RenderHelper.func_74519_b(); + ++ TileEntityRendererDispatcher.field_147556_a.preDrawBatch(); + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R) + { + List list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b(); +@@ -689,6 +701,7 @@ + { + for (TileEntity tileentity2 : list3) + { ++ if (!tileentity2.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity2.getRenderBoundingBox())) continue; + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1); + } + } +@@ -698,9 +711,11 @@ + { + for (TileEntity tileentity : this.field_181024_n) + { ++ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue; + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1); + } + } ++ TileEntityRendererDispatcher.field_147556_a.drawBatch(pass); + + this.func_180443_s(); + +@@ -895,7 +910,7 @@ + { + RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8)); + +- if (renderchunk1 != null && p_174970_4_.func_78546_a(renderchunk1.field_178591_c)) ++ if (renderchunk1 != null && p_174970_4_.func_78546_a(renderchunk1.field_178591_c.func_72321_a(0.0, blockpos1.func_177956_o() > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY, 0.0))) // Forge: fix MC-73139 + { + renderchunk1.func_178577_a(p_174970_5_); + queue.add(new RenderGlobal.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0)); +@@ -951,7 +966,7 @@ + BlockPos blockpos2 = renderchunk4.func_178568_j().func_177982_a(8, 8, 8); + boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D; + +- if (!renderchunk4.func_188281_o() && !flag3) ++ if (net.minecraftforge.common.ForgeModContainer.alwaysSetupTerrainOffThread || (!renderchunk4.func_188281_o() && !flag3)) + { + this.field_175009_l.add(renderchunk4); + } +@@ -1253,6 +1268,13 @@ + + public void func_174976_a(float p_174976_1_, int p_174976_2_) + { ++ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer(); ++ if (renderer != null) ++ { ++ renderer.render(p_174976_1_, field_72769_h, field_72777_q); ++ return; ++ } ++ + if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1) + { + this.func_180448_r(); +@@ -1470,6 +1492,7 @@ + + public void func_180447_b(float p_180447_1_, int p_180447_2_, double p_180447_3_, double p_180447_5_, double p_180447_7_) + { ++ if (net.minecraftforge.fml.client.FMLClientHandler.instance().renderClouds(this.field_72773_u, p_180447_1_)) return; + if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) + { + if (this.field_72777_q.field_71474_y.func_181147_e() == 2) +@@ -1852,7 +1875,8 @@ + GlStateManager.func_187428_a(GlStateManager.SourceFactor.DST_COLOR, GlStateManager.DestFactor.SRC_COLOR, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.func_179147_l(); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.5F); +- GlStateManager.func_179136_a(-3.0F, -3.0F); ++ // FORGE: Fix MC-234 ++ GlStateManager.func_179136_a(-1.0F, -10.0F); + GlStateManager.func_179088_q(); + GlStateManager.func_179092_a(516, 0.1F); + GlStateManager.func_179141_d(); +@@ -1892,8 +1916,11 @@ + double d7 = (double)blockpos.func_177956_o() - d4; + double d8 = (double)blockpos.func_177952_p() - d5; + Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); ++ TileEntity te = this.field_72769_h.func_175625_s(blockpos); ++ boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull; ++ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking(); + +- if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull)) ++ if (!hasBreak) + { + if (d6 * d6 + d7 * d7 + d8 * d8 > 1024.0D) + { +@@ -2388,7 +2415,7 @@ + + if (block.func_176223_P().func_185904_a() != Material.field_151579_a) + { +- SoundType soundtype = block.func_185467_w(); ++ SoundType soundtype = block.getSoundType(Block.func_176220_d(p_180439_4_), field_72769_h, p_180439_3_, null); + this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false); + } + diff --git a/patches_old/minecraft/net/minecraft/client/renderer/RenderItem.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/RenderItem.java.patch new file mode 100644 index 000000000..1f558710e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/RenderItem.java.patch @@ -0,0 +1,120 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderItem.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderItem.java +@@ -71,7 +71,7 @@ + public RenderItem(TextureManager p_i46552_1_, ModelManager p_i46552_2_, ItemColors p_i46552_3_) + { + this.field_175057_n = p_i46552_1_; +- this.field_175059_m = new ItemModelMesher(p_i46552_2_); ++ this.field_175059_m = new net.minecraftforge.client.ItemModelMesherForge(p_i46552_2_); + this.func_175041_b(); + this.field_184395_f = p_i46552_3_; + } +@@ -137,7 +137,7 @@ + { + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179091_B(); +- TileEntityItemStackRenderer.field_147719_a.func_179022_a(p_180454_1_); ++ p_180454_1_.func_77973_b().getTileEntityItemStackRenderer().func_179022_a(p_180454_1_); + } + else + { +@@ -218,7 +218,7 @@ + k = k | -16777216; + } + +- this.func_191969_a(p_191970_1_, bakedquad, k); ++ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(p_191970_1_, bakedquad, k); + } + } + +@@ -240,17 +240,7 @@ + public IBakedModel func_184393_a(ItemStack p_184393_1_, @Nullable World p_184393_2_, @Nullable EntityLivingBase p_184393_3_) + { + IBakedModel ibakedmodel = this.field_175059_m.func_178089_a(p_184393_1_); +- Item item = p_184393_1_.func_77973_b(); +- +- if (item != null && item.func_185040_i()) +- { +- ResourceLocation resourcelocation = ibakedmodel.func_188617_f().func_188021_a(p_184393_1_, p_184393_2_, p_184393_3_); +- return resourcelocation == null ? ibakedmodel : this.field_175059_m.func_178083_a().func_174953_a(new ModelResourceLocation(resourcelocation, "inventory")); +- } +- else +- { +- return ibakedmodel; +- } ++ return ibakedmodel.func_188617_f().handleItemState(ibakedmodel, p_184393_1_, p_184393_2_, p_184393_3_); + } + + public void func_184392_a(ItemStack p_184392_1_, EntityLivingBase p_184392_2_, ItemCameraTransforms.TransformType p_184392_3_, boolean p_184392_4_) +@@ -274,14 +264,9 @@ + GlStateManager.func_179147_l(); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.func_179094_E(); +- ItemCameraTransforms itemcameratransforms = p_184394_2_.func_177552_f(); +- ItemCameraTransforms.func_188034_a(itemcameratransforms.func_181688_b(p_184394_3_), p_184394_4_); ++ // TODO: check if negative scale is a thing ++ p_184394_2_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_184394_2_, p_184394_3_, p_184394_4_); + +- if (this.func_183005_a(itemcameratransforms.func_181688_b(p_184394_3_))) +- { +- GlStateManager.func_187407_a(GlStateManager.CullFace.FRONT); +- } +- + this.func_180454_a(p_184394_1_, p_184394_2_); + GlStateManager.func_187407_a(GlStateManager.CullFace.BACK); + GlStateManager.func_179121_F(); +@@ -314,7 +299,7 @@ + GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + this.func_180452_a(p_191962_2_, p_191962_3_, p_191962_4_.func_177556_c()); +- p_191962_4_.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GUI); ++ p_191962_4_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_191962_4_, ItemCameraTransforms.TransformType.GUI, false); + this.func_180454_a(p_191962_1_, p_191962_4_); + GlStateManager.func_179118_c(); + GlStateManager.func_179101_C(); +@@ -367,6 +352,7 @@ + return String.valueOf((Object)p_184391_2_.func_77973_b()); + } + }); ++ crashreportcategory.func_189529_a("Registry Name", () -> String.valueOf(p_184391_2_.func_77973_b().getRegistryName())); + crashreportcategory.func_189529_a("Item Aux", new ICrashReportDetail() + { + public String call() throws Exception +@@ -413,9 +399,12 @@ + p_180453_1_.func_175063_a(s, (float)(p_180453_3_ + 19 - 2 - p_180453_1_.func_78256_a(s)), (float)(p_180453_4_ + 6 + 3), 16777215); + GlStateManager.func_179145_e(); + GlStateManager.func_179126_j(); ++ // Fixes opaque cooldown overlay a bit lower ++ // TODO: check if enabled blending still screws things up down the line. ++ GlStateManager.func_179147_l(); + } + +- if (p_180453_2_.func_77951_h()) ++ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_)) + { + GlStateManager.func_179140_f(); + GlStateManager.func_179097_i(); +@@ -424,11 +413,10 @@ + GlStateManager.func_179084_k(); + Tessellator tessellator = Tessellator.func_178181_a(); + BufferBuilder bufferbuilder = tessellator.func_178180_c(); +- float f = (float)p_180453_2_.func_77952_i(); +- float f1 = (float)p_180453_2_.func_77958_k(); +- float f2 = Math.max(0.0F, (f1 - f) / f1); +- int i = Math.round(13.0F - f * 13.0F / f1); +- int j = MathHelper.func_181758_c(f2 / 3.0F, 1.0F, 1.0F); ++ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_); ++ int rgbfordisplay = p_180453_2_.func_77973_b().getRGBDurabilityForDisplay(p_180453_2_); ++ int i = Math.round(13.0F - (float)health * 13.0F); ++ int j = rgbfordisplay; + this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255); + this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255); + GlStateManager.func_179147_l(); +@@ -1099,6 +1087,7 @@ + this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.LOAD.func_185110_a(), "structure_block"); + this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.CORNER.func_185110_a(), "structure_block"); + this.func_175029_a(Blocks.field_185779_df, TileEntityStructure.Mode.DATA.func_185110_a(), "structure_block"); ++ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m); + } + + public void func_110549_a(IResourceManager p_110549_1_) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch new file mode 100644 index 000000000..f877af5ab --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch @@ -0,0 +1,57 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java +@@ -27,26 +27,8 @@ + int l = vertexformatelement.func_177369_e(); + bytebuffer.position(vertexformat.func_181720_d(j)); + +- switch (vertexformatelement$enumusage) +- { +- case POSITION: +- GlStateManager.func_187427_b(vertexformatelement.func_177370_d(), k, i, bytebuffer); +- GlStateManager.func_187410_q(32884); +- break; +- case UV: +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l); +- GlStateManager.func_187404_a(vertexformatelement.func_177370_d(), k, i, bytebuffer); +- GlStateManager.func_187410_q(32888); +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); +- break; +- case COLOR: +- GlStateManager.func_187400_c(vertexformatelement.func_177370_d(), k, i, bytebuffer); +- GlStateManager.func_187410_q(32886); +- break; +- case NORMAL: +- GlStateManager.func_187446_a(k, i, bytebuffer); +- GlStateManager.func_187410_q(32885); +- } ++ // moved to VertexFormatElement.preDraw ++ vertexformatelement.func_177375_c().preDraw(vertexformat, j, i, bytebuffer); + } + + GlStateManager.func_187439_f(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h()); +@@ -58,23 +40,8 @@ + VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.func_177375_c(); + int k1 = vertexformatelement1.func_177369_e(); + +- switch (vertexformatelement$enumusage1) +- { +- case POSITION: +- GlStateManager.func_187429_p(32884); +- break; +- case UV: +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + k1); +- GlStateManager.func_187429_p(32888); +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); +- break; +- case COLOR: +- GlStateManager.func_187429_p(32886); +- GlStateManager.func_179117_G(); +- break; +- case NORMAL: +- GlStateManager.func_187429_p(32885); +- } ++ // moved to VertexFormatElement.postDraw ++ vertexformatelement1.func_177375_c().postDraw(vertexformat, i1, i, bytebuffer); + } + } + diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch new file mode 100644 index 000000000..2348edf93 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch @@ -0,0 +1,54 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java +@@ -6,15 +6,26 @@ + import net.minecraftforge.fml.relauncher.SideOnly; + + @SideOnly(Side.CLIENT) +-public class BakedQuad ++public class BakedQuad implements net.minecraftforge.client.model.pipeline.IVertexProducer + { + protected final int[] field_178215_a; + protected final int field_178213_b; + protected final EnumFacing field_178214_c; + protected final TextureAtlasSprite field_187509_d; + ++ /** ++ * @deprecated Use constructor with the format argument. ++ */ ++ @Deprecated + public BakedQuad(int[] p_i46574_1_, int p_i46574_2_, EnumFacing p_i46574_3_, TextureAtlasSprite p_i46574_4_) + { ++ this(p_i46574_1_, p_i46574_2_, p_i46574_3_, p_i46574_4_, true, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b); ++ } ++ ++ public BakedQuad(int[] p_i46574_1_, int p_i46574_2_, EnumFacing p_i46574_3_, TextureAtlasSprite p_i46574_4_, boolean applyDiffuseLighting, net.minecraft.client.renderer.vertex.VertexFormat format) ++ { ++ this.format = format; ++ this.applyDiffuseLighting = applyDiffuseLighting; + this.field_178215_a = p_i46574_1_; + this.field_178213_b = p_i46574_2_; + this.field_178214_c = p_i46574_3_; +@@ -45,4 +56,23 @@ + { + return this.field_178214_c; + } ++ ++ protected final net.minecraft.client.renderer.vertex.VertexFormat format; ++ protected final boolean applyDiffuseLighting; ++ ++ @Override ++ public void pipe(net.minecraftforge.client.model.pipeline.IVertexConsumer consumer) ++ { ++ net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(consumer, this); ++ } ++ ++ public net.minecraft.client.renderer.vertex.VertexFormat getFormat() ++ { ++ return format; ++ } ++ ++ public boolean shouldApplyDiffuseLighting() ++ { ++ return applyDiffuseLighting; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch new file mode 100644 index 000000000..cd89a6f50 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java +@@ -12,7 +12,7 @@ + + public BakedQuadRetextured(BakedQuad p_i46217_1_, TextureAtlasSprite p_i46217_2_) + { +- super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a()); ++ super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a(), p_i46217_1_.applyDiffuseLighting, p_i46217_1_.format); + this.field_178218_d = p_i46217_2_; + this.func_178217_e(); + } +@@ -21,9 +21,16 @@ + { + for (int i = 0; i < 4; ++i) + { +- int j = 7 * i; +- this.field_178215_a[j + 4] = Float.floatToRawIntBits(this.field_178218_d.func_94214_a((double)this.field_187509_d.func_188537_a(Float.intBitsToFloat(this.field_178215_a[j + 4])))); +- this.field_178215_a[j + 4 + 1] = Float.floatToRawIntBits(this.field_178218_d.func_94207_b((double)this.field_187509_d.func_188536_b(Float.intBitsToFloat(this.field_178215_a[j + 4 + 1])))); ++ int j = format.func_181719_f() * i; ++ int uvIndex = format.func_177344_b(0) / 4; ++ this.field_178215_a[j + uvIndex] = Float.floatToRawIntBits(this.field_178218_d.func_94214_a((double)this.field_187509_d.func_188537_a(Float.intBitsToFloat(this.field_178215_a[j + uvIndex])))); ++ this.field_178215_a[j + uvIndex + 1] = Float.floatToRawIntBits(this.field_178218_d.func_94207_b((double)this.field_187509_d.func_188536_b(Float.intBitsToFloat(this.field_178215_a[j + uvIndex + 1])))); + } + } ++ ++ @Override ++ public TextureAtlasSprite func_187508_a() ++ { ++ return field_178218_d; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch new file mode 100644 index 000000000..dd3378717 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch @@ -0,0 +1,105 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java +@@ -49,14 +49,19 @@ + + public BakedQuad func_178414_a(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, ModelRotation p_178414_6_, @Nullable BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_) + { ++ return makeBakedQuad(p_178414_1_, p_178414_2_, p_178414_3_, p_178414_4_, p_178414_5_, (net.minecraftforge.common.model.ITransformation)p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_); ++ } ++ ++ public BakedQuad makeBakedQuad(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, net.minecraftforge.common.model.ITransformation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_) ++ { + BlockFaceUV blockfaceuv = p_178414_3_.field_178243_e; + + if (p_178414_8_) + { +- blockfaceuv = this.func_188010_a(p_178414_3_.field_178243_e, p_178414_5_, p_178414_6_); ++ blockfaceuv = net.minecraftforge.client.ForgeHooksClient.applyUVLock(p_178414_3_.field_178243_e, p_178414_5_, p_178414_6_); + } + +- int[] aint = this.func_188012_a(blockfaceuv, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_9_); ++ int[] aint = this.makeQuadVertexData(blockfaceuv, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, false); + EnumFacing enumfacing = func_178410_a(aint); + + if (p_178414_7_ == null) +@@ -64,7 +69,8 @@ + this.func_178408_a(aint, enumfacing); + } + +- return new BakedQuad(aint, p_178414_3_.field_178245_c, enumfacing, p_178414_4_); ++ net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing); ++ return new BakedQuad(aint, p_178414_3_.field_178245_c, enumfacing, p_178414_4_, p_178414_9_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b); + } + + private BlockFaceUV func_188010_a(BlockFaceUV p_188010_1_, EnumFacing p_188010_2_, ModelRotation p_188010_3_) +@@ -74,11 +80,16 @@ + + private int[] func_188012_a(BlockFaceUV p_188012_1_, TextureAtlasSprite p_188012_2_, EnumFacing p_188012_3_, float[] p_188012_4_, ModelRotation p_188012_5_, @Nullable BlockPartRotation p_188012_6_, boolean p_188012_7_) + { ++ return makeQuadVertexData(p_188012_1_, p_188012_2_, p_188012_3_, p_188012_4_, (net.minecraftforge.common.model.ITransformation)p_188012_5_, p_188012_6_, p_188012_7_); ++ } ++ ++ private int[] makeQuadVertexData(BlockFaceUV uvs, TextureAtlasSprite sprite, EnumFacing orientation, float[] p_188012_4_, net.minecraftforge.common.model.ITransformation rotationIn, BlockPartRotation partRotation, boolean shade) ++ { + int[] aint = new int[28]; + + for (int i = 0; i < 4; ++i) + { +- this.func_188015_a(aint, i, p_188012_3_, p_188012_1_, p_188012_4_, p_188012_2_, p_188012_5_, p_188012_6_, p_188012_7_); ++ this.fillVertexData(aint, i, orientation, uvs, p_188012_4_, sprite, rotationIn, partRotation, shade); + } + + return aint; +@@ -124,12 +135,17 @@ + + private void func_188015_a(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, ModelRotation p_188015_7_, @Nullable BlockPartRotation p_188015_8_, boolean p_188015_9_) + { +- EnumFacing enumfacing = p_188015_7_.func_177523_a(p_188015_3_); ++ fillVertexData(p_188015_1_, p_188015_2_, p_188015_3_, p_188015_4_, p_188015_5_, p_188015_6_, (net.minecraftforge.common.model.ITransformation)p_188015_7_, p_188015_8_, p_188015_9_); ++ } ++ ++ private void fillVertexData(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, net.minecraftforge.common.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_) ++ { ++ EnumFacing enumfacing = p_188015_7_.rotate(p_188015_3_); + int i = p_188015_9_ ? this.func_178413_a(enumfacing) : -1; + EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.func_179027_a(p_188015_3_).func_179025_a(p_188015_2_); + Vector3f vector3f = new Vector3f(p_188015_5_[enumfacedirection$vertexinformation.field_179184_a], p_188015_5_[enumfacedirection$vertexinformation.field_179182_b], p_188015_5_[enumfacedirection$vertexinformation.field_179183_c]); + this.func_178407_a(vector3f, p_188015_8_); +- int j = this.func_188011_a(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); ++ int j = this.rotateVertex(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); + this.func_178404_a(p_188015_1_, j, p_188015_2_, vector3f, i, p_188015_6_, p_188015_4_); + } + +@@ -140,8 +156,8 @@ + p_178404_1_[i + 1] = Float.floatToRawIntBits(p_178404_4_.y); + p_178404_1_[i + 2] = Float.floatToRawIntBits(p_178404_4_.z); + p_178404_1_[i + 3] = p_178404_5_; +- p_178404_1_[i + 4] = Float.floatToRawIntBits(p_178404_6_.func_94214_a((double)p_178404_7_.func_178348_a(p_178404_3_))); +- p_178404_1_[i + 4 + 1] = Float.floatToRawIntBits(p_178404_6_.func_94207_b((double)p_178404_7_.func_178346_b(p_178404_3_))); ++ p_178404_1_[i + 4] = Float.floatToRawIntBits(p_178404_6_.func_94214_a((double)p_178404_7_.func_178348_a(p_178404_3_) * .999 + p_178404_7_.func_178348_a((p_178404_3_ + 2) % 4) * .001)); ++ p_178404_1_[i + 4 + 1] = Float.floatToRawIntBits(p_178404_6_.func_94207_b((double)p_178404_7_.func_178346_b(p_178404_3_) * .999 + p_178404_7_.func_178346_b((p_178404_3_ + 2) % 4) * .001)); + } + + private void func_178407_a(Vector3f p_178407_1_, @Nullable BlockPartRotation p_178407_2_) +@@ -190,14 +206,19 @@ + + public int func_188011_a(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, ModelRotation p_188011_4_) + { ++ return rotateVertex(p_188011_1_, p_188011_2_, p_188011_3_, (net.minecraftforge.common.model.ITransformation)p_188011_4_); ++ } ++ ++ public int rotateVertex(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, net.minecraftforge.common.model.ITransformation p_188011_4_) ++ { + if (p_188011_4_ == ModelRotation.X0_Y0) + { + return p_188011_3_; + } + else + { +- this.func_178406_a(p_188011_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_188011_4_.func_177525_a(), new Vector3f(1.0F, 1.0F, 1.0F)); +- return p_188011_4_.func_177520_a(p_188011_2_, p_188011_3_); ++ net.minecraftforge.client.ForgeHooksClient.transform(p_188011_1_, p_188011_4_.getMatrix()); ++ return p_188011_4_.rotate(p_188011_2_, p_188011_3_); + } + } + diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch new file mode 100644 index 000000000..033f7d808 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch @@ -0,0 +1,22 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java +@@ -21,7 +21,18 @@ + + TextureAtlasSprite func_177554_e(); + +- ItemCameraTransforms func_177552_f(); ++ @Deprecated ++ default ItemCameraTransforms func_177552_f() { return ItemCameraTransforms.field_178357_a; } + + ItemOverrideList func_188617_f(); ++ ++ default boolean isAmbientOcclusion(IBlockState state) { return func_177555_b(); } ++ ++ /* ++ * Returns the pair of the model for the given perspective, and the matrix ++ * that should be applied to the GL state before rendering it (matrix may be null). ++ */ ++ default org.apache.commons.lang3.tuple.Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { ++ return net.minecraftforge.client.ForgeHooksClient.handlePerspective(this, cameraTransformType); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch new file mode 100644 index 000000000..74a4f9c04 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch @@ -0,0 +1,45 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java +@@ -12,6 +12,9 @@ + import net.minecraftforge.fml.relauncher.SideOnly; + import org.lwjgl.util.vector.Quaternion; + ++/* ++ * @deprecated use {@link net.minecraftforge.client.model.IPerspectiveAwareModel} instead ++ */ + @SideOnly(Side.CLIENT) + public class ItemCameraTransforms + { +@@ -39,6 +42,7 @@ + this(ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a, ItemTransformVec3f.field_178366_a); + } + ++ @Deprecated + public ItemCameraTransforms(ItemCameraTransforms p_i46443_1_) + { + this.field_188036_k = p_i46443_1_.field_188036_k; +@@ -51,6 +55,7 @@ + this.field_181700_p = p_i46443_1_.field_181700_p; + } + ++ @Deprecated + public ItemCameraTransforms(ItemTransformVec3f p_i46569_1_, ItemTransformVec3f p_i46569_2_, ItemTransformVec3f p_i46569_3_, ItemTransformVec3f p_i46569_4_, ItemTransformVec3f p_i46569_5_, ItemTransformVec3f p_i46569_6_, ItemTransformVec3f p_i46569_7_, ItemTransformVec3f p_i46569_8_) + { + this.field_188036_k = p_i46569_1_; +@@ -103,6 +108,7 @@ + return new Quaternion(f3 * f6 * f8 + f4 * f5 * f7, f4 * f5 * f8 - f3 * f6 * f7, f3 * f5 * f8 + f4 * f6 * f7, f4 * f6 * f8 - f3 * f5 * f7); + } + ++ @Deprecated + public ItemTransformVec3f func_181688_b(ItemCameraTransforms.TransformType p_181688_1_) + { + switch (p_181688_1_) +@@ -169,7 +175,7 @@ + } + + @SideOnly(Side.CLIENT) +- public static enum TransformType ++ public static enum TransformType implements net.minecraftforge.common.model.IModelPart + { + NONE, + THIRD_PERSON_LEFT_HAND, diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch new file mode 100644 index 000000000..e6690fb62 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch @@ -0,0 +1,33 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java +@@ -29,6 +29,7 @@ + } + + @Nullable ++ @Deprecated + public ResourceLocation func_188021_a(ItemStack p_188021_1_, @Nullable World p_188021_2_, @Nullable EntityLivingBase p_188021_3_) + { + if (!this.field_188023_b.isEmpty()) +@@ -44,4 +45,22 @@ + + return null; + } ++ ++ public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity) ++ { ++ if (!stack.func_190926_b() && stack.func_77973_b().func_185040_i()) ++ { ++ ResourceLocation location = func_188021_a(stack, world, entity); ++ if (location != null) ++ { ++ return net.minecraft.client.Minecraft.func_71410_x().func_175599_af().func_175037_a().func_178083_a().func_174953_a(net.minecraftforge.client.model.ModelLoader.getInventoryVariant(location.toString())); ++ } ++ } ++ return originalModel; ++ } ++ ++ public com.google.common.collect.ImmutableList getOverrides() ++ { ++ return com.google.common.collect.ImmutableList.copyOf(field_188023_b); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch new file mode 100644 index 000000000..174d76434 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java +@@ -13,9 +13,14 @@ + import net.minecraftforge.fml.relauncher.SideOnly; + import org.lwjgl.util.vector.Vector3f; + ++/* ++ * @deprecated use {@link net.minecraftforge.client.model.IModelState} and {@link net.minecraftforge.client.model.TRSRTransformation} ++ */ + @SideOnly(Side.CLIENT) +-public class ItemTransformVec3f ++@Deprecated ++public class ItemTransformVec3f implements net.minecraftforge.common.model.IModelState + { ++ public java.util.Optional apply(java.util.Optional part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(this, part); } + public static final ItemTransformVec3f field_178366_a = new ItemTransformVec3f(new Vector3f(), new Vector3f(), new Vector3f(1.0F, 1.0F, 1.0F)); + public final Vector3f field_178364_b; + public final Vector3f field_178365_c; diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch new file mode 100644 index 000000000..aaded845c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch @@ -0,0 +1,180 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java +@@ -103,6 +103,21 @@ + { + try + { ++ loadBlock(blockstatemapper, block, resourcelocation); ++ } ++ catch (Exception exception) ++ { ++ field_177603_c.warn((String)("Unable to load definition " + resourcelocation), (Throwable)exception); ++ } ++ } ++ } ++ } ++ ++ protected void loadBlock(BlockStateMapper blockstatemapper, Block block, final ResourceLocation resourcelocation) ++ { ++ { ++ { ++ { + ModelBlockDefinition modelblockdefinition = this.func_177586_a(resourcelocation); + Map map = blockstatemapper.func_188181_b(block); + +@@ -115,7 +130,6 @@ + if (collection1 == null) + { + collection1 = Lists.newArrayList(); +- this.field_188642_k.put(modelblockdefinition, collection1); + } + + collection1.addAll(Lists.newArrayList(Iterables.filter(collection, new Predicate() +@@ -125,6 +139,7 @@ + return resourcelocation.equals(p_apply_1_); + } + }))); ++ registerMultipartVariant(modelblockdefinition, collection1); + } + + for (Entry entry : map.entrySet()) +@@ -135,22 +150,18 @@ + { + try + { +- this.field_177612_i.put(modelresourcelocation, modelblockdefinition.func_188004_c(modelresourcelocation.func_177518_c())); ++ func_177569_a(modelblockdefinition, modelresourcelocation); + } + catch (RuntimeException var12) + { + if (!modelblockdefinition.func_188002_b()) + { +- field_177603_c.warn("Unable to load variant: {} from {}", modelresourcelocation.func_177518_c(), modelresourcelocation); ++ field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation, var12); + } + } + } + } + } +- catch (Exception exception) +- { +- field_177603_c.warn("Unable to load definition {}", resourcelocation, exception); +- } + } + } + } +@@ -228,7 +239,7 @@ + try + { + inputstream = p_188636_2_.func_110527_b(); +- lvt_4_1_ = ModelBlockDefinition.func_178331_a(new InputStreamReader(inputstream, StandardCharsets.UTF_8)); ++ lvt_4_1_ = ModelBlockDefinition.parseFromReader(new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_188636_1_); + } + catch (Exception exception) + { +@@ -394,6 +405,7 @@ + + protected void func_177592_e() + { ++ this.field_177613_u.clear(); // FML clear this to prevent double ups. + this.field_177613_u.put(Item.func_150898_a(Blocks.field_150348_b), Lists.newArrayList("stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth")); + this.field_177613_u.put(Item.func_150898_a(Blocks.field_150346_d), Lists.newArrayList("dirt", "coarse_dirt", "podzol")); + this.field_177613_u.put(Item.func_150898_a(Blocks.field_150344_f), Lists.newArrayList("oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks")); +@@ -441,6 +453,10 @@ + this.field_177613_u.put(Items.field_179570_aq, Lists.newArrayList("oak_door")); + this.field_177613_u.put(Items.field_151124_az, Lists.newArrayList("oak_boat")); + this.field_177613_u.put(Items.field_190929_cY, Lists.newArrayList("totem")); ++ for (Entry, Set> e : customVariantNames.entrySet()) ++ { ++ this.field_177613_u.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); ++ } + } + + protected List func_177596_a(Item p_177596_1_) +@@ -457,7 +473,7 @@ + + protected ResourceLocation func_177583_a(String p_177583_1_) + { +- ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_); ++ ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", "")); + return new ResourceLocation(resourcelocation.func_110624_b(), "item/" + resourcelocation.func_110623_a()); + } + +@@ -565,7 +581,7 @@ + for (Entry entry : this.field_177615_s.entrySet()) + { + ResourceLocation resourcelocation = entry.getValue(); +- ModelResourceLocation modelresourcelocation = new ModelResourceLocation(entry.getKey(), "inventory"); ++ ModelResourceLocation modelresourcelocation = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey()); + ModelBlock modelblock = this.field_177611_h.get(resourcelocation); + + if (modelblock != null && modelblock.func_178303_d()) +@@ -653,6 +669,11 @@ + @Nullable + private IBakedModel func_177578_a(ModelBlock p_177578_1_, ModelRotation p_177578_2_, boolean p_177578_3_) + { ++ return bakeModel(p_177578_1_, (net.minecraftforge.common.model.ITransformation)p_177578_2_, p_177578_3_); ++ } ++ ++ protected IBakedModel bakeModel(ModelBlock p_177578_1_, net.minecraftforge.common.model.ITransformation p_177578_2_, boolean p_177578_3_) ++ { + TextureAtlasSprite textureatlassprite = this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c("particle"))); + SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(p_177578_1_, p_177578_1_.func_187967_g())).func_177646_a(textureatlassprite); + +@@ -669,13 +690,13 @@ + BlockPartFace blockpartface = blockpart.field_178240_c.get(enumfacing); + TextureAtlasSprite textureatlassprite1 = this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c(blockpartface.field_178242_d))); + +- if (blockpartface.field_178244_b == null) ++ if (blockpartface.field_178244_b == null || !net.minecraftforge.common.model.TRSRTransformation.isInteger(p_177578_2_.getMatrix())) + { +- simplebakedmodel$builder.func_177648_a(this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); ++ simplebakedmodel$builder.func_177648_a(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); + } + else + { +- simplebakedmodel$builder.func_177650_a(p_177578_2_.func_177523_a(blockpartface.field_178244_b), this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); ++ simplebakedmodel$builder.func_177650_a(p_177578_2_.rotate(blockpartface.field_178244_b), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); + } + } + } +@@ -686,9 +707,14 @@ + + private BakedQuad func_177589_a(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 this.field_177607_l.func_178414_a(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e); ++ return makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, (net.minecraftforge.common.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.common.model.ITransformation p_177589_5_, boolean p_177589_6_) ++ { ++ return this.field_177607_l.makeBakedQuad(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e); ++ } ++ + private void func_177597_h() + { + this.func_177574_i(); +@@ -916,4 +942,23 @@ + field_177606_o.field_178317_b = "generation marker"; + field_177616_r.field_178317_b = "block entity marker"; + } ++ ++ protected void registerMultipartVariant(ModelBlockDefinition definition, Collection locations) ++ { ++ this.field_188642_k.put(definition, locations); ++ } ++ ++ private static Map, Set> customVariantNames = Maps.newHashMap(); ++ ++ public static void registerItemVariants(Item item, ResourceLocation... names) ++ { ++ if (!customVariantNames.containsKey(item.delegate)) ++ { ++ customVariantNames.put(item.delegate, Sets.newHashSet()); ++ } ++ for(ResourceLocation name : names) ++ { ++ customVariantNames.get(item.delegate).add(name.toString()); ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch new file mode 100644 index 000000000..31a21668b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java +@@ -32,11 +32,16 @@ + private final Map field_178332_b = Maps.newHashMap(); + private Multipart field_188005_c; + ++ @Deprecated + public static ModelBlockDefinition func_178331_a(Reader p_178331_0_) + { +- return (ModelBlockDefinition)JsonUtils.func_193839_a(field_178333_a, p_178331_0_, ModelBlockDefinition.class); ++ return parseFromReader(p_178331_0_, null); + } + ++ public static ModelBlockDefinition parseFromReader(Reader reader, net.minecraft.util.ResourceLocation location) { ++ return net.minecraftforge.client.model.BlockStateLoader.load(reader, location, field_178333_a); ++ } ++ + public ModelBlockDefinition(Map p_i46572_1_, Multipart p_i46572_2_) + { + this.field_188005_c = p_i46572_2_; diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch new file mode 100644 index 000000000..5b344f7a1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java +@@ -24,9 +24,10 @@ + + public void func_110549_a(IResourceManager p_110549_1_) + { +- ModelBakery modelbakery = new ModelBakery(p_110549_1_, this.field_174956_b, this.field_174957_c); ++ net.minecraftforge.client.model.ModelLoader modelbakery = new net.minecraftforge.client.model.ModelLoader(p_110549_1_, this.field_174956_b, this.field_174957_c); + this.field_174958_a = modelbakery.func_177570_a(); + this.field_174955_d = this.field_174958_a.func_82594_a(ModelBakery.field_177604_a); ++ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, modelbakery); + this.field_174957_c.func_178124_c(); + } + diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch new file mode 100644 index 000000000..bd20a3c06 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java +@@ -2,11 +2,8 @@ + + import java.util.Locale; + import net.minecraft.util.ResourceLocation; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + import org.apache.commons.lang3.StringUtils; + +-@SideOnly(Side.CLIENT) + public class ModelResourceLocation extends ResourceLocation + { + private final String field_177519_c; diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch new file mode 100644 index 000000000..9a07db1e7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/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.common.model.IModelState, net.minecraftforge.common.model.ITransformation + { + X0_Y0(0, 0), + X0_Y90(0, 90), +@@ -116,4 +116,9 @@ + field_177546_q.put(Integer.valueOf(modelrotation.field_177545_r), modelrotation); + } + } ++ ++ public java.util.Optional apply(java.util.Optional part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(this, part); } ++ public javax.vecmath.Matrix4f getMatrix() { return net.minecraftforge.common.model.TRSRTransformation.from(this).getMatrix(); } ++ public EnumFacing rotate(EnumFacing facing) { return func_177523_a(facing); } ++ public int rotate(EnumFacing facing, int vertexIndex) { return func_177520_a(facing, vertexIndex); } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java.patch new file mode 100644 index 000000000..85c04be1b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java +@@ -88,7 +88,7 @@ + + public Builder(IBlockState p_i46989_1_, IBakedModel p_i46989_2_, TextureAtlasSprite p_i46989_3_, BlockPos p_i46989_4_) + { +- this(p_i46989_2_.func_177555_b(), p_i46989_2_.func_177556_c(), p_i46989_2_.func_177552_f(), p_i46989_2_.func_188617_f()); ++ this(p_i46989_2_.isAmbientOcclusion(p_i46989_1_), p_i46989_2_.func_177556_c(), p_i46989_2_.func_177552_f(), p_i46989_2_.func_188617_f()); + this.field_177652_d = p_i46989_2_.func_177554_e(); + long i = MathHelper.func_180186_a(p_i46989_4_); + diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch new file mode 100644 index 000000000..8e59079cb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/Variant.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/Variant.java +@@ -12,7 +12,7 @@ + import net.minecraftforge.fml.relauncher.SideOnly; + + @SideOnly(Side.CLIENT) +-public class Variant ++public class Variant implements net.minecraftforge.client.model.ISmartVariant + { + private final ResourceLocation field_188050_a; + private final ModelRotation field_188051_b; +@@ -32,11 +32,17 @@ + return this.field_188050_a; + } + ++ @Deprecated + public ModelRotation func_188048_b() + { + return this.field_188051_b; + } + ++ public net.minecraftforge.common.model.IModelState getState() ++ { ++ return this.field_188051_b; ++ } ++ + public boolean func_188049_c() + { + return this.field_188052_c; +@@ -138,4 +144,9 @@ + } + } + } ++ ++ public net.minecraftforge.client.model.IModel process(net.minecraftforge.client.model.IModel base) ++ { ++ return base.uvlock(func_188049_c()); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java.patch new file mode 100644 index 000000000..aebad79fa --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java +@@ -41,6 +41,8 @@ + return this.field_177566_c.func_177555_b(); + } + ++ public boolean isAmbientOcclusion(IBlockState state) { return this.field_177566_c.isAmbientOcclusion(state); } ++ + public boolean func_177556_c() + { + return this.field_177566_c.func_177556_c(); diff --git a/patches_old/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch new file mode 100644 index 000000000..2090d9fc2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java +@@ -39,7 +39,7 @@ + } + else + { +- s = this.func_187490_a(this.field_178142_a, map); ++ s = String.format("%s:%s", Block.field_149771_c.func_177774_c(p_178132_1_.func_177230_c()).func_110624_b(), this.func_187490_a(this.field_178142_a, map)); + } + + if (this.field_178141_c != null) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch new file mode 100644 index 000000000..8297410b1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java +@@ -44,9 +44,15 @@ + + public ChunkRenderDispatcher() + { ++ this(-1); ++ } ++ ++ public ChunkRenderDispatcher(int countRenderBuilders) ++ { + int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760); + int j = Math.max(1, MathHelper.func_76125_a(Runtime.getRuntime().availableProcessors(), 1, i / 5)); +- this.field_188249_c = MathHelper.func_76125_a(j * 10, 1, i); ++ if(countRenderBuilders < 0) countRenderBuilders = MathHelper.func_76125_a(j * 10, 1, i); ++ this.field_188249_c = countRenderBuilders; + + if (j > 1) + { diff --git a/patches_old/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch new file mode 100644 index 000000000..8914328f4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -0,0 +1,80 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java +@@ -162,7 +162,7 @@ + lvt_9_1_.func_178606_a(blockpos$mutableblockpos); + } + +- if (block.func_149716_u()) ++ if (block.hasTileEntity(iblockstate)) + { + TileEntity tileentity = this.field_189564_r.func_190300_a(blockpos$mutableblockpos, Chunk.EnumCreateEntityType.CHECK); + +@@ -172,17 +172,19 @@ + + if (tileentityspecialrenderer != null) + { +- compiledchunk.func_178490_a(tileentity); + + if (tileentityspecialrenderer.func_188185_a(tileentity)) + { + lvt_10_1_.add(tileentity); + } ++ else compiledchunk.func_178490_a(tileentity); // FORGE: Fix MC-112730 + } + } + } + +- BlockRenderLayer blockrenderlayer1 = block.func_180664_k(); ++ for(BlockRenderLayer blockrenderlayer1 : BlockRenderLayer.values()) { ++ if(!block.canRenderInLayer(iblockstate, blockrenderlayer1)) continue; ++ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(blockrenderlayer1); + int j = blockrenderlayer1.ordinal(); + + if (block.func_176223_P().func_185901_i() != EnumBlockRenderType.INVISIBLE) +@@ -197,6 +199,8 @@ + + aboolean[j] |= blockrendererdispatcher.func_175018_a(iblockstate, blockpos$mutableblockpos, this.field_189564_r, bufferbuilder); + } ++ } ++ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null); + } + + for (BlockRenderLayer blockrenderlayer : BlockRenderLayer.values()) +@@ -278,7 +282,9 @@ + private void func_189563_q() + { + int i = 1; +- this.field_189564_r = new ChunkCache(this.field_178588_d, this.field_178586_f.func_177982_a(-1, -1, -1), this.field_178586_f.func_177982_a(16, 16, 16), 1); ++ ChunkCache cache = createRegionRenderCache(this.field_178588_d, this.field_178586_f.func_177982_a(-1, -1, -1), this.field_178586_f.func_177982_a(16, 16, 16), 1); ++ net.minecraftforge.client.MinecraftForgeClient.onRebuildChunk(this.field_178588_d, this.field_178586_f, cache); ++ this.field_189564_r = cache; + } + + @Nullable +@@ -427,6 +433,26 @@ + return this.field_178593_n && this.field_188284_q; + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * Creates a new RegionRenderCache instance.
++ * Extending classes can change the behavior of the cache, allowing to visually change ++ * blocks (schematics etc). ++ * ++ * @see RegionRenderCache ++ * @param world The world to cache. ++ * @param from The starting position of the chunk minus one on each axis. ++ * @param to The ending position of the chunk plus one on each axis. ++ * @param subtract Padding used internally by the RegionRenderCache constructor to make ++ * the cache a 20x20x20 cube, for a total of 8000 states in the cache. ++ * @return new RegionRenderCache instance ++ */ ++ protected ChunkCache createRegionRenderCache(World world, BlockPos from, BlockPos to, int subtract) ++ { ++ return new ChunkCache(world, from, to, subtract); ++ } ++ /* ========================================= FORGE END ======================================*/ ++ + public BlockPos func_181701_a(EnumFacing p_181701_1_) + { + return this.field_181702_p[p_181701_1_.ordinal()]; diff --git a/patches_old/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch new file mode 100644 index 000000000..2965f527f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch @@ -0,0 +1,47 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/color/BlockColors.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/color/BlockColors.java +@@ -27,7 +27,8 @@ + @SideOnly(Side.CLIENT) + public class BlockColors + { +- private final ObjectIntIdentityMap field_186725_a = new ObjectIntIdentityMap(32); ++ // FORGE: Use RegistryDelegates as non-Vanilla block ids are not constant ++ private final java.util.Map, IBlockColor> blockColorMap = com.google.common.collect.Maps.newHashMap(); + + public static BlockColors func_186723_a() + { +@@ -159,12 +160,13 @@ + return p_186720_2_ != null && p_186720_3_ != null ? 2129968 : 7455580; + } + }, Blocks.field_150392_bi); ++ net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(blockcolors); + return blockcolors; + } + + public int func_189991_a(IBlockState p_189991_1_, World p_189991_2_, BlockPos p_189991_3_) + { +- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Block.func_149682_b(p_189991_1_.func_177230_c())); ++ IBlockColor iblockcolor = this.blockColorMap.get(p_189991_1_.func_177230_c().delegate); + + if (iblockcolor != null) + { +@@ -179,7 +181,7 @@ + + public int func_186724_a(IBlockState p_186724_1_, @Nullable IBlockAccess p_186724_2_, @Nullable BlockPos p_186724_3_, int p_186724_4_) + { +- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Block.func_149682_b(p_186724_1_.func_177230_c())); ++ IBlockColor iblockcolor = this.blockColorMap.get(p_186724_1_.func_177230_c().delegate); + return iblockcolor == null ? -1 : iblockcolor.func_186720_a(p_186724_1_, p_186724_2_, p_186724_3_, p_186724_4_); + } + +@@ -187,7 +189,9 @@ + { + for (Block block : p_186722_2_) + { +- this.field_186725_a.func_148746_a(p_186722_1_, Block.func_149682_b(block)); ++ if (block == null) throw new IllegalArgumentException("Block registered to block color handler cannot be null!"); ++ if (block.getRegistryName() == null) throw new IllegalArgumentException("Block must be registered before assigning color handler."); ++ this.blockColorMap.put(block.delegate, p_186722_1_); + } + } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch new file mode 100644 index 000000000..c465eb3f2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch @@ -0,0 +1,49 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/color/ItemColors.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/color/ItemColors.java +@@ -26,7 +26,8 @@ + @SideOnly(Side.CLIENT) + public class ItemColors + { +- private final ObjectIntIdentityMap field_186732_a = new ObjectIntIdentityMap(32); ++ // FORGE: Use RegistryDelegates as non-Vanilla item ids are not constant ++ private final java.util.Map, IItemColor> itemColorMap = com.google.common.collect.Maps.newHashMap(); + + public static ItemColors func_186729_a(final BlockColors p_186729_0_) + { +@@ -137,12 +138,13 @@ + return p_186726_2_ == 0 ? -1 : ItemMap.func_190907_h(p_186726_1_); + } + }, Items.field_151098_aY); ++ net.minecraftforge.client.ForgeHooksClient.onItemColorsInit(itemcolors, p_186729_0_); + return itemcolors; + } + + public int func_186728_a(ItemStack p_186728_1_, int p_186728_2_) + { +- IItemColor iitemcolor = this.field_186732_a.func_148745_a(Item.field_150901_e.func_148757_b(p_186728_1_.func_77973_b())); ++ IItemColor iitemcolor = this.itemColorMap.get(p_186728_1_.func_77973_b().delegate); + return iitemcolor == null ? -1 : iitemcolor.func_186726_a(p_186728_1_, p_186728_2_); + } + +@@ -150,7 +152,9 @@ + { + for (Block block : p_186731_2_) + { +- this.field_186732_a.func_148746_a(p_186731_1_, Item.func_150891_b(Item.func_150898_a(block))); ++ if (block == null) throw new IllegalArgumentException("Block registered to item color handler cannot be null!"); ++ if (block.getRegistryName() == null) throw new IllegalArgumentException("Block must be registered before assigning color handler."); ++ this.itemColorMap.put(Item.func_150898_a(block).delegate, p_186731_1_); + } + } + +@@ -158,7 +162,9 @@ + { + for (Item item : p_186730_2_) + { +- this.field_186732_a.func_148746_a(p_186730_1_, Item.func_150891_b(item)); ++ if (item == null) throw new IllegalArgumentException("Item registered to item color handler cannot be null!"); ++ if (item.getRegistryName() == null) throw new IllegalArgumentException("Item must be registered before assigning color handler."); ++ this.itemColorMap.put(item.delegate, p_186730_1_); + } + } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch new file mode 100644 index 000000000..4bc9f7948 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch @@ -0,0 +1,86 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java +@@ -44,7 +44,7 @@ + boolean flag = p_177077_9_.func_177556_c(); + int i = this.func_177078_a(itemstack); + float f = 0.25F; +- float f1 = MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F; ++ float f1 = shouldBob() ? MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F : 0; + float f2 = p_177077_9_.func_177552_f().func_181688_b(ItemCameraTransforms.TransformType.GROUND).field_178363_d.y; + GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); + +@@ -104,16 +104,13 @@ + GlStateManager.func_179094_E(); + IBakedModel ibakedmodel = this.field_177080_a.func_184393_a(itemstack, p_76986_1_.field_70170_p, (EntityLivingBase)null); + int j = this.func_177077_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_9_, ibakedmodel); +- float f = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.x; +- float f1 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.y; +- float f2 = ibakedmodel.func_177552_f().field_181699_o.field_178363_d.z; + boolean flag1 = ibakedmodel.func_177556_c(); + + if (!flag1) + { +- float f3 = -0.0F * (float)(j - 1) * 0.5F * f; +- float f4 = -0.0F * (float)(j - 1) * 0.5F * f1; +- float f5 = -0.09375F * (float)(j - 1) * 0.5F * f2; ++ float f3 = -0.0F * (float)(j - 1) * 0.5F; ++ float f4 = -0.0F * (float)(j - 1) * 0.5F; ++ float f5 = -0.09375F * (float)(j - 1) * 0.5F; + GlStateManager.func_179109_b(f3, f4, f5); + } + +@@ -134,11 +131,11 @@ + float f7 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f9 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f6 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; +- GlStateManager.func_179109_b(f7, f9, f6); ++ GlStateManager.func_179109_b(shouldSpreadItems() ? f7 : 0, shouldSpreadItems() ? f9 : 0, f6); + } + +- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND); +- this.field_177080_a.func_180454_a(itemstack, ibakedmodel); ++ IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false); ++ this.field_177080_a.func_180454_a(itemstack, transformedModel); + GlStateManager.func_179121_F(); + } + else +@@ -152,10 +149,10 @@ + GlStateManager.func_179109_b(f8, f10, 0.0F); + } + +- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GROUND); +- this.field_177080_a.func_180454_a(itemstack, ibakedmodel); ++ IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND, false); ++ this.field_177080_a.func_180454_a(itemstack, transformedModel); + GlStateManager.func_179121_F(); +- GlStateManager.func_179109_b(0.0F * f, 0.0F * f1, 0.09375F * f2); ++ GlStateManager.func_179109_b(0.0F, 0.0F, 0.09375F); + } + } + +@@ -182,4 +179,25 @@ + { + return TextureMap.field_110575_b; + } ++ ++ /*==================================== FORGE START ===========================================*/ ++ ++ /** ++ * Items should spread out when rendered in 3d? ++ * @return ++ */ ++ public boolean shouldSpreadItems() ++ { ++ return true; ++ } ++ ++ /** ++ * Items should have a bob effect ++ * @return ++ */ ++ public boolean shouldBob() ++ { ++ return true; ++ } ++ /*==================================== FORGE END =============================================*/ + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch new file mode 100644 index 000000000..7ab7bcba8 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderFish.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderFish.java +@@ -75,7 +75,7 @@ + int k = entityplayer.func_184591_cq() == EnumHandSide.RIGHT ? 1 : -1; + ItemStack itemstack = entityplayer.func_184614_ca(); + +- if (itemstack.func_77973_b() != Items.field_151112_aM) ++ if (!(itemstack.func_77973_b() instanceof net.minecraft.item.ItemFishingRod)) + { + k = -k; + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch new file mode 100644 index 000000000..8b83223c0 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch @@ -0,0 +1,43 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java +@@ -49,7 +49,7 @@ + ModelManager modelmanager = blockrendererdispatcher.func_175023_a().func_178126_b(); + IBakedModel ibakedmodel; + +- if (p_76986_1_.func_82335_i().func_77973_b() == Items.field_151098_aY) ++ if (p_76986_1_.func_82335_i().func_77973_b() instanceof net.minecraft.item.ItemMap) + { + ibakedmodel = modelmanager.func_174953_a(this.field_177073_g); + } +@@ -96,10 +96,13 @@ + { + GlStateManager.func_179094_E(); + GlStateManager.func_179140_f(); +- boolean flag = itemstack.func_77973_b() == Items.field_151098_aY; ++ boolean flag = itemstack.func_77973_b() instanceof net.minecraft.item.ItemMap; + int i = flag ? p_82402_1_.func_82333_j() % 4 * 2 : p_82402_1_.func_82333_j(); + GlStateManager.func_179114_b((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F); + ++ net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this); ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) ++ { + if (flag) + { + this.field_76990_c.field_78724_e.func_110577_a(field_110789_a); +@@ -107,7 +110,7 @@ + float f = 0.0078125F; + GlStateManager.func_179152_a(0.0078125F, 0.0078125F, 0.0078125F); + GlStateManager.func_179109_b(-64.0F, -64.0F, 0.0F); +- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, p_82402_1_.field_70170_p); ++ MapData mapdata = ((net.minecraft.item.ItemMap) itemstack.func_77973_b()).func_77873_a(itemstack, p_82402_1_.field_70170_p); + GlStateManager.func_179109_b(0.0F, 0.0F, -1.0F); + + if (mapdata != null) +@@ -124,6 +127,7 @@ + RenderHelper.func_74518_a(); + GlStateManager.func_179099_b(); + } ++ } + + GlStateManager.func_179145_e(); + GlStateManager.func_179121_F(); diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch new file mode 100644 index 000000000..cdefb47ee --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch @@ -0,0 +1,72 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java +@@ -32,6 +32,9 @@ + protected List> field_177097_h = Lists.>newArrayList(); + protected boolean field_188323_j; + ++ public static float NAME_TAG_RANGE = 64.0f; ++ public static float NAME_TAG_RANGE_SNEAK = 32.0f; ++ + public RenderLivingBase(RenderManager p_i46156_1_, ModelBase p_i46156_2_, float p_i46156_3_) + { + super(p_i46156_1_); +@@ -72,10 +75,12 @@ + + public void func_76986_a(T p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return; + GlStateManager.func_179094_E(); + GlStateManager.func_179129_p(); + this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_); +- this.field_77045_g.field_78093_q = p_76986_1_.func_184218_aH(); ++ boolean shouldSit = p_76986_1_.func_184218_aH() && (p_76986_1_.func_184187_bx() != null && p_76986_1_.func_184187_bx().shouldRiderSit()); ++ this.field_77045_g.field_78093_q = shouldSit; + this.field_77045_g.field_78091_s = p_76986_1_.func_70631_g_(); + + try +@@ -84,7 +89,7 @@ + float f1 = this.func_77034_a(p_76986_1_.field_70758_at, p_76986_1_.field_70759_as, p_76986_9_); + float f2 = f1 - f; + +- if (p_76986_1_.func_184218_aH() && p_76986_1_.func_184187_bx() instanceof EntityLivingBase) ++ if (shouldSit && p_76986_1_.func_184187_bx() instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)p_76986_1_.func_184187_bx(); + f = this.func_77034_a(entitylivingbase.field_70760_ar, entitylivingbase.field_70761_aq, p_76986_9_); +@@ -133,6 +138,7 @@ + { + f5 = 1.0F; + } ++ f2 = f1 - f; // Forge: Fix MC-1207 + } + + GlStateManager.func_179141_d(); +@@ -194,6 +200,7 @@ + GlStateManager.func_179089_o(); + GlStateManager.func_179121_F(); + super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_)); + } + + public float func_188322_c(T p_188322_1_, float p_188322_2_) +@@ -454,10 +461,11 @@ + + public void func_177067_a(T p_177067_1_, double p_177067_2_, double p_177067_4_, double p_177067_6_) + { ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_))) return; + if (this.func_177070_b(p_177067_1_)) + { + double d0 = p_177067_1_.func_70068_e(this.field_76990_c.field_78734_h); +- float f = p_177067_1_.func_70093_af() ? 32.0F : 64.0F; ++ float f = p_177067_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; + + if (d0 < (double)(f * f)) + { +@@ -466,6 +474,7 @@ + this.func_188296_a(p_177067_1_, p_177067_2_, p_177067_4_, p_177067_6_, s, d0); + } + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_)); + } + + protected boolean func_177070_b(T p_177070_1_) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch new file mode 100644 index 000000000..c7756b937 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -0,0 +1,28 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +@@ -227,8 +227,13 @@ + this.field_178637_m = new RenderPlayer(this); + this.field_178636_l.put("default", this.field_178637_m); + this.field_178636_l.put("slim", new RenderPlayer(this, true)); ++ net.minecraftforge.fml.client.registry.RenderingRegistry.loadEntityRenderers(this, this.field_78729_o); + } + ++ public Map getSkinMap() { ++ return (Map) java.util.Collections.unmodifiableMap(field_178636_l); ++ } ++ + public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) + { + this.field_78725_b = p_178628_1_; +@@ -277,9 +282,9 @@ + IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_)); + Block block = iblockstate.func_177230_c(); + +- if (block == Blocks.field_150324_C) ++ if (block.isBed(iblockstate, p_180597_1_, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_)) + { +- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b(); ++ int i = block.getBedDirection(iblockstate, p_180597_1_, new BlockPos(p_180597_3_)).func_176736_b(); + this.field_78735_i = (float)(i * 90 + 180); + this.field_78732_j = 0.0F; + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch new file mode 100644 index 000000000..90797a0b8 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java +@@ -56,6 +56,7 @@ + + public void func_76986_a(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return; + if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_78734_h == p_76986_1_) + { + double d0 = p_76986_4_; +@@ -70,6 +71,7 @@ + super.func_76986_a(p_76986_1_, p_76986_2_, d0, p_76986_6_, p_76986_8_, p_76986_9_); + GlStateManager.func_187440_b(GlStateManager.Profile.PLAYER_SKIN); + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_)); + } + + private void func_177137_d(AbstractClientPlayer p_177137_1_) +@@ -128,6 +130,11 @@ + { + modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK; + } ++ // FORGE: fix MC-88356 allow offhand to use bow and arrow animation ++ else if (enumaction1 == EnumAction.BOW) ++ { ++ modelbiped$armpose1 = ModelBiped.ArmPose.BOW_AND_ARROW; ++ } + } + } + diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch new file mode 100644 index 000000000..15ef1c6f5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java +@@ -31,22 +31,7 @@ + + protected ResourceLocation func_110775_a(EntityVillager p_110775_1_) + { +- switch (p_110775_1_.func_70946_n()) +- { +- case 0: +- return field_110904_g; +- case 1: +- return field_110908_h; +- case 2: +- return field_110907_k; +- case 3: +- return field_110905_l; +- case 4: +- return field_110906_m; +- case 5: +- default: +- return field_110903_f; +- } ++ return p_110775_1_.getProfessionForge().getSkin(); + } + + protected void func_77041_b(EntityVillager p_77041_1_, float p_77041_2_) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch new file mode 100644 index 000000000..4f8f88bb7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java +@@ -25,6 +25,7 @@ + + protected ResourceLocation func_110775_a(EntityZombieVillager p_110775_1_) + { ++ if (true) return p_110775_1_.getForgeProfession().getZombieSkin(); + switch (p_110775_1_.func_190736_dl()) + { + case 0: diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch new file mode 100644 index 000000000..628916d7b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch @@ -0,0 +1,107 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java +@@ -58,31 +58,29 @@ + if (itemarmor.func_185083_B_() == p_188361_9_) + { + T t = this.func_188360_a(p_188361_9_); ++ t = getArmorModelHook(p_188361_1_, itemstack, p_188361_9_, t); + t.func_178686_a(this.field_177190_a.func_177087_b()); + t.func_78086_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_4_); + this.func_188359_a(t, p_188361_9_); + boolean flag = this.func_188363_b(p_188361_9_); +- this.field_177190_a.func_110776_a(this.func_177181_a(itemarmor, flag)); ++ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, null)); + +- switch (itemarmor.func_82812_d()) + { +- case LEATHER: ++ if (itemarmor.hasOverlay(itemstack)) // Allow this for anything, not only cloth ++ { + int i = itemarmor.func_82814_b(itemstack); + float f = (float)(i >> 16 & 255) / 255.0F; + float f1 = (float)(i >> 8 & 255) / 255.0F; + float f2 = (float)(i & 255) / 255.0F; + GlStateManager.func_179131_c(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e); + t.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_); +- this.field_177190_a.func_110776_a(this.func_177178_a(itemarmor, flag, "overlay")); +- case CHAIN: +- case IRON: +- case GOLD: +- case DIAMOND: ++ this.field_177190_a.func_110776_a(this.getArmorResource(p_188361_1_, itemstack, p_188361_9_, "overlay")); ++ } ++ { // Non-colored + GlStateManager.func_179131_c(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e); + t.func_78088_a(p_188361_1_, p_188361_2_, p_188361_3_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_); +- default: +- +- if (!this.field_177193_i && itemstack.func_77948_v()) ++ } // Default ++ if (!this.field_177193_i && itemstack.func_77962_s()) + { + func_188364_a(this.field_177190_a, p_188361_1_, t, p_188361_2_, p_188361_3_, p_188361_4_, p_188361_5_, p_188361_6_, p_188361_7_, p_188361_8_); + } +@@ -139,11 +137,13 @@ + Minecraft.func_71410_x().field_71460_t.func_191514_d(false); + } + ++ @Deprecated //Use the more sensitive version getArmorResource below + private ResourceLocation func_177181_a(ItemArmor p_177181_1_, boolean p_177181_2_) + { + return this.func_177178_a(p_177181_1_, p_177181_2_, (String)null); + } + ++ @Deprecated //Use the more sensitive version getArmorResource below + private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) + { + String s = String.format("textures/models/armor/%s_layer_%d%s.png", p_177178_1_.func_82812_d().func_179242_c(), p_177178_2_ ? 2 : 1, p_177178_3_ == null ? "" : String.format("_%s", p_177178_3_)); +@@ -161,4 +161,49 @@ + protected abstract void func_177177_a(); + + protected abstract void func_188359_a(T p_188359_1_, EntityEquipmentSlot p_188359_2_); ++ ++ /*=================================== FORGE START =========================================*/ ++ ++ /** ++ * Hook to allow item-sensitive armor model. for LayerBipedArmor. ++ */ ++ protected T getArmorModelHook(EntityLivingBase entity, ItemStack itemStack, EntityEquipmentSlot 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, EntityEquipmentSlot slot, String type) ++ { ++ ItemArmor item = (ItemArmor)stack.func_77973_b(); ++ String texture = item.func_82812_d().func_179242_c(); ++ 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, (func_188363_b(slot) ? 2 : 1), type == null ? "" : String.format("_%s", type)); ++ ++ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type); ++ ResourceLocation resourcelocation = (ResourceLocation)field_177191_j.get(s1); ++ ++ if (resourcelocation == null) ++ { ++ resourcelocation = new ResourceLocation(s1); ++ field_177191_j.put(s1, resourcelocation); ++ } ++ ++ return resourcelocation; ++ } ++ /*=================================== FORGE END ===========================================*/ + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch new file mode 100644 index 000000000..b5b72c195 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java +@@ -51,4 +51,10 @@ + { + p_177194_1_.func_178719_a(false); + } ++ ++ @Override ++ protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, EntityEquipmentSlot slot, ModelBiped model) ++ { ++ return net.minecraftforge.client.ForgeHooksClient.getArmorModel(entity, itemStack, slot, model); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch new file mode 100644 index 000000000..2f0324798 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java +@@ -49,13 +49,13 @@ + if (!p_188358_2_.func_190926_b()) + { + GlStateManager.func_179094_E(); +- this.func_191361_a(p_188358_4_); + + if (p_188358_1_.func_70093_af()) + { + GlStateManager.func_179109_b(0.0F, 0.2F, 0.0F); + } +- ++ // Forge: moved this call down, fixes incorrect offset while sneaking. ++ this.func_191361_a(p_188358_4_); + GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F); + boolean flag = p_188358_4_ == EnumHandSide.LEFT; diff --git a/patches_old/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch new file mode 100644 index 000000000..63bf1bd46 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -0,0 +1,45 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java +@@ -56,18 +56,24 @@ + { + Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]); + Arrays.sort((Object[])astitcher$holder); ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", astitcher$holder.length); + + for (Stitcher.Holder stitcher$holder : astitcher$holder) + { ++ bar.step(stitcher$holder.func_98150_a().func_94215_i()); + if (!this.func_94310_b(stitcher$holder)) + { + String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", stitcher$holder.func_98150_a().func_94215_i(), stitcher$holder.func_98150_a().func_94211_a(), stitcher$holder.func_98150_a().func_94216_b()); ++ net.minecraftforge.fml.common.FMLLog.log.info(s); ++ for (Stitcher.Holder h : astitcher$holder) ++ net.minecraftforge.fml.common.FMLLog.log.info(" {}", h); + throw new StitcherException(stitcher$holder, s); + } + } + + this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c); + this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d); ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); + } + + public List func_94309_g() +@@ -148,7 +154,7 @@ + + if (flag3 ^ flag4) + { +- flag = flag3; ++ flag = !flag3 && flag1; //Forge: Fix stitcher not expanding entire height before growing width, and {potentially} growing larger then the max size. + } + else + { +@@ -240,7 +246,7 @@ + + public String toString() + { +- return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + '}'; ++ return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + ", name=" + this.field_98151_a.func_94215_i() + '}'; + } + + public int compareTo(Stitcher.Holder p_compareTo_1_) diff --git a/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch new file mode 100644 index 000000000..c74308c78 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -0,0 +1,59 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java +@@ -50,12 +50,10 @@ + this.field_110975_c = p_110971_3_; + this.field_110974_d = p_110971_4_; + this.field_130222_e = p_110971_5_; +- float f = (float)(0.009999999776482582D / (double)p_110971_1_); +- float f1 = (float)(0.009999999776482582D / (double)p_110971_2_); +- this.field_110979_l = (float)p_110971_3_ / (float)((double)p_110971_1_) + f; +- this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)((double)p_110971_1_) - f; +- this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_ + f1; +- this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_ - f1; ++ this.field_110979_l = (float)p_110971_3_ / (float)p_110971_1_; ++ this.field_110980_m = (float)(p_110971_3_ + this.field_130223_c) / (float)p_110971_1_; ++ this.field_110977_n = (float)p_110971_4_ / (float)p_110971_2_; ++ this.field_110978_o = (float)(p_110971_4_ + this.field_130224_d) / (float)p_110971_2_; + } + + public void func_94217_a(TextureAtlasSprite p_94217_1_) +@@ -398,4 +396,39 @@ + { + return "TextureAtlasSprite{name='" + this.field_110984_i + '\'' + ", frameCount=" + this.field_110976_a.size() + ", rotated=" + this.field_130222_e + ", x=" + this.field_110975_c + ", y=" + this.field_110974_d + ", height=" + this.field_130224_d + ", width=" + this.field_130223_c + ", u0=" + this.field_110979_l + ", u1=" + this.field_110980_m + ", v0=" + this.field_110977_n + ", v1=" + this.field_110978_o + '}'; + } ++ ++ /*===================================== FORGE START =====================================*/ ++ /** ++ * The result of this function determines is the below 'load' function is called, and the ++ * default vanilla loading code is bypassed completely. ++ * @param manager Main resource manager ++ * @param location File resource location ++ * @return True to use your own custom load code and bypass vanilla loading. ++ */ ++ public boolean hasCustomLoader(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location) ++ { ++ return false; ++ } ++ ++ /** ++ * Load the specified resource as this sprite's data. ++ * Returning false from this function will prevent this icon from being stitched onto the master texture. ++ * @param manager Main resource manager ++ * @param location File resource location ++ * @param textureGetter accessor for dependencies. All of them will be loaded before this one ++ * @return False to prevent this Icon from being stitched ++ */ ++ public boolean load(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location, java.util.function.Function textureGetter) ++ { ++ return true; ++ } ++ ++ /** ++ * @return all textures that should be loaded before this texture. ++ */ ++ public java.util.Collection getDependencies() { ++ return com.google.common.collect.ImmutableList.of(); ++ } ++ ++ /*===================================== FORGE END ======================================*/ + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch new file mode 100644 index 000000000..8112c0668 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureManager.java +@@ -137,17 +137,20 @@ + + if (itextureobject != null) + { ++ this.field_110585_a.remove(p_147645_1_); // Forge: fix MC-98707 + TextureUtil.func_147942_a(itextureobject.func_110552_b()); + } + } + + public void func_110549_a(IResourceManager p_110549_1_) + { ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Reloading Texture Manager", this.field_110585_a.keySet().size(), true); + Iterator> iterator = this.field_110585_a.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); ++ bar.step(entry.getKey().toString()); + ITextureObject itextureobject = entry.getValue(); + + if (itextureobject == TextureUtil.field_111001_a) +@@ -159,5 +162,6 @@ + this.func_110579_a(entry.getKey(), itextureobject); + } + } ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); + } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch new file mode 100644 index 000000000..d58b4ea3c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -0,0 +1,246 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java +@@ -45,6 +45,16 @@ + + public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_) + { ++ this(p_i46100_1_, p_i46100_2_, false); ++ } ++ ++ public TextureMap(String basePathIn, boolean skipFirst) ++ { ++ this(basePathIn, null, skipFirst); ++ } ++ ++ public TextureMap(String p_i46100_1_, @Nullable ITextureMapPopulator p_i46100_2_, boolean skipFirst) ++ { + this.field_94258_i = Lists.newArrayList(); + this.field_110574_e = Maps.newHashMap(); + this.field_94252_e = Maps.newHashMap(); +@@ -74,6 +84,7 @@ + public void func_174943_a(IResourceManager p_174943_1_, ITextureMapPopulator p_174943_2_) + { + this.field_110574_e.clear(); ++ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this); + p_174943_2_.func_177059_a(this); + this.func_110569_e(); + this.func_147631_c(); +@@ -88,13 +99,55 @@ + this.field_94258_i.clear(); + int j = Integer.MAX_VALUE; + int k = 1 << this.field_147636_j; ++ net.minecraftforge.fml.common.FMLLog.log.info("Max texture size: {}", i); ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", this.field_110574_e.size()); ++ loadedSprites.clear(); + +- for (Entry entry : this.field_110574_e.entrySet()) ++ for (Entry entry : Maps.newHashMap(this.field_110574_e).entrySet()) + { +- TextureAtlasSprite textureatlassprite = entry.getValue(); +- ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite); +- IResource iresource = null; ++ final ResourceLocation location = new ResourceLocation(entry.getKey()); ++ bar.step(location.toString()); ++ j = loadTexture(stitcher, p_110571_1_, location, entry.getValue(), bar, j, k); ++ } ++ finishLoading(stitcher, bar, j, k); ++ } + ++ private int loadTexture(Stitcher stitcher, IResourceManager p_110571_1_, ResourceLocation location, TextureAtlasSprite textureatlassprite, net.minecraftforge.fml.common.ProgressManager.ProgressBar bar, int j, int k) ++ { ++ if (loadedSprites.contains(location)) { ++ return j; ++ } ++ ResourceLocation resourcelocation = this.func_184396_a(textureatlassprite); ++ IResource iresource = null; ++ ++ for(ResourceLocation loading : loadingSprites) ++ { ++ if(location.equals(loading)) ++ { ++ final String error = "circular model dependencies, stack: [" + com.google.common.base.Joiner.on(", ").join(loadingSprites) + "]"; ++ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation, error); ++ } ++ } ++ loadingSprites.addLast(location); ++ try ++ { ++ for (ResourceLocation dependency : textureatlassprite.getDependencies()) ++ { ++ if (!field_110574_e.containsKey(dependency.toString())) ++ { ++ func_174942_a(dependency); ++ } ++ TextureAtlasSprite depSprite = field_110574_e.get(dependency.toString()); ++ j = loadTexture(stitcher, p_110571_1_, dependency, depSprite, bar, j, k); ++ } ++ if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation)) ++ { ++ if (textureatlassprite.load(p_110571_1_, resourcelocation, l -> field_110574_e.get(l.toString()))) ++ { ++ return j; ++ } ++ } ++ else + try + { + PngSizeInfo pngsizeinfo = PngSizeInfo.func_188532_a(p_110571_1_.func_110536_a(resourcelocation)); +@@ -104,13 +157,13 @@ + } + catch (RuntimeException runtimeexception) + { +- field_147635_d.error("Unable to parse metadata from {}", resourcelocation, runtimeexception); +- continue; ++ net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation, runtimeexception.getMessage()); ++ return j; + } + catch (IOException ioexception) + { +- field_147635_d.error("Using missing texture, unable to load {}", resourcelocation, ioexception); +- continue; ++ net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation); ++ return j; + } + finally + { +@@ -122,16 +175,28 @@ + + if (j1 < k) + { +- field_147635_d.warn("Texture {} with size {}x{} limits mip level from {} to {}", resourcelocation, Integer.valueOf(textureatlassprite.func_94211_a()), Integer.valueOf(textureatlassprite.func_94216_b()), Integer.valueOf(MathHelper.func_151239_c(k)), Integer.valueOf(MathHelper.func_151239_c(j1))); +- k = j1; ++ // FORGE: do not lower the mipmap level, just log the problematic textures ++ field_147635_d.warn("Texture {} with size {}x{} will have visual artifacts at mip level {}, it can only support level {}. Please report to the mod author that the texture should be some multiple of 16x16.", resourcelocation, Integer.valueOf(textureatlassprite.func_94211_a()), Integer.valueOf(textureatlassprite.func_94216_b()), Integer.valueOf(MathHelper.func_151239_c(k)), Integer.valueOf(MathHelper.func_151239_c(j1))); + } + ++ if (func_184397_a(p_110571_1_, textureatlassprite)) + stitcher.func_110934_a(textureatlassprite); ++ return j; + } ++ finally ++ { ++ loadingSprites.removeLast(); ++ loadedSprites.add(location); ++ } ++ } + ++ private void finishLoading(Stitcher stitcher, net.minecraftforge.fml.common.ProgressManager.ProgressBar bar, int j, int k) ++ { ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); + int l = Math.min(j, k); + int i1 = MathHelper.func_151239_c(l); + ++ if (false) // FORGE: do not lower the mipmap level + if (i1 < this.field_147636_j) + { + field_147635_d.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", this.field_94254_c, Integer.valueOf(this.field_147636_j), Integer.valueOf(i1), Integer.valueOf(l)); +@@ -140,9 +205,11 @@ + + this.field_94249_f.func_147963_d(this.field_147636_j); + stitcher.func_110934_a(this.field_94249_f); ++ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture creation", 2); + + try + { ++ bar.step("Stitching"); + stitcher.func_94305_f(); + } + catch (StitcherException stitcherexception) +@@ -151,12 +218,16 @@ + } + + field_147635_d.info("Created: {}x{} {}-atlas", Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c); ++ bar.step("Allocating GL texture"); + TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b()); + Map map = Maps.newHashMap(this.field_110574_e); + ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); ++ bar = net.minecraftforge.fml.common.ProgressManager.push("Texture mipmap and upload", stitcher.func_94309_g().size()); ++ + for (TextureAtlasSprite textureatlassprite1 : stitcher.func_94309_g()) + { +- if (textureatlassprite1 == this.field_94249_f || this.func_184397_a(p_110571_1_, textureatlassprite1)) ++ bar.step(textureatlassprite1.func_94215_i()); + { + String s = textureatlassprite1.func_94215_i(); + map.remove(s); +@@ -186,6 +257,8 @@ + { + textureatlassprite2.func_94217_a(this.field_94249_f); + } ++ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this); ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); + } + + private boolean func_184397_a(IResourceManager p_184397_1_, final TextureAtlasSprite p_184397_2_) +@@ -195,7 +268,7 @@ + label62: + { + boolean flag; +- ++ if (p_184397_2_.hasCustomLoader(p_184397_1_, resourcelocation)) break label62; + try + { + iresource = p_184397_1_.func_110536_a(resourcelocation); +@@ -292,7 +365,7 @@ + } + else + { +- TextureAtlasSprite textureatlassprite = this.field_110574_e.get(p_174942_1_); ++ TextureAtlasSprite textureatlassprite = this.field_110574_e.get(p_174942_1_.toString()); + + if (textureatlassprite == null) + { +@@ -318,4 +391,52 @@ + { + return this.field_94249_f; + } ++ ++ //=================================================================================================== ++ // Forge Start ++ //=================================================================================================== ++ ++ private final java.util.Deque loadingSprites = new java.util.ArrayDeque<>(); ++ private final java.util.Set loadedSprites = new java.util.HashSet<>(); ++ ++ /** ++ * Grabs the registered entry for the specified name, returning null if there was not a entry. ++ * Opposed to registerIcon, this will not instantiate the entry, useful to test if a mapping exists. ++ * ++ * @param name The name of the entry to find ++ * @return The registered entry, null if nothing was registered. ++ */ ++ @Nullable ++ public TextureAtlasSprite getTextureExtry(String name) ++ { ++ return field_110574_e.get(name); ++ } ++ ++ /** ++ * Adds a texture registry entry to this map for the specified name if one does not already exist. ++ * Returns false if the map already contains a entry for the specified name. ++ * ++ * @param entry Entry instance ++ * @return True if the entry was added to the map, false otherwise. ++ */ ++ public boolean setTextureEntry(TextureAtlasSprite entry) ++ { ++ String name = entry.func_94215_i(); ++ if (!field_110574_e.containsKey(name)) ++ { ++ field_110574_e.put(name, entry); ++ return true; ++ } ++ return false; ++ } ++ ++ public String getBasePath() ++ { ++ return field_94254_c; ++ } ++ ++ public int getMipmapLevels() ++ { ++ return field_147636_j; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch new file mode 100644 index 000000000..1c5abc42e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java +@@ -83,6 +83,7 @@ + int[] aint1 = aint[l1 - 1]; + int[] aint2 = new int[aint1.length >> 2]; + int j = p_147949_1_ >> l1; ++ if (j > 0) { // FORGE: forcing higher mipmap levels on odd textures needs this check + int k = aint2.length / j; + int l = j << 1; + +@@ -94,6 +95,7 @@ + aint2[i1 + j1 * j] = func_147943_a(aint1[k1 + 0], aint1[k1 + 1], aint1[k1 + 0 + l], aint1[k1 + 1 + l], flag); + } + } ++ } // end if (j > 0) + + aint[l1] = aint2; + } +@@ -168,6 +170,7 @@ + for (int i = 0; i < p_147955_0_.length; ++i) + { + int[] aint = p_147955_0_[i]; ++ if ((p_147955_1_ >> i <= 0) || (p_147955_2_ >> i <= 0)) break; + func_147947_a(i, aint, p_147955_1_ >> i, p_147955_2_ >> i, p_147955_3_ >> i, p_147955_4_ >> i, p_147955_5_, p_147955_6_, p_147955_0_.length > 1); + } + } +@@ -202,9 +205,11 @@ + + public static void func_180600_a(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_) + { ++ synchronized (net.minecraftforge.fml.client.SplashProgress.class) ++ { + func_147942_a(p_180600_0_); + func_94277_a(p_180600_0_); +- ++ } + if (p_180600_1_ >= 0) + { + GlStateManager.func_187421_b(3553, 33085, p_180600_1_); diff --git a/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch new file mode 100644 index 000000000..526faae0d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java +@@ -118,6 +118,7 @@ + { + TileEntityRendererDispatcher.field_147556_a.func_192855_a(field_191274_b[BlockShulkerBox.func_190955_b(item).func_176765_a()], 0.0D, 0.0D, 0.0D, 0.0F, p_192838_2_); + } ++ else if (Block.func_149634_a(item) != Blocks.field_150486_ae) net.minecraftforge.client.ForgeHooksClient.renderTileItem(p_192838_1_.func_77973_b(), p_192838_1_.func_77960_j()); + else + { + TileEntityRendererDispatcher.field_147556_a.func_192855_a(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F, p_192838_2_); diff --git a/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch new file mode 100644 index 000000000..48dd4c3a5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java +@@ -23,10 +23,11 @@ + @SideOnly(Side.CLIENT) + public class TileEntityPistonRenderer extends TileEntitySpecialRenderer + { +- private final BlockRendererDispatcher field_178462_c = Minecraft.func_71410_x().func_175602_ab(); ++ private BlockRendererDispatcher field_178462_c; + + public void func_192841_a(TileEntityPiston p_192841_1_, double p_192841_2_, double p_192841_4_, double p_192841_6_, float p_192841_8_, int p_192841_9_, float p_192841_10_) + { ++ if (field_178462_c == null) field_178462_c = Minecraft.func_71410_x().func_175602_ab(); //Forge: Delay this from constructor to allow us to change it later + BlockPos blockpos = p_192841_1_.func_174877_v(); + IBlockState iblockstate = p_192841_1_.func_174927_b(); + Block block = iblockstate.func_177230_c(); diff --git a/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch new file mode 100644 index 000000000..aaf1f72f6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch @@ -0,0 +1,91 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java +@@ -92,7 +92,7 @@ + @Nullable + public TileEntitySpecialRenderer func_147547_b(@Nullable TileEntity p_147547_1_) + { +- return p_147547_1_ == null ? null : this.func_147546_a(p_147547_1_.getClass()); ++ return p_147547_1_ == null || p_147547_1_.func_145837_r() ? null : this.func_147546_a(p_147547_1_.getClass()); // Forge: fix MC-123363 + } + + public void func_190056_a(World p_190056_1_, TextureManager p_190056_2_, FontRenderer p_190056_3_, Entity p_190056_4_, RayTraceResult p_190056_5_, float p_190056_6_) +@@ -117,12 +117,15 @@ + { + if (p_180546_1_.func_145835_a(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_180546_1_.func_145833_n()) + { ++ if(!drawingBatch || !p_180546_1_.hasFastRenderer()) ++ { + RenderHelper.func_74519_b(); + int i = this.field_147550_f.func_175626_b(p_180546_1_.func_174877_v(), 0); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j, (float)k); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); ++ } + BlockPos blockpos = p_180546_1_.func_174877_v(); + this.func_192854_a(p_180546_1_, (double)blockpos.func_177958_n() - field_147554_b, (double)blockpos.func_177956_o() - field_147555_c, (double)blockpos.func_177952_p() - field_147552_d, p_180546_2_, p_180546_3_, 1.0F); + } +@@ -146,6 +149,9 @@ + { + try + { ++ if(drawingBatch && p_192854_1_.hasFastRenderer()) ++ tileentityspecialrenderer.renderTileEntityFast(p_192854_1_, p_192854_2_, p_192854_4_, p_192854_6_, p_192854_8_, p_192854_9_, p_192854_10_, batchBuffer.func_178180_c()); ++ else + tileentityspecialrenderer.func_192841_a(p_192854_1_, p_192854_2_, p_192854_4_, p_192854_6_, p_192854_8_, p_192854_9_, p_192854_10_); + } + catch (Throwable throwable) +@@ -172,4 +178,53 @@ + { + return this.field_147557_n; + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * Buffer used for batched TESRs ++ */ ++ private net.minecraft.client.renderer.Tessellator batchBuffer = new net.minecraft.client.renderer.Tessellator(0x200000); ++ private boolean drawingBatch = false; ++ ++ /** ++ * Prepare for a batched TESR rendering. ++ * You probably shouldn't call this manually. ++ */ ++ public void preDrawBatch() ++ { ++ batchBuffer.func_178180_c().func_181668_a(org.lwjgl.opengl.GL11.GL_QUADS, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176600_a); ++ drawingBatch = true; ++ } ++ ++ /** ++ * Render all TESRs batched so far. ++ * You probably shouldn't call this manually. ++ */ ++ public void drawBatch(int pass) ++ { ++ field_147553_e.func_110577_a(net.minecraft.client.renderer.texture.TextureMap.field_110575_b); ++ net.minecraft.client.renderer.RenderHelper.func_74518_a(); ++ GlStateManager.func_179112_b(org.lwjgl.opengl.GL11.GL_SRC_ALPHA, org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA); ++ GlStateManager.func_179147_l(); ++ GlStateManager.func_179129_p(); ++ ++ if (net.minecraft.client.Minecraft.func_71379_u()) ++ { ++ GlStateManager.func_179103_j(org.lwjgl.opengl.GL11.GL_SMOOTH); ++ } ++ else ++ { ++ GlStateManager.func_179103_j(org.lwjgl.opengl.GL11.GL_FLAT); ++ } ++ ++ if(pass > 0) ++ { ++ net.minecraft.util.math.Vec3d cameraPos = net.minecraft.client.renderer.ActiveRenderInfo.getCameraPosition(); ++ batchBuffer.func_178180_c().func_181674_a((float)cameraPos.field_72450_a, (float)cameraPos.field_72448_b, (float)cameraPos.field_72449_c); ++ } ++ batchBuffer.func_78381_a(); ++ ++ net.minecraft.client.renderer.RenderHelper.func_74519_b(); ++ drawingBatch = false; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch new file mode 100644 index 000000000..471c25f00 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java +@@ -77,6 +77,8 @@ + return false; + } + ++ public void renderTileEntityFast(T te, double x, double y, double z, float partialTicks, int destroyStage, float partial, net.minecraft.client.renderer.BufferBuilder buffer) {} ++ + protected void func_190052_a(T p_190052_1_, String p_190052_2_, double p_190052_3_, double p_190052_5_, double p_190052_7_, int p_190052_9_) + { + Entity entity = this.field_147501_a.field_147551_g; diff --git a/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch new file mode 100644 index 000000000..e80c6739d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch @@ -0,0 +1,38 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java +@@ -17,6 +17,7 @@ + private int field_177354_e; + private final List field_177351_f; + private int field_177352_g; ++ private int hashCode; + + public VertexFormat(VertexFormat p_i46097_1_) + { +@@ -47,6 +48,7 @@ + this.field_177351_f.clear(); + this.field_177352_g = -1; + this.field_177353_d = 0; ++ this.hashCode = 0; + } + + @SuppressWarnings("incomplete-switch") +@@ -75,6 +77,7 @@ + } + + this.field_177353_d += p_181721_1_.func_177368_f(); ++ this.hashCode = 0; + return this; + } + } +@@ -204,9 +207,11 @@ + + public int hashCode() + { ++ if (this.hashCode != 0) return this.hashCode; + int i = this.field_177355_b.hashCode(); + i = 31 * i + this.field_177356_c.hashCode(); + i = 31 * i + this.field_177353_d; ++ this.hashCode = i; + return i; + } + } diff --git a/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch b/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch new file mode 100644 index 000000000..7638560c2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java +@@ -158,10 +158,17 @@ + NORMAL("Normal"), + COLOR("Vertex Color"), + UV("UV"), ++ // As of 1.8.8 - unused in vanilla; use GENERIC for now ++ @Deprecated + MATRIX("Bone Matrix"), ++ @Deprecated + BLEND_WEIGHT("Blend Weight"), +- PADDING("Padding"); ++ PADDING("Padding"), ++ GENERIC("Generic"); + ++ public void preDraw(VertexFormat format, int element, int stride, java.nio.ByteBuffer buffer) { net.minecraftforge.client.ForgeHooksClient.preDraw(this, format, element, stride, buffer); } ++ public void postDraw(VertexFormat format, int element, int stride, java.nio.ByteBuffer buffer) { net.minecraftforge.client.ForgeHooksClient.postDraw(this, format, element, stride, buffer); } ++ + private final String field_177392_h; + + private EnumUsage(String p_i46094_3_) diff --git a/patches_old/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch b/patches_old/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch new file mode 100644 index 000000000..94b4d3486 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/FallbackResourceManager.java ++++ ../src-work/minecraft/net/minecraft/client/resources/FallbackResourceManager.java +@@ -69,6 +69,7 @@ + throw new FileNotFoundException(p_110536_1_.toString()); + } + ++ @SuppressWarnings("resource") + protected InputStream func_177245_a(ResourceLocation p_177245_1_, IResourcePack p_177245_2_) throws IOException + { + InputStream inputstream = p_177245_2_.func_110590_a(p_177245_1_); diff --git a/patches_old/minecraft/net/minecraft/client/resources/IResourceManagerReloadListener.java.patch b/patches_old/minecraft/net/minecraft/client/resources/IResourceManagerReloadListener.java.patch new file mode 100644 index 000000000..770d1713a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/resources/IResourceManagerReloadListener.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/IResourceManagerReloadListener.java ++++ ../src-work/minecraft/net/minecraft/client/resources/IResourceManagerReloadListener.java +@@ -3,6 +3,11 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + ++/** ++ * @deprecated Forge: {@link net.minecraftforge.client.resource.ISelectiveResourceReloadListener}, which selectively allows ++ * individual resource types being reloaded should rather be used where possible. ++ */ ++@Deprecated + @SideOnly(Side.CLIENT) + public interface IResourceManagerReloadListener + { diff --git a/patches_old/minecraft/net/minecraft/client/resources/Language.java.patch b/patches_old/minecraft/net/minecraft/client/resources/Language.java.patch new file mode 100644 index 000000000..12666ca32 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/resources/Language.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/Language.java ++++ ../src-work/minecraft/net/minecraft/client/resources/Language.java +@@ -17,6 +17,12 @@ + this.field_135037_b = p_i1303_2_; + this.field_135038_c = p_i1303_3_; + this.field_135036_d = p_i1303_4_; ++ String[] splitLangCode = field_135039_a.split("_", 2); ++ if (splitLangCode.length == 1) { // Vanilla has some languages without underscores ++ this.javaLocale = new java.util.Locale(field_135039_a); ++ } else { ++ this.javaLocale = new java.util.Locale(splitLangCode[0], splitLangCode[1]); ++ } + } + + public String func_135034_a() +@@ -55,4 +61,8 @@ + { + return this.field_135039_a.compareTo(p_compareTo_1_.field_135039_a); + } ++ ++ // Forge: add access to Locale so modders can create correct string and number formatters ++ private final java.util.Locale javaLocale; ++ public java.util.Locale getJavaLocale() { return javaLocale; } + } diff --git a/patches_old/minecraft/net/minecraft/client/resources/Locale.java.patch b/patches_old/minecraft/net/minecraft/client/resources/Locale.java.patch new file mode 100644 index 000000000..3d878a45a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/resources/Locale.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/Locale.java ++++ ../src-work/minecraft/net/minecraft/client/resources/Locale.java +@@ -95,6 +95,8 @@ + + private void func_135021_a(InputStream p_135021_1_) throws IOException + { ++ p_135021_1_ = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(field_135032_a, p_135021_1_); ++ if (p_135021_1_ == null) return; + for (String s : IOUtils.readLines(p_135021_1_, StandardCharsets.UTF_8)) + { + if (!s.isEmpty() && s.charAt(0) != '#') diff --git a/patches_old/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch b/patches_old/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch new file mode 100644 index 000000000..042964f53 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java ++++ ../src-work/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java +@@ -92,6 +92,7 @@ + + public void func_110541_a(List p_110541_1_) + { ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Loading Resources", p_110541_1_.size()+1, true); + this.func_110543_a(); + field_147967_a.info("Reloading ResourceManager: {}", (Object)field_130074_a.join(Iterables.transform(p_110541_1_, new Function() + { +@@ -103,23 +104,33 @@ + + for (IResourcePack iresourcepack : p_110541_1_) + { ++ resReload.step(iresourcepack.func_130077_b()); + this.func_110545_a(iresourcepack); + } + ++ resReload.step("Reloading listeners"); + this.func_110544_b(); ++ net.minecraftforge.fml.common.ProgressManager.pop(resReload); + } + + public void func_110542_a(IResourceManagerReloadListener p_110542_1_) + { ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Loading Resource", 1); ++ resReload.step(p_110542_1_.getClass()); + this.field_110546_b.add(p_110542_1_); + p_110542_1_.func_110549_a(this); ++ net.minecraftforge.fml.common.ProgressManager.pop(resReload); + } + + private void func_110544_b() + { ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Reloading", this.field_110546_b.size()); + for (IResourceManagerReloadListener iresourcemanagerreloadlistener : this.field_110546_b) + { ++ resReload.step(iresourcemanagerreloadlistener.getClass()); ++ if (!net.minecraftforge.client.ForgeHooksClient.shouldUseVanillaReloadableListener(iresourcemanagerreloadlistener)) continue; // Forge: Selective reloading for vanilla listeners + iresourcemanagerreloadlistener.func_110549_a(this); + } ++ net.minecraftforge.fml.common.ProgressManager.pop(resReload); + } + } diff --git a/patches_old/minecraft/net/minecraft/client/shader/Framebuffer.java.patch b/patches_old/minecraft/net/minecraft/client/shader/Framebuffer.java.patch new file mode 100644 index 000000000..8bcdddcc2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/shader/Framebuffer.java.patch @@ -0,0 +1,57 @@ +--- ../src-base/minecraft/net/minecraft/client/shader/Framebuffer.java ++++ ../src-work/minecraft/net/minecraft/client/shader/Framebuffer.java +@@ -118,8 +118,17 @@ + if (this.field_147619_e) + { + OpenGlHelper.func_153176_h(OpenGlHelper.field_153199_f, this.field_147624_h); ++ if (!this.stencilEnabled) ++ { + OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, 33190, this.field_147622_a, this.field_147620_b); + OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, OpenGlHelper.field_153201_h, OpenGlHelper.field_153199_f, this.field_147624_h); ++ } ++ else ++ { ++ OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.field_147622_a, this.field_147620_b); ++ OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.field_147624_h); ++ OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.field_147624_h); ++ } + } + + this.func_147614_f(); +@@ -279,4 +288,36 @@ + GlStateManager.func_179086_m(i); + this.func_147609_e(); + } ++ ++ /*================================ FORGE START ================================================*/ ++ private boolean stencilEnabled = false; ++ /** ++ * Attempts to enabled 8 bits of stencil buffer on this FrameBuffer. ++ * Modders must call this directly to set things up. ++ * This is to prevent the default cause where graphics cards do not support stencil bits. ++ * Modders should check the below 'isStencilEnabled' to check if another modder has already enabled them. ++ * ++ * Note: ++ * As of now the only thing that is checked is if FBOs are supported entirely, in the future ++ * we may expand to check for errors. ++ * ++ * @return True if the FBO was re-initialized with stencil bits. ++ */ ++ public boolean enableStencil() ++ { ++ if (!OpenGlHelper.func_148822_b()) return false; ++ stencilEnabled = true; ++ this.func_147613_a(field_147621_c, field_147618_d); ++ return true; //TODO: Find a way to detect if this failed? ++ } ++ ++ /** ++ * Returns wither or not this FBO has been successfully initialized with stencil bits. ++ * If not, and a modder wishes it to be, they must call enableStencil. ++ */ ++ public boolean isStencilEnabled() ++ { ++ return this.stencilEnabled; ++ } ++ /*================================ FORGE END ================================================*/ + } diff --git a/patches_old/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch b/patches_old/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch new file mode 100644 index 000000000..3941a0d28 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/shader/ShaderGroup.java ++++ ../src-work/minecraft/net/minecraft/client/shader/ShaderGroup.java +@@ -179,7 +179,8 @@ + + if (framebuffer2 == null) + { +- ResourceLocation resourcelocation = new ResourceLocation("textures/effect/" + s3 + ".png"); ++ String[] rl = ResourceLocation.func_177516_a(s3); ++ ResourceLocation resourcelocation = new ResourceLocation(rl[0], "textures/effect/" + rl[1] + ".png"); + IResource iresource = null; + + try diff --git a/patches_old/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch b/patches_old/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch new file mode 100644 index 000000000..48459f74a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/shader/ShaderLoader.java ++++ ../src-work/minecraft/net/minecraft/client/shader/ShaderLoader.java +@@ -60,7 +60,8 @@ + + if (shaderloader == null) + { +- ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + p_148057_2_ + p_148057_1_.func_148063_b()); ++ String[] rl = ResourceLocation.func_177516_a(p_148057_2_); ++ ResourceLocation resourcelocation = new ResourceLocation(rl[0], "shaders/program/" + rl[1] + p_148057_1_.func_148063_b()); + IResource iresource = p_148057_0_.func_110536_a(resourcelocation); + + try diff --git a/patches_old/minecraft/net/minecraft/client/shader/ShaderManager.java.patch b/patches_old/minecraft/net/minecraft/client/shader/ShaderManager.java.patch new file mode 100644 index 000000000..9f8592046 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/shader/ShaderManager.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/shader/ShaderManager.java ++++ ../src-work/minecraft/net/minecraft/client/shader/ShaderManager.java +@@ -54,7 +54,8 @@ + public ShaderManager(IResourceManager p_i45087_1_, String p_i45087_2_) throws JsonException, IOException + { + JsonParser jsonparser = new JsonParser(); +- ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + p_i45087_2_ + ".json"); ++ String[] rl = ResourceLocation.func_177516_a(p_i45087_2_); ++ ResourceLocation resourcelocation = new ResourceLocation(rl[0], "shaders/program/" + rl[1] + ".json"); + this.field_148007_m = p_i45087_2_; + IResource iresource = null; + diff --git a/patches_old/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch b/patches_old/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch new file mode 100644 index 000000000..883654d35 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/client/util/RecipeBookClient.java ++++ ../src-work/minecraft/net/minecraft/client/util/RecipeBookClient.java +@@ -54,6 +54,14 @@ + + static + { ++ rebuildTable(); ++ } ++ ++ public static void rebuildTable() ++ { ++ field_194086_e.clear(); ++ field_194087_f.clear(); ++ + Table table = HashBasedTable.create(); + + for (IRecipe irecipe : CraftingManager.field_193380_a) diff --git a/patches_old/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch b/patches_old/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch new file mode 100644 index 000000000..0aeb3beb1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/util/RecipeItemHelper.java ++++ ../src-work/minecraft/net/minecraft/client/util/RecipeItemHelper.java +@@ -24,10 +24,15 @@ + + public void func_194112_a(ItemStack p_194112_1_) + { ++ this.accountStack(p_194112_1_, -1); ++ } ++ ++ public void accountStack(ItemStack p_194112_1_, int forceCount) ++ { + if (!p_194112_1_.func_190926_b() && !p_194112_1_.func_77951_h() && !p_194112_1_.func_77948_v() && !p_194112_1_.func_82837_s()) + { + int i = func_194113_b(p_194112_1_); +- int j = p_194112_1_.func_190916_E(); ++ int j = forceCount == -1 ? p_194112_1_.func_190916_E() : forceCount; + this.func_194117_b(i, j); + } + } diff --git a/patches_old/minecraft/net/minecraft/command/CommandBase.java.patch b/patches_old/minecraft/net/minecraft/command/CommandBase.java.patch new file mode 100644 index 000000000..1962ddd75 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/command/CommandBase.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/command/CommandBase.java ++++ ../src-work/minecraft/net/minecraft/command/CommandBase.java +@@ -393,7 +393,7 @@ + itextcomponent.func_150258_a(" "); + } + +- ITextComponent itextcomponent1 = new TextComponentString(p_147176_1_[i]); ++ ITextComponent itextcomponent1 = net.minecraftforge.common.ForgeHooks.newChatWithLinks(p_147176_1_[i]); // Forge: links for messages + + if (p_147176_3_) + { diff --git a/patches_old/minecraft/net/minecraft/command/CommandFill.java.patch b/patches_old/minecraft/net/minecraft/command/CommandFill.java.patch new file mode 100644 index 000000000..cec0241ec --- /dev/null +++ b/patches_old/minecraft/net/minecraft/command/CommandFill.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/command/CommandFill.java ++++ ../src-work/minecraft/net/minecraft/command/CommandFill.java +@@ -82,7 +82,7 @@ + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + +- if (p_184881_3_.length >= 10 && block.func_149716_u()) ++ if (p_184881_3_.length >= 10 && block.hasTileEntity(iblockstate)) + { + String s = func_180529_a(p_184881_3_, 9); + +@@ -123,7 +123,7 @@ + continue; + } + } +- else if ("replace".equals(p_184881_3_[8]) && !block.func_149716_u() && p_184881_3_.length > 9) ++ else if ("replace".equals(p_184881_3_[8]) && !block.hasTileEntity(iblockstate) && p_184881_3_.length > 9) + { + Block block1 = CommandBase.func_147180_g(p_184881_2_, p_184881_3_[9]); + diff --git a/patches_old/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches_old/minecraft/net/minecraft/command/CommandHandler.java.patch new file mode 100644 index 000000000..de6db71b3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/command/CommandHandler.java ++++ ../src-work/minecraft/net/minecraft/command/CommandHandler.java +@@ -50,6 +50,17 @@ + } + else if (icommand.func_184882_a(this.func_184879_a(), p_71556_1_)) + { ++ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(icommand, p_71556_1_, astring); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) ++ { ++ if (event.getException() != null) ++ { ++ com.google.common.base.Throwables.throwIfUnchecked(event.getException()); ++ } ++ return 1; ++ } ++ if (event.getParameters() != null) astring = event.getParameters(); ++ + if (j > -1) + { + List list = EntitySelector.func_179656_b(p_71556_1_, astring[j], Entity.class); diff --git a/patches_old/minecraft/net/minecraft/command/EntitySelector.java.patch b/patches_old/minecraft/net/minecraft/command/EntitySelector.java.patch new file mode 100644 index 000000000..dd80d47d1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/command/EntitySelector.java.patch @@ -0,0 +1,46 @@ +--- ../src-base/minecraft/net/minecraft/command/EntitySelector.java ++++ ../src-work/minecraft/net/minecraft/command/EntitySelector.java +@@ -121,6 +121,11 @@ + + public static List func_179656_b(ICommandSender p_179656_0_, String p_179656_1_, Class p_179656_2_) throws CommandException + { ++ return net.minecraftforge.common.command.SelectorHandlerManager.matchEntities(p_179656_0_, p_179656_1_, p_179656_2_); ++ } ++ ++ public static List matchEntitiesDefault(ICommandSender p_179656_0_, String p_179656_1_, Class p_179656_2_) throws CommandException ++ { + Matcher matcher = field_82389_a.matcher(p_179656_1_); + + if (matcher.matches() && p_179656_0_.func_70003_b(1, "@")) +@@ -153,6 +158,7 @@ + list2.addAll(func_184951_f(map)); + list2.addAll(func_180698_a(map, vec3d)); + list2.addAll(func_179662_g(map)); ++ list2.addAll(net.minecraftforge.fml.common.registry.GameRegistry.createEntitySelectors(map, s, p_179656_0_, vec3d)); + + if ("s".equalsIgnoreCase(s)) + { +@@ -786,6 +792,11 @@ + + public static boolean func_82377_a(String p_82377_0_) throws CommandException + { ++ return net.minecraftforge.common.command.SelectorHandlerManager.matchesMultiplePlayers(p_82377_0_); ++ } ++ ++ public static boolean matchesMultiplePlayersDefault(String p_82377_0_) throws CommandException ++ { + Matcher matcher = field_82389_a.matcher(p_82377_0_); + + if (!matcher.matches()) +@@ -803,6 +814,11 @@ + + public static boolean func_82378_b(String p_82378_0_) + { ++ return net.minecraftforge.common.command.SelectorHandlerManager.isSelector(p_82378_0_); ++ } ++ ++ public static boolean isSelectorDefault(String p_82378_0_) ++ { + return field_82389_a.matcher(p_82378_0_).matches(); + } + diff --git a/patches_old/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch b/patches_old/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch new file mode 100644 index 000000000..64017a5bc --- /dev/null +++ b/patches_old/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/command/server/CommandSetBlock.java ++++ ../src-work/minecraft/net/minecraft/command/server/CommandSetBlock.java +@@ -70,7 +70,7 @@ + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + +- if (p_184881_3_.length >= 7 && block.func_149716_u()) ++ if (p_184881_3_.length >= 7 && block.hasTileEntity(iblockstate)) + { + String s = func_180529_a(p_184881_3_, 6); + diff --git a/patches_old/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches_old/minecraft/net/minecraft/enchantment/Enchantment.java.patch new file mode 100644 index 000000000..63b50dc7d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -0,0 +1,50 @@ +--- ../src-base/minecraft/net/minecraft/enchantment/Enchantment.java ++++ ../src-work/minecraft/net/minecraft/enchantment/Enchantment.java +@@ -14,9 +14,9 @@ + import net.minecraft.util.text.TextFormatting; + import net.minecraft.util.text.translation.I18n; + +-public abstract class Enchantment ++public abstract class Enchantment extends net.minecraftforge.registries.IForgeRegistryEntry.Impl + { +- public static final RegistryNamespaced field_185264_b = new RegistryNamespaced(); ++ public static final RegistryNamespaced field_185264_b = net.minecraftforge.registries.GameData.getWrapper(Enchantment.class); + private final EntityEquipmentSlot[] field_185263_a; + private final Enchantment.Rarity field_77333_a; + @Nullable +@@ -134,7 +134,7 @@ + + public boolean func_92089_a(ItemStack p_92089_1_) + { +- return this.field_77351_y.func_77557_a(p_92089_1_.func_77973_b()); ++ return canApplyAtEnchantingTable(p_92089_1_); + } + + public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) +@@ -155,6 +155,26 @@ + return false; + } + ++ /** ++ * 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 stack.func_77973_b().canApplyAtEnchantingTable(stack, this); ++ } ++ ++ /** ++ * Is this enchantment allowed to be enchanted on books via Enchantment Table ++ * @return false to disable the vanilla feature ++ */ ++ public boolean isAllowedOnBooks() ++ { ++ return true; ++ } ++ + public static void func_185257_f() + { + EntityEquipmentSlot[] aentityequipmentslot = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET}; diff --git a/patches_old/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch b/patches_old/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch new file mode 100644 index 000000000..f60bac684 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java ++++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java +@@ -59,7 +59,7 @@ + { + IBlockState iblockstate1 = p_185266_1_.func_180495_p(blockpos$mutableblockpos1); + +- if (iblockstate1.func_185904_a() == Material.field_151586_h && ((Integer)iblockstate1.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0 && p_185266_1_.func_190527_a(Blocks.field_185778_de, blockpos$mutableblockpos1, false, EnumFacing.DOWN, (Entity)null)) ++ if (iblockstate1.func_185904_a() == Material.field_151586_h && (iblockstate1.func_177230_c() == net.minecraft.init.Blocks.field_150355_j || iblockstate1.func_177230_c() == net.minecraft.init.Blocks.field_150358_i) && ((Integer)iblockstate1.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0 && p_185266_1_.func_190527_a(Blocks.field_185778_de, blockpos$mutableblockpos1, false, EnumFacing.DOWN, (Entity)null)) + { + p_185266_1_.func_175656_a(blockpos$mutableblockpos1, Blocks.field_185778_de.func_176223_P()); + p_185266_1_.func_175684_a(blockpos$mutableblockpos1.func_185334_h(), Blocks.field_185778_de, MathHelper.func_76136_a(p_185266_0_.func_70681_au(), 60, 120)); diff --git a/patches_old/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches_old/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch new file mode 100644 index 000000000..ba0514750 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -0,0 +1,57 @@ +--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java ++++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +@@ -140,6 +140,7 @@ + field_77520_b.field_77497_a = 0; + field_77520_b.field_77496_b = p_77508_1_; + func_77516_a(field_77520_b, p_77508_0_); ++ field_77520_b.field_77496_b = null; //Forge Fix memory leaks: https://bugs.mojang.com/browse/MC-128547 + return field_77520_b.field_77497_a; + } + +@@ -171,6 +172,9 @@ + { + func_77518_a(field_151388_d, p_151384_0_.func_184614_ca()); + } ++ ++ field_151388_d.field_151363_b = null; //Forge Fix memory leaks: https://bugs.mojang.com/browse/MC-128547 ++ field_151388_d.field_151364_a = null; + } + + public static void func_151385_b(EntityLivingBase p_151385_0_, Entity p_151385_1_) +@@ -187,6 +191,9 @@ + { + func_77518_a(field_151389_e, p_151385_0_.func_184614_ca()); + } ++ ++ field_151389_e.field_151366_a = null; //Forge Fix memory leaks: https://bugs.mojang.com/browse/MC-128547 ++ field_151389_e.field_151365_b = null; + } + + public static int func_185284_a(Enchantment p_185284_0_, EntityLivingBase p_185284_1_) +@@ -302,7 +309,7 @@ + public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) + { + Item item = p_77514_3_.func_77973_b(); +- int i = item.func_77619_b(); ++ int i = item.getItemEnchantability(p_77514_3_); + + if (i <= 0) + { +@@ -357,7 +364,7 @@ + { + List list = Lists.newArrayList(); + Item item = p_77513_1_.func_77973_b(); +- int i = item.func_77619_b(); ++ int i = item.getItemEnchantability(p_77513_1_); + + if (i <= 0) + { +@@ -413,7 +420,7 @@ + + for (Enchantment enchantment : Enchantment.field_185264_b) + { +- if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.field_77351_y.func_77557_a(item) || flag)) ++ if ((!enchantment.func_185261_e() || p_185291_2_) && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) + { + for (int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) + { diff --git a/patches_old/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch b/patches_old/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch new file mode 100644 index 000000000..821c4f1a5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch @@ -0,0 +1,43 @@ +--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentThorns.java ++++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentThorns.java +@@ -51,12 +51,12 @@ + + if (!itemstack.func_190926_b()) + { +- itemstack.func_77972_a(3, p_151367_1_); ++ damageArmor(itemstack, 3, p_151367_1_); + } + } + else if (!itemstack.func_190926_b()) + { +- itemstack.func_77972_a(1, p_151367_1_); ++ damageArmor(itemstack, 1, p_151367_1_); + } + } + +@@ -76,4 +76,25 @@ + { + return p_92095_0_ > 10 ? p_92095_0_ - 10 : 1 + p_92095_1_.nextInt(4); + } ++ ++ private void damageArmor(ItemStack stack, int amount, EntityLivingBase entity) ++ { ++ int slot = -1; ++ int x = 0; ++ for (ItemStack i : entity.func_184193_aE()) ++ { ++ if (i == stack){ ++ slot = x; ++ break; ++ } ++ x++; ++ } ++ if (slot == -1 || !(stack.func_77973_b() instanceof net.minecraftforge.common.ISpecialArmor)) ++ { ++ stack.func_77972_a(1, entity); ++ return; ++ } ++ net.minecraftforge.common.ISpecialArmor armor = (net.minecraftforge.common.ISpecialArmor)stack.func_77973_b(); ++ armor.damageArmor(entity, stack, DamageSource.func_92087_a(entity), amount, slot); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch b/patches_old/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch new file mode 100644 index 000000000..1643ab6c7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java ++++ ../src-work/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java +@@ -100,5 +100,13 @@ + { + } + +- public abstract boolean func_77557_a(Item p_77557_1_); ++ private com.google.common.base.Predicate delegate = null; ++ private EnumEnchantmentType(com.google.common.base.Predicate delegate) ++ { ++ this.delegate = delegate; ++ } ++ public boolean func_77557_a(Item p_77557_1_) ++ { ++ return this.delegate == null ? false : this.delegate.apply(p_77557_1_); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/entity/EntityAgeable.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityAgeable.java.patch new file mode 100644 index 000000000..e0d2dae6f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityAgeable.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityAgeable.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityAgeable.java +@@ -38,7 +38,7 @@ + { + if (!this.field_70170_p.field_72995_K) + { +- Class oclass = (Class)EntityList.field_191308_b.func_82594_a(ItemMonsterPlacer.func_190908_h(itemstack)); ++ Class oclass = EntityList.getClass(ItemMonsterPlacer.func_190908_h(itemstack)); + + if (oclass != null && this.getClass() == oclass) + { +@@ -79,7 +79,7 @@ + } + else + { +- Class oclass = (Class)EntityList.field_191308_b.func_82594_a(ItemMonsterPlacer.func_190908_h(p_190669_1_)); ++ Class oclass = EntityList.getClass(ItemMonsterPlacer.func_190908_h(p_190669_1_)); + return oclass != null && p_190669_2_ == oclass; + } + } diff --git a/patches_old/minecraft/net/minecraft/entity/EntityFlying.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityFlying.java.patch new file mode 100644 index 000000000..6b4ceb135 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityFlying.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityFlying.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityFlying.java +@@ -44,7 +44,9 @@ + + if (this.field_70122_E) + { +- f = this.field_70170_p.func_180495_p(new BlockPos(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) - 1, MathHelper.func_76128_c(this.field_70161_v))).func_177230_c().field_149765_K * 0.91F; ++ BlockPos underPos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) - 1, MathHelper.func_76128_c(this.field_70161_v)); ++ IBlockState underState = this.field_70170_p.func_180495_p(underPos); ++ f = underState.func_177230_c().getSlipperiness(underState, this.field_70170_p, underPos, this) * 0.91F; + } + + float f1 = 0.16277136F / (f * f * f); +@@ -53,7 +55,9 @@ + + if (this.field_70122_E) + { +- f = this.field_70170_p.func_180495_p(new BlockPos(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) - 1, MathHelper.func_76128_c(this.field_70161_v))).func_177230_c().field_149765_K * 0.91F; ++ BlockPos underPos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) - 1, MathHelper.func_76128_c(this.field_70161_v)); ++ IBlockState underState = this.field_70170_p.func_180495_p(underPos); ++ f = underState.func_177230_c().getSlipperiness(underState, this.field_70170_p, underPos, this) * 0.91F; + } + + this.func_70091_d(MoverType.SELF, this.field_70159_w, this.field_70181_x, this.field_70179_y); diff --git a/patches_old/minecraft/net/minecraft/entity/EntityHanging.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityHanging.java.patch new file mode 100644 index 000000000..c45f2b206 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityHanging.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityHanging.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityHanging.java +@@ -144,6 +144,9 @@ + blockpos$mutableblockpos.func_189533_g(blockpos).func_189534_c(enumfacing, k + i1).func_189534_c(EnumFacing.UP, l + j1); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$mutableblockpos); + ++ if (iblockstate.isSideSolid(this.field_70170_p, blockpos$mutableblockpos, this.field_174860_b)) ++ continue; ++ + if (!iblockstate.func_185904_a().func_76220_a() && !BlockRedstoneDiode.func_185546_B(iblockstate)) + { + return false; diff --git a/patches_old/minecraft/net/minecraft/entity/EntityList.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityList.java.patch new file mode 100644 index 000000000..b3a681975 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityList.java.patch @@ -0,0 +1,183 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityList.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityList.java +@@ -107,10 +107,8 @@ + public static final ResourceLocation field_191307_a = new ResourceLocation("lightning_bolt"); + private static final ResourceLocation field_191310_e = new ResourceLocation("player"); + private static final Logger field_151516_b = LogManager.getLogger(); +- public static final RegistryNamespaced < ResourceLocation, Class > field_191308_b = new RegistryNamespaced < ResourceLocation, Class > (); + public static final Map field_75627_a = Maps.newLinkedHashMap(); +- public static final Set field_191309_d = Sets.newHashSet(); +- private static final List field_191311_g = Lists.newArrayList(); ++ private static final Set EXTRA_NAMES = Sets.newHashSet(); + + @Nullable + public static ResourceLocation func_191301_a(Entity p_191301_0_) +@@ -121,38 +119,54 @@ + @Nullable + public static ResourceLocation func_191306_a(Class p_191306_0_) + { +- return field_191308_b.func_177774_c(p_191306_0_); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_191306_0_); ++ return entry == null ? null : entry.getRegistryName(); + } + + @Nullable + public static String func_75621_b(Entity p_75621_0_) + { +- int i = field_191308_b.func_148757_b(p_75621_0_.getClass()); +- return i == -1 ? null : (String)field_191311_g.get(i); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_75621_0_.getClass()); ++ return entry == null ? null : entry.getName(); + } + + @Nullable + public static String func_191302_a(@Nullable ResourceLocation p_191302_0_) + { +- int i = field_191308_b.func_148757_b(field_191308_b.func_82594_a(p_191302_0_)); +- return i == -1 ? null : (String)field_191311_g.get(i); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(p_191302_0_); ++ return entry == null ? null : entry.getName(); + } + + @Nullable + @SideOnly(Side.CLIENT) + public static Class func_90035_a(int p_90035_0_) + { +- return (Class)field_191308_b.func_148754_a(p_90035_0_); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.registries.GameData.getEntityRegistry().getValue(p_90035_0_); ++ return entry == null ? null : entry.getEntityClass(); + } + + @Nullable + @SideOnly(Side.CLIENT) + public static Class func_192839_a(String p_192839_0_) + { +- return (Class)field_191308_b.func_82594_a(new ResourceLocation(p_192839_0_)); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(new ResourceLocation(p_192839_0_)); ++ return entry == null ? null : entry.getEntityClass(); + } + ++ public static int getID(Class cls) ++ { ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(cls); ++ return entry == null ? -1 : net.minecraftforge.registries.GameData.getEntityRegistry().getID(entry); ++ } ++ + @Nullable ++ public static Class getClass(ResourceLocation key) ++ { ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(key); ++ return entry == null ? null : entry.getEntityClass(); ++ } ++ ++ @Nullable + public static Entity func_191304_a(@Nullable Class p_191304_0_, World p_191304_1_) + { + if (p_191304_0_ == null) +@@ -163,6 +177,8 @@ + { + try + { ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_191304_0_); ++ if (entry != null) return entry.newInstance(p_191304_1_); + return p_191304_0_.getConstructor(World.class).newInstance(p_191304_1_); + } + catch (Exception exception) +@@ -177,13 +193,15 @@ + @SideOnly(Side.CLIENT) + public static Entity func_75616_a(int p_75616_0_, World p_75616_1_) + { +- return func_191304_a(func_90035_a(p_75616_0_), p_75616_1_); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.registries.GameData.getEntityRegistry().getValue(p_75616_0_); ++ return entry == null ? null : entry.newInstance(p_75616_1_); + } + + @Nullable + public static Entity func_188429_b(ResourceLocation p_188429_0_, World p_188429_1_) + { +- return func_191304_a(field_191308_b.func_82594_a(p_188429_0_), p_188429_1_); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(p_188429_0_); ++ return entry == null ? null : entry.newInstance(p_188429_1_); + } + + @Nullable +@@ -198,7 +216,16 @@ + } + else + { ++ try ++ { + entity.func_70020_e(p_75615_0_); ++ } ++ catch (Exception e) ++ { ++ net.minecraftforge.fml.common.FMLLog.log.error("An Entity {}({}) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", ++ p_75615_0_.func_74779_i("id"), entity.func_70005_c_(), e); ++ entity = null; ++ } + } + + return entity; +@@ -206,7 +233,7 @@ + + public static Set func_180124_b() + { +- return field_191309_d; ++ return Sets.union(net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getKeys(), EXTRA_NAMES); + } + + public static boolean func_180123_a(Entity p_180123_0_, ResourceLocation p_180123_1_) +@@ -373,7 +400,7 @@ + func_191305_a("zombie_horse", 3232308, 9945732); + func_191305_a("zombie_pigman", 15373203, 5009705); + func_191305_a("zombie_villager", 5651507, 7969893); +- field_191309_d.add(field_191307_a); ++ EXTRA_NAMES.add(field_191307_a); + } + + private static void func_191303_a(int p_191303_0_, String p_191303_1_, Class p_191303_2_, String p_191303_3_) +@@ -394,22 +421,17 @@ + else + { + ResourceLocation resourcelocation = new ResourceLocation(p_191303_1_); +- field_191308_b.func_177775_a(p_191303_0_, resourcelocation, p_191303_2_); +- field_191309_d.add(resourcelocation); +- +- while (field_191311_g.size() <= p_191303_0_) +- { +- field_191311_g.add(null); +- } +- +- field_191311_g.set(p_191303_0_, p_191303_3_); ++ net.minecraftforge.registries.GameData.registerEntity(p_191303_0_, resourcelocation, p_191303_2_, p_191303_3_); + } + } + + protected static EntityList.EntityEggInfo func_191305_a(String p_191305_0_, int p_191305_1_, int p_191305_2_) + { + ResourceLocation resourcelocation = new ResourceLocation(p_191305_0_); +- return field_75627_a.put(resourcelocation, new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_)); ++ EntityList.EntityEggInfo egg = new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_); ++ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(resourcelocation); ++ if (entry != null) entry.setEgg(egg); ++ return (EntityList.EntityEggInfo)field_75627_a.put(resourcelocation, egg); + } + + public static class EntityEggInfo +@@ -428,5 +450,16 @@ + this.field_151512_d = StatList.func_151182_a(this); + this.field_151513_e = StatList.func_151176_b(this); + } ++ ++ // Forge start ++ public EntityEggInfo(ResourceLocation id, int primaryColor, int secondaryColor, StatBase killEntityStatistic, StatBase entityKilledByStatistic) ++ { ++ this.field_75613_a = id; ++ this.field_75611_b = primaryColor; ++ this.field_75612_c = secondaryColor; ++ this.field_151512_d = killEntityStatistic; ++ this.field_151513_e = entityKilledByStatistic; ++ } ++ // Forge end + } + } diff --git a/patches_old/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityLiving.java.patch new file mode 100644 index 000000000..d23ec224a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -0,0 +1,88 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java +@@ -170,6 +170,7 @@ + public void func_70624_b(@Nullable EntityLivingBase p_70624_1_) + { + this.field_70696_bz = p_70624_1_; ++ net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_); + } + + public boolean func_70686_a(Class p_70686_1_) +@@ -576,7 +577,7 @@ + super.func_70636_d(); + this.field_70170_p.field_72984_F.func_76320_a("looting"); + +- if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && !this.field_70729_aU && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (!this.field_70170_p.field_72995_K && this.func_98052_bS() && !this.field_70729_aU && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) + { + for (EntityItem entityitem : this.field_70170_p.func_72872_a(EntityItem.class, this.func_174813_aQ().func_72314_b(1.0D, 0.0D, 1.0D))) + { +@@ -702,10 +703,22 @@ + + protected void func_70623_bb() + { ++ net.minecraftforge.fml.common.eventhandler.Event.Result result = null; + if (this.field_82179_bU) + { + this.field_70708_bq = 0; + } ++ else if ((this.field_70708_bq & 0x1F) == 0x1F && (result = net.minecraftforge.event.ForgeEventFactory.canEntityDespawn(this)) != net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT) ++ { ++ if (result == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ this.field_70708_bq = 0; ++ } ++ else ++ { ++ this.func_70106_y(); ++ } ++ } + else + { + Entity entity = this.field_70170_p.func_72890_a(this, -1.0D); +@@ -839,7 +852,6 @@ + return !this.field_70170_p.func_72953_d(this.func_174813_aQ()) && this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty() && this.field_70170_p.func_72917_a(this.func_174813_aQ(), this); + } + +- @SideOnly(Side.CLIENT) + public float func_70603_bj() + { + return 1.0F; +@@ -991,6 +1003,8 @@ + + public static EntityEquipmentSlot func_184640_d(ItemStack p_184640_0_) + { ++ final EntityEquipmentSlot slot = p_184640_0_.func_77973_b().getEquipmentSlot(p_184640_0_); ++ if (slot != null) return slot; // FORGE: Allow modders to set a non-default equipment slot for a stack; e.g. a non-armor chestplate-slot item + if (p_184640_0_.func_77973_b() != Item.func_150898_a(Blocks.field_150423_aK) && p_184640_0_.func_77973_b() != Items.field_151144_bL) + { + if (p_184640_0_.func_77973_b() instanceof ItemArmor) +@@ -1003,7 +1017,7 @@ + } + else + { +- return p_184640_0_.func_77973_b() == Items.field_185159_cQ ? EntityEquipmentSlot.OFFHAND : EntityEquipmentSlot.MAINHAND; ++ return p_184640_0_.func_77973_b().isShield(p_184640_0_, null) ? EntityEquipmentSlot.OFFHAND : EntityEquipmentSlot.MAINHAND; + } + } + else +@@ -1434,5 +1448,19 @@ + ON_GROUND, + IN_AIR, + IN_WATER; ++ ++ private final java.util.function.BiPredicate spawnPredicate; ++ ++ SpawnPlacementType() { this.spawnPredicate = null; } ++ ++ SpawnPlacementType(java.util.function.BiPredicate spawnPredicate) ++ { ++ this.spawnPredicate = spawnPredicate; ++ } ++ ++ public boolean canSpawnAt(World world, BlockPos pos) ++ { ++ return this.spawnPredicate != null ? this.spawnPredicate.test(world, pos) : net.minecraft.world.WorldEntitySpawner.canCreatureTypeSpawnBody(this, world, pos); ++ } + } + } diff --git a/patches_old/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityLivingBase.java.patch new file mode 100644 index 000000000..fd41f3a8b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -0,0 +1,482 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityLivingBase.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityLivingBase.java +@@ -82,6 +82,7 @@ + private static final Logger field_190632_a = LogManager.getLogger(); + private static final UUID field_110156_b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); + private static final AttributeModifier field_110157_c = (new AttributeModifier(field_110156_b, "Sprinting speed boost", 0.30000001192092896D, 2)).func_111168_a(false); ++ public static final net.minecraft.entity.ai.attributes.IAttribute SWIM_SPEED = new net.minecraft.entity.ai.attributes.RangedAttribute(null, "forge.swimSpeed", 1.0D, 0.0D, 1024.0D).func_111112_a(true); + protected static final DataParameter field_184621_as = EntityDataManager.func_187226_a(EntityLivingBase.class, DataSerializers.field_187191_a); + private static final DataParameter field_184632_c = EntityDataManager.func_187226_a(EntityLivingBase.class, DataSerializers.field_187193_c); + private static final DataParameter field_184633_f = EntityDataManager.func_187226_a(EntityLivingBase.class, DataSerializers.field_187192_b); +@@ -188,6 +189,7 @@ + this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111263_d); + this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188791_g); + this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_189429_h); ++ this.func_110140_aT().func_111150_b(SWIM_SPEED); + } + + protected void func_184231_a(double p_184231_1_, boolean p_184231_3_, IBlockState p_184231_4_, BlockPos p_184231_5_) +@@ -201,10 +203,11 @@ + { + float f = (float)MathHelper.func_76123_f(this.field_70143_R - 3.0F); + +- if (p_184231_4_.func_185904_a() != Material.field_151579_a) ++ if (!p_184231_4_.func_177230_c().isAir(p_184231_4_, field_70170_p, p_184231_5_)) + { + double d0 = Math.min((double)(0.2F + f / 15.0F), 2.5D); + int i = (int)(150.0D * d0); ++ if (!p_184231_4_.func_177230_c().addLandingEffects(p_184231_4_, (WorldServer)this.field_70170_p, p_184231_5_, p_184231_4_, this, i)) + ((WorldServer)this.field_70170_p).func_175739_a(EnumParticleTypes.BLOCK_DUST, this.field_70165_t, this.field_70163_u, this.field_70161_v, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.func_176210_f(p_184231_4_)); + } + } +@@ -281,7 +284,7 @@ + } + } + +- if (!this.field_70170_p.field_72995_K && this.func_184218_aH() && this.func_184187_bx() instanceof EntityLivingBase) ++ if (!this.field_70170_p.field_72995_K && this.func_184218_aH() && this.func_184187_bx() != null && this.func_184187_bx().shouldDismountInWater(this)) + { + this.func_184210_p(); + } +@@ -380,7 +383,7 @@ + if (!this.field_70170_p.field_72995_K && (this.func_70684_aJ() || this.field_70718_bc > 0 && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot"))) + { + int i = this.func_70693_a(this.field_70717_bb); +- ++ i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.field_70717_bb, i); + while (i > 0) + { + int j = EntityXPOrb.func_70527_a(i); +@@ -442,6 +445,7 @@ + { + this.field_70755_b = p_70604_1_; + this.field_70756_c = this.field_70173_aa; ++ net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70604_1_); + } + + public EntityLivingBase func_110144_aD() +@@ -670,8 +674,10 @@ + else + { + Collection collection = this.field_70713_bf.values(); +- this.field_70180_af.func_187227_b(field_184634_g, Boolean.valueOf(func_184593_a(collection))); +- this.field_70180_af.func_187227_b(field_184633_f, Integer.valueOf(PotionUtils.func_185181_a(collection))); ++ net.minecraftforge.event.entity.living.PotionColorCalculationEvent event = new net.minecraftforge.event.entity.living.PotionColorCalculationEvent(this, PotionUtils.func_185181_a(collection), func_184593_a(collection), collection); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ this.field_70180_af.func_187227_b(field_184634_g, event.areParticlesHidden()); ++ this.field_70180_af.func_187227_b(field_184633_f, event.getColor()); + this.func_82142_c(this.func_70644_a(MobEffects.field_76441_p)); + } + } +@@ -819,6 +825,8 @@ + + public void func_70691_i(float p_70691_1_) + { ++ p_70691_1_ = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, p_70691_1_); ++ if (p_70691_1_ <= 0) return; + float f = this.func_110143_aJ(); + + if (f > 0.0F) +@@ -839,6 +847,7 @@ + + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) + { ++ if (!net.minecraftforge.common.ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_180431_b(p_70097_1_)) + { + return false; +@@ -927,9 +936,9 @@ + this.field_70718_bc = 100; + this.field_70717_bb = (EntityPlayer)entity1; + } +- else if (entity1 instanceof EntityWolf) ++ else if (entity1 instanceof net.minecraft.entity.passive.EntityTameable) + { +- EntityWolf entitywolf = (EntityWolf)entity1; ++ net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity1; + + if (entitywolf.func_70909_n()) + { +@@ -1127,7 +1136,7 @@ + + public void func_70669_a(ItemStack p_70669_1_) + { +- this.func_184185_a(SoundEvents.field_187635_cQ, 0.8F, 0.8F + this.field_70170_p.field_73012_v.nextFloat() * 0.4F); ++ this.field_70170_p.func_184148_a(null, this.field_70165_t, this.field_70163_u, this.field_70161_v, SoundEvents.field_187635_cQ, this.func_184176_by(), 0.8F, 0.8F + this.field_70170_p.field_73012_v.nextFloat() * 0.4F); //Forge: Fix MC-2518 Items are not damaged on the client so client needs packet as well. + + for (int i = 0; i < 5; ++i) + { +@@ -1139,12 +1148,17 @@ + vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * 0.017453292F); + vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * 0.017453292F); + vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v); +- this.field_70170_p.func_175688_a(EnumParticleTypes.ITEM_CRACK, vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c, Item.func_150891_b(p_70669_1_.func_77973_b())); ++ if (this.field_70170_p instanceof WorldServer) //Forge: Fix MC-2518 spawnParticle is nooped on server, need to use server specific variant ++ ((WorldServer)this.field_70170_p).func_175739_a(EnumParticleTypes.ITEM_CRACK, vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, 0, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c, 0.0D, Item.func_150891_b(p_70669_1_.func_77973_b()), p_70669_1_.func_77960_j()); ++ else //Fix the fact that spawning ItemCrack uses TWO arguments. ++ this.field_70170_p.func_175688_a(EnumParticleTypes.ITEM_CRACK, vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c, Item.func_150891_b(p_70669_1_.func_77973_b()), p_70669_1_.func_77960_j()); ++ + } + } + + public void func_70645_a(DamageSource p_70645_1_) + { ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + if (!this.field_70729_aU) + { + Entity entity = p_70645_1_.func_76346_g(); +@@ -1165,18 +1179,26 @@ + + if (!this.field_70170_p.field_72995_K) + { +- int i = 0; ++ int i = net.minecraftforge.common.ForgeHooks.getLootingLevel(this, entity, p_70645_1_); + +- if (entity instanceof EntityPlayer) +- { +- i = EnchantmentHelper.func_185283_h((EntityLivingBase)entity); +- } ++ captureDrops = true; ++ capturedDrops.clear(); + + if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) + { + boolean flag = this.field_70718_bc > 0; + this.func_184610_a(flag, i, p_70645_1_); + } ++ ++ captureDrops = false; ++ ++ if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, p_70645_1_, capturedDrops, i, field_70718_bc > 0)) ++ { ++ for (EntityItem item : capturedDrops) ++ { ++ field_70170_p.func_72838_d(item); ++ } ++ } + } + + this.field_70170_p.func_72960_a(this, (byte)3); +@@ -1195,6 +1217,9 @@ + + public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) + { ++ net.minecraftforge.event.entity.living.LivingKnockBackEvent event = net.minecraftforge.common.ForgeHooks.onLivingKnockBack(this, p_70653_1_, p_70653_2_, p_70653_3_, p_70653_5_); ++ if(event.isCanceled()) return; ++ p_70653_2_ = event.getStrength(); p_70653_3_ = event.getRatioX(); p_70653_5_ = event.getRatioZ(); + if (this.field_70146_Z.nextDouble() >= this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e()) + { + this.field_70160_al = true; +@@ -1253,15 +1278,7 @@ + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); +- +- if (block != Blocks.field_150468_ap && block != Blocks.field_150395_bd) +- { +- return block instanceof BlockTrapDoor && this.func_184604_a(blockpos, iblockstate); +- } +- else +- { +- return true; +- } ++ return net.minecraftforge.common.ForgeHooks.isLivingOnLadder(iblockstate, field_70170_p, new BlockPos(i, j, k), this); + } + } + +@@ -1287,6 +1304,9 @@ + + public void func_180430_e(float p_180430_1_, float p_180430_2_) + { ++ float[] ret = net.minecraftforge.common.ForgeHooks.onLivingFall(this, p_180430_1_, p_180430_2_); ++ if (ret == null) return; ++ p_180430_1_ = ret[0]; p_180430_2_ = ret[1]; + super.func_180430_e(p_180430_1_, p_180430_2_); + PotionEffect potioneffect = this.func_70660_b(MobEffects.field_76430_j); + float f = potioneffect == null ? 0.0F : (float)(potioneffect.func_76458_c() + 1); +@@ -1303,7 +1323,7 @@ + + if (iblockstate.func_185904_a() != Material.field_151579_a) + { +- SoundType soundtype = iblockstate.func_177230_c().func_185467_w(); ++ SoundType soundtype = iblockstate.func_177230_c().getSoundType(iblockstate, field_70170_p, new BlockPos(j, k, l), this); + this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F); + } + } +@@ -1380,17 +1400,20 @@ + { + if (!this.func_180431_b(p_70665_1_)) + { ++ p_70665_2_ = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); + p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); + float f = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F); + this.func_110149_m(this.func_110139_bj() - (f - p_70665_2_)); ++ p_70665_2_ = net.minecraftforge.common.ForgeHooks.onLivingDamage(this, p_70665_1_, p_70665_2_); + + if (p_70665_2_ != 0.0F) + { + float f1 = this.func_110143_aJ(); +- this.func_70606_j(f1 - p_70665_2_); + this.func_110142_aN().func_94547_a(p_70665_1_, f1, p_70665_2_); ++ this.func_70606_j(f1 - p_70665_2_); // Forge: moved to fix MC-121048 + this.func_110149_m(this.func_110139_bj() - p_70665_2_); + } + } +@@ -1447,6 +1470,11 @@ + + public void func_184609_a(EnumHand p_184609_1_) + { ++ ItemStack stack = this.func_184586_b(p_184609_1_); ++ if (!stack.func_190926_b()) ++ { ++ if (stack.func_77973_b().onEntitySwing(this, stack)) return; ++ } + if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) + { + this.field_110158_av = -1; +@@ -1694,7 +1722,7 @@ + + if (!this.field_70170_p.func_184143_b(axisalignedbb1)) + { +- if (this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u, d12)).func_185896_q()) ++ if (this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u, d12)).isSideSolid(field_70170_p, new BlockPos(d11, this.field_70163_u, d12), EnumFacing.UP)) + { + this.func_70634_a(d11, this.field_70163_u + 1.0D, d12); + return; +@@ -1702,14 +1730,14 @@ + + BlockPos blockpos = new BlockPos(d11, this.field_70163_u - 1.0D, d12); + +- if (this.field_70170_p.func_180495_p(blockpos).func_185896_q() || this.field_70170_p.func_180495_p(blockpos).func_185904_a() == Material.field_151586_h) ++ if (this.field_70170_p.func_180495_p(blockpos).isSideSolid(field_70170_p, blockpos, EnumFacing.UP) || this.field_70170_p.func_180495_p(blockpos).func_185904_a() == Material.field_151586_h) + { + d1 = d11; + d13 = this.field_70163_u + 1.0D; + d14 = d12; + } + } +- else if (!this.field_70170_p.func_184143_b(axisalignedbb1.func_72317_d(0.0D, 1.0D, 0.0D)) && this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u + 1.0D, d12)).func_185896_q()) ++ else if (!this.field_70170_p.func_184143_b(axisalignedbb1.func_72317_d(0.0D, 1.0D, 0.0D)) && this.field_70170_p.func_180495_p(new BlockPos(d11, this.field_70163_u + 1.0D, d12)).isSideSolid(field_70170_p, new BlockPos(d11, this.field_70163_u + 1.0D, d12), EnumFacing.UP)) + { + d1 = d11; + d13 = this.field_70163_u + 2.0D; +@@ -1781,16 +1809,17 @@ + } + + this.field_70160_al = true; ++ net.minecraftforge.common.ForgeHooks.onLivingJump(this); + } + + protected void func_70629_bd() + { +- this.field_70181_x += 0.03999999910593033D; ++ this.field_70181_x += 0.03999999910593033D * this.func_110148_a(SWIM_SPEED).func_111126_e(); + } + + protected void func_180466_bG() + { +- this.field_70181_x += 0.03999999910593033D; ++ this.field_70181_x += 0.03999999910593033D * this.func_110148_a(SWIM_SPEED).func_111126_e(); + } + + protected float func_189749_co() +@@ -1874,7 +1903,8 @@ + + if (this.field_70122_E) + { +- f6 = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos).func_177230_c().field_149765_K * 0.91F; ++ IBlockState underState = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos); ++ f6 = underState.func_177230_c().getSlipperiness(underState, this.field_70170_p, blockpos$pooledmutableblockpos, this) * 0.91F; + } + + float f7 = 0.16277136F / (f6 * f6 * f6); +@@ -1894,7 +1924,8 @@ + + if (this.field_70122_E) + { +- f6 = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos.func_189532_c(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v)).func_177230_c().field_149765_K * 0.91F; ++ IBlockState underState = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos.func_189532_c(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v)); ++ f6 = underState.func_177230_c().getSlipperiness(underState, this.field_70170_p, blockpos$pooledmutableblockpos, this) * 0.91F; + } + + if (this.func_70617_f_()) +@@ -2054,6 +2085,7 @@ + + public void func_70071_h_() + { ++ if (net.minecraftforge.common.ForgeHooks.onLivingUpdate(this)) return; + super.func_70071_h_(); + this.func_184608_ct(); + +@@ -2096,7 +2128,9 @@ + + if (!ItemStack.func_77989_b(itemstack1, itemstack)) + { ++ if (!ItemStack.areItemStacksEqualUsingNBTShareTag(itemstack1, itemstack)) + ((WorldServer)this.field_70170_p).func_73039_n().func_151247_a(this, new SPacketEntityEquipment(this.func_145782_y(), entityequipmentslot, itemstack1)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent(this, entityequipmentslot, itemstack, itemstack1)); + + if (!itemstack.func_190926_b()) + { +@@ -2575,6 +2609,40 @@ + this.field_70752_e = 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 ++ */ ++ public void curePotionEffects(ItemStack curativeItem) ++ { ++ if (field_70170_p.field_72995_K) return; ++ Iterator iterator = this.field_70713_bf.values().iterator(); ++ ++ while (iterator.hasNext()) ++ { ++ PotionEffect effect = iterator.next(); ++ ++ if (effect.isCurativeItem(curativeItem)) ++ { ++ func_70688_c(effect); ++ iterator.remove(); ++ this.field_70752_e = true; ++ } ++ } ++ } ++ ++ /** ++ * Returns true if the entity's rider (EntityPlayer) should face forward when mounted. ++ * currently only used in vanilla code by pigs. ++ * ++ * @param player The player who is riding the entity. ++ * @return If the player should orient the same direction as this entity. ++ */ ++ public boolean shouldRiderFaceForward(EntityPlayer player) ++ { ++ return this instanceof net.minecraft.entity.passive.EntityPig; ++ } ++ + public abstract EnumHandSide func_184591_cq(); + + public boolean func_184587_cr() +@@ -2595,12 +2663,19 @@ + + if (itemstack == this.field_184627_bm) + { ++ if (!this.field_184627_bm.func_190926_b()) ++ { ++ field_184628_bn = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, field_184627_bm, field_184628_bn); ++ if (field_184628_bn > 0) ++ field_184627_bm.func_77973_b().onUsingTick(field_184627_bm, this, field_184628_bn); ++ } ++ + if (this.func_184605_cv() <= 25 && this.func_184605_cv() % 4 == 0) + { + this.func_184584_a(this.field_184627_bm, 5); + } + +- if (--this.field_184628_bn == 0 && !this.field_70170_p.field_72995_K) ++ if (--this.field_184628_bn <= 0 && !this.field_70170_p.field_72995_K) + { + this.func_71036_o(); + } +@@ -2618,8 +2693,10 @@ + + if (!itemstack.func_190926_b() && !this.func_184587_cr()) + { ++ int duration = net.minecraftforge.event.ForgeEventFactory.onItemUseStart(this, itemstack, itemstack.func_77988_m()); ++ if (duration <= 0) return; + this.field_184627_bm = itemstack; +- this.field_184628_bn = itemstack.func_77988_m(); ++ this.field_184628_bn = duration; + + if (!this.field_70170_p.field_72995_K) + { +@@ -2700,7 +2777,10 @@ + if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) + { + this.func_184584_a(this.field_184627_bm, 16); +- this.func_184611_a(this.func_184600_cs(), this.field_184627_bm.func_77950_b(this.field_70170_p, this)); ++ ItemStack activeItemStackCopy = this.field_184627_bm.func_77946_l(); ++ ItemStack itemstack = this.field_184627_bm.func_77950_b(this.field_70170_p, this); ++ itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, activeItemStackCopy, func_184605_cv(), itemstack); ++ this.func_184611_a(this.func_184600_cs(), itemstack); + this.func_184602_cy(); + } + } +@@ -2724,7 +2804,8 @@ + { + if (!this.field_184627_bm.func_190926_b()) + { +- this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv()); ++ if (!net.minecraftforge.event.ForgeEventFactory.onUseItemStop(this, field_184627_bm, this.func_184605_cv())) ++ this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv()); + } + + this.func_184602_cy(); +@@ -2852,6 +2933,31 @@ + return true; + } + ++ // FORGE ++ private final net.minecraftforge.items.IItemHandlerModifiable handHandler = new net.minecraftforge.items.wrapper.EntityHandsInvWrapper(this); ++ private final net.minecraftforge.items.IItemHandlerModifiable armorHandler = new net.minecraftforge.items.wrapper.EntityArmorInvWrapper(this); ++ private final net.minecraftforge.items.IItemHandler joinedHandler = new net.minecraftforge.items.wrapper.CombinedInvWrapper(armorHandler, handHandler); ++ ++ @SuppressWarnings("unchecked") ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ if (capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) ++ { ++ if (facing == null) return (T) joinedHandler; ++ else if (facing.func_176740_k().func_176720_b()) return (T) handHandler; ++ else if (facing.func_176740_k().func_176722_c()) return (T) armorHandler; ++ } ++ return super.getCapability(capability, facing); ++ } ++ ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); ++ } ++ + public boolean func_190631_cK() + { + return true; +@@ -2861,4 +2967,30 @@ + public void func_191987_a(BlockPos p_191987_1_, boolean p_191987_2_) + { + } ++ ++ @Override ++ public void func_191958_b(float strafe, float up, float forward, float friction) ++ { ++ float f = strafe * strafe + up * up + forward * forward; ++ if (f >= 1.0E-4F) ++ { ++ f = MathHelper.func_76129_c(f); ++ if (f < 1.0F) f = 1.0F; ++ f = friction / f; ++ strafe = strafe * f; ++ up = up * f; ++ forward = forward * f; ++ if(this.func_70090_H() || this.func_180799_ab()) ++ { ++ strafe = strafe * (float)this.func_110148_a(SWIM_SPEED).func_111126_e(); ++ up = up * (float)this.func_110148_a(SWIM_SPEED).func_111126_e(); ++ forward = forward * (float)this.func_110148_a(SWIM_SPEED).func_111126_e(); ++ } ++ float f1 = MathHelper.func_76126_a(this.field_70177_z * 0.017453292F); ++ float f2 = MathHelper.func_76134_b(this.field_70177_z * 0.017453292F); ++ this.field_70159_w += (double)(strafe * f2 - forward * f1); ++ this.field_70181_x += (double)up; ++ this.field_70179_y += (double)(forward * f2 + strafe * f1); ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch b/patches_old/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch new file mode 100644 index 000000000..daaee1873 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java ++++ ../src-work/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java +@@ -50,9 +50,14 @@ + + public static EntityLiving.SpawnPlacementType func_180109_a(Class p_180109_0_) + { +- return field_180110_a.get(p_180109_0_); ++ return field_180110_a.getOrDefault(p_180109_0_, EntityLiving.SpawnPlacementType.ON_GROUND); + } + ++ public static void setPlacementType(Class entityClass, EntityLiving.SpawnPlacementType placementType) ++ { ++ field_180110_a.putIfAbsent(entityClass, placementType); ++ } ++ + static + { + field_180110_a.put(EntityBat.class, EntityLiving.SpawnPlacementType.ON_GROUND); diff --git a/patches_old/minecraft/net/minecraft/entity/EntityTracker.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityTracker.java.patch new file mode 100644 index 000000000..33c225524 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityTracker.java.patch @@ -0,0 +1,37 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java +@@ -77,6 +77,8 @@ + + public void func_72786_a(Entity p_72786_1_) + { ++ if (net.minecraftforge.fml.common.registry.EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) return; ++ + if (p_72786_1_ instanceof EntityPlayerMP) + { + this.func_72791_a(p_72786_1_, 512, 2); +@@ -339,6 +341,25 @@ + } + } + ++ /* ======================================== FORGE START =====================================*/ ++ ++ // don't expose the EntityTrackerEntry directly so mods can't mess with the data in there as easily ++ /** ++ * Get all players tracking the given Entity. The Entity must be part of the World that this Tracker belongs to. ++ * @param entity the Entity ++ * @return all players tracking the Entity ++ */ ++ public Set getTrackingPlayers(Entity entity) ++ { ++ EntityTrackerEntry entry = (EntityTrackerEntry) field_72794_c.func_76041_a(entity.func_145782_y()); ++ if (entry == null) ++ return java.util.Collections.emptySet(); ++ else ++ return java.util.Collections.unmodifiableSet(entry.field_73134_o); ++ } ++ ++ /* ======================================== FORGE END =====================================*/ ++ + public void func_151248_b(Entity p_151248_1_, Packet p_151248_2_) + { + EntityTrackerEntry entitytrackerentry = this.field_72794_c.func_76041_a(p_151248_1_.func_145782_y()); diff --git a/patches_old/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch b/patches_old/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch new file mode 100644 index 000000000..9c189b957 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityTrackerEntry.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityTrackerEntry.java +@@ -158,13 +158,13 @@ + + if (itemstack.func_77973_b() instanceof ItemMap) + { +- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, this.field_73132_a.field_70170_p); ++ MapData mapdata = ((ItemMap) itemstack.func_77973_b()).func_77873_a(itemstack, this.field_73132_a.field_70170_p); + + for (EntityPlayer entityplayer : p_73122_1_) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)entityplayer; + mapdata.func_76191_a(entityplayermp, itemstack); +- Packet packet = Items.field_151098_aY.func_150911_c(itemstack, this.field_73132_a.field_70170_p, entityplayermp); ++ Packet packet = ((ItemMap) itemstack.func_77973_b()).func_150911_c(itemstack, this.field_73132_a.field_70170_p, entityplayermp); + + if (packet != null) + { +@@ -457,6 +457,7 @@ + + this.field_73132_a.func_184178_b(p_73117_1_); + p_73117_1_.func_184848_d(this.field_73132_a); ++ net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(field_73132_a, p_73117_1_); + } + } + else if (this.field_73134_o.contains(p_73117_1_)) +@@ -464,6 +465,7 @@ + this.field_73134_o.remove(p_73117_1_); + this.field_73132_a.func_184203_c(p_73117_1_); + p_73117_1_.func_152339_d(this.field_73132_a); ++ net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(field_73132_a, p_73117_1_); + } + } + } +@@ -496,6 +498,9 @@ + field_151262_p.warn("Fetching addPacket for removed entity"); + } + ++ Packet pkt = net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.getEntitySpawningPacket(this.field_73132_a); ++ if (pkt != null) return pkt; ++ + if (this.field_73132_a instanceof EntityPlayerMP) + { + return new SPacketSpawnPlayer((EntityPlayer)this.field_73132_a); diff --git a/patches_old/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch b/patches_old/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch new file mode 100644 index 000000000..8ee4d336e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/SharedMonsterAttributes.java ++++ ../src-work/minecraft/net/minecraft/entity/SharedMonsterAttributes.java +@@ -16,7 +16,7 @@ + public class SharedMonsterAttributes + { + private static final Logger field_151476_f = LogManager.getLogger(); +- public static final IAttribute field_111267_a = (new RangedAttribute((IAttribute)null, "generic.maxHealth", 20.0D, 0.0D, 1024.0D)).func_111117_a("Max Health").func_111112_a(true); ++ public static final IAttribute field_111267_a = (new RangedAttribute((IAttribute)null, "generic.maxHealth", 20.0D, Float.MIN_VALUE, 1024.0D)).func_111117_a("Max Health").func_111112_a(true); // Forge: set smallest max-health value to fix MC-119183. This gets rounded to float so we use the smallest positive float value. + public static final IAttribute field_111265_b = (new RangedAttribute((IAttribute)null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).func_111117_a("Follow Range"); + public static final IAttribute field_111266_c = (new RangedAttribute((IAttribute)null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).func_111117_a("Knockback Resistance"); + public static final IAttribute field_111263_d = (new RangedAttribute((IAttribute)null, "generic.movementSpeed", 0.699999988079071D, 0.0D, 1024.0D)).func_111117_a("Movement Speed").func_111112_a(true); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch new file mode 100644 index 000000000..30ff2d124 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch @@ -0,0 +1,55 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java +@@ -21,6 +21,8 @@ + private double field_151495_j; + private double field_151496_k; + protected final int field_188493_g = 20; ++ private int failedPathFindingPenalty = 0; ++ private boolean canPenalize = false; + + public EntityAIAttackMelee(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) + { +@@ -45,6 +47,19 @@ + } + else + { ++ if (canPenalize) ++ { ++ if (--this.field_75445_i <= 0) ++ { ++ this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); ++ this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); ++ return this.field_75438_g != null; ++ } ++ else ++ { ++ return true; ++ } ++ } + this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); + + if (this.field_75438_g != null) +@@ -116,6 +131,23 @@ + this.field_151496_k = entitylivingbase.field_70161_v; + this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); + ++ if (this.canPenalize) ++ { ++ this.field_75445_i += failedPathFindingPenalty; ++ if (this.field_75441_b.func_70661_as().func_75505_d() != null) ++ { ++ net.minecraft.pathfinding.PathPoint finalPathPoint = this.field_75441_b.func_70661_as().func_75505_d().func_75870_c(); ++ if (finalPathPoint != null && entitylivingbase.func_70092_e(finalPathPoint.field_75839_a, finalPathPoint.field_75837_b, finalPathPoint.field_75838_c) < 1) ++ failedPathFindingPenalty = 0; ++ else ++ failedPathFindingPenalty += 10; ++ } ++ else ++ { ++ failedPathFindingPenalty += 10; ++ } ++ } ++ + if (d0 > 1024.0D) + { + this.field_75445_i += 10; diff --git a/patches_old/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch new file mode 100644 index 000000000..78f527bfd --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java +@@ -21,7 +21,7 @@ + { + return false; + } +- else if (!this.field_75356_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75356_a.field_70170_p, this.field_75356_a) || !this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b).func_177230_c().canEntityDestroy(this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b), this.field_75356_a.field_70170_p, this.field_179507_b, this.field_75356_a) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_75356_a, this.field_179507_b, this.field_75356_a.field_70170_p.func_180495_p(this.field_179507_b))) + { + return false; + } diff --git a/patches_old/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java.patch new file mode 100644 index 000000000..b1f6b330d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java +@@ -78,7 +78,7 @@ + + if (field_179505_b.apply(this.field_151501_c.func_180495_p(blockpos))) + { +- if (this.field_151501_c.func_82736_K().func_82766_b("mobGriefing")) ++ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b)) + { + this.field_151501_c.func_175655_b(blockpos, false); + } +@@ -91,7 +91,7 @@ + + if (this.field_151501_c.func_180495_p(blockpos1).func_177230_c() == Blocks.field_150349_c) + { +- if (this.field_151501_c.func_82736_K().func_82766_b("mobGriefing")) ++ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_151501_c, this.field_151500_b)) + { + this.field_151501_c.func_175718_b(2001, blockpos1, Block.func_149682_b(Blocks.field_150349_c)); + this.field_151501_c.func_180501_a(blockpos1, Blocks.field_150346_d.func_176223_P(), 2); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java.patch new file mode 100644 index 000000000..5f941f5ab --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.java +@@ -29,7 +29,7 @@ + { + if (this.field_179496_a <= 0) + { +- if (!this.field_179504_c.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179504_c.field_70170_p, this.field_179504_c)) + { + return false; + } +@@ -94,6 +94,12 @@ + world.func_180501_a(blockpos, Blocks.field_185773_cZ.func_176223_P(), 3); + flag = true; + } ++ else if (itemstack.func_77973_b() instanceof net.minecraftforge.common.IPlantable) { ++ if(((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlantType(world,blockpos) == net.minecraftforge.common.EnumPlantType.Crop) { ++ world.func_180501_a(blockpos, ((net.minecraftforge.common.IPlantable)itemstack.func_77973_b()).getPlant(world,blockpos),3); ++ flag = true; ++ } ++ } + } + + if (flag) diff --git a/patches_old/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch new file mode 100644 index 000000000..48fda1f82 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIMate.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIMate.java +@@ -92,6 +92,18 @@ + { + EntityAgeable entityageable = this.field_75390_d.func_90011_a(this.field_75391_e); + ++ final net.minecraftforge.event.entity.living.BabyEntitySpawnEvent event = new net.minecraftforge.event.entity.living.BabyEntitySpawnEvent(field_75390_d, field_75391_e, entityageable); ++ final boolean cancelled = net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ entityageable = event.getChild(); ++ if (cancelled) { ++ //Reset the "inLove" state for the animals ++ this.field_75390_d.func_70873_a(6000); ++ this.field_75391_e.func_70873_a(6000); ++ this.field_75390_d.func_70875_t(); ++ this.field_75391_e.func_70875_t(); ++ return; ++ } ++ + if (entityageable != null) + { + EntityPlayerMP entityplayermp = this.field_75390_d.func_191993_do(); diff --git a/patches_old/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch new file mode 100644 index 000000000..0392b138c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java +@@ -70,7 +70,7 @@ + int i = this.field_111180_a.func_110252_cg(); + int j = this.field_111180_a.func_190676_dC(); + +- if (j > 0 && this.field_111180_a.func_70681_au().nextInt(j) < i) ++ if (j > 0 && this.field_111180_a.func_70681_au().nextInt(j) < i && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(field_111180_a, (EntityPlayer)entity)) + { + this.field_111180_a.func_110263_g((EntityPlayer)entity); + return; diff --git a/patches_old/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch new file mode 100644 index 000000000..9b81a621e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java +@@ -113,11 +113,15 @@ + + private void func_75447_i() + { +- EntityVillager entityvillager = this.field_75450_b.func_90011_a(this.field_75451_c); ++ net.minecraft.entity.EntityAgeable entityvillager = this.field_75450_b.func_90011_a(this.field_75451_c); + this.field_75451_c.func_70873_a(6000); + this.field_75450_b.func_70873_a(6000); + this.field_75451_c.func_175549_o(false); + this.field_75450_b.func_175549_o(false); ++ ++ final net.minecraftforge.event.entity.living.BabyEntitySpawnEvent event = new net.minecraftforge.event.entity.living.BabyEntitySpawnEvent(field_75450_b, field_75451_c, entityvillager); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event) || event.getChild() == null) { return; } ++ entityvillager = event.getChild(); + entityvillager.func_70873_a(-24000); + entityvillager.func_70012_b(this.field_75450_b.field_70165_t, this.field_75450_b.field_70163_u, this.field_75450_b.field_70161_v, 0.0F, 0.0F); + this.field_75448_d.func_72838_d(entityvillager); diff --git a/patches_old/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches_old/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch new file mode 100644 index 000000000..21ac11760 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/entity/boss/EntityDragon.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/EntityDragon.java +@@ -499,13 +499,13 @@ + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() != Material.field_151579_a && iblockstate.func_185904_a() != Material.field_151581_o) ++ if (!block.isAir(iblockstate, this.field_70170_p, blockpos) && iblockstate.func_185904_a() != Material.field_151581_o) + { +- if (!this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) + { + flag = true; + } +- else if (block != Blocks.field_180401_cv && block != Blocks.field_150343_Z && block != Blocks.field_150377_bs && block != Blocks.field_150357_h && block != Blocks.field_150384_bq && block != Blocks.field_150378_br) ++ else if (block.canEntityDestroy(iblockstate, this.field_70170_p, blockpos, this) && net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this, blockpos, iblockstate)) + { + if (block != Blocks.field_150483_bI && block != Blocks.field_185776_dc && block != Blocks.field_185777_dd && block != Blocks.field_150411_aY && block != Blocks.field_185775_db) + { diff --git a/patches_old/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches_old/minecraft/net/minecraft/entity/boss/EntityWither.java.patch new file mode 100644 index 000000000..98bbf2a3b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/boss/EntityWither.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/entity/boss/EntityWither.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java +@@ -255,7 +255,7 @@ + + if (j1 <= 0) + { +- this.field_70170_p.func_72885_a(this, this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v, 7.0F, false, this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")); ++ this.field_70170_p.func_72885_a(this, this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v, 7.0F, false, net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)); + this.field_70170_p.func_175669_a(1023, new BlockPos(this), 0); + } + +@@ -362,7 +362,7 @@ + { + --this.field_82222_j; + +- if (this.field_82222_j == 0 && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (this.field_82222_j == 0 && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) + { + int i1 = MathHelper.func_76128_c(this.field_70163_u); + int l1 = MathHelper.func_76128_c(this.field_70165_t); +@@ -382,7 +382,7 @@ + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() != Material.field_151579_a && func_181033_a(block)) ++ if (!block.isAir(iblockstate, this.field_70170_p, blockpos) && block.canEntityDestroy(iblockstate, field_70170_p, blockpos, this) && net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this, blockpos, iblockstate)) + { + flag = this.field_70170_p.func_175655_b(blockpos, true) || flag; + } diff --git a/patches_old/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch b/patches_old/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch new file mode 100644 index 000000000..3140d39b6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java +@@ -72,7 +72,7 @@ + double d2 = this.field_188661_a.field_70986_h.field_70163_u + (double)(this.field_188661_a.field_70986_h.field_70131_O / 2.0F); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.func_76128_c(d0), MathHelper.func_76128_c(d2), MathHelper.func_76128_c(d1)); + +- while (this.field_188661_a.field_70170_p.func_175623_d(blockpos$mutableblockpos)) ++ while (this.field_188661_a.field_70170_p.func_175623_d(blockpos$mutableblockpos) && d2 >= 0) //Forge: Fix infinite loop if ground is missing. + { + --d2; + blockpos$mutableblockpos.func_181079_c(MathHelper.func_76128_c(d0), MathHelper.func_76128_c(d2), MathHelper.func_76128_c(d1)); diff --git a/patches_old/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/patches_old/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch new file mode 100644 index 000000000..e8fbc7e34 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java ++++ ../src-work/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java +@@ -104,7 +104,8 @@ + for (int i = 0; i < list.size(); ++i) + { + Entity entity = list.get(i); +- entity.func_70077_a(this); ++ if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this)) ++ entity.func_70077_a(this); + } + } + } diff --git a/patches_old/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches_old/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch new file mode 100644 index 000000000..46afa1b57 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -0,0 +1,41 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityEnderPearl.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java +@@ -98,6 +98,9 @@ + + if (entityplayermp.field_71135_a.func_147362_b().func_150724_d() && entityplayermp.field_70170_p == this.field_70170_p && !entityplayermp.func_70608_bn()) + { ++ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(entityplayermp, this.field_70165_t, this.field_70163_u, this.field_70161_v, 5.0F); ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) ++ { // Don't indent to lower patch size + if (this.field_70146_Z.nextFloat() < 0.05F && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) + { + EntityEndermite entityendermite = new EntityEndermite(this.field_70170_p); +@@ -111,9 +114,10 @@ + entitylivingbase.func_184210_p(); + } + +- entitylivingbase.func_70634_a(this.field_70165_t, this.field_70163_u, this.field_70161_v); ++ entitylivingbase.func_70634_a(event.getTargetX(), event.getTargetY(), event.getTargetZ()); + entitylivingbase.field_70143_R = 0.0F; +- entitylivingbase.func_70097_a(DamageSource.field_76379_h, 5.0F); ++ entitylivingbase.func_70097_a(DamageSource.field_76379_h, event.getAttackDamage()); ++ } + } + } + else if (entitylivingbase != null) +@@ -141,13 +145,13 @@ + } + + @Nullable +- public Entity func_184204_a(int p_184204_1_) ++ public Entity changeDimension(int p_184204_1_, net.minecraftforge.common.util.ITeleporter teleporter) + { + if (this.field_70192_c.field_71093_bK != p_184204_1_) + { + this.field_70192_c = null; + } + +- return super.func_184204_a(p_184204_1_); ++ return super.changeDimension(p_184204_1_, teleporter); + } + } diff --git a/patches_old/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch b/patches_old/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch new file mode 100644 index 000000000..a6322acef --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityFallingBlock.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityFallingBlock.java +@@ -166,6 +166,7 @@ + { + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos1); + ++ if (this.field_70170_p.func_175623_d(new BlockPos(this.field_70165_t, this.field_70163_u - 0.009999999776482582D, this.field_70161_v))) //Forge: Don't indent below. + if (!flag1 && BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - 0.009999999776482582D, this.field_70161_v)))) + { + this.field_70122_E = false; +@@ -189,7 +190,7 @@ + ((BlockFalling)block).func_176502_a_(this.field_70170_p, blockpos1, this.field_175132_d, iblockstate); + } + +- if (this.field_145810_d != null && block instanceof ITileEntityProvider) ++ if (this.field_145810_d != null && block.hasTileEntity(this.field_175132_d)) + { + TileEntity tileentity = this.field_70170_p.func_175625_s(blockpos1); + diff --git a/patches_old/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches_old/minecraft/net/minecraft/entity/item/EntityItem.java.patch new file mode 100644 index 000000000..b86590467 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -0,0 +1,139 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityItem.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityItem.java +@@ -38,6 +38,11 @@ + private String field_145802_g; + public float field_70290_d; + ++ /** ++ * The maximum age of this EntityItem. The item is expired once this is reached. ++ */ ++ public int lifespan = 6000; ++ + public EntityItem(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_) + { + super(p_i1709_1_); +@@ -55,6 +60,7 @@ + { + this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); + this.func_92058_a(p_i1710_8_); ++ this.lifespan = (p_i1710_8_.func_77973_b() == null ? 6000 : p_i1710_8_.func_77973_b().getEntityLifespan(p_i1710_8_, p_i1710_1_)); + } + + protected boolean func_70041_e_() +@@ -78,6 +84,7 @@ + + public void func_70071_h_() + { ++ if (func_92059_d().func_77973_b().onEntityItemUpdate(this)) return; + if (this.func_92059_d().func_190926_b()) + { + this.func_70106_y(); +@@ -135,7 +142,9 @@ + + if (this.field_70122_E) + { +- f = this.field_70170_p.func_180495_p(new BlockPos(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) - 1, MathHelper.func_76128_c(this.field_70161_v))).func_177230_c().field_149765_K * 0.98F; ++ BlockPos underPos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) - 1, MathHelper.func_76128_c(this.field_70161_v)); ++ net.minecraft.block.state.IBlockState underState = this.field_70170_p.func_180495_p(underPos); ++ f = underState.func_177230_c().getSlipperiness(underState, this.field_70170_p, underPos, this) * 0.98F; + } + + this.field_70159_w *= (double)f; +@@ -167,8 +176,16 @@ + } + } + +- if (!this.field_70170_p.field_72995_K && this.field_70292_b >= 6000) ++ ItemStack item = this.func_92059_d(); ++ ++ if (!this.field_70170_p.field_72995_K && this.field_70292_b >= lifespan) + { ++ int hook = net.minecraftforge.event.ForgeEventFactory.onItemExpire(this, item); ++ if (hook < 0) this.func_70106_y(); ++ else this.lifespan += hook; ++ } ++ if (item.func_190926_b()) ++ { + this.func_70106_y(); + } + } +@@ -225,6 +242,10 @@ + { + return false; + } ++ else if (!itemstack.areCapsCompatible(itemstack1)) ++ { ++ return false; ++ } + else + { + itemstack1.func_190917_f(itemstack.func_190916_E()); +@@ -282,6 +303,7 @@ + + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) + { ++ if (this.field_70170_p.field_72995_K || this.field_70128_L) return false; //Forge: Fixes MC-53850 + if (this.func_180431_b(p_70097_1_)) + { + return false; +@@ -314,6 +336,7 @@ + p_70014_1_.func_74777_a("Health", (short)this.field_70291_e); + p_70014_1_.func_74777_a("Age", (short)this.field_70292_b); + p_70014_1_.func_74777_a("PickupDelay", (short)this.field_145804_b); ++ p_70014_1_.func_74768_a("Lifespan", lifespan); + + if (this.func_145800_j() != null) + { +@@ -358,22 +381,30 @@ + { + this.func_70106_y(); + } ++ if (p_70037_1_.func_74764_b("Lifespan")) lifespan = p_70037_1_.func_74762_e("Lifespan"); + } + + public void func_70100_b_(EntityPlayer p_70100_1_) + { + if (!this.field_70170_p.field_72995_K) + { ++ if (this.field_145804_b > 0) return; + ItemStack itemstack = this.func_92059_d(); + Item item = itemstack.func_77973_b(); + int i = itemstack.func_190916_E(); + +- if (this.field_145804_b == 0 && (this.field_145802_g == null || 6000 - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && p_70100_1_.field_71071_by.func_70441_a(itemstack)) ++ int hook = net.minecraftforge.event.ForgeEventFactory.onItemPickup(this, p_70100_1_); ++ if (hook < 0) return; ++ ItemStack clone = itemstack.func_77946_l(); ++ ++ if (this.field_145804_b <= 0 && (this.field_145802_g == null || lifespan - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && (hook == 1 || i <= 0 || p_70100_1_.field_71071_by.func_70441_a(itemstack) || clone.func_190916_E() > this.func_92059_d().func_190916_E())) + { +- p_70100_1_.func_71001_a(this, i); ++ clone.func_190920_e(clone.func_190916_E() - this.func_92059_d().func_190916_E()); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerItemPickupEvent(p_70100_1_, this, clone); + + if (itemstack.func_190926_b()) + { ++ p_70100_1_.func_71001_a(this, i); + this.func_70106_y(); + itemstack.func_190920_e(i); + } +@@ -394,9 +425,9 @@ + } + + @Nullable +- public Entity func_184204_a(int p_184204_1_) ++ public Entity changeDimension(int p_184204_1_, net.minecraftforge.common.util.ITeleporter teleporter) + { +- Entity entity = super.func_184204_a(p_184204_1_); ++ Entity entity = super.changeDimension(p_184204_1_, teleporter); + + if (!this.field_70170_p.field_72995_K && entity instanceof EntityItem) + { +@@ -476,6 +507,6 @@ + public void func_174870_v() + { + this.func_174871_r(); +- this.field_70292_b = 5999; ++ this.field_70292_b = func_92059_d().func_77973_b().getEntityLifespan(func_92059_d(), field_70170_p) - 1; + } + } diff --git a/patches_old/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches_old/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch new file mode 100644 index 000000000..c1ef384ed --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -0,0 +1,63 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java +@@ -138,10 +138,10 @@ + } + + @Nullable +- public Entity func_184204_a(int p_184204_1_) ++ public Entity changeDimension(int p_184204_1_, net.minecraftforge.common.util.ITeleporter teleporter) + { + this.field_94112_b = false; +- return super.func_184204_a(p_184204_1_); ++ return super.changeDimension(p_184204_1_, teleporter); + } + + public void func_70106_y() +@@ -202,6 +202,7 @@ + + public boolean func_184230_a(EntityPlayer p_184230_1_, EnumHand p_184230_2_) + { ++ if (super.func_184230_a(p_184230_1_, p_184230_2_)) return true; + if (!this.field_70170_p.field_72995_K) + { + p_184230_1_.func_71007_a(this); +@@ -270,17 +271,37 @@ + random = new Random(this.field_184291_d); + } + +- LootContext.Builder lootcontext$builder = new LootContext.Builder((WorldServer)this.field_70170_p); ++ LootContext.Builder lootcontext$builder = new LootContext.Builder((WorldServer)this.field_70170_p).func_186472_a(this); // Forge: add looted entity to LootContext + + if (p_184288_1_ != null) + { +- lootcontext$builder.func_186469_a(p_184288_1_.func_184817_da()); ++ lootcontext$builder.func_186469_a(p_184288_1_.func_184817_da()).func_186470_a(p_184288_1_); // Forge: add player to LootContext + } + + loottable.func_186460_a(this, random, lootcontext$builder.func_186471_a()); + } + } + ++ public net.minecraftforge.items.IItemHandler itemHandler = new net.minecraftforge.items.wrapper.InvWrapper(this); ++ ++ @SuppressWarnings("unchecked") ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ if (capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) ++ { ++ return (T) itemHandler; ++ } ++ return super.getCapability(capability, facing); ++ } ++ ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); ++ } ++ + public void func_174888_l() + { + this.func_184288_f((EntityPlayer)null); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityCreeper.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityCreeper.java.patch new file mode 100644 index 000000000..260fcb2ad --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityCreeper.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityCreeper.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityCreeper.java +@@ -265,7 +265,7 @@ + { + if (!this.field_70170_p.field_72995_K) + { +- boolean flag = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing"); ++ boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this); + float f = this.func_70830_n() ? 2.0F : 1.0F; + this.field_70729_aU = true; + this.field_70170_p.func_72876_a(this, this.field_70165_t, this.field_70163_u, this.field_70161_v, (float)this.field_82226_g * f, flag); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch new file mode 100644 index 000000000..ce0edefef --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -0,0 +1,50 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityEnderman.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEnderman.java +@@ -267,7 +267,9 @@ + + private boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) + { +- boolean flag = this.func_184595_k(p_70825_1_, p_70825_3_, p_70825_5_); ++ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false; ++ boolean flag = this.func_184595_k(event.getTargetX(), event.getTargetY(), event.getTargetZ()); + + if (flag) + { +@@ -354,6 +356,18 @@ + } + } + ++ /*===================================== Forge Start ==============================*/ ++ public static void setCarriable(Block block, boolean canCarry) ++ { ++ if (canCarry) field_70827_d.add(block); ++ else field_70827_d.remove(block); ++ } ++ public static boolean getCarriable(Block block) ++ { ++ return field_70827_d.contains(block); ++ } ++ /*===================================== Forge End ==============================*/ ++ + public boolean func_70823_r() + { + return ((Boolean)this.field_70180_af.func_187225_a(field_184719_bw)).booleanValue(); +@@ -486,7 +500,7 @@ + { + return false; + } +- else if (!this.field_179475_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179475_a.field_70170_p, this.field_179475_a)) + { + return false; + } +@@ -551,7 +565,7 @@ + { + return false; + } +- else if (!this.field_179473_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179473_a.field_70170_p, this.field_179473_a)) + { + return false; + } diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch new file mode 100644 index 000000000..f30aa0699 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityEvoker.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEvoker.java +@@ -369,7 +369,7 @@ + { + return false; + } +- else if (!EntityEvoker.this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(EntityEvoker.this.field_70170_p, EntityEvoker.this)) + { + return false; + } diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch new file mode 100644 index 000000000..0fe2a53a9 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityIronGolem.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityIronGolem.java +@@ -294,7 +294,7 @@ + { + if (!this.func_70850_q() && this.field_70717_bb != null && this.field_70857_d != null) + { +- this.field_70857_d.func_82688_a(this.field_70717_bb.func_70005_c_(), -5); ++ this.field_70857_d.modifyPlayerReputation(this.field_70717_bb.func_110124_au(), -5); + } + + super.func_70645_a(p_70645_1_); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch new file mode 100644 index 000000000..2a2e07af6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java +@@ -96,6 +96,7 @@ + { + this.field_70181_x = (double)(0.42F + (float)this.func_70809_q() * 0.1F); + this.field_70160_al = true; ++ net.minecraftforge.common.ForgeHooks.onLivingJump(this); + } + + protected void func_180466_bG() diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityMob.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityMob.java.patch new file mode 100644 index 000000000..de621ab30 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityMob.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityMob.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityMob.java +@@ -120,13 +120,13 @@ + ItemStack itemstack = this.func_184614_ca(); + ItemStack itemstack1 = entityplayer.func_184587_cr() ? entityplayer.func_184607_cu() : ItemStack.field_190927_a; + +- if (!itemstack.func_190926_b() && !itemstack1.func_190926_b() && itemstack.func_77973_b() instanceof ItemAxe && itemstack1.func_77973_b() == Items.field_185159_cQ) ++ if (!itemstack.func_190926_b() && !itemstack1.func_190926_b() && itemstack.func_77973_b().canDisableShield(itemstack, itemstack1, entityplayer, this) && itemstack1.func_77973_b().isShield(itemstack1, entityplayer)) + { + float f1 = 0.25F + (float)EnchantmentHelper.func_185293_e(this) * 0.05F; + + if (this.field_70146_Z.nextFloat() < f1) + { +- entityplayer.func_184811_cZ().func_185145_a(Items.field_185159_cQ, 100); ++ entityplayer.func_184811_cZ().func_185145_a(itemstack1.func_77973_b(), 100); + this.field_70170_p.func_72960_a(entityplayer, (byte)30); + } + } diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch new file mode 100644 index 000000000..c9e4dd32a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch @@ -0,0 +1,16 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityShulker.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityShulker.java +@@ -426,6 +426,13 @@ + + if (flag) + { ++ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, blockpos1.func_177958_n(), blockpos1.func_177956_o(), blockpos1.func_177952_p(), 0); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) flag = false; ++ blockpos1 = new BlockPos(event.getTargetX(), event.getTargetY(), event.getTargetZ()); ++ } ++ ++ if (flag) ++ { + this.func_184185_a(SoundEvents.field_187791_eX, 1.0F, 1.0F); + this.field_70180_af.func_187227_b(field_184701_b, Optional.of(blockpos1)); + this.field_70180_af.func_187227_b(field_184702_c, Byte.valueOf((byte)0)); diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntitySilverfish.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntitySilverfish.java.patch new file mode 100644 index 000000000..a2baf2bc7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntitySilverfish.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntitySilverfish.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySilverfish.java +@@ -184,7 +184,7 @@ + { + Random random = this.field_75457_a.func_70681_au(); + +- if (this.field_75457_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing") && random.nextInt(10) == 0) ++ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_75457_a.field_70170_p, this.field_75457_a) && random.nextInt(10) == 0) + { + this.field_179483_b = EnumFacing.func_176741_a(random); + BlockPos blockpos = (new BlockPos(this.field_75457_a.field_70165_t, this.field_75457_a.field_70163_u + 0.5D, this.field_75457_a.field_70161_v)).func_177972_a(this.field_179483_b); +@@ -273,7 +273,7 @@ + + if (iblockstate.func_177230_c() == Blocks.field_150418_aU) + { +- if (world.func_82736_K().func_82766_b("mobGriefing")) ++ if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(world, this.field_179464_a)) + { + world.func_175655_b(blockpos1, true); + } diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch new file mode 100644 index 000000000..ee7a4b241 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntitySlime.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySlime.java +@@ -137,7 +137,7 @@ + if (this.field_70122_E && !this.field_175452_bi) + { + int i = this.func_70809_q(); +- ++ 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.field_70146_Z.nextFloat() * ((float)Math.PI * 2F); +@@ -304,7 +304,7 @@ + BlockPos blockpos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v)); + Chunk chunk = this.field_70170_p.func_175726_f(blockpos); + +- if (this.field_70170_p.func_72912_H().func_76067_t() == WorldType.field_77138_c && this.field_70146_Z.nextInt(4) != 1) ++ if (this.field_70170_p.func_72912_H().func_76067_t().handleSlimeSpawnReduction(field_70146_Z, field_70170_p)) + { + return false; + } +@@ -370,6 +370,14 @@ + return this.func_189101_db() ? SoundEvents.field_189110_fE : SoundEvents.field_187882_fq; + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * Called when the slime spawns particles on landing, see onUpdate. ++ * Return true to prevent the spawning of the default particles. ++ */ ++ protected boolean spawnCustomParticles() { return false; } ++ /* ======================================== FORGE END =====================================*/ ++ + static class AISlimeAttack extends EntityAIBase + { + private final EntitySlime field_179466_a; diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch new file mode 100644 index 000000000..632fa3575 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntitySnowman.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySnowman.java +@@ -31,7 +31,7 @@ + import net.minecraft.world.World; + import net.minecraft.world.storage.loot.LootTableList; + +-public class EntitySnowman extends EntityGolem implements IRangedAttackMob ++public class EntitySnowman extends EntityGolem implements IRangedAttackMob, net.minecraftforge.common.IShearable + { + private static final DataParameter field_184749_a = EntityDataManager.func_187226_a(EntitySnowman.class, DataSerializers.field_187191_a); + +@@ -104,7 +104,7 @@ + this.func_70097_a(DamageSource.field_76370_b, 1.0F); + } + +- if (!this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) + { + return; + } +@@ -152,7 +152,7 @@ + { + ItemStack itemstack = p_184645_1_.func_184586_b(p_184645_2_); + +- if (itemstack.func_77973_b() == Items.field_151097_aZ && this.func_184748_o() && !this.field_70170_p.field_72995_K) ++ if (false && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_184748_o() && !this.field_70170_p.field_72995_K) //Forge: Moved to onSheared + { + this.func_184747_a(false); + itemstack.func_77972_a(1, p_184645_1_); +@@ -198,6 +198,14 @@ + return SoundEvents.field_187801_fC; + } + ++ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos) { return this.func_184748_o(); } ++ @Override ++ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) ++ { ++ this.func_184747_a(false); ++ return com.google.common.collect.Lists.newArrayList(); ++ } ++ + public void func_184724_a(boolean p_184724_1_) + { + } diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch new file mode 100644 index 000000000..264639a7b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -0,0 +1,67 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityZombie.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityZombie.java +@@ -98,7 +98,7 @@ + this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.23000000417232513D); + this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D); + this.func_110148_a(SharedMonsterAttributes.field_188791_g).func_111128_a(2.0D); +- this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * 0.10000000149011612D); ++ this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * net.minecraftforge.common.ForgeModContainer.zombieSummonBaseChance); + } + + protected void func_70088_a() +@@ -239,12 +239,24 @@ + entitylivingbase = (EntityLivingBase)p_70097_1_.func_76346_g(); + } + +- if (entitylivingbase != null && this.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) ++ int i = MathHelper.func_76128_c(this.field_70165_t); ++ int j = MathHelper.func_76128_c(this.field_70163_u); ++ int k = MathHelper.func_76128_c(this.field_70161_v); ++ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent summonAid = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, entitylivingbase, this.func_110148_a(field_110186_bp).func_111126_e()); ++ 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.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) + { +- int i = MathHelper.func_76128_c(this.field_70165_t); +- int j = MathHelper.func_76128_c(this.field_70163_u); +- int k = MathHelper.func_76128_c(this.field_70161_v); +- EntityZombie entityzombie = new EntityZombie(this.field_70170_p); ++ EntityZombie entityzombie; ++ if (summonAid.getCustomSummonedAid() != null && summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) ++ { ++ entityzombie = summonAid.getCustomSummonedAid(); ++ } ++ else ++ { ++ entityzombie = new EntityZombie(this.field_70170_p); ++ } + + for (int l = 0; l < 50; ++l) + { +@@ -252,14 +264,14 @@ + int j1 = j + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1); + int k1 = k + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1); + +- if (this.field_70170_p.func_180495_p(new BlockPos(i1, j1 - 1, k1)).func_185896_q() && this.field_70170_p.func_175671_l(new BlockPos(i1, j1, k1)) < 10) ++ if (this.field_70170_p.func_180495_p(new BlockPos(i1, j1 - 1, k1)).isSideSolid(this.field_70170_p, new BlockPos(i1, j1 - 1, k1), net.minecraft.util.EnumFacing.UP) && this.field_70170_p.func_175671_l(new BlockPos(i1, j1, k1)) < 10) + { + entityzombie.func_70107_b((double)i1, (double)j1, (double)k1); + + if (!this.field_70170_p.func_175636_b((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_72917_a(entityzombie.func_174813_aQ(), entityzombie) && this.field_70170_p.func_184144_a(entityzombie, entityzombie.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(entityzombie.func_174813_aQ())) + { + this.field_70170_p.func_72838_d(entityzombie); +- entityzombie.func_70624_b(entitylivingbase); ++ if (entitylivingbase != null) entityzombie.func_70624_b(entitylivingbase); + entityzombie.func_180482_a(this.field_70170_p.func_175649_E(new BlockPos(entityzombie)), (IEntityLivingData)null); + this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + entityzombie.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); +@@ -435,7 +447,7 @@ + + if (p_180482_2_ == null) + { +- p_180482_2_ = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < 0.05F); ++ p_180482_2_ = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < net.minecraftforge.common.ForgeModContainer.zombieBabyChance); + } + + if (p_180482_2_ instanceof EntityZombie.GroupData) diff --git a/patches_old/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch b/patches_old/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch new file mode 100644 index 000000000..a54d82718 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch @@ -0,0 +1,86 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java +@@ -53,11 +53,14 @@ + public void func_190733_a(int p_190733_1_) + { + this.field_70180_af.func_187227_b(field_190739_c, Integer.valueOf(p_190733_1_)); ++ net.minecraftforge.fml.common.registry.VillagerRegistry.onSetProfession(this, p_190733_1_); + } + ++ //Use Forge Variant below ++ @Deprecated + public int func_190736_dl() + { +- return Math.max(((Integer)this.field_70180_af.func_187225_a(field_190739_c)).intValue() % 6, 0); ++ return Math.max(((Integer)this.field_70180_af.func_187225_a(field_190739_c)).intValue(), 0); + } + + public static void func_190737_b(DataFixer p_190737_0_) +@@ -69,6 +72,7 @@ + { + super.func_70014_b(p_70014_1_); + p_70014_1_.func_74768_a("Profession", this.func_190736_dl()); ++ p_70014_1_.func_74778_a("ProfessionName", this.getForgeProfession().getRegistryName().toString()); + p_70014_1_.func_74768_a("ConversionTime", this.func_82230_o() ? this.field_82234_d : -1); + + if (this.field_191992_by != null) +@@ -81,6 +85,12 @@ + { + super.func_70037_a(p_70037_1_); + this.func_190733_a(p_70037_1_.func_74762_e("Profession")); ++ if (p_70037_1_.func_74764_b("ProfessionName")) ++ { ++ net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession p = net.minecraftforge.fml.common.registry.ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new net.minecraft.util.ResourceLocation(p_70037_1_.func_74779_i("ProfessionName"))); ++ if (p == null) p = net.minecraftforge.fml.common.registry.VillagerRegistry.FARMER; ++ this.setForgeProfession(p); ++ } + + if (p_70037_1_.func_150297_b("ConversionTime", 99) && p_70037_1_.func_74762_e("ConversionTime") > -1) + { +@@ -175,7 +185,7 @@ + { + EntityVillager entityvillager = new EntityVillager(this.field_70170_p); + entityvillager.func_82149_j(this); +- entityvillager.func_70938_b(this.func_190736_dl()); ++ entityvillager.setProfession(this.getForgeProfession()); + entityvillager.func_190672_a(this.field_70170_p.func_175649_E(new BlockPos(entityvillager)), (IEntityLivingData)null, false); + entityvillager.func_82187_q(); + +@@ -278,4 +288,37 @@ + { + return ItemStack.field_190927_a; + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ ++ @Nullable ++ private net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession prof; ++ public void setForgeProfession(net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession prof) ++ { ++ this.prof = prof; ++ this.func_190733_a(net.minecraftforge.fml.common.registry.VillagerRegistry.getId(prof)); ++ } ++ ++ public net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession getForgeProfession() ++ { ++ if (this.prof == null) ++ { ++ this.prof = net.minecraftforge.fml.common.registry.VillagerRegistry.getById(this.func_190736_dl()); ++ if (this.prof == null) ++ return net.minecraftforge.fml.common.registry.VillagerRegistry.FARMER; ++ } ++ return this.prof; ++ } ++ ++ @Override ++ public void func_184206_a(DataParameter key) ++ { ++ super.func_184206_a(key); ++ if (key.equals(field_190739_c)) ++ { ++ net.minecraftforge.fml.common.registry.VillagerRegistry.onSetProfession(this, this.field_70180_af.func_187225_a(field_190739_c)); ++ } ++ } ++ ++ /* ======================================== FORGE END =====================================*/ + } diff --git a/patches_old/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch new file mode 100644 index 000000000..fa9cd4ce9 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch @@ -0,0 +1,33 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/AbstractHorse.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/AbstractHorse.java +@@ -312,6 +312,7 @@ + + this.field_110296_bG.func_110134_a(this); + this.func_110232_cE(); ++ this.itemHandler = new net.minecraftforge.items.wrapper.InvWrapper(this.field_110296_bG); + } + + protected void func_110232_cE() +@@ -1227,4 +1228,22 @@ + + return p_180482_2_; + } ++ ++ // FORGE ++ private net.minecraftforge.items.IItemHandler itemHandler = null; // Initialized by initHorseChest above. ++ ++ @SuppressWarnings("unchecked") ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ if (capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T) itemHandler; ++ return super.getCapability(capability, facing); ++ } ++ ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch new file mode 100644 index 000000000..fdce8b1f5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch @@ -0,0 +1,80 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityHorse.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityHorse.java +@@ -34,6 +34,7 @@ + private static final UUID field_184786_bD = UUID.fromString("556E1665-8B10-40C8-8F9D-CF9B1667F295"); + private static final DataParameter field_184789_bG = EntityDataManager.func_187226_a(EntityHorse.class, DataSerializers.field_187192_b); + private static final DataParameter field_184791_bI = EntityDataManager.func_187226_a(EntityHorse.class, DataSerializers.field_187192_b); ++ private static final DataParameter HORSE_ARMOR_STACK = EntityDataManager.func_187226_a(EntityHorse.class, DataSerializers.field_187196_f); + private static final String[] field_110268_bz = new String[] {"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; + private static final String[] field_110269_bA = new String[] {"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; + private static final String[] field_110291_bB = new String[] {null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; +@@ -51,6 +52,7 @@ + super.func_70088_a(); + this.field_70180_af.func_187214_a(field_184789_bG, Integer.valueOf(0)); + this.field_70180_af.func_187214_a(field_184791_bI, Integer.valueOf(HorseArmorType.NONE.func_188579_a())); ++ this.field_70180_af.func_187214_a(HORSE_ARMOR_STACK, ItemStack.field_190927_a); + } + + public static void func_189803_b(DataFixer p_189803_0_) +@@ -79,7 +81,7 @@ + { + ItemStack itemstack = new ItemStack(p_70037_1_.func_74775_l("ArmorItem")); + +- if (!itemstack.func_190926_b() && HorseArmorType.func_188577_b(itemstack.func_77973_b())) ++ if (!itemstack.func_190926_b() && func_190682_f(itemstack)) + { + this.field_110296_bG.func_70299_a(1, itemstack); + } +@@ -110,11 +112,12 @@ + int i = this.func_110202_bQ(); + int j = (i & 255) % 7; + int k = ((i & 65280) >> 8) % 5; +- HorseArmorType horsearmortype = this.func_184783_dl(); ++ ItemStack armorStack = this.field_70180_af.func_187225_a(HORSE_ARMOR_STACK); ++ String texture = !armorStack.func_190926_b() ? armorStack.func_77973_b().getHorseArmorTexture(this, armorStack) : HorseArmorType.func_188575_a(this.field_70180_af.func_187225_a(field_184791_bI)).func_188574_d(); //If armorStack is empty, the server is vanilla so the texture should be determined the vanilla way + this.field_110280_bR[0] = field_110268_bz[j]; + this.field_110280_bR[1] = field_110291_bB[k]; +- this.field_110280_bR[2] = horsearmortype.func_188574_d(); +- this.field_110286_bQ = "horse/" + field_110269_bA[j] + field_110292_bC[k] + horsearmortype.func_188573_b(); ++ this.field_110280_bR[2] = texture; ++ this.field_110286_bQ = "horse/" + field_110269_bA[j] + field_110292_bC[k] + texture; + } + + @SideOnly(Side.CLIENT) +@@ -149,6 +152,7 @@ + { + HorseArmorType horsearmortype = HorseArmorType.func_188580_a(p_146086_1_); + this.field_70180_af.func_187227_b(field_184791_bI, Integer.valueOf(horsearmortype.func_188579_a())); ++ this.field_70180_af.func_187227_b(HORSE_ARMOR_STACK, p_146086_1_); + this.func_110230_cF(); + + if (!this.field_70170_p.field_72995_K) +@@ -165,7 +169,9 @@ + + public HorseArmorType func_184783_dl() + { +- return HorseArmorType.func_188575_a(((Integer)this.field_70180_af.func_187225_a(field_184791_bI)).intValue()); ++ HorseArmorType armor = HorseArmorType.func_188580_a(this.field_70180_af.func_187225_a(HORSE_ARMOR_STACK)); //First check the Forge armor DataParameter ++ if (armor == HorseArmorType.NONE) armor = HorseArmorType.func_188575_a(this.field_70180_af.func_187225_a(field_184791_bI)); //If the Forge armor DataParameter returns NONE, fallback to the vanilla armor DataParameter. This is necessary to prevent issues with Forge clients connected to vanilla servers. ++ return armor; + } + + public void func_76316_a(IInventory p_76316_1_) +@@ -207,6 +213,8 @@ + this.field_70180_af.func_187230_e(); + this.func_110230_cF(); + } ++ ItemStack armor = this.field_110296_bG.func_70301_a(1); ++ if (func_190682_f(armor)) armor.func_77973_b().onHorseArmorTick(field_70170_p, this, armor); + } + + protected SoundEvent func_184639_G() +@@ -381,7 +389,7 @@ + + public boolean func_190682_f(ItemStack p_190682_1_) + { +- return HorseArmorType.func_188577_b(p_190682_1_.func_77973_b()); ++ return HorseArmorType.isHorseArmor(p_190682_1_); + } + + @Nullable diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch new file mode 100644 index 000000000..ad9f10775 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -0,0 +1,56 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityMooshroom.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityMooshroom.java +@@ -16,7 +16,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 p_i1687_1_) + { +@@ -49,7 +49,7 @@ + + return true; + } +- else if (itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) ++ else if (false && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) //Forge Disable, Moved to onSheared + { + this.func_70106_y(); + this.field_70170_p.func_175688_a(EnumParticleTypes.EXPLOSION_LARGE, this.field_70165_t, this.field_70163_u + (double)(this.field_70131_O / 2.0F), this.field_70161_v, 0.0D, 0.0D, 0.0D); +@@ -90,6 +90,35 @@ + return new EntityMooshroom(this.field_70170_p); + } + ++ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.math.BlockPos pos){ return func_70874_b() >= 0; } ++ @Override ++ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.math.BlockPos pos, int fortune) ++ { ++ this.func_70106_y(); ++ ((net.minecraft.world.WorldServer)this.field_70170_p).func_180505_a(EnumParticleTypes.EXPLOSION_LARGE, false, this.field_70165_t, this.field_70163_u + (double)(this.field_70131_O / 2.0F), this.field_70161_v, 1, 0.0D, 0.0D, 0.0D, 0.0D); ++ ++ EntityCow entitycow = new EntityCow(this.field_70170_p); ++ entitycow.func_70012_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, this.field_70125_A); ++ entitycow.func_70606_j(this.func_110143_aJ()); ++ entitycow.field_70761_aq = this.field_70761_aq; ++ ++ if (this.func_145818_k_()) ++ { ++ entitycow.func_96094_a(this.func_95999_t()); ++ } ++ ++ this.field_70170_p.func_72838_d(entitycow); ++ ++ java.util.List ret = new java.util.ArrayList(); ++ for (int i = 0; i < 5; ++i) ++ { ++ ret.add(new ItemStack(Blocks.field_150337_Q)); ++ } ++ ++ this.func_184185_a(SoundEvents.field_187784_dt, 1.0F, 1.0F); ++ return ret; ++ } ++ + @Nullable + protected ResourceLocation func_184647_J() + { diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch new file mode 100644 index 000000000..2a439cff2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityOcelot.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java +@@ -222,7 +222,7 @@ + + if (!this.field_70170_p.field_72995_K) + { +- if (this.field_70146_Z.nextInt(3) == 0) ++ if (this.field_70146_Z.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_184645_1_)) + { + this.func_193101_c(p_184645_1_); + this.func_70912_b(1 + this.field_70170_p.field_73012_v.nextInt(3)); +@@ -320,7 +320,7 @@ + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos.func_177977_b()); + Block block = iblockstate.func_177230_c(); + +- if (block == Blocks.field_150349_c || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (block == Blocks.field_150349_c || block.isLeaves(iblockstate, this.field_70170_p, blockpos.func_177977_b())) + { + return true; + } diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch new file mode 100644 index 000000000..3f5e02cc6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch @@ -0,0 +1,134 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityParrot.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityParrot.java +@@ -1,6 +1,7 @@ + package net.minecraft.entity.passive; + + import com.google.common.base.Predicate; ++import com.google.common.collect.Maps; + import com.google.common.collect.Sets; + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +@@ -89,12 +90,12 @@ + { + public boolean apply(@Nullable EntityLiving p_apply_1_) + { +- return p_apply_1_ != null && EntityParrot.field_192017_bK.containsKey(EntityList.field_191308_b.func_148757_b(p_apply_1_.getClass())); ++ return p_apply_1_ != null && EntityParrot.MIMIC_SOUNDS.containsKey(p_apply_1_.getClass()); + } + }; + private static final Item field_192015_bI = Items.field_151106_aX; + private static final Set field_192016_bJ = Sets.newHashSet(Items.field_151014_N, Items.field_151081_bc, Items.field_151080_bb, Items.field_185163_cU); +- private static final Int2ObjectMap field_192017_bK = new Int2ObjectOpenHashMap(32); ++ private static final java.util.Map, SoundEvent> MIMIC_SOUNDS = Maps.newHashMapWithExpectedSize(32); + public float field_192008_bB; + public float field_192009_bC; + public float field_192010_bD; +@@ -214,7 +215,7 @@ + + if (!entityliving.func_174814_R()) + { +- SoundEvent soundevent = func_191999_g(EntityList.field_191308_b.func_148757_b(entityliving.getClass())); ++ SoundEvent soundevent = MIMIC_SOUNDS.get(entityliving.getClass()); + p_192006_0_.func_184148_a((EntityPlayer)null, p_192006_1_.field_70165_t, p_192006_1_.field_70163_u, p_192006_1_.field_70161_v, soundevent, p_192006_1_.func_184176_by(), 0.7F, func_192000_b(p_192006_0_.field_73012_v)); + return true; + } +@@ -246,7 +247,7 @@ + + if (!this.field_70170_p.field_72995_K) + { +- if (this.field_70146_Z.nextInt(10) == 0) ++ if (this.field_70146_Z.nextInt(10) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_184645_1_)) + { + this.func_193101_c(p_184645_1_); + this.func_70908_e(true); +@@ -345,8 +346,9 @@ + { + if (p_192003_0_.nextInt(1000) == 0) + { +- List list = new ArrayList(field_192017_bK.keySet()); +- return func_191999_g(((Integer)list.get(p_192003_0_.nextInt(list.size()))).intValue()); ++ List list = new ArrayList(MIMIC_SOUNDS.values()); ++ SoundEvent ret = list.get(p_192003_0_.nextInt(list.size())); ++ return ret == null ? SoundEvents.field_192792_ep : ret; + } + else + { +@@ -354,11 +356,6 @@ + } + } + +- public static SoundEvent func_191999_g(int p_191999_0_) +- { +- return field_192017_bK.containsKey(p_191999_0_) ? (SoundEvent)field_192017_bK.get(p_191999_0_) : SoundEvents.field_192792_ep; +- } +- + protected SoundEvent func_184601_bQ(DamageSource p_184601_1_) + { + return SoundEvents.field_192794_er; +@@ -471,33 +468,38 @@ + + static + { +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityBlaze.class), SoundEvents.field_193791_eM); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityCaveSpider.class), SoundEvents.field_193813_fc); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityCreeper.class), SoundEvents.field_193792_eN); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityElderGuardian.class), SoundEvents.field_193793_eO); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityDragon.class), SoundEvents.field_193794_eP); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityEnderman.class), SoundEvents.field_193795_eQ); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityEndermite.class), SoundEvents.field_193796_eR); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityEvoker.class), SoundEvents.field_193797_eS); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityGhast.class), SoundEvents.field_193798_eT); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityHusk.class), SoundEvents.field_193799_eU); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityIllusionIllager.class), SoundEvents.field_193800_eV); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityMagmaCube.class), SoundEvents.field_193801_eW); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityPigZombie.class), SoundEvents.field_193822_fl); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityPolarBear.class), SoundEvents.field_193802_eX); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityShulker.class), SoundEvents.field_193803_eY); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntitySilverfish.class), SoundEvents.field_193804_eZ); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntitySkeleton.class), SoundEvents.field_193811_fa); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntitySlime.class), SoundEvents.field_193812_fb); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntitySpider.class), SoundEvents.field_193813_fc); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityStray.class), SoundEvents.field_193814_fd); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityVex.class), SoundEvents.field_193815_fe); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityVindicator.class), SoundEvents.field_193816_ff); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityWitch.class), SoundEvents.field_193817_fg); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityWither.class), SoundEvents.field_193818_fh); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityWitherSkeleton.class), SoundEvents.field_193819_fi); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityWolf.class), SoundEvents.field_193820_fj); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityZombie.class), SoundEvents.field_193821_fk); +- field_192017_bK.put(EntityList.field_191308_b.func_148757_b(EntityZombieVillager.class), SoundEvents.field_193823_fm); ++ registerMimicSound(EntityBlaze.class, SoundEvents.field_193791_eM); ++ registerMimicSound(EntityCaveSpider.class, SoundEvents.field_193813_fc); ++ registerMimicSound(EntityCreeper.class, SoundEvents.field_193792_eN); ++ registerMimicSound(EntityElderGuardian.class, SoundEvents.field_193793_eO); ++ registerMimicSound(EntityDragon.class, SoundEvents.field_193794_eP); ++ registerMimicSound(EntityEnderman.class, SoundEvents.field_193795_eQ); ++ registerMimicSound(EntityEndermite.class, SoundEvents.field_193796_eR); ++ registerMimicSound(EntityEvoker.class, SoundEvents.field_193797_eS); ++ registerMimicSound(EntityGhast.class, SoundEvents.field_193798_eT); ++ registerMimicSound(EntityHusk.class, SoundEvents.field_193799_eU); ++ registerMimicSound(EntityIllusionIllager.class, SoundEvents.field_193800_eV); ++ registerMimicSound(EntityMagmaCube.class, SoundEvents.field_193801_eW); ++ registerMimicSound(EntityPigZombie.class, SoundEvents.field_193822_fl); ++ registerMimicSound(EntityPolarBear.class, SoundEvents.field_193802_eX); ++ registerMimicSound(EntityShulker.class, SoundEvents.field_193803_eY); ++ registerMimicSound(EntitySilverfish.class, SoundEvents.field_193804_eZ); ++ registerMimicSound(EntitySkeleton.class, SoundEvents.field_193811_fa); ++ registerMimicSound(EntitySlime.class, SoundEvents.field_193812_fb); ++ registerMimicSound(EntitySpider.class, SoundEvents.field_193813_fc); ++ registerMimicSound(EntityStray.class, SoundEvents.field_193814_fd); ++ registerMimicSound(EntityVex.class, SoundEvents.field_193815_fe); ++ registerMimicSound(EntityVindicator.class, SoundEvents.field_193816_ff); ++ registerMimicSound(EntityWitch.class, SoundEvents.field_193817_fg); ++ registerMimicSound(EntityWither.class, SoundEvents.field_193818_fh); ++ registerMimicSound(EntityWitherSkeleton.class, SoundEvents.field_193819_fi); ++ registerMimicSound(EntityWolf.class, SoundEvents.field_193820_fj); ++ registerMimicSound(EntityZombie.class, SoundEvents.field_193821_fk); ++ registerMimicSound(EntityZombieVillager.class, SoundEvents.field_193823_fm); + } ++ ++ public static void registerMimicSound(Class cls, SoundEvent sound) ++ { ++ MIMIC_SOUNDS.put(cls, sound); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch new file mode 100644 index 000000000..8f525fd80 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityRabbit.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityRabbit.java +@@ -551,7 +551,7 @@ + { + if (this.field_179496_a <= 0) + { +- if (!this.field_179500_c.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179500_c.field_70170_p, this.field_179500_c)) + { + return false; + } diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch new file mode 100644 index 000000000..88da777f9 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -0,0 +1,42 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntitySheep.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntitySheep.java +@@ -46,7 +46,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 field_90016_e = new InventoryCrafting(new Container() +@@ -189,7 +189,7 @@ + { + ItemStack itemstack = p_184645_1_.func_184586_b(p_184645_2_); + +- if (itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) ++ if (false && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) //Forge: Moved to onSheared + { + if (!this.field_70170_p.field_72995_K) + { +@@ -364,6 +364,21 @@ + return p_180482_2_; + } + ++ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return !this.func_70892_o() && !this.func_70631_g_(); } ++ @Override ++ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) ++ { ++ this.func_70893_e(true); ++ int i = 1 + this.field_70146_Z.nextInt(3); ++ ++ java.util.List ret = new java.util.ArrayList(); ++ for (int j = 0; j < i; ++j) ++ ret.add(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, this.func_175509_cj().func_176765_a())); ++ ++ this.func_184185_a(SoundEvents.field_187763_eJ, 1.0F, 1.0F); ++ return ret; ++ } ++ + private EnumDyeColor func_175511_a(EntityAnimal p_175511_1_, EntityAnimal p_175511_2_) + { + int i = ((EntitySheep)p_175511_1_).func_175509_cj().func_176767_b(); diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch new file mode 100644 index 000000000..cdc768b4e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch @@ -0,0 +1,204 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java +@@ -109,7 +109,7 @@ + private boolean field_70959_by; + private boolean field_175565_bs; + private int field_70956_bz; +- private String field_82189_bL; ++ private java.util.UUID field_82189_bL; + private int field_175563_bv; + private int field_175562_bw; + private boolean field_82190_bM; +@@ -234,7 +234,7 @@ + if (this.field_70954_d != null && this.field_82189_bL != null) + { + this.field_70170_p.func_72960_a(this, (byte)14); +- this.field_70954_d.func_82688_a(this.field_82189_bL, 1); ++ this.field_70954_d.modifyPlayerReputation(this.field_82189_bL, 1); + } + } + +@@ -255,7 +255,7 @@ + itemstack.func_111282_a(p_184645_1_, this, p_184645_2_); + return true; + } +- else if (!this.func_190669_a(itemstack, this.getClass()) && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_()) ++ else if (!this.func_190669_a(itemstack, this.getClass()) && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_() && !p_184645_1_.func_70093_af()) + { + if (this.field_70963_i == null) + { +@@ -327,6 +327,7 @@ + { + super.func_70014_b(p_70014_1_); + p_70014_1_.func_74768_a("Profession", this.func_70946_n()); ++ p_70014_1_.func_74778_a("ProfessionName", this.getProfessionForge().getRegistryName().toString()); + p_70014_1_.func_74768_a("Riches", this.field_70956_bz); + p_70014_1_.func_74768_a("Career", this.field_175563_bv); + p_70014_1_.func_74768_a("CareerLevel", this.field_175562_bw); +@@ -356,6 +357,14 @@ + { + super.func_70037_a(p_70037_1_); + this.func_70938_b(p_70037_1_.func_74762_e("Profession")); ++ if (p_70037_1_.func_74764_b("ProfessionName")) ++ { ++ net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession p = ++ net.minecraftforge.fml.common.registry.ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new net.minecraft.util.ResourceLocation(p_70037_1_.func_74779_i("ProfessionName"))); ++ if (p == null) ++ p = net.minecraftforge.fml.common.registry.ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new net.minecraft.util.ResourceLocation("minecraft:farmer")); ++ this.setProfession(p); ++ } + this.field_70956_bz = p_70037_1_.func_74762_e("Riches"); + this.field_175563_bv = p_70037_1_.func_74762_e("Career"); + this.field_175562_bw = p_70037_1_.func_74762_e("CareerLevel"); +@@ -412,13 +421,43 @@ + public void func_70938_b(int p_70938_1_) + { + this.field_70180_af.func_187227_b(field_184752_bw, Integer.valueOf(p_70938_1_)); ++ net.minecraftforge.fml.common.registry.VillagerRegistry.onSetProfession(this, p_70938_1_); + } + ++ @Deprecated //Use Forge Variant below + public int func_70946_n() + { +- return Math.max(((Integer)this.field_70180_af.func_187225_a(field_184752_bw)).intValue() % 6, 0); ++ return Math.max(((Integer)this.field_70180_af.func_187225_a(field_184752_bw)).intValue(), 0); + } + ++ private net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession prof; ++ public void setProfession(net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession prof) ++ { ++ this.prof = prof; ++ this.func_70938_b(net.minecraftforge.fml.common.registry.VillagerRegistry.getId(prof)); ++ } ++ ++ public net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession getProfessionForge() ++ { ++ if (this.prof == null) ++ { ++ this.prof = net.minecraftforge.fml.common.registry.VillagerRegistry.getById(this.func_70946_n()); ++ if (this.prof == null) ++ return net.minecraftforge.fml.common.registry.VillagerRegistry.getById(0); //Farmer ++ } ++ return this.prof; ++ } ++ ++ @Override ++ public void func_184206_a(DataParameter key) ++ { ++ super.func_184206_a(key); ++ if (key.equals(field_184752_bw)) ++ { ++ net.minecraftforge.fml.common.registry.VillagerRegistry.onSetProfession(this, this.field_70180_af.func_187225_a(field_184752_bw)); ++ } ++ } ++ + public boolean func_70941_o() + { + return this.field_70952_f; +@@ -456,7 +495,7 @@ + i = -3; + } + +- this.field_70954_d.func_82688_a(p_70604_1_.func_70005_c_(), i); ++ this.field_70954_d.modifyPlayerReputation(p_70604_1_.func_110124_au(), i); + + if (this.func_70089_S()) + { +@@ -476,7 +515,7 @@ + { + if (entity instanceof EntityPlayer) + { +- this.field_70954_d.func_82688_a(entity.func_70005_c_(), -2); ++ this.field_70954_d.modifyPlayerReputation(entity.func_110124_au(), -2); + } + else if (entity instanceof IMob) + { +@@ -569,7 +608,7 @@ + + if (this.field_70962_h != null) + { +- this.field_82189_bL = this.field_70962_h.func_70005_c_(); ++ this.field_82189_bL = this.field_70962_h.func_110124_au(); + } + else + { +@@ -617,15 +656,13 @@ + + private void func_175554_cu() + { +- EntityVillager.ITradeList[][][] aentityvillager$itradelist = field_175561_bA[this.func_70946_n()]; +- + if (this.field_175563_bv != 0 && this.field_175562_bw != 0) + { + ++this.field_175562_bw; + } + else + { +- this.field_175563_bv = this.field_70146_Z.nextInt(aentityvillager$itradelist.length) + 1; ++ this.field_175563_bv = this.getProfessionForge().getRandomCareer(this.field_70146_Z) + 1; + this.field_175562_bw = 1; + } + +@@ -636,19 +673,13 @@ + + int i = this.field_175563_bv - 1; + int j = this.field_175562_bw - 1; ++ java.util.List trades = this.getProfessionForge().getCareer(i).getTrades(j); + +- if (i >= 0 && i < aentityvillager$itradelist.length) ++ if (trades != null) + { +- EntityVillager.ITradeList[][] aentityvillager$itradelist1 = aentityvillager$itradelist[i]; +- +- if (j >= 0 && j < aentityvillager$itradelist1.length) ++ for (EntityVillager.ITradeList entityvillager$itradelist : trades) + { +- EntityVillager.ITradeList[] aentityvillager$itradelist2 = aentityvillager$itradelist1[j]; +- +- for (EntityVillager.ITradeList entityvillager$itradelist : aentityvillager$itradelist2) +- { +- entityvillager$itradelist.func_190888_a(this, this.field_70963_i, this.field_70146_Z); +- } ++ entityvillager$itradelist.func_190888_a(this, this.field_70963_i, this.field_70146_Z); + } + } + } +@@ -758,7 +789,7 @@ + s1 = "nitwit"; + } + +- if (s1 != null) ++ s1 = this.getProfessionForge().getCareer(this.field_175563_bv-1).getName(); + { + ITextComponent itextcomponent = new TextComponentTranslation("entity.Villager." + s1, new Object[0]); + itextcomponent.func_150256_b().func_150209_a(this.func_174823_aP()); +@@ -771,10 +802,6 @@ + + return itextcomponent; + } +- else +- { +- return super.func_145748_c_(); +- } + } + } + +@@ -828,7 +855,7 @@ + + if (p_190672_3_) + { +- this.func_70938_b(this.field_70170_p.field_73012_v.nextInt(6)); ++ net.minecraftforge.fml.common.registry.VillagerRegistry.setRandomProfession(this, this.field_70170_p.field_73012_v); + } + + this.func_175552_ct(); +@@ -1089,6 +1116,9 @@ + p_190888_2_.add(new MerchantRecipe(itemstack, itemstack1)); + } + } ++ //MODDERS DO NOT USE OR EDIT THIS IN ANY WAY IT WILL HAVE NO EFFECT, THIS IS JUST IN HERE TO ALLOW FORGE TO ACCESS IT ++ @Deprecated ++ public static ITradeList[][][][] GET_TRADES_DONT_USE(){ return field_175561_bA; } + + public static class ListItemForEmeralds implements EntityVillager.ITradeList + { diff --git a/patches_old/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch new file mode 100644 index 000000000..ebb5890e4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityWolf.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityWolf.java +@@ -434,7 +434,7 @@ + + if (!this.field_70170_p.field_72995_K) + { +- if (this.field_70146_Z.nextInt(3) == 0) ++ if (this.field_70146_Z.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, p_184645_1_)) + { + this.func_193101_c(p_184645_1_); + this.field_70699_by.func_75499_g(); diff --git a/patches_old/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch b/patches_old/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch new file mode 100644 index 000000000..31bd698ae --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch @@ -0,0 +1,53 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/HorseArmorType.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/HorseArmorType.java +@@ -55,6 +55,7 @@ + return this.field_188586_e; + } + ++ @Deprecated /**Forge: Use getByName. Ordinals of mod-added enum constants are dependent on load order, unlike names.**/ + public static HorseArmorType func_188575_a(int p_188575_0_) + { + return values()[p_188575_0_]; +@@ -62,9 +63,10 @@ + + public static HorseArmorType func_188580_a(ItemStack p_188580_0_) + { +- return p_188580_0_.func_190926_b() ? NONE : func_188576_a(p_188580_0_.func_77973_b()); ++ return p_188580_0_.func_77973_b().getHorseArmorType(p_188580_0_); + } + ++ @Deprecated //Forge: Use getByItemStack + public static HorseArmorType func_188576_a(Item p_188576_0_) + { + if (p_188576_0_ == Items.field_151138_bX) +@@ -81,8 +83,30 @@ + } + } + ++ @Deprecated //Forge: Use ItemStack sensitive overload + public static boolean func_188577_b(Item p_188577_0_) + { + return func_188576_a(p_188577_0_) != NONE; + } ++ ++ /* ======================================== FORGE START ======================================== */ ++ //Allows for textures located outside the vanilla horse armor folder ++ private HorseArmorType(String defaultTextureLocation, int armorStrengthIn) ++ { ++ this.field_188588_g = armorStrengthIn; ++ this.field_188586_e = defaultTextureLocation; ++ this.field_188587_f = "forge"; ++ } ++ ++ public static HorseArmorType getByName(String name) ++ { ++ HorseArmorType type = HorseArmorType.valueOf(name); ++ return type != null ? type : NONE; ++ } ++ ++ public static boolean isHorseArmor(ItemStack stack) ++ { ++ return func_188580_a(stack) != NONE; ++ } ++ /* ======================================== FORGE END ======================================== */ + } diff --git a/patches_old/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches_old/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch new file mode 100644 index 000000000..6fa569a7e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -0,0 +1,672 @@ +--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayer.java ++++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayer.java +@@ -96,6 +96,12 @@ + @SuppressWarnings("incomplete-switch") + public abstract class EntityPlayer extends EntityLivingBase + { ++ public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; ++ protected java.util.HashMap spawnChunkMap = new java.util.HashMap(); ++ protected java.util.HashMap spawnForcedMap = new java.util.HashMap(); ++ public float eyeHeight = this.getDefaultEyeHeight(); ++ public static final net.minecraft.entity.ai.attributes.IAttribute REACH_DISTANCE = new net.minecraft.entity.ai.attributes.RangedAttribute(null, "generic.reachDistance", 5.0D, 0.0D, 1024.0D).func_111112_a(true); ++ + private static final DataParameter field_184829_a = EntityDataManager.func_187226_a(EntityPlayer.class, DataSerializers.field_187193_c); + private static final DataParameter field_184830_b = EntityDataManager.func_187226_a(EntityPlayer.class, DataSerializers.field_187192_b); + protected static final DataParameter field_184827_bp = EntityDataManager.func_187226_a(EntityPlayer.class, DataSerializers.field_187191_a); +@@ -165,6 +171,7 @@ + this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.10000000149011612D); + this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188790_f); + this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188792_h); ++ this.func_110140_aT().func_111150_b(REACH_DISTANCE); + } + + protected void func_70088_a() +@@ -180,6 +187,7 @@ + + public void func_70071_h_() + { ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPlayerPreTick(this); + this.field_70145_X = this.func_175149_v(); + + if (this.func_175149_v()) +@@ -207,7 +215,7 @@ + { + this.func_70999_a(true, true, false); + } +- else if (this.field_70170_p.func_72935_r()) ++ else if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, this.field_71081_bT)) + { + this.func_70999_a(false, true, true); + } +@@ -367,6 +375,7 @@ + this.func_70105_a(f, f1); + } + } ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPlayerPostTick(this); + } + + public int func_82145_z() +@@ -454,11 +463,11 @@ + this.field_71109_bG = 0.0F; + this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2); + +- if (this.func_184187_bx() instanceof EntityPig) ++ if (this.func_184187_bx() instanceof EntityLivingBase && ((EntityLivingBase)this.func_184187_bx()).shouldRiderFaceForward(this)) + { + this.field_70125_A = f1; + this.field_70177_z = f; +- this.field_70761_aq = ((EntityPig)this.func_184187_bx()).field_70761_aq; ++ this.field_70761_aq = ((EntityLivingBase)this.func_184187_bx()).field_70761_aq; + } + } + } +@@ -609,11 +618,15 @@ + + public void func_70645_a(DamageSource p_70645_1_) + { ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + super.func_70645_a(p_70645_1_); + this.func_70105_a(0.2F, 0.2F); + this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.field_70181_x = 0.10000000149011612D; + ++ captureDrops = true; ++ capturedDrops.clear(); ++ + if ("Notch".equals(this.func_70005_c_())) + { + this.func_146097_a(new ItemStack(Items.field_151034_e, 1), true, false); +@@ -625,6 +638,9 @@ + this.field_71071_by.func_70436_m(); + } + ++ captureDrops = false; ++ if (!field_70170_p.field_72995_K) net.minecraftforge.event.ForgeEventFactory.onPlayerDrops(this, p_70645_1_, capturedDrops, field_70718_bc > 0); ++ + if (p_70645_1_ != null) + { + this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * 0.017453292F) * 0.1F); +@@ -675,13 +691,24 @@ + @Nullable + public EntityItem func_71040_bB(boolean p_71040_1_) + { +- return this.func_146097_a(this.field_71071_by.func_70298_a(this.field_71071_by.field_70461_c, p_71040_1_ && !this.field_71071_by.func_70448_g().func_190926_b() ? this.field_71071_by.func_70448_g().func_190916_E() : 1), false, true); ++ ItemStack stack = field_71071_by.func_70448_g(); ++ ++ if (stack.func_190926_b()) ++ { ++ return null; ++ } ++ if (stack.func_77973_b().onDroppedByPlayer(stack, this)) ++ { ++ int count = p_71040_1_ ? this.field_71071_by.func_70448_g().func_190916_E() : 1; ++ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, field_71071_by.func_70298_a(field_71071_by.field_70461_c, count), true); ++ } ++ return null; + } + + @Nullable + public EntityItem func_71019_a(ItemStack p_71019_1_, boolean p_71019_2_) + { +- return this.func_146097_a(p_71019_1_, false, p_71019_2_); ++ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false); + } + + @Nullable +@@ -741,14 +768,22 @@ + + public ItemStack func_184816_a(EntityItem p_184816_1_) + { ++ if (captureDrops) capturedDrops.add(p_184816_1_); ++ else // Forge: Don't indent to keep patch smaller. + this.field_70170_p.func_72838_d(p_184816_1_); + return p_184816_1_.func_92059_d(); + } + ++ @Deprecated //Use location sensitive version below + public float func_184813_a(IBlockState p_184813_1_) + { +- float f = this.field_71071_by.func_184438_a(p_184813_1_); ++ return getDigSpeed(p_184813_1_, null); ++ } + ++ public float getDigSpeed(IBlockState state, BlockPos pos) ++ { ++ float f = this.field_71071_by.func_184438_a(state); ++ + if (f > 1.0F) + { + int i = EnchantmentHelper.func_185293_e(this); +@@ -798,12 +833,13 @@ + f /= 5.0F; + } + +- return f; ++ f = net.minecraftforge.event.ForgeEventFactory.getBreakSpeed(this, state, f, pos); ++ return (f < 0 ? 0 : f); + } + + public boolean func_184823_b(IBlockState p_184823_1_) + { +- return this.field_71071_by.func_184432_b(p_184823_1_); ++ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, p_184823_1_, this.field_71071_by.func_184432_b(p_184823_1_)); + } + + public static void func_189806_a(DataFixer p_189806_0_) +@@ -863,6 +899,17 @@ + this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); + } + ++ NBTTagList spawnlist = null; ++ spawnlist = p_70037_1_.func_150295_c("Spawns", 10); ++ for (int i = 0; i < spawnlist.func_74745_c(); i++) ++ { ++ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.func_150305_b(i); ++ int spawndim = spawndata.func_74762_e("Dim"); ++ this.spawnChunkMap.put(spawndim, new BlockPos(spawndata.func_74762_e("SpawnX"), spawndata.func_74762_e("SpawnY"), spawndata.func_74762_e("SpawnZ"))); ++ this.spawnForcedMap.put(spawndim, spawndata.func_74767_n("SpawnForced")); ++ } ++ this.spawnDimension = p_70037_1_.func_74767_n("HasSpawnDimensionSet") ? p_70037_1_.func_74762_e("SpawnDimension") : null; ++ + this.field_71100_bB.func_75112_a(p_70037_1_); + this.field_71075_bZ.func_75095_b(p_70037_1_); + +@@ -896,6 +943,7 @@ + p_70014_1_.func_74768_a("XpTotal", this.field_71067_cb); + p_70014_1_.func_74768_a("XpSeed", this.field_175152_f); + p_70014_1_.func_74768_a("Score", this.func_71037_bA()); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(p_70014_1_); //Moved down so it doesn't keep missing every MC update. + + if (this.field_71077_c != null) + { +@@ -905,6 +953,27 @@ + p_70014_1_.func_74757_a("SpawnForced", this.field_82248_d); + } + ++ NBTTagList spawnlist = new NBTTagList(); ++ for (java.util.Map.Entry entry : this.spawnChunkMap.entrySet()) ++ { ++ BlockPos spawn = entry.getValue(); ++ if (spawn == null) continue; ++ Boolean forced = spawnForcedMap.get(entry.getKey()); ++ if (forced == null) forced = false; ++ NBTTagCompound spawndata = new NBTTagCompound(); ++ spawndata.func_74768_a("Dim", entry.getKey()); ++ spawndata.func_74768_a("SpawnX", spawn.func_177958_n()); ++ spawndata.func_74768_a("SpawnY", spawn.func_177956_o()); ++ spawndata.func_74768_a("SpawnZ", spawn.func_177952_p()); ++ spawndata.func_74757_a("SpawnForced", forced); ++ spawnlist.func_74742_a(spawndata); ++ } ++ p_70014_1_.func_74782_a("Spawns", spawnlist); ++ ++ p_70014_1_.func_74757_a("HasSpawnDimensionSet", this.hasSpawnDimension()); ++ if (this.hasSpawnDimension()) ++ p_70014_1_.func_74768_a("SpawnDimension", this.getSpawnDimension()); ++ + this.field_71100_bB.func_75117_b(p_70014_1_); + this.field_71075_bZ.func_75091_a(p_70014_1_); + p_70014_1_.func_74782_a("EnderItems", this.field_71078_a.func_70487_g()); +@@ -922,6 +991,7 @@ + + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) + { ++ if (!net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_180431_b(p_70097_1_)) + { + return false; +@@ -974,7 +1044,7 @@ + { + super.func_190629_c(p_190629_1_); + +- if (p_190629_1_.func_184614_ca().func_77973_b() instanceof ItemAxe) ++ if (p_190629_1_.func_184614_ca().func_77973_b().canDisableShield(p_190629_1_.func_184614_ca(), this.func_184607_cu(), this, p_190629_1_)) + { + this.func_190777_m(true); + } +@@ -1002,14 +1072,16 @@ + + protected void func_184590_k(float p_184590_1_) + { +- if (p_184590_1_ >= 3.0F && this.field_184627_bm.func_77973_b() == Items.field_185159_cQ) ++ if (p_184590_1_ >= 3.0F && this.field_184627_bm.func_77973_b().isShield(this.field_184627_bm, this)) + { ++ ItemStack copyBeforeUse = this.field_184627_bm.func_77946_l(); + int i = 1 + MathHelper.func_76141_d(p_184590_1_); + this.field_184627_bm.func_77972_a(i, this); + + if (this.field_184627_bm.func_190926_b()) + { + EnumHand enumhand = this.func_184600_cs(); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, copyBeforeUse, enumhand); + + if (enumhand == EnumHand.MAIN_HAND) + { +@@ -1045,11 +1117,15 @@ + { + if (!this.func_180431_b(p_70665_1_)) + { +- p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); ++ p_70665_2_ = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; ++ p_70665_2_ = net.minecraftforge.common.ISpecialArmor.ArmorProperties.applyArmor(this, field_71071_by.field_70460_b, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); + float f = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F); + this.func_110149_m(this.func_110139_bj() - (f - p_70665_2_)); ++ p_70665_2_ = net.minecraftforge.common.ForgeHooks.onLivingDamage(this, p_70665_1_, p_70665_2_); + + if (p_70665_2_ != 0.0F) + { +@@ -1115,6 +1191,8 @@ + } + else + { ++ EnumActionResult cancelResult = net.minecraftforge.common.ForgeHooks.onInteractEntity(this, p_190775_1_, p_190775_2_); ++ if (cancelResult != null) return cancelResult; + ItemStack itemstack = this.func_184586_b(p_190775_2_); + ItemStack itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.func_77946_l(); + +@@ -1124,7 +1202,10 @@ + { + itemstack.func_190920_e(itemstack1.func_190916_E()); + } +- ++ if (!this.field_71075_bZ.field_75098_d && itemstack.func_190926_b()) ++ { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, itemstack1, p_190775_2_); ++ } + return EnumActionResult.SUCCESS; + } + else +@@ -1140,6 +1221,7 @@ + { + if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) + { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, itemstack1, p_190775_2_); + this.func_184611_a(p_190775_2_, ItemStack.field_190927_a); + } + +@@ -1165,6 +1247,7 @@ + + public void func_71059_n(Entity p_71059_1_) + { ++ if (!net.minecraftforge.common.ForgeHooks.onPlayerAttackTarget(this, p_71059_1_)) return; + if (p_71059_1_.func_70075_an()) + { + if (!p_71059_1_.func_85031_j(this)) +@@ -1203,9 +1286,11 @@ + boolean flag2 = flag && this.field_70143_R > 0.0F && !this.field_70122_E && !this.func_70617_f_() && !this.func_70090_H() && !this.func_70644_a(MobEffects.field_76440_q) && !this.func_184218_aH() && p_71059_1_ instanceof EntityLivingBase; + flag2 = flag2 && !this.func_70051_ag(); + ++ net.minecraftforge.event.entity.player.CriticalHitEvent hitResult = net.minecraftforge.common.ForgeHooks.getCriticalHit(this, p_71059_1_, flag2, flag2 ? 1.5F : 1.0F); ++ flag2 = hitResult != null; + if (flag2) + { +- f *= 1.5F; ++ f *= hitResult.getDamageModifier(); + } + + f = f + f1; +@@ -1332,10 +1417,12 @@ + + if (!itemstack1.func_190926_b() && entity instanceof EntityLivingBase) + { ++ ItemStack beforeHitCopy = itemstack1.func_77946_l(); + itemstack1.func_77961_a((EntityLivingBase)entity, this); + + if (itemstack1.func_190926_b()) + { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, beforeHitCopy, EnumHand.MAIN_HAND); + this.func_184611_a(EnumHand.MAIN_HAND, ItemStack.field_190927_a); + } + } +@@ -1384,7 +1471,7 @@ + + if (this.field_70146_Z.nextFloat() < f) + { +- this.func_184811_cZ().func_185145_a(Items.field_185159_cQ, 100); ++ this.func_184811_cZ().func_185145_a(this.func_184607_cu().func_77973_b(), 100); + this.func_184602_cy(); + this.field_70170_p.func_72960_a(this, (byte)30); + } +@@ -1442,7 +1529,11 @@ + + public EntityPlayer.SleepResult func_180469_a(BlockPos p_180469_1_) + { +- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(p_180469_1_).func_177229_b(BlockHorizontal.field_185512_D); ++ EntityPlayer.SleepResult ret = net.minecraftforge.event.ForgeEventFactory.onPlayerSleepInBed(this, p_180469_1_); ++ if (ret != null) return ret; ++ final IBlockState state = this.field_70170_p.func_175667_e(p_180469_1_) ? this.field_70170_p.func_180495_p(p_180469_1_) : null; ++ final boolean isBed = state != null && state.func_177230_c().isBed(state, this.field_70170_p, p_180469_1_, this); ++ final EnumFacing enumfacing = isBed && state.func_177230_c() instanceof BlockHorizontal ? (EnumFacing)state.func_177229_b(BlockHorizontal.field_185512_D) : null; + + if (!this.field_70170_p.field_72995_K) + { +@@ -1456,7 +1547,7 @@ + return EntityPlayer.SleepResult.NOT_POSSIBLE_HERE; + } + +- if (this.field_70170_p.func_72935_r()) ++ if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, this.field_71081_bT)) + { + return EntityPlayer.SleepResult.NOT_POSSIBLE_NOW; + } +@@ -1484,8 +1575,7 @@ + this.func_192030_dh(); + this.func_70105_a(0.2F, 0.2F); + +- if (this.field_70170_p.func_175667_e(p_180469_1_)) +- { ++ if (enumfacing != null) { + float f1 = 0.5F + (float)enumfacing.func_82601_c() * 0.4F; + float f = 0.5F + (float)enumfacing.func_82599_e() * 0.4F; + this.func_175139_a(enumfacing); +@@ -1517,6 +1607,7 @@ + { + return true; + } ++ else if (p_190774_2_ == null) return false; + else + { + BlockPos blockpos = p_190774_1_.func_177972_a(p_190774_2_.func_176734_d()); +@@ -1532,13 +1623,14 @@ + + public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) + { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerWakeup(this, p_70999_1_, p_70999_2_, p_70999_3_); + this.func_70105_a(0.6F, 1.8F); +- IBlockState iblockstate = this.field_70170_p.func_180495_p(this.field_71081_bT); ++ IBlockState iblockstate = this.field_71081_bT == null ? null : this.field_70170_p.func_180495_p(this.field_71081_bT); + +- if (this.field_71081_bT != null && iblockstate.func_177230_c() == Blocks.field_150324_C) ++ if (this.field_71081_bT != null && iblockstate.func_177230_c().isBed(iblockstate, field_70170_p, field_71081_bT, this)) + { +- this.field_70170_p.func_180501_a(this.field_71081_bT, iblockstate.func_177226_a(BlockBed.field_176471_b, Boolean.valueOf(false)), 4); +- BlockPos blockpos = BlockBed.func_176468_a(this.field_70170_p, this.field_71081_bT, 0); ++ iblockstate.func_177230_c().setBedOccupied(field_70170_p, field_71081_bT, this, false); ++ BlockPos blockpos = iblockstate.func_177230_c().getBedSpawnPosition(iblockstate, field_70170_p, field_71081_bT, this); + + if (blockpos == null) + { +@@ -1547,6 +1639,10 @@ + + this.func_70107_b((double)((float)blockpos.func_177958_n() + 0.5F), (double)((float)blockpos.func_177956_o() + 0.1F), (double)((float)blockpos.func_177952_p() + 0.5F)); + } ++ else ++ { ++ p_70999_3_ = false; ++ } + + this.field_71083_bS = false; + +@@ -1565,15 +1661,16 @@ + + private boolean func_175143_p() + { +- return this.field_70170_p.func_180495_p(this.field_71081_bT).func_177230_c() == Blocks.field_150324_C; ++ return net.minecraftforge.event.ForgeEventFactory.fireSleepingLocationCheck(this, this.field_71081_bT); + } + + @Nullable + public static BlockPos func_180467_a(World p_180467_0_, BlockPos p_180467_1_, boolean p_180467_2_) + { +- Block block = p_180467_0_.func_180495_p(p_180467_1_).func_177230_c(); ++ IBlockState state = p_180467_0_.func_180495_p(p_180467_1_); ++ Block block = state.func_177230_c(); + +- if (block != Blocks.field_150324_C) ++ if (!block.isBed(state, p_180467_0_, p_180467_1_, null)) + { + if (!p_180467_2_) + { +@@ -1588,16 +1685,17 @@ + } + else + { +- return BlockBed.func_176468_a(p_180467_0_, p_180467_1_, 0); ++ return block.getBedSpawnPosition(state, p_180467_0_, p_180467_1_, null); + } + } + + @SideOnly(Side.CLIENT) + public float func_71051_bG() + { +- if (this.field_71081_bT != null) ++ IBlockState state = this.field_71081_bT == null ? null : this.field_70170_p.func_180495_p(field_71081_bT); ++ if (state != null && state.func_177230_c().isBed(state, field_70170_p, field_71081_bT, this)) + { +- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(this.field_71081_bT).func_177229_b(BlockHorizontal.field_185512_D); ++ EnumFacing enumfacing = state.func_177230_c().getBedDirection(state, field_70170_p, field_71081_bT); + + switch (enumfacing) + { +@@ -1637,16 +1735,24 @@ + + public BlockPos func_180470_cg() + { +- return this.field_71077_c; ++ return getBedLocation(this.field_71093_bK); + } + ++ @Deprecated // Use dimension-sensitive version. + public boolean func_82245_bX() + { +- return this.field_82248_d; ++ return isSpawnForced(this.field_71093_bK); + } + + public void func_180473_a(BlockPos p_180473_1_, boolean p_180473_2_) + { ++ if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, p_180473_1_, p_180473_2_)) return; ++ if (this.field_71093_bK != 0) ++ { ++ setSpawnChunk(p_180473_1_, p_180473_2_, this.field_71093_bK); ++ return; ++ } ++ + if (p_180473_1_ != null) + { + this.field_71077_c = p_180473_1_; +@@ -1839,6 +1945,10 @@ + + super.func_180430_e(p_180430_1_, p_180430_2_); + } ++ else ++ { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerFall(this, p_180430_1_, p_180430_2_); ++ } + } + + protected void func_71061_d_() +@@ -2176,7 +2286,10 @@ + + public ITextComponent func_145748_c_() + { +- ITextComponent itextcomponent = new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_())); ++ ITextComponent itextcomponent = new TextComponentString(""); ++ if (!prefixes.isEmpty()) for (ITextComponent prefix : prefixes) itextcomponent.func_150257_a(prefix); ++ itextcomponent.func_150257_a(new TextComponentString(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.getDisplayNameString()))); ++ if (!suffixes.isEmpty()) for (ITextComponent suffix : suffixes) itextcomponent.func_150257_a(suffix); + itextcomponent.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.func_70005_c_() + " ")); + itextcomponent.func_150256_b().func_150209_a(this.func_174823_aP()); + itextcomponent.func_150256_b().func_179989_a(this.func_70005_c_()); +@@ -2185,7 +2298,7 @@ + + public float func_70047_e() + { +- float f = 1.62F; ++ float f = eyeHeight; + + if (this.func_70608_bn()) + { +@@ -2421,6 +2534,168 @@ + return this.field_71075_bZ.field_75098_d && this.func_70003_b(2, ""); + } + ++ /** ++ * Opens a GUI with this player, uses FML's IGuiHandler system. ++ * Allows for extension by modders. ++ * ++ * @param mod The mod trying to open a GUI ++ * @param modGuiId GUI ID ++ * @param world Current World ++ * @param x Passed directly to IGuiHandler, data meaningless Typically world X position ++ * @param y Passed directly to IGuiHandler, data meaningless Typically world Y position ++ * @param z Passed directly to IGuiHandler, data meaningless Typically world Z position ++ */ ++ public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) ++ { ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); ++ } ++ ++ ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * A dimension aware version of getBedLocation. ++ * @param dimension The dimension to get the bed spawn for ++ * @return The player specific spawn location for the dimension. May be null. ++ */ ++ public BlockPos getBedLocation(int dimension) ++ { ++ return dimension == 0 ? field_71077_c : spawnChunkMap.get(dimension); ++ } ++ ++ /** ++ * A dimension aware version of isSpawnForced. ++ * Noramally isSpawnForced is used to determine if the respawn system should check for a bed or not. ++ * This just extends that to be dimension aware. ++ * @param dimension The dimension to get whether to check for a bed before spawning for ++ * @return The player specific spawn location for the dimension. May be null. ++ */ ++ public boolean isSpawnForced(int dimension) ++ { ++ if (dimension == 0) return this.field_82248_d; ++ Boolean forced = this.spawnForcedMap.get(dimension); ++ return forced == null ? false : forced; ++ } ++ ++ /** ++ * A dimension aware version of setSpawnChunk. ++ * This functions identically, but allows you to specify which dimension to affect, rather than affecting the player's current dimension. ++ * @param pos The spawn point to set as the player-specific spawn point for the dimension ++ * @param forced Whether or not the respawn code should check for a bed at this location (true means it won't check for a bed) ++ * @param dimension Which dimension to apply the player-specific respawn point to ++ */ ++ public void setSpawnChunk(BlockPos pos, boolean forced, int dimension) ++ { ++ if (dimension == 0) ++ { ++ if (pos != null) ++ { ++ field_71077_c = pos; ++ field_82248_d = forced; ++ } ++ else ++ { ++ field_71077_c = null; ++ field_82248_d = false; ++ } ++ return; ++ } ++ ++ if (pos != null) ++ { ++ spawnChunkMap.put(dimension, pos); ++ spawnForcedMap.put(dimension, forced); ++ } ++ else ++ { ++ spawnChunkMap.remove(dimension); ++ spawnForcedMap.remove(dimension); ++ } ++ } ++ ++ private String displayname; ++ ++ /** ++ * Returns the default eye height of the player ++ * @return player default eye height ++ */ ++ public float getDefaultEyeHeight() ++ { ++ return 1.62F; ++ } ++ ++ /** ++ * Get the currently computed display name, cached for efficiency. ++ * @return the current display name ++ */ ++ public String getDisplayNameString() ++ { ++ if(this.displayname == null) ++ { ++ this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); ++ } ++ return this.displayname; ++ } ++ ++ /** ++ * Force the displayed name to refresh ++ */ ++ public void refreshDisplayName() ++ { ++ this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); ++ } ++ ++ private final java.util.Collection prefixes = new java.util.LinkedList(); ++ private final java.util.Collection suffixes = new java.util.LinkedList(); ++ ++ /** ++ * Add a prefix to the player's username in chat ++ * @param prefix The prefix ++ */ ++ public void addPrefix(ITextComponent prefix) { prefixes.add(prefix); } ++ ++ /** ++ * Add a suffix to the player's username in chat ++ * @param suffix The suffix ++ */ ++ public void addSuffix(ITextComponent suffix) { suffixes.add(suffix); } ++ ++ public java.util.Collection getPrefixes() { return this.prefixes; } ++ public java.util.Collection getSuffixes() { return this.suffixes; } ++ ++ private final net.minecraftforge.items.IItemHandler playerMainHandler = new net.minecraftforge.items.wrapper.PlayerMainInvWrapper(field_71071_by); ++ private final net.minecraftforge.items.IItemHandler playerEquipmentHandler = new net.minecraftforge.items.wrapper.CombinedInvWrapper( ++ new net.minecraftforge.items.wrapper.PlayerArmorInvWrapper(field_71071_by), ++ new net.minecraftforge.items.wrapper.PlayerOffhandInvWrapper(field_71071_by)); ++ private final net.minecraftforge.items.IItemHandler playerJoinedHandler = new net.minecraftforge.items.wrapper.PlayerInvWrapper(field_71071_by); ++ ++ @SuppressWarnings("unchecked") ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ if (capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) ++ { ++ if (facing == null) return (T) playerJoinedHandler; ++ else if (facing.func_176740_k().func_176720_b()) return (T) playerMainHandler; ++ else if (facing.func_176740_k().func_176722_c()) return (T) playerEquipmentHandler; ++ } ++ return super.getCapability(capability, facing); ++ } ++ ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); ++ } ++ ++ @Nullable ++ private Integer spawnDimension; ++ public boolean hasSpawnDimension() { return spawnDimension != null; } ++ public int getSpawnDimension() { return spawnDimension != null ? spawnDimension : 0; } ++ public void setSpawnDimension(@Nullable Integer dimension) { this.spawnDimension = dimension; } ++ ++ /* ======================================== FORGE END =====================================*/ ++ + public static enum EnumChatVisibility + { + FULL(0, "options.chat.visibility.full"), diff --git a/patches_old/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches_old/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch new file mode 100644 index 000000000..51170d5b8 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -0,0 +1,146 @@ +--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java ++++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java +@@ -158,9 +158,9 @@ + super(p_i45285_2_, p_i45285_3_); + p_i45285_4_.field_73090_b = this; + this.field_71134_c = p_i45285_4_; +- BlockPos blockpos = p_i45285_2_.func_175694_M(); ++ BlockPos blockpos = p_i45285_2_.field_73011_w.getRandomizedSpawnPoint(); + +- if (p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE) ++ if (false && p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE) + { + int i = Math.max(0, p_i45285_1_.func_184108_a(p_i45285_2_)); + int j = MathHelper.func_76128_c(p_i45285_2_.func_175723_af().func_177729_b((double)blockpos.func_177958_n(), (double)blockpos.func_177952_p())); +@@ -323,7 +323,7 @@ + + this.field_71070_bA.func_75142_b(); + +- if (!this.field_70170_p.field_72995_K && !this.field_71070_bA.func_75145_c(this)) ++ if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !this.field_71070_bA.func_75145_c(this)) + { + this.func_71053_j(); + this.field_71070_bA = this.field_71069_bz; +@@ -471,6 +471,7 @@ + + public void func_70645_a(DamageSource p_70645_1_) + { ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + boolean flag = this.field_70170_p.func_82736_K().func_82766_b("showDeathMessages"); + this.field_71135_a.func_147359_a(new SPacketCombatEvent(this.func_110142_aN(), SPacketCombatEvent.Event.ENTITY_DIED, flag)); + +@@ -499,8 +500,20 @@ + + if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory") && !this.func_175149_v()) + { ++ captureDrops = true; ++ capturedDrops.clear(); + this.func_190776_cN(); + this.field_71071_by.func_70436_m(); ++ ++ captureDrops = false; ++ net.minecraftforge.event.entity.player.PlayerDropsEvent event = new net.minecraftforge.event.entity.player.PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0); ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) ++ { ++ for (net.minecraft.entity.item.EntityItem item : capturedDrops) ++ { ++ this.field_70170_p.func_72838_d(item); ++ } ++ } + } + + for (ScoreObjective scoreobjective : this.field_70170_p.func_96441_U().func_96520_a(IScoreCriteria.field_96642_c)) +@@ -645,8 +658,9 @@ + } + + @Nullable +- public Entity func_184204_a(int p_184204_1_) ++ public Entity changeDimension(int p_184204_1_, net.minecraftforge.common.util.ITeleporter teleporter) + { ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return this; + this.field_184851_cj = true; + + if (this.field_71093_bK == 0 && p_184204_1_ == -1) +@@ -658,7 +672,7 @@ + this.field_193110_cw = null; + } + +- if (this.field_71093_bK == 1 && p_184204_1_ == 1) ++ if (this.field_71093_bK == 1 && p_184204_1_ == 1 && teleporter.isVanilla()) + { + this.field_70170_p.func_72900_e(this); + +@@ -678,7 +692,7 @@ + p_184204_1_ = 1; + } + +- this.field_71133_b.func_184103_al().func_187242_a(this, p_184204_1_); ++ this.field_71133_b.func_184103_al().transferPlayerToDimension(this, p_184204_1_, teleporter); + this.field_71135_a.func_147359_a(new SPacketEffect(1032, BlockPos.field_177992_a, 0, false)); + this.field_71144_ck = -1; + this.field_71149_ch = -1.0F; +@@ -808,7 +822,7 @@ + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); + +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_70170_p, blockpos)) + { + BlockPos blockpos1 = blockpos.func_177977_b(); + IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1); +@@ -848,6 +862,7 @@ + this.field_71070_bA = p_180468_1_.func_174876_a(this.field_71071_by, this); + this.field_71070_bA.field_75152_c = this.field_71139_cq; + this.field_71070_bA.func_75132_a(this); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA)); + } + } + +@@ -891,6 +906,7 @@ + + this.field_71070_bA.field_75152_c = this.field_71139_cq; + this.field_71070_bA.func_75132_a(this); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA)); + } + } + +@@ -900,6 +916,7 @@ + this.field_71070_bA = new ContainerMerchant(this.field_71071_by, p_180472_1_, this.field_70170_p); + this.field_71070_bA.field_75152_c = this.field_71139_cq; + this.field_71070_bA.func_75132_a(this); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA)); + IInventory iinventory = ((ContainerMerchant)this.field_71070_bA).func_75174_d(); + ITextComponent itextcomponent = p_180472_1_.func_145748_c_(); + this.field_71135_a.func_147359_a(new SPacketOpenWindow(this.field_71139_cq, "minecraft:villager", itextcomponent, iinventory.func_70302_i_())); +@@ -1003,6 +1020,7 @@ + public void func_71128_l() + { + this.field_71070_bA.func_75134_a(this); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Close(this, this.field_71070_bA)); + this.field_71070_bA = this.field_71069_bz; + } + +@@ -1144,6 +1162,23 @@ + this.field_193110_cw = p_193104_1_.field_193110_cw; + this.func_192029_h(p_193104_1_.func_192023_dk()); + this.func_192031_i(p_193104_1_.func_192025_dl()); ++ ++ this.spawnChunkMap = p_193104_1_.spawnChunkMap; ++ this.spawnForcedMap = p_193104_1_.spawnForcedMap; ++ if(p_193104_1_.field_71093_bK != 0) ++ { ++ this.field_71077_c = p_193104_1_.field_71077_c; ++ this.field_82248_d = p_193104_1_.field_82248_d; ++ } ++ ++ //Copy over a section of the Entity Data from the old player. ++ //Allows mods to specify data that persists after players respawn. ++ NBTTagCompound old = p_193104_1_.getEntityData(); ++ if (old.func_74764_b(PERSISTED_NBT_TAG)) ++ { ++ getEntityData().func_74782_a(PERSISTED_NBT_TAG, old.func_74775_l(PERSISTED_NBT_TAG)); ++ } ++ net.minecraftforge.event.ForgeEventFactory.onPlayerClone(this, p_193104_1_, !p_193104_2_); + } + + protected void func_70670_a(PotionEffect p_70670_1_) diff --git a/patches_old/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches_old/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch new file mode 100644 index 000000000..4e029b08b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java ++++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java +@@ -292,7 +292,8 @@ + + if (itemstack.func_190926_b()) + { +- itemstack = new ItemStack(item, 0, p_191973_2_.func_77960_j()); ++ itemstack = p_191973_2_.func_77946_l(); // Forge: Replace Item clone above to preserve item capabilities when picking the item up. ++ itemstack.func_190920_e(0); + + if (p_191973_2_.func_77942_o()) + { +@@ -363,6 +364,13 @@ + } + } + } ++ for (ItemStack is : field_70460_b) // FORGE: Tick armor on animation ticks ++ { ++ if (!is.func_190926_b()) ++ { ++ is.func_77973_b().onArmorTick(field_70458_d.field_70170_p, field_70458_d, is); ++ } ++ } + } + + public boolean func_70441_a(ItemStack p_70441_1_) +@@ -444,6 +452,8 @@ + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Item being added"); + crashreportcategory.func_71507_a("Item ID", Integer.valueOf(Item.func_150891_b(p_191971_2_.func_77973_b()))); + crashreportcategory.func_71507_a("Item data", Integer.valueOf(p_191971_2_.func_77960_j())); ++ crashreportcategory.func_189529_a("Registry Name", () -> String.valueOf(p_191971_2_.func_77973_b().getRegistryName())); ++ crashreportcategory.func_189529_a("Item Class", () -> p_191971_2_.func_77973_b().getClass().getName()); + crashreportcategory.func_189529_a("Item name", new ICrashReportDetail() + { + public String call() throws Exception diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch new file mode 100644 index 000000000..726c3d70f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityArrow.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityArrow.java +@@ -262,7 +262,7 @@ + } + } + +- if (raytraceresult != null) ++ if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) + { + this.func_184549_a(raytraceresult); + } diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch new file mode 100644 index 000000000..d33aa12bf --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityFireball.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityFireball.java +@@ -93,7 +93,7 @@ + ++this.field_70234_an; + RayTraceResult raytraceresult = ProjectileHelper.func_188802_a(this, true, this.field_70234_an >= 25, this.field_70235_a); + +- if (raytraceresult != null) ++ if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) + { + this.func_70227_a(raytraceresult); + } diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch new file mode 100644 index 000000000..316ef38e1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch @@ -0,0 +1,74 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityFishHook.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityFishHook.java +@@ -269,8 +269,8 @@ + { + ItemStack itemstack = this.field_146042_b.func_184614_ca(); + ItemStack itemstack1 = this.field_146042_b.func_184592_cb(); +- boolean flag = itemstack.func_77973_b() == Items.field_151112_aM; +- boolean flag1 = itemstack1.func_77973_b() == Items.field_151112_aM; ++ boolean flag = itemstack.func_77973_b() instanceof net.minecraft.item.ItemFishingRod; ++ boolean flag1 = itemstack1.func_77973_b() instanceof net.minecraft.item.ItemFishingRod; + + if (!this.field_146042_b.field_70128_L && this.field_146042_b.func_70089_S() && (flag || flag1) && this.func_70068_e(this.field_146042_b) <= 1024.0D) + { +@@ -416,9 +416,9 @@ + double d0 = this.field_70165_t + (double)(f1 * (float)this.field_146038_az * 0.1F); + double d1 = (double)((float)MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) + 1.0F); + double d2 = this.field_70161_v + (double)(f2 * (float)this.field_146038_az * 0.1F); +- Block block = worldserver.func_180495_p(new BlockPos(d0, d1 - 1.0D, d2)).func_177230_c(); ++ IBlockState state = worldserver.func_180495_p(new BlockPos(d0, d1 - 1.0D, d2)); + +- if (block == Blocks.field_150355_j || block == Blocks.field_150358_i) ++ if (state.func_185904_a() == Material.field_151586_h) + { + if (this.field_70146_Z.nextFloat() < 0.15F) + { +@@ -466,9 +466,9 @@ + double d4 = this.field_70165_t + (double)(MathHelper.func_76126_a(f6) * f7 * 0.1F); + double d5 = (double)((float)MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b) + 1.0F); + double d6 = this.field_70161_v + (double)(MathHelper.func_76134_b(f6) * f7 * 0.1F); +- Block block1 = worldserver.func_180495_p(new BlockPos((int)d4, (int)d5 - 1, (int)d6)).func_177230_c(); ++ IBlockState state = worldserver.func_180495_p(new BlockPos((int) d4, (int) d5 - 1, (int) d6)); + +- if (block1 == Blocks.field_150355_j || block1 == Blocks.field_150358_i) ++ if (state.func_185904_a() == Material.field_151586_h) + { + worldserver.func_175739_a(EnumParticleTypes.WATER_SPLASH, d4, d5, d6, 2 + this.field_70146_Z.nextInt(2), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D); + } +@@ -506,6 +506,7 @@ + { + int i = 0; + ++ net.minecraftforge.event.entity.player.ItemFishedEvent event = null; + if (this.field_146043_c != null) + { + this.func_184527_k(); +@@ -515,9 +516,17 @@ + else if (this.field_146045_ax > 0) + { + LootContext.Builder lootcontext$builder = new LootContext.Builder((WorldServer)this.field_70170_p); +- lootcontext$builder.func_186469_a((float)this.field_191518_aw + this.field_146042_b.func_184817_da()); ++ lootcontext$builder.func_186469_a((float)this.field_191518_aw + this.field_146042_b.func_184817_da()).func_186470_a(this.field_146042_b).func_186472_a(this); // Forge: add player & looted entity to LootContext ++ List result = this.field_70170_p.func_184146_ak().func_186521_a(LootTableList.field_186387_al).func_186462_a(this.field_70146_Z, lootcontext$builder.func_186471_a()); ++ event = new net.minecraftforge.event.entity.player.ItemFishedEvent(result, this.field_146051_au ? 2 : 1, this); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ if (event.isCanceled()) ++ { ++ this.func_70106_y(); ++ return event.getRodDamage(); ++ } + +- for (ItemStack itemstack : this.field_70170_p.func_184146_ak().func_186521_a(LootTableList.field_186387_al).func_186462_a(this.field_70146_Z, lootcontext$builder.func_186471_a())) ++ for (ItemStack itemstack : result) + { + EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u, this.field_70161_v, itemstack); + double d0 = this.field_146042_b.field_70165_t - this.field_70165_t; +@@ -547,7 +556,7 @@ + } + + this.func_70106_y(); +- return i; ++ return event == null ? i : event.getRodDamage(); + } + else + { diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java.patch new file mode 100644 index 000000000..ec2f1066f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java +@@ -40,7 +40,7 @@ + this.func_174815_a(this.field_70235_a, p_70227_1_.field_72308_g); + } + +- boolean flag = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing"); ++ boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a); + this.field_70170_p.func_72885_a((Entity)null, this.field_70165_t, this.field_70163_u, this.field_70161_v, (float)this.field_92057_e, flag, flag); + this.func_70106_y(); + } diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch new file mode 100644 index 000000000..e68d05f26 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java +@@ -80,7 +80,7 @@ + raytraceresult = new RayTraceResult(entity); + } + +- if (raytraceresult != null) ++ if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) + { + this.func_190536_a(raytraceresult); + } diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch new file mode 100644 index 000000000..3707a37a2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java +@@ -310,7 +310,7 @@ + + RayTraceResult raytraceresult = ProjectileHelper.func_188802_a(this, true, false, this.field_184570_a); + +- if (raytraceresult != null) ++ if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) + { + this.func_184567_a(raytraceresult); + } diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java.patch new file mode 100644 index 000000000..4bf04d83a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java +@@ -57,7 +57,7 @@ + + if (this.field_70235_a != null && this.field_70235_a instanceof EntityLiving) + { +- flag1 = this.field_70170_p.func_82736_K().func_82766_b("mobGriefing"); ++ flag1 = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a); + } + + if (flag1) diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch new file mode 100644 index 000000000..8d0622599 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityThrowable.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityThrowable.java +@@ -244,7 +244,7 @@ + { + this.func_181015_d(raytraceresult.func_178782_a()); + } +- else ++ else if (!net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult)) + { + this.func_70184_a(raytraceresult); + } diff --git a/patches_old/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch b/patches_old/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch new file mode 100644 index 000000000..d8084774b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java +@@ -62,7 +62,7 @@ + float f = super.func_180428_a(p_180428_1_, p_180428_2_, p_180428_3_, p_180428_4_); + Block block = p_180428_4_.func_177230_c(); + +- if (this.func_82342_d() && EntityWither.func_181033_a(block)) ++ if (this.func_82342_d() && block.canEntityDestroy(p_180428_4_, p_180428_2_, p_180428_3_, this) && net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.field_70235_a, p_180428_3_, p_180428_4_)) + { + f = Math.min(0.8F, f); + } +@@ -115,7 +115,7 @@ + } + } + +- this.field_70170_p.func_72885_a(this, this.field_70165_t, this.field_70163_u, this.field_70161_v, 1.0F, false, this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")); ++ this.field_70170_p.func_72885_a(this, this.field_70165_t, this.field_70163_u, this.field_70161_v, 1.0F, false, net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this.field_70235_a)); + this.func_70106_y(); + } + } diff --git a/patches_old/minecraft/net/minecraft/inventory/Container.java.patch b/patches_old/minecraft/net/minecraft/inventory/Container.java.patch new file mode 100644 index 000000000..db903339d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/Container.java.patch @@ -0,0 +1,47 @@ +--- ../src-base/minecraft/net/minecraft/inventory/Container.java ++++ ../src-work/minecraft/net/minecraft/inventory/Container.java +@@ -81,9 +81,11 @@ + + if (!ItemStack.func_77989_b(itemstack1, itemstack)) + { ++ boolean clientStackChanged = !ItemStack.areItemStacksEqualUsingNBTShareTag(itemstack1, itemstack); + itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.func_77946_l(); + this.field_75153_a.set(i, itemstack1); + ++ if (clientStackChanged) + for (int j = 0; j < this.field_75149_d.size(); ++j) + { + ((IContainerListener)this.field_75149_d.get(j)).func_71111_a(this, i, itemstack1); +@@ -589,18 +591,19 @@ + if (!itemstack.func_190926_b() && itemstack.func_77973_b() == p_75135_1_.func_77973_b() && (!p_75135_1_.func_77981_g() || p_75135_1_.func_77960_j() == itemstack.func_77960_j()) && ItemStack.func_77970_a(p_75135_1_, itemstack)) + { + int j = itemstack.func_190916_E() + p_75135_1_.func_190916_E(); ++ int maxSize = Math.min(slot.func_75219_a(), p_75135_1_.func_77976_d()); + +- if (j <= p_75135_1_.func_77976_d()) ++ if (j <= maxSize) + { + p_75135_1_.func_190920_e(0); + itemstack.func_190920_e(j); + slot.func_75218_e(); + flag = true; + } +- else if (itemstack.func_190916_E() < p_75135_1_.func_77976_d()) ++ else if (itemstack.func_190916_E() < maxSize) + { +- p_75135_1_.func_190918_g(p_75135_1_.func_77976_d() - itemstack.func_190916_E()); +- itemstack.func_190920_e(p_75135_1_.func_77976_d()); ++ p_75135_1_.func_190918_g(maxSize - itemstack.func_190916_E()); ++ itemstack.func_190920_e(maxSize); + slot.func_75218_e(); + flag = true; + } +@@ -738,7 +741,7 @@ + p_94525_2_.func_190920_e(1); + break; + case 2: +- p_94525_2_.func_190920_e(p_94525_2_.func_77973_b().func_77639_j()); ++ p_94525_2_.func_190920_e(p_94525_2_.func_77976_d()); + } + + p_94525_2_.func_190917_f(p_94525_3_); diff --git a/patches_old/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch b/patches_old/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch new file mode 100644 index 000000000..4ff44b321 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerBeacon.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerBeacon.java +@@ -90,12 +90,9 @@ + + slot.func_75220_a(itemstack1, itemstack); + } +- else if (!this.field_82864_f.func_75216_d() && this.field_82864_f.func_75214_a(itemstack1) && itemstack1.func_190916_E() == 1) ++ else if (this.func_75135_a(itemstack1, 0, 1, false)) //Forge Fix Shift Clicking in beacons with stacks larger then 1. + { +- if (!this.func_75135_a(itemstack1, 0, 1, false)) +- { +- return ItemStack.field_190927_a; +- } ++ return ItemStack.field_190927_a; + } + else if (p_82846_2_ >= 1 && p_82846_2_ < 28) + { +@@ -145,8 +142,7 @@ + + public boolean func_75214_a(ItemStack p_75214_1_) + { +- Item item = p_75214_1_.func_77973_b(); +- return item == Items.field_151166_bC || item == Items.field_151045_i || item == Items.field_151043_k || item == Items.field_151042_j; ++ return p_75214_1_.func_77973_b().isBeaconPayment(p_75214_1_); + } + + public int func_75219_a() diff --git a/patches_old/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch b/patches_old/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch new file mode 100644 index 000000000..f5b404c23 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerBrewingStand.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java +@@ -197,7 +197,7 @@ + + public boolean func_75214_a(ItemStack p_75214_1_) + { +- return PotionHelper.func_185205_a(p_75214_1_); ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_75214_1_); + } + + public int func_75219_a() +@@ -229,6 +229,7 @@ + + if (p_190901_1_ instanceof EntityPlayerMP) + { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerBrewedPotion(p_190901_1_, p_190901_2_); + CriteriaTriggers.field_192130_j.func_192173_a((EntityPlayerMP)p_190901_1_, potiontype); + } + +@@ -238,8 +239,7 @@ + + public static boolean func_75243_a_(ItemStack p_75243_0_) + { +- Item item = p_75243_0_.func_77973_b(); +- return item == Items.field_151068_bn || item == Items.field_185155_bH || item == Items.field_185156_bI || item == Items.field_151069_bo; ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_75243_0_); + } + } + } diff --git a/patches_old/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches_old/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch new file mode 100644 index 000000000..c08121be8 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -0,0 +1,98 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerEnchantment.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerEnchantment.java +@@ -73,9 +73,12 @@ + }); + this.func_75146_a(new Slot(this.field_75168_e, 1, 35, 47) + { ++ java.util.List ores = net.minecraftforge.oredict.OreDictionary.getOres("gemLapis"); + public boolean func_75214_a(ItemStack p_75214_1_) + { +- return p_75214_1_.func_77973_b() == Items.field_151100_aR && EnumDyeColor.func_176766_a(p_75214_1_.func_77960_j()) == EnumDyeColor.BLUE; ++ for (ItemStack ore : ores) ++ if (net.minecraftforge.oredict.OreDictionary.itemMatches(ore, p_75214_1_, false)) return true; ++ return false; + } + }); + +@@ -160,6 +163,7 @@ + if (!this.field_75172_h.field_72995_K) + { + int l = 0; ++ float power = 0; + + for (int j = -1; j <= 1; ++j) + { +@@ -167,37 +171,14 @@ + { + if ((j != 0 || k != 0) && this.field_75172_h.func_175623_d(this.field_178150_j.func_177982_a(k, 0, j)) && this.field_75172_h.func_175623_d(this.field_178150_j.func_177982_a(k, 1, j))) + { +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 0, j * 2)).func_177230_c() == Blocks.field_150342_X) +- { +- ++l; +- } +- +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 1, j * 2)).func_177230_c() == Blocks.field_150342_X) +- { +- ++l; +- } +- ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 0, j * 2)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 1, j * 2)); + if (k != 0 && j != 0) + { +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 0, j)).func_177230_c() == Blocks.field_150342_X) +- { +- ++l; +- } +- +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 1, j)).func_177230_c() == Blocks.field_150342_X) +- { +- ++l; +- } +- +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k, 0, j * 2)).func_177230_c() == Blocks.field_150342_X) +- { +- ++l; +- } +- +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k, 1, j * 2)).func_177230_c() == Blocks.field_150342_X) +- { +- ++l; +- } ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 0, j)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 1, j)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k, 0, j * 2)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k, 1, j * 2)); + } + } + } +@@ -207,7 +188,7 @@ + + for (int i1 = 0; i1 < 3; ++i1) + { +- this.field_75167_g[i1] = EnchantmentHelper.func_77514_a(this.field_75169_l, i1, l, itemstack); ++ this.field_75167_g[i1] = EnchantmentHelper.func_77514_a(this.field_75169_l, i1, (int)power, itemstack); + this.field_185001_h[i1] = -1; + this.field_185002_i[i1] = -1; + +@@ -215,6 +196,7 @@ + { + this.field_75167_g[i1] = 0; + } ++ this.field_75167_g[i1] = net.minecraftforge.event.ForgeEventFactory.onEnchantmentLevelSet(field_75172_h, field_178150_j, i1, (int)power, itemstack, field_75167_g[i1]); + } + + for (int j1 = 0; j1 < 3; ++j1) +@@ -400,10 +382,9 @@ + return ItemStack.field_190927_a; + } + +- if (itemstack1.func_77942_o() && itemstack1.func_190916_E() == 1) ++ if (itemstack1.func_77942_o())// Forge: Fix MC-17431 + { +- ((Slot)this.field_75151_b.get(0)).func_75215_d(itemstack1.func_77946_l()); +- itemstack1.func_190920_e(0); ++ ((Slot)this.field_75151_b.get(0)).func_75215_d(itemstack1.func_77979_a(1)); + } + else if (!itemstack1.func_190926_b()) + { diff --git a/patches_old/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches_old/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch new file mode 100644 index 000000000..6fea935b0 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerPlayer.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerPlayer.java +@@ -43,7 +43,7 @@ + } + public boolean func_75214_a(ItemStack p_75214_1_) + { +- return entityequipmentslot == EntityLiving.func_184640_d(p_75214_1_); ++ return p_75214_1_.func_77973_b().isValidArmor(p_75214_1_, entityequipmentslot, field_82862_h); + } + public boolean func_82869_a(EntityPlayer p_82869_1_) + { diff --git a/patches_old/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches_old/minecraft/net/minecraft/inventory/ContainerRepair.java.patch new file mode 100644 index 000000000..65af6163c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -0,0 +1,51 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java +@@ -70,6 +70,8 @@ + p_190901_1_.func_82242_a(-ContainerRepair.this.field_82854_e); + } + ++ float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(p_190901_1_, p_190901_2_, ContainerRepair.this.field_82853_g.func_70301_a(0), ContainerRepair.this.field_82853_g.func_70301_a(1)); ++ + ContainerRepair.this.field_82853_g.func_70299_a(0, ItemStack.field_190927_a); + + if (ContainerRepair.this.field_82856_l > 0) +@@ -94,7 +96,7 @@ + ContainerRepair.this.field_82854_e = 0; + IBlockState iblockstate = p_i45807_2_.func_180495_p(p_i45807_3_); + +- if (!p_190901_1_.field_71075_bZ.field_75098_d && !p_i45807_2_.field_72995_K && iblockstate.func_177230_c() == Blocks.field_150467_bQ && p_190901_1_.func_70681_au().nextFloat() < 0.12F) ++ if (!p_190901_1_.field_71075_bZ.field_75098_d && !p_i45807_2_.field_72995_K && iblockstate.func_177230_c() == Blocks.field_150467_bQ && p_190901_1_.func_70681_au().nextFloat() < breakChance) + { + int l = ((Integer)iblockstate.func_177229_b(BlockAnvil.field_176505_b)).intValue(); + ++l; +@@ -163,10 +165,12 @@ + Map map = EnchantmentHelper.func_82781_a(itemstack1); + j = j + itemstack.func_82838_A() + (itemstack2.func_190926_b() ? 0 : itemstack2.func_82838_A()); + this.field_82856_l = 0; ++ boolean flag = false; + + if (!itemstack2.func_190926_b()) + { +- boolean flag = itemstack2.func_77973_b() == Items.field_151134_bR && !ItemEnchantedBook.func_92110_g(itemstack2).func_82582_d(); ++ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_82852_f, field_82857_m, j)) return; ++ flag = itemstack2.func_77973_b() == Items.field_151134_bR && !ItemEnchantedBook.func_92110_g(itemstack2).func_82582_d(); + + if (itemstack1.func_77984_f() && itemstack1.func_77973_b().func_82789_a(itemstack, itemstack2)) + { +@@ -213,7 +217,7 @@ + l1 = 0; + } + +- if (l1 < itemstack1.func_77960_j()) ++ if (l1 < itemstack1.func_77952_i()) // vanilla uses metadata here instead of damage. + { + itemstack1.func_77964_b(l1); + i += 2; +@@ -317,6 +321,7 @@ + i += k; + itemstack1.func_151001_c(this.field_82857_m); + } ++ if (flag && !itemstack1.func_77973_b().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = ItemStack.field_190927_a; + + this.field_82854_e = j + i; + diff --git a/patches_old/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches_old/minecraft/net/minecraft/inventory/SlotCrafting.java.patch new file mode 100644 index 000000000..8d60d550e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/SlotCrafting.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/inventory/SlotCrafting.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java +@@ -51,6 +51,7 @@ + if (this.field_75237_g > 0) + { + p_75208_1_.func_77980_a(this.field_75238_b.field_70170_p, this.field_75238_b, this.field_75237_g); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(this.field_75238_b, p_75208_1_, field_75239_a); + } + + this.field_75237_g = 0; +@@ -67,7 +68,9 @@ + public ItemStack func_190901_a(EntityPlayer p_190901_1_, ItemStack p_190901_2_) + { + this.func_75208_c(p_190901_2_); ++ net.minecraftforge.common.ForgeHooks.setCraftingPlayer(p_190901_1_); + NonNullList nonnulllist = CraftingManager.func_180303_b(this.field_75239_a, p_190901_1_.field_70170_p); ++ net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null); + + for (int i = 0; i < nonnulllist.size(); ++i) + { diff --git a/patches_old/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch b/patches_old/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch new file mode 100644 index 000000000..843b76257 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch @@ -0,0 +1,9 @@ +--- ../src-base/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java +@@ -79,5 +79,6 @@ + } + + this.field_75228_b = 0; ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerSmeltedEvent(field_75229_a, p_75208_1_); + } + } diff --git a/patches_old/minecraft/net/minecraft/item/Item.java.patch b/patches_old/minecraft/net/minecraft/item/Item.java.patch new file mode 100644 index 000000000..810dbd0bd --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/Item.java.patch @@ -0,0 +1,867 @@ +--- ../src-base/minecraft/net/minecraft/item/Item.java ++++ ../src-work/minecraft/net/minecraft/item/Item.java +@@ -58,10 +58,10 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-public class Item ++public class Item extends net.minecraftforge.registries.IForgeRegistryEntry.Impl + { +- public static final RegistryNamespaced field_150901_e = new RegistryNamespaced(); +- private static final Map field_179220_a = Maps.newHashMap(); ++ public static final RegistryNamespaced field_150901_e = net.minecraftforge.registries.GameData.getWrapper(Item.class); ++ private static final Map field_179220_a = net.minecraftforge.registries.GameData.getBlockItemMap(); + private static final IItemPropertyGetter field_185046_b = new IItemPropertyGetter() + { + @SideOnly(Side.CLIENT) +@@ -197,6 +197,7 @@ + return p_77654_1_; + } + ++ @Deprecated // Use ItemStack sensitive version below. + public int func_77639_j() + { + return this.field_77777_bU; +@@ -218,6 +219,7 @@ + return this; + } + ++ @Deprecated + public int func_77612_l() + { + return this.field_77699_b; +@@ -317,6 +319,7 @@ + return this.field_77700_c; + } + ++ @Deprecated // Use ItemStack sensitive version below. + public boolean func_77634_r() + { + return this.field_77700_c != null; +@@ -372,7 +375,7 @@ + + public boolean func_77616_k(ItemStack p_77616_1_) + { +- return this.func_77639_j() == 1 && this.func_77645_m(); ++ return this.getItemStackLimit(p_77616_1_) == 1 && this.func_77645_m(); + } + + protected RayTraceResult func_77621_a(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) +@@ -389,8 +392,8 @@ + float f5 = MathHelper.func_76126_a(-f * 0.017453292F); + float f6 = f3 * f4; + float f7 = f2 * f4; +- double d3 = 5.0D; +- Vec3d vec3d1 = vec3d.func_72441_c((double)f6 * 5.0D, (double)f5 * 5.0D, (double)f7 * 5.0D); ++ double d3 = p_77621_2_.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111126_e(); ++ Vec3d vec3d1 = vec3d.func_72441_c((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); + return p_77621_1_.func_147447_a(vec3d, vec3d1, p_77621_3_, !p_77621_3_, false); + } + +@@ -409,6 +412,9 @@ + + protected boolean func_194125_a(CreativeTabs p_194125_1_) + { ++ for (CreativeTabs tab : this.getCreativeTabs()) ++ if (tab == p_194125_1_) ++ return true; + CreativeTabs creativetabs = this.func_77640_w(); + return creativetabs != null && (p_194125_1_ == CreativeTabs.field_78027_g || p_194125_1_ == creativetabs); + } +@@ -435,11 +441,757 @@ + return false; + } + ++ @Deprecated // Use ItemStack sensitive version below. + public Multimap func_111205_h(EntityEquipmentSlot p_111205_1_) + { + return HashMultimap.create(); + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * ItemStack sensitive version of getItemAttributeModifiers ++ */ ++ public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) ++ { ++ return this.func_111205_h(slot); ++ } ++ ++ /** ++ * 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 displayName 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 ++ * @param hand Which hand the item is being held in. ++ * @return Return PASS to allow vanilla handling, any other to skip normal code. ++ */ ++ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) ++ { ++ return EnumActionResult.PASS; ++ } ++ ++ protected boolean canRepair = true; ++ /** ++ * Called by CraftingManager to determine if an item is reparable. ++ * @return True if reparable ++ */ ++ public boolean isRepairable() ++ { ++ return canRepair && func_77645_m(); ++ } ++ ++ /** ++ * Call to disable repair recipes. ++ * @return The current Item instance ++ */ ++ public Item setNoRepair() ++ { ++ canRepair = false; ++ return this; ++ } ++ ++ /** ++ * Override this method to change the NBT data being sent to the client. ++ * You should ONLY override this when you have no other choice, as this might change behavior client side! ++ * ++ * Note that this will sometimes be applied multiple times, the following MUST be supported: ++ * Item item = stack.getItem(); ++ * NBTTagCompound nbtShare1 = item.getNBTShareTag(stack); ++ * stack.setTagCompound(nbtShare1); ++ * NBTTagCompound nbtShare2 = item.getNBTShareTag(stack); ++ * assert nbtShare1.equals(nbtShare2); ++ * ++ * @param stack The stack to send the NBT tag for ++ * @return The NBT tag ++ */ ++ @Nullable ++ public NBTTagCompound getNBTShareTag(ItemStack stack) ++ { ++ return stack.func_77978_p(); ++ } ++ ++ /** ++ * Override this method to decide what to do with the NBT data received from getNBTShareTag(). ++ * ++ * @param stack The stack that received NBT ++ * @param nbt Received NBT, can be null ++ */ ++ public void readNBTShareTag(ItemStack stack, @Nullable NBTTagCompound nbt) ++ { ++ stack.func_77982_d(nbt); ++ } ++ ++ /** ++ * 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, EntityLivingBase 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; ++ } ++ ++ /** ++ * 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 ItemStack.field_190927_a; ++ } ++ return new ItemStack(func_77668_q()); ++ } ++ ++ /** ++ * 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 func_77634_r(); ++ } ++ ++ /** ++ * 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 ++ */ ++ @Nullable ++ 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[]{ func_77640_w() }; ++ } ++ ++ /** ++ * 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. ++ } ++ ++ /** ++ * ++ * 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(ItemStack stack, net.minecraft.world.IBlockAccess 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, for the entity. ++ * ++ * TODO: Change name to canEquip in 1.13? ++ * ++ * @param stack The ItemStack ++ * @param armorType Armor slot to be verified. ++ * @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, EntityEquipmentSlot armorType, Entity entity) ++ { ++ return net.minecraft.entity.EntityLiving.func_184640_d(stack) == armorType; ++ } ++ ++ /** ++ * Override this to set a non-default armor slot for an ItemStack, but ++ * do not use this to get the armor slot of said stack; for that, use ++ * {@link net.minecraft.entity.EntityLiving#getSlotForItemStack(ItemStack)}. ++ * ++ * @param stack the ItemStack ++ * @return the armor slot of the ItemStack, or {@code null} to let the default ++ * vanilla logic as per {@code EntityLiving.getSlotForItemStack(stack)} decide ++ */ ++ @Nullable ++ public EntityEquipmentSlot getEquipmentSlot(ItemStack stack) ++ { ++ return null; ++ } ++ ++ /** ++ * 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 ++ */ ++ @Nullable ++ public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot 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) ++ @Nullable ++ public net.minecraft.client.gui.FontRenderer getFontRenderer(ItemStack stack) ++ { ++ 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 The slot the armor is in ++ * @param _default Original armor model. Will have attributes set. ++ * @return A ModelBiped to render instead of the default ++ */ ++ @SideOnly(Side.CLIENT) ++ @Nullable ++ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, net.minecraft.client.model.ModelBiped _default) ++ { ++ return null; ++ } ++ ++ /** ++ * 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.field_77991_e; ++ } ++ ++ /** ++ * 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.field_77991_e; ++ } ++ ++ /** ++ * 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.func_77951_h(); ++ } ++ ++ /** ++ * Queries the percentage of the 'Durability' bar that should be drawn. ++ * ++ * @param stack The current ItemStack ++ * @return 0.0 for 100% (no damage / full bar), 1.0 for 0% (fully damaged / empty bar) ++ */ ++ public double getDurabilityForDisplay(ItemStack stack) ++ { ++ return (double)stack.func_77952_i() / (double)stack.func_77958_k(); ++ } ++ ++ /** ++ * Returns the packed int RGB value used to render the durability bar in the GUI. ++ * Defaults to a value based on the hue scaled based on {@link #getDurabilityForDisplay}, but can be overriden. ++ * ++ * @param stack Stack to get durability from ++ * @return A packed RGB value for the durability colour (0x00RRGGBB) ++ */ ++ public int getRGBDurabilityForDisplay(ItemStack stack) ++ { ++ return MathHelper.func_181758_c(Math.max(0.0F, (float) (1.0F - getDurabilityForDisplay(stack))) / 3.0F, 1.0F, 1.0F); ++ } ++ /** ++ * 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 func_77612_l(); ++ } ++ ++ /** ++ * 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.field_77991_e > 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.field_77991_e = damage; ++ ++ if (stack.field_77991_e < 0) ++ { ++ stack.field_77991_e = 0; ++ } ++ } ++ ++ /** ++ * Checked from {@link net.minecraft.client.multiplayer.PlayerControllerMP#onPlayerDestroyBlock(BlockPos pos) PlayerControllerMP.onPlayerDestroyBlock()} ++ * when a creative player left-clicks a block with this item. ++ * Also checked from {@link net.minecraftforge.common.ForgeHooks#onBlockBreakEvent(World, GameType, EntityPlayerMP, BlockPos) ForgeHooks.onBlockBreakEvent()} ++ * to prevent sending an event. ++ * @return true if the given player can destroy specified block in creative mode with this item ++ */ ++ public boolean canDestroyBlockInCreative(World world, BlockPos pos, ItemStack stack, EntityPlayer player) ++ { ++ return !(this instanceof ItemSword); ++ } ++ ++ /** ++ * ItemStack sensitive version of {@link #canHarvestBlock(IBlockState)} ++ * @param state The block trying to harvest ++ * @param stack The itemstack used to harvest the block ++ * @return true if can harvest the block ++ */ ++ public boolean canHarvestBlock(IBlockState state, ItemStack stack) ++ { ++ return func_150897_b(state); ++ } ++ ++ /** ++ * 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.func_77639_j(); ++ } ++ ++ 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 specified tool class, ++ * Returns -1 if this tool is not of the specified type ++ * ++ * @param stack This item stack instance ++ * @param toolClass Tool Class ++ * @param player The player trying to harvest the given blockstate ++ * @param blockState The block to harvest ++ * @return Harvest level, or -1 if not the specified tool type. ++ */ ++ public int getHarvestLevel(ItemStack stack, String toolClass, @Nullable EntityPlayer player, @Nullable IBlockState blockState) ++ { ++ 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 func_77619_b(); ++ } ++ ++ /** ++ * Checks whether an item can be enchanted with a certain enchantment. This applies specifically to enchanting an item in the enchanting table and is called when retrieving the list of possible enchantments for an item. ++ * Enchantments may additionally (or exclusively) be doing their own checks in {@link net.minecraft.enchantment.Enchantment#canApplyAtEnchantingTable(ItemStack)}; check the individual implementation for reference. ++ * By default this will check if the enchantment type is valid for this item type. ++ * @param stack the item stack to be enchanted ++ * @param enchantment the enchantment to be applied ++ * @return true if the enchantment can be applied to this item ++ */ ++ public boolean canApplyAtEnchantingTable(ItemStack stack, net.minecraft.enchantment.Enchantment enchantment) ++ { ++ return enchantment.field_77351_y.func_77557_a(stack.func_77973_b()); ++ } ++ ++ /** ++ * 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.field_151166_bC || this == Items.field_151045_i || this == Items.field_151043_k || this == Items.field_151042_j; ++ } ++ ++ /** ++ * 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 !oldStack.equals(newStack); //!ItemStack.areItemStacksEqual(oldStack, newStack); ++ } ++ ++ /** ++ * Called when the player is mining a block and the item in his hand changes. ++ * Allows to not reset blockbreaking if only NBT or similar changes. ++ * @param oldStack The old stack that was used for mining. Item in players main hand ++ * @param newStack The new stack ++ * @return True to reset block break progress ++ */ ++ public boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack) ++ { ++ return !(newStack.func_77973_b() == oldStack.func_77973_b() && ItemStack.func_77970_a(newStack, oldStack) && (newStack.func_77984_f() || newStack.func_77960_j() == oldStack.func_77960_j())); ++ } ++ ++ /** ++ * Called to get the Mod ID of the mod that *created* the ItemStack, ++ * instead of the real Mod ID that *registered* it. ++ * ++ * For example the Forge Universal Bucket creates a subitem for each modded fluid, ++ * and it returns the modded fluid's Mod ID here. ++ * ++ * Mods that register subitems for other mods can override this. ++ * Informational mods can call it to show the mod that created the item. ++ * ++ * @param itemStack the ItemStack to check ++ * @return the Mod ID for the ItemStack, or ++ * null when there is no specially associated mod and {@link #getRegistryName()} would return null. ++ */ ++ @Nullable ++ public String getCreatorModId(ItemStack itemStack) ++ { ++ return net.minecraftforge.common.ForgeHooks.getDefaultCreatorModId(itemStack); ++ } ++ ++ /** ++ * 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. ++ */ ++ @Nullable ++ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) ++ { ++ return null; ++ } ++ ++ public com.google.common.collect.ImmutableMap getAnimationParameters(final ItemStack stack, final World world, final EntityLivingBase entity) ++ { ++ com.google.common.collect.ImmutableMap.Builder builder = com.google.common.collect.ImmutableMap.builder(); ++ for(ResourceLocation location : field_185051_m.func_148742_b()) ++ { ++ final IItemPropertyGetter parameter = field_185051_m.func_82594_a(location); ++ builder.put(location.toString(), new net.minecraftforge.common.animation.ITimeValue() ++ { ++ public float apply(float input) ++ { ++ return parameter.func_185085_a(stack, world, entity); ++ } ++ }); ++ } ++ return builder.build(); ++ } ++ ++ /** ++ * Can this Item disable a shield ++ * @param stack The ItemStack ++ * @param shield The shield in question ++ * @param entity The EntityLivingBase holding the shield ++ * @param attacker The EntityLivingBase holding the ItemStack ++ * @retrun True if this ItemStack can disable the shield in question. ++ */ ++ public boolean canDisableShield(ItemStack stack, ItemStack shield, EntityLivingBase entity, EntityLivingBase attacker) ++ { ++ return this instanceof ItemAxe; ++ } ++ ++ /** ++ * Is this Item a shield ++ * @param stack The ItemStack ++ * @param entity The Entity holding the ItemStack ++ * @return True if the ItemStack is considered a shield ++ */ ++ public boolean isShield(ItemStack stack, @Nullable EntityLivingBase entity) ++ { ++ return stack.func_77973_b() == Items.field_185159_cQ; ++ } ++ ++ /** ++ * @return the fuel burn time for this itemStack in a furnace. ++ * Return 0 to make it not act as a fuel. ++ * Return -1 to let the default vanilla logic decide. ++ */ ++ public int getItemBurnTime(ItemStack itemStack) ++ { ++ return -1; ++ } ++ ++ /** ++ * Returns an enum constant of type {@code HorseArmorType}. ++ * The returned enum constant will be used to determine the armor value and texture of this item when equipped. ++ * @param stack the armor stack ++ * @return an enum constant of type {@code HorseArmorType}. Return HorseArmorType.NONE if this is not horse armor ++ */ ++ public net.minecraft.entity.passive.HorseArmorType getHorseArmorType(ItemStack stack) ++ { ++ return net.minecraft.entity.passive.HorseArmorType.func_188576_a(stack.func_77973_b()); ++ } ++ ++ public String getHorseArmorTexture(net.minecraft.entity.EntityLiving wearer, ItemStack stack) ++ { ++ return getHorseArmorType(stack).func_188574_d(); ++ } ++ ++ /** ++ * Called every tick from {@link EntityHorse#onUpdate()} on the item in the armor slot. ++ * @param world the world the horse is in ++ * @param horse the horse wearing this armor ++ * @param armor the armor itemstack ++ */ ++ public void onHorseArmorTick(World world, net.minecraft.entity.EntityLiving horse, ItemStack armor) {} ++ ++ @SideOnly(Side.CLIENT) ++ @Nullable ++ private net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer teisr; ++ ++ /** ++ * @return This Item's renderer, or the default instance if it does not have one. ++ */ ++ @SideOnly(Side.CLIENT) ++ public final net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer getTileEntityItemStackRenderer() ++ { ++ return teisr != null ? teisr : net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer.field_147719_a; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public void setTileEntityItemStackRenderer(@Nullable net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer teisr) ++ { ++ this.teisr = teisr; ++ } ++ ++ /* ======================================== FORGE END =====================================*/ ++ + public static void func_150900_l() + { + func_179214_a(Blocks.field_150350_a, new ItemAir(Blocks.field_150350_a)); +@@ -999,6 +1751,8 @@ + private final float field_78010_h; + private final float field_78011_i; + private final int field_78008_j; ++ //Added by forge for custom Tool materials. ++ private ItemStack repairMaterial = ItemStack.field_190927_a; + + private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) + { +@@ -1034,6 +1788,7 @@ + return this.field_78008_j; + } + ++ @Deprecated // Use getRepairItemStack below + public Item func_150995_f() + { + if (this == WOOD) +@@ -1057,5 +1812,21 @@ + return this == DIAMOND ? Items.field_151045_i : null; + } + } ++ ++ public ToolMaterial setRepairItem(ItemStack stack) ++ { ++ if (!this.repairMaterial.func_190926_b()) throw new RuntimeException("Repair material has already been set"); ++ if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == DIAMOND) throw new RuntimeException("Can not change vanilla tool repair materials"); ++ this.repairMaterial = stack; ++ return this; ++ } ++ ++ public ItemStack getRepairItemStack() ++ { ++ if (!repairMaterial.func_190926_b()) return repairMaterial; ++ Item ret = this.func_150995_f(); ++ if (ret != null) repairMaterial = new ItemStack(ret, 1, net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); ++ return repairMaterial; ++ } + } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches_old/minecraft/net/minecraft/item/ItemArmor.java.patch new file mode 100644 index 000000000..aeabab817 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -0,0 +1,72 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemArmor.java ++++ ../src-work/minecraft/net/minecraft/item/ItemArmor.java +@@ -187,7 +187,9 @@ + + public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) + { +- return this.field_77878_bZ.func_151685_b() == p_82789_2_.func_77973_b() ? true : super.func_82789_a(p_82789_1_, p_82789_2_); ++ ItemStack mat = this.field_77878_bZ.getRepairItemStack(); ++ if (!mat.func_190926_b() && net.minecraftforge.oredict.OreDictionary.itemMatches(mat,p_82789_2_,false)) return true; ++ return super.func_82789_a(p_82789_1_, p_82789_2_); + } + + public ActionResult func_77659_a(World p_77659_1_, EntityPlayer p_77659_2_, EnumHand p_77659_3_) +@@ -221,6 +223,19 @@ + return multimap; + } + ++ /** ++ * Determines if this armor will be rendered with the secondary 'overlay' texture. ++ * If this is true, the first texture will be rendered using a tint of the color ++ * specified by getColor(ItemStack) ++ * ++ * @param stack The stack ++ * @return true/false ++ */ ++ public boolean hasOverlay(ItemStack stack) ++ { ++ return this.field_77878_bZ == ItemArmor.ArmorMaterial.LEATHER || func_82814_b(stack) != 0x00FFFFFF; ++ } ++ + public static enum ArmorMaterial + { + LEATHER("leather", 5, new int[]{1, 2, 3, 1}, 15, SoundEvents.field_187728_s, 0.0F), +@@ -235,6 +250,8 @@ + private final int field_78055_h; + private final SoundEvent field_185020_j; + private final float field_189417_k; ++ //Added by forge for custom Armor materials. ++ public ItemStack repairMaterial = ItemStack.field_190927_a; + + private ArmorMaterial(String p_i47117_3_, int p_i47117_4_, int[] p_i47117_5_, int p_i47117_6_, SoundEvent p_i47117_7_, float p_i47117_8_) + { +@@ -266,6 +283,7 @@ + return this.field_185020_j; + } + ++ @Deprecated // Use getRepairItemStack below + public Item func_151685_b() + { + if (this == LEATHER) +@@ -300,5 +318,21 @@ + { + return this.field_189417_k; + } ++ ++ public ArmorMaterial setRepairItem(ItemStack stack) ++ { ++ if (!this.repairMaterial.func_190926_b()) throw new RuntimeException("Repair material has already been set"); ++ if (this == LEATHER || this == CHAIN || this == GOLD || this == IRON || this == DIAMOND) throw new RuntimeException("Can not change vanilla armor repair materials"); ++ this.repairMaterial = stack; ++ return this; ++ } ++ ++ public ItemStack getRepairItemStack() ++ { ++ if (!repairMaterial.func_190926_b()) return repairMaterial; ++ Item ret = this.func_151685_b(); ++ if (ret != null) repairMaterial = new ItemStack(ret,1,net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); ++ return repairMaterial; ++ } + } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemArrow.java.patch b/patches_old/minecraft/net/minecraft/item/ItemArrow.java.patch new file mode 100644 index 000000000..01363b4bb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemArrow.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemArrow.java ++++ ../src-work/minecraft/net/minecraft/item/ItemArrow.java +@@ -19,4 +19,10 @@ + entitytippedarrow.func_184555_a(p_185052_2_); + return entitytippedarrow; + } ++ ++ public boolean isInfinite(ItemStack stack, ItemStack bow, net.minecraft.entity.player.EntityPlayer player) ++ { ++ int enchant = net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.init.Enchantments.field_185312_x, bow); ++ return enchant <= 0 ? false : this.getClass() == ItemArrow.class; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemAxe.java.patch b/patches_old/minecraft/net/minecraft/item/ItemAxe.java.patch new file mode 100644 index 000000000..310c9091e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemAxe.java.patch @@ -0,0 +1,16 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemAxe.java ++++ ../src-work/minecraft/net/minecraft/item/ItemAxe.java +@@ -20,6 +20,13 @@ + this.field_185065_c = field_185067_n[p_i45327_1_.ordinal()]; + } + ++ protected ItemAxe(Item.ToolMaterial material, float damage, float speed) ++ { ++ super(material, field_150917_c); ++ this.field_77865_bY = damage; ++ this.field_185065_c = speed; ++ } ++ + public float func_150893_a(ItemStack p_150893_1_, IBlockState p_150893_2_) + { + Material material = p_150893_2_.func_185904_a(); diff --git a/patches_old/minecraft/net/minecraft/item/ItemBed.java.patch b/patches_old/minecraft/net/minecraft/item/ItemBed.java.patch new file mode 100644 index 000000000..f1f00d850 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemBed.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBed.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBed.java +@@ -67,7 +67,7 @@ + IBlockState iblockstate2 = Blocks.field_150324_C.func_176223_P().func_177226_a(BlockBed.field_176471_b, Boolean.valueOf(false)).func_177226_a(BlockBed.field_185512_D, enumfacing).func_177226_a(BlockBed.field_176472_a, BlockBed.EnumPartType.FOOT); + p_180614_2_.func_180501_a(p_180614_3_, iblockstate2, 10); + p_180614_2_.func_180501_a(blockpos, iblockstate2.func_177226_a(BlockBed.field_176472_a, BlockBed.EnumPartType.HEAD), 10); +- SoundType soundtype = iblockstate2.func_177230_c().func_185467_w(); ++ SoundType soundtype = iblockstate2.func_177230_c().getSoundType(iblockstate2, p_180614_2_, p_180614_3_, p_180614_1_); + p_180614_2_.func_184133_a((EntityPlayer)null, p_180614_3_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); + TileEntity tileentity = p_180614_2_.func_175625_s(blockpos); + diff --git a/patches_old/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches_old/minecraft/net/minecraft/item/ItemBlock.java.patch new file mode 100644 index 000000000..b750fd2c2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemBlock.java.patch @@ -0,0 +1,76 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBlock.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java +@@ -49,24 +49,12 @@ + if (!itemstack.func_190926_b() && p_180614_1_.func_175151_a(p_180614_3_, p_180614_5_, itemstack) && p_180614_2_.func_190527_a(this.field_150939_a, p_180614_3_, false, p_180614_5_, (Entity)null)) + { + int i = this.func_77647_b(itemstack.func_77960_j()); +- IBlockState iblockstate1 = this.field_150939_a.func_180642_a(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_1_); ++ IBlockState iblockstate1 = this.field_150939_a.getStateForPlacement(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_1_, p_180614_4_); + +- if (p_180614_2_.func_180501_a(p_180614_3_, iblockstate1, 11)) ++ if (placeBlockAt(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, iblockstate1)) + { + iblockstate1 = p_180614_2_.func_180495_p(p_180614_3_); +- +- if (iblockstate1.func_177230_c() == this.field_150939_a) +- { +- func_179224_a(p_180614_2_, p_180614_1_, p_180614_3_, itemstack); +- this.field_150939_a.func_180633_a(p_180614_2_, p_180614_3_, iblockstate1, p_180614_1_, itemstack); +- +- if (p_180614_1_ instanceof EntityPlayerMP) +- { +- CriteriaTriggers.field_193137_x.func_193173_a((EntityPlayerMP)p_180614_1_, p_180614_3_, itemstack); +- } +- } +- +- SoundType soundtype = this.field_150939_a.func_185467_w(); ++ SoundType soundtype = iblockstate1.func_177230_c().getSoundType(iblockstate1, p_180614_2_, p_180614_3_, p_180614_1_); + p_180614_2_.func_184133_a(p_180614_1_, p_180614_3_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); + itemstack.func_190918_g(1); + } +@@ -127,7 +115,7 @@ + { + Block block = p_179222_1_.func_180495_p(p_179222_2_).func_177230_c(); + +- if (block == Blocks.field_150431_aC) ++ if (block == Blocks.field_150431_aC && block.func_176200_f(p_179222_1_, p_179222_2_)) + { + p_179222_3_ = EnumFacing.UP; + } +@@ -171,6 +159,36 @@ + + public Block func_179223_d() + { ++ return this.getBlockRaw() == null ? null : this.getBlockRaw().delegate.get(); ++ } ++ ++ private Block getBlockRaw() ++ { + return this.field_150939_a; + } ++ ++ /** ++ * Called to actually place the block, after the location is determined ++ * and all permission checks have been made. ++ * ++ * @param stack The item stack that was used to place the block. This can be changed inside the method. ++ * @param player The player who is placing the block. Can be null if the block is not being placed by a player. ++ * @param side The side the player (or machine) right-clicked on. ++ */ ++ public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) ++ { ++ if (!world.func_180501_a(pos, newState, 11)) return false; ++ ++ IBlockState state = world.func_180495_p(pos); ++ if (state.func_177230_c() == this.field_150939_a) ++ { ++ func_179224_a(world, player, pos, stack); ++ this.field_150939_a.func_180633_a(world, pos, state, player, stack); ++ ++ if (player instanceof EntityPlayerMP) ++ CriteriaTriggers.field_193137_x.func_193173_a((EntityPlayerMP)player, pos, stack); ++ } ++ ++ return true; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch b/patches_old/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch new file mode 100644 index 000000000..57c528072 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBlockSpecial.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBlockSpecial.java +@@ -43,7 +43,7 @@ + + if (!itemstack.func_190926_b() && p_180614_1_.func_175151_a(p_180614_3_, p_180614_5_, itemstack) && p_180614_2_.func_190527_a(this.field_150935_a, p_180614_3_, false, p_180614_5_, (Entity)null)) + { +- IBlockState iblockstate1 = this.field_150935_a.func_180642_a(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, 0, p_180614_1_); ++ IBlockState iblockstate1 = this.field_150935_a.getStateForPlacement(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, 0, p_180614_1_, p_180614_4_); + + if (!p_180614_2_.func_180501_a(p_180614_3_, iblockstate1, 11)) + { +@@ -64,7 +64,7 @@ + } + } + +- SoundType soundtype = this.field_150935_a.func_185467_w(); ++ SoundType soundtype = iblockstate1.func_177230_c().getSoundType(iblockstate1, p_180614_2_, p_180614_3_, p_180614_1_); + p_180614_2_.func_184133_a(p_180614_1_, p_180614_3_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); + itemstack.func_190918_g(1); + return EnumActionResult.SUCCESS; +@@ -75,4 +75,14 @@ + return EnumActionResult.FAIL; + } + } ++ ++ public Block getBlock() ++ { ++ return this.getBlockRaw() == null ? null : this.getBlockRaw().delegate.get(); ++ } ++ ++ private Block getBlockRaw() ++ { ++ return this.field_150935_a; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemBow.java.patch b/patches_old/minecraft/net/minecraft/item/ItemBow.java.patch new file mode 100644 index 000000000..0694e0b30 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemBow.java.patch @@ -0,0 +1,37 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBow.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBow.java +@@ -90,6 +90,10 @@ + boolean flag = entityplayer.field_71075_bZ.field_75098_d || EnchantmentHelper.func_77506_a(Enchantments.field_185312_x, p_77615_1_) > 0; + ItemStack itemstack = this.func_185060_a(entityplayer); + ++ int i = this.func_77626_a(p_77615_1_) - p_77615_4_; ++ i = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(p_77615_1_, p_77615_2_, entityplayer, i, !itemstack.func_190926_b() || flag); ++ if (i < 0) return; ++ + if (!itemstack.func_190926_b() || flag) + { + if (itemstack.func_190926_b()) +@@ -97,12 +101,11 @@ + itemstack = new ItemStack(Items.field_151032_g); + } + +- int i = this.func_77626_a(p_77615_1_) - p_77615_4_; + float f = func_185059_b(i); + + if ((double)f >= 0.1D) + { +- boolean flag1 = flag && itemstack.func_77973_b() == Items.field_151032_g; ++ boolean flag1 = entityplayer.field_71075_bZ.field_75098_d || (itemstack.func_77973_b() instanceof ItemArrow && ((ItemArrow) itemstack.func_77973_b()).isInfinite(itemstack, p_77615_1_, entityplayer)); + + if (!p_77615_2_.field_72995_K) + { +@@ -190,6 +193,9 @@ + ItemStack itemstack = p_77659_2_.func_184586_b(p_77659_3_); + boolean flag = !this.func_185060_a(p_77659_2_).func_190926_b(); + ++ ActionResult ret = net.minecraftforge.event.ForgeEventFactory.onArrowNock(itemstack, p_77659_1_, p_77659_2_, p_77659_3_, flag); ++ if (ret != null) return ret; ++ + if (!p_77659_2_.field_71075_bZ.field_75098_d && !flag) + { + return flag ? new ActionResult(EnumActionResult.PASS, itemstack) : new ActionResult(EnumActionResult.FAIL, itemstack); diff --git a/patches_old/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches_old/minecraft/net/minecraft/item/ItemBucket.java.patch new file mode 100644 index 000000000..10e135cc2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemBucket.java.patch @@ -0,0 +1,28 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBucket.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBucket.java +@@ -40,6 +40,8 @@ + boolean flag = this.field_77876_a == Blocks.field_150350_a; + ItemStack itemstack = p_77659_2_.func_184586_b(p_77659_3_); + RayTraceResult raytraceresult = this.func_77621_a(p_77659_1_, p_77659_2_, flag); ++ ActionResult ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(p_77659_2_, p_77659_1_, itemstack, raytraceresult); ++ if (ret != null) return ret; + + if (raytraceresult == null) + { +@@ -188,4 +190,16 @@ + } + } + } ++ ++ @Override ++ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, @Nullable net.minecraft.nbt.NBTTagCompound nbt) { ++ if (this.getClass() == ItemBucket.class) ++ { ++ return new net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper(stack); ++ } ++ else ++ { ++ return super.initCapabilities(stack, nbt); ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches_old/minecraft/net/minecraft/item/ItemBucketMilk.java.patch new file mode 100644 index 000000000..55f14044e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemBucketMilk.java.patch @@ -0,0 +1,34 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBucketMilk.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java +@@ -22,6 +22,7 @@ + + public ItemStack func_77654_b(ItemStack p_77654_1_, World p_77654_2_, EntityLivingBase p_77654_3_) + { ++ if (!p_77654_2_.field_72995_K) p_77654_3_.curePotionEffects(p_77654_1_); // FORGE - move up so stack.shrink does not turn stack into air + if (p_77654_3_ instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)p_77654_3_; +@@ -34,11 +35,6 @@ + p_77654_1_.func_190918_g(1); + } + +- if (!p_77654_2_.field_72995_K) +- { +- p_77654_3_.func_70674_bp(); +- } +- + return p_77654_1_.func_190926_b() ? new ItemStack(Items.field_151133_ar) : p_77654_1_; + } + +@@ -52,6 +48,11 @@ + return EnumAction.DRINK; + } + ++ @Override ++ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, net.minecraft.nbt.NBTTagCompound nbt) { ++ return new net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper(stack); ++ } ++ + public ActionResult func_77659_a(World p_77659_1_, EntityPlayer p_77659_2_, EnumHand p_77659_3_) + { + p_77659_2_.func_184598_c(p_77659_3_); diff --git a/patches_old/minecraft/net/minecraft/item/ItemDoor.java.patch b/patches_old/minecraft/net/minecraft/item/ItemDoor.java.patch new file mode 100644 index 000000000..8321edc9c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemDoor.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemDoor.java ++++ ../src-work/minecraft/net/minecraft/item/ItemDoor.java +@@ -48,7 +48,7 @@ + int j = enumfacing.func_82599_e(); + boolean flag = i < 0 && p_180614_8_ < 0.5F || i > 0 && p_180614_8_ > 0.5F || j < 0 && p_180614_6_ > 0.5F || j > 0 && p_180614_6_ < 0.5F; + func_179235_a(p_180614_2_, p_180614_3_, enumfacing, this.field_179236_a, flag); +- SoundType soundtype = this.field_179236_a.func_185467_w(); ++ SoundType soundtype = p_180614_2_.func_180495_p(p_180614_3_).func_177230_c().getSoundType(p_180614_2_.func_180495_p(p_180614_3_), p_180614_2_, p_180614_3_, p_180614_1_); + p_180614_2_.func_184133_a(p_180614_1_, p_180614_3_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); + itemstack.func_190918_g(1); + return EnumActionResult.SUCCESS; diff --git a/patches_old/minecraft/net/minecraft/item/ItemDye.java.patch b/patches_old/minecraft/net/minecraft/item/ItemDye.java.patch new file mode 100644 index 000000000..d663936c7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemDye.java.patch @@ -0,0 +1,56 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemDye.java ++++ ../src-work/minecraft/net/minecraft/item/ItemDye.java +@@ -52,7 +52,7 @@ + + if (enumdyecolor == EnumDyeColor.WHITE) + { +- if (func_179234_a(itemstack, p_180614_2_, p_180614_3_)) ++ if (applyBonemeal(itemstack, p_180614_2_, p_180614_3_, p_180614_1_, p_180614_4_)) + { + if (!p_180614_2_.field_72995_K) + { +@@ -78,7 +78,7 @@ + + if (p_180614_2_.func_175623_d(p_180614_3_)) + { +- IBlockState iblockstate1 = Blocks.field_150375_by.func_180642_a(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, 0, p_180614_1_); ++ IBlockState iblockstate1 = Blocks.field_150375_by.getStateForPlacement(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, 0, p_180614_1_, p_180614_4_); + p_180614_2_.func_180501_a(p_180614_3_, iblockstate1, 10); + + if (!p_180614_1_.field_71075_bZ.field_75098_d) +@@ -99,8 +99,18 @@ + + public static boolean func_179234_a(ItemStack p_179234_0_, World p_179234_1_, BlockPos p_179234_2_) + { ++ if (p_179234_1_ instanceof net.minecraft.world.WorldServer) ++ return applyBonemeal(p_179234_0_, p_179234_1_, p_179234_2_, net.minecraftforge.common.util.FakePlayerFactory.getMinecraft((net.minecraft.world.WorldServer)p_179234_1_), null); ++ return false; ++ } ++ ++ public static boolean applyBonemeal(ItemStack p_179234_0_, World p_179234_1_, BlockPos p_179234_2_, EntityPlayer player, @javax.annotation.Nullable EnumHand hand) ++ { + IBlockState iblockstate = p_179234_1_.func_180495_p(p_179234_2_); + ++ int hook = net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(player, p_179234_1_, p_179234_2_, iblockstate, p_179234_0_, hand); ++ if (hook != 0) return hook > 0; ++ + if (iblockstate.func_177230_c() instanceof IGrowable) + { + IGrowable igrowable = (IGrowable)iblockstate.func_177230_c(); +@@ -144,6 +154,16 @@ + p_180617_0_.func_175688_a(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)p_180617_1_.func_177958_n() + field_77697_d.nextFloat()), (double)p_180617_1_.func_177956_o() + (double)field_77697_d.nextFloat() * iblockstate.func_185900_c(p_180617_0_, p_180617_1_).field_72337_e, (double)((float)p_180617_1_.func_177952_p() + field_77697_d.nextFloat()), d0, d1, d2); + } + } ++ else ++ { ++ for (int i1 = 0; i1 < p_180617_2_; ++i1) ++ { ++ double d0 = field_77697_d.nextGaussian() * 0.02D; ++ double d1 = field_77697_d.nextGaussian() * 0.02D; ++ double d2 = field_77697_d.nextGaussian() * 0.02D; ++ p_180617_0_.func_175688_a(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)p_180617_1_.func_177958_n() + field_77697_d.nextFloat()), (double)p_180617_1_.func_177956_o() + (double)field_77697_d.nextFloat() * 1.0f, (double)((float)p_180617_1_.func_177952_p() + field_77697_d.nextFloat()), d0, d1, d2, new int[0]); ++ } ++ } + } + + public boolean func_111207_a(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_, EnumHand p_111207_4_) diff --git a/patches_old/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches_old/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch new file mode 100644 index 000000000..bc751c102 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemFlintAndSteel.java ++++ ../src-work/minecraft/net/minecraft/item/ItemFlintAndSteel.java +@@ -34,7 +34,7 @@ + } + else + { +- if (p_180614_2_.func_180495_p(p_180614_3_).func_185904_a() == Material.field_151579_a) ++ if (p_180614_2_.func_175623_d(p_180614_3_)) + { + p_180614_2_.func_184133_a(p_180614_1_, p_180614_3_, SoundEvents.field_187649_bu, SoundCategory.BLOCKS, 1.0F, field_77697_d.nextFloat() * 0.4F + 0.8F); + p_180614_2_.func_180501_a(p_180614_3_, Blocks.field_150480_ab.func_176223_P(), 11); diff --git a/patches_old/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches_old/minecraft/net/minecraft/item/ItemHoe.java.patch new file mode 100644 index 000000000..01cd1bbfb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemHoe.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemHoe.java ++++ ../src-work/minecraft/net/minecraft/item/ItemHoe.java +@@ -47,10 +47,13 @@ + } + else + { ++ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(itemstack, p_180614_1_, p_180614_2_, p_180614_3_); ++ if (hook != 0) return hook > 0 ? EnumActionResult.SUCCESS : EnumActionResult.FAIL; ++ + IBlockState iblockstate = p_180614_2_.func_180495_p(p_180614_3_); + Block block = iblockstate.func_177230_c(); + +- if (p_180614_5_ != EnumFacing.DOWN && p_180614_2_.func_180495_p(p_180614_3_.func_177984_a()).func_185904_a() == Material.field_151579_a) ++ if (p_180614_5_ != EnumFacing.DOWN && p_180614_2_.func_175623_d(p_180614_3_.func_177984_a())) + { + if (block == Blocks.field_150349_c || block == Blocks.field_185774_da) + { diff --git a/patches_old/minecraft/net/minecraft/item/ItemLilyPad.java.patch b/patches_old/minecraft/net/minecraft/item/ItemLilyPad.java.patch new file mode 100644 index 000000000..73ca02424 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemLilyPad.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemLilyPad.java ++++ ../src-work/minecraft/net/minecraft/item/ItemLilyPad.java +@@ -50,6 +50,15 @@ + + if (iblockstate.func_185904_a() == Material.field_151586_h && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0 && p_77659_1_.func_175623_d(blockpos1)) + { ++ // special case for handling block placement with water lilies ++ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(p_77659_1_, blockpos1); ++ p_77659_1_.func_175656_a(blockpos1, Blocks.field_150392_bi.func_176223_P()); ++ if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(p_77659_2_, blocksnapshot, net.minecraft.util.EnumFacing.UP, p_77659_3_).isCanceled()) ++ { ++ blocksnapshot.restore(true, false); ++ return new ActionResult(EnumActionResult.FAIL, itemstack); ++ } ++ + p_77659_1_.func_180501_a(blockpos1, Blocks.field_150392_bi.func_176223_P(), 11); + + if (p_77659_2_ instanceof EntityPlayerMP) diff --git a/patches_old/minecraft/net/minecraft/item/ItemMap.java.patch b/patches_old/minecraft/net/minecraft/item/ItemMap.java.patch new file mode 100644 index 000000000..93b770922 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemMap.java.patch @@ -0,0 +1,46 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemMap.java ++++ ../src-work/minecraft/net/minecraft/item/ItemMap.java +@@ -42,7 +42,7 @@ + p_190906_0_.func_72823_a(s, mapdata); + mapdata.field_76197_d = p_190906_5_; + mapdata.func_176054_a(p_190906_1_, p_190906_3_, mapdata.field_76197_d); +- mapdata.field_76200_c = (byte)p_190906_0_.field_73011_w.func_186058_p().func_186068_a(); ++ mapdata.field_76200_c = p_190906_0_.field_73011_w.getDimension(); + mapdata.field_186210_e = p_190906_6_; + mapdata.field_191096_f = p_190906_7_; + mapdata.func_76185_a(); +@@ -70,7 +70,7 @@ + mapdata = new MapData(s); + mapdata.field_76197_d = 3; + mapdata.func_176054_a((double)p_77873_2_.func_72912_H().func_76079_c(), (double)p_77873_2_.func_72912_H().func_76074_e(), mapdata.field_76197_d); +- mapdata.field_76200_c = (byte)p_77873_2_.field_73011_w.func_186058_p().func_186068_a(); ++ mapdata.field_76200_c = p_77873_2_.field_73011_w.getDimension(); + mapdata.func_76185_a(); + p_77873_2_.func_72823_a(s, mapdata); + } +@@ -80,7 +80,7 @@ + + public void func_77872_a(World p_77872_1_, Entity p_77872_2_, MapData p_77872_3_) + { +- if (p_77872_1_.field_73011_w.func_186058_p().func_186068_a() == p_77872_3_.field_76200_c && p_77872_2_ instanceof EntityPlayer) ++ if (p_77872_1_.field_73011_w.getDimension() == p_77872_3_.field_76200_c && p_77872_2_ instanceof EntityPlayer) + { + int i = 1 << p_77872_3_.field_76197_d; + int j = p_77872_3_.field_76201_a; +@@ -251,13 +251,13 @@ + + public static void func_190905_a(World p_190905_0_, ItemStack p_190905_1_) + { +- if (p_190905_1_.func_77973_b() == Items.field_151098_aY) ++ if (p_190905_1_.func_77973_b() instanceof ItemMap) + { +- MapData mapdata = Items.field_151098_aY.func_77873_a(p_190905_1_, p_190905_0_); ++ MapData mapdata = ((ItemMap) p_190905_1_.func_77973_b()).func_77873_a(p_190905_1_, p_190905_0_); + + if (mapdata != null) + { +- if (p_190905_0_.field_73011_w.func_186058_p().func_186068_a() == mapdata.field_76200_c) ++ if (p_190905_0_.field_73011_w.getDimension() == mapdata.field_76200_c) + { + int i = 1 << mapdata.field_76197_d; + int j = mapdata.field_76201_a; diff --git a/patches_old/minecraft/net/minecraft/item/ItemMinecart.java.patch b/patches_old/minecraft/net/minecraft/item/ItemMinecart.java.patch new file mode 100644 index 000000000..2137fb8ac --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemMinecart.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemMinecart.java ++++ ../src-work/minecraft/net/minecraft/item/ItemMinecart.java +@@ -30,7 +30,7 @@ + double d2 = p_82487_1_.func_82616_c() + (double)enumfacing.func_82599_e() * 1.125D; + BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(enumfacing); + IBlockState iblockstate = world.func_180495_p(blockpos); +- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.func_177230_c() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; ++ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.func_177230_c() instanceof BlockRailBase ? ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(world, blockpos, iblockstate, null) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + double d3; + + if (BlockRailBase.func_176563_d(iblockstate)) +@@ -52,7 +52,7 @@ + } + + IBlockState iblockstate1 = world.func_180495_p(blockpos.func_177977_b()); +- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1.func_177230_c() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate1.func_177229_b(((BlockRailBase)iblockstate1.func_177230_c()).func_176560_l()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; ++ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1.func_177230_c() instanceof BlockRailBase ? ((BlockRailBase)iblockstate1.func_177230_c()).getRailDirection(world, blockpos.func_177977_b(), iblockstate1, null) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + + if (enumfacing != EnumFacing.DOWN && blockrailbase$enumraildirection1.func_177018_c()) + { +@@ -104,7 +104,7 @@ + + if (!p_180614_2_.field_72995_K) + { +- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.func_177230_c() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; ++ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.func_177230_c() instanceof BlockRailBase ? ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(p_180614_2_, p_180614_3_, iblockstate, null) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + double d0 = 0.0D; + + if (blockrailbase$enumraildirection.func_177018_c()) diff --git a/patches_old/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches_old/minecraft/net/minecraft/item/ItemSeedFood.java.patch new file mode 100644 index 000000000..4b6d47a6e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSeedFood.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSeedFood.java +@@ -8,7 +8,7 @@ + import net.minecraft.util.math.BlockPos; + import net.minecraft.world.World; + +-public class ItemSeedFood extends ItemFood ++public class ItemSeedFood extends ItemFood implements net.minecraftforge.common.IPlantable + { + private final Block field_150908_b; + private final Block field_82809_c; +@@ -23,8 +23,8 @@ + public EnumActionResult func_180614_a(EntityPlayer p_180614_1_, World p_180614_2_, BlockPos p_180614_3_, EnumHand p_180614_4_, EnumFacing p_180614_5_, float p_180614_6_, float p_180614_7_, float p_180614_8_) + { + ItemStack itemstack = p_180614_1_.func_184586_b(p_180614_4_); +- +- if (p_180614_5_ == EnumFacing.UP && p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack) && p_180614_2_.func_180495_p(p_180614_3_).func_177230_c() == this.field_82809_c && p_180614_2_.func_175623_d(p_180614_3_.func_177984_a())) ++ net.minecraft.block.state.IBlockState state = p_180614_2_.func_180495_p(p_180614_3_); ++ if (p_180614_5_ == EnumFacing.UP && p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack) && state.func_177230_c().canSustainPlant(state, p_180614_2_, p_180614_3_, EnumFacing.UP, this) && p_180614_2_.func_175623_d(p_180614_3_.func_177984_a())) + { + p_180614_2_.func_180501_a(p_180614_3_.func_177984_a(), this.field_150908_b.func_176223_P(), 11); + itemstack.func_190918_g(1); +@@ -35,4 +35,16 @@ + return EnumActionResult.FAIL; + } + } ++ ++ @Override ++ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) ++ { ++ return net.minecraftforge.common.EnumPlantType.Crop; ++ } ++ ++ @Override ++ public net.minecraft.block.state.IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) ++ { ++ return this.field_150908_b.func_176223_P(); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches_old/minecraft/net/minecraft/item/ItemSeeds.java.patch new file mode 100644 index 000000000..93e4b84fb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSeeds.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSeeds.java +@@ -11,7 +11,7 @@ + import net.minecraft.util.math.BlockPos; + import net.minecraft.world.World; + +-public class ItemSeeds extends Item ++public class ItemSeeds extends Item implements net.minecraftforge.common.IPlantable + { + private final Block field_150925_a; + private final Block field_77838_b; +@@ -26,8 +26,8 @@ + public EnumActionResult func_180614_a(EntityPlayer p_180614_1_, World p_180614_2_, BlockPos p_180614_3_, EnumHand p_180614_4_, EnumFacing p_180614_5_, float p_180614_6_, float p_180614_7_, float p_180614_8_) + { + ItemStack itemstack = p_180614_1_.func_184586_b(p_180614_4_); +- +- if (p_180614_5_ == EnumFacing.UP && p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack) && p_180614_2_.func_180495_p(p_180614_3_).func_177230_c() == this.field_77838_b && p_180614_2_.func_175623_d(p_180614_3_.func_177984_a())) ++ net.minecraft.block.state.IBlockState state = p_180614_2_.func_180495_p(p_180614_3_); ++ if (p_180614_5_ == EnumFacing.UP && p_180614_1_.func_175151_a(p_180614_3_.func_177972_a(p_180614_5_), p_180614_5_, itemstack) && state.func_177230_c().canSustainPlant(state, p_180614_2_, p_180614_3_, EnumFacing.UP, this) && p_180614_2_.func_175623_d(p_180614_3_.func_177984_a())) + { + p_180614_2_.func_175656_a(p_180614_3_.func_177984_a(), this.field_150925_a.func_176223_P()); + +@@ -44,4 +44,16 @@ + return EnumActionResult.FAIL; + } + } ++ ++ @Override ++ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) ++ { ++ return this.field_150925_a == net.minecraft.init.Blocks.field_150388_bm ? net.minecraftforge.common.EnumPlantType.Nether : net.minecraftforge.common.EnumPlantType.Crop; ++ } ++ ++ @Override ++ public net.minecraft.block.state.IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) ++ { ++ return this.field_150925_a.func_176223_P(); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemShears.java.patch b/patches_old/minecraft/net/minecraft/item/ItemShears.java.patch new file mode 100644 index 000000000..20a1ff8b4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemShears.java.patch @@ -0,0 +1,86 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemShears.java ++++ ../src-work/minecraft/net/minecraft/item/ItemShears.java +@@ -26,6 +26,7 @@ + } + + Block block = p_179218_3_.func_177230_c(); ++ if (block instanceof net.minecraftforge.common.IShearable) return true; + return p_179218_3_.func_185904_a() != Material.field_151584_j && block != Blocks.field_150321_G && block != Blocks.field_150329_H && block != Blocks.field_150395_bd && block != Blocks.field_150473_bD && block != Blocks.field_150325_L ? super.func_179218_a(p_179218_1_, p_179218_2_, p_179218_3_, p_179218_4_, p_179218_5_) : true; + } + +@@ -35,6 +36,75 @@ + return block == Blocks.field_150321_G || block == Blocks.field_150488_af || block == Blocks.field_150473_bD; + } + ++ ++ @Override ++ public boolean func_111207_a(ItemStack itemstack, net.minecraft.entity.player.EntityPlayer player, EntityLivingBase entity, net.minecraft.util.EnumHand hand) ++ { ++ if (entity.field_70170_p.field_72995_K) ++ { ++ return false; ++ } ++ if (entity instanceof net.minecraftforge.common.IShearable) ++ { ++ net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)entity; ++ BlockPos pos = new BlockPos(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v); ++ if (target.isShearable(itemstack, entity.field_70170_p, pos)) ++ { ++ java.util.List drops = target.onSheared(itemstack, entity.field_70170_p, pos, ++ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.init.Enchantments.field_185308_t, itemstack)); ++ ++ java.util.Random rand = new java.util.Random(); ++ for(ItemStack stack : drops) ++ { ++ net.minecraft.entity.item.EntityItem ent = entity.func_70099_a(stack, 1.0F); ++ ent.field_70181_x += rand.nextFloat() * 0.05F; ++ ent.field_70159_w += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ ent.field_70179_y += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ } ++ itemstack.func_77972_a(1, entity); ++ } ++ return true; ++ } ++ return false; ++ } ++ ++ @Override ++ public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, net.minecraft.entity.player.EntityPlayer player) ++ { ++ if (player.field_70170_p.field_72995_K || player.field_71075_bZ.field_75098_d) ++ { ++ return false; ++ } ++ Block block = player.field_70170_p.func_180495_p(pos).func_177230_c(); ++ if (block instanceof net.minecraftforge.common.IShearable) ++ { ++ net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)block; ++ if (target.isShearable(itemstack, player.field_70170_p, pos)) ++ { ++ java.util.List drops = target.onSheared(itemstack, player.field_70170_p, pos, ++ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.init.Enchantments.field_185308_t, itemstack)); ++ java.util.Random rand = new java.util.Random(); ++ ++ for (ItemStack stack : drops) ++ { ++ float f = 0.7F; ++ double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; ++ double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; ++ double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; ++ net.minecraft.entity.item.EntityItem entityitem = new net.minecraft.entity.item.EntityItem(player.field_70170_p, (double)pos.func_177958_n() + d, (double)pos.func_177956_o() + d1, (double)pos.func_177952_p() + d2, stack); ++ entityitem.func_174869_p(); ++ player.field_70170_p.func_72838_d(entityitem); ++ } ++ ++ itemstack.func_77972_a(1, player); ++ player.func_71029_a(net.minecraft.stats.StatList.func_188055_a(block)); ++ player.field_70170_p.func_180501_a(pos, Blocks.field_150350_a.func_176223_P(), 11); //TODO: Move to IShearable implementors in 1.12+ ++ return true; ++ } ++ } ++ return false; ++ } ++ + public float func_150893_a(ItemStack p_150893_1_, IBlockState p_150893_2_) + { + Block block = p_150893_2_.func_177230_c(); diff --git a/patches_old/minecraft/net/minecraft/item/ItemSkull.java.patch b/patches_old/minecraft/net/minecraft/item/ItemSkull.java.patch new file mode 100644 index 000000000..cabea4855 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemSkull.java.patch @@ -0,0 +1,22 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSkull.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSkull.java +@@ -43,13 +43,18 @@ + } + else + { ++ if (p_180614_2_.func_180495_p(p_180614_3_).func_177230_c().func_176200_f(p_180614_2_, p_180614_3_)) ++ { ++ p_180614_5_ = EnumFacing.UP; ++ p_180614_3_ = p_180614_3_.func_177977_b(); ++ } + IBlockState iblockstate = p_180614_2_.func_180495_p(p_180614_3_); + Block block = iblockstate.func_177230_c(); + boolean flag = block.func_176200_f(p_180614_2_, p_180614_3_); + + if (!flag) + { +- if (!p_180614_2_.func_180495_p(p_180614_3_).func_185904_a().func_76220_a()) ++ if (!p_180614_2_.func_180495_p(p_180614_3_).func_185904_a().func_76220_a() && !p_180614_2_.isSideSolid(p_180614_3_, p_180614_5_, true)) + { + return EnumActionResult.FAIL; + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemSlab.java.patch b/patches_old/minecraft/net/minecraft/item/ItemSlab.java.patch new file mode 100644 index 000000000..483b99ef5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemSlab.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSlab.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSlab.java +@@ -64,7 +64,7 @@ + + if (axisalignedbb != Block.field_185506_k && p_180614_2_.func_72855_b(axisalignedbb.func_186670_a(p_180614_3_)) && p_180614_2_.func_180501_a(p_180614_3_, iblockstate1, 11)) + { +- SoundType soundtype = this.field_179226_c.func_185467_w(); ++ SoundType soundtype = this.field_179226_c.getSoundType(iblockstate1, p_180614_2_, p_180614_3_, p_180614_1_); + p_180614_2_.func_184133_a(p_180614_1_, p_180614_3_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); + itemstack.func_190918_g(1); + +@@ -124,7 +124,7 @@ + + if (axisalignedbb != Block.field_185506_k && p_180615_3_.func_72855_b(axisalignedbb.func_186670_a(p_180615_4_)) && p_180615_3_.func_180501_a(p_180615_4_, iblockstate1, 11)) + { +- SoundType soundtype = this.field_179226_c.func_185467_w(); ++ SoundType soundtype = this.field_179226_c.getSoundType(iblockstate1, p_180615_3_, p_180615_4_, p_180615_1_); + p_180615_3_.func_184133_a(p_180615_1_, p_180615_4_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); + p_180615_2_.func_190918_g(1); + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemSnow.java.patch b/patches_old/minecraft/net/minecraft/item/ItemSnow.java.patch new file mode 100644 index 000000000..1cd3c65cb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemSnow.java.patch @@ -0,0 +1,22 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSnow.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSnow.java +@@ -51,7 +51,7 @@ + + if (axisalignedbb != Block.field_185506_k && p_180614_2_.func_72855_b(axisalignedbb.func_186670_a(blockpos)) && p_180614_2_.func_180501_a(blockpos, iblockstate1, 10)) + { +- SoundType soundtype = this.field_150939_a.func_185467_w(); ++ SoundType soundtype = this.field_150939_a.getSoundType(iblockstate1, p_180614_2_, p_180614_3_, p_180614_1_); + p_180614_2_.func_184133_a(p_180614_1_, blockpos, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F); + + if (p_180614_1_ instanceof EntityPlayerMP) +@@ -77,4 +77,10 @@ + { + return p_77647_1_; + } ++ ++ public boolean func_179222_a(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) ++ { ++ IBlockState state = world.func_180495_p(pos); ++ return (state.func_177230_c() != net.minecraft.init.Blocks.field_150431_aC || ((Integer)state.func_177229_b(BlockSnow.field_176315_a)) > 7) ? super.func_179222_a(world, pos, side, player, stack) : true; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/item/ItemSword.java.patch b/patches_old/minecraft/net/minecraft/item/ItemSword.java.patch new file mode 100644 index 000000000..178744f5f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemSword.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSword.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSword.java +@@ -88,7 +88,9 @@ + + public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) + { +- return this.field_150933_b.func_150995_f() == p_82789_2_.func_77973_b() ? true : super.func_82789_a(p_82789_1_, p_82789_2_); ++ ItemStack mat = this.field_150933_b.getRepairItemStack(); ++ if (!mat.func_190926_b() && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; ++ return super.func_82789_a(p_82789_1_, p_82789_2_); + } + + public Multimap func_111205_h(EntityEquipmentSlot p_111205_1_) diff --git a/patches_old/minecraft/net/minecraft/item/ItemTool.java.patch b/patches_old/minecraft/net/minecraft/item/ItemTool.java.patch new file mode 100644 index 000000000..1cc6b23a8 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/ItemTool.java.patch @@ -0,0 +1,73 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemTool.java ++++ ../src-work/minecraft/net/minecraft/item/ItemTool.java +@@ -33,6 +33,18 @@ + this.field_77865_bY = p_i46745_1_ + p_i46745_3_.func_78000_c(); + this.field_185065_c = p_i46745_2_; + this.func_77637_a(CreativeTabs.field_78040_i); ++ if (this instanceof ItemPickaxe) ++ { ++ toolClass = "pickaxe"; ++ } ++ else if (this instanceof ItemAxe) ++ { ++ toolClass = "axe"; ++ } ++ else if (this instanceof ItemSpade) ++ { ++ toolClass = "shovel"; ++ } + } + + protected ItemTool(Item.ToolMaterial p_i46746_1_, Set p_i46746_2_) +@@ -42,6 +54,11 @@ + + public float func_150893_a(ItemStack p_150893_1_, IBlockState p_150893_2_) + { ++ for (String type : getToolClasses(p_150893_1_)) ++ { ++ if (p_150893_2_.func_177230_c().isToolEffective(type, p_150893_2_)) ++ return field_77864_a; ++ } + return this.field_150914_c.contains(p_150893_2_.func_177230_c()) ? this.field_77864_a : 1.0F; + } + +@@ -79,7 +96,9 @@ + + public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) + { +- return this.field_77862_b.func_150995_f() == p_82789_2_.func_77973_b() ? true : super.func_82789_a(p_82789_1_, p_82789_2_); ++ ItemStack mat = this.field_77862_b.getRepairItemStack(); ++ if (!mat.func_190926_b() && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; ++ return super.func_82789_a(p_82789_1_, p_82789_2_); + } + + public Multimap func_111205_h(EntityEquipmentSlot p_111205_1_) +@@ -94,4 +113,28 @@ + + return multimap; + } ++ ++ /*===================================== FORGE START =================================*/ ++ @javax.annotation.Nullable ++ private String toolClass; ++ @Override ++ public int getHarvestLevel(ItemStack stack, String toolClass, @javax.annotation.Nullable net.minecraft.entity.player.EntityPlayer player, @javax.annotation.Nullable IBlockState blockState) ++ { ++ int level = super.getHarvestLevel(stack, toolClass, player, blockState); ++ if (level == -1 && toolClass.equals(this.toolClass)) ++ { ++ return this.field_77862_b.func_77996_d(); ++ } ++ else ++ { ++ return level; ++ } ++ } ++ ++ @Override ++ public Set getToolClasses(ItemStack stack) ++ { ++ return toolClass != null ? com.google.common.collect.ImmutableSet.of(toolClass) : super.getToolClasses(stack); ++ } ++ /*===================================== FORGE END =================================*/ + } diff --git a/patches_old/minecraft/net/minecraft/item/crafting/Ingredient.java.patch b/patches_old/minecraft/net/minecraft/item/crafting/Ingredient.java.patch new file mode 100644 index 000000000..b413d7c34 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/item/crafting/Ingredient.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/item/crafting/Ingredient.java ++++ ../src-work/minecraft/net/minecraft/item/crafting/Ingredient.java +@@ -108,4 +142,22 @@ + + return field_193370_a; + } ++ ++ // Merges several vanilla Ingredients together. As a qwerk of how the json is structured, we can't tell if its a single Ingredient type or multiple so we split per item and remerge here. ++ //Only public for internal use, so we can access a private field in here. ++ public static Ingredient merge(java.util.Collection parts) ++ { ++ net.minecraft.util.NonNullList lst = net.minecraft.util.NonNullList.func_191196_a(); ++ for (Ingredient part : parts) ++ { ++ for (ItemStack stack : part.field_193371_b) ++ lst.add(stack); ++ } ++ return new Ingredient(lst.toArray(new ItemStack[lst.size()])); ++ } ++ + } diff --git a/patches_old/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch b/patches_old/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch new file mode 100644 index 000000000..32f6bffe3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch @@ -0,0 +1,53 @@ +--- ../src-base/minecraft/net/minecraft/nbt/CompressedStreamTools.java ++++ ../src-work/minecraft/net/minecraft/nbt/CompressedStreamTools.java +@@ -18,8 +18,6 @@ + import net.minecraft.crash.CrashReport; + import net.minecraft.crash.CrashReportCategory; + import net.minecraft.util.ReportedException; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + + public class CompressedStreamTools + { +@@ -54,7 +52,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public static void func_74793_a(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException + { + File file1 = new File(p_74793_1_.getAbsolutePath() + "_tmp"); +@@ -119,6 +116,7 @@ + private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException + { + byte b0 = p_152455_0_.readByte(); ++ p_152455_2_.func_152450_a(8); // Forge: Count everything! + + if (b0 == 0) + { +@@ -126,7 +124,8 @@ + } + else + { +- p_152455_0_.readUTF(); ++ NBTSizeTracker.readUTF(p_152455_2_, p_152455_0_.readUTF()); //Forge: Count this string. ++ p_152455_2_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(b0); + + try +@@ -144,7 +143,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public static void func_74795_b(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException + { + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(p_74795_1_)); +@@ -160,7 +158,6 @@ + } + + @Nullable +- @SideOnly(Side.CLIENT) + public static NBTTagCompound func_74797_a(File p_74797_0_) throws IOException + { + if (!p_74797_0_.exists()) diff --git a/patches_old/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch b/patches_old/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch new file mode 100644 index 000000000..c7720b745 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch @@ -0,0 +1,37 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTSizeTracker.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTSizeTracker.java +@@ -25,4 +25,34 @@ + throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.field_152453_c + "bytes where max allowed: " + this.field_152452_b); + } + } ++ ++ /* ++ * UTF8 is not a simple encoding system, each character can be either ++ * 1, 2, or 3 bytes. Depending on where it's numerical value falls. ++ * We have to count up each character individually to see the true ++ * length of the data. ++ * ++ * Basic concept is that it uses the MSB of each byte as a 'read more' signal. ++ * So it has to shift each 7-bit segment. ++ * ++ * This will accurately count the correct byte length to encode this string, plus the 2 bytes for it's length prefix. ++ */ ++ public static void readUTF(NBTSizeTracker tracker, String data) ++ { ++ tracker.func_152450_a(16); //Header length ++ if (data == null) ++ return; ++ ++ int len = data.length(); ++ int utflen = 0; ++ ++ for (int i = 0; i < len; i++) ++ { ++ int c = data.charAt(i); ++ if ((c >= 0x0001) && (c <= 0x007F)) utflen += 1; ++ else if (c > 0x07FF) utflen += 3; ++ else utflen += 2; ++ } ++ tracker.func_152450_a(8 * utflen); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch b/patches_old/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch new file mode 100644 index 000000000..07296de5a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagCompound.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagCompound.java +@@ -477,6 +477,7 @@ + + private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException + { ++ p_152447_1_.func_152450_a(8); + return p_152447_0_.readByte(); + } + +@@ -487,6 +488,7 @@ + + static NBTBase func_152449_a(byte p_152449_0_, String p_152449_1_, DataInput p_152449_2_, int p_152449_3_, NBTSizeTracker p_152449_4_) throws IOException + { ++ p_152449_4_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(p_152449_0_); + + try diff --git a/patches_old/minecraft/net/minecraft/nbt/NBTTagList.java.patch b/patches_old/minecraft/net/minecraft/nbt/NBTTagList.java.patch new file mode 100644 index 000000000..0fe0f23dc --- /dev/null +++ b/patches_old/minecraft/net/minecraft/nbt/NBTTagList.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagList.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagList.java +@@ -9,7 +9,7 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +-public class NBTTagList extends NBTBase ++public class NBTTagList extends NBTBase implements java.lang.Iterable + { + private static final Logger field_179239_b = LogManager.getLogger(); + private List field_74747_a = Lists.newArrayList(); +@@ -281,4 +281,5 @@ + { + return this.field_74746_b; + } ++ @Override public java.util.Iterator iterator() {return field_74747_a.iterator();} + } diff --git a/patches_old/minecraft/net/minecraft/nbt/NBTTagString.java.patch b/patches_old/minecraft/net/minecraft/nbt/NBTTagString.java.patch new file mode 100644 index 000000000..3820c8686 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/nbt/NBTTagString.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagString.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagString.java +@@ -29,7 +29,7 @@ + { + p_152446_3_.func_152450_a(288L); + this.field_74751_a = p_152446_1_.readUTF(); +- p_152446_3_.func_152450_a((long)(16 * this.field_74751_a.length())); ++ NBTSizeTracker.readUTF(p_152446_3_, field_74751_a); // Forge: Correctly read String length including header. + } + + public byte func_74732_a() diff --git a/patches_old/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches_old/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch new file mode 100644 index 000000000..877ffe5f5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -0,0 +1,62 @@ +--- ../src-base/minecraft/net/minecraft/network/NetHandlerPlayServer.java ++++ ../src-work/minecraft/net/minecraft/network/NetHandlerPlayServer.java +@@ -671,7 +671,10 @@ + double d2 = this.field_147369_b.field_70161_v - ((double)blockpos.func_177952_p() + 0.5D); + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + +- if (d3 > 36.0D) ++ double dist = field_147369_b.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111126_e() + 1; ++ dist *= dist; ++ ++ if (d3 > dist) + { + return; + } +@@ -729,7 +732,9 @@ + + if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z() - 1 || enumfacing != EnumFacing.UP && blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) + { +- if (this.field_184362_y == null && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < 64.0D && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) ++ double dist = field_147369_b.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111126_e() + 3; ++ dist *= dist; ++ if (this.field_184362_y == null && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < dist && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) + { + this.field_147369_b.field_71134_c.func_187251_a(this.field_147369_b, worldserver, itemstack, enumhand, blockpos, enumfacing, p_184337_1_.func_187026_d(), p_184337_1_.func_187025_e(), p_184337_1_.func_187020_f()); + } +@@ -933,7 +938,9 @@ + } + else + { +- ITextComponent itextcomponent = new TextComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s}); ++ ITextComponent itextcomponent = new TextComponentTranslation("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s)); ++ itextcomponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, itextcomponent); ++ if (itextcomponent == null) return; + this.field_147367_d.func_184103_al().func_148544_a(itextcomponent, false); + } + +@@ -1066,6 +1073,7 @@ + else if (p_147340_1_.func_149565_c() == CPacketUseEntity.Action.INTERACT_AT) + { + EnumHand enumhand1 = p_147340_1_.func_186994_b(); ++ if(net.minecraftforge.common.ForgeHooks.onInteractEntityAt(field_147369_b, entity, p_147340_1_.func_179712_b(), enumhand1) != null) return; + entity.func_184199_a(this.field_147369_b, p_147340_1_.func_179712_b(), enumhand1); + } + else if (p_147340_1_.func_149565_c() == CPacketUseEntity.Action.ATTACK) +@@ -1106,7 +1114,7 @@ + return; + } + +- this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, 0, false); ++ this.field_147369_b = this.field_147367_d.func_184103_al().func_72368_a(this.field_147369_b, field_147369_b.field_71093_bK, false); + + if (this.field_147367_d.func_71199_h()) + { +@@ -1149,7 +1157,7 @@ + { + ItemStack itemstack2 = this.field_147369_b.field_71070_bA.func_184996_a(p_147351_1_.func_149544_d(), p_147351_1_.func_149543_e(), p_147351_1_.func_186993_f(), this.field_147369_b); + +- if (ItemStack.func_77989_b(p_147351_1_.func_149546_g(), itemstack2)) ++ if (ItemStack.areItemStacksEqualUsingNBTShareTag(p_147351_1_.func_149546_g(), itemstack2)) + { + this.field_147369_b.field_71135_a.func_147359_a(new SPacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true)); + this.field_147369_b.field_71137_h = true; diff --git a/patches_old/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch b/patches_old/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch new file mode 100644 index 000000000..412aba17f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/network/NettyPacketEncoder.java ++++ ../src-work/minecraft/net/minecraft/network/NettyPacketEncoder.java +@@ -52,7 +52,7 @@ + } + catch (Throwable throwable) + { +- field_150798_a.error(throwable); ++ throw throwable; // Forge: throw this instead of logging it, to prevent corrupt packets from being sent to the client where they are much harder to debug. + } + } + } diff --git a/patches_old/minecraft/net/minecraft/network/NetworkManager.java.patch b/patches_old/minecraft/net/minecraft/network/NetworkManager.java.patch new file mode 100644 index 000000000..7145a3147 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/NetworkManager.java.patch @@ -0,0 +1,61 @@ +--- ../src-base/minecraft/net/minecraft/network/NetworkManager.java ++++ ../src-work/minecraft/net/minecraft/network/NetworkManager.java +@@ -88,6 +88,11 @@ + this.field_179294_g = p_i46004_1_; + } + ++ public EnumPacketDirection getDirection() ++ { ++ return this.field_179294_g; ++ } ++ + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception + { + super.channelActive(p_channelActive_1_); +@@ -204,7 +209,7 @@ + final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(p_150732_1_); + final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.field_150746_k.attr(field_150739_c).get(); + +- if (enumconnectionstate1 != enumconnectionstate) ++ if (enumconnectionstate1 != enumconnectionstate && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) + { + field_150735_g.debug("Disabled auto read"); + this.field_150746_k.config().setAutoRead(false); +@@ -212,7 +217,7 @@ + + if (this.field_150746_k.eventLoop().inEventLoop()) + { +- if (enumconnectionstate != enumconnectionstate1) ++ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) + { + this.func_150723_a(enumconnectionstate); + } +@@ -232,7 +237,7 @@ + { + public void run() + { +- if (enumconnectionstate != enumconnectionstate1) ++ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) + { + NetworkManager.this.func_150723_a(enumconnectionstate); + } +@@ -308,6 +313,7 @@ + @SideOnly(Side.CLIENT) + public static NetworkManager func_181124_a(InetAddress p_181124_0_, int p_181124_1_, boolean p_181124_2_) + { ++ if (p_181124_0_ instanceof java.net.Inet6Address) System.setProperty("java.net.preferIPv4Stack", "false"); + final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND); + Class oclass; + LazyLoadBase lazyloadbase; +@@ -454,6 +460,11 @@ + } + } + ++ public Channel channel() ++ { ++ return field_150746_k; ++ } ++ + static class InboundHandlerTuplePacketListener + { + private final Packet field_150774_a; diff --git a/patches_old/minecraft/net/minecraft/network/NetworkSystem.java.patch b/patches_old/minecraft/net/minecraft/network/NetworkSystem.java.patch new file mode 100644 index 000000000..e4bb5bf6e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/NetworkSystem.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/network/NetworkSystem.java ++++ ../src-work/minecraft/net/minecraft/network/NetworkSystem.java +@@ -49,21 +49,21 @@ + { + protected NioEventLoopGroup func_179280_b() + { +- return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Server IO #%d").setDaemon(true).build()); ++ return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Server IO #%d").setDaemon(true).setThreadFactory(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER).build()); + } + }; + public static final LazyLoadBase field_181141_b = new LazyLoadBase() + { + protected EpollEventLoopGroup func_179280_b() + { +- return new EpollEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Epoll Server IO #%d").setDaemon(true).build()); ++ return new EpollEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Epoll Server IO #%d").setDaemon(true).setThreadFactory(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER).build()); + } + }; + public static final LazyLoadBase field_180232_b = new LazyLoadBase() + { + protected LocalEventLoopGroup func_179280_b() + { +- return new LocalEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Server IO #%d").setDaemon(true).build()); ++ return new LocalEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Server IO #%d").setDaemon(true).setThreadFactory(net.minecraftforge.fml.common.thread.SidedThreadGroups.CLIENT).build()); + } + }; + private final MinecraftServer field_151273_d; +@@ -79,6 +79,7 @@ + + public void func_151265_a(InetAddress p_151265_1_, int p_151265_2_) throws IOException + { ++ if (p_151265_1_ instanceof java.net.Inet6Address) System.setProperty("java.net.preferIPv4Stack", "false"); + synchronized (this.field_151274_e) + { + Class oclass; +@@ -110,7 +111,7 @@ + ; + } + +- p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(NetworkSystem.this)).addLast("splitter", new NettyVarint21FrameDecoder()).addLast("decoder", new NettyPacketDecoder(EnumPacketDirection.SERVERBOUND)).addLast("prepender", new NettyVarint21FrameEncoder()).addLast("encoder", new NettyPacketEncoder(EnumPacketDirection.CLIENTBOUND)); ++ p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.READ_TIMEOUT)).addLast("legacy_query", new LegacyPingHandler(NetworkSystem.this)).addLast("splitter", new NettyVarint21FrameDecoder()).addLast("decoder", new NettyPacketDecoder(EnumPacketDirection.SERVERBOUND)).addLast("prepender", new NettyVarint21FrameEncoder()).addLast("encoder", new NettyPacketEncoder(EnumPacketDirection.CLIENTBOUND)); + NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); + NetworkSystem.this.field_151272_f.add(networkmanager); + p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); diff --git a/patches_old/minecraft/net/minecraft/network/PacketBuffer.java.patch b/patches_old/minecraft/net/minecraft/network/PacketBuffer.java.patch new file mode 100644 index 000000000..f2f417666 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/PacketBuffer.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/network/PacketBuffer.java ++++ ../src-work/minecraft/net/minecraft/network/PacketBuffer.java +@@ -336,7 +336,7 @@ + + if (p_150788_1_.func_77973_b().func_77645_m() || p_150788_1_.func_77973_b().func_77651_p()) + { +- nbttagcompound = p_150788_1_.func_77978_p(); ++ nbttagcompound = p_150788_1_.func_77973_b().getNBTShareTag(p_150788_1_); + } + + this.func_150786_a(nbttagcompound); +@@ -358,7 +358,7 @@ + int j = this.readByte(); + int k = this.readShort(); + ItemStack itemstack = new ItemStack(Item.func_150899_d(i), j, k); +- itemstack.func_77982_d(this.func_150793_b()); ++ itemstack.func_77973_b().readNBTShareTag(itemstack, this.func_150793_b()); + return itemstack; + } + } diff --git a/patches_old/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch b/patches_old/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch new file mode 100644 index 000000000..f04560812 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch @@ -0,0 +1,48 @@ +--- ../src-base/minecraft/net/minecraft/network/handshake/client/C00Handshake.java ++++ ../src-work/minecraft/net/minecraft/network/handshake/client/C00Handshake.java +@@ -14,6 +14,7 @@ + private String field_149598_b; + private int field_149599_c; + private EnumConnectionState field_149597_d; ++ private boolean hasFMLMarker = false; + + public C00Handshake() + { +@@ -28,18 +29,26 @@ + this.field_149597_d = p_i47613_3_; + } + ++ public C00Handshake(String address, int port, EnumConnectionState state, boolean addFMLMarker) ++ { ++ this(address, port, state); ++ this.hasFMLMarker = addFMLMarker; ++ } ++ + public void func_148837_a(PacketBuffer p_148837_1_) throws IOException + { + this.field_149600_a = p_148837_1_.func_150792_a(); + this.field_149598_b = p_148837_1_.func_150789_c(255); + this.field_149599_c = p_148837_1_.readUnsignedShort(); + this.field_149597_d = EnumConnectionState.func_150760_a(p_148837_1_.func_150792_a()); ++ this.hasFMLMarker = this.field_149598_b.contains("\0FML\0"); ++ this.field_149598_b = this.field_149598_b.split("\0")[0]; + } + + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException + { + p_148840_1_.func_150787_b(this.field_149600_a); +- p_148840_1_.func_180714_a(this.field_149598_b); ++ p_148840_1_.func_180714_a(this.field_149598_b + "\0FML\0"); + p_148840_1_.writeShort(this.field_149599_c); + p_148840_1_.func_150787_b(this.field_149597_d.func_150759_c()); + } +@@ -58,4 +67,9 @@ + { + return this.field_149600_a; + } ++ ++ public boolean hasFMLMarker() ++ { ++ return this.hasFMLMarker; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch b/patches_old/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch new file mode 100644 index 000000000..c5361662d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java ++++ ../src-work/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java +@@ -26,7 +26,7 @@ + { + String s = p_148837_1_.func_150789_c(36); + String s1 = p_148837_1_.func_150789_c(16); +- UUID uuid = UUID.fromString(s); ++ UUID uuid = s.length() > 0 ? UUID.fromString(s) : null; + this.field_149602_a = new GameProfile(uuid, s1); + } + diff --git a/patches_old/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch b/patches_old/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch new file mode 100644 index 000000000..b6843bb7f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java ++++ ../src-work/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java +@@ -55,7 +55,7 @@ + p_148840_1_.writeByte(this.field_149553_c); + p_148840_1_.writeShort(this.field_149550_d); + p_148840_1_.func_179249_a(this.field_149549_f); +- p_148840_1_.func_150788_a(this.field_149551_e); ++ net.minecraftforge.common.util.PacketUtil.writeItemStackFromClientToServer(p_148840_1_, this.field_149551_e); + } + + public int func_149548_c() diff --git a/patches_old/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch b/patches_old/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch new file mode 100644 index 000000000..390c68264 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java ++++ ../src-work/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java +@@ -38,7 +38,7 @@ + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException + { + p_148840_1_.writeShort(this.field_149629_a); +- p_148840_1_.func_150788_a(this.field_149628_b); ++ net.minecraftforge.common.util.PacketUtil.writeItemStackFromClientToServer(p_148840_1_, this.field_149628_b); + } + + public int func_149627_c() diff --git a/patches_old/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch b/patches_old/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch new file mode 100644 index 000000000..b0ba90495 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch @@ -0,0 +1,14 @@ +--- ../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 func_148840_b(PacketBuffer p_148840_1_) throws IOException + { + p_148840_1_.func_180714_a(this.field_149562_a); ++ synchronized(this.field_149561_c) { //This may be access multiple times, from multiple threads, lets be safe. ++ this.field_149561_c.markReaderIndex(); + p_148840_1_.writeBytes((ByteBuf)this.field_149561_c); ++ this.field_149561_c.resetReaderIndex(); ++ } + } + + public void func_148833_a(INetHandlerPlayServer p_148833_1_) diff --git a/patches_old/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch b/patches_old/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch new file mode 100644 index 000000000..bd9426ff2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java +@@ -46,12 +46,18 @@ + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException + { + p_148840_1_.func_180714_a(this.field_149172_a); ++ synchronized(this.field_149171_b) { //This may be access multiple times, from multiple threads, lets be safe. ++ this.field_149171_b.markReaderIndex(); + p_148840_1_.writeBytes((ByteBuf)this.field_149171_b); ++ this.field_149171_b.resetReaderIndex(); ++ } + } + + public void func_148833_a(INetHandlerPlayClient p_148833_1_) + { + p_148833_1_.func_147240_a(this); ++ // Forge: fix network buffer leaks (MC-121884) ++ if (this.field_149171_b != null) this.field_149171_b.release(); + } + + @SideOnly(Side.CLIENT) diff --git a/patches_old/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch b/patches_old/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch new file mode 100644 index 000000000..66d894c69 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java +@@ -38,7 +38,7 @@ + { + this.field_149042_a = p_i46973_1_.func_145782_y(); + this.field_186894_b = p_i46973_1_.func_110124_au(); +- this.field_149040_b = EntityList.field_191308_b.func_148757_b(p_i46973_1_.getClass()); ++ this.field_149040_b = EntityList.getID(p_i46973_1_.getClass()); + this.field_149041_c = p_i46973_1_.field_70165_t; + this.field_149038_d = p_i46973_1_.field_70163_u; + this.field_149039_e = p_i46973_1_.field_70161_v; diff --git a/patches_old/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch b/patches_old/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch new file mode 100644 index 000000000..30c0973ec --- /dev/null +++ b/patches_old/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java ++++ ../src-work/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java +@@ -427,6 +427,7 @@ + { + p_193578_5_ = PathNodeType.DANGER_FIRE; + } ++ else if(block.isBurning(p_193578_1_,blockpos$pooledmutableblockpos)) p_193578_5_ = PathNodeType.DAMAGE_FIRE; + } + } + } +@@ -443,6 +444,9 @@ + Block block = iblockstate.func_177230_c(); + Material material = iblockstate.func_185904_a(); + ++ PathNodeType type = block.getAiPathNodeType(iblockstate, p_189553_1_, blockpos); ++ if (type != null) return type; ++ + if (material == Material.field_151579_a) + { + return PathNodeType.OPEN; diff --git a/patches_old/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches_old/minecraft/net/minecraft/potion/PotionEffect.java.patch new file mode 100644 index 000000000..346bced07 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -0,0 +1,138 @@ +--- ../src-base/minecraft/net/minecraft/potion/PotionEffect.java ++++ ../src-work/minecraft/net/minecraft/potion/PotionEffect.java +@@ -19,6 +19,8 @@ + @SideOnly(Side.CLIENT) + private boolean field_100013_f; + private boolean field_188421_h; ++ /** List of ItemStack that can cure the potion effect **/ ++ private java.util.List curativeItems; + + public PotionEffect(Potion p_i46811_1_) + { +@@ -51,6 +53,7 @@ + this.field_76461_c = p_i1577_1_.field_76461_c; + this.field_82724_e = p_i1577_1_.field_82724_e; + this.field_188421_h = p_i1577_1_.field_188421_h; ++ this.curativeItems = p_i1577_1_.curativeItems == null ? null : new java.util.ArrayList(p_i1577_1_.curativeItems); + } + + public void func_76452_a(PotionEffect p_76452_1_) +@@ -195,12 +198,13 @@ + p_82719_1_.func_74768_a("Duration", this.func_76459_b()); + p_82719_1_.func_74757_a("Ambient", this.func_82720_e()); + p_82719_1_.func_74757_a("ShowParticles", this.func_188418_e()); ++ writeCurativeItems(p_82719_1_); + return p_82719_1_; + } + + public static PotionEffect func_82722_b(NBTTagCompound p_82722_0_) + { +- int i = p_82722_0_.func_74771_c("Id"); ++ int i = p_82722_0_.func_74771_c("Id") & 0xFF; + Potion potion = Potion.func_188412_a(i); + + if (potion == null) +@@ -219,7 +223,7 @@ + flag1 = p_82722_0_.func_74767_n("ShowParticles"); + } + +- return new PotionEffect(potion, k, j < 0 ? 0 : j, flag, flag1); ++ return readCurativeItems(new PotionEffect(potion, k, j < 0 ? 0 : j, flag, flag1), p_82722_0_); + } + } + +@@ -232,7 +236,7 @@ + public int compareTo(PotionEffect p_compareTo_1_) + { + int i = 32147; +- return (this.func_76459_b() <= 32147 || p_compareTo_1_.func_76459_b() <= 32147) && (!this.func_82720_e() || !p_compareTo_1_.func_82720_e()) ? ComparisonChain.start().compare(Boolean.valueOf(this.func_82720_e()), Boolean.valueOf(p_compareTo_1_.func_82720_e())).compare(this.func_76459_b(), p_compareTo_1_.func_76459_b()).compare(this.func_188419_a().func_76401_j(), p_compareTo_1_.func_188419_a().func_76401_j()).result() : ComparisonChain.start().compare(Boolean.valueOf(this.func_82720_e()), Boolean.valueOf(p_compareTo_1_.func_82720_e())).compare(this.func_188419_a().func_76401_j(), p_compareTo_1_.func_188419_a().func_76401_j()).result(); ++ return (this.func_76459_b() <= 32147 || p_compareTo_1_.func_76459_b() <= 32147) && (!this.func_82720_e() || !p_compareTo_1_.func_82720_e()) ? ComparisonChain.start().compare(Boolean.valueOf(this.func_82720_e()), Boolean.valueOf(p_compareTo_1_.func_82720_e())).compare(this.func_76459_b(), p_compareTo_1_.func_76459_b()).compare(this.func_188419_a().getGuiSortColor(this), p_compareTo_1_.func_188419_a().getGuiSortColor(p_compareTo_1_)).result() : ComparisonChain.start().compare(Boolean.valueOf(this.func_82720_e()), Boolean.valueOf(p_compareTo_1_.func_82720_e())).compare(this.func_188419_a().getGuiSortColor(this), p_compareTo_1_.func_188419_a().getGuiSortColor(p_compareTo_1_)).result(); + } + + @SideOnly(Side.CLIENT) +@@ -240,4 +244,85 @@ + { + return this.field_100013_f; + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ /*** ++ * Returns a list of curative items for the potion effect ++ * By default, this list is initialized using {@link Potion#getCurativeItems} ++ * ++ * @return The list (ItemStack) of curative items for the potion effect ++ */ ++ public java.util.List getCurativeItems() ++ { ++ if (this.curativeItems == null) //Lazy load this so that we don't create a circular dep on Items. ++ { ++ this.curativeItems = func_188419_a().getCurativeItems(); ++ } ++ return this.curativeItems; ++ } ++ ++ /*** ++ * Checks the given ItemStack to see if it is in the list of curative items for the potion effect ++ * @param stack The ItemStack being checked against the list of curative items for this PotionEffect ++ * @return true if the given ItemStack is in the list of curative items for this PotionEffect, false otherwise ++ */ ++ public boolean isCurativeItem(net.minecraft.item.ItemStack stack) ++ { ++ for (net.minecraft.item.ItemStack curativeItem : this.getCurativeItems()) ++ { ++ if (curativeItem.func_77969_a(stack)) ++ { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ /*** ++ * Sets the list of curative items for this potion effect, overwriting any already present ++ * @param curativeItems The list of ItemStacks being set to the potion effect ++ */ ++ public void setCurativeItems(java.util.List curativeItems) ++ { ++ this.curativeItems = curativeItems; ++ } ++ ++ /*** ++ * Adds the given stack to the list of curative items for this PotionEffect ++ * @param stack The ItemStack being added to the curative item list ++ */ ++ public void addCurativeItem(net.minecraft.item.ItemStack stack) ++ { ++ if (!this.isCurativeItem(stack)) ++ { ++ this.getCurativeItems().add(stack); ++ } ++ } ++ ++ private void writeCurativeItems(NBTTagCompound nbt) ++ { ++ net.minecraft.nbt.NBTTagList list = new net.minecraft.nbt.NBTTagList(); ++ for (net.minecraft.item.ItemStack stack : getCurativeItems()) ++ { ++ list.func_74742_a(stack.func_77955_b(new NBTTagCompound())); ++ } ++ nbt.func_74782_a("CurativeItems", list); ++ } ++ ++ private static PotionEffect readCurativeItems(PotionEffect effect, NBTTagCompound nbt) ++ { ++ if (nbt.func_150297_b("CurativeItems", net.minecraftforge.common.util.Constants.NBT.TAG_LIST)) ++ { ++ java.util.List items = new java.util.ArrayList(); ++ net.minecraft.nbt.NBTTagList list = nbt.func_150295_c("CurativeItems", net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND); ++ for (int i = 0; i < list.func_74745_c(); i++) ++ { ++ items.add(new net.minecraft.item.ItemStack(list.func_150305_b(i))); ++ } ++ effect.setCurativeItems(items); ++ } ++ ++ return effect; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/potion/PotionType.java.patch b/patches_old/minecraft/net/minecraft/potion/PotionType.java.patch new file mode 100644 index 000000000..0af4665e3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/potion/PotionType.java.patch @@ -0,0 +1,16 @@ +--- ../src-base/minecraft/net/minecraft/potion/PotionType.java ++++ ../src-work/minecraft/net/minecraft/potion/PotionType.java +@@ -8,10 +8,11 @@ + import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey; + +-public class PotionType ++public class PotionType extends net.minecraftforge.registries.IForgeRegistryEntry.Impl + { ++ @Deprecated // unused + private static final ResourceLocation field_185177_b = new ResourceLocation("empty"); +- public static final RegistryNamespacedDefaultedByKey field_185176_a = new RegistryNamespacedDefaultedByKey(field_185177_b); ++ public static final RegistryNamespacedDefaultedByKey field_185176_a = net.minecraftforge.registries.GameData.getWrapperDefaulted(PotionType.class); + private static int field_185178_c; + private final String field_185179_d; + private final ImmutableList field_185180_e; diff --git a/patches_old/minecraft/net/minecraft/profiler/Profiler.java.patch b/patches_old/minecraft/net/minecraft/profiler/Profiler.java.patch new file mode 100644 index 000000000..27b3ec6b0 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/profiler/Profiler.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/profiler/Profiler.java ++++ ../src-work/minecraft/net/minecraft/profiler/Profiler.java +@@ -193,4 +193,16 @@ + return (this.field_76331_c.hashCode() & 11184810) + 4473924; + } + } ++ ++ /** ++ * Forge: Fix for MC-117087, World.updateEntities is wasting time calling Class.getSimpleName() when the profiler is not active ++ */ ++ @Deprecated // TODO: remove (1.13) ++ public void startSection(Class profiledClass) ++ { ++ if (this.field_76327_a) ++ { ++ func_76320_a(profiledClass.getSimpleName()); ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/realms/RealmsConnect.java.patch b/patches_old/minecraft/net/minecraft/realms/RealmsConnect.java.patch new file mode 100644 index 000000000..df0223048 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/realms/RealmsConnect.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/realms/RealmsConnect.java ++++ ../src-work/minecraft/net/minecraft/realms/RealmsConnect.java +@@ -38,6 +38,7 @@ + + try + { ++ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToRealmsServer(p_connect_1_, p_connect_2_); + inetaddress = InetAddress.getByName(p_connect_1_); + + if (RealmsConnect.this.aborted) +@@ -59,7 +60,7 @@ + return; + } + +- RealmsConnect.this.connection.func_179290_a(new C00Handshake(p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); ++ RealmsConnect.this.connection.func_179290_a(new C00Handshake(p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN, true)); + + if (RealmsConnect.this.aborted) + { diff --git a/patches_old/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches_old/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch new file mode 100644 index 000000000..3da2d686a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -0,0 +1,78 @@ +--- ../src-base/minecraft/net/minecraft/server/dedicated/DedicatedServer.java ++++ ../src-work/minecraft/net/minecraft/server/dedicated/DedicatedServer.java +@@ -62,6 +62,7 @@ + private boolean field_71338_p; + private GameType field_71337_q; + private boolean field_71335_s; ++ public static boolean allowPlayerLogins = false; + + 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_) + { +@@ -95,6 +96,7 @@ + { + public void run() + { ++ if (net.minecraftforge.server.console.TerminalHandler.handleCommands(DedicatedServer.this)) return; + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); + String s4; + +@@ -120,6 +122,8 @@ + field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); + } + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onServerStart(this); ++ + field_155771_h.info("Loading properties"); + this.field_71340_o = new PropertyManager(new File("server.properties")); + this.field_154332_n = new ServerEula(new File("eula.txt")); +@@ -212,6 +216,7 @@ + } + else + { ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onServerStarted(); + this.func_184105_a(new DedicatedPlayerList(this)); + long j = System.nanoTime(); + +@@ -260,11 +265,13 @@ + TileEntitySkull.func_184293_a(this.func_152358_ax()); + TileEntitySkull.func_184294_a(this.func_147130_as()); + PlayerProfileCache.func_187320_a(this.func_71266_T()); ++ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerAboutToStart(this)) return false; + field_155771_h.info("Preparing level \"{}\"", (Object)this.func_71270_I()); + this.func_71247_a(this.func_71270_I(), this.func_71270_I(), k, worldtype, s2); + long i1 = System.nanoTime() - j; + String s3 = String.format("%.3fs", (double)i1 / 1.0E9D); + field_155771_h.info("Done ({})! For help, type \"help\" or \"?\"", (Object)s3); ++ this.field_175591_ab = func_130071_aq(); + + if (this.field_71340_o.func_187239_a("announce-player-achievements")) + { +@@ -296,7 +303,8 @@ + } + + Items.field_190931_a.func_150895_a(CreativeTabs.field_78027_g, NonNullList.func_191196_a()); +- return true; ++ // <3 you Grum for this, saves us ~30 patch files! --^ ++ return net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarting(this); + } + } + } +@@ -515,7 +523,7 @@ + + public boolean func_175579_a(World p_175579_1_, BlockPos p_175579_2_, EntityPlayer p_175579_3_) + { +- if (p_175579_1_.field_73011_w.func_186058_p().func_186068_a() != 0) ++ if (p_175579_1_.field_73011_w.getDimension() != 0) + { + return false; + } +@@ -584,6 +592,9 @@ + return this.field_71340_o.func_73669_a("network-compression-threshold", super.func_175577_aI()); + } + ++ //Forge: Enable formated text for colors in console. ++ @Override public void func_145747_a(net.minecraft.util.text.ITextComponent message) { field_155771_h.info(message.func_150254_d()); } ++ + protected boolean func_152368_aE() throws IOException + { + boolean flag = false; diff --git a/patches_old/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch b/patches_old/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch new file mode 100644 index 000000000..8317ea164 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java ++++ ../src-work/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java +@@ -44,7 +44,7 @@ + ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean(); + ThreadInfo[] athreadinfo = threadmxbean.dumpAllThreads(true, true); + StringBuilder stringbuilder = new StringBuilder(); +- Error error = new Error(); ++ Error error = new Error(String.format("ServerHangWatchdog detected that a single server tick took %.2f seconds (should be max 0.05)", k / 1000F)); // Forge: don't just make a crash report with a seemingly-inexplicable Error + + for (ThreadInfo threadinfo : athreadinfo) + { diff --git a/patches_old/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch b/patches_old/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch new file mode 100644 index 000000000..8b9416cb1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/server/gui/MinecraftServerGui.java ++++ ../src-work/minecraft/net/minecraft/server/gui/MinecraftServerGui.java +@@ -77,6 +77,7 @@ + System.exit(0); + } + }); ++ minecraftservergui.latch.countDown(); + } + + public MinecraftServerGui(DedicatedServer p_i2362_1_) +@@ -161,8 +162,13 @@ + return jpanel; + } + ++ private java.util.concurrent.CountDownLatch latch = new java.util.concurrent.CountDownLatch(1); + public void func_164247_a(final JTextArea p_164247_1_, final JScrollPane p_164247_2_, final String p_164247_3_) + { ++ try ++ { ++ latch.await(); ++ } catch (InterruptedException e){} //Prevent logging until after constructor has ended. + if (!SwingUtilities.isEventDispatchThread()) + { + SwingUtilities.invokeLater(new Runnable() diff --git a/patches_old/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch b/patches_old/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch new file mode 100644 index 000000000..78684574e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch @@ -0,0 +1,162 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java +@@ -32,12 +32,21 @@ + private int field_187288_h; + private long field_187289_i; + private boolean field_187290_j; ++ private Runnable loadedRunnable = new Runnable() ++ { ++ public void run() ++ { ++ PlayerChunkMapEntry.this.field_187286_f = PlayerChunkMapEntry.this.field_187282_b.func_72688_a().func_72863_F().func_186028_c(PlayerChunkMapEntry.this.field_187284_d.field_77276_a, PlayerChunkMapEntry.this.field_187284_d.field_77275_b); ++ PlayerChunkMapEntry.this.loading = false; ++ } ++ }; ++ private boolean loading = true; + + public PlayerChunkMapEntry(PlayerChunkMap p_i1518_1_, int p_i1518_2_, int p_i1518_3_) + { + this.field_187282_b = p_i1518_1_; + this.field_187284_d = new ChunkPos(p_i1518_2_, p_i1518_3_); +- this.field_187286_f = p_i1518_1_.func_72688_a().func_72863_F().func_186028_c(p_i1518_2_, p_i1518_3_); ++ p_i1518_1_.func_72688_a().func_72863_F().loadChunk(p_i1518_2_, p_i1518_3_, this.loadedRunnable); + } + + public ChunkPos func_187264_a() +@@ -63,6 +72,8 @@ + if (this.field_187290_j) + { + this.func_187278_c(p_187276_1_); ++ // chunk watch event - the chunk is ready ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(this.field_187286_f, p_187276_1_)); + } + } + } +@@ -71,6 +82,20 @@ + { + if (this.field_187283_c.contains(p_187277_1_)) + { ++ // If we haven't loaded yet don't load the chunk just so we can clean it up ++ if (this.field_187286_f == null) ++ { ++ this.field_187283_c.remove(p_187277_1_); ++ ++ if (this.field_187283_c.isEmpty()) ++ { ++ if (this.loading) net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(this.field_187282_b.func_72688_a(), this.field_187284_d.field_77276_a, this.field_187284_d.field_77275_b, this.loadedRunnable); ++ this.field_187282_b.func_187305_b(this); ++ } ++ ++ return; ++ } ++ + if (this.field_187290_j) + { + p_187277_1_.field_71135_a.func_147359_a(new SPacketUnloadChunk(this.field_187284_d.field_77276_a, this.field_187284_d.field_77275_b)); +@@ -78,6 +103,8 @@ + + this.field_187283_c.remove(p_187277_1_); + ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(this.field_187286_f, p_187277_1_)); ++ + if (this.field_187283_c.isEmpty()) + { + this.field_187282_b.func_187305_b(this); +@@ -87,6 +114,7 @@ + + public boolean func_187268_a(boolean p_187268_1_) + { ++ if (this.loading) return false; + if (this.field_187286_f != null) + { + return true; +@@ -125,12 +153,15 @@ + this.field_187287_g = 0; + this.field_187288_h = 0; + this.field_187290_j = true; ++ if (this.field_187283_c.isEmpty()) return true; // Forge: fix MC-120780 + Packet packet = new SPacketChunkData(this.field_187286_f, 65535); + + for (EntityPlayerMP entityplayermp : this.field_187283_c) + { + entityplayermp.field_71135_a.func_147359_a(packet); + this.field_187282_b.func_72688_a().func_73039_n().func_85172_a(entityplayermp, this.field_187286_f); ++ // chunk watch event - delayed to here as the chunk wasn't ready in addPlayer ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(this.field_187286_f, entityplayermp)); + } + + return true; +@@ -169,7 +200,7 @@ + + this.field_187288_h |= 1 << (p_187265_2_ >> 4); + +- if (this.field_187287_g < 64) ++ //Forge; Cache everything, so always run + { + short short1 = (short)(p_187265_1_ << 12 | p_187265_3_ << 8 | p_187265_2_); + +@@ -180,7 +211,8 @@ + return; + } + } +- ++ if (this.field_187287_g == this.field_187285_e.length) ++ this.field_187285_e = java.util.Arrays.copyOf(this.field_187285_e, this.field_187285_e.length << 1); + this.field_187285_e[this.field_187287_g++] = short1; + } + } +@@ -197,6 +229,7 @@ + } + } + ++ @SuppressWarnings("unused") + public void func_187280_d() + { + if (this.field_187290_j && this.field_187286_f != null) +@@ -210,28 +243,32 @@ + int k = (this.field_187285_e[0] >> 8 & 15) + this.field_187284_d.field_77275_b * 16; + BlockPos blockpos = new BlockPos(i, j, k); + this.func_187267_a(new SPacketBlockChange(this.field_187282_b.func_72688_a(), blockpos)); ++ net.minecraft.block.state.IBlockState state = this.field_187282_b.func_72688_a().func_180495_p(blockpos); + +- if (this.field_187282_b.func_72688_a().func_180495_p(blockpos).func_177230_c().func_149716_u()) ++ if (state.func_177230_c().hasTileEntity(state)) + { + this.func_187273_a(this.field_187282_b.func_72688_a().func_175625_s(blockpos)); + } + } +- else if (this.field_187287_g == 64) ++ else if (this.field_187287_g >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) + { + this.func_187267_a(new SPacketChunkData(this.field_187286_f, this.field_187288_h)); ++ //TODO: FDix Mojang's fuckup to modded by combining all TE data into the chunk data packet... seriously... packet size explosion! + } + else + { + this.func_187267_a(new SPacketMultiBlockChange(this.field_187287_g, this.field_187285_e, this.field_187286_f)); +- ++ //} Keep this in the else until we figure out a fix for mojang's derpitude on the data packet so we don't double send crap. ++ //{// Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small + for (int l = 0; l < this.field_187287_g; ++l) + { + int i1 = (this.field_187285_e[l] >> 12 & 15) + this.field_187284_d.field_77276_a * 16; + int j1 = this.field_187285_e[l] & 255; + int k1 = (this.field_187285_e[l] >> 8 & 15) + this.field_187284_d.field_77275_b * 16; + BlockPos blockpos1 = new BlockPos(i1, j1, k1); ++ net.minecraft.block.state.IBlockState state = this.field_187282_b.func_72688_a().func_180495_p(blockpos1); + +- if (this.field_187282_b.func_72688_a().func_180495_p(blockpos1).func_177230_c().func_149716_u()) ++ if (state.func_177230_c().hasTileEntity(state)) + { + this.func_187273_a(this.field_187282_b.func_72688_a().func_175625_s(blockpos1)); + } +@@ -311,4 +348,9 @@ + + return d0; + } ++ ++ public List getWatchingPlayers() ++ { ++ return func_187274_e() ? java.util.Collections.unmodifiableList(field_187283_c) : java.util.Collections.emptyList(); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch b/patches_old/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch new file mode 100644 index 000000000..c14361b2c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch @@ -0,0 +1,286 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerInteractionManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerInteractionManager.java +@@ -88,7 +88,7 @@ + int i = this.field_73100_i - this.field_73093_n; + IBlockState iblockstate = this.field_73092_a.func_180495_p(this.field_180241_i); + +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, field_180241_i)) + { + this.field_73097_j = false; + } +@@ -114,7 +114,7 @@ + { + IBlockState iblockstate1 = this.field_73092_a.func_180495_p(this.field_180240_f); + +- if (iblockstate1.func_185904_a() == Material.field_151579_a) ++ if (iblockstate1.func_177230_c().isAir(iblockstate1, field_73092_a, field_180240_f)) + { + this.field_73092_a.func_175715_c(this.field_73090_b.func_145782_y(), this.field_180240_f, -1); + this.field_73094_o = -1; +@@ -123,7 +123,7 @@ + else + { + int k = this.field_73100_i - this.field_73089_e; +- float f1 = iblockstate1.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, this.field_180241_i) * (float)(k + 1); ++ float f1 = iblockstate1.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, this.field_180240_f) * (float)(k + 1); // Forge: Fix network break progress using wrong position + int l = (int)(f1 * 10.0F); + + if (l != this.field_73094_o) +@@ -137,6 +137,16 @@ + + public void func_180784_a(BlockPos p_180784_1_, EnumFacing p_180784_2_) + { ++ double reachDist = field_73090_b.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111126_e(); ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.LeftClickBlock event = net.minecraftforge.common.ForgeHooks.onLeftClickBlock(field_73090_b, p_180784_1_, p_180784_2_, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(field_73090_b, reachDist + 1)); ++ if (event.isCanceled()) ++ { ++ // Restore block and te data ++ field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(field_73092_a, p_180784_1_)); ++ field_73092_a.func_184138_a(p_180784_1_, field_73092_a.func_180495_p(p_180784_1_), field_73092_a.func_180495_p(p_180784_1_), 3); ++ return; ++ } ++ + if (this.func_73083_d()) + { + if (!this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_)) +@@ -172,17 +182,36 @@ + } + } + +- this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); + this.field_73089_e = this.field_73100_i; + float f = 1.0F; + +- if (iblockstate.func_185904_a() != Material.field_151579_a) ++ if (!iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, p_180784_1_)) + { +- block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); ++ if (event.getUseBlock() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); ++ this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); ++ } ++ else ++ { ++ // Restore block and te data ++ field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(field_73092_a, p_180784_1_)); ++ field_73092_a.func_184138_a(p_180784_1_, field_73092_a.func_180495_p(p_180784_1_), field_73092_a.func_180495_p(p_180784_1_), 3); ++ } + f = iblockstate.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180784_1_); + } ++ if (event.getUseItem() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ if (f >= 1.0F) ++ { ++ // Restore block and te data ++ field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(field_73092_a, p_180784_1_)); ++ field_73092_a.func_184138_a(p_180784_1_, field_73092_a.func_180495_p(p_180784_1_), field_73092_a.func_180495_p(p_180784_1_), 3); ++ } ++ return; ++ } + +- if (iblockstate.func_185904_a() != Material.field_151579_a && f >= 1.0F) ++ if (!iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, p_180784_1_) && f >= 1.0F) + { + this.func_180237_b(p_180784_1_); + } +@@ -204,7 +233,7 @@ + int i = this.field_73100_i - this.field_73089_e; + IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180785_1_); + +- if (iblockstate.func_185904_a() != Material.field_151579_a) ++ if (!iblockstate.func_177230_c().isAir(iblockstate, field_73092_a, p_180785_1_)) + { + float f = iblockstate.func_185903_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180785_1_) * (float)(i + 1); + +@@ -233,13 +262,17 @@ + + private boolean func_180235_c(BlockPos p_180235_1_) + { +- IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180235_1_); +- iblockstate.func_177230_c().func_176208_a(this.field_73092_a, p_180235_1_, iblockstate, this.field_73090_b); +- boolean flag = this.field_73092_a.func_175698_g(p_180235_1_); ++ return removeBlock(p_180235_1_, false); ++ } + ++ private boolean removeBlock(BlockPos pos, boolean canHarvest) ++ { ++ IBlockState iblockstate = this.field_73092_a.func_180495_p(pos); ++ boolean flag = iblockstate.func_177230_c().removedByPlayer(iblockstate, field_73092_a, pos, field_73090_b, canHarvest); ++ + if (flag) + { +- iblockstate.func_177230_c().func_176206_d(this.field_73092_a, p_180235_1_, iblockstate); ++ iblockstate.func_177230_c().func_176206_d(this.field_73092_a, pos, iblockstate); + } + + return flag; +@@ -247,7 +280,8 @@ + + public boolean func_180237_b(BlockPos p_180237_1_) + { +- if (this.field_73091_c.func_77145_d() && !this.field_73090_b.func_184614_ca().func_190926_b() && this.field_73090_b.func_184614_ca().func_77973_b() instanceof ItemSword) ++ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(field_73092_a, field_73091_c, field_73090_b, p_180237_1_); ++ if (exp == -1) + { + return false; + } +@@ -264,53 +298,41 @@ + } + else + { +- if (this.field_73091_c.func_82752_c()) +- { +- if (this.field_73091_c == GameType.SPECTATOR) +- { +- return false; +- } ++ ItemStack stack = field_73090_b.func_184614_ca(); ++ if (!stack.func_190926_b() && stack.func_77973_b().onBlockStartBreak(stack, p_180237_1_, field_73090_b)) return false; + +- if (!this.field_73090_b.func_175142_cm()) +- { +- ItemStack itemstack = this.field_73090_b.func_184614_ca(); +- +- if (itemstack.func_190926_b()) +- { +- return false; +- } +- +- if (!itemstack.func_179544_c(block)) +- { +- return false; +- } +- } +- } +- + this.field_73092_a.func_180498_a(this.field_73090_b, 2001, p_180237_1_, Block.func_176210_f(iblockstate)); +- boolean flag1 = this.func_180235_c(p_180237_1_); ++ boolean flag1 = false; + + if (this.func_73083_d()) + { ++ flag1 = this.func_180235_c(p_180237_1_); + this.field_73090_b.field_71135_a.func_147359_a(new SPacketBlockChange(this.field_73092_a, p_180237_1_)); + } + else + { + ItemStack itemstack1 = this.field_73090_b.func_184614_ca(); + ItemStack itemstack2 = itemstack1.func_190926_b() ? ItemStack.field_190927_a : itemstack1.func_77946_l(); +- boolean flag = this.field_73090_b.func_184823_b(iblockstate); ++ boolean flag = iblockstate.func_177230_c().canHarvestBlock(field_73092_a, p_180237_1_, field_73090_b); + + if (!itemstack1.func_190926_b()) + { + itemstack1.func_179548_a(this.field_73092_a, iblockstate, p_180237_1_, this.field_73090_b); ++ if (itemstack1.func_190926_b()) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.field_73090_b, itemstack2, EnumHand.MAIN_HAND); + } + ++ flag1 = this.removeBlock(p_180237_1_, flag); + if (flag1 && flag) + { + iblockstate.func_177230_c().func_180657_a(this.field_73092_a, this.field_73090_b, p_180237_1_, iblockstate, tileentity, itemstack2); + } + } + ++ // Drop experience ++ if (!this.func_73083_d() && flag1 && exp > 0) ++ { ++ iblockstate.func_177230_c().func_180637_b(field_73092_a, p_180237_1_, exp); ++ } + return flag1; + } + } +@@ -328,8 +350,11 @@ + } + else + { ++ EnumActionResult cancelResult = net.minecraftforge.common.ForgeHooks.onItemRightClick(p_187250_1_, p_187250_4_); ++ if (cancelResult != null) return cancelResult; + int i = p_187250_3_.func_190916_E(); + int j = p_187250_3_.func_77960_j(); ++ ItemStack copyBeforeUse = p_187250_3_.func_77946_l(); + ActionResult actionresult = p_187250_3_.func_77957_a(p_187250_2_, p_187250_1_, p_187250_4_); + ItemStack itemstack = actionresult.func_188398_b(); + +@@ -357,6 +382,7 @@ + + if (itemstack.func_190926_b()) + { ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187250_1_, copyBeforeUse, p_187250_4_); + p_187250_1_.func_184611_a(p_187250_4_, ItemStack.field_190927_a); + } + +@@ -402,13 +428,27 @@ + } + else + { +- if (!p_187251_1_.func_70093_af() || p_187251_1_.func_184614_ca().func_190926_b() && p_187251_1_.func_184592_cb().func_190926_b()) ++ double reachDist = p_187251_1_.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111126_e(); ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock event = net.minecraftforge.common.ForgeHooks ++ .onRightClickBlock(p_187251_1_, p_187251_4_, p_187251_5_, p_187251_6_, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(p_187251_1_, reachDist + 1)); ++ if (event.isCanceled()) return event.getCancellationResult(); ++ ++ EnumActionResult result = EnumActionResult.PASS; ++ if (event.getUseItem() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { +- IBlockState iblockstate = p_187251_2_.func_180495_p(p_187251_5_); ++ result = p_187251_3_.onItemUseFirst(p_187251_1_, p_187251_2_, p_187251_5_, p_187251_4_, p_187251_6_, p_187251_7_, p_187251_8_, p_187251_9_); ++ if (result != EnumActionResult.PASS) return result ; ++ } + ++ boolean bypass = p_187251_1_.func_184614_ca().doesSneakBypassUse(p_187251_2_, p_187251_5_, p_187251_1_) && p_187251_1_.func_184592_cb().doesSneakBypassUse(p_187251_2_, p_187251_5_, p_187251_1_); ++ ++ if (!p_187251_1_.func_70093_af() || bypass || event.getUseBlock() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) ++ { ++ IBlockState iblockstate = p_187251_2_.func_180495_p(p_187251_5_); ++ if(event.getUseBlock() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + if (iblockstate.func_177230_c().func_180639_a(p_187251_2_, p_187251_5_, iblockstate, p_187251_1_, p_187251_4_, p_187251_6_, p_187251_7_, p_187251_8_, p_187251_9_)) + { +- return EnumActionResult.SUCCESS; ++ result = EnumActionResult.SUCCESS; + } + } + +@@ -436,14 +476,22 @@ + { + int j = p_187251_3_.func_77960_j(); + int i = p_187251_3_.func_190916_E(); ++ if (result != EnumActionResult.SUCCESS && event.getUseItem() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY ++ || result == EnumActionResult.SUCCESS && event.getUseItem() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) { + EnumActionResult enumactionresult = p_187251_3_.func_179546_a(p_187251_1_, p_187251_2_, p_187251_5_, p_187251_4_, p_187251_6_, p_187251_7_, p_187251_8_, p_187251_9_); + p_187251_3_.func_77964_b(j); + p_187251_3_.func_190920_e(i); + return enumactionresult; ++ } else return result; + } + else + { +- return p_187251_3_.func_179546_a(p_187251_1_, p_187251_2_, p_187251_5_, p_187251_4_, p_187251_6_, p_187251_7_, p_187251_8_, p_187251_9_); ++ if (result != EnumActionResult.SUCCESS && event.getUseItem() != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY ++ || result == EnumActionResult.SUCCESS && event.getUseItem() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) { ++ ItemStack copyBeforeUse = p_187251_3_.func_77946_l(); ++ result = p_187251_3_.func_179546_a(p_187251_1_, p_187251_2_, p_187251_5_, p_187251_4_, p_187251_6_, p_187251_7_, p_187251_8_, p_187251_9_); ++ if (p_187251_3_.func_190926_b()) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187251_1_, copyBeforeUse, p_187251_4_); ++ } return result; + } + } + } +@@ -453,4 +501,16 @@ + { + this.field_73092_a = p_73080_1_; + } ++ ++ @Deprecated // use the attribute directly ++ public double getBlockReachDistance() ++ { ++ return field_73090_b.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111126_e(); ++ } ++ ++ @Deprecated // use an attribute modifier ++ public void setBlockReachDistance(double distance) ++ { ++ field_73090_b.func_110148_a(EntityPlayer.REACH_DISTANCE).func_111128_a(distance); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/server/management/PlayerList.java.patch b/patches_old/minecraft/net/minecraft/server/management/PlayerList.java.patch new file mode 100644 index 000000000..587dc6df3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/management/PlayerList.java.patch @@ -0,0 +1,253 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerList.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerList.java +@@ -106,7 +106,7 @@ + this.field_72405_c = 8; + } + +- public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) ++ public void initializeConnectionToPlayer(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_, NetHandlerPlayServer nethandlerplayserver) + { + GameProfile gameprofile = p_72355_2_.func_146103_bH(); + PlayerProfileCache playerprofilecache = this.field_72400_f.func_152358_ax(); +@@ -115,6 +115,17 @@ + playerprofilecache.func_152649_a(gameprofile); + NBTTagCompound nbttagcompound = this.func_72380_a(p_72355_2_); + p_72355_2_.func_70029_a(this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK)); ++ ++ World playerWorld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); ++ if (playerWorld == null) ++ { ++ p_72355_2_.field_71093_bK = 0; ++ playerWorld = this.field_72400_f.func_71218_a(0); ++ BlockPos spawnPoint = playerWorld.field_73011_w.getRandomizedSpawnPoint(); ++ p_72355_2_.func_70107_b(spawnPoint.func_177958_n(), spawnPoint.func_177956_o(), spawnPoint.func_177952_p()); ++ } ++ ++ p_72355_2_.func_70029_a(playerWorld); + p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p); + String s1 = "local"; + +@@ -127,8 +138,9 @@ + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + WorldInfo worldinfo = worldserver.func_72912_H(); + this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver); +- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_); +- nethandlerplayserver.func_147359_a(new SPacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldinfo.func_76093_s(), worldserver.field_73011_w.func_186058_p().func_186068_a(), worldserver.func_175659_aa(), this.func_72352_l(), worldinfo.func_76067_t(), worldserver.func_82736_K().func_82766_b("reducedDebugInfo"))); ++ p_72355_2_.field_71135_a = nethandlerplayserver; ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireServerConnectionEvent(p_72355_1_); ++ nethandlerplayserver.func_147359_a(new SPacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldinfo.func_76093_s(), worldserver.field_73011_w.getDimension(), worldserver.func_175659_aa(), this.func_72352_l(), worldinfo.func_76067_t(), worldserver.func_82736_K().func_82766_b("reducedDebugInfo"))); + nethandlerplayserver.func_147359_a(new SPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(this.func_72365_p().getServerModName()))); + nethandlerplayserver.func_147359_a(new SPacketServerDifficulty(worldinfo.func_176130_y(), worldinfo.func_176123_z())); + nethandlerplayserver.func_147359_a(new SPacketPlayerAbilities(p_72355_2_.field_71075_bZ)); +@@ -204,6 +216,7 @@ + } + + p_72355_2_.func_71116_b(); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedIn(p_72355_2_); + } + + protected void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_) +@@ -304,6 +317,7 @@ + nbttagcompound1 = nbttagcompound; + p_72380_1_.func_70020_e(nbttagcompound); + field_148546_d.debug("loading single player"); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_72380_1_, this.field_72412_k, p_72380_1_.func_110124_au().toString()); + } + else + { +@@ -313,8 +327,24 @@ + return nbttagcompound1; + } + ++ public NBTTagCompound getPlayerNBT(EntityPlayerMP player) ++ { ++ // Hacky method to allow loading the NBT for a player prior to login ++ NBTTagCompound nbttagcompound = this.field_72400_f.field_71305_c[0].func_72912_H().func_76072_h(); ++ if (player.func_70005_c_().equals(this.field_72400_f.func_71214_G()) && nbttagcompound != null) ++ { ++ return nbttagcompound; ++ } ++ else ++ { ++ return ((net.minecraft.world.storage.SaveHandler)this.field_72412_k).getPlayerNBT(player); ++ } ++ } ++ + protected void func_72391_b(EntityPlayerMP p_72391_1_) + { ++ if (p_72391_1_.field_71135_a == null) return; ++ + this.field_72412_k.func_75753_a(p_72391_1_); + StatisticsManagerServer statisticsmanagerserver = this.field_148547_k.get(p_72391_1_.func_110124_au()); + +@@ -343,6 +373,7 @@ + p_72377_1_.field_71135_a.func_147359_a(new SPacketPlayerListItem(SPacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {this.field_72404_b.get(i)})); + } + ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); + worldserver.func_72838_d(p_72377_1_); + this.func_72375_a(p_72377_1_, (WorldServer)null); + } +@@ -354,6 +385,7 @@ + + public void func_72367_e(EntityPlayerMP p_72367_1_) + { ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedOut(p_72367_1_); + WorldServer worldserver = p_72367_1_.func_71121_q(); + p_72367_1_.func_71029_a(StatList.field_75947_j); + this.func_72391_b(p_72367_1_); +@@ -376,6 +408,7 @@ + worldserver.func_72964_e(p_72367_1_.field_70176_ah, p_72367_1_.field_70164_aj).func_76630_e(); + } + } ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); + + worldserver.func_72900_e(p_72367_1_); + worldserver.func_184164_w().func_72695_c(p_72367_1_); +@@ -473,13 +506,24 @@ + + public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) + { ++ World world = field_72400_f.func_71218_a(p_72368_2_); ++ if (world == null) ++ { ++ p_72368_2_ = p_72368_1_.getSpawnDimension(); ++ } ++ else if (!world.field_73011_w.func_76567_e()) ++ { ++ p_72368_2_ = world.field_73011_w.getRespawnDimension(p_72368_1_); ++ } ++ if (field_72400_f.func_71218_a(p_72368_2_) == null) p_72368_2_ = 0; ++ + p_72368_1_.func_71121_q().func_73039_n().func_72787_a(p_72368_1_); + p_72368_1_.func_71121_q().func_73039_n().func_72790_b(p_72368_1_); + p_72368_1_.func_71121_q().func_184164_w().func_72695_c(p_72368_1_); + this.field_72404_b.remove(p_72368_1_); + this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK).func_72973_f(p_72368_1_); +- BlockPos blockpos = p_72368_1_.func_180470_cg(); +- boolean flag = p_72368_1_.func_82245_bX(); ++ BlockPos blockpos = p_72368_1_.getBedLocation(p_72368_2_); ++ boolean flag = p_72368_1_.isSpawnForced(p_72368_2_); + p_72368_1_.field_71093_bK = p_72368_2_; + PlayerInteractionManager playerinteractionmanager; + +@@ -495,6 +539,7 @@ + EntityPlayerMP entityplayermp = new EntityPlayerMP(this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), playerinteractionmanager); + entityplayermp.field_71135_a = p_72368_1_.field_71135_a; + entityplayermp.func_193104_a(p_72368_1_, p_72368_3_); ++ entityplayermp.field_71093_bK = p_72368_2_; + entityplayermp.func_145769_d(p_72368_1_.func_145782_y()); + entityplayermp.func_174817_o(p_72368_1_); + entityplayermp.func_184819_a(p_72368_1_.func_184591_cq()); +@@ -542,6 +587,7 @@ + this.field_177454_f.put(entityplayermp.func_110124_au(), entityplayermp); + entityplayermp.func_71116_b(); + entityplayermp.func_70606_j(entityplayermp.func_110143_aJ()); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp, p_72368_3_); + return entityplayermp; + } + +@@ -556,15 +602,26 @@ + + public void func_187242_a(EntityPlayerMP p_187242_1_, int p_187242_2_) + { ++ transferPlayerToDimension(p_187242_1_, p_187242_2_, field_72400_f.func_71218_a(p_187242_2_).func_85176_s()); ++ } ++ ++ // TODO: Remove (1.13) ++ public void transferPlayerToDimension(EntityPlayerMP p_187242_1_, int p_187242_2_, net.minecraft.world.Teleporter teleporter) ++ { ++ transferPlayerToDimension(p_187242_1_, p_187242_2_, (net.minecraftforge.common.util.ITeleporter) teleporter); ++ } ++ ++ public void transferPlayerToDimension(EntityPlayerMP p_187242_1_, int p_187242_2_, net.minecraftforge.common.util.ITeleporter teleporter) ++ { + int i = p_187242_1_.field_71093_bK; + WorldServer worldserver = this.field_72400_f.func_71218_a(p_187242_1_.field_71093_bK); + p_187242_1_.field_71093_bK = p_187242_2_; + WorldServer worldserver1 = this.field_72400_f.func_71218_a(p_187242_1_.field_71093_bK); +- p_187242_1_.field_71135_a.func_147359_a(new SPacketRespawn(p_187242_1_.field_71093_bK, p_187242_1_.field_70170_p.func_175659_aa(), p_187242_1_.field_70170_p.func_72912_H().func_76067_t(), p_187242_1_.field_71134_c.func_73081_b())); ++ p_187242_1_.field_71135_a.func_147359_a(new SPacketRespawn(p_187242_1_.field_71093_bK, worldserver1.func_175659_aa(), worldserver1.func_72912_H().func_76067_t(), p_187242_1_.field_71134_c.func_73081_b())); + this.func_187243_f(p_187242_1_); + worldserver.func_72973_f(p_187242_1_); + p_187242_1_.field_70128_L = false; +- this.func_82448_a(p_187242_1_, i, worldserver, worldserver1); ++ this.transferEntityToWorld(p_187242_1_, i, worldserver, worldserver1, teleporter); + this.func_72375_a(p_187242_1_, worldserver); + p_187242_1_.field_71135_a.func_147364_a(p_187242_1_.field_70165_t, p_187242_1_.field_70163_u, p_187242_1_.field_70161_v, p_187242_1_.field_70177_z, p_187242_1_.field_70125_A); + p_187242_1_.field_71134_c.func_73080_a(worldserver1); +@@ -576,17 +633,34 @@ + { + p_187242_1_.field_71135_a.func_147359_a(new SPacketEntityEffect(p_187242_1_.func_145782_y(), potioneffect)); + } ++ // Fix MC-88179: on non-death SPacketRespawn, also resend attributes ++ net.minecraft.entity.ai.attributes.AttributeMap attributemap = (net.minecraft.entity.ai.attributes.AttributeMap) p_187242_1_.func_110140_aT(); ++ java.util.Collection watchedAttribs = attributemap.func_111160_c(); ++ if (!watchedAttribs.isEmpty()) p_187242_1_.field_71135_a.func_147359_a(new net.minecraft.network.play.server.SPacketEntityProperties(p_187242_1_.func_145782_y(), watchedAttribs)); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_187242_1_, i, p_187242_2_); + } + + public void func_82448_a(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) + { +- double d0 = p_82448_1_.field_70165_t; +- double d1 = p_82448_1_.field_70161_v; ++ transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.func_85176_s()); ++ } ++ ++ // TODO: Remove (1.13) ++ public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraft.world.Teleporter teleporter) ++ { ++ transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, (net.minecraftforge.common.util.ITeleporter) teleporter); ++ } ++ ++ public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraftforge.common.util.ITeleporter teleporter) ++ { ++ double moveFactor = p_82448_3_.field_73011_w.getMovementFactor() / p_82448_4_.field_73011_w.getMovementFactor(); ++ double d0 = MathHelper.func_151237_a(p_82448_1_.field_70165_t * moveFactor, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); ++ double d1 = MathHelper.func_151237_a(p_82448_1_.field_70161_v * moveFactor, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); + double d2 = 8.0D; + float f = p_82448_1_.field_70177_z; + p_82448_3_.field_72984_F.func_76320_a("moving"); + +- if (p_82448_1_.field_71093_bK == -1) ++ if (false && p_82448_1_.field_71093_bK == -1) + { + d0 = MathHelper.func_151237_a(d0 / 8.0D, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); + d1 = MathHelper.func_151237_a(d1 / 8.0D, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); +@@ -597,7 +671,7 @@ + p_82448_3_.func_72866_a(p_82448_1_, false); + } + } +- else if (p_82448_1_.field_71093_bK == 0) ++ else if (false && p_82448_1_.field_71093_bK == 0) + { + d0 = MathHelper.func_151237_a(d0 * 8.0D, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); + d1 = MathHelper.func_151237_a(d1 * 8.0D, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); +@@ -608,7 +682,7 @@ + p_82448_3_.func_72866_a(p_82448_1_, false); + } + } +- else ++ if (p_82448_1_.field_71093_bK == 1 && teleporter.isVanilla()) + { + BlockPos blockpos; + +@@ -634,7 +708,7 @@ + + p_82448_3_.field_72984_F.func_76319_b(); + +- if (p_82448_2_ != 1) ++ if (p_82448_2_ != 1 || !teleporter.isVanilla()) + { + p_82448_3_.field_72984_F.func_76320_a("placing"); + d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872); +@@ -643,7 +717,8 @@ + if (p_82448_1_.func_70089_S()) + { + p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); +- p_82448_4_.func_85176_s().func_180266_a(p_82448_1_, f); ++ p_82448_3_.func_72866_a(p_82448_1_, false); ++ teleporter.placeEntity(p_82448_4_, p_82448_1_, f); + p_82448_4_.func_72838_d(p_82448_1_); + p_82448_4_.func_72866_a(p_82448_1_, false); + } diff --git a/patches_old/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch b/patches_old/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch new file mode 100644 index 000000000..876f48a73 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java ++++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java +@@ -22,6 +22,8 @@ + + public void func_147383_a(C00Handshake p_147383_1_) + { ++ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerHandshake(p_147383_1_, this.field_147386_b)) return; ++ + switch (p_147383_1_.func_149594_c()) + { + case LOGIN: diff --git a/patches_old/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/patches_old/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch new file mode 100644 index 000000000..2c3ee93c0 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java ++++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java +@@ -69,7 +69,7 @@ + if (entityplayermp == null) + { + this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; +- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_181025_l); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_181025_l); + this.field_181025_l = null; + } + } +@@ -132,7 +132,7 @@ + } + else + { +- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i)); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i)); + } + } + } +@@ -177,7 +177,7 @@ + this.field_147335_k = p_147315_1_.func_149300_a(privatekey); + this.field_147328_g = NetHandlerLoginServer.LoginState.AUTHENTICATING; + this.field_147333_a.func_150727_a(this.field_147335_k); +- (new Thread("User Authenticator #" + field_147331_b.incrementAndGet()) ++ (new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, "User Authenticator #" + field_147331_b.incrementAndGet()) + { + public void run() + { diff --git a/patches_old/minecraft/net/minecraft/stats/RecipeBook.java.patch b/patches_old/minecraft/net/minecraft/stats/RecipeBook.java.patch new file mode 100644 index 000000000..605fbd53f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/stats/RecipeBook.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/stats/RecipeBook.java ++++ ../src-work/minecraft/net/minecraft/stats/RecipeBook.java +@@ -42,9 +42,17 @@ + this.field_194078_b.clear(i); + } + ++ @Deprecated //DO NOT USE + protected static int func_194075_d(@Nullable IRecipe p_194075_0_) + { +- return CraftingManager.field_193380_a.func_148757_b(p_194075_0_); ++ int ret = CraftingManager.field_193380_a.func_148757_b(p_194075_0_); ++ if (ret == -1) ++ { ++ ret = ((net.minecraftforge.registries.ForgeRegistry)net.minecraftforge.fml.common.registry.ForgeRegistries.RECIPES).getID(p_194075_0_.getRegistryName()); ++ if (ret == -1) ++ throw new IllegalArgumentException(String.format("Attempted to get the ID for a unknown recipe: %s Name: %s", p_194075_0_, p_194075_0_.getRegistryName())); ++ } ++ return ret; + } + + @SideOnly(Side.CLIENT) diff --git a/patches_old/minecraft/net/minecraft/stats/RecipeBookServer.java.patch b/patches_old/minecraft/net/minecraft/stats/RecipeBookServer.java.patch new file mode 100644 index 000000000..f795cc5e4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/stats/RecipeBookServer.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/stats/RecipeBookServer.java ++++ ../src-work/minecraft/net/minecraft/stats/RecipeBookServer.java +@@ -55,7 +55,7 @@ + + private void func_194081_a(SPacketRecipeBook.State p_194081_1_, EntityPlayerMP p_194081_2_, List p_194081_3_) + { +- p_194081_2_.field_71135_a.func_147359_a(new SPacketRecipeBook(p_194081_1_, p_194081_3_, Collections.emptyList(), this.field_192818_b, this.field_192819_c)); ++ net.minecraftforge.common.ForgeHooks.sendRecipeBook(p_194081_2_.field_71135_a, p_194081_1_, p_194081_3_, Collections.emptyList(), this.field_192818_b, this.field_192819_c); + } + + public NBTTagCompound func_192824_e() +@@ -147,6 +147,6 @@ + + public void func_192826_c(EntityPlayerMP p_192826_1_) + { +- p_192826_1_.field_71135_a.func_147359_a(new SPacketRecipeBook(SPacketRecipeBook.State.INIT, this.func_194079_d(), this.func_194080_e(), this.field_192818_b, this.field_192819_c)); ++ net.minecraftforge.common.ForgeHooks.sendRecipeBook(p_192826_1_.field_71135_a, SPacketRecipeBook.State.INIT, this.func_194079_d(), this.func_194080_e(), this.field_192818_b, this.field_192819_c); + } + } diff --git a/patches_old/minecraft/net/minecraft/stats/StatList.java.patch b/patches_old/minecraft/net/minecraft/stats/StatList.java.patch new file mode 100644 index 000000000..efabe0caf --- /dev/null +++ b/patches_old/minecraft/net/minecraft/stats/StatList.java.patch @@ -0,0 +1,138 @@ +--- ../src-base/minecraft/net/minecraft/stats/StatList.java ++++ ../src-work/minecraft/net/minecraft/stats/StatList.java +@@ -162,7 +162,7 @@ + } + } + +- func_75924_a(field_188066_af); ++ replaceAllSimilarBlocks(field_188066_af, true); + } + + private static void func_151181_c() +@@ -184,7 +184,7 @@ + } + } + +- func_75924_a(field_188065_ae); ++ replaceAllSimilarBlocks(field_188065_ae, false); + } + + private static void func_75925_c() +@@ -208,7 +208,7 @@ + } + } + +- func_75924_a(field_75929_E); ++ replaceAllSimilarBlocks(field_75929_E, true); + } + + private static void func_151179_e() +@@ -227,7 +227,7 @@ + } + } + +- func_75924_a(field_75930_F); ++ replaceAllSimilarBlocks(field_75930_F, true); + } + + private static void func_188054_f() +@@ -247,7 +247,7 @@ + } + } + +- func_75924_a(field_75930_F); ++ replaceAllSimilarBlocks(field_75930_F, true); + } + + private static String func_180204_a(Item p_180204_0_) +@@ -256,28 +256,35 @@ + return resourcelocation != null ? resourcelocation.toString().replace(':', '.') : null; + } + +- private static void func_75924_a(StatBase[] p_75924_0_) ++ private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_, boolean useItemIds) + { +- func_151180_a(p_75924_0_, Blocks.field_150355_j, Blocks.field_150358_i); +- func_151180_a(p_75924_0_, Blocks.field_150353_l, Blocks.field_150356_k); +- func_151180_a(p_75924_0_, Blocks.field_150428_aP, Blocks.field_150423_aK); +- func_151180_a(p_75924_0_, Blocks.field_150470_am, Blocks.field_150460_al); +- func_151180_a(p_75924_0_, Blocks.field_150439_ay, Blocks.field_150450_ax); +- func_151180_a(p_75924_0_, Blocks.field_150416_aS, Blocks.field_150413_aR); +- func_151180_a(p_75924_0_, Blocks.field_150455_bV, Blocks.field_150441_bU); +- func_151180_a(p_75924_0_, Blocks.field_150429_aA, Blocks.field_150437_az); +- func_151180_a(p_75924_0_, Blocks.field_150374_bv, Blocks.field_150379_bu); +- func_151180_a(p_75924_0_, Blocks.field_150334_T, Blocks.field_150333_U); +- func_151180_a(p_75924_0_, Blocks.field_150373_bw, Blocks.field_150376_bx); +- func_151180_a(p_75924_0_, Blocks.field_180388_cO, Blocks.field_180389_cP); +- func_151180_a(p_75924_0_, Blocks.field_150349_c, Blocks.field_150346_d); +- func_151180_a(p_75924_0_, Blocks.field_150458_ak, Blocks.field_150346_d); ++ mergeStatBases(p_75924_0_, Blocks.field_150355_j, Blocks.field_150358_i, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150353_l, Blocks.field_150356_k, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150428_aP, Blocks.field_150423_aK, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150470_am, Blocks.field_150460_al, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150439_ay, Blocks.field_150450_ax, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150416_aS, Blocks.field_150413_aR, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150455_bV, Blocks.field_150441_bU, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150429_aA, Blocks.field_150437_az, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150374_bv, Blocks.field_150379_bu, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150334_T, Blocks.field_150333_U, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150373_bw, Blocks.field_150376_bx, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_180388_cO, Blocks.field_180389_cP, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150349_c, Blocks.field_150346_d, useItemIds); ++ mergeStatBases(p_75924_0_, Blocks.field_150458_ak, Blocks.field_150346_d, useItemIds); + } + +- private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_) ++ private static void mergeStatBases(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_, boolean useItemIds) + { +- int i = Block.func_149682_b(p_151180_1_); +- int j = Block.func_149682_b(p_151180_2_); ++ int i; ++ int j; ++ if (useItemIds) { ++ i = Item.func_150891_b(Item.func_150898_a(p_151180_1_)); ++ j = Item.func_150891_b(Item.func_150898_a(p_151180_2_)); ++ } else { ++ i = Block.func_149682_b(p_151180_1_); ++ j = Block.func_149682_b(p_151180_2_); ++ } + + if (p_151180_0_[i] != null && p_151180_0_[j] == null) + { +@@ -309,4 +316,36 @@ + { + return field_188093_a.get(p_151177_0_); + } ++ ++ @Deprecated //MODDER DO NOT CALL THIS ITS JUST A EVENT CALLBACK FOR FORGE ++ public static void reinit() ++ { ++ field_188093_a.clear(); ++ field_188094_c.clear(); ++ field_188095_d.clear(); ++ field_188096_e.clear(); ++ ++ for (StatBase[] sb : new StatBase[][]{field_188065_ae, field_188066_af, field_75929_E, field_75930_F, field_188067_ai, field_188068_aj}) ++ { ++ for (int x = 0; x < sb.length; x++) ++ { ++ if (sb[x] != null) ++ { ++ field_75940_b.remove(sb[x]); ++ sb[x] = null; ++ } ++ } ++ } ++ List unknown = Lists.newArrayList(field_75940_b); ++ field_75940_b.clear(); ++ ++ for (StatBase b : unknown) ++ b.func_75971_g(); ++ ++ func_151181_c(); ++ func_75925_c(); ++ func_151179_e(); ++ func_75918_d(); ++ func_188054_f(); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntity.java.patch new file mode 100644 index 000000000..d9e519c0e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -0,0 +1,282 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java +@@ -21,7 +21,7 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +-public abstract class TileEntity ++public abstract class TileEntity implements net.minecraftforge.common.capabilities.ICapabilitySerializable + { + private static final Logger field_145852_a = LogManager.getLogger(); + private static final RegistryNamespaced < ResourceLocation, Class > field_190562_f = new RegistryNamespaced < ResourceLocation, Class > (); +@@ -60,6 +60,8 @@ + public void func_145839_a(NBTTagCompound p_145839_1_) + { + this.field_174879_c = new BlockPos(p_145839_1_.func_74762_e("x"), p_145839_1_.func_74762_e("y"), p_145839_1_.func_74762_e("z")); ++ if (p_145839_1_.func_74764_b("ForgeData")) this.customTileData = p_145839_1_.func_74775_l("ForgeData"); ++ if (this.capabilities != null && p_145839_1_.func_74764_b("ForgeCaps")) this.capabilities.deserializeNBT(p_145839_1_.func_74775_l("ForgeCaps")); + } + + public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) +@@ -81,6 +83,8 @@ + p_189516_1_.func_74768_a("x", this.field_174879_c.func_177958_n()); + p_189516_1_.func_74768_a("y", this.field_174879_c.func_177956_o()); + p_189516_1_.func_74768_a("z", this.field_174879_c.func_177952_p()); ++ if (this.customTileData != null) p_189516_1_.func_74782_a("ForgeData", this.customTileData); ++ if (this.capabilities != null) p_189516_1_.func_74782_a("ForgeCaps", this.capabilities.serializeNBT()); + return p_189516_1_; + } + } +@@ -90,10 +94,11 @@ + { + TileEntity tileentity = null; + String s = p_190200_1_.func_74779_i("id"); ++ Class oclass = null; + + try + { +- Class oclass = (Class)field_190562_f.func_82594_a(new ResourceLocation(s)); ++ oclass = (Class)field_190562_f.func_82594_a(new ResourceLocation(s)); + + if (oclass != null) + { +@@ -103,6 +108,8 @@ + catch (Throwable throwable1) + { + field_145852_a.error("Failed to create block entity {}", s, throwable1); ++ net.minecraftforge.fml.common.FMLLog.log.error("A TileEntity {}({}) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", ++ s, oclass == null ? null : oclass.getName(), throwable1); + } + + if (tileentity != null) +@@ -115,6 +122,8 @@ + catch (Throwable throwable) + { + field_145852_a.error("Failed to load data for block entity {}", s, throwable); ++ net.minecraftforge.fml.common.FMLLog.log.error("A TileEntity {}({}) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", ++ s, oclass.getName(), throwable); + tileentity = null; + } + } +@@ -156,7 +165,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public double func_145835_a(double p_145835_1_, double p_145835_3_, double p_145835_5_) + { + double d0 = (double)this.field_174879_c.func_177958_n() + 0.5D - p_145835_1_; +@@ -244,7 +252,7 @@ + + try + { +- return String.format("ID #%d (%s // %s)", i, Block.func_149729_e(i).func_149739_a(), Block.func_149729_e(i).getClass().getCanonicalName()); ++ return String.format("ID #%d (%s // %s // %s)", i, Block.func_149729_e(i).func_149739_a(), Block.func_149729_e(i).getClass().getName(), Block.func_149729_e(i).getRegistryName()); + } + catch (Throwable var3) + { +@@ -297,6 +305,204 @@ + { + } + ++ // -- BEGIN FORGE PATCHES -- ++ /** ++ * Called when you receive a TileEntityData packet for the location this ++ * TileEntity is currently in. On the client, the NetworkManager will always ++ * be the remote server. On the server, it will be whomever is responsible for ++ * sending the packet. ++ * ++ * @param net The NetworkManager the packet originated from ++ * @param pkt The data packet ++ */ ++ public void onDataPacket(net.minecraft.network.NetworkManager net, net.minecraft.network.play.server.SPacketUpdateTileEntity pkt) ++ { ++ } ++ ++ /** ++ * Called when the chunk's TE update tag, gotten from {@link #getUpdateTag()}, is received on the client. ++ *

++ * Used to handle this tag in a special way. By default this simply calls {@link #readFromNBT(NBTTagCompound)}. ++ * ++ * @param tag The {@link NBTTagCompound} sent from {@link #getUpdateTag()} ++ */ ++ public void handleUpdateTag(NBTTagCompound tag) ++ { ++ this.func_145839_a(tag); ++ } ++ ++ /** ++ * Called when the chunk this TileEntity is on is Unloaded. ++ */ ++ public void onChunkUnload() ++ { ++ } ++ ++ private boolean isVanilla = getClass().getName().startsWith("net.minecraft."); ++ /** ++ * Called from Chunk.setBlockIDWithMetadata and Chunk.fillChunk, determines if this tile entity should be re-created when the ID, or Metadata changes. ++ * Use with caution as this will leave straggler TileEntities, or create conflicts with other TileEntities if not used properly. ++ * ++ * @param world Current world ++ * @param pos Tile's world position ++ * @param oldState The old ID of the block ++ * @param newState The new ID of the block (May be the same) ++ * @return true forcing the invalidation of the existing TE, false not to invalidate the existing TE ++ */ ++ public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) ++ { ++ return isVanilla ? (oldState.func_177230_c() != newSate.func_177230_c()) : oldState != newSate; ++ } ++ ++ public boolean shouldRenderInPass(int pass) ++ { ++ return pass == 0; ++ } ++ ++ /** ++ * Sometimes default render bounding box: infinite in scope. Used to control rendering on {@link TileEntitySpecialRenderer}. ++ */ ++ public static final net.minecraft.util.math.AxisAlignedBB INFINITE_EXTENT_AABB = new net.minecraft.util.math.AxisAlignedBB(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); ++ /** ++ * Return an {@link AxisAlignedBB} that controls the visible scope of a {@link TileEntitySpecialRenderer} associated with this {@link TileEntity} ++ * Defaults to the collision bounding box {@link Block#getCollisionBoundingBoxFromPool(World, int, int, int)} associated with the block ++ * at this location. ++ * ++ * @return an appropriately size {@link AxisAlignedBB} for the {@link TileEntity} ++ */ ++ @SideOnly(Side.CLIENT) ++ public net.minecraft.util.math.AxisAlignedBB getRenderBoundingBox() ++ { ++ net.minecraft.util.math.AxisAlignedBB bb = INFINITE_EXTENT_AABB; ++ Block type = func_145838_q(); ++ BlockPos pos = func_174877_v(); ++ if (type == Blocks.field_150381_bn) ++ { ++ bb = new net.minecraft.util.math.AxisAlignedBB(pos, pos.func_177982_a(1, 1, 1)); ++ } ++ else if (type == Blocks.field_150486_ae || type == Blocks.field_150447_bR) ++ { ++ bb = new net.minecraft.util.math.AxisAlignedBB(pos.func_177982_a(-1, 0, -1), pos.func_177982_a(2, 2, 2)); ++ } ++ else if (type == Blocks.field_185779_df) ++ { ++ bb = INFINITE_EXTENT_AABB; ++ } ++ else if (type != null && type != Blocks.field_150461_bJ) ++ { ++ net.minecraft.util.math.AxisAlignedBB cbb = null; ++ try ++ { ++ cbb = field_145850_b.func_180495_p(func_174877_v()).func_185890_d(field_145850_b, pos).func_186670_a(pos); ++ } ++ catch (Exception e) ++ { ++ // We have to capture any exceptions that may occur here because BUKKIT servers like to send ++ // the tile entity data BEFORE the chunk data, you know, the OPPOSITE of what vanilla does! ++ // So we can not GARENTEE that the world state is the real state for the block... ++ // So, once again in the long line of US having to accommodate BUKKIT breaking things, ++ // here it is, assume that the TE is only 1 cubic block. Problem with this is that it may ++ // cause the TileEntity renderer to error further down the line! But alas, nothing we can do. ++ cbb = new net.minecraft.util.math.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(1, 1, 1)); ++ } ++ if (cbb != null) bb = cbb; ++ } ++ return bb; ++ } ++ ++ /** ++ * Checks if this tile entity knows how to render its 'breaking' overlay effect. ++ * If this returns true, The TileEntitySpecialRenderer will be called again with break progress set. ++ * @return True to re-render tile with breaking effect. ++ */ ++ public boolean canRenderBreaking() ++ { ++ Block block = this.func_145838_q(); ++ return (block instanceof net.minecraft.block.BlockChest || ++ block instanceof net.minecraft.block.BlockEnderChest || ++ block instanceof net.minecraft.block.BlockSign || ++ block instanceof net.minecraft.block.BlockSkull); ++ } ++ ++ private NBTTagCompound customTileData; ++ ++ /** ++ * Gets a {@link NBTTagCompound} that can be used to store custom data for this tile entity. ++ * It will be written, and read from disc, so it persists over world saves. ++ * ++ * @return A compound tag for custom data ++ */ ++ public NBTTagCompound getTileData() ++ { ++ if (this.customTileData == null) ++ { ++ this.customTileData = new NBTTagCompound(); ++ } ++ return this.customTileData; ++ } ++ ++ /** ++ * Determines if the player can overwrite the NBT data of this tile entity while they place it using a ItemStack. ++ * Added as a fix for MC-75630 - Exploit with signs and command blocks ++ * @return True to prevent NBT copy, false to allow. ++ */ ++ public boolean restrictNBTCopy() ++ { ++ return this instanceof TileEntityCommandBlock || ++ this instanceof TileEntityMobSpawner || ++ this instanceof TileEntitySign; ++ } ++ ++ ++ /** ++ * Called when this is first added to the world (by {@link World#addTileEntity(TileEntity)}). ++ * Override instead of adding {@code if (firstTick)} stuff in update. ++ */ ++ public void onLoad() ++ { ++ // NOOP ++ } ++ ++ /** ++ * If the TileEntitySpecialRenderer associated with this TileEntity can be batched in with another renderers, and won't access the GL state. ++ * If TileEntity returns true, then TESR should have the same functionality as (and probably extend) the FastTESR class. ++ */ ++ public boolean hasFastRenderer() ++ { ++ return false; ++ } ++ ++ private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; ++ public TileEntity() ++ { ++ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); ++ } ++ ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capabilities == null ? false : capabilities.hasCapability(capability, facing); ++ } ++ ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capabilities == null ? null : capabilities.getCapability(capability, facing); ++ } ++ ++ public void deserializeNBT(NBTTagCompound nbt) ++ { ++ this.func_145839_a(nbt); ++ } ++ ++ public NBTTagCompound serializeNBT() ++ { ++ NBTTagCompound ret = new NBTTagCompound(); ++ this.func_189515_b(ret); ++ return ret; ++ } ++ + static + { + func_190560_a("furnace", TileEntityFurnace.class); diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch new file mode 100644 index 000000000..8fbc3d27f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -0,0 +1,45 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +@@ -130,17 +130,21 @@ + { + if (iblockstate.func_177230_c() != Blocks.field_150397_co) + { +- if (iblockstate.func_185891_c() >= 15 && iblockstate.func_177230_c() != Blocks.field_150357_h) ++ if (iblockstate.getLightOpacity(field_145850_b, blockpos$mutableblockpos) >= 15 && iblockstate.func_177230_c() != Blocks.field_150357_h) + { + this.field_146015_k = false; + this.field_174909_f.clear(); + break; + } +- ++ float[] customColor = iblockstate.func_177230_c().getBeaconColorMultiplier(iblockstate, this.field_145850_b, blockpos$mutableblockpos, func_174877_v()); ++ if (customColor != null) ++ afloat = customColor; ++ else { + tileentitybeacon$beamsegment.func_177262_a(); + continue; ++ } + } +- ++ else + afloat = ((EnumDyeColor)iblockstate.func_177229_b(BlockStainedGlassPane.field_176245_a)).func_193349_f(); + } + +@@ -181,7 +185,7 @@ + { + Block block = this.field_145850_b.func_180495_p(new BlockPos(j1, i2, k1)).func_177230_c(); + +- if (block != Blocks.field_150475_bE && block != Blocks.field_150340_R && block != Blocks.field_150484_ah && block != Blocks.field_150339_S) ++ if (!block.isBeaconBase(this.field_145850_b, new BlockPos(j1, i2, k1), func_174877_v())) + { + flag1 = false; + break; +@@ -395,7 +399,7 @@ + + public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) + { +- return p_94041_2_.func_77973_b() == Items.field_151166_bC || p_94041_2_.func_77973_b() == Items.field_151045_i || p_94041_2_.func_77973_b() == Items.field_151043_k || p_94041_2_.func_77973_b() == Items.field_151042_j; ++ return p_94041_2_.func_77973_b() != null && p_94041_2_.func_77973_b().isBeaconPayment(p_94041_2_); + } + + public String func_174875_k() diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch new file mode 100644 index 000000000..78b80ff38 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch @@ -0,0 +1,48 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityChest.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityChest.java +@@ -116,6 +116,7 @@ + { + super.func_145836_u(); + this.field_145984_a = false; ++ doubleChestHandler = null; + } + + @SuppressWarnings("incomplete-switch") +@@ -167,6 +168,7 @@ + { + if (!this.field_145984_a) + { ++ if (this.field_145850_b == null || !this.field_145850_b.func_175697_a(this.field_174879_c, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbors + this.field_145984_a = true; + this.field_145991_k = this.func_174911_a(EnumFacing.WEST); + this.field_145990_j = this.func_174911_a(EnumFacing.EAST); +@@ -349,6 +351,29 @@ + } + } + ++ public net.minecraftforge.items.VanillaDoubleChestItemHandler doubleChestHandler; ++ ++ @SuppressWarnings("unchecked") ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ if (capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) ++ { ++ if(doubleChestHandler == null || doubleChestHandler.needsRefresh()) ++ doubleChestHandler = net.minecraftforge.items.VanillaDoubleChestItemHandler.get(this); ++ if (doubleChestHandler != null && doubleChestHandler != net.minecraftforge.items.VanillaDoubleChestItemHandler.NO_ADJACENT_CHESTS_INSTANCE) ++ return (T) doubleChestHandler; ++ } ++ return super.getCapability(capability, facing); ++ } ++ ++ public net.minecraftforge.items.IItemHandler getSingleChestHandler() ++ { ++ return super.getCapability(net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); ++ } ++ ++ + public void func_145843_s() + { + super.func_145843_s(); diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch new file mode 100644 index 000000000..a758f873e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -0,0 +1,52 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java +@@ -191,6 +191,7 @@ + + private boolean func_145883_k() + { ++ if (net.minecraftforge.items.VanillaInventoryCodeHooks.insertHook(this)) { return true; } + IInventory iinventory = this.func_145895_l(); + + if (iinventory == null) +@@ -297,6 +298,8 @@ + + public static boolean func_145891_a(IHopper p_145891_0_) + { ++ Boolean ret = net.minecraftforge.items.VanillaInventoryCodeHooks.extractHook(p_145891_0_); ++ if (ret != null) return ret; + IInventory iinventory = func_145884_b(p_145891_0_); + + if (iinventory != null) +@@ -396,6 +399,12 @@ + } + } + ++ ++ protected net.minecraftforge.items.IItemHandler createUnSidedHandler() ++ { ++ return new net.minecraftforge.items.VanillaHopperItemHandler(this); ++ } ++ + public static ItemStack func_174918_a(IInventory p_174918_0_, IInventory p_174918_1_, ItemStack p_174918_2_, @Nullable EnumFacing p_174918_3_) + { + if (p_174918_1_ instanceof ISidedInventory && p_174918_3_ != null) +@@ -516,9 +525,10 @@ + int j = MathHelper.func_76128_c(p_145893_3_); + int k = MathHelper.func_76128_c(p_145893_5_); + BlockPos blockpos = new BlockPos(i, j, k); +- Block block = p_145893_0_.func_180495_p(blockpos).func_177230_c(); ++ net.minecraft.block.state.IBlockState state = p_145893_0_.func_180495_p(blockpos); ++ Block block = state.func_177230_c(); + +- if (block.func_149716_u()) ++ if (block.hasTileEntity(state)) + { + TileEntity tileentity = p_145893_0_.func_175625_s(blockpos); + +@@ -611,4 +621,6 @@ + { + return this.field_145900_a; + } ++ ++ public long getLastUpdateTime() { return field_190578_g; } // Forge + } diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch new file mode 100644 index 000000000..69eac2db7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityLockable.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityLockable.java +@@ -48,4 +48,27 @@ + { + return (ITextComponent)(this.func_145818_k_() ? new TextComponentString(this.func_70005_c_()) : new TextComponentTranslation(this.func_70005_c_(), new Object[0])); + } ++ ++ private net.minecraftforge.items.IItemHandler itemHandler; ++ ++ protected net.minecraftforge.items.IItemHandler createUnSidedHandler() ++ { ++ return new net.minecraftforge.items.wrapper.InvWrapper(this); ++ } ++ ++ @SuppressWarnings("unchecked") ++ @Override ++ @javax.annotation.Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @javax.annotation.Nullable net.minecraft.util.EnumFacing facing) ++ { ++ if (capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) ++ return (T) (itemHandler == null ? (itemHandler = createUnSidedHandler()) : itemHandler); ++ return super.getCapability(capability, facing); ++ } ++ ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @javax.annotation.Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch new file mode 100644 index 000000000..3ec94d9c6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java +@@ -73,7 +73,7 @@ + + if (p_184281_1_ != null) + { +- lootcontext$builder.func_186469_a(p_184281_1_.func_184817_da()); ++ lootcontext$builder.func_186469_a(p_184281_1_.func_184817_da()).func_186470_a(p_184281_1_); // Forge: add player to LootContext + } + + loottable.func_186460_a(this, random, lootcontext$builder.func_186471_a()); diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch new file mode 100644 index 000000000..e8d6a2688 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityNote.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityNote.java +@@ -32,7 +32,9 @@ + + public void func_145877_a() + { ++ byte old = field_145879_a; + this.field_145879_a = (byte)((this.field_145879_a + 1) % 25); ++ if (!net.minecraftforge.common.ForgeHooks.onNoteChange(this, old)) return; + this.func_70296_d(); + } + diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch new file mode 100644 index 000000000..6b9608798 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityPiston.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityPiston.java +@@ -145,7 +145,7 @@ + + if (!list1.isEmpty()) + { +- boolean flag = this.field_174932_a.func_177230_c() == Blocks.field_180399_cE; ++ boolean flag = this.field_174932_a.func_177230_c().isStickyBlock(this.field_174932_a); + + for (int i = 0; i < list1.size(); ++i) + { diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch new file mode 100644 index 000000000..10b195fa2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java +@@ -422,4 +422,9 @@ + OPENED, + CLOSING; + } ++ ++ protected net.minecraftforge.items.IItemHandler createUnSidedHandler() ++ { ++ return new net.minecraftforge.items.wrapper.SidedInvWrapper(this, EnumFacing.UP); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch b/patches_old/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch new file mode 100644 index 000000000..f0b24d2e3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntitySign.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntitySign.java +@@ -59,7 +59,7 @@ + } + public boolean func_70003_b(int p_70003_1_, String p_70003_2_) + { +- return true; ++ return p_70003_1_ <= 2; //Forge: Fixes MC-75630 - Exploit with signs and command blocks + } + public BlockPos func_180425_c() + { diff --git a/patches_old/minecraft/net/minecraft/util/ActionResult.java.patch b/patches_old/minecraft/net/minecraft/util/ActionResult.java.patch new file mode 100644 index 000000000..28c5a82cf --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/ActionResult.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/util/ActionResult.java ++++ ../src-work/minecraft/net/minecraft/util/ActionResult.java +@@ -20,4 +20,10 @@ + { + return this.field_188400_b; + } ++ ++ //Just a generic helper function to make typecasing easier... ++ public static ActionResult newResult(EnumActionResult result, T value) ++ { ++ return new ActionResult(result, value); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/util/BlockRenderLayer.java.patch b/patches_old/minecraft/net/minecraft/util/BlockRenderLayer.java.patch new file mode 100644 index 000000000..80055839a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/BlockRenderLayer.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/util/BlockRenderLayer.java ++++ ../src-work/minecraft/net/minecraft/util/BlockRenderLayer.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 BlockRenderLayer + { + SOLID("Solid"), diff --git a/patches_old/minecraft/net/minecraft/util/ChatAllowedCharacters.java.patch b/patches_old/minecraft/net/minecraft/util/ChatAllowedCharacters.java.patch new file mode 100644 index 000000000..3ae294d26 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/ChatAllowedCharacters.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/ChatAllowedCharacters.java ++++ ../src-work/minecraft/net/minecraft/util/ChatAllowedCharacters.java +@@ -31,6 +31,7 @@ + + static + { ++ if (System.getProperty("io.netty.leakDetection.level") == null) // Forge: allow level to be manually specified + ResourceLeakDetector.setLevel(field_184877_a); + } + } diff --git a/patches_old/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch b/patches_old/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch new file mode 100644 index 000000000..93d097b39 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java ++++ ../src-work/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java +@@ -13,7 +13,8 @@ + + public class ClassInheritanceMultiMap extends AbstractSet + { +- private static final Set < Class> field_181158_a = Sets. < Class> newHashSet(); ++ // Forge: Use concurrent collection to allow creating chunks from multiple threads safely ++ private static final Set < Class> field_181158_a = java.util.Collections.newSetFromMap(new java.util.concurrent.ConcurrentHashMap, Boolean>()); + private final Map < Class, List> field_180218_a = Maps. < Class, List> newHashMap(); + private final Set < Class> field_180216_b = Sets. < Class> newIdentityHashSet(); + private final Class field_180217_c; diff --git a/patches_old/minecraft/net/minecraft/util/EnumFacing.java.patch b/patches_old/minecraft/net/minecraft/util/EnumFacing.java.patch new file mode 100644 index 000000000..4ca5aafe9 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/EnumFacing.java.patch @@ -0,0 +1,67 @@ +--- ../src-base/minecraft/net/minecraft/util/EnumFacing.java ++++ ../src-work/minecraft/net/minecraft/util/EnumFacing.java +@@ -12,8 +12,6 @@ + import net.minecraft.util.math.BlockPos; + import net.minecraft.util.math.MathHelper; + import net.minecraft.util.math.Vec3i; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + + public enum EnumFacing implements IStringSerializable + { +@@ -66,7 +64,6 @@ + return func_82600_a(this.field_176759_h); + } + +- @SideOnly(Side.CLIENT) + public EnumFacing func_176732_a(EnumFacing.Axis p_176732_1_) + { + switch (p_176732_1_) +@@ -117,7 +114,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + private EnumFacing func_176744_n() + { + switch (this) +@@ -137,7 +133,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + private EnumFacing func_176738_p() + { + switch (this) +@@ -199,7 +194,6 @@ + } + + @Nullable +- @SideOnly(Side.CLIENT) + public static EnumFacing func_176739_a(String p_176739_0_) + { + return p_176739_0_ == null ? null : (EnumFacing)field_176761_p.get(p_176739_0_.toLowerCase(Locale.ROOT)); +@@ -230,7 +224,6 @@ + return values()[p_176741_0_.nextInt(values().length)]; + } + +- @SideOnly(Side.CLIENT) + public static EnumFacing func_176737_a(float p_176737_0_, float p_176737_1_, float p_176737_2_) + { + EnumFacing enumfacing = NORTH; +@@ -293,7 +286,6 @@ + return p_190914_1_.func_174811_aO().func_176734_d(); + } + +- @SideOnly(Side.CLIENT) + public Vec3i func_176730_m() + { + return this.field_176756_m; +@@ -330,7 +322,6 @@ + } + + @Nullable +- @SideOnly(Side.CLIENT) + public static EnumFacing.Axis func_176717_a(String p_176717_0_) + { + return p_176717_0_ == null ? null : (EnumFacing.Axis)field_176725_d.get(p_176717_0_.toLowerCase(Locale.ROOT)); diff --git a/patches_old/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch b/patches_old/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch new file mode 100644 index 000000000..a26f3cfc5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/IntIdentityHashBiMap.java ++++ ../src-work/minecraft/net/minecraft/util/IntIdentityHashBiMap.java +@@ -168,7 +168,6 @@ + return Iterators.filter(Iterators.forArray(this.field_186820_d), Predicates.notNull()); + } + +- @SideOnly(Side.CLIENT) + public void func_186812_a() + { + Arrays.fill(this.field_186818_b, (Object)null); diff --git a/patches_old/minecraft/net/minecraft/util/MouseHelper.java.patch b/patches_old/minecraft/net/minecraft/util/MouseHelper.java.patch new file mode 100644 index 000000000..9a1be0ea4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/MouseHelper.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/MouseHelper.java ++++ ../src-work/minecraft/net/minecraft/util/MouseHelper.java +@@ -13,6 +13,7 @@ + + public void func_74372_a() + { ++ if (Boolean.parseBoolean(System.getProperty("fml.noGrab","false"))) return; + Mouse.setGrabbed(true); + this.field_74377_a = 0; + this.field_74375_b = 0; diff --git a/patches_old/minecraft/net/minecraft/util/ScreenShotHelper.java.patch b/patches_old/minecraft/net/minecraft/util/ScreenShotHelper.java.patch new file mode 100644 index 000000000..33fd2b6e6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/ScreenShotHelper.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/util/ScreenShotHelper.java ++++ ../src-work/minecraft/net/minecraft/util/ScreenShotHelper.java +@@ -53,10 +53,14 @@ + file2 = new File(file1, p_148259_1_); + } + ++ file2 = file2.getCanonicalFile(); // FORGE: Fix errors on Windows with paths that include \.\ ++ net.minecraftforge.client.event.ScreenshotEvent event = net.minecraftforge.client.ForgeHooksClient.onScreenshot(bufferedimage, file2); ++ if (event.isCanceled()) return event.getCancelMessage(); else file2 = event.getScreenshotFile(); + ImageIO.write(bufferedimage, "png", file2); + ITextComponent itextcomponent = new TextComponentString(file2.getName()); + itextcomponent.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.OPEN_FILE, file2.getAbsolutePath())); + itextcomponent.func_150256_b().func_150228_d(Boolean.valueOf(true)); ++ if (event.getResultMessage() != null) return event.getResultMessage(); + return new TextComponentTranslation("screenshot.success", new Object[] {itextcomponent}); + } + catch (Exception exception) diff --git a/patches_old/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch b/patches_old/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch new file mode 100644 index 000000000..612d7d1ee --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/util/ServerRecipeBookHelper.java ++++ ../src-work/minecraft/net/minecraft/util/ServerRecipeBookHelper.java +@@ -55,6 +55,11 @@ + this.field_194335_f = ((ContainerPlayer)container).field_75179_f; + this.field_194336_g = ((ContainerPlayer)container).field_75181_e; + } ++ else if (container instanceof net.minecraftforge.common.crafting.IRecipeContainer) ++ { ++ this.field_194335_f = ((net.minecraftforge.common.crafting.IRecipeContainer)container).getCraftResult(); ++ this.field_194336_g = ((net.minecraftforge.common.crafting.IRecipeContainer)container).getCraftMatrix(); ++ } + + if (this.field_194335_f != null && this.field_194336_g != null) + { +@@ -199,11 +204,11 @@ + int i = this.field_194336_g.func_174922_i(); + int j = this.field_194336_g.func_174923_h(); + +- if (this.field_194333_d instanceof ShapedRecipes) ++ if (this.field_194333_d instanceof net.minecraftforge.common.crafting.IShapedRecipe) + { +- ShapedRecipes shapedrecipes = (ShapedRecipes)this.field_194333_d; +- i = shapedrecipes.func_192403_f(); +- j = shapedrecipes.func_192404_g(); ++ net.minecraftforge.common.crafting.IShapedRecipe shapedrecipes = (net.minecraftforge.common.crafting.IShapedRecipe)this.field_194333_d; ++ i = shapedrecipes.getRecipeWidth(); ++ j = shapedrecipes.getRecipeHeight(); + } + + int j1 = 1; diff --git a/patches_old/minecraft/net/minecraft/util/Session.java.patch b/patches_old/minecraft/net/minecraft/util/Session.java.patch new file mode 100644 index 000000000..83520cf67 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/Session.java.patch @@ -0,0 +1,60 @@ +--- ../src-base/minecraft/net/minecraft/util/Session.java ++++ ../src-work/minecraft/net/minecraft/util/Session.java +@@ -17,9 +17,25 @@ + private final String field_148257_b; + private final String field_148258_c; + private final Session.Type field_152429_d; ++ /** Forge: Cache of the local session's GameProfile properties. */ ++ private com.mojang.authlib.properties.PropertyMap properties; + + public Session(String p_i1098_1_, String p_i1098_2_, String p_i1098_3_, String p_i1098_4_) + { ++ if (p_i1098_1_ == null || p_i1098_1_.isEmpty()) ++ { ++ p_i1098_1_ = "MissingName"; ++ p_i1098_2_ = p_i1098_3_ = "NotValid"; ++ org.apache.logging.log4j.Logger logger = net.minecraftforge.fml.common.FMLLog.log; ++ logger.log(org.apache.logging.log4j.Level.WARN, "========================================================="); ++ logger.log(org.apache.logging.log4j.Level.WARN, "WARNING!! the username was not set for this session, typically"); ++ logger.log(org.apache.logging.log4j.Level.WARN, "this means you installed Forge incorrectly. We have set your"); ++ logger.log(org.apache.logging.log4j.Level.WARN, "name to \"MissingName\" and your session to nothing. Please"); ++ logger.log(org.apache.logging.log4j.Level.WARN, "check your installation and post a console log from the launcher"); ++ logger.log(org.apache.logging.log4j.Level.WARN, "when asking for help!"); ++ logger.log(org.apache.logging.log4j.Level.WARN, "========================================================="); ++ } ++ + this.field_74286_b = p_i1098_1_; + this.field_148257_b = p_i1098_2_; + this.field_148258_c = p_i1098_3_; +@@ -51,14 +67,29 @@ + try + { + UUID uuid = UUIDTypeAdapter.fromString(this.func_148255_b()); +- return new GameProfile(uuid, this.func_111285_a()); ++ GameProfile ret = new GameProfile(uuid, this.func_111285_a()); //Forge: Adds cached GameProfile properties to returned GameProfile. ++ if (properties != null) ret.getProperties().putAll(properties); // Helps to cut down on calls to the session service, ++ return ret; // which helps to fix MC-52974. + } + catch (IllegalArgumentException var2) + { +- return new GameProfile((UUID)null, this.func_111285_a()); ++ return new GameProfile(net.minecraft.entity.player.EntityPlayer.func_146094_a(new GameProfile((UUID)null, this.func_111285_a())), this.func_111285_a()); + } + } + ++ /* ======================================== 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_old/minecraft/net/minecraft/util/SoundEvent.java.patch b/patches_old/minecraft/net/minecraft/util/SoundEvent.java.patch new file mode 100644 index 000000000..e1970495c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/SoundEvent.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/util/SoundEvent.java ++++ ../src-work/minecraft/net/minecraft/util/SoundEvent.java +@@ -4,9 +4,9 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-public class SoundEvent ++public class SoundEvent extends net.minecraftforge.registries.IForgeRegistryEntry.Impl + { +- public static final RegistryNamespaced field_187505_a = new RegistryNamespaced(); ++ public static final RegistryNamespaced field_187505_a = net.minecraftforge.registries.GameData.getWrapper(SoundEvent.class); + private final ResourceLocation field_187506_b; + private static int field_187507_c; + diff --git a/patches_old/minecraft/net/minecraft/util/TabCompleter.java.patch b/patches_old/minecraft/net/minecraft/util/TabCompleter.java.patch new file mode 100644 index 000000000..381309b8f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/TabCompleter.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/util/TabCompleter.java ++++ ../src-work/minecraft/net/minecraft/util/TabCompleter.java +@@ -55,13 +55,14 @@ + this.field_186844_a.func_146175_b(i - this.field_186844_a.func_146198_h()); + } + +- this.field_186844_a.func_146191_b(this.field_186849_f.get(this.field_186848_e++)); ++ this.field_186844_a.func_146191_b(net.minecraft.util.text.TextFormatting.func_110646_a(this.field_186849_f.get(this.field_186848_e++))); + } + + private void func_186838_a(String p_186838_1_) + { + if (p_186838_1_.length() >= 1) + { ++ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_186838_1_); + Minecraft.func_71410_x().field_71439_g.field_71174_a.func_147297_a(new CPacketTabComplete(p_186838_1_, this.func_186839_b(), this.field_186845_b)); + this.field_186847_d = true; + } +@@ -77,6 +78,12 @@ + this.field_186846_c = false; + this.field_186849_f.clear(); + ++ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; ++ if (complete != null) ++ { ++ p_186840_1_ = com.google.common.collect.ObjectArrays.concat(complete, p_186840_1_, String.class); ++ } ++ + for (String s : p_186840_1_) + { + if (!s.isEmpty()) +@@ -87,6 +94,7 @@ + + String s1 = this.field_186844_a.func_146179_b().substring(this.field_186844_a.func_146197_a(-1, this.field_186844_a.func_146198_h(), false)); + String s2 = org.apache.commons.lang3.StringUtils.getCommonPrefix(p_186840_1_); ++ s2 = net.minecraft.util.text.TextFormatting.func_110646_a(s2); + + if (!s2.isEmpty() && !s1.equalsIgnoreCase(s2)) + { diff --git a/patches_old/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch b/patches_old/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch new file mode 100644 index 000000000..df0831665 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/datafix/DataFixesManager.java ++++ ../src-work/minecraft/net/minecraft/util/datafix/DataFixesManager.java +@@ -165,6 +165,7 @@ + public static DataFixer func_188279_a() + { + DataFixer datafixer = new DataFixer(1343); ++ datafixer = new net.minecraftforge.common.util.CompoundDataFixer(datafixer); + WorldInfo.func_189967_a(datafixer); + EntityPlayerMP.func_191522_a(datafixer); + EntityPlayer.func_189806_a(datafixer); diff --git a/patches_old/minecraft/net/minecraft/util/math/RayTraceResult.java.patch b/patches_old/minecraft/net/minecraft/util/math/RayTraceResult.java.patch new file mode 100644 index 000000000..907251546 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/math/RayTraceResult.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/util/math/RayTraceResult.java ++++ ../src-work/minecraft/net/minecraft/util/math/RayTraceResult.java +@@ -5,6 +5,12 @@ + + public class RayTraceResult + { ++ /** Used to determine what sub-segment is hit */ ++ public int subHit = -1; ++ ++ /** Used to add extra hit info */ ++ public Object hitInfo = null; ++ + private BlockPos field_178783_e; + public RayTraceResult.Type field_72313_a; + public EnumFacing field_178784_b; diff --git a/patches_old/minecraft/net/minecraft/util/math/Vec3d.java.patch b/patches_old/minecraft/net/minecraft/util/math/Vec3d.java.patch new file mode 100644 index 000000000..f01939a01 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/math/Vec3d.java.patch @@ -0,0 +1,42 @@ +--- ../src-base/minecraft/net/minecraft/util/math/Vec3d.java ++++ ../src-work/minecraft/net/minecraft/util/math/Vec3d.java +@@ -1,9 +1,6 @@ + package net.minecraft.util.math; + + import javax.annotation.Nullable; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; +- + public class Vec3d + { + public static final Vec3d field_186680_a = new Vec3d(0.0D, 0.0D, 0.0D); +@@ -54,7 +51,6 @@ + return this.field_72450_a * p_72430_1_.field_72450_a + this.field_72448_b * p_72430_1_.field_72448_b + this.field_72449_c * p_72430_1_.field_72449_c; + } + +- @SideOnly(Side.CLIENT) + public Vec3d func_72431_c(Vec3d p_72431_1_) + { + return new Vec3d(this.field_72448_b * p_72431_1_.field_72449_c - this.field_72449_c * p_72431_1_.field_72448_b, this.field_72449_c * p_72431_1_.field_72450_a - this.field_72450_a * p_72431_1_.field_72449_c, this.field_72450_a * p_72431_1_.field_72448_b - this.field_72448_b * p_72431_1_.field_72450_a); +@@ -114,7 +110,6 @@ + return (double)MathHelper.func_76133_a(this.field_72450_a * this.field_72450_a + this.field_72448_b * this.field_72448_b + this.field_72449_c * this.field_72449_c); + } + +- @SideOnly(Side.CLIENT) + public double func_189985_c() + { + return this.field_72450_a * this.field_72450_a + this.field_72448_b * this.field_72448_b + this.field_72449_c * this.field_72449_c; +@@ -239,13 +234,11 @@ + return new Vec3d(d0, d1, d2); + } + +- @SideOnly(Side.CLIENT) + public static Vec3d func_189984_a(Vec2f p_189984_0_) + { + return func_189986_a(p_189984_0_.field_189982_i, p_189984_0_.field_189983_j); + } + +- @SideOnly(Side.CLIENT) + public static Vec3d func_189986_a(float p_189986_0_, float p_189986_1_) + { + float f = MathHelper.func_76134_b(-p_189986_1_ * 0.017453292F - (float)Math.PI); diff --git a/patches_old/minecraft/net/minecraft/util/text/ITextComponent.java.patch b/patches_old/minecraft/net/minecraft/util/text/ITextComponent.java.patch new file mode 100644 index 000000000..34da23c67 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/text/ITextComponent.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/text/ITextComponent.java ++++ ../src-work/minecraft/net/minecraft/util/text/ITextComponent.java +@@ -34,7 +34,6 @@ + + String func_150260_c(); + +- @SideOnly(Side.CLIENT) + String func_150254_d(); + + List func_150253_a(); diff --git a/patches_old/minecraft/net/minecraft/util/text/Style.java.patch b/patches_old/minecraft/net/minecraft/util/text/Style.java.patch new file mode 100644 index 000000000..2aa70dad9 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/text/Style.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/text/Style.java ++++ ../src-work/minecraft/net/minecraft/util/text/Style.java +@@ -238,7 +238,6 @@ + return this; + } + +- @SideOnly(Side.CLIENT) + public String func_150218_j() + { + if (this.func_150229_g()) diff --git a/patches_old/minecraft/net/minecraft/util/text/TextComponentBase.java.patch b/patches_old/minecraft/net/minecraft/util/text/TextComponentBase.java.patch new file mode 100644 index 000000000..41d3f8c38 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/text/TextComponentBase.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/text/TextComponentBase.java ++++ ../src-work/minecraft/net/minecraft/util/text/TextComponentBase.java +@@ -75,7 +75,6 @@ + return stringbuilder.toString(); + } + +- @SideOnly(Side.CLIENT) + public final String func_150254_d() + { + StringBuilder stringbuilder = new StringBuilder(); diff --git a/patches_old/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch b/patches_old/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch new file mode 100644 index 000000000..841728247 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch @@ -0,0 +1,54 @@ +--- ../src-base/minecraft/net/minecraft/util/text/translation/LanguageMap.java ++++ ../src-work/minecraft/net/minecraft/util/text/translation/LanguageMap.java +@@ -23,9 +23,29 @@ + + public LanguageMap() + { ++ InputStream inputstream = LanguageMap.class.getResourceAsStream("/assets/minecraft/lang/en_us.lang"); ++ inject(this, inputstream); ++ } ++ ++ public static void inject(InputStream inputstream) ++ { ++ inject(field_74817_a, inputstream); ++ } ++ ++ private static void inject(LanguageMap inst, InputStream inputstream) ++ { ++ Map map = parseLangFile(inputstream); ++ inst.field_74816_c.putAll(map); ++ inst.field_150511_e = System.currentTimeMillis(); ++ } ++ ++ public static Map parseLangFile(InputStream inputstream) ++ { ++ Map table = Maps.newHashMap(); + try + { +- InputStream inputstream = LanguageMap.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, StandardCharsets.UTF_8)) + { +@@ -37,17 +57,18 @@ + { + String s1 = astring[0]; + String s2 = field_111053_a.matcher(astring[1]).replaceAll("%$1s"); +- this.field_74816_c.put(s1, s2); ++ table.put(s1, s2); + } + } + } + +- this.field_150511_e = System.currentTimeMillis(); + } + catch (IOException var7) + { + ; + } ++ catch (Exception ex) {} ++ return table; + } + + static LanguageMap func_74808_a() diff --git a/patches_old/minecraft/net/minecraft/village/Village.java.patch b/patches_old/minecraft/net/minecraft/village/Village.java.patch new file mode 100644 index 000000000..b435446fb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/village/Village.java.patch @@ -0,0 +1,209 @@ +--- ../src-base/minecraft/net/minecraft/village/Village.java ++++ ../src-work/minecraft/net/minecraft/village/Village.java +@@ -26,7 +26,7 @@ + import net.minecraft.util.math.Vec3d; + import net.minecraft.world.World; + +-public class Village ++public class Village implements net.minecraftforge.common.capabilities.ICapabilitySerializable + { + private World field_75586_a; + private final List field_75584_b = Lists.newArrayList(); +@@ -37,17 +37,19 @@ + private int field_75581_g; + private int field_75588_h; + private int field_82694_i; +- private final Map field_82693_j = Maps.newHashMap(); ++ private final Map field_82693_j = Maps.newHashMap(); + private final List field_75589_i = Lists.newArrayList(); + private int field_75587_j; + + public Village() + { ++ this.capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); + } + + public Village(World p_i1675_1_) + { + this.field_75586_a = p_i1675_1_; ++ this.capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); + } + + public void func_82691_a(World p_82691_1_) +@@ -310,11 +312,11 @@ + double d0 = Double.MAX_VALUE; + EntityPlayer entityplayer = null; + +- for (String s : this.field_82693_j.keySet()) ++ for (UUID s : this.field_82693_j.keySet()) + { +- if (this.func_82687_d(s)) ++ if (this.isPlayerReputationTooLow(s)) + { +- EntityPlayer entityplayer1 = this.field_75586_a.func_72924_a(s); ++ EntityPlayer entityplayer1 = this.field_75586_a.func_152378_a(s); + + if (entityplayer1 != null) + { +@@ -362,6 +364,7 @@ + villagedoorinfo.func_75466_d(); + } + ++ if (field_75586_a.func_175667_e(villagedoorinfo.func_179852_d())) // Forge: check that the door block is loaded to avoid loading chunks + if (!this.func_179860_f(villagedoorinfo.func_179852_d()) || Math.abs(this.field_75581_g - villagedoorinfo.func_75473_b()) > 1200) + { + this.field_75585_c = this.field_75585_c.func_177973_b(villagedoorinfo.func_179852_d()); +@@ -415,25 +418,51 @@ + } + } + ++ @Deprecated //Hasn't worked since 1.9, use UUID version below. + public int func_82684_a(String p_82684_1_) + { ++ return this.getPlayerReputation(findUUID(p_82684_1_)); ++ } ++ ++ public int getPlayerReputation(UUID p_82684_1_) ++ { + Integer integer = this.field_82693_j.get(p_82684_1_); + return integer == null ? 0 : integer.intValue(); + } + ++ private UUID findUUID(String name) ++ { ++ if (this.field_75586_a == null || this.field_75586_a.func_73046_m() == null) ++ return EntityPlayer.func_175147_b(name); ++ GameProfile profile = this.field_75586_a.func_73046_m().func_152358_ax().func_152655_a(name); ++ return profile == null ? EntityPlayer.func_175147_b(name) : profile.getId(); ++ } ++ ++ @Deprecated //Hasn't worked since 1.9, use UUID version below. + public int func_82688_a(String p_82688_1_, int p_82688_2_) + { +- int i = this.func_82684_a(p_82688_1_); ++ return this.modifyPlayerReputation(findUUID(p_82688_1_), p_82688_2_); ++ } ++ ++ public int modifyPlayerReputation(UUID p_82688_1_, int p_82688_2_) ++ { ++ int i = this.getPlayerReputation(p_82688_1_); + int j = MathHelper.func_76125_a(i + p_82688_2_, -30, 10); + this.field_82693_j.put(p_82688_1_, Integer.valueOf(j)); + return j; + } + ++ @Deprecated //Hasn't worked since 1.9, use UUID version below. + public boolean func_82687_d(String p_82687_1_) + { +- return this.func_82684_a(p_82687_1_) <= -15; ++ return this.isPlayerReputationTooLow(findUUID(p_82687_1_)); + } + ++ public boolean isPlayerReputationTooLow(UUID uuid) ++ { ++ return this.getPlayerReputation(uuid) <= -15; ++ } ++ + public void func_82690_a(NBTTagCompound p_82690_1_) + { + this.field_75588_h = p_82690_1_.func_74762_e("PopSize"); +@@ -459,21 +488,17 @@ + { + NBTTagCompound nbttagcompound1 = nbttaglist1.func_150305_b(j); + +- if (nbttagcompound1.func_74764_b("UUID") && this.field_75586_a != null && this.field_75586_a.func_73046_m() != null) ++ if (nbttagcompound1.func_74764_b("UUID")) + { +- PlayerProfileCache playerprofilecache = this.field_75586_a.func_73046_m().func_152358_ax(); +- GameProfile gameprofile = playerprofilecache.func_152652_a(UUID.fromString(nbttagcompound1.func_74779_i("UUID"))); +- +- if (gameprofile != null) +- { +- this.field_82693_j.put(gameprofile.getName(), Integer.valueOf(nbttagcompound1.func_74762_e("S"))); +- } ++ this.field_82693_j.put(UUID.fromString(nbttagcompound1.func_74779_i("UUID")), Integer.valueOf(nbttagcompound1.func_74762_e("S"))); + } + else + { +- this.field_82693_j.put(nbttagcompound1.func_74779_i("Name"), Integer.valueOf(nbttagcompound1.func_74762_e("S"))); ++ //World is never set here, so this will always be offline UUIDs, sadly there is no way to convert this. ++ this.field_82693_j.put(findUUID(nbttagcompound1.func_74779_i("Name")), Integer.valueOf(nbttagcompound1.func_74762_e("S"))); + } + } ++ if (this.capabilities != null && p_82690_1_.func_74764_b("ForgeCaps")) this.capabilities.deserializeNBT(p_82690_1_.func_74775_l("ForgeCaps")); + } + + public void func_82689_b(NBTTagCompound p_82689_1_) +@@ -507,18 +532,14 @@ + p_82689_1_.func_74782_a("Doors", nbttaglist); + NBTTagList nbttaglist1 = new NBTTagList(); + +- for (String s : this.field_82693_j.keySet()) ++ for (UUID s : this.field_82693_j.keySet()) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); +- PlayerProfileCache playerprofilecache = this.field_75586_a.func_73046_m().func_152358_ax(); + + try + { +- GameProfile gameprofile = playerprofilecache.func_152655_a(s); +- +- if (gameprofile != null) + { +- nbttagcompound1.func_74778_a("UUID", gameprofile.getId().toString()); ++ nbttagcompound1.func_74778_a("UUID", s.toString()); + nbttagcompound1.func_74768_a("S", ((Integer)this.field_82693_j.get(s)).intValue()); + nbttaglist1.func_74742_a(nbttagcompound1); + } +@@ -530,6 +551,7 @@ + } + + p_82689_1_.func_74782_a("Players", nbttaglist1); ++ if (this.capabilities != null) p_82689_1_.func_74782_a("ForgeCaps", this.capabilities.serializeNBT()); + } + + public void func_82692_h() +@@ -544,9 +566,9 @@ + + public void func_82683_b(int p_82683_1_) + { +- for (String s : this.field_82693_j.keySet()) ++ for (UUID s : this.field_82693_j.keySet()) + { +- this.func_82688_a(s, p_82683_1_); ++ this.modifyPlayerReputation(s, p_82683_1_); + } + } + +@@ -561,4 +583,31 @@ + this.field_75590_b = p_i1674_3_; + } + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capabilities == null ? false : capabilities.hasCapability(capability, facing); ++ } ++ ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) ++ { ++ return capabilities == null ? null : capabilities.getCapability(capability, facing); ++ } ++ ++ public void deserializeNBT(NBTTagCompound nbt) ++ { ++ this.func_82690_a(nbt);; ++ } ++ ++ public NBTTagCompound serializeNBT() ++ { ++ NBTTagCompound ret = new NBTTagCompound(); ++ this.func_82689_b(ret); ++ return ret; ++ } ++ ++ /* ========================================= FORGE END ======================================*/ + } diff --git a/patches_old/minecraft/net/minecraft/village/VillageCollection.java.patch b/patches_old/minecraft/net/minecraft/village/VillageCollection.java.patch new file mode 100644 index 000000000..41811b9f4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/village/VillageCollection.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/village/VillageCollection.java ++++ ../src-work/minecraft/net/minecraft/village/VillageCollection.java +@@ -151,6 +151,7 @@ + + private void func_180609_b(BlockPos p_180609_1_) + { ++ if (!this.field_75556_a.func_175697_a(p_180609_1_, 16)) return; // Forge: prevent loading unloaded chunks when checking for doors + int i = 16; + int j = 4; + int k = 16; diff --git a/patches_old/minecraft/net/minecraft/world/BossInfo.java.patch b/patches_old/minecraft/net/minecraft/world/BossInfo.java.patch new file mode 100644 index 000000000..447890e81 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/BossInfo.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/world/BossInfo.java ++++ ../src-work/minecraft/net/minecraft/world/BossInfo.java +@@ -2,8 +2,6 @@ + + import java.util.UUID; + import net.minecraft.util.text.ITextComponent; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + + public abstract class BossInfo + { +@@ -55,7 +53,6 @@ + return this.field_186751_c; + } + +- @SideOnly(Side.CLIENT) + public void func_186745_a(BossInfo.Color p_186745_1_) + { + this.field_186751_c = p_186745_1_; +@@ -66,7 +63,6 @@ + return this.field_186752_d; + } + +- @SideOnly(Side.CLIENT) + public void func_186746_a(BossInfo.Overlay p_186746_1_) + { + this.field_186752_d = p_186746_1_; diff --git a/patches_old/minecraft/net/minecraft/world/BossInfoServer.java.patch b/patches_old/minecraft/net/minecraft/world/BossInfoServer.java.patch new file mode 100644 index 000000000..d9e3ba034 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/BossInfoServer.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/world/BossInfoServer.java ++++ ../src-work/minecraft/net/minecraft/world/BossInfoServer.java +@@ -9,8 +9,6 @@ + import net.minecraft.network.play.server.SPacketUpdateBossInfo; + import net.minecraft.util.math.MathHelper; + import net.minecraft.util.text.ITextComponent; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + + public class BossInfoServer extends BossInfo + { +@@ -34,7 +32,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public void func_186745_a(BossInfo.Color p_186745_1_) + { + if (p_186745_1_ != this.field_186751_c) +@@ -44,7 +41,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public void func_186746_a(BossInfo.Overlay p_186746_1_) + { + if (p_186746_1_ != this.field_186752_d) diff --git a/patches_old/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches_old/minecraft/net/minecraft/world/ChunkCache.java.patch new file mode 100644 index 000000000..fce0bcdfa --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/ChunkCache.java.patch @@ -0,0 +1,75 @@ +--- ../src-base/minecraft/net/minecraft/world/ChunkCache.java ++++ ../src-work/minecraft/net/minecraft/world/ChunkCache.java +@@ -61,7 +61,7 @@ + @Nullable + public TileEntity func_175625_s(BlockPos p_175625_1_) + { +- return this.func_190300_a(p_175625_1_, Chunk.EnumCreateEntityType.IMMEDIATE); ++ return this.func_190300_a(p_175625_1_, Chunk.EnumCreateEntityType.CHECK); // Forge: don't modify world from other threads + } + + @Nullable +@@ -69,6 +69,7 @@ + { + int i = (p_190300_1_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_190300_1_.func_177952_p() >> 4) - this.field_72816_b; ++ if (!withinBounds(i, j)) return null; + return this.field_72817_c[i][j].func_177424_a(p_190300_1_, p_190300_2_); + } + +@@ -112,6 +113,7 @@ + { + int i = (p_180494_1_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_180494_1_.func_177952_p() >> 4) - this.field_72816_b; ++ if (!withinBounds(i, j)) return net.minecraft.init.Biomes.field_76772_c; + return this.field_72817_c[i][j].func_177411_a(p_180494_1_, this.field_72815_e.func_72959_q()); + } + +@@ -149,6 +151,7 @@ + { + int i = (p_175629_2_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_175629_2_.func_177952_p() >> 4) - this.field_72816_b; ++ if (!withinBounds(i, j)) return p_175629_1_.field_77198_c; + return this.field_72817_c[i][j].func_177413_a(p_175629_1_, p_175629_2_); + } + } +@@ -160,7 +163,8 @@ + + public boolean func_175623_d(BlockPos p_175623_1_) + { +- return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a; ++ IBlockState state = this.func_180495_p(p_175623_1_); ++ return state.func_177230_c().isAir(state, this, p_175623_1_); + } + + @SideOnly(Side.CLIENT) +@@ -170,6 +174,7 @@ + { + int i = (p_175628_2_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_175628_2_.func_177952_p() >> 4) - this.field_72816_b; ++ if (!withinBounds(i, j)) return p_175628_1_.field_77198_c; + return this.field_72817_c[i][j].func_177413_a(p_175628_1_, p_175628_2_); + } + else +@@ -188,4 +193,21 @@ + { + return this.field_72815_e.func_175624_G(); + } ++ ++ @Override ++ public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) ++ { ++ int x = (pos.func_177958_n() >> 4) - this.field_72818_a; ++ int z = (pos.func_177952_p() >> 4) - this.field_72816_b; ++ if (pos.func_177956_o() < 0 || pos.func_177956_o() >= 256) return _default; ++ if (!withinBounds(x, z)) return _default; ++ ++ IBlockState state = func_180495_p(pos); ++ return state.func_177230_c().isSideSolid(state, this, pos, side); ++ } ++ ++ private boolean withinBounds(int x, int z) ++ { ++ return x >= 0 && x < field_72817_c.length && z >= 0 && z < field_72817_c[x].length && field_72817_c[x][z] != null; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/DimensionType.java.patch b/patches_old/minecraft/net/minecraft/world/DimensionType.java.patch new file mode 100644 index 000000000..06d76f880 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/DimensionType.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/world/DimensionType.java ++++ ../src-work/minecraft/net/minecraft/world/DimensionType.java +@@ -13,6 +13,7 @@ + private final String field_186075_e; + private final String field_186076_f; + private final Class field_186077_g; ++ private boolean shouldLoadSpawn = false; + + private DimensionType(int p_i46672_3_, String p_i46672_4_, String p_i46672_5_, Class p_i46672_6_) + { +@@ -20,6 +21,7 @@ + this.field_186075_e = p_i46672_4_; + this.field_186076_f = p_i46672_5_; + this.field_186077_g = p_i46672_6_; ++ this.shouldLoadSpawn = p_i46672_3_ == 0; + } + + public int func_186068_a() +@@ -75,6 +77,20 @@ + throw new IllegalArgumentException("Invalid dimension id " + p_186069_0_); + } + ++ public boolean shouldLoadSpawn(){ return this.shouldLoadSpawn; } ++ public DimensionType setLoadSpawn(boolean value) { this.shouldLoadSpawn = value; return this; } ++ ++ private static Class[] ENUM_ARGS = {int.class, String.class, String.class, Class.class}; ++ static { net.minecraftforge.common.util.EnumHelper.testEnum(DimensionType.class, ENUM_ARGS); } ++ public static DimensionType register(String name, String suffix, int id, Class provider, boolean keepLoaded) ++ { ++ String enum_name = name.replace(" ", "_").toLowerCase(); ++ DimensionType ret = net.minecraftforge.common.util.EnumHelper.addEnum(DimensionType.class, enum_name, ENUM_ARGS, ++ id, name, suffix, provider); ++ return ret.setLoadSpawn(keepLoaded); ++ } ++ //TODO: Unregister? There is no way to really delete a enum value... ++ + public static DimensionType func_193417_a(String p_193417_0_) + { + for (DimensionType dimensiontype : values()) diff --git a/patches_old/minecraft/net/minecraft/world/Explosion.java.patch b/patches_old/minecraft/net/minecraft/world/Explosion.java.patch new file mode 100644 index 000000000..82f20efd5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/Explosion.java.patch @@ -0,0 +1,52 @@ +--- ../src-base/minecraft/net/minecraft/world/Explosion.java ++++ ../src-work/minecraft/net/minecraft/world/Explosion.java +@@ -41,6 +41,7 @@ + private final float field_77280_f; + private final List field_77281_g; + private final Map field_77288_k; ++ private final Vec3d position; + + @SideOnly(Side.CLIENT) + public Explosion(World p_i45752_1_, Entity p_i45752_2_, double p_i45752_3_, double p_i45752_5_, double p_i45752_7_, float p_i45752_9_, List p_i45752_10_) +@@ -68,6 +69,7 @@ + this.field_77282_d = p_i45754_7_; + this.field_77286_a = p_i45754_10_; + this.field_82755_b = p_i45754_11_; ++ this.position = new Vec3d(this.field_77284_b, this.field_77285_c, this.field_77282_d); + } + + public void func_77278_a() +@@ -102,7 +104,7 @@ + + if (iblockstate.func_185904_a() != Material.field_151579_a) + { +- float f2 = this.field_77283_e != null ? this.field_77283_e.func_180428_a(this, this.field_77287_j, blockpos, iblockstate) : iblockstate.func_177230_c().func_149638_a((Entity)null); ++ float f2 = this.field_77283_e != null ? this.field_77283_e.func_180428_a(this, this.field_77287_j, blockpos, iblockstate) : iblockstate.func_177230_c().getExplosionResistance(field_77287_j, blockpos, (Entity)null, this); + f -= (f2 + 0.3F) * 0.3F; + } + +@@ -129,6 +131,7 @@ + int j2 = MathHelper.func_76128_c(this.field_77282_d - (double)f3 - 1.0D); + int j1 = MathHelper.func_76128_c(this.field_77282_d + (double)f3 + 1.0D); + List list = this.field_77287_j.func_72839_b(this.field_77283_e, new AxisAlignedBB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); ++ net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.field_77287_j, this, list, f3); + Vec3d vec3d = new Vec3d(this.field_77284_b, this.field_77285_c, this.field_77282_d); + + for (int k2 = 0; k2 < list.size(); ++k2) +@@ -228,8 +231,7 @@ + block.func_180653_a(this.field_77287_j, blockpos, this.field_77287_j.func_180495_p(blockpos), 1.0F / this.field_77280_f, 0); + } + +- this.field_77287_j.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 3); +- block.func_180652_a(this.field_77287_j, blockpos, this); ++ block.onBlockExploded(this.field_77287_j, blockpos, this); + } + } + } +@@ -277,4 +279,6 @@ + { + return this.field_77281_g; + } ++ ++ public Vec3d getPosition(){ return this.position; } + } diff --git a/patches_old/minecraft/net/minecraft/world/IBlockAccess.java.patch b/patches_old/minecraft/net/minecraft/world/IBlockAccess.java.patch new file mode 100644 index 000000000..068be9ed2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/IBlockAccess.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/world/IBlockAccess.java ++++ ../src-work/minecraft/net/minecraft/world/IBlockAccess.java +@@ -28,4 +28,14 @@ + + @SideOnly(Side.CLIENT) + WorldType func_175624_G(); ++ ++ /** ++ * FORGE: isSideSolid, pulled up from {@link World} ++ * ++ * @param pos Position ++ * @param side Side ++ * @param _default default return value ++ * @return if the block is solid on the side ++ */ ++ boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default); + } diff --git a/patches_old/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch b/patches_old/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch new file mode 100644 index 000000000..f67ef2483 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/world/ServerWorldEventHandler.java ++++ ../src-work/minecraft/net/minecraft/world/ServerWorldEventHandler.java +@@ -55,7 +55,7 @@ + + public void func_184375_a(@Nullable EntityPlayer p_184375_1_, SoundEvent p_184375_2_, SoundCategory p_184375_3_, double p_184375_4_, double p_184375_6_, double p_184375_8_, float p_184375_10_, float p_184375_11_) + { +- this.field_72783_a.func_184103_al().func_148543_a(p_184375_1_, p_184375_4_, p_184375_6_, p_184375_8_, p_184375_10_ > 1.0F ? (double)(16.0F * p_184375_10_) : 16.0D, this.field_72782_b.field_73011_w.func_186058_p().func_186068_a(), new SPacketSoundEffect(p_184375_2_, p_184375_3_, p_184375_4_, p_184375_6_, p_184375_8_, p_184375_10_, p_184375_11_)); ++ this.field_72783_a.func_184103_al().func_148543_a(p_184375_1_, p_184375_4_, p_184375_6_, p_184375_8_, p_184375_10_ > 1.0F ? (double)(16.0F * p_184375_10_) : 16.0D, this.field_72782_b.field_73011_w.getDimension(), new SPacketSoundEffect(p_184375_2_, p_184375_3_, p_184375_4_, p_184375_6_, p_184375_8_, p_184375_10_, p_184375_11_)); + } + + public void func_147585_a(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) +@@ -77,7 +77,7 @@ + + public void func_180439_a(EntityPlayer p_180439_1_, int p_180439_2_, BlockPos p_180439_3_, int p_180439_4_) + { +- this.field_72783_a.func_184103_al().func_148543_a(p_180439_1_, (double)p_180439_3_.func_177958_n(), (double)p_180439_3_.func_177956_o(), (double)p_180439_3_.func_177952_p(), 64.0D, this.field_72782_b.field_73011_w.func_186058_p().func_186068_a(), new SPacketEffect(p_180439_2_, p_180439_3_, p_180439_4_, false)); ++ this.field_72783_a.func_184103_al().func_148543_a(p_180439_1_, (double)p_180439_3_.func_177958_n(), (double)p_180439_3_.func_177956_o(), (double)p_180439_3_.func_177952_p(), 64.0D, this.field_72782_b.field_73011_w.getDimension(), new SPacketEffect(p_180439_2_, p_180439_3_, p_180439_4_, false)); + } + + public void func_180440_a(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) diff --git a/patches_old/minecraft/net/minecraft/world/Teleporter.java.patch b/patches_old/minecraft/net/minecraft/world/Teleporter.java.patch new file mode 100644 index 000000000..8b5983a4d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/Teleporter.java.patch @@ -0,0 +1,25 @@ +--- ../src-base/minecraft/net/minecraft/world/Teleporter.java ++++ ../src-work/minecraft/net/minecraft/world/Teleporter.java +@@ -15,7 +15,7 @@ + import net.minecraft.util.math.ChunkPos; + import net.minecraft.util.math.MathHelper; + +-public class Teleporter ++public class Teleporter implements net.minecraftforge.common.util.ITeleporter + { + protected final WorldServer field_85192_a; + protected final Random field_77187_a; +@@ -428,4 +428,13 @@ + this.field_85087_d = p_i45747_3_; + } + } ++ ++ @Override ++ public void placeEntity(World world, Entity entity, float yaw) ++ { ++ if (entity instanceof EntityPlayerMP) ++ func_180266_a(entity, yaw); ++ else ++ func_180620_b(entity, yaw); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/World.java.patch b/patches_old/minecraft/net/minecraft/world/World.java.patch new file mode 100644 index 000000000..1757acc9e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/World.java.patch @@ -0,0 +1,1153 @@ +--- ../src-base/minecraft/net/minecraft/world/World.java ++++ ../src-work/minecraft/net/minecraft/world/World.java +@@ -63,8 +63,15 @@ + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-public abstract class World implements IBlockAccess ++public abstract class World implements IBlockAccess, net.minecraftforge.common.capabilities.ICapabilityProvider + { ++ /** ++ * Used in the getEntitiesWithinAABB functions to expand the search area for entities. ++ * Modders should change this variable to a higher value if it is less then the radius ++ * of one of there entities. ++ */ ++ public static double MAX_ENTITY_RADIUS = 2.0D; ++ + private int field_181546_a = 63; + protected boolean field_72999_e; + public final List field_72996_f = Lists.newArrayList(); +@@ -108,6 +115,12 @@ + private final WorldBorder field_175728_M; + int[] field_72994_J; + ++ public boolean restoringBlockSnapshots = false; ++ public boolean captureBlockSnapshots = false; ++ public java.util.ArrayList capturedBlockSnapshots = new java.util.ArrayList(); ++ private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; ++ private net.minecraftforge.common.util.WorldCapabilityData capabilityData; ++ + protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, WorldProvider p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) + { + this.field_73021_x = Lists.newArrayList(this.field_184152_t); +@@ -122,6 +135,7 @@ + this.field_73011_w = p_i45749_3_; + this.field_72995_K = p_i45749_5_; + this.field_175728_M = p_i45749_3_.func_177501_r(); ++ perWorldStorage = new MapStorage((ISaveHandler)null); + } + + public World func_175643_b() +@@ -131,6 +145,11 @@ + + public Biome func_180494_b(final BlockPos p_180494_1_) + { ++ return this.field_73011_w.getBiomeForCoords(p_180494_1_); ++ } ++ ++ public Biome getBiomeForCoordsBody(final BlockPos p_180494_1_) ++ { + if (this.func_175667_e(p_180494_1_)) + { + Chunk chunk = this.func_175726_f(p_180494_1_); +@@ -207,7 +226,7 @@ + + public boolean func_175623_d(BlockPos p_175623_1_) + { +- return this.func_180495_p(p_175623_1_).func_185904_a() == Material.field_151579_a; ++ return this.func_180495_p(p_175623_1_).func_177230_c().isAir(this.func_180495_p(p_175623_1_), this, p_175623_1_); + } + + public boolean func_175667_e(BlockPos p_175667_1_) +@@ -308,24 +327,51 @@ + else + { + Chunk chunk = this.func_175726_f(p_180501_1_); +- Block block = p_180501_2_.func_177230_c(); ++ ++ p_180501_1_ = p_180501_1_.func_185334_h(); // Forge - prevent mutable BlockPos leaks ++ net.minecraftforge.common.util.BlockSnapshot blockSnapshot = null; ++ if (this.captureBlockSnapshots && !this.field_72995_K) ++ { ++ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, p_180501_1_, p_180501_3_); ++ this.capturedBlockSnapshots.add(blockSnapshot); ++ } ++ IBlockState oldState = func_180495_p(p_180501_1_); ++ int oldLight = oldState.getLightValue(this, p_180501_1_); ++ int oldOpacity = oldState.getLightOpacity(this, p_180501_1_); ++ + IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_); + + if (iblockstate == null) + { ++ if (blockSnapshot != null) this.capturedBlockSnapshots.remove(blockSnapshot); + return false; + } + else + { +- if (p_180501_2_.func_185891_c() != iblockstate.func_185891_c() || p_180501_2_.func_185906_d() != iblockstate.func_185906_d()) ++ if (p_180501_2_.getLightOpacity(this, p_180501_1_) != oldOpacity || p_180501_2_.getLightValue(this, p_180501_1_) != oldLight) + { + this.field_72984_F.func_76320_a("checkLight"); + this.func_175664_x(p_180501_1_); + this.field_72984_F.func_76319_b(); + } + +- if ((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) ++ if (blockSnapshot == null) // Don't notify clients or update physics while capturing blockstates + { ++ this.markAndNotifyBlock(p_180501_1_, chunk, iblockstate, p_180501_2_, p_180501_3_); ++ } ++ return true; ++ } ++ } ++ } ++ ++ // Split off from original setBlockState(BlockPos, IBlockState, int) method in order to directly send client and physic updates ++ public void markAndNotifyBlock(BlockPos p_180501_1_, @Nullable Chunk chunk, IBlockState iblockstate, IBlockState p_180501_2_, int p_180501_3_) ++ { ++ Block block = p_180501_2_.func_177230_c(); ++ { ++ { ++ if ((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && (chunk == null || chunk.func_150802_k())) ++ { + this.func_184138_a(p_180501_1_, iblockstate, p_180501_2_, p_180501_3_); + } + +@@ -342,8 +388,6 @@ + { + this.func_190522_c(p_180501_1_, block); + } +- +- return true; + } + } + } +@@ -358,7 +402,7 @@ + IBlockState iblockstate = this.func_180495_p(p_175655_1_); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() == Material.field_151579_a) ++ if (block.isAir(iblockstate, this, p_175655_1_)) + { + return false; + } +@@ -441,6 +485,9 @@ + + public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_, boolean p_175685_3_) + { ++ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(this, p_175685_1_, this.func_180495_p(p_175685_1_), java.util.EnumSet.allOf(EnumFacing.class), p_175685_3_).isCanceled()) ++ return; ++ + this.func_190524_a(p_175685_1_.func_177976_e(), p_175685_2_, p_175685_1_); + this.func_190524_a(p_175685_1_.func_177974_f(), p_175685_2_, p_175685_1_); + this.func_190524_a(p_175685_1_.func_177977_b(), p_175685_2_, p_175685_1_); +@@ -456,6 +503,11 @@ + + public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) + { ++ java.util.EnumSet directions = java.util.EnumSet.allOf(EnumFacing.class); ++ directions.remove(p_175695_3_); ++ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(this, p_175695_1_, this.func_180495_p(p_175695_1_), directions, false).isCanceled()) ++ return; ++ + if (p_175695_3_ != EnumFacing.WEST) + { + this.func_190524_a(p_175695_1_.func_177976_e(), p_175695_2_, p_175695_1_); +@@ -507,7 +559,7 @@ + { + try + { +- return String.format("ID #%d (%s // %s)", Block.func_149682_b(p_190524_2_), p_190524_2_.func_149739_a(), p_190524_2_.getClass().getCanonicalName()); ++ return String.format("ID #%d (%s // %s // %s)", Block.func_149682_b(p_190524_2_), p_190524_2_.func_149739_a(), p_190524_2_.getClass().getName(), p_190524_2_.getRegistryName()); + } + catch (Throwable var2) + { +@@ -527,11 +579,11 @@ + { + IBlockState iblockstate = this.func_180495_p(p_190529_1_); + +- if (iblockstate.func_177230_c() == Blocks.field_190976_dk) ++ if (true) + { + try + { +- ((BlockObserver)iblockstate.func_177230_c()).func_190962_b(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_); ++ iblockstate.func_177230_c().observedNeighborChange(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_); + } + catch (Throwable throwable) + { +@@ -543,7 +595,7 @@ + { + try + { +- return String.format("ID #%d (%s // %s)", Block.func_149682_b(p_190529_2_), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getCanonicalName()); ++ return String.format("ID #%d (%s // %s // %s)", Block.func_149682_b(p_190529_2_), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getName(), p_190529_2_.getRegistryName()); + } + catch (Throwable var2) + { +@@ -588,7 +640,7 @@ + { + IBlockState iblockstate = this.func_180495_p(blockpos1); + +- if (iblockstate.func_185891_c() > 0 && !iblockstate.func_185904_a().func_76224_d()) ++ if (iblockstate.func_177230_c().getLightOpacity(iblockstate, this, blockpos) > 0 && !iblockstate.func_185904_a().func_76224_d()) + { + return false; + } +@@ -862,7 +914,7 @@ + + public boolean func_72935_r() + { +- return this.field_73008_k < 4; ++ return this.field_73011_w.isDaytime(); + } + + @Nullable +@@ -1065,6 +1117,13 @@ + + public void func_184148_a(@Nullable EntityPlayer p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) + { ++ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_184148_1_, p_184148_8_, p_184148_9_, p_184148_10_, p_184148_11_); ++ if (event.isCanceled() || event.getSound() == null) return; ++ p_184148_8_ = event.getSound(); ++ p_184148_9_ = event.getCategory(); ++ p_184148_10_ = event.getVolume(); ++ p_184148_11_ = event.getPitch(); ++ + for (int i = 0; i < this.field_73021_x.size(); ++i) + { + ((IWorldEventListener)this.field_73021_x.get(i)).func_184375_a(p_184148_1_, p_184148_8_, p_184148_9_, p_184148_2_, p_184148_4_, p_184148_6_, p_184148_10_, p_184148_11_); +@@ -1118,6 +1177,9 @@ + + public boolean func_72838_d(Entity p_72838_1_) + { ++ // do not drop any items while restoring blocksnapshots. Prevents dupes ++ if (!this.field_72995_K && (p_72838_1_ == null || (p_72838_1_ instanceof net.minecraft.entity.item.EntityItem && this.restoringBlockSnapshots))) return false; ++ + int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D); + int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D); + boolean flag = p_72838_1_.field_98038_p; +@@ -1140,6 +1202,8 @@ + this.func_72854_c(); + } + ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_72838_1_, this)) && !flag) return false; ++ + this.func_72964_e(i, j).func_76612_a(p_72838_1_); + this.field_72996_f.add(p_72838_1_); + this.func_72923_a(p_72838_1_); +@@ -1227,6 +1291,7 @@ + IBlockState iblockstate = Blocks.field_150348_b.func_176223_P(); + BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s(); + ++ if (p_191504_3_ && !net.minecraftforge.event.ForgeEventFactory.gatherCollisionBoxes(this, p_191504_1_, p_191504_2_, p_191504_4_)) return true; + try + { + for (int k1 = i; k1 < j; ++k1) +@@ -1269,7 +1334,7 @@ + + iblockstate1.func_185908_a(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false); + +- if (p_191504_3_ && !p_191504_4_.isEmpty()) ++ if (p_191504_3_ && !net.minecraftforge.event.ForgeEventFactory.gatherCollisionBoxes(this, p_191504_1_, p_191504_2_, p_191504_4_)) + { + boolean flag5 = true; + return flag5; +@@ -1319,11 +1384,10 @@ + } + } + } +- ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.GetCollisionBoxesEvent(this, p_184144_1_, p_184144_2_, list)); + return list; + } + +- @SideOnly(Side.CLIENT) + public void func_72848_b(IWorldEventListener p_72848_1_) + { + this.field_73021_x.remove(p_72848_1_); +@@ -1361,19 +1425,38 @@ + + public int func_72967_a(float p_72967_1_) + { ++ float f = field_73011_w.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.func_72826_c(p_72967_1_); + float f1 = 1.0F - (MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F); + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); + f1 = 1.0F - f1; + f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D)); + f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72967_1_) * 5.0F) / 16.0D)); +- f1 = 1.0F - f1; +- return (int)(f1 * 11.0F); ++ return f1; + } + + @SideOnly(Side.CLIENT) + public float func_72971_b(float p_72971_1_) + { ++ return this.field_73011_w.getSunBrightness(p_72971_1_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public float getSunBrightnessBody(float p_72971_1_) ++ { + float f = this.func_72826_c(p_72971_1_); + float f1 = 1.0F - (MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.2F); + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); +@@ -1386,6 +1469,12 @@ + @SideOnly(Side.CLIENT) + public Vec3d func_72833_a(Entity p_72833_1_, float p_72833_2_) + { ++ return this.field_73011_w.getSkyColor(p_72833_1_, p_72833_2_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3d getSkyColorBody(Entity p_72833_1_, float p_72833_2_) ++ { + float f = this.func_72826_c(p_72833_2_); + float f1 = MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F; + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); +@@ -1393,9 +1482,7 @@ + int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u); + int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v); + BlockPos blockpos = new BlockPos(i, j, k); +- Biome biome = this.func_180494_b(blockpos); +- float f2 = biome.func_180626_a(blockpos); +- int l = biome.func_76731_a(f2); ++ int l = net.minecraftforge.client.ForgeHooksClient.getSkyBlendColour(this, blockpos); + float f3 = (float)(l >> 16 & 255) / 255.0F; + float f4 = (float)(l >> 8 & 255) / 255.0F; + float f5 = (float)(l & 255) / 255.0F; +@@ -1444,20 +1531,25 @@ + + public float func_72826_c(float p_72826_1_) + { +- return this.field_73011_w.func_76563_a(this.field_72986_A.func_76073_f(), p_72826_1_); ++ return this.field_73011_w.func_76563_a(this.func_72820_D(), p_72826_1_); + } + + @SideOnly(Side.CLIENT) + public int func_72853_d() + { +- return this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f()); ++ return this.field_73011_w.func_76559_b(this.func_72820_D()); + } + + public float func_130001_d() + { +- return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())]; ++ return field_73011_w.getCurrentMoonPhaseFactor(); + } + ++ public float getCurrentMoonPhaseFactorBody() ++ { ++ return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.func_72820_D())]; ++ } ++ + public float func_72929_e(float p_72929_1_) + { + float f = this.func_72826_c(p_72929_1_); +@@ -1467,6 +1559,12 @@ + @SideOnly(Side.CLIENT) + public Vec3d func_72824_f(float p_72824_1_) + { ++ return this.field_73011_w.getCloudColor(p_72824_1_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3d getCloudColorBody(float p_72824_1_) ++ { + float f = this.func_72826_c(p_72824_1_); + float f1 = MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F; + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); +@@ -1522,9 +1620,9 @@ + for (blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1) + { + blockpos1 = blockpos.func_177977_b(); +- Material material = chunk.func_177435_g(blockpos1).func_185904_a(); ++ IBlockState state = chunk.func_177435_g(blockpos1); + +- if (material.func_76230_c() && material != Material.field_151584_j) ++ if (state.func_185904_a().func_76230_c() && !state.func_177230_c().isLeaves(state, this, blockpos1) && !state.func_177230_c().isFoliage(this, blockpos1)) + { + break; + } +@@ -1536,6 +1634,12 @@ + @SideOnly(Side.CLIENT) + public float func_72880_h(float p_72880_1_) + { ++ return this.field_73011_w.getStarBrightness(p_72880_1_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public float getStarBrightnessBody(float p_72880_1_) ++ { + float f = this.func_72826_c(p_72880_1_); + float f1 = 1.0F - (MathHelper.func_76134_b(f * ((float)Math.PI * 2F)) * 2.0F + 0.25F); + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); +@@ -1570,6 +1674,7 @@ + + try + { ++ if(entity.updateBlocked) continue; + ++entity.field_70173_aa; + entity.func_70071_h_(); + } +@@ -1587,6 +1692,12 @@ + entity.func_85029_a(crashreportcategory); + } + ++ if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) ++ { ++ net.minecraftforge.fml.common.FMLLog.log.fatal("{}", crashreport.func_71502_e()); ++ func_72900_e(entity); ++ } ++ else + throw new ReportedException(crashreport); + } + +@@ -1641,13 +1752,21 @@ + { + try + { ++ net.minecraftforge.server.timings.TimeTracker.ENTITY_UPDATE.trackStart(entity2); + this.func_72870_g(entity2); ++ net.minecraftforge.server.timings.TimeTracker.ENTITY_UPDATE.trackEnd(entity2); + } + catch (Throwable throwable1) + { + CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity"); + CrashReportCategory crashreportcategory1 = crashreport1.func_85058_a("Entity being ticked"); + entity2.func_85029_a(crashreportcategory1); ++ if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) ++ { ++ net.minecraftforge.fml.common.FMLLog.log.fatal("{}", crashreport1.func_71502_e()); ++ func_72900_e(entity2); ++ } ++ else + throw new ReportedException(crashreport1); + } + } +@@ -1674,14 +1793,23 @@ + + this.field_72984_F.func_76318_c("blockEntities"); + ++ this.field_147481_N = true; //FML Move above remove to prevent CMEs ++ + if (!this.field_147483_b.isEmpty()) + { +- this.field_175730_i.removeAll(this.field_147483_b); +- this.field_147482_g.removeAll(this.field_147483_b); ++ for (Object tile : field_147483_b) ++ { ++ ((TileEntity)tile).onChunkUnload(); ++ } ++ ++ // forge: faster "contains" makes this removal much more efficient ++ java.util.Set remove = java.util.Collections.newSetFromMap(new java.util.IdentityHashMap<>()); ++ remove.addAll(field_147483_b); ++ this.field_175730_i.removeAll(remove); ++ this.field_147482_g.removeAll(remove); + this.field_147483_b.clear(); + } + +- this.field_147481_N = true; + Iterator iterator = this.field_175730_i.iterator(); + + while (iterator.hasNext()) +@@ -1692,7 +1820,7 @@ + { + BlockPos blockpos = tileentity.func_174877_v(); + +- if (this.func_175667_e(blockpos) && this.field_175728_M.func_177746_a(blockpos)) ++ if (this.func_175668_a(blockpos, false) && this.field_175728_M.func_177746_a(blockpos)) //Forge: Fix TE's getting an extra tick on the client side.... + { + try + { +@@ -1700,7 +1828,9 @@ + { + return String.valueOf((Object)TileEntity.func_190559_a(tileentity.getClass())); + }); ++ net.minecraftforge.server.timings.TimeTracker.TILE_ENTITY_UPDATE.trackStart(tileentity); + ((ITickable)tileentity).func_73660_a(); ++ net.minecraftforge.server.timings.TimeTracker.TILE_ENTITY_UPDATE.trackEnd(tileentity); + this.field_72984_F.func_76319_b(); + } + catch (Throwable throwable) +@@ -1708,6 +1838,13 @@ + CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity"); + CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked"); + tileentity.func_145828_a(crashreportcategory2); ++ if (net.minecraftforge.common.ForgeModContainer.removeErroringTileEntities) ++ { ++ net.minecraftforge.fml.common.FMLLog.log.fatal("{}", crashreport2.func_71502_e()); ++ tileentity.func_145843_s(); ++ this.func_175713_t(tileentity.func_174877_v()); ++ } ++ else + throw new ReportedException(crashreport2); + } + } +@@ -1720,7 +1857,10 @@ + + if (this.func_175667_e(tileentity.func_174877_v())) + { +- this.func_175726_f(tileentity.func_174877_v()).func_177425_e(tileentity.func_174877_v()); ++ //Forge: Bugfix: If we set the tile entity it immediately sets it in the chunk, so we could be desyned ++ Chunk chunk = this.func_175726_f(tileentity.func_174877_v()); ++ if (chunk.func_177424_a(tileentity.func_174877_v(), net.minecraft.world.chunk.Chunk.EnumCreateEntityType.CHECK) == tileentity) ++ chunk.func_177425_e(tileentity.func_174877_v()); + } + } + } +@@ -1764,12 +1904,18 @@ + + public boolean func_175700_a(TileEntity p_175700_1_) + { ++ // Forge - set the world early as vanilla doesn't set it until next tick ++ if (p_175700_1_.func_145831_w() != this) p_175700_1_.func_145834_a(this); ++ // Forge: wait to add new TE if we're currently processing existing ones ++ if (field_147481_N) return field_147484_a.add(p_175700_1_); ++ + boolean flag = this.field_147482_g.add(p_175700_1_); + + if (flag && p_175700_1_ instanceof ITickable) + { + this.field_175730_i.add(p_175700_1_); + } ++ p_175700_1_.onLoad(); + + if (this.field_72995_K) + { +@@ -1785,6 +1931,11 @@ + { + if (this.field_147481_N) + { ++ for (TileEntity te : p_147448_1_) ++ { ++ if (te.func_145831_w() != this) // Forge - set the world early as vanilla doesn't set it until next tick ++ te.func_145834_a(this); ++ } + this.field_147484_a.addAll(p_147448_1_); + } + else +@@ -1807,9 +1958,13 @@ + { + int j2 = MathHelper.func_76128_c(p_72866_1_.field_70165_t); + int k2 = MathHelper.func_76128_c(p_72866_1_.field_70161_v); +- int l2 = 32; + +- if (p_72866_2_ && !this.func_175663_a(j2 - 32, 0, k2 - 32, j2 + 32, 0, k2 + 32, true)) ++ boolean isForced = getPersistentChunks().containsKey(new net.minecraft.util.math.ChunkPos(j2 >> 4, k2 >> 4)); ++ int range = isForced ? 0 : 32; ++ boolean canUpdate = !p_72866_2_ || this.func_175663_a(j2 - range, 0, k2 - range, j2 + range, 0, k2 + range, true); ++ if (!canUpdate) canUpdate = net.minecraftforge.event.ForgeEventFactory.canEntityUpdate(p_72866_1_); ++ ++ if (!canUpdate) + { + return; + } +@@ -1831,6 +1986,7 @@ + } + else + { ++ if(!p_72866_1_.updateBlocked) + p_72866_1_.func_70071_h_(); + } + } +@@ -1914,7 +2070,7 @@ + { + Entity entity4 = list.get(j2); + +- if (!entity4.field_70128_L && entity4.field_70156_m && entity4 != p_72917_2_ && (p_72917_2_ == null || entity4.func_184223_x(p_72917_2_))) ++ if (!entity4.field_70128_L && entity4.field_70156_m && entity4 != p_72917_2_ && (p_72917_2_ == null || !entity4.func_184223_x(p_72917_2_))) // Forge: fix MC-103516 + { + return false; + } +@@ -1972,6 +2128,12 @@ + { + IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4)); + ++ Boolean result = iblockstate1.func_177230_c().isAABBInsideLiquid(this, blockpos$pooledmutableblockpos, p_72953_1_); ++ if (result != null) { ++ if (!result) continue; ++ blockpos$pooledmutableblockpos.func_185344_t(); ++ return true; ++ } + if (iblockstate1.func_185904_a().func_76224_d()) + { + blockpos$pooledmutableblockpos.func_185344_t(); +@@ -2011,6 +2173,11 @@ + blockpos$pooledmutableblockpos.func_185344_t(); + return true; + } ++ else if (block.isBurning(this, new BlockPos(l3, i4, j4))) ++ { ++ blockpos$pooledmutableblockpos.func_185344_t(); ++ return true; ++ } + } + } + } +@@ -2050,6 +2217,16 @@ + IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos); + Block block = iblockstate1.func_177230_c(); + ++ Boolean result = block.isEntityInsideMaterial(this, blockpos$pooledmutableblockpos, iblockstate1, p_72918_3_, (double)i3, p_72918_2_, false); ++ if (result != null && result == true) ++ { ++ // Forge: When requested call blocks modifyAcceleration method, and more importantly cause this method to return true, which results in an entity being "inWater" ++ flag = true; ++ vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d); ++ continue; ++ } ++ else if (result != null && result == false) continue; ++ + if (iblockstate1.func_185904_a() == p_72918_2_) + { + double d0 = (double)((float)(i4 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate1.func_177229_b(BlockLiquid.field_176367_b)).intValue())); +@@ -2095,7 +2272,14 @@ + { + for (int j4 = j3; j4 < k3; ++j4) + { +- if (this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4)).func_185904_a() == p_72875_2_) ++ IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4)); ++ Boolean result = iblockstate1.func_177230_c().isAABBInsideMaterial(this, blockpos$pooledmutableblockpos, p_72875_1_, p_72875_2_); ++ if (result != null) { ++ if (!result) continue; ++ blockpos$pooledmutableblockpos.func_185344_t(); ++ return true; ++ } ++ if (iblockstate1.func_185904_a() == p_72875_2_) + { + blockpos$pooledmutableblockpos.func_185344_t(); + return true; +@@ -2116,6 +2300,7 @@ + public Explosion func_72885_a(@Nullable Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) + { + Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_); ++ if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; + explosion.func_77278_a(); + explosion.func_77279_a(true); + return explosion; +@@ -2238,6 +2423,7 @@ + + public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) + { ++ p_175690_1_ = p_175690_1_.func_185334_h(); // Forge - prevent mutable BlockPos leaks + if (!this.func_189509_E(p_175690_1_)) + { + if (p_175690_2_ != null && !p_175690_2_.func_145837_r()) +@@ -2245,6 +2431,8 @@ + if (this.field_147481_N) + { + p_175690_2_.func_174878_a(p_175690_1_); ++ if (p_175690_2_.func_145831_w() != this) ++ p_175690_2_.func_145834_a(this); // Forge - set the world early as vanilla doesn't set it until next tick + Iterator iterator1 = this.field_147484_a.iterator(); + + while (iterator1.hasNext()) +@@ -2262,7 +2450,8 @@ + } + else + { +- this.func_175726_f(p_175690_1_).func_177426_a(p_175690_1_, p_175690_2_); ++ Chunk chunk = this.func_175726_f(p_175690_1_); ++ if (chunk != null) chunk.func_177426_a(p_175690_1_, p_175690_2_); + this.func_175700_a(p_175690_2_); + } + } +@@ -2277,6 +2466,8 @@ + { + tileentity2.func_145843_s(); + this.field_147484_a.remove(tileentity2); ++ if (!(tileentity2 instanceof ITickable)) //Forge: If they are not tickable they wont be removed in the update loop. ++ this.field_147482_g.remove(tileentity2); + } + else + { +@@ -2289,6 +2480,7 @@ + + this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_); + } ++ this.func_175666_e(p_175713_1_, func_180495_p(p_175713_1_).func_177230_c()); //Notify neighbors of changes + } + + public void func_147457_a(TileEntity p_147457_1_) +@@ -2315,7 +2507,7 @@ + if (chunk1 != null && !chunk1.func_76621_g()) + { + IBlockState iblockstate1 = this.func_180495_p(p_175677_1_); +- return iblockstate1.func_185904_a().func_76218_k() && iblockstate1.func_185917_h(); ++ return iblockstate1.func_177230_c().isNormalCube(iblockstate1, this, p_175677_1_); + } + else + { +@@ -2338,6 +2530,7 @@ + { + this.field_72985_G = p_72891_1_; + this.field_72992_H = p_72891_2_; ++ this.field_73011_w.setAllowedSpawnTypes(p_72891_1_, p_72891_2_); + } + + public void func_72835_b() +@@ -2347,6 +2540,11 @@ + + protected void func_72947_a() + { ++ this.field_73011_w.calculateInitialWeather(); ++ } ++ ++ public void calculateInitialWeatherBody() ++ { + if (this.field_72986_A.func_76059_o()) + { + this.field_73004_o = 1.0F; +@@ -2360,6 +2558,11 @@ + + protected void func_72979_l() + { ++ this.field_73011_w.updateWeather(); ++ } ++ ++ public void updateWeatherBody() ++ { + if (this.field_73011_w.func_191066_m()) + { + if (!this.field_72995_K) +@@ -2484,6 +2687,11 @@ + + public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_) + { ++ return this.field_73011_w.canBlockFreeze(p_175670_1_, p_175670_2_); ++ } ++ ++ public boolean canBlockFreezeBody(BlockPos p_175670_1_, boolean p_175670_2_) ++ { + Biome biome = this.func_180494_b(p_175670_1_); + float f = biome.func_180626_a(p_175670_1_); + +@@ -2525,6 +2733,11 @@ + + public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_) + { ++ return this.field_73011_w.canSnowAt(p_175708_1_, p_175708_2_); ++ } ++ ++ public boolean canSnowAtBody(BlockPos p_175708_1_, boolean p_175708_2_) ++ { + Biome biome = this.func_180494_b(p_175708_1_); + float f = biome.func_180626_a(p_175708_1_); + +@@ -2542,7 +2755,7 @@ + { + IBlockState iblockstate1 = this.func_180495_p(p_175708_1_); + +- if (iblockstate1.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) ++ if (iblockstate1.func_177230_c().isAir(iblockstate1, this, p_175708_1_) && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) + { + return true; + } +@@ -2574,10 +2787,10 @@ + else + { + IBlockState iblockstate1 = this.func_180495_p(p_175638_1_); +- int j2 = p_175638_2_ == EnumSkyBlock.SKY ? 0 : iblockstate1.func_185906_d(); +- int k2 = iblockstate1.func_185891_c(); ++ int j2 = p_175638_2_ == EnumSkyBlock.SKY ? 0 : iblockstate1.func_177230_c().getLightValue(iblockstate1, this, p_175638_1_); ++ int k2 = iblockstate1.func_177230_c().getLightOpacity(iblockstate1, this, p_175638_1_); + +- if (k2 >= 15 && iblockstate1.func_185906_d() > 0) ++ if (false) // Forge: fix MC-119932 + { + k2 = 1; + } +@@ -2589,7 +2802,7 @@ + + if (k2 >= 15) + { +- return 0; ++ return j2; // Forge: fix MC-119932 + } + else if (j2 >= 14) + { +@@ -2630,12 +2843,13 @@ + + public boolean func_180500_c(EnumSkyBlock p_180500_1_, BlockPos p_180500_2_) + { +- if (!this.func_175648_a(p_180500_2_, 17, false)) ++ if (!this.func_175648_a(p_180500_2_, 16, false)) + { + return false; + } + else + { ++ int updateRange = this.func_175648_a(p_180500_2_, 18, false) ? 17 : 15; + int j2 = 0; + int k2 = 0; + this.field_72984_F.func_76320_a("getBrightness"); +@@ -2673,7 +2887,7 @@ + int l5 = MathHelper.func_76130_a(k4 - k3); + int i6 = MathHelper.func_76130_a(l4 - l3); + +- if (k5 + l5 + i6 < 17) ++ if (k5 + l5 + i6 < updateRange) + { + BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s(); + +@@ -2683,7 +2897,8 @@ + int k6 = k4 + enumfacing.func_96559_d(); + int l6 = l4 + enumfacing.func_82599_e(); + blockpos$pooledmutableblockpos.func_181079_c(j6, k6, l6); +- int i7 = Math.max(1, this.func_180495_p(blockpos$pooledmutableblockpos).func_185891_c()); ++ IBlockState bs = this.func_180495_p(blockpos$pooledmutableblockpos); ++ int i7 = Math.max(1, bs.func_177230_c().getLightOpacity(bs, this, blockpos$pooledmutableblockpos)); + j5 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos); + + if (j5 == i5 - i7 && k2 < this.field_72994_J.length) +@@ -2725,7 +2940,7 @@ + int j9 = Math.abs(i8 - l3); + boolean flag = k2 < this.field_72994_J.length - 6; + +- if (l8 + i9 + j9 < 17 && flag) ++ if (l8 + i9 + j9 < updateRange && flag) + { + if (this.func_175642_b(p_180500_1_, blockpos2.func_177976_e()) < k8) + { +@@ -2791,10 +3006,10 @@ + public List func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate p_175674_3_) + { + List list = Lists.newArrayList(); +- int j2 = MathHelper.func_76128_c((p_175674_2_.field_72340_a - 2.0D) / 16.0D); +- int k2 = MathHelper.func_76128_c((p_175674_2_.field_72336_d + 2.0D) / 16.0D); +- int l2 = MathHelper.func_76128_c((p_175674_2_.field_72339_c - 2.0D) / 16.0D); +- int i3 = MathHelper.func_76128_c((p_175674_2_.field_72334_f + 2.0D) / 16.0D); ++ int j2 = MathHelper.func_76128_c((p_175674_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int k2 = MathHelper.func_76128_c((p_175674_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int l2 = MathHelper.func_76128_c((p_175674_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int i3 = MathHelper.func_76128_c((p_175674_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); + + for (int j3 = j2; j3 <= k2; ++j3) + { +@@ -2847,10 +3062,10 @@ + + public List func_175647_a(Class p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate p_175647_3_) + { +- int j2 = MathHelper.func_76128_c((p_175647_2_.field_72340_a - 2.0D) / 16.0D); +- int k2 = MathHelper.func_76143_f((p_175647_2_.field_72336_d + 2.0D) / 16.0D); +- int l2 = MathHelper.func_76128_c((p_175647_2_.field_72339_c - 2.0D) / 16.0D); +- int i3 = MathHelper.func_76143_f((p_175647_2_.field_72334_f + 2.0D) / 16.0D); ++ int j2 = MathHelper.func_76128_c((p_175647_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int k2 = MathHelper.func_76143_f((p_175647_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int l2 = MathHelper.func_76128_c((p_175647_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int i3 = MathHelper.func_76143_f((p_175647_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); + List list = Lists.newArrayList(); + + for (int j3 = j2; j3 < k2; ++j3) +@@ -2930,11 +3145,13 @@ + + public void func_175650_b(Collection p_175650_1_) + { +- this.field_72996_f.addAll(p_175650_1_); +- + for (Entity entity4 : p_175650_1_) + { +- this.func_72923_a(entity4); ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(entity4, this))) ++ { ++ field_72996_f.add(entity4); ++ this.func_72923_a(entity4); ++ } + } + } + +@@ -2958,7 +3175,7 @@ + } + else + { +- return iblockstate1.func_185904_a().func_76222_j() && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_); ++ return iblockstate1.func_177230_c().func_176200_f(this, p_190527_2_) && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_); + } + } + +@@ -3042,7 +3259,7 @@ + public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_) + { + IBlockState iblockstate1 = this.func_180495_p(p_175651_1_); +- return iblockstate1.func_185915_l() ? this.func_175676_y(p_175651_1_) : iblockstate1.func_185911_a(this, p_175651_1_, p_175651_2_); ++ return iblockstate1.func_177230_c().shouldCheckWeakPower(iblockstate1, this, p_175651_1_, p_175651_2_) ? this.func_175676_y(p_175651_1_) : iblockstate1.func_185911_a(this, p_175651_1_, p_175651_2_); + } + + public boolean func_175640_z(BlockPos p_175640_1_) +@@ -3208,6 +3425,8 @@ + d2 *= ((Double)MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue(); + } + ++ d2 = net.minecraftforge.common.ForgeHooks.getPlayerVisibilityDistance(entityplayer1, d2, p_184150_9_); ++ + if ((p_184150_9_ < 0.0D || Math.abs(entityplayer1.field_70163_u - p_184150_3_) < p_184150_9_ * p_184150_9_) && (p_184150_7_ < 0.0D || d1 < d2 * d2) && (d0 == -1.0D || d1 < d0)) + { + d0 = d1; +@@ -3269,7 +3488,7 @@ + + public long func_72905_C() + { +- return this.field_72986_A.func_76063_b(); ++ return this.field_73011_w.getSeed(); + } + + public long func_82737_E() +@@ -3279,17 +3498,17 @@ + + public long func_72820_D() + { +- return this.field_72986_A.func_76073_f(); ++ return this.field_73011_w.getWorldTime(); + } + + public void func_72877_b(long p_72877_1_) + { +- this.field_72986_A.func_76068_b(p_72877_1_); ++ this.field_73011_w.setWorldTime(p_72877_1_); + } + + public BlockPos func_175694_M() + { +- BlockPos blockpos1 = new BlockPos(this.field_72986_A.func_76079_c(), this.field_72986_A.func_76075_d(), this.field_72986_A.func_76074_e()); ++ BlockPos blockpos1 = this.field_73011_w.getSpawnPoint(); + + if (!this.func_175723_af().func_177746_a(blockpos1)) + { +@@ -3301,7 +3520,7 @@ + + public void func_175652_B(BlockPos p_175652_1_) + { +- this.field_72986_A.func_176143_a(p_175652_1_); ++ this.field_73011_w.setSpawnPoint(p_175652_1_); + } + + @SideOnly(Side.CLIENT) +@@ -3321,12 +3540,18 @@ + + if (!this.field_72996_f.contains(p_72897_1_)) + { ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_72897_1_, this))) + this.field_72996_f.add(p_72897_1_); + } + } + + public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) + { ++ return this.field_73011_w.canMineBlock(p_175660_1_, p_175660_2_); ++ } ++ ++ public boolean canMineBlockBody(EntityPlayer p_175660_1_, BlockPos p_175660_2_) ++ { + return true; + } + +@@ -3428,8 +3653,7 @@ + + public boolean func_180502_D(BlockPos p_180502_1_) + { +- Biome biome = this.func_180494_b(p_180502_1_); +- return biome.func_76736_e(); ++ return this.field_73011_w.isBlockHighHumidity(p_180502_1_); + } + + @Nullable +@@ -3490,12 +3714,12 @@ + + public int func_72800_K() + { +- return 256; ++ return this.field_73011_w.getHeight(); + } + + public int func_72940_L() + { +- return this.field_73011_w.func_177495_o() ? 128 : 256; ++ return this.field_73011_w.getActualHeight(); + } + + public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) +@@ -3539,7 +3763,7 @@ + @SideOnly(Side.CLIENT) + public double func_72919_O() + { +- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c ? 0.0D : 63.0D; ++ return field_73011_w.getHorizon(); + } + + public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) +@@ -3573,7 +3797,7 @@ + + public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) + { +- for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) ++ for (EnumFacing enumfacing : EnumFacing.field_82609_l) + { + BlockPos blockpos1 = p_175666_1_.func_177972_a(enumfacing); + +@@ -3581,18 +3805,15 @@ + { + IBlockState iblockstate1 = this.func_180495_p(blockpos1); + +- if (Blocks.field_150441_bU.func_185547_C(iblockstate1)) ++ iblockstate1.func_177230_c().onNeighborChange(this, blockpos1, p_175666_1_); ++ if (iblockstate1.func_177230_c().isNormalCube(iblockstate1, this, blockpos1)) + { +- iblockstate1.func_189546_a(this, blockpos1, p_175666_2_, p_175666_1_); +- } +- else if (iblockstate1.func_185915_l()) +- { + blockpos1 = blockpos1.func_177972_a(enumfacing); + iblockstate1 = this.func_180495_p(blockpos1); + +- if (Blocks.field_150441_bU.func_185547_C(iblockstate1)) ++ if (iblockstate1.func_177230_c().getWeakChanges(this, blockpos1)) + { +- iblockstate1.func_189546_a(this, blockpos1, p_175666_2_, p_175666_1_); ++ iblockstate1.func_177230_c().onNeighborChange(this, blockpos1, p_175666_1_); + } + } + } +@@ -3658,6 +3879,124 @@ + return j2 >= -128 && j2 <= 128 && k2 >= -128 && k2 <= 128; + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * Determine if the given block is considered solid on the ++ * specified side. Used by placement logic. ++ * ++ * @param pos Block Position ++ * @param side The Side in question ++ * @return True if the side is solid ++ */ ++ public boolean isSideSolid(BlockPos pos, EnumFacing side) ++ { ++ return isSideSolid(pos, side, false); ++ } ++ ++ /** ++ * Determine if the given block is considered solid on the ++ * specified side. Used by placement logic. ++ * ++ * @param pos Block Position ++ * @param side The Side in question ++ * @param _default The default to return if the block doesn't exist. ++ * @return True if the side is solid ++ */ ++ @Override ++ public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) ++ { ++ if (!this.func_175701_a(pos)) return _default; ++ ++ Chunk chunk = func_175726_f(pos); ++ if (chunk == null || chunk.func_76621_g()) return _default; ++ return func_180495_p(pos).isSideSolid(this, pos, side); ++ } ++ ++ /** ++ * Get the persistent chunks for this world ++ * ++ * @return ++ */ ++ public com.google.common.collect.ImmutableSetMultimap getPersistentChunks() ++ { ++ return net.minecraftforge.common.ForgeChunkManager.getPersistentChunksFor(this); ++ } ++ ++ public Iterator getPersistentChunkIterable(Iterator chunkIterator) ++ { ++ return net.minecraftforge.common.ForgeChunkManager.getPersistentChunksIterableFor(this, chunkIterator); ++ } ++ /** ++ * Readded as it was removed, very useful helper function ++ * ++ * @param pos Block position ++ * @return The blocks light opacity ++ */ ++ public int getBlockLightOpacity(BlockPos pos) ++ { ++ if (!this.func_175701_a(pos)) return 0; ++ return func_175726_f(pos).func_177437_b(pos); ++ } ++ ++ /** ++ * Returns a count of entities that classify themselves as the specified creature type. ++ */ ++ public int countEntities(net.minecraft.entity.EnumCreatureType type, boolean forSpawnCount) ++ { ++ int count = 0; ++ for (int x = 0; x < field_72996_f.size(); x++) ++ { ++ if (((Entity)field_72996_f.get(x)).isCreatureType(type, forSpawnCount)) ++ { ++ count++; ++ } ++ } ++ return count; ++ } ++ ++ @Deprecated // remove in 1.13 ++ public void markTileEntitiesInChunkForRemoval(Chunk chunk) ++ { ++ for (TileEntity tileentity : chunk.func_177434_r().values()) ++ { ++ func_147457_a(tileentity); ++ } ++ } ++ ++ protected void initCapabilities() ++ { ++ net.minecraftforge.common.capabilities.ICapabilityProvider parent = field_73011_w.initCapabilities(); ++ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this, parent); ++ net.minecraftforge.common.util.WorldCapabilityData data = (net.minecraftforge.common.util.WorldCapabilityData)perWorldStorage.func_75742_a(net.minecraftforge.common.util.WorldCapabilityData.class, net.minecraftforge.common.util.WorldCapabilityData.ID); ++ if (data == null) ++ { ++ capabilityData = new net.minecraftforge.common.util.WorldCapabilityData(capabilities); ++ perWorldStorage.func_75745_a(capabilityData.field_76190_i, capabilityData); ++ } ++ else ++ { ++ capabilityData = data; ++ capabilityData.setCapabilities(field_73011_w, capabilities); ++ } ++ } ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable EnumFacing facing) ++ { ++ return capabilities == null ? false : capabilities.hasCapability(capability, facing); ++ } ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable EnumFacing facing) ++ { ++ return capabilities == null ? null : capabilities.getCapability(capability, facing); ++ } ++ ++ protected MapStorage perWorldStorage; //Moved to a getter to simulate final without being final so we can load in subclasses. ++ public MapStorage getPerWorldStorage() ++ { ++ 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_old/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch b/patches_old/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch new file mode 100644 index 000000000..fa334277d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch @@ -0,0 +1,94 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldEntitySpawner.java ++++ ../src-work/minecraft/net/minecraft/world/WorldEntitySpawner.java +@@ -79,15 +79,17 @@ + { + if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_)) + { +- int k4 = p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a()); ++ int k4 = p_77192_1_.countEntities(enumcreaturetype, true); + int l4 = enumcreaturetype.func_75601_b() * i / field_180268_a; + + if (k4 <= l4) + { ++ java.util.ArrayList shuffled = com.google.common.collect.Lists.newArrayList(this.field_77193_b); ++ java.util.Collections.shuffle(shuffled); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + label134: + +- for (ChunkPos chunkpos1 : this.field_77193_b) ++ for (ChunkPos chunkpos1 : shuffled) + { + BlockPos blockpos = func_180621_a(p_77192_1_, chunkpos1.field_77276_a, chunkpos1.field_77275_b); + int k1 = blockpos.func_177958_n(); +@@ -136,7 +138,7 @@ + + try + { +- entityliving = biome$spawnlistentry.field_76300_b.getConstructor(World.class).newInstance(p_77192_1_); ++ entityliving = biome$spawnlistentry.newInstance(p_77192_1_); + } + catch (Exception exception) + { +@@ -146,8 +148,10 @@ + + entityliving.func_70012_b((double)f, (double)i3, (double)f1, p_77192_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); + +- if (entityliving.func_70601_bi() && entityliving.func_70058_J()) ++ net.minecraftforge.fml.common.eventhandler.Event.Result canSpawn = net.minecraftforge.event.ForgeEventFactory.canEntitySpawn(entityliving, p_77192_1_, f, i3, f1, false); ++ if (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT && (entityliving.func_70601_bi() && entityliving.func_70058_J()))) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, p_77192_1_, f, i3, f1)) + ientitylivingdata = entityliving.func_180482_a(p_77192_1_.func_175649_E(new BlockPos(entityliving)), ientitylivingdata); + + if (entityliving.func_70058_J()) +@@ -160,7 +164,7 @@ + entityliving.func_70106_y(); + } + +- if (j2 >= entityliving.func_70641_bl()) ++ if (j2 >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(entityliving)) + { + continue label134; + } +@@ -219,6 +223,13 @@ + } + else + { ++ return p_180267_0_.canSpawnAt(p_180267_1_, p_180267_2_); ++ } ++ } ++ ++ public static boolean canCreatureTypeSpawnBody(EntityLiving.SpawnPlacementType p_180267_0_, World p_180267_1_, BlockPos p_180267_2_) ++ { ++ { + IBlockState iblockstate = p_180267_1_.func_180495_p(p_180267_2_); + + if (p_180267_0_ == EntityLiving.SpawnPlacementType.IN_WATER) +@@ -228,8 +239,9 @@ + else + { + BlockPos blockpos = p_180267_2_.func_177977_b(); ++ IBlockState state = p_180267_1_.func_180495_p(blockpos); + +- if (!p_180267_1_.func_180495_p(blockpos).func_185896_q()) ++ if (!state.func_177230_c().canCreatureSpawn(state, p_180267_1_, blockpos, p_180267_0_)) + { + return false; + } +@@ -273,7 +285,7 @@ + + try + { +- entityliving = biome$spawnlistentry.field_76300_b.getConstructor(World.class).newInstance(p_77191_0_); ++ entityliving = biome$spawnlistentry.newInstance(p_77191_0_); + } + catch (Exception exception) + { +@@ -281,6 +293,7 @@ + continue; + } + ++ if (net.minecraftforge.event.ForgeEventFactory.canEntitySpawn(entityliving, p_77191_0_, j + 0.5f, (float) blockpos.func_177956_o(), k +0.5f, false) == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) continue; + entityliving.func_70012_b((double)((float)j + 0.5F), (double)blockpos.func_177956_o(), (double)((float)k + 0.5F), p_77191_6_.nextFloat() * 360.0F, 0.0F); + p_77191_0_.func_72838_d(entityliving); + ientitylivingdata = entityliving.func_180482_a(p_77191_0_.func_175649_E(new BlockPos(entityliving)), ientitylivingdata); diff --git a/patches_old/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches_old/minecraft/net/minecraft/world/WorldProvider.java.patch new file mode 100644 index 000000000..9cfd4fc1c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/WorldProvider.java.patch @@ -0,0 +1,439 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldProvider.java ++++ ../src-work/minecraft/net/minecraft/world/WorldProvider.java +@@ -55,37 +55,12 @@ + protected void func_76572_b() + { + this.field_191067_f = true; +- WorldType worldtype = this.field_76579_a.func_72912_H().func_76067_t(); +- +- if (worldtype == WorldType.field_77138_c) +- { +- FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.func_82651_a(this.field_76579_a.func_72912_H().func_82571_y()); +- this.field_76578_c = new BiomeProviderSingle(Biome.func_180276_a(flatgeneratorinfo.func_82648_a(), Biomes.field_180279_ad)); +- } +- else if (worldtype == WorldType.field_180272_g) +- { +- this.field_76578_c = new BiomeProviderSingle(Biomes.field_76772_c); +- } +- else +- { +- this.field_76578_c = new BiomeProvider(this.field_76579_a.func_72912_H()); +- } ++ this.field_76578_c = this.field_76577_b.getBiomeProvider(field_76579_a); + } + + public IChunkGenerator func_186060_c() + { +- if (this.field_76577_b == WorldType.field_77138_c) +- { +- return new ChunkGeneratorFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c); +- } +- else if (this.field_76577_b == WorldType.field_180272_g) +- { +- return new ChunkGeneratorDebug(this.field_76579_a); +- } +- else +- { +- return this.field_76577_b == WorldType.field_180271_f ? new ChunkGeneratorOverworld(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : new ChunkGeneratorOverworld(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c); +- } ++ return this.field_76577_b.getChunkGenerator(field_76579_a, field_82913_c); + } + + public boolean func_76566_a(int p_76566_1_, int p_76566_2_) +@@ -179,7 +154,7 @@ + @SideOnly(Side.CLIENT) + public float func_76571_f() + { +- return 128.0F; ++ return this.field_76577_b.getCloudHeight(); + } + + @SideOnly(Side.CLIENT) +@@ -196,13 +171,13 @@ + + public int func_76557_i() + { +- return this.field_76577_b == WorldType.field_77138_c ? 4 : this.field_76579_a.func_181545_F() + 1; ++ return this.field_76577_b.getMinimumSpawnHeight(this.field_76579_a); + } + + @SideOnly(Side.CLIENT) + public double func_76565_k() + { +- return this.field_76577_b == WorldType.field_77138_c ? 1.0D : 0.03125D; ++ return this.field_76577_b.voidFadeMagnitude(); + } + + @SideOnly(Side.CLIENT) +@@ -241,6 +216,371 @@ + return new WorldBorder(); + } + ++ /*======================================= Forge Start =========================================*/ ++ private net.minecraftforge.client.IRenderHandler skyRenderer = null; ++ private net.minecraftforge.client.IRenderHandler cloudRenderer = null; ++ private net.minecraftforge.client.IRenderHandler weatherRenderer = null; ++ private int dimensionId; ++ ++ /** ++ * Sets the providers current dimension ID, used in default getSaveFolder() ++ * Added to allow default providers to be registered for multiple dimensions. ++ * This is to denote the exact dimension ID opposed to the 'type' in WorldType ++ * ++ * @param dim Dimension ID ++ */ ++ public void setDimension(int dim) ++ { ++ this.dimensionId = dim; ++ } ++ public int getDimension() ++ { ++ return this.dimensionId; ++ } ++ ++ /** ++ * Returns the sub-folder of the world folder that this WorldProvider saves to. ++ * EXA: DIM1, DIM-1 ++ * @return The sub-folder name to save this world's chunks to. ++ */ ++ @Nullable ++ public String getSaveFolder() ++ { ++ return (dimensionId == 0 ? null : "DIM" + dimensionId); ++ } ++ ++ /** ++ * The dimension's movement factor. ++ * Whenever a player or entity changes dimension from world A to world B, their coordinates are multiplied by ++ * worldA.provider.getMovementFactor() / worldB.provider.getMovementFactor() ++ * Example: Overworld factor is 1, nether factor is 8. Traveling from overworld to nether multiplies coordinates by 1/8. ++ * @return The movement factor ++ */ ++ public double getMovementFactor() ++ { ++ if (this instanceof WorldProviderHell) ++ { ++ return 8.0; ++ } ++ return 1.0; ++ } ++ ++ /** ++ * If this method returns true, then chunks received by the client will ++ * have {@link net.minecraft.world.chunk.Chunk#resetRelightChecks} called ++ * on them, queuing lighting checks for all air blocks in the chunk (and ++ * any adjacent light-emitting blocks). ++ * ++ * Returning true here is recommended if the chunk generator used also ++ * does this for newly generated chunks. ++ * ++ * @return true if lighting checks should be performed ++ */ ++ public boolean shouldClientCheckLighting() ++ { ++ return !(this instanceof WorldProviderSurface); ++ } ++ ++ @Nullable ++ @SideOnly(Side.CLIENT) ++ public net.minecraftforge.client.IRenderHandler getSkyRenderer() ++ { ++ return this.skyRenderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public void setSkyRenderer(net.minecraftforge.client.IRenderHandler skyRenderer) ++ { ++ this.skyRenderer = skyRenderer; ++ } ++ ++ @Nullable ++ @SideOnly(Side.CLIENT) ++ public net.minecraftforge.client.IRenderHandler getCloudRenderer() ++ { ++ return cloudRenderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public void setCloudRenderer(net.minecraftforge.client.IRenderHandler renderer) ++ { ++ cloudRenderer = renderer; ++ } ++ ++ @Nullable ++ @SideOnly(Side.CLIENT) ++ public net.minecraftforge.client.IRenderHandler getWeatherRenderer() ++ { ++ return weatherRenderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public void setWeatherRenderer(net.minecraftforge.client.IRenderHandler renderer) ++ { ++ weatherRenderer = renderer; ++ } ++ ++ /** ++ * Allows for manipulating the coloring of the lightmap texture. ++ * Will be called for each 16*16 combination of sky/block light values. ++ * ++ * @param partialTicks Progress between ticks. ++ * @param sunBrightness Current sun brightness. ++ * @param skyLight Sky light brightness factor. ++ * @param blockLight Block light brightness factor. ++ * @param colors The color values that will be used: [r, g, b]. ++ * ++ * @see net.minecraft.client.renderer.EntityRenderer#updateLightmap(float) ++ */ ++ public void getLightmapColors(float partialTicks, float sunBrightness, float skyLight, float blockLight, float[] colors) {} ++ ++ public BlockPos getRandomizedSpawnPoint() ++ { ++ BlockPos ret = this.field_76579_a.func_175694_M(); ++ ++ boolean isAdventure = field_76579_a.func_72912_H().func_76077_q() == GameType.ADVENTURE; ++ int spawnFuzz = this.field_76579_a instanceof WorldServer ? field_76577_b.getSpawnFuzz((WorldServer)this.field_76579_a, this.field_76579_a.func_73046_m()) : 1; ++ int border = MathHelper.func_76128_c(field_76579_a.func_175723_af().func_177729_b(ret.func_177958_n(), ret.func_177952_p())); ++ if (border < spawnFuzz) spawnFuzz = border; ++ ++ if (!func_177495_o() && !isAdventure && spawnFuzz != 0) ++ { ++ if (spawnFuzz < 2) spawnFuzz = 2; ++ int spawnFuzzHalf = spawnFuzz / 2; ++ ret = field_76579_a.func_175672_r(ret.func_177982_a(spawnFuzzHalf - field_76579_a.field_73012_v.nextInt(spawnFuzz), 0, spawnFuzzHalf - field_76579_a.field_73012_v.nextInt(spawnFuzz))); ++ } ++ ++ return ret; ++ } ++ /** ++ * Determine if the cursor on the map should 'spin' when rendered, like it does for the player in the nether. ++ * ++ * @param entity The entity holding the map, playername, or frame-ENTITYID ++ * @param x X Position ++ * @param z Z Position ++ * @param rotation the regular rotation of the marker ++ * @return True to 'spin' the cursor ++ */ ++ public boolean shouldMapSpin(String entity, double x, double z, double rotation) ++ { ++ return dimensionId < 0; ++ } ++ ++ /** ++ * Determines the dimension the player will be respawned in, typically this brings them back to the overworld. ++ * ++ * @param player The player that is respawning ++ * @return The dimension to respawn the player in ++ */ ++ public int getRespawnDimension(net.minecraft.entity.player.EntityPlayerMP player) ++ { ++ return player.getSpawnDimension(); ++ } ++ ++ /** ++ * Called from {@link World#initCapabilities()}, to gather capabilities for this world. ++ * It's safe to access world here since this is called after world is registered. ++ * ++ * On server, called directly after mapStorage and world data such as Scoreboard and VillageCollection are initialized. ++ * On client, called when world is constructed, just before world load event is called. ++ * Note that this method is always called before the world load event. ++ * @return initial holder for capabilities on the world ++ */ ++ @Nullable ++ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities() { ++ return null; ++ } ++ ++ /** ++ * Called on the client to get the music type to play when in this world type. ++ * At the time of calling, the client player and world are guaranteed to be non-null ++ * @return null to use vanilla logic, otherwise a MusicType to play in this world ++ */ ++ @Nullable ++ @SideOnly(Side.CLIENT) ++ public net.minecraft.client.audio.MusicTicker.MusicType getMusicType() ++ { ++ return null; ++ } ++ ++ /** ++ * Determines if the player can sleep in this world (or if the bed should explode for example). ++ * ++ * @param player The player that is attempting to sleep ++ * @param pos The location where the player tries to sleep at (the position of the clicked on bed for example) ++ * @return the result of a player trying to sleep at the given location ++ */ ++ public WorldSleepResult canSleepAt(net.minecraft.entity.player.EntityPlayer player, BlockPos pos) ++ { ++ return (this.func_76567_e() && this.field_76579_a.func_180494_b(pos) != net.minecraft.init.Biomes.field_76778_j) ? WorldSleepResult.ALLOW : WorldSleepResult.BED_EXPLODES; ++ } ++ ++ public static enum WorldSleepResult ++ { ++ ALLOW, ++ DENY, ++ BED_EXPLODES; ++ } ++ ++ /*======================================= Start Moved From World =========================================*/ ++ ++ public Biome getBiomeForCoords(BlockPos pos) ++ { ++ return field_76579_a.getBiomeForCoordsBody(pos); ++ } ++ ++ public boolean isDaytime() ++ { ++ return field_76579_a.func_175657_ab() < 4; ++ } ++ ++ /** ++ * The current sun brightness factor for this dimension. ++ * 0.0f means no light at all, and 1.0f means maximum sunlight. ++ * This will be used for the "calculateSkylightSubtracted" ++ * which is for Sky light value calculation. ++ * ++ * @return The current brightness factor ++ * */ ++ public float getSunBrightnessFactor(float par1) ++ { ++ return field_76579_a.getSunBrightnessFactor(par1); ++ } ++ ++ /** ++ * Calculates the current moon phase factor. ++ * This factor is effective for slimes. ++ * (This method do not affect the moon rendering) ++ * */ ++ public float getCurrentMoonPhaseFactor() ++ { ++ return field_76579_a.getCurrentMoonPhaseFactorBody(); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3d getSkyColor(net.minecraft.entity.Entity cameraEntity, float partialTicks) ++ { ++ return field_76579_a.getSkyColorBody(cameraEntity, partialTicks); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3d getCloudColor(float partialTicks) ++ { ++ return field_76579_a.getCloudColorBody(partialTicks); ++ } ++ ++ /** ++ * Gets the Sun Brightness for rendering sky. ++ * */ ++ @SideOnly(Side.CLIENT) ++ public float getSunBrightness(float par1) ++ { ++ return field_76579_a.getSunBrightnessBody(par1); ++ } ++ ++ /** ++ * Gets the Star Brightness for rendering sky. ++ * */ ++ @SideOnly(Side.CLIENT) ++ public float getStarBrightness(float par1) ++ { ++ return field_76579_a.getStarBrightnessBody(par1); ++ } ++ ++ public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) ++ { ++ field_76579_a.field_72985_G = allowHostile; ++ field_76579_a.field_72992_H = allowPeaceful; ++ } ++ ++ public void calculateInitialWeather() ++ { ++ field_76579_a.calculateInitialWeatherBody(); ++ } ++ ++ public void updateWeather() ++ { ++ field_76579_a.updateWeatherBody(); ++ } ++ ++ public boolean canBlockFreeze(BlockPos pos, boolean byWater) ++ { ++ return field_76579_a.canBlockFreezeBody(pos, byWater); ++ } ++ ++ public boolean canSnowAt(BlockPos pos, boolean checkLight) ++ { ++ return field_76579_a.canSnowAtBody(pos, checkLight); ++ } ++ public void setWorldTime(long time) ++ { ++ field_76579_a.field_72986_A.func_76068_b(time); ++ } ++ ++ public long getSeed() ++ { ++ return field_76579_a.field_72986_A.func_76063_b(); ++ } ++ ++ public long getWorldTime() ++ { ++ return field_76579_a.field_72986_A.func_76073_f(); ++ } ++ ++ public BlockPos getSpawnPoint() ++ { ++ net.minecraft.world.storage.WorldInfo info = field_76579_a.field_72986_A; ++ return new BlockPos(info.func_76079_c(), info.func_76075_d(), info.func_76074_e()); ++ } ++ ++ public void setSpawnPoint(BlockPos pos) ++ { ++ field_76579_a.field_72986_A.func_176143_a(pos); ++ } ++ ++ public boolean canMineBlock(net.minecraft.entity.player.EntityPlayer player, BlockPos pos) ++ { ++ return field_76579_a.canMineBlockBody(player, pos); ++ } ++ ++ public boolean isBlockHighHumidity(BlockPos pos) ++ { ++ return field_76579_a.func_180494_b(pos).func_76736_e(); ++ } ++ ++ public int getHeight() ++ { ++ return 256; ++ } ++ ++ public int getActualHeight() ++ { ++ return field_76576_e ? 128 : 256; ++ } ++ ++ public double getHorizon() ++ { ++ return field_76579_a.field_72986_A.func_76067_t().getHorizon(field_76579_a); ++ } ++ ++ public void resetRainAndThunder() ++ { ++ field_76579_a.field_72986_A.func_76080_g(0); ++ field_76579_a.field_72986_A.func_76084_b(false); ++ field_76579_a.field_72986_A.func_76090_f(0); ++ field_76579_a.field_72986_A.func_76069_a(false); ++ } ++ ++ public boolean canDoLightning(net.minecraft.world.chunk.Chunk chunk) ++ { ++ return true; ++ } ++ ++ public boolean canDoRainSnowIce(net.minecraft.world.chunk.Chunk chunk) ++ { ++ return true; ++ } ++ + public void func_186061_a(EntityPlayerMP p_186061_1_) + { + } diff --git a/patches_old/minecraft/net/minecraft/world/WorldProviderEnd.java.patch b/patches_old/minecraft/net/minecraft/world/WorldProviderEnd.java.patch new file mode 100644 index 000000000..8281c449f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/WorldProviderEnd.java.patch @@ -0,0 +1,43 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldProviderEnd.java ++++ ../src-work/minecraft/net/minecraft/world/WorldProviderEnd.java +@@ -20,7 +20,7 @@ + public void func_76572_b() + { + this.field_76578_c = new BiomeProviderSingle(Biomes.field_76779_k); +- NBTTagCompound nbttagcompound = this.field_76579_a.func_72912_H().func_186347_a(DimensionType.THE_END); ++ NBTTagCompound nbttagcompound = this.field_76579_a.func_72912_H().getDimensionData(this.field_76579_a.field_73011_w.getDimension()); + this.field_186064_g = this.field_76579_a instanceof WorldServer ? new DragonFightManager((WorldServer)this.field_76579_a, nbttagcompound.func_74775_l("DragonFight")) : null; + } + +@@ -113,7 +113,7 @@ + nbttagcompound.func_74782_a("DragonFight", this.field_186064_g.func_186088_a()); + } + +- this.field_76579_a.func_72912_H().func_186345_a(DimensionType.THE_END, nbttagcompound); ++ this.field_76579_a.func_72912_H().setDimensionData(this.field_76579_a.field_73011_w.getDimension(), nbttagcompound); + } + + public void func_186059_r() +@@ -129,4 +129,22 @@ + { + return this.field_186064_g; + } ++ ++ @Override ++ public void func_186061_a(net.minecraft.entity.player.EntityPlayerMP player) ++ { ++ if (this.field_186064_g != null) ++ { ++ this.field_186064_g.addPlayer(player); ++ } ++ } ++ ++ @Override ++ public void func_186062_b(net.minecraft.entity.player.EntityPlayerMP player) ++ { ++ if (this.field_186064_g != null) ++ { ++ this.field_186064_g.removePlayer(player); ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/WorldProviderSurface.java.patch b/patches_old/minecraft/net/minecraft/world/WorldProviderSurface.java.patch new file mode 100644 index 000000000..1b588e11e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/WorldProviderSurface.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldProviderSurface.java ++++ ../src-work/minecraft/net/minecraft/world/WorldProviderSurface.java +@@ -9,6 +9,6 @@ + + public boolean func_186056_c(int p_186056_1_, int p_186056_2_) + { +- return !this.field_76579_a.func_72916_c(p_186056_1_, p_186056_2_); ++ return !this.field_76579_a.func_72916_c(p_186056_1_, p_186056_2_) || !this.field_76579_a.field_73011_w.func_186058_p().shouldLoadSpawn(); + } + } diff --git a/patches_old/minecraft/net/minecraft/world/WorldServer.java.patch b/patches_old/minecraft/net/minecraft/world/WorldServer.java.patch new file mode 100644 index 000000000..f717bbb20 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/WorldServer.java.patch @@ -0,0 +1,304 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldServer.java ++++ ../src-work/minecraft/net/minecraft/world/WorldServer.java +@@ -101,30 +101,39 @@ + private int field_147489_T; + private final List field_94579_S = Lists.newArrayList(); + ++ /** Stores the recently processed (lighting) chunks */ ++ protected Set doneChunks = new java.util.HashSet(); ++ public List customTeleporters = new ArrayList(); ++ + public WorldServer(MinecraftServer p_i45921_1_, ISaveHandler p_i45921_2_, WorldInfo p_i45921_3_, int p_i45921_4_, Profiler p_i45921_5_) + { +- super(p_i45921_2_, p_i45921_3_, DimensionType.func_186069_a(p_i45921_4_).func_186070_d(), p_i45921_5_, false); ++ super(p_i45921_2_, p_i45921_3_, net.minecraftforge.common.DimensionManager.createProviderFor(p_i45921_4_), p_i45921_5_, false); + this.field_73061_a = p_i45921_1_; + this.field_73062_L = new EntityTracker(this); + this.field_73063_M = new PlayerChunkMap(this); ++ // Guarantee the dimension ID was not reset by the provider ++ int providerDim = this.field_73011_w.getDimension(); + this.field_73011_w.func_76558_a(this); ++ this.field_73011_w.setDimension(providerDim); + this.field_73020_y = this.func_72970_h(); ++ perWorldStorage = new MapStorage(new net.minecraftforge.common.WorldSpecificSaveHandler((WorldServer)this, p_i45921_2_)); + this.field_85177_Q = new Teleporter(this); + this.func_72966_v(); + this.func_72947_a(); + this.func_175723_af().func_177725_a(p_i45921_1_.func_175580_aG()); ++ net.minecraftforge.common.DimensionManager.setWorld(p_i45921_4_, this, field_73061_a); + } + + public World func_175643_b() + { + this.field_72988_C = new MapStorage(this.field_73019_z); + String s = VillageCollection.func_176062_a(this.field_73011_w); +- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, s); ++ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_75742_a(VillageCollection.class, s); + + if (villagecollection == null) + { + this.field_72982_D = new VillageCollection(this); +- this.field_72988_C.func_75745_a(s, this.field_72982_D); ++ this.perWorldStorage.func_75745_a(s, this.field_72982_D); + } + else + { +@@ -161,6 +170,7 @@ + this.func_175723_af().func_177750_a(this.field_72986_A.func_176137_E()); + } + ++ this.initCapabilities(); + return this; + } + +@@ -179,8 +189,8 @@ + { + if (this.func_82736_K().func_82766_b("doDaylightCycle")) + { +- long i = this.field_72986_A.func_76073_f() + 24000L; +- this.field_72986_A.func_76068_b(i - i % 24000L); ++ long i = this.func_72820_D() + 24000L; ++ this.func_72877_b(i - i % 24000L); + } + + this.func_73053_d(); +@@ -206,7 +216,7 @@ + + if (this.func_82736_K().func_82766_b("doDaylightCycle")) + { +- this.field_72986_A.func_76068_b(this.field_72986_A.func_76073_f() + 1L); ++ this.func_72877_b(this.func_72820_D() + 1L); + } + + this.field_72984_F.func_76318_c("tickPending"); +@@ -220,6 +230,10 @@ + this.field_175740_d.func_75528_a(); + this.field_72984_F.func_76318_c("portalForcer"); + this.field_85177_Q.func_85189_a(this.func_82737_E()); ++ for (Teleporter tele : customTeleporters) ++ { ++ tele.func_85189_a(func_82737_E()); ++ } + this.field_72984_F.func_76319_b(); + this.func_147488_Z(); + } +@@ -228,12 +242,14 @@ + public Biome.SpawnListEntry func_175734_a(EnumCreatureType p_175734_1_, BlockPos p_175734_2_) + { + List list = this.func_72863_F().func_177458_a(p_175734_1_, p_175734_2_); ++ list = net.minecraftforge.event.ForgeEventFactory.getPotentialSpawns(this, p_175734_1_, p_175734_2_, list); + return list != null && !list.isEmpty() ? (Biome.SpawnListEntry)WeightedRandom.func_76271_a(this.field_73012_v, list) : null; + } + + public boolean func_175732_a(EnumCreatureType p_175732_1_, Biome.SpawnListEntry p_175732_2_, BlockPos p_175732_3_) + { + List list = this.func_72863_F().func_177458_a(p_175732_1_, p_175732_3_); ++ list = net.minecraftforge.event.ForgeEventFactory.getPotentialSpawns(this, p_175732_1_, p_175732_3_, list); + return list != null && !list.isEmpty() ? list.contains(p_175732_2_) : false; + } + +@@ -279,10 +295,7 @@ + + private void func_73051_P() + { +- this.field_72986_A.func_76080_g(0); +- this.field_72986_A.func_76084_b(false); +- this.field_72986_A.func_76090_f(0); +- this.field_72986_A.func_76069_a(false); ++ this.field_73011_w.resetRainAndThunder(); + } + + public boolean func_73056_e() +@@ -375,7 +388,7 @@ + boolean flag1 = this.func_72911_I(); + this.field_72984_F.func_76320_a("pollingChunks"); + +- for (Iterator iterator = this.field_73063_M.func_187300_b(); iterator.hasNext(); this.field_72984_F.func_76319_b()) ++ for (Iterator iterator = getPersistentChunkIterable(this.field_73063_M.func_187300_b()); iterator.hasNext(); this.field_72984_F.func_76319_b()) + { + this.field_72984_F.func_76320_a("getChunk"); + Chunk chunk = iterator.next(); +@@ -387,7 +400,7 @@ + chunk.func_150804_b(false); + this.field_72984_F.func_76318_c("thunder"); + +- if (flag && flag1 && this.field_73012_v.nextInt(100000) == 0) ++ if (this.field_73011_w.canDoLightning(chunk) && flag && flag1 && this.field_73012_v.nextInt(100000) == 0) + { + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + int l = this.field_73005_l >> 2; +@@ -415,13 +428,14 @@ + + this.field_72984_F.func_76318_c("iceandsnow"); + +- if (this.field_73012_v.nextInt(16) == 0) ++ if (this.field_73011_w.canDoRainSnowIce(chunk) && this.field_73012_v.nextInt(16) == 0) + { + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + int j2 = this.field_73005_l >> 2; + BlockPos blockpos1 = this.func_175725_q(new BlockPos(j + (j2 & 15), 0, k + (j2 >> 8 & 15))); + BlockPos blockpos2 = blockpos1.func_177977_b(); + ++ if (this.func_175697_a(blockpos2, 1)) // Forge: check area to avoid loading neighbors in unloaded chunks + if (this.func_175662_w(blockpos2)) + { + this.func_175656_a(blockpos2, Blocks.field_150432_aD.func_176223_P()); +@@ -525,7 +539,10 @@ + { + if (p_175654_2_.func_149698_L()) + { +- if (this.func_175707_a(p_175654_1_.func_177982_a(-8, -8, -8), p_175654_1_.func_177982_a(8, 8, 8))) ++ //Keeping here as a note for future when it may be restored. ++ boolean isForced = getPersistentChunks().containsKey(new ChunkPos(p_175654_1_)); ++ int range = isForced ? 0 : 8; ++ if (this.func_175707_a(p_175654_1_.func_177982_a(-range, -range, -range), p_175654_1_.func_177982_a(range, range, range))) + { + IBlockState iblockstate = this.func_180495_p(p_175654_1_); + +@@ -561,6 +578,7 @@ + + public void func_180497_b(BlockPos p_180497_1_, Block p_180497_2_, int p_180497_3_, int p_180497_4_) + { ++ if (p_180497_2_ == null) return; //Forge: Prevent null blocks from ticking, can happen if blocks are removed in old worlds. TODO: Fix real issue causing block to be null. + NextTickListEntry nextticklistentry = new NextTickListEntry(p_180497_1_, p_180497_2_); + nextticklistentry.func_82753_a(p_180497_4_); + Material material = p_180497_2_.func_176223_P().func_185904_a(); +@@ -579,7 +597,7 @@ + + public void func_72939_s() + { +- if (this.field_73010_i.isEmpty()) ++ if (this.field_73010_i.isEmpty() && getPersistentChunks().isEmpty()) + { + if (this.field_80004_Q++ >= 300) + { +@@ -703,6 +721,9 @@ + { + NextTickListEntry nextticklistentry1 = iterator.next(); + iterator.remove(); ++ //Keeping here as a note for future when it may be restored. ++ //boolean isForced = getPersistentChunks().containsKey(new ChunkPos(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); ++ //byte b0 = isForced ? 0 : 8; + int k = 0; + + if (this.func_175707_a(nextticklistentry1.field_180282_a.func_177982_a(0, 0, 0), nextticklistentry1.field_180282_a.func_177982_a(0, 0, 0))) +@@ -829,6 +850,10 @@ + + public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) + { ++ return super.func_175660_a(p_175660_1_, p_175660_2_); ++ } ++ public boolean canMineBlockBody(EntityPlayer p_175660_1_, BlockPos p_175660_2_) ++ { + return !this.field_73061_a.func_175579_a(this, p_175660_2_, p_175660_1_) && this.func_175723_af().func_177746_a(p_175660_2_); + } + +@@ -894,6 +919,7 @@ + } + else + { ++ if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(this, p_73052_1_)) return; + this.field_72987_B = true; + BiomeProvider biomeprovider = this.field_73011_w.func_177499_m(); + List list = biomeprovider.func_76932_a(); +@@ -979,6 +1005,7 @@ + } + + chunkproviderserver.func_186027_a(p_73044_1_); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Save(this)); + + for (Chunk chunk : Lists.newArrayList(chunkproviderserver.func_189548_a())) + { +@@ -1023,6 +1050,7 @@ + this.field_72986_A.func_176135_e(this.func_175723_af().func_177732_i()); + this.field_73019_z.func_75755_a(this.field_72986_A, this.field_73061_a.func_184103_al().func_72378_q()); + this.field_72988_C.func_75744_a(); ++ this.perWorldStorage.func_75744_a(); + } + + public boolean func_72838_d(Entity p_72838_1_) +@@ -1034,7 +1062,7 @@ + { + for (Entity entity : Lists.newArrayList(p_175650_1_)) + { +- if (this.func_184165_i(entity)) ++ if (this.func_184165_i(entity) && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(entity, this))) + { + this.field_72996_f.add(entity); + this.func_72923_a(entity); +@@ -1115,7 +1143,7 @@ + { + if (super.func_72942_c(p_72942_1_)) + { +- this.field_73061_a.func_184103_al().func_148543_a((EntityPlayer)null, p_72942_1_.field_70165_t, p_72942_1_.field_70163_u, p_72942_1_.field_70161_v, 512.0D, this.field_73011_w.func_186058_p().func_186068_a(), new SPacketSpawnGlobalEntity(p_72942_1_)); ++ this.field_73061_a.func_184103_al().func_148543_a((EntityPlayer)null, p_72942_1_.field_70165_t, p_72942_1_.field_70163_u, p_72942_1_.field_70161_v, 512.0D, this.field_73011_w.getDimension(), new SPacketSpawnGlobalEntity(p_72942_1_)); + return true; + } + else +@@ -1137,6 +1165,7 @@ + public Explosion func_72885_a(@Nullable Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) + { + Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_); ++ if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; + explosion.func_77278_a(); + explosion.func_77279_a(false); + +@@ -1182,7 +1211,7 @@ + { + if (this.func_147485_a(blockeventdata)) + { +- this.field_73061_a.func_184103_al().func_148543_a((EntityPlayer)null, (double)blockeventdata.func_180328_a().func_177958_n(), (double)blockeventdata.func_180328_a().func_177956_o(), (double)blockeventdata.func_180328_a().func_177952_p(), 64.0D, this.field_73011_w.func_186058_p().func_186068_a(), new SPacketBlockAction(blockeventdata.func_180328_a(), blockeventdata.func_151337_f(), blockeventdata.func_151339_d(), blockeventdata.func_151338_e())); ++ this.field_73061_a.func_184103_al().func_148543_a((EntityPlayer)null, (double)blockeventdata.func_180328_a().func_177958_n(), (double)blockeventdata.func_180328_a().func_177956_o(), (double)blockeventdata.func_180328_a().func_177952_p(), 64.0D, this.field_73011_w.getDimension(), new SPacketBlockAction(blockeventdata.func_180328_a(), blockeventdata.func_151337_f(), blockeventdata.func_151339_d(), blockeventdata.func_151338_e())); + } + } + +@@ -1208,27 +1237,31 @@ + + if (this.field_73003_n != this.field_73004_o) + { +- this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.func_186058_p().func_186068_a()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.getDimension()); + } + + if (this.field_73018_p != this.field_73017_q) + { +- this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.func_186058_p().func_186068_a()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.getDimension()); + } + ++ /* 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.func_72896_J()) + { + if (flag) + { +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(2, 0.0F)); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(2, 0.0F), this.field_73011_w.getDimension()); + } + else + { +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(1, 0.0F)); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(1, 0.0F), this.field_73011_w.getDimension()); + } + +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(7, this.field_73004_o)); +- this.field_73061_a.func_184103_al().func_148540_a(new SPacketChangeGameState(8, this.field_73017_q)); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.getDimension()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.getDimension()); + } + } + +@@ -1323,6 +1356,11 @@ + return this.field_193036_D; + } + ++ public java.io.File getChunkSaveLocation() ++ { ++ return ((net.minecraft.world.chunk.storage.AnvilChunkLoader)func_72863_F().field_73247_e).field_75825_d; ++ } ++ + static class ServerBlockEventList extends ArrayList + { + private ServerBlockEventList() diff --git a/patches_old/minecraft/net/minecraft/world/WorldServerMulti.java.patch b/patches_old/minecraft/net/minecraft/world/WorldServerMulti.java.patch new file mode 100644 index 000000000..c31730313 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/WorldServerMulti.java.patch @@ -0,0 +1,66 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldServerMulti.java ++++ ../src-work/minecraft/net/minecraft/world/WorldServerMulti.java +@@ -11,12 +11,13 @@ + public class WorldServerMulti extends WorldServer + { + private final WorldServer field_175743_a; ++ private IBorderListener borderListener; + + public WorldServerMulti(MinecraftServer p_i45923_1_, ISaveHandler p_i45923_2_, int p_i45923_3_, WorldServer p_i45923_4_, Profiler p_i45923_5_) + { + super(p_i45923_1_, p_i45923_2_, new DerivedWorldInfo(p_i45923_4_.func_72912_H()), p_i45923_3_, p_i45923_5_); + this.field_175743_a = p_i45923_4_; +- p_i45923_4_.func_175723_af().func_177737_a(new IBorderListener() ++ this.borderListener = new IBorderListener() + { + public void func_177694_a(WorldBorder p_177694_1_, double p_177694_2_) + { +@@ -46,11 +47,13 @@ + { + WorldServerMulti.this.func_175723_af().func_177724_b(p_177695_2_); + } +- }); ++ }; ++ this.field_175743_a.func_175723_af().func_177737_a(this.borderListener); + } + + protected void func_73042_a() throws MinecraftException + { ++ this.perWorldStorage.func_75744_a(); + } + + public World func_175643_b() +@@ -60,12 +63,12 @@ + this.field_184151_B = this.field_175743_a.func_184146_ak(); + this.field_191951_C = this.field_175743_a.func_191952_z(); + String s = VillageCollection.func_176062_a(this.field_73011_w); +- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, s); ++ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_75742_a(VillageCollection.class, s); + + if (villagecollection == null) + { + this.field_72982_D = new VillageCollection(this); +- this.field_72988_C.func_75745_a(s, this.field_72982_D); ++ this.perWorldStorage.func_75745_a(s, this.field_72982_D); + } + else + { +@@ -73,9 +76,18 @@ + this.field_72982_D.func_82566_a(this); + } + ++ this.initCapabilities(); + return this; + } + ++ ++ @Override ++ public void func_73041_k() ++ { ++ super.func_73041_k(); ++ this.field_175743_a.func_175723_af().removeListener(this.borderListener); // Unlink ourselves, to prevent world leak. ++ } ++ + public void func_184166_c() + { + this.field_73011_w.func_186057_q(); diff --git a/patches_old/minecraft/net/minecraft/world/WorldType.java.patch b/patches_old/minecraft/net/minecraft/world/WorldType.java.patch new file mode 100644 index 000000000..3e6aed1de --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/WorldType.java.patch @@ -0,0 +1,115 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldType.java ++++ ../src-work/minecraft/net/minecraft/world/WorldType.java +@@ -113,4 +114,145 @@ + this.field_151361_l = true; + return this; + } ++ ++ public net.minecraft.world.biome.BiomeProvider getBiomeProvider(World world) ++ { ++ if (this == field_77138_c) ++ { ++ net.minecraft.world.gen.FlatGeneratorInfo flatgeneratorinfo = net.minecraft.world.gen.FlatGeneratorInfo.func_82651_a(world.func_72912_H().func_82571_y()); ++ return new net.minecraft.world.biome.BiomeProviderSingle(net.minecraft.world.biome.Biome.func_180276_a(flatgeneratorinfo.func_82648_a(), net.minecraft.init.Biomes.field_180279_ad)); ++ } ++ else if (this == field_180272_g) ++ { ++ return new net.minecraft.world.biome.BiomeProviderSingle(net.minecraft.init.Biomes.field_76772_c); ++ } ++ else ++ { ++ return new net.minecraft.world.biome.BiomeProvider(world.func_72912_H()); ++ } ++ } ++ ++ public net.minecraft.world.gen.IChunkGenerator getChunkGenerator(World world, String generatorOptions) ++ { ++ if (this == field_77138_c) return new net.minecraft.world.gen.ChunkGeneratorFlat(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); ++ if (this == field_180272_g) return new net.minecraft.world.gen.ChunkGeneratorDebug(world); ++ if (this == field_180271_f) return new net.minecraft.world.gen.ChunkGeneratorOverworld(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); ++ return new net.minecraft.world.gen.ChunkGeneratorOverworld(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); ++ } ++ ++ public int getMinimumSpawnHeight(World world) ++ { ++ return this == field_77138_c ? 4 : world.func_181545_F() + 1; ++ } ++ ++ public double getHorizon(World world) ++ { ++ return this == field_77138_c ? 0.0D : 63.0D; ++ } ++ ++ public double voidFadeMagnitude() ++ { ++ return this == field_77138_c ? 1.0D : 0.03125D; ++ } ++ ++ public boolean handleSlimeSpawnReduction(java.util.Random random, World world) ++ { ++ return this == field_77138_c ? random.nextInt(4) != 1 : false; ++ } ++ ++ /*=================================================== FORGE START ======================================*/ ++ private static int getNextID() ++ { ++ for (int x = 0; x < field_77139_a.length; x++) ++ { ++ if (field_77139_a[x] == null) ++ { ++ return x; ++ } ++ } ++ ++ int oldLen = field_77139_a.length; ++ field_77139_a = java.util.Arrays.copyOf(field_77139_a, oldLen + 16); ++ return oldLen; ++ } ++ ++ /** ++ * Creates a new world type, the ID is hidden and should not be referenced by modders. ++ * It will automatically expand the underlying workdType array if there are no IDs left. ++ * @param name ++ */ ++ public WorldType(String name) ++ { ++ this(getNextID(), name); ++ } ++ ++ /** ++ * Gets the spawn fuzz for players who join the world. ++ * Useful for void world types. ++ * @return Fuzz for entity initial spawn in blocks. ++ */ ++ public int getSpawnFuzz(WorldServer world, net.minecraft.server.MinecraftServer server) ++ { ++ return Math.max(0, server.func_184108_a(world)); ++ }+ ++ ++ /** ++ * Get the height to render the clouds for this world type ++ * @return The height to render clouds at ++ */ ++ public float getCloudHeight() ++ { ++ return 128.0F; ++ } ++ ++ /** ++ * Creates the GenLayerBiome used for generating the world with the specified ChunkProviderSettings JSON String ++ * *IF AND ONLY IF* this WorldType == WorldType.CUSTOMIZED. ++ * ++ * ++ * @param worldSeed The world seed ++ * @param parentLayer The parent layer to feed into any layer you return ++ * @param chunkSettings The ChunkGeneratorSettings constructed from the custom JSON ++ * @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome ++ */ ++ public net.minecraft.world.gen.layer.GenLayer getBiomeLayer(long worldSeed, net.minecraft.world.gen.layer.GenLayer parentLayer, net.minecraft.world.gen.ChunkGeneratorSettings chunkSettings) ++ { ++ net.minecraft.world.gen.layer.GenLayer ret = new net.minecraft.world.gen.layer.GenLayerBiome(200L, parentLayer, this, chunkSettings); ++ ret = net.minecraft.world.gen.layer.GenLayerZoom.func_75915_a(1000L, ret, 2); ++ ret = new net.minecraft.world.gen.layer.GenLayerBiomeEdge(1000L, ret); ++ return ret; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/biome/Biome.java.patch b/patches_old/minecraft/net/minecraft/world/biome/Biome.java.patch new file mode 100644 index 000000000..1f9850b39 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/Biome.java.patch @@ -0,0 +1,201 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/Biome.java ++++ ../src-work/minecraft/net/minecraft/world/biome/Biome.java +@@ -50,7 +50,7 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +-public abstract class Biome ++public abstract class Biome extends net.minecraftforge.registries.IForgeRegistryEntry.Impl + { + private static final Logger field_150586_aC = LogManager.getLogger(); + protected static final IBlockState field_185365_a = Blocks.field_150348_b.func_176223_P(); +@@ -68,7 +68,7 @@ + protected static final WorldGenTrees field_76757_N = new WorldGenTrees(false); + protected static final WorldGenBigTree field_76758_O = new WorldGenBigTree(false); + protected static final WorldGenSwamp field_76763_Q = new WorldGenSwamp(); +- public static final RegistryNamespaced field_185377_q = new RegistryNamespaced(); ++ public static final RegistryNamespaced field_185377_q = net.minecraftforge.registries.GameData.getWrapper(Biome.class); + private final String field_76791_y; + private final float field_76748_D; + private final float field_76749_E; +@@ -86,6 +86,8 @@ + protected List field_76762_K = Lists.newArrayList(); + protected List field_76755_L = Lists.newArrayList(); + protected List field_82914_M = Lists.newArrayList(); ++ // Forge: Stores the spawnable lists for non-vanilla EnumCreatureTypes. Can't be an EnumMap as that doesn't handle new enum values being added after it's created. ++ protected java.util.Map> modSpawnableLists = com.google.common.collect.Maps.newHashMap(); + + public static int func_185362_a(Biome p_185362_0_) + { +@@ -130,11 +132,12 @@ + this.field_76761_J.add(new Biome.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.field_76755_L.add(new Biome.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.field_82914_M.add(new Biome.SpawnListEntry(EntityBat.class, 10, 8, 8)); ++ this.addDefaultFlowers(); + } + + public BiomeDecorator func_76729_a() + { +- return new BiomeDecorator(); ++ return getModdedBiomeDecorator(new BiomeDecorator()); + } + + public boolean func_185363_b() +@@ -178,7 +181,9 @@ + case AMBIENT: + return this.field_82914_M; + default: +- return Collections.emptyList(); ++ // Forge: Return a non-empty list for non-vanilla EnumCreatureTypes ++ if (!this.modSpawnableLists.containsKey(p_76747_1_)) this.modSpawnableLists.put(p_76747_1_, Lists.newArrayList()); ++ return this.modSpawnableLists.get(p_76747_1_); + } + } + +@@ -230,7 +235,7 @@ + { + double d0 = (double)MathHelper.func_76131_a(this.func_180626_a(p_180627_1_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerGrass.func_77480_a(d0, d1); ++ return getModdedBiomeGrassColor(ColorizerGrass.func_77480_a(d0, d1)); + } + + public final void func_180628_b(World p_180628_1_, Random p_180628_2_, ChunkPrimer p_180628_3_, int p_180628_4_, int p_180628_5_, double p_180628_6_) +@@ -323,7 +328,7 @@ + { + double d0 = (double)MathHelper.func_76131_a(this.func_180626_a(p_180625_1_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerFoliage.func_77470_a(d0, d1); ++ return getModdedBiomeFoliageColor(ColorizerFoliage.func_77470_a(d0, d1)); + } + + public Class func_150562_l() +@@ -389,7 +394,7 @@ + @SideOnly(Side.CLIENT) + public final int func_185361_o() + { +- return this.field_76759_H; ++ return getWaterColorMultiplier(); + } + + public final boolean func_150559_j() +@@ -397,6 +402,84 @@ + return this.field_76766_R; + } + ++ /* ========================================= 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, field_76759_H); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ return event.getNewColor(); ++ } ++ ++ 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.getNewColor(); ++ } ++ ++ 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.getNewColor(); ++ } ++ ++ /** ++ * 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.field_150327_N.func_176223_P().func_177226_a(Blocks.field_150327_N.func_176494_l(), BlockFlower.EnumFlowerType.DANDELION), 20); ++ addFlower(Blocks.field_150328_O.func_176223_P().func_177226_a(Blocks.field_150328_O.func_176494_l(), BlockFlower.EnumFlowerType.POPPY), 10); ++ } ++ ++ /** 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) ++ { ++ if (flowers.isEmpty()) return; ++ FlowerEntry flower = (FlowerEntry)WeightedRandom.func_76271_a(rand, flowers); ++ if (flower == null || flower.state == null || ++ (flower.state.func_177230_c() instanceof net.minecraft.block.BlockBush && ++ !((net.minecraft.block.BlockBush)flower.state.func_177230_c()).func_180671_f(world, pos, flower.state))) ++ { ++ return; ++ } ++ ++ world.func_180501_a(pos, flower.state, 3); ++ } ++ ++ /* ========================================= FORGE END ======================================*/ ++ + public static void func_185358_q() + { + func_185354_a(0, "ocean", new BiomeOcean((new Biome.BiomeProperties("Ocean")).func_185398_c(-1.0F).func_185400_d(0.1F))); +@@ -552,6 +635,7 @@ + public Class field_76300_b; + public int field_76301_c; + public int field_76299_d; ++ private final java.lang.reflect.Constructor ctr; + + public SpawnListEntry(Class p_i1970_1_, int p_i1970_2_, int p_i1970_3_, int p_i1970_4_) + { +@@ -559,12 +643,26 @@ + this.field_76300_b = p_i1970_1_; + this.field_76301_c = p_i1970_3_; + this.field_76299_d = p_i1970_4_; ++ ++ try ++ { ++ ctr = p_i1970_1_.getConstructor(World.class); ++ } ++ catch (NoSuchMethodException e) ++ { ++ throw new RuntimeException(e); ++ } + } + + public String toString() + { + return this.field_76300_b.getSimpleName() + "*(" + this.field_76301_c + "-" + this.field_76299_d + "):" + this.field_76292_a; + } ++ ++ public EntityLiving newInstance(World world) throws Exception ++ { ++ return ctr.newInstance(world); ++ } + } + + public static enum TempCategory diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch new file mode 100644 index 000000000..8e65db285 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -0,0 +1,168 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeDecorator.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeDecorator.java +@@ -92,8 +92,11 @@ + + protected void func_150513_a(Biome p_150513_1_, World p_150513_2_, Random p_150513_3_) + { ++ net.minecraft.util.math.ChunkPos forgeChunkPos = new net.minecraft.util.math.ChunkPos(field_180294_c); // actual ChunkPos instead of BlockPos, used for events ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(p_150513_2_, p_150513_3_, forgeChunkPos)); + this.func_76797_b(p_150513_2_, p_150513_3_); + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND)) + for (int i = 0; i < this.field_76805_H; ++i) + { + int j = p_150513_3_.nextInt(16) + 8; +@@ -101,6 +104,7 @@ + this.field_76810_g.func_180709_b(p_150513_2_, p_150513_3_, p_150513_2_.func_175672_r(this.field_180294_c.func_177982_a(j, 0, k))); + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY)) + for (int i1 = 0; i1 < this.field_76806_I; ++i1) + { + int l1 = p_150513_3_.nextInt(16) + 8; +@@ -108,6 +112,7 @@ + this.field_76809_f.func_180709_b(p_150513_2_, p_150513_3_, p_150513_2_.func_175672_r(this.field_180294_c.func_177982_a(l1, 0, i6))); + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2)) + for (int j1 = 0; j1 < this.field_76801_G; ++j1) + { + int i2 = p_150513_3_.nextInt(16) + 8; +@@ -122,6 +127,7 @@ + ++k1; + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)) + for (int j2 = 0; j2 < k1; ++j2) + { + int k6 = p_150513_3_.nextInt(16) + 8; +@@ -136,6 +142,7 @@ + } + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) + for (int k2 = 0; k2 < this.field_76807_J; ++k2) + { + int l6 = p_150513_3_.nextInt(16) + 8; +@@ -143,6 +150,7 @@ + this.field_76826_u.func_180709_b(p_150513_2_, p_150513_3_, p_150513_2_.func_175645_m(this.field_180294_c.func_177982_a(l6, 0, k10))); + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) + for (int l2 = 0; l2 < this.field_76802_A; ++l2) + { + int i7 = p_150513_3_.nextInt(16) + 8; +@@ -164,6 +172,7 @@ + } + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) + for (int i3 = 0; i3 < this.field_76803_B; ++i3) + { + int j7 = p_150513_3_.nextInt(16) + 8; +@@ -177,6 +186,7 @@ + } + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)) + for (int j3 = 0; j3 < this.field_76804_C; ++j3) + { + int k7 = p_150513_3_.nextInt(16) + 8; +@@ -190,6 +200,7 @@ + } + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD)) + for (int k3 = 0; k3 < this.field_76833_y; ++k3) + { + int l7 = p_150513_3_.nextInt(16) + 8; +@@ -216,6 +227,8 @@ + } + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM)) ++ { + for (int l3 = 0; l3 < this.field_76798_D; ++l3) + { + if (p_150513_3_.nextInt(4) == 0) +@@ -266,7 +279,9 @@ + this.field_76827_t.func_180709_b(p_150513_2_, p_150513_3_, this.field_180294_c.func_177982_a(j4, l15, l8)); + } + } +- ++ } // End of Mushroom generation ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED)) ++ { + for (int k4 = 0; k4 < this.field_76799_E; ++k4) + { + int i9 = p_150513_3_.nextInt(16) + 8; +@@ -292,7 +307,8 @@ + this.field_76825_v.func_180709_b(p_150513_2_, p_150513_3_, this.field_180294_c.func_177982_a(j9, i19, i13)); + } + } +- ++ } // End of Reed generation ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) + if (p_150513_3_.nextInt(32) == 0) + { + int i5 = p_150513_3_.nextInt(16) + 8; +@@ -306,6 +322,7 @@ + } + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS)) + for (int j5 = 0; j5 < this.field_76800_F; ++j5) + { + int l9 = p_150513_3_.nextInt(16) + 8; +@@ -321,6 +338,7 @@ + + if (this.field_76808_K) + { ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) + for (int k5 = 0; k5 < 50; ++k5) + { + int i10 = p_150513_3_.nextInt(16) + 8; +@@ -335,6 +353,7 @@ + } + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_150513_2_, p_150513_3_, forgeChunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) + for (int l5 = 0; l5 < 20; ++l5) + { + int j10 = p_150513_3_.nextInt(16) + 8; +@@ -344,21 +363,35 @@ + (new WorldGenLiquids(Blocks.field_150356_k)).func_180709_b(p_150513_2_, p_150513_3_, blockpos3); + } + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(p_150513_2_, p_150513_3_, forgeChunkPos)); + } + + protected void func_76797_b(World p_76797_1_, Random p_76797_2_) + { ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(p_76797_1_, p_76797_2_, field_180294_c)); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76823_i, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177790_J, this.field_76823_i, this.field_180293_d.field_177791_K, this.field_180293_d.field_177784_L); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76820_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177786_N, this.field_76820_j, this.field_180293_d.field_177787_O, this.field_180293_d.field_177797_P); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180297_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIORITE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177795_V, this.field_180297_k, this.field_180293_d.field_177794_W, this.field_180293_d.field_177801_X); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180296_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRANITE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177799_R, this.field_180296_j, this.field_180293_d.field_177798_S, this.field_180293_d.field_177793_T); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180295_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.ANDESITE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177802_Z, this.field_180295_l, this.field_180293_d.field_177846_aa, this.field_180293_d.field_177847_ab); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76821_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177845_ad, this.field_76821_k, this.field_180293_d.field_177851_ae, this.field_180293_d.field_177853_af); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76818_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177849_ah, this.field_76818_l, this.field_180293_d.field_177832_ai, this.field_180293_d.field_177834_aj); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76819_m, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177830_al, this.field_76819_m, this.field_180293_d.field_177840_am, this.field_180293_d.field_177842_an); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180299_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177838_ap, this.field_180299_p, this.field_180293_d.field_177818_aq, this.field_180293_d.field_177816_ar); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_180298_q, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND)) + this.func_76795_a(p_76797_1_, p_76797_2_, this.field_180293_d.field_177812_at, this.field_180298_q, this.field_180293_d.field_177826_au, this.field_180293_d.field_177824_av); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76831_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS)) + this.func_76793_b(p_76797_1_, p_76797_2_, this.field_180293_d.field_177820_ax, this.field_76831_p, this.field_180293_d.field_177807_ay, this.field_180293_d.field_177805_az); ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(p_76797_1_, p_76797_2_, field_180294_c)); + } + + protected void func_76795_a(World p_76795_1_, Random p_76795_2_, int p_76795_3_, WorldGenerator p_76795_4_, int p_76795_5_, int p_76795_6_) diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch new file mode 100644 index 000000000..8ad23bf52 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeDesert.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeDesert.java +@@ -47,6 +47,7 @@ + { + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DESERT_WELL)) + if (p_180624_2_.nextInt(1000) == 0) + { + int i = p_180624_2_.nextInt(16) + 8; +@@ -55,6 +56,7 @@ + (new WorldGenDesertWells()).func_180709_b(p_180624_1_, p_180624_2_, blockpos); + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL)) + if (p_180624_2_.nextInt(64) == 0) + { + (new WorldGenFossils()).func_180709_b(p_180624_1_, p_180624_2_, p_180624_3_); diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeForest.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeForest.java.patch new file mode 100644 index 000000000..479715fa2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeForest.java.patch @@ -0,0 +1,58 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeForest.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeForest.java +@@ -46,6 +46,17 @@ + { + this.field_76760_I.field_76832_z = -999; + } ++ ++ if (this.field_150632_aF == BiomeForest.Type.FLOWER) //Needs to be done here so we have access to this.type ++ { ++ this.flowers.clear(); ++ for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) ++ { ++ if (type.func_176964_a() == BlockFlower.EnumFlowerColor.YELLOW) continue; ++ if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; ++ addFlower(net.minecraft.init.Blocks.field_150328_O.func_176223_P().func_177226_a(net.minecraft.init.Blocks.field_150328_O.func_176494_l(), type), 10); ++ } ++ } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) +@@ -85,6 +96,8 @@ + this.func_185379_b(p_180624_1_, p_180624_2_, p_180624_3_); + } + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) ++ { // no tab for patch + int i = p_180624_2_.nextInt(5) - 3; + + if (this.field_150632_aF == BiomeForest.Type.FLOWER) +@@ -93,11 +106,13 @@ + } + + this.func_185378_a(p_180624_1_, p_180624_2_, p_180624_3_, i); ++ } + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); + } + + public void func_185379_b(World p_185379_1_, Random p_185379_2_, BlockPos p_185379_3_) + { ++ + for (int i = 0; i < 4; ++i) + { + for (int j = 0; j < 4; ++j) +@@ -106,12 +121,12 @@ + int l = j * 4 + 1 + 8 + p_185379_2_.nextInt(3); + BlockPos blockpos = p_185379_1_.func_175645_m(p_185379_3_.func_177982_a(k, 0, l)); + +- if (p_185379_2_.nextInt(20) == 0) ++ if (p_185379_2_.nextInt(20) == 0 && net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, new net.minecraft.util.math.ChunkPos(p_185379_3_), blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) + { + WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom(); + worldgenbigmushroom.func_180709_b(p_185379_1_, p_185379_2_, blockpos); + } +- else ++ else if (net.minecraftforge.event.terraingen.TerrainGen.decorate(p_185379_1_, p_185379_2_, new net.minecraft.util.math.ChunkPos(p_185379_3_), blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)) + { + WorldGenAbstractTree worldgenabstracttree = this.func_150567_a(p_185379_2_); + worldgenabstracttree.func_175904_e(); diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeHills.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeHills.java.patch new file mode 100644 index 000000000..7f25b2cc3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeHills.java.patch @@ -0,0 +1,63 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeHills.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeHills.java +@@ -39,28 +39,21 @@ + public void func_180624_a(World p_180624_1_, Random p_180624_2_, BlockPos p_180624_3_) + { + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); +- int i = 3 + p_180624_2_.nextInt(6); + +- for (int j = 0; j < i; ++j) +- { +- int k = p_180624_2_.nextInt(16); +- int l = p_180624_2_.nextInt(28) + 4; +- int i1 = p_180624_2_.nextInt(16); +- BlockPos blockpos = p_180624_3_.func_177982_a(k, l, i1); ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(p_180624_1_, p_180624_2_, p_180624_3_)); ++ WorldGenerator emeralds = new EmeraldGenerator(); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_180624_1_, p_180624_2_, emeralds, p_180624_3_, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.EMERALD)) ++ emeralds.func_180709_b(p_180624_1_, p_180624_2_, p_180624_3_); + +- if (p_180624_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150348_b) +- { +- p_180624_1_.func_180501_a(blockpos, Blocks.field_150412_bA.func_176223_P(), 2); +- } +- } +- + for (int j1 = 0; j1 < 7; ++j1) + { + int k1 = p_180624_2_.nextInt(16); + int l1 = p_180624_2_.nextInt(64); + int i2 = p_180624_2_.nextInt(16); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_180624_1_, p_180624_2_, field_82915_S, p_180624_3_.func_177982_a(j1, k1, l1), net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.SILVERFISH)) + this.field_82915_S.func_180709_b(p_180624_1_, p_180624_2_, p_180624_3_.func_177982_a(k1, l1, i2)); + } ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(p_180624_1_, p_180624_2_, p_180624_3_)); + } + + public void func_180622_a(World p_180622_1_, Random p_180622_2_, ChunkPrimer p_180622_3_, int p_180622_4_, int p_180622_5_, double p_180622_6_) +@@ -88,4 +81,25 @@ + EXTRA_TREES, + MUTATED; + } ++ ++ private static class EmeraldGenerator extends WorldGenerator ++ { ++ @Override ++ public boolean func_180709_b(World worldIn, Random rand, BlockPos pos) ++ { ++ int count = 3 + rand.nextInt(6); ++ for (int i = 0; i < count; i++) ++ { ++ int offset = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 8 : 0; // MC-114332 ++ BlockPos blockpos = pos.func_177982_a(rand.nextInt(16) + offset, rand.nextInt(28) + 4, rand.nextInt(16) + offset); ++ ++ net.minecraft.block.state.IBlockState state = worldIn.func_180495_p(blockpos); ++ if (state.func_177230_c().isReplaceableOreGen(state, worldIn, blockpos, net.minecraft.block.state.pattern.BlockMatcher.func_177642_a(Blocks.field_150348_b))) ++ { ++ worldIn.func_180501_a(blockpos, Blocks.field_150412_bA.func_176223_P(), 16 | 2); ++ } ++ } ++ return true; ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch new file mode 100644 index 000000000..6b4b003a1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeJungle.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeJungle.java +@@ -81,10 +81,14 @@ + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); + int i = p_180624_2_.nextInt(16) + 8; + int j = p_180624_2_.nextInt(16) + 8; +- int k = p_180624_2_.nextInt(p_180624_1_.func_175645_m(p_180624_3_.func_177982_a(i, 0, j)).func_177956_o() * 2); ++ int height = p_180624_1_.func_175645_m(p_180624_3_.func_177982_a(i, 0, j)).func_177956_o() * 2; // could == 0, which crashes nextInt ++ if (height < 1) height = 1; ++ int k = p_180624_2_.nextInt(height); ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), p_180624_3_.func_177982_a(i, k, j), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) + (new WorldGenMelon()).func_180709_b(p_180624_1_, p_180624_2_, p_180624_3_.func_177982_a(i, k, j)); + WorldGenVines worldgenvines = new WorldGenVines(); + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) + for (int j1 = 0; j1 < 50; ++j1) + { + k = p_180624_2_.nextInt(16) + 8; diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch new file mode 100644 index 000000000..5f13874f7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeMesa.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeMesa.java +@@ -318,13 +318,13 @@ + @SideOnly(Side.CLIENT) + public int func_180625_c(BlockPos p_180625_1_) + { +- return 10387789; ++ return getModdedBiomeFoliageColor(10387789); + } + + @SideOnly(Side.CLIENT) + public int func_180627_b(BlockPos p_180627_1_) + { +- return 9470285; ++ return getModdedBiomeGrassColor(9470285); + } + + class Decorator extends BiomeDecorator +@@ -336,6 +336,7 @@ + protected void func_76797_b(World p_76797_1_, Random p_76797_2_) + { + super.func_76797_b(p_76797_1_, p_76797_2_); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(p_76797_1_, p_76797_2_, field_76819_m, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) + this.func_76795_a(p_76797_1_, p_76797_2_, 20, this.field_76819_m, 32, 80); + } + } diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomePlains.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomePlains.java.patch new file mode 100644 index 000000000..71561fc4c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomePlains.java.patch @@ -0,0 +1,41 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomePlains.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomePlains.java +@@ -80,6 +80,7 @@ + this.field_76760_I.field_76803_B = 10; + field_180280_ag.func_180710_a(BlockDoublePlant.EnumPlantType.GRASS); + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) + for (int i = 0; i < 7; ++i) + { + int j = p_180624_2_.nextInt(16) + 8; +@@ -89,7 +90,7 @@ + } + } + +- if (this.field_150628_aC) ++ if (this.field_150628_aC && net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) + { + field_180280_ag.func_180710_a(BlockDoublePlant.EnumPlantType.SUNFLOWER); + +@@ -105,6 +106,21 @@ + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); + } + ++ @Override ++ public void addDefaultFlowers() ++ { ++ BlockFlower red = net.minecraft.init.Blocks.field_150328_O; ++ BlockFlower yel = net.minecraft.init.Blocks.field_150327_N; ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.ORANGE_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.RED_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.PINK_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.WHITE_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.POPPY), 20); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.HOUSTONIA), 20); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.OXEYE_DAISY), 20); ++ addFlower(yel.func_176223_P().func_177226_a(yel.func_176494_l(), BlockFlower.EnumFlowerType.DANDELION), 30); ++ } ++ + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return (WorldGenAbstractTree)(p_150567_1_.nextInt(3) == 0 ? field_76758_O : field_76757_N); diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch new file mode 100644 index 000000000..2506b7829 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch @@ -0,0 +1,38 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeProvider.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeProvider.java +@@ -22,11 +22,12 @@ + private GenLayer field_76945_e; + private final BiomeCache field_76942_f; + private final List field_76943_g; ++ public static List allowedBiomes = Lists.newArrayList(Biomes.field_76767_f, Biomes.field_76772_c, Biomes.field_76768_g, Biomes.field_76784_u, Biomes.field_76785_t, Biomes.field_76782_w, Biomes.field_76792_x); + + protected BiomeProvider() + { + this.field_76942_f = new BiomeCache(this); +- this.field_76943_g = Lists.newArrayList(Biomes.field_76767_f, Biomes.field_76772_c, Biomes.field_76768_g, Biomes.field_76784_u, Biomes.field_76785_t, Biomes.field_76782_w, Biomes.field_76792_x); ++ this.field_76943_g = Lists.newArrayList(allowedBiomes); + } + + private BiomeProvider(long p_i45744_1_, WorldType p_i45744_3_, String p_i45744_4_) +@@ -39,6 +40,7 @@ + } + + GenLayer[] agenlayer = GenLayer.func_180781_a(p_i45744_1_, p_i45744_3_, this.field_190945_a); ++ agenlayer = getModdedBiomeGenerators(p_i45744_3_, p_i45744_1_, agenlayer); + this.field_76944_d = agenlayer[0]; + this.field_76945_e = agenlayer[1]; + } +@@ -207,6 +209,13 @@ + this.field_76942_f.func_76838_a(); + } + ++ 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.getNewBiomeGens(); ++ } ++ + public boolean func_190944_c() + { + return this.field_190945_a != null && this.field_190945_a.field_177779_F >= 0; diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch new file mode 100644 index 000000000..5ba3254b4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeSavanna.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeSavanna.java +@@ -39,6 +39,7 @@ + { + field_180280_ag.func_180710_a(BlockDoublePlant.EnumPlantType.GRASS); + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) + for (int i = 0; i < 7; ++i) + { + int j = p_180624_2_.nextInt(16) + 8; diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch new file mode 100644 index 000000000..01957a696 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeSnow.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeSnow.java +@@ -56,7 +56,7 @@ + + public void func_180624_a(World p_180624_1_, Random p_180624_2_, BlockPos p_180624_3_) + { +- if (this.field_150615_aC) ++ if (this.field_150615_aC && net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.ICE)) + { + for (int i = 0; i < 3; ++i) + { diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch new file mode 100644 index 000000000..b39501ffa --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeSwamp.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeSwamp.java +@@ -79,6 +79,7 @@ + { + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL)) + if (p_180624_2_.nextInt(64) == 0) + { + (new WorldGenFossils()).func_180709_b(p_180624_1_, p_180624_2_, p_180624_3_); +@@ -89,12 +90,18 @@ + public int func_180627_b(BlockPos p_180627_1_) + { + double d0 = field_180281_af.func_151601_a((double)p_180627_1_.func_177958_n() * 0.0225D, (double)p_180627_1_.func_177952_p() * 0.0225D); +- return d0 < -0.1D ? 5011004 : 6975545; ++ return getModdedBiomeGrassColor(d0 < -0.1D ? 5011004 : 6975545); + } + + @SideOnly(Side.CLIENT) + public int func_180625_c(BlockPos p_180625_1_) + { +- return 6975545; ++ return getModdedBiomeFoliageColor(6975545); + } ++ ++ @Override ++ public void addDefaultFlowers() ++ { ++ addFlower(Blocks.field_150328_O.func_176223_P().func_177226_a(Blocks.field_150328_O.func_176494_l(), BlockFlower.EnumFlowerType.BLUE_ORCHID), 10); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch b/patches_old/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch new file mode 100644 index 000000000..575398368 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeTaiga.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeTaiga.java +@@ -67,7 +67,7 @@ + + public void func_180624_a(World p_180624_1_, Random p_180624_2_, BlockPos p_180624_3_) + { +- if (this.field_150644_aH == BiomeTaiga.Type.MEGA || this.field_150644_aH == BiomeTaiga.Type.MEGA_SPRUCE) ++ if ((this.field_150644_aH == BiomeTaiga.Type.MEGA || this.field_150644_aH == BiomeTaiga.Type.MEGA_SPRUCE) && net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.ROCK)) + { + int i = p_180624_2_.nextInt(3); + +@@ -82,6 +82,7 @@ + + field_180280_ag.func_180710_a(BlockDoublePlant.EnumPlantType.FERN); + ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(p_180624_1_, p_180624_2_, new net.minecraft.util.math.ChunkPos(p_180624_3_), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) + for (int i1 = 0; i1 < 7; ++i1) + { + int j1 = p_180624_2_.nextInt(16) + 8; diff --git a/patches_old/minecraft/net/minecraft/world/border/WorldBorder.java.patch b/patches_old/minecraft/net/minecraft/world/border/WorldBorder.java.patch new file mode 100644 index 000000000..fea866e4c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/border/WorldBorder.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/world/border/WorldBorder.java ++++ ../src-work/minecraft/net/minecraft/world/border/WorldBorder.java +@@ -284,4 +284,9 @@ + iborderlistener.func_177690_b(this, p_177747_1_); + } + } ++ ++ public void removeListener(IBorderListener listener) ++ { ++ this.field_177758_a.remove(listener); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch new file mode 100644 index 000000000..ed98b669a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/BlockStateContainer.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/BlockStateContainer.java +@@ -30,6 +30,10 @@ + + private void func_186012_b(int p_186012_1_) + { ++ setBits(p_186012_1_, false); ++ } ++ private void setBits(int p_186012_1_, boolean forceBits) ++ { + if (p_186012_1_ != this.field_186024_e) + { + this.field_186024_e = p_186012_1_; +@@ -47,6 +51,8 @@ + { + this.field_186022_c = field_186023_d; + this.field_186024_e = MathHelper.func_151241_e(Block.field_176229_d.func_186804_a()); ++ if (forceBits) ++ this.field_186024_e = p_186012_1_; + } + + this.field_186022_c.func_186041_a(field_186020_a); +@@ -102,11 +108,15 @@ + + if (this.field_186024_e != i) + { +- this.func_186012_b(i); ++ this.setBits(i, true); //Forge, Force bit density to fix network issues, resize below if needed. + } + + this.field_186022_c.func_186038_a(p_186010_1_); + p_186010_1_.func_186873_b(this.field_186021_b.func_188143_a()); ++ ++ int regSize = MathHelper.func_151241_e(Block.field_176229_d.func_186804_a()); ++ if (this.field_186022_c == field_186023_d && this.field_186024_e != regSize) // Resize bits to fit registry. ++ this.func_186008_a(regSize, field_186020_a); + } + + public void func_186009_b(PacketBuffer p_186009_1_) diff --git a/patches_old/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/Chunk.java.patch new file mode 100644 index 000000000..eb15c03a9 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -0,0 +1,372 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/Chunk.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/Chunk.java +@@ -41,7 +41,7 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +-public class Chunk ++public class Chunk implements net.minecraftforge.common.capabilities.ICapabilityProvider + { + private static final Logger field_150817_t = LogManager.getLogger(); + public static final ExtendedBlockStorage field_186036_a = null; +@@ -91,6 +91,7 @@ + + Arrays.fill(this.field_76638_b, -999); + Arrays.fill(this.field_76651_r, (byte) - 1); ++ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); + } + + public Chunk(World p_i45645_1_, ChunkPrimer p_i45645_2_, int p_i45645_3_, int p_i45645_4_) +@@ -179,7 +180,7 @@ + { + IBlockState iblockstate = this.func_186032_a(j, l - 1, k); + +- if (iblockstate.func_185891_c() != 0) ++ if (this.func_150808_b(j, l - 1, k) != 0) + { + this.field_76634_f[k << 4 | j] = l; + +@@ -452,12 +453,13 @@ + + public int func_177437_b(BlockPos p_177437_1_) + { +- return this.func_177435_g(p_177437_1_).func_185891_c(); ++ return this.func_177435_g(p_177437_1_).getLightOpacity(this.field_76637_e, p_177437_1_); + } + + private int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) + { +- return this.func_186032_a(p_150808_1_, p_150808_2_, p_150808_3_).func_185891_c(); ++ IBlockState state = this.func_186032_a(p_150808_1_, p_150808_2_, p_150808_3_); //Forge: Can sometimes be called before we are added to the global world list. So use the less accurate one during that. It'll be recalculated later ++ return !field_76636_d ? state.func_185891_c() : state.getLightOpacity(field_76637_e, new BlockPos(this.field_76635_g << 4 | p_150808_1_ & 15, p_150808_2_, this.field_76647_h << 4 | p_150808_3_ & 15)); + } + + public IBlockState func_177435_g(BlockPos p_177435_1_) +@@ -539,6 +541,7 @@ + { + Block block = p_177436_2_.func_177230_c(); + Block block1 = iblockstate.func_177230_c(); ++ int k1 = iblockstate.getLightOpacity(this.field_76637_e, p_177436_1_); // Relocate old light value lookup here, so that it is called before TE is removed. + ExtendedBlockStorage extendedblockstorage = this.field_76652_q[j >> 4]; + boolean flag = false; + +@@ -556,14 +559,19 @@ + + extendedblockstorage.func_177484_a(i, j & 15, k, p_177436_2_); + +- if (block1 != block) ++ //if (block1 != block) + { + if (!this.field_76637_e.field_72995_K) + { ++ if (block1 != block) //Only fire block breaks when the block changes. + block1.func_180663_b(this.field_76637_e, p_177436_1_, iblockstate); ++ TileEntity te = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); ++ if (te != null && te.shouldRefresh(this.field_76637_e, p_177436_1_, iblockstate, p_177436_2_)) this.field_76637_e.func_175713_t(p_177436_1_); + } +- else if (block1 instanceof ITileEntityProvider) ++ else if (block1.hasTileEntity(iblockstate)) + { ++ TileEntity te = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); ++ if (te != null && te.shouldRefresh(this.field_76637_e, p_177436_1_, iblockstate, p_177436_2_)) + this.field_76637_e.func_175713_t(p_177436_1_); + } + } +@@ -580,8 +588,7 @@ + } + else + { +- int j1 = p_177436_2_.func_185891_c(); +- int k1 = iblockstate.func_185891_c(); ++ int j1 = p_177436_2_.getLightOpacity(this.field_76637_e, p_177436_1_); + + if (j1 > 0) + { +@@ -601,28 +608,19 @@ + } + } + +- if (block1 instanceof ITileEntityProvider) ++ // If capturing blocks, only run block physics for TE's. Non-TE's are handled in ForgeHooks.onPlaceItemIntoWorld ++ if (!this.field_76637_e.field_72995_K && block1 != block && (!this.field_76637_e.captureBlockSnapshots || block.hasTileEntity(p_177436_2_))) + { +- TileEntity tileentity = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); +- +- if (tileentity != null) +- { +- tileentity.func_145836_u(); +- } +- } +- +- if (!this.field_76637_e.field_72995_K && block1 != block) +- { + block.func_176213_c(this.field_76637_e, p_177436_1_, p_177436_2_); + } + +- if (block instanceof ITileEntityProvider) ++ if (block.hasTileEntity(p_177436_2_)) + { + TileEntity tileentity1 = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); + + if (tileentity1 == null) + { +- tileentity1 = ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, block.func_176201_c(p_177436_2_)); ++ tileentity1 = block.createTileEntity(this.field_76637_e, p_177436_2_); + this.field_76637_e.func_175690_a(p_177436_1_, tileentity1); + } + +@@ -738,6 +736,7 @@ + k = this.field_76645_j.length - 1; + } + ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EnteringChunk(p_76612_1_, this.field_76635_g, this.field_76647_h, p_76612_1_.field_70176_ah, p_76612_1_.field_70164_aj)); + p_76612_1_.field_70175_ag = true; + p_76612_1_.field_70176_ah = this.field_76635_g; + p_76612_1_.field_70162_ai = k; +@@ -778,7 +777,7 @@ + { + IBlockState iblockstate = this.func_177435_g(p_177422_1_); + Block block = iblockstate.func_177230_c(); +- return !block.func_149716_u() ? null : ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, iblockstate.func_177230_c().func_176201_c(iblockstate)); ++ return !block.hasTileEntity(iblockstate) ? null : block.createTileEntity(this.field_76637_e, iblockstate); + } + + @Nullable +@@ -786,6 +785,12 @@ + { + TileEntity tileentity = this.field_150816_i.get(p_177424_1_); + ++ if (tileentity != null && tileentity.func_145837_r()) ++ { ++ field_150816_i.remove(p_177424_1_); ++ tileentity = null; ++ } ++ + if (tileentity == null) + { + if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE) +@@ -795,14 +800,9 @@ + } + else if (p_177424_2_ == Chunk.EnumCreateEntityType.QUEUED) + { +- this.field_177447_w.add(p_177424_1_); ++ this.field_177447_w.add(p_177424_1_.func_185334_h()); + } + } +- else if (tileentity.func_145837_r()) +- { +- this.field_150816_i.remove(p_177424_1_); +- return null; +- } + + return tileentity; + } +@@ -819,10 +819,11 @@ + + public void func_177426_a(BlockPos p_177426_1_, TileEntity p_177426_2_) + { ++ if (p_177426_2_.func_145831_w() != this.field_76637_e) //Forge don't call unless it's changed, could screw up bad mods. + p_177426_2_.func_145834_a(this.field_76637_e); + p_177426_2_.func_174878_a(p_177426_1_); + +- if (this.func_177435_g(p_177426_1_).func_177230_c() instanceof ITileEntityProvider) ++ if (this.func_177435_g(p_177426_1_).func_177230_c().hasTileEntity(this.func_177435_g(p_177426_1_))) + { + if (this.field_150816_i.containsKey(p_177426_1_)) + { +@@ -854,12 +855,14 @@ + + for (ClassInheritanceMultiMap classinheritancemultimap : this.field_76645_j) + { +- this.field_76637_e.func_175650_b(classinheritancemultimap); ++ this.field_76637_e.func_175650_b(com.google.common.collect.ImmutableList.copyOf(classinheritancemultimap)); + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(this)); + } + + public void func_76623_d() + { ++ java.util.Arrays.stream(field_76645_j).forEach(multimap -> com.google.common.collect.Lists.newArrayList(multimap.func_180215_b(net.minecraft.entity.player.EntityPlayer.class)).forEach(player -> field_76637_e.func_72866_a(player, false))); // FORGE - Fix for MC-92916 + this.field_76636_d = false; + + for (TileEntity tileentity : this.field_150816_i.values()) +@@ -871,6 +874,7 @@ + { + this.field_76637_e.func_175681_c(classinheritancemultimap); + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Unload(this)); + } + + public void func_76630_e() +@@ -880,8 +884,8 @@ + + public void func_177414_a(@Nullable Entity p_177414_1_, AxisAlignedBB p_177414_2_, List p_177414_3_, Predicate p_177414_4_) + { +- int i = MathHelper.func_76128_c((p_177414_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_177414_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_177414_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_177414_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); + +@@ -918,8 +922,8 @@ + + public void func_177430_a(Class p_177430_1_, AxisAlignedBB p_177430_2_, List p_177430_3_, Predicate p_177430_4_) + { +- int i = MathHelper.func_76128_c((p_177430_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_177430_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_177430_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_177430_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); + +@@ -997,6 +1001,9 @@ + + protected void func_186034_a(IChunkGenerator p_186034_1_) + { ++ if (populating != null && net.minecraftforge.common.ForgeModContainer.logCascadingWorldGeneration) logCascadingWorldGeneration(); ++ ChunkPos prev = populating; ++ populating = this.func_76632_l(); + if (this.func_177419_t()) + { + if (p_186034_1_.func_185933_a(this, this.field_76635_g, this.field_76647_h)) +@@ -1008,8 +1015,10 @@ + { + this.func_150809_p(); + p_186034_1_.func_185931_b(this.field_76635_g, this.field_76647_h); ++ net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(this.field_76635_g, this.field_76647_h, this.field_76637_e, p_186034_1_, this.field_76637_e.func_72863_F()); + this.func_76630_e(); + } ++ populating = prev; + } + + public BlockPos func_177440_h(BlockPos p_177440_1_) +@@ -1064,7 +1073,7 @@ + { + BlockPos blockpos = this.field_177447_w.poll(); + +- if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.func_177435_g(blockpos).func_177230_c().func_149716_u()) ++ if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.func_177435_g(blockpos).func_177230_c().hasTileEntity(this.func_177435_g(blockpos))) + { + TileEntity tileentity = this.func_177422_i(blockpos); + this.field_76637_e.func_175690_a(blockpos, tileentity); +@@ -1128,6 +1137,13 @@ + @SideOnly(Side.CLIENT) + public void func_186033_a(PacketBuffer p_186033_1_, int p_186033_2_, boolean p_186033_3_) + { ++ for(TileEntity tileEntity : field_150816_i.values()) ++ { ++ tileEntity.func_145836_u(); ++ tileEntity.func_145832_p(); ++ tileEntity.func_145838_q(); ++ } ++ + boolean flag = this.field_76637_e.field_73011_w.func_191066_m(); + + for (int i = 0; i < this.field_76652_q.length; ++i) +@@ -1176,10 +1192,16 @@ + this.field_76646_k = true; + this.func_76590_a(); + ++ List invalidList = new java.util.ArrayList(); ++ + for (TileEntity tileentity : this.field_150816_i.values()) + { ++ if (tileentity.shouldRefresh(this.field_76637_e, tileentity.func_174877_v(), tileentity.func_145838_q().func_176203_a(tileentity.func_145832_p()), func_177435_g(tileentity.func_174877_v()))) ++ invalidList.add(tileentity); + tileentity.func_145836_u(); + } ++ ++ for (TileEntity te : invalidList) te.func_145843_s(); + } + + public Biome func_177411_a(BlockPos p_177411_1_, BiomeProvider p_177411_2_) +@@ -1244,13 +1266,13 @@ + BlockPos blockpos1 = blockpos.func_177982_a(k, (j << 4) + i1, l); + boolean flag = i1 == 0 || i1 == 15 || k == 0 || k == 15 || l == 0 || l == 15; + +- if (this.field_76652_q[j] == field_186036_a && flag || this.field_76652_q[j] != field_186036_a && this.field_76652_q[j].func_177485_a(k, i1, l).func_185904_a() == Material.field_151579_a) ++ if (this.field_76652_q[j] == field_186036_a && flag || this.field_76652_q[j] != field_186036_a && this.field_76652_q[j].func_177485_a(k, i1, l).func_177230_c().isAir(this.field_76652_q[j].func_177485_a(k, i1, l), this.field_76637_e, blockpos1)) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + BlockPos blockpos2 = blockpos1.func_177972_a(enumfacing); + +- if (this.field_76637_e.func_180495_p(blockpos2).func_185906_d() > 0) ++ if (this.field_76637_e.func_180495_p(blockpos2).getLightValue(this.field_76637_e, blockpos2) > 0) + { + this.field_76637_e.func_175664_x(blockpos2); + } +@@ -1381,7 +1403,7 @@ + { + blockpos$mutableblockpos.func_181079_c(blockpos$mutableblockpos.func_177958_n(), l, blockpos$mutableblockpos.func_177952_p()); + +- if (this.func_177435_g(blockpos$mutableblockpos).func_185906_d() > 0) ++ if (this.func_177435_g(blockpos$mutableblockpos).getLightValue(this.field_76637_e, blockpos$mutableblockpos) > 0) + { + this.field_76637_e.func_175664_x(blockpos$mutableblockpos); + } +@@ -1420,6 +1442,7 @@ + else + { + System.arraycopy(p_177420_1_, 0, this.field_76634_f, 0, this.field_76634_f.length); ++ this.field_82912_p = com.google.common.primitives.Ints.min(this.field_76634_f); // Forge: fix MC-117412 + } + } + +@@ -1489,4 +1512,55 @@ + QUEUED, + CHECK; + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * Removes the tile entity at the specified position, only if it's ++ * marked as invalid. ++ */ ++ public void removeInvalidTileEntity(BlockPos pos) ++ { ++ if (field_76636_d) ++ { ++ TileEntity entity = (TileEntity)field_150816_i.get(pos); ++ if (entity != null && entity.func_145837_r()) ++ { ++ field_150816_i.remove(pos); ++ } ++ } ++ } ++ ++ private static ChunkPos populating = null; // keep track of cascading chunk generation during chunk population ++ ++ private void logCascadingWorldGeneration() ++ { ++ net.minecraftforge.fml.common.ModContainer activeModContainer = net.minecraftforge.fml.common.Loader.instance().activeModContainer(); ++ String format = "{} loaded a new chunk {} in dimension {} ({}) while populating chunk {}, causing cascading worldgen lag."; ++ ++ if (activeModContainer == null) { // vanilla minecraft has problems too (MC-114332), log it at a quieter level. ++ net.minecraftforge.fml.common.FMLLog.log.debug(format, "Minecraft", this.func_76632_l(), this.field_76637_e.field_73011_w.getDimension(), this.field_76637_e.field_73011_w.func_186058_p().func_186065_b(), populating); ++ net.minecraftforge.fml.common.FMLLog.log.debug("Consider setting 'fixVanillaCascading' to 'true' in the Forge config to fix many cases where this occurs in the base game."); ++ } else { ++ net.minecraftforge.fml.common.FMLLog.log.warn(format, activeModContainer.getName(), this.func_76632_l(), this.field_76637_e.field_73011_w.getDimension(), this.field_76637_e.field_73011_w.func_186058_p().func_186065_b(), populating); ++ net.minecraftforge.fml.common.FMLLog.log.warn("Please report this to the mod's issue tracker. This log can be disabled in the Forge config."); ++ } ++ } ++ ++ private final net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; ++ @Nullable ++ public net.minecraftforge.common.capabilities.CapabilityDispatcher getCapabilities() ++ { ++ return capabilities; ++ } ++ @Override ++ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable EnumFacing facing) ++ { ++ return capabilities == null ? false : capabilities.hasCapability(capability, facing); ++ } ++ @Override ++ @Nullable ++ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable EnumFacing facing) ++ { ++ return capabilities == null ? null : capabilities.getCapability(capability, facing); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch new file mode 100644 index 000000000..2d4bf100d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -0,0 +1,191 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +@@ -49,9 +49,31 @@ + this.field_193416_e = p_i46673_2_; + } + ++ @Deprecated // TODO: remove (1.13) ++ public boolean chunkExists(World world, int x, int z) ++ { ++ return func_191063_a(x, z); ++ } ++ + @Nullable + public Chunk func_75815_a(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException + { ++ Object[] data = this.loadChunk__Async(p_75815_1_, p_75815_2_, p_75815_3_); ++ ++ if (data != null) ++ { ++ Chunk chunk = (Chunk) data[0]; ++ NBTTagCompound nbttagcompound = (NBTTagCompound) data[1]; ++ this.loadEntities(p_75815_1_, nbttagcompound.func_74775_l("Level"), chunk); ++ return chunk; ++ } ++ ++ return null; ++ } ++ ++ @Nullable ++ public Object[] loadChunk__Async(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException ++ { + ChunkPos chunkpos = new ChunkPos(p_75815_2_, p_75815_3_); + NBTTagCompound nbttagcompound = this.field_75828_a.get(chunkpos); + +@@ -67,7 +89,7 @@ + nbttagcompound = this.field_193416_e.func_188257_a(FixTypes.CHUNK, CompressedStreamTools.func_74794_a(datainputstream)); + } + +- return this.func_75822_a(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound); ++ return this.checkedReadChunkFromNBT__Async(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound); + } + + public boolean func_191063_a(int p_191063_1_, int p_191063_2_) +@@ -80,6 +102,13 @@ + @Nullable + protected Chunk func_75822_a(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) + { ++ Object[] data = this.checkedReadChunkFromNBT__Async(p_75822_1_, p_75822_2_, p_75822_3_, p_75822_4_); ++ return data != null ? (Chunk)data[0] : null; ++ } ++ ++ @Nullable ++ protected Object[] checkedReadChunkFromNBT__Async(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) ++ { + if (!p_75822_4_.func_150297_b("Level", 10)) + { + field_151505_a.error("Chunk file at {},{} is missing level data, skipping", Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_)); +@@ -103,10 +132,29 @@ + field_151505_a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(chunk.field_76635_g), Integer.valueOf(chunk.field_76647_h)); + nbttagcompound.func_74768_a("xPos", p_75822_2_); + nbttagcompound.func_74768_a("zPos", p_75822_3_); ++ ++ // Have to move tile entities since we don't load them at this stage ++ NBTTagList _tileEntities = nbttagcompound.func_150295_c("TileEntities", 10); ++ ++ if (_tileEntities != null) ++ { ++ for (int te = 0; te < _tileEntities.func_74745_c(); te++) ++ { ++ NBTTagCompound _nbt = (NBTTagCompound) _tileEntities.func_150305_b(te); ++ _nbt.func_74768_a("x", p_75822_2_ * 16 + (_nbt.func_74762_e("x") - chunk.field_76635_g * 16)); ++ _nbt.func_74768_a("z", p_75822_3_ * 16 + (_nbt.func_74762_e("z") - chunk.field_76647_h * 16)); ++ } ++ } ++ + chunk = this.func_75823_a(p_75822_1_, nbttagcompound); + } + +- return chunk; ++ Object[] data = new Object[2]; ++ data[0] = chunk; ++ data[1] = p_75822_4_; ++ // event is fired in ChunkIOProvider.callStage2 since it must be fired after TE's load. ++ // MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(chunk, par4NBTTagCompound)); ++ return data; + } + } + } +@@ -121,7 +169,10 @@ + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound.func_74782_a("Level", nbttagcompound1); + nbttagcompound.func_74768_a("DataVersion", 1343); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(nbttagcompound); + this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1); ++ net.minecraftforge.common.ForgeChunkManager.storeChunkNBT(p_75816_2_, nbttagcompound1); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(p_75816_2_, nbttagcompound)); + this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound); + } + catch (Exception exception) +@@ -305,11 +356,19 @@ + { + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + ++ try ++ { + if (entity.func_70039_c(nbttagcompound2)) + { + p_75820_1_.func_177409_g(true); + nbttaglist1.func_74742_a(nbttagcompound2); + } ++ } ++ catch (Exception e) ++ { ++ net.minecraftforge.fml.common.FMLLog.log.error("An Entity type {} has thrown an exception trying to write state. It will not persist. Report this to the mod author", ++ entity.getClass().getName(), e); ++ } + } + } + +@@ -318,8 +377,16 @@ + + for (TileEntity tileentity : p_75820_1_.func_177434_r().values()) + { ++ try ++ { + NBTTagCompound nbttagcompound3 = tileentity.func_189515_b(new NBTTagCompound()); + nbttaglist2.func_74742_a(nbttagcompound3); ++ } ++ catch (Exception e) ++ { ++ net.minecraftforge.fml.common.FMLLog.log.error("A TileEntity type {} has throw an exception trying to write state. It will not persist. Report this to the mod author", ++ tileentity.getClass().getName(), e); ++ } + } + + p_75820_3_.func_74782_a("TileEntities", nbttaglist2); +@@ -345,6 +412,18 @@ + + p_75820_3_.func_74782_a("TileTicks", nbttaglist3); + } ++ ++ if (p_75820_1_.getCapabilities() != null) ++ { ++ try ++ { ++ p_75820_3_.func_74782_a("ForgeCaps", p_75820_1_.getCapabilities().serializeNBT()); ++ } ++ catch (Exception exception) ++ { ++ net.minecraftforge.fml.common.FMLLog.log.error("A capability provider has thrown an exception trying to write state. It will not persist. Report this to the mod author", exception); ++ } ++ } + } + + private Chunk func_75823_a(World p_75823_1_, NBTTagCompound p_75823_2_) +@@ -388,6 +467,16 @@ + chunk.func_76616_a(p_75823_2_.func_74770_j("Biomes")); + } + ++ if (chunk.getCapabilities() != null && p_75823_2_.func_74764_b("ForgeCaps")) { ++ chunk.getCapabilities().deserializeNBT(p_75823_2_.func_74775_l("ForgeCaps")); ++ } ++ ++ // End this method here and split off entity loading to another method ++ return chunk; ++ } ++ ++ public void loadEntities(World p_75823_1_, NBTTagCompound p_75823_2_, Chunk chunk) ++ { + NBTTagList nbttaglist1 = p_75823_2_.func_150295_c("Entities", 10); + + for (int j1 = 0; j1 < nbttaglist1.func_74745_c(); ++j1) +@@ -431,8 +520,6 @@ + p_75823_1_.func_180497_b(new BlockPos(nbttagcompound3.func_74762_e("x"), nbttagcompound3.func_74762_e("y"), nbttagcompound3.func_74762_e("z")), block, nbttagcompound3.func_74762_e("t"), nbttagcompound3.func_74762_e("p")); + } + } +- +- return chunk; + } + + @Nullable +@@ -563,4 +650,9 @@ + return entity; + } + } ++ ++ public int getPendingSaveCount() ++ { ++ return this.field_75828_a.size(); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch new file mode 100644 index 000000000..38e5ac4e7 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java +@@ -22,18 +22,12 @@ + { + File file1 = this.func_75765_b(); + +- if (p_75763_1_ instanceof WorldProviderHell) ++ if (p_75763_1_.getSaveFolder() != null) + { +- File file3 = new File(file1, "DIM-1"); ++ File file3 = new File(file1, p_75763_1_.getSaveFolder()); + file3.mkdirs(); + return new AnvilChunkLoader(file3, this.field_186341_a); + } +- else if (p_75763_1_ instanceof WorldProviderEnd) +- { +- File file2 = new File(file1, "DIM1"); +- file2.mkdirs(); +- return new AnvilChunkLoader(file2, this.field_186341_a); +- } + else + { + return new AnvilChunkLoader(file1, this.field_186341_a); diff --git a/patches_old/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch new file mode 100644 index 000000000..945276017 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java +@@ -34,6 +34,8 @@ + + public void func_177484_a(int p_177484_1_, int p_177484_2_, int p_177484_3_, IBlockState p_177484_4_) + { ++ if (p_177484_4_ instanceof net.minecraftforge.common.property.IExtendedBlockState) ++ p_177484_4_ = ((net.minecraftforge.common.property.IExtendedBlockState) p_177484_4_).getClean(); + IBlockState iblockstate = this.func_177485_a(p_177484_1_, p_177484_2_, p_177484_3_); + Block block = iblockstate.func_177230_c(); + Block block1 = p_177484_4_.func_177230_c(); diff --git a/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch b/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch new file mode 100644 index 000000000..59c2aaaf2 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/RegionFile.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/RegionFile.java +@@ -95,6 +95,12 @@ + } + } + ++ @Deprecated // TODO: remove (1.13) ++ public synchronized boolean chunkExists(int x, int z) ++ { ++ return func_76709_c(x, z); ++ } ++ + @Nullable + + public synchronized DataInputStream func_76704_a(int p_76704_1_, int p_76704_2_) diff --git a/patches_old/minecraft/net/minecraft/world/end/DragonFightManager.java.patch b/patches_old/minecraft/net/minecraft/world/end/DragonFightManager.java.patch new file mode 100644 index 000000000..1232aa902 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/end/DragonFightManager.java.patch @@ -0,0 +1,33 @@ +--- ../src-base/minecraft/net/minecraft/world/end/DragonFightManager.java ++++ ../src-work/minecraft/net/minecraft/world/end/DragonFightManager.java +@@ -82,6 +82,7 @@ + + this.field_186117_k = p_i46669_2_.func_74767_n("DragonKilled"); + this.field_186118_l = p_i46669_2_.func_74767_n("PreviouslyKilled"); ++ this.field_186120_n = !p_i46669_2_.func_74767_n("LegacyScanPerformed"); // Forge: fix MC-105080 + + if (p_i46669_2_.func_74767_n("IsRespawning")) + { +@@ -128,6 +129,7 @@ + + nbttagcompound.func_74757_a("DragonKilled", this.field_186117_k); + nbttagcompound.func_74757_a("PreviouslyKilled", this.field_186118_l); ++ nbttagcompound.func_74757_a("LegacyScanPerformed", !this.field_186120_n); // Forge: fix MC-105080 + + if (this.field_186121_o != null) + { +@@ -582,4 +584,14 @@ + } + } + } ++ ++ public void addPlayer(EntityPlayerMP player) ++ { ++ this.field_186109_c.func_186760_a(player); ++ } ++ ++ public void removePlayer(EntityPlayerMP player) ++ { ++ this.field_186109_c.func_186761_b(player); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch new file mode 100644 index 000000000..0a8b5667b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch @@ -0,0 +1,73 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java +@@ -43,6 +43,9 @@ + double[] field_185967_f; + double[] field_185968_g; + private final WorldGenEndIsland field_185975_r = new WorldGenEndIsland(); ++ // temporary variables used during event handling ++ private int chunkX = 0; ++ private int chunkZ = 0; + + public ChunkGeneratorEnd(World p_i47241_1_, boolean p_i47241_2_, long p_i47241_3_, BlockPos p_i47241_5_) + { +@@ -56,6 +59,17 @@ + this.field_73214_a = new NoiseGeneratorOctaves(this.field_73220_k, 10); + this.field_73212_b = new NoiseGeneratorOctaves(this.field_73220_k, 16); + this.field_185973_o = new NoiseGeneratorSimplex(this.field_73220_k); ++ ++ net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextEnd ctx = ++ new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextEnd(field_185969_i, field_185970_j, field_185971_k, field_73214_a, field_73212_b, field_185973_o); ++ ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i47241_1_, this.field_73220_k, ctx); ++ this.field_185969_i = ctx.getLPerlin1(); ++ this.field_185970_j = ctx.getLPerlin2(); ++ this.field_185971_k = ctx.getPerlin(); ++ this.field_73214_a = ctx.getDepth(); ++ this.field_73212_b = ctx.getScale(); ++ this.field_185973_o = ctx.getIsland(); ++ this.field_185972_n = (MapGenEndCity) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(this.field_185972_n, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.END_CITY); + } + + public void func_180518_a(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) +@@ -128,6 +142,7 @@ + + public void func_185962_a(ChunkPrimer p_185962_1_) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, this.chunkX, this.chunkZ, p_185962_1_, this.field_73230_p)) return; + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) +@@ -173,6 +188,7 @@ + + public Chunk func_185932_a(int p_185932_1_, int p_185932_2_) + { ++ this.chunkX = p_185932_1_; this.chunkZ = p_185932_2_; + this.field_73220_k.setSeed((long)p_185932_1_ * 341873128712L + (long)p_185932_2_ * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.field_73231_z = this.field_73230_p.func_72959_q().func_76933_b(this.field_73231_z, p_185932_1_ * 16, p_185932_2_ * 16, 16, 16); +@@ -254,6 +270,10 @@ + + private double[] func_185963_a(double[] p_185963_1_, int p_185963_2_, int p_185963_3_, int p_185963_4_, int p_185963_5_, int p_185963_6_, int p_185963_7_) + { ++ net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField(this, p_185963_1_, p_185963_2_, p_185963_3_, p_185963_4_, p_185963_5_, p_185963_6_, p_185963_7_); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getNoisefield(); ++ + if (p_185963_1_ == null) + { + p_185963_1_ = new double[p_185963_5_ * p_185963_6_ * p_185963_7_]; +@@ -326,6 +346,7 @@ + public void func_185931_b(int p_185931_1_, int p_185931_2_) + { + BlockFalling.field_149832_M = true; ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_73230_p, this.field_73220_k, p_185931_1_, p_185931_2_, false); + BlockPos blockpos = new BlockPos(p_185931_1_ * 16, 0, p_185931_2_ * 16); + + if (this.field_73229_q) +@@ -394,6 +415,7 @@ + } + } + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_73230_p, this.field_73220_k, p_185931_1_, p_185931_2_, false); + BlockFalling.field_149832_M = false; + } + diff --git a/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch new file mode 100644 index 000000000..1592b257a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java +@@ -162,6 +162,7 @@ + + public void func_185931_b(int p_185931_1_, int p_185931_2_) + { ++ net.minecraft.block.BlockFalling.field_149832_M = true; + int i = p_185931_1_ * 16; + int j = p_185931_2_ * 16; + BlockPos blockpos = new BlockPos(i, 0, j); +@@ -173,6 +174,8 @@ + this.field_73161_b.setSeed((long)p_185931_1_ * k + (long)p_185931_2_ * l ^ this.field_73163_a.func_72905_C()); + ChunkPos chunkpos = new ChunkPos(p_185931_1_, p_185931_2_); + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_73163_a, this.field_73161_b, p_185931_1_, p_185931_2_, flag); ++ + for (MapGenStructure mapgenstructure : this.field_82696_f.values()) + { + boolean flag1 = mapgenstructure.func_175794_a(this.field_73163_a, this.field_73161_b, chunkpos); +@@ -210,6 +213,9 @@ + { + biome.func_180624_a(this.field_73163_a, this.field_73161_b, blockpos); + } ++ ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_73163_a, this.field_73161_b, p_185931_1_, p_185931_2_, flag); ++ net.minecraft.block.BlockFalling.field_149832_M = false; + } + + public boolean func_185933_a(Chunk p_185933_1_, int p_185933_2_, int p_185933_3_) diff --git a/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch new file mode 100644 index 000000000..a62ecec31 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch @@ -0,0 +1,120 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java +@@ -77,6 +77,19 @@ + this.field_185946_g = new NoiseGeneratorOctaves(this.field_185954_p, 10); + this.field_185947_h = new NoiseGeneratorOctaves(this.field_185954_p, 16); + p_i45637_1_.func_181544_b(63); ++ ++ net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextHell ctx = ++ new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextHell(field_185957_u, field_185958_v, field_185959_w, field_73177_m, field_73174_n, field_185946_g, field_185947_h); ++ ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i45637_1_, this.field_185954_p, ctx); ++ this.field_185957_u = ctx.getLPerlin1(); ++ this.field_185958_v = ctx.getLPerlin2(); ++ this.field_185959_w = ctx.getPerlin(); ++ this.field_73177_m = ctx.getPerlin2(); ++ this.field_73174_n = ctx.getPerlin3(); ++ this.field_185946_g = ctx.getScale(); ++ this.field_185947_h = ctx.getDepth(); ++ this.field_73172_c = (MapGenNetherBridge)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73172_c, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_BRIDGE); ++ this.field_185939_I = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_185939_I, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_CAVE); + } + + public void func_185936_a(int p_185936_1_, int p_185936_2_, ChunkPrimer p_185936_3_) +@@ -155,6 +168,7 @@ + + public void func_185937_b(int p_185937_1_, int p_185937_2_, ChunkPrimer p_185937_3_) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, p_185937_1_, p_185937_2_, p_185937_3_, this.field_185952_n)) return; + int i = this.field_185952_n.func_181545_F() + 1; + double d0 = 0.03125D; + this.field_73185_q = this.field_73177_m.func_76304_a(this.field_73185_q, p_185937_1_ * 16, p_185937_2_ * 16, 0, 16, 16, 1, 0.03125D, 0.03125D, 1.0D); +@@ -277,6 +291,10 @@ + p_185938_1_ = new double[p_185938_5_ * p_185938_6_ * p_185938_7_]; + } + ++ net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField(this, p_185938_1_, p_185938_2_, p_185938_3_, p_185938_4_, p_185938_5_, p_185938_6_, p_185938_7_); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getNoisefield(); ++ + double d0 = 684.412D; + double d1 = 2053.236D; + this.field_73168_g = this.field_185946_g.func_76304_a(this.field_73168_g, p_185938_2_, p_185938_3_, p_185938_4_, p_185938_5_, 1, p_185938_7_, 1.0D, 0.0D, 1.0D); +@@ -358,6 +376,7 @@ + public void func_185931_b(int p_185931_1_, int p_185931_2_) + { + BlockFalling.field_149832_M = true; ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false); + int i = p_185931_1_ * 16; + int j = p_185931_2_ * 16; + BlockPos blockpos = new BlockPos(i, 0, j); +@@ -365,16 +384,20 @@ + ChunkPos chunkpos = new ChunkPos(p_185931_1_, p_185931_2_); + this.field_73172_c.func_175794_a(this.field_185952_n, this.field_185954_p, chunkpos); + ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA)) + for (int k = 0; k < 8; ++k) + { + this.field_177472_y.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(120) + 4, this.field_185954_p.nextInt(16) + 8)); + } + ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.FIRE)) + for (int i1 = 0; i1 < this.field_185954_p.nextInt(this.field_185954_p.nextInt(10) + 1) + 1; ++i1) + { + this.field_177470_t.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(120) + 4, this.field_185954_p.nextInt(16) + 8)); + } + ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.GLOWSTONE)) ++ { + for (int j1 = 0; j1 < this.field_185954_p.nextInt(this.field_185954_p.nextInt(10) + 1); ++j1) + { + this.field_177469_u.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(120) + 4, this.field_185954_p.nextInt(16) + 8)); +@@ -384,7 +407,13 @@ + { + this.field_177468_v.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(128), this.field_185954_p.nextInt(16) + 8)); + } ++ }//Forge: End doGLowstone + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(this.field_185952_n, this.field_185954_p, chunkpos)); ++ ++ if (net.minecraftforge.event.terraingen.TerrainGen.decorate(this.field_185952_n, this.field_185954_p, chunkpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM)) ++ { + if (this.field_185954_p.nextBoolean()) + { + this.field_177471_z.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(128), this.field_185954_p.nextInt(16) + 8)); +@@ -394,7 +423,10 @@ + { + this.field_177465_A.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + 8, this.field_185954_p.nextInt(128), this.field_185954_p.nextInt(16) + 8)); + } ++ } + ++ ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(this.field_185952_n, this.field_185954_p, field_177467_w, blockpos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.QUARTZ)) + for (int l1 = 0; l1 < 16; ++l1) + { + this.field_177467_w.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16), this.field_185954_p.nextInt(108) + 10, this.field_185954_p.nextInt(16))); +@@ -402,17 +434,23 @@ + + int i2 = this.field_185952_n.func_181545_F() / 2 + 1; + ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_MAGMA)) + for (int l = 0; l < 4; ++l) + { + this.field_189888_D.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16), i2 - 5 + this.field_185954_p.nextInt(10), this.field_185954_p.nextInt(16))); + } + ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185952_n, this.field_185954_p, p_185931_1_, p_185931_2_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA2)) + for (int j2 = 0; j2 < 16; ++j2) + { +- this.field_177473_x.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16), this.field_185954_p.nextInt(108) + 10, this.field_185954_p.nextInt(16))); ++ int offset = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 8 : 0; // MC-117810 ++ this.field_177473_x.func_180709_b(this.field_185952_n, this.field_185954_p, blockpos.func_177982_a(this.field_185954_p.nextInt(16) + offset, this.field_185954_p.nextInt(108) + 10, this.field_185954_p.nextInt(16) + offset)); + } + + biome.func_180624_a(this.field_185952_n, this.field_185954_p, new BlockPos(i, 0, j)); ++ ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(this.field_185952_n, this.field_185954_p, blockpos)); ++ + BlockFalling.field_149832_M = false; + } + diff --git a/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch new file mode 100644 index 000000000..49424b6a3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch @@ -0,0 +1,102 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java +@@ -61,6 +61,16 @@ + + public ChunkGeneratorOverworld(World p_i46668_1_, long p_i46668_2_, boolean p_i46668_4_, String p_i46668_5_) + { ++ { ++ field_186003_v = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186003_v, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); ++ field_186004_w = (MapGenStronghold)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186004_w, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD); ++ field_186005_x = (MapGenVillage)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186005_x, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); ++ field_186006_y = (MapGenMineshaft)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186006_y, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); ++ field_186007_z = (MapGenScatteredFeature)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_186007_z, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); ++ field_185979_A = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_185979_A, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); ++ field_185980_B = (StructureOceanMonument)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_185980_B, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.OCEAN_MONUMENT); ++ field_191060_C = (WoodlandMansion)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_191060_C, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.WOODLAND_MANSION); ++ } + this.field_185995_n = p_i46668_1_; + this.field_185996_o = p_i46668_4_; + this.field_185997_p = p_i46668_1_.func_72912_H().func_76067_t(); +@@ -90,6 +100,17 @@ + this.field_186001_t = this.field_186000_s.field_177778_E ? Blocks.field_150353_l.func_176223_P() : Blocks.field_150355_j.func_176223_P(); + p_i46668_1_.func_181544_b(this.field_186000_s.field_177841_q); + } ++ ++ net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextOverworld ctx = ++ new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextOverworld(field_185991_j, field_185992_k, field_185993_l, field_185994_m, field_185983_b, field_185984_c, field_185985_d); ++ ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i46668_1_, this.field_185990_i, ctx); ++ this.field_185991_j = ctx.getLPerlin1(); ++ this.field_185992_k = ctx.getLPerlin2(); ++ this.field_185993_l = ctx.getPerlin(); ++ this.field_185994_m = ctx.getHeight(); ++ this.field_185983_b = ctx.getScale(); ++ this.field_185984_c = ctx.getDepth(); ++ this.field_185985_d = ctx.getForest(); + } + + public void func_185976_a(int p_185976_1_, int p_185976_2_, ChunkPrimer p_185976_3_) +@@ -163,6 +184,7 @@ + + public void func_185977_a(int p_185977_1_, int p_185977_2_, ChunkPrimer p_185977_3_, Biome[] p_185977_4_) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, p_185977_1_, p_185977_2_, p_185977_3_, this.field_185995_n)) return; + double d0 = 0.03125D; + this.field_186002_u = this.field_185994_m.func_151599_a(this.field_186002_u, (double)(p_185977_1_ * 16), (double)(p_185977_2_ * 16), 16, 16, 0.0625D, 0.0625D, 1.0D); + +@@ -370,6 +392,8 @@ + boolean flag = false; + ChunkPos chunkpos = new ChunkPos(p_185931_1_, p_185931_2_); + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag); ++ + if (this.field_185996_o) + { + if (this.field_186000_s.field_177829_w) +@@ -404,6 +428,7 @@ + } + + if (biome != Biomes.field_76769_d && biome != Biomes.field_76786_s && this.field_186000_s.field_177781_A && !flag && this.field_185990_i.nextInt(this.field_186000_s.field_177782_B) == 0) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) + { + int i1 = this.field_185990_i.nextInt(16) + 8; + int j1 = this.field_185990_i.nextInt(256); +@@ -412,6 +437,7 @@ + } + + if (!flag && this.field_185990_i.nextInt(this.field_186000_s.field_177777_D / 10) == 0 && this.field_186000_s.field_177783_C) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA)) + { + int i2 = this.field_185990_i.nextInt(16) + 8; + int l2 = this.field_185990_i.nextInt(this.field_185990_i.nextInt(248) + 8); +@@ -424,6 +450,7 @@ + } + + if (this.field_186000_s.field_177837_s) ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON)) + { + for (int j2 = 0; j2 < this.field_186000_s.field_177835_t; ++j2) + { +@@ -435,9 +462,12 @@ + } + + biome.func_180624_a(this.field_185995_n, this.field_185990_i, new BlockPos(i, 0, j)); ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS)) + WorldEntitySpawner.func_77191_a(this.field_185995_n, biome, i + 8, j + 8, 16, 16, this.field_185990_i); + blockpos = blockpos.func_177982_a(8, 0, 8); + ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE)) ++ { + for (int k2 = 0; k2 < 16; ++k2) + { + for (int j3 = 0; j3 < 16; ++j3) +@@ -456,7 +486,10 @@ + } + } + } ++ }//Forge: End ICE + ++ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_185995_n, this.field_185990_i, p_185931_1_, p_185931_2_, flag); ++ + BlockFalling.field_149832_M = false; + } + diff --git a/patches_old/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches_old/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch new file mode 100644 index 000000000..2cc997e08 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -0,0 +1,91 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java +@@ -35,6 +35,7 @@ + public final IChunkLoader field_73247_e; + public final Long2ObjectMap field_73244_f = new Long2ObjectOpenHashMap(8192); + public final WorldServer field_73251_h; ++ private final Set loadingChunks = com.google.common.collect.Sets.newHashSet(); + + public ChunkProviderServer(WorldServer p_i46838_1_, IChunkLoader p_i46838_2_, IChunkGenerator p_i46838_3_) + { +@@ -85,20 +86,47 @@ + @Nullable + public Chunk func_186028_c(int p_186028_1_, int p_186028_2_) + { +- Chunk chunk = this.func_186026_b(p_186028_1_, p_186028_2_); ++ return loadChunk(p_186028_1_, p_186028_2_, null); ++ } + ++ @Nullable ++ public Chunk loadChunk(int p_186028_1_, int p_186028_2_, @Nullable Runnable runnable) ++ { ++ Chunk chunk = this.func_186026_b(p_186028_1_, p_186028_2_); + if (chunk == null) + { +- chunk = this.func_73239_e(p_186028_1_, p_186028_2_); +- +- if (chunk != null) ++ long pos = ChunkPos.func_77272_a(p_186028_1_, p_186028_2_); ++ chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(pos, this.field_73251_h); ++ if (chunk != null || !(this.field_73247_e instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader)) + { ++ if (!loadingChunks.add(pos)) net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk ({},{}) in dimension {} that is already being loaded. This will cause weird chunk breakages.", p_186028_1_, p_186028_2_, this.field_73251_h.field_73011_w.getDimension()); ++ if (chunk == null) chunk = this.func_73239_e(p_186028_1_, p_186028_2_); ++ ++ if (chunk != null) ++ { + this.field_73244_f.put(ChunkPos.func_77272_a(p_186028_1_, p_186028_2_), chunk); + chunk.func_76631_c(); + chunk.func_186030_a(this, this.field_186029_c); ++ } ++ ++ loadingChunks.remove(pos); + } ++ else ++ { ++ net.minecraft.world.chunk.storage.AnvilChunkLoader loader = (net.minecraft.world.chunk.storage.AnvilChunkLoader) this.field_73247_e; ++ if (runnable == null || !net.minecraftforge.common.ForgeChunkManager.asyncChunkLoading) ++ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.field_73251_h, loader, this, p_186028_1_, p_186028_2_); ++ else if (loader.func_191063_a(p_186028_1_, p_186028_2_)) ++ { ++ // We can only use the async queue for already generated chunks ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.field_73251_h, loader, this, p_186028_1_, p_186028_2_, runnable); ++ return null; ++ } ++ } + } + ++ // If we didn't load the chunk async and have a callback run it now ++ if (runnable != null) runnable.run(); + return chunk; + } + +@@ -224,6 +252,11 @@ + { + if (!this.field_73248_b.isEmpty()) + { ++ for (ChunkPos forced : this.field_73251_h.getPersistentChunks().keySet()) ++ { ++ this.field_73248_b.remove(ChunkPos.func_77272_a(forced.field_77276_a, forced.field_77275_b)); ++ } ++ + Iterator iterator = this.field_73248_b.iterator(); + + for (int i = 0; i < 100 && iterator.hasNext(); iterator.remove()) +@@ -234,6 +267,7 @@ + if (chunk != null && chunk.field_189550_d) + { + chunk.func_76623_d(); ++ net.minecraftforge.common.ForgeChunkManager.putDormantChunk(ChunkPos.func_77272_a(chunk.field_76635_g, chunk.field_76647_h), chunk); + this.func_73242_b(chunk); + this.func_73243_a(chunk); + this.field_73244_f.remove(olong); +@@ -242,6 +276,8 @@ + } + } + ++ if (this.field_73244_f.isEmpty()) net.minecraftforge.common.DimensionManager.unloadWorld(this.field_73251_h.field_73011_w.getDimension()); ++ + this.field_73247_e.func_75817_a(); + } + diff --git a/patches_old/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch b/patches_old/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch new file mode 100644 index 000000000..2188761f3 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch @@ -0,0 +1,111 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/MapGenCaves.java ++++ ../src-work/minecraft/net/minecraft/world/gen/MapGenCaves.java +@@ -140,9 +140,7 @@ + { + if (l1 >= 0 && l1 < 256) + { +- IBlockState iblockstate = p_180702_5_.func_177856_a(j1, l1, k1); +- +- if (iblockstate.func_177230_c() == Blocks.field_150358_i || iblockstate.func_177230_c() == Blocks.field_150355_j) ++ if (isOceanBlock(p_180702_5_, j1, l1, k1, p_180702_3_, p_180702_4_)) + { + flag3 = true; + } +@@ -180,28 +178,12 @@ + IBlockState iblockstate1 = p_180702_5_.func_177856_a(j3, j2, i2); + IBlockState iblockstate2 = (IBlockState)MoreObjects.firstNonNull(p_180702_5_.func_177856_a(j3, j2 + 1, i2), field_186127_b); + +- if (iblockstate1.func_177230_c() == Blocks.field_150349_c || iblockstate1.func_177230_c() == Blocks.field_150391_bh) ++ 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_.func_177855_a(j3, j2, i2, field_186126_a); +- } +- else +- { +- p_180702_5_.func_177855_a(j3, j2, i2, field_186127_b); +- +- if (flag1 && p_180702_5_.func_177856_a(j3, j2 - 1, i2).func_177230_c() == Blocks.field_150346_d) +- { +- blockpos$mutableblockpos.func_181079_c(j3 + p_180702_3_ * 16, 0, i2 + p_180702_4_ * 16); +- p_180702_5_.func_177855_a(j3, j2 - 1, i2, this.field_75039_c.func_180494_b(blockpos$mutableblockpos).field_76752_A.func_177230_c().func_176223_P()); +- } +- } +- } ++ digBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_, flag1, iblockstate1, iblockstate2); + } + } + } +@@ -299,4 +281,66 @@ + } + } + } ++ ++ protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ net.minecraft.block.Block block = data.func_177856_a(x, y, z).func_177230_c(); ++ return block== Blocks.field_150358_i || block == Blocks.field_150355_j; ++ } ++ ++ //Exception biomes to make sure we generate like vanilla ++ private boolean isExceptionBiome(net.minecraft.world.biome.Biome biome) ++ { ++ if (biome == net.minecraft.init.Biomes.field_76787_r) return true; ++ if (biome == net.minecraft.init.Biomes.field_76769_d) return true; ++ return false; ++ } ++ ++ //Determine if the block at the specified location is the top block for the biome, we take into account ++ //Vanilla bugs to make sure that we generate the map the same way vanilla does. ++ private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ net.minecraft.world.biome.Biome biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState state = data.func_177856_a(x, y, z); ++ return (isExceptionBiome(biome) ? state.func_177230_c() == Blocks.field_150349_c : state.func_177230_c() == biome.field_76752_A); ++ } ++ ++ /** ++ * Digs out the current block, default implementation removes stone, filler, and top block ++ * Sets the block to lava if y is less then 10, and air other wise. ++ * If setting to air, it also checks to see if we've broken the surface and if so ++ * tries to make the floor the biome's top block ++ * ++ * @param data Block data array ++ * @param index Pre-calculated index into block data ++ * @param x local X position ++ * @param y local Y position ++ * @param z local Z position ++ * @param chunkX Chunk X position ++ * @param chunkZ Chunk Y position ++ * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface. ++ */ ++ protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop, IBlockState state, IBlockState up) ++ { ++ net.minecraft.world.biome.Biome biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState top = biome.field_76752_A; ++ IBlockState filler = biome.field_76753_B; ++ ++ if (this.func_175793_a(state, up) || state.func_177230_c() == top.func_177230_c() || state.func_177230_c() == filler.func_177230_c()) ++ { ++ if (y - 1 < 10) ++ { ++ data.func_177855_a(x, y, z, field_186126_a); ++ } ++ else ++ { ++ data.func_177855_a(x, y, z, field_186127_b); ++ ++ if (foundTop && data.func_177856_a(x, y - 1, z).func_177230_c() == filler.func_177230_c()) ++ { ++ data.func_177855_a(x, y - 1, z, top.func_177230_c().func_176223_P()); ++ } ++ } ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch b/patches_old/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch new file mode 100644 index 000000000..30657ba50 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch @@ -0,0 +1,124 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/MapGenRavine.java ++++ ../src-work/minecraft/net/minecraft/world/gen/MapGenRavine.java +@@ -128,9 +128,7 @@ + { + if (l1 >= 0 && l1 < 256) + { +- IBlockState iblockstate = p_180707_5_.func_177856_a(j1, l1, k1); +- +- if (iblockstate.func_177230_c() == Blocks.field_150358_i || iblockstate.func_177230_c() == Blocks.field_150355_j) ++ if (isOceanBlock(p_180707_5_, j1, l1, k1, p_180707_3_, p_180707_4_)) + { + flag2 = true; + } +@@ -146,8 +144,6 @@ + + if (!flag2) + { +- BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); +- + for (int j3 = k2; j3 < k; ++j3) + { + double d10 = ((double)(j3 + p_180707_3_ * 16) + 0.5D - p_180707_6_) / d9; +@@ -165,30 +161,12 @@ + + if ((d10 * d10 + d7 * d7) * (double)this.field_75046_d[j2 - 1] + d8 * d8 / 6.0D < 1.0D) + { +- IBlockState iblockstate1 = p_180707_5_.func_177856_a(j3, j2, i2); +- +- if (iblockstate1.func_177230_c() == Blocks.field_150349_c) ++ if (isTopBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_)) + { + flag = true; + } + +- if (iblockstate1.func_177230_c() == Blocks.field_150348_b || iblockstate1.func_177230_c() == Blocks.field_150346_d || iblockstate1.func_177230_c() == Blocks.field_150349_c) +- { +- if (j2 - 1 < 10) +- { +- p_180707_5_.func_177855_a(j3, j2, i2, field_186135_a); +- } +- else +- { +- p_180707_5_.func_177855_a(j3, j2, i2, field_186136_b); +- +- if (flag && p_180707_5_.func_177856_a(j3, j2 - 1, i2).func_177230_c() == Blocks.field_150346_d) +- { +- blockpos$mutableblockpos.func_181079_c(j3 + p_180707_3_ * 16, 0, i2 + p_180707_4_ * 16); +- p_180707_5_.func_177855_a(j3, j2 - 1, i2, this.field_75039_c.func_180494_b(blockpos$mutableblockpos).field_76752_A); +- } +- } +- } ++ digBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_, flag); + } + } + } +@@ -223,4 +201,68 @@ + } + } + } ++ protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ net.minecraft.block.Block block = data.func_177856_a(x, y, z).func_177230_c(); ++ return block== Blocks.field_150358_i || block == Blocks.field_150355_j; ++ } ++ ++ //Exception biomes to make sure we generate like vanilla ++ private boolean isExceptionBiome(net.minecraft.world.biome.Biome biome) ++ { ++ if (biome == net.minecraft.init.Biomes.field_76787_r) return true; ++ if (biome == net.minecraft.init.Biomes.field_76769_d) return true; ++ if (biome == net.minecraft.init.Biomes.field_76789_p) return true; ++ if (biome == net.minecraft.init.Biomes.field_76788_q) return true; ++ return false; ++ } ++ ++ //Determine if the block at the specified location is the top block for the biome, we take into account ++ //Vanilla bugs to make sure that we generate the map the same way vanilla does. ++ private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ net.minecraft.world.biome.Biome biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState state = data.func_177856_a(x, y, z); ++ return (isExceptionBiome(biome) ? state.func_177230_c() == Blocks.field_150349_c : state.func_177230_c() == biome.field_76752_A); ++ } ++ ++ /** ++ * Digs out the current block, default implementation removes stone, filler, and top block ++ * Sets the block to lava if y is less then 10, and air other wise. ++ * If setting to air, it also checks to see if we've broken the surface and if so ++ * tries to make the floor the biome's top block ++ * ++ * @param data Block data array ++ * @param index Pre-calculated index into block data ++ * @param x local X position ++ * @param y local Y position ++ * @param z local Z position ++ * @param chunkX Chunk X position ++ * @param chunkZ Chunk Y position ++ * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface. ++ */ ++ protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) ++ { ++ net.minecraft.world.biome.Biome biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState state = data.func_177856_a(x, y, z); ++ IBlockState top = isExceptionBiome(biome) ? Blocks.field_150349_c.func_176223_P() : biome.field_76752_A; ++ IBlockState filler = isExceptionBiome(biome) ? Blocks.field_150346_d.func_176223_P() : biome.field_76753_B; ++ ++ if (state.func_177230_c() == Blocks.field_150348_b || state.func_177230_c() == top.func_177230_c() || state.func_177230_c() == filler.func_177230_c()) ++ { ++ if (y - 1 < 10) ++ { ++ data.func_177855_a(x, y, z, field_186135_a); ++ } ++ else ++ { ++ data.func_177855_a(x, y, z, field_186136_b); ++ ++ if (foundTop && data.func_177856_a(x, y - 1, z).func_177230_c() == filler.func_177230_c()) ++ { ++ data.func_177855_a(x, y - 1, z, top.func_177230_c().func_176223_P()); ++ } ++ } ++ } ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch new file mode 100644 index 000000000..773fd43ed --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java +@@ -31,4 +31,10 @@ + this.func_175903_a(p_175921_1_, p_175921_2_, Blocks.field_150346_d.func_176223_P()); + } + } ++ ++ public boolean isReplaceable(World world, BlockPos pos) ++ { ++ net.minecraft.block.state.IBlockState state = world.func_180495_p(pos); ++ return state.func_177230_c().isAir(state, world, pos) || state.func_177230_c().isLeaves(state, world, pos) || state.func_177230_c().isWood(world, pos) || func_150523_a(state.func_177230_c()); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch new file mode 100644 index 000000000..5bf7cfad5 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch @@ -0,0 +1,34 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java +@@ -62,9 +62,9 @@ + { + if (j >= 0 && j < 256) + { +- Material material = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_185904_a(); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)); + +- if (material != Material.field_151579_a && material != Material.field_151584_j) ++ if (!state.func_177230_c().isAir(state, p_180709_1_, blockpos$mutableblockpos) && !state.func_177230_c().isLeaves(state, p_180709_1_, blockpos$mutableblockpos)) + { + flag = false; + } +@@ -199,8 +199,9 @@ + if (p_180709_3_.func_177956_o() >= p_180709_3_.func_177956_o() + i - 1 || blockhugemushroom$enumtype != BlockHugeMushroom.EnumType.ALL_INSIDE) + { + BlockPos blockpos = new BlockPos(l1, l2, i2); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos); + +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, block.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, blockhugemushroom$enumtype)); + } +@@ -213,7 +214,7 @@ + { + IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)); + +- if (!iblockstate.func_185913_b()) ++ if (iblockstate.func_177230_c().canBeReplacedByLeaves(iblockstate, p_180709_1_, p_180709_3_.func_177981_b(i3))) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i3), block.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, BlockHugeMushroom.EnumType.STEM)); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch new file mode 100644 index 000000000..6c34a84ea --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -0,0 +1,52 @@ +--- ../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_.func_177982_a(j, 0, k); +- Material material = this.field_175946_l.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = this.field_175946_l.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, field_175946_l, blockpos) || state.func_177230_c().isLeaves(state, field_175946_l, blockpos)) + { + this.func_175903_a(this.field_175946_l, blockpos, p_181631_3_); + } +@@ -269,7 +269,7 @@ + { + BlockPos blockpos1 = p_175936_1_.func_177963_a((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); + +- if (!this.func_150523_a(this.field_175946_l.func_180495_p(blockpos1).func_177230_c())) ++ if (!this.isReplaceable(field_175946_l, blockpos1)) + { + return j; + } +@@ -297,6 +297,7 @@ + + if (!this.func_76497_e()) + { ++ this.field_175946_l = null; //Fix vanilla Mem leak, holds latest world + return false; + } + else +@@ -305,15 +306,18 @@ + this.func_175941_b(); + this.func_175942_c(); + this.func_175939_d(); ++ this.field_175946_l = null; //Fix vanilla Mem leak, holds latest world + return true; + } + } + + private boolean func_76497_e() + { +- Block block = this.field_175946_l.func_180495_p(this.field_175947_m.func_177977_b()).func_177230_c(); ++ BlockPos down = this.field_175947_m.func_177977_b(); ++ net.minecraft.block.state.IBlockState state = this.field_175946_l.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, this.field_175946_l, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); + +- if (block != Blocks.field_150346_d && block != Blocks.field_150349_c && block != Blocks.field_150458_ak) ++ if (!isSoil) + { + return false; + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch new file mode 100644 index 000000000..77d4b839e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch @@ -0,0 +1,56 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java +@@ -56,9 +56,9 @@ + { + for (int i1 = p_180709_3_.func_177952_p() - k; i1 <= p_180709_3_.func_177952_p() + k && flag; ++i1) + { +- if (j >= 0 && j < 256) ++ if (j >= 0 && j < p_180709_1_.func_72800_K()) + { +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) + { + flag = false; + } +@@ -77,11 +77,13 @@ + } + else + { +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d || block == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) + { +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); + + for (int i2 = p_180709_3_.func_177956_o() - 3 + i; i2 <= p_180709_3_.func_177956_o() + i; ++i2) + { +@@ -99,9 +101,9 @@ + if (Math.abs(j1) != l2 || Math.abs(l1) != l2 || p_180709_2_.nextInt(2) != 0 && k2 != 0) + { + BlockPos blockpos = new BlockPos(i3, i2, k1); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state2 = p_180709_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state2.func_177230_c().isAir(state2, p_180709_1_, blockpos) || state2.func_177230_c().isAir(state2, p_180709_1_, blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, field_181630_b); + } +@@ -112,9 +114,10 @@ + + for (int j2 = 0; j2 < i; ++j2) + { +- Material material1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j2)).func_185904_a(); ++ BlockPos upN = p_180709_3_.func_177981_b(j2); ++ IBlockState state2 = p_180709_1_.func_180495_p(upN); + +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j) ++ if (state2.func_177230_c().isAir(state2, p_180709_1_, upN) || state2.func_177230_c().isLeaves(state2, p_180709_1_, upN)) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j2), field_181629_a); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch new file mode 100644 index 000000000..ed54b4718 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java +@@ -20,7 +20,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8), p_180709_2_.nextInt(4) - p_180709_2_.nextInt(4), p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8)); + +- if (p_180709_1_.func_175623_d(blockpos) && (!p_180709_1_.field_73011_w.func_177495_o() || blockpos.func_177956_o() < 255) && this.field_175908_a.func_180671_f(p_180709_1_, blockpos, this.field_175908_a.func_176223_P())) ++ if (p_180709_1_.func_175623_d(blockpos) && (!p_180709_1_.field_73011_w.func_177495_o() || blockpos.func_177956_o() < p_180709_1_.func_72800_K() - 1) && this.field_175908_a.func_180671_f(p_180709_1_, blockpos, this.field_175908_a.func_176223_P())) + { + p_180709_1_.func_180501_a(blockpos, this.field_175908_a.func_176223_P(), 2); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch new file mode 100644 index 000000000..61ebf130c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch @@ -0,0 +1,72 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java +@@ -33,9 +33,10 @@ + if (k >= 1 && k + i + 1 < 256) + { + BlockPos blockpos = p_180709_3_.func_177977_b(); +- Block block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); + +- if (block != Blocks.field_150349_c && block != Blocks.field_150346_d) ++ if (!(isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1)) + { + return false; + } +@@ -45,10 +46,10 @@ + } + else + { +- this.func_175921_a(p_180709_1_, blockpos); +- this.func_175921_a(p_180709_1_, blockpos.func_177974_f()); +- this.func_175921_a(p_180709_1_, blockpos.func_177968_d()); +- this.func_175921_a(p_180709_1_, blockpos.func_177968_d().func_177974_f()); ++ this.onPlantGrow(p_180709_1_, blockpos, p_180709_3_); ++ this.onPlantGrow(p_180709_1_, blockpos.func_177974_f(), p_180709_3_); ++ this.onPlantGrow(p_180709_1_, blockpos.func_177968_d(), p_180709_3_); ++ this.onPlantGrow(p_180709_1_, blockpos.func_177968_d().func_177974_f(), p_180709_3_); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180709_2_); + int i1 = i - p_180709_2_.nextInt(4); + int j1 = 2 - p_180709_2_.nextInt(3); +@@ -67,9 +68,9 @@ + + int k2 = k + j2; + BlockPos blockpos1 = new BlockPos(k1, k2, l1); +- Material material = p_180709_1_.func_180495_p(blockpos1).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos1); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos1) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos1)) + { + this.func_181639_b(p_180709_1_, blockpos1); + this.func_181639_b(p_180709_1_, blockpos1.func_177974_f()); +@@ -187,7 +188,7 @@ + { + for (int k1 = -i1; k1 <= i1; ++k1) + { +- if (!this.func_150523_a(p_181638_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(i + j1, j + l, k + k1)).func_177230_c())) ++ if (!this.isReplaceable(p_181638_1_, blockpos$mutableblockpos.func_181079_c(i + j1, j + l, k + k1))) + { + return false; + } +@@ -209,11 +210,18 @@ + private void func_150526_a(World p_150526_1_, 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_); +- Material material = p_150526_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = p_150526_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a) ++ if (state.func_177230_c().isAir(state, p_150526_1_, blockpos)) + { + this.func_175903_a(p_150526_1_, blockpos, field_181641_b); + } + } ++ ++ //Just a helper macro ++ private void onPlantGrow(World world, BlockPos pos, BlockPos source) ++ { ++ IBlockState state = world.func_180495_p(pos); ++ state.func_177230_c().onPlantGrow(state, world, pos, source); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch new file mode 100644 index 000000000..f1d9ad72c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java +@@ -11,7 +11,7 @@ + { + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) + { +- for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) ++ for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_) || iblockstate.func_177230_c().isLeaves(iblockstate, p_180709_1_, p_180709_3_)) && p_180709_3_.func_177956_o() > 0; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) + { + p_180709_3_ = p_180709_3_.func_177977_b(); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch new file mode 100644 index 000000000..6ca2da90e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java +@@ -159,6 +159,6 @@ + + private ResourceLocation func_76543_b(Random p_76543_1_) + { +- return field_175916_b[p_76543_1_.nextInt(field_175916_b.length)]; ++ return net.minecraftforge.common.DungeonHooks.getRandomDungeonMob(p_76543_1_); + } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch new file mode 100644 index 000000000..45ec43950 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java +@@ -27,7 +27,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8), -p_180709_2_.nextInt(12), p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8)); + +- if (p_180709_1_.func_180495_p(blockpos).func_185904_a() == Material.field_151579_a) ++ if (p_180709_1_.func_175623_d(blockpos)) + { + int j = 0; + diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch new file mode 100644 index 000000000..cec562cde --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java +@@ -27,7 +27,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8), -p_180709_2_.nextInt(12), p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8)); + +- if (p_180709_1_.func_180495_p(blockpos).func_185904_a() == Material.field_151579_a) ++ if (p_180709_1_.func_175623_d(blockpos)) + { + int j = 0; + diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch new file mode 100644 index 000000000..dcdcd472c --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java +@@ -25,7 +25,7 @@ + { + return false; + } +- else if (p_180709_1_.func_180495_p(p_180709_3_).func_185904_a() != Material.field_151579_a && p_180709_1_.func_180495_p(p_180709_3_).func_177230_c() != Blocks.field_150424_aL) ++ else if (!p_180709_1_.func_175623_d(p_180709_3_) && p_180709_1_.func_180495_p(p_180709_3_).func_177230_c() != Blocks.field_150424_aL) + { + return false; + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch new file mode 100644 index 000000000..c0785697b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -0,0 +1,69 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java +@@ -59,7 +59,7 @@ + { + for (int l = -j; l <= j && flag; ++l) + { +- if (p_175926_2_.func_177956_o() + i < 0 || p_175926_2_.func_177956_o() + i >= 256 || !this.func_150523_a(p_175926_1_.func_180495_p(p_175926_2_.func_177982_a(k, i, l)).func_177230_c())) ++ if (p_175926_2_.func_177956_o() + i < 0 || p_175926_2_.func_177956_o() + i >= 256 || !this.isReplaceable(p_175926_1_,p_175926_2_.func_177982_a(k, i, l))) + { + flag = false; + } +@@ -78,14 +78,15 @@ + private boolean func_175927_a(BlockPos p_175927_1_, World p_175927_2_) + { + BlockPos blockpos = p_175927_1_.func_177977_b(); +- Block block = p_175927_2_.func_180495_p(blockpos).func_177230_c(); ++ IBlockState state = p_175927_2_.func_180495_p(blockpos); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_175927_2_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_175927_1_.func_177956_o() >= 2) ++ if (isSoil && p_175927_1_.func_177956_o() >= 2) + { +- this.func_175921_a(p_175927_2_, blockpos); +- this.func_175921_a(p_175927_2_, blockpos.func_177974_f()); +- this.func_175921_a(p_175927_2_, blockpos.func_177968_d()); +- this.func_175921_a(p_175927_2_, blockpos.func_177968_d().func_177974_f()); ++ this.onPlantGrow(p_175927_2_, blockpos, p_175927_1_); ++ this.onPlantGrow(p_175927_2_, blockpos.func_177974_f(), p_175927_1_); ++ this.onPlantGrow(p_175927_2_, blockpos.func_177968_d(), p_175927_1_); ++ this.onPlantGrow(p_175927_2_, blockpos.func_177968_d().func_177974_f(), p_175927_1_); + 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_.func_177982_a(j, 0, k); +- Material material = p_175925_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = p_175925_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_175925_1_, blockpos) || state.func_177230_c().isLeaves(state, p_175925_1_, blockpos)) + { + this.func_175903_a(p_175925_1_, blockpos, this.field_76521_c); + } +@@ -135,9 +136,9 @@ + if (j * j + k * k <= i) + { + BlockPos blockpos = p_175928_2_.func_177982_a(j, 0, k); +- Material material = p_175928_1_.func_180495_p(blockpos).func_185904_a(); ++ IBlockState state = p_175928_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_175928_1_, blockpos) || state.func_177230_c().isLeaves(state, p_175928_1_, blockpos)) + { + this.func_175903_a(p_175928_1_, blockpos, this.field_76521_c); + } +@@ -145,4 +146,11 @@ + } + } + } ++ ++ //Just a helper macro ++ private void onPlantGrow(World world, BlockPos pos, BlockPos source) ++ { ++ IBlockState state = world.func_180495_p(pos); ++ state.func_177230_c().onPlantGrow(state, world, pos, source); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch new file mode 100644 index 000000000..1ac2953b8 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java +@@ -51,7 +51,7 @@ + IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(i1, k, j1)); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() == Material.field_151579_a || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) ++ if (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_.func_177982_a(i1, k, j1)) || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(i1, k, j1), Blocks.field_150403_cj.func_176223_P()); + } +@@ -61,7 +61,7 @@ + iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(i1, -k, j1)); + block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() == Material.field_151579_a || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) ++ if (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_.func_177982_a(i1, -k, j1)) || block == Blocks.field_150346_d || block == Blocks.field_150433_aE || block == Blocks.field_150432_aD) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(i1, -k, j1), Blocks.field_150403_cj.func_176223_P()); + } +@@ -99,7 +99,7 @@ + IBlockState iblockstate1 = p_180709_1_.func_180495_p(blockpos); + Block block1 = iblockstate1.func_177230_c(); + +- if (iblockstate1.func_185904_a() != Material.field_151579_a && block1 != Blocks.field_150346_d && block1 != Blocks.field_150433_aE && block1 != Blocks.field_150432_aD && block1 != Blocks.field_150403_cj) ++ if (!iblockstate1.func_177230_c().isAir(iblockstate1, p_180709_1_, blockpos) && block1 != Blocks.field_150346_d && block1 != Blocks.field_150433_aE && block1 != Blocks.field_150432_aD && block1 != Blocks.field_150403_cj) + { + break; + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch new file mode 100644 index 000000000..8782dc0cb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java +@@ -161,7 +161,8 @@ + + if (p_180709_1_.func_175675_v(p_180709_3_.func_177982_a(k2, 4, l3))) + { +- p_180709_1_.func_180501_a(p_180709_3_.func_177982_a(k2, 4, l3), Blocks.field_150432_aD.func_176223_P(), 2); ++ int flag = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 2| 16 : 2; //Forge: With bit 5 unset, it will notify neighbors and load adjacent chunks. ++ p_180709_1_.func_180501_a(p_180709_3_.func_177982_a(k2, 4, l3), Blocks.field_150432_aD.func_176223_P(), flag); //Forge + } + } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch new file mode 100644 index 000000000..074c4483e --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java +@@ -31,7 +31,7 @@ + { + IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); + +- if (iblockstate.func_185904_a() != Material.field_151579_a && iblockstate.func_177230_c() != Blocks.field_150348_b) ++ if (!iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_) && iblockstate.func_177230_c() != Blocks.field_150348_b) + { + return false; + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch new file mode 100644 index 000000000..8964b67b1 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch @@ -0,0 +1,50 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java +@@ -55,7 +55,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177981_b(i2); + +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, this.field_76520_b); + +@@ -70,7 +70,7 @@ + { + BlockPos blockpos1 = blockpos.func_177974_f(); + +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos1).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos1)) + { + this.func_175903_a(p_180709_1_, blockpos1, this.field_76520_b); + +@@ -83,7 +83,7 @@ + + BlockPos blockpos2 = blockpos.func_177968_d().func_177974_f(); + +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos2).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos2)) + { + this.func_175903_a(p_180709_1_, blockpos2, this.field_76520_b); + +@@ -96,7 +96,7 @@ + + BlockPos blockpos3 = blockpos.func_177968_d(); + +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos3).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos3)) + { + this.func_175903_a(p_180709_1_, blockpos3, this.field_76520_b); + +@@ -130,4 +130,11 @@ + this.func_175925_a(p_175930_1_, p_175930_2_.func_177981_b(j), p_175930_3_ + 1 - j); + } + } ++ ++ //Helper macro ++ private boolean isAirLeaves(World world, BlockPos pos) ++ { ++ IBlockState state = world.func_180495_p(pos); ++ return state.func_177230_c().isAir(state, world, pos) || state.func_177230_c().isLeaves(state, world, pos); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch new file mode 100644 index 000000000..70ea1b446 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch @@ -0,0 +1,60 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java +@@ -41,32 +41,25 @@ + + for (int j = 0; j < i; ++j) + { +- IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j)); +- +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177981_b(j))) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j), this.field_76520_b); + } + + if (j < i - 1) + { +- iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 0)); +- +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177982_a(1, j, 0))) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(1, j, 0), this.field_76520_b); + } + +- iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 1)); +- +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177982_a(1, j, 1))) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(1, j, 1), this.field_76520_b); + } + +- iblockstate = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(0, j, 1)); + +- if (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_, p_180709_3_.func_177982_a(0, j, 1))) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(0, j, 1), this.field_76520_b); + } +@@ -133,7 +126,7 @@ + IBlockState iblockstate = p_175934_1_.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); + +- if (block == Blocks.field_150349_c || block == Blocks.field_150346_d) ++ if (block.canSustainPlant(iblockstate, p_175934_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) + { + this.func_175903_a(p_175934_1_, blockpos, field_181635_g); + break; +@@ -145,4 +138,11 @@ + } + } + } ++ ++ //Helper macro ++ private boolean isAirLeaves(World world, BlockPos pos) ++ { ++ IBlockState state = world.func_180495_p(pos); ++ return state.func_177230_c().isAir(state, world, pos) || state.func_177230_c().isLeaves(state, world, pos); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch new file mode 100644 index 000000000..d7cc9310a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java +@@ -73,7 +73,8 @@ + { + BlockPos blockpos = new BlockPos(l1, i2, j2); + +- if (this.field_175919_c.apply(p_180709_1_.func_180495_p(blockpos))) ++ IBlockState state = p_180709_1_.func_180495_p(blockpos); ++ if (state.func_177230_c().isReplaceableOreGen(state, p_180709_1_, blockpos, this.field_175919_c)) + { + p_180709_1_.func_180501_a(blockpos, this.field_175920_a, 2); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch new file mode 100644 index 000000000..3a17a2173 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch @@ -0,0 +1,64 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java +@@ -52,7 +52,7 @@ + { + if (j >= 0 && j < 256) + { +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_,blockpos$mutableblockpos.func_181079_c(l, j, i1))) + { + flag = false; + } +@@ -71,11 +71,13 @@ + } + else + { +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) + { +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180709_2_); + int k2 = i - p_180709_2_.nextInt(4) - 1; + int l2 = 3 - p_180709_2_.nextInt(3); +@@ -95,9 +97,9 @@ + } + + BlockPos blockpos = new BlockPos(i3, i2, j1); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos)) + { + this.func_181642_b(p_180709_1_, blockpos); + k1 = i2; +@@ -149,9 +151,9 @@ + i3 += enumfacing1.func_82601_c(); + j1 += enumfacing1.func_82599_e(); + BlockPos blockpos1 = new BlockPos(i3, j2, j1); +- Material material1 = p_180709_1_.func_180495_p(blockpos1).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos1); + +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos1) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos1)) + { + this.func_181642_b(p_180709_1_, blockpos1); + k1 = j2; +@@ -209,9 +211,9 @@ + + private void func_175924_b(World p_175924_1_, BlockPos p_175924_2_) + { +- Material material = p_175924_1_.func_180495_p(p_175924_2_).func_185904_a(); ++ IBlockState state = p_175924_1_.func_180495_p(p_175924_2_); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_175924_1_, p_175924_2_) || state.func_177230_c().isLeaves(state, p_175924_1_, p_175924_2_)) + { + this.func_175903_a(p_175924_1_, p_175924_2_, field_181644_b); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch new file mode 100644 index 000000000..1826fe68b --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java +@@ -22,14 +22,14 @@ + + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) + { +- for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) ++ for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_) || iblockstate.func_177230_c().isLeaves(iblockstate, p_180709_1_, p_180709_3_)) && p_180709_3_.func_177956_o() > 0; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) + { + p_180709_3_ = p_180709_3_.func_177977_b(); + } + +- Block block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_); + +- if (block == Blocks.field_150346_d || block == Blocks.field_150349_c) ++ if (state.func_177230_c().canSustainPlant(state, p_180709_1_, p_180709_3_, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) + { + p_180709_3_ = p_180709_3_.func_177984_a(); + this.func_175903_a(p_180709_1_, p_180709_3_, this.field_150527_b); +@@ -50,9 +50,9 @@ + if (Math.abs(i1) != k || Math.abs(k1) != k || p_180709_2_.nextInt(2) != 0) + { + BlockPos blockpos = new BlockPos(l, i, j1); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, this.field_150528_a); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch new file mode 100644 index 000000000..dfe3fe59d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -0,0 +1,89 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java +@@ -61,7 +61,7 @@ + IBlockState iblockstate = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)); + Block block = iblockstate.func_177230_c(); + +- if (iblockstate.func_185904_a() != Material.field_151579_a && iblockstate.func_185904_a() != Material.field_151584_j) ++ if (!iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1)) && !iblockstate.func_177230_c().isLeaves(iblockstate, p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) + { + if (block != Blocks.field_150355_j && block != Blocks.field_150358_i) + { +@@ -87,11 +87,13 @@ + } + else + { +- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); + +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) + { +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, p_180709_3_.func_177977_b(),p_180709_3_); + + for (int k1 = p_180709_3_.func_177956_o() - 3 + i; k1 <= p_180709_3_.func_177956_o() + i; ++k1) + { +@@ -109,8 +111,9 @@ + if (Math.abs(k3) != l2 || Math.abs(j1) != l2 || p_180709_2_.nextInt(2) != 0 && j2 != 0) + { + BlockPos blockpos = new BlockPos(j3, k1, i4); ++ state = p_180709_1_.func_180495_p(blockpos); + +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, field_181649_b); + } +@@ -121,10 +124,11 @@ + + for (int l1 = 0; l1 < i; ++l1) + { +- IBlockState iblockstate1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(l1)); ++ BlockPos upN = p_180709_3_.func_177981_b(l1); ++ IBlockState iblockstate1 = p_180709_1_.func_180495_p(upN); + Block block2 = iblockstate1.func_177230_c(); + +- if (iblockstate1.func_185904_a() == Material.field_151579_a || iblockstate1.func_185904_a() == Material.field_151584_j || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) ++ if (block2.isAir(iblockstate1, p_180709_1_, upN) || block2.isLeaves(iblockstate1, p_180709_1_, upN) || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(l1), field_181648_a); + } +@@ -149,22 +153,22 @@ + BlockPos blockpos1 = blockpos$mutableblockpos1.func_177978_c(); + BlockPos blockpos2 = blockpos$mutableblockpos1.func_177968_d(); + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos3)) + { + this.func_181647_a(p_180709_1_, blockpos3, BlockVine.field_176278_M); + } + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos4)) + { + this.func_181647_a(p_180709_1_, blockpos4, BlockVine.field_176280_O); + } + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos1)) + { + this.func_181647_a(p_180709_1_, blockpos1, BlockVine.field_176279_N); + } + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos2)) + { + this.func_181647_a(p_180709_1_, blockpos2, BlockVine.field_176273_b); + } +@@ -193,7 +197,7 @@ + this.func_175903_a(p_181647_1_, p_181647_2_, iblockstate); + int i = 4; + +- for (BlockPos blockpos = p_181647_2_.func_177977_b(); p_181647_1_.func_180495_p(blockpos).func_185904_a() == Material.field_151579_a && i > 0; --i) ++ for (BlockPos blockpos = p_181647_2_.func_177977_b(); p_181647_1_.func_175623_d(blockpos) && i > 0; --i) + { + this.func_175903_a(p_181647_1_, blockpos, iblockstate); + blockpos = blockpos.func_177977_b(); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch new file mode 100644 index 000000000..f228c6167 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -0,0 +1,52 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java +@@ -54,7 +54,7 @@ + { + if (i1 >= 0 && i1 < 256) + { +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_,blockpos$mutableblockpos.func_181079_c(k1, i1, l1))) + { + flag = false; + } +@@ -73,11 +73,13 @@ + } + else + { +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ IBlockState state = p_180709_1_.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) + { +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); + int k2 = 0; + + for (int l2 = p_180709_3_.func_177956_o() + i; l2 >= p_180709_3_.func_177956_o() + j; --l2) +@@ -93,8 +95,9 @@ + if (Math.abs(k3) != k2 || Math.abs(j2) != k2 || k2 <= 0) + { + BlockPos blockpos = new BlockPos(j3, l2, i2); ++ state = p_180709_1_.func_180495_p(blockpos); + +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, field_181637_b); + } +@@ -114,9 +117,10 @@ + + for (int i3 = 0; i3 < i - 1; ++i3) + { +- Material material = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)).func_185904_a(); ++ BlockPos upN = p_180709_3_.func_177981_b(i3); ++ state = p_180709_1_.func_180495_p(upN); + +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_180709_1_, upN) || state.func_177230_c().isLeaves(state, p_180709_1_, upN)) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i3), field_181636_a); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch new file mode 100644 index 000000000..611141161 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch @@ -0,0 +1,66 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java +@@ -30,7 +30,7 @@ + int l = 2 + p_180709_2_.nextInt(2); + boolean flag = true; + +- if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= 256) ++ if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= p_180709_1_.func_72800_K()) + { + for (int i1 = p_180709_3_.func_177956_o(); i1 <= p_180709_3_.func_177956_o() + 1 + i && flag; ++i1) + { +@@ -51,11 +51,11 @@ + { + for (int l1 = p_180709_3_.func_177952_p() - j1; l1 <= p_180709_3_.func_177952_p() + j1 && flag; ++l1) + { +- if (i1 >= 0 && i1 < 256) ++ if (i1 >= 0 && i1 < p_180709_1_.func_72800_K()) + { +- Material material = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).func_185904_a(); ++ IBlockState state = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)); + +- if (material != Material.field_151579_a && material != Material.field_151584_j) ++ if (!state.func_177230_c().isAir(state, p_180709_1_, blockpos$mutableblockpos.func_181079_c(k1, i1, l1)) && !state.func_177230_c().isLeaves(state, p_180709_1_, blockpos$mutableblockpos.func_181079_c(k1, i1, l1))) + { + flag = false; + } +@@ -74,11 +74,12 @@ + } + else + { +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ IBlockState state = p_180709_1_.func_180495_p(down); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d || block == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (state.func_177230_c().canSustainPlant(state, p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g) && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) + { +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, down, p_180709_3_); + int i3 = p_180709_2_.nextInt(2); + int j3 = 1; + int k3 = 0; +@@ -98,8 +99,9 @@ + if (Math.abs(j2) != i3 || Math.abs(l2) != i3 || i3 <= 0) + { + BlockPos blockpos = new BlockPos(i2, j4, k2); ++ state = p_180709_1_.func_180495_p(blockpos); + +- if (!p_180709_1_.func_180495_p(blockpos).func_185913_b()) ++ if (state.func_177230_c().canBeReplacedByLeaves(state, p_180709_1_, blockpos)) + { + this.func_175903_a(p_180709_1_, blockpos, field_181646_b); + } +@@ -128,9 +130,10 @@ + + for (int k4 = 0; k4 < i - i4; ++k4) + { +- Material material1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(k4)).func_185904_a(); ++ BlockPos upN = p_180709_3_.func_177981_b(k4); ++ state = p_180709_1_.func_180495_p(upN); + +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j) ++ if (state.func_177230_c().isAir(state, p_180709_1_, upN) || state.func_177230_c().isLeaves(state, p_180709_1_, upN)) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(k4), field_181645_a); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch new file mode 100644 index 000000000..2f6ab26ee --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java +@@ -19,7 +19,7 @@ + + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) + { +- for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) ++ for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_) || iblockstate.func_177230_c().isLeaves(iblockstate, p_180709_1_, p_180709_3_)) && p_180709_3_.func_177956_o() > 0; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) + { + p_180709_3_ = p_180709_3_.func_177977_b(); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch new file mode 100644 index 000000000..f6ba38728 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -0,0 +1,108 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java +@@ -44,7 +44,7 @@ + int i = p_180709_2_.nextInt(3) + this.field_76533_a; + boolean flag = true; + +- if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= 256) ++ if (p_180709_3_.func_177956_o() >= 1 && p_180709_3_.func_177956_o() + i + 1 <= p_180709_1_.func_72800_K()) + { + for (int j = p_180709_3_.func_177956_o(); j <= p_180709_3_.func_177956_o() + 1 + i; ++j) + { +@@ -66,9 +66,9 @@ + { + for (int i1 = p_180709_3_.func_177952_p() - k; i1 <= p_180709_3_.func_177952_p() + k && flag; ++i1) + { +- if (j >= 0 && j < 256) ++ if (j >= 0 && j < p_180709_1_.func_72800_K()) + { +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_,blockpos$mutableblockpos.func_181079_c(l, j, i1))) + { + flag = false; + } +@@ -87,11 +87,11 @@ + } + else + { +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ IBlockState state = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d || block == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (state.func_177230_c().canSustainPlant(state, p_180709_1_, p_180709_3_.func_177977_b(), net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g) && p_180709_3_.func_177956_o() < p_180709_1_.func_72800_K() - i - 1) + { +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ state.func_177230_c().onPlantGrow(state, p_180709_1_, p_180709_3_.func_177977_b(), p_180709_3_); + int k2 = 3; + int l2 = 0; + +@@ -111,9 +111,9 @@ + if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_180709_2_.nextInt(2) != 0 && i4 != 0) + { + BlockPos blockpos = new BlockPos(k1, i3, i2); +- Material material = p_180709_1_.func_180495_p(blockpos).func_185904_a(); ++ state = p_180709_1_.func_180495_p(blockpos); + +- if (material == Material.field_151579_a || material == Material.field_151584_j || material == Material.field_151582_l) ++ if (state.func_177230_c().isAir(state, p_180709_1_, blockpos) || state.func_177230_c().isLeaves(state, p_180709_1_, blockpos) || state.func_185904_a() == Material.field_151582_l) + { + this.func_175903_a(p_180709_1_, blockpos, this.field_76530_d); + } +@@ -124,9 +124,10 @@ + + for (int j3 = 0; j3 < i; ++j3) + { +- Material material1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j3)).func_185904_a(); ++ BlockPos upN = p_180709_3_.func_177981_b(j3); ++ state = p_180709_1_.func_180495_p(upN); + +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j || material1 == Material.field_151582_l) ++ if (state.func_177230_c().isAir(state, p_180709_1_, upN) || state.func_177230_c().isLeaves(state, p_180709_1_, upN) || state.func_185904_a() == Material.field_151582_l) + { + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j3), this.field_76532_c); + +@@ -169,29 +170,30 @@ + { + blockpos$mutableblockpos1.func_181079_c(l4, k3, i5); + +- if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_185904_a() == Material.field_151584_j) ++ state = p_180709_1_.func_180495_p(blockpos$mutableblockpos1); ++ if (state.func_177230_c().isLeaves(state, p_180709_1_, blockpos$mutableblockpos1)) + { + BlockPos blockpos2 = blockpos$mutableblockpos1.func_177976_e(); + BlockPos blockpos3 = blockpos$mutableblockpos1.func_177974_f(); + BlockPos blockpos4 = blockpos$mutableblockpos1.func_177978_c(); + BlockPos blockpos1 = blockpos$mutableblockpos1.func_177968_d(); + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos2)) + { + this.func_181650_b(p_180709_1_, blockpos2, BlockVine.field_176278_M); + } + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos3)) + { + this.func_181650_b(p_180709_1_, blockpos3, BlockVine.field_176280_O); + } + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos4)) + { + this.func_181650_b(p_180709_1_, blockpos4, BlockVine.field_176279_N); + } + +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_185904_a() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_175623_d(blockpos1)) + { + this.func_181650_b(p_180709_1_, blockpos1, BlockVine.field_176273_b); + } +@@ -245,7 +247,7 @@ + this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); + int i = 4; + +- for (BlockPos blockpos = p_181650_2_.func_177977_b(); p_181650_1_.func_180495_p(blockpos).func_185904_a() == Material.field_151579_a && i > 0; --i) ++ for (BlockPos blockpos = p_181650_2_.func_177977_b(); p_181650_1_.func_175623_d(blockpos) && i > 0; --i) + { + this.func_181651_a(p_181650_1_, blockpos, p_181650_3_); + blockpos = blockpos.func_177977_b(); diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch new file mode 100644 index 000000000..6f09227e4 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java +@@ -33,7 +33,8 @@ + } + else + { +- p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, 2); ++ int flag = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 2| 16 : 2; //Forge: With bit 5 unset, it will notify neighbors and load adjacent chunks. ++ p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, flag); + } + } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch new file mode 100644 index 000000000..15c8c9b41 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch @@ -0,0 +1,47 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java +@@ -14,7 +14,7 @@ + { + public boolean func_180709_b(World p_180709_1_, Random p_180709_2_, BlockPos p_180709_3_) + { +- for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_185904_a() == Material.field_151579_a || iblockstate.func_185904_a() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 1; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) ++ for (IBlockState iblockstate = p_180709_1_.func_180495_p(p_180709_3_); (iblockstate.func_177230_c().isAir(iblockstate, p_180709_1_, p_180709_3_) || iblockstate.func_177230_c().isLeaves(iblockstate, p_180709_1_, p_180709_3_)) && p_180709_3_.func_177956_o() > 1; iblockstate = p_180709_1_.func_180495_p(p_180709_3_)) + { + p_180709_3_ = p_180709_3_.func_177977_b(); + } +@@ -31,7 +31,7 @@ + { + BlockPos blockpos = p_180709_3_.func_177982_a(p_180709_2_.nextInt(4) - p_180709_2_.nextInt(4), p_180709_2_.nextInt(3) - p_180709_2_.nextInt(3), p_180709_2_.nextInt(4) - p_180709_2_.nextInt(4)); + +- if (p_180709_1_.func_175623_d(blockpos) && p_180709_1_.func_180495_p(blockpos.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos) && p_180709_1_.func_180495_p(blockpos.func_177977_b()).isSideSolid(p_180709_1_, blockpos.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos, Blocks.field_150486_ae.func_176223_P(), 2); + TileEntity tileentity = p_180709_1_.func_175625_s(blockpos); +@@ -46,22 +46,22 @@ + BlockPos blockpos3 = blockpos.func_177978_c(); + BlockPos blockpos4 = blockpos.func_177968_d(); + +- if (p_180709_1_.func_175623_d(blockpos2) && p_180709_1_.func_180495_p(blockpos2.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos2) && p_180709_1_.func_180495_p(blockpos2.func_177977_b()).isSideSolid(p_180709_1_, blockpos2.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos2, Blocks.field_150478_aa.func_176223_P(), 2); + } + +- if (p_180709_1_.func_175623_d(blockpos1) && p_180709_1_.func_180495_p(blockpos1.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos1) && p_180709_1_.func_180495_p(blockpos1.func_177977_b()).isSideSolid(p_180709_1_, blockpos1.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos1, Blocks.field_150478_aa.func_176223_P(), 2); + } + +- if (p_180709_1_.func_175623_d(blockpos3) && p_180709_1_.func_180495_p(blockpos3.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos3) && p_180709_1_.func_180495_p(blockpos3.func_177977_b()).isSideSolid(p_180709_1_, blockpos3.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos3, Blocks.field_150478_aa.func_176223_P(), 2); + } + +- if (p_180709_1_.func_175623_d(blockpos4) && p_180709_1_.func_180495_p(blockpos4.func_177977_b()).func_185896_q()) ++ if (p_180709_1_.func_175623_d(blockpos4) && p_180709_1_.func_180495_p(blockpos4.func_177977_b()).isSideSolid(p_180709_1_, blockpos4.func_177977_b(), net.minecraft.util.EnumFacing.UP)) + { + p_180709_1_.func_180501_a(blockpos4, Blocks.field_150478_aa.func_176223_P(), 2); + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch b/patches_old/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch new file mode 100644 index 000000000..37db40005 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -0,0 +1,52 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayer.java ++++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayer.java +@@ -47,11 +47,11 @@ + i = 6; + } + ++ i = getModdedBiomeSize(p_180781_2_, i); ++ + GenLayer lvt_7_1_ = GenLayerZoom.func_75915_a(1000L, genlayer4, 0); + GenLayer genlayerriverinit = new GenLayerRiverInit(100L, lvt_7_1_); +- GenLayer lvt_8_1_ = new GenLayerBiome(200L, genlayer4, p_180781_2_, p_180781_3_); +- GenLayer genlayer6 = GenLayerZoom.func_75915_a(1000L, lvt_8_1_, 2); +- GenLayer genlayerbiomeedge = new GenLayerBiomeEdge(1000L, genlayer6); ++ GenLayer genlayerbiomeedge = p_180781_2_.getBiomeLayer(p_180781_0_, genlayer4, p_180781_3_); + GenLayer lvt_9_1_ = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); + GenLayer genlayerhills = new GenLayerHills(1000L, genlayerbiomeedge, lvt_9_1_); + GenLayer genlayer5 = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); +@@ -171,10 +171,32 @@ + + protected static boolean func_151618_b(int p_151618_0_) + { +- Biome biome = Biome.func_150568_d(p_151618_0_); +- return biome == Biomes.field_76771_b || biome == Biomes.field_150575_M || biome == Biomes.field_76776_l; ++ return net.minecraftforge.common.BiomeManager.oceanBiomes.contains(Biome.func_150568_d(p_151618_0_)); + } + ++ /* ======================================== FORGE START =====================================*/ ++ protected long nextLong(long par1) ++ { ++ long j = (this.field_75908_c >> 24) % par1; ++ ++ if (j < 0) ++ { ++ j += par1; ++ } ++ ++ this.field_75908_c *= this.field_75908_c * 6364136223846793005L + 1442695040888963407L; ++ this.field_75908_c += this.field_75907_b; ++ return j; ++ } ++ ++ public static int getModdedBiomeSize(WorldType worldType, int original) ++ { ++ net.minecraftforge.event.terraingen.WorldTypeEvent.BiomeSize event = new net.minecraftforge.event.terraingen.WorldTypeEvent.BiomeSize(worldType, original); ++ net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ return event.getNewSize(); ++ } ++ /* ========================================= FORGE END ======================================*/ ++ + protected int func_151619_a(int... p_151619_1_) + { + return p_151619_1_[this.func_75902_a(p_151619_1_.length)]; diff --git a/patches_old/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch b/patches_old/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch new file mode 100644 index 000000000..18fbcfa5a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch @@ -0,0 +1,93 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java ++++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java +@@ -7,10 +7,8 @@ + + public class GenLayerBiome extends GenLayer + { +- private Biome[] field_151623_c = new Biome[] {Biomes.field_76769_d, Biomes.field_76769_d, Biomes.field_76769_d, Biomes.field_150588_X, Biomes.field_150588_X, Biomes.field_76772_c}; +- private final Biome[] field_151621_d = new Biome[] {Biomes.field_76767_f, Biomes.field_150585_R, Biomes.field_76770_e, Biomes.field_76772_c, Biomes.field_150583_P, Biomes.field_76780_h}; +- private final Biome[] field_151622_e = new Biome[] {Biomes.field_76767_f, Biomes.field_76770_e, Biomes.field_76768_g, Biomes.field_76772_c}; +- private final Biome[] field_151620_f = new Biome[] {Biomes.field_76774_n, Biomes.field_76774_n, Biomes.field_76774_n, Biomes.field_150584_S}; ++ @SuppressWarnings("unchecked") ++ private java.util.List[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType.values().length]; + private final ChunkGeneratorSettings field_175973_g; + + public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, ChunkGeneratorSettings p_i45560_5_) +@@ -18,9 +16,30 @@ + super(p_i45560_1_); + this.field_75909_a = 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(Biomes.field_76769_d, 30)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_150588_X, 20)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76772_c, 10)); ++ + if (p_i45560_4_ == WorldType.field_77136_e) + { +- this.field_151623_c = new Biome[] {Biomes.field_76769_d, Biomes.field_76767_f, Biomes.field_76770_e, Biomes.field_76780_h, Biomes.field_76772_c, Biomes.field_76768_g}; ++ biomes[desertIdx].clear(); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76769_d, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76767_f, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76770_e, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76780_h, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76772_c, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.field_76768_g, 10)); + this.field_175973_g = null; + } + else +@@ -70,7 +89,7 @@ + } + else + { +- aint1[j + i * p_75904_3_] = Biome.func_185362_a(this.field_151623_c[this.func_75902_a(this.field_151623_c.length)]); ++ aint1[j + i * p_75904_3_] = Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT).biome); + } + } + else if (k == 2) +@@ -81,7 +100,7 @@ + } + else + { +- aint1[j + i * p_75904_3_] = Biome.func_185362_a(this.field_151621_d[this.func_75902_a(this.field_151621_d.length)]); ++ aint1[j + i * p_75904_3_] = Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM).biome); + } + } + else if (k == 3) +@@ -92,12 +111,12 @@ + } + else + { +- aint1[j + i * p_75904_3_] = Biome.func_185362_a(this.field_151622_e[this.func_75902_a(this.field_151622_e.length)]); ++ aint1[j + i * p_75904_3_] = Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL).biome); + } + } + else if (k == 4) + { +- aint1[j + i * p_75904_3_] = Biome.func_185362_a(this.field_151620_f[this.func_75902_a(this.field_151620_f.length)]); ++ aint1[j + i * p_75904_3_] = Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY).biome); + } + else + { +@@ -108,4 +127,12 @@ + + return aint1; + } ++ ++ protected net.minecraftforge.common.BiomeManager.BiomeEntry getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType type) ++ { ++ java.util.List biomeList = biomes[type.ordinal()]; ++ int totalWeight = net.minecraft.util.WeightedRandom.func_76272_a(biomeList); ++ int weight = net.minecraftforge.common.BiomeManager.isTypeListModded(type)?func_75902_a(totalWeight):func_75902_a(totalWeight / 10) * 10; ++ return (net.minecraftforge.common.BiomeManager.BiomeEntry)net.minecraft.util.WeightedRandom.func_180166_a(biomeList, weight); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch b/patches_old/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch new file mode 100644 index 000000000..d9a07a6c9 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java +@@ -29,11 +29,19 @@ + + for (Biome biome : Biome.field_185377_q) + { +- if (biome != null && biome.func_185355_j() > 0.0F) ++ if (biome != null && biome.func_185355_j() > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biome)) + { + this.field_151546_e.add(biome); + } + } ++ ++ for (Biome 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_old/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch b/patches_old/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch new file mode 100644 index 000000000..b0924ce1f --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java +@@ -175,12 +175,12 @@ + { + if (this.field_143029_e == null && p_143027_1_ != null) + { +- this.field_143029_e = (MapGenStructureData)p_143027_1_.func_72943_a(MapGenStructureData.class, this.func_143025_a()); ++ this.field_143029_e = (MapGenStructureData)p_143027_1_.getPerWorldStorage().func_75742_a(MapGenStructureData.class, this.func_143025_a()); + + if (this.field_143029_e == null) + { + this.field_143029_e = new MapGenStructureData(this.func_143025_a()); +- p_143027_1_.func_72823_a(this.func_143025_a(), this.field_143029_e); ++ p_143027_1_.getPerWorldStorage().func_75745_a(this.func_143025_a(), this.field_143029_e); + } + else + { diff --git a/patches_old/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch b/patches_old/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch new file mode 100644 index 000000000..d46138d51 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureComponent.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureComponent.java +@@ -41,6 +41,10 @@ + + public final NBTTagCompound func_143010_b() + { ++ if (MapGenStructureIO.func_143036_a(this) == null) // Friendlier error then the Null String error below. ++ { ++ throw new RuntimeException("StructureComponent \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); ++ } + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143036_a(this)); + nbttagcompound.func_74782_a("BB", this.field_74887_e.func_151535_h()); diff --git a/patches_old/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch b/patches_old/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch new file mode 100644 index 000000000..c8db28dbb --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStart.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStart.java +@@ -63,6 +63,10 @@ + + public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) + { ++ if (MapGenStructureIO.func_143033_a(this) == null) // This is just a more friendly error instead of the 'Null String' below ++ { ++ throw new RuntimeException("StructureStart \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); ++ } + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143033_a(this)); + nbttagcompound.func_74768_a("ChunkX", p_143021_1_); +@@ -98,7 +102,8 @@ + + for (int i = 0; i < nbttaglist.func_74745_c(); ++i) + { +- this.field_75075_a.add(MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_)); ++ StructureComponent tmp = MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_); ++ if (tmp != null) this.field_75075_a.add(tmp); //Forge: Prevent NPEs further down the line when a componenet can't be loaded. + } + + this.func_143017_b(p_143020_2_); diff --git a/patches_old/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/patches_old/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch new file mode 100644 index 000000000..b65b5cd04 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -0,0 +1,93 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java +@@ -68,6 +68,7 @@ + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.func_76136_a(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.func_76136_a(p_75084_0_, 0, 1 + p_75084_1_))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.func_76136_a(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); ++ net.minecraftforge.fml.common.registry.VillagerRegistry.addExtraVillageComponents(list, p_75084_0_, p_75084_1_); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) +@@ -140,6 +141,10 @@ + { + structurevillagepieces$village = StructureVillagePieces.House3.func_175849_a(p_176065_0_, p_176065_2_, p_176065_3_, p_176065_4_, p_176065_5_, p_176065_6_, p_176065_7_, p_176065_8_); + } ++ else ++ { ++ structurevillagepieces$village = net.minecraftforge.fml.common.registry.VillagerRegistry.getVillageComponent(p_176065_1_, p_176065_0_ , p_176065_2_, p_176065_3_, p_176065_4_, p_176065_5_, p_176065_6_, p_176065_7_, p_176065_8_); ++ } + + return structurevillagepieces$village; + } +@@ -1539,6 +1544,7 @@ + public List field_74931_h; + public List field_74932_i = Lists.newArrayList(); + public List field_74930_j = Lists.newArrayList(); ++ public Biome biome; + + public Start() + { +@@ -1551,6 +1557,8 @@ + this.field_74931_h = p_i2104_6_; + this.field_74928_c = p_i2104_7_; + Biome biome = p_i2104_1_.func_180300_a(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.field_180279_ad); ++ this.biome = biome; ++ this.startPiece = this; + + if (biome instanceof BiomeDesert) + { +@@ -1623,6 +1631,7 @@ + private int field_74896_a; + protected int field_189928_h; + protected boolean field_189929_i; ++ protected StructureVillagePieces.Start startPiece; + + public Village() + { +@@ -1636,6 +1645,7 @@ + { + this.field_189928_h = p_i2107_1_.field_189928_h; + this.field_189929_i = p_i2107_1_.field_189929_i; ++ startPiece = p_i2107_1_; + } + } + +@@ -1770,7 +1780,6 @@ + EntityZombieVillager entityzombievillager = new EntityZombieVillager(p_74893_1_); + entityzombievillager.func_70012_b((double)j + 0.5D, (double)k, (double)l + 0.5D, 0.0F, 0.0F); + entityzombievillager.func_180482_a(p_74893_1_.func_175649_E(new BlockPos(entityzombievillager)), (IEntityLivingData)null); +- entityzombievillager.func_190733_a(this.func_180779_c(i, 0)); + entityzombievillager.func_110163_bv(); + p_74893_1_.func_72838_d(entityzombievillager); + } +@@ -1778,7 +1787,7 @@ + { + EntityVillager entityvillager = new EntityVillager(p_74893_1_); + entityvillager.func_70012_b((double)j + 0.5D, (double)k, (double)l + 0.5D, 0.0F, 0.0F); +- entityvillager.func_70938_b(this.func_180779_c(i, p_74893_1_.field_73012_v.nextInt(6))); ++ entityvillager.setProfession(this.chooseForgeProfession(i, entityvillager.getProfessionForge())); + entityvillager.func_190672_a(p_74893_1_.func_175649_E(new BlockPos(entityvillager)), (IEntityLivingData)null, false); + p_74893_1_.func_72838_d(entityvillager); + } +@@ -1786,13 +1795,21 @@ + } + } + ++ @Deprecated // Use Forge version below. + protected int func_180779_c(int p_180779_1_, int p_180779_2_) + { + return p_180779_2_; + } ++ protected net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession chooseForgeProfession(int count, net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession prof) ++ { ++ return net.minecraftforge.fml.common.registry.VillagerRegistry.getById(func_180779_c(count, net.minecraftforge.fml.common.registry.VillagerRegistry.getId(prof))); ++ } + + protected IBlockState func_175847_a(IBlockState p_175847_1_) + { ++ net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID event = new net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, p_175847_1_); ++ net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getReplacement(); + if (this.field_189928_h == 1) + { + if (p_175847_1_.func_177230_c() == Blocks.field_150364_r || p_175847_1_.func_177230_c() == Blocks.field_150363_s) diff --git a/patches_old/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch b/patches_old/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch new file mode 100644 index 000000000..4ed1f367d --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/template/Template.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/template/Template.java +@@ -211,6 +211,8 @@ + for (Template.BlockInfo template$blockinfo : this.field_186270_a) + { + BlockPos blockpos = func_186266_a(p_189960_4_, template$blockinfo.field_186242_a).func_177971_a(p_189960_2_); ++ // Forge: skip processing blocks outside BB to prevent cascading worldgen issues ++ if (structureboundingbox != null && !structureboundingbox.func_175898_b(blockpos)) continue; + Template.BlockInfo template$blockinfo1 = p_189960_3_ != null ? p_189960_3_.func_189943_a(p_189960_1_, blockpos, template$blockinfo) : template$blockinfo; + + if (template$blockinfo1 != null) +@@ -514,6 +516,7 @@ + nbttaglist2.func_74742_a(NBTUtil.func_190009_a(new NBTTagCompound(), iblockstate)); + } + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(p_189552_1_); //Moved up for MC updating reasons. + p_189552_1_.func_74782_a("palette", nbttaglist2); + p_189552_1_.func_74782_a("blocks", nbttaglist); + p_189552_1_.func_74782_a("entities", nbttaglist1); diff --git a/patches_old/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch b/patches_old/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch new file mode 100644 index 000000000..7c992734a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch @@ -0,0 +1,28 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java ++++ ../src-work/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java +@@ -218,13 +218,25 @@ + { + } + ++ @Deprecated + public void func_186345_a(DimensionType p_186345_1_, NBTTagCompound p_186345_2_) + { + this.field_76115_a.func_186345_a(p_186345_1_, p_186345_2_); + } + ++ @Deprecated + public NBTTagCompound func_186347_a(DimensionType p_186347_1_) + { + return this.field_76115_a.func_186347_a(p_186347_1_); + } ++ ++ public void setDimensionData(int dimensionID, NBTTagCompound compound) ++ { ++ this.field_76115_a.setDimensionData(dimensionID, compound); ++ } ++ ++ public NBTTagCompound getDimensionData(int dimensionID) ++ { ++ return this.field_76115_a.getDimensionData(dimensionID); ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches_old/minecraft/net/minecraft/world/storage/MapData.java.patch new file mode 100644 index 000000000..df1ee059a --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -0,0 +1,41 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/MapData.java ++++ ../src-work/minecraft/net/minecraft/world/storage/MapData.java +@@ -20,7 +20,7 @@ + { + public int field_76201_a; + public int field_76199_b; +- public byte field_76200_c; ++ public int field_76200_c; //FML byte -> int + public boolean field_186210_e; + public boolean field_191096_f; + public byte field_76197_d; +@@ -45,7 +45,7 @@ + + public void func_76184_a(NBTTagCompound p_76184_1_) + { +- this.field_76200_c = p_76184_1_.func_74771_c("dimension"); ++ this.field_76200_c = p_76184_1_.func_74762_e("dimension"); + this.field_76201_a = p_76184_1_.func_74762_e("xCenter"); + this.field_76199_b = p_76184_1_.func_74762_e("zCenter"); + this.field_76197_d = p_76184_1_.func_74771_c("scale"); +@@ -97,7 +97,7 @@ + + public NBTTagCompound func_189551_b(NBTTagCompound p_189551_1_) + { +- p_189551_1_.func_74774_a("dimension", this.field_76200_c); ++ p_189551_1_.func_74768_a("dimension", this.field_76200_c); + p_189551_1_.func_74768_a("xCenter", this.field_76201_a); + p_189551_1_.func_74768_a("zCenter", this.field_76199_b); + p_189551_1_.func_74774_a("scale", this.field_76197_d); +@@ -208,9 +208,9 @@ + p_191095_8_ = p_191095_8_ + (p_191095_8_ < 0.0D ? -8.0D : 8.0D); + b2 = (byte)((int)(p_191095_8_ * 16.0D / 360.0D)); + +- if (this.field_76200_c < 0) ++ if (p_191095_2_.field_73011_w.shouldMapSpin(p_191095_3_, p_191095_4_, p_191095_6_, p_191095_8_)) + { +- int l = (int)(p_191095_2_.func_72912_H().func_76073_f() / 10L); ++ int l = (int)(p_191095_2_.func_72820_D() / 10L); + b2 = (byte)(l * l * 34187121 + l * 121 >> 15 & 15); + } + } diff --git a/patches_old/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch b/patches_old/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch new file mode 100644 index 000000000..60f926478 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/SaveFormatOld.java ++++ ../src-work/minecraft/net/minecraft/world/storage/SaveFormatOld.java +@@ -109,6 +109,24 @@ + } + } + ++ //Forge: Special version of the above that runs during actual world loading and not metadata gathering. ++ public static WorldInfo loadAndFix(File file, DataFixer fixer, SaveHandler save) ++ { ++ try ++ { ++ NBTTagCompound nbt = CompressedStreamTools.func_74796_a(new FileInputStream(file)); ++ WorldInfo info = new WorldInfo(fixer.func_188257_a(FixTypes.LEVEL, nbt.func_74775_l("Data"))); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(save, info, nbt); ++ return info; ++ } ++ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) { throw e; } ++ catch (Exception exception) ++ { ++ field_151479_b.error((String)("Exception reading " + file), (Throwable)exception); ++ return null; ++ } ++ } ++ + @SideOnly(Side.CLIENT) + public void func_75806_a(String p_75806_1_, String p_75806_2_) + { diff --git a/patches_old/minecraft/net/minecraft/world/storage/SaveHandler.java.patch b/patches_old/minecraft/net/minecraft/world/storage/SaveHandler.java.patch new file mode 100644 index 000000000..c297315d0 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/storage/SaveHandler.java.patch @@ -0,0 +1,70 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/SaveHandler.java ++++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java +@@ -119,7 +119,7 @@ + + if (file1.exists()) + { +- WorldInfo worldinfo = SaveFormatOld.func_186353_a(file1, this.field_186341_a); ++ WorldInfo worldinfo = SaveFormatOld.loadAndFix(file1, this.field_186341_a, this); + + if (worldinfo != null) + { +@@ -127,8 +127,9 @@ + } + } + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().confirmBackupLevelDatUse(this); + file1 = new File(this.field_75770_b, "level.dat_old"); +- return file1.exists() ? SaveFormatOld.func_186353_a(file1, this.field_186341_a) : null; ++ return file1.exists() ? SaveFormatOld.loadAndFix(file1, this.field_186341_a, this) : null; + } + + public void func_75755_a(WorldInfo p_75755_1_, @Nullable NBTTagCompound p_75755_2_) +@@ -137,6 +138,8 @@ + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.func_74782_a("Data", nbttagcompound); + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, p_75755_1_, nbttagcompound1); ++ + try + { + File file1 = new File(this.field_75770_b, "level.dat_new"); +@@ -189,6 +192,7 @@ + } + + file1.renameTo(file2); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(p_75753_1_, this.field_75771_c, p_75753_1_.func_110124_au().toString()); + } + catch (Exception var5) + { +@@ -220,6 +224,7 @@ + p_75752_1_.func_70020_e(this.field_186341_a.func_188257_a(FixTypes.PLAYER, nbttagcompound)); + } + ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_75752_1_, field_75771_c, p_75752_1_.func_110124_au().toString()); + return nbttagcompound; + } + +@@ -261,4 +266,22 @@ + { + return this.field_186342_h; + } ++ ++ public NBTTagCompound getPlayerNBT(net.minecraft.entity.player.EntityPlayerMP player) ++ { ++ try ++ { ++ File file1 = new File(this.field_75771_c, player.func_110124_au().toString() + ".dat"); ++ ++ if (file1.exists() && file1.isFile()) ++ { ++ return CompressedStreamTools.func_74796_a(new FileInputStream(file1)); ++ } ++ } ++ catch (Exception exception) ++ { ++ field_151478_a.warn("Failed to load player data for " + player.func_70005_c_()); ++ } ++ return null; ++ } + } diff --git a/patches_old/minecraft/net/minecraft/world/storage/WorldInfo.java.patch b/patches_old/minecraft/net/minecraft/world/storage/WorldInfo.java.patch new file mode 100644 index 000000000..798480c46 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/storage/WorldInfo.java.patch @@ -0,0 +1,103 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/WorldInfo.java ++++ ../src-work/minecraft/net/minecraft/world/storage/WorldInfo.java +@@ -63,8 +63,9 @@ + private double field_176153_H = 0.2D; + private int field_176154_I = 5; + private int field_176155_J = 15; +- private final Map field_186348_N = Maps.newEnumMap(DimensionType.class); ++ private final Map field_186348_N = Maps.newHashMap(); + private GameRules field_82577_x = new GameRules(); ++ private java.util.Map additionalProperties; + + protected WorldInfo() + { +@@ -251,7 +252,7 @@ + + for (String s : nbttagcompound1.func_150296_c()) + { +- this.field_186348_N.put(DimensionType.func_186069_a(Integer.parseInt(s)), nbttagcompound1.func_74775_l(s)); ++ this.field_186348_N.put(Integer.parseInt(s), nbttagcompound1.func_74775_l(s)); + } + } + } +@@ -366,6 +367,7 @@ + p_76064_1_.func_74780_a("BorderSizeLerpTarget", this.field_176148_F); + p_76064_1_.func_74780_a("BorderWarningBlocks", (double)this.field_176154_I); + p_76064_1_.func_74780_a("BorderWarningTime", (double)this.field_176155_J); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(p_76064_1_); + + if (this.field_176158_z != null) + { +@@ -376,9 +378,10 @@ + p_76064_1_.func_74782_a("GameRules", this.field_82577_x.func_82770_a()); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + +- for (Entry entry : this.field_186348_N.entrySet()) ++ for (Entry entry : this.field_186348_N.entrySet()) + { +- nbttagcompound1.func_74782_a(String.valueOf(((DimensionType)entry.getKey()).func_186068_a()), entry.getValue()); ++ if (entry.getValue() == null || entry.getValue().func_82582_d()) continue; ++ nbttagcompound1.func_74782_a(String.valueOf(entry.getKey()), entry.getValue()); + } + + p_76064_1_.func_74782_a("DimensionData", nbttagcompound1); +@@ -708,6 +711,7 @@ + + public void func_176144_a(EnumDifficulty p_176144_1_) + { ++ net.minecraftforge.common.ForgeHooks.onDifficultyChange(p_176144_1_, this.field_176158_z); + this.field_176158_z = p_176144_1_; + } + +@@ -805,18 +809,49 @@ + } + }); + } ++ /** ++ * 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 ++ * Used by Forge to store the dimensions available to a world ++ * @param additionalProperties ++ */ ++ public void setAdditionalProperties(java.util.Map additionalProperties) ++ { ++ // one time set for this ++ if (this.additionalProperties == null) ++ { ++ this.additionalProperties = additionalProperties; ++ } ++ } + ++ public net.minecraft.nbt.NBTBase getAdditionalProperty(String additionalProperty) ++ { ++ return this.additionalProperties!=null? this.additionalProperties.get(additionalProperty) : null; ++ } ++ ++ @Deprecated //Use the int version below, and pass in dimension id NOT TYPE id + public NBTTagCompound func_186347_a(DimensionType p_186347_1_) + { +- NBTTagCompound nbttagcompound = this.field_186348_N.get(p_186347_1_); ++ return getDimensionData(p_186347_1_.func_186068_a()); ++ } ++ public NBTTagCompound getDimensionData(int dimensionIn) ++ { ++ NBTTagCompound nbttagcompound = this.field_186348_N.get(dimensionIn); + return nbttagcompound == null ? new NBTTagCompound() : nbttagcompound; + } + ++ @Deprecated //Use the int version below, and pass in dimension id NOT TYPE id + public void func_186345_a(DimensionType p_186345_1_, NBTTagCompound p_186345_2_) + { +- this.field_186348_N.put(p_186345_1_, p_186345_2_); ++ this.setDimensionData(p_186345_1_.func_186068_a(), p_186345_2_); + } + ++ //Dimension numerical ID version of setter, as two dimensions could in theory have the same DimensionType. ID should be grabbed from the world NOT the Type ++ public void setDimensionData(int dimensionID, NBTTagCompound compound) ++ { ++ this.field_186348_N.put(dimensionID, compound); ++ } ++ + @SideOnly(Side.CLIENT) + public int func_186344_K() + { diff --git a/patches_old/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch b/patches_old/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch new file mode 100644 index 000000000..2849daca6 --- /dev/null +++ b/patches_old/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/WorldSavedData.java ++++ ../src-work/minecraft/net/minecraft/world/storage/WorldSavedData.java +@@ -2,7 +2,7 @@ + + import net.minecraft.nbt.NBTTagCompound; + +-public abstract class WorldSavedData ++public abstract class WorldSavedData implements net.minecraftforge.common.util.INBTSerializable + { + public final String field_76190_i; + private boolean field_76189_a; +@@ -30,4 +30,14 @@ + { + return this.field_76189_a; + } ++ ++ public void deserializeNBT(NBTTagCompound nbt) ++ { ++ this.func_76184_a(nbt); ++ } ++ ++ public NBTTagCompound serializeNBT() ++ { ++ return this.func_189551_b(new NBTTagCompound()); ++ } + } diff --git a/patches_old_unknown/BlockDynamicLiquid.java.patch b/patches_old_unknown/BlockDynamicLiquid.java.patch new file mode 100644 index 000000000..6cb27004c --- /dev/null +++ b/patches_old_unknown/BlockDynamicLiquid.java.patch @@ -0,0 +1,60 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockDynamicLiquid.java ++++ ../src-work/minecraft/net/minecraft/block/BlockDynamicLiquid.java +@@ -26,6 +26,7 @@ + + public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_) + { ++ if (!p_180650_1_.func_175697_a(p_180650_2_, this.func_185698_b(p_180650_1_))) return; // Forge: avoid loading unloaded chunks + int i = ((Integer)p_180650_3_.func_177229_b(field_176367_b)).intValue(); + int j = 1; + +@@ -67,7 +68,7 @@ + } + } + +- if (this.field_149815_a >= 2 && this.field_149764_J == Material.field_151586_h) ++ if (this.field_149815_a >= 2 && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_180650_1_, p_180650_2_, p_180650_3_, this.field_149764_J == Material.field_151586_h)) + { + IBlockState iblockstate = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()); + +@@ -118,7 +119,7 @@ + { + if (this.field_149764_J == Material.field_151587_i && p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185904_a() == Material.field_151586_h) + { +- p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), Blocks.field_150348_b.func_176223_P()); ++ p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, p_180650_2_.func_177977_b(), p_180650_2_, Blocks.field_150348_b.func_176223_P())); + this.func_180688_d(p_180650_1_, p_180650_2_.func_177977_b()); + return; + } +@@ -166,6 +167,7 @@ + } + else + { ++ if (p_176375_3_.func_177230_c() != Blocks.field_150431_aC) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww... + p_176375_3_.func_177230_c().func_176226_b(p_176375_1_, p_176375_2_, p_176375_3_, 0); + } + } +@@ -187,7 +189,7 @@ + + if (!this.func_176372_g(p_176374_1_, blockpos, iblockstate) && (iblockstate.func_185904_a() != this.field_149764_J || ((Integer)iblockstate.func_177229_b(field_176367_b)).intValue() > 0)) + { +- if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), iblockstate)) ++ if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), p_176374_1_.func_180495_p(blockpos.func_177977_b()))) + { + return p_176374_3_; + } +@@ -254,11 +256,12 @@ + + private boolean func_176372_g(World p_176372_1_, BlockPos p_176372_2_, IBlockState p_176372_3_) + { +- Block block = p_176372_1_.func_180495_p(p_176372_2_).func_177230_c(); ++ Block block = p_176372_3_.func_177230_c(); //Forge: state must be valid for position ++ Material mat = p_176372_3_.func_185904_a(); + + if (!(block instanceof BlockDoor) && block != Blocks.field_150472_an && block != Blocks.field_150468_ap && block != Blocks.field_150436_aH) + { +- return block.field_149764_J != Material.field_151567_E && block.field_149764_J != Material.field_189963_J ? block.field_149764_J.func_76230_c() : true; ++ return mat != Material.field_151567_E && mat != Material.field_189963_J ? mat.func_76230_c() : true; + } + else + { diff --git a/patches_old_unknown/BlockFlowerPot.java.patch b/patches_old_unknown/BlockFlowerPot.java.patch new file mode 100644 index 000000000..fb380d96d --- /dev/null +++ b/patches_old_unknown/BlockFlowerPot.java.patch @@ -0,0 +1,64 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java +@@ -152,12 +152,14 @@ + + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) + { +- return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q(); ++ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); ++ return super.func_176196_c(p_176196_1_, p_176196_2_) && (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID); + } + + public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_) + { +- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q()) ++ IBlockState downState = p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()); ++ if (!downState.func_185896_q() && downState.func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID) + { + this.func_176226_b(p_189540_2_, p_189540_3_, p_189540_1_, 0); + p_189540_2_.func_175698_g(p_189540_3_); +@@ -166,13 +168,6 @@ + + public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) + { +- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_); +- +- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null) +- { +- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b())); +- } +- + super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); + } + +@@ -398,6 +393,30 @@ + return BlockFaceShape.UNDEFINED; + } + ++ ++ /*============================FORGE START=====================================*/ ++ @Override ++ public void getDrops(net.minecraft.util.NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) ++ { ++ super.getDrops(drops, world, pos, state, fortune); ++ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null; ++ if (te != null && te.func_145965_a() != null) ++ drops.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b())); ++ } ++ @Override ++ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) ++ { ++ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops ++ return super.removedByPlayer(state, world, pos, player, willHarvest); ++ } ++ @Override ++ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack tool) ++ { ++ super.func_180657_a(world, player, pos, state, te, tool); ++ world.func_175698_g(pos); ++ } ++ /*===========================FORGE END==========================================*/ ++ + public static enum EnumFlowerType implements IStringSerializable + { + EMPTY("empty"), diff --git a/patches_old_unknown/BlockLeaves.java.patch b/patches_old_unknown/BlockLeaves.java.patch new file mode 100644 index 000000000..cc6f07c90 --- /dev/null +++ b/patches_old_unknown/BlockLeaves.java.patch @@ -0,0 +1,51 @@ +@@ -53,9 +53,9 @@ + BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1); + IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos); + +- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue()) ++ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos)) + { +- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4); ++ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos); + } + } + } +@@ -83,7 +83,8 @@ + this.field_150128_a = new int[32768]; + } + +- if (p_180650_1_.func_175707_a(new BlockPos(k - 5, l - 5, i1 - 5), new BlockPos(k + 5, l + 5, i1 + 5))) ++ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent decaying leaves from updating neighbors and loading unloaded chunks ++ if (p_180650_1_.func_175697_a(p_180650_2_, 6)) // Forge: extend range from 5 to 6 to account for neighbor checks in world.markAndNotifyBlock -> world.updateObservingBlocksAt + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + +@@ -96,9 +97,9 @@ + IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)); + Block block = iblockstate.func_177230_c(); + +- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s) ++ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) + { +- if (iblockstate.func_185904_a() == Material.field_151584_j) ++ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) + { + this.field_150128_a[(i2 + 16) * 1024 + (j2 + 16) * 32 + k2 + 16] = -2; + } + + protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_) +@@ -274,6 +242,51 @@ + + public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_); + ++ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; } ++ ++ @Override ++ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos) ++ { ++ if (!(Boolean)state.func_177229_b(field_176236_b)) ++ { ++ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4); ++ } ++ } ++ diff --git a/patches_old_unknown/BlockLiquid.java.patch b/patches_old_unknown/BlockLiquid.java.patch new file mode 100644 index 000000000..f5635a58f --- /dev/null +++ b/patches_old_unknown/BlockLiquid.java.patch @@ -0,0 +1,49 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java +@@ -284,14 +284,14 @@ + + if (integer.intValue() == 0) + { +- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150343_Z.func_176223_P()); ++ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150343_Z.func_176223_P())); + this.func_180688_d(p_176365_1_, p_176365_2_); + return true; + } + + if (integer.intValue() <= 4) + { +- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150347_e.func_176223_P()); ++ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150347_e.func_176223_P())); + this.func_180688_d(p_176365_1_, p_176365_2_); + return true; + } +@@ -452,4 +452,29 @@ + { + return BlockFaceShape.UNDEFINED; + } ++ ++ @Override ++ @SideOnly (Side.CLIENT) ++ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks) ++ { ++ Vec3d viewport = net.minecraft.client.renderer.ActiveRenderInfo.func_178806_a(entity, partialTicks); ++ ++ if (state.func_185904_a().func_76224_d()) ++ { ++ float height = 0.0F; ++ if (state.func_177230_c() instanceof BlockLiquid) ++ { ++ height = func_149801_b(state.func_177229_b(field_176367_b)) - 0.11111111F; ++ } ++ float f1 = (float) (pos.func_177956_o() + 1) - height; ++ if (viewport.field_72448_b > (double)f1) ++ { ++ BlockPos upPos = pos.func_177984_a(); ++ IBlockState upState = world.func_180495_p(upPos); ++ return upState.func_177230_c().getFogColor(world, upPos, upState, entity, originalColor, partialTicks); ++ } ++ } ++ ++ return super.getFogColor(world, pos, state, entity, originalColor, partialTicks); ++ } + } diff --git a/patches_old_unknown/BlockLog.java.patch b/patches_old_unknown/BlockLog.java.patch new file mode 100644 index 000000000..626833921 --- /dev/null +++ b/patches_old_unknown/BlockLog.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLog.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLog.java +@@ -34,9 +34,9 @@ + { + IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos); + +- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue()) ++ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos)) + { +- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4); ++ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos); + } + } + } +@@ -69,6 +69,9 @@ + } + } + ++ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } ++ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } ++ + public static enum EnumAxis implements IStringSerializable + { + X("x"), diff --git a/patches_old_unknown/BlockObserver.java.patch b/patches_old_unknown/BlockObserver.java.patch new file mode 100644 index 000000000..ba62fd8ad --- /dev/null +++ b/patches_old_unknown/BlockObserver.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockObserver.java ++++ ../src-work/minecraft/net/minecraft/block/BlockObserver.java +@@ -145,4 +145,12 @@ + { + return this.func_176223_P().func_177226_a(field_176387_N, EnumFacing.func_82600_a(p_176203_1_ & 7)); + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ @Override ++ public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos) ++ { ++ func_190962_b(observerState, world, observerPos, changedBlock, changedBlockPos); ++ } ++ /* ========================================= FORGE END ======================================*/ + } diff --git a/patches_old_unknown/BlockSlab.java.patch b/patches_old_unknown/BlockSlab.java.patch new file mode 100644 index 000000000..2b1c6a50d --- /dev/null +++ b/patches_old_unknown/BlockSlab.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockSlab.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java +@@ -80,6 +80,19 @@ + return this.func_176552_j(); + } + ++ @Override ++ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) ++ { ++ if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling) ++ return super.doesSideBlockRendering(state, world, pos, face); ++ ++ if ( state.func_185914_p() ) ++ return true; ++ ++ EnumBlockHalf side = state.func_177229_b(field_176554_a); ++ return (side == EnumBlockHalf.TOP && face == EnumFacing.UP) || (side == EnumBlockHalf.BOTTOM && face == EnumFacing.DOWN); ++ } ++ + public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) + { + IBlockState iblockstate = super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176554_a, BlockSlab.EnumBlockHalf.BOTTOM); +@@ -115,7 +128,7 @@ + { + return false; + } +- else ++ else if (false) // Forge: Additional logic breaks doesSideBlockRendering and is no longer useful. + { + IBlockState iblockstate = p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)); + boolean flag = func_185675_i(iblockstate) && iblockstate.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP; +@@ -149,6 +162,7 @@ + return !func_185675_i(iblockstate) || flag; + } + } ++ return super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_); + } + + @SideOnly(Side.CLIENT) diff --git a/patches_old_unknown/BlockStairs.java.patch b/patches_old_unknown/BlockStairs.java.patch new file mode 100644 index 000000000..648edc76d --- /dev/null +++ b/patches_old_unknown/BlockStairs.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockStairs.java ++++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java +@@ -483,6 +483,29 @@ + return new BlockStateContainer(this, new IProperty[] {field_176309_a, field_176308_b, field_176310_M}); + } + ++ @Override ++ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) ++ { ++ if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling) ++ return super.doesSideBlockRendering(state, world, pos, face); ++ ++ if ( state.func_185914_p() ) ++ return true; ++ ++ state = this.func_176221_a(state, world, pos); ++ ++ EnumHalf half = state.func_177229_b(field_176308_b); ++ EnumFacing side = state.func_177229_b(field_176309_a); ++ EnumShape shape = state.func_177229_b(field_176310_M); ++ if (face == EnumFacing.UP) return half == EnumHalf.TOP; ++ if (face == EnumFacing.DOWN) return half == EnumHalf.BOTTOM; ++ if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT) return false; ++ if (face == side) return true; ++ if (shape == EnumShape.INNER_LEFT && face.func_176746_e() == side) return true; ++ if (shape == EnumShape.INNER_RIGHT && face.func_176735_f() == side) return true; ++ return false; ++ } ++ + public static enum EnumHalf implements IStringSerializable + { + TOP("top"), diff --git a/patches_old_unknown/BlockStaticLiquid.java.patch b/patches_old_unknown/BlockStaticLiquid.java.patch new file mode 100644 index 000000000..20d78abae --- /dev/null +++ b/patches_old_unknown/BlockStaticLiquid.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockStaticLiquid.java ++++ ../src-work/minecraft/net/minecraft/block/BlockStaticLiquid.java +@@ -52,22 +52,22 @@ + { + blockpos = blockpos.func_177982_a(p_180650_4_.nextInt(3) - 1, 1, p_180650_4_.nextInt(3) - 1); + +- if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256 && !p_180650_1_.func_175667_e(blockpos)) ++ if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < p_180650_1_.func_72800_K() && !p_180650_1_.func_175667_e(blockpos)) + { + return; + } + +- Block block = p_180650_1_.func_180495_p(blockpos).func_177230_c(); ++ IBlockState block = p_180650_1_.func_180495_p(blockpos); + +- if (block.field_149764_J == Material.field_151579_a) ++ if (block.func_177230_c().isAir(block, p_180650_1_, blockpos)) + { + if (this.func_176369_e(p_180650_1_, blockpos)) + { +- p_180650_1_.func_175656_a(blockpos, Blocks.field_150480_ab.func_176223_P()); ++ p_180650_1_.func_175656_a(blockpos, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, blockpos, p_180650_2_, Blocks.field_150480_ab.func_176223_P())); + return; + } + } +- else if (block.field_149764_J.func_76230_c()) ++ else if (block.func_185904_a().func_76230_c()) + { + return; + } +@@ -86,7 +86,7 @@ + + if (p_180650_1_.func_175623_d(blockpos1.func_177984_a()) && this.func_176368_m(p_180650_1_, blockpos1)) + { +- p_180650_1_.func_175656_a(blockpos1.func_177984_a(), Blocks.field_150480_ab.func_176223_P()); ++ p_180650_1_.func_175656_a(blockpos1.func_177984_a(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, blockpos1.func_177984_a(), p_180650_2_, Blocks.field_150480_ab.func_176223_P())); + } + } + } diff --git a/patches_old_unknown/CrashReport.java.patch b/patches_old_unknown/CrashReport.java.patch new file mode 100644 index 000000000..fc71a49cd --- /dev/null +++ b/patches_old_unknown/CrashReport.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/crash/CrashReport.java ++++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java +@@ -116,6 +116,7 @@ + return IntCache.func_85144_b(); + } + }); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().enhanceCrashReport(this, this.field_85061_c); + } + + public String func_71501_a() +@@ -205,6 +206,7 @@ + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append("---- Minecraft Crash Report ----\n"); ++ net.minecraftforge.fml.relauncher.CoreModManager.onCrash(stringbuilder); + stringbuilder.append("// "); + stringbuilder.append(func_71503_h()); + stringbuilder.append("\n\n"); diff --git a/patches_old_unknown/EntityMinecart.java.patch b/patches_old_unknown/EntityMinecart.java.patch new file mode 100644 index 000000000..200de4fc1 --- /dev/null +++ b/patches_old_unknown/EntityMinecart.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecart.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java +@@ -105,18 +119,20 @@ + @Nullable + public AxisAlignedBB func_70046_E() + { ++ if (getCollisionHandler() != null) return getCollisionHandler().getBoundingBox(this); + return null; + } +@@ -1014,7 +1046,237 @@ + { + this.func_184212_Q().func_187227_b(field_184270_f, Boolean.valueOf(p_94096_1_)); + } ++ ++ @Override ++ public boolean func_184230_a(EntityPlayer player, net.minecraft.util.EnumHand hand) ++ { ++ return net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player, hand)); ++ } diff --git a/patches_old_unknown/EntityPlayerSP.java.patch b/patches_old_unknown/EntityPlayerSP.java.patch new file mode 100644 index 000000000..8d6f3cb6b --- /dev/null +++ b/patches_old_unknown/EntityPlayerSP.java.patch @@ -0,0 +1,68 @@ +--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java ++++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +@@ -448,6 +449,15 @@ + } + } + ++ private boolean isHeadspaceFree(BlockPos pos, int height) ++ { ++ for (int y = 0; y < height; y++) ++ { ++ if (!func_175162_d(pos.func_177982_a(0, y, 0))) return false; ++ } ++ return true; ++ } ++ + protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) + { + if (this.field_70145_X) +@@ -460,30 +470,34 @@ + double d0 = p_145771_1_ - (double)blockpos.func_177958_n(); + double d1 = p_145771_5_ - (double)blockpos.func_177952_p(); + +- if (!this.func_175162_d(blockpos)) ++ int entHeight = Math.max((int)Math.ceil(this.field_70131_O), 1); ++ ++ boolean inTranslucentBlock = !this.isHeadspaceFree(blockpos, entHeight); ++ ++ if (inTranslucentBlock) + { + int i = -1; + double d2 = 9999.0D; + +- if (this.func_175162_d(blockpos.func_177976_e()) && d0 < d2) ++ if (this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d0 < d2) + { + d2 = d0; + i = 0; + } + +- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d0 < d2) ++ if (this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d0 < d2) + { + d2 = 1.0D - d0; + i = 1; + } + +- if (this.func_175162_d(blockpos.func_177978_c()) && d1 < d2) ++ if (this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d1 < d2) + { + d2 = d1; + i = 4; + } + +- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d1 < d2) ++ if (this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d1 < d2) + { + d2 = 1.0D - d1; + i = 5; +@@ -518,7 +532,8 @@ + + private boolean func_175162_d(BlockPos p_175162_1_) + { +- return !this.field_70170_p.func_180495_p(p_175162_1_).func_185915_l() && !this.field_70170_p.func_180495_p(p_175162_1_.func_177984_a()).func_185915_l(); ++ IBlockState iblockstate = field_70170_p.func_180495_p(p_175162_1_); ++ return !iblockstate.func_177230_c().isNormalCube(iblockstate, field_70170_p, p_175162_1_); + } + + public void func_70031_b(boolean p_70031_1_) diff --git a/patches_old_unknown/FontRenderer.java.patch b/patches_old_unknown/FontRenderer.java.patch new file mode 100644 index 000000000..5890c8524 --- /dev/null +++ b/patches_old_unknown/FontRenderer.java.patch @@ -0,0 +1,152 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/FontRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/gui/FontRenderer.java +@@ -57,7 +57,7 @@ + this.field_111273_g = p_i1035_2_; + this.field_78298_i = p_i1035_3_; + this.field_78293_l = p_i1035_4_; +- p_i1035_3_.func_110577_a(this.field_111273_g); ++ bindTexture(this.field_111273_g); + + for (int i = 0; i < 32; ++i) + { +@@ -107,7 +107,7 @@ + + try + { +- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g); ++ iresource = getResource(this.field_111273_g); + bufferedimage = TextureUtil.func_177053_a(iresource.func_110527_b()); + } + catch (IOException ioexception) +@@ -172,7 +172,7 @@ + + try + { +- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin")); ++ iresource = getResource(new ResourceLocation("font/glyph_sizes.bin")); + iresource.func_110527_b().read(this.field_78287_e); + } + catch (IOException ioexception) +@@ -187,6 +187,7 @@ + + private float func_181559_a(char p_181559_1_, boolean p_181559_2_) + { ++ if (p_181559_1_ == 160) return 4.0F; // forge: display nbsp as space. MC-2595 + if (p_181559_1_ == ' ') + { + return 4.0F; +@@ -203,7 +204,7 @@ + int i = p_78266_1_ % 16 * 8; + int j = p_78266_1_ / 16 * 8; + int k = p_78266_2_ ? 1 : 0; +- this.field_78298_i.func_110577_a(this.field_111273_g); ++ bindTexture(this.field_111273_g); + int l = this.field_78286_d[p_78266_1_]; + float f = (float)l - 0.01F; + GlStateManager.func_187447_r(5); +@@ -231,7 +232,7 @@ + + private void func_78257_a(int p_78257_1_) + { +- this.field_78298_i.func_110577_a(this.func_111271_a(p_78257_1_)); ++ bindTexture(this.func_111271_a(p_78257_1_)); + } + + protected float func_78277_a(char p_78277_1_, boolean p_78277_2_) +@@ -280,7 +281,7 @@ + + public int func_175065_a(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_) + { +- GlStateManager.func_179141_d(); ++ enableAlpha(); + this.func_78265_b(); + int i; + +@@ -350,7 +351,7 @@ + + int j1 = this.field_78285_g[i1]; + this.field_78304_r = j1; +- GlStateManager.func_179131_c((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q); ++ setColor((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q); + } + else if (i1 == 16) + { +@@ -379,7 +380,7 @@ + this.field_78299_w = false; + this.field_78300_v = false; + this.field_78301_u = false; +- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); ++ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); + } + + ++i; +@@ -407,7 +408,7 @@ + c0 = c1; + } + +- float f1 = this.field_78293_l ? 0.5F : 1.0F; ++ float f1 = j == -1 || this.field_78293_l ? 0.5f : 1f; + boolean flag = (c0 == 0 || j == -1 || this.field_78293_l) && p_78255_2_; + + if (flag) +@@ -445,7 +446,16 @@ + + ++f; + } ++ doDraw(f); ++ } ++ } ++ } + ++ protected void doDraw(float f) ++ { ++ { ++ { ++ + if (this.field_78299_w) + { + Tessellator tessellator = Tessellator.func_178181_a(); +@@ -518,7 +528,7 @@ + this.field_78292_o = (float)(p_180455_4_ >> 8 & 255) / 255.0F; + this.field_78306_p = (float)(p_180455_4_ & 255) / 255.0F; + this.field_78305_q = (float)(p_180455_4_ >> 24 & 255) / 255.0F; +- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); ++ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); + this.field_78295_j = p_180455_2_; + this.field_78296_k = p_180455_3_; + this.func_78255_a(p_180455_1_, p_180455_5_); +@@ -576,6 +586,7 @@ + + public int func_78263_a(char p_78263_1_) + { ++ if (p_78263_1_ == 160) return 4; // forge: display nbsp as space. MC-2595 + if (p_78263_1_ == 167) + { + return -1; +@@ -849,6 +860,26 @@ + return this.field_78294_m; + } + ++ protected void setColor(float r, float g, float b, float a) ++ { ++ GlStateManager.func_179131_c(r,g,b,a); ++ } ++ ++ protected void enableAlpha() ++ { ++ GlStateManager.func_179141_d(); ++ } ++ ++ protected void bindTexture(ResourceLocation location) ++ { ++ field_78298_i.func_110577_a(location); ++ } ++ ++ protected IResource getResource(ResourceLocation location) throws IOException ++ { ++ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location); ++ } ++ + public int func_175064_b(char p_175064_1_) + { + int i = "0123456789abcdef".indexOf(p_175064_1_); diff --git a/patches_old_unknown/GuiIngameMenu.java.patch b/patches_old_unknown/GuiIngameMenu.java.patch new file mode 100644 index 000000000..acf44ad8e --- /dev/null +++ b/patches_old_unknown/GuiIngameMenu.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngameMenu.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java +@@ -30,7 +30,8 @@ + + this.field_146292_n.add(new GuiButton(4, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 24 + -16, I18n.func_135052_a("menu.returnToGame"))); + this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 96 + -16, 98, 20, I18n.func_135052_a("menu.options"))); +- GuiButton guibutton = this.func_189646_b(new GuiButton(7, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + -16, 98, 20, I18n.func_135052_a("menu.shareToLan"))); ++ this.field_146292_n.add(new GuiButton(12, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + i, 98, 20, I18n.func_135052_a("fml.menu.modoptions"))); ++ GuiButton guibutton = this.func_189646_b(new GuiButton(7, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 72 + -16, 200, 20, I18n.func_135052_a("menu.shareToLan", new Object[0]))); + guibutton.field_146124_l = this.field_146297_k.func_71356_B() && !this.field_146297_k.func_71401_C().func_71344_c(); + this.field_146292_n.add(new GuiButton(5, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 48 + -16, 98, 20, I18n.func_135052_a("gui.advancements"))); + this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 48 + -16, 98, 20, I18n.func_135052_a("gui.stats"))); +@@ -73,13 +74,19 @@ + this.field_146297_k.func_71381_h(); + break; + case 5: ++ if (this.field_146297_k.field_71439_g != null) + this.field_146297_k.func_147108_a(new GuiScreenAdvancements(this.field_146297_k.field_71439_g.field_71174_a.func_191982_f())); + break; + case 6: ++ if (this.field_146297_k.field_71439_g != null) + this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m())); + break; + case 7: + this.field_146297_k.func_147108_a(new GuiShareToLan(this)); ++ break; ++ case 12: ++ net.minecraftforge.fml.client.FMLClientHandler.instance().showInGameModOptions(this); ++ break; + } + } + diff --git a/patches_old_unknown/GuiMultiplayer.java.patch b/patches_old_unknown/GuiMultiplayer.java.patch new file mode 100644 index 000000000..761db19b7 --- /dev/null +++ b/patches_old_unknown/GuiMultiplayer.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiMultiplayer.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiMultiplayer.java +@@ -41,6 +41,7 @@ + public GuiMultiplayer(GuiScreen p_i1040_1_) + { + this.field_146798_g = p_i1040_1_; ++ net.minecraftforge.fml.client.FMLClientHandler.instance().setupServerList(); + } + + public void func_73866_w_() +@@ -375,7 +376,7 @@ + + private void func_146791_a(ServerData p_146791_1_) + { +- this.field_146297_k.func_147108_a(new GuiConnecting(this, this.field_146297_k, p_146791_1_)); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServer(this, p_146791_1_); + } + + public void func_146790_a(int p_146790_1_) diff --git a/patches_old_unknown/GuiOverlayDebug.java.patch b/patches_old_unknown/GuiOverlayDebug.java.patch new file mode 100644 index 000000000..7d5cf304b --- /dev/null +++ b/patches_old_unknown/GuiOverlayDebug.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java +@@ -189,6 +189,9 @@ + long l = j - k; + List list = Lists.newArrayList(String.format("Java: %s %dbit", System.getProperty("java.version"), this.field_175242_a.func_147111_S() ? 64 : 32), String.format("Mem: % 2d%% %03d/%03dMB", l * 100L / i, func_175240_a(l), func_175240_a(i)), String.format("Allocated: % 2d%% %03dMB", j * 100L / i, func_175240_a(j)), "", String.format("CPU: %s", OpenGlHelper.func_183029_j()), "", String.format("Display: %dx%d (%s)", Display.getWidth(), Display.getHeight(), GlStateManager.func_187416_u(7936)), GlStateManager.func_187416_u(7937), GlStateManager.func_187416_u(7938)); + ++ list.add(""); ++ list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false)); ++ + if (this.field_175242_a.func_189648_am()) + { + return list; diff --git a/patches_old_unknown/GuiScreen.java.patch b/patches_old_unknown/GuiScreen.java.patch new file mode 100644 index 000000000..6fa5df83b --- /dev/null +++ b/patches_old_unknown/GuiScreen.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java +@@ -421,9 +434,15 @@ + + if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_)) + { ++ net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre event = new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.field_146292_n); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) ++ break; ++ guibutton = event.getButton(); + this.field_146290_a = guibutton; + guibutton.func_146113_a(this.field_146297_k.func_147118_V()); + this.func_146284_a(guibutton); ++ if (this.equals(this.field_146297_k.field_71462_r)) ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.getButton(), this.field_146292_n)); + } + } + } +@@ -473,7 +496,10 @@ + { + while (Mouse.next()) + { ++ this.mouseHandled = false; ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Pre(this))) continue; + this.func_146274_d(); ++ if (this.equals(this.field_146297_k.field_71462_r) && !this.mouseHandled) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Post(this)); + } + } + +@@ -481,7 +507,10 @@ + { + while (Keyboard.next()) + { ++ this.keyHandled = false; ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Pre(this))) continue; + this.func_146282_l(); ++ if (this.equals(this.field_146297_k.field_71462_r) && !this.keyHandled) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Post(this)); + } + } + } diff --git a/patches_old_unknown/LoadingScreenRenderer.java.patch b/patches_old_unknown/LoadingScreenRenderer.java.patch new file mode 100644 index 000000000..25b99e723 --- /dev/null +++ b/patches_old_unknown/LoadingScreenRenderer.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/client/LoadingScreenRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/LoadingScreenRenderer.java +@@ -139,6 +139,10 @@ + GlStateManager.func_179086_m(16640); + } + ++ try ++ { ++ if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering ++ { + Tessellator tessellator = Tessellator.func_178181_a(); + BufferBuilder bufferbuilder = tessellator.func_178180_c(); + this.field_73725_b.func_110434_K().func_110577_a(Gui.field_110325_k); +@@ -174,6 +178,12 @@ + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + this.field_73725_b.field_71466_p.func_175063_a(this.field_73726_c, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73726_c)) / 2), (float)(l / 2 - 4 - 16), 16777215); + this.field_73725_b.field_71466_p.func_175063_a(this.field_73727_a, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73727_a)) / 2), (float)(l / 2 - 4 + 8), 16777215); ++ } ++ } ++ catch (java.io.IOException e) ++ { ++ throw new RuntimeException(e); ++ } //FML End + this.field_146588_g.func_147609_e(); + + if (OpenGlHelper.func_148822_b()) diff --git a/patches_old_unknown/ServerListEntryNormal.java.patch b/patches_old_unknown/ServerListEntryNormal.java.patch new file mode 100644 index 000000000..50e3e6114 --- /dev/null +++ b/patches_old_unknown/ServerListEntryNormal.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java ++++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java +@@ -83,7 +83,7 @@ + boolean flag1 = this.field_148301_e.field_82821_f < 340; + boolean flag2 = flag || flag1; + this.field_148300_d.field_71466_p.func_78276_b(this.field_148301_e.field_78847_a, p_192634_2_ + 32 + 3, p_192634_3_ + 1, 16777215); +- List list = this.field_148300_d.field_71466_p.func_78271_c(this.field_148301_e.field_78843_d, p_192634_4_ - 32 - 2); ++ List list = this.field_148300_d.field_71466_p.func_78271_c(net.minecraftforge.fml.client.FMLClientHandler.instance().fixDescription(this.field_148301_e.field_78843_d), p_192634_4_ - 32 - 2); + + for (int i = 0; i < Math.min(list.size(), 2); ++i) + { +@@ -177,6 +177,11 @@ + int i1 = p_192634_6_ - p_192634_2_; + int j1 = p_192634_7_ - p_192634_3_; + ++ String tooltip = net.minecraftforge.fml.client.FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, p_192634_2_, p_192634_4_, p_192634_3_, i1, j1); ++ if (tooltip != null) ++ { ++ this.field_148303_c.func_146793_a(tooltip); ++ } else + if (i1 >= p_192634_4_ - 15 && i1 <= p_192634_4_ - 5 && j1 >= 0 && j1 <= 8) + { + this.field_148303_c.func_146793_a(s1);