From 330db1a54dd4e77071a97fbe9c4e444aebb23e0e Mon Sep 17 00:00:00 2001 From: cpw Date: Mon, 27 Aug 2018 14:11:24 -0400 Subject: [PATCH] Patches deleted --- .gitignore | 2 + build.gradle | 6 + .../AdvancementManager.java.patch | 10 - .../AdvancementRewards.java.patch | 11 - .../advancements/DisplayInfo.java.patch | 13 - .../PlayerAdvancements.java.patch | 21 - .../critereon/ItemPredicate.java.patch | 16 - .../net/minecraft/block/Block.java.patch | 1626 ----------------- .../minecraft/block/BlockBanner.java.patch | 43 - .../net/minecraft/block/BlockBush.java.patch | 70 - .../minecraft/block/BlockButton.java.patch | 11 - .../minecraft/block/BlockCactus.java.patch | 67 - .../net/minecraft/block/BlockChest.java.patch | 31 - .../block/BlockChorusFlower.java.patch | 19 - .../net/minecraft/block/BlockCocoa.java.patch | 44 - .../net/minecraft/block/BlockCrops.java.patch | 81 - .../minecraft/block/BlockDeadBush.java.patch | 23 - .../net/minecraft/block/BlockDoor.java.patch | 28 - .../block/BlockDoublePlant.java.patch | 81 - .../minecraft/block/BlockDragonEgg.java.patch | 29 - .../minecraft/block/BlockDropper.java.patch | 11 - .../block/BlockDynamicLiquid.java.patch | 60 - .../block/BlockEnchantmentTable.java.patch | 11 - .../block/BlockEnderChest.java.patch | 11 - .../minecraft/block/BlockFalling.java.patch | 32 - .../minecraft/block/BlockFarmland.java.patch | 20 - .../net/minecraft/block/BlockFence.java.patch | 38 - .../minecraft/block/BlockFenceGate.java.patch | 35 - .../net/minecraft/block/BlockFire.java.patch | 218 --- .../minecraft/block/BlockFlowerPot.java.patch | 64 - .../net/minecraft/block/BlockGrass.java.patch | 42 - .../block/BlockHugeMushroom.java.patch | 23 - .../net/minecraft/block/BlockIce.java.patch | 29 - .../minecraft/block/BlockLadder.java.patch | 11 - .../minecraft/block/BlockLeaves.java.patch | 139 -- .../minecraft/block/BlockLiquid.java.patch | 49 - .../net/minecraft/block/BlockLog.java.patch | 24 - .../block/BlockMobSpawner.java.patch | 19 - .../minecraft/block/BlockMushroom.java.patch | 11 - .../minecraft/block/BlockMycelium.java.patch | 21 - .../block/BlockNetherWart.java.patch | 60 - .../minecraft/block/BlockNewLeaf.java.patch | 13 - .../net/minecraft/block/BlockNote.java.patch | 23 - .../minecraft/block/BlockObserver.java.patch | 15 - .../minecraft/block/BlockOldLeaf.java.patch | 20 - .../net/minecraft/block/BlockOre.java.patch | 50 - .../net/minecraft/block/BlockPane.java.patch | 39 - .../block/BlockPistonBase.java.patch | 45 - .../block/BlockPistonMoving.java.patch | 37 - .../minecraft/block/BlockPotato.java.patch | 24 - .../minecraft/block/BlockPumpkin.java.patch | 11 - .../minecraft/block/BlockQuartz.java.patch | 29 - .../minecraft/block/BlockRailBase.java.patch | 230 --- .../block/BlockRailDetector.java.patch | 11 - .../block/BlockRailPowered.java.patch | 29 - .../block/BlockRedstoneComparator.java.patch | 24 - .../block/BlockRedstoneDiode.java.patch | 54 - .../block/BlockRedstoneOre.java.patch | 22 - .../block/BlockRedstoneTorch.java.patch | 11 - .../block/BlockRedstoneWire.java.patch | 68 - .../net/minecraft/block/BlockReed.java.patch | 58 - .../block/BlockRotatedPillar.java.patch | 24 - .../minecraft/block/BlockSapling.java.patch | 18 - .../net/minecraft/block/BlockSkull.java.patch | 54 - .../net/minecraft/block/BlockSlab.java.patch | 39 - .../net/minecraft/block/BlockSnow.java.patch | 55 - .../minecraft/block/BlockStairs.java.patch | 32 - .../block/BlockStaticLiquid.java.patch | 39 - .../net/minecraft/block/BlockStem.java.patch | 71 - .../minecraft/block/BlockTallGrass.java.patch | 49 - .../net/minecraft/block/BlockTorch.java.patch | 23 - .../minecraft/block/BlockTrapDoor.java.patch | 21 - .../net/minecraft/block/BlockVine.java.patch | 47 - .../net/minecraft/block/BlockWall.java.patch | 41 - .../net/minecraft/block/BlockWeb.java.patch | 24 - .../net/minecraft/block/SoundType.java.patch | 18 - .../BlockPistonStructureHelper.java.patch | 54 - .../block/state/BlockStateBase.java.patch | 13 - .../state/BlockStateContainer.java.patch | 146 -- .../block/state/IBlockProperties.java.patch | 31 - .../client/ClientBrandRetriever.java.patch | 10 - .../client/LoadingScreenRenderer.java.patch | 26 - .../net/minecraft/client/Minecraft.java.patch | 606 ------ .../client/audio/SoundHandler.java.patch | 52 - .../client/audio/SoundManager.java.patch | 61 - .../entity/AbstractClientPlayer.java.patch | 10 - .../entity/EntityOtherPlayerMP.java.patch | 10 - .../client/entity/EntityPlayerSP.java.patch | 131 -- .../client/gui/FontRenderer.java.patch | 152 -- .../client/gui/GuiBossOverlay.java.patch | 22 - .../minecraft/client/gui/GuiButton.java.patch | 22 - .../client/gui/GuiControls.java.patch | 50 - .../client/gui/GuiCreateWorld.java.patch | 36 - .../client/gui/GuiEnchantment.java.patch | 26 - .../minecraft/client/gui/GuiIngame.java.patch | 35 - .../client/gui/GuiIngameMenu.java.patch | 32 - .../client/gui/GuiKeyBindingList.java.patch | 67 - .../gui/GuiListWorldSelectionEntry.java.patch | 11 - .../client/gui/GuiMainMenu.java.patch | 76 - .../client/gui/GuiMultiplayer.java.patch | 19 - .../client/gui/GuiOverlayDebug.java.patch | 12 - .../minecraft/client/gui/GuiScreen.java.patch | 110 -- .../client/gui/GuiScreenBook.java.patch | 10 - .../client/gui/GuiScreenDemo.java.patch | 16 - .../client/gui/GuiSleepMP.java.patch | 11 - .../minecraft/client/gui/GuiSlot.java.patch | 39 - .../client/gui/GuiSpectator.java.patch | 11 - .../gui/GuiUtilRenderComponents.java.patch | 11 - .../client/gui/GuiVideoSettings.java.patch | 15 - .../client/gui/MapItemRenderer.java.patch | 11 - .../gui/ServerListEntryNormal.java.patch | 23 - .../advancements/GuiAdvancementTab.java.patch | 40 - .../GuiScreenAdvancements.java.patch | 88 - .../gui/inventory/GuiContainer.java.patch | 156 -- .../inventory/GuiContainerCreative.java.patch | 308 ---- .../gui/recipebook/GuiRecipeBook.java.patch | 20 - .../recipebook/GuiRecipeOverlay.java.patch | 18 - .../client/gui/toasts/RecipeToast.java.patch | 11 - .../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/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 - .../renderer/block/model/Variant.java.patch | 39 - .../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 - .../client/resources/Language.java.patch | 24 - .../client/resources/Locale.java.patch | 11 - ...SimpleReloadableResourceManager.java.patch | 44 - .../client/settings/GameSettings.java.patch | 104 -- .../client/settings/KeyBinding.java.patch | 216 --- .../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 - .../minecraft/crash/CrashReport.java.patch | 18 - .../crash/CrashReportCategory.java.patch | 25 - .../creativetab/CreativeTabs.java.patch | 92 - .../enchantment/Enchantment.java.patch | 50 - .../EnchantmentFrostWalker.java.patch | 11 - .../enchantment/EnchantmentHelper.java.patch | 57 - .../enchantment/EnchantmentThorns.java.patch | 43 - .../EnumEnchantmentType.java.patch | 17 - .../net/minecraft/entity/Entity.java.patch | 415 ----- .../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/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/EntityArmorStand.java.patch | 11 - .../entity/item/EntityBoat.java.patch | 32 - .../entity/item/EntityEnderPearl.java.patch | 41 - .../entity/item/EntityFallingBlock.java.patch | 19 - .../entity/item/EntityItem.java.patch | 139 -- .../entity/item/EntityItemFrame.java.patch | 18 - .../entity/item/EntityMinecart.java.patch | 494 ----- .../EntityMinecartCommandBlock.java.patch | 10 - .../item/EntityMinecartContainer.java.patch | 63 - .../item/EntityMinecartEmpty.java.patch | 11 - .../item/EntityMinecartFurnace.java.patch | 11 - .../item/EntityMinecartHopper.java.patch | 10 - .../item/EntityMinecartMobSpawner.java.patch | 12 - .../entity/item/EntityXPOrb.java.patch | 29 - .../entity/monster/EntityEnderman.java.patch | 50 - .../entity/monster/EntityIronGolem.java.patch | 11 - .../entity/monster/EntityMagmaCube.java.patch | 10 - .../entity/monster/EntityMob.java.patch | 18 - .../entity/monster/EntityShulker.java.patch | 16 - .../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/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/EntityLlamaSpit.java.patch | 11 - .../projectile/EntityShulkerBullet.java.patch | 11 - .../projectile/EntityThrowable.java.patch | 11 - .../projectile/EntityWitherSkull.java.patch | 20 - .../net/minecraft/init/Bootstrap.java.patch | 29 - .../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 - .../net/minecraft/inventory/Slot.java.patch | 86 - .../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/ItemStack.java.patch | 363 ---- .../net/minecraft/item/ItemSword.java.patch | 13 - .../net/minecraft/item/ItemTool.java.patch | 73 - .../item/crafting/CraftingManager.java.patch | 42 - .../item/crafting/FurnaceRecipes.java.patch | 20 - .../item/crafting/IRecipe.java.patch | 37 - .../item/crafting/Ingredient.java.patch | 112 -- .../crafting/RecipeBookCloning.java.patch | 22 - .../item/crafting/RecipeFireworks.java.patch | 67 - .../item/crafting/RecipeRepairItem.java.patch | 73 - .../crafting/RecipeTippedArrow.java.patch | 22 - .../item/crafting/RecipesArmorDyes.java.patch | 59 - .../item/crafting/RecipesBanners.java.patch | 96 - .../crafting/RecipesMapCloning.java.patch | 35 - .../item/crafting/ShapedRecipes.java.patch | 83 - .../item/crafting/ShapelessRecipes.java.patch | 103 -- .../item/crafting/ShieldRecipes.java.patch | 24 - .../crafting/ShulkerBoxRecipes.java.patch | 50 - .../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 - .../network/ServerStatusResponse.java.patch | 91 - .../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 - .../net/minecraft/potion/Potion.java.patch | 108 -- .../minecraft/potion/PotionEffect.java.patch | 138 -- .../minecraft/potion/PotionType.java.patch | 16 - .../minecraft/profiler/Profiler.java.patch | 19 - .../minecraft/realms/RealmsConnect.java.patch | 19 - .../server/MinecraftServer.java.patch | 304 --- .../dedicated/DedicatedServer.java.patch | 78 - .../dedicated/ServerHangWatchdog.java.patch | 11 - .../server/gui/MinecraftServerGui.java.patch | 24 - .../integrated/IntegratedServer.java.patch | 75 - .../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/MobSpawnerBaseLogic.java.patch | 23 - .../tileentity/TileEntity.java.patch | 282 --- .../tileentity/TileEntityBeacon.java.patch | 45 - .../TileEntityBrewingStand.java.patch | 88 - .../tileentity/TileEntityChest.java.patch | 48 - .../tileentity/TileEntityFurnace.java.patch | 97 - .../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/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/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 | 156 -- .../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/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/MapDecoration.java.patch | 20 - .../world/storage/SaveFormatOld.java.patch | 27 - .../world/storage/SaveHandler.java.patch | 70 - .../world/storage/WorldInfo.java.patch | 103 -- .../world/storage/WorldSavedData.java.patch | 26 - .../world/storage/loot/LootContext.java.patch | 19 - .../world/storage/loot/LootEntry.java.patch | 59 - .../storage/loot/LootEntryEmpty.java.patch | 22 - .../storage/loot/LootEntryItem.java.patch | 39 - .../storage/loot/LootEntryTable.java.patch | 24 - .../world/storage/loot/LootPool.java.patch | 121 -- .../world/storage/loot/LootTable.java.patch | 75 - .../storage/loot/LootTableManager.java.patch | 20 - .../LootConditionManager.java.patch | 18 - .../RandomChanceWithLooting.java.patch | 17 - .../functions/LootingEnchantBonus.java.patch | 11 - .../critereon/OredictItemPredicate.java | 51 + 491 files changed, 59 insertions(+), 29527 deletions(-) delete mode 100644 patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch delete mode 100644 patches/minecraft/net/minecraft/advancements/DisplayInfo.java.patch delete mode 100644 patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch delete mode 100644 patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/Block.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockBanner.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockBush.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockButton.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockCactus.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockChest.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockChorusFlower.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockCocoa.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockCrops.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockDoor.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockDragonEgg.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockDropper.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockDynamicLiquid.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockEnchantmentTable.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockEnderChest.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockFalling.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockFarmland.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockFence.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockFenceGate.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockFire.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockGrass.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockIce.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockLadder.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockLeaves.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockLiquid.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockLog.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockMushroom.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockMycelium.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockNote.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockObserver.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockOre.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockPane.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockPotato.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockQuartz.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRailBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockReed.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockSapling.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockSkull.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockSlab.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockSnow.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockStairs.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockStaticLiquid.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockStem.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockTorch.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockVine.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockWall.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/BlockWeb.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/SoundType.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/state/BlockStateContainer.java.patch delete mode 100644 patches/minecraft/net/minecraft/block/state/IBlockProperties.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/ClientBrandRetriever.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/Minecraft.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiBossOverlay.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiScreenBook.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiScreenDemo.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiSpectator.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/MapItemRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeBook.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeOverlay.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/gui/toasts/RecipeToast.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/model/ModelBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/model/ModelBox.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/network/ServerPinger.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/particle/Particle.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/particle/ParticleManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/RenderItem.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/resources/Language.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/resources/Locale.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/shader/ShaderManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch delete mode 100644 patches/minecraft/net/minecraft/command/CommandBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/command/CommandFill.java.patch delete mode 100644 patches/minecraft/net/minecraft/command/CommandHandler.java.patch delete mode 100644 patches/minecraft/net/minecraft/command/EntitySelector.java.patch delete mode 100644 patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch delete mode 100644 patches/minecraft/net/minecraft/crash/CrashReport.java.patch delete mode 100644 patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch delete mode 100644 patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch delete mode 100644 patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch delete mode 100644 patches/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch delete mode 100644 patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch delete mode 100644 patches/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch delete mode 100644 patches/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/Entity.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityAgeable.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityFlying.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityHanging.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityList.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityLiving.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityTracker.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityMinecartMobSpawner.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityMob.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch delete mode 100644 patches/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch delete mode 100644 patches/minecraft/net/minecraft/init/Bootstrap.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/Container.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/Slot.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch delete mode 100644 patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/Item.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemArmor.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemArrow.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemAxe.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemBed.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemBlock.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemBow.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemBucket.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemDoor.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemDye.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemHoe.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemMap.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemMinecart.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemSeeds.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemShears.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemSkull.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemSlab.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemSnow.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemStack.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemSword.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/ItemTool.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/RecipeBookCloning.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/RecipeTippedArrow.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/ShieldRecipes.java.patch delete mode 100644 patches/minecraft/net/minecraft/item/crafting/ShulkerBoxRecipes.java.patch delete mode 100644 patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch delete mode 100644 patches/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch delete mode 100644 patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch delete mode 100644 patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch delete mode 100644 patches/minecraft/net/minecraft/nbt/NBTTagString.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/NetworkManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/NetworkSystem.java.patch delete mode 100755 patches/minecraft/net/minecraft/network/PacketBuffer.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch delete mode 100644 patches/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch delete mode 100644 patches/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch delete mode 100644 patches/minecraft/net/minecraft/potion/Potion.java.patch delete mode 100644 patches/minecraft/net/minecraft/potion/PotionEffect.java.patch delete mode 100644 patches/minecraft/net/minecraft/potion/PotionType.java.patch delete mode 100644 patches/minecraft/net/minecraft/profiler/Profiler.java.patch delete mode 100644 patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/MinecraftServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/management/PlayerList.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch delete mode 100644 patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/stats/RecipeBook.java.patch delete mode 100644 patches/minecraft/net/minecraft/stats/RecipeBookServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/stats/StatList.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch delete mode 100644 patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/ActionResult.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/BlockRenderLayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/EnumFacing.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/MouseHelper.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/Session.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/SoundEvent.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/TabCompleter.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/math/RayTraceResult.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/math/Vec3d.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/text/ITextComponent.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/text/Style.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/text/TextComponentBase.java.patch delete mode 100644 patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch delete mode 100644 patches/minecraft/net/minecraft/village/Village.java.patch delete mode 100644 patches/minecraft/net/minecraft/village/VillageCollection.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/BossInfo.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/BossInfoServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/ChunkCache.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/DimensionType.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/Explosion.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/IBlockAccess.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/World.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/WorldProvider.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/WorldProviderEnd.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/WorldProviderSurface.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/WorldServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/WorldType.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/Biome.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeForest.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeHills.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomePlains.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/MapData.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/MapDecoration.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootContext.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootEntry.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootEntryEmpty.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootEntryTable.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootTable.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/conditions/LootConditionManager.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/conditions/RandomChanceWithLooting.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/loot/functions/LootingEnchantBonus.java.patch create mode 100644 src/main/java/net/minecraftforge/advancements/critereon/OredictItemPredicate.java diff --git a/.gitignore b/.gitignore index cc81d5d548..35c0642163 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,8 @@ changelog.txt /patches_old/ /patches_old_bak/ +/patches/minecraft.old/ +/projects.old/ *.py *.7z /logs/ diff --git a/build.gradle b/build.gradle index 36749dfb1f..d355854fee 100644 --- a/build.gradle +++ b/build.gradle @@ -98,12 +98,18 @@ project(':forge') { classpath sourceSets.main.runtimeClasspath main 'net.minecraftforge.fml.LaunchTesting' systemProperties target:'fmldevclient' + workingDir 'runclient' } task runserver(type: JavaExec) { + doFirst { + mkdir 'runserver' + } classpath sourceSets.main.runtimeClasspath main 'net.minecraftforge.fml.LaunchTesting' + args 'nogui' systemProperties target:'fmldevserver' + workingDir 'runserver' } } diff --git a/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch b/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch deleted file mode 100644 index 262c73dba2..0000000000 --- a/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/advancements/AdvancementManager.java -+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementManager.java -@@ -66,6 +66,7 @@ - field_192784_c.func_192087_a(); - Map map = this.func_192781_c(); - this.func_192777_a(map); -+ this.field_193768_e |= net.minecraftforge.common.ForgeHooks.loadAdvancements(map); - field_192784_c.func_192083_a(map); - - for (Advancement advancement : field_192784_c.func_192088_b()) diff --git a/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch b/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch deleted file mode 100644 index 782e7931e9..0000000000 --- a/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/advancements/AdvancementRewards.java -+++ ../src-work/minecraft/net/minecraft/advancements/AdvancementRewards.java -@@ -49,7 +49,7 @@ - public void func_192113_a(final EntityPlayerMP p_192113_1_) - { - p_192113_1_.func_71023_q(this.field_192115_b); -- LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186471_a(); -+ LootContext lootcontext = (new LootContext.Builder(p_192113_1_.func_71121_q())).func_186472_a(p_192113_1_).func_186470_a(p_192113_1_).func_186469_a(p_192113_1_.func_184817_da()).func_186471_a(); // Forge: add player & luck to LootContext - boolean flag = false; - - for (ResourceLocation resourcelocation : this.field_192116_c) diff --git a/patches/minecraft/net/minecraft/advancements/DisplayInfo.java.patch b/patches/minecraft/net/minecraft/advancements/DisplayInfo.java.patch deleted file mode 100644 index e04d102418..0000000000 --- a/patches/minecraft/net/minecraft/advancements/DisplayInfo.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/advancements/DisplayInfo.java -+++ ../src-work/minecraft/net/minecraft/advancements/DisplayInfo.java -@@ -132,7 +132,9 @@ - { - Item item = JsonUtils.func_188180_i(p_193221_0_, "item"); - int i = JsonUtils.func_151208_a(p_193221_0_, "data", 0); -- return new ItemStack(item, 1, i); -+ ItemStack ret = new ItemStack(item, 1, i); -+ ret.func_77982_d(net.minecraftforge.common.util.JsonUtils.readNBT(p_193221_0_, "nbt")); -+ return ret; - } - } - diff --git a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch b/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch deleted file mode 100644 index 9d422fdaa7..0000000000 --- a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/advancements/PlayerAdvancements.java -+++ ../src-work/minecraft/net/minecraft/advancements/PlayerAdvancements.java -@@ -196,6 +196,9 @@ - - public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) - { -+ // Forge: don't grant advancements for fake players -+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false; -+ - boolean flag = false; - AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_); - boolean flag1 = advancementprogress.func_192105_a(); -@@ -214,6 +217,8 @@ - { - this.field_192756_d.func_184103_al().func_148539_a(new TextComponentTranslation("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), new Object[] {this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()})); - } -+ -+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_); - } - } - diff --git a/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch b/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch deleted file mode 100644 index 4d2c9e92b3..0000000000 --- a/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java -+++ ../src-work/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java -@@ -104,6 +104,13 @@ - if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) - { - JsonObject jsonobject = JsonUtils.func_151210_l(p_192492_0_, "item"); -+ if (jsonobject.has("type")) -+ { -+ final ResourceLocation rl = new ResourceLocation(JsonUtils.func_151200_h(jsonobject, "type")); -+ final Map> map = net.minecraftforge.advancements.critereon.ItemPredicates.getPredicates(); -+ if (map.containsKey(rl)) return map.get(rl).apply(jsonobject); -+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl); -+ } - MinMaxBounds minmaxbounds = MinMaxBounds.func_192515_a(jsonobject.get("count")); - MinMaxBounds minmaxbounds1 = MinMaxBounds.func_192515_a(jsonobject.get("durability")); - Integer integer = jsonobject.has("data") ? JsonUtils.func_151203_m(jsonobject, "data") : null; diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch deleted file mode 100644 index 6e6969b782..0000000000 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ /dev/null @@ -1,1626 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/Block.java -+++ ../src-work/minecraft/net/minecraft/block/Block.java -@@ -52,11 +52,12 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public class Block -+public class Block extends net.minecraftforge.registries.IForgeRegistryEntry.Impl - { - private static final ResourceLocation field_176230_a = new ResourceLocation("air"); -- public static final RegistryNamespacedDefaultedByKey field_149771_c = new RegistryNamespacedDefaultedByKey(field_176230_a); -- public static final ObjectIntIdentityMap field_176229_d = new ObjectIntIdentityMap(); -+ public static final RegistryNamespacedDefaultedByKey field_149771_c = net.minecraftforge.registries.GameData.getWrapperDefaulted(Block.class); -+ @Deprecated //Modders: DO NOT use this! Use GameRegistry -+ public static final ObjectIntIdentityMap field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap(); - public static final AxisAlignedBB field_185505_j = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); - @Nullable - public static final AxisAlignedBB field_185506_k = null; -@@ -75,6 +76,7 @@ - public float field_149763_I; - protected final Material field_149764_J; - protected final MapColor field_181083_K; -+ @Deprecated // Forge: State/world/pos/entity sensitive version below - public float field_149765_K; - protected final BlockStateContainer field_176227_L; - private IBlockState field_176228_M; -@@ -319,7 +321,7 @@ - - public boolean func_176200_f(IBlockAccess p_176200_1_, BlockPos p_176200_2_) - { -- return false; -+ return p_176200_1_.func_180495_p(p_176200_2_).func_185904_a().func_76222_j(); - } - - public Block func_149711_c(float p_149711_1_) -@@ -357,9 +359,10 @@ - return this.field_149789_z; - } - -+ @Deprecated //Forge: New State sensitive version. - public boolean func_149716_u() - { -- return this.field_149758_A; -+ return hasTileEntity(func_176223_P()); - } - - @Deprecated -@@ -372,13 +375,13 @@ - @SideOnly(Side.CLIENT) - public int func_185484_c(IBlockState p_185484_1_, IBlockAccess p_185484_2_, BlockPos p_185484_3_) - { -- int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d()); -+ int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_)); - - if (i == 0 && p_185484_1_.func_177230_c() instanceof BlockSlab) - { - p_185484_3_ = p_185484_3_.func_177977_b(); - p_185484_1_ = p_185484_2_.func_180495_p(p_185484_3_); -- return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d()); -+ return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_)); - } - else - { -@@ -442,7 +445,7 @@ - } - } - -- return !p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)).func_185914_p(); -+ return !p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)).doesSideBlockRendering(p_176225_2_, p_176225_3_.func_177972_a(p_176225_4_), p_176225_4_.func_176734_d()); - } - - @Deprecated -@@ -534,6 +537,10 @@ - - public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) - { -+ if (hasTileEntity(p_180663_3_) && !(this instanceof BlockContainer)) -+ { -+ p_180663_1_.func_175713_t(p_180663_2_); -+ } - } - - public int func_149745_a(Random p_149745_1_) -@@ -549,16 +556,7 @@ - @Deprecated - public float func_180647_a(IBlockState p_180647_1_, EntityPlayer p_180647_2_, World p_180647_3_, BlockPos p_180647_4_) - { -- float f = p_180647_1_.func_185887_b(p_180647_3_, p_180647_4_); -- -- if (f < 0.0F) -- { -- return 0.0F; -- } -- else -- { -- return !p_180647_2_.func_184823_b(p_180647_1_) ? p_180647_2_.func_184813_a(p_180647_1_) / f / 100.0F : p_180647_2_.func_184813_a(p_180647_1_) / f / 30.0F; -- } -+ return net.minecraftforge.common.ForgeHooks.blockStrength(p_180647_1_, p_180647_2_, p_180647_3_, p_180647_4_); - } - - public final void func_176226_b(World p_176226_1_, BlockPos p_176226_2_, IBlockState p_176226_3_, int p_176226_4_) -@@ -568,20 +566,16 @@ - - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { -- if (!p_180653_1_.field_72995_K) -+ if (!p_180653_1_.field_72995_K && !p_180653_1_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe - { -- int i = this.func_149679_a(p_180653_5_, p_180653_1_.field_73012_v); -+ List drops = getDrops(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_5_); // use the old method until it gets removed, for backward compatibility -+ p_180653_4_ = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(drops, p_180653_1_, p_180653_2_, p_180653_3_, p_180653_5_, p_180653_4_, false, harvesters.get()); - -- for (int j = 0; j < i; ++j) -+ for (ItemStack drop : drops) - { - if (p_180653_1_.field_73012_v.nextFloat() <= p_180653_4_) - { -- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_); -- -- if (item != Items.field_190931_a) -- { -- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_))); -- } -+ func_180635_a(p_180653_1_, p_180653_2_, drop); - } - } - } -@@ -589,8 +583,13 @@ - - public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) - { -- if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops")) -+ if (!p_180635_0_.field_72995_K && !p_180635_2_.func_190926_b() && p_180635_0_.func_82736_K().func_82766_b("doTileDrops")&& !p_180635_0_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe - { -+ if (captureDrops.get()) -+ { -+ capturedDrops.get().add(p_180635_2_); -+ return; -+ } - float f = 0.5F; - double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; - double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D; -@@ -619,6 +618,7 @@ - return 0; - } - -+ @Deprecated //Forge: State sensitive version - public float func_149638_a(Entity p_149638_1_) - { - return this.field_149781_w / 5.0F; -@@ -657,7 +657,7 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j(); -+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_); - } - - public boolean func_180639_a(World p_180639_1_, BlockPos p_180639_2_, IBlockState p_180639_3_, EntityPlayer p_180639_4_, EnumHand p_180639_5_, EnumFacing p_180639_6_, float p_180639_7_, float p_180639_8_, float p_180639_9_) -@@ -669,6 +669,8 @@ - { - } - -+ // Forge: use getStateForPlacement -+ @Deprecated - 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_) - { - return this.func_176203_a(p_180642_7_); -@@ -710,21 +712,35 @@ - p_180657_2_.func_71029_a(StatList.func_188055_a(this)); - p_180657_2_.func_71020_j(0.005F); - -- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) -+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) - { -+ java.util.List items = new java.util.ArrayList(); - ItemStack itemstack = this.func_180643_i(p_180657_4_); -- func_180635_a(p_180657_1_, p_180657_3_, itemstack); -+ -+ if (!itemstack.func_190926_b()) -+ { -+ items.add(itemstack); -+ } -+ -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_); -+ for (ItemStack item : items) -+ { -+ func_180635_a(p_180657_1_, p_180657_3_, item); -+ } - } - else - { -+ harvesters.set(p_180657_2_); - int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_); - this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i); -+ harvesters.set(null); - } - } - -+ @Deprecated //Forge: State sensitive version - protected boolean func_149700_E() - { -- return this.func_176223_P().func_185917_h() && !this.field_149758_A; -+ return this.func_176223_P().func_185917_h() && !this.hasTileEntity(silk_check_state.get()); - } - - protected ItemStack func_180643_i(IBlockState p_180643_1_) -@@ -810,6 +826,7 @@ - p_176216_2_.field_70181_x = 0.0D; - } - -+ @Deprecated // Forge: Use more sensitive version below: getPickBlock - public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) - { - return new ItemStack(Item.func_150898_a(this), 1, this.func_180651_a(p_185473_3_)); -@@ -919,6 +936,7 @@ - } - } - -+ @Deprecated // Forge - World/state/pos/entity sensitive version below - public SoundType func_185467_w() - { - return this.field_149762_H; -@@ -934,6 +952,1361 @@ - { - } - -+ /* ======================================== FORGE START =====================================*/ -+ //For ForgeInternal use Only! -+ protected ThreadLocal harvesters = new ThreadLocal(); -+ private ThreadLocal silk_check_state = new ThreadLocal(); -+ protected static java.util.Random RANDOM = new java.util.Random(); // Useful for random things without a seed. -+ -+ /** -+ * Gets the slipperiness at the given location at the given state. Normally -+ * between 0 and 1. -+ *

-+ * Note that entities may reduce slipperiness by a certain factor of their own; -+ * for {@link net.minecraft.entity.EntityLivingBase}, this is {@code .91}. -+ * {@link net.minecraft.entity.item.EntityItem} uses {@code .98}, and -+ * {@link net.minecraft.entity.projectile.EntityFishHook} uses {@code .92}. -+ * -+ * @param state state of the block -+ * @param world the world -+ * @param pos the position in the world -+ * @param entity the entity in question -+ * @return the factor by which the entity's motion should be multiplied -+ */ -+ public float getSlipperiness(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable Entity entity) -+ { -+ return field_149765_K; -+ } -+ -+ /** -+ * Sets the base slipperiness level. Normally between 0 and 1. -+ *

-+ * Calling this method may have no effect on the function of this block, -+ * or may not have the expected result. This block is free to caclculate -+ * its slipperiness arbitrarily. This method is guaranteed to work on the -+ * base {@code Block} class. -+ * -+ * @param slipperiness the base slipperiness of this block -+ * @see #getSlipperiness(IBlockState, IBlockAccess, BlockPos, Entity) -+ */ -+ public void setDefaultSlipperiness(float slipperiness) -+ { -+ this.field_149765_K = slipperiness; -+ } -+ -+ /** -+ * Get a light value for this block, taking into account the given state and coordinates, normal ranges are between 0 and 15 -+ * -+ * @param state Block state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return The light value -+ */ -+ public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return state.func_185906_d(); -+ } -+ -+ /** -+ * Checks if a player or entity can use this block to 'climb' like a ladder. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param entity The entity trying to use the ladder, CAN be null. -+ * @return True if the block should act like a ladder -+ */ -+ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return false; } -+ -+ /** -+ * Return true if the block is a normal, solid cube. This -+ * determines indirect power state, entity ejection from blocks, and a few -+ * others. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return True if the block is a full cube -+ */ -+ public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return state.func_185915_l(); -+ } -+ -+ /** -+ * Check if the face of a block should block rendering. -+ * -+ * Faces which are fully opaque should return true, faces with transparency -+ * or faces which do not span the full size of the block should return false. -+ * -+ * @param state The current block state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param face The side to check -+ * @return True if the block is opaque on the specified side. -+ */ -+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ return state.func_185914_p(); -+ } -+ -+ /** -+ * Checks if the block is a solid face on the given side, used by placement logic. -+ * -+ * @param base_state The base state, getActualState should be called first -+ * @param world The current world -+ * @param pos Block position in world -+ * @param side The side to check -+ * @return True if the block is solid on the specified side. -+ */ -+ @Deprecated //Use IBlockState.getBlockFaceShape -+ public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) -+ { -+ if (base_state.func_185896_q() && side == EnumFacing.UP) // Short circuit to vanilla function if its true -+ return true; -+ -+ if (this instanceof BlockSlab) -+ { -+ IBlockState state = this.func_176221_a(base_state, world, pos); -+ return base_state.func_185913_b() -+ || (state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP && side == EnumFacing.UP ) -+ || (state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.BOTTOM && side == EnumFacing.DOWN); -+ } -+ else if (this instanceof BlockFarmland) -+ { -+ return (side != EnumFacing.DOWN && side != EnumFacing.UP); -+ } -+ else if (this instanceof BlockStairs) -+ { -+ IBlockState state = this.func_176221_a(base_state, world, pos); -+ boolean flipped = state.func_177229_b(BlockStairs.field_176308_b) == BlockStairs.EnumHalf.TOP; -+ BlockStairs.EnumShape shape = (BlockStairs.EnumShape)state.func_177229_b(BlockStairs.field_176310_M); -+ EnumFacing facing = (EnumFacing)state.func_177229_b(BlockStairs.field_176309_a); -+ if (side == EnumFacing.UP) return flipped; -+ if (side == EnumFacing.DOWN) return !flipped; -+ if (facing == side) return true; -+ if (flipped) -+ { -+ if (shape == BlockStairs.EnumShape.INNER_LEFT ) return side == facing.func_176735_f(); -+ if (shape == BlockStairs.EnumShape.INNER_RIGHT) return side == facing.func_176746_e(); -+ } -+ else -+ { -+ if (shape == BlockStairs.EnumShape.INNER_LEFT ) return side == facing.func_176746_e(); -+ if (shape == BlockStairs.EnumShape.INNER_RIGHT) return side == facing.func_176735_f(); -+ } -+ return false; -+ } -+ else if (this instanceof BlockSnow) -+ { -+ IBlockState state = this.func_176221_a(base_state, world, pos); -+ return ((Integer)state.func_177229_b(BlockSnow.field_176315_a)) >= 8; -+ } -+ else if (this instanceof BlockHopper && side == EnumFacing.UP) -+ { -+ return true; -+ } -+ else if (this instanceof BlockCompressedPowered) -+ { -+ return true; -+ } -+ return isNormalCube(base_state, world, pos); -+ } -+ -+ /** -+ * Determines if this block should set fire and deal fire damage -+ * to entities coming into contact with it. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @return True if the block should deal damage -+ */ -+ public boolean isBurning(IBlockAccess world, BlockPos pos) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines this block should be treated as an air block -+ * by the rest of the code. This method is primarily -+ * useful for creating pure logic-blocks that will be invisible -+ * to the player and otherwise interact as air would. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return True if the block considered air -+ */ -+ public boolean isAir(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return state.func_185904_a() == Material.field_151579_a; -+ } -+ -+ /** -+ * Determines if the player can harvest this block, obtaining it's drops when the block is destroyed. -+ * -+ * @param player The player damaging the block -+ * @param pos The block's current position -+ * @return True to spawn the drops -+ */ -+ public boolean canHarvestBlock(IBlockAccess world, BlockPos pos, EntityPlayer player) -+ { -+ return net.minecraftforge.common.ForgeHooks.canHarvestBlock(this, player, world, pos); -+ } -+ -+ /** -+ * Called when a player removes a block. This is responsible for -+ * actually destroying the block, and the block is intact at time of call. -+ * This is called regardless of whether the player can harvest the block or -+ * not. -+ * -+ * Return true if the block is actually destroyed. -+ * -+ * Note: When used in multiplayer, this is called on both client and -+ * server sides! -+ * -+ * @param state The current state. -+ * @param world The current world -+ * @param player The player damaging the block, may be null -+ * @param pos Block position in world -+ * @param willHarvest True if Block.harvestBlock will be called after this, if the return in true. -+ * Can be useful to delay the destruction of tile entities till after harvestBlock -+ * @return True if the block is actually destroyed. -+ */ -+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) -+ { -+ this.func_176208_a(world, pos, state, player); -+ return world.func_180501_a(pos, net.minecraft.init.Blocks.field_150350_a.func_176223_P(), world.field_72995_K ? 11 : 3); -+ } -+ -+ /** -+ * Chance that fire will spread and consume this block. -+ * 300 being a 100% chance, 0, being a 0% chance. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param face The face that the fire is coming from -+ * @return A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire -+ */ -+ public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ return net.minecraft.init.Blocks.field_150480_ab.func_176532_c(this); -+ } -+ -+ /** -+ * Called when fire is updating, checks if a block face can catch fire. -+ * -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param face The face that the fire is coming from -+ * @return True if the face can be on fire, false otherwise. -+ */ -+ public boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ return getFlammability(world, pos, face) > 0; -+ } -+ -+ /** -+ * Called when fire is updating on a neighbor block. -+ * The higher the number returned, the faster fire will spread around this block. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param face The face that the fire is coming from -+ * @return A number that is used to determine the speed of fire growth around the block -+ */ -+ public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ return net.minecraft.init.Blocks.field_150480_ab.func_176534_d(this); -+ } -+ -+ /** -+ * Currently only called by fire when it is on top of this block. -+ * Returning true will prevent the fire from naturally dying during updating. -+ * Also prevents firing from dying from rain. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param side The face that the fire is coming from -+ * @return True if this block sustains fire, meaning it will never go out. -+ */ -+ public boolean isFireSource(World world, BlockPos pos, EnumFacing side) -+ { -+ if (side != EnumFacing.UP) -+ return false; -+ if (this == Blocks.field_150424_aL || this == Blocks.field_189877_df) -+ return true; -+ if ((world.field_73011_w instanceof net.minecraft.world.WorldProviderEnd) && this == Blocks.field_150357_h) -+ return true; -+ return false; -+ } -+ -+ private boolean isTileProvider = this instanceof ITileEntityProvider; -+ /** -+ * Called throughout the code as a replacement for block instanceof BlockContainer -+ * Moving this to the Block base class allows for mods that wish to extend vanilla -+ * blocks, and also want to have a tile entity on that block, may. -+ * -+ * Return true from this function to specify this block has a tile entity. -+ * -+ * @param state State of the current block -+ * @return True if block has a tile entity, false otherwise -+ */ -+ public boolean hasTileEntity(IBlockState state) -+ { -+ return isTileProvider; -+ } -+ -+ /** -+ * Called throughout the code as a replacement for ITileEntityProvider.createNewTileEntity -+ * Return the same thing you would from that function. -+ * This will fall back to ITileEntityProvider.createNewTileEntity(World) if this block is a ITileEntityProvider -+ * -+ * @param state The state of the current block -+ * @return A instance of a class extending TileEntity -+ */ -+ @Nullable -+ public TileEntity createTileEntity(World world, IBlockState state) -+ { -+ if (isTileProvider) -+ { -+ return ((ITileEntityProvider)this).func_149915_a(world, func_176201_c(state)); -+ } -+ return null; -+ } -+ -+ /** -+ * State and fortune sensitive version, this replaces the old (int meta, Random rand) -+ * version in 1.1. -+ * -+ * @param state Current state -+ * @param fortune Current item fortune level -+ * @param random Random number generator -+ * @return The number of items to drop -+ */ -+ public int quantityDropped(IBlockState state, int fortune, Random random) -+ { -+ return func_149679_a(fortune, random); -+ } -+ -+ /** -+ * @deprecated use {@link #getDrops(NonNullList, IBlockAccess, BlockPos, IBlockState, int)} -+ */ -+ @Deprecated -+ public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ NonNullList ret = NonNullList.func_191196_a(); -+ getDrops(ret, world, pos, state, fortune); -+ return ret; -+ } -+ -+ /** -+ * This gets a complete list of items dropped from this block. -+ * -+ * @param drops add all items this block drops to this drops list -+ * @param world The current world -+ * @param pos Block position in world -+ * @param state Current state -+ * @param fortune Breakers fortune level -+ */ -+ public void getDrops(NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ Random rand = world instanceof World ? ((World)world).field_73012_v : RANDOM; -+ -+ int count = quantityDropped(state, fortune, rand); -+ for (int i = 0; i < count; i++) -+ { -+ Item item = this.func_180660_a(state, rand, fortune); -+ if (item != Items.field_190931_a) -+ { -+ drops.add(new ItemStack(item, 1, this.func_180651_a(state))); -+ } -+ } -+ } -+ -+ /** -+ * Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops. -+ * -+ * @param world The world -+ * @param pos Block position in world -+ * @param state current block state -+ * @param player The player doing the harvesting -+ * @return True if the block can be directly harvested using silk touch -+ */ -+ public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) -+ { -+ silk_check_state.set(state);; -+ boolean ret = this.func_149700_E(); -+ silk_check_state.set(null); -+ return ret; -+ } -+ -+ /** -+ * Determines if a specified mob type can spawn on this block, returning false will -+ * prevent any mob from spawning on the block. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param type The Mob Category Type -+ * @return True to allow a mob of the specified category to spawn, false to prevent it. -+ */ -+ public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type) -+ { -+ return isSideSolid(state, world, pos, EnumFacing.UP); -+ } -+ -+ /** -+ * Determines if this block is classified as a Bed, Allowing -+ * players to sleep in it, though the block has to specifically -+ * perform the sleeping functionality in it's activated event. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param player The player or camera entity, null in some cases. -+ * @return True to treat this as a bed -+ */ -+ public boolean isBed(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable Entity player) -+ { -+ return this == net.minecraft.init.Blocks.field_150324_C; -+ } -+ -+ /** -+ * Returns the position that the player is moved to upon -+ * waking up, or respawning at the bed. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param player The player or camera entity, null in some cases. -+ * @return The spawn position -+ */ -+ @Nullable -+ public BlockPos getBedSpawnPosition(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EntityPlayer player) -+ { -+ if (world instanceof World) -+ return BlockBed.func_176468_a((World)world, pos, 0); -+ return null; -+ } -+ -+ /** -+ * Called when a user either starts or stops sleeping in the bed. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param player The player or camera entity, null in some cases. -+ * @param occupied True if we are occupying the bed, or false if they are stopping use of the bed -+ */ -+ public void setBedOccupied(IBlockAccess world, BlockPos pos, EntityPlayer player, boolean occupied) -+ { -+ if (world instanceof World) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ state = state.func_177230_c().func_176221_a(state, world, pos); -+ state = state.func_177226_a(BlockBed.field_176471_b, occupied); -+ ((World)world).func_180501_a(pos, state, 4); -+ } -+ } -+ -+ /** -+ * Returns the direction of the block. Same values that -+ * are returned by BlockDirectional -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return Bed direction -+ */ -+ public EnumFacing getBedDirection(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return (EnumFacing)func_176221_a(state, world, pos).func_177229_b(BlockHorizontal.field_185512_D); -+ } -+ -+ /** -+ * Determines if the current block is the foot half of the bed. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @return True if the current block is the foot side of a bed. -+ */ -+ public boolean isBedFoot(IBlockAccess world, BlockPos pos) -+ { -+ return func_176221_a(world.func_180495_p(pos), world, pos).func_177229_b(BlockBed.field_176472_a) == BlockBed.EnumPartType.FOOT; -+ } -+ -+ /** -+ * Called when a leaf should start its decay process. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ */ -+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos){} -+ -+ /** -+ * Determines if this block can prevent leaves connected to it from decaying. -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return true if the presence this block can prevent leaves from decaying. -+ */ -+ public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if this block is considered a leaf block, used to apply the leaf decay and generation system. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return true if this block is considered leaves. -+ */ -+ public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return state.func_185904_a() == Material.field_151584_j; -+ } -+ -+ /** -+ * Used during tree growth to determine if newly generated leaves can replace this block. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return true if this block can be replaced by growing leaves. -+ */ -+ public boolean canBeReplacedByLeaves(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return isAir(state, world, pos) || isLeaves(state, world, pos); //!state.isFullBlock(); -+ } -+ -+ /** -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @return true if the block is wood (logs) -+ */ -+ public boolean isWood(IBlockAccess world, BlockPos pos) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if the current block is replaceable by Ore veins during world generation. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param target The generic target block the gen is looking for, Standards define stone -+ * for overworld generation, and neatherack for the nether. -+ * @return True to allow this block to be replaced by a ore -+ */ -+ public boolean isReplaceableOreGen(IBlockState state, IBlockAccess world, BlockPos pos, com.google.common.base.Predicate target) -+ { -+ return target.apply(state); -+ } -+ -+ /** -+ * Location sensitive version of getExplosionResistance -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param exploder The entity that caused the explosion, can be null -+ * @param explosion The explosion -+ * @return The amount of the explosion absorbed. -+ */ -+ public float getExplosionResistance(World world, BlockPos pos, @Nullable Entity exploder, Explosion explosion) -+ { -+ return func_149638_a(exploder); -+ } -+ -+ /** -+ * Called when the block is destroyed by an explosion. -+ * Useful for allowing the block to take into account tile entities, -+ * state, etc. when exploded, before it is removed. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param explosion The explosion instance affecting the block -+ */ -+ public void onBlockExploded(World world, BlockPos pos, Explosion explosion) -+ { -+ world.func_175698_g(pos); -+ func_180652_a(world, pos, explosion); -+ } -+ -+ /** -+ * Determine if this block can make a redstone connection on the side provided, -+ * Useful to control which sides are inputs and outputs for redstone wires. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param side The side that is trying to make the connection, CAN BE NULL -+ * @return True to make the connection -+ */ -+ public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) -+ { -+ return state.func_185897_m() && side != null; -+ } -+ -+ /** -+ * Determines if a torch can be placed on the top surface of this block. -+ * Useful for creating your own block that torches can be on, such as fences. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return True to allow the torch to be placed -+ */ -+ public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ if (state.func_185896_q() || state.func_193401_d(world, pos, EnumFacing.UP) == BlockFaceShape.SOLID) -+ { -+ return this != Blocks.field_185775_db && this != Blocks.field_150428_aP; -+ } -+ else -+ { -+ return this instanceof BlockFence || this == Blocks.field_150359_w || this == Blocks.field_150463_bK || this == Blocks.field_150399_cn; -+ } -+ } -+ -+ /** -+ * Called when a user uses the creative pick block button on this block -+ * -+ * @param target The full target the player is looking at -+ * @return A ItemStack to add to the player's inventory, empty itemstack if nothing should be added. -+ */ -+ public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) -+ { -+ return func_185473_a(world, pos, state); -+ } -+ -+ /** -+ * Used by getTopSolidOrLiquidBlock while placing biome decorations, villages, etc -+ * Also used to determine if the player can spawn on this block. -+ * -+ * @return False to disallow spawning -+ */ -+ public boolean isFoliage(IBlockAccess world, BlockPos pos) -+ { -+ return false; -+ } -+ -+ /** -+ * Allows a block to override the standard EntityLivingBase.updateFallState -+ * particles, this is a server side method that spawns particles with -+ * WorldServer.spawnParticle -+ * -+ * @param world The current Server world -+ * @param blockPosition of the block that the entity landed on. -+ * @param iblockstate State at the specific world/pos -+ * @param entity the entity that hit landed on the block. -+ * @param numberOfParticles that vanilla would have spawned. -+ * @return True to prevent vanilla landing particles form spawning. -+ */ -+ public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) -+ { -+ return false; -+ } -+ -+ /** -+ * Allows a block to override the standard vanilla running particles. -+ * This is called from {@link Entity#spawnRunningParticles} and is called both, -+ * Client and server side, it's up to the implementor to client check / server check. -+ * By default vanilla spawns particles only on the client and the server methods no-op. -+ * -+ * @param state The BlockState the entity is running on. -+ * @param world The world. -+ * @param pos The position at the entities feet. -+ * @param entity The entity running on the block. -+ * @return True to prevent vanilla running particles from spawning. -+ */ -+ public boolean addRunningEffects(IBlockState state, World world, BlockPos pos, Entity entity) -+ { -+ return false; -+ } -+ -+ /** -+ * Spawn a digging particle effect in the world, this is a wrapper -+ * around EffectRenderer.addBlockHitEffects to allow the block more -+ * control over the particles. Useful when you have entirely different -+ * texture sheets for different sides/locations in the world. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param target The target the player is looking at {x/y/z/side/sub} -+ * @param manager A reference to the current particle manager. -+ * @return True to prevent vanilla digging particles form spawning. -+ */ -+ @SideOnly(Side.CLIENT) -+ public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, net.minecraft.client.particle.ParticleManager manager) -+ { -+ return false; -+ } -+ -+ /** -+ * Spawn particles for when the block is destroyed. Due to the nature -+ * of how this is invoked, the x/y/z locations are not always guaranteed -+ * to host your block. So be sure to do proper sanity checks before assuming -+ * that the location is this block. -+ * -+ * @param world The current world -+ * @param pos Position to spawn the particle -+ * @param manager A reference to the current particle manager. -+ * @return True to prevent vanilla break particles from spawning. -+ */ -+ @SideOnly(Side.CLIENT) -+ public boolean addDestroyEffects(World world, BlockPos pos, net.minecraft.client.particle.ParticleManager manager) -+ { -+ return false; -+ } -+ -+ /** -+ * Determines if this block can support the passed in plant, allowing it to be planted and grow. -+ * Some examples: -+ * Reeds check if its a reed, or if its sand/dirt/grass and adjacent to water -+ * Cacti checks if its a cacti, or if its sand -+ * Nether types check for soul sand -+ * Crops check for tilled soil -+ * Caves check if it's a solid surface -+ * Plains check if its grass or dirt -+ * Water check if its still water -+ * -+ * @param state The Current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @param direction The direction relative to the given position the plant wants to be, typically its UP -+ * @param plantable The plant that wants to check -+ * @return True to allow the plant to be planted/stay. -+ */ -+ public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) -+ { -+ IBlockState plant = plantable.getPlant(world, pos.func_177972_a(direction)); -+ net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.func_177972_a(direction)); -+ -+ if (plant.func_177230_c() == net.minecraft.init.Blocks.field_150434_aF) -+ { -+ return this == net.minecraft.init.Blocks.field_150434_aF || this == net.minecraft.init.Blocks.field_150354_m; -+ } -+ -+ if (plant.func_177230_c() == net.minecraft.init.Blocks.field_150436_aH && this == net.minecraft.init.Blocks.field_150436_aH) -+ { -+ return true; -+ } -+ -+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_185514_i(state)) -+ { -+ return true; -+ } -+ -+ switch (plantType) -+ { -+ case Desert: return this == net.minecraft.init.Blocks.field_150354_m || this == net.minecraft.init.Blocks.field_150405_ch || this == net.minecraft.init.Blocks.field_150406_ce; -+ case Nether: return this == net.minecraft.init.Blocks.field_150425_aM; -+ case Crop: return this == net.minecraft.init.Blocks.field_150458_ak; -+ case Cave: return state.isSideSolid(world, pos, EnumFacing.UP); -+ case Plains: return this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150458_ak; -+ case Water: return state.func_185904_a() == Material.field_151586_h && state.func_177229_b(BlockLiquid.field_176367_b) == 0; -+ case Beach: -+ boolean isBeach = this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150354_m; -+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == Material.field_151586_h || -+ world.func_180495_p(pos.func_177976_e()).func_185904_a() == Material.field_151586_h || -+ world.func_180495_p(pos.func_177978_c()).func_185904_a() == Material.field_151586_h || -+ world.func_180495_p(pos.func_177968_d()).func_185904_a() == Material.field_151586_h); -+ return isBeach && hasWater; -+ } -+ -+ return false; -+ } -+ -+ /** -+ * Called when a plant grows on this block, only implemented for saplings using the WorldGen*Trees classes right now. -+ * Modder may implement this for custom plants. -+ * This does not use ForgeDirection, because large/huge trees can be located in non-representable direction, -+ * so the source location is specified. -+ * Currently this just changes the block to dirt if it was grass. -+ * -+ * Note: This happens DURING the generation, the generation may not be complete when this is called. -+ * -+ * @param state The current state -+ * @param world Current world -+ * @param pos Block position in world -+ * @param source Source plant's position in world -+ */ -+ public void onPlantGrow(IBlockState state, World world, BlockPos pos, BlockPos source) -+ { -+ if (this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150458_ak) -+ { -+ world.func_180501_a(pos, net.minecraft.init.Blocks.field_150346_d.func_176223_P(), 2); -+ } -+ } -+ -+ /** -+ * Checks if this soil is fertile, typically this means that growth rates -+ * of plants on this soil will be slightly sped up. -+ * Only vanilla case is tilledField when it is within range of water. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @return True if the soil should be considered fertile. -+ */ -+ public boolean isFertile(World world, BlockPos pos) -+ { -+ if (this == net.minecraft.init.Blocks.field_150458_ak) -+ { -+ return ((Integer)world.func_180495_p(pos).func_177229_b(BlockFarmland.field_176531_a)) > 0; -+ } -+ -+ return false; -+ } -+ -+ /** -+ * Location aware and overrideable version of the lightOpacity array, -+ * return the number to subtract from the light value when it passes through this block. -+ * -+ * This is not guaranteed to have the tile entity in place before this is called, so it is -+ * Recommended that you have your tile entity call relight after being placed if you -+ * rely on it for light info. -+ * -+ * @param state The Block state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return The amount of light to block, 0 for air, 255 for fully opaque. -+ */ -+ public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return state.func_185891_c(); -+ } -+ -+ /** -+ * Determines if this block is can be destroyed by the specified entities normal behavior. -+ * -+ * @param state The current state -+ * @param world The current world -+ * @param pos Block position in world -+ * @return True to allow the ender dragon to destroy this block -+ */ -+ public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) -+ { -+ if (entity instanceof net.minecraft.entity.boss.EntityDragon) -+ { -+ return this != net.minecraft.init.Blocks.field_180401_cv && -+ this != net.minecraft.init.Blocks.field_150343_Z && -+ this != net.minecraft.init.Blocks.field_150377_bs && -+ this != net.minecraft.init.Blocks.field_150357_h && -+ this != net.minecraft.init.Blocks.field_150384_bq && -+ this != net.minecraft.init.Blocks.field_150378_br && -+ this != net.minecraft.init.Blocks.field_150483_bI && -+ this != net.minecraft.init.Blocks.field_185776_dc && -+ this != net.minecraft.init.Blocks.field_185777_dd && -+ this != net.minecraft.init.Blocks.field_150411_aY && -+ this != net.minecraft.init.Blocks.field_185775_db; -+ } -+ else if ((entity instanceof net.minecraft.entity.boss.EntityWither) || -+ (entity instanceof net.minecraft.entity.projectile.EntityWitherSkull)) -+ { -+ return net.minecraft.entity.boss.EntityWither.func_181033_a(this); -+ } -+ -+ return true; -+ } -+ -+ /** -+ * Determines if this block can be used as the base of a beacon. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @param beacon Beacon position in world -+ * @return True, to support the beacon, and make it active with this block. -+ */ -+ public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon) -+ { -+ return this == net.minecraft.init.Blocks.field_150475_bE || this == net.minecraft.init.Blocks.field_150340_R || this == net.minecraft.init.Blocks.field_150484_ah || this == net.minecraft.init.Blocks.field_150339_S; -+ } -+ -+ /** -+ * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit). -+ * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the -+ * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations. -+ * The method should return true if the rotation was successful though. -+ * -+ * @param world The world -+ * @param pos Block position in world -+ * @param axis The axis to rotate around -+ * @return True if the rotation was successful, False if the rotation failed, or is not possible -+ */ -+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : state.func_177228_b().keySet()) -+ { -+ if ((prop.func_177701_a().equals("facing") || prop.func_177701_a().equals("rotation")) && prop.func_177699_b() == EnumFacing.class) -+ { -+ Block block = state.func_177230_c(); -+ if (!(block instanceof BlockBed) && !(block instanceof BlockPistonExtension)) -+ { -+ IBlockState newState; -+ //noinspection unchecked -+ IProperty facingProperty = (IProperty) prop; -+ EnumFacing facing = state.func_177229_b(facingProperty); -+ java.util.Collection validFacings = facingProperty.func_177700_c(); -+ -+ // rotate horizontal facings clockwise -+ if (validFacings.size() == 4 && !validFacings.contains(EnumFacing.UP) && !validFacings.contains(EnumFacing.DOWN)) -+ { -+ newState = state.func_177226_a(facingProperty, facing.func_176746_e()); -+ } -+ else -+ { -+ // rotate other facings about the axis -+ EnumFacing rotatedFacing = facing.func_176732_a(axis.func_176740_k()); -+ if (validFacings.contains(rotatedFacing)) -+ { -+ newState = state.func_177226_a(facingProperty, rotatedFacing); -+ } -+ else // abnormal facing property, just cycle it -+ { -+ newState = state.func_177231_a(facingProperty); -+ } -+ } -+ -+ world.func_175656_a(pos, newState); -+ return true; -+ } -+ } -+ } -+ return false; -+ } -+ -+ /** -+ * Get the rotations that can apply to the block at the specified coordinates. Null means no rotations are possible. -+ * Note, this is up to the block to decide. It may not be accurate or representative. -+ * @param world The world -+ * @param pos Block position in world -+ * @return An array of valid axes to rotate around, or null for none or unknown -+ */ -+ @Nullable -+ public EnumFacing[] getValidRotations(World world, BlockPos pos) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : state.func_177228_b().keySet()) -+ { -+ if ((prop.func_177701_a().equals("facing") || prop.func_177701_a().equals("rotation")) && prop.func_177699_b() == EnumFacing.class) -+ { -+ @SuppressWarnings("unchecked") -+ java.util.Collection values = ((java.util.Collection)prop.func_177700_c()); -+ return values.toArray(new EnumFacing[values.size()]); -+ } -+ } -+ return null; -+ } -+ -+ /** -+ * Determines the amount of enchanting power this block can provide to an enchanting table. -+ * @param world The World -+ * @param pos Block position in world -+ * @return The amount of enchanting power this block produces. -+ */ -+ public float getEnchantPowerBonus(World world, BlockPos pos) -+ { -+ return this == net.minecraft.init.Blocks.field_150342_X ? 1 : 0; -+ } -+ -+ /** -+ * Common way to recolor a block with an external tool -+ * @param world The world -+ * @param pos Block position in world -+ * @param side The side hit with the coloring tool -+ * @param color The color to change to -+ * @return If the recoloring was successful -+ */ -+ @SuppressWarnings({ "unchecked", "rawtypes" }) -+ public boolean recolorBlock(World world, BlockPos pos, EnumFacing side, net.minecraft.item.EnumDyeColor color) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : state.func_177228_b().keySet()) -+ { -+ if (prop.func_177701_a().equals("color") && prop.func_177699_b() == net.minecraft.item.EnumDyeColor.class) -+ { -+ net.minecraft.item.EnumDyeColor current = (net.minecraft.item.EnumDyeColor)state.func_177229_b(prop); -+ if (current != color && prop.func_177700_c().contains(color)) -+ { -+ world.func_175656_a(pos, state.func_177226_a(prop, color)); -+ return true; -+ } -+ } -+ } -+ return false; -+ } -+ -+ /** -+ * Gathers how much experience this block drops when broken. -+ * -+ * @param state The current state -+ * @param world The world -+ * @param pos Block position -+ * @param fortune -+ * @return Amount of XP from breaking this block. -+ */ -+ public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return 0; -+ } -+ -+ /** -+ * Called when a tile entity on a side of this block changes is created or is destroyed. -+ * @param world The world -+ * @param pos Block position in world -+ * @param neighbor Block position of neighbor -+ */ -+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor){} -+ -+ /** -+ * Called on an Observer block whenever an update for an Observer is received. -+ * -+ * @param observerState The Observer block's state. -+ * @param world The current world. -+ * @param observerPos The Observer block's position. -+ * @param changedBlock The updated block. -+ * @param changedBlockPos The updated block's position. -+ */ -+ public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos){} -+ -+ /** -+ * Called to determine whether to allow the a block to handle its own indirect power rather than using the default rules. -+ * @param world The world -+ * @param pos Block position in world -+ * @param side The INPUT side of the block to be powered - ie the opposite of this block's output side -+ * @return Whether Block#isProvidingWeakPower should be called when determining indirect power -+ */ -+ public boolean shouldCheckWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) -+ { -+ return state.func_185915_l(); -+ } -+ -+ /** -+ * If this block should be notified of weak changes. -+ * Weak changes are changes 1 block away through a solid block. -+ * Similar to comparators. -+ * -+ * @param world The current world -+ * @param pos Block position in world -+ * @return true To be notified of changes -+ */ -+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos) -+ { -+ return false; -+ } -+ -+ private String[] harvestTool = new String[16];; -+ private int[] harvestLevel = new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; -+ /** -+ * Sets or removes the tool and level required to harvest this block. -+ * -+ * @param toolClass Class -+ * @param level Harvest level: -+ * Wood: 0 -+ * Stone: 1 -+ * Iron: 2 -+ * Diamond: 3 -+ * Gold: 0 -+ */ -+ public void setHarvestLevel(String toolClass, int level) -+ { -+ java.util.Iterator itr = func_176194_O().func_177619_a().iterator(); -+ while (itr.hasNext()) -+ { -+ setHarvestLevel(toolClass, level, itr.next()); -+ } -+ } -+ -+ /** -+ * Sets or removes the tool and level required to harvest this block. -+ * -+ * @param toolClass Class -+ * @param level Harvest level: -+ * Wood: 0 -+ * Stone: 1 -+ * Iron: 2 -+ * Diamond: 3 -+ * Gold: 0 -+ * @param state The specific state. -+ */ -+ public void setHarvestLevel(String toolClass, int level, IBlockState state) -+ { -+ int idx = this.func_176201_c(state); -+ this.harvestTool[idx] = toolClass; -+ this.harvestLevel[idx] = level; -+ } -+ -+ /** -+ * Queries the class of tool required to harvest this block, if null is returned -+ * we assume that anything can harvest this block. -+ */ -+ @Nullable public String getHarvestTool(IBlockState state) -+ { -+ return harvestTool[func_176201_c(state)]; -+ } -+ -+ /** -+ * Queries the harvest level of this item stack for the specified tool class, -+ * Returns -1 if this tool is not of the specified type -+ * -+ * @return Harvest level, or -1 if not the specified tool type. -+ */ -+ public int getHarvestLevel(IBlockState state) -+ { -+ return harvestLevel[func_176201_c(state)]; -+ } -+ -+ /** -+ * Checks if the specified tool type is efficient on this block, -+ * meaning that it digs at full speed. -+ */ -+ public boolean isToolEffective(String type, IBlockState state) -+ { -+ if ("pickaxe".equals(type) && (this == net.minecraft.init.Blocks.field_150450_ax || this == net.minecraft.init.Blocks.field_150439_ay || this == net.minecraft.init.Blocks.field_150343_Z)) -+ return false; -+ return type != null && type.equals(getHarvestTool(state)); -+ } -+ -+ /** -+ * Can return IExtendedBlockState -+ */ -+ public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return state; -+ } -+ -+ /** -+ * Called when the entity is inside this block, may be used to determined if the entity can breathing, -+ * display material overlays, or if the entity can swim inside a block. -+ * -+ * @param world that is being tested. -+ * @param blockpos position thats being tested. -+ * @param iblockstate state at world/blockpos -+ * @param entity that is being tested. -+ * @param yToTest, primarily for testingHead, which sends the the eye level of the entity, other wise it sends a y that can be tested vs liquid height. -+ * @param materialIn to test for. -+ * @param testingHead when true, its testing the entities head for vision, breathing ect... otherwise its testing the body, for swimming and movement adjustment. -+ * @return null for default behavior, true if the entity is within the material, false if it was not. -+ */ -+ @Nullable -+ public Boolean isEntityInsideMaterial(IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) -+ { -+ return null; -+ } -+ -+ /** -+ * Called when boats or fishing hooks are inside the block to check if they are inside -+ * the material requested. -+ * -+ * @param world world that is being tested. -+ * @param pos block thats being tested. -+ * @param boundingBox box to test, generally the bounds of an entity that are besting tested. -+ * @param materialIn to check for. -+ * @return null for default behavior, true if the box is within the material, false if it was not. -+ */ -+ @Nullable -+ public Boolean isAABBInsideMaterial(World world, BlockPos pos, AxisAlignedBB boundingBox, Material materialIn) -+ { -+ return null; -+ } -+ -+ /** -+ * Called when entities are moving to check if they are inside a liquid -+ * -+ * @param world world that is being tested. -+ * @param pos block thats being tested. -+ * @param boundingBox box to test, generally the bounds of an entity that are besting tested. -+ * @return null for default behavior, true if the box is within the material, false if it was not. -+ */ -+ @Nullable -+ public Boolean isAABBInsideLiquid(World world, BlockPos pos, AxisAlignedBB boundingBox) -+ { -+ return null; -+ } -+ -+ /** -+ * Queries if this block should render in a given layer. -+ * ISmartBlockModel can use {@link net.minecraftforge.client.MinecraftForgeClient#getRenderLayer()} to alter their model based on layer. -+ */ -+ public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) -+ { -+ return func_180664_k() == layer; -+ } -+ // For Internal use only to capture droped items inside getDrops -+ protected static ThreadLocal captureDrops = ThreadLocal.withInitial(() -> false); -+ protected static ThreadLocal> capturedDrops = ThreadLocal.withInitial(NonNullList::func_191196_a); -+ protected NonNullList captureDrops(boolean start) -+ { -+ if (start) -+ { -+ captureDrops.set(true); -+ capturedDrops.get().clear(); -+ return NonNullList.func_191196_a(); -+ } -+ else -+ { -+ captureDrops.set(false); -+ return capturedDrops.get(); -+ } -+ } -+ -+ /** -+ * Sensitive version of getSoundType -+ * @param state The state -+ * @param world The world -+ * @param pos The position. Note that the world may not necessarily have {@code state} here! -+ * @param entity The entity that is breaking/stepping on/placing/hitting/falling on this block, or null if no entity is in this context -+ * @return A SoundType to use -+ */ -+ public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity) -+ { -+ return func_185467_w(); -+ } -+ -+ /** -+ * @param state The state -+ * @param world The world -+ * @param pos The position of this state -+ * @param beaconPos The position of the beacon -+ * @return A float RGB [0.0, 1.0] array to be averaged with a beacon's existing beam color, or null to do nothing to the beam -+ */ -+ @Nullable -+ public float[] getBeaconColorMultiplier(IBlockState state, World world, BlockPos pos, BlockPos beaconPos) -+ { -+ return null; -+ } -+ -+ /** -+ * Use this to change the fog color used when the entity is "inside" a material. -+ * Vec3d is used here as "r/g/b" 0 - 1 values. -+ * -+ * @param world The world. -+ * @param pos The position at the entity viewport. -+ * @param state The state at the entity viewport. -+ * @param entity the entity -+ * @param originalColor The current fog color, You are not expected to use this, Return as the default if applicable. -+ * @return The new fog color. -+ */ -+ @SideOnly (Side.CLIENT) -+ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks) -+ { -+ if (state.func_185904_a() == Material.field_151586_h) -+ { -+ float f12 = 0.0F; -+ -+ if (entity instanceof net.minecraft.entity.EntityLivingBase) -+ { -+ net.minecraft.entity.EntityLivingBase ent = (net.minecraft.entity.EntityLivingBase)entity; -+ f12 = (float)net.minecraft.enchantment.EnchantmentHelper.func_185292_c(ent) * 0.2F; -+ -+ if (ent.func_70644_a(net.minecraft.init.MobEffects.field_76427_o)) -+ { -+ f12 = f12 * 0.3F + 0.6F; -+ } -+ } -+ return new Vec3d(0.02F + f12, 0.02F + f12, 0.2F + f12); -+ } -+ else if (state.func_185904_a() == Material.field_151587_i) -+ { -+ return new Vec3d(0.6F, 0.1F, 0.0F); -+ } -+ return originalColor; -+ } -+ -+ /** -+ * Used to determine the state 'viewed' by an entity (see -+ * {@link net.minecraft.client.renderer.ActiveRenderInfo#getBlockStateAtEntityViewpoint(World, Entity, float)}). -+ * Can be used by fluid blocks to determine if the viewpoint is within the fluid or not. -+ * -+ * @param state the state -+ * @param world the world -+ * @param pos the position -+ * @param viewpoint the viewpoint -+ * @return the block state that should be 'seen' -+ */ -+ public IBlockState getStateAtViewpoint(IBlockState state, IBlockAccess world, BlockPos pos, Vec3d viewpoint) -+ { -+ return state; -+ } -+ -+ /** -+ * Gets the {@link IBlockState} to place -+ * @param world The world the block is being placed in -+ * @param pos The position the block is being placed at -+ * @param facing The side the block is being placed on -+ * @param hitX The X coordinate of the hit vector -+ * @param hitY The Y coordinate of the hit vector -+ * @param hitZ The Z coordinate of the hit vector -+ * @param meta The metadata of {@link ItemStack} as processed by {@link Item#getMetadata(int)} -+ * @param placer The entity placing the block -+ * @param hand The player hand used to place this block -+ * @return The state to be placed in the world -+ */ -+ public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) -+ { -+ return func_180642_a(world, pos, facing, hitX, hitY, hitZ, meta, placer); -+ } -+ -+ /** -+ * Determines if another block can connect to this block -+ * -+ * @param world The current world -+ * @param pos The position of this block -+ * @param facing The side the connecting block is on -+ * @return True to allow another block to connect to this block -+ */ -+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) -+ { -+ return false; -+ } -+ -+ /** -+ * Get the {@code PathNodeType} for this block. Return {@code null} for vanilla behavior. -+ * -+ * @return the PathNodeType -+ */ -+ @Nullable -+ public net.minecraft.pathfinding.PathNodeType getAiPathNodeType(IBlockState state, IBlockAccess world, BlockPos pos) -+ { -+ return isBurning(world, pos) ? net.minecraft.pathfinding.PathNodeType.DAMAGE_FIRE : null; -+ } -+ -+ /** -+ * @param blockState The state for this block -+ * @param world The world this block is in -+ * @param pos The position of this block -+ * @param side The side of this block that the chest lid is trying to open into -+ * @return true if the chest should be prevented from opening by this block -+ */ -+ public boolean doesSideBlockChestOpening(IBlockState blockState, IBlockAccess world, BlockPos pos, EnumFacing side) -+ { -+ ResourceLocation registryName = this.getRegistryName(); -+ if (registryName != null && "minecraft".equals(registryName.func_110624_b())) -+ { -+ // maintain the vanilla behavior of https://bugs.mojang.com/browse/MC-378 -+ return isNormalCube(blockState, world, pos); -+ } -+ return isSideSolid(blockState, world, pos, side); -+ } -+ -+ /** -+ * @param state The state -+ * @return true if the block is sticky block which used for pull or push adjacent blocks (use by piston) -+ */ -+ public boolean isStickyBlock(IBlockState state) -+ { -+ return state.func_177230_c() == Blocks.field_180399_cE; -+ } -+ -+ /* ========================================= FORGE END ======================================*/ -+ - public static void func_149671_p() - { - func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air")); -@@ -1105,7 +2478,7 @@ - Block block11 = (new BlockQuartz()).func_149672_a(SoundType.field_185851_d).func_149711_c(0.8F).func_149663_c("quartzBlock"); - func_176219_a(155, "quartz_block", block11); - func_176219_a(156, "quartz_stairs", (new BlockStairs(block11.func_176223_P().func_177226_a(BlockQuartz.field_176335_a, BlockQuartz.EnumType.DEFAULT))).func_149663_c("stairsQuartz")); -- func_176219_a(157, "activator_rail", (new BlockRailPowered()).func_149711_c(0.7F).func_149672_a(SoundType.field_185852_e).func_149663_c("activatorRail")); -+ func_176219_a(157, "activator_rail", (new BlockRailPowered(true)).func_149711_c(0.7F).func_149672_a(SoundType.field_185852_e).func_149663_c("activatorRail")); - func_176219_a(158, "dropper", (new BlockDropper()).func_149711_c(3.5F).func_149672_a(SoundType.field_185851_d).func_149663_c("dropper")); - func_176219_a(159, "stained_hardened_clay", (new BlockStainedHardenedClay()).func_149711_c(1.25F).func_149752_b(7.0F).func_149672_a(SoundType.field_185851_d).func_149663_c("clayHardenedStained")); - func_176219_a(160, "stained_glass_pane", (new BlockStainedGlassPane()).func_149711_c(0.3F).func_149672_a(SoundType.field_185853_f).func_149663_c("thinStainedGlass")); -@@ -1230,31 +2603,6 @@ - block15.field_149783_u = flag; - } - } -- -- Set set = Sets.newHashSet(field_149771_c.func_82594_a(new ResourceLocation("tripwire"))); -- -- for (Block block16 : field_149771_c) -- { -- if (set.contains(block16)) -- { -- for (int i = 0; i < 15; ++i) -- { -- int j = field_149771_c.func_148757_b(block16) << 4 | i; -- field_176229_d.func_148746_a(block16.func_176203_a(i), j); -- } -- } -- else -- { -- UnmodifiableIterator unmodifiableiterator = block16.func_176194_O().func_177619_a().iterator(); -- -- while (unmodifiableiterator.hasNext()) -- { -- IBlockState iblockstate = (IBlockState)unmodifiableiterator.next(); -- int k = field_149771_c.func_148757_b(block16) << 4 | block16.func_176201_c(iblockstate); -- field_176229_d.func_148746_a(iblockstate, k); -- } -- } -- } - } - - private static void func_176215_a(int p_176215_0_, ResourceLocation p_176215_1_, Block p_176215_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockBanner.java.patch b/patches/minecraft/net/minecraft/block/BlockBanner.java.patch deleted file mode 100644 index 6fc1a2f4cf..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockBanner.java.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockBanner.java -+++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java -@@ -90,16 +90,9 @@ - - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { -- ItemStack itemstack = this.func_185549_e(p_180653_1_, p_180653_2_); -- -- if (itemstack.func_190926_b()) - { - super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); - } -- else -- { -- func_180635_a(p_180653_1_, p_180653_2_, itemstack); -- } - } - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) -@@ -126,6 +119,23 @@ - return BlockFaceShape.UNDEFINED; - } - -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ TileEntity te = world.func_175625_s(pos); -+ -+ if (te instanceof TileEntityBanner) -+ { -+ TileEntityBanner tileentitybanner = (TileEntityBanner)te; -+ ItemStack itemstack = tileentitybanner.func_190615_l(); -+ drops.add(itemstack); -+ } -+ else -+ { -+ drops.add(new ItemStack(Items.field_179564_cE, 1, 0)); -+ } -+ } -+ - public static class BlockBannerHanging extends BlockBanner - { - protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D); diff --git a/patches/minecraft/net/minecraft/block/BlockBush.java.patch b/patches/minecraft/net/minecraft/block/BlockBush.java.patch deleted file mode 100644 index 3e19dc4a8f..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockBush.java.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockBush.java -+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java -@@ -17,7 +17,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public class BlockBush extends Block -+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable - { - protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D); - -@@ -40,7 +40,8 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_185514_i(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b())); -+ IBlockState soil = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); -+ return super.func_176196_c(p_176196_1_, p_176196_2_) && soil.func_177230_c().canSustainPlant(soil, p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); - } - - protected boolean func_185514_i(IBlockState p_185514_1_) -@@ -70,6 +71,11 @@ - - public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) - { -+ if (p_180671_3_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. -+ { -+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()); -+ return soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); -+ } - return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); - } - -@@ -94,6 +100,36 @@ - return false; - } - -+ @Override -+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) -+ { -+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.field_185773_cZ) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert; -+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water; -+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave; -+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave; -+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether; -+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains; -+ return net.minecraftforge.common.EnumPlantType.Plains; -+ } -+ -+ @Override -+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ if (state.func_177230_c() != this) return func_176223_P(); -+ return state; -+ } -+ - @SideOnly(Side.CLIENT) - public BlockRenderLayer func_180664_k() - { diff --git a/patches/minecraft/net/minecraft/block/BlockButton.java.patch b/patches/minecraft/net/minecraft/block/BlockButton.java.patch deleted file mode 100644 index 1a2c3337ba..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockButton.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockButton.java -+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java -@@ -98,7 +98,7 @@ - - if (p_181088_2_ == EnumFacing.UP) - { -- return block == Blocks.field_150438_bZ || !func_193384_b(block) && flag; -+ return iblockstate.func_185896_q() || !func_193384_b(block) && flag; - } - else - { diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch deleted file mode 100644 index 596e4a2120..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockCactus.java -+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java -@@ -20,7 +20,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public class BlockCactus extends Block -+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable - { - public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15); - protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D); -@@ -36,6 +36,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_, 1)) return; // Forge: prevent growing cactus from loading unloaded chunks with block update - BlockPos blockpos = p_180650_2_.func_177984_a(); - - if (p_180650_1_.func_175623_d(blockpos)) -@@ -51,6 +52,8 @@ - { - int j = ((Integer)p_180650_3_.func_177229_b(field_176587_a)).intValue(); - -+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, true)) -+ { - if (j == 15) - { - p_180650_1_.func_175656_a(blockpos, this.func_176223_P()); -@@ -62,6 +65,8 @@ - { - p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176587_a, Integer.valueOf(j + 1)), 4); - } -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_)); -+ } - } - } - } -@@ -112,8 +117,8 @@ - } - } - -- Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c(); -- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d(); -+ IBlockState state = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()); -+ return state.func_177230_c().canSustainPlant(state, p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this) && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d(); - } - - public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_) -@@ -137,6 +142,18 @@ - return ((Integer)p_176201_1_.func_177229_b(field_176587_a)).intValue(); - } - -+ @Override -+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) -+ { -+ return net.minecraftforge.common.EnumPlantType.Desert; -+ } -+ -+ @Override -+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) -+ { -+ return func_176223_P(); -+ } -+ - protected BlockStateContainer func_180661_e() - { - return new BlockStateContainer(this, new IProperty[] {field_176587_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockChest.java.patch b/patches/minecraft/net/minecraft/block/BlockChest.java.patch deleted file mode 100644 index 142a29176a..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockChest.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockChest.java -+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java -@@ -470,7 +470,7 @@ - - if (block == this) - { -- if (this.func_176457_m(p_189418_1_, blockpos)) -+ if (!p_189418_3_ && this.func_176457_m(p_189418_1_, blockpos)) // Forge: fix MC-99321 - { - return null; - } -@@ -538,7 +538,7 @@ - - private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_) - { -- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_185915_l(); -+ return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).doesSideBlockChestOpening(p_176456_1_, p_176456_2_.func_177984_a(), EnumFacing.DOWN); - } - - private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_) -@@ -608,4 +608,10 @@ - BASIC, - TRAP; - } -+ -+ /* ======================================== FORGE START =====================================*/ -+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) -+ { -+ return !func_176454_e(world, pos) && super.rotateBlock(world, pos, axis); -+ } - } diff --git a/patches/minecraft/net/minecraft/block/BlockChorusFlower.java.patch b/patches/minecraft/net/minecraft/block/BlockChorusFlower.java.patch deleted file mode 100644 index 37b7878b0e..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockChorusFlower.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockChorusFlower.java -+++ ../src-work/minecraft/net/minecraft/block/BlockChorusFlower.java -@@ -55,7 +55,7 @@ - { - int i = ((Integer)p_180650_3_.func_177229_b(field_185607_a)).intValue(); - -- if (i < 5 && p_180650_4_.nextInt(1) == 0) -+ if (i < 5 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, blockpos, p_180650_3_, p_180650_4_.nextInt(1) == 0)) - { - boolean flag = false; - boolean flag1 = false; -@@ -144,6 +144,7 @@ - { - this.func_185605_c(p_180650_1_, p_180650_2_); - } -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_)); - } - } - } diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch deleted file mode 100644 index c75c1a7fe4..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java -+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java -@@ -44,13 +44,14 @@ - { - this.func_176500_f(p_180650_1_, p_180650_2_, p_180650_3_); - } -- else if (p_180650_1_.field_73012_v.nextInt(5) == 0) -+ else - { - int i = ((Integer)p_180650_3_.func_177229_b(field_176501_a)).intValue(); - -- if (i < 2) -+ if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(5) == 0)) - { - p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176501_a, Integer.valueOf(i + 1)), 2); -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_)); - } - } - } -@@ -132,7 +133,14 @@ - - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { -- int i = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue(); -+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); -+ } -+ -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ super.getDrops(drops, world, pos, state, fortune); -+ int i = ((Integer)state.func_177229_b(field_176501_a)).intValue(); - int j = 1; - - if (i >= 2) -@@ -142,7 +150,7 @@ - - for (int k = 0; k < j; ++k) - { -- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b())); -+ drops.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b())); - } - } - diff --git a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch deleted file mode 100644 index c5b37a58e1..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockCrops.java -+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java -@@ -70,6 +70,7 @@ - { - super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_); - -+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light - if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) >= 9) - { - int i = this.func_185527_x(p_180650_3_); -@@ -78,9 +79,10 @@ - { - float f = func_180672_a(this, p_180650_1_, p_180650_2_); - -- if (p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0) -+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0)) - { - p_180650_1_.func_180501_a(p_180650_2_, this.func_185528_e(i + 1), 2); -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_)); - } - } - } -@@ -116,11 +118,11 @@ - float f1 = 0.0F; - IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j)); - -- if (iblockstate.func_177230_c() == Blocks.field_150458_ak) -+ if (iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_)) - { - f1 = 1.0F; - -- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0) -+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j))) - { - f1 = 3.0F; - } -@@ -161,7 +163,8 @@ - - public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) - { -- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); -+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()); -+ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); - } - - protected Item func_149866_i() -@@ -174,11 +177,32 @@ - return Items.field_151015_O; - } - -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ super.getDrops(drops, world, pos, state, 0); -+ int age = func_185527_x(state); -+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); -+ -+ if (age >= func_185526_g()) -+ { -+ int k = 3 + fortune; -+ -+ for (int i = 0; i < 3 + fortune; ++i) -+ { -+ if (rand.nextInt(2 * func_185526_g()) <= age) -+ { -+ drops.add(new ItemStack(this.func_149866_i(), 1, 0)); -+ } -+ } -+ } -+ } -+ - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { -- super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0); -+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); - -- if (!p_180653_1_.field_72995_K) -+ if (false && !p_180653_1_.field_72995_K) // Forge: NOP all this. - { - int i = this.func_185527_x(p_180653_3_); - diff --git a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch b/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch deleted file mode 100644 index 30963462e5..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java -+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java -@@ -17,7 +17,7 @@ - import net.minecraft.world.IBlockAccess; - import net.minecraft.world.World; - --public class BlockDeadBush extends BlockBush -+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable - { - protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D); - -@@ -68,4 +68,11 @@ - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); - } - } -+ -+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } -+ @Override -+ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I)); -+ } - } diff --git a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch deleted file mode 100644 index 0494a60c44..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockDoor.java -+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java -@@ -203,7 +203,7 @@ - flag1 = true; - } - -- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q()) -+ if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).isSideSolid(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP)) - { - p_189540_2_.func_175698_g(p_189540_3_); - flag1 = true; -@@ -247,13 +247,14 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- if (p_176196_2_.func_177956_o() >= 255) -+ if (p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1) - { - return false; - } - else - { -- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); -+ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); -+ return (state.func_185896_q() || state.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); - } - } - diff --git a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch deleted file mode 100644 index d8881e1dae..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java -+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java -@@ -24,7 +24,7 @@ - import net.minecraft.world.IBlockAccess; - import net.minecraft.world.World; - --public class BlockDoublePlant extends BlockBush implements IGrowable -+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable - { - public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class); - public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class); -@@ -87,6 +87,8 @@ - Block block = (Block)(flag ? this : p_176475_1_.func_180495_p(blockpos).func_177230_c()); - Block block1 = (Block)(flag ? p_176475_1_.func_180495_p(blockpos1).func_177230_c() : this); - -+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air. -+ - if (block == this) - { - p_176475_1_.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 2); -@@ -95,17 +97,13 @@ - if (block1 == this) - { - p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3); -- -- if (!flag) -- { -- this.func_176226_b(p_176475_1_, blockpos1, p_176475_3_, 0); -- } - } - } - } - - public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) - { -+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. - if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER) - { - return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this; -@@ -160,7 +158,6 @@ - - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) - { -- if (p_180657_1_.field_72995_K || p_180657_6_.func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_)) - { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); - } -@@ -220,8 +217,6 @@ - else - { - p_176489_4_.func_71029_a(StatList.func_188055_a(this)); -- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).func_177044_a(); -- func_180635_a(p_176489_1_, p_176489_2_, new ItemStack(Blocks.field_150329_H, 2, i)); - return true; - } - } -@@ -290,6 +285,24 @@ - return Block.EnumOffsetType.XZ; - } - -+ @Override -+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a); -+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS); -+ } -+ -+ @Override -+ public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ java.util.List ret = new java.util.ArrayList(); -+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a); -+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a())); -+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a())); -+ return ret; -+ } -+ - public static enum EnumBlockHalf implements IStringSerializable - { - UPPER, diff --git a/patches/minecraft/net/minecraft/block/BlockDragonEgg.java.patch b/patches/minecraft/net/minecraft/block/BlockDragonEgg.java.patch deleted file mode 100644 index 70feba27db..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockDragonEgg.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockDragonEgg.java -+++ ../src-work/minecraft/net/minecraft/block/BlockDragonEgg.java -@@ -48,7 +48,7 @@ - - private void func_180683_d(World p_180683_1_, BlockPos p_180683_2_) - { -- if (BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0) -+ if (p_180683_1_.func_175623_d(p_180683_2_.func_177977_b()) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0) - { - int i = 32; - -@@ -61,7 +61,7 @@ - p_180683_1_.func_175698_g(p_180683_2_); - BlockPos blockpos; - -- for (blockpos = p_180683_2_; BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) -+ for (blockpos = p_180683_2_; p_180683_1_.func_175623_d(blockpos) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) - { - ; - } -@@ -95,7 +95,7 @@ - { - BlockPos blockpos = p_180684_2_.func_177982_a(p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16), p_180684_1_.field_73012_v.nextInt(8) - p_180684_1_.field_73012_v.nextInt(8), p_180684_1_.field_73012_v.nextInt(16) - p_180684_1_.field_73012_v.nextInt(16)); - -- if (p_180684_1_.func_180495_p(blockpos).func_177230_c().field_149764_J == Material.field_151579_a) -+ if (p_180684_1_.func_175623_d(blockpos)) - { - if (p_180684_1_.field_72995_K) - { diff --git a/patches/minecraft/net/minecraft/block/BlockDropper.java.patch b/patches/minecraft/net/minecraft/block/BlockDropper.java.patch deleted file mode 100644 index 3f71656ac1..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockDropper.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockDropper.java -+++ ../src-work/minecraft/net/minecraft/block/BlockDropper.java -@@ -43,7 +43,7 @@ - { - ItemStack itemstack = tileentitydispenser.func_70301_a(i); - -- if (!itemstack.func_190926_b()) -+ if (!itemstack.func_190926_b() && net.minecraftforge.items.VanillaInventoryCodeHooks.dropperInsertHook(p_176439_1_, p_176439_2_, tileentitydispenser, i, itemstack)) - { - EnumFacing enumfacing = (EnumFacing)p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a); - BlockPos blockpos = p_176439_2_.func_177972_a(enumfacing); diff --git a/patches/minecraft/net/minecraft/block/BlockDynamicLiquid.java.patch b/patches/minecraft/net/minecraft/block/BlockDynamicLiquid.java.patch deleted file mode 100644 index 6cb27004cd..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockDynamicLiquid.java.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockEnchantmentTable.java.patch b/patches/minecraft/net/minecraft/block/BlockEnchantmentTable.java.patch deleted file mode 100644 index b5eb0aa5b1..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockEnchantmentTable.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockEnchantmentTable.java -+++ ../src-work/minecraft/net/minecraft/block/BlockEnchantmentTable.java -@@ -64,7 +64,7 @@ - { - BlockPos blockpos = p_180655_3_.func_177982_a(i, k, j); - -- if (p_180655_2_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150342_X) -+ if (net.minecraftforge.common.ForgeHooks.getEnchantPower(p_180655_2_, blockpos) > 0) - { - if (!p_180655_2_.func_175623_d(p_180655_3_.func_177982_a(i / 2, 0, j / 2))) - { diff --git a/patches/minecraft/net/minecraft/block/BlockEnderChest.java.patch b/patches/minecraft/net/minecraft/block/BlockEnderChest.java.patch deleted file mode 100644 index c1fed46f04..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockEnderChest.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockEnderChest.java -+++ ../src-work/minecraft/net/minecraft/block/BlockEnderChest.java -@@ -100,7 +100,7 @@ - - if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest) - { -- if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).func_185915_l()) -+ if (p_180639_1_.func_180495_p(p_180639_2_.func_177984_a()).doesSideBlockChestOpening(p_180639_1_, p_180639_2_.func_177984_a(), EnumFacing.DOWN)) - { - return true; - } diff --git a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch deleted file mode 100644 index 3aa85cd9a0..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockFalling.java -+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java -@@ -47,7 +47,7 @@ - - private void func_176503_e(World p_176503_1_, BlockPos p_176503_2_) - { -- if (func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0) -+ if ((p_176503_1_.func_175623_d(p_176503_2_.func_177977_b()) || func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b()))) && p_176503_2_.func_177956_o() >= 0) - { - int i = 32; - -@@ -62,17 +62,18 @@ - } - else - { -+ IBlockState state = p_176503_1_.func_180495_p(p_176503_2_); - p_176503_1_.func_175698_g(p_176503_2_); - BlockPos blockpos; - -- for (blockpos = p_176503_2_.func_177977_b(); func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) -+ for (blockpos = p_176503_2_.func_177977_b(); (p_176503_1_.func_175623_d(blockpos) || func_185759_i(p_176503_1_.func_180495_p(blockpos))) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b()) - { - ; - } - - if (blockpos.func_177956_o() > 0) - { -- p_176503_1_.func_175656_a(blockpos.func_177984_a(), this.func_176223_P()); -+ p_176503_1_.func_175656_a(blockpos.func_177984_a(), state); //Forge: Fix loss of state information during world gen. - } - } - } diff --git a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch deleted file mode 100644 index cabce5427a..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java -+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java -@@ -72,7 +72,7 @@ - - public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) - { -- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof EntityLivingBase && (p_180658_3_ instanceof EntityPlayer || p_180658_1_.func_82736_K().func_82766_b("mobGriefing")) && p_180658_3_.field_70130_N * p_180658_3_.field_70130_N * p_180658_3_.field_70131_O > 0.512F) -+ if (net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_180658_1_, p_180658_2_, Blocks.field_150346_d.func_176223_P(), p_180658_4_, p_180658_3_)) // Forge: Move logic to Entity#canTrample - { - func_190970_b(p_180658_1_, p_180658_2_); - } -@@ -95,7 +95,7 @@ - private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_) - { - Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c(); -- return block instanceof BlockCrops || block instanceof BlockStem; -+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_.func_180495_p(p_176529_2_), p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block); - } - - private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockFence.java.patch b/patches/minecraft/net/minecraft/block/BlockFence.java.patch deleted file mode 100644 index f3ae9dcb4a..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockFence.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockFence.java -+++ ../src-work/minecraft/net/minecraft/block/BlockFence.java -@@ -165,7 +165,10 @@ - - public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_) - { -- return p_176221_1_.func_177226_a(field_176526_a, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176525_b, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))).func_177226_a(field_176527_M, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176528_N, Boolean.valueOf(this.func_176524_e(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST))); -+ return p_176221_1_.func_177226_a(field_176526_a, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH)) -+ .func_177226_a(field_176525_b, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST)) -+ .func_177226_a(field_176527_M, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH)) -+ .func_177226_a(field_176528_N, canFenceConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST)); - } - - public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) -@@ -201,6 +204,23 @@ - return new BlockStateContainer(this, new IProperty[] {field_176526_a, field_176525_b, field_176528_N, field_176527_M}); - } - -+ /* ======================================== FORGE START ======================================== */ -+ -+ @Override -+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) -+ { -+ return func_176524_e(world, pos.func_177972_a(facing), facing.func_176734_d()); -+ } -+ -+ private boolean canFenceConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing) -+ { -+ BlockPos other = pos.func_177972_a(facing); -+ Block block = world.func_180495_p(other).func_177230_c(); -+ return block.canBeConnectedTo(world, other, facing.func_176734_d()) || func_176524_e(world, other, facing.func_176734_d()); -+ } -+ -+ /* ======================================== FORGE END ======================================== */ -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE : BlockFaceShape.CENTER; diff --git a/patches/minecraft/net/minecraft/block/BlockFenceGate.java.patch b/patches/minecraft/net/minecraft/block/BlockFenceGate.java.patch deleted file mode 100644 index c29e855ff1..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockFenceGate.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockFenceGate.java -+++ ../src-work/minecraft/net/minecraft/block/BlockFenceGate.java -@@ -59,7 +59,7 @@ - { - EnumFacing.Axis enumfacing$axis = ((EnumFacing)p_176221_1_.func_177229_b(field_185512_D)).func_176740_k(); - -- if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() == Blocks.field_150463_bK) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() == Blocks.field_150463_bK || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() == Blocks.field_150463_bK)) -+ if (enumfacing$axis == EnumFacing.Axis.Z && (p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c() instanceof BlockWall || p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c() instanceof BlockWall)) - { - p_176221_1_ = p_176221_1_.func_177226_a(field_176467_M, Boolean.valueOf(true)); - } -@@ -192,6 +192,23 @@ - return new BlockStateContainer(this, new IProperty[] {field_185512_D, field_176466_a, field_176465_b, field_176467_M}); - } - -+ /* ======================================== FORGE START ======================================== */ -+ -+ @Override -+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ if (state.func_177230_c() instanceof BlockFenceGate && -+ state.func_193401_d(world, pos, facing) == BlockFaceShape.MIDDLE_POLE) -+ { -+ Block connector = world.func_180495_p(pos.func_177972_a(facing)).func_177230_c(); -+ return connector instanceof BlockFence || connector instanceof BlockWall; -+ } -+ return false; -+ } -+ -+ /* ======================================== FORGE END ======================================== */ -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - if (p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN) diff --git a/patches/minecraft/net/minecraft/block/BlockFire.java.patch b/patches/minecraft/net/minecraft/block/BlockFire.java.patch deleted file mode 100644 index 616495030b..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockFire.java.patch +++ /dev/null @@ -1,218 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockFire.java -+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java -@@ -39,7 +39,15 @@ - - public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_) - { -- return !p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()) ? p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))) : this.func_176223_P(); -+ if (!p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).isSideSolid(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP)) -+ { -+ return p_176221_1_.func_177226_a(field_176545_N, this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH)) -+ .func_177226_a(field_176546_O, this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST)) -+ .func_177226_a(field_176541_P, this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH)) -+ .func_177226_a(field_176539_Q, this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST)) -+ .func_177226_a(field_176542_R, this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN)); -+ } -+ return this.func_176223_P(); - } - - protected BlockFire() -@@ -92,6 +100,7 @@ - - public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) - { -+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); - this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_)); - this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_)); - } -@@ -126,19 +135,15 @@ - { - if (p_180650_1_.func_82736_K().func_82766_b("doFireTick")) - { -+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when spreading fire - if (!this.func_176196_c(p_180650_1_, p_180650_2_)) - { - p_180650_1_.func_175698_g(p_180650_2_); - } - - Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c(); -- boolean flag = block == Blocks.field_150424_aL || block == Blocks.field_189877_df; -+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP); - -- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h) -- { -- flag = true; -- } -- - int i = ((Integer)p_180650_3_.func_177229_b(field_176543_a)).intValue(); - - if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_) && p_180650_4_.nextFloat() < 0.2F + (float)i * 0.03F) -@@ -159,7 +164,7 @@ - { - if (!this.func_176533_e(p_180650_1_, p_180650_2_)) - { -- if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185896_q() || i > 3) -+ if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).isSideSolid(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) || i > 3) - { - p_180650_1_.func_175698_g(p_180650_2_); - } -@@ -167,7 +172,7 @@ - return; - } - -- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0) -+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0) - { - p_180650_1_.func_175698_g(p_180650_2_); - return; -@@ -182,12 +187,12 @@ - j = -50; - } - -- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i); -- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i); -- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i); -- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i); -- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i); -- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i); -+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i, EnumFacing.WEST); -+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i, EnumFacing.EAST); -+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i, EnumFacing.UP); -+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i, EnumFacing.DOWN); -+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i, EnumFacing.SOUTH); -+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i, EnumFacing.NORTH); - - for (int k = -1; k <= 1; ++k) - { -@@ -246,22 +251,30 @@ - return false; - } - -+ @Deprecated // Use Block.getFlammability - public int func_176532_c(Block p_176532_1_) - { - Integer integer = this.field_149848_b.get(p_176532_1_); - return integer == null ? 0 : integer.intValue(); - } - -+ @Deprecated // Use Block.getFireSpreadSpeed - public int func_176534_d(Block p_176534_1_) - { - Integer integer = this.field_149849_a.get(p_176534_1_); - return integer == null ? 0 : integer.intValue(); - } - -+ @Deprecated // Use tryCatchFire with face below - private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_) - { -- int i = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c()); -+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP); -+ } - -+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face) -+ { -+ int i = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face); -+ - if (p_176536_4_.nextInt(p_176536_3_) < i) - { - IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_); -@@ -293,7 +306,7 @@ - { - for (EnumFacing enumfacing : EnumFacing.values()) - { -- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing))) -+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())) - { - return true; - } -@@ -314,7 +327,7 @@ - - for (EnumFacing enumfacing : EnumFacing.values()) - { -- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i); -+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFireSpreadSpeed(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i); - } - - return i; -@@ -326,9 +339,10 @@ - return false; - } - -+ @Deprecated // Use canCatchFire with face sensitive version below - public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_) - { -- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0; -+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP); - } - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) -@@ -372,9 +386,9 @@ - p_180655_2_.func_184134_a((double)((float)p_180655_3_.func_177958_n() + 0.5F), (double)((float)p_180655_3_.func_177956_o() + 0.5F), (double)((float)p_180655_3_.func_177952_p() + 0.5F), SoundEvents.field_187643_bs, SoundCategory.BLOCKS, 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false); - } - -- if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177977_b())) -+ if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).isSideSolid(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP)) - { -- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177976_e())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST)) - { - for (int j = 0; j < 2; ++j) - { -@@ -385,7 +399,7 @@ - } - } - -- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177974_f())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST)) - { - for (int k = 0; k < 2; ++k) - { -@@ -396,7 +410,7 @@ - } - } - -- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177978_c())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH)) - { - for (int l = 0; l < 2; ++l) - { -@@ -407,7 +421,7 @@ - } - } - -- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177968_d())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH)) - { - for (int i1 = 0; i1 < 2; ++i1) - { -@@ -418,7 +432,7 @@ - } - } - -- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177984_a())) -+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN)) - { - for (int j1 = 0; j1 < 2; ++j1) - { -@@ -462,6 +476,21 @@ - return new BlockStateContainer(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R}); - } - -+ /*================================= Forge Start ======================================*/ -+ /** -+ * Side sensitive version that calls the block function. -+ * -+ * @param world The current world -+ * @param pos Block position -+ * @param face The side the fire is coming from -+ * @return True if the face can catch fire. -+ */ -+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face) -+ { -+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face); -+ } -+ /*================================= Forge Start ======================================*/ -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return BlockFaceShape.UNDEFINED; diff --git a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch b/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch deleted file mode 100644 index fb380d96dd..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch deleted file mode 100644 index b68cf2a680..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockGrass.java -+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java -@@ -38,7 +38,8 @@ - { - if (!p_180650_1_.field_72995_K) - { -- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2) -+ if (!p_180650_1_.func_175697_a(p_180650_2_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading -+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) - { - p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P()); - } -@@ -58,7 +59,7 @@ - IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos.func_177984_a()); - IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos); - -- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.func_185891_c() <= 2) -+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) <= 2) - { - p_180650_1_.func_175656_a(blockpos, Blocks.field_150349_c.func_176223_P()); - } -@@ -96,18 +97,11 @@ - { - if (j >= i / 16) - { -- if (p_176474_1_.func_180495_p(blockpos1).func_177230_c().field_149764_J == Material.field_151579_a) -+ if (p_176474_1_.func_175623_d(blockpos1)) - { - if (p_176474_2_.nextInt(8) == 0) - { -- BlockFlower.EnumFlowerType blockflower$enumflowertype = p_176474_1_.func_180494_b(blockpos1).func_180623_a(p_176474_2_, blockpos1); -- BlockFlower blockflower = blockflower$enumflowertype.func_176964_a().func_180346_a(); -- IBlockState iblockstate = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), blockflower$enumflowertype); -- -- if (blockflower.func_180671_f(p_176474_1_, blockpos1, iblockstate)) -- { -- p_176474_1_.func_180501_a(blockpos1, iblockstate, 3); -- } -+ p_176474_1_.func_180494_b(blockpos1).plantFlower(p_176474_1_, p_176474_2_, blockpos1); - } - else - { diff --git a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch deleted file mode 100644 index a1ea620298..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java -+++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java -@@ -222,6 +222,20 @@ - return new BlockStateContainer(this, new IProperty[] {field_176380_a}); - } - -+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : (java.util.Set>)state.func_177228_b().keySet()) -+ { -+ if (prop.func_177701_a().equals("variant")) -+ { -+ world.func_175656_a(pos, state.func_177231_a(prop)); -+ return true; -+ } -+ } -+ return false; -+ } -+ - public static enum EnumType implements IStringSerializable - { - NORTH_WEST(1, "north_west"), diff --git a/patches/minecraft/net/minecraft/block/BlockIce.java.patch b/patches/minecraft/net/minecraft/block/BlockIce.java.patch deleted file mode 100644 index 5b385fabc8..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockIce.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockIce.java -+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java -@@ -41,9 +41,14 @@ - p_180657_2_.func_71029_a(StatList.func_188055_a(this)); - p_180657_2_.func_71020_j(0.005F); - -- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) -+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) - { -- func_180635_a(p_180657_1_, p_180657_3_, this.func_180643_i(p_180657_4_)); -+ java.util.List items = new java.util.ArrayList(); -+ items.add(this.func_180643_i(p_180657_4_)); -+ -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_); -+ for (ItemStack is : items) -+ func_180635_a(p_180657_1_, p_180657_3_, is); - } - else - { -@@ -54,7 +59,9 @@ - } - - int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_); -+ harvesters.set(p_180657_2_); - this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i); -+ harvesters.set(null); - Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_185904_a(); - - if (material.func_76230_c() || material.func_76224_d()) diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch deleted file mode 100644 index 6fa84a5628..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockLadder.java -+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java -@@ -158,6 +158,8 @@ - return new BlockStateContainer(this, new IProperty[] {field_176382_a}); - } - -+ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return BlockFaceShape.UNDEFINED; diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch deleted file mode 100644 index fd9616aabe..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ /dev/null @@ -1,139 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java -+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java -@@ -17,7 +17,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public abstract class BlockLeaves extends Block -+public abstract class BlockLeaves extends Block implements net.minecraftforge.common.IShearable - { - public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable"); - public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay"); -@@ -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; - } -@@ -205,40 +206,7 @@ - - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { -- if (!p_180653_1_.field_72995_K) -- { -- int i = this.func_176232_d(p_180653_3_); -- -- if (p_180653_5_ > 0) -- { -- i -= 2 << p_180653_5_; -- -- if (i < 10) -- { -- i = 10; -- } -- } -- -- if (p_180653_1_.field_73012_v.nextInt(i) == 0) -- { -- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_); -- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_))); -- } -- -- i = 200; -- -- if (p_180653_5_ > 0) -- { -- i -= 10 << p_180653_5_; -- -- if (i < 40) -- { -- i = 40; -- } -- } -- -- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, i); -- } -+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); - } - - 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 isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } -+ @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); -+ } -+ } -+ -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); -+ int chance = this.func_176232_d(state); -+ -+ if (fortune > 0) -+ { -+ chance -= 2 << fortune; -+ if (chance < 10) chance = 10; -+ } -+ -+ if (rand.nextInt(chance) == 0) -+ { -+ ItemStack drop = new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state)); -+ if (!drop.func_190926_b()) -+ drops.add(drop); -+ } -+ -+ chance = 200; -+ if (fortune > 0) -+ { -+ chance -= 10 << fortune; -+ if (chance < 40) chance = 40; -+ } -+ -+ this.captureDrops(true); -+ if (world instanceof World) -+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang -+ drops.addAll(this.captureDrops(false)); -+ } -+ -+ - @SideOnly(Side.CLIENT) - public boolean func_176225_a(IBlockState p_176225_1_, IBlockAccess p_176225_2_, BlockPos p_176225_3_, EnumFacing p_176225_4_) - { diff --git a/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch b/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch deleted file mode 100644 index f5635a58f0..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockLog.java.patch b/patches/minecraft/net/minecraft/block/BlockLog.java.patch deleted file mode 100644 index 6268339217..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockLog.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch deleted file mode 100644 index f5093e664c..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java -+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java -@@ -40,10 +40,14 @@ - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { - super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); -- int i = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15); -- this.func_180637_b(p_180653_1_, p_180653_2_, i); - } - -+ @Override -+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); -+ } -+ - public boolean func_149662_c(IBlockState p_149662_1_) - { - return false; diff --git a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch deleted file mode 100644 index 103ba635c0..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java -+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java -@@ -89,7 +89,7 @@ - } - else - { -- return p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_185514_i(iblockstate); -+ return p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); - } - } - else diff --git a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch deleted file mode 100644 index 36158f0378..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java -+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java -@@ -39,7 +39,8 @@ - { - if (!p_180650_1_.field_72995_K) - { -- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2) -+ if (!p_180650_1_.func_175697_a(p_180650_2_, 2)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading -+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) - { - p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT)); - } -@@ -53,7 +54,7 @@ - IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos); - IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos.func_177984_a()); - -- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.func_185891_c() <= 2) -+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2) - { - p_180650_1_.func_175656_a(blockpos, this.func_176223_P()); - } diff --git a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch deleted file mode 100644 index 9237f76335..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java -+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java -@@ -42,25 +42,28 @@ - - public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) - { -- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); -+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); - } - - public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_) - { - int i = ((Integer)p_180650_3_.func_177229_b(field_176486_a)).intValue(); - -- if (i < 3 && p_180650_4_.nextInt(10) == 0) -+ if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt(10) == 0)) - { -- p_180650_3_ = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1)); -- p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_, 2); -+ IBlockState newState = p_180650_3_.func_177226_a(field_176486_a, Integer.valueOf(i + 1)); -+ p_180650_1_.func_180501_a(p_180650_2_, newState, 2); -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, newState); - } - - super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_); - } - -+ @SuppressWarnings("unused") - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { -- if (!p_180653_1_.field_72995_K) -+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); -+ if (false && !p_180653_1_.field_72995_K) - { - int i = 1; - -@@ -106,6 +109,23 @@ - return ((Integer)p_176201_1_.func_177229_b(field_176486_a)).intValue(); - } - -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); -+ int count = 1; -+ -+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3) -+ { -+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0); -+ } -+ -+ for (int i = 0; i < count; i++) -+ { -+ drops.add(new ItemStack(Items.field_151075_bm)); -+ } -+ } -+ - protected BlockStateContainer func_180661_e() - { - return new BlockStateContainer(this, new IProperty[] {field_176486_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch b/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch deleted file mode 100644 index c75246a5dd..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java -+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java -@@ -106,4 +106,10 @@ - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); - } - } -+ -+ @Override -+ public NonNullList onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176240_P).func_176839_a() - 4)); -+ } - } diff --git a/patches/minecraft/net/minecraft/block/BlockNote.java.patch b/patches/minecraft/net/minecraft/block/BlockNote.java.patch deleted file mode 100644 index 654716d83a..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockNote.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockNote.java -+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java -@@ -63,7 +63,9 @@ - if (tileentity instanceof TileEntityNote) - { - TileEntityNote tileentitynote = (TileEntityNote)tileentity; -+ int old = tileentitynote.field_145879_a; - tileentitynote.func_145877_a(); -+ if (old == tileentitynote.field_145879_a) return false; - tileentitynote.func_175108_a(p_180639_1_, p_180639_2_); - p_180639_4_.func_71029_a(StatList.field_188087_U); - } -@@ -103,6 +105,10 @@ - - public boolean func_189539_a(IBlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) - { -+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_189539_2_, p_189539_3_, p_189539_1_, p_189539_5_, p_189539_4_); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false; -+ p_189539_4_ = e.getInstrument().ordinal(); -+ p_189539_5_ = e.getVanillaNoteId(); - float f = (float)Math.pow(2.0D, (double)(p_189539_5_ - 12) / 12.0D); - p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, this.func_185576_e(p_189539_4_), SoundCategory.RECORDS, 3.0F, f); - p_189539_2_.func_175688_a(EnumParticleTypes.NOTE, (double)p_189539_3_.func_177958_n() + 0.5D, (double)p_189539_3_.func_177956_o() + 1.2D, (double)p_189539_3_.func_177952_p() + 0.5D, (double)p_189539_5_ / 24.0D, 0.0D, 0.0D); diff --git a/patches/minecraft/net/minecraft/block/BlockObserver.java.patch b/patches/minecraft/net/minecraft/block/BlockObserver.java.patch deleted file mode 100644 index ba62fd8ad1..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockObserver.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockOldLeaf.java.patch b/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch deleted file mode 100644 index b5f19bf38e..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java -+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java -@@ -101,11 +101,16 @@ - if (!p_180657_1_.field_72995_K && p_180657_6_.func_77973_b() == Items.field_151097_aZ) - { - p_180657_2_.func_71029_a(StatList.func_188055_a(this)); -- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176239_P)).func_176839_a())); - } - else - { - super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); - } - } -+ -+ @Override -+ public NonNullList onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return NonNullList.func_191197_a(1, new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176239_P).func_176839_a())); -+ } - } diff --git a/patches/minecraft/net/minecraft/block/BlockOre.java.patch b/patches/minecraft/net/minecraft/block/BlockOre.java.patch deleted file mode 100644 index 0c839576bf..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockOre.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockOre.java -+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java -@@ -78,34 +78,39 @@ - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { - super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); -- -- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this)) -+ } -+ @Override -+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); -+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this)) - { - int i = 0; - - if (this == Blocks.field_150365_q) - { -- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2); -+ i = MathHelper.func_76136_a(rand, 0, 2); - } - else if (this == Blocks.field_150482_ag) - { -- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7); -+ i = MathHelper.func_76136_a(rand, 3, 7); - } - else if (this == Blocks.field_150412_bA) - { -- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7); -+ i = MathHelper.func_76136_a(rand, 3, 7); - } - else if (this == Blocks.field_150369_x) - { -- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5); -+ i = MathHelper.func_76136_a(rand, 2, 5); - } - else if (this == Blocks.field_150449_bY) - { -- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5); -+ i = MathHelper.func_76136_a(rand, 2, 5); - } - -- this.func_180637_b(p_180653_1_, p_180653_2_, i); -+ return i; - } -+ return 0; - } - - public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) diff --git a/patches/minecraft/net/minecraft/block/BlockPane.java.patch b/patches/minecraft/net/minecraft/block/BlockPane.java.patch deleted file mode 100644 index cb62fe1a89..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockPane.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPane.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java -@@ -112,7 +112,10 @@ - - public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_) - { -- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()), p_176221_3_.func_177978_c(), EnumFacing.SOUTH))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()), p_176221_3_.func_177968_d(), EnumFacing.NORTH))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()), p_176221_3_.func_177976_e(), EnumFacing.EAST))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_193393_b(p_176221_2_, p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()), p_176221_3_.func_177974_f(), EnumFacing.WEST))); -+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH)) -+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH)) -+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST)) -+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST)); - } - - public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) -@@ -197,6 +200,24 @@ - return new BlockStateContainer(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N}); - } - -+ /* ======================================== FORGE START ======================================== */ -+ -+ @Override -+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) -+ { -+ BlockPos offset = pos.func_177972_a(facing); -+ return func_193393_b(world, world.func_180495_p(offset), offset, facing.func_176734_d()); -+ } -+ -+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir) -+ { -+ BlockPos other = pos.func_177972_a(dir); -+ IBlockState state = world.func_180495_p(other); -+ return state.func_177230_c().canBeConnectedTo(world, other, dir.func_176734_d()) || func_193393_b(world, state, other, dir.func_176734_d()); -+ } -+ -+ /* ======================================== FORGE END ======================================== */ -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE_THIN : BlockFaceShape.CENTER_SMALL; diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch deleted file mode 100644 index e265c26724..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java -@@ -241,7 +241,7 @@ - } - } - -- if (!flag1 && iblockstate.func_185904_a() != Material.field_151579_a && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) -+ if (!flag1 && !iblockstate.func_177230_c().isAir(iblockstate, p_189539_2_, blockpos) && func_185646_a(iblockstate, p_189539_2_, blockpos, enumfacing.func_176734_d(), false, enumfacing) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) - { - this.func_176319_a(p_189539_2_, p_189539_3_, enumfacing, false); - } -@@ -307,7 +307,7 @@ - return false; - } - -- return !block.func_149716_u(); -+ return !block.hasTileEntity(p_185646_0_); - } - else - { -@@ -353,7 +353,9 @@ - { - BlockPos blockpos1 = list2.get(j); - IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos1); -- iblockstate.func_177230_c().func_176226_b(p_176319_1_, blockpos1, iblockstate, 0); -+ // Forge: With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior. -+ float chance = iblockstate.func_177230_c() instanceof BlockSnow ? -1.0f : 1.0f; -+ iblockstate.func_177230_c().func_180653_a(p_176319_1_, blockpos1, iblockstate, chance, 0); - p_176319_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 4); - --k; - aiblockstate[k] = iblockstate; -@@ -434,6 +436,13 @@ - return new BlockStateContainer(this, new IProperty[] {field_176387_N, field_176320_b}); - } - -+ /* ======================================== FORGE START =====================================*/ -+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ return !state.func_177229_b(field_176320_b) && super.rotateBlock(world, pos, axis); -+ } -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - p_193383_2_ = this.func_176221_a(p_193383_2_, p_193383_1_, p_193383_3_); diff --git a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch deleted file mode 100644 index 8cadb8eeb3..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java -@@ -116,7 +116,7 @@ - - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { -- if (!p_180653_1_.field_72995_K) -+ if (false && !p_180653_1_.field_72995_K) // Forge: Noop this out - { - TileEntityPiston tileentitypiston = this.func_185589_c(p_180653_1_, p_180653_2_); - -@@ -126,6 +126,7 @@ - iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0); - } - } -+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, 1, p_180653_5_); // mimic vanilla behavior from above and ignore chance - } - - @Nullable -@@ -210,6 +211,17 @@ - return new BlockStateContainer(this, new IProperty[] {field_176426_a, field_176425_b}); - } - -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ TileEntityPiston tileentitypiston = this.func_185589_c(world, pos); -+ if (tileentitypiston != null) -+ { -+ IBlockState pushed = tileentitypiston.func_174927_b(); -+ drops.addAll(pushed.func_177230_c().getDrops(world, pos, pushed, fortune)); // use the old method until it gets removed, for backward compatibility -+ } -+ } -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return BlockFaceShape.UNDEFINED; diff --git a/patches/minecraft/net/minecraft/block/BlockPotato.java.patch b/patches/minecraft/net/minecraft/block/BlockPotato.java.patch deleted file mode 100644 index d52e13a25a..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockPotato.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPotato.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java -@@ -27,7 +27,7 @@ - { - super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); - -- if (!p_180653_1_.field_72995_K) -+ if (false && !p_180653_1_.field_72995_K) //Forge: Moved to getDrops - { - if (this.func_185525_y(p_180653_3_) && p_180653_1_.field_73012_v.nextInt(50) == 0) - { -@@ -40,4 +40,12 @@ - { - return field_185534_a[((Integer)p_185496_1_.func_177229_b(this.func_185524_e())).intValue()]; - } -+ -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ super.getDrops(drops, world, pos, state, fortune); -+ if (this.func_185525_y(state) && RANDOM.nextInt(50) == 0) -+ drops.add(new ItemStack(Items.field_151170_bI)); -+ } - } diff --git a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch deleted file mode 100644 index dc5a220d91..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java -+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java -@@ -136,7 +136,7 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q(); -+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && p_176196_1_.isSideSolid(p_176196_2_.func_177977_b(), EnumFacing.UP); - } - - public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch b/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch deleted file mode 100644 index b0f8c1ed62..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java -+++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java -@@ -108,6 +108,26 @@ - return new BlockStateContainer(this, new IProperty[] {field_176335_a}); - } - -+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : state.func_177228_b().keySet()) -+ { -+ if (prop.func_177701_a().equals("variant") && prop.func_177699_b() == EnumType.class) -+ { -+ EnumType current = (EnumType)state.func_177229_b(prop); -+ EnumType next = current == EnumType.LINES_X ? EnumType.LINES_Y : -+ current == EnumType.LINES_Y ? EnumType.LINES_Z : -+ current == EnumType.LINES_Z ? EnumType.LINES_X : current; -+ if (next == current) -+ return false; -+ world.func_175656_a(pos, state.func_177226_a(prop, next)); -+ return true; -+ } -+ } -+ return false; -+ } -+ - public static enum EnumType implements IStringSerializable - { - DEFAULT(0, "default", "default"), diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch deleted file mode 100644 index f3fbfbf5ee..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ /dev/null @@ -1,230 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java -@@ -34,7 +34,7 @@ - public static boolean func_176563_d(IBlockState p_176563_0_) - { - Block block = p_176563_0_.func_177230_c(); -- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc; -+ return block instanceof BlockRailBase; - } - - protected BlockRailBase(boolean p_i45389_1_) -@@ -57,7 +57,7 @@ - - public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_) - { -- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = p_185496_1_.func_177230_c() == this ? (BlockRailBase.EnumRailDirection)p_185496_1_.func_177229_b(this.func_176560_l()) : null; -+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = p_185496_1_.func_177230_c() == this ? getRailDirection(p_185496_2_, p_185496_3_, p_185496_1_, null) : null; - return blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.func_177018_c() ? field_190959_b : field_185590_a; - } - -@@ -73,7 +73,7 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q(); -+ return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP); - } - - public void func_176213_c(World p_176213_1_, BlockPos p_176213_2_, IBlockState p_176213_3_) -@@ -93,27 +93,27 @@ - { - if (!p_189540_2_.field_72995_K) - { -- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_189540_1_.func_177229_b(this.func_176560_l()); -+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = getRailDirection(p_189540_2_, p_189540_3_, p_189540_2_.func_180495_p(p_189540_3_), null); - boolean flag = false; - -- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q()) -+ if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).isSideSolid(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP)) - { - flag = true; - } - -- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).func_185896_q()) -+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_189540_2_.func_180495_p(p_189540_3_.func_177974_f()).isSideSolid(p_189540_2_, p_189540_3_.func_177974_f(), EnumFacing.UP)) - { - flag = true; - } -- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).func_185896_q()) -+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_189540_2_.func_180495_p(p_189540_3_.func_177976_e()).isSideSolid(p_189540_2_, p_189540_3_.func_177976_e(), EnumFacing.UP)) - { - flag = true; - } -- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).func_185896_q()) -+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177978_c()).isSideSolid(p_189540_2_, p_189540_3_.func_177978_c(), EnumFacing.UP)) - { - flag = true; - } -- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).func_185896_q()) -+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_189540_2_.func_180495_p(p_189540_3_.func_177968_d()).isSideSolid(p_189540_2_, p_189540_3_.func_177968_d(), EnumFacing.UP)) - { - flag = true; - } -@@ -154,7 +154,7 @@ - { - super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); - -- if (((BlockRailBase.EnumRailDirection)p_180663_3_.func_177229_b(this.func_176560_l())).func_177018_c()) -+ if (getRailDirection(p_180663_1_, p_180663_2_, p_180663_3_, null).func_177018_c()) - { - p_180663_1_.func_175685_c(p_180663_2_.func_177984_a(), this, false); - } -@@ -166,8 +166,101 @@ - } - } - -+ //Forge: Use getRailDirection(IBlockAccess, BlockPos, IBlockState, EntityMinecart) for enhanced ability - public abstract IProperty func_176560_l(); - -+ /* ======================================== FORGE START =====================================*/ -+ /** -+ * Return true if the rail can make corners. -+ * Used by placement logic. -+ * @param world The world. -+ * @param pos Block's position in world -+ * @return True if the rail can make corners. -+ */ -+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos) -+ { -+ return !this.field_150053_a; -+ } -+ -+ /** -+ * Returns true if the rail can make up and down slopes. -+ * Used by placement logic. -+ * @param world The world. -+ * @param pos Block's position in world -+ * @return True if the rail can make slopes. -+ */ -+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos) -+ { -+ return true; -+ } -+ -+ /** -+ * Return the rail's direction. -+ * Can be used to make the cart think the rail is a different shape, -+ * for example when making diamond junctions or switches. -+ * The cart parameter will often be null unless it it called from EntityMinecart. -+ * -+ * @param world The world. -+ * @param pos Block's position in world -+ * @param state The BlockState -+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart. -+ * @return The direction. -+ */ -+ public EnumRailDirection getRailDirection(IBlockAccess world, BlockPos pos, IBlockState state, @javax.annotation.Nullable net.minecraft.entity.item.EntityMinecart cart) -+ { -+ return state.func_177229_b(func_176560_l()); -+ } -+ -+ /** -+ * Returns the max speed of the rail at the specified position. -+ * @param world The world. -+ * @param cart The cart on the rail, may be null. -+ * @param pos Block's position in world -+ * @return The max speed of the current rail. -+ */ -+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos) -+ { -+ return 0.4f; -+ } -+ -+ /** -+ * This function is called by any minecart that passes over this rail. -+ * It is called once per update tick that the minecart is on the rail. -+ * @param world The world. -+ * @param cart The cart on the rail. -+ * @param pos Block's position in world -+ */ -+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos) -+ { -+ } -+ -+ /** -+ * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit). -+ * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the -+ * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations. -+ * The method should return true if the rotation was successful though. -+ * -+ * @param world The world -+ * @param pos Block position in world -+ * @param axis The axis to rotate around -+ * @return True if the rotation was successful, False if the rotation failed, or is not possible -+ */ -+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ for (IProperty prop : state.func_177228_b().keySet()) -+ { -+ if (prop.func_177701_a().equals("shape")) -+ { -+ world.func_175656_a(pos, state.func_177231_a(prop)); -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ /* ======================================== FORGE END =====================================*/ -+ - public static enum EnumRailDirection implements IStringSerializable - { - NORTH_SOUTH(0, "north_south"), -@@ -238,6 +331,7 @@ - private IBlockState field_180366_e; - private final boolean field_150656_f; - private final List field_150657_g = Lists.newArrayList(); -+ private final boolean canMakeSlopes; - - public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_) - { -@@ -245,8 +339,9 @@ - this.field_180367_c = p_i45739_3_; - this.field_180366_e = p_i45739_4_; - this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c(); -- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(this.field_180365_d.func_176560_l()); -- this.field_150656_f = this.field_180365_d.field_150053_a; -+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = field_180365_d.getRailDirection(p_i45739_2_, p_i45739_3_, p_i45739_4_, null); -+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_); -+ this.canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_); - this.func_180360_a(blockrailbase$enumraildirection); - } - -@@ -438,7 +533,7 @@ - } - } - -- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) -+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes) - { - if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a())) - { -@@ -451,7 +546,7 @@ - } - } - -- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) -+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes) - { - if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a())) - { -@@ -594,7 +689,7 @@ - } - } - -- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) -+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes) - { - if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a())) - { -@@ -607,7 +702,7 @@ - } - } - -- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) -+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes) - { - if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a())) - { diff --git a/patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch b/patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch deleted file mode 100644 index e65cfd400f..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRailDetector.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRailDetector.java -@@ -163,6 +163,8 @@ - { - if (((Boolean)p_180641_1_.func_177229_b(field_176574_M)).booleanValue()) - { -+ List carts = this.func_176571_a(p_180641_2_, p_180641_3_, EntityMinecart.class); -+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel(); - List list = this.func_176571_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class); - - if (!list.isEmpty()) diff --git a/patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch b/patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch deleted file mode 100644 index bd799f5318..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRailPowered.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRailPowered.java -@@ -23,9 +23,17 @@ - }); - public static final PropertyBool field_176569_M = PropertyBool.func_177716_a("powered"); - -+ private final boolean isActivator; -+ - protected BlockRailPowered() - { -+ this(false); -+ } -+ -+ protected BlockRailPowered(boolean isActivator) -+ { - super(true); -+ this.isActivator = isActivator; - this.func_180632_j(this.field_176227_L.func_177621_b().func_177226_a(field_176568_b, BlockRailBase.EnumRailDirection.NORTH_SOUTH).func_177226_a(field_176569_M, Boolean.valueOf(false))); - } - -@@ -146,7 +154,7 @@ - { - IBlockState iblockstate = p_176567_1_.func_180495_p(p_176567_2_); - -- if (iblockstate.func_177230_c() != this) -+ if (!(iblockstate.func_177230_c() instanceof BlockRailPowered) || isActivator != ((BlockRailPowered)iblockstate.func_177230_c()).isActivator) - { - return false; - } diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch deleted file mode 100644 index 17ae29a103..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java -@@ -319,6 +319,21 @@ - return this.func_176223_P().func_177226_a(field_185512_D, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE); - } - -+ @Override -+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) -+ { -+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World && !((World) world).field_72995_K) -+ { -+ func_189540_a(world.func_180495_p(pos), (World)world, pos, world.func_180495_p(neighbor).func_177230_c(), neighbor); -+ } -+ } -+ -+ @Override -+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos) -+ { -+ return true; -+ } -+ - public static enum Mode implements IStringSerializable - { - COMPARE("compare"), diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch deleted file mode 100644 index d42edf6769..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java -@@ -39,12 +39,14 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() ? super.func_176196_c(p_176196_1_, p_176196_2_) : false; -+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); -+ return (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID) ? super.func_176196_c(p_176196_1_, p_176196_2_) : false; - } - - public boolean func_176409_d(World p_176409_1_, BlockPos p_176409_2_) - { -- return p_176409_1_.func_180495_p(p_176409_2_.func_177977_b()).func_185896_q(); -+ IBlockState downState = p_176409_1_.func_180495_p(p_176409_2_.func_177977_b()); -+ return downState.func_185896_q() || downState.func_193401_d(p_176409_1_, p_176409_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID; - } - - public void func_180645_a(World p_180645_1_, BlockPos p_180645_2_, IBlockState p_180645_3_, Random p_180645_4_) -@@ -227,6 +229,8 @@ - { - EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_185512_D); - BlockPos blockpos = p_176400_2_.func_177972_a(enumfacing.func_176734_d()); -+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(p_176400_1_, p_176400_2_, p_176400_1_.func_180495_p(p_176400_2_), java.util.EnumSet.of(enumfacing.func_176734_d()), false).isCanceled()) -+ return; - p_176400_1_.func_190524_a(blockpos, this, p_176400_2_); - p_176400_1_.func_175695_a(blockpos, this, enumfacing); - } -@@ -307,6 +311,25 @@ - return BlockRenderLayer.CUTOUT; - } - -+ /* ======================================== FORGE START =====================================*/ -+ @Override -+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) -+ { -+ if (super.rotateBlock(world, pos, axis)) -+ { -+ IBlockState state = world.func_180495_p(pos); -+ state = func_180675_k(state); -+ world.func_175656_a(pos, state); -+ -+ if (func_176404_e(world, pos, state)) -+ { -+ world.func_175684_a(pos, this, 1); -+ } -+ return true; -+ } -+ return false; -+ } -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return p_193383_4_ == EnumFacing.DOWN ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch deleted file mode 100644 index 7762d1ea3c..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java -@@ -92,12 +92,16 @@ - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { - super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); -+ } - -- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this)) -+ @Override -+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) -+ { -+ if (this.func_180660_a(state, RANDOM, fortune) != Item.func_150898_a(this)) - { -- int i = 1 + p_180653_1_.field_73012_v.nextInt(5); -- this.func_180637_b(p_180653_1_, p_180653_2_, i); -+ return 1 + RANDOM.nextInt(5); - } -+ return 0; - } - - @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch deleted file mode 100644 index e7d19abe32..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRedstoneTorch.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneTorch.java -@@ -23,7 +23,7 @@ - - public class BlockRedstoneTorch extends BlockTorch - { -- private static final Map> field_150112_b = Maps.>newHashMap(); -+ private static final Map> field_150112_b = new java.util.WeakHashMap>(); // FORGE - fix vanilla MC-101233 - private final boolean field_150113_a; - - private boolean func_176598_a(World p_176598_1_, BlockPos p_176598_2_, boolean p_176598_3_) diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch deleted file mode 100644 index 7498cb84df..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java -@@ -99,15 +99,15 @@ - BlockPos blockpos = p_176341_2_.func_177972_a(p_176341_3_); - IBlockState iblockstate = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)); - -- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos), p_176341_3_) && (iblockstate.func_185915_l() || !func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177977_b())))) -+ if (!canConnectTo(p_176341_1_.func_180495_p(blockpos), p_176341_3_, p_176341_1_, blockpos) && (iblockstate.func_185915_l() || !func_176340_e(p_176341_1_, blockpos.func_177977_b()))) - { - IBlockState iblockstate1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()); - - if (!iblockstate1.func_185915_l()) - { -- boolean flag = p_176341_1_.func_180495_p(blockpos).func_185896_q() || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN; -+ boolean flag = p_176341_1_.func_180495_p(blockpos).isSideSolid(p_176341_1_, blockpos, EnumFacing.UP) || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN; - -- if (flag && func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177984_a()))) -+ if (flag && func_176340_e(p_176341_1_, blockpos.func_177984_a())) - { - if (iblockstate.func_185898_k()) - { -@@ -144,7 +144,8 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() || p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c() == Blocks.field_150426_aN; -+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); -+ return downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID || p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c() == Blocks.field_150426_aN; - } - - private IBlockState func_176338_e(World p_176338_1_, BlockPos p_176338_2_, IBlockState p_176338_3_) -@@ -414,7 +415,7 @@ - { - return true; - } -- else if (func_176343_a(iblockstate, p_176339_3_)) -+ else if (canConnectTo(iblockstate, p_176339_3_, p_176339_1_, p_176339_2_)) - { - return true; - } -@@ -430,16 +431,11 @@ - - protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_) - { -- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_)); -+ return canConnectTo(p_176340_0_.func_180495_p(p_176340_1_), null, p_176340_0_, p_176340_1_); - } - -- protected static boolean func_176346_d(IBlockState p_176346_0_) -+ protected static boolean canConnectTo(IBlockState p_176343_0_, @Nullable EnumFacing p_176343_1_, IBlockAccess world, BlockPos pos) - { -- return func_176343_a(p_176346_0_, (EnumFacing)null); -- } -- -- protected static boolean func_176343_a(IBlockState p_176343_0_, @Nullable EnumFacing p_176343_1_) -- { - Block block = p_176343_0_.func_177230_c(); - - if (block == Blocks.field_150488_af) -@@ -457,7 +453,7 @@ - } - else - { -- return p_176343_0_.func_185897_m() && p_176343_1_ != null; -+ return p_176343_0_.func_177230_c().canConnectRedstone(p_176343_0_, world, pos, p_176343_1_); - } - } - diff --git a/patches/minecraft/net/minecraft/block/BlockReed.java.patch b/patches/minecraft/net/minecraft/block/BlockReed.java.patch deleted file mode 100644 index 7cfa88f625..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockReed.java.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockReed.java -+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java -@@ -21,7 +21,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public class BlockReed extends Block -+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable - { - public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15); - protected static final AxisAlignedBB field_185701_b = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D); -@@ -55,6 +55,8 @@ - { - int j = ((Integer)p_180650_3_.func_177229_b(field_176355_a)).intValue(); - -+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, true)) -+ { - if (j == 15) - { - p_180650_1_.func_175656_a(p_180650_2_.func_177984_a(), this.func_176223_P()); -@@ -64,6 +66,8 @@ - { - p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_.func_177226_a(field_176355_a, Integer.valueOf(j + 1)), 4); - } -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_)); -+ } - } - } - } -@@ -71,7 +75,9 @@ - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) - { -- Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c(); -+ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); -+ Block block = state.func_177230_c(); -+ if (block.canSustainPlant(state, p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP, this)) return true; - - if (block == this) - { -@@ -165,6 +171,17 @@ - return ((Integer)p_176201_1_.func_177229_b(field_176355_a)).intValue(); - } - -+ @Override -+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) -+ { -+ return net.minecraftforge.common.EnumPlantType.Beach; -+ } -+ @Override -+ public IBlockState getPlant(IBlockAccess world, BlockPos pos) -+ { -+ return this.func_176223_P(); -+ } -+ - protected BlockStateContainer func_180661_e() - { - return new BlockStateContainer(this, new IProperty[] {field_176355_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch b/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch deleted file mode 100644 index d4e280aaf8..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockRotatedPillar.java -+++ ../src-work/minecraft/net/minecraft/block/BlockRotatedPillar.java -@@ -28,6 +28,21 @@ - super(p_i46385_1_, p_i46385_2_); - } - -+ @Override -+ public boolean rotateBlock(net.minecraft.world.World world, BlockPos pos, EnumFacing axis) -+ { -+ net.minecraft.block.state.IBlockState state = world.func_180495_p(pos); -+ for (net.minecraft.block.properties.IProperty prop : state.func_177228_b().keySet()) -+ { -+ if (prop.func_177701_a().equals("axis")) -+ { -+ world.func_175656_a(pos, state.func_177231_a(prop)); -+ return true; -+ } -+ } -+ return false; -+ } -+ - public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_) - { - switch (p_185499_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch deleted file mode 100644 index 059accce70..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockSapling.java -+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java -@@ -53,6 +53,7 @@ - { - super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_); - -+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light - if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) >= 9 && p_180650_4_.nextInt(7) == 0) - { - this.func_176478_d(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_); -@@ -74,6 +75,7 @@ - - public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_) - { -+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_176476_1_, p_176476_4_, p_176476_2_)) return; - WorldGenerator worldgenerator = (WorldGenerator)(p_176476_4_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true)); - int i = 0; - int j = 0; diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch deleted file mode 100644 index ffcd2b8eaf..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockSkull.java -+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java -@@ -128,10 +128,6 @@ - return new ItemStack(Items.field_151144_bL, 1, i); - } - -- public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) -- { -- } -- - public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_) - { - if (p_176208_4_.field_71075_bZ.field_75098_d) -@@ -139,13 +135,17 @@ - p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true)); - p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4); - } -+ this.func_176226_b(p_176208_1_, p_176208_2_, p_176208_3_, 0); - - super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_); - } - - public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) - { -- if (!p_180663_1_.field_72995_K) -+ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); -+ } -+ public void getDrops(net.minecraft.util.NonNullList drops, IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune) -+ { - { - if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue()) - { -@@ -154,7 +154,7 @@ - if (tileentity instanceof TileEntitySkull) - { - TileEntitySkull tileentityskull = (TileEntitySkull)tileentity; -- ItemStack itemstack = this.func_185473_a(p_180663_1_, p_180663_2_, p_180663_3_); -+ ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a()); - - if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null) - { -@@ -164,11 +164,9 @@ - itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound); - } - -- func_180635_a(p_180663_1_, p_180663_2_, itemstack); -+ drops.add(itemstack); - } - } -- -- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); - } - } - diff --git a/patches/minecraft/net/minecraft/block/BlockSlab.java.patch b/patches/minecraft/net/minecraft/block/BlockSlab.java.patch deleted file mode 100644 index 2b1c6a50d7..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockSlab.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch deleted file mode 100644 index a4fa871d31..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockSnow.java -+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java -@@ -85,7 +85,7 @@ - if (block != Blocks.field_150432_aD && block != Blocks.field_150403_cj && block != Blocks.field_180401_cv) - { - BlockFaceShape blockfaceshape = iblockstate.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP); -- return blockfaceshape == BlockFaceShape.SOLID || iblockstate.func_185904_a() == Material.field_151584_j || block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 8; -+ return blockfaceshape == BlockFaceShape.SOLID || iblockstate.func_177230_c().isLeaves(iblockstate, p_176196_1_, p_176196_2_.func_177977_b()) || block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 8; - } - else - { -@@ -102,7 +102,6 @@ - { - if (!this.func_176196_c(p_176314_1_, p_176314_2_)) - { -- this.func_176226_b(p_176314_1_, p_176314_2_, p_176314_3_, 0); - p_176314_1_.func_175698_g(p_176314_2_); - return false; - } -@@ -114,9 +113,8 @@ - - public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) - { -- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, ((Integer)p_180657_4_.func_177229_b(field_176315_a)).intValue() + 1, 0)); -+ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_); - p_180657_1_.func_175698_g(p_180657_3_); -- p_180657_2_.func_71029_a(StatList.func_188055_a(this)); - } - - public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) -@@ -126,14 +124,13 @@ - - public int func_149745_a(Random p_149745_1_) - { -- return 0; -+ return 1; - } - - 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_175642_b(EnumSkyBlock.BLOCK, p_180650_2_) > 11) - { -- this.func_176226_b(p_180650_1_, p_180650_2_, p_180650_1_.func_180495_p(p_180650_2_), 0); - p_180650_1_.func_175698_g(p_180650_2_); - } - } -@@ -167,6 +164,8 @@ - return ((Integer)p_176201_1_.func_177229_b(field_176315_a)).intValue() - 1; - } - -+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; } -+ - protected BlockStateContainer func_180661_e() - { - return new BlockStateContainer(this, new IProperty[] {field_176315_a}); diff --git a/patches/minecraft/net/minecraft/block/BlockStairs.java.patch b/patches/minecraft/net/minecraft/block/BlockStairs.java.patch deleted file mode 100644 index 648edc76da..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockStairs.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockStaticLiquid.java.patch b/patches/minecraft/net/minecraft/block/BlockStaticLiquid.java.patch deleted file mode 100644 index 20d78abaed..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockStaticLiquid.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch deleted file mode 100644 index 34ee16bea7..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockStem.java -+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java -@@ -66,18 +66,19 @@ - { - super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_); - -+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light - if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) >= 9) - { - float f = BlockCrops.func_180672_a(this, p_180650_1_, p_180650_2_); - -- if (p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0) -+ if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_.nextInt((int)(25.0F / f) + 1) == 0)) - { - int i = ((Integer)p_180650_3_.func_177229_b(field_176484_a)).intValue(); - - if (i < 7) - { -- p_180650_3_ = p_180650_3_.func_177226_a(field_176484_a, Integer.valueOf(i + 1)); -- p_180650_1_.func_180501_a(p_180650_2_, p_180650_3_, 2); -+ IBlockState newState = p_180650_3_.func_177226_a(field_176484_a, Integer.valueOf(i + 1)); -+ p_180650_1_.func_180501_a(p_180650_2_, newState, 2); - } - else - { -@@ -90,13 +91,15 @@ - } - - p_180650_2_ = p_180650_2_.func_177972_a(EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180650_4_)); -- Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c(); -+ IBlockState soil = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()); -+ Block block = soil.func_177230_c(); - -- if (p_180650_1_.func_180495_p(p_180650_2_).func_177230_c().field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) -+ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(soil, p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) - { - p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P()); - } - } -+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_1_.func_180495_p(p_180650_2_)); - } - } - } -@@ -110,20 +113,23 @@ - public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { - super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); -+ } - -- if (!p_180653_1_.field_72995_K) -+ @Override -+ public void getDrops(net.minecraft.util.NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { - { - Item item = this.func_176481_j(); - - if (item != null) - { -- int i = ((Integer)p_180653_3_.func_177229_b(field_176484_a)).intValue(); -+ int i = ((Integer)state.func_177229_b(field_176484_a)).intValue(); - - for (int j = 0; j < 3; ++j) - { -- if (p_180653_1_.field_73012_v.nextInt(15) <= i) -+ if (RANDOM.nextInt(15) <= i) - { -- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item)); -+ drops.add(new ItemStack(item)); - } - } - } diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch deleted file mode 100644 index bdf356ff84..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java -+++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java -@@ -22,7 +22,7 @@ - import net.minecraft.world.IBlockAccess; - import net.minecraft.world.World; - --public class BlockTallGrass extends BlockBush implements IGrowable -+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable - { - public static final PropertyEnum field_176497_a = PropertyEnum.func_177709_a("type", BlockTallGrass.EnumType.class); - protected static final AxisAlignedBB field_185522_c = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D); -@@ -40,7 +40,7 @@ - - public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) - { -- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b())); -+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); - } - - public boolean func_176200_f(IBlockAccess p_176200_1_, BlockPos p_176200_2_) -@@ -50,7 +50,7 @@ - - public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) - { -- return p_180660_2_.nextInt(8) == 0 ? Items.field_151014_N : Items.field_190931_a; -+ return null; - } - - public int func_149679_a(int p_149679_1_, Random p_149679_2_) -@@ -178,4 +178,19 @@ - } - } - } -+ -+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } -+ @Override -+ public NonNullList onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return NonNullList.func_191197_a(1, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)world.func_180495_p(pos).func_177229_b(field_176497_a)).func_177044_a())); -+ } -+ @Override -+ public void getDrops(NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) -+ { -+ if (RANDOM.nextInt(8) != 0) return; -+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM, fortune); -+ if (!seed.func_190926_b()) -+ drops.add(seed); -+ } - } diff --git a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch deleted file mode 100644 index 7bba682565..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockTorch.java -+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java -@@ -82,18 +82,8 @@ - - private boolean func_176594_d(World p_176594_1_, BlockPos p_176594_2_) - { -- Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c(); -- boolean flag = block == Blocks.field_185775_db || block == Blocks.field_150428_aP; -- -- if (p_176594_1_.func_180495_p(p_176594_2_).func_185896_q()) -- { -- return !flag; -- } -- else -- { -- boolean flag1 = block instanceof BlockFence || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_150399_cn; -- return flag1 && !flag; -- } -+ IBlockState state = p_176594_1_.func_180495_p(p_176594_2_); -+ return state.func_177230_c().canPlaceTorchOnTop(state, p_176594_1_, p_176594_2_); - } - - public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch deleted file mode 100644 index f67ffbb68d..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java -+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java -@@ -250,6 +250,18 @@ - return (p_193383_4_ == EnumFacing.UP && p_193383_2_.func_177229_b(field_176285_M) == BlockTrapDoor.DoorHalf.TOP || p_193383_4_ == EnumFacing.DOWN && p_193383_2_.func_177229_b(field_176285_M) == BlockTrapDoor.DoorHalf.BOTTOM) && !((Boolean)p_193383_2_.func_177229_b(field_176283_b)).booleanValue() ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; - } - -+ @Override -+ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) -+ { -+ if (state.func_177229_b(field_176283_b)) -+ { -+ IBlockState down = world.func_180495_p(pos.func_177977_b()); -+ if (down.func_177230_c() == net.minecraft.init.Blocks.field_150468_ap) -+ return down.func_177229_b(BlockLadder.field_176382_a) == state.func_177229_b(field_176284_a); -+ } -+ return false; -+ } -+ - public static enum DoorHalf implements IStringSerializable - { - TOP("top"), diff --git a/patches/minecraft/net/minecraft/block/BlockVine.java.patch b/patches/minecraft/net/minecraft/block/BlockVine.java.patch deleted file mode 100644 index b6860d87a4..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockVine.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockVine.java -+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java -@@ -28,7 +28,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public class BlockVine extends Block -+public class BlockVine extends Block implements net.minecraftforge.common.IShearable - { - public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up"); - public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north"); -@@ -185,7 +185,7 @@ - { - if (!p_180650_1_.field_72995_K) - { -- if (p_180650_1_.field_73012_v.nextInt(4) == 0) -+ if (p_180650_1_.field_73012_v.nextInt(4) == 0 && p_180650_1_.func_175697_a(p_180650_2_, 4)) // Forge: check area to prevent loading unloaded chunks - { - int i = 4; - int j = 5; -@@ -244,7 +244,7 @@ - IBlockState iblockstate3 = p_180650_1_.func_180495_p(blockpos4); - Block block1 = iblockstate3.func_177230_c(); - -- if (block1.field_149764_J == Material.field_151579_a) -+ if (block1.isAir(iblockstate3, p_180650_1_, blockpos4)) - { - EnumFacing enumfacing3 = enumfacing1.func_176746_e(); - EnumFacing enumfacing4 = enumfacing1.func_176735_f(); -@@ -459,7 +459,17 @@ - - return i; - } -+ /*************************FORGE START***********************************/ -+ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; } -+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } -+ @Override -+ public java.util.List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) -+ { -+ return java.util.Arrays.asList(new ItemStack(this, 1)); -+ } -+ /*************************FORGE END***********************************/ - -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return BlockFaceShape.UNDEFINED; diff --git a/patches/minecraft/net/minecraft/block/BlockWall.java.patch b/patches/minecraft/net/minecraft/block/BlockWall.java.patch deleted file mode 100644 index c43465fdf4..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockWall.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockWall.java -+++ ../src-work/minecraft/net/minecraft/block/BlockWall.java -@@ -159,10 +159,10 @@ - - public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_) - { -- boolean flag = this.func_176253_e(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH); -- boolean flag1 = this.func_176253_e(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST); -- boolean flag2 = this.func_176253_e(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH); -- boolean flag3 = this.func_176253_e(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST); -+ boolean flag = canWallConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH); -+ boolean flag1 = canWallConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST); -+ boolean flag2 = canWallConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH); -+ boolean flag3 = canWallConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST); - boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3; - return p_176221_1_.func_177226_a(field_176256_a, Boolean.valueOf(!flag4 || !p_176221_2_.func_175623_d(p_176221_3_.func_177984_a()))).func_177226_a(field_176254_b, Boolean.valueOf(flag)).func_177226_a(field_176257_M, Boolean.valueOf(flag1)).func_177226_a(field_176258_N, Boolean.valueOf(flag2)).func_177226_a(field_176259_O, Boolean.valueOf(flag3)); - } -@@ -177,6 +177,23 @@ - return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE_THICK : BlockFaceShape.CENTER_BIG; - } - -+ /* ======================================== FORGE START ======================================== */ -+ -+ @Override -+ public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) -+ { -+ return func_176253_e(world, pos.func_177972_a(facing), facing.func_176734_d()); -+ } -+ -+ private boolean canWallConnectTo(IBlockAccess world, BlockPos pos, EnumFacing facing) -+ { -+ BlockPos other = pos.func_177972_a(facing); -+ Block block = world.func_180495_p(other).func_177230_c(); -+ return block.canBeConnectedTo(world, other, facing.func_176734_d()) || func_176253_e(world, other, facing.func_176734_d()); -+ } -+ -+ /* ======================================== FORGE END ======================================== */ -+ - public static enum EnumType implements IStringSerializable - { - NORMAL(0, "cobblestone", "normal"), diff --git a/patches/minecraft/net/minecraft/block/BlockWeb.java.patch b/patches/minecraft/net/minecraft/block/BlockWeb.java.patch deleted file mode 100644 index 822fdbf495..0000000000 --- a/patches/minecraft/net/minecraft/block/BlockWeb.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/BlockWeb.java -+++ ../src-work/minecraft/net/minecraft/block/BlockWeb.java -@@ -22,7 +22,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public class BlockWeb extends Block -+public class BlockWeb extends Block implements net.minecraftforge.common.IShearable - { - public BlockWeb() - { -@@ -80,6 +80,12 @@ - } - } - -+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos) { return true; } -+ @Override -+ public java.util.List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { -+ return com.google.common.collect.Lists.newArrayList(new ItemStack(Item.func_150898_a(this))); -+ } -+ - public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) - { - return BlockFaceShape.UNDEFINED; diff --git a/patches/minecraft/net/minecraft/block/SoundType.java.patch b/patches/minecraft/net/minecraft/block/SoundType.java.patch deleted file mode 100644 index 6afc1d3917..0000000000 --- a/patches/minecraft/net/minecraft/block/SoundType.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/SoundType.java -+++ ../src-work/minecraft/net/minecraft/block/SoundType.java -@@ -48,7 +48,6 @@ - return this.field_185861_n; - } - -- @SideOnly(Side.CLIENT) - public SoundEvent func_185845_c() - { - return this.field_185862_o; -@@ -64,7 +63,6 @@ - return this.field_185864_q; - } - -- @SideOnly(Side.CLIENT) - public SoundEvent func_185846_f() - { - return this.field_185865_r; diff --git a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch b/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch deleted file mode 100644 index 0637b21ec5..0000000000 --- a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java -+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java -@@ -65,7 +65,7 @@ - { - BlockPos blockpos = this.field_177258_e.get(i); - -- if (this.field_177261_a.func_180495_p(blockpos).func_177230_c() == Blocks.field_180399_cE && !this.func_177250_b(blockpos)) -+ if (this.field_177261_a.func_180495_p(blockpos).func_177230_c().isStickyBlock(this.field_177261_a.func_180495_p(blockpos)) && !this.func_177250_b(blockpos)) - { - return false; - } -@@ -80,7 +80,7 @@ - IBlockState iblockstate = this.field_177261_a.func_180495_p(p_177251_1_); - Block block = iblockstate.func_177230_c(); - -- if (iblockstate.func_185904_a() == Material.field_151579_a) -+ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, p_177251_1_)) - { - return true; - } -@@ -106,13 +106,13 @@ - } - else - { -- while (block == Blocks.field_180399_cE) -+ while (block.isStickyBlock(iblockstate)) - { - BlockPos blockpos = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i); - iblockstate = this.field_177261_a.func_180495_p(blockpos); - block = iblockstate.func_177230_c(); - -- if (iblockstate.func_185904_a() == Material.field_151579_a || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) -+ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, blockpos) || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) - { - break; - } -@@ -148,7 +148,7 @@ - { - BlockPos blockpos2 = this.field_177258_e.get(l); - -- if (this.field_177261_a.func_180495_p(blockpos2).func_177230_c() == Blocks.field_180399_cE && !this.func_177250_b(blockpos2)) -+ if (this.field_177261_a.func_180495_p(blockpos2).func_177230_c().isStickyBlock(this.field_177261_a.func_180495_p(blockpos2)) && !this.func_177250_b(blockpos2)) - { - return false; - } -@@ -159,7 +159,7 @@ - - iblockstate = this.field_177261_a.func_180495_p(blockpos1); - -- if (iblockstate.func_185904_a() == Material.field_151579_a) -+ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, blockpos1)) - { - return true; - } diff --git a/patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch b/patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch deleted file mode 100644 index ac50e35e7a..0000000000 --- a/patches/minecraft/net/minecraft/block/state/BlockStateBase.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/state/BlockStateBase.java -+++ ../src-work/minecraft/net/minecraft/block/state/BlockStateBase.java -@@ -73,4 +73,10 @@ - - return stringbuilder.toString(); - } -+ -+ @Nullable -+ public com.google.common.collect.ImmutableTable, Comparable, IBlockState> getPropertyValueTable() -+ { -+ return null; -+ } - } diff --git a/patches/minecraft/net/minecraft/block/state/BlockStateContainer.java.patch b/patches/minecraft/net/minecraft/block/state/BlockStateContainer.java.patch deleted file mode 100644 index d9d4e4a65d..0000000000 --- a/patches/minecraft/net/minecraft/block/state/BlockStateContainer.java.patch +++ /dev/null @@ -1,146 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/state/BlockStateContainer.java -+++ ../src-work/minecraft/net/minecraft/block/state/BlockStateContainer.java -@@ -59,12 +59,22 @@ - - public BlockStateContainer(Block p_i45663_1_, IProperty... p_i45663_2_) - { -- this.field_177627_c = p_i45663_1_; -+ this(p_i45663_1_, p_i45663_2_, null); -+ } -+ -+ protected StateImplementation createState(Block block, ImmutableMap, Comparable> properties, @Nullable ImmutableMap, java.util.Optional> unlistedProperties) -+ { -+ return new StateImplementation(block, properties); -+ } -+ -+ protected BlockStateContainer(Block blockIn, IProperty[] properties, ImmutableMap, java.util.Optional> unlistedProperties) -+ { -+ this.field_177627_c = blockIn; - Map < String, IProperty> map = Maps. < String, IProperty> newHashMap(); - -- for (IProperty iproperty : p_i45663_2_) -+ for (IProperty iproperty : properties) - { -- func_185919_a(p_i45663_1_, iproperty); -+ func_185919_a(blockIn, iproperty); - map.put(iproperty.func_177701_a(), iproperty); - } - -@@ -75,7 +85,7 @@ - for (List < Comparable> list : Cartesian.func_179321_a(this.func_177620_e())) - { - Map < IProperty, Comparable> map1 = MapPopulator. < IProperty, Comparable> func_179400_b(this.field_177624_d.values(), list); -- BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation = new BlockStateContainer.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map1)); -+ BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation = createState(blockIn, ImmutableMap.copyOf(map1), unlistedProperties); - map2.put(map1, blockstatecontainer$stateimplementation); - list1.add(blockstatecontainer$stateimplementation); - } -@@ -170,6 +180,13 @@ - this.field_177237_b = p_i45660_2_; - } - -+ protected StateImplementation(Block blockIn, ImmutableMap, Comparable> propertiesIn, ImmutableTable, Comparable, IBlockState> propertyValueTable) -+ { -+ this.field_177239_a = blockIn; -+ this.field_177237_b = propertiesIn; -+ this.field_177238_c = propertyValueTable; -+ } -+ - public Collection < IProperty> func_177227_a() - { - return Collections. < IProperty> unmodifiableCollection(this.field_177237_b.keySet()); -@@ -473,5 +490,94 @@ - { - return this.field_177239_a.func_193383_a(p_193401_1_, this, p_193401_2_, p_193401_3_); - } -+ -+ //Forge Start -+ @Override -+ public ImmutableTable, Comparable, IBlockState> getPropertyValueTable() -+ { -+ return field_177238_c; -+ } -+ -+ @Override -+ public int getLightOpacity(IBlockAccess world, BlockPos pos) -+ { -+ return this.field_177239_a.getLightOpacity(this, world, pos); -+ } -+ -+ @Override -+ public int getLightValue(IBlockAccess world, BlockPos pos) -+ { -+ return this.field_177239_a.getLightValue(this, world, pos); -+ } -+ -+ @Override -+ public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) -+ { -+ return this.field_177239_a.isSideSolid(this, world, pos, side); -+ } -+ -+ @Override -+ public boolean doesSideBlockChestOpening(IBlockAccess world, BlockPos pos, EnumFacing side) -+ { -+ return this.field_177239_a.doesSideBlockChestOpening(this, world, pos, side); -+ } -+ -+ @Override -+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side) -+ { -+ return this.field_177239_a.doesSideBlockRendering(this, world, pos, side); -+ } - } -+ -+ /** -+ * Forge added class to make building things easier. -+ * Will return an instance of BlockStateContainer appropriate for -+ * the list of properties passed in. -+ * -+ * Example usage: -+ * -+ * protected BlockStateContainer createBlockState() -+ * { -+ * return (new BlockStateContainer.Builder(this)).add(FACING).add(SOME_UNLISTED).build(); -+ * } -+ * -+ */ -+ public static class Builder -+ { -+ private final Block block; -+ private final List> listed = Lists.newArrayList(); -+ private final List> unlisted = Lists.newArrayList(); -+ -+ public Builder(Block block) -+ { -+ this.block = block; -+ } -+ -+ public Builder add(IProperty... props) -+ { -+ for (IProperty prop : props) -+ this.listed.add(prop); -+ return this; -+ } -+ -+ public Builder add(net.minecraftforge.common.property.IUnlistedProperty... props) -+ { -+ for (net.minecraftforge.common.property.IUnlistedProperty prop : props) -+ this.unlisted.add(prop); -+ return this; -+ } -+ -+ public BlockStateContainer build() -+ { -+ IProperty[] listed = new IProperty[this.listed.size()]; -+ listed = this.listed.toArray(listed); -+ if (this.unlisted.size() == 0) -+ return new BlockStateContainer(this.block, listed); -+ -+ net.minecraftforge.common.property.IUnlistedProperty[] unlisted = new net.minecraftforge.common.property.IUnlistedProperty[this.unlisted.size()]; -+ unlisted = this.unlisted.toArray(unlisted); -+ -+ return new net.minecraftforge.common.property.ExtendedBlockState(this.block, listed, unlisted); -+ } -+ } - } diff --git a/patches/minecraft/net/minecraft/block/state/IBlockProperties.java.patch b/patches/minecraft/net/minecraft/block/state/IBlockProperties.java.patch deleted file mode 100644 index f5e322e139..0000000000 --- a/patches/minecraft/net/minecraft/block/state/IBlockProperties.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/block/state/IBlockProperties.java -+++ ../src-work/minecraft/net/minecraft/block/state/IBlockProperties.java -@@ -28,9 +28,13 @@ - - boolean func_189884_a(Entity p_189884_1_); - -+ @Deprecated //Forge location aware version below - int func_185891_c(); -+ int getLightOpacity(IBlockAccess world, BlockPos pos); - -+ @Deprecated //Forge location aware version below - int func_185906_d(); -+ int getLightValue(IBlockAccess world, BlockPos pos); - - @SideOnly(Side.CLIENT) - boolean func_185895_e(); -@@ -95,8 +99,14 @@ - - RayTraceResult func_185910_a(World p_185910_1_, BlockPos p_185910_2_, Vec3d p_185910_3_, Vec3d p_185910_4_); - -+ @Deprecated // Forge: Use isSideSolid(IBlockAccess, BlockPos, EnumFacing.UP) instead - boolean func_185896_q(); - -+ //Forge added functions -+ boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side); -+ boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side); -+ boolean doesSideBlockChestOpening(IBlockAccess world, BlockPos pos, EnumFacing side); -+ - Vec3d func_191059_e(IBlockAccess p_191059_1_, BlockPos p_191059_2_); - - boolean func_191058_s(); diff --git a/patches/minecraft/net/minecraft/client/ClientBrandRetriever.java.patch b/patches/minecraft/net/minecraft/client/ClientBrandRetriever.java.patch deleted file mode 100644 index e666d37fe5..0000000000 --- a/patches/minecraft/net/minecraft/client/ClientBrandRetriever.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/ClientBrandRetriever.java -+++ ../src-work/minecraft/net/minecraft/client/ClientBrandRetriever.java -@@ -8,6 +8,6 @@ - { - public static String getClientModName() - { -- return "vanilla"; -+ return net.minecraftforge.fml.common.FMLCommonHandler.instance().getModName(); - } - } diff --git a/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch b/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch deleted file mode 100644 index 25b99e7234..0000000000 --- a/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch deleted file mode 100644 index 86476fd5e2..0000000000 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ /dev/null @@ -1,606 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/audio/SoundHandler.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch deleted file mode 100644 index 95caffe213..0000000000 --- a/patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/audio/SoundHandler.java -+++ ../src-work/minecraft/net/minecraft/client/audio/SoundHandler.java -@@ -67,6 +67,7 @@ - { - this.field_147697_e.func_148763_c(); - -+ java.util.List> resources = new java.util.LinkedList<>(); - for (String s : p_110549_1_.func_135055_a()) - { - try -@@ -79,7 +80,7 @@ - - for (Entry entry : map.entrySet()) - { -- this.func_147693_a(new ResourceLocation(s, entry.getKey()), entry.getValue()); -+ resources.add(new net.minecraft.util.Tuple<>(new ResourceLocation(s, entry.getKey()), entry.getValue())); - } - } - catch (RuntimeException runtimeexception) -@@ -94,6 +95,20 @@ - } - } - -+ net.minecraftforge.fml.common.ProgressManager.ProgressBar resourcesBar = net.minecraftforge.fml.common.ProgressManager.push("Loading sounds", resources.size()); -+ resources.forEach(entry -> -+ { -+ resourcesBar.step(entry.func_76341_a().toString()); -+ try -+ { -+ this.func_147693_a(entry.func_76341_a(), entry.func_76340_b()); -+ } -+ catch (RuntimeException e) -+ { -+ field_147698_b.warn("Invalid sounds.json", e); -+ } -+ }); -+ net.minecraftforge.fml.common.ProgressManager.pop(resourcesBar); - for (ResourceLocation resourcelocation : this.field_147697_e.func_148742_b()) - { - SoundEventAccessor soundeventaccessor = (SoundEventAccessor)this.field_147697_e.func_82594_a(resourcelocation); -@@ -253,6 +268,11 @@ - this.field_147694_f.func_148615_a(p_147691_1_, p_147691_2_); - } - -+ public void setListener(net.minecraft.entity.Entity entity, float partialTicks) -+ { -+ this.field_147694_f.setListener(entity, partialTicks); -+ } -+ - public void func_147689_b() - { - this.field_147694_f.func_148610_e(); diff --git a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch deleted file mode 100644 index b87a636aad..0000000000 --- a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java -+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java -@@ -76,6 +76,7 @@ - { - SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); - SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundSetupEvent(this)); - } - catch (SoundSystemException soundsystemexception) - { -@@ -100,6 +101,7 @@ - - this.func_148613_b(); - this.func_148608_i(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this)); - } - - private synchronized void func_148608_i() -@@ -205,6 +207,7 @@ - this.field_148620_e.stop(s); - } - -+ this.field_189000_p.clear(); //Forge: MC-35856 Fixed paused sounds repeating when switching worlds - this.field_148629_h.clear(); - this.field_148626_m.clear(); - this.field_148625_l.clear(); -@@ -346,6 +349,9 @@ - { - if (this.field_148617_f) - { -+ p_148611_1_ = net.minecraftforge.client.ForgeHooksClient.playSound(this, p_148611_1_); -+ if (p_148611_1_ == null) return; -+ - SoundEventAccessor soundeventaccessor = p_148611_1_.func_184366_a(this.field_148622_c); - ResourceLocation resourcelocation = p_148611_1_.func_147650_b(); - -@@ -408,10 +414,12 @@ - if (sound.func_188723_h()) - { - this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, p_148611_1_, s)); - } - else - { - this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, p_148611_1_, s)); - } - - field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", sound.func_188719_a(), resourcelocation, s); -@@ -507,6 +515,11 @@ - - public void func_148615_a(EntityPlayer p_148615_1_, float p_148615_2_) - { -+ setListener((net.minecraft.entity.Entity) p_148615_1_, p_148615_2_); -+ } -+ -+ public void setListener(net.minecraft.entity.Entity p_148615_1_, float p_148615_2_) -+ { - if (this.field_148617_f && p_148615_1_ != null) - { - float f = p_148615_1_.field_70127_C + (p_148615_1_.field_70125_A - p_148615_1_.field_70127_C) * p_148615_2_; diff --git a/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch b/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch deleted file mode 100644 index 10a72e174e..0000000000 --- a/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java -+++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java -@@ -152,6 +152,6 @@ - f *= 1.0F - f1 * 0.15F; - } - -- return f; -+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f); - } - } diff --git a/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch deleted file mode 100644 index 2876e2214a..0000000000 --- a/patches/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java -+++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java -@@ -43,6 +43,7 @@ - - public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) - { -+ net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_); - return true; - } - diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch deleted file mode 100644 index 2073bdb542..0000000000 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ /dev/null @@ -1,131 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java -+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java -@@ -131,6 +131,7 @@ - - public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) - { -+ net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_); - return false; - } - -@@ -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_) -@@ -563,7 +578,13 @@ - - public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) - { -- this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false); -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_); -+ if (event.isCanceled() || event.getSound() == null) return; -+ p_184185_1_ = event.getSound(); -+ p_184185_2_ = event.getVolume(); -+ p_184185_3_ = event.getPitch(); -+ -+ this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, event.getCategory(), p_184185_2_, p_184185_3_, false); - } - - public boolean func_70613_aW() -@@ -840,6 +861,7 @@ - float f = 0.8F; - boolean flag2 = this.field_71158_b.field_192832_b >= 0.8F; - this.field_71158_b.func_78898_a(); -+ net.minecraftforge.client.ForgeHooksClient.onInputUpdate(this, this.field_71158_b); - this.field_71159_c.func_193032_ao().func_193293_a(this.field_71158_b); - - if (this.func_184587_cr() && !this.func_184218_aH()) -@@ -859,10 +881,13 @@ - } - - AxisAlignedBB axisalignedbb = this.func_174813_aQ(); -+ net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent event = new net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent(this, axisalignedbb); -+ if(!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { axisalignedbb = event.getEntityBoundingBox(); - this.func_145771_j(this.field_70165_t - (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v + (double)this.field_70130_N * 0.35D); - this.func_145771_j(this.field_70165_t - (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v - (double)this.field_70130_N * 0.35D); - this.func_145771_j(this.field_70165_t + (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v - (double)this.field_70130_N * 0.35D); - this.func_145771_j(this.field_70165_t + (double)this.field_70130_N * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v + (double)this.field_70130_N * 0.35D); -+ } - boolean flag4 = (float)this.func_71024_bL().func_75116_a() > 6.0F || this.field_71075_bZ.field_75101_c; - - if (this.field_70122_E && !flag1 && !flag2 && this.field_71158_b.field_192832_b >= 0.8F && !this.func_70051_ag() && flag4 && !this.func_184587_cr() && !this.func_70644_a(MobEffects.field_76440_q)) -@@ -1178,4 +1203,17 @@ - } - } - } -+ -+ public void updateSyncFields(EntityPlayerSP old) -+ { -+ this.field_175172_bI = old.field_175172_bI; -+ this.field_175166_bJ = old.field_175166_bJ; -+ this.field_175167_bK = old.field_175167_bK; -+ this.field_175164_bL = old.field_175164_bL; -+ this.field_175165_bM = old.field_175165_bM; -+ this.field_184841_cd = old.field_184841_cd; -+ this.field_175170_bN = old.field_175170_bN; -+ this.field_175171_bO = old.field_175171_bO; -+ this.field_175168_bP = old.field_175168_bP; -+ } - } diff --git a/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch b/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch deleted file mode 100644 index 5890c8524c..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch +++ /dev/null @@ -1,152 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/gui/GuiBossOverlay.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiBossOverlay.java.patch deleted file mode 100644 index 3b6ed0e038..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiBossOverlay.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiBossOverlay.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiBossOverlay.java -@@ -34,13 +34,18 @@ - for (BossInfoClient bossinfoclient : this.field_184060_g.values()) - { - int k = i / 2 - 91; -+ net.minecraftforge.client.event.RenderGameOverlayEvent.BossInfo event = -+ net.minecraftforge.client.ForgeHooksClient.bossBarRenderPre(scaledresolution, bossinfoclient, k, j, 10 + this.field_184059_f.field_71466_p.field_78288_b); -+ if (!event.isCanceled()) { - GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); - this.field_184059_f.func_110434_K().func_110577_a(field_184058_a); - this.func_184052_a(k, j, bossinfoclient); - String s = bossinfoclient.func_186744_e().func_150254_d(); - this.field_184059_f.field_71466_p.func_175063_a(s, (float)(i / 2 - this.field_184059_f.field_71466_p.func_78256_a(s) / 2), (float)(j - 9), 16777215); -- j += 10 + this.field_184059_f.field_71466_p.field_78288_b; -+ } -+ j += event.getIncrement(); - -+ net.minecraftforge.client.ForgeHooksClient.bossBarRenderPost(scaledresolution); - if (j >= scaledresolution.func_78328_b() / 3) - { - break; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch deleted file mode 100644 index 92c79564f2..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java -@@ -22,6 +22,7 @@ - public boolean field_146124_l; - public boolean field_146125_m; - protected boolean field_146123_n; -+ public int packedFGColour; //FML - - public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) - { -@@ -75,6 +76,11 @@ - this.func_146119_b(p_191745_1_, p_191745_2_, p_191745_3_); - int j = 14737632; - -+ if (packedFGColour != 0) -+ { -+ j = packedFGColour; -+ } -+ else - if (!this.field_146124_l) - { - j = 10526880; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch deleted file mode 100644 index 615cc2df80..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiControls.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiControls.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiControls.java -@@ -65,7 +65,7 @@ - { - for (KeyBinding keybinding : this.field_146297_k.field_71474_y.field_74324_K) - { -- keybinding.func_151462_b(keybinding.func_151469_h()); -+ keybinding.setToDefault(); - } - - KeyBinding.func_74508_b(); -@@ -81,6 +81,7 @@ - { - if (this.field_146491_f != null) - { -+ this.field_146491_f.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), -100 + p_73864_3_); - this.field_146497_i.func_151440_a(this.field_146491_f, -100 + p_73864_3_); - this.field_146491_f = null; - KeyBinding.func_74508_b(); -@@ -105,17 +106,21 @@ - { - if (p_73869_2_ == 1) - { -+ this.field_146491_f.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, 0); - this.field_146497_i.func_151440_a(this.field_146491_f, 0); - } - else if (p_73869_2_ != 0) - { -+ this.field_146491_f.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), p_73869_2_); - this.field_146497_i.func_151440_a(this.field_146491_f, p_73869_2_); - } - else if (p_73869_1_ > 0) - { -+ this.field_146491_f.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), p_73869_1_ + 256); - this.field_146497_i.func_151440_a(this.field_146491_f, p_73869_1_ + 256); - } - -+ if (!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(p_73869_2_)) - this.field_146491_f = null; - this.field_152177_g = Minecraft.func_71386_F(); - KeyBinding.func_74508_b(); -@@ -135,7 +140,7 @@ - - for (KeyBinding keybinding : this.field_146497_i.field_74324_K) - { -- if (keybinding.func_151463_i() != keybinding.func_151469_h()) -+ if (!keybinding.isSetToDefaultValue()) - { - flag = true; - break; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch deleted file mode 100644 index 7132b205e9..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java -@@ -206,6 +206,8 @@ - } - } - -+ WorldType.field_77139_a[this.field_146331_K].onGUICreateWorldPress(); -+ - WorldSettings worldsettings = new WorldSettings(i, GameType.func_77142_a(this.field_146342_r), this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]); - worldsettings.func_82750_a(this.field_146334_a); - -@@ -312,14 +314,7 @@ - } - else if (p_146284_1_.field_146127_k == 8) - { -- if (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c) -- { -- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a)); -- } -- else -- { -- this.field_146297_k.func_147108_a(new GuiCustomizeWorldScreen(this, this.field_146334_a)); -- } -+ WorldType.field_77139_a[this.field_146331_K].onCustomizeButton(field_146297_k, this); - } - } - } -@@ -379,7 +374,7 @@ - this.field_146326_C.field_146125_m = this.field_146344_y; - this.field_146320_D.field_146125_m = this.field_146344_y; - this.field_146321_E.field_146125_m = this.field_146344_y; -- this.field_146322_F.field_146125_m = this.field_146344_y && (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c || WorldType.field_77139_a[this.field_146331_K] == WorldType.field_180271_f); -+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable(); - } - - this.func_146319_h(); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch deleted file mode 100644 index 80db6586a6..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiEnchantment.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiEnchantment.java -@@ -171,7 +171,7 @@ - FontRenderer fontrenderer = this.field_146297_k.field_71464_q; - int i2 = 6839882; - -- if ((k < l + 1 || this.field_146297_k.field_71439_g.field_71068_ca < k1) && !this.field_146297_k.field_71439_g.field_71075_bZ.field_75098_d) -+ if (((k < l + 1 || this.field_146297_k.field_71439_g.field_71068_ca < k1) && !this.field_146297_k.field_71439_g.field_71075_bZ.field_75098_d) || this.field_147075_G.field_185001_h[l] == -1) // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels - { - this.func_73729_b(i1, j + 14 + 19 * l, 0, 185, 108, 19); - this.func_73729_b(i1 + 1, j + 15 + 19 * l, 16 * l, 239, 16, 16); -@@ -220,11 +220,12 @@ - int l = this.field_147075_G.field_185002_i[j]; - int i1 = j + 1; - -- if (this.func_146978_c(60, 14 + 19 * j, 108, 17, p_73863_1_, p_73863_2_) && k > 0 && l >= 0 && enchantment != null) -+ if (this.func_146978_c(60, 14 + 19 * j, 108, 17, p_73863_1_, p_73863_2_) && k > 0) - { - List list = Lists.newArrayList(); -- list.add("" + TextFormatting.WHITE + TextFormatting.ITALIC + I18n.func_135052_a("container.enchant.clue", enchantment.func_77316_c(l))); -+ list.add("" + TextFormatting.WHITE + TextFormatting.ITALIC + I18n.func_135052_a("container.enchant.clue", enchantment == null ? "" : enchantment.func_77316_c(l))); - -+ if(enchantment == null) java.util.Collections.addAll(list, "", TextFormatting.RED + I18n.func_135052_a("forge.container.enchant.limitedEnchantability")); else - if (!flag) - { - list.add(""); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch deleted file mode 100644 index 4e444c1e70..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiIngame.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiIngame.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngame.java -@@ -379,7 +379,8 @@ - - BlockPos blockpos = raytraceresult.func_178782_a(); - -- if (!this.field_73839_d.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149716_u() || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory)) -+ net.minecraft.block.state.IBlockState state = this.field_73839_d.field_71441_e.func_180495_p(blockpos); -+ if (!state.func_177230_c().hasTileEntity(state) || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory)) - { - return; - } -@@ -449,7 +450,10 @@ - { - Potion potion = potioneffect.func_188419_a(); - -- if (potion.func_76400_d() && potioneffect.func_188418_e()) -+ if (!potion.shouldRenderHUD(potioneffect)) continue; -+ // Rebind in case previous renderHUDEffect changed texture -+ this.field_73839_d.func_110434_K().func_110577_a(GuiContainer.field_147001_a); -+ if (potioneffect.func_188418_e()) - { - int k = p_184048_1_.func_78326_a(); - int l = 1; -@@ -492,7 +496,10 @@ - } - - GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, f); -+ // FORGE - Move status icon check down from above so renderHUDEffect will still be called without a status icon -+ if (potion.func_76400_d()) - this.func_73729_b(k + 3, l + 3, i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18); -+ potion.renderHUDEffect(k, l, potioneffect, field_73839_d, f); - } - } - } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch deleted file mode 100644 index acf44ad8e8..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/gui/GuiKeyBindingList.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.java.patch deleted file mode 100644 index 8e4165c286..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiKeyBindingList.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiKeyBindingList.java -@@ -62,7 +62,7 @@ - - protected int func_148137_d() - { -- return super.func_148137_d() + 15; -+ return super.func_148137_d() + 35; - } - - public int func_148139_c() -@@ -113,7 +113,7 @@ - { - this.field_148282_b = p_i45029_2_; - this.field_148283_c = I18n.func_135052_a(p_i45029_2_.func_151464_g()); -- this.field_148280_d = new GuiButton(0, 0, 0, 75, 20, I18n.func_135052_a(p_i45029_2_.func_151464_g())); -+ this.field_148280_d = new GuiButton(0, 0, 0, 95, 20, I18n.func_135052_a(p_i45029_2_.func_151464_g())); - this.field_148281_e = new GuiButton(0, 0, 0, 50, 20, I18n.func_135052_a("controls.reset")); - } - -@@ -121,23 +121,24 @@ - { - boolean flag = GuiKeyBindingList.this.field_148191_k.field_146491_f == this.field_148282_b; - GuiKeyBindingList.this.field_148189_l.field_71466_p.func_78276_b(this.field_148283_c, p_192634_2_ + 90 - GuiKeyBindingList.this.field_148188_n, p_192634_3_ + p_192634_5_ / 2 - GuiKeyBindingList.this.field_148189_l.field_71466_p.field_78288_b / 2, 16777215); -- this.field_148281_e.field_146128_h = p_192634_2_ + 190; -+ this.field_148281_e.field_146128_h = p_192634_2_ + 210; - this.field_148281_e.field_146129_i = p_192634_3_; -- this.field_148281_e.field_146124_l = this.field_148282_b.func_151463_i() != this.field_148282_b.func_151469_h(); -+ this.field_148281_e.field_146124_l = !this.field_148282_b.isSetToDefaultValue(); - this.field_148281_e.func_191745_a(GuiKeyBindingList.this.field_148189_l, p_192634_6_, p_192634_7_, p_192634_9_); - this.field_148280_d.field_146128_h = p_192634_2_ + 105; - this.field_148280_d.field_146129_i = p_192634_3_; -- this.field_148280_d.field_146126_j = GameSettings.func_74298_c(this.field_148282_b.func_151463_i()); -+ this.field_148280_d.field_146126_j = this.field_148282_b.getDisplayName(); - boolean flag1 = false; -+ boolean keyCodeModifierConflict = true; // less severe form of conflict, like SHIFT conflicting with SHIFT+G - - if (this.field_148282_b.func_151463_i() != 0) - { - for (KeyBinding keybinding : GuiKeyBindingList.this.field_148189_l.field_71474_y.field_74324_K) - { -- if (keybinding != this.field_148282_b && keybinding.func_151463_i() == this.field_148282_b.func_151463_i()) -+ if (keybinding != this.field_148282_b && keybinding.conflicts(this.field_148282_b)) - { - flag1 = true; -- break; -+ keyCodeModifierConflict &= keybinding.hasKeyCodeModifierConflict(this.field_148282_b); - } - } - } -@@ -148,7 +149,7 @@ - } - else if (flag1) - { -- this.field_148280_d.field_146126_j = TextFormatting.RED + this.field_148280_d.field_146126_j; -+ this.field_148280_d.field_146126_j = (keyCodeModifierConflict ? TextFormatting.GOLD : TextFormatting.RED) + this.field_148280_d.field_146126_j; - } - - this.field_148280_d.func_191745_a(GuiKeyBindingList.this.field_148189_l, p_192634_6_, p_192634_7_, p_192634_9_); -@@ -163,6 +164,7 @@ - } - else if (this.field_148281_e.func_146116_c(GuiKeyBindingList.this.field_148189_l, p_148278_2_, p_148278_3_)) - { -+ this.field_148282_b.setToDefault(); - GuiKeyBindingList.this.field_148189_l.field_71474_y.func_151440_a(this.field_148282_b, this.field_148282_b.func_151469_h()); - KeyBinding.func_74508_b(); - return true; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java.patch deleted file mode 100644 index e24503cc7b..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java -@@ -246,7 +246,7 @@ - - if (this.field_186784_e.func_71359_d().func_90033_f(this.field_186786_g.func_75786_a())) - { -- this.field_186784_e.func_71371_a(this.field_186786_g.func_75786_a(), this.field_186786_g.func_75788_b(), (WorldSettings)null); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(field_186785_f, this.field_186786_g); - } - } - diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch deleted file mode 100644 index 2d3016da6d..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java -@@ -70,6 +70,8 @@ - private GuiScreen field_183503_M; - private int field_193978_M; - private int field_193979_N; -+ private GuiButton modButton; -+ private net.minecraftforge.client.gui.NotificationModUpdateScreen modUpdateNotification; - - public GuiMainMenu() - { -@@ -212,13 +214,15 @@ - this.field_183503_M.func_183500_a(this.field_146294_l, this.field_146295_m); - this.field_183503_M.func_73866_w_(); - } -+ modUpdateNotification = net.minecraftforge.client.gui.NotificationModUpdateScreen.init(this, modButton); - } - - private void func_73969_a(int p_73969_1_, int p_73969_2_) - { - this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 100, p_73969_1_, I18n.func_135052_a("menu.singleplayer"))); - this.field_146292_n.add(new GuiButton(2, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.func_135052_a("menu.multiplayer"))); -- this.field_175372_K = this.func_189646_b(new GuiButton(14, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135052_a("menu.online"))); -+ this.field_175372_K = this.func_189646_b(new GuiButton(14, this.field_146294_l / 2 + 2, p_73969_1_ + p_73969_2_ * 2, 98, 20, I18n.func_135052_a("menu.online").replace("Minecraft", "").trim())); -+ this.field_146292_n.add(modButton = new GuiButton(6, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, 98, 20, I18n.func_135052_a("fml.menu.mods"))); - } - - private void func_73972_b(int p_73972_1_, int p_73972_2_) -@@ -266,6 +270,11 @@ - this.field_146297_k.func_71400_g(); - } - -+ if (p_146284_1_.field_146127_k == 6) -+ { -+ this.field_146297_k.func_147108_a(new net.minecraftforge.fml.client.GuiModList(this)); -+ } -+ - if (p_146284_1_.field_146127_k == 11) - { - this.field_146297_k.func_71371_a("Demo_World", "Demo_World", WorldServerDemo.field_73071_a); -@@ -500,6 +509,9 @@ - - this.field_146297_k.func_110434_K().func_110577_a(field_194400_H); - func_146110_a(j + 88, 67, 0.0F, 0.0F, 98, 14, 128.0F, 16.0F); -+ -+ this.field_73975_c = net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.field_146289_q, this.field_146294_l, this.field_146295_m, this.field_73975_c); -+ - GlStateManager.func_179094_E(); - GlStateManager.func_179109_b((float)(this.field_146294_l / 2 + 90), 70.0F, 0.0F); - GlStateManager.func_179114_b(-20.0F, 0.0F, 0.0F, 1.0F); -@@ -519,7 +531,16 @@ - s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d()); - } - -- this.func_73731_b(this.field_146289_q, s, 2, this.field_146295_m - 10, -1); -+ java.util.List brandings = com.google.common.collect.Lists.reverse(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(true)); -+ for (int brdline = 0; brdline < brandings.size(); brdline++) -+ { -+ String brd = brandings.get(brdline); -+ if (!com.google.common.base.Strings.isNullOrEmpty(brd)) -+ { -+ this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + brdline * (this.field_146289_q.field_78288_b + 1)), 16777215); -+ } -+ } -+ - this.func_73731_b(this.field_146289_q, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_146295_m - 10, -1); - - if (p_73863_1_ > this.field_193979_N && p_73863_1_ < this.field_193979_N + this.field_193978_M && p_73863_2_ > this.field_146295_m - 10 && p_73863_2_ < this.field_146295_m && Mouse.isInsideWindow()) -@@ -540,6 +561,7 @@ - { - this.field_183503_M.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); - } -+ modUpdateNotification.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); - } - - protected void func_73864_a(int p_73864_1_, int p_73864_2_, int p_73864_3_) throws IOException diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch deleted file mode 100644 index 761db19b71..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch deleted file mode 100644 index 7d5cf304b9..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/gui/GuiScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch deleted file mode 100644 index 537a2bde18..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java -@@ -61,6 +61,7 @@ - private int field_146298_h; - private URI field_175286_t; - private boolean field_193977_u; -+ protected boolean keyHandled, mouseHandled; // Forge: allow canceling key and mouse Post events from handleMouseInput and handleKeyboardInput - - public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) - { -@@ -131,7 +132,10 @@ - - protected void func_146285_a(ItemStack p_146285_1_, int p_146285_2_, int p_146285_3_) - { -- this.func_146283_a(this.func_191927_a(p_146285_1_), p_146285_2_, p_146285_3_); -+ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_); -+ net.minecraftforge.fml.client.config.GuiUtils.preItemToolTip(p_146285_1_); -+ this.drawHoveringText(this.func_191927_a(p_146285_1_), p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font)); -+ net.minecraftforge.fml.client.config.GuiUtils.postItemToolTip(); - } - - public List func_191927_a(ItemStack p_191927_1_) -@@ -170,7 +174,13 @@ - - public void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_) - { -- if (!p_146283_1_.isEmpty()) -+ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146289_q); -+ } -+ -+ protected void drawHoveringText(List p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font) -+ { -+ net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146294_l, field_146295_m, -1, font); -+ if (false && !p_146283_1_.isEmpty()) - { - GlStateManager.func_179101_C(); - RenderHelper.func_74518_a(); -@@ -403,10 +413,13 @@ - - public void func_175281_b(String p_175281_1_, boolean p_175281_2_) - { -+ p_175281_1_ = net.minecraftforge.event.ForgeEventFactory.onClientSendMessage(p_175281_1_); -+ if (p_175281_1_.isEmpty()) return; - if (p_175281_2_) - { - this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_); - } -+ if (net.minecraftforge.client.ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_175281_1_) != 0) return; - - this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_); - } -@@ -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)); - } - } - } -@@ -453,8 +472,12 @@ - this.field_146289_q = p_146280_1_.field_71466_p; - this.field_146294_l = p_146280_2_; - this.field_146295_m = p_146280_3_; -+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Pre(this, this.field_146292_n))) -+ { - this.field_146292_n.clear(); - this.func_73866_w_(); -+ } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Post(this, this.field_146292_n)); - } - - public void func_183500_a(int p_183500_1_, int p_183500_2_) -@@ -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)); - } - } - } -@@ -543,6 +572,7 @@ - public void func_146276_q_() - { - this.func_146270_b(0); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this)); - } - - public void func_146270_b(int p_146270_1_) diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreenBook.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreenBook.java.patch deleted file mode 100644 index 013628cab3..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreenBook.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiScreenBook.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreenBook.java -@@ -69,6 +69,7 @@ - - if (this.field_146476_w < 1) - { -+ this.field_146483_y.func_74742_a(new NBTTagString("")); // Forge: fix MC-1685 - this.field_146476_w = 1; - } - } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreenDemo.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreenDemo.java.patch deleted file mode 100644 index 7bd08fc2ef..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreenDemo.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiScreenDemo.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreenDemo.java -@@ -68,10 +68,10 @@ - this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.title"), i, j, 2039583); - j = j + 12; - GameSettings gamesettings = this.field_146297_k.field_71474_y; -- this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.movementShort", 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())), i, j, 5197647); -+ this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.movementShort", gamesettings.field_74351_w.getDisplayName(), gamesettings.field_74370_x.getDisplayName(), gamesettings.field_74368_y.getDisplayName(), gamesettings.field_74366_z.getDisplayName()), i, j, 5197647); - this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.movementMouse"), i, j + 12, 5197647); -- this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.jump", GameSettings.func_74298_c(gamesettings.field_74314_A.func_151463_i())), i, j + 24, 5197647); -- this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.inventory", GameSettings.func_74298_c(gamesettings.field_151445_Q.func_151463_i())), i, j + 36, 5197647); -+ this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.jump", gamesettings.field_74314_A.getDisplayName()), i, j + 24, 5197647); -+ this.field_146289_q.func_78276_b(I18n.func_135052_a("demo.help.inventory", gamesettings.field_151445_Q.getDisplayName()), i, j + 36, 5197647); - this.field_146289_q.func_78279_b(I18n.func_135052_a("demo.help.fullWrapped"), i, j + 68, 218, 2039583); - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); - } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch deleted file mode 100644 index 11a0b4f048..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiSleepMP.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSleepMP.java -@@ -32,7 +32,7 @@ - - if (!s.isEmpty()) - { -- this.field_146297_k.field_71439_g.func_71165_d(s); -+ this.func_175275_f(s); // Forge: fix vanilla not adding messages to the sent list while sleeping - } - - this.field_146415_a.func_146180_a(""); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch deleted file mode 100644 index d6c6e60689..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java -@@ -181,15 +181,8 @@ - GlStateManager.func_179106_n(); - Tessellator tessellator = Tessellator.func_178181_a(); - BufferBuilder bufferbuilder = tessellator.func_178180_c(); -- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); -- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); -- float f = 32.0F; -- bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_181709_i); -- bufferbuilder.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148152_e / 32.0F), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- bufferbuilder.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148151_d / 32.0F), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- bufferbuilder.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148151_d / 32.0F), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- bufferbuilder.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148152_e / 32.0F), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / 32.0F)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- tessellator.func_78381_a(); -+ // Forge: background rendering moved into separate method. -+ this.drawContainerBackground(tessellator); - int k = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; - int l = this.field_148153_b + 4 - (int)this.field_148169_q; - -@@ -458,4 +451,18 @@ - { - return this.field_148149_f; - } -+ -+ protected void drawContainerBackground(Tessellator tessellator) -+ { -+ BufferBuilder buffer = tessellator.func_178180_c(); -+ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); -+ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); -+ float f = 32.0F; -+ buffer.func_181668_a(7, DefaultVertexFormats.field_181709_i); -+ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ tessellator.func_78381_a(); -+ } - } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSpectator.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSpectator.java.patch deleted file mode 100644 index 75838aea9a..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiSpectator.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiSpectator.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSpectator.java -@@ -109,7 +109,7 @@ - GlStateManager.func_179131_c(f, f, f, p_175266_4_); - p_175266_5_.func_178663_a(f, i); - GlStateManager.func_179121_F(); -- String s = String.valueOf((Object)GameSettings.func_74298_c(this.field_175268_g.field_71474_y.field_151456_ac[p_175266_1_].func_151463_i())); -+ String s = String.valueOf(this.field_175268_g.field_71474_y.field_151456_ac[p_175266_1_].getDisplayName()); - - if (i > 3 && p_175266_5_.func_178662_A_()) - { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch deleted file mode 100644 index 2279e0a97e..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java -@@ -73,6 +73,8 @@ - s3 = s4; - } - -+ s3 = FontRenderer.func_78282_e(s2) + s3; //Forge: Fix chat formatting not surviving line wrapping. -+ - TextComponentString textcomponentstring1 = new TextComponentString(s3); - textcomponentstring1.func_150255_a(itextcomponent1.func_150256_b().func_150232_l()); - list1.add(j + 1, textcomponentstring1); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.java.patch deleted file mode 100644 index 54b664ace2..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/GuiVideoSettings.java -+++ ../src-work/minecraft/net/minecraft/client/gui/GuiVideoSettings.java -@@ -117,4 +117,12 @@ - this.func_73732_a(this.field_146289_q, this.field_146500_a, this.field_146294_l / 2, 5, 16777215); - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); - } -+ -+ // FORGE: fix for MC-64581 very laggy mipmap slider -+ @Override -+ public void func_146281_b() -+ { -+ super.func_146281_b(); -+ this.field_146297_k.field_71474_y.onGuiClosed(); -+ } - } diff --git a/patches/minecraft/net/minecraft/client/gui/MapItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/gui/MapItemRenderer.java.patch deleted file mode 100644 index 64f2b43c64..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/MapItemRenderer.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/MapItemRenderer.java -+++ ../src-work/minecraft/net/minecraft/client/gui/MapItemRenderer.java -@@ -139,6 +139,8 @@ - { - if (!p_148237_1_ || mapdecoration.func_191180_f()) - { -+ if (mapdecoration.render(k)) { k++; continue; } -+ MapItemRenderer.this.field_148251_b.func_110577_a(MapItemRenderer.field_148253_a); // Rebind in case custom render changes it - GlStateManager.func_179094_E(); - GlStateManager.func_179109_b(0.0F + (float)mapdecoration.func_176112_b() / 2.0F + 64.0F, 0.0F + (float)mapdecoration.func_176113_c() / 2.0F + 64.0F, -0.02F); - GlStateManager.func_179114_b((float)(mapdecoration.func_176111_d() * 360) / 16.0F, 0.0F, 0.0F, 1.0F); diff --git a/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch b/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch deleted file mode 100644 index 50e3e61147..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../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); diff --git a/patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch b/patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch deleted file mode 100644 index a14d65d529..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java -+++ ../src-work/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java -@@ -37,6 +37,7 @@ - private int field_191814_q = Integer.MIN_VALUE; - private float field_191815_r; - private boolean field_192992_s; -+ private int page; - - public GuiAdvancementTab(Minecraft p_i47589_1_, GuiScreenAdvancements p_i47589_2_, AdvancementTabType p_i47589_3_, int p_i47589_4_, Advancement p_i47589_5_, DisplayInfo p_i47589_6_) - { -@@ -160,9 +161,9 @@ - { - for (AdvancementTabType advancementtabtype : AdvancementTabType.values()) - { -- if (p_193936_2_ < advancementtabtype.func_192650_a()) -+ if ((p_193936_2_ % AdvancementTabType.field_192659_e) < advancementtabtype.func_192650_a()) - { -- return new GuiAdvancementTab(p_193936_0_, p_193936_1_, advancementtabtype, p_193936_2_, p_193936_3_, p_193936_3_.func_192068_c()); -+ return new GuiAdvancementTab(p_193936_0_, p_193936_1_, advancementtabtype, p_193936_2_ % AdvancementTabType.field_192659_e, p_193936_2_ / AdvancementTabType.field_192659_e, p_193936_3_, p_193936_3_.func_192068_c()); - } - - p_193936_2_ -= advancementtabtype.func_192650_a(); -@@ -222,4 +223,17 @@ - { - return this.field_193938_f; - } -+ -+ /* ======================================== FORGE START =====================================*/ -+ public int getPage() -+ { -+ return this.page; -+ } -+ -+ public GuiAdvancementTab(Minecraft p_i47589_1_, GuiScreenAdvancements p_i47589_2_, AdvancementTabType p_i47589_3_, int p_i47589_4_, int page, Advancement p_i47589_5_, DisplayInfo p_i47589_6_) -+ { -+ this(p_i47589_1_, p_i47589_2_, p_i47589_3_, p_i47589_4_, p_i47589_5_, p_i47589_6_); -+ this.page = page; -+ } -+ /* ======================================== FORGE END =====================================*/ - } diff --git a/patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch b/patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch deleted file mode 100644 index a9804a1cdc..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch +++ /dev/null @@ -1,88 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java -+++ ../src-work/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java -@@ -29,6 +29,7 @@ - private int field_191941_t; - private int field_191942_u; - private boolean field_191944_v; -+ private static int tabPage, maxPages; - - public GuiScreenAdvancements(ClientAdvancementManager p_i47383_1_) - { -@@ -49,6 +50,14 @@ - { - this.field_191946_h.func_194230_a(this.field_191940_s == null ? null : this.field_191940_s.func_193935_c(), true); - } -+ if (this.field_191947_i.size() > AdvancementTabType.field_192659_e) -+ { -+ int guiLeft = (this.field_146294_l - 252) / 2; -+ int guiTop = (this.field_146295_m - 140) / 2; -+ this.field_146292_n.add(new net.minecraft.client.gui.GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<")); -+ this.field_146292_n.add(new net.minecraft.client.gui.GuiButton(102, guiLeft + 252 - 20, guiTop - 50, 20, 20, ">")); -+ maxPages = this.field_191947_i.size() / AdvancementTabType.field_192659_e; -+ } - } - - public void func_146281_b() -@@ -71,7 +80,7 @@ - - for (GuiAdvancementTab guiadvancementtab : this.field_191947_i.values()) - { -- if (guiadvancementtab.func_191793_c(i, j, p_73864_1_, p_73864_2_)) -+ if (guiadvancementtab.getPage() == tabPage && guiadvancementtab.func_191793_c(i, j, p_73864_1_, p_73864_2_)) - { - this.field_191946_h.func_194230_a(guiadvancementtab.func_193935_c(), true); - break; -@@ -122,6 +131,14 @@ - this.func_146276_q_(); - this.func_191936_c(p_73863_1_, p_73863_2_, i, j); - this.func_191934_b(i, j); -+ super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); -+ if (maxPages != 0) -+ { -+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1); -+ int width = this.field_146289_q.func_78256_a(page); -+ GlStateManager.func_179140_f(); -+ this.field_146289_q.func_175063_a(page, i + (252 / 2) - (width / 2), j - 44, -1); -+ } - this.func_191937_d(p_73863_1_, p_73863_2_, i, j); - } - -@@ -163,6 +180,7 @@ - - for (GuiAdvancementTab guiadvancementtab : this.field_191947_i.values()) - { -+ if(guiadvancementtab.getPage() == tabPage) - guiadvancementtab.func_191798_a(p_191934_1_, p_191934_2_, guiadvancementtab == this.field_191940_s); - } - -@@ -172,6 +190,7 @@ - - for (GuiAdvancementTab guiadvancementtab1 : this.field_191947_i.values()) - { -+ if(guiadvancementtab1.getPage() == tabPage) - guiadvancementtab1.func_191796_a(p_191934_1_, p_191934_2_, this.field_146296_j); - } - -@@ -199,7 +218,7 @@ - { - for (GuiAdvancementTab guiadvancementtab : this.field_191947_i.values()) - { -- if (guiadvancementtab.func_191793_c(p_191937_3_, p_191937_4_, p_191937_1_, p_191937_2_)) -+ if (guiadvancementtab.getPage() == tabPage && guiadvancementtab.func_191793_c(p_191937_3_, p_191937_4_, p_191937_1_, p_191937_2_)) - { - this.func_146279_a(guiadvancementtab.func_191795_d(), p_191937_1_, p_191937_2_); - } -@@ -273,4 +292,13 @@ - - return this.field_191947_i.get(p_191935_1_); - } -+ -+ @Override -+ protected void func_146284_a(net.minecraft.client.gui.GuiButton button) throws IOException -+ { -+ if(button.field_146127_k == 101) -+ tabPage = Math.max(tabPage - 1, 0); -+ else if(button.field_146127_k == 102) -+ tabPage = Math.min(tabPage + 1, maxPages); -+ } - } diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch deleted file mode 100644 index 714fc45235..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch +++ /dev/null @@ -1,156 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java -+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java -@@ -116,6 +116,7 @@ - RenderHelper.func_74518_a(); - this.func_146979_b(p_73863_1_, p_73863_2_); - RenderHelper.func_74520_c(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiContainerEvent.DrawForeground(this, p_73863_1_, p_73863_2_)); - InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by; - ItemStack itemstack = this.field_147012_x.func_190926_b() ? inventoryplayer.func_70445_o() : this.field_147012_x; - -@@ -180,8 +181,10 @@ - GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F); - this.field_73735_i = 200.0F; - this.field_146296_j.field_77023_b = 200.0F; -+ net.minecraft.client.gui.FontRenderer font = p_146982_1_.func_77973_b().getFontRenderer(p_146982_1_); -+ if (font == null) font = field_146289_q; - this.field_146296_j.func_180450_b(p_146982_1_, p_146982_2_, p_146982_3_); -- this.field_146296_j.func_180453_a(this.field_146289_q, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x.func_190926_b() ? 0 : 8), p_146982_4_); -+ this.field_146296_j.func_180453_a(font, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x.func_190926_b() ? 0 : 8), p_146982_4_); - this.field_73735_i = 0.0F; - this.field_146296_j.field_77023_b = 0.0F; - } -@@ -239,13 +242,12 @@ - - if (itemstack.func_190926_b() && p_146977_1_.func_111238_b()) - { -- String s1 = p_146977_1_.func_178171_c(); -+ TextureAtlasSprite textureatlassprite = p_146977_1_.getBackgroundSprite(); - -- if (s1 != null) -+ if (textureatlassprite != null) - { -- TextureAtlasSprite textureatlassprite = this.field_146297_k.func_147117_R().func_110572_b(s1); - GlStateManager.func_179140_f(); -- this.field_146297_k.func_110434_K().func_110577_a(TextureMap.field_110575_b); -+ this.field_146297_k.func_110434_K().func_110577_a(p_146977_1_.getBackgroundLocation()); - this.func_175175_a(i, j, textureatlassprite, 16, 16); - GlStateManager.func_179145_e(); - flag1 = true; -@@ -319,7 +321,7 @@ - protected void func_73864_a(int p_73864_1_, int p_73864_2_, int p_73864_3_) throws IOException - { - super.func_73864_a(p_73864_1_, p_73864_2_, p_73864_3_); -- boolean flag = p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100; -+ boolean flag = this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ - 100); - Slot slot = this.func_146975_c(p_73864_1_, p_73864_2_); - long i = Minecraft.func_71386_F(); - this.field_146993_M = this.field_146998_K == slot && i - this.field_146997_J < 250L && this.field_146992_L == p_73864_3_; -@@ -330,6 +332,7 @@ - int j = this.field_147003_i; - int k = this.field_147009_r; - boolean flag1 = this.func_193983_c(p_73864_1_, p_73864_2_, j, k); -+ if (slot != null) flag1 = false; // Forge, prevent dropping of items through slots outside of GUI boundaries - int l = -1; - - if (slot != null) -@@ -367,7 +370,7 @@ - { - if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b()) - { -- if (p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100) -+ if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ - 100)) - { - this.func_184098_a(slot, l, p_73864_3_, ClickType.CLONE); - } -@@ -405,7 +408,7 @@ - { - this.field_146987_F = 1; - } -- else if (p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100) -+ else if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ - 100)) - { - this.field_146987_F = 2; - } -@@ -472,10 +475,12 @@ - - protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_) - { -+ super.func_146286_b(p_146286_1_, p_146286_2_, p_146286_3_); //Forge, Call parent to release buttons - Slot slot = this.func_146975_c(p_146286_1_, p_146286_2_); - int i = this.field_147003_i; - int j = this.field_147009_r; - boolean flag = this.func_193983_c(p_146286_1_, p_146286_2_, i, j); -+ if (slot != null) flag = false; // Forge, prevent dropping of items through slots outside of GUI boundaries - int k = -1; - - if (slot != null) -@@ -496,7 +501,7 @@ - { - for (Slot slot2 : this.field_147002_h.field_75151_b) - { -- if (slot2 != null && slot2.func_82869_a(this.field_146297_k.field_71439_g) && slot2.func_75216_d() && slot2.field_75224_c == slot.field_75224_c && Container.func_94527_a(slot2, this.field_146994_N, true)) -+ if (slot2 != null && slot2.func_82869_a(this.field_146297_k.field_71439_g) && slot2.func_75216_d() && slot2.isSameInventory(slot) && Container.func_94527_a(slot2, this.field_146994_N, true)) - { - this.func_184098_a(slot2, slot2.field_75222_d, p_146286_3_, ClickType.QUICK_MOVE); - } -@@ -583,7 +588,7 @@ - } - else if (!this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b()) - { -- if (p_146286_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100) -+ if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_146286_3_ - 100)) - { - this.func_184098_a(slot, k, p_146286_3_, ClickType.CLONE); - } -@@ -635,7 +640,7 @@ - - protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException - { -- if (p_73869_2_ == 1 || p_73869_2_ == this.field_146297_k.field_71474_y.field_151445_Q.func_151463_i()) -+ if (p_73869_2_ == 1 || this.field_146297_k.field_71474_y.field_151445_Q.isActiveAndMatches(p_73869_2_)) - { - this.field_146297_k.field_71439_g.func_71053_j(); - } -@@ -644,11 +649,11 @@ - - if (this.field_147006_u != null && this.field_147006_u.func_75216_d()) - { -- if (p_73869_2_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i()) -+ if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73869_2_)) - { - this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, 0, ClickType.CLONE); - } -- else if (p_73869_2_ == this.field_146297_k.field_71474_y.field_74316_C.func_151463_i()) -+ else if (this.field_146297_k.field_71474_y.field_74316_C.isActiveAndMatches(p_73869_2_)) - { - this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, func_146271_m() ? 1 : 0, ClickType.THROW); - } -@@ -661,7 +666,7 @@ - { - for (int i = 0; i < 9; ++i) - { -- if (p_146983_1_ == this.field_146297_k.field_71474_y.field_151456_ac[i].func_151463_i()) -+ if (this.field_146297_k.field_71474_y.field_151456_ac[i].isActiveAndMatches(p_146983_1_)) - { - this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, i, ClickType.SWAP); - return true; -@@ -694,4 +699,18 @@ - this.field_146297_k.field_71439_g.func_71053_j(); - } - } -+ -+ /* ======================================== FORGE START =====================================*/ -+ -+ /** -+ * Returns the slot that is currently displayed under the mouse. -+ */ -+ @javax.annotation.Nullable -+ public Slot getSlotUnderMouse() { return this.field_147006_u; } -+ public int getGuiLeft() { return field_147003_i; } -+ public int getGuiTop() { return field_147009_r; } -+ public int getXSize() { return field_146999_f; } -+ public int getYSize() { return field_147000_g; } -+ -+ /* ======================================== FORGE END =====================================*/ - } diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch deleted file mode 100644 index 7760c3c58f..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ /dev/null @@ -1,308 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -@@ -57,6 +57,8 @@ - private Slot field_147064_C; - private boolean field_147057_D; - private CreativeCrafting field_147059_E; -+ private static int tabPage = 0; -+ private int maxPages = 0; - - public GuiContainerCreative(EntityPlayer p_i1088_1_) - { -@@ -287,6 +289,13 @@ - this.func_147050_b(CreativeTabs.field_78032_a[i]); - this.field_147059_E = new CreativeCrafting(this.field_146297_k); - this.field_146297_k.field_71439_g.field_71069_bz.func_75132_a(this.field_147059_E); -+ int tabCount = CreativeTabs.field_78032_a.length; -+ if (tabCount > 12) -+ { -+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<")); -+ field_146292_n.add(new GuiButton(102, field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, ">")); -+ maxPages = (int) Math.ceil((tabCount - 12) / 10D); -+ } - } - else - { -@@ -308,7 +317,7 @@ - - protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException - { -- if (field_147058_w != CreativeTabs.field_78027_g.func_78021_a()) -+ if (!CreativeTabs.field_78032_a[field_147058_w].hasSearchBar()) - { - if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D)) - { -@@ -346,6 +355,34 @@ - GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; - guicontainercreative$containercreative.field_148330_a.clear(); - -+ CreativeTabs tab = CreativeTabs.field_78032_a[field_147058_w]; -+ if (tab.hasSearchBar() && tab != CreativeTabs.field_78027_g) -+ { -+ tab.func_78018_a(guicontainercreative$containercreative.field_148330_a); -+ if (!this.field_147062_A.func_146179_b().isEmpty()) -+ { -+ //TODO: Make this a SearchTree not a manual search -+ String search = this.field_147062_A.func_146179_b().toLowerCase(Locale.ROOT); -+ java.util.Iterator itr = guicontainercreative$containercreative.field_148330_a.iterator(); -+ while (itr.hasNext()) { -+ ItemStack stack = itr.next(); -+ boolean matches = false; -+ for (String line : stack.func_82840_a(this.field_146297_k.field_71439_g, this.field_146297_k.field_71474_y.field_82882_x ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL)) -+ { -+ if (TextFormatting.func_110646_a(line).toLowerCase(Locale.ROOT).contains(search)) { -+ matches = true; -+ break; -+ } -+ } -+ if (!matches) -+ itr.remove(); -+ } -+ } -+ this.field_147067_x = 0.0F; -+ guicontainercreative$containercreative.func_148329_a(0.0F); -+ return; -+ } -+ - if (this.field_147062_A.func_146179_b().isEmpty()) - { - for (Item item : Item.field_150901_e) -@@ -366,7 +403,7 @@ - { - CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; - -- if (creativetabs.func_78019_g()) -+ if (creativetabs != null && creativetabs.func_78019_g()) - { - GlStateManager.func_179084_k(); - this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c()), 8, 6, 4210752); -@@ -401,7 +438,7 @@ - - for (CreativeTabs creativetabs : CreativeTabs.field_78032_a) - { -- if (this.func_147049_a(creativetabs, i, j)) -+ if (creativetabs != null && this.func_147049_a(creativetabs, i, j)) - { - this.func_147050_b(creativetabs); - return; -@@ -414,11 +451,13 @@ - - private boolean func_147055_p() - { -+ if (CreativeTabs.field_78032_a[field_147058_w] == null) return false; - return field_147058_w != CreativeTabs.field_78036_m.func_78021_a() && CreativeTabs.field_78032_a[field_147058_w].func_78017_i() && ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148328_e(); - } - - private void func_147050_b(CreativeTabs p_147050_1_) - { -+ if (p_147050_1_ == null) return; - int i = field_147058_w; - field_147058_w = p_147050_1_.func_78021_a(); - GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; -@@ -524,12 +563,14 @@ - - if (this.field_147062_A != null) - { -- if (p_147050_1_ == CreativeTabs.field_78027_g) -+ if (p_147050_1_.hasSearchBar()) - { - this.field_147062_A.func_146189_e(true); - this.field_147062_A.func_146205_d(false); - this.field_147062_A.func_146195_b(true); - this.field_147062_A.func_146180_a(""); -+ this.field_147062_A.field_146218_h = p_147050_1_.getSearchbarWidth(); -+ this.field_147062_A.field_146209_f = this.field_147003_i + (82 /*default left*/ + 89 /*default width*/) - this.field_147062_A.field_146218_h; - this.func_147053_i(); - } - else -@@ -601,19 +642,43 @@ - - super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); - -- for (CreativeTabs creativetabs : CreativeTabs.field_78032_a) -+ int start = tabPage * 10; -+ int end = Math.min(CreativeTabs.field_78032_a.length, ((tabPage + 1) * 10) + 2); -+ if (tabPage != 0) start += 2; -+ boolean rendered = false; -+ -+ for (CreativeTabs creativetabs : java.util.Arrays.copyOfRange(CreativeTabs.field_78032_a,start,end)) - { -+ if (creativetabs == null) continue; - if (this.func_147052_b(creativetabs, p_73863_1_, p_73863_2_)) - { -+ rendered = true; - break; - } - } - -+ if (!rendered && !func_147052_b(CreativeTabs.field_78027_g, p_73863_1_, p_73863_2_)) -+ { -+ func_147052_b(CreativeTabs.field_78036_m, p_73863_1_, p_73863_2_); -+ } -+ - if (this.field_147064_C != null && field_147058_w == CreativeTabs.field_78036_m.func_78021_a() && this.func_146978_c(this.field_147064_C.field_75223_e, this.field_147064_C.field_75221_f, 16, 16, p_73863_1_, p_73863_2_)) - { - this.func_146279_a(I18n.func_135052_a("inventory.binSlot"), p_73863_1_, p_73863_2_); - } - -+ if (maxPages != 0) -+ { -+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1); -+ int width = field_146289_q.func_78256_a(page); -+ GlStateManager.func_179140_f(); -+ this.field_73735_i = 300.0F; -+ field_146296_j.field_77023_b = 300.0F; -+ field_146289_q.func_78276_b(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1); -+ this.field_73735_i = 0.0F; -+ field_146296_j.field_77023_b = 0.0F; -+ } -+ - GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.func_179140_f(); - this.func_191948_b(p_73863_1_, p_73863_2_); -@@ -662,7 +727,10 @@ - } - } - -- this.func_146283_a(list, p_146285_2_, p_146285_3_); -+ net.minecraft.client.gui.FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_); -+ net.minecraftforge.fml.client.config.GuiUtils.preItemToolTip(p_146285_1_); -+ this.drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font)); -+ net.minecraftforge.fml.client.config.GuiUtils.postItemToolTip(); - } - else - { -@@ -676,17 +744,36 @@ - RenderHelper.func_74520_c(); - CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; - -- for (CreativeTabs creativetabs1 : CreativeTabs.field_78032_a) -+ int start = tabPage * 10; -+ int end = Math.min(CreativeTabs.field_78032_a.length, ((tabPage + 1) * 10 + 2)); -+ if (tabPage != 0) start += 2; -+ -+ for (CreativeTabs creativetabs1 : java.util.Arrays.copyOfRange(CreativeTabs.field_78032_a,start,end)) - { - this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); - -+ if (creativetabs1 == null) continue; - if (creativetabs1.func_78021_a() != field_147058_w) - { - this.func_147051_a(creativetabs1); - } - } - -- this.field_146297_k.func_110434_K().func_110577_a(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.func_78015_f())); -+ if (tabPage != 0) -+ { -+ if (creativetabs != CreativeTabs.field_78027_g) -+ { -+ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); -+ func_147051_a(CreativeTabs.field_78027_g); -+ } -+ if (creativetabs != CreativeTabs.field_78036_m) -+ { -+ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); -+ func_147051_a(CreativeTabs.field_78036_m); -+ } -+ } -+ -+ this.field_146297_k.func_110434_K().func_110577_a(creativetabs.getBackgroundImage()); - this.func_73729_b(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g); - this.field_147062_A.func_146194_f(); - GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); -@@ -700,6 +787,14 @@ - this.func_73729_b(i, j + (int)((float)(k - j - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15); - } - -+ if (creativetabs == null || creativetabs.getTabPage() != tabPage) -+ { -+ if (creativetabs != CreativeTabs.field_78027_g && creativetabs != CreativeTabs.field_78036_m) -+ { -+ return; -+ } -+ } -+ - this.func_147051_a(creativetabs); - - if (creativetabs == CreativeTabs.field_78036_m) -@@ -710,6 +805,14 @@ - - protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) - { -+ if (p_147049_1_.getTabPage() != tabPage) -+ { -+ if (p_147049_1_ != CreativeTabs.field_78027_g && p_147049_1_ != CreativeTabs.field_78036_m) -+ { -+ return false; -+ } -+ } -+ - int i = p_147049_1_.func_78020_k(); - int j = 28 * i; - int k = 0; -@@ -806,6 +909,8 @@ - } - - GlStateManager.func_179140_f(); -+ GlStateManager.func_179124_c(1F, 1F, 1F); //Forge: Reset color in case Items change it. -+ GlStateManager.func_179147_l(); //Forge: Make sure blend is enabled else tabs show a white border. - this.func_73729_b(l, i1, j, k, 28, 32); - this.field_73735_i = 100.0F; - this.field_146296_j.field_77023_b = 100.0F; -@@ -827,6 +932,15 @@ - { - this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m())); - } -+ -+ if (p_146284_1_.field_146127_k == 101) -+ { -+ tabPage = Math.max(tabPage - 1, 0); -+ } -+ else if (p_146284_1_.field_146127_k == 102) -+ { -+ tabPage = Math.min(tabPage + 1, maxPages); -+ } - } - - public int func_147056_g() -@@ -1031,6 +1145,39 @@ - { - return this.field_148332_b.func_82869_a(p_82869_1_); - } -+ -+ /*========================================= FORGE START =====================================*/ -+ public net.minecraft.util.ResourceLocation getBackgroundLocation() -+ { -+ return this.field_148332_b.getBackgroundLocation(); -+ } -+ -+ public void setBackgroundLocation(net.minecraft.util.ResourceLocation texture) -+ { -+ this.field_148332_b.setBackgroundLocation(texture); -+ } -+ -+ public void setBackgroundName(@Nullable String name) -+ { -+ this.field_148332_b.setBackgroundName(name); -+ } -+ -+ @Nullable -+ public net.minecraft.client.renderer.texture.TextureAtlasSprite getBackgroundSprite() -+ { -+ return this.field_148332_b.getBackgroundSprite(); -+ } -+ -+ public int getSlotIndex() -+ { -+ return this.field_148332_b.getSlotIndex(); -+ } -+ -+ public boolean isSameInventory(Slot other) -+ { -+ return this.field_148332_b.isSameInventory(other); -+ } -+ /*========================================= FORGE END =====================================*/ - } - - @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeBook.java.patch b/patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeBook.java.patch deleted file mode 100644 index 1954aadbe1..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeBook.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeBook.java -+++ ../src-work/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeBook.java -@@ -448,7 +448,7 @@ - - languagemanager.func_135045_a(language); - this.field_191888_F.field_71474_y.field_74363_ab = language.func_135034_a(); -- this.field_191888_F.func_110436_a(); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().refreshResources(net.minecraftforge.client.resource.VanillaResourceType.LANGUAGES); - this.field_191888_F.field_71466_p.func_78264_a(this.field_191888_F.func_135016_M().func_135042_a() || this.field_191888_F.field_71474_y.field_151455_aw); - this.field_191888_F.field_71466_p.func_78275_b(languagemanager.func_135044_b()); - this.field_191888_F.field_71474_y.func_74303_b(); -@@ -485,7 +485,7 @@ - this.field_191915_z.func_194187_a(Ingredient.func_193369_a(itemstack), (p_193951_2_.get(0)).field_75223_e, (p_193951_2_.get(0)).field_75221_f); - int i = this.field_193961_o.func_174922_i(); - int j = this.field_193961_o.func_174923_h(); -- int k = p_193951_1_ instanceof ShapedRecipes ? ((ShapedRecipes)p_193951_1_).func_192403_f() : i; -+ int k = p_193951_1_ instanceof net.minecraftforge.common.crafting.IShapedRecipe ? ((net.minecraftforge.common.crafting.IShapedRecipe)p_193951_1_).getRecipeWidth() : i; - int l = 1; - Iterator iterator = p_193951_1_.func_192400_c().iterator(); - diff --git a/patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeOverlay.java.patch b/patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeOverlay.java.patch deleted file mode 100644 index c95bd2b701..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeOverlay.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeOverlay.java -+++ ../src-work/minecraft/net/minecraft/client/gui/recipebook/GuiRecipeOverlay.java -@@ -230,11 +230,11 @@ - int k = 3; - int l = 3; - -- if (this.field_193924_p instanceof ShapedRecipes) -+ if (this.field_193924_p instanceof net.minecraftforge.common.crafting.IShapedRecipe) - { -- ShapedRecipes shapedrecipes = (ShapedRecipes)this.field_193924_p; -- k = shapedrecipes.func_192403_f(); -- l = shapedrecipes.func_192404_g(); -+ net.minecraftforge.common.crafting.IShapedRecipe shapedrecipes = (net.minecraftforge.common.crafting.IShapedRecipe)this.field_193924_p; -+ k = shapedrecipes.getRecipeWidth(); -+ l = shapedrecipes.getRecipeHeight(); - } - - Iterator iterator = this.field_193924_p.func_192400_c().iterator(); diff --git a/patches/minecraft/net/minecraft/client/gui/toasts/RecipeToast.java.patch b/patches/minecraft/net/minecraft/client/gui/toasts/RecipeToast.java.patch deleted file mode 100644 index a7d4c80d3b..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/toasts/RecipeToast.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/gui/toasts/RecipeToast.java -+++ ../src-work/minecraft/net/minecraft/client/gui/toasts/RecipeToast.java -@@ -43,7 +43,7 @@ - p_193653_1_.func_192989_b().field_71466_p.func_78276_b(I18n.func_135052_a("recipe.toast.title"), 30, 7, -11534256); - p_193653_1_.func_192989_b().field_71466_p.func_78276_b(I18n.func_135052_a("recipe.toast.description"), 30, 18, -16777216); - RenderHelper.func_74520_c(); -- p_193653_1_.func_192989_b().func_175599_af().func_184391_a((EntityLivingBase)null, this.field_193666_c.get((int)(p_193653_2_ / (5000L / (long)this.field_193666_c.size()) % (long)this.field_193666_c.size())), 8, 8); -+ p_193653_1_.func_192989_b().func_175599_af().func_184391_a((EntityLivingBase)null, this.field_193666_c.get((int)(p_193653_2_ * (long)this.field_193666_c.size() / 5000L % (long)this.field_193666_c.size())), 8, 8); //Forge: fix math so that it doesn't divide by 0 when there are more than 5000 recipes - return p_193653_2_ - this.field_193667_d >= 5000L ? IToast.Visibility.HIDE : IToast.Visibility.SHOW; - } - } diff --git a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch deleted file mode 100644 index 04667710a5..0000000000 --- a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/model/ModelBox.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch deleted file mode 100644 index 7995ccb236..0000000000 --- a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/model/ModelRenderer.java.patch b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch deleted file mode 100644 index 4962d8769a..0000000000 --- a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch deleted file mode 100644 index 307bb90b30..0000000000 --- a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/model/PositionTextureVertex.java -+++ ../src-work/minecraft/net/minecraft/client/model/PositionTextureVertex.java -@@ -1,10 +1,7 @@ - package net.minecraft.client.model; - - import net.minecraft.util.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/minecraft/net/minecraft/client/model/TexturedQuad.java.patch b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch deleted file mode 100644 index 9712d2d3d8..0000000000 --- a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch deleted file mode 100644 index f6725fc122..0000000000 --- a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch deleted file mode 100644 index c618ed9fa9..0000000000 --- a/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java -+++ ../src-work/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java -@@ -67,7 +67,7 @@ - inetaddress = InetAddress.getByName(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/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch deleted file mode 100644 index 46556c38d8..0000000000 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ /dev/null @@ -1,214 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch deleted file mode 100644 index b2931d8d34..0000000000 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch deleted file mode 100644 index a09e9fe7b3..0000000000 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch deleted file mode 100644 index e3eb857061..0000000000 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch deleted file mode 100644 index 36e36090a8..0000000000 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ /dev/null @@ -1,101 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/network/ServerPinger.java.patch b/patches/minecraft/net/minecraft/client/network/ServerPinger.java.patch deleted file mode 100644 index da8135c50b..0000000000 --- a/patches/minecraft/net/minecraft/client/network/ServerPinger.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/particle/Particle.java.patch b/patches/minecraft/net/minecraft/client/particle/Particle.java.patch deleted file mode 100644 index 8dd3ac9a7d..0000000000 --- a/patches/minecraft/net/minecraft/client/particle/Particle.java.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/particle/ParticleManager.java.patch b/patches/minecraft/net/minecraft/client/particle/ParticleManager.java.patch deleted file mode 100644 index d90b99b15d..0000000000 --- a/patches/minecraft/net/minecraft/client/particle/ParticleManager.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch b/patches/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch deleted file mode 100644 index 61eb06afb4..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch deleted file mode 100644 index 2e03252c52..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch deleted file mode 100644 index fc77349fc3..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch deleted file mode 100644 index f4b9120b61..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/BlockModelShapes.java.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch deleted file mode 100644 index 884649bcd5..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch b/patches/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch deleted file mode 100644 index fab9595463..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/BufferBuilder.java.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch deleted file mode 100644 index 7bd4682b83..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ /dev/null @@ -1,296 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch deleted file mode 100644 index 8279ca8757..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch deleted file mode 100644 index d8b6f3ce0e..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch deleted file mode 100644 index c258eb7133..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ /dev/null @@ -1,101 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch deleted file mode 100644 index 52a6d1ecf8..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch deleted file mode 100644 index e9cf614004..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ /dev/null @@ -1,158 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/RenderItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderItem.java.patch deleted file mode 100644 index 1f558710e3..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/RenderItem.java.patch +++ /dev/null @@ -1,120 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch deleted file mode 100644 index f877af5ab4..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch deleted file mode 100644 index 2348edf932..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch deleted file mode 100644 index cd89a6f50b..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch deleted file mode 100644 index dd33787173..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch +++ /dev/null @@ -1,105 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch deleted file mode 100644 index 033f7d808e..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch deleted file mode 100644 index 74a4f9c042..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch deleted file mode 100644 index e6690fb627..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch deleted file mode 100644 index 174d764348..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch deleted file mode 100644 index aaded845c4..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch +++ /dev/null @@ -1,180 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch deleted file mode 100644 index 31a21668be..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch deleted file mode 100644 index 5b344f7a1d..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch deleted file mode 100644 index bd20a3c063..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch deleted file mode 100644 index 9a07db1e7e..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch deleted file mode 100644 index 8e59079cb5..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch deleted file mode 100644 index 2090d9fc26..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java -+++ ../src-work/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java -@@ -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/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch deleted file mode 100644 index 8297410b17..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch deleted file mode 100644 index 8914328f46..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch b/patches/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch deleted file mode 100644 index 2965f527fb..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch b/patches/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch deleted file mode 100644 index c465eb3f2d..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/color/ItemColors.java.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch deleted file mode 100644 index 4bc9f79481..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch deleted file mode 100644 index 7ab7bcba8c..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderFish.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch deleted file mode 100644 index 8b83223c01..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch deleted file mode 100644 index cdefb47ee7..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderLivingBase.java.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch deleted file mode 100644 index c7756b937b..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch deleted file mode 100644 index 90797a0b80..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch deleted file mode 100644 index 15ef1c6f5b..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch deleted file mode 100644 index 4f8f88bb77..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderZombieVillager.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch deleted file mode 100644 index 628916d7be..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch +++ /dev/null @@ -1,107 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch deleted file mode 100644 index b5b72c1951..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch deleted file mode 100644 index 2f03247980..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch deleted file mode 100644 index 63bf1bd468..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch deleted file mode 100644 index c74308c789..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch deleted file mode 100644 index 8112c06683..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch deleted file mode 100644 index d58b4ea3ce..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ /dev/null @@ -1,246 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch deleted file mode 100644 index 1c5abc42ef..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch deleted file mode 100644 index 526faae0db..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch deleted file mode 100644 index 48dd4c3a59..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch deleted file mode 100644 index aaf1f72f67..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch deleted file mode 100644 index 471c25f00b..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch deleted file mode 100644 index e80c6739da..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch deleted file mode 100644 index 7638560c2f..0000000000 --- a/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch b/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch deleted file mode 100644 index 94b4d34863..0000000000 --- a/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/resources/Language.java.patch b/patches/minecraft/net/minecraft/client/resources/Language.java.patch deleted file mode 100644 index 12666ca323..0000000000 --- a/patches/minecraft/net/minecraft/client/resources/Language.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/resources/Locale.java.patch b/patches/minecraft/net/minecraft/client/resources/Locale.java.patch deleted file mode 100644 index 3d878a45a6..0000000000 --- a/patches/minecraft/net/minecraft/client/resources/Locale.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch b/patches/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch deleted file mode 100644 index 042964f539..0000000000 --- a/patches/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/settings/GameSettings.java.patch b/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch deleted file mode 100644 index 1b373746b5..0000000000 --- a/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch +++ /dev/null @@ -1,104 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/settings/GameSettings.java -+++ ../src-work/minecraft/net/minecraft/client/settings/GameSettings.java -@@ -165,6 +165,7 @@ - - public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) - { -+ setForgeKeybindProperties(); - this.field_74324_K = (KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.field_74312_F, this.field_74313_G, this.field_74351_w, this.field_74370_x, this.field_74368_y, this.field_74366_z, this.field_74314_A, this.field_74311_E, this.field_151444_V, this.field_74316_C, this.field_151445_Q, this.field_74310_D, this.field_74321_H, this.field_74322_I, this.field_74323_J, this.field_151447_Z, this.field_151457_aa, this.field_151458_ab, this.field_152395_am, this.field_178883_an, this.field_186718_X, this.field_193629_ap, this.field_193630_aq, this.field_194146_ao}, this.field_151456_ac); - this.field_74318_M = EnumDifficulty.NORMAL; - this.field_74332_R = ""; -@@ -188,6 +189,7 @@ - - public GameSettings() - { -+ setForgeKeybindProperties(); - this.field_74324_K = (KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.field_74312_F, this.field_74313_G, this.field_74351_w, this.field_74370_x, this.field_74368_y, this.field_74366_z, this.field_74314_A, this.field_74311_E, this.field_151444_V, this.field_74316_C, this.field_151445_Q, this.field_74310_D, this.field_74321_H, this.field_74322_I, this.field_74323_J, this.field_151447_Z, this.field_151457_aa, this.field_151458_ab, this.field_152395_am, this.field_178883_an, this.field_186718_X, this.field_193629_ap, this.field_193630_aq, this.field_194146_ao}, this.field_151456_ac); - this.field_74318_M = EnumDifficulty.NORMAL; - this.field_74332_R = ""; -@@ -299,7 +301,7 @@ - this.field_74317_L.func_147117_R().func_147633_a(this.field_151442_I); - this.field_74317_L.func_110434_K().func_110577_a(TextureMap.field_110575_b); - this.field_74317_L.func_147117_R().func_174937_a(false, this.field_151442_I > 0); -- this.field_74317_L.func_175603_A(); -+ this.needsBlockModelRefresh = true; // FORGE: fix for MC-64581 very laggy mipmap slider - } - } - -@@ -361,7 +363,7 @@ - if (p_74306_1_ == GameSettings.Options.ANAGLYPH) - { - this.field_74337_g = !this.field_74337_g; -- this.field_74317_L.func_110436_a(); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().refreshResources(net.minecraftforge.client.resource.VanillaResourceType.TEXTURES); - } - - if (p_74306_1_ == GameSettings.Options.GRAPHICS) -@@ -1068,7 +1070,12 @@ - { - if (s1.equals("key_" + keybinding.func_151464_g())) - { -- keybinding.func_151462_b(Integer.parseInt(s2)); -+ if (s2.indexOf(':') != -1) -+ { -+ String[] t = s2.split(":"); -+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.valueFromString(t[1]), Integer.parseInt(t[0])); -+ } else -+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, Integer.parseInt(s2)); - } - } - -@@ -1132,6 +1139,7 @@ - - public void func_74303_b() - { -+ if (net.minecraftforge.fml.client.FMLClientHandler.instance().isLoading()) return; - PrintWriter printwriter = null; - - try -@@ -1206,7 +1214,8 @@ - - for (KeyBinding keybinding : this.field_74324_K) - { -- printwriter.println("key_" + keybinding.func_151464_g() + ":" + keybinding.func_151463_i()); -+ String keyString = "key_" + keybinding.func_151464_g() + ":" + keybinding.func_151463_i(); -+ printwriter.println(keybinding.getKeyModifier() != net.minecraftforge.client.settings.KeyModifier.NONE ? keyString + ":" + keybinding.getKeyModifier() : keyString); - } - - for (SoundCategory soundcategory : SoundCategory.values()) -@@ -1440,4 +1449,35 @@ - return p_148264_1_; - } - } -+ -+ /******* Forge Start ***********/ -+ private void setForgeKeybindProperties() { -+ net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME; -+ field_74351_w.setKeyConflictContext(inGame); -+ field_74370_x.setKeyConflictContext(inGame); -+ field_74368_y.setKeyConflictContext(inGame); -+ field_74366_z.setKeyConflictContext(inGame); -+ field_74314_A.setKeyConflictContext(inGame); -+ field_74311_E.setKeyConflictContext(inGame); -+ field_151444_V.setKeyConflictContext(inGame); -+ field_74312_F.setKeyConflictContext(inGame); -+ field_74310_D.setKeyConflictContext(inGame); -+ field_74321_H.setKeyConflictContext(inGame); -+ field_74323_J.setKeyConflictContext(inGame); -+ field_151457_aa.setKeyConflictContext(inGame); -+ field_151458_ab.setKeyConflictContext(inGame); -+ field_186718_X.setKeyConflictContext(inGame); -+ } -+ -+ // FORGE: fix for MC-64581 very laggy mipmap slider -+ private boolean needsBlockModelRefresh = false; -+ public void onGuiClosed() -+ { -+ if (needsBlockModelRefresh) -+ { -+ net.minecraftforge.fml.client.FMLClientHandler.instance().scheduleResourcesRefresh(net.minecraftforge.client.resource.VanillaResourceType.MODELS); -+ this.needsBlockModelRefresh = false; -+ } -+ } -+ /******* Forge End ***********/ - } diff --git a/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch b/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch deleted file mode 100644 index 6e2714778a..0000000000 --- a/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch +++ /dev/null @@ -1,216 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/client/settings/KeyBinding.java -+++ ../src-work/minecraft/net/minecraft/client/settings/KeyBinding.java -@@ -15,7 +15,7 @@ - public class KeyBinding implements Comparable - { - private static final Map field_74516_a = Maps.newHashMap(); -- private static final IntHashMap field_74514_b = new IntHashMap(); -+ private static final net.minecraftforge.client.settings.KeyBindingMap field_74514_b = new net.minecraftforge.client.settings.KeyBindingMap(); - private static final Set field_151473_c = Sets.newHashSet(); - private static final Map field_193627_d = Maps.newHashMap(); - private final String field_74515_c; -@@ -29,7 +29,7 @@ - { - if (p_74507_0_ != 0) - { -- KeyBinding keybinding = field_74514_b.func_76041_a(p_74507_0_); -+ KeyBinding keybinding = field_74514_b.lookupActive(p_74507_0_); - - if (keybinding != null) - { -@@ -42,7 +42,7 @@ - { - if (p_74510_0_ != 0) - { -- KeyBinding keybinding = field_74514_b.func_76041_a(p_74510_0_); -+ for (KeyBinding keybinding : field_74514_b.lookupAll(p_74510_0_)) - - if (keybinding != null) - { -@@ -76,11 +76,11 @@ - - public static void func_74508_b() - { -- field_74514_b.func_76046_c(); -+ field_74514_b.clearMap(); - - for (KeyBinding keybinding : field_74516_a.values()) - { -- field_74514_b.func_76038_a(keybinding.field_74512_d, keybinding); -+ field_74514_b.addKey(keybinding.field_74512_d, keybinding); - } - } - -@@ -96,13 +96,13 @@ - this.field_151472_e = p_i45001_2_; - this.field_151471_f = p_i45001_3_; - field_74516_a.put(p_i45001_1_, this); -- field_74514_b.func_76038_a(p_i45001_2_, this); -+ field_74514_b.addKey(p_i45001_2_, this); - field_151473_c.add(p_i45001_3_); - } - - public boolean func_151470_d() - { -- return this.field_74513_e; -+ return this.field_74513_e && getKeyConflictContext().isActive() && getKeyModifier().isActive(getKeyConflictContext()); - } - - public String func_151466_e() -@@ -151,9 +151,146 @@ - - public int compareTo(KeyBinding p_compareTo_1_) - { -- return this.field_151471_f.equals(p_compareTo_1_.field_151471_f) ? I18n.func_135052_a(this.field_74515_c).compareTo(I18n.func_135052_a(p_compareTo_1_.field_74515_c)) : ((Integer)field_193627_d.get(this.field_151471_f)).compareTo(field_193627_d.get(p_compareTo_1_.field_151471_f)); -+ if (this.field_151471_f.equals(p_compareTo_1_.field_151471_f)) return I18n.func_135052_a(this.field_74515_c).compareTo(I18n.func_135052_a(p_compareTo_1_.field_74515_c)); -+ Integer tCat = field_193627_d.get(this.field_151471_f); -+ Integer oCat = field_193627_d.get(p_compareTo_1_.field_151471_f); -+ if (tCat == null && oCat != null) return 1; -+ if (tCat != null && oCat == null) return -1; -+ if (tCat == null && oCat == null) return I18n.func_135052_a(this.field_151471_f).compareTo(I18n.func_135052_a(p_compareTo_1_.field_151471_f)); -+ return tCat.compareTo(oCat); - } - -+ /****************** Forge Start *****************************/ -+ private net.minecraftforge.client.settings.KeyModifier keyModifierDefault = net.minecraftforge.client.settings.KeyModifier.NONE; -+ private net.minecraftforge.client.settings.KeyModifier keyModifier = net.minecraftforge.client.settings.KeyModifier.NONE; -+ private net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext = net.minecraftforge.client.settings.KeyConflictContext.UNIVERSAL; -+ -+ /** -+ * Convenience constructor for creating KeyBindings with keyConflictContext set. -+ */ -+ public KeyBinding(String description, net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext, int keyCode, String category) -+ { -+ this(description, keyConflictContext, net.minecraftforge.client.settings.KeyModifier.NONE, keyCode, category); -+ } -+ -+ /** -+ * Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set. -+ */ -+ public KeyBinding(String description, net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext, net.minecraftforge.client.settings.KeyModifier keyModifier, int keyCode, String category) -+ { -+ this.field_74515_c = description; -+ this.field_74512_d = keyCode; -+ this.field_151472_e = keyCode; -+ this.field_151471_f = category; -+ this.keyConflictContext = keyConflictContext; -+ this.keyModifier = keyModifier; -+ this.keyModifierDefault = keyModifier; -+ if (this.keyModifier.matches(keyCode)) -+ { -+ this.keyModifier = net.minecraftforge.client.settings.KeyModifier.NONE; -+ } -+ field_74516_a.put(description, this); -+ field_74514_b.addKey(keyCode, this); -+ field_151473_c.add(category); -+ } -+ -+ /** -+ * Checks that the key conflict context and modifier are active, and that the keyCode matches this binding. -+ */ -+ public boolean isActiveAndMatches(int keyCode) -+ { -+ return keyCode != 0 && keyCode == this.func_151463_i() && getKeyConflictContext().isActive() && getKeyModifier().isActive(getKeyConflictContext()); -+ } -+ -+ public void setKeyConflictContext(net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext) -+ { -+ this.keyConflictContext = keyConflictContext; -+ } -+ -+ public net.minecraftforge.client.settings.IKeyConflictContext getKeyConflictContext() -+ { -+ return keyConflictContext; -+ } -+ -+ public net.minecraftforge.client.settings.KeyModifier getKeyModifierDefault() -+ { -+ return keyModifierDefault; -+ } -+ -+ public net.minecraftforge.client.settings.KeyModifier getKeyModifier() -+ { -+ return keyModifier; -+ } -+ -+ public void setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier keyModifier, int keyCode) -+ { -+ this.field_74512_d = keyCode; -+ if (keyModifier.matches(keyCode)) -+ { -+ keyModifier = net.minecraftforge.client.settings.KeyModifier.NONE; -+ } -+ field_74514_b.removeKey(this); -+ this.keyModifier = keyModifier; -+ field_74514_b.addKey(keyCode, this); -+ } -+ -+ public void setToDefault() -+ { -+ setKeyModifierAndCode(getKeyModifierDefault(), func_151469_h()); -+ } -+ -+ public boolean isSetToDefaultValue() -+ { -+ return func_151463_i() == func_151469_h() && getKeyModifier() == getKeyModifierDefault(); -+ } -+ -+ /** -+ * Returns true when the other keyBinding conflicts with this one -+ */ -+ public boolean conflicts(KeyBinding other) -+ { -+ if (getKeyConflictContext().conflicts(other.getKeyConflictContext()) || other.getKeyConflictContext().conflicts(getKeyConflictContext())) -+ { -+ net.minecraftforge.client.settings.KeyModifier keyModifier = getKeyModifier(); -+ net.minecraftforge.client.settings.KeyModifier otherKeyModifier = other.getKeyModifier(); -+ if (keyModifier.matches(other.func_151463_i()) || otherKeyModifier.matches(func_151463_i())) -+ { -+ return true; -+ } -+ else if (func_151463_i() == other.func_151463_i()) -+ { -+ return keyModifier == otherKeyModifier || -+ // IN_GAME key contexts have a conflict when at least one modifier is NONE. -+ // For example: If you hold shift to crouch, you can still press E to open your inventory. This means that a Shift+E hotkey is in conflict with E. -+ // GUI and other key contexts do not have this limitation. -+ (getKeyConflictContext().conflicts(net.minecraftforge.client.settings.KeyConflictContext.IN_GAME) && -+ (keyModifier == net.minecraftforge.client.settings.KeyModifier.NONE || otherKeyModifier == net.minecraftforge.client.settings.KeyModifier.NONE)); -+ } -+ } -+ return false; -+ } -+ -+ /** -+ * Returns true when one of the bindings' key codes conflicts with the other's modifier. -+ */ -+ public boolean hasKeyCodeModifierConflict(KeyBinding other) -+ { -+ if (getKeyConflictContext().conflicts(other.getKeyConflictContext()) || other.getKeyConflictContext().conflicts(getKeyConflictContext())) -+ { -+ if (getKeyModifier().matches(other.func_151463_i()) || other.getKeyModifier().matches(func_151463_i())) -+ { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ public String getDisplayName() -+ { -+ return getKeyModifier().getLocalizedComboName(func_151463_i()); -+ } -+ /****************** Forge End *****************************/ -+ - public static Supplier func_193626_b(String p_193626_0_) - { - KeyBinding keybinding = field_74516_a.get(p_193626_0_); -@@ -162,7 +299,7 @@ - return p_193626_0_; - } : () -> - { -- return GameSettings.func_74298_c(keybinding.func_151463_i()); -+ return keybinding.getDisplayName(); - }; - } - diff --git a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch deleted file mode 100644 index 8bcdddcc2b..0000000000 --- a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch deleted file mode 100644 index 3941a0d28e..0000000000 --- a/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch deleted file mode 100644 index 48459f74a8..0000000000 --- a/patches/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/shader/ShaderManager.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderManager.java.patch deleted file mode 100644 index 9f85920461..0000000000 --- a/patches/minecraft/net/minecraft/client/shader/ShaderManager.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch b/patches/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch deleted file mode 100644 index 883654d351..0000000000 --- a/patches/minecraft/net/minecraft/client/util/RecipeBookClient.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../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/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch b/patches/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch deleted file mode 100644 index 0aeb3beb17..0000000000 --- a/patches/minecraft/net/minecraft/client/util/RecipeItemHelper.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/command/CommandBase.java.patch b/patches/minecraft/net/minecraft/command/CommandBase.java.patch deleted file mode 100644 index 1962ddd757..0000000000 --- a/patches/minecraft/net/minecraft/command/CommandBase.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/command/CommandFill.java.patch b/patches/minecraft/net/minecraft/command/CommandFill.java.patch deleted file mode 100644 index cec0241ecf..0000000000 --- a/patches/minecraft/net/minecraft/command/CommandFill.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch deleted file mode 100644 index de6db71b37..0000000000 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/command/EntitySelector.java.patch b/patches/minecraft/net/minecraft/command/EntitySelector.java.patch deleted file mode 100644 index dd80d47d1e..0000000000 --- a/patches/minecraft/net/minecraft/command/EntitySelector.java.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- ../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/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch b/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch deleted file mode 100644 index 64017a5bcd..0000000000 --- a/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch deleted file mode 100644 index fc71a49cd7..0000000000 --- a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch deleted file mode 100644 index d50b54fd80..0000000000 --- a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/crash/CrashReportCategory.java -+++ ../src-work/minecraft/net/minecraft/crash/CrashReportCategory.java -@@ -121,8 +121,11 @@ - } - else - { -- this.field_85075_d = new StackTraceElement[astacktraceelement.length - 3 - p_85073_1_]; -- System.arraycopy(astacktraceelement, 3 + p_85073_1_, this.field_85075_d, 0, this.field_85075_d.length); -+ int len = astacktraceelement.length - 3 - p_85073_1_; -+ // Really Mojang, Still, god damn... -+ if (len <= 0) len = astacktraceelement.length; -+ this.field_85075_d = new StackTraceElement[len]; -+ System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.field_85075_d, 0, this.field_85075_d.length); - return this.field_85075_d.length; - } - } -@@ -206,7 +209,7 @@ - { - try - { -- return String.format("ID #%d (%s // %s)", i, p_180523_2_.func_149739_a(), p_180523_2_.getClass().getCanonicalName()); -+ return String.format("ID #%d (%s // %s // %s)", i, p_180523_2_.func_149739_a(), p_180523_2_.getClass().getName(), p_180523_2_.getRegistryName()); - } - catch (Throwable var2) - { diff --git a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch deleted file mode 100644 index b5f34325d6..0000000000 --- a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/creativetab/CreativeTabs.java -+++ ../src-work/minecraft/net/minecraft/creativetab/CreativeTabs.java -@@ -131,8 +131,22 @@ - private EnumEnchantmentType[] field_111230_s = new EnumEnchantmentType[0]; - private ItemStack field_151245_t; - -+ public CreativeTabs(String label) -+ { -+ this(getNextID(), label); -+ } -+ - public CreativeTabs(int p_i1853_1_, String p_i1853_2_) - { -+ if (p_i1853_1_ >= field_78032_a.length) -+ { -+ CreativeTabs[] tmp = new CreativeTabs[p_i1853_1_ + 1]; -+ for (int x = 0; x < field_78032_a.length; x++) -+ { -+ tmp[x] = field_78032_a[x]; -+ } -+ field_78032_a = tmp; -+ } - this.field_78033_n = p_i1853_1_; - this.field_78034_o = p_i1853_2_; - this.field_151245_t = ItemStack.field_190927_a; -@@ -210,12 +224,20 @@ - @SideOnly(Side.CLIENT) - public int func_78020_k() - { -+ if (field_78033_n > 11) -+ { -+ return ((field_78033_n - 12) % 10) % 5; -+ } - return this.field_78033_n % 6; - } - - @SideOnly(Side.CLIENT) - public boolean func_78023_l() - { -+ if (field_78033_n > 11) -+ { -+ return ((field_78033_n - 12) % 10) < 5; -+ } - return this.field_78033_n < 6; - } - -@@ -260,4 +282,45 @@ - item.func_150895_a(this, p_78018_1_); - } - } -+ -+ public int getTabPage() -+ { -+ if (field_78033_n > 11) -+ { -+ return ((field_78033_n - 12) / 10) + 1; -+ } -+ return 0; -+ } -+ -+ public static int getNextID() -+ { -+ return field_78032_a.length; -+ } -+ -+ /** -+ * Determines if the search bar should be shown for this tab. -+ * -+ * @return True to show the bar -+ */ -+ public boolean hasSearchBar() -+ { -+ return field_78033_n == CreativeTabs.field_78027_g.field_78033_n; -+ } -+ -+ /** -+ * Gets the width of the search bar of the creative tab, use this if your -+ * creative tab name overflows together with a custom texture. -+ * -+ * @return The width of the search bar, 89 by default -+ */ -+ public int getSearchbarWidth() -+ { -+ return 89; -+ } -+ -+ @SideOnly(Side.CLIENT) -+ public net.minecraft.util.ResourceLocation getBackgroundImage() -+ { -+ return new net.minecraft.util.ResourceLocation("textures/gui/container/creative_inventory/tab_" + this.func_78015_f()); -+ } - } diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch deleted file mode 100644 index 63b50dc7d3..0000000000 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../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/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch deleted file mode 100644 index f60bac6846..0000000000 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch deleted file mode 100644 index ba05147502..0000000000 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- ../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/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch deleted file mode 100644 index 821c4f1a58..0000000000 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentThorns.java.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- ../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/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch b/patches/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch deleted file mode 100644 index 1643ab6c7e..0000000000 --- a/patches/minecraft/net/minecraft/enchantment/EnumEnchantmentType.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch deleted file mode 100644 index 91c2107134..0000000000 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ /dev/null @@ -1,415 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/Entity.java -+++ ../src-work/minecraft/net/minecraft/entity/Entity.java -@@ -85,7 +85,7 @@ - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - --public abstract class Entity implements ICommandSender -+public abstract class Entity implements ICommandSender, net.minecraftforge.common.capabilities.ICapabilitySerializable - { - private static final Logger field_184243_a = LogManager.getLogger(); - private static final List field_190535_b = Collections.emptyList(); -@@ -177,6 +177,10 @@ - private boolean field_184237_aG; - private final double[] field_191505_aI; - private long field_191506_aJ; -+ /** -+ * Setting this to true will prevent the world from calling {@link #onUpdate()} for this entity. -+ */ -+ public boolean updateBlocked; - - public Entity(World p_i1582_1_) - { -@@ -200,7 +204,7 @@ - - if (p_i1582_1_ != null) - { -- this.field_71093_bK = p_i1582_1_.field_73011_w.func_186058_p().func_186068_a(); -+ this.field_71093_bK = p_i1582_1_.field_73011_w.getDimension(); - } - - this.field_70180_af = new EntityDataManager(this); -@@ -211,8 +215,16 @@ - this.field_70180_af.func_187214_a(field_184234_aB, Boolean.valueOf(false)); - this.field_70180_af.func_187214_a(field_189655_aD, Boolean.valueOf(false)); - this.func_70088_a(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this)); -+ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); - } - -+ /** Forge: Used to store custom data for each entity. */ -+ private NBTTagCompound customEntityData; -+ public boolean captureDrops = false; -+ public java.util.ArrayList capturedDrops = new java.util.ArrayList(); -+ private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; -+ - public int func_145782_y() - { - return this.field_145783_c; -@@ -1053,7 +1065,7 @@ - - protected void func_180429_a(BlockPos p_180429_1_, Block p_180429_2_) - { -- SoundType soundtype = p_180429_2_.func_185467_w(); -+ SoundType soundtype = p_180429_2_.getSoundType(field_70170_p.func_180495_p(p_180429_1_), field_70170_p, p_180429_1_, this); - - if (this.field_70170_p.func_180495_p(p_180429_1_.func_177984_a()).func_177230_c() == Blocks.field_150431_aC) - { -@@ -1259,6 +1271,7 @@ - BlockPos blockpos = new BlockPos(i, j, k); - IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); - -+ if(!iblockstate.func_177230_c().addRunningEffects(iblockstate, field_70170_p, blockpos, this)) - if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) - { - this.field_70170_p.func_175688_a(EnumParticleTypes.BLOCK_CRACK, this.field_70165_t + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, this.func_174813_aQ().field_72338_b + 0.1D, this.field_70161_v + ((double)this.field_70146_Z.nextFloat() - 0.5D) * (double)this.field_70130_N, -this.field_70159_w * 4.0D, 1.5D, -this.field_70179_y * 4.0D, Block.func_176210_f(iblockstate)); -@@ -1277,12 +1290,12 @@ - BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v); - IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); - -+ Boolean result = iblockstate.func_177230_c().isEntityInsideMaterial(this.field_70170_p, blockpos, iblockstate, this, d0, p_70055_1_, true); -+ if (result != null) return result; -+ - if (iblockstate.func_185904_a() == p_70055_1_) - { -- float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F; -- float f1 = (float)(blockpos.func_177956_o() + 1) - f; -- boolean flag = d0 < (double)f1; -- return !flag && this instanceof EntityPlayer ? false : flag; -+ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(p_70055_1_, this, blockpos); - } - else - { -@@ -1707,6 +1720,7 @@ - { - p_189511_1_.func_74757_a("Glowing", this.field_184238_ar); - } -+ p_189511_1_.func_74757_a("UpdateBlocked", updateBlocked); - - if (!this.field_184236_aF.isEmpty()) - { -@@ -1720,6 +1734,9 @@ - p_189511_1_.func_74782_a("Tags", nbttaglist); - } - -+ if (customEntityData != null) p_189511_1_.func_74782_a("ForgeData", customEntityData); -+ if (this.capabilities != null) p_189511_1_.func_74782_a("ForgeCaps", this.capabilities.serializeNBT()); -+ - this.func_70014_b(p_189511_1_); - - if (this.func_184207_aI()) -@@ -1826,7 +1843,11 @@ - this.func_174810_b(p_70020_1_.func_74767_n("Silent")); - this.func_189654_d(p_70020_1_.func_74767_n("NoGravity")); - this.func_184195_f(p_70020_1_.func_74767_n("Glowing")); -+ updateBlocked = p_70020_1_.func_74767_n("UpdateBlocked"); - -+ if (p_70020_1_.func_74764_b("ForgeData")) customEntityData = p_70020_1_.func_74775_l("ForgeData"); -+ if (this.capabilities != null && p_70020_1_.func_74764_b("ForgeCaps")) this.capabilities.deserializeNBT(p_70020_1_.func_74775_l("ForgeCaps")); -+ - if (p_70020_1_.func_150297_b("Tags", 9)) - { - this.field_184236_aF.clear(); -@@ -1918,7 +1939,10 @@ - { - EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_); - entityitem.func_174869_p(); -- this.field_70170_p.func_72838_d(entityitem); -+ if (captureDrops) -+ this.capturedDrops.add(entityitem); -+ else -+ this.field_70170_p.func_72838_d(entityitem); - return entityitem; - } - } -@@ -1985,6 +2009,7 @@ - this.field_70159_w = 0.0D; - this.field_70181_x = 0.0D; - this.field_70179_y = 0.0D; -+ if(!updateBlocked) - this.func_70071_h_(); - - if (this.func_184218_aH()) -@@ -2032,6 +2057,7 @@ - } - } - -+ if (!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_184205_1_, true)) return false; - if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) - { - if (this.func_184218_aH()) -@@ -2067,6 +2093,7 @@ - if (this.field_184239_as != null) - { - Entity entity = this.field_184239_as; -+ if (!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, entity, false)) return; - this.field_184239_as = null; - entity.func_184225_p(this); - } -@@ -2509,8 +2536,16 @@ - @Nullable - public Entity func_184204_a(int p_184204_1_) - { -+ if (this.field_70170_p.field_72995_K || this.field_70128_L) return null; -+ return changeDimension(p_184204_1_, this.func_184102_h().func_71218_a(p_184204_1_).func_85176_s()); -+ } -+ -+ @Nullable // Forge: Entities that require custom handling should override this method, not the other -+ public Entity changeDimension(int p_184204_1_, net.minecraftforge.common.util.ITeleporter teleporter) -+ { - if (!this.field_70170_p.field_72995_K && !this.field_70128_L) - { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return null; - this.field_70170_p.field_72984_F.func_76320_a("changeDimension"); - MinecraftServer minecraftserver = this.func_184102_h(); - int i = this.field_71093_bK; -@@ -2518,7 +2553,7 @@ - WorldServer worldserver1 = minecraftserver.func_71218_a(p_184204_1_); - this.field_71093_bK = p_184204_1_; - -- if (i == 1 && p_184204_1_ == 1) -+ if (i == 1 && p_184204_1_ == 1 && teleporter.isVanilla()) - { - worldserver1 = minecraftserver.func_71218_a(0); - this.field_71093_bK = 0; -@@ -2529,22 +2564,23 @@ - this.field_70170_p.field_72984_F.func_76320_a("reposition"); - BlockPos blockpos; - -- if (p_184204_1_ == 1) -+ if (p_184204_1_ == 1 && teleporter.isVanilla()) - { - blockpos = worldserver1.func_180504_m(); - } - else - { -- double d0 = this.field_70165_t; -- double d1 = this.field_70161_v; -+ double moveFactor = worldserver.field_73011_w.getMovementFactor() / worldserver1.field_73011_w.getMovementFactor(); -+ double d0 = MathHelper.func_151237_a(this.field_70165_t * moveFactor, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D); -+ double d1 = MathHelper.func_151237_a(this.field_70161_v * moveFactor, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D); - double d2 = 8.0D; - -- if (p_184204_1_ == -1) -+ if (false && p_184204_1_ == -1) - { - d0 = MathHelper.func_151237_a(d0 / 8.0D, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D); - d1 = MathHelper.func_151237_a(d1 / 8.0D, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D); - } -- else if (p_184204_1_ == 0) -+ else if (false && p_184204_1_ == 0) - { - d0 = MathHelper.func_151237_a(d0 * 8.0D, worldserver1.func_175723_af().func_177726_b() + 16.0D, worldserver1.func_175723_af().func_177728_d() - 16.0D); - d1 = MathHelper.func_151237_a(d1 * 8.0D, worldserver1.func_175723_af().func_177736_c() + 16.0D, worldserver1.func_175723_af().func_177733_e() - 16.0D); -@@ -2554,8 +2590,7 @@ - d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872); - float f = this.field_70177_z; - this.func_70012_b(d0, this.field_70163_u, d1, 90.0F, 0.0F); -- Teleporter teleporter = worldserver1.func_85176_s(); -- teleporter.func_180620_b(this, f); -+ teleporter.placeEntity(worldserver1, this, f); - blockpos = new BlockPos(this); - } - -@@ -2567,7 +2602,7 @@ - { - entity.func_180432_n(this); - -- if (i == 1 && p_184204_1_ == 1) -+ if (i == 1 && p_184204_1_ == 1 && teleporter.isVanilla()) - { - BlockPos blockpos1 = worldserver1.func_175672_r(worldserver1.func_175694_M()); - entity.func_174828_a(blockpos1, entity.field_70177_z, entity.field_70125_A); -@@ -2604,7 +2639,7 @@ - - public float func_180428_a(Explosion p_180428_1_, World p_180428_2_, BlockPos p_180428_3_, IBlockState p_180428_4_) - { -- return p_180428_4_.func_177230_c().func_149638_a(this); -+ return p_180428_4_.func_177230_c().getExplosionResistance(p_180428_2_, p_180428_3_, this, p_180428_1_); - } - - public boolean func_174816_a(Explosion p_174816_1_, World p_174816_2_, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_) -@@ -2901,6 +2936,183 @@ - EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_); - } - -+ /* ================================== Forge Start =====================================*/ -+ /** -+ * Returns a NBTTagCompound that can be used to store custom data for this entity. -+ * It will be written, and read from disc, so it persists over world saves. -+ * @return A NBTTagCompound -+ */ -+ public NBTTagCompound getEntityData() -+ { -+ if (customEntityData == null) -+ { -+ customEntityData = new NBTTagCompound(); -+ } -+ return customEntityData; -+ } -+ -+ /** -+ * Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position. -+ * @return false to prevent an entity that is mounted to this entity from displaying the 'sitting' animation. -+ */ -+ public boolean shouldRiderSit() -+ { -+ return true; -+ } -+ -+ /** -+ * Called when a user uses the creative pick block button on this entity. -+ * -+ * @param target The full target the player is looking at -+ * @return A ItemStack to add to the player's inventory, empty ItemStack if nothing should be added. -+ */ -+ public ItemStack getPickedResult(RayTraceResult target) -+ { -+ if (this instanceof net.minecraft.entity.item.EntityPainting) -+ { -+ return new ItemStack(net.minecraft.init.Items.field_151159_an); -+ } -+ else if (this instanceof EntityLeashKnot) -+ { -+ return new ItemStack(net.minecraft.init.Items.field_151058_ca); -+ } -+ else if (this instanceof net.minecraft.entity.item.EntityItemFrame) -+ { -+ ItemStack held = ((net.minecraft.entity.item.EntityItemFrame)this).func_82335_i(); -+ if (held.func_190926_b()) -+ { -+ return new ItemStack(net.minecraft.init.Items.field_151160_bD); -+ } -+ else -+ { -+ return held.func_77946_l(); -+ } -+ } -+ else if (this instanceof net.minecraft.entity.item.EntityMinecart) -+ { -+ return ((net.minecraft.entity.item.EntityMinecart)this).getCartItem(); -+ } -+ else if (this instanceof net.minecraft.entity.item.EntityBoat) -+ { -+ return new ItemStack(((EntityBoat)this).func_184455_j()); -+ } -+ else if (this instanceof net.minecraft.entity.item.EntityArmorStand) -+ { -+ return new ItemStack(net.minecraft.init.Items.field_179565_cj); -+ } -+ else if (this instanceof net.minecraft.entity.item.EntityEnderCrystal) -+ { -+ return new ItemStack(net.minecraft.init.Items.field_185158_cP); -+ } -+ else -+ { -+ ResourceLocation name = EntityList.func_191301_a(this); -+ if (name != null && EntityList.field_75627_a.containsKey(name)) -+ { -+ ItemStack stack = new ItemStack(net.minecraft.init.Items.field_151063_bx); -+ net.minecraft.item.ItemMonsterPlacer.func_185078_a(stack, name); -+ return stack; -+ } -+ } -+ return ItemStack.field_190927_a; -+ } -+ -+ public UUID getPersistentID() -+ { -+ return field_96093_i; -+ } -+ -+ /** -+ * Reset the entity ID to a new value. Not to be used from Mod code -+ */ -+ @Deprecated // TODO: remove (1.13?) -+ public final void resetEntityId() -+ { -+ this.field_145783_c = field_70152_a++; -+ } -+ -+ public boolean shouldRenderInPass(int pass) -+ { -+ return pass == 0; -+ } -+ -+ /** -+ * Returns true if the entity is of the @link{EnumCreatureType} provided -+ * @param type The EnumCreatureType type this entity is evaluating -+ * @param forSpawnCount If this is being invoked to check spawn count caps. -+ * @return If the creature is of the type provided -+ */ -+ public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) -+ { -+ if (forSpawnCount && (this instanceof EntityLiving) && ((EntityLiving)this).func_104002_bU()) return false; -+ return type.func_75598_a().isAssignableFrom(this.getClass()); -+ } -+ -+ /** -+ * If a rider of this entity can interact with this entity. Should return true on the -+ * ridden entity if so. -+ * -+ * @return if the entity can be interacted with from a rider -+ */ -+ public boolean canRiderInteract() -+ { -+ return false; -+ } -+ -+ /** -+ * If the rider should be dismounted from the entity when the entity goes under water -+ * -+ * @param rider The entity that is riding -+ * @return if the entity should be dismounted when under water -+ */ -+ public boolean shouldDismountInWater(Entity rider) -+ { -+ return this instanceof EntityLivingBase; -+ } -+ -+ @Override -+ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) -+ { -+ return capabilities != null && 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_70020_e(nbt); -+ } -+ -+ public NBTTagCompound serializeNBT() -+ { -+ NBTTagCompound ret = new NBTTagCompound(); -+ ret.func_74778_a("id", this.func_70022_Q()); -+ return this.func_189511_e(ret); -+ } -+ -+ /** -+ * Checks if this {@link Entity} can trample a {@link Block}. -+ * -+ * @param world The world in which the block will be trampled -+ * @param block The block being tested -+ * @param pos The block pos -+ * @param fallDistance The fall distance -+ * @return {@code true} if this entity can trample, {@code false} otherwise -+ */ -+ public boolean canTrample(World world, Block block, BlockPos pos, float fallDistance) -+ { -+ return world.field_73012_v.nextFloat() < fallDistance - 0.5F -+ && this instanceof EntityLivingBase -+ && (this instanceof EntityPlayer || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(world, this)) -+ && this.field_70130_N * this.field_70130_N * this.field_70131_O > 0.512F; -+ } -+ /* ================================== Forge End =====================================*/ -+ - public void func_184178_b(EntityPlayerMP p_184178_1_) - { - } diff --git a/patches/minecraft/net/minecraft/entity/EntityAgeable.java.patch b/patches/minecraft/net/minecraft/entity/EntityAgeable.java.patch deleted file mode 100644 index e0d2dae6f5..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityAgeable.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/EntityFlying.java.patch b/patches/minecraft/net/minecraft/entity/EntityFlying.java.patch deleted file mode 100644 index 6b4ceb1355..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityFlying.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/EntityHanging.java.patch b/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch deleted file mode 100644 index c45f2b2060..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/EntityHanging.java -+++ ../src-work/minecraft/net/minecraft/entity/EntityHanging.java -@@ -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/minecraft/net/minecraft/entity/EntityList.java.patch b/patches/minecraft/net/minecraft/entity/EntityList.java.patch deleted file mode 100644 index b3a6819757..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityList.java.patch +++ /dev/null @@ -1,183 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch deleted file mode 100644 index d23ec224a8..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ /dev/null @@ -1,88 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch deleted file mode 100644 index fd41f3a8bc..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ /dev/null @@ -1,482 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch b/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch deleted file mode 100644 index daaee18734..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntitySpawnPlacementRegistry.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/EntityTracker.java.patch b/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch deleted file mode 100644 index 33c225524b..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch b/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch deleted file mode 100644 index 9c189b957b..0000000000 --- a/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch b/patches/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch deleted file mode 100644 index 8ee4d336e8..0000000000 --- a/patches/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch deleted file mode 100644 index 30ff2d1249..0000000000 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackMelee.java.patch +++ /dev/null @@ -1,55 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch deleted file mode 100644 index 78f527bfd3..0000000000 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch deleted file mode 100644 index 48fda1f826..0000000000 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIMate.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch deleted file mode 100644 index 0392b138ca..0000000000 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch deleted file mode 100644 index 9b81a621ec..0000000000 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch deleted file mode 100644 index 21ac117609..0000000000 --- a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch deleted file mode 100644 index 98bbf2a3bc..0000000000 --- a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch b/patches/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch deleted file mode 100644 index 3140d39b66..0000000000 --- a/patches/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseSittingFlaming.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch deleted file mode 100644 index e8fbc7e342..0000000000 --- a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch deleted file mode 100644 index 8c245c4f5d..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityArmorStand.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityArmorStand.java -@@ -58,7 +58,7 @@ - { - public boolean apply(@Nullable Entity p_apply_1_) - { -- return p_apply_1_ instanceof EntityMinecart && ((EntityMinecart)p_apply_1_).func_184264_v() == EntityMinecart.Type.RIDEABLE; -+ return p_apply_1_ instanceof EntityMinecart && ((EntityMinecart)p_apply_1_).canBeRidden(); - } - }; - private final NonNullList field_184799_bw; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch deleted file mode 100644 index 46a988983c..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityBoat.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityBoat.java -@@ -508,7 +508,7 @@ - - if (!list.isEmpty()) - { -- f += iblockstate.func_177230_c().field_149765_K; -+ f += iblockstate.func_177230_c().getSlipperiness(iblockstate, this.field_70170_p, blockpos$pooledmutableblockpos, this); - ++k1; - } - -@@ -980,4 +980,20 @@ - return values()[0]; - } - } -+ -+ // Forge: Fix MC-119811 by instantly completing lerp on board -+ @Override -+ protected void func_184200_o(Entity passenger) -+ { -+ super.func_184200_o(passenger); -+ if(this.func_184186_bw() && this.field_184476_at > 0) -+ { -+ this.field_184476_at = 0; -+ this.field_70165_t = this.field_70281_h; -+ this.field_70163_u = this.field_184477_av; -+ this.field_70161_v = this.field_184478_aw; -+ this.field_70177_z = (float)this.field_70273_g; -+ this.field_70125_A = (float)this.field_184479_ay; -+ } -+ } - } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch deleted file mode 100644 index 46afa1b579..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch deleted file mode 100644 index a6322acef4..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch deleted file mode 100644 index b86590467a..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ /dev/null @@ -1,139 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch deleted file mode 100644 index 021151acbf..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityItemFrame.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityItemFrame.java -@@ -140,13 +140,14 @@ - { - if (!p_110131_1_.func_190926_b()) - { -- if (p_110131_1_.func_77973_b() == Items.field_151098_aY) -+ if (p_110131_1_.func_77973_b() instanceof net.minecraft.item.ItemMap) - { - MapData mapdata = ((ItemMap)p_110131_1_.func_77973_b()).func_77873_a(p_110131_1_, this.field_70170_p); - mapdata.field_76203_h.remove("frame-" + this.func_145782_y()); - } - - p_110131_1_.func_82842_a((EntityItemFrame)null); -+ this.func_82334_a(ItemStack.field_190927_a); //Forge: Fix MC-124833 Pistons duplicating Items. - } - } - diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch deleted file mode 100644 index 834e56aff0..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ /dev/null @@ -1,494 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecart.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java -@@ -59,6 +59,20 @@ - @SideOnly(Side.CLIENT) - private double field_70506_as; - -+ /* Forge: Minecart Compatibility Layer Integration. */ -+ public static float defaultMaxSpeedAirLateral = 0.4f; -+ public static float defaultMaxSpeedAirVertical = -1f; -+ public static double defaultDragAir = 0.94999998807907104D; -+ protected boolean canUseRail = true; -+ protected boolean canBePushed = true; -+ private static net.minecraftforge.common.IMinecartCollisionHandler collisionHandler = null; -+ -+ /* Instance versions of the above physics properties */ -+ private float currentSpeedRail = getMaxCartSpeedOnRail(); -+ protected float maxSpeedAirLateral = defaultMaxSpeedAirLateral; -+ protected float maxSpeedAirVertical = defaultMaxSpeedAirVertical; -+ protected double dragAir = defaultDragAir; -+ - public EntityMinecart(World p_i1712_1_) - { - super(p_i1712_1_); -@@ -105,18 +119,20 @@ - @Nullable - public AxisAlignedBB func_70114_g(Entity p_70114_1_) - { -+ if (getCollisionHandler() != null) return getCollisionHandler().getCollisionBox(this, p_70114_1_); - return p_70114_1_.func_70104_M() ? p_70114_1_.func_174813_aQ() : null; - } - - @Nullable - public AxisAlignedBB func_70046_E() - { -+ if (getCollisionHandler() != null) return getCollisionHandler().getBoundingBox(this); - return null; - } - - public boolean func_70104_M() - { -- return true; -+ return canBePushed; - } - - public EntityMinecart(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) -@@ -322,7 +338,7 @@ - BlockPos blockpos = new BlockPos(k, l, i1); - IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); - -- if (BlockRailBase.func_176563_d(iblockstate)) -+ if (canUseRail() && BlockRailBase.func_176563_d(iblockstate)) - { - this.func_180460_a(blockpos, iblockstate); - -@@ -361,9 +377,13 @@ - - this.func_70101_b(this.field_70177_z, this.field_70125_A); - -- if (this.func_184264_v() == EntityMinecart.Type.RIDEABLE && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D) -+ AxisAlignedBB box; -+ if (getCollisionHandler() != null) box = getCollisionHandler().getMinecartCollisionBox(this); -+ else box = this.func_174813_aQ().func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D); -+ -+ if (canBeRidden() && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D) - { -- List list = this.field_70170_p.func_175674_a(this, this.func_174813_aQ().func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D), EntitySelectors.func_188442_a(this)); -+ List list = this.field_70170_p.func_175674_a(this, box, EntitySelectors.func_188442_a(this)); - - if (!list.isEmpty()) - { -@@ -384,7 +404,7 @@ - } - else - { -- for (Entity entity : this.field_70170_p.func_72839_b(this, this.func_174813_aQ().func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D))) -+ for (Entity entity : this.field_70170_p.func_72839_b(this, box)) - { - if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof EntityMinecart) - { -@@ -394,6 +414,7 @@ - } - - this.func_70072_I(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartUpdateEvent(this, this.getCurrentRailPosition())); - } - } - -@@ -408,10 +429,21 @@ - - protected void func_180459_n() - { -- double d0 = this.func_174898_m(); -+ double d0 = field_70122_E ? this.func_174898_m() : getMaxSpeedAirLateral(); - this.field_70159_w = MathHelper.func_151237_a(this.field_70159_w, -d0, d0); - this.field_70179_y = MathHelper.func_151237_a(this.field_70179_y, -d0, d0); - -+ double moveY = field_70181_x; -+ if(getMaxSpeedAirVertical() > 0 && field_70181_x > getMaxSpeedAirVertical()) -+ { -+ moveY = getMaxSpeedAirVertical(); -+ if(Math.abs(field_70159_w) < 0.3f && Math.abs(field_70179_y) < 0.3f) -+ { -+ moveY = 0.15f; -+ field_70181_x = moveY; -+ } -+ } -+ - if (this.field_70122_E) - { - this.field_70159_w *= 0.5D; -@@ -419,13 +451,13 @@ - this.field_70179_y *= 0.5D; - } - -- this.func_70091_d(MoverType.SELF, this.field_70159_w, this.field_70181_x, this.field_70179_y); -+ this.func_70091_d(MoverType.SELF, this.field_70159_w, moveY, this.field_70179_y); - - if (!this.field_70122_E) - { -- this.field_70159_w *= 0.949999988079071D; -- this.field_70181_x *= 0.949999988079071D; -- this.field_70179_y *= 0.949999988079071D; -+ this.field_70159_w *= getDragAir(); -+ this.field_70181_x *= getDragAir(); -+ this.field_70179_y *= getDragAir(); - } - } - -@@ -445,25 +477,25 @@ - flag1 = !flag; - } - -- double d0 = 0.0078125D; -- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.func_177229_b(blockrailbase.func_176560_l()); -+ double slopeAdjustment = getSlopeAdjustment(); -+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = blockrailbase.getRailDirection(field_70170_p, p_180460_1_, p_180460_2_, this); - - switch (blockrailbase$enumraildirection) - { - case ASCENDING_EAST: -- this.field_70159_w -= 0.0078125D; -+ this.field_70159_w -= slopeAdjustment; - ++this.field_70163_u; - break; - case ASCENDING_WEST: -- this.field_70159_w += 0.0078125D; -+ this.field_70159_w += slopeAdjustment; - ++this.field_70163_u; - break; - case ASCENDING_NORTH: -- this.field_70179_y += 0.0078125D; -+ this.field_70179_y += slopeAdjustment; - ++this.field_70163_u; - break; - case ASCENDING_SOUTH: -- this.field_70179_y -= 0.0078125D; -+ this.field_70179_y -= slopeAdjustment; - ++this.field_70163_u; - } - -@@ -509,7 +541,7 @@ - } - } - -- if (flag1) -+ if (flag1 && shouldDoRailFunctions()) - { - double d17 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); - -@@ -555,20 +587,8 @@ - this.field_70165_t = d18 + d1 * d10; - this.field_70161_v = d19 + d2 * d10; - this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); -- double d22 = this.field_70159_w; -- double d23 = this.field_70179_y; -+ this.moveMinecartOnRail(p_180460_1_); - -- if (this.func_184207_aI()) -- { -- d22 *= 0.75D; -- d23 *= 0.75D; -- } -- -- double d13 = this.func_174898_m(); -- d22 = MathHelper.func_151237_a(d22, -d13, d13); -- d23 = MathHelper.func_151237_a(d23, -d13, d13); -- this.func_70091_d(MoverType.SELF, d22, 0.0D, d23); -- - if (aint[0][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[0][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[0][2]) - { - this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)aint[0][1], this.field_70161_v); -@@ -605,8 +625,14 @@ - this.field_70179_y = d5 * (double)(i - p_180460_1_.func_177952_p()); - } - -- if (flag) -+ -+ if(shouldDoRailFunctions()) - { -+ ((BlockRailBase)p_180460_2_.func_177230_c()).onMinecartPass(field_70170_p, this, p_180460_1_); -+ } -+ -+ if (flag && shouldDoRailFunctions()) -+ { - double d15 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); - - if (d15 > 0.01D) -@@ -683,7 +709,7 @@ - - if (BlockRailBase.func_176563_d(iblockstate)) - { -- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()); -+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(field_70170_p, new BlockPos(i, j, k), iblockstate, this); - p_70495_3_ = (double)j; - - if (blockrailbase$enumraildirection.func_177018_c()) -@@ -733,7 +759,7 @@ - - if (BlockRailBase.func_176563_d(iblockstate)) - { -- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()); -+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(field_70170_p, new BlockPos(i, j, k), iblockstate, this); - int[][] aint = field_70500_g[blockrailbase$enumraildirection.func_177015_a()]; - double d0 = (double)i + 0.5D + (double)aint[0][0] * 0.5D; - double d1 = (double)j + 0.0625D + (double)aint[0][1] * 0.5D; -@@ -830,6 +856,12 @@ - - public void func_70108_f(Entity p_70108_1_) - { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, p_70108_1_)); -+ if (getCollisionHandler() != null) -+ { -+ getCollisionHandler().onEntityCollision(this, p_70108_1_); -+ return; -+ } - if (!this.field_70170_p.field_72995_K) - { - if (!p_70108_1_.field_70145_X && !this.field_70145_X) -@@ -877,7 +909,7 @@ - double d7 = p_70108_1_.field_70159_w + this.field_70159_w; - double d8 = p_70108_1_.field_70179_y + this.field_70179_y; - -- if (((EntityMinecart)p_70108_1_).func_184264_v() == EntityMinecart.Type.FURNACE && this.func_184264_v() != EntityMinecart.Type.FURNACE) -+ if (((EntityMinecart)p_70108_1_).isPoweredCart() && !isPoweredCart()) - { - this.field_70159_w *= 0.20000000298023224D; - this.field_70179_y *= 0.20000000298023224D; -@@ -885,7 +917,7 @@ - p_70108_1_.field_70159_w *= 0.949999988079071D; - p_70108_1_.field_70179_y *= 0.949999988079071D; - } -- else if (((EntityMinecart)p_70108_1_).func_184264_v() != EntityMinecart.Type.FURNACE && this.func_184264_v() == EntityMinecart.Type.FURNACE) -+ else if (!((EntityMinecart)p_70108_1_).isPoweredCart() && isPoweredCart()) - { - p_70108_1_.field_70159_w *= 0.20000000298023224D; - p_70108_1_.field_70179_y *= 0.20000000298023224D; -@@ -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)); -+ } - -+ /* =================================== FORGE START ===========================================*/ -+ private BlockPos getCurrentRailPosition() -+ { -+ int x = MathHelper.func_76128_c(this.field_70165_t); -+ int y = MathHelper.func_76128_c(this.field_70163_u); -+ int z = MathHelper.func_76128_c(this.field_70161_v); -+ -+ if (BlockRailBase.func_176562_d(this.field_70170_p, new BlockPos(x, y - 1, z))) y--; -+ return new BlockPos(x, y, z); -+ } -+ -+ protected double getMaxSpeed() -+ { -+ if (!canUseRail()) return func_174898_m(); -+ BlockPos pos = this.getCurrentRailPosition(); -+ IBlockState state = this.field_70170_p.func_180495_p(pos); -+ if (!BlockRailBase.func_176563_d(state)) return func_174898_m(); -+ -+ float railMaxSpeed = ((BlockRailBase)state.func_177230_c()).getRailMaxSpeed(field_70170_p, this, pos); -+ return Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); -+ } -+ -+ /** -+ * Moved to allow overrides. -+ * This code handles minecart movement and speed capping when on a rail. -+ */ -+ public void moveMinecartOnRail(BlockPos pos) -+ { -+ double mX = this.field_70159_w; -+ double mZ = this.field_70179_y; -+ -+ if (this.func_184207_aI()) -+ { -+ mX *= 0.75D; -+ mZ *= 0.75D; -+ } -+ -+ double max = this.getMaxSpeed(); -+ mX = MathHelper.func_151237_a(mX, -max, max); -+ mZ = MathHelper.func_151237_a(mZ, -max, max); -+ this.func_70091_d(MoverType.SELF, mX, 0.0D, mZ); -+ } -+ -+ /** -+ * Gets the current global Minecart Collision handler if none -+ * is registered, returns null -+ * @return The collision handler or null -+ */ -+ @Nullable -+ public static net.minecraftforge.common.IMinecartCollisionHandler getCollisionHandler() -+ { -+ return collisionHandler; -+ } -+ -+ /** -+ * Sets the global Minecart Collision handler, overwrites any -+ * that is currently set. -+ * @param handler The new handler -+ */ -+ public static void setCollisionHandler(net.minecraftforge.common.IMinecartCollisionHandler handler) -+ { -+ collisionHandler = handler; -+ } -+ -+ /** -+ * This function returns an ItemStack that represents this cart. -+ * This should be an ItemStack that can be used by the player to place the cart, -+ * but is not necessary the item the cart drops when destroyed. -+ * @return An ItemStack that can be used to place the cart. -+ */ -+ public ItemStack getCartItem() -+ { -+ if (this instanceof EntityMinecartFurnace) -+ { -+ return new ItemStack(Items.field_151109_aJ); -+ } -+ else if (this instanceof EntityMinecartChest) -+ { -+ return new ItemStack(Items.field_151108_aI); -+ } -+ else if (this instanceof EntityMinecartTNT) -+ { -+ return new ItemStack(Items.field_151142_bV); -+ } -+ else if (this instanceof EntityMinecartHopper) -+ { -+ return new ItemStack(Items.field_151140_bW); -+ } -+ else if (this instanceof EntityMinecartCommandBlock) -+ { -+ return new ItemStack(Items.field_151095_cc); -+ } -+ return new ItemStack(Items.field_151143_au); -+ } -+ -+ /** -+ * Returns true if this cart can currently use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @return True if the minecart can use rails. -+ */ -+ public boolean canUseRail() -+ { -+ return canUseRail; -+ } -+ -+ /** -+ * Set whether the minecart can use rails. -+ * This function is mainly used to gracefully detach a minecart from a rail. -+ * @param use Whether the minecart can currently use rails. -+ */ -+ public void setCanUseRail(boolean use) -+ { -+ canUseRail = use; -+ } -+ -+ /** -+ * Return false if this cart should not call onMinecartPass() and should ignore Powered Rails. -+ * @return True if this cart should call onMinecartPass(). -+ */ -+ public boolean shouldDoRailFunctions() -+ { -+ return true; -+ } -+ -+ /** -+ * Returns true if this cart is self propelled. -+ * @return True if powered. -+ */ -+ public boolean isPoweredCart() -+ { -+ return func_184264_v() == EntityMinecart.Type.FURNACE; -+ } -+ -+ /** -+ * Returns true if this cart can be ridden by an Entity. -+ * @return True if this cart can be ridden. -+ */ -+ public boolean canBeRidden() -+ { -+ return this.func_184264_v() == EntityMinecart.Type.RIDEABLE; -+ } -+ -+ /** -+ * Getters/setters for physics variables -+ */ -+ -+ /** -+ * Returns the carts max speed when traveling on rails. Carts going faster -+ * than 1.1 cause issues with chunk loading. Carts cant traverse slopes or -+ * corners at greater than 0.5 - 0.6. This value is compared with the rails -+ * max speed and the carts current speed cap to determine the carts current -+ * max speed. A normal rail's max speed is 0.4. -+ * -+ * @return Carts max speed. -+ */ -+ public float getMaxCartSpeedOnRail() -+ { -+ return 1.2f; -+ } -+ -+ /** -+ * Returns the current speed cap for the cart when traveling on rails. This -+ * functions differs from getMaxCartSpeedOnRail() in that it controls -+ * current movement and cannot be overridden. The value however can never be -+ * higher than getMaxCartSpeedOnRail(). -+ * -+ * @return -+ */ -+ public final float getCurrentCartSpeedCapOnRail() -+ { -+ return currentSpeedRail; -+ } -+ -+ public final void setCurrentCartSpeedCapOnRail(float value) -+ { -+ value = Math.min(value, getMaxCartSpeedOnRail()); -+ currentSpeedRail = value; -+ } -+ -+ public float getMaxSpeedAirLateral() -+ { -+ return maxSpeedAirLateral; -+ } -+ -+ public void setMaxSpeedAirLateral(float value) -+ { -+ maxSpeedAirLateral = value; -+ } -+ -+ public float getMaxSpeedAirVertical() -+ { -+ return maxSpeedAirVertical; -+ } -+ -+ public void setMaxSpeedAirVertical(float value) -+ { -+ maxSpeedAirVertical = value; -+ } -+ -+ public double getDragAir() -+ { -+ return dragAir; -+ } -+ -+ public void setDragAir(double value) -+ { -+ dragAir = value; -+ } -+ -+ public double getSlopeAdjustment() -+ { -+ return 0.0078125D; -+ } -+ -+ /** -+ * Called from Detector Rails to retrieve a redstone power level for comparators. -+ */ -+ public int getComparatorLevel() -+ { -+ return -1; -+ } -+ -+ /* =================================== FORGE END ===========================================*/ -+ - public static enum Type - { - RIDEABLE(0, "MinecartRideable"), diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java.patch deleted file mode 100644 index e2ffb9ea5f..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartCommandBlock.java -@@ -147,6 +147,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; - this.field_145824_a.func_175574_a(p_184230_1_); - return false; - } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch deleted file mode 100644 index c1ef384edf..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch deleted file mode 100644 index c8e7a04639..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java -@@ -24,6 +24,8 @@ - - 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 (p_184230_1_.func_70093_af()) - { - return false; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch deleted file mode 100644 index 59667b5618..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java -@@ -145,6 +145,8 @@ - { - ItemStack itemstack = p_184230_1_.func_184586_b(p_184230_2_); - -+ if (super.func_184230_a(p_184230_1_, p_184230_2_)) return true; -+ - if (itemstack.func_77973_b() == Items.field_151044_h && this.field_94110_c + 3600 <= 32000) - { - if (!p_184230_1_.field_71075_bZ.field_75098_d) diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch deleted file mode 100644 index 2d09f66485..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java -@@ -57,6 +57,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); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartMobSpawner.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartMobSpawner.java.patch deleted file mode 100644 index b3f36c8924..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartMobSpawner.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartMobSpawner.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartMobSpawner.java -@@ -33,6 +33,9 @@ - { - return new BlockPos(EntityMinecartMobSpawner.this); - } -+ public net.minecraft.entity.Entity getSpawnerEntity() { -+ return EntityMinecartMobSpawner.this; -+ } - }; - - public EntityMinecartMobSpawner(World p_i46752_1_) diff --git a/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch deleted file mode 100644 index 8440a707e1..0000000000 --- a/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/entity/item/EntityXPOrb.java -+++ ../src-work/minecraft/net/minecraft/entity/item/EntityXPOrb.java -@@ -137,7 +137,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; -@@ -170,6 +172,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; -@@ -208,6 +211,7 @@ - { - if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) - { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerPickupXpEvent(p_70100_1_, this))) return; - p_70100_1_.field_71090_bL = 2; - p_70100_1_.func_71001_a(this, 1); - ItemStack itemstack = EnchantmentHelper.func_92099_a(Enchantments.field_185296_A, p_70100_1_); diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch deleted file mode 100644 index ce0edefef9..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch deleted file mode 100644 index 0fe2a53a95..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch deleted file mode 100644 index 2a2e07af69..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntityMob.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityMob.java.patch deleted file mode 100644 index de621ab309..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntityMob.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch deleted file mode 100644 index c9e4dd32a3..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntityShulker.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch deleted file mode 100644 index ee7a4b2413..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch deleted file mode 100644 index 632fa35759..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch deleted file mode 100644 index 264639a7b4..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch deleted file mode 100644 index a54d827189..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombieVillager.java.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch b/patches/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch deleted file mode 100644 index fa9cd4ce97..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/AbstractHorse.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch deleted file mode 100644 index fdce8b1f5f..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch deleted file mode 100644 index ad9f107751..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch deleted file mode 100644 index 2a439cff2c..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch deleted file mode 100644 index 3f5e02cc6e..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch +++ /dev/null @@ -1,134 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch deleted file mode 100644 index 88da777f92..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch deleted file mode 100644 index cdc768b4e8..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch +++ /dev/null @@ -1,204 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch deleted file mode 100644 index ebb5890e4b..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/EntityWolf.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch b/patches/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch deleted file mode 100644 index 31bd698ae0..0000000000 --- a/patches/minecraft/net/minecraft/entity/passive/HorseArmorType.java.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch deleted file mode 100644 index 6fa569a7ec..0000000000 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ /dev/null @@ -1,672 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch deleted file mode 100644 index 51170d5b8a..0000000000 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ /dev/null @@ -1,146 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch deleted file mode 100644 index 4e029b08b9..0000000000 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch deleted file mode 100644 index 726c3d70f7..0000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch deleted file mode 100644 index d33aa12bf3..0000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityFireball.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch deleted file mode 100644 index 316ef38e16..0000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch deleted file mode 100644 index e68d05f26c..0000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityLlamaSpit.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch deleted file mode 100644 index 3707a37a26..0000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch deleted file mode 100644 index 8d0622599d..0000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch deleted file mode 100644 index d8084774b7..0000000000 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityWitherSkull.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/init/Bootstrap.java.patch b/patches/minecraft/net/minecraft/init/Bootstrap.java.patch deleted file mode 100644 index da3c8a012f..0000000000 --- a/patches/minecraft/net/minecraft/init/Bootstrap.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/init/Bootstrap.java -+++ ../src-work/minecraft/net/minecraft/init/Bootstrap.java -@@ -264,6 +264,9 @@ - }; - BlockDispenser.field_149943_a.func_82595_a(Items.field_151129_at, ibehaviordispenseitem); - BlockDispenser.field_149943_a.func_82595_a(Items.field_151131_as, ibehaviordispenseitem); -+ BlockDispenser.field_149943_a.func_82595_a(Items.field_151117_aB, net.minecraftforge.fluids.DispenseFluidContainer.getInstance()); -+ BlockDispenser.field_149943_a.func_82595_a(Items.field_151133_ar, net.minecraftforge.fluids.DispenseFluidContainer.getInstance()); -+ if (false) - BlockDispenser.field_149943_a.func_82595_a(Items.field_151133_ar, new BehaviorDefaultDispenseItem() - { - private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); -@@ -489,6 +492,7 @@ - if (!field_151355_a) - { - field_151355_a = true; -+ if (false) // skip redirectOutputToLog, Forge already redirects stdout and stderr output to log so that they print with more context - func_179868_d(); - SoundEvent.func_187504_b(); - Block.func_149671_p(); -@@ -524,6 +528,8 @@ - field_179871_c.error("Errors with built-in loot tables"); - } - } -+ -+ net.minecraftforge.registries.GameData.vanillaSnapshot(); - } - } - diff --git a/patches/minecraft/net/minecraft/inventory/Container.java.patch b/patches/minecraft/net/minecraft/inventory/Container.java.patch deleted file mode 100644 index db903339de..0000000000 --- a/patches/minecraft/net/minecraft/inventory/Container.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- ../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/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch deleted file mode 100644 index 4ff44b321f..0000000000 --- a/patches/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ../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/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch deleted file mode 100644 index f5b404c234..0000000000 --- a/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/inventory/ContainerBrewingStand.java -+++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java -@@ -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/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch deleted file mode 100644 index c08121be8b..0000000000 --- a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- ../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/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch deleted file mode 100644 index 6fea935b07..0000000000 --- a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch deleted file mode 100644 index 65af6163c5..0000000000 --- a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- ../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/minecraft/net/minecraft/inventory/Slot.java.patch b/patches/minecraft/net/minecraft/inventory/Slot.java.patch deleted file mode 100644 index be2b8209cf..0000000000 --- a/patches/minecraft/net/minecraft/inventory/Slot.java.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/inventory/Slot.java -+++ ../src-work/minecraft/net/minecraft/inventory/Slot.java -@@ -90,7 +90,7 @@ - @SideOnly(Side.CLIENT) - public String func_178171_c() - { -- return null; -+ return backgroundName; - } - - public ItemStack func_75209_a(int p_75209_1_) -@@ -113,4 +113,74 @@ - { - return true; - } -+ -+ /*========================================= FORGE START =====================================*/ -+ protected String backgroundName = null; -+ protected net.minecraft.util.ResourceLocation backgroundLocation = null; -+ protected Object backgroundMap; -+ /** -+ * Gets the path of the texture file to use for the background image of this slot when drawing the GUI. -+ * @return The resource location for the background image -+ */ -+ @SideOnly(Side.CLIENT) -+ public net.minecraft.util.ResourceLocation getBackgroundLocation() -+ { -+ return (backgroundLocation == null ? net.minecraft.client.renderer.texture.TextureMap.field_110575_b : backgroundLocation); -+ } -+ -+ /** -+ * Sets the texture file to use for the background image of the slot when it's empty. -+ * @param texture the resourcelocation for the texture -+ */ -+ @SideOnly(Side.CLIENT) -+ public void setBackgroundLocation(net.minecraft.util.ResourceLocation texture) -+ { -+ this.backgroundLocation = texture; -+ } -+ -+ /** -+ * Sets which icon index to use as the background image of the slot when it's empty. -+ * @param name The icon to use, null for none -+ */ -+ public void setBackgroundName(@Nullable String name) -+ { -+ this.backgroundName = name; -+ } -+ -+ @Nullable -+ @SideOnly(Side.CLIENT) -+ public net.minecraft.client.renderer.texture.TextureAtlasSprite getBackgroundSprite() -+ { -+ String name = func_178171_c(); -+ return name == null ? null : getBackgroundMap().func_110572_b(name); -+ } -+ -+ @SideOnly(Side.CLIENT) -+ protected net.minecraft.client.renderer.texture.TextureMap getBackgroundMap() -+ { -+ if (backgroundMap == null) backgroundMap = net.minecraft.client.Minecraft.func_71410_x().func_147117_R(); -+ return (net.minecraft.client.renderer.texture.TextureMap)backgroundMap; -+ } -+ -+ /** -+ * Retrieves the index in the inventory for this slot, this value should typically not -+ * be used, but can be useful for some occasions. -+ * -+ * @return Index in associated inventory for this slot. -+ */ -+ public int getSlotIndex() -+ { -+ return field_75225_a; -+ } -+ -+ /** -+ * Checks if the other slot is in the same inventory, by comparing the inventory reference. -+ * @param other -+ * @return true if the other slot is in the same inventory -+ */ -+ public boolean isSameInventory(Slot other) -+ { -+ return this.field_75224_c == other.field_75224_c; -+ } -+ /*========================================= FORGE END =====================================*/ - } diff --git a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch deleted file mode 100644 index 8d60d550e1..0000000000 --- a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch b/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch deleted file mode 100644 index 843b762578..0000000000 --- a/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch deleted file mode 100644 index 810dbd0bdb..0000000000 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ /dev/null @@ -1,867 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch deleted file mode 100644 index aeabab817a..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemArrow.java.patch b/patches/minecraft/net/minecraft/item/ItemArrow.java.patch deleted file mode 100644 index 01363b4bb2..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemArrow.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemAxe.java.patch b/patches/minecraft/net/minecraft/item/ItemAxe.java.patch deleted file mode 100644 index 310c9091ee..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemAxe.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemBed.java.patch b/patches/minecraft/net/minecraft/item/ItemBed.java.patch deleted file mode 100644 index f1f00d8507..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemBed.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch deleted file mode 100644 index b750fd2c27..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch b/patches/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch deleted file mode 100644 index 57c528072f..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemBlockSpecial.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemBow.java.patch b/patches/minecraft/net/minecraft/item/ItemBow.java.patch deleted file mode 100644 index 0694e0b30d..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemBow.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch deleted file mode 100644 index 10e135cc2d..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch deleted file mode 100644 index 55f14044e1..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemDoor.java.patch b/patches/minecraft/net/minecraft/item/ItemDoor.java.patch deleted file mode 100644 index 8321edc9c0..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemDoor.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemDye.java.patch b/patches/minecraft/net/minecraft/item/ItemDye.java.patch deleted file mode 100644 index d663936c7c..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemDye.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch deleted file mode 100644 index bc751c1023..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemFlintAndSteel.java -+++ ../src-work/minecraft/net/minecraft/item/ItemFlintAndSteel.java -@@ -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/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch deleted file mode 100644 index 01cd1bbfbb..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemHoe.java -+++ ../src-work/minecraft/net/minecraft/item/ItemHoe.java -@@ -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/minecraft/net/minecraft/item/ItemLilyPad.java.patch b/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch deleted file mode 100644 index 73ca024241..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemMap.java.patch b/patches/minecraft/net/minecraft/item/ItemMap.java.patch deleted file mode 100644 index 93b7709224..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemMap.java.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemMinecart.java.patch b/patches/minecraft/net/minecraft/item/ItemMinecart.java.patch deleted file mode 100644 index 2137fb8ac3..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemMinecart.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch deleted file mode 100644 index 4b6d47a6e3..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch deleted file mode 100644 index 93e4b84fb0..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemShears.java.patch b/patches/minecraft/net/minecraft/item/ItemShears.java.patch deleted file mode 100644 index 20a1ff8b47..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemShears.java.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemSkull.java.patch b/patches/minecraft/net/minecraft/item/ItemSkull.java.patch deleted file mode 100644 index cabea4855a..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemSkull.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemSlab.java.patch b/patches/minecraft/net/minecraft/item/ItemSlab.java.patch deleted file mode 100644 index 483b99ef58..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemSlab.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemSnow.java.patch b/patches/minecraft/net/minecraft/item/ItemSnow.java.patch deleted file mode 100644 index 1cd3c65cb0..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemSnow.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch deleted file mode 100644 index d458745219..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ /dev/null @@ -1,363 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/ItemStack.java -+++ ../src-work/minecraft/net/minecraft/item/ItemStack.java -@@ -50,7 +50,7 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public final class ItemStack -+public final class ItemStack implements net.minecraftforge.common.capabilities.ICapabilitySerializable - { - public static final ItemStack field_190927_a = new ItemStack((Item)null); - public static final DecimalFormat field_111284_a = new DecimalFormat("#.##"); -@@ -66,6 +66,10 @@ - private Block field_179550_j; - private boolean field_179551_k; - -+ private net.minecraftforge.registries.IRegistryDelegate delegate; -+ private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; -+ private NBTTagCompound capNBT; -+ - public ItemStack(Block p_i1876_1_) - { - this(p_i1876_1_, 1); -@@ -91,8 +95,10 @@ - this(p_i1880_1_, p_i1880_2_, 0); - } - -- public ItemStack(Item p_i1881_1_, int p_i1881_2_, int p_i1881_3_) -+ public ItemStack(Item p_i1881_1_, int p_i1881_2_, int p_i1881_3_){ this(p_i1881_1_, p_i1881_2_, p_i1881_3_, null); } -+ public ItemStack(Item p_i1881_1_, int p_i1881_2_, int p_i1881_3_, @Nullable NBTTagCompound capNBT) - { -+ this.capNBT = capNBT; - this.field_151002_e = p_i1881_1_; - this.field_77991_e = p_i1881_3_; - this.field_77994_a = p_i1881_2_; -@@ -103,6 +109,7 @@ - } - - this.func_190923_F(); -+ this.forgeInit(); - } - - private void func_190923_F() -@@ -112,7 +119,8 @@ - - public ItemStack(NBTTagCompound p_i47263_1_) - { -- this.field_151002_e = Item.func_111206_d(p_i47263_1_.func_74779_i("id")); -+ this.capNBT = p_i47263_1_.func_74764_b("ForgeCaps") ? p_i47263_1_.func_74775_l("ForgeCaps") : null; -+ this.field_151002_e = p_i47263_1_.func_150297_b("id", 8) ? Item.func_111206_d(p_i47263_1_.func_74779_i("id")) : Items.field_190931_a; //Forge fix tons of NumberFormatExceptions that are caused by deserializing EMPTY ItemStacks. - this.field_77994_a = p_i47263_1_.func_74771_c("Count"); - this.field_77991_e = Math.max(0, p_i47263_1_.func_74765_d("Damage")); - -@@ -127,6 +135,7 @@ - } - - this.func_190923_F(); -+ this.forgeInit(); - } - - public boolean func_190926_b() -@@ -135,7 +144,7 @@ - { - return true; - } -- else if (this.field_151002_e != null && this.field_151002_e != Item.func_150898_a(Blocks.field_150350_a)) -+ else if (this.getItemRaw() != null && this.getItemRaw() != Items.field_190931_a) - { - if (this.field_77994_a <= 0) - { -@@ -169,11 +178,12 @@ - - public Item func_77973_b() - { -- return this.field_190928_g ? Item.func_150898_a(Blocks.field_150350_a) : this.field_151002_e; -+ return this.field_190928_g || this.delegate == null ? Items.field_190931_a : this.delegate.get(); - } - - public EnumActionResult func_179546_a(EntityPlayer p_179546_1_, World p_179546_2_, BlockPos p_179546_3_, EnumHand p_179546_4_, EnumFacing p_179546_5_, float p_179546_6_, float p_179546_7_, float p_179546_8_) - { -+ if (!p_179546_2_.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_5_, p_179546_6_, p_179546_7_, p_179546_8_, p_179546_4_); - EnumActionResult enumactionresult = this.func_77973_b().func_180614_a(p_179546_1_, p_179546_2_, p_179546_3_, p_179546_4_, p_179546_5_, p_179546_6_, p_179546_7_, p_179546_8_); - - if (enumactionresult == EnumActionResult.SUCCESS) -@@ -184,6 +194,19 @@ - return enumactionresult; - } - -+ public EnumActionResult onItemUseFirst(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) -+ { -+ // copy of onitemuse but for onitemusefirst -+ EnumActionResult enumactionresult = this.func_77973_b().onItemUseFirst(playerIn, worldIn, pos, side, hitX, hitY, hitZ, hand); -+ -+ if (enumactionresult == EnumActionResult.SUCCESS) -+ { -+ playerIn.func_71029_a(StatList.func_188057_b(this.field_151002_e)); -+ } -+ -+ return enumactionresult; -+ } -+ - public float func_150997_a(IBlockState p_150997_1_) - { - return this.func_77973_b().func_150893_a(this, p_150997_1_); -@@ -211,12 +234,18 @@ - p_77955_1_.func_74782_a("tag", this.field_77990_d); - } - -+ if (this.capabilities != null) -+ { -+ NBTTagCompound cnbt = this.capabilities.serializeNBT(); -+ if (!cnbt.func_82582_d()) p_77955_1_.func_74782_a("ForgeCaps", cnbt); -+ } -+ - return p_77955_1_; - } - - public int func_77976_d() - { -- return this.func_77973_b().func_77639_j(); -+ return this.func_77973_b().getItemStackLimit(this); - } - - public boolean func_77985_e() -@@ -230,7 +259,7 @@ - { - return false; - } -- else if (this.field_151002_e.func_77612_l() <= 0) -+ else if (this.field_151002_e.getMaxDamage(this) <= 0) - { - return false; - } -@@ -247,32 +276,27 @@ - - public boolean func_77951_h() - { -- return this.func_77984_f() && this.field_77991_e > 0; -+ return this.func_77984_f() && func_77973_b().isDamaged(this); - } - - public int func_77952_i() - { -- return this.field_77991_e; -+ return func_77973_b().getDamage(this); - } - - public int func_77960_j() - { -- return this.field_77991_e; -+ return func_77973_b().getMetadata(this); - } - - public void func_77964_b(int p_77964_1_) - { -- this.field_77991_e = p_77964_1_; -- -- if (this.field_77991_e < 0) -- { -- this.field_77991_e = 0; -- } -+ func_77973_b().setDamage(this, p_77964_1_); - } - - public int func_77958_k() - { -- return this.func_77973_b().func_77612_l(); -+ return this.func_77973_b().getMaxDamage(this); - } - - public boolean func_96631_a(int p_96631_1_, Random p_96631_2_, @Nullable EntityPlayerMP p_96631_3_) -@@ -309,8 +333,8 @@ - CriteriaTriggers.field_193132_s.func_193158_a(p_96631_3_, this, this.field_77991_e + p_96631_1_); - } - -- this.field_77991_e += p_96631_1_; -- return this.field_77991_e > this.func_77958_k(); -+ func_77964_b(func_77952_i() + p_96631_1_); //Redirect through Item's callback if applicable. -+ return func_77952_i() > func_77958_k(); - } - } - -@@ -359,7 +383,7 @@ - - public boolean func_150998_b(IBlockState p_150998_1_) - { -- return this.func_77973_b().func_150897_b(p_150998_1_); -+ return this.func_77973_b().canHarvestBlock(p_150998_1_, this); - } - - public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_, EnumHand p_111282_3_) -@@ -369,7 +393,7 @@ - - public ItemStack func_77946_l() - { -- ItemStack itemstack = new ItemStack(this.field_151002_e, this.field_77994_a, this.field_77991_e); -+ ItemStack itemstack = new ItemStack(this.field_151002_e, this.field_77994_a, this.field_77991_e, this.capabilities != null ? this.capabilities.serializeNBT() : null); - itemstack.func_190915_d(this.func_190921_D()); - - if (this.field_77990_d != null) -@@ -394,7 +418,7 @@ - } - else - { -- return p_77970_0_.field_77990_d == null || p_77970_0_.field_77990_d.equals(p_77970_1_.field_77990_d); -+ return (p_77970_0_.field_77990_d == null || p_77970_0_.field_77990_d.equals(p_77970_1_.field_77990_d)) && p_77970_0_.areCapsCompatible(p_77970_1_); - } - } - else -@@ -435,7 +459,7 @@ - } - else - { -- return this.field_77990_d == null || this.field_77990_d.equals(p_77959_1_.field_77990_d); -+ return (this.field_77990_d == null || this.field_77990_d.equals(p_77959_1_.field_77990_d)) && this.areCapsCompatible(p_77959_1_); - } - } - -@@ -862,6 +886,7 @@ - } - } - -+ net.minecraftforge.event.ForgeEventFactory.onItemTooltip(this, p_82840_1_, list, p_82840_2_); - return list; - } - -@@ -987,7 +1012,7 @@ - } - else - { -- multimap = this.func_77973_b().func_111205_h(p_111283_1_); -+ multimap = this.func_77973_b().getAttributeModifiers(p_111283_1_, this); - } - - return multimap; -@@ -1130,4 +1155,128 @@ - { - this.func_190917_f(-p_190918_1_); - } -+ -+ @Override -+ public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) -+ { -+ return this.field_190928_g || this.capabilities == null ? false : this.capabilities.hasCapability(capability, facing); -+ } -+ -+ @Override -+ @Nullable -+ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @Nullable net.minecraft.util.EnumFacing facing) -+ { -+ return this.field_190928_g || this.capabilities == null ? null : this.capabilities.getCapability(capability, facing); -+ } -+ -+ public void deserializeNBT(NBTTagCompound nbt) -+ { -+ // TODO do this better while respecting new rules -+ final ItemStack itemStack = new ItemStack(nbt); -+ this.field_77990_d = itemStack.field_77990_d; -+ this.capNBT = itemStack.capNBT; -+ } -+ -+ public NBTTagCompound serializeNBT() -+ { -+ NBTTagCompound ret = new NBTTagCompound(); -+ this.func_77955_b(ret); -+ return ret; -+ } -+ -+ public boolean areCapsCompatible(ItemStack other) -+ { -+ if (this.capabilities == null) -+ { -+ if (other.capabilities == null) -+ { -+ return true; -+ } -+ else -+ { -+ return other.capabilities.areCompatible(null); -+ } -+ } -+ else -+ { -+ return this.capabilities.areCompatible(other.capabilities); -+ } -+ } -+ -+ /** -+ * Set up forge's ItemStack additions. -+ */ -+ private void forgeInit() -+ { -+ Item item = getItemRaw(); -+ if (item != null) -+ { -+ this.delegate = item.delegate; -+ net.minecraftforge.common.capabilities.ICapabilityProvider provider = item.initCapabilities(this, this.capNBT); -+ this.capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this, provider); -+ if (this.capNBT != null && this.capabilities != null) this.capabilities.deserializeNBT(this.capNBT); -+ } -+ } -+ -+ /** -+ * Internal call to get the actual item, not the delegate. -+ * In all other methods, FML replaces calls to this.item with the item delegate. -+ */ -+ @Nullable -+ private Item getItemRaw() -+ { -+ return this.field_151002_e; -+ } -+ -+ /** -+ * Modeled after ItemStack.areItemStacksEqual -+ * Uses Item.getNBTShareTag for comparison instead of NBT and capabilities. -+ * Only used for comparing itemStacks that were transferred from server to client using Item.getNBTShareTag. -+ */ -+ public static boolean areItemStacksEqualUsingNBTShareTag(ItemStack stackA, ItemStack stackB) -+ { -+ if (stackA.func_190926_b()) -+ return stackB.func_190926_b(); -+ else -+ return !stackB.func_190926_b() && stackA.isItemStackEqualUsingNBTShareTag(stackB); -+ } -+ -+ /** -+ * Modeled after ItemStack.isItemStackEqual -+ * Uses Item.getNBTShareTag for comparison instead of NBT and capabilities. -+ * Only used for comparing itemStacks that were transferred from server to client using Item.getNBTShareTag. -+ */ -+ private boolean isItemStackEqualUsingNBTShareTag(ItemStack other) -+ { -+ return this.field_77994_a == other.field_77994_a && this.func_77973_b() == other.func_77973_b() && this.field_77991_e == other.field_77991_e && areItemStackShareTagsEqual(this, other); -+ } -+ -+ /** -+ * Modeled after ItemStack.areItemStackTagsEqual -+ * Uses Item.getNBTShareTag for comparison instead of NBT and capabilities. -+ * Only used for comparing itemStacks that were transferred from server to client using Item.getNBTShareTag. -+ */ -+ public static boolean areItemStackShareTagsEqual(ItemStack stackA, ItemStack stackB) -+ { -+ NBTTagCompound shareTagA = stackA.func_77973_b().getNBTShareTag(stackA); -+ NBTTagCompound shareTagB = stackB.func_77973_b().getNBTShareTag(stackB); -+ if (shareTagA == null) -+ return shareTagB == null; -+ else -+ return shareTagB != null && shareTagA.equals(shareTagB); -+ } -+ -+ /** -+ * -+ * 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(net.minecraft.world.IBlockAccess world, BlockPos pos, EntityPlayer player) -+ { -+ return this.func_190926_b() || this.func_77973_b().doesSneakBypassUse(this, world, pos, player); -+ } - } diff --git a/patches/minecraft/net/minecraft/item/ItemSword.java.patch b/patches/minecraft/net/minecraft/item/ItemSword.java.patch deleted file mode 100644 index 178744f5fe..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemSword.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/ItemTool.java.patch b/patches/minecraft/net/minecraft/item/ItemTool.java.patch deleted file mode 100644 index 1cc6b23a85..0000000000 --- a/patches/minecraft/net/minecraft/item/ItemTool.java.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- ../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/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch deleted file mode 100644 index de4592198a..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.java.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/CraftingManager.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/CraftingManager.java -@@ -36,7 +36,7 @@ - { - private static final Logger field_192422_a = LogManager.getLogger(); - private static int field_193381_c; -- public static final RegistryNamespaced field_193380_a = new RegistryNamespaced(); -+ public static final RegistryNamespaced field_193380_a = net.minecraftforge.registries.GameData.getWrapper(IRecipe.class); - - public static boolean func_193377_a() - { -@@ -173,12 +173,14 @@ - } - } - -- public static void func_193379_a(String p_193379_0_, IRecipe p_193379_1_) -+ //Forge: Made private use GameData/Registry events! -+ private static void func_193379_a(String p_193379_0_, IRecipe p_193379_1_) - { - func_193372_a(new ResourceLocation(p_193379_0_), p_193379_1_); - } - -- public static void func_193372_a(ResourceLocation p_193372_0_, IRecipe p_193372_1_) -+ //Forge: Made private use GameData/Registry events! -+ private static void func_193372_a(ResourceLocation p_193372_0_, IRecipe p_193372_1_) - { - if (field_193380_a.func_148741_d(p_193372_0_)) - { -@@ -243,11 +245,13 @@ - return field_193380_a.func_82594_a(p_193373_0_); - } - -+ @Deprecated //DO NOT USE THIS - public static int func_193375_a(IRecipe p_193375_0_) - { - return field_193380_a.func_148757_b(p_193375_0_); - } - -+ @Deprecated //DO NOT USE THIS - @Nullable - public static IRecipe func_193374_a(int p_193374_0_) - { diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch deleted file mode 100644 index f7a4595ff8..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java -@@ -113,6 +113,7 @@ - - public void func_151394_a(ItemStack p_151394_1_, ItemStack p_151394_2_, float p_151394_3_) - { -+ if (func_151395_a(p_151394_1_) != ItemStack.field_190927_a) { net.minecraftforge.fml.common.FMLLog.log.info("Ignored smelting recipe with conflicting input: {} = {}", p_151394_1_, p_151394_2_); return; } - this.field_77604_b.put(p_151394_1_, p_151394_2_); - this.field_77605_c.put(p_151394_2_, Float.valueOf(p_151394_3_)); - } -@@ -142,6 +143,9 @@ - - public float func_151398_b(ItemStack p_151398_1_) - { -+ float ret = p_151398_1_.func_77973_b().getSmeltingExperience(p_151398_1_); -+ if (ret != -1) return ret; -+ - for (Entry entry : this.field_77605_c.entrySet()) - { - if (this.func_151397_a(p_151398_1_, entry.getKey())) diff --git a/patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch b/patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch deleted file mode 100644 index 03ec0313d6..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/IRecipe.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/IRecipe.java -@@ -4,21 +4,21 @@ - import net.minecraft.item.ItemStack; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public interface IRecipe -+public interface IRecipe extends net.minecraftforge.registries.IForgeRegistryEntry - { - boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_); - - ItemStack func_77572_b(InventoryCrafting p_77572_1_); - -- @SideOnly(Side.CLIENT) - boolean func_194133_a(int p_194133_1_, int p_194133_2_); - - ItemStack func_77571_b(); - -- NonNullList func_179532_b(InventoryCrafting p_179532_1_); -+ default NonNullList func_179532_b(InventoryCrafting p_179532_1_) -+ { -+ return net.minecraftforge.common.ForgeHooks.defaultRecipeGetRemainingItems(p_179532_1_); -+ } - - default NonNullList func_192400_c() - { -@@ -30,7 +30,6 @@ - return false; - } - -- @SideOnly(Side.CLIENT) - default String func_193358_e() - { - return ""; diff --git a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch b/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch deleted file mode 100644 index 8990be4c34..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch +++ /dev/null @@ -1,112 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/Ingredient.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/Ingredient.java -@@ -8,11 +8,11 @@ - import net.minecraft.client.util.RecipeItemHelper; - import net.minecraft.item.Item; - import net.minecraft.item.ItemStack; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - - public class Ingredient implements Predicate - { -+ //Because Mojang caches things... we need to invalidate them.. so... here we go.. -+ private static final java.util.Set INSTANCES = java.util.Collections.newSetFromMap(new java.util.WeakHashMap()); - public static final Ingredient field_193370_a = new Ingredient(new ItemStack[0]) - { - public boolean apply(@Nullable ItemStack p_apply_1_) -@@ -21,17 +21,39 @@ - } - }; - private final ItemStack[] field_193371_b; -+ private final ItemStack[] matchingStacksExploded; - private IntList field_194140_c; -+ private final boolean isSimple; - -+ protected Ingredient(int size) -+ { -+ this(new ItemStack[size]); -+ } -+ - protected Ingredient(ItemStack... p_i47503_1_) - { -+ boolean simple = true; - this.field_193371_b = p_i47503_1_; -+ net.minecraft.util.NonNullList lst = net.minecraft.util.NonNullList.func_191196_a(); -+ for (ItemStack s : p_i47503_1_) -+ { -+ if (s.func_190926_b()) -+ continue; -+ if (s.func_77973_b().func_77645_m()) -+ simple = false; -+ if (s.func_77960_j() == net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE) -+ s.func_77973_b().func_150895_a(net.minecraft.creativetab.CreativeTabs.field_78027_g, lst); -+ else -+ lst.add(s); -+ } -+ this.matchingStacksExploded = lst.toArray(new ItemStack[lst.size()]); -+ this.isSimple = simple && this.matchingStacksExploded.length > 0; -+ Ingredient.INSTANCES.add(this); - } - -- @SideOnly(Side.CLIENT) - public ItemStack[] func_193365_a() - { -- return this.field_193371_b; -+ return this.matchingStacksExploded; - } - - public boolean apply(@Nullable ItemStack p_apply_1_) -@@ -63,9 +85,9 @@ - { - if (this.field_194140_c == null) - { -- this.field_194140_c = new IntArrayList(this.field_193371_b.length); -+ this.field_194140_c = new IntArrayList(this.matchingStacksExploded.length); - -- for (ItemStack itemstack : this.field_193371_b) -+ for (ItemStack itemstack : this.matchingStacksExploded) - { - this.field_194140_c.add(RecipeItemHelper.func_194113_b(itemstack)); - } -@@ -76,6 +98,18 @@ - return this.field_194140_c; - } - -+ public static void invalidateAll() -+ { -+ for (Ingredient ing : INSTANCES) -+ if (ing != null) -+ ing.invalidate(); -+ } -+ -+ protected void invalidate() -+ { -+ this.field_194140_c = null; -+ } -+ - public static Ingredient func_193367_a(Item p_193367_0_) - { - return func_193369_a(new ItemStack(p_193367_0_, 1, 32767)); -@@ -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()])); -+ } -+ -+ public boolean isSimple() -+ { -+ return isSimple || this == field_193370_a; -+ } - } diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeBookCloning.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeBookCloning.java.patch deleted file mode 100644 index 3d6e9fbf1e..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeBookCloning.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/RecipeBookCloning.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeBookCloning.java -@@ -6,10 +6,8 @@ - import net.minecraft.item.ItemWrittenBook; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class RecipeBookCloning implements IRecipe -+public class RecipeBookCloning extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -127,7 +125,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ >= 3 && p_194133_2_ >= 3; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch deleted file mode 100644 index 7fedeb0f2d..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/RecipeFireworks.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeFireworks.java -@@ -10,10 +10,8 @@ - import net.minecraft.nbt.NBTTagList; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class RecipeFireworks implements IRecipe -+public class RecipeFireworks extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - private ItemStack field_92102_a = ItemStack.field_190927_a; - -@@ -41,7 +39,7 @@ - { - ++l; - } -- else if (itemstack.func_77973_b() == Items.field_151100_aR) -+ else if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack)) - { - ++k; - } -@@ -127,9 +125,9 @@ - - if (!itemstack2.func_190926_b()) - { -- if (itemstack2.func_77973_b() == Items.field_151100_aR) -+ if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack2)) - { -- list.add(Integer.valueOf(ItemDye.field_150922_c[itemstack2.func_77960_j() & 15])); -+ list.add(Integer.valueOf(ItemDye.field_150922_c[net.minecraftforge.oredict.DyeUtils.rawDyeDamageFromStack(itemstack2) & 15])); - } - else if (itemstack2.func_77973_b() == Items.field_151114_aO) - { -@@ -181,9 +179,9 @@ - - if (!itemstack1.func_190926_b()) - { -- if (itemstack1.func_77973_b() == Items.field_151100_aR) -+ if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack1)) - { -- list1.add(Integer.valueOf(ItemDye.field_150922_c[itemstack1.func_77960_j() & 15])); -+ list1.add(Integer.valueOf(ItemDye.field_150922_c[net.minecraftforge.oredict.DyeUtils.rawDyeDamageFromStack(itemstack1) & 15])); - } - else if (itemstack1.func_77973_b() == Items.field_151154_bQ) - { -@@ -248,10 +246,7 @@ - { - ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack.func_77973_b().func_77634_r()) -- { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -- } -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - - return nonnulllist; -@@ -262,7 +257,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ * p_194133_2_ >= 1; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch deleted file mode 100644 index 7fa875c4d0..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java -@@ -7,10 +7,8 @@ - import net.minecraft.item.ItemStack; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class RecipeRepairItem implements IRecipe -+public class RecipeRepairItem extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -28,7 +26,7 @@ - { - ItemStack itemstack1 = list.get(0); - -- if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.func_77973_b().func_77645_m()) -+ if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.func_77973_b().isRepairable()) - { - return false; - } -@@ -55,7 +53,7 @@ - { - ItemStack itemstack1 = list.get(0); - -- if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.func_77973_b().func_77645_m()) -+ if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.func_190916_E() != 1 || itemstack.func_190916_E() != 1 || !itemstack1.func_77973_b().isRepairable()) - { - return ItemStack.field_190927_a; - } -@@ -68,13 +66,13 @@ - ItemStack itemstack2 = list.get(0); - ItemStack itemstack3 = list.get(1); - -- if (itemstack2.func_77973_b() == itemstack3.func_77973_b() && itemstack2.func_190916_E() == 1 && itemstack3.func_190916_E() == 1 && itemstack2.func_77973_b().func_77645_m()) -+ if (itemstack2.func_77973_b() == itemstack3.func_77973_b() && itemstack2.func_190916_E() == 1 && itemstack3.func_190916_E() == 1 && itemstack2.func_77973_b().isRepairable()) - { -- Item item = itemstack2.func_77973_b(); -- int j = item.func_77612_l() - itemstack2.func_77952_i(); -- int k = item.func_77612_l() - itemstack3.func_77952_i(); -- int l = j + k + item.func_77612_l() * 5 / 100; -- int i1 = item.func_77612_l() - l; -+ // FORGE: Make itemstack sensitive // Item item = itemstack2.getItem(); -+ int j = itemstack2.func_77958_k() - itemstack2.func_77952_i(); -+ int k = itemstack2.func_77958_k() - itemstack3.func_77952_i(); -+ int l = j + k + itemstack2.func_77958_k() * 5 / 100; -+ int i1 = itemstack2.func_77958_k() - l; - - if (i1 < 0) - { -@@ -100,11 +98,7 @@ - for (int i = 0; i < nonnulllist.size(); ++i) - { - ItemStack itemstack = p_179532_1_.func_70301_a(i); -- -- if (itemstack.func_77973_b().func_77634_r()) -- { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -- } -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - - return nonnulllist; -@@ -115,7 +109,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ * p_194133_2_ >= 2; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeTippedArrow.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeTippedArrow.java.patch deleted file mode 100644 index 7447209fae..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeTippedArrow.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/RecipeTippedArrow.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeTippedArrow.java -@@ -7,10 +7,8 @@ - import net.minecraft.potion.PotionUtils; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class RecipeTippedArrow implements IRecipe -+public class RecipeTippedArrow extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -83,7 +81,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ >= 2 && p_194133_2_ >= 2; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch deleted file mode 100644 index 8e8559fdd1..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java -@@ -9,10 +9,8 @@ - import net.minecraft.item.ItemStack; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class RecipesArmorDyes implements IRecipe -+public class RecipesArmorDyes extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -38,7 +36,7 @@ - } - else - { -- if (itemstack1.func_77973_b() != Items.field_151100_aR) -+ if (!net.minecraftforge.oredict.DyeUtils.isDye(itemstack1)) - { - return false; - } -@@ -92,12 +90,12 @@ - } - else - { -- if (itemstack1.func_77973_b() != Items.field_151100_aR) -+ if (!net.minecraftforge.oredict.DyeUtils.isDye(itemstack1)) - { - return ItemStack.field_190927_a; - } - -- float[] afloat = EnumDyeColor.func_176766_a(itemstack1.func_77960_j()).func_193349_f(); -+ float[] afloat = net.minecraftforge.oredict.DyeUtils.colorFromStack(itemstack1).get().func_193349_f(); - int l1 = (int)(afloat[0] * 255.0F); - int i2 = (int)(afloat[1] * 255.0F); - int j2 = (int)(afloat[2] * 255.0F); -@@ -143,11 +141,7 @@ - for (int i = 0; i < nonnulllist.size(); ++i) - { - ItemStack itemstack = p_179532_1_.func_70301_a(i); -- -- if (itemstack.func_77973_b().func_77634_r()) -- { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -- } -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - - return nonnulllist; -@@ -158,7 +152,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ * p_194133_2_ >= 2; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch deleted file mode 100644 index f1c344e35d..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/RecipesBanners.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipesBanners.java -@@ -12,12 +12,10 @@ - import net.minecraft.tileentity.TileEntityBanner; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - - public class RecipesBanners - { -- public static class RecipeAddPattern implements IRecipe -+ public static class RecipeAddPattern extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -79,9 +77,10 @@ - { - ItemStack itemstack2 = p_77572_1_.func_70301_a(j); - -- if (itemstack2.func_77973_b() == Items.field_151100_aR) -+ int color = net.minecraftforge.oredict.DyeUtils.rawDyeDamageFromStack(itemstack2); -+ if (color != -1) - { -- k = itemstack2.func_77960_j(); -+ k = color; - break; - } - } -@@ -120,11 +119,7 @@ - for (int i = 0; i < nonnulllist.size(); ++i) - { - ItemStack itemstack = p_179532_1_.func_70301_a(i); -- -- if (itemstack.func_77973_b().func_77634_r()) -- { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -- } -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - - return nonnulllist; -@@ -150,7 +145,7 @@ - - if (!itemstack.func_190926_b() && itemstack.func_77973_b() != Items.field_179564_cE) - { -- if (itemstack.func_77973_b() == Items.field_151100_aR) -+ if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack)) - { - if (flag2) - { -@@ -190,7 +185,7 @@ - - if (!itemstack1.func_190926_b() && itemstack1.func_77973_b() != Items.field_179564_cE) - { -- if (itemstack1.func_77973_b() != Items.field_151100_aR) -+ if (!net.minecraftforge.oredict.DyeUtils.isDye(itemstack1)) - { - flag = false; - break; -@@ -237,14 +232,13 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ >= 3 && p_194133_2_ >= 3; - } - } - -- public static class RecipeDuplicatePattern implements IRecipe -+ public static class RecipeDuplicatePattern extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -344,9 +338,9 @@ - - if (!itemstack.func_190926_b()) - { -- if (itemstack.func_77973_b().func_77634_r()) -+ if (itemstack.func_77973_b().hasContainerItem(itemstack)) - { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - else if (itemstack.func_77942_o() && TileEntityBanner.func_175113_c(itemstack) > 0) - { -@@ -365,7 +359,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ * p_194133_2_ >= 2; diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch deleted file mode 100644 index d8da106418..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java -@@ -5,10 +5,8 @@ - import net.minecraft.item.ItemStack; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class RecipesMapCloning implements IRecipe -+public class RecipesMapCloning extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -111,11 +109,7 @@ - for (int i = 0; i < nonnulllist.size(); ++i) - { - ItemStack itemstack = p_179532_1_.func_70301_a(i); -- -- if (itemstack.func_77973_b().func_77634_r()) -- { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -- } -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - - return nonnulllist; -@@ -126,7 +120,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ >= 3 && p_194133_2_ >= 3; diff --git a/patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch deleted file mode 100644 index 7c43c43610..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch +++ /dev/null @@ -1,83 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/ShapedRecipes.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/ShapedRecipes.java -@@ -19,10 +19,8 @@ - import net.minecraft.util.NonNullList; - import net.minecraft.util.ResourceLocation; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class ShapedRecipes implements IRecipe -+public class ShapedRecipes extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements net.minecraftforge.common.crafting.IShapedRecipe - { - public final int field_77576_b; - public final int field_77577_c; -@@ -39,7 +37,6 @@ - this.field_77575_e = p_i47501_5_; - } - -- @SideOnly(Side.CLIENT) - public String func_193358_e() - { - return this.field_194137_e; -@@ -58,10 +55,7 @@ - { - ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack.func_77973_b().func_77634_r()) -- { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -- } -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - - return nonnulllist; -@@ -72,7 +66,6 @@ - return this.field_77574_d; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ >= this.field_77576_b && p_194133_2_ >= this.field_77577_c; -@@ -80,9 +73,9 @@ - - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -- for (int i = 0; i <= 3 - this.field_77576_b; ++i) -+ for (int i = 0; i <= p_77569_1_.func_174922_i() - this.field_77576_b; ++i) - { -- for (int j = 0; j <= 3 - this.field_77577_c; ++j) -+ for (int j = 0; j <= p_77569_1_.func_174923_h() - this.field_77577_c; ++j) - { - if (this.func_77573_a(p_77569_1_, i, j, true)) - { -@@ -101,9 +94,9 @@ - - private boolean func_77573_a(InventoryCrafting p_77573_1_, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) - { -- for (int i = 0; i < 3; ++i) -+ for (int i = 0; i < p_77573_1_.func_174922_i(); ++i) - { -- for (int j = 0; j < 3; ++j) -+ for (int j = 0; j < p_77573_1_.func_174923_h(); ++j) - { - int k = i - p_77573_2_; - int l = j - p_77573_3_; -@@ -379,4 +372,16 @@ - return new ItemStack(item, j, i); - } - } -+ -+ //================================================ FORGE START ================================================ -+ @Override -+ public int getRecipeWidth() -+ { -+ return this.func_192403_f(); -+ } -+ @Override -+ public int getRecipeHeight() -+ { -+ return this.func_192404_g(); -+ } - } diff --git a/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch deleted file mode 100644 index 00b8ccf2ac..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch +++ /dev/null @@ -1,103 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java -@@ -10,23 +10,25 @@ - import net.minecraft.util.JsonUtils; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - --public class ShapelessRecipes implements IRecipe -+public class ShapelessRecipes extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - private final ItemStack field_77580_a; - public final NonNullList field_77579_b; - private final String field_194138_c; -+ private final boolean isSimple; - - public ShapelessRecipes(String p_i47500_1_, ItemStack p_i47500_2_, NonNullList p_i47500_3_) - { - this.field_194138_c = p_i47500_1_; - this.field_77580_a = p_i47500_2_; - this.field_77579_b = p_i47500_3_; -+ boolean simple = true; -+ for (Ingredient i : p_i47500_3_) -+ simple &= i.isSimple(); -+ this.isSimple = simple; - } - -- @SideOnly(Side.CLIENT) - public String func_193358_e() - { - return this.field_194138_c; -@@ -50,10 +52,7 @@ - { - ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack.func_77973_b().func_77634_r()) -- { -- nonnulllist.set(i, new ItemStack(itemstack.func_77973_b().func_77668_q())); -- } -+ nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); - } - - return nonnulllist; -@@ -61,7 +60,9 @@ - - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -- List list = Lists.newArrayList(this.field_77579_b); -+ int ingredientCount = 0; -+ net.minecraft.client.util.RecipeItemHelper recipeItemHelper = new net.minecraft.client.util.RecipeItemHelper(); -+ List inputs = Lists.newArrayList(); - - for (int i = 0; i < p_77569_1_.func_174923_h(); ++i) - { -@@ -71,27 +72,22 @@ - - if (!itemstack.func_190926_b()) - { -- boolean flag = false; -- -- for (Ingredient ingredient : list) -- { -- if (ingredient.apply(itemstack)) -- { -- flag = true; -- list.remove(ingredient); -- break; -- } -- } -- -- if (!flag) -- { -- return false; -- } -+ ++ingredientCount; -+ if (this.isSimple) -+ recipeItemHelper.accountStack(itemstack, 1); -+ else -+ inputs.add(itemstack); - } - } - } - -- return list.isEmpty(); -+ if (ingredientCount != this.field_77579_b.size()) -+ return false; -+ -+ if (this.isSimple) -+ return recipeItemHelper.func_194116_a(this, null); -+ -+ return net.minecraftforge.common.util.RecipeMatcher.findMatches(inputs, this.field_77579_b) != null; - } - - public ItemStack func_77572_b(InventoryCrafting p_77572_1_) -@@ -136,7 +132,6 @@ - return nonnulllist; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ * p_194133_2_ >= this.field_77579_b.size(); diff --git a/patches/minecraft/net/minecraft/item/crafting/ShieldRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/ShieldRecipes.java.patch deleted file mode 100644 index 8f3c0b42e5..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/ShieldRecipes.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/ShieldRecipes.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/ShieldRecipes.java -@@ -6,12 +6,10 @@ - import net.minecraft.nbt.NBTTagCompound; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - - public class ShieldRecipes - { -- public static class Decoration implements IRecipe -+ public static class Decoration extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -128,7 +126,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ * p_194133_2_ >= 2; diff --git a/patches/minecraft/net/minecraft/item/crafting/ShulkerBoxRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/ShulkerBoxRecipes.java.patch deleted file mode 100644 index 42ca11d4e4..0000000000 --- a/patches/minecraft/net/minecraft/item/crafting/ShulkerBoxRecipes.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/item/crafting/ShulkerBoxRecipes.java -+++ ../src-work/minecraft/net/minecraft/item/crafting/ShulkerBoxRecipes.java -@@ -8,12 +8,10 @@ - import net.minecraft.item.ItemStack; - import net.minecraft.util.NonNullList; - import net.minecraft.world.World; --import net.minecraftforge.fml.relauncher.Side; --import net.minecraftforge.fml.relauncher.SideOnly; - - public class ShulkerBoxRecipes - { -- public static class ShulkerBoxColoring implements IRecipe -+ public static class ShulkerBoxColoring extends net.minecraftforge.registries.IForgeRegistryEntry.Impl implements IRecipe - { - public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) - { -@@ -32,7 +30,7 @@ - } - else - { -- if (itemstack.func_77973_b() != Items.field_151100_aR) -+ if (!net.minecraftforge.oredict.DyeUtils.isDye(itemstack)) - { - return false; - } -@@ -65,14 +63,14 @@ - { - itemstack = itemstack2; - } -- else if (itemstack2.func_77973_b() == Items.field_151100_aR) -+ else if (net.minecraftforge.oredict.DyeUtils.isDye(itemstack2)) - { - itemstack1 = itemstack2; - } - } - } - -- ItemStack itemstack3 = BlockShulkerBox.func_190953_b(EnumDyeColor.func_176766_a(itemstack1.func_77960_j())); -+ ItemStack itemstack3 = BlockShulkerBox.func_190953_b(net.minecraftforge.oredict.DyeUtils.colorFromStack(itemstack1).get()); - - if (itemstack.func_77942_o()) - { -@@ -109,7 +107,6 @@ - return true; - } - -- @SideOnly(Side.CLIENT) - public boolean func_194133_a(int p_194133_1_, int p_194133_2_) - { - return p_194133_1_ * p_194133_2_ >= 2; diff --git a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch deleted file mode 100644 index 32f6bffe39..0000000000 --- a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- ../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/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch b/patches/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch deleted file mode 100644 index c7720b7452..0000000000 --- a/patches/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- ../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/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch deleted file mode 100644 index 07296de5a5..0000000000 --- a/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/nbt/NBTTagList.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch deleted file mode 100644 index 0fe0f23dcf..0000000000 --- a/patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../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/minecraft/net/minecraft/nbt/NBTTagString.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagString.java.patch deleted file mode 100644 index 3820c8686a..0000000000 --- a/patches/minecraft/net/minecraft/nbt/NBTTagString.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch deleted file mode 100644 index 877ffe5f53..0000000000 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch b/patches/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch deleted file mode 100644 index 412aba17f5..0000000000 --- a/patches/minecraft/net/minecraft/network/NettyPacketEncoder.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/NetworkManager.java.patch b/patches/minecraft/net/minecraft/network/NetworkManager.java.patch deleted file mode 100644 index 7145a31471..0000000000 --- a/patches/minecraft/net/minecraft/network/NetworkManager.java.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/NetworkSystem.java.patch b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch deleted file mode 100644 index e4bb5bf6e9..0000000000 --- a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/PacketBuffer.java.patch b/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch deleted file mode 100755 index f2f417666c..0000000000 --- a/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/ServerStatusResponse.java.patch b/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch deleted file mode 100644 index 388c5ef4b9..0000000000 --- a/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/network/ServerStatusResponse.java -+++ ../src-work/minecraft/net/minecraft/network/ServerStatusResponse.java -@@ -29,6 +29,7 @@ - public void func_151315_a(ITextComponent p_151315_1_) - { - this.field_151326_a = p_151315_1_; -+ invalidateJson(); - } - - public ServerStatusResponse.Players func_151318_b() -@@ -39,6 +40,7 @@ - public void func_151319_a(ServerStatusResponse.Players p_151319_1_) - { - this.field_151324_b = p_151319_1_; -+ invalidateJson(); - } - - public ServerStatusResponse.Version func_151322_c() -@@ -49,11 +51,13 @@ - public void func_151321_a(ServerStatusResponse.Version p_151321_1_) - { - this.field_151325_c = p_151321_1_; -+ invalidateJson(); - } - - public void func_151320_a(String p_151320_1_) - { - this.field_151323_d = p_151320_1_; -+ invalidateJson(); - } - - public String func_151316_d() -@@ -176,6 +180,7 @@ - serverstatusresponse.func_151320_a(JsonUtils.func_151200_h(jsonobject, "favicon")); - } - -+ net.minecraftforge.fml.client.FMLClientHandler.instance().captureAdditionalData(serverstatusresponse, jsonobject); - return serverstatusresponse; - } - -@@ -203,10 +208,50 @@ - jsonobject.addProperty("favicon", p_serialize_1_.func_151316_d()); - } - -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.enhanceStatusQuery(jsonobject); - return jsonobject; - } - } - -+ private java.util.concurrent.Semaphore mutex = new java.util.concurrent.Semaphore(1); -+ private String json = null; -+ /** -+ * Returns this object as a Json string. -+ * Converting to JSON if a cached version is not available. -+ * -+ * Also to prevent potentially large memory allocations on the server -+ * this is moved from the S00PacketServerInfo writePacket function -+ * -+ * As this method is called from the network threads thread safety is important! -+ * -+ * @return -+ */ -+ public String getJson() -+ { -+ String ret = this.json; -+ if (ret == null) -+ { -+ mutex.acquireUninterruptibly(); -+ ret = this.json; -+ if (ret == null) -+ { -+ ret = net.minecraft.network.status.server.SPacketServerInfo.field_149297_a.toJson(this); -+ this.json = ret; -+ } -+ mutex.release(); -+ } -+ return ret; -+ } -+ -+ /** -+ * Invalidates the cached json, causing the next call to getJson to rebuild it. -+ * This is needed externally because PlayerCountData.setPlayer's is public. -+ */ -+ public void invalidateJson() -+ { -+ this.json = null; -+ } -+ - public static class Version - { - private final String field_151306_a; diff --git a/patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch b/patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch deleted file mode 100644 index f045608129..0000000000 --- a/patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch b/patches/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch deleted file mode 100644 index c5361662de..0000000000 --- a/patches/minecraft/net/minecraft/network/login/server/SPacketLoginSuccess.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch b/patches/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch deleted file mode 100644 index b6843bb7f8..0000000000 --- a/patches/minecraft/net/minecraft/network/play/client/CPacketClickWindow.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch b/patches/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch deleted file mode 100644 index 390c68264a..0000000000 --- a/patches/minecraft/net/minecraft/network/play/client/CPacketCreativeInventoryAction.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch b/patches/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch deleted file mode 100644 index b0ba904952..0000000000 --- a/patches/minecraft/net/minecraft/network/play/client/CPacketCustomPayload.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch b/patches/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch deleted file mode 100644 index bd9426ff2d..0000000000 --- a/patches/minecraft/net/minecraft/network/play/server/SPacketCustomPayload.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../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/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch b/patches/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch deleted file mode 100644 index 66d894c691..0000000000 --- a/patches/minecraft/net/minecraft/network/play/server/SPacketSpawnMob.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch b/patches/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch deleted file mode 100644 index 30c0973ec4..0000000000 --- a/patches/minecraft/net/minecraft/pathfinding/WalkNodeProcessor.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/potion/Potion.java.patch b/patches/minecraft/net/minecraft/potion/Potion.java.patch deleted file mode 100644 index c3d3aba35e..0000000000 --- a/patches/minecraft/net/minecraft/potion/Potion.java.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/potion/Potion.java -+++ ../src-work/minecraft/net/minecraft/potion/Potion.java -@@ -22,9 +22,9 @@ - import net.minecraftforge.fml.relauncher.Side; - import net.minecraftforge.fml.relauncher.SideOnly; - --public class Potion -+public class Potion extends net.minecraftforge.registries.IForgeRegistryEntry.Impl - { -- public static final RegistryNamespaced field_188414_b = new RegistryNamespaced(); -+ public static final RegistryNamespaced field_188414_b = net.minecraftforge.registries.GameData.getWrapper(Potion.class); - private final Map field_111188_I = Maps.newHashMap(); - private final boolean field_76418_K; - private final int field_76414_N; -@@ -222,7 +222,6 @@ - return this.field_76417_J; - } - -- @SideOnly(Side.CLIENT) - public boolean func_76398_f() - { - return this.field_76418_K; -@@ -293,7 +292,85 @@ - return p_111183_2_.func_111164_d() * (double)(p_111183_1_ + 1); - } - -+ /* ======================================== FORGE START =====================================*/ -+ -+ /** -+ * If the Potion effect should be displayed in the players inventory -+ * @param effect the active PotionEffect -+ * @return true to display it (default), false to hide it. -+ */ -+ public boolean shouldRender(PotionEffect effect) { return true; } -+ -+ /** -+ * If the standard PotionEffect text (name and duration) should be drawn when this potion is active. -+ * @param effect the active PotionEffect -+ * @return true to draw the standard text -+ */ -+ public boolean shouldRenderInvText(PotionEffect effect) -+ { -+ return true; -+ } -+ -+ /** -+ * If the Potion effect should be displayed in the player's ingame HUD -+ * @param effect the active PotionEffect -+ * @return true to display it (default), false to hide it. -+ */ -+ public boolean shouldRenderHUD(PotionEffect effect) -+ { -+ return true; -+ } -+ -+ /** -+ * Called to draw the this Potion onto the player's inventory when it's active. -+ * This can be used to e.g. render Potion icons from your own texture. -+ * @param x the x coordinate -+ * @param y the y coordinate -+ * @param effect the active PotionEffect -+ * @param mc the Minecraft instance, for convenience -+ */ - @SideOnly(Side.CLIENT) -+ public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { } -+ -+ /** -+ * Called to draw the this Potion onto the player's ingame HUD when it's active. -+ * This can be used to e.g. render Potion icons from your own texture. -+ * @param x the x coordinate -+ * @param y the y coordinate -+ * @param effect the active PotionEffect -+ * @param mc the Minecraft instance, for convenience -+ * @param alpha the alpha value, blinks when the potion is about to run out -+ */ -+ @SideOnly(Side.CLIENT) -+ public void renderHUDEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc, float alpha) { } -+ -+ /** -+ * Get a fresh list of items that can cure this Potion. -+ * All new PotionEffects created from this Potion will call this to initialize the default curative items -+ * @see PotionEffect#getCurativeItems -+ * @return A list of items that can cure this Potion -+ */ -+ public java.util.List getCurativeItems() -+ { -+ java.util.ArrayList ret = new java.util.ArrayList(); -+ ret.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.field_151117_aB)); -+ return ret; -+ } -+ -+ /** -+ * Used for determining {@code PotionEffect} sort order in GUIs. -+ * Defaults to the {@code PotionEffect}'s liquid color. -+ * @param potionEffect the {@code PotionEffect} instance containing the potion -+ * @return a value used to sort {@code PotionEffect}s in GUIs -+ */ -+ public int getGuiSortColor(PotionEffect potionEffect) -+ { -+ return this.func_76401_j(); -+ } -+ -+ /* ======================================== FORGE END =====================================*/ -+ -+ @SideOnly(Side.CLIENT) - public boolean func_188408_i() - { - return this.field_188415_h; diff --git a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch deleted file mode 100644 index 346bced079..0000000000 --- a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- ../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/minecraft/net/minecraft/potion/PotionType.java.patch b/patches/minecraft/net/minecraft/potion/PotionType.java.patch deleted file mode 100644 index 0af4665e36..0000000000 --- a/patches/minecraft/net/minecraft/potion/PotionType.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- ../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/minecraft/net/minecraft/profiler/Profiler.java.patch b/patches/minecraft/net/minecraft/profiler/Profiler.java.patch deleted file mode 100644 index 27b3ec6b03..0000000000 --- a/patches/minecraft/net/minecraft/profiler/Profiler.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/realms/RealmsConnect.java.patch b/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch deleted file mode 100644 index df02230483..0000000000 --- a/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch deleted file mode 100644 index fab28b0fcd..0000000000 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ /dev/null @@ -1,304 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java -+++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java -@@ -105,7 +105,7 @@ - @SideOnly(Side.SERVER) - private String field_71320_r; - private int field_71319_s = -1; -- public WorldServer[] field_71305_c; -+ public WorldServer[] field_71305_c = new WorldServer[0]; - private PlayerList field_71318_t; - private boolean field_71317_u = true; - private boolean field_71316_v; -@@ -123,7 +123,8 @@ - private int field_71280_D; - private int field_143008_E; - public final long[] field_71311_j = new long[100]; -- public long[][] field_71312_k; -+ //public long[][] timeOfLastDimensionTick; -+ public java.util.Hashtable worldTickTimes = new java.util.Hashtable(); - private KeyPair field_71292_I; - private String field_71293_J; - private String field_71294_K; -@@ -222,8 +223,6 @@ - { - this.func_71237_c(p_71247_1_); - this.func_71192_d("menu.loadingLevel"); -- this.field_71305_c = new WorldServer[3]; -- this.field_71312_k = new long[this.field_71305_c.length][100]; - ISaveHandler isavehandler = this.field_71310_m.func_75804_a(p_71247_1_, true); - this.func_175584_a(this.func_71270_I(), isavehandler); - WorldInfo worldinfo = isavehandler.func_75757_d(); -@@ -254,6 +253,7 @@ - worldsettings = new WorldSettings(worldinfo); - } - -+ if (false) { //Forge Dead code, reimplemented below - for (int i = 0; i < this.field_71305_c.length; ++i) - { - int j = 0; -@@ -293,8 +293,23 @@ - this.field_71305_c[i].func_72912_H().func_76060_a(this.func_71265_f()); - } - } -+ } //Forge: End dead code - -- this.field_71318_t.func_72364_a(this.field_71305_c); -+ WorldServer overWorld = (WorldServer)(func_71242_L() ? new WorldServerDemo(this, isavehandler, worldinfo, 0, field_71304_b).func_175643_b() : new WorldServer(this, isavehandler, worldinfo, 0, field_71304_b).func_175643_b()); -+ overWorld.func_72963_a(worldsettings); -+ for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) -+ { -+ WorldServer world = (dim == 0 ? overWorld : (WorldServer)new WorldServerMulti(this, isavehandler, dim, overWorld, field_71304_b).func_175643_b()); -+ world.func_72954_a(new ServerWorldEventHandler(this, world)); -+ -+ if (!this.func_71264_H()) -+ { -+ world.func_72912_H().func_76060_a(this.func_71265_f()); -+ } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(world)); -+ } -+ -+ this.field_71318_t.func_72364_a(new WorldServer[]{ overWorld }); - this.func_147139_a(this.func_147135_j()); - this.func_71222_d(); - } -@@ -309,7 +324,7 @@ - this.func_71192_d("menu.generatingTerrain"); - int j1 = 0; - field_147145_h.info("Preparing start region for level 0"); -- WorldServer worldserver = this.field_71305_c[0]; -+ WorldServer worldserver = net.minecraftforge.common.DimensionManager.getWorld(j1); - BlockPos blockpos = worldserver.func_175694_M(); - long k1 = func_130071_aq(); - -@@ -434,15 +449,24 @@ - { - if (worldserver1 != null) - { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver1)); - worldserver1.func_73041_k(); - } - } -+ -+ WorldServer[] tmp = field_71305_c; -+ for (WorldServer world : tmp) -+ { -+ net.minecraftforge.common.DimensionManager.setWorld(world.field_73011_w.getDimension(), null, this); -+ } - } - - if (this.field_71307_n.func_76468_d()) - { - this.field_71307_n.func_76470_e(); - } -+ -+ CommandBase.func_71529_a(null); // Forge: fix MC-128561 - } - - public boolean func_71278_l() -@@ -461,6 +485,7 @@ - { - if (this.func_71197_b()) - { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarted(); - this.field_175591_ab = func_130071_aq(); - long i = 0L; - this.field_147147_p.func_151315_a(new TextComponentString(this.field_71286_C)); -@@ -505,12 +530,20 @@ - Thread.sleep(Math.max(1L, 50L - i)); - this.field_71296_Q = true; - } -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStopping(); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions - } - else - { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions - this.func_71228_a((CrashReport)null); - } - } -+ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) -+ { -+ // ignore silently -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions -+ } - catch (Throwable throwable1) - { - field_147145_h.error("Encountered an unexpected exception", throwable1); -@@ -536,13 +569,13 @@ - field_147145_h.error("We were unable to save this crash report to disk."); - } - -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions - this.func_71228_a(crashreport); - } - finally - { - try - { -- this.field_71316_v = true; - this.func_71260_j(); - } - catch (Throwable throwable) -@@ -551,6 +584,8 @@ - } - finally - { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStopped(); -+ this.field_71316_v = true; - this.func_71240_o(); - } - } -@@ -577,6 +612,7 @@ - ImageIO.write(bufferedimage, "PNG", new ByteBufOutputStream(bytebuf)); - ByteBuf bytebuf1 = Base64.encode(bytebuf); - p_184107_1_.func_151320_a("data:image/png;base64," + bytebuf1.toString(StandardCharsets.UTF_8)); -+ bytebuf1.release(); // Forge: fix MC-122085 - } - catch (Exception exception) - { -@@ -618,6 +654,7 @@ - public void func_71217_p() - { - long i = System.nanoTime(); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreServerTick(); - ++this.field_71315_w; - - if (this.field_71295_T) -@@ -644,6 +681,7 @@ - - Collections.shuffle(Arrays.asList(agameprofile)); - this.field_147147_p.func_151318_b().func_151330_a(agameprofile); -+ this.field_147147_p.invalidateJson(); - } - - if (this.field_71315_w % 900 == 0) -@@ -671,6 +709,7 @@ - - this.field_71304_b.func_76319_b(); - this.field_71304_b.func_76319_b(); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostServerTick(); - } - - public void func_71190_q() -@@ -686,14 +725,17 @@ - } - - this.field_71304_b.func_76318_c("levels"); -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.tick(); - -- for (int j = 0; j < this.field_71305_c.length; ++j) -+ Integer[] ids = net.minecraftforge.common.DimensionManager.getIDs(this.field_71315_w % 200 == 0); -+ for (int x = 0; x < ids.length; x++) - { -+ int id = ids[x]; - long i = System.nanoTime(); - -- if (j == 0 || this.func_71255_r()) -+ if (id == 0 || this.func_71255_r()) - { -- WorldServer worldserver = this.field_71305_c[j]; -+ WorldServer worldserver = net.minecraftforge.common.DimensionManager.getWorld(id); - this.field_71304_b.func_194340_a(() -> - { - return worldserver.func_72912_H().func_76065_j(); -@@ -702,11 +744,12 @@ - if (this.field_71315_w % 20 == 0) - { - this.field_71304_b.func_76320_a("timeSync"); -- this.field_71318_t.func_148537_a(new SPacketTimeUpdate(worldserver.func_82737_E(), worldserver.func_72820_D(), worldserver.func_82736_K().func_82766_b("doDaylightCycle")), worldserver.field_73011_w.func_186058_p().func_186068_a()); -+ this.field_71318_t.func_148537_a(new SPacketTimeUpdate(worldserver.func_82737_E(), worldserver.func_72820_D(), worldserver.func_82736_K().func_82766_b("doDaylightCycle")), worldserver.field_73011_w.getDimension()); - this.field_71304_b.func_76319_b(); - } - - this.field_71304_b.func_76320_a("tick"); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreWorldTick(worldserver); - - try - { -@@ -730,6 +773,7 @@ - throw new ReportedException(crashreport1); - } - -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostWorldTick(worldserver); - this.field_71304_b.func_76319_b(); - this.field_71304_b.func_76320_a("tracker"); - worldserver.func_73039_n().func_72788_a(); -@@ -737,9 +781,11 @@ - this.field_71304_b.func_76319_b(); - } - -- this.field_71312_k[j][this.field_71315_w % 100] = System.nanoTime() - i; -+ worldTickTimes.get(id)[this.field_71315_w % 100] = System.nanoTime() - i; - } - -+ this.field_71304_b.func_76318_c("dim_unloading"); -+ net.minecraftforge.common.DimensionManager.unloadWorlds(worldTickTimes); - this.field_71304_b.func_76318_c("connection"); - this.func_147137_ag().func_151269_c(); - this.field_71304_b.func_76318_c("players"); -@@ -763,7 +809,8 @@ - - public void func_71256_s() - { -- this.field_175590_aa = new Thread(this, "Server thread"); -+ net.minecraftforge.fml.common.StartupQuery.reset(); -+ this.field_175590_aa = new Thread(net.minecraftforge.fml.common.thread.SidedThreadGroups.SERVER, this, "Server thread"); - this.field_175590_aa.start(); - } - -@@ -779,14 +826,13 @@ - - public WorldServer func_71218_a(int p_71218_1_) - { -- if (p_71218_1_ == -1) -+ WorldServer ret = net.minecraftforge.common.DimensionManager.getWorld(p_71218_1_, true); -+ if (ret == null) - { -- return this.field_71305_c[1]; -+ net.minecraftforge.common.DimensionManager.initDimension(p_71218_1_); -+ ret = net.minecraftforge.common.DimensionManager.getWorld(p_71218_1_); - } -- else -- { -- return p_71218_1_ == 1 ? this.field_71305_c[2] : this.field_71305_c[0]; -- } -+ return ret; - } - - public String func_71249_w() -@@ -816,7 +862,7 @@ - - public String getServerModName() - { -- return "vanilla"; -+ return net.minecraftforge.fml.common.FMLCommonHandler.instance().getModName(); - } - - public CrashReport func_71230_b(CrashReport p_71230_1_) -@@ -1411,6 +1457,16 @@ - @SideOnly(Side.SERVER) - public static void main(String[] p_main_0_) - { -+ //Forge: Copied from DedicatedServer.init as to run as early as possible, Old code left in place intentionally. -+ //Done in good faith with permission: https://github.com/MinecraftForge/MinecraftForge/issues/3659#issuecomment-390467028 -+ ServerEula eula = new ServerEula(new File("eula.txt")); -+ if (!eula.func_154346_a()) -+ { -+ field_147145_h.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); -+ eula.func_154348_b(); -+ return; -+ } -+ - Bootstrap.func_151354_b(); - - try -@@ -1598,4 +1654,9 @@ - { - return this.field_175590_aa; - } -+ -+ public DataFixer getDataFixer() -+ { -+ return this.field_184112_s; -+ } - } diff --git a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch deleted file mode 100644 index 3da2d686a9..0000000000 --- a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch b/patches/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch deleted file mode 100644 index 8317ea164a..0000000000 --- a/patches/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch b/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch deleted file mode 100644 index 8b9416cb1f..0000000000 --- a/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch deleted file mode 100644 index ab05c869dd..0000000000 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java -+++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java -@@ -68,8 +68,6 @@ - public void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) - { - this.func_71237_c(p_71247_1_); -- this.field_71305_c = new WorldServer[3]; -- this.field_71312_k = new long[this.field_71305_c.length][100]; - ISaveHandler isavehandler = this.func_71254_M().func_75804_a(p_71247_1_, true); - this.func_175584_a(this.func_71270_I(), isavehandler); - WorldInfo worldinfo = isavehandler.func_75757_d(); -@@ -83,6 +81,7 @@ - worldinfo.func_76062_a(p_71247_2_); - } - -+ if (false) { //Forge: Dead Code, implement below. - for (int i = 0; i < this.field_71305_c.length; ++i) - { - int j = 0; -@@ -117,10 +116,25 @@ - - this.field_71305_c[i].func_72954_a(new ServerWorldEventHandler(this, this.field_71305_c[i])); - } -+ }// Forge: End Dead Code - -- this.func_184103_al().func_72364_a(this.field_71305_c); -+ WorldServer overWorld = (func_71242_L() ? (WorldServer)(new WorldServerDemo(this, isavehandler, worldinfo, 0, this.field_71304_b)).func_175643_b() : -+ (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.field_71304_b)).func_175643_b()); -+ overWorld.func_72963_a(this.field_71350_m); -+ for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) -+ { -+ WorldServer world = (dim == 0 ? overWorld : (WorldServer)(new WorldServerMulti(this, isavehandler, dim, overWorld, this.field_71304_b)).func_175643_b()); -+ world.func_72954_a(new ServerWorldEventHandler(this, world)); -+ if (!this.func_71264_H()) -+ { -+ world.func_72912_H().func_76060_a(func_71265_f()); -+ } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(world)); -+ } - -- if (this.field_71305_c[0].func_72912_H().func_176130_y() == null) -+ this.func_184103_al().func_72364_a(new WorldServer[]{ overWorld }); -+ -+ if (overWorld.func_72912_H().func_176130_y() == null) - { - this.func_147139_a(this.field_71349_l.field_71474_y.field_74318_M); - } -@@ -138,9 +152,10 @@ - this.func_71245_h(true); - field_147148_h.info("Generating keypair"); - this.func_71253_a(CryptManager.func_75891_b()); -+ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerAboutToStart(this)) return false; - this.func_71247_a(this.func_71270_I(), this.func_71221_J(), this.field_71350_m.func_77160_d(), this.field_71350_m.func_77165_h(), this.field_71350_m.func_82749_j()); - this.func_71205_p(this.func_71214_G() + " - " + this.field_71305_c[0].func_72912_H().func_76065_j()); -- return true; -+ return net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarting(this); - } - - public void func_71217_p() -@@ -213,6 +228,7 @@ - - public EnumDifficulty func_147135_j() - { -+ if (this.field_71349_l.field_71441_e == null) return this.field_71349_l.field_71474_y.field_74318_M; // Fix NPE just in case. - return this.field_71349_l.field_71441_e.func_72912_H().func_176130_y(); - } - -@@ -364,6 +380,7 @@ - - public void func_71263_m() - { -+ if (func_71278_l()) - Futures.getUnchecked(this.func_152344_a(new Runnable() - { - public void run() diff --git a/patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch deleted file mode 100644 index 78684574e6..0000000000 --- a/patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch +++ /dev/null @@ -1,162 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch deleted file mode 100644 index c14361b2ce..0000000000 --- a/patches/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch +++ /dev/null @@ -1,286 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/management/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch deleted file mode 100644 index 587dc6df34..0000000000 --- a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch +++ /dev/null @@ -1,253 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch b/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch deleted file mode 100644 index 876f48a734..0000000000 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch deleted file mode 100644 index 2c3ee93c0f..0000000000 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../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/minecraft/net/minecraft/stats/RecipeBook.java.patch b/patches/minecraft/net/minecraft/stats/RecipeBook.java.patch deleted file mode 100644 index 605fbd53f9..0000000000 --- a/patches/minecraft/net/minecraft/stats/RecipeBook.java.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ../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/minecraft/net/minecraft/stats/RecipeBookServer.java.patch b/patches/minecraft/net/minecraft/stats/RecipeBookServer.java.patch deleted file mode 100644 index f795cc5e41..0000000000 --- a/patches/minecraft/net/minecraft/stats/RecipeBookServer.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/stats/StatList.java.patch b/patches/minecraft/net/minecraft/stats/StatList.java.patch deleted file mode 100644 index efabe0caf5..0000000000 --- a/patches/minecraft/net/minecraft/stats/StatList.java.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch b/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch deleted file mode 100644 index 15fb0accde..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java -+++ ../src-work/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java -@@ -124,10 +124,11 @@ - EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null; - entity.func_70012_b(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v, world.field_73012_v.nextFloat() * 360.0F, 0.0F); - -- if (entityliving == null || entityliving.func_70601_bi() && entityliving.func_70058_J()) -+ if (entityliving == null || net.minecraftforge.event.ForgeEventFactory.canEntitySpawnSpawner(entityliving, func_98271_a(), (float)entity.field_70165_t, (float)entity.field_70163_u, (float)entity.field_70161_v, this)) - { - if (this.field_98282_f.func_185277_b().func_186856_d() == 1 && this.field_98282_f.func_185277_b().func_150297_b("id", 8) && entity instanceof EntityLiving) - { -+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, this.func_98271_a(), (float)entity.field_70165_t, (float)entity.field_70163_u, (float)entity.field_70161_v, this)) - ((EntityLiving)entity).func_180482_a(world.func_175649_E(new BlockPos(entity)), (IEntityLivingData)null); - } - -@@ -307,4 +308,7 @@ - { - return this.field_98284_d; - } -+ -+ /* ======================================== FORGE START =====================================*/ -+ @Nullable public Entity getSpawnerEntity() { return null; } - } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch deleted file mode 100644 index d9e519c0ed..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ /dev/null @@ -1,282 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch deleted file mode 100644 index 8fbc3d27fd..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch deleted file mode 100644 index 2c386145bb..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch +++ /dev/null @@ -1,88 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java -+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java -@@ -153,6 +153,7 @@ - - private boolean func_145934_k() - { -+ if (1 == 1) return net.minecraftforge.common.brewing.BrewingRecipeRegistry.canBrew(field_145945_j, field_145945_j.get(3), field_145947_i); // divert to VanillaBrewingRegistry - ItemStack itemstack = this.field_145945_j.get(3); - - if (itemstack.func_190926_b()) -@@ -181,19 +182,17 @@ - - private void func_145940_l() - { -+ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBrew(field_145945_j)) return; - ItemStack itemstack = this.field_145945_j.get(3); - -- for (int i = 0; i < 3; ++i) -- { -- this.field_145945_j.set(i, PotionHelper.func_185212_d(itemstack, this.field_145945_j.get(i))); -- } -+ net.minecraftforge.common.brewing.BrewingRecipeRegistry.brewPotions(field_145945_j, field_145945_j.get(3), field_145947_i); - - itemstack.func_190918_g(1); - BlockPos blockpos = this.func_174877_v(); - -- if (itemstack.func_77973_b().func_77634_r()) -+ if (itemstack.func_77973_b().hasContainerItem(itemstack)) - { -- ItemStack itemstack1 = new ItemStack(itemstack.func_77973_b().func_77668_q()); -+ ItemStack itemstack1 = itemstack.func_77973_b().getContainerItem(itemstack); - - if (itemstack.func_190926_b()) - { -@@ -207,6 +206,7 @@ - - this.field_145945_j.set(3, itemstack); - this.field_145850_b.func_175718_b(1035, blockpos, 0); -+ net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(field_145945_j); - } - - public static void func_189675_a(DataFixer p_189675_0_) -@@ -296,7 +296,7 @@ - { - if (p_94041_1_ == 3) - { -- return PotionHelper.func_185205_a(p_94041_2_); -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_94041_2_); - } - else - { -@@ -308,7 +308,7 @@ - } - else - { -- return (item == Items.field_151068_bn || item == Items.field_185155_bH || item == Items.field_185156_bI || item == Items.field_151069_bo) && this.func_70301_a(p_94041_1_).func_190926_b(); -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_94041_2_) && this.func_70301_a(p_94041_1_).func_190926_b(); - } - } - } -@@ -377,6 +377,27 @@ - } - } - -+ net.minecraftforge.items.IItemHandler handlerInput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.UP); -+ net.minecraftforge.items.IItemHandler handlerOutput = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.DOWN); -+ net.minecraftforge.items.IItemHandler handlerSides = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.NORTH); -+ -+ @SuppressWarnings("unchecked") -+ @Override -+ @javax.annotation.Nullable -+ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @javax.annotation.Nullable net.minecraft.util.EnumFacing facing) -+ { -+ if (facing != null && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) -+ { -+ if (facing == EnumFacing.UP) -+ return (T) handlerInput; -+ else if (facing == EnumFacing.DOWN) -+ return (T) handlerOutput; -+ else -+ return (T) handlerSides; -+ } -+ return super.getCapability(capability, facing); -+ } -+ - public int func_174890_g() - { - return 2; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch deleted file mode 100644 index 78b80ff38f..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch deleted file mode 100644 index d1b9be1309..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ /dev/null @@ -1,97 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java -+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java -@@ -121,9 +121,9 @@ - super.func_145839_a(p_145839_1_); - this.field_145957_n = NonNullList.func_191197_a(this.func_70302_i_(), ItemStack.field_190927_a); - ItemStackHelper.func_191283_b(p_145839_1_, this.field_145957_n); -- this.field_145956_a = p_145839_1_.func_74765_d("BurnTime"); -- this.field_174906_k = p_145839_1_.func_74765_d("CookTime"); -- this.field_174905_l = p_145839_1_.func_74765_d("CookTimeTotal"); -+ this.field_145956_a = p_145839_1_.func_74762_e("BurnTime"); -+ this.field_174906_k = p_145839_1_.func_74762_e("CookTime"); -+ this.field_174905_l = p_145839_1_.func_74762_e("CookTimeTotal"); - this.field_145963_i = func_145952_a(this.field_145957_n.get(1)); - - if (p_145839_1_.func_150297_b("CustomName", 8)) -@@ -135,9 +135,9 @@ - public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) - { - super.func_189515_b(p_189515_1_); -- p_189515_1_.func_74777_a("BurnTime", (short)this.field_145956_a); -- p_189515_1_.func_74777_a("CookTime", (short)this.field_174906_k); -- p_189515_1_.func_74777_a("CookTimeTotal", (short)this.field_174905_l); -+ p_189515_1_.func_74768_a("BurnTime", (short)this.field_145956_a); -+ p_189515_1_.func_74768_a("CookTime", (short)this.field_174906_k); -+ p_189515_1_.func_74768_a("CookTimeTotal", (short)this.field_174905_l); - ItemStackHelper.func_191282_a(p_189515_1_, this.field_145957_n); - - if (this.func_145818_k_()) -@@ -196,8 +196,8 @@ - - if (itemstack.func_190926_b()) - { -- Item item1 = item.func_77668_q(); -- this.field_145957_n.set(1, item1 == null ? ItemStack.field_190927_a : new ItemStack(item1)); -+ ItemStack item1 = item.getContainerItem(itemstack); -+ this.field_145957_n.set(1, item1); - } - } - } -@@ -269,13 +269,13 @@ - { - return false; - } -- else if (itemstack1.func_190916_E() < this.func_70297_j_() && itemstack1.func_190916_E() < itemstack1.func_77976_d()) -+ else if (itemstack1.func_190916_E() + itemstack.func_190916_E() <= this.func_70297_j_() && itemstack1.func_190916_E() + itemstack.func_190916_E() <= itemstack1.func_77976_d()) // Forge fix: make furnace respect stack sizes in furnace recipes - { - return true; - } - else - { -- return itemstack1.func_190916_E() < itemstack.func_77976_d(); -+ return itemstack1.func_190916_E() + itemstack.func_190916_E() <= itemstack.func_77976_d(); // Forge fix: make furnace respect stack sizes in furnace recipes - } - } - } -@@ -295,7 +295,7 @@ - } - else if (itemstack2.func_77973_b() == itemstack1.func_77973_b()) - { -- itemstack2.func_190917_f(1); -+ itemstack2.func_190917_f(itemstack1.func_190916_E()); - } - - if (itemstack.func_77973_b() == Item.func_150898_a(Blocks.field_150360_v) && itemstack.func_77960_j() == 1 && !((ItemStack)this.field_145957_n.get(1)).func_190926_b() && ((ItemStack)this.field_145957_n.get(1)).func_77973_b() == Items.field_151133_ar) -@@ -315,6 +315,8 @@ - } - else - { -+ int burnTime = net.minecraftforge.event.ForgeEventFactory.getItemBurnTime(p_145952_0_); -+ if (burnTime >= 0) return burnTime; - Item item = p_145952_0_.func_77973_b(); - - if (item == Item.func_150898_a(Blocks.field_150376_bx)) -@@ -530,4 +532,23 @@ - { - this.field_145957_n.clear(); - } -+ -+ net.minecraftforge.items.IItemHandler handlerTop = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.UP); -+ net.minecraftforge.items.IItemHandler handlerBottom = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.DOWN); -+ net.minecraftforge.items.IItemHandler handlerSide = new net.minecraftforge.items.wrapper.SidedInvWrapper(this, net.minecraft.util.EnumFacing.WEST); -+ -+ @SuppressWarnings("unchecked") -+ @Override -+ @javax.annotation.Nullable -+ public T getCapability(net.minecraftforge.common.capabilities.Capability capability, @javax.annotation.Nullable net.minecraft.util.EnumFacing facing) -+ { -+ if (facing != null && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) -+ if (facing == EnumFacing.DOWN) -+ return (T) handlerBottom; -+ else if (facing == EnumFacing.UP) -+ return (T) handlerTop; -+ else -+ return (T) handlerSide; -+ return super.getCapability(capability, facing); -+ } - } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch deleted file mode 100644 index a758f873e4..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch deleted file mode 100644 index 69eac2db71..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityLockable.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch deleted file mode 100644 index 3ec94d9c69..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityLockableLoot.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch deleted file mode 100644 index e8d6a2688a..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch deleted file mode 100644 index 6b96087982..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch deleted file mode 100644 index 10b195fa2b..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch deleted file mode 100644 index f0b24d2e3d..0000000000 --- a/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/ActionResult.java.patch b/patches/minecraft/net/minecraft/util/ActionResult.java.patch deleted file mode 100644 index 28c5a82cff..0000000000 --- a/patches/minecraft/net/minecraft/util/ActionResult.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/BlockRenderLayer.java.patch b/patches/minecraft/net/minecraft/util/BlockRenderLayer.java.patch deleted file mode 100644 index 80055839ac..0000000000 --- a/patches/minecraft/net/minecraft/util/BlockRenderLayer.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch b/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch deleted file mode 100644 index 93d097b397..0000000000 --- a/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/EnumFacing.java.patch b/patches/minecraft/net/minecraft/util/EnumFacing.java.patch deleted file mode 100644 index 4ca5aafe98..0000000000 --- a/patches/minecraft/net/minecraft/util/EnumFacing.java.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch b/patches/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch deleted file mode 100644 index a26f3cfc57..0000000000 --- a/patches/minecraft/net/minecraft/util/IntIdentityHashBiMap.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/MouseHelper.java.patch b/patches/minecraft/net/minecraft/util/MouseHelper.java.patch deleted file mode 100644 index 9a1be0ea46..0000000000 --- a/patches/minecraft/net/minecraft/util/MouseHelper.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/ScreenShotHelper.java.patch b/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch deleted file mode 100644 index 33fd2b6e6c..0000000000 --- a/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch b/patches/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch deleted file mode 100644 index 612d7d1eeb..0000000000 --- a/patches/minecraft/net/minecraft/util/ServerRecipeBookHelper.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/Session.java.patch b/patches/minecraft/net/minecraft/util/Session.java.patch deleted file mode 100644 index 83520cf67c..0000000000 --- a/patches/minecraft/net/minecraft/util/Session.java.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/SoundEvent.java.patch b/patches/minecraft/net/minecraft/util/SoundEvent.java.patch deleted file mode 100644 index e1970495c2..0000000000 --- a/patches/minecraft/net/minecraft/util/SoundEvent.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/TabCompleter.java.patch b/patches/minecraft/net/minecraft/util/TabCompleter.java.patch deleted file mode 100644 index 381309b8f8..0000000000 --- a/patches/minecraft/net/minecraft/util/TabCompleter.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch b/patches/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch deleted file mode 100644 index df08316655..0000000000 --- a/patches/minecraft/net/minecraft/util/datafix/DataFixesManager.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/math/RayTraceResult.java.patch b/patches/minecraft/net/minecraft/util/math/RayTraceResult.java.patch deleted file mode 100644 index 9072515469..0000000000 --- a/patches/minecraft/net/minecraft/util/math/RayTraceResult.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/math/Vec3d.java.patch b/patches/minecraft/net/minecraft/util/math/Vec3d.java.patch deleted file mode 100644 index f01939a018..0000000000 --- a/patches/minecraft/net/minecraft/util/math/Vec3d.java.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/text/ITextComponent.java.patch b/patches/minecraft/net/minecraft/util/text/ITextComponent.java.patch deleted file mode 100644 index 34da23c67a..0000000000 --- a/patches/minecraft/net/minecraft/util/text/ITextComponent.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/text/Style.java.patch b/patches/minecraft/net/minecraft/util/text/Style.java.patch deleted file mode 100644 index 2aa70dad9c..0000000000 --- a/patches/minecraft/net/minecraft/util/text/Style.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/text/TextComponentBase.java.patch b/patches/minecraft/net/minecraft/util/text/TextComponentBase.java.patch deleted file mode 100644 index 41d3f8c38e..0000000000 --- a/patches/minecraft/net/minecraft/util/text/TextComponentBase.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch b/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch deleted file mode 100644 index 8417282478..0000000000 --- a/patches/minecraft/net/minecraft/util/text/translation/LanguageMap.java.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../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/minecraft/net/minecraft/village/Village.java.patch b/patches/minecraft/net/minecraft/village/Village.java.patch deleted file mode 100644 index b435446fbb..0000000000 --- a/patches/minecraft/net/minecraft/village/Village.java.patch +++ /dev/null @@ -1,209 +0,0 @@ ---- ../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/minecraft/net/minecraft/village/VillageCollection.java.patch b/patches/minecraft/net/minecraft/village/VillageCollection.java.patch deleted file mode 100644 index 41811b9f4d..0000000000 --- a/patches/minecraft/net/minecraft/village/VillageCollection.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/BossInfo.java.patch b/patches/minecraft/net/minecraft/world/BossInfo.java.patch deleted file mode 100644 index 447890e816..0000000000 --- a/patches/minecraft/net/minecraft/world/BossInfo.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/BossInfoServer.java.patch b/patches/minecraft/net/minecraft/world/BossInfoServer.java.patch deleted file mode 100644 index d9e3ba0341..0000000000 --- a/patches/minecraft/net/minecraft/world/BossInfoServer.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch deleted file mode 100644 index fce0bcdfa5..0000000000 --- a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/DimensionType.java.patch b/patches/minecraft/net/minecraft/world/DimensionType.java.patch deleted file mode 100644 index 06d76f880f..0000000000 --- a/patches/minecraft/net/minecraft/world/DimensionType.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch deleted file mode 100644 index 82f20efd5c..0000000000 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/IBlockAccess.java.patch b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch deleted file mode 100644 index 068be9ed2d..0000000000 --- a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch b/patches/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch deleted file mode 100644 index f67ef24832..0000000000 --- a/patches/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch deleted file mode 100644 index 1757acc9e8..0000000000 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ /dev/null @@ -1,1153 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch b/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch deleted file mode 100644 index fa334277d1..0000000000 --- a/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch +++ /dev/null @@ -1,94 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch deleted file mode 100644 index 9cfd4fc1cf..0000000000 --- a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch +++ /dev/null @@ -1,439 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/WorldProviderEnd.java.patch b/patches/minecraft/net/minecraft/world/WorldProviderEnd.java.patch deleted file mode 100644 index 8281c449ff..0000000000 --- a/patches/minecraft/net/minecraft/world/WorldProviderEnd.java.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/WorldProviderSurface.java.patch b/patches/minecraft/net/minecraft/world/WorldProviderSurface.java.patch deleted file mode 100644 index 1b588e11e8..0000000000 --- a/patches/minecraft/net/minecraft/world/WorldProviderSurface.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch deleted file mode 100644 index f717bbb201..0000000000 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ /dev/null @@ -1,304 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/WorldServerMulti.java.patch b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch deleted file mode 100644 index c317303138..0000000000 --- a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/WorldType.java.patch b/patches/minecraft/net/minecraft/world/WorldType.java.patch deleted file mode 100644 index 28bfd1c320..0000000000 --- a/patches/minecraft/net/minecraft/world/WorldType.java.patch +++ /dev/null @@ -1,156 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/WorldType.java -+++ ../src-work/minecraft/net/minecraft/world/WorldType.java -@@ -27,6 +27,7 @@ - - private WorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) - { -+ if (p_i1960_2_.length() > 16 && field_180272_g != null) throw new IllegalArgumentException("World type names must not be longer then 16: " + p_i1960_2_); - this.field_77133_f = p_i1960_2_; - this.field_77134_g = p_i1960_3_; - this.field_77140_h = true; -@@ -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); -+ } -+ -+ /** -+ * Called when 'Create New World' button is pressed before starting game -+ */ -+ public void onGUICreateWorldPress() { } -+ -+ /** -+ * 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)); -+ } -+ -+ /** -+ * Called when the 'Customize' button is pressed on world creation GUI -+ * @param mc The Minecraft instance -+ * @param guiCreateWorld the createworld GUI -+ */ -+ @SideOnly(Side.CLIENT) -+ public void onCustomizeButton(net.minecraft.client.Minecraft mc, net.minecraft.client.gui.GuiCreateWorld guiCreateWorld) -+ { -+ if (this == WorldType.field_77138_c) -+ { -+ mc.func_147108_a(new net.minecraft.client.gui.GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); -+ } -+ else if (this == WorldType.field_180271_f) -+ { -+ mc.func_147108_a(new net.minecraft.client.gui.GuiCustomizeWorldScreen(guiCreateWorld, guiCreateWorld.field_146334_a)); -+ } -+ } -+ -+ /** -+ * Should world creation GUI show 'Customize' button for this world type? -+ * @return if this world type has customization parameters -+ */ -+ public boolean isCustomizable() -+ { -+ return this == field_77138_c || this == WorldType.field_180271_f; -+ } -+ -+ -+ /** -+ * 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/minecraft/net/minecraft/world/biome/Biome.java.patch b/patches/minecraft/net/minecraft/world/biome/Biome.java.patch deleted file mode 100644 index 1f9850b39b..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/Biome.java.patch +++ /dev/null @@ -1,201 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch deleted file mode 100644 index 8e65db285b..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch +++ /dev/null @@ -1,168 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch deleted file mode 100644 index 8ad23bf526..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDesert.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeForest.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeForest.java.patch deleted file mode 100644 index 479715fa2e..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeForest.java.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeHills.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeHills.java.patch deleted file mode 100644 index 7f25b2cc3b..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeHills.java.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch deleted file mode 100644 index 6b4b003a1a..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeJungle.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch deleted file mode 100644 index 5f13874f70..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeMesa.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomePlains.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomePlains.java.patch deleted file mode 100644 index 71561fc4cf..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomePlains.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch deleted file mode 100644 index 2506b7829b..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeProvider.java.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch deleted file mode 100644 index 5ba3254b4a..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeSavanna.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch deleted file mode 100644 index 01957a6960..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeSnow.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch deleted file mode 100644 index b39501ffa4..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeSwamp.java.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch deleted file mode 100644 index 5753983685..0000000000 --- a/patches/minecraft/net/minecraft/world/biome/BiomeTaiga.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/border/WorldBorder.java.patch b/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch deleted file mode 100644 index fea866e4cc..0000000000 --- a/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch b/patches/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch deleted file mode 100644 index ed98b669a5..0000000000 --- a/patches/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch deleted file mode 100644 index eb15c03a97..0000000000 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ /dev/null @@ -1,372 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch deleted file mode 100644 index 2d4bf100d3..0000000000 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch +++ /dev/null @@ -1,191 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch deleted file mode 100644 index 38e5ac4e74..0000000000 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -+++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -@@ -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/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch deleted file mode 100644 index 945276017f..0000000000 --- a/patches/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch deleted file mode 100644 index 59c2aaaf2b..0000000000 --- a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch deleted file mode 100644 index 0a8b5667ba..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch deleted file mode 100644 index 1592b257a3..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorFlat.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch deleted file mode 100644 index a62ecec317..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorHell.java.patch +++ /dev/null @@ -1,120 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch deleted file mode 100644 index 49424b6a3c..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/ChunkGeneratorOverworld.java.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch deleted file mode 100644 index 2cc997e08e..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch deleted file mode 100644 index 2188761f3a..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch +++ /dev/null @@ -1,111 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch deleted file mode 100644 index 30657ba503..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch +++ /dev/null @@ -1,124 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch deleted file mode 100644 index 773fd43edc..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch deleted file mode 100644 index 5bf7cfad59..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch deleted file mode 100644 index 6c34a84eae..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch deleted file mode 100644 index 77d4b839e8..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBirchTree.java.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch deleted file mode 100644 index ed54b4718f..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBush.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch deleted file mode 100644 index 61ebf130cf..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch deleted file mode 100644 index f1d9ad72cb..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch deleted file mode 100644 index 6ca2da90eb..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch deleted file mode 100644 index 45ec439504..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch deleted file mode 100644 index cec562cded..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch deleted file mode 100644 index dcdcd472c2..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch deleted file mode 100644 index c0785697b7..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch deleted file mode 100644 index 1ac2953b8e..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.java.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch deleted file mode 100644 index 8782dc0cb9..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch deleted file mode 100644 index 074c4483e9..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch deleted file mode 100644 index 8964b67b1e..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch deleted file mode 100644 index 70ea1b4468..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch deleted file mode 100644 index d7cc9310a8..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch deleted file mode 100644 index 3a17a2173c..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch deleted file mode 100644 index 1826fe68b6..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch deleted file mode 100644 index dfe3fe59dd..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch +++ /dev/null @@ -1,89 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch deleted file mode 100644 index f228c61679..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch deleted file mode 100644 index 611141161b..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch deleted file mode 100644 index 2f6ab26ee8..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch deleted file mode 100644 index f6ba38728d..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch +++ /dev/null @@ -1,108 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch deleted file mode 100644 index 6f09227e41..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch deleted file mode 100644 index 15c8c9b418..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch deleted file mode 100644 index 37db40005d..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch deleted file mode 100644 index 18fbcfa5ac..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch +++ /dev/null @@ -1,93 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch deleted file mode 100644 index d9a07a6c9a..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch deleted file mode 100644 index b0924ce1f6..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch deleted file mode 100644 index d46138d517..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch deleted file mode 100644 index c8db28dbbd..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch deleted file mode 100644 index b65b5cd04a..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch +++ /dev/null @@ -1,93 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch deleted file mode 100644 index 4ed1f367d6..0000000000 --- a/patches/minecraft/net/minecraft/world/gen/structure/template/Template.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch b/patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch deleted file mode 100644 index 7c992734a7..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch deleted file mode 100644 index df1ee059a4..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/storage/MapDecoration.java.patch b/patches/minecraft/net/minecraft/world/storage/MapDecoration.java.patch deleted file mode 100644 index 58b9bbe6f1..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/MapDecoration.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/MapDecoration.java -+++ ../src-work/minecraft/net/minecraft/world/storage/MapDecoration.java -@@ -92,6 +92,17 @@ - return i; - } - -+ /** -+ * Renders this decoration, useful for custom sprite sheets. -+ * @param index The index of this icon in the MapData's list. Used by vanilla to offset the Z-coordinate to prevent Z-fighting -+ * @return false to run vanilla logic for this decoration, true to skip it -+ */ -+ @SideOnly(Side.CLIENT) -+ public boolean render(int index) -+ { -+ return false; -+ } -+ - public static enum Type - { - PLAYER(false), diff --git a/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch b/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch deleted file mode 100644 index 60f926478b..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/storage/SaveHandler.java.patch b/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch deleted file mode 100644 index c297315d0c..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/storage/WorldInfo.java.patch b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch deleted file mode 100644 index 798480c463..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch +++ /dev/null @@ -1,103 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch b/patches/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch deleted file mode 100644 index 2849daca6b..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/WorldSavedData.java.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- ../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/minecraft/net/minecraft/world/storage/loot/LootContext.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootContext.java.patch deleted file mode 100644 index 779ac13c81..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootContext.java.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootContext.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootContext.java -@@ -89,6 +89,16 @@ - } - } - -+ public WorldServer getWorld() -+ { -+ return field_186499_b; -+ } -+ -+ public int getLootingModifier() -+ { -+ return net.minecraftforge.common.ForgeHooks.getLootingLevel(func_186493_a(), func_186492_c(), field_186503_f); -+ } -+ - public static class Builder - { - private final WorldServer field_186474_a; diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootEntry.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootEntry.java.patch deleted file mode 100644 index 372136e656..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootEntry.java.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootEntry.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootEntry.java -@@ -18,15 +18,17 @@ - - public abstract class LootEntry - { -+ protected final String entryName; - protected final int field_186364_c; - protected final int field_186365_d; - protected final LootCondition[] field_186366_e; - -- protected LootEntry(int p_i46642_1_, int p_i46642_2_, LootCondition[] p_i46642_3_) -+ protected LootEntry(int p_i46642_1_, int p_i46642_2_, LootCondition[] p_i46642_3_, String entryName) - { - this.field_186364_c = p_i46642_1_; - this.field_186365_d = p_i46642_2_; - this.field_186366_e = p_i46642_3_; -+ this.entryName = entryName; - } - - public int func_186361_a(float p_186361_1_) -@@ -34,6 +36,8 @@ - return Math.max(MathHelper.func_76141_d((float)this.field_186364_c + (float)this.field_186365_d * p_186361_1_), 0); - } - -+ public String getEntryName(){ return this.entryName; } -+ - public abstract void func_186363_a(Collection p_186363_1_, Random p_186363_2_, LootContext p_186363_3_); - - protected abstract void func_186362_a(JsonObject p_186362_1_, JsonSerializationContext p_186362_2_); -@@ -57,6 +61,9 @@ - alootcondition = new LootCondition[0]; - } - -+ LootEntry ret = net.minecraftforge.common.ForgeHooks.deserializeJsonLootEntry(s, jsonobject, i, j, alootcondition); -+ if (ret != null) return ret; -+ - if ("item".equals(s)) - { - return LootEntryItem.func_186367_a(jsonobject, p_deserialize_3_, i, j, alootcondition); -@@ -78,6 +85,8 @@ - public JsonElement serialize(LootEntry p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) - { - JsonObject jsonobject = new JsonObject(); -+ if (p_serialize_1_.entryName != null && !p_serialize_1_.entryName.startsWith("custom#")) -+ jsonobject.addProperty("entryName", p_serialize_1_.entryName); - jsonobject.addProperty("weight", Integer.valueOf(p_serialize_1_.field_186364_c)); - jsonobject.addProperty("quality", Integer.valueOf(p_serialize_1_.field_186365_d)); - -@@ -86,6 +95,9 @@ - jsonobject.add("conditions", p_serialize_3_.serialize(p_serialize_1_.field_186366_e)); - } - -+ String type = net.minecraftforge.common.ForgeHooks.getLootEntryType(p_serialize_1_); -+ if (type != null) jsonobject.addProperty("type", type); -+ else - if (p_serialize_1_ instanceof LootEntryItem) - { - jsonobject.addProperty("type", "item"); diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryEmpty.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootEntryEmpty.java.patch deleted file mode 100644 index 058252bfcb..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryEmpty.java.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootEntryEmpty.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootEntryEmpty.java -@@ -10,9 +10,9 @@ - - public class LootEntryEmpty extends LootEntry - { -- public LootEntryEmpty(int p_i46645_1_, int p_i46645_2_, LootCondition[] p_i46645_3_) -+ public LootEntryEmpty(int p_i46645_1_, int p_i46645_2_, LootCondition[] p_i46645_3_, String entryName) - { -- super(p_i46645_1_, p_i46645_2_, p_i46645_3_); -+ super(p_i46645_1_, p_i46645_2_, p_i46645_3_, entryName); - } - - public void func_186363_a(Collection p_186363_1_, Random p_186363_2_, LootContext p_186363_3_) -@@ -25,6 +25,6 @@ - - public static LootEntryEmpty func_186372_a(JsonObject p_186372_0_, JsonDeserializationContext p_186372_1_, int p_186372_2_, int p_186372_3_, LootCondition[] p_186372_4_) - { -- return new LootEntryEmpty(p_186372_2_, p_186372_3_, p_186372_4_); -+ return new LootEntryEmpty(p_186372_2_, p_186372_3_, p_186372_4_, net.minecraftforge.common.ForgeHooks.readLootEntryName(p_186372_0_, "empty")); - } - } diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch deleted file mode 100644 index 8c110fcf3a..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java -@@ -18,9 +18,9 @@ - protected final Item field_186368_a; - protected final LootFunction[] field_186369_b; - -- public LootEntryItem(Item p_i46644_1_, int p_i46644_2_, int p_i46644_3_, LootFunction[] p_i46644_4_, LootCondition[] p_i46644_5_) -+ public LootEntryItem(Item p_i46644_1_, int p_i46644_2_, int p_i46644_3_, LootFunction[] p_i46644_4_, LootCondition[] p_i46644_5_, String entryName) - { -- super(p_i46644_2_, p_i46644_3_, p_i46644_5_); -+ super(p_i46644_2_, p_i46644_3_, p_i46644_5_, entryName); - this.field_186368_a = p_i46644_1_; - this.field_186369_b = p_i46644_4_; - } -@@ -39,7 +39,7 @@ - - if (!itemstack.func_190926_b()) - { -- if (itemstack.func_190916_E() < this.field_186368_a.func_77639_j()) -+ if (itemstack.func_190916_E() < this.field_186368_a.getItemStackLimit(itemstack)) - { - p_186363_1_.add(itemstack); - } -@@ -79,6 +79,7 @@ - - public static LootEntryItem func_186367_a(JsonObject p_186367_0_, JsonDeserializationContext p_186367_1_, int p_186367_2_, int p_186367_3_, LootCondition[] p_186367_4_) - { -+ String name = net.minecraftforge.common.ForgeHooks.readLootEntryName(p_186367_0_, "item"); - Item item = JsonUtils.func_188180_i(p_186367_0_, "name"); - LootFunction[] alootfunction; - -@@ -91,6 +92,6 @@ - alootfunction = new LootFunction[0]; - } - -- return new LootEntryItem(item, p_186367_2_, p_186367_3_, alootfunction, p_186367_4_); -+ return new LootEntryItem(item, p_186367_2_, p_186367_3_, alootfunction, p_186367_4_, name); - } - } diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryTable.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootEntryTable.java.patch deleted file mode 100644 index fa2158b8c9..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryTable.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootEntryTable.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootEntryTable.java -@@ -14,9 +14,9 @@ - { - protected final ResourceLocation field_186371_a; - -- public LootEntryTable(ResourceLocation p_i46639_1_, int p_i46639_2_, int p_i46639_3_, LootCondition[] p_i46639_4_) -+ public LootEntryTable(ResourceLocation p_i46639_1_, int p_i46639_2_, int p_i46639_3_, LootCondition[] p_i46639_4_, String entryName) - { -- super(p_i46639_2_, p_i46639_3_, p_i46639_4_); -+ super(p_i46639_2_, p_i46639_3_, p_i46639_4_, entryName); - this.field_186371_a = p_i46639_1_; - } - -@@ -34,7 +34,8 @@ - - public static LootEntryTable func_186370_a(JsonObject p_186370_0_, JsonDeserializationContext p_186370_1_, int p_186370_2_, int p_186370_3_, LootCondition[] p_186370_4_) - { -+ String name = net.minecraftforge.common.ForgeHooks.readLootEntryName(p_186370_0_, "loot_table"); - ResourceLocation resourcelocation = new ResourceLocation(JsonUtils.func_151200_h(p_186370_0_, "name")); -- return new LootEntryTable(resourcelocation, p_186370_2_, p_186370_3_, p_186370_4_); -+ return new LootEntryTable(resourcelocation, p_186370_2_, p_186370_3_, p_186370_4_, name); - } - } diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch deleted file mode 100644 index 13b5834bc3..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch +++ /dev/null @@ -1,121 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootPool.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootPool.java -@@ -21,17 +21,19 @@ - - public class LootPool - { -- private final LootEntry[] field_186453_a; -- private final LootCondition[] field_186454_b; -+ private final List field_186453_a; -+ private final List field_186454_b; - private RandomValueRange field_186455_c; - private RandomValueRange field_186456_d; -+ private final String name; - -- public LootPool(LootEntry[] p_i46643_1_, LootCondition[] p_i46643_2_, RandomValueRange p_i46643_3_, RandomValueRange p_i46643_4_) -+ public LootPool(LootEntry[] p_i46643_1_, LootCondition[] p_i46643_2_, RandomValueRange p_i46643_3_, RandomValueRange p_i46643_4_, String name) - { -- this.field_186453_a = p_i46643_1_; -- this.field_186454_b = p_i46643_2_; -+ this.field_186453_a = Lists.newArrayList(p_i46643_1_); -+ this.field_186454_b = Lists.newArrayList(p_i46643_2_); - this.field_186455_c = p_i46643_3_; - this.field_186456_d = p_i46643_4_; -+ this.name = name; - } - - protected void func_186452_a(Collection p_186452_1_, Random p_186452_2_, LootContext p_186452_3_) -@@ -72,7 +74,7 @@ - - public void func_186449_b(Collection p_186449_1_, Random p_186449_2_, LootContext p_186449_3_) - { -- if (LootConditionManager.func_186638_a(this.field_186454_b, p_186449_2_, p_186449_3_)) -+ if (LootConditionManager.testAllConditions(this.field_186454_b, p_186449_2_, p_186449_3_)) - { - int i = this.field_186455_c.func_186511_a(p_186449_2_) + MathHelper.func_76141_d(this.field_186456_d.func_186507_b(p_186449_2_) * p_186449_3_.func_186491_f()); - -@@ -83,21 +85,74 @@ - } - } - -+ //======================== FORGE START ============================================= -+ private boolean isFrozen = false; -+ public void freeze() -+ { -+ this.isFrozen = true; -+ } -+ public boolean isFrozen(){ return this.isFrozen; } -+ private void checkFrozen() -+ { -+ if (this.isFrozen()) -+ throw new RuntimeException("Attempted to modify LootPool after being frozen!"); -+ } -+ -+ public String getName(){ return this.name; } -+ public RandomValueRange getRolls() { return this.field_186455_c; } -+ public RandomValueRange getBonusRolls() { return this.field_186456_d; } -+ public void setRolls (RandomValueRange v){ checkFrozen(); this.field_186455_c = v; } -+ public void setBonusRolls(RandomValueRange v){ checkFrozen(); this.field_186456_d = v; } -+ -+ public LootEntry getEntry(String name) -+ { -+ for (LootEntry entry : this.field_186453_a) -+ if (name.equals(entry.getEntryName())) -+ return entry; -+ return null; -+ } -+ public LootEntry removeEntry(String name) -+ { -+ checkFrozen(); -+ for (LootEntry entry : this.field_186453_a) -+ { -+ if (name.equals(entry.getEntryName())) -+ { -+ this.field_186453_a.remove(entry); -+ return entry; -+ } -+ } -+ return null; -+ } -+ public void addEntry(LootEntry entry) -+ { -+ checkFrozen(); -+ for (LootEntry e : this.field_186453_a) -+ if (e == entry || e.getEntryName().equals(entry.getEntryName())) -+ throw new RuntimeException("Attempted to add a duplicate entry to pool: " + e.getEntryName()); -+ this.field_186453_a.add(entry); -+ } -+ //TODO: Allow modifications of conditions? If so need a way to uniquely identify them. -+ //======================== FORGE END =============================================== -+ - public static class Serializer implements JsonDeserializer, JsonSerializer - { - public LootPool deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException - { - JsonObject jsonobject = JsonUtils.func_151210_l(p_deserialize_1_, "loot pool"); -+ String name = net.minecraftforge.common.ForgeHooks.readPoolName(jsonobject); - LootEntry[] alootentry = (LootEntry[])JsonUtils.func_188174_a(jsonobject, "entries", p_deserialize_3_, LootEntry[].class); - LootCondition[] alootcondition = (LootCondition[])JsonUtils.func_188177_a(jsonobject, "conditions", new LootCondition[0], p_deserialize_3_, LootCondition[].class); - RandomValueRange randomvaluerange = (RandomValueRange)JsonUtils.func_188174_a(jsonobject, "rolls", p_deserialize_3_, RandomValueRange.class); - RandomValueRange randomvaluerange1 = (RandomValueRange)JsonUtils.func_188177_a(jsonobject, "bonus_rolls", new RandomValueRange(0.0F, 0.0F), p_deserialize_3_, RandomValueRange.class); -- return new LootPool(alootentry, alootcondition, randomvaluerange, randomvaluerange1); -+ return new LootPool(alootentry, alootcondition, randomvaluerange, randomvaluerange1, name); - } - - public JsonElement serialize(LootPool p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) - { - JsonObject jsonobject = new JsonObject(); -+ if (p_serialize_1_.name != null && !p_serialize_1_.name.startsWith("custom#")) -+ jsonobject.add("name", p_serialize_3_.serialize(p_serialize_1_.name)); - jsonobject.add("entries", p_serialize_3_.serialize(p_serialize_1_.field_186453_a)); - jsonobject.add("rolls", p_serialize_3_.serialize(p_serialize_1_.field_186455_c)); - -@@ -106,7 +161,7 @@ - jsonobject.add("bonus_rolls", p_serialize_3_.serialize(p_serialize_1_.field_186456_d)); - } - -- if (!ArrayUtils.isEmpty((Object[])p_serialize_1_.field_186454_b)) -+ if (!p_serialize_1_.field_186454_b.isEmpty()) - { - jsonobject.add("conditions", p_serialize_3_.serialize(p_serialize_1_.field_186454_b)); - } diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootTable.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootTable.java.patch deleted file mode 100644 index 58ecc2ba27..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootTable.java.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootTable.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootTable.java -@@ -24,11 +24,11 @@ - { - private static final Logger field_186465_b = LogManager.getLogger(); - public static final LootTable field_186464_a = new LootTable(new LootPool[0]); -- private final LootPool[] field_186466_c; -+ private final List field_186466_c; - - public LootTable(LootPool[] p_i46641_1_) - { -- this.field_186466_c = p_i46641_1_; -+ this.field_186466_c = Lists.newArrayList(p_i46641_1_); - } - - public List func_186462_a(Random p_186462_1_, LootContext p_186462_2_) -@@ -144,6 +144,58 @@ - return list; - } - -+ //======================== FORGE START ============================================= -+ private boolean isFrozen = false; -+ public void freeze() -+ { -+ this.isFrozen = true; -+ for (LootPool pool : this.field_186466_c) -+ pool.freeze(); -+ } -+ public boolean isFrozen(){ return this.isFrozen; } -+ private void checkFrozen() -+ { -+ if (this.isFrozen()) -+ throw new RuntimeException("Attempted to modify LootTable after being finalized!"); -+ } -+ -+ public LootPool getPool(String name) -+ { -+ for (LootPool pool : this.field_186466_c) -+ { -+ if (name.equals(pool.getName())) -+ return pool; -+ } -+ return null; -+ } -+ -+ public LootPool removePool(String name) -+ { -+ checkFrozen(); -+ for (LootPool pool : this.field_186466_c) -+ { -+ if (name.equals(pool.getName())) -+ { -+ this.field_186466_c.remove(pool); -+ return pool; -+ } -+ } -+ -+ return null; -+ } -+ -+ public void addPool(LootPool pool) -+ { -+ checkFrozen(); -+ for (LootPool p : this.field_186466_c) -+ { -+ if (p == pool || p.getName().equals(pool.getName())) -+ throw new RuntimeException("Attempted to add a duplicate pool to loot table: " + pool.getName()); -+ } -+ this.field_186466_c.add(pool); -+ } -+ //======================== FORGE END =============================================== -+ - public static class Serializer implements JsonDeserializer, JsonSerializer - { - public LootTable deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch deleted file mode 100644 index 81a4d3d3c8..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/LootTableManager.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/LootTableManager.java -@@ -111,7 +111,7 @@ - - try - { -- return (LootTable)JsonUtils.func_188178_a(LootTableManager.field_186526_b, s, LootTable.class); -+ return net.minecraftforge.common.ForgeHooks.loadLootTable(LootTableManager.field_186526_b, p_186517_1_, s, true, LootTableManager.this); - } - catch (IllegalArgumentException | JsonParseException jsonparseexception) - { -@@ -153,7 +153,7 @@ - - try - { -- return (LootTable)JsonUtils.func_188178_a(LootTableManager.field_186526_b, s, LootTable.class); -+ return net.minecraftforge.common.ForgeHooks.loadLootTable(LootTableManager.field_186526_b, p_186518_1_, s, false, LootTableManager.this); - } - catch (JsonParseException jsonparseexception) - { diff --git a/patches/minecraft/net/minecraft/world/storage/loot/conditions/LootConditionManager.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/conditions/LootConditionManager.java.patch deleted file mode 100644 index 47f72e8d38..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/conditions/LootConditionManager.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/conditions/LootConditionManager.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/conditions/LootConditionManager.java -@@ -42,6 +42,15 @@ - } - } - -+ public static boolean testAllConditions(Iterable conditions, Random rand, LootContext context) -+ { -+ if (conditions == null) return true; -+ for (LootCondition cond : conditions) -+ if (!cond.func_186618_a(rand, context)) -+ return false; -+ return true; -+ } -+ - public static boolean func_186638_a(@Nullable LootCondition[] p_186638_0_, Random p_186638_1_, LootContext p_186638_2_) - { - if (p_186638_0_ == null) diff --git a/patches/minecraft/net/minecraft/world/storage/loot/conditions/RandomChanceWithLooting.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/conditions/RandomChanceWithLooting.java.patch deleted file mode 100644 index 22ab3c87ab..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/conditions/RandomChanceWithLooting.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/conditions/RandomChanceWithLooting.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/conditions/RandomChanceWithLooting.java -@@ -23,13 +23,8 @@ - - public boolean func_186618_a(Random p_186618_1_, LootContext p_186618_2_) - { -- int i = 0; -+ int i = p_186618_2_.getLootingModifier(); - -- if (p_186618_2_.func_186492_c() instanceof EntityLivingBase) -- { -- i = EnchantmentHelper.func_185283_h((EntityLivingBase)p_186618_2_.func_186492_c()); -- } -- - return p_186618_1_.nextFloat() < this.field_186627_a + (float)i * this.field_186628_b; - } - diff --git a/patches/minecraft/net/minecraft/world/storage/loot/functions/LootingEnchantBonus.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/functions/LootingEnchantBonus.java.patch deleted file mode 100644 index c6bf5438a6..0000000000 --- a/patches/minecraft/net/minecraft/world/storage/loot/functions/LootingEnchantBonus.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../src-base/minecraft/net/minecraft/world/storage/loot/functions/LootingEnchantBonus.java -+++ ../src-work/minecraft/net/minecraft/world/storage/loot/functions/LootingEnchantBonus.java -@@ -32,7 +32,7 @@ - - if (entity instanceof EntityLivingBase) - { -- int i = EnchantmentHelper.func_185283_h((EntityLivingBase)entity); -+ int i = p_186553_3_.getLootingModifier(); - - if (i == 0) - { diff --git a/src/main/java/net/minecraftforge/advancements/critereon/OredictItemPredicate.java b/src/main/java/net/minecraftforge/advancements/critereon/OredictItemPredicate.java new file mode 100644 index 0000000000..35b42a5d0f --- /dev/null +++ b/src/main/java/net/minecraftforge/advancements/critereon/OredictItemPredicate.java @@ -0,0 +1,51 @@ +/* + * Minecraft Forge + * Copyright (c) 2016-2018. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.minecraftforge.advancements.critereon; + + +import com.google.gson.JsonObject; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.ArrayUtils; + +import net.minecraft.advancements.critereon.ItemPredicate; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +/** + * An {@link ItemPredicate} that matches oredicts. + */ +public class OredictItemPredicate /*extends ItemPredicate */ +{/* + private final String ore; + + public OredictItemPredicate(String ore) + { + this.ore = ore; + } + + public OredictItemPredicate(JsonObject jsonObject) { this(JsonUtils.getString(jsonObject, "ore")); } + + @Override + public boolean test(ItemStack stack) + { + return !stack.isEmpty() && ArrayUtils.contains(OreDictionary.getOreIDs(stack), OreDictionary.getOreID(ore)); + } + */ +}