From ca72710937a88ffbcccb9f748ae1890ea9887514 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 14 Feb 2019 15:08:53 -0800 Subject: [PATCH] Initial 1.13.2 update. Major thing to note is that Dimensions have been completely revamped. DimensionType is not unique per Dimension. See DimensionManager for more details. Vanilla now has a chunk loading system, so Forge's will need to be deprecated/adapted. --- build.gradle | 10 +- .../PlayerAdvancements.java.patch | 2 +- .../criterion/ItemPredicate.java.patch | 10 +- .../net/minecraft/block/Block.java.patch | 62 +- .../block/BlockAbstractBanner.java.patch | 4 +- .../net/minecraft/block/BlockBed.java.patch | 2 +- .../net/minecraft/block/BlockBush.java.patch | 2 +- .../minecraft/block/BlockCactus.java.patch | 4 +- .../net/minecraft/block/BlockCocoa.java.patch | 2 +- .../minecraft/block/BlockDeadBush.java.patch | 2 +- .../minecraft/block/BlockDropper.java.patch | 2 +- .../net/minecraft/block/BlockFence.java.patch | 16 +- .../net/minecraft/block/BlockFire.java.patch | 62 +- .../minecraft/block/BlockFlowerPot.java.patch | 4 +- .../minecraft/block/BlockLeaves.java.patch | 2 +- .../block/BlockMobSpawner.java.patch | 2 +- .../block/BlockNetherWart.java.patch | 27 +- .../net/minecraft/block/BlockNote.java.patch | 4 +- ...onBars.java.patch => BlockPane.java.patch} | 20 +- .../block/BlockPistonBase.java.patch | 20 +- .../block/BlockPistonMoving.java.patch | 2 +- .../minecraft/block/BlockRailBase.java.patch | 6 +- .../block/BlockRailDetector.java.patch | 4 +- .../block/BlockRailPowered.java.patch | 8 +- .../minecraft/block/BlockRailState.java.patch | 4 +- .../block/BlockRedstoneDiode.java.patch | 2 +- .../block/BlockRedstoneTorch.java.patch | 4 +- .../block/BlockRedstoneWire.java.patch | 24 +- .../net/minecraft/block/BlockReed.java.patch | 4 +- .../minecraft/block/BlockSapling.java.patch | 2 +- .../minecraft/block/BlockSnowLayer.java.patch | 2 +- .../net/minecraft/block/BlockStem.java.patch | 4 +- .../minecraft/block/BlockTallGrass.java.patch | 2 +- .../net/minecraft/block/BlockWall.java.patch | 2 +- .../net/minecraft/block/BlockWeb.java.patch | 2 +- .../block/state/IBlockState.java.patch | 4 +- .../minecraft/client/GameSettings.java.patch | 26 +- .../client/KeyboardListener.java.patch | 4 +- .../net/minecraft/client/Minecraft.java.patch | 73 +- .../client/audio/SoundHandler.java.patch | 19 +- .../client/audio/SoundManager.java.patch | 10 +- .../client/entity/EntityPlayerSP.java.patch | 10 +- .../minecraft/client/gui/GuiButton.java.patch | 4 +- .../client/gui/GuiCreateWorld.java.patch | 6 +- .../client/gui/GuiEnchantment.java.patch | 11 +- .../client/gui/GuiMainMenu.java.patch | 16 +- .../gui/achievement/GuiStats.java.patch | 2 +- .../AdvancementTabType.java.patch | 10 + .../advancements/GuiAdvancementTab.java.patch | 4 +- .../GuiScreenAdvancements.java.patch | 6 +- .../inventory/GuiContainerCreative.java.patch | 32 +- .../ChunkProviderClient.java.patch | 16 +- .../multiplayer/PlayerControllerMP.java.patch | 2 +- .../client/multiplayer/WorldClient.java.patch | 16 +- .../network/NetHandlerLoginClient.java.patch | 8 +- .../network/NetHandlerPlayClient.java.patch | 20 +- .../client/particle/Particle.java.patch | 8 +- .../particle/ParticleManager.java.patch | 6 +- .../client/renderer/FogRenderer.java.patch | 37 +- ...rer.java.patch => GameRenderer.java.patch} | 60 +- .../client/renderer/ItemRenderer.java.patch | 24 +- .../client/renderer/LightTexture.java.patch | 7 +- ...al.java.patch => WorldRenderer.java.patch} | 82 ++- .../block/model/ModelBakery.java.patch | 11 - .../model/ModelBlockDefinition.java.patch | 18 - .../renderer/chunk/RenderChunk.java.patch | 25 +- .../renderer/color/BlockColors.java.patch | 14 +- .../entity/RenderItemFrame.java.patch | 9 +- .../renderer/entity/RenderManager.java.patch | 11 +- .../renderer/entity/RenderPlayer.java.patch | 9 - .../entity/layers/LayerArmorBase.java.patch | 24 +- .../{block => }/model/BakedQuad.java.patch | 4 +- .../model/BakedQuadRetextured.java.patch | 4 +- .../{block => }/model/FaceBakery.java.patch | 4 +- .../{block => }/model/IBakedModel.java.patch | 4 +- .../model/IUnbakedModel.java.patch | 12 +- .../model/ItemCameraTransforms.java.patch | 4 +- .../model/ItemOverrideList.java.patch | 14 +- .../model/ItemTransformVec3f.java.patch | 4 +- .../renderer/model/ModelBakery.java.patch | 11 + .../{block => }/model/ModelBlock.java.patch | 42 +- .../model/ModelBlockDefinition.java.patch | 19 + .../{block => }/model/ModelManager.java.patch | 8 +- .../model/ModelResourceLocation.java.patch | 4 +- .../model/ModelRotation.java.patch | 11 +- .../model/SimpleBakedModel.java.patch | 4 +- .../{block => }/model/Variant.java.patch | 4 +- .../{block => }/model/VariantList.java.patch | 8 +- .../model/WeightedBakedModel.java.patch | 4 +- .../model/multipart/Multipart.java.patch | 4 +- .../LayeredColorMaskTexture.java.patch | 2 +- .../renderer/texture/Stitcher.java.patch | 6 +- .../TileEntityRendererDispatcher.java.patch | 33 +- .../renderer/vertex/VertexFormat.java.patch | 12 +- .../client/settings/KeyBinding.java.patch | 58 +- .../client/shader/ShaderGroup.java.patch | 2 +- .../client/shader/ShaderLoader.java.patch | 2 +- .../client/shader/ShaderManager.java.patch | 4 +- .../net/minecraft/command/Commands.java.patch | 6 +- .../arguments/BlockStateParser.java.patch | 25 +- .../arguments/EntitySelectorParser.java.patch | 10 +- .../minecraft/crash/CrashReport.java.patch | 2 +- .../enchantment/Enchantment.java.patch | 8 +- .../enchantment/EnchantmentHelper.java.patch | 10 +- .../net/minecraft/entity/Entity.java.patch | 97 ++- .../minecraft/entity/EntityLiving.java.patch | 8 +- .../entity/EntityLivingBase.java.patch | 84 +-- .../minecraft/entity/EntityType.java.patch | 25 +- .../entity/boss/EntityDragon.java.patch | 2 +- .../entity/item/EntityArmorStand.java.patch | 8 +- .../entity/item/EntityBoat.java.patch | 6 +- .../entity/item/EntityEnderPearl.java.patch | 17 +- .../entity/item/EntityFallingBlock.java.patch | 4 +- .../entity/item/EntityItem.java.patch | 34 +- .../entity/item/EntityItemFrame.java.patch | 2 +- .../entity/item/EntityMinecart.java.patch | 54 +- .../item/EntityMinecartContainer.java.patch | 18 +- .../entity/monster/EntityEvoker.java.patch | 2 +- .../entity/monster/EntityIronGolem.java.patch | 2 +- .../entity/monster/EntitySlime.java.patch | 2 +- .../entity/monster/EntitySnowman.java.patch | 2 +- .../entity/monster/EntityZombie.java.patch | 8 +- .../entity/passive/EntityHorse.java.patch | 4 +- .../entity/passive/EntityMooshroom.java.patch | 4 +- .../entity/passive/EntityParrot.java.patch | 4 +- .../entity/passive/EntityRabbit.java.patch | 4 +- .../entity/passive/EntitySheep.java.patch | 2 +- .../entity/passive/EntityVillager.java.patch | 4 +- .../entity/player/EntityPlayer.java.patch | 141 ++-- .../entity/player/EntityPlayerMP.java.patch | 51 +- .../entity/player/InventoryPlayer.java.patch | 6 +- .../entity/projectile/EntityArrow.java.patch | 4 +- .../projectile/EntityFishHook.java.patch | 12 +- .../projectile/EntityThrowable.java.patch | 2 +- .../net/minecraft/fluid/Fluid.java.patch | 6 +- .../net/minecraft/init/Biomes.java.patch | 4 +- .../net/minecraft/init/Blocks.java.patch | 4 +- .../net/minecraft/init/Bootstrap.java.patch | 15 +- .../minecraft/init/Enchantments.java.patch | 4 +- .../net/minecraft/init/Items.java.patch | 4 +- .../net/minecraft/init/MobEffects.java.patch | 4 +- .../net/minecraft/init/Particles.java.patch | 4 +- .../net/minecraft/init/PotionTypes.java.patch | 4 +- .../net/minecraft/init/SoundEvents.java.patch | 4 +- .../minecraft/inventory/Container.java.patch | 4 +- .../inventory/ContainerEnchantment.java.patch | 12 +- .../inventory/ContainerFurnace.java.patch | 6 +- .../inventory/ContainerRepair.java.patch | 8 +- .../minecraft/item/EnumDyeColor.java.patch | 8 +- .../net/minecraft/item/Item.java.patch | 66 +- .../net/minecraft/item/ItemArmor.java.patch | 2 +- .../net/minecraft/item/ItemAxe.java.patch | 4 +- .../minecraft/item/ItemBoneMeal.java.patch | 8 +- .../net/minecraft/item/ItemBow.java.patch | 2 +- .../net/minecraft/item/ItemBucket.java.patch | 4 +- .../minecraft/item/ItemBucketMilk.java.patch | 16 +- .../net/minecraft/item/ItemGroup.java.patch | 8 +- .../net/minecraft/item/ItemMap.java.patch | 51 +- .../minecraft/item/ItemMinecart.java.patch | 14 +- .../net/minecraft/item/ItemPickaxe.java.patch | 2 +- .../minecraft/item/ItemSeedFood.java.patch | 2 +- .../net/minecraft/item/ItemSeeds.java.patch | 2 +- .../net/minecraft/item/ItemSpade.java.patch | 4 +- .../net/minecraft/item/ItemStack.java.patch | 38 +- .../item/crafting/FurnaceRecipe.java.patch | 12 +- .../item/crafting/IRecipe.java.patch | 2 +- .../item/crafting/Ingredient.java.patch | 22 +- .../item/crafting/RecipeItemHelper.java.patch | 2 +- .../item/crafting/RecipeManager.java.patch | 2 +- .../crafting/RecipeSerializers.java.patch | 8 +- .../item/crafting/ShapedRecipe.java.patch | 18 +- .../network/NetHandlerHandshakeTCP.java.patch | 6 +- .../network/NetHandlerLoginServer.java.patch | 38 +- .../network/NetHandlerPlayServer.java.patch | 20 +- .../network/NetworkSystem.java.patch | 10 +- .../minecraft/network/PacketBuffer.java.patch | 8 +- .../net/minecraft/potion/Potion.java.patch | 12 +- .../minecraft/potion/PotionBrewing.java.patch | 12 +- .../minecraft/potion/PotionType.java.patch | 7 +- .../server/MinecraftServer.java.patch | 172 ++--- .../dedicated/DedicatedServer.java.patch | 23 +- .../integrated/IntegratedServer.java.patch | 39 +- .../management/PlayerChunkMapEntry.java.patch | 40 +- .../server/management/PlayerList.java.patch | 78 +-- .../tileentity/MobSpawnerBaseLogic.java.patch | 6 +- .../tileentity/TileEntity.java.patch | 18 +- .../tileentity/TileEntityChest.java.patch | 4 +- .../tileentity/TileEntityFurnace.java.patch | 20 +- .../tileentity/TileEntityPiston.java.patch | 2 +- .../TileEntityShulkerBox.java.patch | 2 +- .../tileentity/TileEntityType.java.patch | 9 +- .../util/ClassInheritanceMultiMap.java.patch | 6 +- .../net/minecraft/util/EnumFacing.java.patch | 2 +- .../util/ScreenShotHelper.java.patch | 59 +- .../net/minecraft/util/SoundEvent.java.patch | 4 +- .../util/registry/IRegistry.java.patch | 41 ++ .../net/minecraft/village/Village.java.patch | 32 +- .../net/minecraft/world/Explosion.java.patch | 22 +- .../net/minecraft/world/IWorld.java.patch | 2 +- ...hunkCache.java.patch => Region.java.patch} | 14 +- .../world/ServerWorldEventHandler.java.patch | 20 - .../net/minecraft/world/Teleporter.java.patch | 6 +- .../net/minecraft/world/World.java.patch | 367 ++++------ .../world/WorldEntitySpawner.java.patch | 94 ++- .../minecraft/world/WorldServer.java.patch | 187 ++--- .../world/WorldServerMulti.java.patch | 42 +- .../minecraft/world/biome/Biome.java.patch | 27 +- .../world/border/WorldBorder.java.patch | 4 +- .../chunk/BlockStateContainer.java.patch | 2 +- .../minecraft/world/chunk/Chunk.java.patch | 91 ++- .../chunk/storage/AnvilChunkLoader.java.patch | 12 +- .../chunk/storage/AnvilSaveHandler.java.patch | 17 - .../world/dimension/Dimension.java.patch | 13 +- .../world/dimension/DimensionType.java.patch | 111 ++- .../world/dimension/EndDimension.java.patch | 26 +- .../dimension/NetherDimension.java.patch | 23 + .../dimension/OverworldDimension.java.patch | 18 +- .../world/end/DragonFightManager.java.patch | 2 +- .../world/gen/ChunkProviderServer.java.patch | 36 +- .../world/gen/WorldGenRegion.java.patch | 10 +- .../feature/BigRedMushroomFeature.java.patch | 2 +- .../gen/feature/BigTreeFeature.java.patch | 13 +- .../gen/feature/GlowStoneFeature.java.patch | 6 +- .../structure/StructureStart.java.patch | 4 +- .../structure/VillagePieces.java.patch | 4 +- .../world/gen/layer/GenLayerBiome.java.patch | 32 +- .../world/gen/layer/LayerUtil.java.patch | 17 +- .../world/storage/DerivedWorldInfo.java.patch | 24 - .../world/storage/MapData.java.patch | 40 +- .../world/storage/SaveHandler.java.patch | 6 +- .../world/storage/WorldInfo.java.patch | 57 +- .../storage/loot/LootEntryItem.java.patch | 6 +- .../world/storage/loot/LootPool.java.patch | 6 +- .../storage/loot/LootTableManager.java.patch | 4 +- .../storage/loot/functions/Smelt.java.patch | 6 +- .../client/ForgeHooksClient.java | 41 +- .../minecraftforge/client/GuiIngameForge.java | 7 +- .../client/ItemModelMesherForge.java | 8 +- .../client/MinecraftForgeClient.java | 19 +- .../client/event/DrawBlockHighlightEvent.java | 8 +- .../client/event/EntityViewRenderEvent.java | 22 +- .../client/event/ModelBakeEvent.java | 16 +- .../client/event/RenderHandEvent.java | 8 +- .../client/event/RenderWorldLastEvent.java | 8 +- .../client/extensions/IForgeBakedModel.java | 4 +- .../client/extensions/IForgeRenderChunk.java | 6 +- .../client/model/BakedItemModel.java | 8 +- .../client/model/BakedModelWrapper.java | 8 +- .../client/model/BlockStateLoader.java | 10 +- .../client/model/FancyMissingModel.java | 10 +- .../client/model/ForgeBlockStateV1.java | 4 +- .../client/model/ICustomModelLoader.java | 2 +- .../minecraftforge/client/model/IModel.java | 4 +- .../client/model/ISmartVariant.java | 2 +- .../client/model/ItemLayerModel.java | 12 +- .../client/model/ModelDynBucket.java | 12 +- .../client/model/ModelFluid.java | 10 +- .../client/model/ModelLoader.java | 52 +- .../client/model/ModelLoaderRegistry.java | 4 +- .../client/model/MultiLayerModel.java | 12 +- .../client/model/MultiModel.java | 12 +- .../client/model/PerspectiveMapWrapper.java | 8 +- .../client/model/SimpleModelFontRenderer.java | 2 +- .../animation/AnimationItemOverrideList.java | 10 +- .../model/animation/AnimationModelBase.java | 6 +- .../model/animation/ModelBlockAnimation.java | 2 +- .../TileEntityRendererAnimation.java | 4 +- .../animation/TileEntityRendererFast.java | 4 +- .../client/model/b3d/B3DLoader.java | 10 +- .../client/model/obj/OBJLoader.java | 2 +- .../client/model/obj/OBJModel.java | 10 +- .../pipeline/ForgeBlockModelRenderer.java | 4 +- .../client/model/pipeline/LightUtil.java | 2 +- .../model/pipeline/UnpackedBakedQuad.java | 2 +- .../model/pipeline/VertexLighterFlat.java | 2 +- .../common/DimensionManager.java | 651 ++++++++---------- .../minecraftforge/common/ForgeConfig.java | 56 +- .../net/minecraftforge/common/ForgeHooks.java | 5 +- .../net/minecraftforge/common/ForgeMod.java | 13 +- .../minecraftforge/common/ModDimension.java | 55 ++ .../common/WorldSpecificSaveHandler.java | 113 --- .../common/chunkio/ChunkIOExecutor.java | 3 +- .../common/chunkio/QueuedChunk.java | 3 +- .../common/extensions/IForgeBlock.java | 2 +- .../common/extensions/IForgeBlockState.java | 2 +- .../common/extensions/IForgeDimension.java | 32 +- .../common/extensions/IForgeFluid.java | 2 +- .../common/extensions/IForgeFluidState.java | 2 +- .../common/extensions/IForgeItem.java | 17 +- .../common/extensions/IForgeWorld.java | 30 - .../common/model/TRSRTransformation.java | 6 +- .../common/model/animation/Clips.java | 4 +- .../network/DimensionMessageHandler.java | 6 +- .../common/network/ForgeMessage.java | 71 +- .../common/util/BlockSnapshot.java | 2 +- .../common/util/FakePlayer.java | 8 +- .../event/ForgeEventFactory.java | 4 +- .../entity/EntityTravelToDimensionEvent.java | 7 +- .../event/entity/living/LivingSpawnEvent.java | 20 +- .../event/world/RegisterDimensionsEvent.java | 59 ++ .../fluids/UniversalBucket.java | 14 +- .../fluids/capability/ItemFluidContainer.java | 4 +- .../fml/client/registry/ClientRegistry.java | 2 +- .../fml/common/gameevent/PlayerEvent.java | 47 +- .../fml/common/registry/VillagerRegistry.java | 2 +- .../fml/hooks/BasicEventHooks.java | 3 +- .../fml/network/FMLHandshakeHandler.java | 3 +- .../fml/network/FMLPlayMessages.java | 5 +- .../fml/network/NetworkHooks.java | 2 +- .../logging/ModelLoaderErrorMessage.java | 2 +- .../registries/ClearableRegistry.java | 175 +++++ .../registries/ForgeRegistries.java | 6 +- .../registries/ForgeRegistry.java | 10 +- .../minecraftforge/registries/GameData.java | 29 +- .../registries/IForgeRegistry.java | 1 + .../NamespacedDefaultedWrapper.java | 19 +- .../registries/NamespacedWrapper.java | 8 +- .../server/command/ChunkGenWorker.java | 16 +- .../server/command/CommandDimensions.java | 18 +- .../server/command/CommandEntity.java | 23 +- .../server/command/CommandGenerate.java | 14 +- .../server/command/CommandSetDimension.java | 27 +- .../server/command/CommandTps.java | 32 +- .../server/command/CommandTrack.java | 20 +- .../resources/META-INF/accesstransformer.cfg | 107 ++- src/main/resources/forge.exc | 124 ++-- .../debug/block/MaterialFogColorTest.java | 2 +- .../debug/block/ParticleEffectsTest.java | 2 +- .../debug/block/PathNodeTypeTest.java | 2 +- .../debug/block/SlipperinessTest.java | 2 +- .../debug/block/StickyBlockTest.java | 2 +- .../debug/client/model/AnimatedModelTest.java | 2 +- .../client/model/BlockstateRetextureTest.java | 4 +- .../model/ForgeBlockStatesLoaderTest.java | 2 +- .../client/model/ItemLayerModelTest.java | 2 +- .../client/model/ItemModelConflictTest.java | 2 +- .../client/model/ItemModelGenerationTest.java | 2 +- .../client/model/ModelBakeEventTest.java | 8 +- .../debug/client/model/ModelFluidTest.java | 4 +- .../client/model/ModelLoaderRegistryTest.java | 2 +- .../client/model/MultiLayerModelTest.java | 2 +- .../rendering/FastTESRTransparentTest.java | 2 +- .../debug/client/rendering/ItemTESRTest.java | 2 +- .../player/ReachDistanceAttributeTest.java | 2 +- .../entity/player/SwimSpeedAttributeTest.java | 2 +- .../debug/fluid/DynBucketTest.java | 4 +- .../debug/fluid/FluidPlacementTest.java | 4 +- .../debug/gameplay/AnytimeSleepingTest.java | 2 +- .../FurnaceFuelBurnTimeEventTest.java | 4 +- .../debug/gameplay/NoBedSleepingTest.java | 2 +- .../debug/gameplay/RecipeMatchingTest.java | 2 +- .../item/CanApplyAtEnchantingTableTest.java | 2 +- .../debug/item/HorseArmorTest.java | 2 +- .../debug/item/IsBookEnchantableTest.java | 2 +- .../debug/item/MapDataTest.java | 4 +- .../debug/item/NBTShareTagTest.java | 2 +- .../debug/item/OnItemUseFirstTest.java | 2 +- .../debug/item/PotionCurabilityTest.java | 2 +- .../minecraftforge/debug/item/ShieldTest.java | 2 +- .../debug/util/RotatingWrench.java | 4 +- .../debug/world/TileEntityLoadingTest.java | 2 +- 361 files changed, 3166 insertions(+), 3547 deletions(-) rename patches/minecraft/net/minecraft/block/{BlockIronBars.java.patch => BlockPane.java.patch} (50%) create mode 100644 patches/minecraft/net/minecraft/client/gui/advancements/AdvancementTabType.java.patch rename patches/minecraft/net/minecraft/client/renderer/{EntityRenderer.java.patch => GameRenderer.java.patch} (84%) rename patches/minecraft/net/minecraft/client/renderer/{RenderGlobal.java.patch => WorldRenderer.java.patch} (71%) 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 rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/BakedQuad.java.patch (93%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/BakedQuadRetextured.java.patch (88%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/FaceBakery.java.patch (98%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/IBakedModel.java.patch (82%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/IUnbakedModel.java.patch (70%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/ItemCameraTransforms.java.patch (92%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/ItemOverrideList.java.patch (69%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/ItemTransformVec3f.java.patch (86%) create mode 100644 patches/minecraft/net/minecraft/client/renderer/model/ModelBakery.java.patch rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/ModelBlock.java.patch (75%) create mode 100644 patches/minecraft/net/minecraft/client/renderer/model/ModelBlockDefinition.java.patch rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/ModelManager.java.patch (76%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/ModelResourceLocation.java.patch (67%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/ModelRotation.java.patch (77%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/SimpleBakedModel.java.patch (80%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/Variant.java.patch (85%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/VariantList.java.patch (65%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/WeightedBakedModel.java.patch (70%) rename patches/minecraft/net/minecraft/client/renderer/{block => }/model/multipart/Multipart.java.patch (88%) rename patches/minecraft/net/minecraft/{server => }/network/NetHandlerHandshakeTCP.java.patch (69%) rename patches/minecraft/net/minecraft/{server => }/network/NetHandlerLoginServer.java.patch (82%) create mode 100644 patches/minecraft/net/minecraft/util/registry/IRegistry.java.patch rename patches/minecraft/net/minecraft/world/{ChunkCache.java.patch => Region.java.patch} (92%) delete mode 100644 patches/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch create mode 100644 patches/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch create mode 100644 src/main/java/net/minecraftforge/common/ModDimension.java delete mode 100644 src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java create mode 100644 src/main/java/net/minecraftforge/event/world/RegisterDimensionsEvent.java create mode 100644 src/main/java/net/minecraftforge/registries/ClearableRegistry.java diff --git a/build.gradle b/build.gradle index 5df72be60..74cd3991b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { repositories { - //mavenLocal() + mavenLocal() maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() @@ -45,8 +45,8 @@ ext { } MAPPING_CHANNEL = 'snapshot' MAPPING_VERSION = '20180921-1.13' - MC_VERSION = '1.13' - MCP_VERSION = '2018.09.12.04.11.00' + MC_VERSION = '1.13.2' + MCP_VERSION = '20190213.203750' } project(':mcp') { @@ -75,7 +75,7 @@ project(':clean') { mkdir 'runclient' } classpath sourceSets.main.runtimeClasspath - args = ['--accessToken', '0', '--version', '1.13'] + args = ['--accessToken', '0', '--version', MC_VERSION] main 'net.minecraft.client.main.Main' workingDir 'runclient' } @@ -140,7 +140,7 @@ project(':forge') { } ext { - SPEC_VERSION = '24.0' // This is overwritten by git tag, but here so dev time doesnt explode + SPEC_VERSION = '25.0' // This is overwritten by git tag, but here so dev time doesnt explode // The new versioning sceme is -.. // ForgeMC is a unique identifier for every MC version we have supported. // Essentially, the same as the old, except dropping the first number, and the builds are no longer unique. diff --git a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch b/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch index f4295d911..2b621a3c9 100644 --- a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch +++ b/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch @@ -11,7 +11,7 @@ boolean flag1 = advancementprogress.func_192105_a(); @@ -186,6 +188,7 @@ if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_82766_b("announceAdvancements")) { - 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()})); + 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(), 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/criterion/ItemPredicate.java.patch b/patches/minecraft/net/minecraft/advancements/criterion/ItemPredicate.java.patch index 4cd3ca5eb..15163eb09 100644 --- a/patches/minecraft/net/minecraft/advancements/criterion/ItemPredicate.java.patch +++ b/patches/minecraft/net/minecraft/advancements/criterion/ItemPredicate.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/advancements/criterion/ItemPredicate.java +++ b/net/minecraft/advancements/criterion/ItemPredicate.java -@@ -23,6 +23,8 @@ - import net.minecraft.util.ResourceLocation; +@@ -24,6 +24,8 @@ + import net.minecraft.util.registry.IRegistry; public class ItemPredicate { + private static final Map> custom_predicates = new java.util.HashMap<>(); @@ -9,7 +9,7 @@ public static final ItemPredicate field_192495_a = new ItemPredicate(); @Nullable private final Tag field_200018_b; -@@ -89,6 +91,11 @@ +@@ -90,6 +92,11 @@ public static ItemPredicate func_192492_a(@Nullable JsonElement p_192492_0_) { if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) { JsonObject jsonobject = JsonUtils.func_151210_l(p_192492_0_, "item"); @@ -21,7 +21,7 @@ MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count")); MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability")); if (jsonobject.has("data")) { -@@ -180,6 +187,14 @@ +@@ -181,6 +188,14 @@ } } @@ -34,5 +34,5 @@ + } + public static class Builder { - private final List field_200312_a = Lists.newArrayList(); + private final List field_200312_a = Lists.newArrayList(); @Nullable diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 776b34ebc..822e51b26 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -1,23 +1,19 @@ --- a/net/minecraft/block/Block.java +++ b/net/minecraft/block/Block.java -@@ -74,11 +74,13 @@ +@@ -75,9 +75,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -public class Block implements IItemProvider { +public class Block extends net.minecraftforge.registries.ForgeRegistryEntry implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock { protected static final Logger field_196273_d = LogManager.getLogger(); - 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(); -+ @Deprecated //Forge: Do not use, use ForgeRegistries -+ public static final RegistryNamespacedDefaultedByKey field_149771_c = net.minecraftforge.registries.GameData.getWrapperDefaulted(Block.class); +- public static final ObjectIntIdentityMap field_176229_d = new ObjectIntIdentityMap<>(); + @Deprecated //Forge: Do not use, use GameRegistry + public static final ObjectIntIdentityMap field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap(); + private static final EnumFacing[] field_212556_a = new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.DOWN, EnumFacing.UP}; protected final int field_149784_t; protected final float field_149782_v; - protected final float field_149781_w; -@@ -316,7 +318,7 @@ +@@ -298,7 +299,7 @@ @Deprecated public boolean func_196253_a(IBlockState p_196253_1_, BlockItemUseContext p_196253_2_) { @@ -26,7 +22,7 @@ } @Deprecated -@@ -328,8 +330,9 @@ +@@ -310,8 +311,9 @@ return this.field_149789_z; } @@ -37,7 +33,7 @@ } @Deprecated -@@ -340,11 +343,11 @@ +@@ -322,11 +324,11 @@ @Deprecated @OnlyIn(Dist.CLIENT) public int func_185484_c(IBlockState p_185484_1_, IWorldReader p_185484_2_, BlockPos p_185484_3_) { @@ -51,7 +47,7 @@ } else { return i; } -@@ -486,8 +489,12 @@ +@@ -468,8 +470,12 @@ @Deprecated public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) { @@ -64,7 +60,7 @@ public int func_196264_a(IBlockState p_196264_1_, Random p_196264_2_) { return 1; } -@@ -502,30 +509,30 @@ +@@ -484,30 +490,30 @@ if (f == -1.0F) { return 0.0F; } else { @@ -109,7 +105,7 @@ 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; -@@ -547,6 +554,7 @@ +@@ -529,6 +535,7 @@ } @@ -117,7 +113,7 @@ public float func_149638_a() { return this.field_149781_w; } -@@ -561,7 +569,7 @@ +@@ -543,7 +550,7 @@ } } @@ -126,7 +122,7 @@ } public void func_180652_a(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) { -@@ -615,16 +623,22 @@ +@@ -597,16 +604,22 @@ 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_) { p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this)); p_180657_2_.func_71020_j(0.005F); @@ -151,7 +147,7 @@ protected boolean func_149700_E() { return this.func_176223_P().func_185917_h() && !this.func_149716_u(); } -@@ -681,6 +695,7 @@ +@@ -663,6 +676,7 @@ p_176216_2_.field_70181_x = 0.0D; } @@ -159,7 +155,7 @@ public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) { return new ItemStack(this); } -@@ -755,6 +770,7 @@ +@@ -737,6 +751,7 @@ } } @@ -167,7 +163,7 @@ public SoundType func_185467_w() { return this.field_149762_H; } -@@ -776,11 +792,11 @@ +@@ -758,11 +773,11 @@ } public static boolean func_196252_e(Block p_196252_0_) { @@ -181,24 +177,24 @@ } public static void func_149671_p() { -@@ -1147,7 +1163,7 @@ - func_196254_a("chiseled_quartz_block", new Block(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_151677_p).func_200943_b(0.8F))); - func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_151677_p).func_200943_b(0.8F))); - func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Builder.func_200950_a(block42))); -- func_196254_a("activator_rail", new BlockRailPowered(Block.Builder.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e))); -+ func_196254_a("activator_rail", new BlockRailPowered(Block.Builder.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true)); - func_196254_a("dropper", new BlockDropper(Block.Builder.func_200945_a(Material.field_151576_e).func_200943_b(3.5F))); - func_196254_a("white_terracotta", new Block(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_193561_M).func_200948_a(1.25F, 4.2F))); - func_196254_a("orange_terracotta", new Block(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_193562_N).func_200948_a(1.25F, 4.2F))); -@@ -1464,6 +1480,7 @@ - func_196254_a("structure_block", new BlockStructure(Block.Builder.func_200949_a(Material.field_151573_f, MapColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F))); - field_149771_c.func_177776_a(); +@@ -1129,7 +1144,7 @@ + func_196254_a("chiseled_quartz_block", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F))); + func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F))); + func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Properties.func_200950_a(block42))); +- func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e))); ++ func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true)); + func_196254_a("dropper", new BlockDropper(Block.Properties.func_200945_a(Material.field_151576_e).func_200943_b(3.5F))); + func_196254_a("white_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193561_M).func_200948_a(1.25F, 4.2F))); + func_196254_a("orange_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193562_N).func_200948_a(1.25F, 4.2F))); +@@ -1455,6 +1470,7 @@ + func_196254_a("bubble_column", new BlockBubbleColumn(Block.Properties.func_200945_a(Material.field_203244_i).func_200942_a())); + func_196254_a("structure_block", new BlockStructure(Block.Properties.func_200949_a(Material.field_151573_f, MaterialColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F))); + if(false) // Processed in GameData.BlockCallbacks#onBake - for(Block block80 : field_149771_c) { - for(IBlockState iblockstate : block80.func_176194_O().func_177619_a()) { + for(Block block85 : IRegistry.field_212618_g) { + for(IBlockState iblockstate : block85.func_176194_O().func_177619_a()) { field_176229_d.func_195867_b(iblockstate); -@@ -1604,4 +1621,83 @@ +@@ -1594,4 +1610,83 @@ return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c); } } diff --git a/patches/minecraft/net/minecraft/block/BlockAbstractBanner.java.patch b/patches/minecraft/net/minecraft/block/BlockAbstractBanner.java.patch index 4a420fe59..e5f6e90a9 100644 --- a/patches/minecraft/net/minecraft/block/BlockAbstractBanner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockAbstractBanner.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/BlockAbstractBanner.java +++ b/net/minecraft/block/BlockAbstractBanner.java -@@ -50,7 +50,7 @@ +@@ -51,7 +51,7 @@ } public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) { @@ -9,7 +9,7 @@ } 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_) { -@@ -73,4 +73,10 @@ +@@ -75,4 +75,10 @@ public EnumDyeColor func_196285_M_() { return this.field_196286_a; } diff --git a/patches/minecraft/net/minecraft/block/BlockBed.java.patch b/patches/minecraft/net/minecraft/block/BlockBed.java.patch index 76a727fd7..c7585fca6 100644 --- a/patches/minecraft/net/minecraft/block/BlockBed.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBed.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/BlockBed.java +++ b/net/minecraft/block/BlockBed.java -@@ -66,7 +66,9 @@ +@@ -67,7 +67,9 @@ } } diff --git a/patches/minecraft/net/minecraft/block/BlockBush.java.patch b/patches/minecraft/net/minecraft/block/BlockBush.java.patch index 2ebb73e44..0db69b24f 100644 --- a/patches/minecraft/net/minecraft/block/BlockBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBush.java.patch @@ -6,7 +6,7 @@ -public class BlockBush extends Block { +public class BlockBush extends Block implements net.minecraftforge.common.IPlantable { - protected BlockBush(Block.Builder p_i48437_1_) { + protected BlockBush(Block.Properties p_i48437_1_) { super(p_i48437_1_); } @@ -26,6 +26,8 @@ diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch index dde294a1e..82582bf76 100644 --- a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch @@ -24,10 +24,10 @@ + if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, blockpos, p_196267_1_, true)) { if (j == 15) { p_196267_2_.func_175656_a(blockpos, this.func_176223_P()); - IBlockState iblockstate = (IBlockState)p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(0)); + IBlockState iblockstate = p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(0)); @@ -52,7 +54,8 @@ } else { - p_196267_2_.func_180501_a(p_196267_3_, (IBlockState)p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(j + 1)), 4); + p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176587_a, Integer.valueOf(j + 1)), 4); } - + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_); diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch index 52e4517b1..b683a062c 100644 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -9,7 +9,7 @@ int i = p_196267_1_.func_177229_b(field_176501_a); - if (i < 2) { + if (i < 2 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_2_.field_73012_v.nextInt(5) == 0)) { - p_196267_2_.func_180501_a(p_196267_3_, (IBlockState)p_196267_1_.func_206870_a(field_176501_a, Integer.valueOf(i + 1)), 2); + p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176501_a, Integer.valueOf(i + 1)), 2); + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_); } } diff --git a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch b/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch index ec044aee7..be05194f9 100644 --- a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch @@ -8,7 +8,7 @@ +public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable { protected static final VoxelShape field_196397_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D); - protected BlockDeadBush(Block.Builder p_i48418_1_) { + protected BlockDeadBush(Block.Properties p_i48418_1_) { @@ -46,4 +46,10 @@ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, flag ? Blocks.field_150350_a.func_176223_P() : p_180657_4_, p_180657_5_, p_180657_6_); diff --git a/patches/minecraft/net/minecraft/block/BlockDropper.java.patch b/patches/minecraft/net/minecraft/block/BlockDropper.java.patch index f63894504..e76a48f4a 100644 --- a/patches/minecraft/net/minecraft/block/BlockDropper.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDropper.java.patch @@ -6,6 +6,6 @@ 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); + EnumFacing enumfacing = p_176439_1_.func_180495_p(p_176439_2_).func_177229_b(field_176441_a); IInventory iinventory = TileEntityHopper.func_195484_a(p_176439_1_, p_176439_2_.func_177972_a(enumfacing)); ItemStack itemstack1; diff --git a/patches/minecraft/net/minecraft/block/BlockFence.java.patch b/patches/minecraft/net/minecraft/block/BlockFence.java.patch index a816a460f..ace8048c6 100644 --- a/patches/minecraft/net/minecraft/block/BlockFence.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFence.java.patch @@ -12,13 +12,13 @@ - IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2); - IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3); - IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4); -- return (IBlockState)((IBlockState)((IBlockState)((IBlockState)((IBlockState)super.func_196258_a(p_196258_1_).func_206870_a(field_196409_a, Boolean.valueOf(this.func_196416_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH))))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196416_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.WEST))))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196416_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.NORTH))))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196416_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.EAST))))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); +- return super.func_196258_a(p_196258_1_).func_206870_a(field_196409_a, Boolean.valueOf(this.func_196416_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196416_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.WEST)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196416_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196416_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.EAST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); + return super.func_196258_a(p_196258_1_) -+ .func_206870_a(field_196409_a, canFenceConnectTo(iblockreader, blockpos, EnumFacing.NORTH)) -+ .func_206870_a(field_196411_b, canFenceConnectTo(iblockreader, blockpos, EnumFacing.EAST)) -+ .func_206870_a(field_196413_c, canFenceConnectTo(iblockreader, blockpos, EnumFacing.SOUTH)) -+ .func_206870_a(field_196414_y, canFenceConnectTo(iblockreader, blockpos, EnumFacing.WEST)) -+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); ++ .func_206870_a(field_196409_a, canFenceConnectTo(iblockreader, blockpos, EnumFacing.NORTH)) ++ .func_206870_a(field_196411_b, canFenceConnectTo(iblockreader, blockpos, EnumFacing.EAST)) ++ .func_206870_a(field_196413_c, canFenceConnectTo(iblockreader, blockpos, EnumFacing.SOUTH)) ++ .func_206870_a(field_196414_y, canFenceConnectTo(iblockreader, blockpos, EnumFacing.WEST)) ++ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); } public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) { @@ -26,8 +26,8 @@ p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_)); } -- return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? (IBlockState)p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196416_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); -+ return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? (IBlockState)p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canFenceConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); +- return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196416_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); ++ return p_196271_2_.func_176740_k().func_176716_d() == EnumFacing.Plane.HORIZONTAL ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canFenceConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); } protected void func_206840_a(StateContainer.Builder p_206840_1_) { diff --git a/patches/minecraft/net/minecraft/block/BlockFire.java.patch b/patches/minecraft/net/minecraft/block/BlockFire.java.patch index 92c370a4b..53a89665e 100644 --- a/patches/minecraft/net/minecraft/block/BlockFire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFire.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/BlockFire.java +++ b/net/minecraft/block/BlockFire.java -@@ -63,13 +63,13 @@ +@@ -64,13 +64,13 @@ public IBlockState func_196448_a(IBlockReader p_196448_1_, BlockPos p_196448_2_) { IBlockState iblockstate = p_196448_1_.func_180495_p(p_196448_2_.func_177977_b()); @@ -11,12 +11,12 @@ for(EnumFacing enumfacing : EnumFacing.values()) { BooleanProperty booleanproperty = field_196449_B.get(enumfacing); if (booleanproperty != null) { -- iblockstate1 = (IBlockState)iblockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.func_196446_i(p_196448_1_.func_180495_p(p_196448_2_.func_177972_a(enumfacing))))); -+ iblockstate1 = iblockstate1.func_206870_a(booleanproperty, this.canCatchFire(p_196448_1_, p_196448_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())); +- iblockstate1 = iblockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.func_196446_i(p_196448_1_.func_180495_p(p_196448_2_.func_177972_a(enumfacing))))); ++ iblockstate1 = iblockstate1.func_206870_a(booleanproperty, Boolean.valueOf(this.canCatchFire(p_196448_1_, p_196448_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))); } } -@@ -97,12 +97,13 @@ +@@ -98,12 +98,13 @@ public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) { if (p_196267_2_.func_82736_K().func_82766_b("doFireTick")) { @@ -32,7 +32,7 @@ int i = p_196267_1_.func_177229_b(field_176543_a); if (!flag && p_196267_2_.func_72896_J() && this.func_176537_d(p_196267_2_, p_196267_3_) && p_196267_4_.nextFloat() < 0.2F + (float)i * 0.03F) { p_196267_2_.func_175698_g(p_196267_3_); -@@ -116,14 +117,14 @@ +@@ -117,14 +118,14 @@ if (!flag) { p_196267_2_.func_205220_G_().func_205360_a(p_196267_3_, this, this.func_149738_a(p_196267_2_) + p_196267_4_.nextInt(10)); if (!this.func_196447_a(p_196267_2_, p_196267_3_)) { @@ -49,7 +49,7 @@ p_196267_2_.func_175698_g(p_196267_3_); return; } -@@ -131,12 +132,12 @@ +@@ -132,12 +133,12 @@ boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_); int k = flag1 ? -50 : 0; @@ -68,7 +68,7 @@ BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for(int l = -1; l <= 1; ++l) { -@@ -174,28 +175,31 @@ +@@ -175,16 +176,18 @@ return p_176537_1_.func_175727_C(p_176537_2_) || p_176537_1_.func_175727_C(p_176537_2_.func_177976_e()) || p_176537_1_.func_175727_C(p_176537_2_.func_177974_f()) || p_176537_1_.func_175727_C(p_176537_2_.func_177978_c()) || p_176537_1_.func_175727_C(p_176537_2_.func_177968_d()); } @@ -84,32 +84,12 @@ - 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()); -- if (p_176536_4_.nextInt(p_176536_3_) < i) { -- IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_); -- if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) { -- int j = Math.min(p_176536_5_ + p_176536_4_.nextInt(5) / 4, 15); -- p_176536_1_.func_180501_a(p_176536_2_, (IBlockState)this.func_196448_a(p_176536_1_, p_176536_2_).func_206870_a(field_176543_a, Integer.valueOf(j)), 3); -+ private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, EnumFacing face) { -+ IBlockState other = worldIn.func_180495_p(pos); -+ int i = other.getFlammability(worldIn, pos, face); -+ if (random.nextInt(chance) < i) { -+ IBlockState iblockstate = worldIn.func_180495_p(pos); -+ if (random.nextInt(age + 10) < 5 && !worldIn.func_175727_C(pos)) { -+ int j = Math.min(age + random.nextInt(5) / 4, 15); -+ worldIn.func_180501_a(pos, (IBlockState)this.func_196448_a(worldIn, pos).func_206870_a(field_176543_a, Integer.valueOf(j)), 3); - } else { -- p_176536_1_.func_175698_g(p_176536_2_); -+ worldIn.func_175698_g(pos); - } - - Block block = iblockstate.func_177230_c(); - if (block instanceof BlockTNT) { -- ((BlockTNT)block).func_196534_a(p_176536_1_, p_176536_2_); -+ ((BlockTNT)block).func_196534_a(worldIn, pos); - } - } - -@@ -203,7 +207,7 @@ ++ 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_).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_); + if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_)) { +@@ -204,7 +207,7 @@ private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) { for(EnumFacing enumfacing : EnumFacing.values()) { @@ -118,7 +98,7 @@ return true; } } -@@ -218,7 +222,7 @@ +@@ -219,7 +222,7 @@ int i = 0; for(EnumFacing enumfacing : EnumFacing.values()) { @@ -127,7 +107,7 @@ } return i; -@@ -229,6 +233,7 @@ +@@ -230,6 +233,7 @@ return false; } @@ -135,7 +115,7 @@ public boolean func_196446_i(IBlockState p_196446_1_) { return this.func_176534_d(p_196446_1_.func_177230_c()) > 0; } -@@ -251,8 +256,8 @@ +@@ -252,8 +256,8 @@ 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); } @@ -146,7 +126,7 @@ for(int j = 0; j < 2; ++j) { double d3 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble() * (double)0.1F; double d8 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -261,7 +266,7 @@ +@@ -262,7 +266,7 @@ } } @@ -155,7 +135,7 @@ for(int k = 0; k < 2; ++k) { double d4 = (double)(p_180655_3_.func_177958_n() + 1) - p_180655_4_.nextDouble() * (double)0.1F; double d9 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -270,7 +275,7 @@ +@@ -271,7 +275,7 @@ } } @@ -164,7 +144,7 @@ for(int l = 0; l < 2; ++l) { double d5 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble(); double d10 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -279,7 +284,7 @@ +@@ -280,7 +284,7 @@ } } @@ -173,7 +153,7 @@ for(int i1 = 0; i1 < 2; ++i1) { double d6 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble(); double d11 = (double)p_180655_3_.func_177956_o() + p_180655_4_.nextDouble(); -@@ -288,7 +293,7 @@ +@@ -289,7 +293,7 @@ } } @@ -182,7 +162,7 @@ for(int j1 = 0; j1 < 2; ++j1) { double d7 = (double)p_180655_3_.func_177958_n() + p_180655_4_.nextDouble(); double d12 = (double)(p_180655_3_.func_177956_o() + 1) - p_180655_4_.nextDouble() * (double)0.1F; -@@ -320,10 +325,23 @@ +@@ -321,10 +325,23 @@ } public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) { diff --git a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch b/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch index a50fbc266..609f11f84 100644 --- a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch @@ -4,8 +4,8 @@ import net.minecraft.world.World; public class BlockFlowerPot extends Block { -- private static final Map field_196451_b = Maps.newHashMap(); -+ private static final Map field_196451_b = Maps.newHashMap(); //TODO: Delegates +- private static final Map field_196451_b = Maps.newHashMap(); ++ private static final Map field_196451_b = Maps.newHashMap(); //TODO: Delegates protected static final VoxelShape field_196450_a = Block.func_208617_a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D); private final Block field_196452_c; diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch index 2411dd278..6dab8ef77 100644 --- a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch @@ -72,7 +72,7 @@ protected void func_206840_a(StateContainer.Builder p_206840_1_) { @@ -189,4 +192,10 @@ public IBlockState func_196258_a(BlockItemUseContext p_196258_1_) { - return func_208493_b((IBlockState)this.func_176223_P().func_206870_a(field_208495_b, Boolean.valueOf(true)), p_196258_1_.func_195991_k(), p_196258_1_.func_195995_a()); + return func_208493_b(this.func_176223_P().func_206870_a(field_208495_b, Boolean.valueOf(true)), p_196258_1_.func_195991_k(), p_196258_1_.func_195995_a()); } + + @Override diff --git a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch index 2786613be..ad0dc4aac 100644 --- a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch @@ -6,7 +6,7 @@ public class BlockMobSpawner extends BlockContainer { + private static final java.util.Random RAND = new java.util.Random(); + - protected BlockMobSpawner(Block.Builder p_i48364_1_) { + protected BlockMobSpawner(Block.Properties p_i48364_1_) { super(p_i48364_1_); } @@ -27,10 +29,13 @@ diff --git a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch index e44c334df..6de05de96 100644 --- a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch @@ -1,17 +1,14 @@ --- a/net/minecraft/block/BlockNetherWart.java +++ b/net/minecraft/block/BlockNetherWart.java -@@ -33,26 +33,33 @@ +@@ -33,16 +33,22 @@ public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) { int i = p_196267_1_.func_177229_b(field_176486_a); - if (i < 3 && p_196267_4_.nextInt(10) == 0) { -- p_196267_1_ = (IBlockState)p_196267_1_.func_206870_a(field_176486_a, Integer.valueOf(i + 1)); -- p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2); + if (i < 3 && net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt(10) == 0)) { -+ IBlockState newState = (IBlockState)p_196267_1_.func_206870_a(field_176486_a, Integer.valueOf(i + 1)); -+ p_196267_2_.func_180501_a(p_196267_3_, newState, 2); + p_196267_1_ = p_196267_1_.func_206870_a(field_176486_a, Integer.valueOf(i + 1)); + p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2); + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_); -+ p_196267_1_ = newState; } super.func_196267_b(p_196267_1_, p_196267_2_, p_196267_3_, p_196267_4_); @@ -19,22 +16,16 @@ public void func_196255_a(IBlockState p_196255_1_, World p_196255_2_, BlockPos p_196255_3_, float p_196255_4_, int p_196255_5_) { - if (!p_196255_2_.field_72995_K) { -+ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_); -+ } ++ super.func_196255_a(p_196255_1_, p_196255_2_, p_196255_3_, p_196255_4_, p_196255_5_); ++ } + + @Override -+ public void getDrops(IBlockState state, net.minecraft.util.NonNullList drops, World worldIn, BlockPos pos, int fortune) { ++ public void getDrops(IBlockState p_196255_1_, net.minecraft.util.NonNullList drops, World p_196255_2_, BlockPos p_196255_3_, int p_196255_5_) { + { int i = 1; -- if (p_196255_1_.func_177229_b(field_176486_a) >= 3) { -- i = 2 + p_196255_2_.field_73012_v.nextInt(3); -- if (p_196255_5_ > 0) { -- i += p_196255_2_.field_73012_v.nextInt(p_196255_5_ + 1); -+ if (state.func_177229_b(field_176486_a) >= 3) { -+ i = 2 + worldIn.field_73012_v.nextInt(3); -+ if (fortune > 0) { -+ i += worldIn.field_73012_v.nextInt(fortune + 1); - } + if (p_196255_1_.func_177229_b(field_176486_a) >= 3) { + i = 2 + p_196255_2_.field_73012_v.nextInt(3); +@@ -52,7 +58,7 @@ } for(int j = 0; j < i; ++j) { diff --git a/patches/minecraft/net/minecraft/block/BlockNote.java.patch b/patches/minecraft/net/minecraft/block/BlockNote.java.patch index 8863e598d..de5bb1a17 100644 --- a/patches/minecraft/net/minecraft/block/BlockNote.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNote.java.patch @@ -13,7 +13,7 @@ if (p_196250_2_.field_72995_K) { return true; } else { -- p_196250_1_ = (IBlockState)p_196250_1_.func_177231_a(field_196485_c); +- p_196250_1_ = p_196250_1_.func_177231_a(field_196485_c); + int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_196250_2_, p_196250_3_, p_196250_1_, p_196250_1_.func_177229_b(field_196485_c), p_196250_1_.func_177231_a(field_196485_c).func_177229_b(field_196485_c)); + if (_new == -1) return false; + p_196250_1_ = (IBlockState)p_196250_1_.func_206870_a(field_196485_c, _new); @@ -29,4 +29,4 @@ + p_189539_1_ = p_189539_1_.func_206870_a(field_196485_c, e.getVanillaNoteId()).func_206870_a(field_196483_a, e.getInstrument()); int i = p_189539_1_.func_177229_b(field_196485_c); float f = (float)Math.pow(2.0D, (double)(i - 12) / 12.0D); - p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, ((NoteBlockInstrument)p_189539_1_.func_177229_b(field_196483_a)).func_208088_a(), SoundCategory.RECORDS, 3.0F, f); + p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, p_189539_1_.func_177229_b(field_196483_a).func_208088_a(), SoundCategory.RECORDS, 3.0F, f); diff --git a/patches/minecraft/net/minecraft/block/BlockIronBars.java.patch b/patches/minecraft/net/minecraft/block/BlockPane.java.patch similarity index 50% rename from patches/minecraft/net/minecraft/block/BlockIronBars.java.patch rename to patches/minecraft/net/minecraft/block/BlockPane.java.patch index 4e0de40c2..29b4ba9bd 100644 --- a/patches/minecraft/net/minecraft/block/BlockIronBars.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPane.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/block/BlockIronBars.java -+++ b/net/minecraft/block/BlockIronBars.java +--- a/net/minecraft/block/BlockPane.java ++++ b/net/minecraft/block/BlockPane.java @@ -25,15 +25,12 @@ IBlockReader iblockreader = p_196258_1_.func_195991_k(); BlockPos blockpos = p_196258_1_.func_195995_a(); @@ -12,13 +12,13 @@ - IBlockState iblockstate1 = iblockreader.func_180495_p(blockpos2); - IBlockState iblockstate2 = iblockreader.func_180495_p(blockpos3); - IBlockState iblockstate3 = iblockreader.func_180495_p(blockpos4); -- return (IBlockState)((IBlockState)((IBlockState)((IBlockState)((IBlockState)this.func_176223_P().func_206870_a(field_196409_a, Boolean.valueOf(this.func_196417_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH))))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196417_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.NORTH))))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196417_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.EAST))))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196417_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.WEST))))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); +- return this.func_176223_P().func_206870_a(field_196409_a, Boolean.valueOf(this.func_196417_a(iblockstate, iblockstate.func_193401_d(iblockreader, blockpos1, EnumFacing.SOUTH)))).func_206870_a(field_196413_c, Boolean.valueOf(this.func_196417_a(iblockstate1, iblockstate1.func_193401_d(iblockreader, blockpos2, EnumFacing.NORTH)))).func_206870_a(field_196414_y, Boolean.valueOf(this.func_196417_a(iblockstate2, iblockstate2.func_193401_d(iblockreader, blockpos3, EnumFacing.EAST)))).func_206870_a(field_196411_b, Boolean.valueOf(this.func_196417_a(iblockstate3, iblockstate3.func_193401_d(iblockreader, blockpos4, EnumFacing.WEST)))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); + return this.func_176223_P() -+ .func_206870_a(field_196409_a, canPaneConnectTo(iblockreader, blockpos, EnumFacing.NORTH)) -+ .func_206870_a(field_196413_c, canPaneConnectTo(iblockreader, blockpos, EnumFacing.SOUTH)) -+ .func_206870_a(field_196414_y, canPaneConnectTo(iblockreader, blockpos, EnumFacing.WEST)) -+ .func_206870_a(field_196411_b, canPaneConnectTo(iblockreader, blockpos, EnumFacing.EAST)) -+ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); ++ .func_206870_a(field_196409_a, canPaneConnectTo(iblockreader, blockpos, EnumFacing.NORTH)) ++ .func_206870_a(field_196413_c, canPaneConnectTo(iblockreader, blockpos, EnumFacing.SOUTH)) ++ .func_206870_a(field_196414_y, canPaneConnectTo(iblockreader, blockpos, EnumFacing.WEST)) ++ .func_206870_a(field_196411_b, canPaneConnectTo(iblockreader, blockpos, EnumFacing.EAST)) ++ .func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); } public IBlockState func_196271_a(IBlockState p_196271_1_, EnumFacing p_196271_2_, IBlockState p_196271_3_, IWorld p_196271_4_, BlockPos p_196271_5_, BlockPos p_196271_6_) { @@ -26,8 +26,8 @@ p_196271_4_.func_205219_F_().func_205360_a(p_196271_5_, Fluids.field_204546_a, Fluids.field_204546_a.func_205569_a(p_196271_4_)); } -- return p_196271_2_.func_176740_k().func_176722_c() ? (IBlockState)p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196417_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); -+ return p_196271_2_.func_176740_k().func_176722_c() ? (IBlockState)p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canPaneConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); +- return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.func_196417_a(p_196271_3_, p_196271_3_.func_193401_d(p_196271_4_, p_196271_6_, p_196271_2_.func_176734_d())))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); ++ return p_196271_2_.func_176740_k().func_176722_c() ? p_196271_1_.func_206870_a(field_196415_z.get(p_196271_2_), Boolean.valueOf(this.canPaneConnectTo(p_196271_4_, p_196271_5_, p_196271_2_))) : super.func_196271_a(p_196271_1_, p_196271_2_, p_196271_3_, p_196271_4_, p_196271_5_, p_196271_6_); } public boolean func_149686_d(IBlockState p_149686_1_) { diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index fea7b46dd..f3a231e4b 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/block/BlockPistonBase.java +++ b/net/minecraft/block/BlockPistonBase.java -@@ -235,7 +235,7 @@ +@@ -244,7 +244,7 @@ return false; } @@ -9,19 +9,19 @@ } else { return false; } -@@ -266,7 +266,9 @@ +@@ -280,7 +280,9 @@ for(int j = list2.size() - 1; j >= 0; --j) { - BlockPos blockpos1 = list2.get(j); - IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos1); -- iblockstate.func_196949_c(p_176319_1_, blockpos1, 0); + BlockPos blockpos2 = list2.get(j); + IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos2); +- iblockstate.func_196949_c(p_176319_1_, blockpos2, 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_196941_a(p_176319_1_, blockpos1, chance, 0); - p_176319_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 18); ++ iblockstate.func_196941_a(p_176319_1_, blockpos2, chance, 0); + p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18); --k; aiblockstate[k] = iblockstate; -@@ -320,6 +322,10 @@ - return (IBlockState)p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a((EnumFacing)p_185499_1_.func_177229_b(field_176387_N))); +@@ -333,6 +335,10 @@ + return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N))); } + public IBlockState rotate(IBlockState state, net.minecraft.world.IWorld world, BlockPos pos, Rotation direction) { @@ -29,5 +29,5 @@ + } + public IBlockState func_185471_a(IBlockState p_185471_1_, Mirror p_185471_2_) { - return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a((EnumFacing)p_185471_1_.func_177229_b(field_176387_N))); + return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a(p_185471_1_.func_177229_b(field_176387_N))); } diff --git a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch index fdd64b99a..403b606c7 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch @@ -22,5 +22,5 @@ + } + public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) { - return ShapeUtils.func_197880_a(); + return VoxelShapes.func_197880_a(); } diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch index 089f6de3d..2110ec226 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -4,7 +4,7 @@ } public VoxelShape func_196244_b(IBlockState p_196244_1_, IBlockReader p_196244_2_, BlockPos p_196244_3_) { -- RailShape railshape = p_196244_1_.func_177230_c() == this ? (RailShape)p_196244_1_.func_177229_b(this.func_176560_l()) : null; +- RailShape railshape = p_196244_1_.func_177230_c() == this ? p_196244_1_.func_177229_b(this.func_176560_l()) : null; + RailShape railshape = p_196244_1_.func_177230_c() == this ? getRailDirection(p_196244_1_, p_196244_2_, p_196244_3_, null) : null; return railshape != null && railshape.func_208092_c() ? field_190959_b : field_185590_a; } @@ -22,7 +22,7 @@ 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_.field_72995_K) { -- RailShape railshape = (RailShape)p_189540_1_.func_177229_b(this.func_176560_l()); +- RailShape railshape = p_189540_1_.func_177229_b(this.func_176560_l()); + RailShape railshape = getRailDirection(p_189540_1_, p_189540_2_, p_189540_3_, null); boolean flag = false; - if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q()) { @@ -48,7 +48,7 @@ public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) { if (!p_196243_5_) { super.func_196243_a(p_196243_1_, p_196243_2_, p_196243_3_, p_196243_4_, p_196243_5_); -- if (((RailShape)p_196243_1_.func_177229_b(this.func_176560_l())).func_208092_c()) { +- if (p_196243_1_.func_177229_b(this.func_176560_l()).func_208092_c()) { + if (getRailDirection(p_196243_1_, p_196243_2_, p_196243_3_, null).func_208092_c()) { p_196243_2_.func_195593_d(p_196243_3_.func_177984_a(), this); } diff --git a/patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch b/patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch index b397f165a..c5246eb88 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailDetector.java.patch @@ -6,6 +6,6 @@ if (p_180641_1_.func_177229_b(field_176574_M)) { + List carts = this.func_200878_a(p_180641_2_, p_180641_3_, EntityMinecart.class, null); + if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel(); - List list = this.func_200878_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class, (Predicate)null); + List list = this.func_200878_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class, (Predicate)null); if (!list.isEmpty()) { - return ((EntityMinecartCommandBlock)list.get(0)).func_145822_e().func_145760_g(); + return list.get(0).func_145822_e().func_145760_g(); diff --git a/patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch b/patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch index 29feb0d92..4f8d7e7bc 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailPowered.java.patch @@ -6,14 +6,14 @@ public static final BooleanProperty field_176569_M = BlockStateProperties.field_208194_u; + private final boolean isActivator; - protected BlockRailPowered(Block.Builder p_i48349_1_) { + protected BlockRailPowered(Block.Properties p_i48349_1_) { - super(true, p_i48349_1_); + this(p_i48349_1_, false); + } + -+ protected BlockRailPowered(Block.Builder builder, boolean isActivator) { ++ protected BlockRailPowered(Block.Properties builder, boolean isActivator) { + super(true, builder); - this.func_180632_j((IBlockState)((IBlockState)(this.field_176227_L.func_177621_b()).func_206870_a(field_176568_b, RailShape.NORTH_SOUTH)).func_206870_a(field_176569_M, Boolean.valueOf(false))); + this.func_180632_j(this.field_176227_L.func_177621_b().func_206870_a(field_176568_b, RailShape.NORTH_SOUTH).func_206870_a(field_176569_M, Boolean.valueOf(false))); + this.isActivator = isActivator; } @@ -26,4 +26,4 @@ + if (!(iblockstate.func_177230_c() instanceof BlockRailPowered) || isActivator != ((BlockRailPowered)iblockstate.func_177230_c()).isActivator) { return false; } else { - RailShape railshape = (RailShape)iblockstate.func_177229_b(field_176568_b); + RailShape railshape = iblockstate.func_177229_b(field_176568_b); diff --git a/patches/minecraft/net/minecraft/block/BlockRailState.java.patch b/patches/minecraft/net/minecraft/block/BlockRailState.java.patch index 9c5b79413..63521e159 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailState.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailState.java.patch @@ -3,7 +3,7 @@ @@ -16,14 +16,16 @@ private IBlockState field_196923_d; private final boolean field_208513_e; - private final List field_196924_e = Lists.newArrayList(); + private final List field_196924_e = Lists.newArrayList(); + private final boolean canMakeSlopes; public BlockRailState(World p_i47755_1_, BlockPos p_i47755_2_, IBlockState p_i47755_3_) { @@ -11,7 +11,7 @@ this.field_196921_b = p_i47755_2_; this.field_196923_d = p_i47755_3_; this.field_196922_c = (BlockRailBase)p_i47755_3_.func_177230_c(); -- RailShape railshape = (RailShape)p_i47755_3_.func_177229_b(this.field_196922_c.func_176560_l()); +- RailShape railshape = p_i47755_3_.func_177229_b(this.field_196922_c.func_176560_l()); - this.field_208513_e = this.field_196922_c.func_208490_b(); + RailShape railshape = this.field_196922_c.getRailDirection(field_196923_d, p_i47755_1_, p_i47755_2_, null); + this.field_208513_e = this.field_196922_c.isFlexibleRail(field_196923_d, p_i47755_1_, p_i47755_2_); diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch index 642b6133d..aa7c44fb4 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch @@ -11,7 +11,7 @@ public void func_196267_b(IBlockState p_196267_1_, World p_196267_2_, BlockPos p_196267_3_, Random p_196267_4_) { @@ -172,6 +172,8 @@ protected void func_176400_h(World p_176400_1_, BlockPos p_176400_2_, IBlockState p_176400_3_) { - EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_185512_D); + 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; diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch index a362333f8..571c0011c 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.java.patch @@ -4,8 +4,8 @@ public class BlockRedstoneTorch extends BlockTorch { public static final BooleanProperty field_196528_a = BlockStateProperties.field_208190_q; -- private static final Map> field_196529_b = Maps.>newHashMap(); +- private static final Map> field_196529_b = Maps.newHashMap(); + private static final Map> field_196529_b = new java.util.WeakHashMap>(); // FORGE - fix vanilla MC-101233 - protected BlockRedstoneTorch(Block.Builder p_i48342_1_) { + protected BlockRedstoneTorch(Block.Properties p_i48342_1_) { super(p_i48342_1_); diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch index 09aa899f6..07ff16751 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch @@ -29,7 +29,7 @@ } private IBlockState func_176338_e(World p_176338_1_, BlockPos p_176338_2_, IBlockState p_176338_3_) { -@@ -337,36 +337,28 @@ +@@ -338,26 +338,18 @@ IBlockState iblockstate = p_176339_1_.func_180495_p(blockpos); boolean flag = iblockstate.func_185915_l(); boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_185915_l(); @@ -37,7 +37,7 @@ + if (!flag1 && flag && canConnectTo(p_176339_1_.func_180495_p(blockpos.func_177984_a()), p_176339_1_, blockpos.func_177984_a(), null)) { return true; - } else if (func_176343_a(iblockstate, p_176339_3_)) { -+ } else if (canConnectTo(iblockstate, p_176339_1_, p_176339_2_, p_176339_3_)) { ++ } else if (canConnectTo(iblockstate, p_176339_1_, blockpos, p_176339_3_)) { return true; } else if (iblockstate.func_177230_c() == Blocks.field_196633_cV && iblockstate.func_177229_b(BlockRedstoneDiode.field_196348_c) && iblockstate.func_177229_b(BlockRedstoneDiode.field_185512_D) == p_176339_3_) { return true; @@ -56,24 +56,16 @@ - } - - protected static boolean func_176343_a(IBlockState p_176343_0_, @Nullable EnumFacing p_176343_1_) { -- Block block = p_176343_0_.func_177230_c(); -+ protected boolean canConnectTo(IBlockState blockState, IBlockReader world, BlockPos pos, @Nullable EnumFacing side) { -+ Block block = blockState.func_177230_c(); ++ protected boolean canConnectTo(IBlockState p_176343_0_, IBlockReader world, BlockPos pos, @Nullable EnumFacing p_176343_1_) { + Block block = p_176343_0_.func_177230_c(); if (block == Blocks.field_150488_af) { return true; -- } else if (p_176343_0_.func_177230_c() == Blocks.field_196633_cV) { -- EnumFacing enumfacing = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_185512_D); -- return enumfacing == p_176343_1_ || enumfacing.func_176734_d() == p_176343_1_; -- } else if (Blocks.field_190976_dk == p_176343_0_.func_177230_c()) { -- return p_176343_1_ == p_176343_0_.func_177229_b(BlockObserver.field_176387_N); -+ } else if (blockState.func_177230_c() == Blocks.field_196633_cV) { -+ EnumFacing enumfacing = (EnumFacing)blockState.func_177229_b(BlockRedstoneRepeater.field_185512_D); -+ return enumfacing == side || enumfacing.func_176734_d() == side; -+ } else if (Blocks.field_190976_dk == blockState.func_177230_c()) { -+ return side == blockState.func_177229_b(BlockObserver.field_176387_N); +@@ -367,7 +359,7 @@ + } else if (Blocks.field_190976_dk == p_176343_0_.func_177230_c()) { + return p_176343_1_ == p_176343_0_.func_177229_b(BlockObserver.field_176387_N); } else { - return p_176343_0_.func_185897_m() && p_176343_1_ != null; -+ return blockState.canConnectRedstone(world, pos, side); ++ return p_176343_0_.canConnectRedstone(world, pos, p_176343_1_) && p_176343_1_ != null; } } diff --git a/patches/minecraft/net/minecraft/block/BlockReed.java.patch b/patches/minecraft/net/minecraft/block/BlockReed.java.patch index c99178493..15fe18682 100644 --- a/patches/minecraft/net/minecraft/block/BlockReed.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockReed.java.patch @@ -16,9 +16,9 @@ + if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, true)) { if (j == 15) { p_196267_2_.func_175656_a(p_196267_3_.func_177984_a(), this.func_176223_P()); - p_196267_2_.func_180501_a(p_196267_3_, (IBlockState)p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(0)), 4); + p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(0)), 4); } else { - p_196267_2_.func_180501_a(p_196267_3_, (IBlockState)p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(j + 1)), 4); + p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(j + 1)), 4); } + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_); + } diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch index e1c7c0758..a1cbf8d3b 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -10,7 +10,7 @@ } @@ -39,6 +40,7 @@ if (p_176478_3_.func_177229_b(field_176479_b) == 0) { - p_176478_1_.func_180501_a(p_176478_2_, (IBlockState)p_176478_3_.func_177231_a(field_176479_b), 4); + p_176478_1_.func_180501_a(p_176478_2_, p_176478_3_.func_177231_a(field_176479_b), 4); } else { + if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(p_176478_1_, p_176478_4_, p_176478_2_)) return; this.field_196387_c.func_196935_a(p_176478_1_, p_176478_2_, p_176478_3_, p_176478_4_); diff --git a/patches/minecraft/net/minecraft/block/BlockSnowLayer.java.patch b/patches/minecraft/net/minecraft/block/BlockSnowLayer.java.patch index f907ba99f..1468d1d94 100644 --- a/patches/minecraft/net/minecraft/block/BlockSnowLayer.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSnowLayer.java.patch @@ -3,7 +3,7 @@ @@ -84,30 +84,45 @@ 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_) { - Integer integer = (Integer)p_180657_4_.func_177229_b(field_176315_a); + Integer integer = p_180657_4_.func_177229_b(field_176315_a); - if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0) { + net.minecraft.util.NonNullList items = net.minecraft.util.NonNullList.func_191196_a(); + int fortune = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_); diff --git a/patches/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch index f762a9339..1419c26b5 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStem.java.patch @@ -11,7 +11,7 @@ + if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_.nextInt((int)(25.0F / f) + 1) == 0)) { int i = p_196267_1_.func_177229_b(field_176484_a); if (i < 7) { -- p_196267_1_ = (IBlockState)p_196267_1_.func_206870_a(field_176484_a, Integer.valueOf(i + 1)); +- p_196267_1_ = p_196267_1_.func_206870_a(field_176484_a, Integer.valueOf(i + 1)); - p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_, 2); + p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176484_a, i + 1), 2); } else { @@ -23,7 +23,7 @@ + Block block = soil.func_177230_c(); + if (p_196267_2_.func_180495_p(blockpos).isAir(p_196267_2_, blockpos) && (soil.canSustainPlant(p_196267_2_, blockpos.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_196660_k || block == Blocks.field_196661_l || block == Blocks.field_196658_i)) { p_196267_2_.func_175656_a(blockpos, this.field_149877_a.func_176223_P()); - p_196267_2_.func_175656_a(p_196267_3_, (IBlockState)this.field_149877_a.func_196523_e().func_176223_P().func_206870_a(BlockHorizontal.field_185512_D, enumfacing)); + p_196267_2_.func_175656_a(p_196267_3_, this.field_149877_a.func_196523_e().func_176223_P().func_206870_a(BlockHorizontal.field_185512_D, enumfacing)); } } + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_); diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch index 8f67247b7..be184902d 100644 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch @@ -8,7 +8,7 @@ +public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable { protected static final VoxelShape field_196389_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D); - protected BlockTallGrass(Block.Builder p_i48310_1_) { + protected BlockTallGrass(Block.Properties p_i48310_1_) { @@ -27,7 +27,7 @@ } diff --git a/patches/minecraft/net/minecraft/block/BlockWall.java.patch b/patches/minecraft/net/minecraft/block/BlockWall.java.patch index 66177ef5a..754036307 100644 --- a/patches/minecraft/net/minecraft/block/BlockWall.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockWall.java.patch @@ -40,5 +40,5 @@ + boolean flag2 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.SOUTH); + boolean flag3 = canWallConnectTo(iworldreaderbase, blockpos, EnumFacing.WEST); boolean flag4 = (!flag || flag1 || !flag2 || flag3) && (flag || !flag1 || flag2 || !flag3); - return (IBlockState)((IBlockState)((IBlockState)((IBlockState)((IBlockState)((IBlockState)this.func_176223_P().func_206870_a(field_176256_a, Boolean.valueOf(flag4 || !iworldreaderbase.func_175623_d(blockpos.func_177984_a())))).func_206870_a(field_196409_a, Boolean.valueOf(flag))).func_206870_a(field_196411_b, Boolean.valueOf(flag1))).func_206870_a(field_196413_c, Boolean.valueOf(flag2))).func_206870_a(field_196414_y, Boolean.valueOf(flag3))).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); + return this.func_176223_P().func_206870_a(field_176256_a, Boolean.valueOf(flag4 || !iworldreaderbase.func_175623_d(blockpos.func_177984_a()))).func_206870_a(field_196409_a, Boolean.valueOf(flag)).func_206870_a(field_196411_b, Boolean.valueOf(flag1)).func_206870_a(field_196413_c, Boolean.valueOf(flag2)).func_206870_a(field_196414_y, Boolean.valueOf(flag3)).func_206870_a(field_204514_u, Boolean.valueOf(ifluidstate.func_206886_c() == Fluids.field_204546_a)); } diff --git a/patches/minecraft/net/minecraft/block/BlockWeb.java.patch b/patches/minecraft/net/minecraft/block/BlockWeb.java.patch index 9502c7874..77b1e975b 100644 --- a/patches/minecraft/net/minecraft/block/BlockWeb.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockWeb.java.patch @@ -14,7 +14,7 @@ -public class BlockWeb extends Block { +public class BlockWeb extends Block implements net.minecraftforge.common.IShearable { - public BlockWeb(Block.Builder p_i48296_1_) { + public BlockWeb(Block.Properties p_i48296_1_) { super(p_i48296_1_); } @@ -54,4 +55,10 @@ diff --git a/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch b/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch index e3f4d07d9..01fa9b25f 100644 --- a/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch +++ b/patches/minecraft/net/minecraft/block/state/IBlockState.java.patch @@ -6,8 +6,8 @@ -public interface IBlockState extends IStateHolder { +public interface IBlockState extends IStateHolder, net.minecraftforge.common.extensions.IForgeBlockState { - ThreadLocal> field_208776_a = ThreadLocal.>withInitial(() -> { - Object2ByteOpenHashMap object2byteopenhashmap = new Object2ByteOpenHashMap(); + ThreadLocal> field_208776_a = ThreadLocal.withInitial(() -> { + Object2ByteOpenHashMap object2byteopenhashmap = new Object2ByteOpenHashMap<>(); object2byteopenhashmap.defaultReturnValue((byte)127); @@ -97,6 +97,7 @@ return this.func_177230_c().func_149750_m(this); diff --git a/patches/minecraft/net/minecraft/client/GameSettings.java.patch b/patches/minecraft/net/minecraft/client/GameSettings.java.patch index 53453aea3..e40659bc7 100644 --- a/patches/minecraft/net/minecraft/client/GameSettings.java.patch +++ b/patches/minecraft/net/minecraft/client/GameSettings.java.patch @@ -1,22 +1,22 @@ --- a/net/minecraft/client/GameSettings.java +++ b/net/minecraft/client/GameSettings.java -@@ -168,6 +168,7 @@ +@@ -167,6 +167,7 @@ public boolean field_211842_aO; 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 = ""; -@@ -186,6 +187,7 @@ + this.field_74317_L = p_i46326_1_; + this.field_74354_ai = new File(p_i46326_2_, "options.txt"); + if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) { +@@ -180,6 +181,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 = ""; -@@ -247,7 +249,7 @@ + } + + public void func_198014_a(KeyBinding p_198014_1_, InputMappings.Input p_198014_2_) { +@@ -236,7 +238,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); @@ -25,7 +25,7 @@ } } -@@ -857,7 +859,11 @@ +@@ -846,7 +848,11 @@ for(KeyBinding keybinding : this.field_74324_K) { if (s1.equals("key_" + keybinding.func_151464_g())) { @@ -38,7 +38,7 @@ } } -@@ -905,6 +911,7 @@ +@@ -894,6 +900,7 @@ } public void func_74303_b() { @@ -46,7 +46,7 @@ PrintWriter printwriter = null; try { -@@ -982,7 +989,7 @@ +@@ -971,7 +978,7 @@ printwriter.println("glDebugVerbosity:" + this.field_209231_W); for(KeyBinding keybinding : this.field_74324_K) { @@ -55,7 +55,7 @@ } for(SoundCategory soundcategory : SoundCategory.values()) { -@@ -1084,6 +1091,33 @@ +@@ -1073,6 +1080,33 @@ p_198017_1_.func_198985_a(set); } diff --git a/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch b/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch index 6ab139000..bba1d5ec3 100644 --- a/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch +++ b/patches/minecraft/net/minecraft/client/KeyboardListener.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/KeyboardListener.java +++ b/net/minecraft/client/KeyboardListener.java -@@ -266,10 +266,14 @@ +@@ -271,10 +271,14 @@ GuiScreen.func_195121_a(() -> { if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) { if (p_197961_5_ == 0) { @@ -17,7 +17,7 @@ } }, "keyPressed event handler", iguieventlistener.getClass().getCanonicalName()); -@@ -346,12 +350,16 @@ +@@ -351,12 +355,16 @@ if (iguieventlistener != null) { if (Character.charCount(p_197963_3_) == 1) { GuiScreen.func_195121_a(() -> { diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index 59a7a4fe8..99186bb62 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/Minecraft.java +++ b/net/minecraft/client/Minecraft.java -@@ -318,7 +318,6 @@ +@@ -322,7 +322,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()); @@ -8,7 +8,7 @@ this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a; this.field_147129_ai = func_147122_X(); this.field_71437_Z = null; -@@ -405,9 +404,11 @@ +@@ -409,9 +408,11 @@ this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab); this.field_110451_am.func_199006_a(this.field_135017_as); this.field_71474_y.func_198017_a(this.field_110448_aq); @@ -20,7 +20,7 @@ this.field_195558_d.func_198098_h(); this.func_147108_a(new GuiScreenLoading()); this.func_195547_ap(); -@@ -425,6 +426,8 @@ +@@ -429,6 +430,8 @@ this.field_110451_am.func_199006_a(new GrassColorReloadListener()); this.field_110451_am.func_199006_a(new FoliageColorReloadListener()); @@ -29,7 +29,7 @@ this.field_195558_d.func_198076_a("Startup"); GlStateManager.func_179098_w(); GlStateManager.func_179103_j(7425); -@@ -438,19 +441,24 @@ +@@ -442,19 +445,24 @@ GlStateManager.func_179096_D(); GlStateManager.func_179128_n(5888); this.field_195558_d.func_198076_a("Post startup"); @@ -51,10 +51,10 @@ this.field_110451_am.func_199006_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_71460_t = new GameRenderer(this, this.field_110451_am); this.field_110451_am.func_199006_a(this.field_71460_t); this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH); -@@ -461,7 +469,10 @@ +@@ -465,7 +473,10 @@ this.field_110451_am.func_199006_a(this.field_193995_ae); GlStateManager.func_179083_b(0, 0, this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l()); this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o); @@ -66,7 +66,7 @@ if (this.field_71475_ae != null) { this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af)); } else { -@@ -470,6 +481,7 @@ +@@ -474,6 +485,7 @@ this.field_184132_p = new DebugRenderer(this); GLFW.glfwSetErrorCallback(this::func_195545_a).free(); @@ -74,16 +74,16 @@ if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) { this.field_195558_d.func_198077_g(); } -@@ -485,7 +497,7 @@ +@@ -489,7 +501,7 @@ }); - List list = Lists.newArrayList(); + List list = Lists.newArrayList(); GLFWErrorCallback glfwerrorcallback = GLFW.glfwSetErrorCallback((p_211100_1_, p_211100_2_) -> { - list.add(String.format("GLFW error during init: [0x%X]%s", p_211100_1_, p_211100_2_)); + list.add(String.format("GLFW error during init: [0x%X] %s", p_211100_1_, GLFWErrorCallback.getDescription(p_211100_2_))); }); if (!GLFW.glfwInit()) { throw new IllegalStateException("Failed to initialize GLFW, errors: " + Joiner.on(",").join(list)); -@@ -595,7 +607,7 @@ +@@ -599,7 +611,7 @@ Bootstrap.func_179870_a(p_71377_1_.func_71502_e()); if (p_71377_1_.func_71497_f() != null) { Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f()); @@ -92,15 +92,15 @@ } else if (p_71377_1_.func_147149_a(file2)) { Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath()); System.exit(-1); -@@ -610,6 +622,7 @@ +@@ -614,6 +626,7 @@ return this.field_71474_y.field_211842_aO; } + @Deprecated // Forge: Use selective refreshResources method in FMLClientHandler public void func_110436_a() { - List list = Lists.newArrayList(); this.field_110448_aq.func_198983_a(); -@@ -667,16 +680,20 @@ + List list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList()); +@@ -668,16 +681,20 @@ } public void func_147108_a(@Nullable GuiScreen p_147108_1_) { @@ -125,7 +125,7 @@ if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) { this.field_71474_y.field_74330_P = false; this.field_71456_v.func_146158_b().func_146231_a(true); -@@ -760,7 +777,7 @@ +@@ -761,7 +778,7 @@ GLFW.glfwPollEvents(); long i1 = Util.func_211178_c() - l; this.field_71424_I.func_76318_c("sound"); @@ -134,7 +134,7 @@ this.field_71424_I.func_76319_b(); this.field_71424_I.func_76320_a("render"); GlStateManager.func_179094_E(); -@@ -770,11 +787,13 @@ +@@ -771,11 +788,13 @@ GlStateManager.func_179098_w(); this.field_71424_I.func_76319_b(); if (!this.field_71454_w) { @@ -148,7 +148,7 @@ } this.field_71424_I.func_76319_b(); -@@ -992,8 +1011,8 @@ +@@ -994,8 +1013,8 @@ if (this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) { if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) { BlockPos blockpos = this.field_71476_x.func_178782_a(); @@ -159,7 +159,7 @@ this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND); } -@@ -1018,7 +1037,7 @@ +@@ -1020,7 +1039,7 @@ break; case BLOCK: BlockPos blockpos = this.field_71476_x.func_178782_a(); @@ -168,7 +168,7 @@ this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b); break; } -@@ -1028,6 +1047,7 @@ +@@ -1030,6 +1049,7 @@ } this.field_71439_g.func_184821_cY(); @@ -176,7 +176,16 @@ } this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND); -@@ -1077,6 +1097,9 @@ +@@ -1060,7 +1080,7 @@ + break; + case BLOCK: + BlockPos blockpos = this.field_71476_x.func_178782_a(); +- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f()) { ++ if (!this.field_71441_e.func_180495_p(blockpos).isAir(field_71441_e, blockpos)) { + int i = itemstack.func_190916_E(); + EnumActionResult enumactionresult = this.field_71442_b.func_187099_a(this.field_71439_g, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f, enumhand); + if (enumactionresult == EnumActionResult.SUCCESS) { +@@ -1079,6 +1099,9 @@ } } @@ -186,7 +195,7 @@ 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); return; -@@ -1096,6 +1119,8 @@ +@@ -1098,6 +1121,8 @@ --this.field_71467_ac; } @@ -195,7 +204,7 @@ this.field_71424_I.func_76320_a("gui"); if (!this.field_71445_n) { this.field_71456_v.func_73831_a(); -@@ -1216,6 +1241,8 @@ +@@ -1220,6 +1245,8 @@ this.field_71424_I.func_76318_c("keyboard"); this.field_195559_v.func_204870_b(); this.field_71424_I.func_76319_b(); @@ -204,7 +213,7 @@ } private void func_184117_aA() { -@@ -1392,8 +1419,14 @@ +@@ -1396,8 +1423,14 @@ NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress); networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> { })); @@ -220,7 +229,7 @@ this.field_71453_ak = networkmanager; } -@@ -1407,6 +1440,7 @@ +@@ -1411,6 +1444,7 @@ } public void func_205055_a(@Nullable WorldClient p_205055_1_, GuiScreen p_205055_2_) { @@ -228,7 +237,7 @@ if (p_205055_1_ == null) { NetHandlerPlayClient nethandlerplayclient = this.func_147114_u(); if (nethandlerplayclient != null) { -@@ -1443,6 +1477,7 @@ +@@ -1447,6 +1481,7 @@ } TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_205055_1_); @@ -236,15 +245,15 @@ if (p_205055_1_ != null) { if (!this.field_71455_al) { AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString()); -@@ -1489,6 +1524,7 @@ +@@ -1493,6 +1528,7 @@ EntityPlayerSP entityplayersp = this.field_71439_g; this.field_71439_g = this.field_71442_b.func_199681_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 RecipeBookClient(new RecipeManager()) : this.field_71439_g.func_199507_B()); 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_71439_g.field_71093_bK = p_212315_1_; this.field_175622_Z = this.field_71439_g; this.field_71439_g.func_70065_x(); -@@ -1528,110 +1564,8 @@ +@@ -1532,110 +1568,8 @@ private void func_147112_ai() { if (this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) { @@ -327,9 +336,9 @@ - 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(); +- s = IRegistry.field_212618_g.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 = ((ResourceLocation)EntityType.field_200787_a.func_177774_c(this.field_71476_x.field_72308_g.func_200600_R())).toString(); +- s = IRegistry.field_212629_r.func_177774_c(this.field_71476_x.field_72308_g.func_200600_R()).toString(); - } - - field_147123_G.warn("Picking on: [{}] {} gave null item", this.field_71476_x.field_72313_a, s); @@ -357,7 +366,7 @@ } } -@@ -1708,6 +1642,7 @@ +@@ -1712,6 +1646,7 @@ return field_71432_P; } @@ -365,7 +374,7 @@ public ListenableFuture func_175603_A() { return this.func_152344_a(this::func_110436_a); } -@@ -1867,6 +1802,8 @@ +@@ -1871,6 +1806,8 @@ } public MusicTicker.MusicType func_147109_W() { @@ -374,7 +383,7 @@ if (this.field_71462_r instanceof GuiWinGame) { return MusicTicker.MusicType.CREDITS; } else if (this.field_71439_g == null) { -@@ -2006,4 +1943,12 @@ +@@ -2010,4 +1947,12 @@ public FontResourceManager func_211500_ak() { return this.field_211501_aD; } diff --git a/patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch index f510d1d9d..9c27ca9d1 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/audio/SoundHandler.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/client/audio/SoundHandler.java +++ b/net/minecraft/client/audio/SoundHandler.java -@@ -63,6 +63,7 @@ +@@ -64,6 +64,7 @@ public void func_195410_a(IResourceManager p_195410_1_) { - this.field_147697_e.func_148763_c(); + this.field_147697_e.clear(); + java.util.List> resources = new java.util.LinkedList<>(); for(String s : p_195410_1_.func_199001_a()) { try { for(IResource iresource : p_195410_1_.func_199004_b(new ResourceLocation(s, "sounds.json"))) { -@@ -70,7 +71,7 @@ +@@ -71,7 +72,7 @@ Map map = this.func_175085_a(iresource.func_199027_b()); for(Entry entry : map.entrySet()) { @@ -17,10 +17,10 @@ } } catch (RuntimeException runtimeexception) { field_147698_b.warn("Invalid sounds.json in resourcepack: '{}'", iresource.func_199026_d(), runtimeexception); -@@ -81,6 +82,17 @@ +@@ -81,7 +82,18 @@ + ; } } - + try (net.minecraftforge.fml.common.progress.ProgressBar resourcesBar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Loading sounds", resources.size())) { + resources.forEach(entry -> { + resourcesBar.step(entry.func_76341_a().toString()); @@ -31,11 +31,12 @@ + } + }); + }; // Forge: end progress bar + + - for(ResourceLocation resourcelocation : this.field_147697_e.func_148742_b()) { - SoundEventAccessor soundeventaccessor = (SoundEventAccessor)this.field_147697_e.func_82594_a(resourcelocation); + for(ResourceLocation resourcelocation : this.field_147697_e.keySet()) { + SoundEventAccessor soundeventaccessor = this.field_147697_e.get(resourcelocation); if (soundeventaccessor.func_188712_c() instanceof TextComponentTranslation) { -@@ -210,6 +222,10 @@ +@@ -211,6 +223,10 @@ this.field_147694_f.func_148615_a(p_147691_1_, p_147691_2_); } @@ -46,7 +47,7 @@ public void func_147689_b() { this.field_147694_f.func_148610_e(); } -@@ -257,4 +273,9 @@ +@@ -258,4 +274,9 @@ public void func_195478_a(@Nullable ResourceLocation p_195478_1_, @Nullable SoundCategory p_195478_2_) { this.field_147694_f.func_195855_a(p_195478_1_, p_195478_2_); } diff --git a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch index d48402c2e..26a43388b 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/audio/SoundManager.java +++ b/net/minecraft/client/audio/SoundManager.java -@@ -75,6 +75,7 @@ +@@ -69,6 +69,7 @@ try { SoundSystemConfig.addLibrary(LibraryLWJGL3.class); SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); @@ -8,7 +8,7 @@ } catch (SoundSystemException soundsystemexception) { field_148621_b.error(field_148623_a, "Error linking with the LibraryJavaSound plug-in", (Throwable)soundsystemexception); } -@@ -94,6 +95,7 @@ +@@ -88,6 +89,7 @@ this.func_148613_b(); this.func_148608_i(); @@ -16,7 +16,7 @@ } private synchronized void func_148608_i() { -@@ -299,6 +301,8 @@ +@@ -293,6 +295,8 @@ public void func_148611_c(ISound p_148611_1_) { if (this.field_148617_f) { @@ -25,7 +25,7 @@ SoundEventAccessor soundeventaccessor = p_148611_1_.func_184366_a(this.field_148622_c); ResourceLocation resourcelocation = p_148611_1_.func_147650_b(); if (soundeventaccessor == null) { -@@ -340,8 +344,10 @@ +@@ -334,8 +338,10 @@ ResourceLocation resourcelocation1 = sound.func_188721_b(); if (sound.func_188723_h()) { this.field_148620_e.newStreamingSource(p_148611_1_.func_204200_l(), 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); @@ -36,7 +36,7 @@ } field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", sound.func_188719_a(), resourcelocation, s); -@@ -429,12 +435,16 @@ +@@ -423,12 +429,16 @@ } public void func_148615_a(EntityPlayer p_148615_1_, float p_148615_2_) { diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch index dd2dc94d1..5b671cef1 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/entity/EntityPlayerSP.java +++ b/net/minecraft/client/entity/EntityPlayerSP.java -@@ -137,6 +137,7 @@ +@@ -139,6 +139,7 @@ } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -8,7 +8,7 @@ return false; } -@@ -465,6 +466,11 @@ +@@ -468,6 +469,11 @@ } public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) { @@ -20,7 +20,7 @@ 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); } -@@ -670,6 +676,7 @@ +@@ -673,6 +679,7 @@ float f = 0.8F; boolean flag2 = this.field_71158_b.field_192832_b >= 0.8F; this.field_71158_b.func_78898_a(); @@ -28,7 +28,7 @@ this.field_71159_c.func_193032_ao().func_193293_a(this.field_71158_b); if (this.func_184587_cr() && !this.func_184218_aH()) { this.field_71158_b.field_78902_a *= 0.2F; -@@ -685,10 +692,14 @@ +@@ -688,10 +695,14 @@ } AxisAlignedBB axisalignedbb = this.func_174813_aQ(); @@ -43,7 +43,7 @@ boolean flag4 = (float)this.func_71024_bL().func_75116_a() > 6.0F || this.field_71075_bZ.field_75101_c; if ((this.field_70122_E || this.func_204231_K()) && !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)) { if (this.field_71156_d <= 0 && !this.field_71159_c.field_71474_y.field_151444_V.func_151470_d()) { -@@ -973,4 +984,16 @@ +@@ -979,4 +990,16 @@ return this.field_204230_bP; } } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch index 04cab2b31..12c74f624 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/client/gui/GuiButton.java +++ b/net/minecraft/client/gui/GuiButton.java @@ -22,6 +22,7 @@ - public boolean field_146125_m; + public boolean field_146125_m = true; protected boolean field_146123_n; private boolean field_194832_o; + public int packedFGColor; // FML public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) { this(p_i1020_1_, p_i1020_2_, p_i1020_3_, 200, 20, p_i1020_4_); -@@ -66,6 +67,11 @@ +@@ -62,6 +63,11 @@ this.func_73729_b(this.field_146128_h + this.field_146120_f / 2, this.field_146129_i, 200 - this.field_146120_f / 2, 46 + i * 20, this.field_146120_f / 2, this.field_146121_g); this.func_146119_b(minecraft, p_194828_1_, p_194828_2_); int j = 14737632; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch index 1871d4dd9..1a6a47f6d 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/GuiCreateWorld.java +++ b/net/minecraft/client/gui/GuiCreateWorld.java -@@ -159,14 +159,7 @@ +@@ -158,14 +158,7 @@ this.field_146321_E.field_146125_m = false; this.field_146322_F = this.func_189646_b(new GuiButton(8, this.field_146294_l / 2 + 5, 120, 150, 20, I18n.func_135052_a("selectWorld.customizeType")) { public void func_194829_a(double p_194829_1_, double p_194829_3_) { @@ -16,11 +16,11 @@ } }); this.field_146322_F.field_146125_m = false; -@@ -258,6 +251,7 @@ +@@ -257,6 +250,7 @@ i = (long)s.hashCode(); } } + 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_205390_a((JsonElement)Dynamic.convert(NBTDynamicOps.field_210820_a, JsonOps.INSTANCE, this.field_146334_a)); + worldsettings.func_205390_a(Dynamic.convert(NBTDynamicOps.field_210820_a, JsonOps.INSTANCE, this.field_146334_a)); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch index 379ad7536..7932794cf 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiEnchantment.java.patch @@ -9,16 +9,19 @@ this.func_73729_b(j1, j + 14 + 19 * i1, 0, 185, 108, 19); this.func_73729_b(j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16); fontrenderer.func_78279_b(s1, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1); -@@ -193,9 +193,10 @@ +@@ -193,10 +193,12 @@ Enchantment enchantment = Enchantment.func_185262_c(this.field_147075_G.field_185001_h[j]); int l = this.field_147075_G.field_185002_i[j]; int i1 = j + 1; - if (this.func_195359_a(60, 14 + 19 * j, 108, 17, (double)p_73863_1_, (double)p_73863_2_) && k > 0 && l >= 0 && enchantment != null) { + if (this.func_195359_a(60, 14 + 19 * j, 108, 17, (double)p_73863_1_, (double)p_73863_2_) && k > 0) { - List list = Lists.newArrayList(); + List list = Lists.newArrayList(); - list.add("" + TextFormatting.WHITE + TextFormatting.ITALIC + I18n.func_135052_a("container.enchant.clue", enchantment.func_200305_d(l).func_150254_d())); +- if (!flag) { + list.add("" + TextFormatting.WHITE + TextFormatting.ITALIC + I18n.func_135052_a("container.enchant.clue", enchantment == null ? "" : enchantment.func_200305_d(l).func_150254_d())); -+ if (enchantment == null) java.util.Collections.addAll(list, "", TextFormatting.RED + I18n.func_135052_a("forge.container.enchant.limitedEnchantability")); else - if (!flag) { ++ if (enchantment == null) { ++ java.util.Collections.addAll(list, "", TextFormatting.RED + I18n.func_135052_a("forge.container.enchant.limitedEnchantability")); ++ } else if (!flag) { list.add(""); if (this.field_146297_k.field_71439_g.field_71068_ca < k) { + list.add(TextFormatting.RED + I18n.func_135052_a("container.enchant.level.requirement", this.field_147075_G.field_75167_g[j])); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch index 3b3000ab9..3becbc27d 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -3,12 +3,12 @@ @@ -59,6 +59,7 @@ private int field_193978_M; private int field_193979_N; - private final RenderSkybox field_209101_K; + private final RenderSkybox field_209101_K = new RenderSkybox(new RenderSkyboxCube(new ResourceLocation("textures/gui/title/background/panorama"))); + private net.minecraftforge.client.gui.NotificationModUpdateScreen modUpdateNotification; public GuiMainMenu() { - this.field_146972_A = field_96138_a; -@@ -178,7 +179,7 @@ + this.field_73975_c = "missingno"; +@@ -176,7 +177,7 @@ if (this.func_183501_a()) { this.field_183503_M.func_146280_a(this.field_146297_k, this.field_146294_l, this.field_146295_m); } @@ -17,7 +17,7 @@ } private void func_73969_a(int p_73969_1_, int p_73969_2_) { -@@ -192,11 +193,17 @@ +@@ -190,11 +191,17 @@ GuiMainMenu.this.field_146297_k.func_147108_a(new GuiMultiplayer(GuiMainMenu.this)); } }); @@ -36,7 +36,7 @@ } private void func_73972_b(int p_73972_1_, int p_73972_2_) { -@@ -206,7 +213,7 @@ +@@ -204,7 +211,7 @@ } }); this.field_73973_d = this.func_189646_b(new GuiButton(12, this.field_146294_l / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.func_135052_a("menu.resetdemo")) { @@ -45,7 +45,7 @@ ISaveFormat isaveformat1 = GuiMainMenu.this.field_146297_k.func_71359_d(); WorldInfo worldinfo1 = isaveformat1.func_75803_c("Demo_World"); if (worldinfo1 != null) { -@@ -268,6 +275,9 @@ +@@ -266,6 +273,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); @@ -55,7 +55,7 @@ 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); -@@ -283,7 +293,10 @@ +@@ -281,7 +291,10 @@ s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d()); } @@ -67,7 +67,7 @@ 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) { func_73734_a(this.field_193979_N, this.field_146295_m - 1, this.field_193979_N + this.field_193978_M, this.field_146295_m, -1); -@@ -299,6 +312,7 @@ +@@ -297,6 +310,7 @@ if (this.func_183501_a()) { this.field_183503_M.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); } diff --git a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch b/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch index 43d0962b1..32dca7037 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/achievement/GuiStats.java +++ b/net/minecraft/client/gui/achievement/GuiStats.java -@@ -118,8 +118,8 @@ +@@ -122,8 +122,8 @@ public void func_193026_g() { if (this.field_146543_v) { this.func_193028_a(); diff --git a/patches/minecraft/net/minecraft/client/gui/advancements/AdvancementTabType.java.patch b/patches/minecraft/net/minecraft/client/gui/advancements/AdvancementTabType.java.patch new file mode 100644 index 000000000..0e57ecc1d --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/advancements/AdvancementTabType.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/client/gui/advancements/AdvancementTabType.java ++++ b/net/minecraft/client/gui/advancements/AdvancementTabType.java +@@ -14,6 +14,7 @@ + LEFT(0, 64, 32, 28, 5), + RIGHT(96, 64, 32, 28, 5); + ++ public static final int MAX_TABS = java.util.Arrays.stream(values()).mapToInt(e -> e.field_192664_j).sum(); + private final int field_192660_f; + private final int field_192661_g; + private final int field_192662_h; diff --git a/patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch b/patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch index ea4d26ccf..ba044b3f0 100644 --- a/patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/advancements/GuiAdvancementTab.java.patch @@ -30,8 +30,8 @@ for(AdvancementTabType advancementtabtype : AdvancementTabType.values()) { - if (p_193936_2_ < 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()); -+ 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_ % AdvancementTabType.field_192659_e, p_193936_2_ / AdvancementTabType.field_192659_e, p_193936_3_, p_193936_3_.func_192068_c()); ++ if ((p_193936_2_ % AdvancementTabType.MAX_TABS) < advancementtabtype.func_192650_a()) { ++ return new GuiAdvancementTab(p_193936_0_, p_193936_1_, advancementtabtype, p_193936_2_ % AdvancementTabType.MAX_TABS, p_193936_2_ / AdvancementTabType.MAX_TABS, p_193936_3_, p_193936_3_.func_192068_c()); } p_193936_2_ -= advancementtabtype.func_192650_a(); diff --git a/patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch b/patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch index bc62c6fc4..36cb02889 100644 --- a/patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java +++ b/net/minecraft/client/gui/advancements/GuiScreenAdvancements.java @@ -24,6 +24,7 @@ - private final Map field_191947_i = Maps.newLinkedHashMap(); + private final Map field_191947_i = Maps.newLinkedHashMap(); private GuiAdvancementTab field_191940_s; private boolean field_191944_v; + private static int tabPage, maxPages; @@ -13,7 +13,7 @@ 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) { ++ if (this.field_191947_i.size() > AdvancementTabType.MAX_TABS) { + int guiLeft = (this.field_146294_l - 252) / 2; + int guiTop = (this.field_146295_m - 140) / 2; + func_189646_b(new net.minecraft.client.gui.GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<") { @@ -28,7 +28,7 @@ + tabPage = Math.min(tabPage + 1, maxPages); + } + }); -+ maxPages = this.field_191947_i.size() / AdvancementTabType.field_192659_e; ++ maxPages = this.field_191947_i.size() / AdvancementTabType.MAX_TABS; + } } diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch index 448254301..6b3a04eec 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ b/net/minecraft/client/gui/inventory/GuiContainerCreative.java -@@ -53,6 +53,8 @@ +@@ -54,6 +54,8 @@ private CreativeCrafting field_147059_E; private boolean field_195377_F; private boolean field_199506_G; @@ -9,7 +9,7 @@ public GuiContainerCreative(EntityPlayer p_i1088_1_) { super(new GuiContainerCreative.ContainerCreative(p_i1088_1_)); -@@ -230,6 +232,22 @@ +@@ -231,6 +233,22 @@ this.func_147050_b(ItemGroup.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); @@ -32,7 +32,7 @@ } else { this.field_146297_k.func_147108_a(new GuiInventory(this.field_146297_k.field_71439_g)); } -@@ -255,7 +273,7 @@ +@@ -259,7 +277,7 @@ public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_) { if (this.field_195377_F) { return false; @@ -41,7 +41,7 @@ return false; } else { String s = this.field_147062_A.func_146179_b(); -@@ -273,7 +291,7 @@ +@@ -277,7 +295,7 @@ public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_) { this.field_195377_F = false; @@ -50,7 +50,7 @@ if (this.field_146297_k.field_71474_y.field_74310_D.func_197976_a(p_keyPressed_1_, p_keyPressed_2_)) { this.field_195377_F = true; this.func_147050_b(ItemGroup.field_78027_g); -@@ -309,6 +327,32 @@ +@@ -313,6 +331,32 @@ private void func_147053_i() { GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; guicontainercreative$containercreative.field_148330_a.clear(); @@ -81,9 +81,9 @@ + } + if (this.field_147062_A.func_146179_b().isEmpty()) { - for(Item item : Item.field_150901_e) { + for(Item item : IRegistry.field_212630_s) { item.func_150895_a(ItemGroup.field_78027_g, guicontainercreative$containercreative.field_148330_a); -@@ -323,9 +367,9 @@ +@@ -327,9 +371,9 @@ protected void func_146979_b(int p_146979_1_, int p_146979_2_) { ItemGroup itemgroup = ItemGroup.field_78032_a[field_147058_w]; @@ -95,7 +95,7 @@ } } -@@ -357,7 +401,7 @@ +@@ -361,7 +405,7 @@ this.field_147066_y = false; for(ItemGroup itemgroup : ItemGroup.field_78032_a) { @@ -104,7 +104,7 @@ this.func_147050_b(itemgroup); return true; } -@@ -368,12 +412,15 @@ +@@ -372,12 +416,15 @@ } private boolean func_147055_p() { @@ -120,7 +120,7 @@ GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; this.field_147008_s.clear(); guicontainercreative$containercreative.field_148330_a.clear(); -@@ -447,13 +494,15 @@ +@@ -451,13 +498,15 @@ } if (this.field_147062_A != null) { @@ -137,7 +137,7 @@ this.func_147053_i(); } else { -@@ -512,16 +561,36 @@ +@@ -517,16 +566,36 @@ this.func_146276_q_(); super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); @@ -175,7 +175,7 @@ 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_); -@@ -563,7 +632,10 @@ +@@ -568,7 +637,10 @@ } } @@ -187,7 +187,7 @@ } else { super.func_146285_a(p_146285_1_, p_146285_2_, p_146285_3_); } -@@ -575,25 +647,44 @@ +@@ -580,25 +652,44 @@ RenderHelper.func_74520_c(); ItemGroup itemgroup = ItemGroup.field_78032_a[field_147058_w]; @@ -236,7 +236,7 @@ this.func_147051_a(itemgroup); if (itemgroup == ItemGroup.field_78036_m) { GuiInventory.func_147046_a(this.field_147003_i + 88, this.field_147009_r + 45, 20, (float)(this.field_147003_i + 88 - p_146976_2_), (float)(this.field_147009_r + 45 - 30 - p_146976_3_), this.field_146297_k.field_71439_g); -@@ -602,6 +693,7 @@ +@@ -607,6 +698,7 @@ } protected boolean func_195375_a(ItemGroup p_195375_1_, double p_195375_2_, double p_195375_4_) { @@ -244,7 +244,7 @@ int i = p_195375_1_.func_78020_k(); int j = 28 * i; int k = 0; -@@ -671,6 +763,8 @@ +@@ -676,6 +768,8 @@ } GlStateManager.func_179140_f(); @@ -253,7 +253,7 @@ 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; -@@ -845,6 +939,31 @@ +@@ -850,6 +944,31 @@ public boolean func_82869_a(EntityPlayer p_82869_1_) { return this.field_148332_b.func_82869_a(p_82869_1_); } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch index a3493655a..6141732f9 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/client/multiplayer/ChunkProviderClient.java +++ b/net/minecraft/client/multiplayer/ChunkProviderClient.java -@@ -55,6 +55,7 @@ - public Chunk func_73158_c(int p_73158_1_, int p_73158_2_) { - Chunk chunk = new Chunk(this.field_73235_d, p_73158_1_, p_73158_2_, new Biome[256]); - 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; - } +@@ -59,6 +59,7 @@ + return new Chunk(this.field_73235_d, p_212474_1_, p_212474_2_, new Biome[256]); + }); + chunk.func_186033_a(p_212474_3_, p_212474_4_, p_212474_5_); ++ 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/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index db257f16d..8e9769ea3 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -70,7 +70,7 @@ if (this.field_78780_h % 4.0F == 0.0F) { - SoundType soundtype = block.func_185467_w(); + SoundType soundtype = iblockstate.getSoundType(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_)); + this.field_78776_a.func_147118_V().func_147682_a(new SimpleSound(soundtype.func_185846_f(), SoundCategory.NEUTRAL, (soundtype.func_185843_a() + 1.0F) / 8.0F, soundtype.func_185847_b() * 0.5F, p_180512_1_)); } @@ -251,7 +256,8 @@ diff --git a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch index 6883e4405..99a4c5969 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -1,25 +1,17 @@ --- a/net/minecraft/client/multiplayer/WorldClient.java +++ b/net/minecraft/client/multiplayer/WorldClient.java -@@ -69,18 +69,20 @@ - private Scoreboard field_200261_M; - - 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(); +@@ -76,11 +76,13 @@ this.field_200261_M = new Scoreboard(); - this.field_73035_a = p_i45063_1_; - this.func_72912_H().func_176144_a(p_i45063_4_); + this.field_73035_a = p_i49845_1_; + this.func_72912_H().func_176144_a(p_i49845_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() { + public void func_72835_b(BooleanSupplier p_72835_1_) { diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch index 9b8f40814..fbee390e3 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch @@ -1,12 +1,10 @@ --- a/net/minecraft/client/network/NetHandlerLoginClient.java +++ b/net/minecraft/client/network/NetHandlerLoginClient.java -@@ -122,7 +122,9 @@ +@@ -122,6 +122,7 @@ } public void func_209521_a(SPacketCustomPayloadLogin p_209521_1_) { -+ if (!net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(p_209521_1_, this.field_147393_d)) { - this.field_209525_d.accept(new TextComponentTranslation("connect.negotiating", new Object[0])); ++ if (net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(p_209521_1_, this.field_147393_d)) return; + this.field_209525_d.accept(new TextComponentTranslation("connect.negotiating")); this.field_147393_d.func_179290_a(new CPacketCustomPayloadLogin(p_209521_1_.func_209918_a(), (PacketBuffer)null)); } - } -+} diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index ee3d74ccc..6553efa86 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/client/network/NetHandlerPlayClient.java +++ b/net/minecraft/client/network/NetHandlerPlayClient.java -@@ -654,7 +654,7 @@ - Chunk chunk = this.field_147300_g.func_72964_e(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f()); - 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); +@@ -659,7 +659,7 @@ + int j = p_147263_1_.func_149271_f(); + Chunk chunk = this.field_147300_g.func_72863_F().func_212474_a(i, j, 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(i << 4, 0, j << 4, (i << 4) + 15, 256, (j << 4) + 15); - if (!p_147263_1_.func_149274_i() || !(this.field_147300_g.field_73011_w instanceof OverworldDimension)) { + if (!p_147263_1_.func_149274_i() || this.field_147300_g.field_73011_w.shouldClientCheckLighting()) { chunk.func_76613_n(); } -@@ -662,7 +662,7 @@ +@@ -667,7 +667,7 @@ BlockPos blockpos = new BlockPos(nbttagcompound.func_74762_e("x"), nbttagcompound.func_74762_e("y"), nbttagcompound.func_74762_e("z")); TileEntity tileentity = this.field_147300_g.func_175625_s(blockpos); if (tileentity != null) { @@ -18,7 +18,7 @@ } } -@@ -727,7 +727,9 @@ +@@ -735,7 +735,9 @@ public void func_147251_a(SPacketChat p_147251_1_) { PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f); @@ -29,7 +29,7 @@ } public void func_147279_a(SPacketAnimation p_147279_1_) { -@@ -1008,6 +1010,12 @@ +@@ -1017,6 +1019,12 @@ boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock; if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign || i == 10 && tileentity instanceof TileEntityShulkerBox || i == 11 && tileentity instanceof TileEntityBed || i == 5 && tileentity instanceof TileEntityConduit) { tileentity.func_145839_a(p_147273_1_.func_148857_g()); @@ -42,7 +42,7 @@ } if (flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock) { -@@ -1182,6 +1190,7 @@ +@@ -1191,6 +1199,7 @@ recipebookclient.func_199644_c(); recipebookclient.func_199642_d().forEach(searchtree::func_194043_a); searchtree.func_194040_a(); @@ -50,7 +50,7 @@ } public void func_200232_a(SPacketPlayerLook p_200232_1_) { -@@ -1272,7 +1281,7 @@ +@@ -1281,7 +1290,7 @@ PacketThreadUtil.func_180031_a(p_147260_1_, this, this.field_147299_f); Entity entity = this.field_147300_g.func_73045_a(p_147260_1_.func_149426_d()); if (entity instanceof EntityLivingBase) { @@ -59,7 +59,7 @@ if (potion != null) { PotionEffect potioneffect = new PotionEffect(potion, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), p_147260_1_.func_186984_g(), p_147260_1_.func_179707_f(), p_147260_1_.func_205527_h()); potioneffect.func_100012_b(p_147260_1_.func_149429_c()); -@@ -1598,10 +1607,12 @@ +@@ -1607,10 +1616,12 @@ ((DebugRendererWorldGenAttempts)this.field_147299_f.field_184132_p.field_201750_j).func_201734_a(packetbuffer.func_179259_c(), packetbuffer.readFloat(), packetbuffer.readFloat(), packetbuffer.readFloat(), packetbuffer.readFloat(), packetbuffer.readFloat()); field_147301_d.warn("Unknown custom packed identifier: {}", (Object)resourcelocation); } else { diff --git a/patches/minecraft/net/minecraft/client/particle/Particle.java.patch b/patches/minecraft/net/minecraft/client/particle/Particle.java.patch index de33ba98a..52b28f271 100644 --- a/patches/minecraft/net/minecraft/client/particle/Particle.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/Particle.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/client/particle/Particle.java +++ b/net/minecraft/client/particle/Particle.java -@@ -253,6 +253,8 @@ +@@ -249,6 +249,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 && (p_187110_1_ != 0.0D || p_187110_3_ != 0.0D || p_187110_5_ != 0.0D)) { - VoxelShape voxelshape = this.field_187122_b.func_199406_a((Entity)null, this.func_187116_l(), p_187110_1_, p_187110_3_, p_187110_5_); - p_187110_3_ = ShapeUtils.func_197884_a(EnumFacing.Axis.Y, this.func_187116_l(), voxelshape, p_187110_3_); -@@ -271,12 +273,12 @@ + ReuseableStream reuseablestream = new ReuseableStream<>(this.field_187122_b.func_199406_a((Entity)null, this.func_187116_l(), p_187110_1_, p_187110_3_, p_187110_5_)); + p_187110_3_ = VoxelShapes.func_212437_a(EnumFacing.Axis.Y, this.func_187116_l(), reuseablestream.func_212761_a(), p_187110_3_); +@@ -267,12 +269,12 @@ } this.func_187118_j(); diff --git a/patches/minecraft/net/minecraft/client/particle/ParticleManager.java.patch b/patches/minecraft/net/minecraft/client/particle/ParticleManager.java.patch index 1829a06df..58a0f01fb 100644 --- a/patches/minecraft/net/minecraft/client/particle/ParticleManager.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/ParticleManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/particle/ParticleManager.java +++ b/net/minecraft/client/particle/ParticleManager.java -@@ -145,6 +145,7 @@ +@@ -146,6 +146,7 @@ } public void func_78873_a(Particle p_78873_1_) { @@ -8,7 +8,7 @@ this.field_187241_h.add(p_78873_1_); } -@@ -332,7 +333,7 @@ +@@ -337,7 +338,7 @@ } public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_) { @@ -17,7 +17,7 @@ VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_); double d0 = 0.25D; voxelshape.func_197755_b((p_199284_3_, p_199284_5_, p_199284_7_, p_199284_9_, p_199284_11_, p_199284_13_) -> { -@@ -411,4 +412,10 @@ +@@ -416,4 +417,10 @@ return String.valueOf(i); } diff --git a/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch index 43b2a4fa3..0979d2e52 100644 --- a/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/FogRenderer.java.patch @@ -1,31 +1,30 @@ --- a/net/minecraft/client/renderer/FogRenderer.java +++ b/net/minecraft/client/renderer/FogRenderer.java -@@ -116,6 +116,9 @@ - if (f4 > 1.0F / this.field_205095_e) { +@@ -103,6 +103,9 @@ + f3 = 1.0F / this.field_205095_e; + } + ++ // Forge: fix MC-4647 and MC-10480 ++ if (Float.isInfinite(f3)) f3 = Math.nextAfter(f3, 0.0); ++ + this.field_205093_c = this.field_205093_c * (1.0F - f1) + this.field_205093_c * f3 * f1; + this.field_205094_d = this.field_205094_d * (1.0F - f1) + this.field_205094_d * f3 * f1; + this.field_205095_e = this.field_205095_e * (1.0F - f1) + this.field_205095_e * f3 * f1; +@@ -117,11 +120,21 @@ f4 = 1.0F / this.field_205095_e; } -+ + + // Forge: fix MC-4647 and MC-10480 + if (Float.isInfinite(f4)) f4 = Math.nextAfter(f4, 0.0); - ++ this.field_205093_c = this.field_205093_c * (1.0F - f2) + this.field_205093_c * f4 * f2; this.field_205094_d = this.field_205094_d * (1.0F - f2) + this.field_205094_d * f4 * f2; -@@ -130,12 +133,22 @@ - if (f5 > 1.0F / this.field_205095_e) { - f5 = 1.0F / this.field_205095_e; - } -+ -+ // Forge: fix MC-4647 and MC-10480 -+ if (Float.isInfinite(f5)) f5 = Math.nextAfter(f5, 0.0); - - this.field_205093_c = this.field_205093_c * (1.0F - f3) + this.field_205093_c * f5 * f3; - this.field_205094_d = this.field_205094_d * (1.0F - f3) + this.field_205094_d * f5 * f3; - this.field_205095_e = this.field_205095_e * (1.0F - f3) + this.field_205095_e * f5 * f3; + this.field_205095_e = this.field_205095_e * (1.0F - f2) + this.field_205095_e * f4 * f2; } -+ + + net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, this.field_205104_n, entity, ActiveRenderInfo.func_186703_a(world, entity, p_78466_1_), ifluidstate, p_78466_1_, this.field_205093_c, this.field_205094_d, this.field_205095_e); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); - ++ + this.field_205093_c = event.getRed(); + this.field_205094_d = event.getGreen(); + this.field_205095_e = event.getBlue(); @@ -33,7 +32,7 @@ GlStateManager.func_179082_a(this.field_205093_c, this.field_205094_d, this.field_205095_e, 0.0F); } -@@ -227,6 +240,10 @@ +@@ -213,6 +226,10 @@ GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F); GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); IFluidState ifluidstate = ActiveRenderInfo.func_206243_b(this.field_205105_o.field_71441_e, entity, p_78468_2_); @@ -44,7 +43,7 @@ if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q)) { float f2 = 5.0F; int i = ((EntityLivingBase)entity).func_70660_b(MobEffects.field_76440_q).func_76459_b(); -@@ -286,6 +303,7 @@ +@@ -272,6 +289,7 @@ GlStateManager.func_179102_b(f1 * 0.05F); GlStateManager.func_179153_c(Math.min(f1, 192.0F) * 0.5F); } diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch similarity index 84% rename from patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch rename to patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch index 21344305e..687fd1256 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch @@ -1,15 +1,15 @@ ---- a/net/minecraft/client/renderer/EntityRenderer.java -+++ b/net/minecraft/client/renderer/EntityRenderer.java -@@ -171,7 +171,7 @@ +--- a/net/minecraft/client/renderer/GameRenderer.java ++++ b/net/minecraft/client/renderer/GameRenderer.java +@@ -171,6 +171,8 @@ this.func_175069_a(new ResourceLocation("shaders/post/spider.json")); } else if (p_175066_1_ instanceof EntityEnderman) { this.func_175069_a(new ResourceLocation("shaders/post/invert.json")); -- } -+ } else net.minecraftforge.client.ForgeHooksClient.loadEntityShader(p_175066_1_, this); ++ } else { ++ net.minecraftforge.client.ForgeHooksClient.loadEntityShader(p_175066_1_, this); + } } - } -@@ -310,7 +310,7 @@ +@@ -309,7 +311,7 @@ } else if (raytraceresult != null) { double d3 = vec3d.func_72438_d(raytraceresult.field_72307_f); if (d3 < d2 || d2 == 0.0D) { @@ -18,7 +18,7 @@ if (d2 == 0.0D) { this.field_78528_u = entity1; vec3d3 = raytraceresult.field_72307_f; -@@ -381,7 +381,7 @@ +@@ -380,7 +382,7 @@ d0 = d0 * 60.0D / 70.0D; } @@ -27,7 +27,7 @@ } } -@@ -488,8 +488,16 @@ +@@ -487,8 +489,16 @@ } if (!this.field_78531_r.field_71474_y.field_74325_U) { @@ -46,16 +46,15 @@ } GlStateManager.func_179109_b(0.0F, -f, 0.0F); -@@ -543,6 +551,8 @@ +@@ -542,6 +552,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_195457_1_)) 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_178889_l() != GameType.SPECTATOR) { this.func_180436_i(); this.field_78516_c.func_78440_a(p_195457_1_); -@@ -631,13 +641,17 @@ +@@ -630,13 +641,17 @@ GlStateManager.func_179128_n(5888); GlStateManager.func_179096_D(); this.field_78531_r.field_195558_d.func_198094_a(); @@ -70,24 +69,23 @@ try { - this.field_78531_r.field_71462_r.func_73863_a(i, j, this.field_78531_r.func_193989_ak()); -+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, i, j, this.field_78531_r.func_193989_ak()); ++ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, i, j, this.field_78531_r.func_193989_ak()); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering screen"); CrashReportCategory crashreportcategory = crashreport.func_85058_a("Screen render details"); -@@ -698,9 +712,10 @@ +@@ -700,9 +715,9 @@ ItemStack itemstack = ((EntityPlayer)entity).func_184614_ca(); if (this.field_78531_r.field_71476_x != null && this.field_78531_r.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) { BlockPos blockpos = this.field_78531_r.field_71476_x.func_178782_a(); - Block block = this.field_78531_r.field_71441_e.func_180495_p(blockpos).func_177230_c(); + IBlockState state = this.field_78531_r.field_71441_e.func_180495_p(blockpos); -+ Block block = state.func_177230_c(); 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(state) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; ++ flag = state.hasTileEntity() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; } else { BlockWorldState blockworldstate = new BlockWorldState(this.field_78531_r.field_71441_e, blockpos, false); flag = !itemstack.func_190926_b() && (itemstack.func_206848_a(this.field_78531_r.field_71441_e.func_205772_D(), blockworldstate) || itemstack.func_206847_b(this.field_78531_r.field_71441_e.func_205772_D(), blockworldstate)); -@@ -738,7 +753,7 @@ +@@ -740,7 +755,7 @@ GlStateManager.func_179086_m(16640); this.field_78531_r.field_71424_I.func_76318_c("camera"); this.func_195460_g(p_181560_1_); @@ -96,45 +94,45 @@ 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"); -@@ -782,7 +797,9 @@ +@@ -784,7 +799,9 @@ GlStateManager.func_179118_c(); - renderglobal.func_195464_a(BlockRenderLayer.SOLID, (double)p_181560_1_, entity); + worldrenderer.func_195464_a(BlockRenderLayer.SOLID, (double)p_181560_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_195464_a(BlockRenderLayer.CUTOUT_MIPPED, (double)p_181560_1_, entity); + worldrenderer.func_195464_a(BlockRenderLayer.CUTOUT_MIPPED, (double)p_181560_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_195464_a(BlockRenderLayer.CUTOUT, (double)p_181560_1_, entity); + worldrenderer.func_195464_a(BlockRenderLayer.CUTOUT, (double)p_181560_1_, entity); this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a(); -@@ -793,7 +810,9 @@ +@@ -795,7 +812,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_181560_1_); + worldrenderer.func_180446_a(entity, icamera, p_181560_1_); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); RenderHelper.func_74518_a(); this.func_175072_h(); GlStateManager.func_179128_n(5888); -@@ -802,6 +821,7 @@ +@@ -804,6 +823,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_181560_1_)) - renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_181560_1_); ++ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(worldrenderer, entityplayer, field_78531_r.field_71476_x, 0, p_181560_1_)) + worldrenderer.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_181560_1_); GlStateManager.func_179141_d(); } -@@ -852,6 +872,9 @@ - this.func_195456_a(renderglobal, p_181560_1_, d0, d1, d2); +@@ -854,6 +874,9 @@ + this.func_195456_a(worldrenderer, p_181560_1_, d0, d1, d2); } + this.field_78531_r.field_71424_I.func_76318_c("forge_render_last"); -+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_181560_1_); ++ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(worldrenderer, p_181560_1_); + this.field_78531_r.field_71424_I.func_76318_c("hand"); if (this.field_175074_C) { GlStateManager.func_179086_m(256); -@@ -955,6 +978,11 @@ +@@ -957,6 +980,11 @@ } protected void func_78474_d(float p_78474_1_) { @@ -146,7 +144,7 @@ float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); if (!(f <= 0.0F)) { this.func_180436_i(); -@@ -1182,4 +1210,9 @@ +@@ -1184,4 +1212,9 @@ public float func_205001_m() { return this.field_78530_s; } diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index f15f8cadf..6767785fc 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -1,22 +1,22 @@ --- a/net/minecraft/client/renderer/ItemRenderer.java +++ b/net/minecraft/client/renderer/ItemRenderer.java -@@ -49,13 +49,14 @@ +@@ -50,13 +50,14 @@ public ItemRenderer(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_); - for(Item item : Item.field_150901_e) { + for(Item item : IRegistry.field_212630_s) { if (!field_195411_c.contains(item)) { - this.field_175059_m.func_199311_a(item, new ModelResourceLocation(Item.field_150901_e.func_177774_c(item), "inventory")); + this.field_175059_m.func_199311_a(item, new ModelResourceLocation(IRegistry.field_212630_s.func_177774_c(item), "inventory")); } } + net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m); this.field_184395_f = p_i46552_3_; } -@@ -96,7 +97,7 @@ +@@ -97,7 +98,7 @@ if (p_180454_2_.func_188618_c()) { GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.func_179091_B(); @@ -25,7 +25,7 @@ } else { this.func_191961_a(p_180454_2_, p_180454_1_); if (p_180454_1_.func_77962_s()) { -@@ -162,7 +163,7 @@ +@@ -163,7 +164,7 @@ k = k | -16777216; } @@ -34,7 +34,7 @@ } } -@@ -223,11 +224,8 @@ +@@ -224,11 +225,8 @@ 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(); @@ -48,7 +48,7 @@ this.func_180454_a(p_184394_1_, p_184394_2_); GlStateManager.func_187407_a(GlStateManager.CullFace.BACK); -@@ -258,7 +256,7 @@ +@@ -259,7 +257,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()); @@ -57,7 +57,7 @@ this.func_180454_a(p_191962_1_, p_191962_4_); GlStateManager.func_179118_c(); GlStateManager.func_179101_C(); -@@ -297,6 +295,7 @@ +@@ -298,6 +296,7 @@ crashreportcategory.func_189529_a("Item Type", () -> { return String.valueOf((Object)p_184391_2_.func_77973_b()); }); @@ -65,8 +65,8 @@ crashreportcategory.func_189529_a("Item Damage", () -> { return String.valueOf(p_184391_2_.func_77952_i()); }); -@@ -327,9 +326,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); +@@ -329,9 +328,12 @@ + GlStateManager.func_179147_l(); GlStateManager.func_179145_e(); GlStateManager.func_179126_j(); + // Fixes opaque cooldown overlay a bit lower @@ -79,7 +79,7 @@ GlStateManager.func_179140_f(); GlStateManager.func_179097_i(); GlStateManager.func_179090_x(); -@@ -337,11 +339,9 @@ +@@ -339,11 +341,9 @@ GlStateManager.func_179084_k(); Tessellator tessellator = Tessellator.func_178181_a(); BufferBuilder bufferbuilder = tessellator.func_178180_c(); @@ -94,7 +94,7 @@ 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(); -@@ -380,4 +380,9 @@ +@@ -382,4 +382,9 @@ public void func_195410_a(IResourceManager p_195410_1_) { this.field_175059_m.func_178085_b(); } diff --git a/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch b/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch index 44b97e2b9..15ad71f34 100644 --- a/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch @@ -1,14 +1,13 @@ --- a/net/minecraft/client/renderer/LightTexture.java +++ b/net/minecraft/client/renderer/LightTexture.java -@@ -110,7 +110,16 @@ - f11 = 0.28F + f8 * 0.75F; +@@ -112,6 +112,15 @@ f12 = 0.25F + f9 * 0.75F; } -+ + + float[] colors = {f10, f11, f12}; + world.func_201675_m().getLightmapColors(p_205106_1_, f, f4, f5, colors); + f10 = colors[0]; f11 = colors[1]; f12 = colors[2]; - ++ + // Forge: fix MC-58177 + f10 = net.minecraft.util.math.MathHelper.func_76131_a(f10, 0f, 1f); + f11 = net.minecraft.util.math.MathHelper.func_76131_a(f11, 0f, 1f); diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch similarity index 71% rename from patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch rename to patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index c0075f54b..d89c0ea18 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/RenderGlobal.java -+++ b/net/minecraft/client/renderer/RenderGlobal.java +--- a/net/minecraft/client/renderer/WorldRenderer.java ++++ b/net/minecraft/client/renderer/WorldRenderer.java @@ -507,7 +507,9 @@ } @@ -14,7 +14,7 @@ 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) { ++ if (pass == 0) { this.field_72748_H = 0; this.field_72749_I = 0; this.field_72750_J = 0; @@ -22,12 +22,12 @@ 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_; -@@ -530,10 +534,12 @@ +@@ -529,10 +533,12 @@ + this.field_175010_j.func_178628_a(d3, d4, d5); 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(); + this.field_72748_H = this.field_72769_h.func_212419_R(); - + } for(int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) { @@ -36,36 +36,37 @@ ++this.field_72749_I; if (entity1.func_145770_h(d0, d1, d2)) { this.field_175010_j.func_188388_a(entity1, p_180446_3_, false); -@@ -550,6 +556,7 @@ - ClassInheritanceMultiMap classinheritancemultimap = chunk.func_177429_s()[renderglobal$containerlocalrenderinformation.field_178036_a.func_178568_j().func_177956_o() / 16]; +@@ -549,6 +555,7 @@ + ClassInheritanceMultiMap classinheritancemultimap = chunk.func_177429_s()[worldrenderer$containerlocalrenderinformation.field_178036_a.func_178568_j().func_177956_o() / 16]; if (!classinheritancemultimap.isEmpty()) { for(Entity entity2 : classinheritancemultimap) { -+ if(!entity2.shouldRenderInPass(pass)) continue; ++ 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) { boolean flag1 = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn(); -@@ -576,6 +583,7 @@ +@@ -575,7 +582,7 @@ } } -+ if(pass == 0) - if (this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad)) { +- if (this.func_174985_d() && (!list.isEmpty() || this.field_184386_ad)) { ++ if (pass == 0 && this.func_174985_d() && (!list.isEmpty() || this.field_184386_ad)) { this.field_72769_h.field_72984_F.func_76318_c("entityOutlines"); this.field_175015_z.func_147614_f(); -@@ -611,10 +619,12 @@ + this.field_184386_ad = !list.isEmpty(); +@@ -610,10 +617,12 @@ 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(); - if (!list3.isEmpty()) { - for(TileEntity tileentity1 : list3) { + for(WorldRenderer.ContainerLocalRenderInformation worldrenderer$containerlocalrenderinformation1 : this.field_72755_R) { + List list2 = worldrenderer$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b(); + if (!list2.isEmpty()) { + for(TileEntity tileentity1 : list2) { + if (!tileentity1.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity1.getRenderBoundingBox())) continue; TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, -1); } } -@@ -622,16 +632,18 @@ +@@ -621,16 +630,18 @@ synchronized(this.field_181024_n) { for(TileEntity tileentity : this.field_181024_n) { @@ -84,17 +85,17 @@ + if (iblockstate.hasTileEntity()) { TileEntity tileentity2 = this.field_72769_h.func_175625_s(blockpos); if (tileentity2 instanceof TileEntityChest && iblockstate.func_177229_b(BlockChest.field_196314_b) == ChestType.LEFT) { - blockpos = blockpos.func_177972_a(((EnumFacing)iblockstate.func_177229_b(BlockChest.field_176459_a)).func_176746_e()); -@@ -767,7 +779,7 @@ + blockpos = blockpos.func_177972_a(iblockstate.func_177229_b(BlockChest.field_176459_a).func_176746_e()); +@@ -766,7 +777,7 @@ for(int j = -this.field_72739_F; j <= this.field_72739_F; ++j) { for(int k = -this.field_72739_F; k <= this.field_72739_F; ++k) { RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8)); - if (renderchunk1 != null && p_195473_3_.func_78546_a(renderchunk1.field_178591_c)) { + if (renderchunk1 != null && p_195473_3_.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_195473_4_); - queue.add(new RenderGlobal.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0)); + queue.add(new WorldRenderer.ContainerLocalRenderInformation(renderchunk1, (EnumFacing)null, 0)); } -@@ -812,7 +824,7 @@ +@@ -811,7 +822,7 @@ this.field_147595_R = true; BlockPos blockpos2 = renderchunk4.func_178568_j().func_177982_a(8, 8, 8); boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D; @@ -103,7 +104,7 @@ this.field_175009_l.add(renderchunk4); } else { this.field_72777_q.field_71424_I.func_76320_a("build near"); -@@ -1032,6 +1044,12 @@ +@@ -1031,6 +1042,11 @@ } public void func_195465_a(float p_195465_1_) { @@ -112,11 +113,10 @@ + renderer.render(p_195465_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) { + if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.THE_END) { this.func_180448_r(); } else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { -@@ -1176,6 +1194,7 @@ +@@ -1175,6 +1191,7 @@ } public void func_195466_a(float p_195466_1_, double p_195466_2_, double p_195466_4_, double p_195466_6_) { @@ -124,7 +124,7 @@ if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { float f = 12.0F; float f1 = 4.0F; -@@ -1552,7 +1571,11 @@ +@@ -1551,7 +1568,11 @@ DestroyBlockProgress destroyblockprogress = iterator.next(); BlockPos blockpos = destroyblockprogress.func_180246_b(); Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); @@ -137,16 +137,36 @@ double d3 = (double)blockpos.func_177958_n() - d0; double d4 = (double)blockpos.func_177956_o() - d1; double d5 = (double)blockpos.func_177952_p() - d2; -@@ -2006,7 +2029,7 @@ +@@ -1559,7 +1580,7 @@ + iterator.remove(); + } else { + IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos); +- if (!iblockstate.func_196958_f()) { ++ if (!iblockstate.isAir(field_72769_h, blockpos)) { + int i = destroyblockprogress.func_73106_e(); + TextureAtlasSprite textureatlassprite = this.field_94141_F[i]; + BlockRendererDispatcher blockrendererdispatcher = this.field_72777_q.func_175602_ab(); +@@ -1580,7 +1601,7 @@ + if (p_72731_3_ == 0 && p_72731_2_.field_72313_a == RayTraceResult.Type.BLOCK) { + BlockPos blockpos = p_72731_2_.func_178782_a(); + IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos); +- if (!iblockstate.func_196958_f() && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) { ++ if (!iblockstate.isAir(field_72769_h, blockpos) && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) { + 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_187441_d(Math.max(2.5F, (float)this.field_72777_q.field_195558_d.func_198109_k() / 1920.0F * 2.5F)); +@@ -2006,8 +2027,8 @@ + break; case 2001: IBlockState iblockstate = Block.func_196257_b(p_180439_4_); - if (!iblockstate.func_196958_f()) { +- if (!iblockstate.func_196958_f()) { - SoundType soundtype = iblockstate.func_177230_c().func_185467_w(); -+ SoundType soundtype = iblockstate.func_177230_c().getSoundType(iblockstate, field_72769_h, p_180439_3_, null); ++ if (!iblockstate.isAir(field_72769_h, p_180439_3_)) { ++ SoundType soundtype = iblockstate.getSoundType(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); } -@@ -2126,6 +2149,11 @@ +@@ -2127,6 +2148,11 @@ } } 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 123697213..000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/client/renderer/block/model/ModelBakery.java -+++ b/net/minecraft/client/renderer/block/model/ModelBakery.java -@@ -200,7 +200,7 @@ - flag = true; - lvt_9_4_ = (List)this.field_177598_f.func_199004_b(resourcelocation1).stream().map((p_209591_1_) -> { - try (InputStream inputstream = p_209591_1_.func_199027_b()) { -- Pair pair1 = Pair.of(p_209591_1_.func_199026_d(), ModelBlockDefinition.func_209577_a(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8))); -+ Pair pair1 = Pair.of(p_209591_1_.func_199026_d(), ModelBlockDefinition.parseFromReader(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_)); - return pair1; - } catch (Exception exception1) { - throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s' in resourcepack: '%s': %s", p_209591_1_.func_199029_a(), p_209591_1_.func_199026_d(), exception1.getMessage())); 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 0599e4d7e..000000000 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java -+++ b/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java -@@ -30,9 +30,14 @@ - private final Map field_178332_b = Maps.newLinkedHashMap(); - private Multipart field_188005_c; - -+ @Deprecated - public static ModelBlockDefinition func_209577_a(ModelBlockDefinition.ContainerHolder p_209577_0_, Reader p_209577_1_) { -- return (ModelBlockDefinition)JsonUtils.func_193839_a(p_209577_0_.field_209575_a, p_209577_1_, ModelBlockDefinition.class); -+ return parseFromReader(p_209577_0_, p_209577_1_, null); - } -+ -+ public static ModelBlockDefinition parseFromReader(ModelBlockDefinition.ContainerHolder containerHolder, Reader reader, net.minecraft.util.ResourceLocation location) { -+ return net.minecraftforge.client.model.BlockStateLoader.load(reader, location, containerHolder.field_209575_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/chunk/RenderChunk.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch index cbd1ebc28..b02f00a83 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -1,33 +1,33 @@ --- a/net/minecraft/client/renderer/chunk/RenderChunk.java +++ b/net/minecraft/client/renderer/chunk/RenderChunk.java -@@ -37,7 +37,7 @@ +@@ -36,7 +36,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) -public class RenderChunk { +public class RenderChunk implements net.minecraftforge.client.extensions.IForgeRenderChunk { private volatile World field_178588_d; - private final RenderGlobal field_178589_e; + private final WorldRenderer field_178589_e; public static int field_178592_a; -@@ -128,7 +128,8 @@ +@@ -125,7 +125,8 @@ p_178581_4_.func_178540_f().unlock(); } -- ChunkCache lvt_10_1_ = new ChunkCache(world, blockpos.func_177982_a(-1, -1, -1), blockpos.func_177982_a(16, 16, 16), 1); -+ ChunkCache lvt_10_1_ = createRegionRenderCache(this.field_178588_d, blockpos.func_177982_a(-1, -1, -1), blockpos.func_177982_a(16, 16, 16), 1); +- RenderChunkCache lvt_10_1_ = RenderChunkCache.func_212397_a(world, blockpos.func_177982_a(-1, -1, -1), blockpos.func_177982_a(16, 16, 16), 1); ++ RenderChunkCache lvt_10_1_ = createRegionRenderCache(world, blockpos.func_177982_a(-1, -1, -1), blockpos.func_177982_a(16, 16, 16), 1); + net.minecraftforge.client.MinecraftForgeClient.onRebuildChunk(this.field_178588_d, this.field_178586_f, lvt_10_1_); VisGraph lvt_11_1_ = new VisGraph(); HashSet lvt_12_1_ = Sets.newHashSet(); - if (!lvt_10_1_.func_72806_N()) { -@@ -145,22 +146,23 @@ + if (lvt_10_1_ != null) { +@@ -142,22 +143,23 @@ lvt_11_1_.func_178606_a(blockpos$mutableblockpos); } - if (block.func_149716_u()) { -+ if (block.hasTileEntity(iblockstate)) { - TileEntity tileentity = lvt_10_1_.func_190300_a(blockpos$mutableblockpos, Chunk.EnumCreateEntityType.CHECK); ++ if (iblockstate.hasTileEntity()) { + TileEntity tileentity = lvt_10_1_.func_212399_a(blockpos$mutableblockpos, Chunk.EnumCreateEntityType.CHECK); if (tileentity != null) { - TileEntityRenderer tileentityrenderer = TileEntityRendererDispatcher.field_147556_a.func_147547_b(tileentity); + TileEntityRenderer tileentityrenderer = TileEntityRendererDispatcher.field_147556_a.func_147547_b(tileentity); if (tileentityrenderer != null) { - compiledchunk.func_178490_a(tileentity); if (tileentityrenderer.func_188185_a(tileentity)) { @@ -37,8 +37,7 @@ } } } -- -+ + IFluidState ifluidstate = lvt_10_1_.func_204610_c(blockpos$mutableblockpos); - if (!ifluidstate.func_206888_e()) { - BlockRenderLayer blockrenderlayer1 = ifluidstate.func_180664_k(); @@ -48,7 +47,7 @@ int j = blockrenderlayer1.ordinal(); BufferBuilder bufferbuilder = p_178581_4_.func_178545_d().func_179039_a(j); if (!compiledchunk.func_178492_d(blockrenderlayer1)) { -@@ -171,17 +173,18 @@ +@@ -168,17 +170,18 @@ aboolean[j] |= blockrendererdispatcher.func_205318_a(blockpos$mutableblockpos, lvt_10_1_, bufferbuilder, ifluidstate); } diff --git a/patches/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch b/patches/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch index c6d27076d..d5e998c5e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/color/BlockColors.java.patch @@ -1,16 +1,16 @@ --- a/net/minecraft/client/renderer/color/BlockColors.java +++ b/net/minecraft/client/renderer/color/BlockColors.java -@@ -21,7 +21,8 @@ +@@ -22,7 +22,8 @@ @OnlyIn(Dist.CLIENT) public class BlockColors { -- private final ObjectIntIdentityMap field_186725_a = new ObjectIntIdentityMap(32); +- 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> field_186725_a = new java.util.HashMap<>(); public static BlockColors func_186723_a() { BlockColors blockcolors = new BlockColors(); -@@ -62,11 +63,12 @@ +@@ -63,11 +64,12 @@ blockcolors.func_186722_a((p_210228_0_, p_210228_1_, p_210228_2_, p_210228_3_) -> { return p_210228_1_ != null && p_210228_2_ != null ? 2129968 : 7455580; }, Blocks.field_196651_dG); @@ -19,23 +19,23 @@ } 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.field_149771_c.func_148757_b(p_189991_1_.func_177230_c())); +- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(IRegistry.field_212618_g.func_148757_b(p_189991_1_.func_177230_c())); + IBlockColor iblockcolor = this.field_186725_a.get(p_189991_1_.func_177230_c().delegate); if (iblockcolor != null) { return iblockcolor.getColor(p_189991_1_, (IWorldReaderBase)null, (BlockPos)null, 0); } else { -@@ -76,13 +78,13 @@ +@@ -77,13 +79,13 @@ } public int func_186724_a(IBlockState p_186724_1_, @Nullable IWorldReaderBase p_186724_2_, @Nullable BlockPos p_186724_3_, int p_186724_4_) { -- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Block.field_149771_c.func_148757_b(p_186724_1_.func_177230_c())); +- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(IRegistry.field_212618_g.func_148757_b(p_186724_1_.func_177230_c())); + IBlockColor iblockcolor = this.field_186725_a.get(p_186724_1_.func_177230_c().delegate); return iblockcolor == null ? -1 : iblockcolor.getColor(p_186724_1_, p_186724_2_, p_186724_3_, p_186724_4_); } public void func_186722_a(IBlockColor p_186722_1_, Block... p_186722_2_) { for(Block block : p_186722_2_) { -- this.field_186725_a.func_148746_a(p_186722_1_, Block.field_149771_c.func_148757_b(block)); +- this.field_186725_a.func_148746_a(p_186722_1_, IRegistry.field_212618_g.func_148757_b(block)); + this.field_186725_a.put(block.delegate, p_186722_1_); } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch index 706f215d6..cef74d839 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItemFrame.java.patch @@ -9,7 +9,7 @@ GlStateManager.func_179094_E(); GlStateManager.func_179109_b(-0.5F, -0.5F, -0.5F); if (this.field_188301_f) { -@@ -87,16 +87,18 @@ +@@ -87,17 +87,17 @@ ItemStack itemstack = p_82402_1_.func_82335_i(); if (!itemstack.func_190926_b()) { GlStateManager.func_179094_E(); @@ -19,10 +19,9 @@ + int i = mapdata != null ? 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); - if (flag) { -+ 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 (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this))) { + if (mapdata != null) { + GlStateManager.func_179140_f(); this.field_76990_c.field_78724_e.func_110577_a(field_110789_a); GlStateManager.func_179114_b(180.0F, 0.0F, 0.0F, 1.0F); float f = 0.0078125F; @@ -32,7 +31,7 @@ GlStateManager.func_179109_b(0.0F, 0.0F, -1.0F); if (mapdata != null) { this.field_147917_g.field_71460_t.func_147701_i().func_148250_a(mapdata, true); -@@ -105,6 +107,7 @@ +@@ -106,6 +106,7 @@ GlStateManager.func_179152_a(0.5F, 0.5F, 0.5F); this.field_177074_h.func_181564_a(itemstack, ItemCameraTransforms.TransformType.FIXED); } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch index b8c5fa898..a01b81cf5 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -1,19 +1,20 @@ --- a/net/minecraft/client/renderer/entity/RenderManager.java +++ b/net/minecraft/client/renderer/entity/RenderManager.java -@@ -242,7 +242,12 @@ +@@ -241,8 +241,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_; -@@ -278,10 +283,11 @@ + this.field_78726_c = p_178628_3_; +@@ -277,10 +282,11 @@ this.field_147941_i = p_180597_4_; this.field_78736_p = p_180597_2_; if (p_180597_3_ instanceof EntityLivingBase && ((EntityLivingBase)p_180597_3_).func_70608_bn()) { @@ -22,7 +23,7 @@ + IBlockState iblockstate = p_180597_1_.func_180495_p(pos); Block block = iblockstate.func_177230_c(); - if (block instanceof BlockBed) { -- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b(); +- int i = iblockstate.func_177229_b(BlockBed.field_185512_D).func_176736_b(); + if (block.isBed(iblockstate, p_180597_1_, pos, p_180597_3_)) { + int i = block.getBedDirection(iblockstate, p_180597_1_, pos).func_176736_b(); this.field_78735_i = (float)(i * 90 + 180); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch index 9ad164690..dd4f8c37f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -16,12 +16,3 @@ } private void func_177137_d(AbstractClientPlayer p_177137_1_) { -@@ -104,6 +106,8 @@ - EnumAction enumaction1 = itemstack1.func_77975_n(); - if (enumaction1 == EnumAction.BLOCK) { - modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK; -+ } else if (enumaction1 == EnumAction.BOW) { // FORGE: fix MC-88356 allow offhand to use bow and arrow animation TODO Remove in 1.13.1 - Fixed -+ modelbiped$armpose1 = ModelBiped.ArmPose.BOW_AND_ARROW; - } else if (enumaction1 == EnumAction.SPEAR) { - modelbiped$armpose1 = ModelBiped.ArmPose.THROW_SPEAR; - } 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 index 0674cad1d..e37e43b0a 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch @@ -1,14 +1,6 @@ --- a/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java +++ b/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java -@@ -2,6 +2,7 @@ - - import com.google.common.collect.Maps; - import java.util.Map; -+ - import net.minecraft.client.Minecraft; - import net.minecraft.client.renderer.GlStateManager; - import net.minecraft.client.renderer.entity.RenderLivingBase; -@@ -50,12 +51,13 @@ +@@ -51,12 +51,13 @@ ItemArmor itemarmor = (ItemArmor)itemstack.func_77973_b(); if (itemarmor.func_185083_B_() == p_188361_9_) { T t = this.func_188360_a(p_188361_9_); @@ -24,7 +16,7 @@ int i = ((ItemArmorDyeable)itemarmor).func_200886_f(itemstack); float f = (float)(i >> 16 & 255) / 255.0F; float f1 = (float)(i >> 8 & 255) / 255.0F; -@@ -67,7 +69,7 @@ +@@ -68,7 +69,7 @@ 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_); @@ -33,7 +25,7 @@ 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_); } -@@ -119,10 +121,12 @@ +@@ -120,10 +121,12 @@ Minecraft.func_71410_x().field_71460_t.func_191514_d(false); } @@ -43,14 +35,14 @@ } + @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_200880_d().func_200897_d(), p_177178_2_ ? 2 : 1, p_177178_3_ == null ? "" : String.format("_%s", p_177178_3_)); - ResourceLocation resourcelocation = field_177191_j.get(s); -@@ -137,4 +141,47 @@ + private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, @Nullable String p_177178_3_) { + String s = "textures/models/armor/" + p_177178_1_.func_200880_d().func_200897_d() + "_layer_" + (p_177178_2_ ? 2 : 1) + (p_177178_3_ == null ? "" : "_" + p_177178_3_) + ".png"; + return field_177191_j.computeIfAbsent(s, ResourceLocation::new); +@@ -132,4 +135,47 @@ protected abstract void func_177177_a(); protected abstract void func_188359_a(T p_188359_1_, EntityEquipmentSlot p_188359_2_); -+ ++ + /*=================================== FORGE START =========================================*/ + + /** diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/BakedQuad.java.patch similarity index 93% rename from patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/BakedQuad.java.patch index 86bdea2ce..54b0c55e6 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/BakedQuad.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/BakedQuad.java -+++ b/net/minecraft/client/renderer/block/model/BakedQuad.java +--- a/net/minecraft/client/renderer/model/BakedQuad.java ++++ b/net/minecraft/client/renderer/model/BakedQuad.java @@ -6,13 +6,23 @@ import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/BakedQuadRetextured.java.patch similarity index 88% rename from patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/BakedQuadRetextured.java.patch index 72c2dda00..bd5dd7305 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/BakedQuadRetextured.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java -+++ b/net/minecraft/client/renderer/block/model/BakedQuadRetextured.java +--- a/net/minecraft/client/renderer/model/BakedQuadRetextured.java ++++ b/net/minecraft/client/renderer/model/BakedQuadRetextured.java @@ -17,10 +17,15 @@ private void func_178217_e() { diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/FaceBakery.java.patch similarity index 98% rename from patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/FaceBakery.java.patch index a5949c58d..02b347694 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/FaceBakery.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/FaceBakery.java -+++ b/net/minecraft/client/renderer/block/model/FaceBakery.java +--- a/net/minecraft/client/renderer/model/FaceBakery.java ++++ b/net/minecraft/client/renderer/model/FaceBakery.java @@ -39,18 +39,23 @@ }; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/IBakedModel.java.patch similarity index 82% rename from patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/IBakedModel.java.patch index f53b61c8e..1bffc59bc 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/IBakedModel.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/IBakedModel.java -+++ b/net/minecraft/client/renderer/block/model/IBakedModel.java +--- a/net/minecraft/client/renderer/model/IBakedModel.java ++++ b/net/minecraft/client/renderer/model/IBakedModel.java @@ -10,7 +10,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/IUnbakedModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/IUnbakedModel.java.patch similarity index 70% rename from patches/minecraft/net/minecraft/client/renderer/block/model/IUnbakedModel.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/IUnbakedModel.java.patch index d4b0c88c8..4a751badd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/IUnbakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/IUnbakedModel.java.patch @@ -1,15 +1,11 @@ ---- a/net/minecraft/client/renderer/block/model/IUnbakedModel.java -+++ b/net/minecraft/client/renderer/block/model/IUnbakedModel.java -@@ -8,13 +8,21 @@ - import net.minecraft.util.ResourceLocation; - import net.minecraftforge.api.distmarker.Dist; +--- a/net/minecraft/client/renderer/model/IUnbakedModel.java ++++ b/net/minecraft/client/renderer/model/IUnbakedModel.java +@@ -10,11 +10,17 @@ import net.minecraftforge.api.distmarker.OnlyIn; -+import net.minecraftforge.client.model.IModel; -+import net.minecraftforge.common.model.IModelState; @OnlyIn(Dist.CLIENT) -public interface IUnbakedModel { -+public interface IUnbakedModel extends IModel { ++public interface IUnbakedModel extends net.minecraftforge.client.model.IModel { Collection func_187965_e(); Collection func_209559_a(Function p_209559_1_, Set p_209559_2_); diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ItemCameraTransforms.java.patch similarity index 92% rename from patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/ItemCameraTransforms.java.patch index 09bd88da1..180f98621 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/ItemCameraTransforms.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java -+++ b/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java +--- a/net/minecraft/client/renderer/model/ItemCameraTransforms.java ++++ b/net/minecraft/client/renderer/model/ItemCameraTransforms.java @@ -12,6 +12,10 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ItemOverrideList.java.patch similarity index 69% rename from patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/ItemOverrideList.java.patch index 6d29fb1c6..92917c140 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrideList.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/ItemOverrideList.java.patch @@ -1,21 +1,21 @@ ---- a/net/minecraft/client/renderer/block/model/ItemOverrideList.java -+++ b/net/minecraft/client/renderer/block/model/ItemOverrideList.java +--- a/net/minecraft/client/renderer/model/ItemOverrideList.java ++++ b/net/minecraft/client/renderer/model/ItemOverrideList.java @@ -25,7 +25,8 @@ - this.field_209582_c = Collections.emptyList(); + this.field_209582_c = Collections.emptyList(); } - public ItemOverrideList(ModelBlock p_i49525_1_, Function p_i49525_2_, Function p_i49525_3_, List p_i49525_4_) { + // FORGE: No reason for first param to be limited to ModelBlock + public ItemOverrideList(IUnbakedModel p_i49525_1_, Function p_i49525_2_, Function p_i49525_3_, List p_i49525_4_) { - this.field_209582_c = (List)p_i49525_4_.stream().map((p_209580_3_) -> { + this.field_209582_c = p_i49525_4_.stream().map((p_209580_3_) -> { IUnbakedModel iunbakedmodel = p_i49525_2_.apply(p_209580_3_.func_188026_a()); return Objects.equals(iunbakedmodel, p_i49525_1_) ? null : iunbakedmodel.func_209558_a(p_i49525_2_, p_i49525_3_, ModelRotation.X0_Y0, false); @@ -56,4 +57,8 @@ return p_209581_1_; } -+ ++ + public com.google.common.collect.ImmutableList getOverrides() { -+ return com.google.common.collect.ImmutableList.copyOf(field_188023_b); ++ 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/model/ItemTransformVec3f.java.patch similarity index 86% rename from patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/ItemTransformVec3f.java.patch index 89ddbc993..67b3031ea 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/ItemTransformVec3f.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java -+++ b/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java +--- a/net/minecraft/client/renderer/model/ItemTransformVec3f.java ++++ b/net/minecraft/client/renderer/model/ItemTransformVec3f.java @@ -12,8 +12,13 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/patches/minecraft/net/minecraft/client/renderer/model/ModelBakery.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ModelBakery.java.patch new file mode 100644 index 000000000..8757fdf84 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/model/ModelBakery.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/renderer/model/ModelBakery.java ++++ b/net/minecraft/client/renderer/model/ModelBakery.java +@@ -198,7 +198,7 @@ + flag = true; + lvt_9_4_ = this.field_177598_f.func_199004_b(resourcelocation1).stream().map((p_209591_1_) -> { + try (InputStream inputstream = p_209591_1_.func_199027_b()) { +- return Pair.of(p_209591_1_.func_199026_d(), ModelBlockDefinition.func_209577_a(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8))); ++ return Pair.of(p_209591_1_.func_199026_d(), ModelBlockDefinition.fromJson(this.field_209610_F, new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_209598_1_)); + } catch (Exception exception1) { + throw new ModelBakery.BlockStateDefinitionException(String.format("Exception loading blockstate definition: '%s' in resourcepack: '%s': %s", p_209591_1_.func_199029_a(), p_209591_1_.func_199026_d(), exception1.getMessage())); + } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlock.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ModelBlock.java.patch similarity index 75% rename from patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlock.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/ModelBlock.java.patch index 30eff9970..66d8679f3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlock.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/ModelBlock.java.patch @@ -1,28 +1,6 @@ ---- a/net/minecraft/client/renderer/block/model/ModelBlock.java -+++ b/net/minecraft/client/renderer/block/model/ModelBlock.java -@@ -18,6 +18,7 @@ - import java.util.List; - import java.util.Map; - import java.util.Objects; -+import java.util.Optional; - import java.util.Set; - import java.util.Map.Entry; - import java.util.function.Function; -@@ -25,11 +26,13 @@ - import javax.annotation.Nullable; - import net.minecraft.client.renderer.texture.MissingTextureSprite; - import net.minecraft.client.renderer.texture.TextureAtlasSprite; -+import net.minecraft.client.renderer.vertex.VertexFormat; - import net.minecraft.util.EnumFacing; - import net.minecraft.util.JsonUtils; - import net.minecraft.util.ResourceLocation; - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; -+ - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - -@@ -79,6 +82,9 @@ +--- a/net/minecraft/client/renderer/model/ModelBlock.java ++++ b/net/minecraft/client/renderer/model/ModelBlock.java +@@ -79,6 +79,9 @@ return this.field_178315_d != null; } @@ -32,14 +10,14 @@ public boolean func_178309_b() { return this.func_178295_k() ? this.field_178315_d.func_178309_b() : this.field_178322_i; } -@@ -178,14 +184,18 @@ +@@ -178,14 +181,18 @@ return set1; } - public IBakedModel func_209558_a(Function p_209558_1_, Function p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_) { - return this.func_209565_a(this, p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_); + @Override -+ public IBakedModel bake(Function p_209558_1_, Function p_209558_2_, net.minecraftforge.common.model.IModelState p_209558_3_, boolean p_209558_4_, VertexFormat format) { ++ public IBakedModel bake(Function p_209558_1_, Function p_209558_2_, net.minecraftforge.common.model.IModelState p_209558_3_, boolean p_209558_4_, net.minecraft.client.renderer.vertex.VertexFormat format) { + if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT)) { + throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK"); } @@ -55,7 +33,7 @@ } else if (modelblock == ModelBakery.field_177616_r) { return new BuiltInModel(this.func_181682_g(), this.func_209568_a(p_209565_1_, p_209565_2_, p_209565_3_)); } else { -@@ -197,9 +207,10 @@ +@@ -197,9 +204,10 @@ BlockPartFace blockpartface = blockpart.field_178240_c.get(enumfacing); TextureAtlasSprite textureatlassprite1 = p_209565_3_.apply(new ResourceLocation(this.func_178308_c(blockpartface.field_178242_d))); if (blockpartface.field_178244_b == null) { @@ -63,12 +41,12 @@ + simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_)); } else { - simplebakedmodel$builder.func_177650_a(p_209565_4_.func_177523_a(blockpartface.field_178244_b), func_209567_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_)); -+ -+ simplebakedmodel$builder.func_177650_a(p_209565_4_.apply(Optional.empty()).map(trsr -> trsr.rotate(enumfacing)).orElse(enumfacing), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_)); ++ ++ simplebakedmodel$builder.func_177650_a(p_209565_4_.apply(java.util.Optional.empty()).map(trsr -> trsr.rotate(enumfacing)).orElse(enumfacing), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_)); } } } -@@ -209,9 +220,13 @@ +@@ -209,9 +217,13 @@ } private static BakedQuad func_209567_a(BlockPart p_209567_0_, BlockPartFace p_209567_1_, TextureAtlasSprite p_209567_2_, EnumFacing p_209567_3_, ModelRotation p_209567_4_, boolean p_209567_5_) { @@ -77,7 +55,7 @@ } + public static BakedQuad makeBakedQuad(BlockPart p_209567_0, BlockPartFace p_209567_1_, TextureAtlasSprite p_209567_2_, EnumFacing p_209567_3_, net.minecraftforge.common.model.IModelState p_209567_4_, boolean p_209567_5_) { -+ return field_209572_h.makeBakedQuad(p_209567_0.field_178241_a, p_209567_0.field_178239_b, p_209567_1_, p_209567_2_, p_209567_3_, p_209567_4_.apply(Optional.empty()).orElse(net.minecraftforge.common.model.TRSRTransformation.identity()), p_209567_0.field_178237_d, p_209567_5_, p_209567_0.field_178238_e); ++ return field_209572_h.makeBakedQuad(p_209567_0.field_178241_a, p_209567_0.field_178239_b, p_209567_1_, p_209567_2_, p_209567_3_, p_209567_4_.apply(java.util.Optional.empty()).orElse(net.minecraftforge.common.model.TRSRTransformation.identity()), p_209567_0.field_178237_d, p_209567_5_, p_209567_0.field_178238_e); + } + public boolean func_178300_b(String p_178300_1_) { diff --git a/patches/minecraft/net/minecraft/client/renderer/model/ModelBlockDefinition.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ModelBlockDefinition.java.patch new file mode 100644 index 000000000..1555e7b6c --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/model/ModelBlockDefinition.java.patch @@ -0,0 +1,19 @@ +--- a/net/minecraft/client/renderer/model/ModelBlockDefinition.java ++++ b/net/minecraft/client/renderer/model/ModelBlockDefinition.java +@@ -30,10 +30,15 @@ + private final Map field_178332_b = Maps.newLinkedHashMap(); + private Multipart field_188005_c; + ++ @Deprecated + public static ModelBlockDefinition func_209577_a(ModelBlockDefinition.ContainerHolder p_209577_0_, Reader p_209577_1_) { +- return JsonUtils.func_193839_a(p_209577_0_.field_209575_a, p_209577_1_, ModelBlockDefinition.class); ++ return fromJson(p_209577_0_, p_209577_1_, null); + } + ++ public static ModelBlockDefinition fromJson(ModelBlockDefinition.ContainerHolder containerHolderIn, Reader readerIn, @Nullable net.minecraft.util.ResourceLocation location) { ++ return net.minecraftforge.client.model.BlockStateLoader.load(readerIn, location, containerHolderIn.field_209575_a); ++ } ++ + public ModelBlockDefinition(Map p_i46572_1_, Multipart p_i46572_2_) { + this.field_188005_c = p_i46572_2_; + this.field_178332_b.putAll(p_i46572_1_); diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ModelManager.java.patch similarity index 76% rename from patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/ModelManager.java.patch index a5c722bcb..a632f871e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/ModelManager.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/ModelManager.java -+++ b/net/minecraft/client/renderer/block/model/ModelManager.java +--- a/net/minecraft/client/renderer/model/ModelManager.java ++++ b/net/minecraft/client/renderer/model/ModelManager.java @@ -21,9 +21,10 @@ } @@ -7,12 +7,12 @@ - ModelBakery modelbakery = new ModelBakery(p_195410_1_, this.field_174956_b); + net.minecraftforge.client.model.ModelLoader modelbakery = new net.minecraftforge.client.model.ModelLoader(p_195410_1_, this.field_174956_b); this.field_174958_a = modelbakery.func_177570_a(); - this.field_174955_d = this.field_174958_a.func_82594_a(ModelBakery.field_177604_a); + this.field_174955_d = this.field_174958_a.get(ModelBakery.field_177604_a); + net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, modelbakery); this.field_174957_c.func_178124_c(); } -@@ -39,4 +40,9 @@ +@@ -38,4 +39,9 @@ public BlockModelShapes func_174954_c() { return this.field_174957_c; } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ModelResourceLocation.java.patch similarity index 67% rename from patches/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/ModelResourceLocation.java.patch index 9cea9ea08..f953097c3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelResourceLocation.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/ModelResourceLocation.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/ModelResourceLocation.java -+++ b/net/minecraft/client/renderer/block/model/ModelResourceLocation.java +--- a/net/minecraft/client/renderer/model/ModelResourceLocation.java ++++ b/net/minecraft/client/renderer/model/ModelResourceLocation.java @@ -2,10 +2,7 @@ import java.util.Locale; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/ModelRotation.java.patch similarity index 77% rename from patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/ModelRotation.java.patch index 94a53bb4a..2d7ed7b61 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/ModelRotation.java.patch @@ -1,10 +1,7 @@ ---- a/net/minecraft/client/renderer/block/model/ModelRotation.java -+++ b/net/minecraft/client/renderer/block/model/ModelRotation.java -@@ -10,9 +10,10 @@ - import net.minecraft.util.math.MathHelper; - import net.minecraftforge.api.distmarker.Dist; +--- a/net/minecraft/client/renderer/model/ModelRotation.java ++++ b/net/minecraft/client/renderer/model/ModelRotation.java +@@ -12,7 +12,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; -+import net.minecraftforge.client.model.IModel; @OnlyIn(Dist.CLIENT) -public enum ModelRotation { @@ -12,7 +9,7 @@ X0_Y0(0, 0), X0_Y90(0, 90), X0_Y180(0, 180), -@@ -97,4 +98,9 @@ +@@ -97,4 +97,9 @@ public static ModelRotation func_177524_a(int p_177524_0_, int p_177524_1_) { return field_177546_q.get(func_177521_b(MathHelper.func_180184_b(p_177524_0_, 360), MathHelper.func_180184_b(p_177524_1_, 360))); } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch similarity index 80% rename from patches/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch index 59fedc950..099695f08 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/SimpleBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/SimpleBakedModel.java -+++ b/net/minecraft/client/renderer/block/model/SimpleBakedModel.java +--- a/net/minecraft/client/renderer/model/SimpleBakedModel.java ++++ b/net/minecraft/client/renderer/model/SimpleBakedModel.java @@ -75,7 +75,7 @@ } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/Variant.java.patch similarity index 85% rename from patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/Variant.java.patch index 48720b5fd..e1f38c60f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/Variant.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/Variant.java -+++ b/net/minecraft/client/renderer/block/model/Variant.java +--- a/net/minecraft/client/renderer/model/Variant.java ++++ b/net/minecraft/client/renderer/model/Variant.java @@ -12,7 +12,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/VariantList.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/VariantList.java.patch similarity index 65% rename from patches/minecraft/net/minecraft/client/renderer/block/model/VariantList.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/VariantList.java.patch index 52b1bdd86..0f73a02cd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/VariantList.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/VariantList.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/VariantList.java -+++ b/net/minecraft/client/renderer/block/model/VariantList.java +--- a/net/minecraft/client/renderer/model/VariantList.java ++++ b/net/minecraft/client/renderer/model/VariantList.java @@ -56,14 +56,15 @@ } @@ -13,8 +13,8 @@ WeightedBakedModel.Builder weightedbakedmodel$builder = new WeightedBakedModel.Builder(); for(Variant variant : this.func_188114_a()) { -- IBakedModel ibakedmodel = (p_209558_1_.apply(variant.func_188046_a())).func_209558_a(p_209558_1_, p_209558_2_, variant.func_188048_b(), variant.func_188049_c()); -+ IBakedModel ibakedmodel = (p_209558_1_.apply(variant.func_188046_a())).bake(p_209558_1_, p_209558_2_, variant.getState(), variant.func_188049_c(), format); +- IBakedModel ibakedmodel = p_209558_1_.apply(variant.func_188046_a()).func_209558_a(p_209558_1_, p_209558_2_, variant.func_188048_b(), variant.func_188049_c()); ++ IBakedModel ibakedmodel = p_209558_1_.apply(variant.func_188046_a()).bake(p_209558_1_, p_209558_2_, variant.getState(), variant.func_188049_c(), format); weightedbakedmodel$builder.func_177677_a(ibakedmodel, variant.func_188047_d()); } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/WeightedBakedModel.java.patch similarity index 70% rename from patches/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/WeightedBakedModel.java.patch index 6b8793c8e..eaba4450c 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/WeightedBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/WeightedBakedModel.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/WeightedBakedModel.java -+++ b/net/minecraft/client/renderer/block/model/WeightedBakedModel.java +--- a/net/minecraft/client/renderer/model/WeightedBakedModel.java ++++ b/net/minecraft/client/renderer/model/WeightedBakedModel.java @@ -30,6 +30,9 @@ public boolean func_177555_b() { return this.field_177566_c.func_177555_b(); diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/multipart/Multipart.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/multipart/Multipart.java.patch similarity index 88% rename from patches/minecraft/net/minecraft/client/renderer/block/model/multipart/Multipart.java.patch rename to patches/minecraft/net/minecraft/client/renderer/model/multipart/Multipart.java.patch index 4a345a618..4660f68d8 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/multipart/Multipart.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/multipart/Multipart.java.patch @@ -1,5 +1,5 @@ ---- a/net/minecraft/client/renderer/block/model/multipart/Multipart.java -+++ b/net/minecraft/client/renderer/block/model/multipart/Multipart.java +--- a/net/minecraft/client/renderer/model/multipart/Multipart.java ++++ b/net/minecraft/client/renderer/model/multipart/Multipart.java @@ -81,11 +81,12 @@ } diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java.patch index 55d8503cd..26d61f7fb 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java.patch @@ -8,5 +8,5 @@ - NativeImage nativeimage2 = NativeImage.func_195713_a(iresource1.func_199027_b()); + NativeImage nativeimage2 = net.minecraftforge.client.MinecraftForgeClient.getImageLayer(new ResourceLocation(s), p_195413_1_); ) { - int j = ((EnumDyeColor)this.field_174950_i.get(i)).func_196057_c(); + int j = this.field_174950_i.get(i).func_196057_c(); if (nativeimage2.func_195702_a() == nativeimage1.func_195702_a() && nativeimage2.func_195714_b() == nativeimage1.func_195714_b()) { diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch index ad125b48a..a4e0a0487 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -7,11 +7,11 @@ + private static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger(); + private final int field_147971_a; - private final Set field_94319_a = Sets.newHashSetWithExpectedSize(256); - private final List field_94317_b = Lists.newArrayListWithCapacity(256); + private final Set field_94319_a = Sets.newHashSetWithExpectedSize(256); + private final List field_94317_b = Lists.newArrayListWithCapacity(256); @@ -48,16 +50,22 @@ public void func_94305_f() { - Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]); + Stitcher.Holder[] astitcher$holder = this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]); Arrays.sort((Object[])astitcher$holder); + try(net.minecraftforge.fml.common.progress.ProgressBar bar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Texture stitching", astitcher$holder.length)) { diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch index 99b4836c8..ca15654de 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch @@ -25,7 +25,12 @@ BlockPos blockpos = p_180546_1_.func_174877_v(); this.func_203602_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_, false); } -@@ -137,6 +140,9 @@ +@@ -133,10 +136,13 @@ + TileEntityRenderer tileentityrenderer = this.func_147547_b(p_203602_1_); + if (tileentityrenderer != null) { + try { +- if (!p_203602_10_ && (!p_203602_1_.func_145830_o() || !p_203602_1_.func_195044_w().func_177230_c().func_149716_u())) { ++ if (!p_203602_10_ && (!p_203602_1_.func_145830_o() || !p_203602_1_.func_195044_w().hasTileEntity())) { return; } @@ -35,12 +40,11 @@ tileentityrenderer.func_199341_a(p_203602_1_, p_203602_2_, p_203602_4_, p_203602_6_, p_203602_8_, p_203602_9_); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Block Entity"); -@@ -159,4 +165,53 @@ +@@ -159,4 +165,51 @@ public FontRenderer func_147548_a() { return this.field_147557_n; } -+ -+ /* ======================================== FORGE START =====================================*/ ++ + /** + * Buffer used for batched TESRs + */ @@ -51,8 +55,7 @@ + * Prepare for a batched TESR rendering. + * You probably shouldn't call this manually. + */ -+ public void preDrawBatch() -+ { ++ 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; + } @@ -61,25 +64,20 @@ + * Render all TESRs batched so far. + * You probably shouldn't call this manually. + */ -+ public void drawBatch(int pass) -+ { ++ 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()) -+ { ++ if (net.minecraft.client.Minecraft.func_71379_u()) { + GlStateManager.func_179103_j(org.lwjgl.opengl.GL11.GL_SMOOTH); -+ } -+ else -+ { ++ } else { + GlStateManager.func_179103_j(org.lwjgl.opengl.GL11.GL_FLAT); + } + -+ if(pass > 0) -+ { ++ 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); + } @@ -87,5 +85,10 @@ + + net.minecraft.client.renderer.RenderHelper.func_74519_b(); + drawingBatch = false; ++ } ++ ++ //Internal, Do not call Use ClientRegistry. ++ public synchronized void setSpecialRenderer(Class tileEntityClass, TileEntityRenderer specialRenderer) { ++ this.field_147559_m.put(tileEntityClass, specialRenderer); + } } diff --git a/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch index cb5abd7cc..0f957ea02 100644 --- a/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/client/renderer/vertex/VertexFormat.java +++ b/net/minecraft/client/renderer/vertex/VertexFormat.java @@ -16,6 +16,7 @@ - private int field_177354_e; - private final List field_177351_f; - private int field_177352_g; + private int field_177354_e = -1; + private final List field_177351_f = Lists.newArrayList(); + private int field_177352_g = -1; + private int hashCode; public VertexFormat(VertexFormat p_i46097_1_) { this(); -@@ -42,6 +43,7 @@ +@@ -37,6 +38,7 @@ this.field_177351_f.clear(); this.field_177352_g = -1; this.field_177353_d = 0; @@ -16,7 +16,7 @@ } public VertexFormat func_181721_a(VertexFormatElement p_181721_1_) { -@@ -63,6 +65,7 @@ +@@ -58,6 +60,7 @@ } this.field_177353_d += p_181721_1_.func_177368_f(); @@ -24,7 +24,7 @@ return this; } } -@@ -157,9 +160,11 @@ +@@ -152,9 +155,11 @@ } public int hashCode() { diff --git a/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch b/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch index 9e97bc08f..b9060dce0 100644 --- a/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch +++ b/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch @@ -6,11 +6,11 @@ @OnlyIn(Dist.CLIENT) -public class KeyBinding implements Comparable { +public class KeyBinding implements Comparable, net.minecraftforge.client.extensions.IForgeKeybinding { - private static final Map field_74516_a = Maps.newHashMap(); -- private static final Map field_74514_b = Maps.newHashMap(); + private static final Map field_74516_a = Maps.newHashMap(); +- private static final Map field_74514_b = Maps.newHashMap(); + 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 = (Map)Util.func_200696_a(Maps.newHashMap(), (p_205215_0_) -> { + private static final Set field_151473_c = Sets.newHashSet(); + private static final Map field_193627_d = Util.func_200696_a(Maps.newHashMap(), (p_205215_0_) -> { p_205215_0_.put("key.categories.movement", 1); @@ -33,7 +33,7 @@ private int field_151474_i; @@ -58,51 +58,43 @@ } public String func_151466_e() { -@@ -122,17 +122,41 @@ +@@ -122,7 +122,13 @@ } 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); +- 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)) : 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); } public static Supplier func_193626_b(String p_193626_0_) { - KeyBinding keybinding = field_74516_a.get(p_193626_0_); - return keybinding == null ? () -> { - return p_193626_0_; -- } : keybinding::func_197978_k; -+ } : () -> keybinding.func_197978_k(); +@@ -133,6 +139,20 @@ } public boolean func_197983_b(KeyBinding p_197983_1_) { -+ if (getKeyConflictContext().conflicts(p_197983_1_.getKeyConflictContext()) || p_197983_1_.getKeyConflictContext().conflicts(getKeyConflictContext())) -+ { ++ if (getKeyConflictContext().conflicts(p_197983_1_.getKeyConflictContext()) || p_197983_1_.getKeyConflictContext().conflicts(getKeyConflictContext())) { + net.minecraftforge.client.settings.KeyModifier keyModifier = getKeyModifier(); + net.minecraftforge.client.settings.KeyModifier otherKeyModifier = p_197983_1_.getKeyModifier(); -+ if (keyModifier.matches(p_197983_1_.getKey()) || otherKeyModifier.matches(getKey())) -+ { ++ if (keyModifier.matches(p_197983_1_.getKey()) || otherKeyModifier.matches(getKey())) { + return true; -+ } -+ else if (getKey().equals(p_197983_1_.getKey())) -+ { ++ } else if (getKey().equals(p_197983_1_.getKey())) { ++ // 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. + 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)); ++ (getKeyConflictContext().conflicts(net.minecraftforge.client.settings.KeyConflictContext.IN_GAME) && ++ (keyModifier == net.minecraftforge.client.settings.KeyModifier.NONE || otherKeyModifier == net.minecraftforge.client.settings.KeyModifier.NONE)); + } + } return this.field_74512_d.equals(p_197983_1_.field_74512_d); } -@@ -153,14 +177,94 @@ +@@ -153,14 +173,94 @@ } public String func_197978_k() { @@ -155,11 +147,11 @@ + } + + @Override -+ public InputMappings.Input getKey() ++ public InputMappings.Input getKey() + { + return this.field_74512_d; + } -+ ++ + @Override + public void setKeyConflictContext(net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext) + { diff --git a/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch index a1dd76938..c2464f7ff 100644 --- a/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/ShaderGroup.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/shader/ShaderGroup.java +++ b/net/minecraft/client/shader/ShaderGroup.java -@@ -143,7 +143,8 @@ +@@ -142,7 +142,8 @@ String s3 = JsonUtils.func_151200_h(jsonobject1, "id"); Framebuffer framebuffer2 = this.func_148017_a(s3); if (framebuffer2 == null) { diff --git a/patches/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch index 41604ae0d..6ae6cbe1d 100644 --- a/patches/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/ShaderLoader.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/client/shader/ShaderLoader.java @@ -51,7 +51,8 @@ public static ShaderLoader func_195655_a(IResourceManager p_195655_0_, ShaderLoader.ShaderType p_195655_1_, String p_195655_2_) throws IOException { - ShaderLoader shaderloader = (ShaderLoader)p_195655_1_.func_148064_d().get(p_195655_2_); + ShaderLoader shaderloader = p_195655_1_.func_148064_d().get(p_195655_2_); if (shaderloader == null) { - ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + p_195655_2_ + p_195655_1_.func_148063_b()); + ResourceLocation rl = ResourceLocation.func_208304_a(p_195655_2_); diff --git a/patches/minecraft/net/minecraft/client/shader/ShaderManager.java.patch b/patches/minecraft/net/minecraft/client/shader/ShaderManager.java.patch index 088306730..009b36505 100644 --- a/patches/minecraft/net/minecraft/client/shader/ShaderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/ShaderManager.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/client/shader/ShaderManager.java +++ b/net/minecraft/client/shader/ShaderManager.java -@@ -51,7 +51,8 @@ +@@ -50,7 +50,8 @@ + private final ShaderLoader field_148012_t; public ShaderManager(IResourceManager p_i45087_1_, String p_i45087_2_) throws IOException { - JsonParser jsonparser = new JsonParser(); - ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + p_i45087_2_ + ".json"); + ResourceLocation rl = ResourceLocation.func_208304_a(p_i45087_2_); + ResourceLocation resourcelocation = new ResourceLocation(rl.func_110624_b(), "shaders/program/" + rl.func_110623_a() + ".json"); diff --git a/patches/minecraft/net/minecraft/command/Commands.java.patch b/patches/minecraft/net/minecraft/command/Commands.java.patch index e4f3fd2a3..1e3bb3b03 100644 --- a/patches/minecraft/net/minecraft/command/Commands.java.patch +++ b/patches/minecraft/net/minecraft/command/Commands.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/command/Commands.java +++ b/net/minecraft/command/Commands.java -@@ -189,7 +189,15 @@ +@@ -193,7 +193,15 @@ try { try { -- int lvt_4_3_ = this.field_197062_b.execute(p_197059_2_, p_197059_1_); -+ com.mojang.brigadier.ParseResults parse = this.field_197062_b.parse(p_197059_2_, p_197059_1_); +- int lvt_4_3_ = this.field_197062_b.execute(stringreader, p_197059_1_); ++ com.mojang.brigadier.ParseResults parse = this.field_197062_b.parse(stringreader, p_197059_1_); + net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(parse); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { + if (event.getException() != null) { diff --git a/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch b/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch index c3ca40618..3cc346834 100644 --- a/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch +++ b/patches/minecraft/net/minecraft/command/arguments/BlockStateParser.java.patch @@ -1,15 +1,22 @@ --- a/net/minecraft/command/arguments/BlockStateParser.java +++ b/net/minecraft/command/arguments/BlockStateParser.java -@@ -167,7 +167,7 @@ - } +@@ -168,13 +168,13 @@ - private CompletableFuture func_197244_d(SuggestionsBuilder p_197244_1_) { -- if (p_197244_1_.getRemaining().isEmpty() && (this.field_197270_l == null || this.field_197270_l.func_177230_c().func_149716_u())) { -+ if (p_197244_1_.getRemaining().isEmpty() && (this.field_197270_l == null || this.field_197270_l.hasTileEntity())) { - p_197244_1_.suggest(String.valueOf('{')); - } - -@@ -252,7 +252,7 @@ + private boolean func_212598_k() { + if (this.field_197270_l != null) { +- return this.field_197270_l.func_177230_c().func_149716_u(); ++ return this.field_197270_l.hasTileEntity(); + } else { + if (this.field_199833_p != null) { + Tag tag = BlockTags.func_199896_a().func_199910_a(this.field_199833_p); + if (tag != null) { + for(Block block : tag.func_199885_a()) { +- if (block.func_149716_u()) { ++ if (block.func_176223_P().hasTileEntity()) { + return true; + } + } +@@ -291,7 +291,7 @@ p_197255_1_.suggest(String.valueOf('[')); } diff --git a/patches/minecraft/net/minecraft/command/arguments/EntitySelectorParser.java.patch b/patches/minecraft/net/minecraft/command/arguments/EntitySelectorParser.java.patch index 2c761fd89..5d3a29e06 100644 --- a/patches/minecraft/net/minecraft/command/arguments/EntitySelectorParser.java.patch +++ b/patches/minecraft/net/minecraft/command/arguments/EntitySelectorParser.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/command/arguments/EntitySelectorParser.java +++ b/net/minecraft/command/arguments/EntitySelectorParser.java -@@ -441,6 +441,10 @@ +@@ -435,6 +435,10 @@ } this.field_197417_j.skip(); @@ -11,10 +11,10 @@ this.func_197403_b(); } else { this.func_197382_c(); -@@ -456,6 +460,7 @@ - p_210326_0_.suggest("@r", new TextComponentTranslation("argument.entity.selector.randomPlayer", new Object[0])); - p_210326_0_.suggest("@s", new TextComponentTranslation("argument.entity.selector.self", new Object[0])); - p_210326_0_.suggest("@e", new TextComponentTranslation("argument.entity.selector.allEntities", new Object[0])); +@@ -450,6 +454,7 @@ + p_210326_0_.suggest("@r", new TextComponentTranslation("argument.entity.selector.randomPlayer")); + p_210326_0_.suggest("@s", new TextComponentTranslation("argument.entity.selector.self")); + p_210326_0_.suggest("@e", new TextComponentTranslation("argument.entity.selector.allEntities")); + net.minecraftforge.common.command.EntitySelectorManager.fillSelectorSuggestions(p_210326_0_); } diff --git a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch index f2e22d8ad..47cda05e2 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/crash/CrashReport.java +++ b/net/minecraft/crash/CrashReport.java @@ -63,6 +63,7 @@ - List list = (List)Util.func_211565_f().collect(Collectors.toList()); + List list = Util.func_211565_f().collect(Collectors.toList()); return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" "))); }); + net.minecraftforge.fml.CrashReportExtender.enhanceCrashReport(this, this.field_85061_c); diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch index 24f8e35c4..7db706c8b 100644 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -1,17 +1,15 @@ --- a/net/minecraft/enchantment/Enchantment.java +++ b/net/minecraft/enchantment/Enchantment.java -@@ -18,8 +18,8 @@ +@@ -18,7 +18,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public abstract class Enchantment { -- public static final RegistryNamespaced field_185264_b = new RegistryNamespaced(); +public abstract class Enchantment extends net.minecraftforge.registries.ForgeRegistryEntry { -+ 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 -@@ -114,7 +114,7 @@ +@@ -115,7 +115,7 @@ } public boolean func_92089_a(ItemStack p_92089_1_) { @@ -20,7 +18,7 @@ } public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) { -@@ -131,6 +131,24 @@ +@@ -132,6 +132,24 @@ return false; } diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index b5ec15e97..84c1132f5 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/enchantment/EnchantmentHelper.java +++ b/net/minecraft/enchantment/EnchantmentHelper.java -@@ -262,7 +262,7 @@ +@@ -258,7 +258,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(); @@ -9,19 +9,19 @@ if (i <= 0) { return 0; } else { -@@ -300,7 +300,7 @@ +@@ -296,7 +296,7 @@ public static List func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_, boolean p_77513_3_) { - List list = Lists.newArrayList(); + List list = Lists.newArrayList(); Item item = p_77513_1_.func_77973_b(); - int i = item.func_77619_b(); + int i = p_77513_1_.getItemEnchantability(); if (i <= 0) { return list; } else { -@@ -353,7 +353,7 @@ +@@ -349,7 +349,7 @@ boolean flag = p_185291_1_.func_77973_b() == Items.field_151122_aG; - for(Enchantment enchantment : Enchantment.field_185264_b) { + for(Enchantment enchantment : IRegistry.field_212628_q) { - 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/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index dd6881908..a677b899f 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -7,7 +7,7 @@ -public abstract class Entity implements INameable, ICommandSource { +public abstract class Entity extends net.minecraftforge.common.capabilities.CapabilityProvider implements INameable, ICommandSource, net.minecraftforge.common.extensions.IForgeEntity { protected static final Logger field_184243_a = LogManager.getLogger(); - private static final List field_190535_b = Collections.emptyList(); + private static final List field_190535_b = Collections.emptyList(); private static final AxisAlignedBB field_174836_a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); private static double field_70155_l = 1.0D; private static int field_70152_a; @@ -21,17 +21,8 @@ public Entity(EntityType p_i48580_1_, World p_i48580_2_) { + super(Entity.class); this.field_145783_c = field_70152_a++; - this.field_184244_h = Lists.newArrayList(); + this.field_184244_h = Lists.newArrayList(); this.field_70121_D = field_174836_a; -@@ -210,7 +212,7 @@ - this.field_70170_p = p_i48580_2_; - this.func_70107_b(0.0D, 0.0D, 0.0D); - if (p_i48580_2_ != null) { -- this.field_71093_bK = p_i48580_2_.field_73011_w.func_186058_p().func_186068_a(); -+ this.field_71093_bK = p_i48580_2_.field_73011_w.getId(); - } - - this.field_70180_af = new EntityDataManager(this); @@ -221,6 +223,8 @@ this.field_70180_af.func_187214_a(field_184234_aB, false); this.field_70180_af.func_187214_a(field_189655_aD, false); @@ -84,7 +75,7 @@ this.field_191959_ay = this.func_191954_d(this.field_82151_R); } } -@@ -794,6 +800,7 @@ +@@ -795,6 +801,7 @@ this.field_70165_t = (axisalignedbb.field_72340_a + axisalignedbb.field_72336_d) / 2.0D; this.field_70163_u = axisalignedbb.field_72338_b; this.field_70161_v = (axisalignedbb.field_72339_c + axisalignedbb.field_72334_f) / 2.0D; @@ -92,7 +83,7 @@ } protected SoundEvent func_184184_Z() { -@@ -845,7 +852,7 @@ +@@ -846,7 +853,7 @@ protected void func_180429_a(BlockPos p_180429_1_, IBlockState p_180429_2_) { if (!p_180429_2_.func_185904_a().func_76224_d()) { @@ -101,7 +92,7 @@ this.func_184185_a(soundtype.func_185844_d(), soundtype.func_185843_a() * 0.15F, soundtype.func_185847_b()); } } -@@ -1040,6 +1047,7 @@ +@@ -1041,6 +1048,7 @@ int k = MathHelper.func_76128_c(this.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); @@ -109,7 +100,7 @@ if (iblockstate.func_185901_i() != EnumBlockRenderType.INVISIBLE) { this.field_70170_p.func_195594_a(new BlockParticleData(Particles.field_197611_d, iblockstate), 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); } -@@ -1053,7 +1061,7 @@ +@@ -1054,7 +1062,7 @@ double d0 = this.field_70163_u + (double)this.func_70047_e(); BlockPos blockpos = new BlockPos(this.field_70165_t, d0, this.field_70161_v); IFluidState ifluidstate = this.field_70170_p.func_204610_c(blockpos); @@ -118,7 +109,7 @@ } } -@@ -1122,6 +1130,7 @@ +@@ -1123,6 +1131,7 @@ this.field_70126_B -= 360.0F; } @@ -126,7 +117,7 @@ this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); this.func_70101_b(p_70080_7_, p_70080_8_); } -@@ -1370,6 +1379,7 @@ +@@ -1371,6 +1380,7 @@ if (this.field_184238_ar) { p_189511_1_.func_74757_a("Glowing", this.field_184238_ar); } @@ -134,7 +125,7 @@ if (!this.field_184236_aF.isEmpty()) { NBTTagList nbttaglist = new NBTTagList(); -@@ -1381,6 +1391,9 @@ +@@ -1382,6 +1392,9 @@ p_189511_1_.func_74782_a("Tags", nbttaglist); } @@ -144,7 +135,7 @@ this.func_70014_b(p_189511_1_); if (this.func_184207_aI()) { NBTTagList nbttaglist1 = new NBTTagList(); -@@ -1466,6 +1479,8 @@ +@@ -1467,6 +1480,8 @@ 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")); @@ -153,7 +144,7 @@ if (p_70020_1_.func_150297_b("Tags", 9)) { this.field_184236_aF.clear(); NBTTagList nbttaglist1 = p_70020_1_.func_150295_c("Tags", 8); -@@ -1546,6 +1561,8 @@ +@@ -1547,6 +1562,8 @@ } else { 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(); @@ -162,7 +153,7 @@ this.field_70170_p.func_72838_d(entityitem); return entityitem; } -@@ -1595,6 +1612,7 @@ +@@ -1596,6 +1613,7 @@ this.field_70159_w = 0.0D; this.field_70181_x = 0.0D; this.field_70179_y = 0.0D; @@ -170,7 +161,7 @@ this.func_70071_h_(); if (this.func_184218_aH()) { entity.func_184232_k(this); -@@ -1636,6 +1654,7 @@ +@@ -1637,6 +1655,7 @@ } } @@ -178,7 +169,7 @@ if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) { if (this.func_184218_aH()) { this.func_184210_p(); -@@ -1663,6 +1682,7 @@ +@@ -1664,6 +1683,7 @@ public void func_184210_p() { if (this.field_184239_as != null) { Entity entity = this.field_184239_as; @@ -186,7 +177,7 @@ this.field_184239_as = null; entity.func_184225_p(this); } -@@ -1789,10 +1809,15 @@ +@@ -1790,10 +1810,15 @@ return !this.func_184188_bt().isEmpty(); } @@ -202,63 +193,63 @@ public boolean func_70093_af() { return this.func_70083_f(1); } -@@ -1990,7 +2015,7 @@ +@@ -1991,7 +2016,7 @@ func_207712_c(itextcomponent1); return itextcomponent1; } else { -- return new TextComponentTranslation(this.field_200606_g.func_210760_d(), new Object[0]); -+ return new TextComponentTranslation(this.func_200600_R().func_210760_d(), new Object[0]); // Forge: Use getter to allow overriding by mods +- return this.field_200606_g.func_212546_e(); ++ return this.func_200600_R().func_212546_e(); // Forge: Use getter to allow overriding by mods } } -@@ -2053,6 +2078,14 @@ +@@ -2054,6 +2079,14 @@ @Nullable - public Entity func_184204_a(int p_184204_1_) { + public Entity func_212321_a(DimensionType p_212321_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()); ++ return changeDimension(p_212321_1_, this.func_184102_h().func_71218_a(p_212321_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) ++ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) + { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return null; ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null; if (!this.field_70170_p.field_72995_K && !this.field_70128_L) { this.field_70170_p.field_72984_F.func_76320_a("changeDimension"); MinecraftServer minecraftserver = this.func_184102_h(); -@@ -2060,7 +2093,7 @@ - WorldServer worldserver = minecraftserver.func_71218_a(i); - 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_200667_a(DimensionType.OVERWORLD); - this.field_71093_bK = 0; +@@ -2061,7 +2094,7 @@ + WorldServer worldserver = minecraftserver.func_71218_a(dimensiontype); + WorldServer worldserver1 = minecraftserver.func_71218_a(p_212321_1_); + this.field_71093_bK = p_212321_1_; +- if (dimensiontype == DimensionType.THE_END && p_212321_1_ == DimensionType.THE_END) { ++ if (dimensiontype == DimensionType.THE_END && p_212321_1_ == DimensionType.THE_END && teleporter.isVanilla()) { + worldserver1 = minecraftserver.func_71218_a(DimensionType.OVERWORLD); + this.field_71093_bK = DimensionType.OVERWORLD; } -@@ -2069,16 +2102,17 @@ +@@ -2070,16 +2103,16 @@ this.field_70128_L = false; 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()) { +- if (p_212321_1_ == DimensionType.THE_END) { ++ if (p_212321_1_ == DimensionType.THE_END && teleporter.isVanilla()) { blockpos = worldserver1.func_180504_m(); } else { - double d0 = this.field_70165_t; - double d1 = this.field_70161_v; +- double d2 = 8.0D; +- if (p_212321_1_ == DimensionType.NETHER) { + 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) { ++ if (false && p_212321_1_ == DimensionType.NETHER) { 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) { +- } else if (p_212321_1_ == DimensionType.OVERWORLD) { ++ } else if (false && p_212321_1_ == DimensionType.OVERWORLD) { 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); } -@@ -2087,8 +2121,7 @@ +@@ -2088,8 +2121,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); @@ -268,16 +259,16 @@ blockpos = new BlockPos(this); } -@@ -2097,7 +2130,7 @@ +@@ -2098,7 +2130,7 @@ Entity entity = this.func_200600_R().func_200721_a(worldserver1); if (entity != null) { entity.func_180432_n(this); -- if (i == 1 && p_184204_1_ == 1) { -+ if (i == 1 && p_184204_1_ == 1 && teleporter.isVanilla()) { +- if (dimensiontype == DimensionType.THE_END && p_212321_1_ == DimensionType.THE_END) { ++ if (dimensiontype == DimensionType.THE_END && p_212321_1_ == DimensionType.THE_END && teleporter.isVanilla()) { BlockPos blockpos1 = worldserver1.func_205770_a(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.func_175694_M()); entity.func_174828_a(blockpos1, entity.field_70177_z, entity.field_70125_A); } else { -@@ -2591,4 +2624,56 @@ +@@ -2592,4 +2624,56 @@ public double func_212107_bY() { return this.field_211517_W; } diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index 3d27213e6..5a5a1321a 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -32,7 +32,7 @@ } else { Entity entity = this.field_70170_p.func_72890_a(this, -1.0D); if (entity != null) { -@@ -675,7 +682,6 @@ +@@ -671,7 +678,6 @@ return !p_205019_1_.func_72953_d(this.func_174813_aQ()) && p_205019_1_.func_195586_b(this, this.func_174813_aQ()) && p_205019_1_.func_195587_c(this, this.func_174813_aQ()); } @@ -40,7 +40,7 @@ public float func_70603_bj() { return 1.0F; } -@@ -803,6 +809,8 @@ +@@ -799,6 +805,8 @@ } public static EntityEquipmentSlot func_184640_d(ItemStack p_184640_0_) { @@ -49,7 +49,7 @@ Item item = p_184640_0_.func_77973_b(); if (item != Blocks.field_196625_cS.func_199767_j() && (!(item instanceof ItemBlock) || !(((ItemBlock)item).func_179223_d() instanceof BlockAbstractSkull))) { if (item instanceof ItemArmor) { -@@ -810,7 +818,7 @@ +@@ -806,7 +814,7 @@ } else if (item == Items.field_185160_cR) { return EntityEquipmentSlot.CHEST; } else { @@ -58,7 +58,7 @@ } } else { return EntityEquipmentSlot.HEAD; -@@ -1133,10 +1141,10 @@ +@@ -1129,10 +1137,10 @@ EntityPlayer entityplayer = (EntityPlayer)p_70652_1_; ItemStack itemstack = this.func_184614_ca(); ItemStack itemstack1 = entityplayer.func_184587_cr() ? entityplayer.func_184607_cu() : ItemStack.field_190927_a; diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index e8ed1d658..2d1bd570f 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -6,9 +6,9 @@ private static final AttributeModifier field_110157_c = (new AttributeModifier(field_110156_b, "Sprinting speed boost", (double)0.3F, 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); + public static final net.minecraft.entity.ai.attributes.IAttribute NAMETAG_DISTANCE = new net.minecraft.entity.ai.attributes.RangedAttribute(null, "forge.nameTagDistance", 64.0D, 0.0D, Float.MAX_VALUE).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); + 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); @@ -199,6 +201,8 @@ this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111263_d); this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188791_g); @@ -113,18 +113,18 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else if (this.field_70170_p.field_72995_K) { -@@ -789,8 +822,8 @@ - if (entity1 instanceof EntityPlayer) { +@@ -790,8 +823,8 @@ + if (entity1 instanceof EntityPlayer) { + this.field_70718_bc = 100; + this.field_70717_bb = (EntityPlayer)entity1; +- } else if (entity1 instanceof EntityWolf) { +- EntityWolf entitywolf = (EntityWolf)entity1; ++ } else if (entity1 instanceof net.minecraft.entity.passive.EntityTameable) { ++ net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity1; + if (entitywolf.func_70909_n()) { this.field_70718_bc = 100; - this.field_70717_bb = (EntityPlayer)entity1; -- } else if (entity1 instanceof EntityWolf) { -- EntityWolf entitywolf = (EntityWolf)entity1; -+ } else if (entity1 instanceof net.minecraft.entity.passive.EntityTameable) { -+ net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity1; - if (entitywolf.func_70909_n()) { - this.field_70718_bc = 100; - this.field_70717_bb = null; -@@ -938,11 +971,12 @@ + this.field_70717_bb = null; +@@ -941,11 +974,12 @@ } public void func_70669_a(ItemStack p_70669_1_) { @@ -138,7 +138,7 @@ if (!this.field_70729_aU) { Entity entity = p_70645_1_.func_76346_g(); EntityLivingBase entitylivingbase = this.func_94060_bK(); -@@ -957,15 +991,16 @@ +@@ -960,15 +994,16 @@ this.field_70729_aU = true; this.func_110142_aN().func_94549_h(); if (!this.field_70170_p.field_72995_K) { @@ -159,7 +159,7 @@ } this.field_70170_p.func_72960_a(this, (byte)3); -@@ -981,6 +1016,9 @@ +@@ -984,6 +1019,9 @@ } public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) { @@ -169,7 +169,7 @@ if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) { this.field_70160_al = true; float f = MathHelper.func_76133_a(p_70653_3_ * p_70653_3_ + p_70653_5_ * p_70653_5_); -@@ -1025,12 +1063,7 @@ +@@ -1028,12 +1066,7 @@ } else { BlockPos blockpos = new BlockPos(i, j, k); IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); @@ -183,7 +183,7 @@ } } -@@ -1050,6 +1083,9 @@ +@@ -1053,6 +1086,9 @@ } public void func_180430_e(float p_180430_1_, float p_180430_2_) { @@ -193,7 +193,7 @@ 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); -@@ -1062,7 +1098,7 @@ +@@ -1065,7 +1101,7 @@ int l = MathHelper.func_76128_c(this.field_70161_v); IBlockState iblockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l)); if (!iblockstate.func_196958_f()) { @@ -202,7 +202,7 @@ this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F); } } -@@ -1122,15 +1158,18 @@ +@@ -1134,6 +1170,8 @@ protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) { if (!this.func_180431_b(p_70665_1_)) { @@ -211,18 +211,20 @@ 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_)); +@@ -1144,10 +1182,11 @@ + ((EntityPlayerMP)p_70665_1_.func_76346_g()).func_195067_a(StatList.field_212735_F, Math.round(f1 * 10.0F)); + } + + 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_); + float f2 = this.func_110143_aJ(); +- this.func_70606_j(f2 - p_70665_2_); + this.func_110142_aN().func_94547_a(p_70665_1_, f2, 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_); } } -@@ -1172,6 +1211,8 @@ +@@ -1189,6 +1228,8 @@ } public void func_184609_a(EnumHand p_184609_1_) { @@ -231,10 +233,10 @@ if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) { this.field_110158_av = -1; this.field_82175_bq = true; -@@ -1356,18 +1397,18 @@ +@@ -1373,18 +1414,18 @@ double d12 = d6 + d10; AxisAlignedBB axisalignedbb1 = axisalignedbb.func_72317_d(d9, 0.0D, d10); - if (this.field_70170_p.func_195586_b((Entity)null, axisalignedbb1)) { + if (this.field_70170_p.func_195586_b(this, 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_195595_w(new BlockPos(d11, this.field_70163_u, d12))) { this.func_70634_a(d11, this.field_70163_u + 1.0D, d12); @@ -248,12 +250,12 @@ d13 = this.field_70163_u + 1.0D; d14 = d12; } -- } else if (this.field_70170_p.func_195586_b((Entity)null, 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_195586_b((Entity)null, axisalignedbb1.func_72317_d(0.0D, 1.0D, 0.0D)) && this.field_70170_p.func_195595_w(new BlockPos(d11, this.field_70163_u + 1.0D, d12))) { +- } else if (this.field_70170_p.func_195586_b(this, 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_195586_b(this, axisalignedbb1.func_72317_d(0.0D, 1.0D, 0.0D)) && this.field_70170_p.func_195595_w(new BlockPos(d11, this.field_70163_u + 1.0D, d12))) { d1 = d11; d13 = this.field_70163_u + 2.0D; d14 = d12; -@@ -1422,15 +1463,16 @@ +@@ -1439,15 +1480,16 @@ } this.field_70160_al = true; @@ -272,7 +274,7 @@ } protected float func_189749_co() { -@@ -1501,7 +1543,7 @@ +@@ -1518,7 +1560,7 @@ try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v)) { if (this.field_70122_E) { @@ -281,7 +283,7 @@ } float f8 = 0.16277137F / (f7 * f7 * f7); -@@ -1515,7 +1557,7 @@ +@@ -1532,7 +1574,7 @@ this.func_191958_b(p_191986_1_, p_191986_2_, p_191986_3_, f9); f7 = 0.91F; if (this.field_70122_E) { @@ -290,7 +292,7 @@ } if (this.func_70617_f_()) { -@@ -1646,6 +1688,7 @@ +@@ -1663,6 +1705,7 @@ } public void func_70071_h_() { @@ -298,7 +300,7 @@ super.func_70071_h_(); this.func_184608_ct(); this.func_205014_p(); -@@ -1677,7 +1720,9 @@ +@@ -1694,7 +1737,9 @@ ItemStack itemstack1 = this.func_184582_a(entityequipmentslot); if (!ItemStack.func_77989_b(itemstack1, itemstack)) { @@ -308,7 +310,7 @@ if (!itemstack.func_190926_b()) { this.func_110140_aT().func_111148_a(itemstack.func_111283_C(entityequipmentslot)); } -@@ -2117,11 +2162,18 @@ +@@ -2134,11 +2179,18 @@ protected void func_184608_ct() { if (this.func_184587_cr()) { if (this.func_184586_b(this.func_184600_cs()) == this.field_184627_bm) { @@ -328,7 +330,7 @@ this.func_71036_o(); } } else { -@@ -2155,8 +2207,10 @@ +@@ -2172,8 +2224,10 @@ public void func_184598_c(EnumHand p_184598_1_) { ItemStack itemstack = this.func_184586_b(p_184598_1_); if (!itemstack.func_190926_b() && !this.func_184587_cr()) { @@ -340,7 +342,7 @@ if (!this.field_70170_p.field_72995_K) { this.func_204802_c(1, true); this.func_204802_c(2, p_184598_1_ == EnumHand.OFF_HAND); -@@ -2212,6 +2266,9 @@ +@@ -2229,6 +2283,9 @@ vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F)); vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F)); vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v); @@ -350,7 +352,7 @@ this.field_70170_p.func_195594_a(new ItemParticleData(Particles.field_197591_B, p_195062_1_), 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); } -@@ -2220,7 +2277,9 @@ +@@ -2237,7 +2294,9 @@ protected void func_71036_o() { if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) { this.func_184584_a(this.field_184627_bm, 16); @@ -361,7 +363,7 @@ this.func_184602_cy(); } -@@ -2240,6 +2299,7 @@ +@@ -2257,6 +2316,7 @@ public void func_184597_cx() { if (!this.field_184627_bm.func_190926_b()) { @@ -369,7 +371,7 @@ this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv()); } -@@ -2346,4 +2406,60 @@ +@@ -2363,4 +2423,60 @@ @OnlyIn(Dist.CLIENT) public void func_191987_a(BlockPos p_191987_1_, boolean p_191987_2_) { } diff --git a/patches/minecraft/net/minecraft/entity/EntityType.java.patch b/patches/minecraft/net/minecraft/entity/EntityType.java.patch index 5469fbf68..a9c376a00 100644 --- a/patches/minecraft/net/minecraft/entity/EntityType.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityType.java.patch @@ -1,26 +1,15 @@ --- a/net/minecraft/entity/EntityType.java +++ b/net/minecraft/entity/EntityType.java -@@ -98,6 +98,7 @@ - import net.minecraft.entity.projectile.EntityTippedArrow; - import net.minecraft.entity.projectile.EntityTrident; - import net.minecraft.entity.projectile.EntityWitherSkull; -+import net.minecraft.item.Item; - import net.minecraft.item.ItemStack; - import net.minecraft.nbt.NBTTagCompound; - import net.minecraft.server.MinecraftServer; -@@ -121,9 +122,9 @@ +@@ -123,7 +123,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -public class EntityType { +public class EntityType extends net.minecraftforge.registries.ForgeRegistryEntry> { private static final Logger field_200731_aJ = LogManager.getLogger(); -- public static final RegistryNamespaced> field_200787_a = new RegistryNamespaced>(); -+ public static final RegistryNamespaced> field_200787_a = (RegistryNamespaced)net.minecraftforge.registries.GameData.getWrapper(EntityType.class); public static final EntityType field_200788_b = func_200712_a("area_effect_cloud", EntityType.Builder.func_201757_a(EntityAreaEffectCloud.class, EntityAreaEffectCloud::new)); public static final EntityType field_200789_c = func_200712_a("armor_stand", EntityType.Builder.func_201757_a(EntityArmorStand.class, EntityArmorStand::new)); - public static final EntityType field_200790_d = func_200712_a("arrow", EntityType.Builder.func_201757_a(EntityTippedArrow.class, EntityTippedArrow::new)); -@@ -375,15 +376,53 @@ +@@ -386,15 +386,53 @@ return p_200719_1_ == null ? null : p_200719_1_.func_200721_a(p_200719_0_); } @@ -74,7 +63,7 @@ } public static EntityType.Builder func_201757_a(Class p_201757_0_, Function p_201757_1_) { -@@ -406,12 +445,26 @@ +@@ -417,12 +455,26 @@ return this; } @@ -96,18 +85,18 @@ Type type = null; if (this.field_200710_b) { try { - type = DataFixesManager.func_210901_a().getSchema(DataFixUtils.makeKey(1519)).getChoiceType(TypeReferences.field_211298_n, p_206830_1_); + type = DataFixesManager.func_210901_a().getSchema(DataFixUtils.makeKey(1631)).getChoiceType(TypeReferences.field_211298_n, p_206830_1_); - } catch (IllegalStateException illegalstateexception) { + } catch (IllegalArgumentException illegalstateexception) { if (SharedConstants.field_206244_b) { throw illegalstateexception; } -@@ -420,7 +473,7 @@ +@@ -431,7 +483,7 @@ } } -- return new EntityType(this.field_201759_a, this.field_200709_a, this.field_200710_b, this.field_200711_c, type); -+ return new EntityType(this.field_201759_a, this.field_200709_a, this.field_200710_b, this.field_200711_c, type, useVanillaSpawning, customSpawnCallback, hasCustomTracking, trackingRange, updateFrequency, sendVelocityUpdates); +- return new EntityType<>(this.field_201759_a, this.field_200709_a, this.field_200710_b, this.field_200711_c, type); ++ return new EntityType<>(this.field_201759_a, this.field_200709_a, this.field_200710_b, this.field_200711_c, type, useVanillaSpawning, customSpawnCallback, hasCustomTracking, trackingRange, updateFrequency, sendVelocityUpdates); } } } diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch index 553eee5af..703b05250 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/boss/EntityDragon.java +++ b/net/minecraft/entity/boss/EntityDragon.java -@@ -415,10 +415,10 @@ +@@ -423,10 +423,10 @@ BlockPos blockpos = new BlockPos(k1, l1, i2); IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); Block block = iblockstate.func_177230_c(); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch index 6f87ffe24..aed24238d 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityArmorStand.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/entity/item/EntityArmorStand.java +++ b/net/minecraft/entity/item/EntityArmorStand.java @@ -54,7 +54,7 @@ - public static final DataParameter field_184806_f = EntityDataManager.func_187226_a(EntityArmorStand.class, DataSerializers.field_187199_i); - public static final DataParameter field_184807_g = EntityDataManager.func_187226_a(EntityArmorStand.class, DataSerializers.field_187199_i); + public static final DataParameter field_184806_f = EntityDataManager.func_187226_a(EntityArmorStand.class, DataSerializers.field_187199_i); + public static final DataParameter field_184807_g = EntityDataManager.func_187226_a(EntityArmorStand.class, DataSerializers.field_187199_i); private static final Predicate field_184798_bv = (p_200617_0_) -> { - return p_200617_0_ instanceof EntityMinecart && ((EntityMinecart)p_200617_0_).func_184264_v() == EntityMinecart.Type.RIDEABLE; + return p_200617_0_ instanceof EntityMinecart && ((EntityMinecart)p_200617_0_).canBeRidden(); }; - private final NonNullList field_184799_bw; - private final NonNullList field_184800_bx; + private final NonNullList field_184799_bw = NonNullList.func_191197_a(2, ItemStack.field_190927_a); + private final NonNullList field_184800_bx = NonNullList.func_191197_a(4, ItemStack.field_190927_a); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch index 4109bba05..5b7c8b510 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityBoat.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/entity/item/EntityBoat.java +++ b/net/minecraft/entity/item/EntityBoat.java -@@ -461,7 +461,7 @@ +@@ -460,7 +460,7 @@ blockpos$pooledmutableblockpos.func_181079_c(l1, k2, i2); IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos$pooledmutableblockpos); - if (!(iblockstate.func_177230_c() instanceof BlockLilyPad) && ShapeUtils.func_197879_c(iblockstate.func_196952_d(this.field_70170_p, blockpos$pooledmutableblockpos).func_197751_a((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.AND)) { + if (!(iblockstate.func_177230_c() instanceof BlockLilyPad) && VoxelShapes.func_197879_c(iblockstate.func_196952_d(this.field_70170_p, blockpos$pooledmutableblockpos).func_197751_a((double)l1, (double)k2, (double)i2), voxelshape, IBooleanFunction.AND)) { - f += iblockstate.func_177230_c().func_208618_m(); + f += iblockstate.getSlipperiness(field_70170_p, blockpos$pooledmutableblockpos, this); ++k1; } } -@@ -780,6 +780,20 @@ +@@ -779,6 +779,20 @@ this.field_184463_aC = p_184442_4_; } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index 7eb68fc2f..6c80456e3 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/EntityEnderPearl.java +++ b/net/minecraft/entity/item/EntityEnderPearl.java -@@ -74,6 +74,9 @@ +@@ -75,6 +75,9 @@ if (entitylivingbase instanceof EntityPlayerMP) { EntityPlayerMP entityplayermp = (EntityPlayerMP)entitylivingbase; if (entityplayermp.field_71135_a.func_147362_b().func_150724_d() && entityplayermp.field_70170_p == this.field_70170_p && !entityplayermp.func_70608_bn()) { @@ -10,7 +10,7 @@ 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); entityendermite.func_175496_a(true); -@@ -85,9 +88,10 @@ +@@ -86,9 +89,10 @@ entitylivingbase.func_184210_p(); } @@ -23,20 +23,19 @@ } } else if (entitylivingbase != null) { entitylivingbase.func_70634_a(this.field_70165_t, this.field_70163_u, this.field_70161_v); -@@ -109,12 +113,13 @@ +@@ -110,12 +114,13 @@ } + @Override @Nullable -- public Entity func_184204_a(int p_184204_1_) { -- if (this.field_70192_c.field_71093_bK != p_184204_1_) { -+ public Entity changeDimension(int dimensionIn, net.minecraftforge.common.util.ITeleporter teleporter) { -+ if (this.field_70192_c.field_71093_bK != dimensionIn) { +- public Entity func_212321_a(DimensionType p_212321_1_) { ++ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { + if (this.field_70192_c.field_71093_bK != p_212321_1_) { this.field_70192_c = null; } -- return super.func_184204_a(p_184204_1_); -+ return super.changeDimension(dimensionIn, teleporter); +- return super.func_212321_a(p_212321_1_); ++ return super.changeDimension(p_212321_1_, teleporter); } } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch index 6335d33cf..429491ed4 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/item/EntityFallingBlock.java +++ b/net/minecraft/entity/item/EntityFallingBlock.java -@@ -137,6 +137,7 @@ +@@ -133,6 +133,7 @@ } } else { IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos1); @@ -8,7 +8,7 @@ if (!flag1 && BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - (double)0.01F, this.field_70161_v)))) { this.field_70122_E = false; return; -@@ -153,7 +154,7 @@ +@@ -149,7 +150,7 @@ ((BlockFalling)block).func_176502_a_(this.field_70170_p, blockpos1, this.field_175132_d, iblockstate); } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch index 2f6650394..a993fc934 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -1,17 +1,17 @@ --- a/net/minecraft/entity/item/EntityItem.java +++ b/net/minecraft/entity/item/EntityItem.java @@ -34,6 +34,10 @@ + private int field_70291_e = 5; private UUID field_145801_f; private UUID 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 float field_70290_d = (float)(Math.random() * Math.PI * 2.0D); public EntityItem(World p_i1711_1_) { - super(EntityType.field_200765_E, p_i1711_1_); -@@ -54,6 +58,7 @@ +@@ -53,6 +57,7 @@ public EntityItem(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) { this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); this.func_92058_a(p_i1710_8_); @@ -19,7 +19,7 @@ } protected boolean func_70041_e_() { -@@ -65,6 +70,7 @@ +@@ -64,6 +69,7 @@ } public void func_70071_h_() { @@ -27,7 +27,7 @@ if (this.func_92059_d().func_190926_b()) { this.func_70106_y(); } else { -@@ -108,7 +114,8 @@ +@@ -107,7 +113,8 @@ float f = 0.98F; if (this.field_70122_E) { @@ -37,7 +37,7 @@ } this.field_70159_w *= (double)f; -@@ -133,7 +140,14 @@ +@@ -132,7 +139,14 @@ } } @@ -53,7 +53,7 @@ this.func_70106_y(); } -@@ -176,6 +190,8 @@ +@@ -175,6 +189,8 @@ return p_70289_1_.func_70289_a(this); } else if (itemstack1.func_190916_E() + itemstack.func_190916_E() > itemstack1.func_77976_d()) { return false; @@ -62,7 +62,7 @@ } else { itemstack1.func_190917_f(itemstack.func_190916_E()); p_70289_1_.field_145804_b = Math.max(p_70289_1_.field_145804_b, this.field_145804_b); -@@ -204,6 +220,7 @@ +@@ -203,6 +219,7 @@ } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { @@ -70,7 +70,7 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else if (!this.func_92059_d().func_190926_b() && this.func_92059_d().func_77973_b() == Items.field_151156_bN && p_70097_1_.func_94541_c()) { -@@ -223,6 +240,7 @@ +@@ -222,6 +239,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); @@ -78,7 +78,7 @@ if (this.func_200214_m() != null) { p_70014_1_.func_74782_a("Thrower", NBTUtil.func_186862_a(this.func_200214_m())); } -@@ -243,6 +261,7 @@ +@@ -242,6 +260,7 @@ if (p_70037_1_.func_74764_b("PickupDelay")) { this.field_145804_b = p_70037_1_.func_74765_d("PickupDelay"); } @@ -86,7 +86,7 @@ if (p_70037_1_.func_150297_b("Owner", 10)) { this.field_145802_g = NBTUtil.func_186860_b(p_70037_1_.func_74775_l("Owner")); -@@ -262,12 +281,20 @@ +@@ -261,12 +280,20 @@ public void func_70100_b_(EntityPlayer p_70100_1_) { if (!this.field_70170_p.field_72995_K) { @@ -109,20 +109,20 @@ this.func_70106_y(); itemstack.func_190920_e(i); } -@@ -287,9 +314,10 @@ +@@ -286,9 +313,10 @@ return false; } + @Override @Nullable -- public Entity func_184204_a(int p_184204_1_) { -- Entity entity = super.func_184204_a(p_184204_1_); -+ public Entity changeDimension(int dimensionIn, net.minecraftforge.common.util.ITeleporter teleporter) { -+ Entity entity = super.changeDimension(dimensionIn, teleporter); +- public Entity func_212321_a(DimensionType p_212321_1_) { +- Entity entity = super.func_212321_a(p_212321_1_); ++ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { ++ Entity entity = super.changeDimension(p_212321_1_, teleporter); if (!this.field_70170_p.field_72995_K && entity instanceof EntityItem) { ((EntityItem)entity).func_85054_d(); } -@@ -354,6 +382,6 @@ +@@ -353,6 +381,6 @@ public void func_174870_v() { this.func_174871_r(); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch index 4e9bcec0e..c3699dfb8 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch @@ -7,7 +7,7 @@ - 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.func_195950_a(p_110131_1_, this.field_70170_p); - mapdata.field_76203_h.remove("frame-" + this.func_145782_y()); + mapdata.func_212441_a(this.field_174861_a, this.func_145782_y()); } p_110131_1_.func_82842_a((EntityItemFrame)null); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index bfeab641d..ad4486b5f 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/entity/item/EntityMinecart.java +++ b/net/minecraft/entity/item/EntityMinecart.java -@@ -37,7 +37,7 @@ +@@ -38,7 +38,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public abstract class EntityMinecart extends Entity implements INameable { +public abstract class EntityMinecart extends Entity implements INameable, net.minecraftforge.common.extensions.IForgeEntityMinecart { - private static final DataParameter field_184265_a = EntityDataManager.func_187226_a(EntityMinecart.class, DataSerializers.field_187192_b); - private static final DataParameter field_184266_b = EntityDataManager.func_187226_a(EntityMinecart.class, DataSerializers.field_187192_b); - private static final DataParameter field_184267_c = EntityDataManager.func_187226_a(EntityMinecart.class, DataSerializers.field_187193_c); -@@ -58,6 +58,7 @@ + private static final DataParameter field_184265_a = EntityDataManager.func_187226_a(EntityMinecart.class, DataSerializers.field_187192_b); + private static final DataParameter field_184266_b = EntityDataManager.func_187226_a(EntityMinecart.class, DataSerializers.field_187192_b); + private static final DataParameter field_184267_c = EntityDataManager.func_187226_a(EntityMinecart.class, DataSerializers.field_187193_c); +@@ -59,6 +59,7 @@ private double field_70507_ar; @OnlyIn(Dist.CLIENT) private double field_70506_as; @@ -17,7 +17,7 @@ protected EntityMinecart(EntityType p_i48538_1_, World p_i48538_2_) { super(p_i48538_1_, p_i48538_2_); -@@ -110,11 +111,12 @@ +@@ -111,11 +112,12 @@ @Nullable public AxisAlignedBB func_70114_g(Entity p_70114_1_) { @@ -31,16 +31,16 @@ } public double func_70042_X() { -@@ -259,7 +261,7 @@ +@@ -260,7 +262,7 @@ - BlockPos blockpos = new BlockPos(k, l, i1); + BlockPos blockpos = new BlockPos(j, k, l); IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); - if (iblockstate.func_203425_a(BlockTags.field_203437_y)) { + if (canUseRail() && iblockstate.func_203425_a(BlockTags.field_203437_y)) { this.func_180460_a(blockpos, iblockstate); if (iblockstate.func_177230_c() == Blocks.field_150408_cc) { - this.func_96095_a(k, l, i1, iblockstate.func_177229_b(BlockRailPowered.field_176569_M)); -@@ -286,8 +288,11 @@ + this.func_96095_a(j, k, l, iblockstate.func_177229_b(BlockRailPowered.field_176569_M)); +@@ -287,8 +289,11 @@ } this.func_70101_b(this.field_70177_z, this.field_70125_A); @@ -52,9 +52,9 @@ + 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, box, EntitySelectors.func_200823_a(this)); if (!list.isEmpty()) { - for(int j1 = 0; j1 < list.size(); ++j1) { - Entity entity1 = list.get(j1); -@@ -299,7 +304,7 @@ + for(int i1 = 0; i1 < list.size(); ++i1) { + Entity entity1 = list.get(i1); +@@ -300,7 +305,7 @@ } } } else { @@ -63,7 +63,7 @@ if (!this.func_184196_w(entity) && entity.func_70104_M() && entity instanceof EntityMinecart) { entity.func_70108_f(this); } -@@ -307,6 +312,7 @@ +@@ -308,6 +313,7 @@ } this.func_70072_I(); @@ -71,7 +71,7 @@ } } -@@ -318,20 +324,30 @@ +@@ -319,20 +325,30 @@ } protected void func_180459_n() { @@ -107,12 +107,12 @@ } } -@@ -348,23 +364,23 @@ +@@ -349,23 +365,23 @@ flag1 = !flag; } - double d0 = 0.0078125D; -- RailShape railshape = (RailShape)p_180460_2_.func_177229_b(blockrailbase.func_176560_l()); +- RailShape railshape = p_180460_2_.func_177229_b(blockrailbase.func_176560_l()); + double slopeAdjustment = getSlopeAdjustment(); + RailShape railshape = ((BlockRailBase)p_180460_2_.func_177230_c()).getRailDirection(p_180460_2_, field_70170_p, p_180460_1_, this); switch(railshape) { @@ -137,7 +137,7 @@ ++this.field_70163_u; } -@@ -400,7 +416,7 @@ +@@ -401,7 +417,7 @@ } } @@ -146,7 +146,7 @@ double d17 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); if (d17 < 0.03D) { this.field_70159_w *= 0.0D; -@@ -435,17 +451,7 @@ +@@ -436,17 +452,7 @@ 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); @@ -165,7 +165,7 @@ 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); } else if (aint[1][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[1][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[1][2]) { -@@ -473,7 +479,10 @@ +@@ -474,7 +480,10 @@ this.field_70179_y = d5 * (double)(i - p_180460_1_.func_177952_p()); } @@ -177,25 +177,25 @@ double d15 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); if (d15 > 0.01D) { double d16 = 0.06D; -@@ -530,7 +539,7 @@ +@@ -531,7 +540,7 @@ IBlockState iblockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (iblockstate.func_203425_a(BlockTags.field_203437_y)) { -- RailShape railshape = (RailShape)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()); +- RailShape railshape = iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()); + RailShape railshape = ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(iblockstate, field_70170_p, new BlockPos(i, j, k), this); p_70495_3_ = (double)j; if (railshape.func_208092_c()) { p_70495_3_ = (double)(j + 1); -@@ -567,7 +576,7 @@ +@@ -568,7 +577,7 @@ IBlockState iblockstate = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)); if (iblockstate.func_203425_a(BlockTags.field_203437_y)) { -- RailShape railshape = (RailShape)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()); +- RailShape railshape = iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()); + RailShape railshape = ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(iblockstate, field_70170_p, new BlockPos(i, j, k), this); int[][] aint = field_70500_g[railshape.func_208091_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; -@@ -630,6 +639,11 @@ +@@ -631,6 +640,11 @@ } public void func_70108_f(Entity p_70108_1_) { @@ -207,7 +207,7 @@ if (!this.field_70170_p.field_72995_K) { if (!p_70108_1_.field_70145_X && !this.field_70145_X) { if (!this.func_184196_w(p_70108_1_)) { -@@ -665,13 +679,13 @@ +@@ -666,13 +680,13 @@ double d7 = p_70108_1_.field_70159_w + this.field_70159_w; double d8 = p_70108_1_.field_70179_y + this.field_70179_y; @@ -223,7 +223,7 @@ p_70108_1_.field_70159_w *= (double)0.2F; p_70108_1_.field_70179_y *= (double)0.2F; p_70108_1_.func_70024_g(this.field_70159_w + d0, 0.0D, this.field_70179_y + d1); -@@ -781,6 +795,32 @@ +@@ -782,6 +796,32 @@ this.func_184212_Q().func_187227_b(field_184270_f, p_94096_1_); } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch index 03a5b5c37..0f7081c3d 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -1,20 +1,20 @@ --- a/net/minecraft/entity/item/EntityMinecartContainer.java +++ b/net/minecraft/entity/item/EntityMinecartContainer.java -@@ -119,10 +119,11 @@ +@@ -120,10 +120,11 @@ return 64; } + @Override @Nullable -- public Entity func_184204_a(int p_184204_1_) { -+ public Entity changeDimension(int dimensionIn, net.minecraftforge.common.util.ITeleporter teleporter) { +- public Entity func_212321_a(DimensionType p_212321_1_) { ++ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { this.field_94112_b = false; -- return super.func_184204_a(p_184204_1_); -+ return super.changeDimension(dimensionIn, teleporter); +- return super.func_212321_a(p_212321_1_); ++ return super.changeDimension(p_212321_1_, teleporter); } public void func_70106_y() { -@@ -131,6 +132,7 @@ +@@ -132,6 +133,7 @@ } super.func_70106_y(); @@ -22,7 +22,7 @@ } public void func_184174_b(boolean p_184174_1_) { -@@ -163,6 +165,7 @@ +@@ -164,6 +166,7 @@ } public boolean func_184230_a(EntityPlayer p_184230_1_, EnumHand p_184230_2_) { @@ -30,7 +30,7 @@ if (!this.field_70170_p.field_72995_K) { p_184230_1_.func_71007_a(this); } -@@ -215,9 +218,9 @@ +@@ -216,9 +219,9 @@ random = new Random(this.field_184291_d); } @@ -42,7 +42,7 @@ } loottable.func_186460_a(this, random, lootcontext$builder.func_186471_a()); -@@ -238,4 +241,13 @@ +@@ -239,4 +242,13 @@ public ResourceLocation func_184276_b() { return this.field_184290_c; } diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch index 2fb811bd3..51abe22d7 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityEvoker.java.patch @@ -8,4 +8,4 @@ + } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(EntityEvoker.this.field_70170_p, EntityEvoker.this)) { return false; } else { - List list = EntityEvoker.this.field_70170_p.func_175647_a(EntitySheep.class, EntityEvoker.this.func_174813_aQ().func_72314_b(16.0D, 4.0D, 16.0D), this.field_190879_a); + List list = EntityEvoker.this.field_70170_p.func_175647_a(EntitySheep.class, EntityEvoker.this.func_174813_aQ().func_72314_b(16.0D, 4.0D, 16.0D), this.field_190879_a); diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch index 622b90418..27d1a7f59 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityIronGolem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/EntityIronGolem.java +++ b/net/minecraft/entity/monster/EntityIronGolem.java -@@ -231,7 +231,7 @@ +@@ -233,7 +233,7 @@ public void func_70645_a(DamageSource p_70645_1_) { if (!this.func_70850_q() && this.field_70717_bb != null && this.field_70857_d != null) { diff --git a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch index 470ff52c6..2d81d4249 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch @@ -10,7 +10,7 @@ float f1 = this.field_70146_Z.nextFloat() * 0.5F + 0.5F; @@ -255,7 +256,7 @@ - public boolean func_205020_a(IWorld p_205020_1_) { + public boolean func_205020_a(IWorld p_205020_1_, boolean p_205020_2_) { BlockPos blockpos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v)); - if (p_205020_1_.func_72912_H().func_76067_t() == WorldType.field_77138_c && this.field_70146_Z.nextInt(4) != 1) { + if (p_205020_1_.func_72912_H().func_76067_t().handleSlimeSpawnReduction(field_70146_Z, field_70170_p)) { diff --git a/patches/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch index 517973fec..a20e07f78 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntitySnowman.java.patch @@ -6,7 +6,7 @@ -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); + private static final DataParameter field_184749_a = EntityDataManager.func_187226_a(EntitySnowman.class, DataSerializers.field_187191_a); public EntitySnowman(World p_i1692_1_) { @@ -85,7 +85,7 @@ diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index 4f6ac7e63..b950752fe 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/monster/EntityZombie.java +++ b/net/minecraft/entity/monster/EntityZombie.java -@@ -109,7 +109,7 @@ +@@ -107,7 +107,7 @@ this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.23F); 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); @@ -9,7 +9,7 @@ } protected void func_70088_a() { -@@ -285,20 +285,25 @@ +@@ -284,20 +284,25 @@ entitylivingbase = (EntityLivingBase)p_70097_1_.func_76346_g(); } @@ -38,7 +38,7 @@ entityzombie.func_70624_b(entitylivingbase); entityzombie.func_204210_a(this.field_70170_p.func_175649_E(new BlockPos(entityzombie)), (IEntityLivingData)null, (NBTTagCompound)null); this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", (double)-0.05F, 0)); -@@ -406,7 +411,7 @@ +@@ -405,7 +410,7 @@ entityzombievillager.func_82149_j(entityvillager); this.field_70170_p.func_72900_e(entityvillager); entityzombievillager.func_204210_a(this.field_70170_p.func_175649_E(new BlockPos(entityzombievillager)), new EntityZombie.GroupData(false), (NBTTagCompound)null); @@ -47,7 +47,7 @@ entityzombievillager.func_82227_f(entityvillager.func_70631_g_()); entityzombievillager.func_94061_f(entityvillager.func_175446_cd()); if (entityvillager.func_145818_k_()) { -@@ -439,7 +444,7 @@ +@@ -438,7 +443,7 @@ float f = p_204210_1_.func_180170_c(); this.func_98053_h(this.field_70146_Z.nextFloat() < 0.55F * f); if (p_204210_2_ == null) { diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch index 21b1c669b..42818fd27 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch @@ -2,8 +2,8 @@ +++ b/net/minecraft/entity/passive/EntityHorse.java @@ -32,6 +32,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 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"}; diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch index b12314d66..047ab67dd 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -15,9 +15,9 @@ 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: Moved to onSheared - this.func_70106_y(); this.field_70170_p.func_195594_a(Particles.field_197627_t, 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); if (!this.field_70170_p.field_72995_K) { + this.func_70106_y(); @@ -69,4 +69,31 @@ protected ResourceLocation func_184647_J() { return LootTableList.field_186400_H; @@ -31,9 +31,9 @@ + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IWorld world, net.minecraft.util.math.BlockPos pos, int fortune) { + java.util.List ret = new java.util.ArrayList<>(); -+ this.func_70106_y(); + this.field_70170_p.func_195594_a(Particles.field_197627_t, 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); + if (!this.field_70170_p.field_72995_K) { ++ this.func_70106_y(); + 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()); diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch index 9c7861f20..f383ede54 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityParrot.java.patch @@ -13,8 +13,8 @@ int k = MathHelper.func_76128_c(this.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); Block block = p_205020_1_.func_180495_p(blockpos.func_177977_b()).func_177230_c(); -- return block instanceof BlockLeaves || block == Blocks.field_150349_c || block instanceof BlockLog || block == Blocks.field_150350_a && super.func_205020_a(p_205020_1_); -+ return block instanceof BlockLeaves || block == Blocks.field_196658_i || block instanceof BlockLog || block == Blocks.field_150350_a && super.func_205020_a(p_205020_1_); +- return block instanceof BlockLeaves || block == Blocks.field_150349_c || block instanceof BlockLog || block == Blocks.field_150350_a && super.func_205020_a(p_205020_1_, p_205020_2_); ++ return block instanceof BlockLeaves || block == Blocks.field_196658_i || block instanceof BlockLog || block == Blocks.field_150350_a && super.func_205020_a(p_205020_1_, p_205020_2_); } public void func_180430_e(float p_180430_1_, float p_180430_2_) { diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch index 436629631..e4c796f65 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityRabbit.java.patch @@ -4,8 +4,8 @@ int k = MathHelper.func_76128_c(this.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); Block block = p_205020_1_.func_180495_p(blockpos.func_177977_b()).func_177230_c(); -- return block != Blocks.field_150349_c && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_205020_a(p_205020_1_) : true; -+ return block != Blocks.field_196658_i && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_205020_a(p_205020_1_) : true; +- return block != Blocks.field_150349_c && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_205020_a(p_205020_1_, p_205020_2_) : true; ++ return block != Blocks.field_196658_i && block != Blocks.field_150433_aE && block != Blocks.field_150354_m ? super.func_205020_a(p_205020_1_, p_205020_2_) : true; } private boolean func_175534_cv() { diff --git a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch index 0629a3c45..857f67525 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -6,7 +6,7 @@ -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 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() { public boolean func_75145_c(EntityPlayer p_75145_1_) { @@ -214,7 +214,7 @@ diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch index 13e433faa..fc87d7c1c 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/passive/EntityVillager.java +++ b/net/minecraft/entity/passive/EntityVillager.java -@@ -105,7 +105,7 @@ +@@ -106,7 +106,7 @@ private boolean field_70959_by; private boolean field_175565_bs; private int field_70956_bz; @@ -161,7 +161,7 @@ - if (s != null) { + s = this.getProfessionForge().getCareer(this.field_175563_bv-1).getName(); - ITextComponent itextcomponent1 = (new TextComponentTranslation(this.func_200600_R().func_210760_d() + '.' + s, new Object[0])).func_211710_a((p_211520_1_) -> { + ITextComponent itextcomponent1 = (new TextComponentTranslation(this.func_200600_R().func_210760_d() + '.' + s)).func_211710_a((p_211520_1_) -> { p_211520_1_.func_150209_a(this.func_174823_aP()).func_179989_a(this.func_189512_bd()); }); @@ -576,9 +609,6 @@ diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index 34b967eb0..0468a18df 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -1,29 +1,28 @@ --- a/net/minecraft/entity/player/EntityPlayer.java +++ b/net/minecraft/entity/player/EntityPlayer.java -@@ -97,6 +97,11 @@ +@@ -98,6 +98,10 @@ import net.minecraftforge.api.distmarker.OnlyIn; public abstract class EntityPlayer extends EntityLivingBase { + public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; -+ protected java.util.HashMap spawnPosMap = new java.util.HashMap(); -+ protected java.util.HashMap spawnForcedMap = new java.util.HashMap(); ++ protected java.util.HashMap spawnPosMap = new java.util.HashMap<>(); ++ protected java.util.HashMap spawnForcedMap = new java.util.HashMap<>(); + 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); -@@ -143,6 +148,10 @@ + 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); +@@ -144,6 +148,10 @@ private final CooldownTracker field_184832_bU = this.func_184815_l(); @Nullable public EntityFishHook field_71104_cf; + private float eyeHeight = this.getDefaultEyeHeight(); -+ private int spawnDimension = 0; ++ private net.minecraft.world.dimension.DimensionType spawnDimension = net.minecraft.world.dimension.DimensionType.OVERWORLD; + private final java.util.Collection prefixes = new java.util.LinkedList(); + private final java.util.Collection suffixes = new java.util.LinkedList(); public EntityPlayer(World p_i45324_1_, GameProfile p_i45324_2_) { super(EntityType.field_200729_aH, p_i45324_1_); -@@ -161,6 +170,7 @@ +@@ -162,6 +170,7 @@ this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.1F); this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188790_f); this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188792_h); @@ -31,7 +30,7 @@ } protected void func_70088_a() { -@@ -174,6 +184,7 @@ +@@ -175,6 +184,7 @@ } public void func_70071_h_() { @@ -39,7 +38,7 @@ this.field_70145_X = this.func_175149_v(); if (this.func_175149_v()) { this.field_70122_E = false; -@@ -192,7 +203,7 @@ +@@ -193,7 +203,7 @@ if (!this.field_70170_p.field_72995_K) { if (!this.func_175143_p()) { this.func_70999_a(true, true, false); @@ -48,7 +47,7 @@ this.func_70999_a(false, true, true); } } -@@ -252,6 +263,7 @@ +@@ -253,6 +263,7 @@ this.func_203041_m(); this.field_184832_bU.func_185144_a(); this.func_184808_cD(); @@ -56,16 +55,7 @@ } protected boolean func_204229_de() { -@@ -420,6 +432,8 @@ - } - - public void func_70098_U() { -+ if (!this.field_70170_p.field_72995_K) -+ System.out.println(this.func_70093_af() + " " + this.func_184218_aH()); - if (!this.field_70170_p.field_72995_K && this.func_70093_af() && this.func_184218_aH()) { - this.func_184210_p(); - this.func_70095_a(false); -@@ -433,10 +447,10 @@ +@@ -434,10 +445,10 @@ this.field_71107_bF = this.field_71109_bG; 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); @@ -78,7 +68,7 @@ } } -@@ -555,10 +569,12 @@ +@@ -556,10 +567,12 @@ } public void func_70645_a(DamageSource p_70645_1_) { @@ -91,7 +81,7 @@ if ("Notch".equals(this.func_200200_C_().getString())) { this.func_146097_a(new ItemStack(Items.field_151034_e), true, false); } -@@ -568,6 +584,8 @@ +@@ -569,6 +582,8 @@ this.field_71071_by.func_70436_m(); } @@ -100,7 +90,7 @@ if (p_70645_1_ != null) { this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * ((float)Math.PI / 180F)) * 0.1F); this.field_70179_y = (double)(-MathHelper.func_76126_a((this.field_70739_aP + this.field_70177_z) * ((float)Math.PI / 180F)) * 0.1F); -@@ -607,12 +625,14 @@ +@@ -608,12 +623,14 @@ @Nullable public EntityItem func_71040_bB(boolean p_71040_1_) { @@ -117,7 +107,7 @@ } @Nullable -@@ -659,11 +679,18 @@ +@@ -660,11 +677,18 @@ } public ItemStack func_184816_a(EntityItem p_184816_1_) { @@ -136,7 +126,7 @@ float f = this.field_71071_by.func_184438_a(p_184813_1_); if (f > 1.0F) { int i = EnchantmentHelper.func_185293_e(this); -@@ -705,11 +732,12 @@ +@@ -706,11 +730,12 @@ f /= 5.0F; } @@ -150,22 +140,22 @@ } public void func_70037_a(NBTTagCompound p_70037_1_) { -@@ -739,6 +767,14 @@ +@@ -740,6 +765,14 @@ this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); } + p_70037_1_.func_150295_c("Spawns", 10).forEach(e -> { + NBTTagCompound data = (NBTTagCompound)e; -+ int dim = data.func_74762_e("Dim"); ++ ResourceLocation dim = new ResourceLocation(data.func_74779_i("Dim")); + this.spawnPosMap.put(dim, new BlockPos(data.func_74762_e("SpawnX"), data.func_74762_e("SpawnY"), data.func_74762_e("SpawnZ"))); + this.spawnForcedMap.put(dim, data.func_74767_n("DpawnForced")); + }); -+ this.spawnDimension = p_70037_1_.func_150297_b("SpawnDimension", 99) ? p_70037_1_.func_74762_e("SpawnDimension") : 0; ++ this.spawnDimension = net.minecraft.world.dimension.DimensionType.func_186069_a(p_70037_1_.func_150297_b("SpawnDimension", 99) ? p_70037_1_.func_74762_e("SpawnDimension") : 0); + this.field_71100_bB.func_75112_a(p_70037_1_); this.field_71075_bZ.func_75095_b(p_70037_1_); if (p_70037_1_.func_150297_b("EnderItems", 9)) { -@@ -785,9 +821,26 @@ +@@ -786,9 +819,26 @@ p_70014_1_.func_74782_a("ShoulderEntityRight", this.func_192025_dl()); } @@ -173,7 +163,7 @@ + spawnPosMap.forEach((dim, pos) -> { + if (pos != null) { + NBTTagCompound data = new NBTTagCompound(); -+ data.func_74768_a("Dim", dim); ++ data.func_74778_a("Dim", dim.toString()); + data.func_74768_a("SpawnX", pos.func_177958_n()); + data.func_74768_a("SpawnY", pos.func_177956_o()); + data.func_74768_a("SpawnZ", pos.func_177952_p()); @@ -182,8 +172,8 @@ + } + }); + p_70014_1_.func_74782_a("Spawns", spawnlist); -+ if (spawnDimension != 0) { -+ p_70014_1_.func_74768_a("SpawnDimension", spawnDimension); ++ if (spawnDimension != net.minecraft.world.dimension.DimensionType.OVERWORLD) { ++ p_70014_1_.func_74768_a("SpawnDimension", spawnDimension.func_186068_a()); + } } @@ -192,7 +182,7 @@ if (this.func_180431_b(p_70097_1_)) { return false; } else if (this.field_71075_bZ.field_75102_a && !p_70097_1_.func_76357_e()) { -@@ -823,7 +876,7 @@ +@@ -824,7 +874,7 @@ protected void func_190629_c(EntityLivingBase p_190629_1_) { super.func_190629_c(p_190629_1_); @@ -201,7 +191,7 @@ this.func_190777_m(true); } -@@ -844,11 +897,13 @@ +@@ -845,11 +895,13 @@ } protected void func_184590_k(float p_184590_1_) { @@ -216,7 +206,7 @@ if (enumhand == EnumHand.MAIN_HAND) { this.func_184201_a(EntityEquipmentSlot.MAINHAND, ItemStack.field_190927_a); } else { -@@ -876,11 +931,14 @@ +@@ -877,11 +929,14 @@ protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) { if (!this.func_180431_b(p_70665_1_)) { @@ -228,10 +218,10 @@ 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) { - this.func_71020_j(p_70665_1_.func_76345_d()); - float f1 = this.func_110143_aJ(); -@@ -929,6 +987,8 @@ + float f1 = f - p_70665_2_; + if (f1 > 0.0F && f1 < 3.4028235E37F) { + this.func_195067_a(StatList.field_212738_J, Math.round(f1 * 10.0F)); +@@ -935,6 +990,8 @@ return EnumActionResult.PASS; } else { @@ -240,7 +230,7 @@ ItemStack itemstack = this.func_184586_b(p_190775_2_); ItemStack itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.func_77946_l(); if (p_190775_1_.func_184230_a(this, p_190775_2_)) { -@@ -936,6 +996,10 @@ +@@ -942,6 +999,10 @@ itemstack.func_190920_e(itemstack1.func_190916_E()); } @@ -251,7 +241,7 @@ return EnumActionResult.SUCCESS; } else { if (!itemstack.func_190926_b() && p_190775_1_ instanceof EntityLivingBase) { -@@ -945,6 +1009,7 @@ +@@ -951,6 +1012,7 @@ if (itemstack.func_111282_a(this, (EntityLivingBase)p_190775_1_, p_190775_2_)) { if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) { @@ -259,7 +249,7 @@ this.func_184611_a(p_190775_2_, ItemStack.field_190927_a); } -@@ -967,6 +1032,7 @@ +@@ -973,6 +1035,7 @@ } public void func_71059_n(Entity p_71059_1_) { @@ -267,7 +257,7 @@ if (p_71059_1_.func_70075_an()) { if (!p_71059_1_.func_85031_j(this)) { float f = (float)this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111126_e(); -@@ -994,8 +1060,11 @@ +@@ -1000,8 +1063,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(); @@ -280,7 +270,7 @@ } f = f + f1; -@@ -1091,8 +1160,10 @@ +@@ -1097,8 +1163,10 @@ } if (!itemstack1.func_190926_b() && entity instanceof EntityLivingBase) { @@ -291,7 +281,7 @@ this.func_184611_a(EnumHand.MAIN_HAND, ItemStack.field_190927_a); } } -@@ -1134,7 +1205,7 @@ +@@ -1140,7 +1208,7 @@ } if (this.field_70146_Z.nextFloat() < f) { @@ -300,21 +290,20 @@ this.func_184602_cy(); this.field_70170_p.func_72960_a(this, (byte)30); } -@@ -1182,7 +1253,12 @@ +@@ -1188,7 +1256,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); +- 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.isBed(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) { if (this.func_70608_bn() || !this.func_70089_S()) { return EntityPlayer.SleepResult.OTHER_PROBLEM; -@@ -1192,7 +1268,7 @@ +@@ -1198,7 +1270,7 @@ return EntityPlayer.SleepResult.NOT_POSSIBLE_HERE; } @@ -323,7 +312,7 @@ return EntityPlayer.SleepResult.NOT_POSSIBLE_NOW; } -@@ -1217,7 +1293,7 @@ +@@ -1223,7 +1295,7 @@ this.func_192030_dh(); this.func_175145_a(StatList.field_199092_j.func_199076_b(StatList.field_203284_n)); this.func_70105_a(0.2F, 0.2F); @@ -332,7 +321,7 @@ 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); -@@ -1242,6 +1318,8 @@ +@@ -1248,6 +1320,8 @@ private boolean func_190774_a(BlockPos p_190774_1_, EnumFacing p_190774_2_) { if (Math.abs(this.field_70165_t - (double)p_190774_1_.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)p_190774_1_.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)p_190774_1_.func_177952_p()) <= 3.0D) { return true; @@ -341,7 +330,7 @@ } else { BlockPos blockpos = p_190774_1_.func_177972_a(p_190774_2_.func_176734_d()); return Math.abs(this.field_70165_t - (double)blockpos.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)blockpos.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)blockpos.func_177952_p()) <= 3.0D; -@@ -1254,16 +1332,19 @@ +@@ -1260,16 +1334,19 @@ } public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) { @@ -349,7 +338,7 @@ this.func_70105_a(0.6F, 1.8F); - IBlockState iblockstate = this.field_70170_p.func_180495_p(this.field_71081_bT); - if (this.field_71081_bT != null && iblockstate.func_177230_c() instanceof BlockBed) { -- this.field_70170_p.func_180501_a(this.field_71081_bT, (IBlockState)iblockstate.func_206870_a(BlockBed.field_176471_b, Boolean.valueOf(false)), 4); +- this.field_70170_p.func_180501_a(this.field_71081_bT, iblockstate.func_206870_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 iblockstate = field_71081_bT == null ? null : this.field_70170_p.func_180495_p(this.field_71081_bT); + if (this.field_71081_bT != null && iblockstate.isBed(field_70170_p, field_71081_bT, this)) { @@ -361,11 +350,11 @@ 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; ++ p_70999_3_ = false; } this.field_71083_bS = false; -@@ -1279,29 +1360,30 @@ +@@ -1285,29 +1362,30 @@ } private boolean func_175143_p() { @@ -396,13 +385,13 @@ @OnlyIn(Dist.CLIENT) public float func_71051_bG() { if (this.field_71081_bT != null) { -- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(this.field_71081_bT).func_177229_b(BlockHorizontal.field_185512_D); +- EnumFacing enumfacing = this.field_70170_p.func_180495_p(this.field_71081_bT).func_177229_b(BlockHorizontal.field_185512_D); + IBlockState state = this.field_70170_p.func_180495_p(this.field_71081_bT); + EnumFacing enumfacing = !state.isBed(field_70170_p, field_71081_bT, this) ? EnumFacing.UP : state.getBedDirection(field_70170_p, field_71081_bT); switch(enumfacing) { case SOUTH: return 90.0F; -@@ -1333,23 +1415,67 @@ +@@ -1339,23 +1417,67 @@ public void func_146105_b(ITextComponent p_146105_1_, boolean p_146105_2_) { } @@ -417,8 +406,8 @@ + * @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 dim) { -+ return dim == 0 ? field_71081_bT : spawnPosMap.get(dim); ++ public BlockPos getBedLocation(net.minecraft.world.dimension.DimensionType dim) { ++ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_71081_bT : spawnPosMap.get(dim); + } + + @Deprecated //Forge: Use Dimension sensitive version @@ -434,8 +423,8 @@ + * @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 dim) { -+ return dim == 0 ? field_82248_d : spawnForcedMap.getOrDefault(dim, false); ++ public boolean isSpawnForced(net.minecraft.world.dimension.DimensionType dim) { ++ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_82248_d : spawnForcedMap.getOrDefault(dim, false); + } + + @Deprecated //Forge: Use Dimension sensitive version @@ -457,15 +446,15 @@ + * @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 setSpawnPoint(BlockPos pos, boolean forced, int dim) { ++ public void setSpawnPoint(BlockPos pos, boolean forced, net.minecraft.world.dimension.DimensionType dim) { + if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, pos, forced)) return; -+ if (dim != 0) { ++ if (dim != net.minecraft.world.dimension.DimensionType.OVERWORLD) { + if (pos == null) { -+ spawnPosMap.remove(dim); -+ spawnForcedMap.remove(dim); ++ spawnPosMap.remove(dim.getRegistryName()); ++ spawnForcedMap.remove(dim.getRegistryName()); + } else { -+ spawnPosMap.put(dim, pos); -+ spawnForcedMap.put(dim, forced); ++ spawnPosMap.put(dim.getRegistryName(), pos); ++ spawnForcedMap.put(dim.getRegistryName(), forced); + } + return; + } @@ -479,7 +468,7 @@ } public void func_195066_a(ResourceLocation p_195066_1_) { -@@ -1519,6 +1645,8 @@ +@@ -1525,6 +1647,8 @@ } super.func_180430_e(p_180430_1_, p_180430_2_); @@ -488,7 +477,7 @@ } } -@@ -1780,7 +1908,10 @@ +@@ -1786,7 +1910,10 @@ } public ITextComponent func_145748_c_() { @@ -500,7 +489,7 @@ return this.func_208016_c(itextcomponent); } -@@ -1800,7 +1931,7 @@ +@@ -1806,7 +1933,7 @@ } public float func_70047_e() { @@ -509,7 +498,7 @@ if (this.func_70608_bn()) { f = 0.2F; } else if (!this.func_203007_ba() && !this.func_184613_cA() && this.field_70131_O != 0.6F) { -@@ -1967,6 +2098,30 @@ +@@ -1973,6 +2100,30 @@ return this.field_71075_bZ.field_75098_d && this.func_184840_I() >= 2; } @@ -521,11 +510,11 @@ + return 1.62F; + } + -+ public int getSpawnDimension() { ++ public net.minecraft.world.dimension.DimensionType getSpawnDimension() { + return this.spawnDimension; + } + -+ public void setSpawnDimenion(int dim) { ++ public void setSpawnDimenion(net.minecraft.world.dimension.DimensionType dim) { + this.spawnDimension = dim; + } + diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index 9a42413bd..6127eb114 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/entity/player/EntityPlayerMP.java +++ b/net/minecraft/entity/player/EntityPlayerMP.java -@@ -418,6 +418,7 @@ +@@ -420,6 +420,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)); if (flag) { -@@ -435,8 +436,10 @@ + ITextComponent itextcomponent = this.func_110142_aN().func_151521_b(); +@@ -451,8 +452,10 @@ this.func_192030_dh(); if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory") && !this.func_175149_v()) { @@ -18,37 +18,38 @@ + if (!field_70170_p.field_72995_K) net.minecraftforge.event.ForgeEventFactory.onPlayerDrops(this, p_70645_1_, captureDrops(null), field_70718_bc > 0); } - this.func_96123_co().func_197893_a(IScoreCriteria.field_96642_c, this.func_195047_I_(), Score::func_96648_a); -@@ -521,7 +524,9 @@ + this.func_96123_co().func_197893_a(ScoreCriteria.field_96642_c, this.func_195047_I_(), Score::func_96648_a); +@@ -537,8 +540,10 @@ + return this.field_71133_b.func_71219_W(); } - @Nullable -- public Entity func_184204_a(int p_184204_1_) { + @Override -+ public Entity changeDimension(int p_184204_1_, net.minecraftforge.common.util.ITeleporter teleporter) { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return null; + @Nullable +- public Entity func_212321_a(DimensionType p_212321_1_) { ++ public Entity changeDimension(DimensionType p_212321_1_, net.minecraftforge.common.util.ITeleporter teleporter) { ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_212321_1_)) return null; this.field_184851_cj = true; - if (this.field_71093_bK == 0 && p_184204_1_ == -1) { + if (this.field_71093_bK == DimensionType.OVERWORLD && p_212321_1_ == DimensionType.NETHER) { this.field_193110_cw = new Vec3d(this.field_70165_t, this.field_70163_u, this.field_70161_v); -@@ -529,7 +534,7 @@ +@@ -546,7 +551,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()) { +- if (this.field_71093_bK == DimensionType.THE_END && p_212321_1_ == DimensionType.THE_END) { ++ if (this.field_71093_bK == DimensionType.THE_END && p_212321_1_ == DimensionType.THE_END && teleporter.isVanilla()) { this.field_70170_p.func_72900_e(this); if (!this.field_71136_j) { this.field_71136_j = true; -@@ -543,7 +548,7 @@ - p_184204_1_ = 1; +@@ -560,7 +565,7 @@ + p_212321_1_ = DimensionType.THE_END; } -- this.field_71133_b.func_184103_al().func_187242_a(this, p_184204_1_); -+ this.field_71133_b.func_184103_al().changePlayerDimension(this, p_184204_1_, teleporter); +- this.field_71133_b.func_184103_al().func_187242_a(this, p_212321_1_); ++ this.field_71133_b.func_184103_al().changePlayerDimension(this, p_212321_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; -@@ -645,7 +650,7 @@ +@@ -662,7 +667,7 @@ int k = MathHelper.func_76128_c(this.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); @@ -57,7 +58,7 @@ BlockPos blockpos1 = blockpos.func_177977_b(); IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1); Block block = iblockstate1.func_177230_c(); -@@ -676,6 +681,7 @@ +@@ -693,6 +698,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); @@ -65,7 +66,7 @@ } } -@@ -707,6 +713,7 @@ +@@ -724,6 +730,7 @@ this.field_71070_bA.field_75152_c = this.field_71139_cq; this.field_71070_bA.func_75132_a(this); @@ -73,7 +74,7 @@ } } -@@ -715,6 +722,7 @@ +@@ -732,6 +739,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); @@ -81,7 +82,7 @@ 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_())); -@@ -738,6 +746,7 @@ +@@ -755,6 +763,7 @@ this.field_71070_bA = new ContainerHorseInventory(this.field_71071_by, p_184826_2_, p_184826_1_, this); this.field_71070_bA.field_75152_c = this.field_71139_cq; this.field_71070_bA.func_75132_a(this); @@ -89,7 +90,7 @@ } public void func_184814_a(ItemStack p_184814_1_, EnumHand p_184814_2_) { -@@ -800,6 +809,7 @@ +@@ -817,6 +826,7 @@ public void func_71128_l() { this.field_71070_bA.func_75134_a(this); @@ -97,14 +98,14 @@ this.field_71070_bA = this.field_71069_bz; } -@@ -929,6 +939,20 @@ +@@ -946,6 +956,20 @@ 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.spawnPosMap = p_193104_1_.spawnPosMap; + this.spawnForcedMap = p_193104_1_.spawnForcedMap; -+ if(p_193104_1_.field_71093_bK != 0) { ++ if(p_193104_1_.field_71093_bK != net.minecraft.world.dimension.DimensionType.OVERWORLD) { + this.field_71077_c = p_193104_1_.field_71077_c; + this.field_82248_d = p_193104_1_.field_82248_d; + } diff --git a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index bbce03ae2..109aa69f4 100644 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/player/InventoryPlayer.java +++ b/net/minecraft/entity/player/InventoryPlayer.java -@@ -216,7 +216,8 @@ +@@ -214,7 +214,8 @@ int i = p_191973_2_.func_190916_E(); ItemStack itemstack = this.func_70301_a(p_191973_1_); if (itemstack.func_190926_b()) { @@ -10,7 +10,7 @@ if (p_191973_2_.func_77942_o()) { itemstack.func_77982_d(p_191973_2_.func_77978_p().func_74737_b()); } -@@ -267,7 +268,7 @@ +@@ -265,7 +266,7 @@ } } } @@ -19,7 +19,7 @@ } public boolean func_70441_a(ItemStack p_70441_1_) { -@@ -320,6 +321,8 @@ +@@ -318,6 +319,8 @@ } catch (Throwable throwable) { CrashReport crashreport = CrashReport.func_85055_a(throwable, "Adding item to inventory"); CrashReportCategory crashreportcategory = crashreport.func_85058_a("Item being added"); diff --git a/patches/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch index 01f1696f8..98db4111e 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/EntityArrow.java.patch @@ -9,7 +9,7 @@ VoxelShape voxelshape = iblockstate.func_196952_d(this.field_70170_p, blockpos); if (!voxelshape.func_197766_b()) { for(AxisAlignedBB axisalignedbb : voxelshape.func_197756_d()) { -@@ -222,7 +222,7 @@ +@@ -223,7 +223,7 @@ } } @@ -18,7 +18,7 @@ this.func_184549_a(raytraceresult); this.field_70160_al = true; } -@@ -313,7 +313,7 @@ +@@ -314,7 +314,7 @@ this.field_70254_i = true; this.field_70249_b = 7; this.func_70243_d(false); diff --git a/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch index 504d6a1bb..42d47fb48 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/projectile/EntityFishHook.java +++ b/net/minecraft/entity/projectile/EntityFishHook.java -@@ -235,8 +235,8 @@ +@@ -234,8 +234,8 @@ private boolean func_190625_o() { ItemStack itemstack = this.field_146042_b.func_184614_ca(); ItemStack itemstack1 = this.field_146042_b.func_184592_cb(); @@ -11,7 +11,7 @@ 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)) { return false; } else { -@@ -346,8 +346,7 @@ +@@ -345,8 +345,7 @@ 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); @@ -21,7 +21,7 @@ if (this.field_70146_Z.nextFloat() < 0.15F) { worldserver.func_195598_a(Particles.field_197612_e, d0, d1 - (double)0.1F, d2, 1, (double)f1, 0.1D, (double)f2, 0.0D); } -@@ -382,8 +381,7 @@ +@@ -381,8 +380,7 @@ 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); @@ -31,7 +31,7 @@ worldserver.func_195598_a(Particles.field_197606_Q, d4, d5, d6, 2 + this.field_70146_Z.nextInt(2), (double)0.1F, 0.0D, (double)0.1F, 0.0D); } } -@@ -412,6 +410,7 @@ +@@ -411,6 +409,7 @@ public int func_146034_e(ItemStack p_146034_1_) { if (!this.field_70170_p.field_72995_K && this.field_146042_b != null) { int i = 0; @@ -39,7 +39,7 @@ if (this.field_146043_c != null) { this.func_184527_k(); CriteriaTriggers.field_204811_D.func_204820_a((EntityPlayerMP)this.field_146042_b, p_146034_1_, this, Collections.emptyList()); -@@ -420,7 +419,14 @@ +@@ -419,7 +418,14 @@ } else if (this.field_146045_ax > 0) { LootContext.Builder lootcontext$builder = (new LootContext.Builder((WorldServer)this.field_70170_p)).func_204313_a(new BlockPos(this)); lootcontext$builder.func_186469_a((float)this.field_191518_aw + this.field_146042_b.func_184817_da()); @@ -54,7 +54,7 @@ CriteriaTriggers.field_204811_D.func_204820_a((EntityPlayerMP)this.field_146042_b, p_146034_1_, this, list); for(ItemStack itemstack : list) { -@@ -448,7 +454,7 @@ +@@ -447,7 +453,7 @@ } this.func_70106_y(); diff --git a/patches/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch index 819e81fc8..68a2726ff 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/EntityThrowable.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/entity/projectile/EntityThrowable.java +++ b/net/minecraft/entity/projectile/EntityThrowable.java -@@ -181,7 +181,7 @@ +@@ -178,7 +178,7 @@ if (raytraceresult != null) { if (raytraceresult.field_72313_a == RayTraceResult.Type.BLOCK && this.field_70170_p.func_180495_p(raytraceresult.func_178782_a()).func_177230_c() == Blocks.field_150427_aO) { this.func_181015_d(raytraceresult.func_178782_a()); diff --git a/patches/minecraft/net/minecraft/fluid/Fluid.java.patch b/patches/minecraft/net/minecraft/fluid/Fluid.java.patch index f2ea69f51..3681b6acc 100644 --- a/patches/minecraft/net/minecraft/fluid/Fluid.java.patch +++ b/patches/minecraft/net/minecraft/fluid/Fluid.java.patch @@ -6,6 +6,6 @@ -public abstract class Fluid { +public abstract class Fluid implements net.minecraftforge.common.extensions.IForgeFluid { - private static final ResourceLocation field_207199_a = new ResourceLocation("empty"); - public static final RegistryNamespacedDefaultedByKey field_205588_a = new RegistryNamespacedDefaultedByKey(field_207199_a); - public static final ObjectIntIdentityMap field_207201_d = new ObjectIntIdentityMap(); + public static final ObjectIntIdentityMap field_207201_d = new ObjectIntIdentityMap<>(); + protected final StateContainer field_207202_e; + private IFluidState field_207200_b; diff --git a/patches/minecraft/net/minecraft/init/Biomes.java.patch b/patches/minecraft/net/minecraft/init/Biomes.java.patch index 91a2e48d1..1a1dfb512 100644 --- a/patches/minecraft/net/minecraft/init/Biomes.java.patch +++ b/patches/minecraft/net/minecraft/init/Biomes.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/init/Biomes.java +++ b/net/minecraft/init/Biomes.java -@@ -3,6 +3,7 @@ - import net.minecraft.util.ResourceLocation; +@@ -4,6 +4,7 @@ + import net.minecraft.util.registry.IRegistry; import net.minecraft.world.biome.Biome; +@net.minecraftforge.registries.ObjectHolder("minecraft") diff --git a/patches/minecraft/net/minecraft/init/Blocks.java.patch b/patches/minecraft/net/minecraft/init/Blocks.java.patch index 89a2b75f6..a13b4c927 100644 --- a/patches/minecraft/net/minecraft/init/Blocks.java.patch +++ b/patches/minecraft/net/minecraft/init/Blocks.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/init/Blocks.java +++ b/net/minecraft/init/Blocks.java -@@ -5,6 +5,7 @@ - import net.minecraft.block.Block; +@@ -6,6 +6,7 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class Blocks { diff --git a/patches/minecraft/net/minecraft/init/Bootstrap.java.patch b/patches/minecraft/net/minecraft/init/Bootstrap.java.patch index 95a153a84..bd7ea528c 100644 --- a/patches/minecraft/net/minecraft/init/Bootstrap.java.patch +++ b/patches/minecraft/net/minecraft/init/Bootstrap.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/init/Bootstrap.java +++ b/net/minecraft/init/Bootstrap.java -@@ -75,6 +75,7 @@ - import net.minecraft.world.biome.Biome; +@@ -79,6 +79,7 @@ + import net.minecraft.world.gen.ChunkGeneratorType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -248,6 +249,9 @@ +@@ -252,6 +253,9 @@ BlockDispenser.func_199774_a(Items.field_203797_aN, ibehaviordispenseitem); BlockDispenser.func_199774_a(Items.field_203795_aL, ibehaviordispenseitem); BlockDispenser.func_199774_a(Items.field_204272_aO, ibehaviordispenseitem); @@ -18,16 +18,11 @@ BlockDispenser.func_199774_a(Items.field_151133_ar, new BehaviorDefaultDispenseItem() { private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); -@@ -419,8 +423,12 @@ - func_210839_a("entity", EntityType.field_200787_a, EntityType::func_210760_d); +@@ -429,6 +433,7 @@ + func_210839_a("entity", IRegistry.field_212629_r, EntityType::func_210760_d); } + if (false) // skip redirectOutputToLog, Forge already redirects stdout and stderr output to log so that they print with more context func_179868_d(); } -+ net.minecraftforge.registries.ForgeRegistries.ITEMS.getClass(); // TODO figure out a better way to ensure these are initialized -+ net.minecraft.tileentity.TileEntityType.field_200970_a.getClass(); -+ net.minecraftforge.registries.GameData.vanillaSnapshot(); } - } - diff --git a/patches/minecraft/net/minecraft/init/Enchantments.java.patch b/patches/minecraft/net/minecraft/init/Enchantments.java.patch index 741660882..55e4d5666 100644 --- a/patches/minecraft/net/minecraft/init/Enchantments.java.patch +++ b/patches/minecraft/net/minecraft/init/Enchantments.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/init/Enchantments.java +++ b/net/minecraft/init/Enchantments.java -@@ -4,6 +4,7 @@ - import net.minecraft.enchantment.Enchantment; +@@ -5,6 +5,7 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class Enchantments { diff --git a/patches/minecraft/net/minecraft/init/Items.java.patch b/patches/minecraft/net/minecraft/init/Items.java.patch index 01a6f60fc..6db65d5f1 100644 --- a/patches/minecraft/net/minecraft/init/Items.java.patch +++ b/patches/minecraft/net/minecraft/init/Items.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/init/Items.java +++ b/net/minecraft/init/Items.java -@@ -3,6 +3,7 @@ - import net.minecraft.item.Item; +@@ -4,6 +4,7 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class Items { diff --git a/patches/minecraft/net/minecraft/init/MobEffects.java.patch b/patches/minecraft/net/minecraft/init/MobEffects.java.patch index bd1d58262..fbdd7c04b 100644 --- a/patches/minecraft/net/minecraft/init/MobEffects.java.patch +++ b/patches/minecraft/net/minecraft/init/MobEffects.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/init/MobEffects.java +++ b/net/minecraft/init/MobEffects.java -@@ -4,6 +4,7 @@ - import net.minecraft.potion.Potion; +@@ -5,6 +5,7 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class MobEffects { diff --git a/patches/minecraft/net/minecraft/init/Particles.java.patch b/patches/minecraft/net/minecraft/init/Particles.java.patch index 4ae3a14fb..63e3f9029 100644 --- a/patches/minecraft/net/minecraft/init/Particles.java.patch +++ b/patches/minecraft/net/minecraft/init/Particles.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/init/Particles.java +++ b/net/minecraft/init/Particles.java -@@ -7,6 +7,7 @@ - import net.minecraft.particles.RedstoneParticleData; +@@ -8,6 +8,7 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class Particles { diff --git a/patches/minecraft/net/minecraft/init/PotionTypes.java.patch b/patches/minecraft/net/minecraft/init/PotionTypes.java.patch index 0bfea991a..7454ba0b1 100644 --- a/patches/minecraft/net/minecraft/init/PotionTypes.java.patch +++ b/patches/minecraft/net/minecraft/init/PotionTypes.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/init/PotionTypes.java +++ b/net/minecraft/init/PotionTypes.java -@@ -5,6 +5,7 @@ - import net.minecraft.potion.PotionType; +@@ -6,6 +6,7 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class PotionTypes { diff --git a/patches/minecraft/net/minecraft/init/SoundEvents.java.patch b/patches/minecraft/net/minecraft/init/SoundEvents.java.patch index b517fad3d..e03fc452e 100644 --- a/patches/minecraft/net/minecraft/init/SoundEvents.java.patch +++ b/patches/minecraft/net/minecraft/init/SoundEvents.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/init/SoundEvents.java +++ b/net/minecraft/init/SoundEvents.java -@@ -3,6 +3,7 @@ - import net.minecraft.util.ResourceLocation; +@@ -4,6 +4,7 @@ import net.minecraft.util.SoundEvent; + import net.minecraft.util.registry.IRegistry; +@net.minecraftforge.registries.ObjectHolder("minecraft") public class SoundEvents { diff --git a/patches/minecraft/net/minecraft/inventory/Container.java.patch b/patches/minecraft/net/minecraft/inventory/Container.java.patch index b331280e0..a29afa2db 100644 --- a/patches/minecraft/net/minecraft/inventory/Container.java.patch +++ b/patches/minecraft/net/minecraft/inventory/Container.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/inventory/Container.java +++ b/net/minecraft/inventory/Container.java @@ -67,9 +67,11 @@ - ItemStack itemstack = ((Slot)this.field_75151_b.get(i)).func_75211_c(); + ItemStack itemstack = this.field_75151_b.get(i).func_75211_c(); ItemStack itemstack1 = this.field_75153_a.get(i); if (!ItemStack.func_77989_b(itemstack1, itemstack)) { + boolean clientStackChanged = !itemstack1.equals(itemstack, true); @@ -10,7 +10,7 @@ + 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); + this.field_75149_d.get(j).func_71111_a(this, i, itemstack1); } @@ -430,14 +432,15 @@ ItemStack itemstack = slot.func_75211_c(); diff --git a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch index 39d7a1083..36b61666c 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/inventory/ContainerEnchantment.java +++ b/net/minecraft/inventory/ContainerEnchantment.java -@@ -66,7 +66,7 @@ +@@ -61,7 +61,7 @@ }); this.func_75146_a(new Slot(this.field_75168_e, 1, 35, 47) { public boolean func_75214_a(ItemStack p_75214_1_) { @@ -9,7 +9,7 @@ } }); -@@ -126,40 +126,29 @@ +@@ -121,40 +121,29 @@ } @@ -61,7 +61,7 @@ } } } -@@ -168,12 +157,13 @@ +@@ -163,12 +152,13 @@ this.field_75169_l.setSeed((long)this.field_178149_f); for(int i1 = 0; i1 < 3; ++i1) { @@ -76,15 +76,15 @@ } for(int j1 = 0; j1 < 3; ++j1) { -@@ -305,9 +295,8 @@ +@@ -300,9 +290,8 @@ return ItemStack.field_190927_a; } - if (itemstack1.func_77942_o() && itemstack1.func_190916_E() == 1) { -- ((Slot)this.field_75151_b.get(0)).func_75215_d(itemstack1.func_77946_l()); +- this.field_75151_b.get(0).func_75215_d(itemstack1.func_77946_l()); - itemstack1.func_190920_e(0); + if (itemstack1.func_77942_o()) { // Forge: Fix MC-17431 + ((Slot)this.field_75151_b.get(0)).func_75215_d(itemstack1.func_77979_a(1)); } else if (!itemstack1.func_190926_b()) { - ((Slot)this.field_75151_b.get(0)).func_75215_d(new ItemStack(itemstack1.func_77973_b())); + this.field_75151_b.get(0).func_75215_d(new ItemStack(itemstack1.func_77973_b())); itemstack1.func_190918_g(1); diff --git a/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch index 259cea148..c971d08bd 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerFurnace.java.patch @@ -1,13 +1,13 @@ --- a/net/minecraft/inventory/ContainerFurnace.java +++ b/net/minecraft/inventory/ContainerFurnace.java -@@ -161,8 +161,8 @@ +@@ -160,8 +160,8 @@ } private boolean func_206253_a(ItemStack p_206253_1_) { - for(IRecipe irecipe : this.field_201773_f.func_199532_z().func_199510_b()) { -- if (irecipe instanceof FurnaceRecipe && ((Ingredient)irecipe.func_192400_c().get(0)).test(p_206253_1_)) { +- if (irecipe instanceof FurnaceRecipe && irecipe.func_192400_c().get(0).test(p_206253_1_)) { + for(IRecipe irecipe : this.field_201773_f.func_199532_z().getRecipes(net.minecraftforge.common.crafting.VanillaRecipeTypes.SMELTING)) { -+ if (((Ingredient)irecipe.func_192400_c().get(0)).test(p_206253_1_)) { ++ if (irecipe.func_192400_c().get(0).test(p_206253_1_)) { return true; } } diff --git a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch index 1abe0912f..aa67a0ce5 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/inventory/ContainerRepair.java +++ b/net/minecraft/inventory/ContainerRepair.java -@@ -63,6 +63,8 @@ +@@ -61,6 +61,8 @@ p_190901_1_.func_82242_a(-ContainerRepair.this.field_82854_e); } @@ -9,7 +9,7 @@ ContainerRepair.this.field_82853_g.func_70299_a(0, ItemStack.field_190927_a); if (ContainerRepair.this.field_82856_l > 0) { ItemStack itemstack = ContainerRepair.this.field_82853_g.func_70301_a(1); -@@ -79,7 +81,7 @@ +@@ -77,7 +79,7 @@ ContainerRepair.this.field_82854_e = 0; IBlockState iblockstate1 = p_i45807_2_.func_180495_p(p_i45807_3_); if (!p_i45807_2_.field_72995_K) { @@ -18,7 +18,7 @@ IBlockState iblockstate = BlockAnvil.func_196433_f(iblockstate1); if (iblockstate == null) { p_i45807_2_.func_175698_g(p_i45807_3_); -@@ -132,8 +134,11 @@ +@@ -130,8 +132,11 @@ 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; @@ -31,7 +31,7 @@ if (itemstack1.func_77984_f() && itemstack1.func_77973_b().func_82789_a(itemstack, itemstack2)) { int l2 = Math.min(itemstack1.func_77952_i(), itemstack1.func_77958_k() / 4); if (l2 <= 0) { -@@ -250,6 +255,7 @@ +@@ -248,6 +253,7 @@ i += k; itemstack1.func_200302_a(new TextComponentString(this.field_82857_m)); } diff --git a/patches/minecraft/net/minecraft/item/EnumDyeColor.java.patch b/patches/minecraft/net/minecraft/item/EnumDyeColor.java.patch index fed2e7b66..b9ba1a3a5 100644 --- a/patches/minecraft/net/minecraft/item/EnumDyeColor.java.patch +++ b/patches/minecraft/net/minecraft/item/EnumDyeColor.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/item/EnumDyeColor.java +++ b/net/minecraft/item/EnumDyeColor.java -@@ -44,6 +44,7 @@ +@@ -43,6 +43,7 @@ private final int field_196066_w; private final float[] field_193352_x; private final int field_196067_y; + private final net.minecraft.tags.Tag tag; - private EnumDyeColor(int p_i47810_3_, String p_i47810_4_, int p_i47810_5_, MapColor p_i47810_6_, int p_i47810_7_) { + private EnumDyeColor(int p_i47810_3_, String p_i47810_4_, int p_i47810_5_, MaterialColor p_i47810_6_, int p_i47810_7_) { this.field_196064_s = p_i47810_3_; -@@ -56,6 +57,7 @@ +@@ -55,6 +56,7 @@ this.field_196066_w = k << 16 | j << 8 | i << 0; this.field_193352_x = new float[]{(float)i / 255.0F, (float)j / 255.0F, (float)k / 255.0F}; this.field_196067_y = p_i47810_7_; @@ -16,7 +16,7 @@ } public int func_196059_a() { -@@ -114,4 +116,21 @@ +@@ -113,4 +115,21 @@ public String func_176610_l() { return this.field_176785_v; } diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index 56996471f..acb181f4a 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -1,19 +1,15 @@ --- a/net/minecraft/item/Item.java +++ b/net/minecraft/item/Item.java -@@ -50,9 +50,9 @@ +@@ -48,7 +48,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class Item implements IItemProvider { -- public static final RegistryNamespaced field_150901_e = new RegistryNamespaced(); -- public static final Map field_179220_a = Maps.newHashMap(); +public class Item extends net.minecraftforge.registries.ForgeRegistryEntry implements IItemProvider, net.minecraftforge.common.extensions.IForgeItem { -+ public static final RegistryNamespaced field_150901_e = net.minecraftforge.registries.GameData.getWrapper(Item.class); -+ public static final Map field_179220_a = net.minecraftforge.registries.GameData.getBlockItemMap(); + public static final Map field_179220_a = Maps.newHashMap(); private static final IItemPropertyGetter field_185046_b = (p_210306_0_, p_210306_1_, p_210306_2_) -> { return p_210306_0_.func_77951_h() ? 1.0F : 0.0F; - }; -@@ -126,6 +126,10 @@ +@@ -96,6 +96,10 @@ this.field_77700_c = p_i48487_1_.field_200922_c; this.field_77699_b = p_i48487_1_.field_200921_b; this.field_77777_bU = p_i48487_1_.field_200920_a; @@ -24,7 +20,7 @@ if (this.field_77699_b > 0) { this.func_185043_a(new ResourceLocation("damaged"), field_185046_b); this.func_185043_a(new ResourceLocation("damage"), field_185047_c); -@@ -149,10 +153,12 @@ +@@ -146,10 +150,12 @@ return p_77654_1_; } @@ -37,7 +33,7 @@ public final int func_77612_l() { return this.field_77699_b; } -@@ -207,6 +213,7 @@ +@@ -204,6 +210,7 @@ return this.field_77700_c; } @@ -45,7 +41,7 @@ public boolean func_77634_r() { return this.field_77700_c != null; } -@@ -263,7 +270,7 @@ +@@ -260,7 +267,7 @@ } public boolean func_77616_k(ItemStack p_77616_1_) { @@ -54,7 +50,7 @@ } @Nullable -@@ -280,8 +287,8 @@ +@@ -277,8 +284,8 @@ float f5 = MathHelper.func_76126_a(-f * ((float)Math.PI / 180F)); float f6 = f3 * f4; float f7 = f2 * f4; @@ -65,7 +61,7 @@ return p_77621_1_.func_200259_a(vec3d, vec3d1, p_77621_3_ ? RayTraceFluidMode.SOURCE_ONLY : RayTraceFluidMode.NEVER, false, false); } -@@ -297,6 +304,7 @@ +@@ -294,6 +301,7 @@ } protected boolean func_194125_a(ItemGroup p_194125_1_) { @@ -73,56 +69,46 @@ ItemGroup itemgroup = this.func_77640_w(); return itemgroup != null && (p_194125_1_ == ItemGroup.field_78027_g || p_194125_1_ == itemgroup); } -@@ -310,10 +318,48 @@ +@@ -307,10 +315,38 @@ return false; } + @Deprecated // Use ItemStack sensitive version. public Multimap func_111205_h(EntityEquipmentSlot p_111205_1_) { - return HashMultimap.create(); + return HashMultimap.create(); } -+ /* ======================================== FORGE START =====================================*/ -+ + @Nullable + private final java.util.function.Supplier teisr; -+ + private final java.util.Map toolClasses = Maps.newHashMap(); -+ + protected final boolean canRepair; + + @Override -+ public boolean isRepairable() -+ { -+ return canRepair && func_77645_m(); ++ public boolean isRepairable() { ++ return canRepair && func_77645_m(); + } + + @Override -+ public java.util.Set getToolTypes(ItemStack stack) -+ { -+ return toolClasses.keySet(); ++ public java.util.Set getToolTypes(ItemStack stack) { ++ return toolClasses.keySet(); + } + + @Override -+ public int getHarvestLevel(ItemStack stack, net.minecraftforge.common.ToolType tool, @Nullable EntityPlayer player, @Nullable IBlockState blockState) -+ { -+ return toolClasses.getOrDefault(tool, -1); ++ public int getHarvestLevel(ItemStack stack, net.minecraftforge.common.ToolType tool, @Nullable EntityPlayer player, @Nullable IBlockState blockState) { ++ return toolClasses.getOrDefault(tool, -1); + } + + @OnlyIn(Dist.CLIENT) + @Override -+ public final net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer getTileEntityItemStackRenderer() -+ { -+ net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer renderer = teisr != null ? teisr.get() : null; -+ return renderer != null ? renderer : net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer.field_147719_a; ++ public final net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer getTileEntityItemStackRenderer() { ++ net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer renderer = teisr != null ? teisr.get() : null; ++ return renderer != null ? renderer : net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer.field_147719_a; + } -+ -+ /* ======================================== FORGE END =====================================*/ + public static void func_150900_l() { - func_179214_a(Blocks.field_150350_a, new ItemAir(Blocks.field_150350_a, new Item.Builder())); + func_179214_a(Blocks.field_150350_a, new ItemAir(Blocks.field_150350_a, new Item.Properties())); func_200879_a(Blocks.field_150348_b, ItemGroup.field_78030_b); -@@ -1147,6 +1193,9 @@ +@@ -1149,6 +1185,9 @@ private Item field_200922_c; private ItemGroup field_200923_d; private EnumRarity field_208104_e = EnumRarity.COMMON; @@ -130,24 +116,24 @@ + private java.util.Map toolClasses = Maps.newHashMap(); + private java.util.function.Supplier> teisr; - public Item.Builder func_200917_a(int p_200917_1_) { + public Item.Properties func_200917_a(int p_200917_1_) { if (this.field_200921_b > 0) { -@@ -1181,5 +1230,20 @@ +@@ -1183,5 +1222,20 @@ this.field_208104_e = p_208103_1_; return this; } + -+ public Item.Builder setNoRepair() { ++ public Item.Properties setNoRepair() { + canRepair = false; + return this; + } + -+ public Item.Builder addToolType(net.minecraftforge.common.ToolType type, int level) { ++ public Item.Properties addToolType(net.minecraftforge.common.ToolType type, int level) { + toolClasses.put(type, level); + return this; + } + -+ public Item.Builder setTEISR(java.util.function.Supplier> teisr) { ++ public Item.Properties setTEISR(java.util.function.Supplier> teisr) { + this.teisr = teisr; + return this; + } diff --git a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch index 2ca60eaba..51b4b26b7 100644 --- a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/item/ItemArmor.java +++ b/net/minecraft/item/ItemArmor.java -@@ -105,4 +105,8 @@ +@@ -104,4 +104,8 @@ public int func_200881_e() { return this.field_77879_b; } diff --git a/patches/minecraft/net/minecraft/item/ItemAxe.java.patch b/patches/minecraft/net/minecraft/item/ItemAxe.java.patch index 4558e5c93..8048918a7 100644 --- a/patches/minecraft/net/minecraft/item/ItemAxe.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemAxe.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/item/ItemAxe.java +++ b/net/minecraft/item/ItemAxe.java @@ -21,7 +21,7 @@ - protected static final Map field_203176_a = (new ImmutableMap.Builder()).put(Blocks.field_196626_Q, Blocks.field_209389_ab).put(Blocks.field_196617_K, Blocks.field_203204_R).put(Blocks.field_196639_V, Blocks.field_209394_ag).put(Blocks.field_196623_P, Blocks.field_203209_W).put(Blocks.field_196637_U, Blocks.field_209393_af).put(Blocks.field_196621_O, Blocks.field_203208_V).put(Blocks.field_196631_S, Blocks.field_209391_ad).put(Blocks.field_196619_M, Blocks.field_203206_T).put(Blocks.field_196634_T, Blocks.field_209392_ae).put(Blocks.field_196620_N, Blocks.field_203207_U).put(Blocks.field_196629_R, Blocks.field_209390_ac).put(Blocks.field_196618_L, Blocks.field_203205_S).build(); + protected static final Map field_203176_a = (new Builder()).put(Blocks.field_196626_Q, Blocks.field_209389_ab).put(Blocks.field_196617_K, Blocks.field_203204_R).put(Blocks.field_196639_V, Blocks.field_209394_ag).put(Blocks.field_196623_P, Blocks.field_203209_W).put(Blocks.field_196637_U, Blocks.field_209393_af).put(Blocks.field_196621_O, Blocks.field_203208_V).put(Blocks.field_196631_S, Blocks.field_209391_ad).put(Blocks.field_196619_M, Blocks.field_203206_T).put(Blocks.field_196634_T, Blocks.field_209392_ae).put(Blocks.field_196620_N, Blocks.field_203207_U).put(Blocks.field_196629_R, Blocks.field_209390_ac).put(Blocks.field_196618_L, Blocks.field_203205_S).build(); - protected ItemAxe(IItemTier p_i48530_1_, float p_i48530_2_, float p_i48530_3_, Item.Builder p_i48530_4_) { + protected ItemAxe(IItemTier p_i48530_1_, float p_i48530_2_, float p_i48530_3_, Item.Properties p_i48530_4_) { - super(p_i48530_2_, p_i48530_3_, p_i48530_1_, field_150917_c, p_i48530_4_); + super(p_i48530_2_, p_i48530_3_, p_i48530_1_, field_150917_c, p_i48530_4_.addToolType(net.minecraftforge.common.ToolType.AXE, p_i48530_1_.func_200925_d())); } diff --git a/patches/minecraft/net/minecraft/item/ItemBoneMeal.java.patch b/patches/minecraft/net/minecraft/item/ItemBoneMeal.java.patch index 3ec5721aa..eb1410617 100644 --- a/patches/minecraft/net/minecraft/item/ItemBoneMeal.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBoneMeal.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/item/ItemBoneMeal.java +++ b/net/minecraft/item/ItemBoneMeal.java -@@ -20,7 +20,7 @@ - public EnumActionResult func_195939_a(ItemUseContext p_195939_1_) { +@@ -27,7 +27,7 @@ World world = p_195939_1_.func_195991_k(); BlockPos blockpos = p_195939_1_.func_195995_a(); + BlockPos blockpos1 = blockpos.func_177972_a(p_195939_1_.func_196000_l()); - if (func_195966_a(p_195939_1_.func_195996_i(), world, blockpos)) { + if (applyBonemeal(p_195939_1_.func_195996_i(), world, blockpos, p_195939_1_.func_195999_j())) { if (!world.field_72995_K) { world.func_175718_b(2005, blockpos, 0); } -@@ -40,8 +40,19 @@ +@@ -48,8 +48,19 @@ } } @@ -29,7 +29,7 @@ if (iblockstate.func_177230_c() instanceof IGrowable) { IGrowable igrowable = (IGrowable)iblockstate.func_177230_c(); if (igrowable.func_176473_a(p_195966_1_, p_195966_2_, iblockstate, p_195966_1_.field_72995_K)) { -@@ -101,12 +112,13 @@ +@@ -125,12 +136,13 @@ } IBlockState iblockstate = p_195965_0_.func_180495_p(p_195965_1_); diff --git a/patches/minecraft/net/minecraft/item/ItemBow.java.patch b/patches/minecraft/net/minecraft/item/ItemBow.java.patch index c72a7771e..3271de18d 100644 --- a/patches/minecraft/net/minecraft/item/ItemBow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBow.java.patch @@ -31,5 +31,5 @@ + 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); + return flag ? new ActionResult<>(EnumActionResult.PASS, itemstack) : new ActionResult<>(EnumActionResult.FAIL, itemstack); } else { diff --git a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch index 5755f7afb..4a5dbc8b4 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch @@ -9,9 +9,9 @@ + if (ret != null) return ret; + if (raytraceresult == null) { - return new ActionResult(EnumActionResult.PASS, itemstack); + return new ActionResult<>(EnumActionResult.PASS, itemstack); } else if (raytraceresult.field_72313_a == RayTraceResult.Type.BLOCK) { -@@ -150,4 +154,12 @@ +@@ -152,4 +156,12 @@ SoundEvent soundevent = this.field_77876_a.func_207185_a(FluidTags.field_206960_b) ? SoundEvents.field_187627_L : SoundEvents.field_187624_K; p_203791_2_.func_184133_a(p_203791_1_, p_203791_3_, soundevent, SoundCategory.BLOCKS, 1.0F, 1.0F); } diff --git a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch index b075bee1b..74b265732 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch @@ -1,14 +1,6 @@ --- a/net/minecraft/item/ItemBucketMilk.java +++ b/net/minecraft/item/ItemBucketMilk.java -@@ -1,5 +1,7 @@ - package net.minecraft.item; - -+import javax.annotation.Nullable; -+ - import net.minecraft.advancements.CriteriaTriggers; - import net.minecraft.entity.EntityLivingBase; - import net.minecraft.entity.player.EntityPlayer; -@@ -17,6 +19,8 @@ +@@ -17,6 +17,8 @@ } public ItemStack func_77654_b(ItemStack p_77654_1_, World p_77654_2_, EntityLivingBase p_77654_3_) { @@ -17,13 +9,13 @@ if (p_77654_3_ instanceof EntityPlayerMP) { EntityPlayerMP entityplayermp = (EntityPlayerMP)p_77654_3_; CriteriaTriggers.field_193138_y.func_193148_a(entityplayermp, p_77654_1_); -@@ -46,4 +50,9 @@ +@@ -46,4 +48,9 @@ p_77659_2_.func_184598_c(p_77659_3_); - return new ActionResult(EnumActionResult.SUCCESS, p_77659_2_.func_184586_b(p_77659_3_)); + return new ActionResult<>(EnumActionResult.SUCCESS, p_77659_2_.func_184586_b(p_77659_3_)); } + + @Override -+ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, @Nullable net.minecraft.nbt.NBTTagCompound nbt) { ++ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, @javax.annotation.Nullable net.minecraft.nbt.NBTTagCompound nbt) { + return new net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper(stack); + } } diff --git a/patches/minecraft/net/minecraft/item/ItemGroup.java.patch b/patches/minecraft/net/minecraft/item/ItemGroup.java.patch index 9d18930fc..c13a39f54 100644 --- a/patches/minecraft/net/minecraft/item/ItemGroup.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemGroup.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/item/ItemGroup.java +++ b/net/minecraft/item/ItemGroup.java -@@ -11,7 +11,7 @@ +@@ -12,7 +12,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; public abstract class ItemGroup { @@ -9,7 +9,7 @@ public static final ItemGroup field_78030_b = (new ItemGroup(0, "buildingBlocks") { @OnlyIn(Dist.CLIENT) public ItemStack func_78016_d() { -@@ -104,11 +104,14 @@ +@@ -105,11 +105,14 @@ private EnumEnchantmentType[] field_111230_s = new EnumEnchantmentType[0]; private ItemStack field_151245_t; @@ -26,7 +26,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -179,11 +182,13 @@ +@@ -180,11 +183,13 @@ @OnlyIn(Dist.CLIENT) public int func_78020_k() { @@ -40,7 +40,7 @@ return this.field_78033_n < 6; } -@@ -220,4 +225,58 @@ +@@ -221,4 +226,58 @@ } } diff --git a/patches/minecraft/net/minecraft/item/ItemMap.java.patch b/patches/minecraft/net/minecraft/item/ItemMap.java.patch index bb1c6a72c..b75651805 100644 --- a/patches/minecraft/net/minecraft/item/ItemMap.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemMap.java.patch @@ -1,48 +1,19 @@ --- a/net/minecraft/item/ItemMap.java +++ b/net/minecraft/item/ItemMap.java -@@ -41,15 +41,25 @@ - - public static ItemStack func_195952_a(World p_195952_0_, int p_195952_1_, int p_195952_2_, byte p_195952_3_, boolean p_195952_4_, boolean p_195952_5_) { - ItemStack itemstack = new ItemStack(Items.field_151098_aY); -- func_195951_a(itemstack, p_195952_0_, p_195952_1_, p_195952_2_, p_195952_3_, p_195952_4_, p_195952_5_, p_195952_0_.field_73011_w.func_186058_p().func_186068_a()); -+ func_195951_a(itemstack, p_195952_0_, p_195952_1_, p_195952_2_, p_195952_3_, p_195952_4_, p_195952_5_, p_195952_0_.field_73011_w.getId()); - return itemstack; - } +@@ -48,6 +48,16 @@ @Nullable public static MapData func_195950_a(ItemStack p_195950_0_, World p_195950_1_) { -+ // FORGE: Add instance method for mods to override -+ Item map = p_195950_0_.func_77973_b(); -+ if (map instanceof ItemMap) { -+ return ((ItemMap)map).getCustomMapData(p_195950_0_, p_195950_1_); -+ } -+ return null; -+ } ++ // FORGE: Add instance method for mods to override ++ Item map = p_195950_0_.func_77973_b(); ++ if (map instanceof ItemMap) { ++ return ((ItemMap)map).getCustomMapData(p_195950_0_, p_195950_1_); ++ } ++ return null; ++ } + -+ @Nullable -+ protected MapData getCustomMapData(ItemStack p_195950_0_, World p_195950_1_) { ++ @Nullable ++ protected MapData getCustomMapData(ItemStack p_195950_0_, World p_195950_1_) { MapData mapdata = func_195953_a(p_195950_1_, "map_" + func_195949_f(p_195950_0_)); if (mapdata == null && !p_195950_1_.field_72995_K) { -- mapdata = func_195951_a(p_195950_0_, p_195950_1_, p_195950_1_.func_72912_H().func_76079_c(), p_195950_1_.func_72912_H().func_76074_e(), 3, false, false, p_195950_1_.field_73011_w.func_186058_p().func_186068_a()); -+ mapdata = func_195951_a(p_195950_0_, p_195950_1_, p_195950_1_.func_72912_H().func_76079_c(), p_195950_1_.func_72912_H().func_76074_e(), 3, false, false, p_195950_1_.field_73011_w.getId()); - } - - return mapdata; -@@ -75,7 +85,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.getId() == 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; - int k = p_77872_3_.field_76199_b; -@@ -215,7 +225,7 @@ - public static void func_190905_a(World p_190905_0_, ItemStack p_190905_1_) { - MapData mapdata = func_195950_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.getId() == mapdata.field_76200_c) { - int i = 1 << mapdata.field_76197_d; - int j = mapdata.field_76201_a; - int k = mapdata.field_76199_b; + mapdata = func_195951_a(p_195950_0_, p_195950_1_, p_195950_1_.func_72912_H().func_76079_c(), p_195950_1_.func_72912_H().func_76074_e(), 3, false, false, p_195950_1_.field_73011_w.func_186058_p()); diff --git a/patches/minecraft/net/minecraft/item/ItemMinecart.java.patch b/patches/minecraft/net/minecraft/item/ItemMinecart.java.patch index d55ed536b..5c031231b 100644 --- a/patches/minecraft/net/minecraft/item/ItemMinecart.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemMinecart.java.patch @@ -4,16 +4,22 @@ 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); -- RailShape railshape = iblockstate.func_177230_c() instanceof BlockRailBase ? (RailShape)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; +- RailShape railshape = iblockstate.func_177230_c() instanceof BlockRailBase ? iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; + RailShape railshape = iblockstate.func_177230_c() instanceof BlockRailBase ? ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(iblockstate, world, blockpos, null) : RailShape.NORTH_SOUTH; double d3; if (iblockstate.func_203425_a(BlockTags.field_203437_y)) { if (railshape.func_208092_c()) { -@@ -40,7 +40,7 @@ +@@ -35,12 +35,12 @@ + d3 = 0.1D; + } + } else { +- if (!iblockstate.func_196958_f() || !world.func_180495_p(blockpos.func_177977_b()).func_203425_a(BlockTags.field_203437_y)) { ++ if (!iblockstate.isAir(world, blockpos) || !world.func_180495_p(blockpos.func_177977_b()).func_203425_a(BlockTags.field_203437_y)) { + return this.field_96465_b.dispense(p_82487_1_, p_82487_2_); } IBlockState iblockstate1 = world.func_180495_p(blockpos.func_177977_b()); -- RailShape railshape1 = iblockstate1.func_177230_c() instanceof BlockRailBase ? (RailShape)iblockstate1.func_177229_b(((BlockRailBase)iblockstate1.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; +- RailShape railshape1 = iblockstate1.func_177230_c() instanceof BlockRailBase ? iblockstate1.func_177229_b(((BlockRailBase)iblockstate1.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; + RailShape railshape1 = iblockstate1.func_177230_c() instanceof BlockRailBase ? ((BlockRailBase)iblockstate1.func_177230_c()).getRailDirection(iblockstate1, world, blockpos, null) : RailShape.NORTH_SOUTH; if (enumfacing != EnumFacing.DOWN && railshape1.func_208092_c()) { d3 = -0.4D; @@ -22,7 +28,7 @@ } else { ItemStack itemstack = p_195939_1_.func_195996_i(); if (!world.field_72995_K) { -- RailShape railshape = iblockstate.func_177230_c() instanceof BlockRailBase ? (RailShape)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; +- RailShape railshape = iblockstate.func_177230_c() instanceof BlockRailBase ? iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l()) : RailShape.NORTH_SOUTH; + RailShape railshape = iblockstate.func_177230_c() instanceof BlockRailBase ? ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(iblockstate, world, blockpos, null) : RailShape.NORTH_SOUTH; double d0 = 0.0D; if (railshape.func_208092_c()) { diff --git a/patches/minecraft/net/minecraft/item/ItemPickaxe.java.patch b/patches/minecraft/net/minecraft/item/ItemPickaxe.java.patch index 3fc3816b3..2d842e369 100644 --- a/patches/minecraft/net/minecraft/item/ItemPickaxe.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemPickaxe.java.patch @@ -3,7 +3,7 @@ @@ -11,24 +11,17 @@ private static final Set field_150915_c = Sets.newHashSet(Blocks.field_150408_cc, Blocks.field_150365_q, Blocks.field_150347_e, Blocks.field_150319_E, Blocks.field_150484_ah, Blocks.field_150482_ag, Blocks.field_196552_aC, Blocks.field_150340_R, Blocks.field_150352_o, Blocks.field_150432_aD, Blocks.field_150339_S, Blocks.field_150366_p, Blocks.field_150368_y, Blocks.field_150369_x, Blocks.field_150341_Y, Blocks.field_150424_aL, Blocks.field_150403_cj, Blocks.field_205164_gk, Blocks.field_150448_aq, Blocks.field_150450_ax, Blocks.field_150322_A, Blocks.field_196583_aj, Blocks.field_196585_ak, Blocks.field_196798_hA, Blocks.field_196799_hB, Blocks.field_180395_cM, Blocks.field_150348_b, Blocks.field_196650_c, Blocks.field_196652_d, Blocks.field_196654_e, Blocks.field_196655_f, Blocks.field_196656_g, Blocks.field_196657_h, Blocks.field_150333_U, Blocks.field_196640_bx, Blocks.field_196643_by, Blocks.field_196646_bz, Blocks.field_196571_bA, Blocks.field_196573_bB, Blocks.field_196575_bC, Blocks.field_196576_bD, Blocks.field_196578_bE, Blocks.field_185771_cX, Blocks.field_196581_bI, Blocks.field_196582_bJ, Blocks.field_196580_bH, Blocks.field_196579_bG, Blocks.field_150430_aB, Blocks.field_150456_au); - protected ItemPickaxe(IItemTier p_i48478_1_, int p_i48478_2_, float p_i48478_3_, Item.Builder p_i48478_4_) { + protected ItemPickaxe(IItemTier p_i48478_1_, int p_i48478_2_, float p_i48478_3_, Item.Properties p_i48478_4_) { - super((float)p_i48478_2_, p_i48478_3_, p_i48478_1_, field_150915_c, p_i48478_4_); + super((float)p_i48478_2_, p_i48478_3_, p_i48478_1_, field_150915_c, p_i48478_4_.addToolType(net.minecraftforge.common.ToolType.PICKAXE, p_i48478_1_.func_200925_d())); } diff --git a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch index 89e964719..b1bf743eb 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -8,7 +8,7 @@ +public class ItemSeedFood extends ItemFood implements net.minecraftforge.common.IPlantable { private final IBlockState field_195972_b; - public ItemSeedFood(int p_i48473_1_, float p_i48473_2_, Block p_i48473_3_, Item.Builder p_i48473_4_) { + public ItemSeedFood(int p_i48473_1_, float p_i48473_2_, Block p_i48473_3_, Item.Properties p_i48473_4_) { @@ -21,7 +21,7 @@ public EnumActionResult func_195939_a(ItemUseContext p_195939_1_) { IWorld iworld = p_195939_1_.func_195991_k(); diff --git a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch index 09987f18e..4c0ea44a0 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -8,7 +8,7 @@ +public class ItemSeeds extends Item implements net.minecraftforge.common.IPlantable { private final IBlockState field_195978_a; - public ItemSeeds(Block p_i48472_1_, Item.Builder p_i48472_2_) { + public ItemSeeds(Block p_i48472_1_, Item.Properties p_i48472_2_) { @@ -21,7 +21,7 @@ public EnumActionResult func_195939_a(ItemUseContext p_195939_1_) { IWorld iworld = p_195939_1_.func_195991_k(); diff --git a/patches/minecraft/net/minecraft/item/ItemSpade.java.patch b/patches/minecraft/net/minecraft/item/ItemSpade.java.patch index ceb413c95..3bfc642e9 100644 --- a/patches/minecraft/net/minecraft/item/ItemSpade.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSpade.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/item/ItemSpade.java +++ b/net/minecraft/item/ItemSpade.java @@ -21,7 +21,7 @@ - protected static final Map field_195955_e = Maps.newHashMap(ImmutableMap.of(Blocks.field_196658_i, Blocks.field_185774_da.func_176223_P())); + protected static final Map field_195955_e = Maps.newHashMap(ImmutableMap.of(Blocks.field_196658_i, Blocks.field_185774_da.func_176223_P())); - public ItemSpade(IItemTier p_i48469_1_, float p_i48469_2_, float p_i48469_3_, Item.Builder p_i48469_4_) { + public ItemSpade(IItemTier p_i48469_1_, float p_i48469_2_, float p_i48469_3_, Item.Properties p_i48469_4_) { - super(p_i48469_2_, p_i48469_3_, p_i48469_1_, field_150916_c, p_i48469_4_); + super(p_i48469_2_, p_i48469_3_, p_i48469_1_, field_150916_c, p_i48469_4_.addToolType(net.minecraftforge.common.ToolType.SHOVEL, p_i48469_1_.func_200925_d())); } diff --git a/patches/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch index 50ce75697..7e1338e96 100644 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemStack.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/item/ItemStack.java +++ b/net/minecraft/item/ItemStack.java -@@ -63,7 +63,7 @@ +@@ -64,7 +64,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ private static final Logger field_199558_c = LogManager.getLogger(); public static final ItemStack field_190927_a = new ItemStack((Item)null); public static final DecimalFormat field_111284_a = func_208306_D(); -@@ -79,6 +79,9 @@ +@@ -80,6 +80,9 @@ private BlockWorldState field_179550_j; private boolean field_179551_k; @@ -19,7 +19,7 @@ private static DecimalFormat func_208306_D() { DecimalFormat decimalformat = new DecimalFormat("#.##"); decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT)); -@@ -89,10 +92,14 @@ +@@ -90,10 +93,14 @@ this(p_i48203_1_, 1); } @@ -35,16 +35,16 @@ } private void func_190923_F() { -@@ -101,6 +108,8 @@ +@@ -102,6 +109,8 @@ } private ItemStack(NBTTagCompound p_i47263_1_) { + super(ItemStack.class); + this.capNBT = p_i47263_1_.func_74764_b("ForgeCaps") ? p_i47263_1_.func_74775_l("ForgeCaps") : null; - Item item = Item.field_150901_e.func_82594_a(new ResourceLocation(p_i47263_1_.func_74779_i("id"))); + Item item = IRegistry.field_212630_s.func_212608_b(new ResourceLocation(p_i47263_1_.func_74779_i("id"))); this.field_151002_e = item == null ? Items.field_190931_a : item; this.field_77994_a = p_i47263_1_.func_74771_c("Count"); -@@ -114,6 +123,7 @@ +@@ -115,6 +124,7 @@ } this.func_190923_F(); @@ -52,7 +52,7 @@ } public static ItemStack func_199557_a(NBTTagCompound p_199557_0_) { -@@ -128,7 +138,7 @@ +@@ -129,7 +139,7 @@ public boolean func_190926_b() { if (this == field_190927_a) { return true; @@ -61,7 +61,7 @@ return this.field_77994_a <= 0; } else { return true; -@@ -144,18 +154,27 @@ +@@ -145,18 +155,27 @@ } public Item func_77973_b() { @@ -95,7 +95,7 @@ if (entityplayer != null && enumactionresult == EnumActionResult.SUCCESS) { entityplayer.func_71029_a(StatList.field_75929_E.func_199076_b(item)); } -@@ -183,12 +202,15 @@ +@@ -184,12 +203,15 @@ if (this.field_77990_d != null) { p_77955_1_.func_74782_a("tag", this.field_77990_d); } @@ -113,7 +113,7 @@ } public boolean func_77985_e() { -@@ -196,7 +218,7 @@ +@@ -197,7 +219,7 @@ } public boolean func_77984_f() { @@ -122,7 +122,7 @@ NBTTagCompound nbttagcompound = this.func_77978_p(); return nbttagcompound == null || !nbttagcompound.func_74767_n("Unbreakable"); } else { -@@ -205,7 +227,7 @@ +@@ -206,7 +228,7 @@ } public boolean func_77951_h() { @@ -131,7 +131,7 @@ } public int func_77952_i() { -@@ -217,7 +239,7 @@ +@@ -218,7 +240,7 @@ } public int func_77958_k() { @@ -140,7 +140,7 @@ } public boolean func_96631_a(int p_96631_1_, Random p_96631_2_, @Nullable EntityPlayerMP p_96631_3_) { -@@ -285,7 +307,7 @@ +@@ -286,7 +308,7 @@ } public boolean func_150998_b(IBlockState p_150998_1_) { @@ -149,7 +149,7 @@ } public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_, EnumHand p_111282_3_) { -@@ -293,7 +315,7 @@ +@@ -294,7 +316,7 @@ } public ItemStack func_77946_l() { @@ -158,7 +158,7 @@ itemstack.func_190915_d(this.func_190921_D()); if (this.field_77990_d != null) { itemstack.field_77990_d = this.field_77990_d.func_74737_b(); -@@ -309,7 +331,7 @@ +@@ -310,7 +332,7 @@ if (p_77970_0_.field_77990_d == null && p_77970_1_.field_77990_d != null) { return false; } else { @@ -167,7 +167,7 @@ } } else { return false; -@@ -332,7 +354,7 @@ +@@ -333,7 +355,7 @@ } else if (this.field_77990_d == null && p_77959_1_.field_77990_d != null) { return false; } else { @@ -176,7 +176,7 @@ } } -@@ -633,6 +655,7 @@ +@@ -634,6 +656,7 @@ } } @@ -184,7 +184,7 @@ return list; } -@@ -743,7 +766,7 @@ +@@ -744,7 +767,7 @@ } } } else { @@ -193,7 +193,7 @@ } return multimap; -@@ -874,4 +897,37 @@ +@@ -875,4 +898,37 @@ public void func_190918_g(int p_190918_1_) { this.func_190917_f(-p_190918_1_); } diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipe.java.patch b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipe.java.patch index 9308c497b..fda96f381 100644 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipe.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipe.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/item/crafting/FurnaceRecipe.java +++ b/net/minecraft/item/crafting/FurnaceRecipe.java -@@ -10,8 +10,6 @@ - import net.minecraft.util.NonNullList; +@@ -11,8 +11,6 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; import net.minecraft.world.World; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; public class FurnaceRecipe implements IRecipe { private final ResourceLocation field_201832_a; -@@ -31,14 +29,13 @@ +@@ -32,14 +30,13 @@ } public boolean func_77569_a(IInventory p_77569_1_, World p_77569_2_) { @@ -25,7 +25,7 @@ public boolean func_194133_a(int p_194133_1_, int p_194133_2_) { return true; } -@@ -61,7 +58,6 @@ +@@ -62,7 +59,6 @@ return this.field_201835_d; } @@ -33,7 +33,7 @@ public String func_193358_e() { return this.field_201833_b; } -@@ -74,7 +70,13 @@ +@@ -75,7 +71,13 @@ return this.field_201832_a; } @@ -47,7 +47,7 @@ public FurnaceRecipe func_199425_a_(ResourceLocation p_199425_1_, JsonObject p_199425_2_) { String s = JsonUtils.func_151219_a(p_199425_2_, "group", ""); Ingredient ingredient; -@@ -113,8 +115,9 @@ +@@ -114,8 +116,9 @@ p_199427_1_.func_150787_b(p_199427_2_.field_201837_f); } diff --git a/patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch b/patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch index ee2cde124..b68671f66 100644 --- a/patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/IRecipe.java.patch @@ -23,7 +23,7 @@ ItemStack func_77571_b(); @@ -23,9 +19,9 @@ - NonNullList nonnulllist = NonNullList.func_191197_a(p_179532_1_.func_70302_i_(), ItemStack.field_190927_a); + NonNullList nonnulllist = NonNullList.func_191197_a(p_179532_1_.func_70302_i_(), ItemStack.field_190927_a); for(int i = 0; i < nonnulllist.size(); ++i) { - Item item = p_179532_1_.func_70301_a(i).func_77973_b(); diff --git a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch b/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch index 3ff68f81d..e5207d2c0 100644 --- a/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/Ingredient.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/item/crafting/Ingredient.java +++ b/net/minecraft/item/crafting/Ingredient.java -@@ -25,10 +25,14 @@ - import net.minecraft.util.IItemProvider; +@@ -26,10 +26,14 @@ import net.minecraft.util.JsonUtils; import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; @@ -17,14 +17,14 @@ private static final Predicate field_209362_b = (p_209361_0_) -> { return !p_209361_0_.func_199799_a().stream().allMatch(ItemStack::func_190926_b); }; -@@ -36,14 +40,16 @@ +@@ -37,14 +41,16 @@ private final Ingredient.IItemList[] field_199807_b; private ItemStack[] field_193371_b; private IntList field_194140_c; + private final boolean isSimple; protected Ingredient(Stream p_i49381_1_) { - this.field_199807_b = (Ingredient.IItemList[])p_i49381_1_.filter(field_209362_b).toArray((p_209360_0_) -> { + this.field_199807_b = p_i49381_1_.filter(field_209362_b).toArray((p_209360_0_) -> { return new Ingredient.IItemList[p_209360_0_]; }); + this.isSimple = !Arrays.stream(field_199807_b).anyMatch(list -> list.func_199799_a().stream().anyMatch(stack -> stack.func_77973_b().func_77645_m())); @@ -35,7 +35,7 @@ public ItemStack[] func_193365_a() { this.func_199806_d(); return this.field_193371_b; -@@ -95,6 +101,10 @@ +@@ -96,6 +102,10 @@ public final void func_199564_a(PacketBuffer p_199564_1_) { this.func_199806_d(); @@ -46,7 +46,7 @@ p_199564_1_.func_150787_b(this.field_193371_b.length); for(int i = 0; i < this.field_193371_b.length; ++i) { -@@ -121,6 +131,25 @@ +@@ -122,6 +132,25 @@ return this.field_199807_b.length == 0 && (this.field_193371_b == null || this.field_193371_b.length == 0) && (this.field_194140_c == null || this.field_194140_c.isEmpty()); } @@ -72,7 +72,7 @@ public static Ingredient func_209357_a(Stream p_209357_0_) { Ingredient ingredient = new Ingredient(p_209357_0_); return ingredient.field_199807_b.length == 0 ? field_193370_a : ingredient; -@@ -132,7 +161,6 @@ +@@ -133,7 +162,6 @@ })); } @@ -80,7 +80,7 @@ public static Ingredient func_193369_a(ItemStack... p_193369_0_) { return func_209357_a(Arrays.stream(p_193369_0_).map((p_209356_0_) -> { return new Ingredient.SingleItemList(p_209356_0_); -@@ -144,7 +172,12 @@ +@@ -145,7 +173,12 @@ } public static Ingredient func_199566_b(PacketBuffer p_199566_0_) { @@ -93,7 +93,7 @@ return func_209357_a(Stream.generate(() -> { return new Ingredient.SingleItemList(p_199566_0_.func_150791_c()); }).limit((long)i)); -@@ -152,6 +185,8 @@ +@@ -153,6 +186,8 @@ public static Ingredient func_199802_a(@Nullable JsonElement p_199802_0_) { if (p_199802_0_ != null && !p_199802_0_.isJsonNull()) { @@ -102,7 +102,7 @@ if (p_199802_0_.isJsonObject()) { return func_209357_a(Stream.of(func_199803_a(p_199802_0_.getAsJsonObject()))); } else if (p_199802_0_.isJsonArray()) { -@@ -172,6 +207,11 @@ +@@ -173,6 +208,11 @@ } public static Ingredient.IItemList func_199803_a(JsonObject p_199803_0_) { @@ -114,7 +114,7 @@ if (p_199803_0_.has("item") && p_199803_0_.has("tag")) { throw new JsonParseException("An ingredient entry is either a tag or an item, not both"); } else if (p_199803_0_.has("item")) { -@@ -195,6 +235,12 @@ +@@ -196,6 +236,12 @@ } } diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeItemHelper.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeItemHelper.java.patch index 9a4178ba8..3e4868252 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeItemHelper.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeItemHelper.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/item/crafting/RecipeItemHelper.java +++ b/net/minecraft/item/crafting/RecipeItemHelper.java -@@ -25,9 +25,13 @@ +@@ -26,9 +26,13 @@ } public void func_194112_a(ItemStack p_194112_1_) { diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch index 1cb83d998..ffe6fe7ad 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeManager.java.patch @@ -22,7 +22,7 @@ String s = resourcelocation.func_110623_a(); ResourceLocation resourcelocation1 = new ResourceLocation(resourcelocation.func_110624_b(), s.substring(field_199519_a, s.length() - field_199520_b)); @@ -47,6 +48,8 @@ - JsonObject jsonobject = (JsonObject)JsonUtils.func_188178_a(gson, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), JsonObject.class); + JsonObject jsonobject = JsonUtils.func_188178_a(gson, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), JsonObject.class); if (jsonobject == null) { field_199521_c.error("Couldn't load recipe {} as it's null or empty", (Object)resourcelocation1); + } else if (jsonobject.has("conditions") && !net.minecraftforge.common.crafting.CraftingHelper.processConditions(JsonUtils.func_151214_t(jsonobject, "conditions"))) { diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeSerializers.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeSerializers.java.patch index 6588afc80..8aa19f506 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeSerializers.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeSerializers.java.patch @@ -4,14 +4,14 @@ import net.minecraft.util.ResourceLocation; public class RecipeSerializers { -- private static final Map> field_199590_p = Maps.>newHashMap(); +- private static final Map> field_199590_p = Maps.newHashMap(); + private static final Map> field_199590_p = Maps.newHashMap(); public static final IRecipeSerializer field_199575_a = func_199573_a(new ShapedRecipe.Serializer()); public static final IRecipeSerializer field_199576_b = func_199573_a(new ShapelessRecipe.Serializer()); - public static final RecipeSerializers.SimpleSerializer field_199577_c = func_199573_a(new RecipeSerializers.SimpleSerializer("crafting_special_armordye", RecipesArmorDyes::new)); + public static final RecipeSerializers.SimpleSerializer field_199577_c = func_199573_a(new RecipeSerializers.SimpleSerializer<>("crafting_special_armordye", RecipesArmorDyes::new)); @@ -27,18 +27,19 @@ - public static final RecipeSerializers.SimpleSerializer field_199588_n = func_199573_a(new RecipeSerializers.SimpleSerializer("crafting_special_shielddecoration", ShieldRecipes::new)); - public static final RecipeSerializers.SimpleSerializer field_199589_o = func_199573_a(new RecipeSerializers.SimpleSerializer("crafting_special_shulkerboxcoloring", ShulkerBoxColoringRecipe::new)); + public static final RecipeSerializers.SimpleSerializer field_199588_n = func_199573_a(new RecipeSerializers.SimpleSerializer<>("crafting_special_shielddecoration", ShieldRecipes::new)); + public static final RecipeSerializers.SimpleSerializer field_199589_o = func_199573_a(new RecipeSerializers.SimpleSerializer<>("crafting_special_shulkerboxcoloring", ShulkerBoxColoringRecipe::new)); public static final IRecipeSerializer field_201839_p = func_199573_a(new FurnaceRecipe.Serializer()); + private static final java.util.Set VANILLA_TYPES = new java.util.HashSet<>(field_199590_p.keySet()); //Copy of vanilla so we can keep track for compatibility. diff --git a/patches/minecraft/net/minecraft/item/crafting/ShapedRecipe.java.patch b/patches/minecraft/net/minecraft/item/crafting/ShapedRecipe.java.patch index 52e6d4254..fe3c72486 100644 --- a/patches/minecraft/net/minecraft/item/crafting/ShapedRecipe.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/ShapedRecipe.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/item/crafting/ShapedRecipe.java +++ b/net/minecraft/item/crafting/ShapedRecipe.java -@@ -20,10 +20,21 @@ - import net.minecraft.util.NonNullList; +@@ -21,10 +21,21 @@ import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; import net.minecraft.world.World; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; @@ -25,7 +25,7 @@ private final int field_77576_b; private final int field_77577_c; private final NonNullList field_77574_d; -@@ -48,7 +59,6 @@ +@@ -49,7 +60,6 @@ return RecipeSerializers.field_199575_a; } @@ -33,7 +33,7 @@ public String func_193358_e() { return this.field_194137_e; } -@@ -61,13 +71,12 @@ +@@ -62,13 +72,12 @@ return this.field_77574_d; } @@ -48,7 +48,7 @@ return false; } else { for(int i = 0; i <= p_77569_1_.func_174922_i() - this.field_77576_b; ++i) { -@@ -117,10 +126,20 @@ +@@ -118,10 +127,20 @@ return this.field_77576_b; } @@ -67,9 +67,9 @@ + } + private static NonNullList func_192402_a(String[] p_192402_0_, Map p_192402_1_, int p_192402_2_, int p_192402_3_) { - NonNullList nonnulllist = NonNullList.func_191197_a(p_192402_2_ * p_192402_3_, Ingredient.field_193370_a); + NonNullList nonnulllist = NonNullList.func_191197_a(p_192402_2_ * p_192402_3_, Ingredient.field_193370_a); Set set = Sets.newHashSet(p_192402_1_.keySet()); -@@ -202,15 +221,15 @@ +@@ -203,15 +222,15 @@ private static String[] func_192407_a(JsonArray p_192407_0_) { String[] astring = new String[p_192407_0_.size()]; @@ -89,7 +89,7 @@ } if (i > 0 && astring[0].length() != s.length()) { -@@ -257,6 +276,7 @@ +@@ -258,6 +277,7 @@ } public static class Serializer implements IRecipeSerializer { @@ -97,7 +97,7 @@ public ShapedRecipe func_199425_a_(ResourceLocation p_199425_1_, JsonObject p_199425_2_) { String s = JsonUtils.func_151219_a(p_199425_2_, "group", ""); Map map = ShapedRecipe.func_192408_a(JsonUtils.func_152754_s(p_199425_2_, "key")); -@@ -268,8 +288,9 @@ +@@ -269,8 +289,9 @@ return new ShapedRecipe(p_199425_1_, s, i, j, nonnulllist, itemstack); } diff --git a/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerHandshakeTCP.java.patch similarity index 69% rename from patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch rename to patches/minecraft/net/minecraft/network/NetHandlerHandshakeTCP.java.patch index 75a876e88..c28466f0d 100644 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerHandshakeTCP.java.patch @@ -1,6 +1,6 @@ ---- a/net/minecraft/server/network/NetHandlerHandshakeTCP.java -+++ b/net/minecraft/server/network/NetHandlerHandshakeTCP.java -@@ -19,6 +19,7 @@ +--- a/net/minecraft/network/NetHandlerHandshakeTCP.java ++++ b/net/minecraft/network/NetHandlerHandshakeTCP.java +@@ -17,6 +17,7 @@ } public void func_147383_a(CPacketHandshake p_147383_1_) { diff --git a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerLoginServer.java.patch similarity index 82% rename from patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch rename to patches/minecraft/net/minecraft/network/NetHandlerLoginServer.java.patch index 5da9cf892..1a7a2ca87 100644 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerLoginServer.java.patch @@ -1,28 +1,30 @@ ---- a/net/minecraft/server/network/NetHandlerLoginServer.java -+++ b/net/minecraft/server/network/NetHandlerLoginServer.java -@@ -55,6 +55,12 @@ +--- a/net/minecraft/network/NetHandlerLoginServer.java ++++ b/net/minecraft/network/NetHandlerLoginServer.java +@@ -54,7 +54,13 @@ } public void func_73660_a() { +- if (this.field_147328_g == NetHandlerLoginServer.LoginState.READY_TO_ACCEPT) { + if (this.field_147328_g == LoginState.NEGOTIATING) { + // We force the state into "NEGOTIATING" which is otherwise unused. Once we're completed we move the negotiation onto "READY_TO_ACCEPT" + // Might want to promote player object creation to here as well.. + boolean negotiationComplete = net.minecraftforge.fml.network.NetworkHooks.tickNegotiation(this, this.field_147333_a, this.field_181025_l); -+ if (negotiationComplete) this.field_147328_g = LoginState.READY_TO_ACCEPT; -+ } else - if (this.field_147328_g == NetHandlerLoginServer.LoginState.READY_TO_ACCEPT) { ++ if (negotiationComplete) ++ this.field_147328_g = LoginState.READY_TO_ACCEPT; ++ } else if (this.field_147328_g == NetHandlerLoginServer.LoginState.READY_TO_ACCEPT) { this.func_147326_c(); } else if (this.field_147328_g == NetHandlerLoginServer.LoginState.DELAY_ACCEPT) { -@@ -126,7 +132,7 @@ + EntityPlayerMP entityplayermp = this.field_147327_f.func_184103_al().func_177451_a(this.field_147337_i.getId()); +@@ -125,7 +131,7 @@ this.field_147328_g = NetHandlerLoginServer.LoginState.KEY; this.field_147333_a.func_179290_a(new SPacketEncryptionRequest("", this.field_147327_f.func_71250_E().getPublic(), this.field_147330_e)); } else { - this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -+ this.field_147328_g = LoginState.NEGOTIATING; ++ this.field_147328_g = NetHandlerLoginServer.LoginState.NEGOTIATING; } } -@@ -140,7 +146,7 @@ +@@ -139,7 +145,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); @@ -31,34 +33,34 @@ public void run() { GameProfile gameprofile = NetHandlerLoginServer.this.field_147337_i; -@@ -149,11 +155,11 @@ +@@ -148,11 +154,11 @@ NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.field_147327_f.func_147130_as().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s, this.func_191235_a()); if (NetHandlerLoginServer.this.field_147337_i != null) { NetHandlerLoginServer.field_147332_c.info("UUID of player {} is {}", NetHandlerLoginServer.this.field_147337_i.getName(), NetHandlerLoginServer.this.field_147337_i.getId()); - NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -+ NetHandlerLoginServer.this.field_147328_g = LoginState.NEGOTIATING; ++ NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.NEGOTIATING; } else if (NetHandlerLoginServer.this.field_147327_f.func_71264_H()) { NetHandlerLoginServer.field_147332_c.warn("Failed to verify username but will let them in anyway!"); NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.func_152506_a(gameprofile); - NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -+ NetHandlerLoginServer.this.field_147328_g = LoginState.NEGOTIATING; ++ NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.NEGOTIATING; } else { - NetHandlerLoginServer.this.func_194026_b(new TextComponentTranslation("multiplayer.disconnect.unverified_username", new Object[0])); + NetHandlerLoginServer.this.func_194026_b(new TextComponentTranslation("multiplayer.disconnect.unverified_username")); NetHandlerLoginServer.field_147332_c.error("Username '{}' tried to join with an invalid session", (Object)gameprofile.getName()); -@@ -162,7 +168,7 @@ +@@ -161,7 +167,7 @@ if (NetHandlerLoginServer.this.field_147327_f.func_71264_H()) { NetHandlerLoginServer.field_147332_c.warn("Authentication servers are down but will let them in anyway!"); NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.func_152506_a(gameprofile); - NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -+ NetHandlerLoginServer.this.field_147328_g = LoginState.NEGOTIATING; ++ NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.NEGOTIATING; } else { - NetHandlerLoginServer.this.func_194026_b(new TextComponentTranslation("multiplayer.disconnect.authservers_down", new Object[0])); + NetHandlerLoginServer.this.func_194026_b(new TextComponentTranslation("multiplayer.disconnect.authservers_down")); NetHandlerLoginServer.field_147332_c.error("Couldn't verify username because servers are unavailable"); -@@ -183,6 +189,7 @@ +@@ -182,6 +188,7 @@ } public void func_209526_a(CPacketCustomPayloadLogin p_209526_1_) { + if (!net.minecraftforge.fml.network.NetworkHooks.onCustomPayload(p_209526_1_, this.field_147333_a)) - this.func_194026_b(new TextComponentTranslation("multiplayer.disconnect.unexpected_query_response", new Object[0])); + this.func_194026_b(new TextComponentTranslation("multiplayer.disconnect.unexpected_query_response")); } diff --git a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch index 950bef0c5..cd12d0877 100644 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/NetHandlerPlayServer.java +++ b/net/minecraft/network/NetHandlerPlayServer.java -@@ -327,9 +327,11 @@ +@@ -328,9 +328,11 @@ } entity.func_70080_a(d3, d4, d5, f, f1); @@ -12,7 +12,7 @@ this.field_147371_a.func_179290_a(new SPacketMoveVehicle(entity)); return; } -@@ -791,7 +793,9 @@ +@@ -798,7 +800,9 @@ double d1 = this.field_147369_b.field_70163_u - ((double)blockpos.func_177956_o() + 0.5D) + 1.5D; double d2 = this.field_147369_b.field_70161_v - ((double)blockpos.func_177952_p() + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; @@ -23,7 +23,7 @@ return; } else if (blockpos.func_177956_o() >= this.field_147367_d.func_71207_Z()) { return; -@@ -830,7 +834,9 @@ +@@ -837,7 +841,9 @@ EnumFacing enumfacing = p_184337_1_.func_187024_b(); this.field_147369_b.func_143004_u(); 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()) { @@ -34,18 +34,18 @@ 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()); } } else { -@@ -957,7 +963,9 @@ +@@ -962,7 +968,9 @@ if (s.startsWith("/")) { this.func_147361_d(s); } 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", new Object[]{this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s)}); +- ITextComponent itextcomponent = new TextComponentTranslation("chat.type.text", 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); } -@@ -1055,6 +1063,7 @@ +@@ -1060,6 +1068,7 @@ this.field_147369_b.func_190775_a(entity, enumhand); } else if (p_147340_1_.func_149565_c() == CPacketUseEntity.Action.INTERACT_AT) { EnumHand enumhand1 = p_147340_1_.func_186994_b(); @@ -53,16 +53,16 @@ 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) { if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.field_147369_b) { -@@ -1085,7 +1094,7 @@ +@@ -1090,7 +1099,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, DimensionType.OVERWORLD, 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()) { this.field_147369_b.func_71033_a(GameType.SPECTATOR); this.field_147369_b.func_71121_q().func_82736_K().func_82764_b("spectatorsGenerateChunks", "false", this.field_147367_d); -@@ -1265,5 +1274,7 @@ +@@ -1270,5 +1279,7 @@ } public void func_147349_a(CPacketCustomPayload p_147349_1_) { diff --git a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch index e0d0bacc6..f6e46aa09 100644 --- a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch +++ b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch @@ -1,22 +1,22 @@ --- a/net/minecraft/network/NetworkSystem.java +++ b/net/minecraft/network/NetworkSystem.java -@@ -41,12 +41,13 @@ +@@ -40,12 +40,13 @@ import org.apache.logging.log4j.Logger; public class NetworkSystem { + private static final int READ_TIMEOUT = Integer.parseInt(System.getProperty("forge.readTimeout", "30")); private static final Logger field_151275_b = LogManager.getLogger(); - public static final LazyLoadBase field_151276_c = new LazyLoadBase(() -> { + public static final LazyLoadBase field_151276_c = new LazyLoadBase<>(() -> { - 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(() -> { + public static final LazyLoadBase field_181141_b = new LazyLoadBase<>(() -> { - 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()); }); private final MinecraftServer field_151273_d; public volatile boolean field_151277_a; -@@ -59,6 +60,7 @@ +@@ -58,6 +59,7 @@ } public void func_151265_a(@Nullable InetAddress p_151265_1_, int p_151265_2_) throws IOException { @@ -24,7 +24,7 @@ synchronized(this.field_151274_e) { Class oclass; LazyLoadBase lazyloadbase; -@@ -80,7 +82,7 @@ +@@ -79,7 +81,7 @@ ; } diff --git a/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch b/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch index a0e33c0ab..fe0b048f9 100644 --- a/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch +++ b/patches/minecraft/net/minecraft/network/PacketBuffer.java.patch @@ -14,9 +14,9 @@ + */ + public PacketBuffer writeItemStack(ItemStack p_150788_1_, boolean limitedTag) { if (p_150788_1_.func_190926_b()) { - this.writeShort(-1); + this.writeBoolean(false); } else { -@@ -264,7 +273,7 @@ +@@ -265,7 +274,7 @@ this.writeByte(p_150788_1_.func_190916_E()); NBTTagCompound nbttagcompound = null; if (item.func_77645_m() || item.func_77651_p()) { @@ -25,8 +25,8 @@ } this.func_150786_a(nbttagcompound); -@@ -280,7 +289,7 @@ - } else { +@@ -281,7 +290,7 @@ + int i = this.func_150792_a(); int j = this.readByte(); ItemStack itemstack = new ItemStack(Item.func_150899_d(i), j); - itemstack.func_77982_d(this.func_150793_b()); diff --git a/patches/minecraft/net/minecraft/potion/Potion.java.patch b/patches/minecraft/net/minecraft/potion/Potion.java.patch index 14b0a0ef5..506483abc 100644 --- a/patches/minecraft/net/minecraft/potion/Potion.java.patch +++ b/patches/minecraft/net/minecraft/potion/Potion.java.patch @@ -1,17 +1,15 @@ --- a/net/minecraft/potion/Potion.java +++ b/net/minecraft/potion/Potion.java -@@ -23,8 +23,8 @@ +@@ -23,7 +23,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class Potion { -- public static final RegistryNamespaced field_188414_b = new RegistryNamespaced(); +public class Potion extends net.minecraftforge.registries.ForgeRegistryEntry { -+ public static final RegistryNamespaced field_188414_b = net.minecraftforge.registries.GameData.getWrapper(Potion.class); - private final Map field_111188_I = Maps.newHashMap(); + private final Map field_111188_I = Maps.newHashMap(); private final boolean field_76418_K; private final int field_76414_N; -@@ -162,7 +162,6 @@ +@@ -161,7 +161,6 @@ return this.field_76417_J; } @@ -19,9 +17,9 @@ public boolean func_76398_f() { return this.field_76418_K; } -@@ -259,4 +258,70 @@ +@@ -258,4 +257,70 @@ private static void func_210759_a(int p_210759_0_, String p_210759_1_, Potion p_210759_2_) { - field_188414_b.func_177775_a(p_210759_0_, new ResourceLocation(p_210759_1_), p_210759_2_); + IRegistry.field_212631_t.func_177775_a(p_210759_0_, new ResourceLocation(p_210759_1_), p_210759_2_); } + + /** diff --git a/patches/minecraft/net/minecraft/potion/PotionBrewing.java.patch b/patches/minecraft/net/minecraft/potion/PotionBrewing.java.patch index d6a273a9a..ffdd30ac1 100644 --- a/patches/minecraft/net/minecraft/potion/PotionBrewing.java.patch +++ b/patches/minecraft/net/minecraft/potion/PotionBrewing.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/potion/PotionBrewing.java +++ b/net/minecraft/potion/PotionBrewing.java -@@ -67,7 +67,7 @@ +@@ -68,7 +68,7 @@ for(int j = field_185214_b.size(); i < j; ++i) { PotionBrewing.MixPredicate mixpredicate = field_185214_b.get(i); @@ -9,7 +9,7 @@ return true; } } -@@ -81,7 +81,7 @@ +@@ -82,7 +82,7 @@ for(int j = field_185213_a.size(); i < j; ++i) { PotionBrewing.MixPredicate mixpredicate = field_185213_a.get(i); @@ -18,7 +18,7 @@ return true; } } -@@ -97,8 +97,8 @@ +@@ -98,8 +98,8 @@ for(int j = field_185214_b.size(); i < j; ++i) { PotionBrewing.MixPredicate mixpredicate = field_185214_b.get(i); @@ -29,7 +29,7 @@ } } -@@ -106,8 +106,8 @@ +@@ -107,8 +107,8 @@ for(int k = field_185213_a.size(); i < k; ++i) { PotionBrewing.MixPredicate mixpredicate1 = field_185213_a.get(i); @@ -40,8 +40,8 @@ } } } -@@ -200,15 +200,15 @@ - field_185213_a.add(new PotionBrewing.MixPredicate(p_193357_0_, Ingredient.func_199804_a(p_193357_1_), p_193357_2_)); +@@ -201,15 +201,15 @@ + field_185213_a.add(new PotionBrewing.MixPredicate<>(p_193357_0_, Ingredient.func_199804_a(p_193357_1_), p_193357_2_)); } - static class MixPredicate { diff --git a/patches/minecraft/net/minecraft/potion/PotionType.java.patch b/patches/minecraft/net/minecraft/potion/PotionType.java.patch index 917091c8c..23b384c3d 100644 --- a/patches/minecraft/net/minecraft/potion/PotionType.java.patch +++ b/patches/minecraft/net/minecraft/potion/PotionType.java.patch @@ -1,14 +1,11 @@ --- a/net/minecraft/potion/PotionType.java +++ b/net/minecraft/potion/PotionType.java -@@ -7,9 +7,8 @@ +@@ -7,7 +7,7 @@ import net.minecraft.util.ResourceLocation; - import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey; + import net.minecraft.util.registry.IRegistry; -public class PotionType { -- private static final ResourceLocation field_185177_b = new ResourceLocation("empty"); -- public static final RegistryNamespacedDefaultedByKey field_185176_a = new RegistryNamespacedDefaultedByKey(field_185177_b); +public class PotionType extends net.minecraftforge.registries.ForgeRegistryEntry { -+ public static final RegistryNamespacedDefaultedByKey field_185176_a = net.minecraftforge.registries.GameData.getWrapperDefaulted(PotionType.class); private final String field_185179_d; private final ImmutableList field_185180_e; diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index f78809bf8..4d8e33f8a 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,75 +1,54 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -148,7 +148,6 @@ - private int field_71280_D; - private int field_143008_E; - public final long[] field_71311_j = new long[100]; -- public long[][] field_71312_k; - private KeyPair field_71292_I; - private String field_71293_J; - private String field_71294_K; -@@ -287,8 +286,7 @@ - public void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, JsonElement p_71247_6_) { - this.func_71237_c(p_71247_1_); - this.func_200245_b(new TextComponentTranslation("menu.loadingLevel", new Object[0])); -- this.field_71305_c = new WorldServer[3]; -- this.field_71312_k = new long[this.field_71305_c.length][100]; -+ this.field_71305_c = new WorldServer[1]; //Forge only initialize overworld, we will do the rest. - ISaveHandler isavehandler = this.field_71310_m.func_197715_a(p_71247_1_, this); - this.func_175584_a(this.func_71270_I(), isavehandler); - WorldInfo worldinfo = isavehandler.func_75757_d(); -@@ -340,6 +338,18 @@ - } +@@ -335,20 +335,19 @@ + worldserver.func_72912_H().func_76060_a(this.func_71265_f()); } -+ for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) { -+ WorldServer world = this.field_71305_c[0]; -+ if (dim != 0) { -+ world = (WorldServer)(new WorldServerMulti(this, isavehandler, dim, this.field_71305_c[0], this.field_71304_b).func_175643_b()); +- WorldServerMulti worldservermulti = (new WorldServerMulti(this, p_212369_1_, DimensionType.NETHER, worldserver, this.field_71304_b)).func_212251_i__(); +- this.field_71305_c.put(DimensionType.NETHER, worldservermulti); +- worldservermulti.func_72954_a(new ServerWorldEventHandler(this, worldservermulti)); +- if (!this.func_71264_H()) { +- worldservermulti.func_72912_H().func_76060_a(this.func_71265_f()); ++ for (DimensionType dim : DimensionType.func_212681_b()) { ++ WorldServer world = worldserver; ++ if (dim != DimensionType.OVERWORLD) { ++ world = (new WorldServerMulti(this, p_212369_1_, dim, worldserver, this.field_71304_b)).func_212251_i__(); ++ this.field_71305_c.put(dim, world); + 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)); -+ } -+ - this.field_71318_t.func_72364_a(this.field_71305_c); - if (worldinfo.func_201357_P() != null) { - this.func_201300_aS().func_201381_a(worldinfo.func_201357_P()); -@@ -378,7 +388,7 @@ - this.func_200245_b(new TextComponentTranslation("menu.generatingTerrain", new Object[0])); - int j1 = 0; - field_147145_h.info("Preparing start region for level 0"); -- WorldServer worldserver = this.field_71305_c[0]; -+ WorldServer worldserver = func_71218_a(0); - BlockPos blockpos = worldserver.func_175694_M(); - List list = Lists.newArrayList(); - Set set = Sets.newConcurrentHashSet(); -@@ -493,9 +503,14 @@ - - for(WorldServer worldserver1 : this.field_71305_c) { - if (worldserver1 != null) { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver1)); - worldserver1.close(); - } - } -+ -+ WorldServer[] tmp = this.field_71305_c; -+ for (WorldServer world : tmp) -+ net.minecraftforge.common.DimensionManager.setWorld(world.field_73011_w.getId(), null, this); } - if (this.field_71307_n.func_76468_d()) { -@@ -523,6 +538,7 @@ +- WorldServerMulti worldservermulti1 = (new WorldServerMulti(this, p_212369_1_, DimensionType.THE_END, worldserver, this.field_71304_b)).func_212251_i__(); +- this.field_71305_c.put(DimensionType.THE_END, worldservermulti1); +- worldservermulti1.func_72954_a(new ServerWorldEventHandler(this, worldservermulti1)); +- if (!this.func_71264_H()) { +- worldservermulti1.func_72912_H().func_76060_a(this.func_71265_f()); +- } +- + this.func_184103_al().func_212504_a(worldserver); + if (p_212369_3_.func_201357_P() != null) { + this.func_201300_aS().func_201381_a(p_212369_3_.func_201357_P()); +@@ -514,6 +513,7 @@ + + for(WorldServer worldserver1 : this.func_212370_w()) { + if (worldserver1 != null) { ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver1)); + worldserver1.close(); + } + } +@@ -547,6 +547,7 @@ public void run() { try { if (this.func_71197_b()) { + net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarted(this); this.field_211151_aa = Util.func_211177_b(); this.field_147147_p.func_151315_a(new TextComponentString(this.field_71286_C)); - this.field_147147_p.func_151321_a(new ServerStatusResponse.Version("1.13", 393)); -@@ -546,7 +562,10 @@ + this.field_147147_p.func_151321_a(new ServerStatusResponse.Version("1.13.2", 404)); +@@ -570,7 +571,10 @@ this.field_71296_Q = true; } @@ -80,7 +59,7 @@ this.func_71228_a((CrashReport)null); } } catch (Throwable throwable1) { -@@ -565,6 +584,7 @@ +@@ -589,6 +593,7 @@ field_147145_h.error("We were unable to save this crash report to disk."); } @@ -88,7 +67,7 @@ this.func_71228_a(crashreport); } finally { try { -@@ -573,6 +593,7 @@ +@@ -597,6 +602,7 @@ } catch (Throwable throwable) { field_147145_h.error("Exception stopping the server", throwable); } finally { @@ -96,15 +75,15 @@ this.func_71240_o(); } -@@ -628,6 +649,7 @@ +@@ -652,6 +658,7 @@ - public void func_71217_p() { + public void func_71217_p(BooleanSupplier p_71217_1_) { long i = Util.func_211178_c(); + net.minecraftforge.fml.hooks.BasicEventHooks.onPreServerTick(); ++this.field_71315_w; if (this.field_71295_T) { this.field_71295_T = false; -@@ -648,6 +670,7 @@ +@@ -672,6 +679,7 @@ Collections.shuffle(Arrays.asList(agameprofile)); this.field_147147_p.func_151318_b().func_151330_a(agameprofile); @@ -112,43 +91,23 @@ } if (this.field_71315_w % 900 == 0) { -@@ -672,6 +695,7 @@ +@@ -696,6 +704,7 @@ this.field_211152_ao = this.field_211152_ao * 0.8F + (float)l / 1000000.0F * 0.19999999F; this.field_71304_b.func_76319_b(); this.field_71304_b.func_76319_b(); + net.minecraftforge.fml.hooks.BasicEventHooks.onPostServerTick(); } - public void func_71190_q() { -@@ -686,20 +710,23 @@ - this.func_193030_aL().func_73660_a(); - this.field_71304_b.func_76318_c("levels"); - -- for(int i = 0; i < this.field_71305_c.length; ++i) { -+ 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 j = Util.func_211178_c(); -- if (i == 0 || this.func_71255_r()) { -- WorldServer worldserver = this.field_71305_c[i]; -+ WorldServer worldserver = func_71218_a(id); -+ if (id == 0 || this.func_71255_r()) { - this.field_71304_b.func_194340_a(() -> { - return worldserver.func_72912_H().func_76065_j(); - }); - 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.getId()); - this.field_71304_b.func_76319_b(); + public void func_71190_q(BooleanSupplier p_71190_1_) { +@@ -723,6 +732,7 @@ } this.field_71304_b.func_76320_a("tick"); + net.minecraftforge.fml.hooks.BasicEventHooks.onPreWorldTick(worldserver); try { - worldserver.func_72835_b(); -@@ -717,6 +744,7 @@ + worldserver.func_72835_b(p_71190_1_); +@@ -740,6 +750,7 @@ throw new ReportedException(crashreport1); } @@ -156,20 +115,16 @@ this.field_71304_b.func_76319_b(); this.field_71304_b.func_76320_a("tracker"); worldserver.func_73039_n().func_72788_a(); -@@ -724,9 +752,11 @@ - this.field_71304_b.func_76319_b(); - } - -- this.field_71312_k[i][this.field_71315_w % 100] = Util.func_211178_c() - j; -+ worldserver.setTickTime(this.field_71315_w, Util.func_211178_c() - j); +@@ -752,6 +763,8 @@ + }))[this.field_71315_w % 100] = Util.func_211178_c() - i; } + this.field_71304_b.func_76318_c("dim_unloading"); -+ net.minecraftforge.common.DimensionManager.unloadWorlds(); ++ net.minecraftforge.common.DimensionManager.unloadWorlds(this, this.field_71315_w % 200 == 0); this.field_71304_b.func_76318_c("connection"); this.func_147137_ag().func_151269_c(); this.field_71304_b.func_76318_c("players"); -@@ -749,6 +779,14 @@ +@@ -774,6 +787,14 @@ } public static void main(String[] p_main_0_) { @@ -184,7 +139,7 @@ Bootstrap.func_151354_b(); try { -@@ -851,7 +889,7 @@ +@@ -876,7 +897,7 @@ } public void func_71256_s() { @@ -193,20 +148,16 @@ this.field_175590_aa.setUncaughtExceptionHandler((p_195574_0_, p_195574_1_) -> { field_147145_h.error(p_195574_1_); }); -@@ -871,11 +909,7 @@ +@@ -896,7 +917,7 @@ } - public WorldServer func_71218_a(int p_71218_1_) { -- if (p_71218_1_ == -1) { -- return this.field_71305_c[1]; -- } else { -- return p_71218_1_ == 1 ? this.field_71305_c[2] : this.field_71305_c[0]; -- } -+ return net.minecraftforge.common.DimensionManager.getWorld(p_71218_1_, true, true); + public WorldServer func_71218_a(DimensionType p_71218_1_) { +- return this.field_71305_c.get(p_71218_1_); ++ return net.minecraftforge.common.DimensionManager.getWorld(this, p_71218_1_, true, true); } - public WorldServer func_200667_a(DimensionType p_200667_1_) { -@@ -918,7 +952,7 @@ + public Iterable func_212370_w() { +@@ -935,7 +956,7 @@ } public String getServerModName() { @@ -215,3 +166,18 @@ } public CrashReport func_71230_b(CrashReport p_71230_1_) { +@@ -1472,4 +1493,14 @@ + return 0; + } + } ++ ++ @Nullable ++ public long[] getTickTime(DimensionType dim) { ++ return field_71312_k.get(dim); ++ } ++ ++ @Deprecated //Forge Internal use Only, You can screw up a lot of things if you mess with this map. ++ public synchronized Map forgeGetWorldMap() { ++ return this.field_71305_c; ++ } + } diff --git a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch index 08e26b4b4..4950d04c9 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -89,6 +89,7 @@ +@@ -91,6 +91,7 @@ public boolean func_71197_b() throws IOException { Thread thread = new Thread("Server console handler") { public void run() { @@ -8,7 +8,7 @@ BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); String s4; -@@ -110,6 +111,7 @@ +@@ -112,6 +113,7 @@ field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } @@ -16,7 +16,7 @@ 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")); -@@ -181,6 +183,7 @@ +@@ -183,6 +185,7 @@ if (!PreYggdrasilConverter.func_152714_a(this.field_71340_o)) { return false; } else { @@ -24,7 +24,7 @@ this.func_184105_a(new DedicatedPlayerList(this)); long j = Util.func_211178_c(); if (this.func_71270_I() == null) { -@@ -218,6 +221,7 @@ +@@ -220,6 +223,7 @@ TileEntitySkull.func_184293_a(this.func_152358_ax()); TileEntitySkull.func_184294_a(this.func_147130_as()); PlayerProfileCache.func_187320_a(this.func_71266_T()); @@ -32,7 +32,7 @@ field_155771_h.info("Preparing level \"{}\"", (Object)this.func_71270_I()); JsonObject jsonobject = new JsonObject(); if (worldtype == WorldType.field_77138_c) { -@@ -230,6 +234,7 @@ +@@ -232,6 +236,7 @@ long i1 = Util.func_211178_c() - j; String s3 = String.format(Locale.ROOT, "%.3fs", (double)i1 / 1.0E9D); field_155771_h.info("Done ({})! For help, type \"help\"", (Object)s3); @@ -40,7 +40,7 @@ if (this.field_71340_o.func_187239_a("announce-player-achievements")) { this.func_200252_aR().func_82764_b("announceAdvancements", this.field_71340_o.func_73670_a("announce-player-achievements", true) ? "true" : "false", this); this.field_71340_o.func_187238_b("announce-player-achievements"); -@@ -257,7 +262,8 @@ +@@ -259,7 +264,8 @@ } Items.field_190931_a.func_150895_a(ItemGroup.field_78027_g, NonNullList.func_191196_a()); @@ -50,16 +50,7 @@ } } } -@@ -436,7 +442,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.getId() != 0) { - return false; - } else if (this.func_184103_al().func_152603_m().func_152690_d()) { - return false; -@@ -566,4 +572,9 @@ +@@ -568,4 +574,9 @@ this.func_195571_aL().func_197059_a(this.field_184115_n.func_195540_f(), p_71252_1_); return this.field_184115_n.func_70008_c(); } diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index d1ba0daab..144611fb6 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -1,47 +1,18 @@ --- a/net/minecraft/server/integrated/IntegratedServer.java +++ b/net/minecraft/server/integrated/IntegratedServer.java -@@ -62,8 +62,7 @@ - - public void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, JsonElement 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]; -+ this.field_71305_c = new WorldServer[1]; //Forge only initialize overworld, we will do the rest. - ISaveHandler isavehandler = this.func_71254_M().func_197715_a(p_71247_1_, this); - this.func_175584_a(this.func_71270_I(), isavehandler); - WorldInfo worldinfo = isavehandler.func_75757_d(); -@@ -100,6 +99,18 @@ - this.field_71305_c[i].func_72954_a(new ServerWorldEventHandler(this, this.field_71305_c[i])); - } - -+ for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) { -+ WorldServer world = this.field_71305_c[0]; -+ if (dim != 0) { -+ world = (WorldServer)(new WorldServerMulti(this, isavehandler, dim, this.field_71305_c[0], 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)); -+ } -+ - this.func_184103_al().func_72364_a(this.field_71305_c); - if (worldinfo.func_201357_P() != null) { - this.func_201300_aS().func_201381_a(worldinfo.func_201357_P()); -@@ -121,9 +132,10 @@ +@@ -91,9 +91,10 @@ this.func_71245_h(true); field_147148_h.info("Generating keypair"); this.func_71253_a(CryptManager.func_75891_b()); + if (!net.minecraftforge.fml.server.ServerLifecycleHooks.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_205391_j()); - this.func_71205_p(this.func_71214_G() + " - " + this.field_71305_c[0].func_72912_H().func_76065_j()); + this.func_71205_p(this.func_71214_G() + " - " + this.func_71218_a(DimensionType.OVERWORLD).func_72912_H().func_76065_j()); - return true; + return net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarting(this); } - public void func_71217_p() { -@@ -176,6 +188,7 @@ + public void func_71217_p(BooleanSupplier p_71217_1_) { +@@ -146,6 +147,7 @@ } public EnumDifficulty func_147135_j() { @@ -49,7 +20,7 @@ return this.field_71349_l.field_71441_e.func_72912_H().func_176130_y(); } -@@ -275,6 +288,7 @@ +@@ -245,6 +247,7 @@ } public void func_71263_m() { diff --git a/patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch index 265e63674..415b10dbb 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerChunkMapEntry.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/management/PlayerChunkMapEntry.java +++ b/net/minecraft/server/management/PlayerChunkMapEntry.java -@@ -30,11 +30,17 @@ +@@ -31,13 +31,19 @@ private int field_187288_h; private long field_187289_i; private boolean field_187290_j; @@ -10,15 +10,17 @@ 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_); + ChunkProviderServer chunkproviderserver = p_i1518_1_.func_72688_a().func_72863_F(); + chunkproviderserver.func_212469_a(p_i1518_2_, p_i1518_3_); + //this.loadedRunnable = () -> { - this.field_187286_f = p_i1518_1_.func_72688_a().func_72863_F().func_201714_b(p_i1518_2_, p_i1518_3_); + this.field_187286_f = chunkproviderserver.func_186025_d(p_i1518_2_, p_i1518_3_, true, false); + /*this.loading = false; + }; Forge: Pending if we find a better way to async load/gen chunks. + mapIn.getWorld().getChunkProvider().loadChunk(chunkX, chunkZ, this.loadedRunnable);*/ } public ChunkPos func_187264_a() { -@@ -52,6 +58,8 @@ +@@ -55,6 +61,8 @@ this.field_187283_c.add(p_187276_1_); if (this.field_187290_j) { this.func_187278_c(p_187276_1_); @@ -27,7 +29,7 @@ } } -@@ -59,11 +67,26 @@ +@@ -62,11 +70,26 @@ public void func_187277_b(EntityPlayerMP p_187277_1_) { if (this.field_187283_c.contains(p_187277_1_)) { @@ -54,7 +56,7 @@ if (this.field_187283_c.isEmpty()) { this.field_187282_b.func_187305_b(this); } -@@ -72,6 +95,7 @@ +@@ -75,6 +98,7 @@ } public boolean func_187268_a(boolean p_187268_1_) { @@ -62,22 +64,16 @@ if (this.field_187286_f != null) { return true; } else { -@@ -96,11 +120,14 @@ - 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)); +@@ -100,6 +124,8 @@ + 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; -@@ -130,7 +157,7 @@ +@@ -130,7 +156,7 @@ } this.field_187288_h |= 1 << (p_187265_2_ >> 4); @@ -86,7 +82,7 @@ short short1 = (short)(p_187265_1_ << 12 | p_187265_3_ << 8 | p_187265_2_); for(int i = 0; i < this.field_187287_g; ++i) { -@@ -139,6 +166,8 @@ +@@ -139,6 +165,8 @@ } } @@ -95,7 +91,7 @@ this.field_187285_e[this.field_187287_g++] = short1; } -@@ -163,20 +192,22 @@ +@@ -163,20 +191,22 @@ 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)); @@ -122,7 +118,7 @@ this.func_187273_a(this.field_187282_b.func_72688_a().func_175625_s(blockpos1)); } } -@@ -240,4 +271,8 @@ +@@ -240,4 +270,8 @@ return d0; } diff --git a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch index 08a7cb8ad..212897727 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/management/PlayerList.java +++ b/net/minecraft/server/management/PlayerList.java -@@ -113,7 +113,16 @@ +@@ -107,7 +107,16 @@ String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); playerprofilecache.func_152649_a(gameprofile); NBTTagCompound nbttagcompound = this.func_72380_a(p_72355_2_); @@ -9,7 +9,7 @@ + //Forge: Make sure the dimension hasn't been deleted, if so stick them in the overworld. + WorldServer playerWorld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + if (playerWorld == null) { -+ p_72355_2_.field_71093_bK = 0; ++ p_72355_2_.field_71093_bK = DimensionType.OVERWORLD; + playerWorld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + p_72355_2_.func_70107_b(playerWorld.func_72912_H().func_76079_c(), playerWorld.func_72912_H().func_76075_d(), playerWorld.func_72912_H().func_76074_e()); + } @@ -18,16 +18,7 @@ p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p); String s1 = "local"; if (p_72355_1_.func_74430_c() != null) { -@@ -125,7 +134,7 @@ - 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"))); -+ 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.getId(), 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(SPacketCustomPayload.field_209911_b, (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)); -@@ -184,6 +193,7 @@ +@@ -178,6 +187,7 @@ } p_72355_2_.func_71116_b(); @@ -35,7 +26,7 @@ } protected void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_) { -@@ -266,6 +276,7 @@ +@@ -260,6 +270,7 @@ nbttagcompound1 = nbttagcompound; p_72380_1_.func_70020_e(nbttagcompound); field_148546_d.debug("loading single player"); @@ -43,7 +34,7 @@ } else { nbttagcompound1 = this.field_72412_k.func_75752_b(p_72380_1_); } -@@ -274,6 +285,7 @@ +@@ -268,6 +279,7 @@ } protected void func_72391_b(EntityPlayerMP p_72391_1_) { @@ -51,15 +42,15 @@ this.field_72412_k.func_75753_a(p_72391_1_); StatisticsManagerServer statisticsmanagerserver = this.field_148547_k.get(p_72391_1_.func_110124_au()); if (statisticsmanagerserver != null) { -@@ -297,6 +309,7 @@ - p_72377_1_.field_71135_a.func_147359_a(new SPacketPlayerListItem(SPacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[]{this.field_72404_b.get(i)})); +@@ -291,6 +303,7 @@ + p_72377_1_.field_71135_a.func_147359_a(new SPacketPlayerListItem(SPacketPlayerListItem.Action.ADD_PLAYER, 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); this.field_72400_f.func_201300_aS().func_201383_a(p_72377_1_); -@@ -307,6 +320,7 @@ +@@ -301,6 +314,7 @@ } public void func_72367_e(EntityPlayerMP p_72367_1_) { @@ -67,7 +58,7 @@ WorldServer worldserver = p_72367_1_.func_71121_q(); p_72367_1_.func_195066_a(StatList.field_75947_j); this.func_72391_b(p_72367_1_); -@@ -324,6 +338,7 @@ +@@ -318,6 +332,7 @@ worldserver.func_72964_e(p_72367_1_.field_70176_ah, p_72367_1_.field_70164_aj).func_76630_e(); } } @@ -75,17 +66,17 @@ worldserver.func_72900_e(p_72367_1_); worldserver.func_184164_w().func_72695_c(p_72367_1_); -@@ -397,13 +412,21 @@ +@@ -391,13 +406,21 @@ } - public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) { + public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, DimensionType p_72368_2_, boolean p_72368_3_) { + WorldServer world = field_72400_f.func_71218_a(p_72368_2_); + if (world == null) + p_72368_2_ = p_72368_1_.getSpawnDimension(); + else if (!world.func_201675_m().func_76567_e()) + p_72368_2_ = world.func_201675_m().getRespawnDimension(p_72368_1_); + if (field_72400_f.func_71218_a(p_72368_2_) == null) -+ p_72368_2_ = 0; ++ p_72368_2_ = DimensionType.OVERWORLD; + 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_); @@ -99,7 +90,7 @@ p_72368_1_.field_71093_bK = p_72368_2_; PlayerInteractionManager playerinteractionmanager; if (this.field_72400_f.func_71242_L()) { -@@ -415,6 +438,7 @@ +@@ -409,6 +432,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_); @@ -107,7 +98,7 @@ entityplayermp.func_145769_d(p_72368_1_.func_145782_y()); entityplayermp.func_184819_a(p_72368_1_.func_184591_cq()); -@@ -428,7 +452,7 @@ +@@ -422,7 +446,7 @@ BlockPos blockpos1 = EntityPlayer.func_180467_a(this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), blockpos, flag); if (blockpos1 != null) { entityplayermp.func_70012_b((double)((float)blockpos1.func_177958_n() + 0.5F), (double)((float)blockpos1.func_177956_o() + 0.1F), (double)((float)blockpos1.func_177952_p() + 0.5F), 0.0F, 0.0F); @@ -116,7 +107,7 @@ } else { entityplayermp.field_71135_a.func_147359_a(new SPacketChangeGameState(0, 0.0F)); } -@@ -453,6 +477,7 @@ +@@ -447,6 +471,7 @@ this.field_177454_f.put(entityplayermp.func_110124_au(), entityplayermp); entityplayermp.func_71116_b(); entityplayermp.func_70606_j(entityplayermp.func_110143_aJ()); @@ -124,61 +115,60 @@ return entityplayermp; } -@@ -463,15 +488,19 @@ +@@ -457,15 +482,19 @@ } - public void func_187242_a(EntityPlayerMP p_187242_1_, int p_187242_2_) { + public void func_187242_a(EntityPlayerMP p_187242_1_, DimensionType p_187242_2_) { + changePlayerDimension(p_187242_1_, p_187242_2_, field_72400_f.func_71218_a(p_187242_2_).func_85176_s()); + } + -+ public void changePlayerDimension(EntityPlayerMP p_187242_1_, int p_187242_2_, net.minecraftforge.common.util.ITeleporter teleporter) { - int i = p_187242_1_.field_71093_bK; ++ public void changePlayerDimension(EntityPlayerMP p_187242_1_, DimensionType p_187242_2_, net.minecraftforge.common.util.ITeleporter teleporter) { + DimensionType dimensiontype = 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, worldserver.func_175659_aa(), worldserver.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_82448_a(p_187242_1_, dimensiontype, worldserver, worldserver1); ++ this.transferEntityToWorld(p_187242_1_, dimensiontype, 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); -@@ -482,30 +511,25 @@ - for(PotionEffect potioneffect : p_187242_1_.func_70651_bq()) { +@@ -477,29 +506,25 @@ 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.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(p_187242_1_, i, p_187242_2_); ++ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(p_187242_1_, dimensiontype, p_187242_2_); } - public void func_82448_a(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) { + public void func_82448_a(Entity p_82448_1_, DimensionType 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()); + } + -+ 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) { ++ public void transferEntityToWorld(Entity p_82448_1_, DimensionType p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraftforge.common.util.ITeleporter teleporter) { + double moveFactor = p_82448_3_.func_201675_m().getMovementFactor() / p_82448_4_.func_201675_m().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 (p_82448_1_.field_71093_bK == DimensionType.NETHER) { - 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); - 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); - if (p_82448_1_.func_70089_S()) { - p_82448_3_.func_72866_a(p_82448_1_, false); - } -- } else if (p_82448_1_.field_71093_bK == 0) { +- } else if (p_82448_1_.field_71093_bK == DimensionType.OVERWORLD) { - 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); - 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); @@ -186,16 +176,16 @@ - p_82448_3_.func_72866_a(p_82448_1_, false); - } - } else { -+ if (p_82448_1_.field_71093_bK == 1 && teleporter.isVanilla()) { ++ if (p_82448_1_.field_71093_bK == DimensionType.THE_END && teleporter.isVanilla()) { BlockPos blockpos; - if (p_82448_2_ == 1) { + if (p_82448_2_ == DimensionType.THE_END) { blockpos = p_82448_4_.func_175694_M(); -@@ -523,13 +547,14 @@ +@@ -517,13 +542,14 @@ } p_82448_3_.field_72984_F.func_76319_b(); -- if (p_82448_2_ != 1) { -+ if (p_82448_2_ != 1 || !teleporter.isVanilla()) { +- if (p_82448_2_ != DimensionType.THE_END) { ++ if (p_82448_2_ != DimensionType.THE_END || !teleporter.isVanilla()) { p_82448_3_.field_72984_F.func_76320_a("placing"); d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872); d1 = (double)MathHelper.func_76125_a((int)d1, -29999872, 29999872); diff --git a/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch b/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch index a196e71f4..5d73d49fc 100644 --- a/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch @@ -1,17 +1,17 @@ --- a/net/minecraft/tileentity/MobSpawnerBaseLogic.java +++ b/net/minecraft/tileentity/MobSpawnerBaseLogic.java -@@ -113,8 +113,9 @@ +@@ -114,8 +114,9 @@ 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 || entityliving.func_205020_a(world, true) && 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_204210_a(world.func_175649_E(new BlockPos(entity)), (IEntityLivingData)null, (NBTTagCompound)null); } -@@ -256,4 +257,9 @@ +@@ -257,4 +258,9 @@ public double func_177223_e() { return this.field_98284_d; } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 5f71bf3cb..e53901a2e 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -1,10 +1,6 @@ --- a/net/minecraft/tileentity/TileEntity.java +++ b/net/minecraft/tileentity/TileEntity.java -@@ -12,10 +12,11 @@ - import net.minecraft.world.World; - import net.minecraftforge.api.distmarker.Dist; - import net.minecraftforge.api.distmarker.OnlyIn; -+ +@@ -16,7 +16,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -13,7 +9,7 @@ private static final Logger field_145852_a = LogManager.getLogger(); private final TileEntityType field_200663_e; protected World field_145850_b; -@@ -23,9 +24,13 @@ +@@ -24,9 +24,13 @@ protected boolean field_145846_f; @Nullable private IBlockState field_195045_e; @@ -27,7 +23,7 @@ } @Nullable -@@ -43,6 +48,8 @@ +@@ -44,6 +48,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")); @@ -36,7 +32,7 @@ } public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) { -@@ -58,6 +65,8 @@ +@@ -59,6 +65,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()); @@ -45,7 +41,7 @@ return p_189516_1_; } } -@@ -91,14 +100,13 @@ +@@ -92,14 +100,13 @@ if (this.field_145850_b != null) { this.field_195045_e = this.field_145850_b.func_180495_p(this.field_174879_c); this.field_145850_b.func_175646_b(this.field_174879_c, this); @@ -61,7 +57,7 @@ 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_; double d1 = (double)this.field_174879_c.func_177956_o() + 0.5D - p_145835_3_; -@@ -138,6 +146,7 @@ +@@ -139,6 +146,7 @@ public void func_145843_s() { this.field_145846_f = true; @@ -69,7 +65,7 @@ } public void func_145829_t() { -@@ -179,4 +188,11 @@ +@@ -180,4 +188,11 @@ public TileEntityType func_200662_C() { return this.field_200663_e; } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch index 9dd04216f..96fe88247 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityChest.java.patch @@ -8,7 +8,7 @@ protected TileEntityChest(TileEntityType p_i48287_1_) { super(p_i48287_1_); -@@ -220,7 +221,7 @@ +@@ -219,7 +220,7 @@ public static int func_195481_a(IBlockReader p_195481_0_, BlockPos p_195481_1_) { IBlockState iblockstate = p_195481_0_.func_180495_p(p_195481_1_); @@ -17,7 +17,7 @@ TileEntity tileentity = p_195481_0_.func_175625_s(p_195481_1_); if (tileentity instanceof TileEntityChest) { return ((TileEntityChest)tileentity).field_145987_o; -@@ -235,4 +236,57 @@ +@@ -234,4 +235,57 @@ p_199722_0_.func_199721_a(p_199722_1_.func_190576_q()); p_199722_1_.func_199721_a(nonnulllist); } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch index 798adfafd..519087c7f 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/tileentity/TileEntityFurnace.java +++ b/net/minecraft/tileentity/TileEntityFurnace.java -@@ -185,9 +185,9 @@ +@@ -184,9 +184,9 @@ super.func_145839_a(p_145839_1_); - this.field_145957_n = NonNullList.func_191197_a(this.func_70302_i_(), ItemStack.field_190927_a); + 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"); @@ -13,7 +13,7 @@ this.field_145963_i = func_145952_a(this.field_145957_n.get(1)); int i = p_145839_1_.func_74765_d("RecipesUsedSize"); -@@ -205,9 +205,9 @@ +@@ -204,9 +204,9 @@ public NBTTagCompound func_189515_b(NBTTagCompound p_189515_1_) { super.func_189515_b(p_189515_1_); @@ -26,10 +26,10 @@ ItemStackHelper.func_191282_a(p_189515_1_, this.field_145957_n); p_189515_1_.func_74777_a("RecipesUsedSize", (short)this.field_203901_m.size()); int i = 0; -@@ -248,12 +248,16 @@ +@@ -247,12 +247,16 @@ if (!this.field_145850_b.field_72995_K) { ItemStack itemstack = this.field_145957_n.get(1); - if (this.func_145950_i() || !itemstack.func_190926_b() && !((ItemStack)this.field_145957_n.get(0)).func_190926_b()) { + if (this.func_145950_i() || !itemstack.func_190926_b() && !this.field_145957_n.get(0).func_190926_b()) { - IRecipe irecipe = this.field_145850_b.func_199532_z().func_199515_b(this, this.field_145850_b); + IRecipe irecipe = this.field_145850_b.func_199532_z().getRecipe(this, this.field_145850_b, net.minecraftforge.common.crafting.VanillaRecipeTypes.SMELTING); if (!this.func_145950_i() && this.func_201566_b(irecipe)) { @@ -44,7 +44,7 @@ if (!itemstack.func_190926_b()) { Item item = itemstack.func_77973_b(); itemstack.func_190918_g(1); -@@ -293,7 +297,7 @@ +@@ -292,7 +296,7 @@ } private int func_201562_r() { @@ -53,7 +53,7 @@ return furnacerecipe != null ? furnacerecipe.func_201830_h() : 200; } -@@ -308,10 +312,10 @@ +@@ -307,10 +311,10 @@ return true; } else if (!itemstack1.func_77969_a(itemstack)) { return false; @@ -66,7 +66,7 @@ } } } else { -@@ -327,7 +331,7 @@ +@@ -326,7 +330,7 @@ if (itemstack2.func_190926_b()) { this.field_145957_n.set(2, itemstack1.func_77946_l()); } else if (itemstack2.func_77973_b() == itemstack1.func_77973_b()) { @@ -75,7 +75,7 @@ } if (!this.field_145850_b.field_72995_K) { -@@ -347,12 +351,13 @@ +@@ -346,12 +350,13 @@ return 0; } else { Item item = p_145952_0_.func_77973_b(); @@ -91,7 +91,7 @@ } public boolean func_70300_a(EntityPlayer p_70300_1_) { -@@ -501,4 +506,27 @@ +@@ -500,4 +505,27 @@ this.field_203901_m.clear(); } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch index 80313b4fb..8538dab6e 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/tileentity/TileEntityPiston.java +++ b/net/minecraft/tileentity/TileEntityPiston.java -@@ -101,7 +101,7 @@ +@@ -105,7 +105,7 @@ AxisAlignedBB axisalignedbb = this.func_190607_a(this.func_191515_a(list)); List list1 = this.field_145850_b.func_72839_b((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).func_111270_a(axisalignedbb)); if (!list1.isEmpty()) { diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch index 6c1980464..26c39cce6 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityShulkerBox.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/tileentity/TileEntityShulkerBox.java +++ b/net/minecraft/tileentity/TileEntityShulkerBox.java -@@ -331,6 +331,11 @@ +@@ -329,6 +329,11 @@ return !this.func_190581_E() || !this.func_191420_l() || this.func_145818_k_() || this.field_184284_m != null; } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityType.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityType.java.patch index b6acb03b9..1f09e3ff3 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityType.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityType.java.patch @@ -1,21 +1,18 @@ --- a/net/minecraft/tileentity/TileEntityType.java +++ b/net/minecraft/tileentity/TileEntityType.java -@@ -12,9 +12,9 @@ +@@ -12,7 +12,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -public class TileEntityType { +public class TileEntityType extends net.minecraftforge.registries.ForgeRegistryEntry> { private static final Logger field_206866_A = LogManager.getLogger(); -- public static final RegistryNamespaced> field_200970_a = new RegistryNamespaced>(); -+ public static final RegistryNamespaced> field_200970_a = (RegistryNamespaced)net.minecraftforge.registries.GameData.getWrapper(TileEntityType.class); public static final TileEntityType field_200971_b = func_200966_a("furnace", TileEntityType.Builder.func_200963_a(TileEntityFurnace::new)); public static final TileEntityType field_200972_c = func_200966_a("chest", TileEntityType.Builder.func_200963_a(TileEntityChest::new)); - public static final TileEntityType field_200973_d = func_200966_a("trapped_chest", TileEntityType.Builder.func_200963_a(TileEntityTrappedChest::new)); -@@ -53,7 +53,7 @@ +@@ -52,7 +52,7 @@ try { - type = DataFixesManager.func_210901_a().getSchema(DataFixUtils.makeKey(1519)).getChoiceType(TypeReferences.field_211294_j, p_200966_0_); + type = DataFixesManager.func_210901_a().getSchema(DataFixUtils.makeKey(1631)).getChoiceType(TypeReferences.field_211294_j, p_200966_0_); - } catch (IllegalStateException illegalstateexception) { + } catch (IllegalArgumentException illegalstateexception) { if (SharedConstants.field_206244_b) { diff --git a/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch b/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch index 8e4a2c019..a1778866c 100644 --- a/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch +++ b/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.java.patch @@ -4,9 +4,9 @@ import java.util.Set; public class ClassInheritanceMultiMap extends AbstractSet { -- private static final Set> field_181158_a = Sets.>newHashSet(); +- private static final Set> field_181158_a = Sets.newHashSet(); + // Forge: Use concurrent collection to allow creating chunks from multiple threads safely + private static final Set> field_181158_a = java.util.Collections.newSetFromMap(new java.util.concurrent.ConcurrentHashMap, Boolean>()); - private final Map, List> field_180218_a = Maps., List>newHashMap(); - private final Set> field_180216_b = Sets.>newIdentityHashSet(); + private final Map, List> field_180218_a = Maps.newHashMap(); + private final Set> field_180216_b = Sets.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 index bb8b6c49a..7740fe7a6 100644 --- a/patches/minecraft/net/minecraft/util/EnumFacing.java.patch +++ b/patches/minecraft/net/minecraft/util/EnumFacing.java.patch @@ -39,7 +39,7 @@ @Nullable - @OnlyIn(Dist.CLIENT) public static EnumFacing func_176739_a(@Nullable String p_176739_0_) { - return p_176739_0_ == null ? null : (EnumFacing)field_176761_p.get(p_176739_0_.toLowerCase(Locale.ROOT)); + return p_176739_0_ == null ? null : field_176761_p.get(p_176739_0_.toLowerCase(Locale.ROOT)); } @@ -295,7 +289,6 @@ throw new IllegalArgumentException("No such direction: " + p_181076_0_ + " " + p_181076_1_); diff --git a/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch b/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch index 52b254b5d..2a5c51459 100644 --- a/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch +++ b/patches/minecraft/net/minecraft/util/ScreenShotHelper.java.patch @@ -1,25 +1,40 @@ --- a/net/minecraft/util/ScreenShotHelper.java +++ b/net/minecraft/util/ScreenShotHelper.java -@@ -39,10 +39,21 @@ - file2 = new File(file1, p_148259_1_); - } +@@ -34,19 +34,34 @@ + NativeImage nativeimage = func_198052_a(p_148259_2_, p_148259_3_, p_148259_4_); + File file1 = new File(p_148259_0_, "screenshots"); + file1.mkdir(); +- File file2; ++ File target; + if (p_148259_1_ == null) { +- file2 = func_74290_a(file1); ++ target = func_74290_a(file1); + } else { +- file2 = new File(file1, p_148259_1_); ++ target = 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(nativeimage, file2); -+ if (event.isCanceled()) { -+ return event.getCancelMessage(); -+ } else { -+ file2 = event.getScreenshotFile(); -+ } - nativeimage.func_209271_a(file2); -+ final File output = file2; - ITextComponent itextcomponent = (new TextComponentString(file2.getName())).func_211708_a(TextFormatting.UNDERLINE).func_211710_a((p_211564_1_) -> { -- p_211564_1_.func_150241_a(new ClickEvent(ClickEvent.Action.OPEN_FILE, file2.getAbsolutePath())); -+ p_211564_1_.func_150241_a(new ClickEvent(ClickEvent.Action.OPEN_FILE, output.getAbsolutePath())); - }); -+ if (event.getResultMessage() != null) { -+ return event.getResultMessage(); -+ } - TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("screenshot.success", new Object[]{itextcomponent}); - return textcomponenttranslation; - } catch (Exception exception) { ++ try { ++ target = target.getCanonicalFile(); // FORGE: Fix errors on Windows with paths that include \.\ ++ } catch (java.io.IOException e) {} ++ net.minecraftforge.client.event.ScreenshotEvent event = net.minecraftforge.client.ForgeHooksClient.onScreenshot(nativeimage, target); ++ if (event.isCanceled()) { ++ p_148259_5_.accept(event.getCancelMessage()); ++ return; ++ } else { ++ target = event.getScreenshotFile(); ++ } ++ ++ final File file2 = target; + SimpleResource.field_199031_a.execute(() -> { + try { + nativeimage.func_209271_a(file2); + ITextComponent itextcomponent = (new TextComponentString(file2.getName())).func_211708_a(TextFormatting.UNDERLINE).func_211710_a((p_212451_1_) -> { + p_212451_1_.func_150241_a(new ClickEvent(ClickEvent.Action.OPEN_FILE, file2.getAbsolutePath())); + }); ++ if (event.getResultMessage() != null) { ++ p_148259_5_.accept(event.getResultMessage()); ++ } else + p_148259_5_.accept(new TextComponentTranslation("screenshot.success", itextcomponent)); + } catch (Exception exception) { + field_148261_a.warn("Couldn't save screenshot", (Throwable)exception); diff --git a/patches/minecraft/net/minecraft/util/SoundEvent.java.patch b/patches/minecraft/net/minecraft/util/SoundEvent.java.patch index ceb1ffecb..f9359fc9e 100644 --- a/patches/minecraft/net/minecraft/util/SoundEvent.java.patch +++ b/patches/minecraft/net/minecraft/util/SoundEvent.java.patch @@ -1,13 +1,11 @@ --- a/net/minecraft/util/SoundEvent.java +++ b/net/minecraft/util/SoundEvent.java -@@ -4,8 +4,8 @@ +@@ -4,7 +4,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class SoundEvent { -- public static final RegistryNamespaced field_187505_a = new RegistryNamespaced(); +public class SoundEvent extends net.minecraftforge.registries.ForgeRegistryEntry { -+ public static final RegistryNamespaced field_187505_a = net.minecraftforge.registries.GameData.getWrapper(SoundEvent.class); private final ResourceLocation field_187506_b; public SoundEvent(ResourceLocation p_i46834_1_) { diff --git a/patches/minecraft/net/minecraft/util/registry/IRegistry.java.patch b/patches/minecraft/net/minecraft/util/registry/IRegistry.java.patch new file mode 100644 index 000000000..a9b19681e --- /dev/null +++ b/patches/minecraft/net/minecraft/util/registry/IRegistry.java.patch @@ -0,0 +1,41 @@ +--- a/net/minecraft/util/registry/IRegistry.java ++++ b/net/minecraft/util/registry/IRegistry.java +@@ -30,25 +30,29 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++/* ++ * Attention Modders: This SHOULD NOT be used, you should use ForgeRegistries instead. As it has a cleaner modder facing API. ++ * We will be wrapping all of these in our API as nessasary for syncing and management. ++ */ + public interface IRegistry extends IObjectIntIterable { + Logger field_212616_e = LogManager.getLogger(); + IRegistry> field_212617_f = new RegistryNamespaced<>(); +- IRegistry field_212618_g = func_212610_a("block", new RegistryNamespacedDefaultedByKey<>(new ResourceLocation("air"))); ++ @Deprecated IRegistry field_212618_g = func_212610_a("block", net.minecraftforge.registries.GameData.getWrapperDefaulted(Block.class)); + IRegistry field_212619_h = func_212610_a("fluid", new RegistryNamespacedDefaultedByKey<>(new ResourceLocation("empty"))); + IRegistry field_212620_i = func_212610_a("motive", new RegistryNamespacedDefaultedByKey<>(new ResourceLocation("kebab"))); +- IRegistry field_212621_j = func_212610_a("potion", new RegistryNamespacedDefaultedByKey<>(new ResourceLocation("empty"))); +- IRegistry field_212622_k = func_212610_a("dimension_type", new RegistryNamespaced<>()); ++ @Deprecated IRegistry field_212621_j = func_212610_a("potion", net.minecraftforge.registries.GameData.getWrapperDefaulted(PotionType.class)); ++ @Deprecated IRegistry field_212622_k = func_212610_a("dimension_type", net.minecraftforge.common.DimensionManager.getRegistry()); + IRegistry field_212623_l = func_212610_a("custom_stat", new RegistryNamespaced<>()); +- IRegistry field_212624_m = func_212610_a("biome", new RegistryNamespaced<>()); ++ @Deprecated IRegistry field_212624_m = func_212610_a("biome", net.minecraftforge.registries.GameData.getWrapper(Biome.class)); + IRegistry> field_212625_n = func_212610_a("biome_source_type", new RegistryNamespaced<>()); +- IRegistry> field_212626_o = func_212610_a("block_entity_type", new RegistryNamespaced<>()); ++ @Deprecated IRegistry> field_212626_o = func_212610_a("block_entity_type", (IRegistry>)net.minecraftforge.registries.GameData.getWrapper(TileEntityType.class)); + IRegistry> field_212627_p = func_212610_a("chunk_generator_type", new RegistryNamespaced<>()); +- IRegistry field_212628_q = func_212610_a("enchantment", new RegistryNamespaced<>()); ++ @Deprecated IRegistry field_212628_q = func_212610_a("enchantment", net.minecraftforge.registries.GameData.getWrapper(Enchantment.class)); + IRegistry> field_212629_r = func_212610_a("entity_type", new RegistryNamespaced<>()); +- IRegistry field_212630_s = func_212610_a("item", new RegistryNamespaced<>()); +- IRegistry field_212631_t = func_212610_a("mob_effect", new RegistryNamespaced<>()); ++ @Deprecated IRegistry field_212630_s = func_212610_a("item", net.minecraftforge.registries.GameData.getWrapper(Item.class)); ++ @Deprecated IRegistry field_212631_t = func_212610_a("mob_effect", net.minecraftforge.registries.GameData.getWrapper(Potion.class)); + IRegistry> field_212632_u = func_212610_a("particle_type", new RegistryNamespaced<>()); +- IRegistry field_212633_v = func_212610_a("sound_event", new RegistryNamespaced<>()); ++ @Deprecated IRegistry field_212633_v = func_212610_a("sound_event", net.minecraftforge.registries.GameData.getWrapper(SoundEvent.class)); + IRegistry> field_212634_w = func_212610_a("stats", new RegistryNamespaced<>()); + + static IRegistry func_212610_a(String p_212610_0_, IRegistry p_212610_1_) { diff --git a/patches/minecraft/net/minecraft/village/Village.java.patch b/patches/minecraft/net/minecraft/village/Village.java.patch index 6f07dbb11..3f5e0ca5d 100644 --- a/patches/minecraft/net/minecraft/village/Village.java.patch +++ b/patches/minecraft/net/minecraft/village/Village.java.patch @@ -7,19 +7,19 @@ -public class Village { +public class Village extends net.minecraftforge.common.capabilities.CapabilityProvider implements net.minecraftforge.common.extensions.IForgeVillage { private World field_75586_a; - private final List field_75584_b = Lists.newArrayList(); + private final List field_75584_b = Lists.newArrayList(); private BlockPos field_75585_c = BlockPos.field_177992_a; @@ -40,15 +40,18 @@ 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 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(null); ++ this(null); } public Village(World p_i1675_1_) { @@ -50,7 +50,7 @@ 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()); flag = true; -@@ -317,22 +321,47 @@ +@@ -317,22 +321,43 @@ } } @@ -59,14 +59,12 @@ + return this.getPlayerReputation(findUUID(p_82684_1_)); + } + -+ public int getPlayerReputation(UUID 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; } -+ private UUID findUUID(String name) -+ { ++ 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); @@ -79,8 +77,7 @@ + return this.modifyPlayerReputation(findUUID(p_82688_1_), p_82688_2_); + } + -+ public int modifyPlayerReputation(UUID p_82688_1_, int 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_, j); @@ -92,15 +89,14 @@ + return this.isPlayerReputationTooLow(findUUID(p_82687_1_)); } -+ public boolean isPlayerReputationTooLow(UUID uuid) -+ { ++ 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"); this.field_75583_e = p_82690_1_.func_74762_e("Radius"); -@@ -354,17 +383,14 @@ +@@ -354,17 +379,14 @@ for(int j = 0; j < nbttaglist1.size(); ++j) { NBTTagCompound nbttagcompound1 = nbttaglist1.func_150305_b(j); @@ -123,7 +119,7 @@ } public void func_82689_b(NBTTagCompound p_82689_1_) { -@@ -396,14 +422,12 @@ +@@ -396,14 +418,12 @@ p_82689_1_.func_74782_a("Doors", nbttaglist); NBTTagList nbttaglist1 = new NBTTagList(); @@ -141,7 +137,7 @@ nbttagcompound1.func_74768_a("S", this.field_82693_j.get(s)); nbttaglist1.add((INBTBase)nbttagcompound1); } -@@ -413,6 +437,8 @@ +@@ -413,6 +433,8 @@ } p_82689_1_.func_74782_a("Players", nbttaglist1); @@ -150,7 +146,7 @@ } public void func_82692_h() { -@@ -424,8 +450,8 @@ +@@ -424,8 +446,8 @@ } public void func_82683_b(int p_82683_1_) { diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index df90b80df..1374edb44 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -2,13 +2,13 @@ +++ b/net/minecraft/world/Explosion.java @@ -41,6 +41,7 @@ private DamageSource field_199593_j; - private final List field_77281_g; - private final Map field_77288_k; + private final List field_77281_g = Lists.newArrayList(); + private final Map field_77288_k = Maps.newHashMap(); + private final Vec3d position; @OnlyIn(Dist.CLIENT) public Explosion(World p_i45752_1_, @Nullable Entity p_i45752_2_, double p_i45752_3_, double p_i45752_5_, double p_i45752_7_, float p_i45752_9_, List p_i45752_10_) { -@@ -66,6 +67,7 @@ +@@ -63,6 +64,7 @@ this.field_77286_a = p_i45754_10_; this.field_82755_b = p_i45754_11_; this.field_199593_j = DamageSource.func_94539_a(this); @@ -16,16 +16,18 @@ } public void func_77278_a() { -@@ -92,7 +94,7 @@ +@@ -89,8 +91,8 @@ BlockPos blockpos = new BlockPos(d4, d6, d8); IBlockState iblockstate = this.field_77287_j.func_180495_p(blockpos); IFluidState ifluidstate = this.field_77287_j.func_204610_c(blockpos); -- float f2 = Math.max(iblockstate.func_177230_c().func_149638_a(), ifluidstate.func_210200_l()); -+ float f2 = Math.max(iblockstate.getExplosionResistance(field_77287_j, blockpos, field_77283_e, this), ifluidstate.getExplosionResistance(field_77287_j, blockpos, field_77283_e, this)); - if (f2 > 0.0F) { +- if (!iblockstate.func_196958_f() || !ifluidstate.func_206888_e()) { +- float f2 = Math.max(iblockstate.func_177230_c().func_149638_a(), ifluidstate.func_210200_l()); ++ if (!iblockstate.isAir(field_77287_j, blockpos) || !ifluidstate.func_206888_e()) { ++ float f2 = Math.max(iblockstate.getExplosionResistance(field_77287_j, blockpos, field_77283_e, this), ifluidstate.getExplosionResistance(field_77287_j, blockpos, field_77283_e, this)); if (this.field_77283_e != null) { f2 = this.field_77283_e.func_180428_a(this, this.field_77287_j, blockpos, iblockstate, ifluidstate, f2); -@@ -123,6 +125,7 @@ + } +@@ -120,6 +122,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)); @@ -33,7 +35,7 @@ Vec3d vec3d = new Vec3d(this.field_77284_b, this.field_77285_c, this.field_77282_d); for(int k2 = 0; k2 < list.size(); ++k2) { -@@ -194,20 +197,19 @@ +@@ -191,20 +194,19 @@ this.field_77287_j.func_195594_a(Particles.field_197601_L, d0, d1, d2, d3, d4, d5); } @@ -57,7 +59,7 @@ this.field_77287_j.func_175656_a(blockpos1, Blocks.field_150480_ab.func_176223_P()); } } -@@ -245,4 +247,8 @@ +@@ -242,4 +244,8 @@ public List func_180343_e() { return this.field_77281_g; } diff --git a/patches/minecraft/net/minecraft/world/IWorld.java.patch b/patches/minecraft/net/minecraft/world/IWorld.java.patch index 8f50dfac4..810876edd 100644 --- a/patches/minecraft/net/minecraft/world/IWorld.java.patch +++ b/patches/minecraft/net/minecraft/world/IWorld.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/IWorld.java +++ b/net/minecraft/world/IWorld.java -@@ -24,16 +24,16 @@ +@@ -21,16 +21,16 @@ long func_72905_C(); default float func_130001_d() { diff --git a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches/minecraft/net/minecraft/world/Region.java.patch similarity index 92% rename from patches/minecraft/net/minecraft/world/ChunkCache.java.patch rename to patches/minecraft/net/minecraft/world/Region.java.patch index 32572a0d4..2c6985db5 100644 --- a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/world/Region.java.patch @@ -1,6 +1,6 @@ ---- a/net/minecraft/world/ChunkCache.java -+++ b/net/minecraft/world/ChunkCache.java -@@ -62,13 +62,14 @@ +--- a/net/minecraft/world/Region.java ++++ b/net/minecraft/world/Region.java +@@ -55,13 +55,14 @@ @Nullable public TileEntity func_175625_s(BlockPos p_175625_1_) { @@ -16,7 +16,7 @@ return this.field_72817_c[i][j].func_177424_a(p_190300_1_, p_190300_2_); } -@@ -205,6 +206,7 @@ +@@ -194,6 +195,7 @@ public Biome func_180494_b(BlockPos p_180494_1_) { 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; @@ -24,7 +24,7 @@ return this.field_72817_c[i][j].func_201600_k(p_180494_1_); } -@@ -231,6 +233,7 @@ +@@ -220,6 +222,7 @@ } else { 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; @@ -32,7 +32,7 @@ return this.field_72817_c[i][j].func_177413_a(p_175629_1_, p_175629_2_); } } else { -@@ -239,13 +242,14 @@ +@@ -228,13 +231,14 @@ } public boolean func_175623_d(BlockPos p_175623_1_) { @@ -48,7 +48,7 @@ return this.field_72817_c[i][j].func_177413_a(p_175642_1_, p_175642_2_); } else { return p_175642_1_.field_77198_c; -@@ -263,4 +267,8 @@ +@@ -252,4 +256,8 @@ public int func_181545_F() { throw new RuntimeException("Not yet implemented"); } 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 8c74af667..000000000 --- a/patches/minecraft/net/minecraft/world/ServerWorldEventHandler.java.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/net/minecraft/world/ServerWorldEventHandler.java -+++ b/net/minecraft/world/ServerWorldEventHandler.java -@@ -47,7 +47,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.getId(), 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_) { -@@ -64,7 +64,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.getId(), 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/Teleporter.java.patch b/patches/minecraft/net/minecraft/world/Teleporter.java.patch index f841ae23e..f536f2c94 100644 --- a/patches/minecraft/net/minecraft/world/Teleporter.java.patch +++ b/patches/minecraft/net/minecraft/world/Teleporter.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/Teleporter.java +++ b/net/minecraft/world/Teleporter.java -@@ -15,7 +15,7 @@ - import net.minecraft.util.math.ChunkPos; +@@ -16,7 +16,7 @@ import net.minecraft.util.math.MathHelper; + import net.minecraft.world.dimension.DimensionType; -public class Teleporter { +public class Teleporter implements net.minecraftforge.common.util.ITeleporter { private static final BlockPortal field_196236_a = (BlockPortal)Blocks.field_150427_aO; protected final WorldServer field_85192_a; protected final Random field_77187_a; -@@ -334,4 +334,13 @@ +@@ -335,4 +335,13 @@ this.field_85087_d = p_i45747_3_; } } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index aa5b7f7ce..c2c42c082 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -1,69 +1,40 @@ --- a/net/minecraft/world/World.java +++ b/net/minecraft/world/World.java -@@ -71,7 +71,7 @@ +@@ -75,7 +75,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; --public abstract class World implements IWorld, IWorldReader, AutoCloseable { -+public abstract class World extends net.minecraftforge.common.capabilities.CapabilityProvider implements IWorld, IWorldReader, AutoCloseable, net.minecraftforge.common.extensions.IForgeWorld { +-public abstract class World implements IEntityReader, IWorld, IWorldReader, AutoCloseable { ++public abstract class World extends net.minecraftforge.common.capabilities.CapabilityProvider implements IEntityReader, IWorld, IWorldReader, AutoCloseable, net.minecraftforge.common.extensions.IForgeWorld { protected static final Logger field_195596_d = LogManager.getLogger(); private static final EnumFacing[] field_200007_a = EnumFacing.values(); private int field_181546_a = 63; -@@ -110,7 +110,14 @@ +@@ -114,8 +114,13 @@ + private boolean field_147481_N; private final WorldBorder field_175728_M; - int[] field_72994_J; - + int[] field_72994_J = new int['\u8000']; + public boolean restoringBlockSnapshots = false; + public boolean captureBlockSnapshots = false; + public java.util.ArrayList capturedBlockSnapshots = new java.util.ArrayList(); -+ protected WorldSavedDataStorage perWorldStorage; + private net.minecraftforge.common.util.WorldCapabilityData capabilityData; -+ - protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, Dimension p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) { -+ super(World.class); - this.field_73021_x = Lists.newArrayList(this.field_184152_t); - this.field_72985_G = true; - this.field_72992_H = true; -@@ -121,6 +128,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 WorldSavedDataStorage((ISaveHandler)null); - } - public IWorld func_175643_b() { -@@ -128,21 +136,25 @@ + protected World(ISaveHandler p_i49813_1_, @Nullable WorldSavedDataStorage p_i49813_2_, WorldInfo p_i49813_3_, Dimension p_i49813_4_, Profiler p_i49813_5_, boolean p_i49813_6_) { ++ super(World.class); + this.field_73019_z = p_i49813_1_; + this.field_72988_C = p_i49813_2_; + this.field_72984_F = p_i49813_5_; +@@ -126,6 +131,10 @@ } public Biome func_180494_b(BlockPos p_180494_1_) { -- if (this.func_175667_e(p_180494_1_)) { -- Chunk chunk = this.func_175726_f(p_180494_1_); -+ return this.field_73011_w.getBiome(p_180494_1_); ++ return this.field_73011_w.getBiome(p_180494_1_); + } - -+ public Biome getBiomeBody(BlockPos pos) { -+ if (this.func_175667_e(pos)) { -+ Chunk chunk = this.func_175726_f(pos); + - try { -- return chunk.func_201600_k(p_180494_1_); -+ return chunk.func_201600_k(pos); - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.func_85055_a(throwable, "Getting biome"); - CrashReportCategory crashreportcategory = crashreport.func_85058_a("Coordinates of biome request"); - crashreportcategory.func_189529_a("Location", () -> { -- return CrashReportCategory.func_180522_a(p_180494_1_); -+ return CrashReportCategory.func_180522_a(pos); - }); - throw new ReportedException(crashreport); - } - } else { -- return this.field_73020_y.func_201711_g().func_202090_b().func_180300_a(p_180494_1_, Biomes.field_76772_c); -+ return this.field_73020_y.func_201711_g().func_202090_b().func_180300_a(pos, Biomes.field_76772_c); - } - } ++ public Biome getBiomeBody(BlockPos p_180494_1_) { + if (this.func_175667_e(p_180494_1_)) { + Chunk chunk = this.func_175726_f(p_180494_1_); -@@ -184,7 +196,7 @@ +@@ -182,7 +191,7 @@ } public boolean func_175623_d(BlockPos p_175623_1_) { @@ -72,7 +43,7 @@ } public Chunk func_175726_f(BlockPos p_175726_1_) { -@@ -203,42 +215,67 @@ +@@ -206,23 +215,50 @@ } else { Chunk chunk = this.func_175726_f(p_180501_1_); Block block = p_180501_2_.func_177230_c(); @@ -101,7 +72,6 @@ this.field_72984_F.func_76319_b(); } -- if (iblockstate1 == p_180501_2_) { + 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_); + } @@ -111,44 +81,23 @@ + } + + // Split off from original setBlockState(BlockPos, IBlockState, int) method in order to directly send client and physic updates -+ public void markAndNotifyBlock(BlockPos pos, @Nullable Chunk chunk, IBlockState iblockstate, IBlockState newState, int flags) { -+ Block block = newState.func_177230_c(); -+ IBlockState iblockstate1 = func_180495_p(pos); ++ 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(); ++ IBlockState iblockstate1 = func_180495_p(p_180501_1_); + { + { -+ if (iblockstate1 == newState) { + if (iblockstate1 == p_180501_2_) { if (iblockstate != iblockstate1) { -- this.func_175704_b(p_180501_1_, p_180501_1_); -+ this.func_175704_b(pos, pos); + this.func_175704_b(p_180501_1_, p_180501_1_); } - if ((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) { -- this.func_184138_a(p_180501_1_, iblockstate, p_180501_2_, p_180501_3_); -+ if ((flags & 2) != 0 && (!this.field_72995_K || (flags & 4) == 0) && (chunk == null || chunk.func_150802_k())) { -+ this.func_184138_a(pos, iblockstate, newState, flags); ++ 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_); } -- if (!this.field_72995_K && (p_180501_3_ & 1) != 0) { -- this.func_195592_c(p_180501_1_, iblockstate.func_177230_c()); -- if (p_180501_2_.func_185912_n()) { -- this.func_175666_e(p_180501_1_, block); -+ if (!this.field_72995_K && (flags & 1) != 0) { -+ this.func_195592_c(pos, iblockstate.func_177230_c()); -+ if (newState.func_185912_n()) { -+ this.func_175666_e(pos, block); - } - } - -- if ((p_180501_3_ & 16) == 0) { -- int i = p_180501_3_ & -2; -- iblockstate.func_196948_b(this, p_180501_1_, i); -- p_180501_2_.func_196946_a(this, p_180501_1_, i); -- p_180501_2_.func_196948_b(this, p_180501_1_, i); -+ if ((flags & 16) == 0) { -+ int i = flags & -2; -+ iblockstate.func_196948_b(this, pos, i); -+ newState.func_196946_a(this, pos, i); -+ newState.func_196948_b(this, pos, i); +@@ -240,8 +276,6 @@ + p_180501_2_.func_196948_b(this, p_180501_1_, i); } } - @@ -156,7 +105,7 @@ } } } -@@ -250,7 +287,7 @@ +@@ -253,7 +287,7 @@ public boolean func_175655_b(BlockPos p_175655_1_, boolean p_175655_2_) { IBlockState iblockstate = this.func_180495_p(p_175655_1_); @@ -165,7 +114,7 @@ return false; } else { IFluidState ifluidstate = this.func_204610_c(p_175655_1_); -@@ -309,6 +346,8 @@ +@@ -312,6 +346,8 @@ } public void func_195593_d(BlockPos p_195593_1_, Block p_195593_2_) { @@ -174,7 +123,7 @@ this.func_190524_a(p_195593_1_.func_177976_e(), p_195593_2_, p_195593_1_); this.func_190524_a(p_195593_1_.func_177974_f(), p_195593_2_, p_195593_1_); this.func_190524_a(p_195593_1_.func_177977_b(), p_195593_2_, p_195593_1_); -@@ -318,6 +357,11 @@ +@@ -321,6 +357,11 @@ } public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) { @@ -186,19 +135,19 @@ if (p_175695_3_ != EnumFacing.WEST) { this.func_190524_a(p_175695_1_.func_177976_e(), p_175695_2_, p_175695_1_); } -@@ -355,9 +399,9 @@ +@@ -358,9 +399,9 @@ CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block being updated"); crashreportcategory.func_189529_a("Source block type", () -> { try { -- return String.format("ID #%s (%s // %s)", Block.field_149771_c.func_177774_c(p_190524_2_), p_190524_2_.func_149739_a(), p_190524_2_.getClass().getCanonicalName()); +- return String.format("ID #%s (%s // %s)", IRegistry.field_212618_g.func_177774_c(p_190524_2_), p_190524_2_.func_149739_a(), p_190524_2_.getClass().getCanonicalName()); + return String.format("ID #%s (%s // %s)", p_190524_2_.getRegistryName(), p_190524_2_.func_149739_a(), p_190524_2_.getClass().getCanonicalName()); } catch (Throwable var2) { -- return "ID #" + Block.field_149771_c.func_177774_c(p_190524_2_); +- return "ID #" + IRegistry.field_212618_g.func_177774_c(p_190524_2_); + return "ID #" + p_190524_2_.getRegistryName(); } }); CrashReportCategory.func_175750_a(crashreportcategory, p_190524_1_, iblockstate); -@@ -515,7 +559,7 @@ +@@ -518,7 +559,7 @@ } public boolean func_72935_r() { @@ -207,7 +156,7 @@ } @Nullable -@@ -695,6 +739,12 @@ +@@ -698,6 +739,12 @@ } 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_) { @@ -218,9 +167,9 @@ + 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_); + 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_); } -@@ -739,6 +789,8 @@ +@@ -742,6 +789,8 @@ } public boolean func_72838_d(Entity p_72838_1_) { @@ -229,7 +178,7 @@ 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; -@@ -755,6 +807,7 @@ +@@ -758,6 +807,7 @@ this.func_72854_c(); } @@ -237,24 +186,23 @@ 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_); -@@ -766,14 +819,14 @@ - for(int i = 0; i < this.field_73021_x.size(); ++i) { - ((IWorldEventListener)this.field_73021_x.get(i)).func_72703_a(p_72923_1_); +@@ -770,6 +820,7 @@ + this.field_73021_x.get(i).func_72703_a(p_72923_1_); } -- + + p_72923_1_.onAddedToWorld(); } public void func_72847_b(Entity p_72847_1_) { - for(int i = 0; i < this.field_73021_x.size(); ++i) { - ((IWorldEventListener)this.field_73021_x.get(i)).func_72709_b(p_72847_1_); +@@ -777,6 +828,7 @@ + this.field_73021_x.get(i).func_72709_b(p_72847_1_); } -- + + p_72847_1_.onRemovedFromWorld(); } public void func_72900_e(Entity p_72900_1_) { -@@ -816,52 +869,62 @@ +@@ -819,24 +871,31 @@ this.field_73021_x.add(p_72954_1_); } @@ -264,60 +212,46 @@ } public int func_72967_a(float p_72967_1_) { -- float f = this.func_72826_c(p_72967_1_); + float f = 1.0F - this.field_73011_w.getSunBrightnessFactor(p_72967_1_); + return (int)(f * 11); + } -+ public float getSunBrightnessFactor(float partialTicks) { -+ float f = this.func_72826_c(partialTicks); ++ 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 = (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); -+ f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(partialTicks) * 5.0F) / 16.0D)); -+ f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(partialTicks) * 5.0F) / 16.0D)); + return f1; } @OnlyIn(Dist.CLIENT) public float func_72971_b(float p_72971_1_) { -- float f = this.func_72826_c(p_72971_1_); + return this.field_73011_w.getSunBrightness(p_72971_1_); + } + + @OnlyIn(Dist.CLIENT) -+ public float getSunBrightnessBody(float partialTicks) { -+ float f = this.func_72826_c(partialTicks); ++ 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); - f1 = 1.0F - f1; -- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72971_1_) * 5.0F) / 16.0D)); -- f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72971_1_) * 5.0F) / 16.0D)); -+ f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(partialTicks) * 5.0F) / 16.0D)); -+ f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(partialTicks) * 5.0F) / 16.0D)); - return f1 * 0.8F + 0.2F; - } +@@ -848,6 +907,11 @@ @OnlyIn(Dist.CLIENT) public Vec3d func_72833_a(Entity p_72833_1_, float p_72833_2_) { -- float f = this.func_72826_c(p_72833_2_); + return this.field_73011_w.getSkyColor(p_72833_1_, p_72833_2_); + } + + @OnlyIn(Dist.CLIENT) -+ public Vec3d getSkyColorBody(Entity entityIn, float partialTicks) { -+ float f = this.func_72826_c(partialTicks); ++ 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); -- int i = MathHelper.func_76128_c(p_72833_1_.field_70165_t); -- int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u); -- int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v); -+ int i = MathHelper.func_76128_c(entityIn.field_70165_t); -+ int j = MathHelper.func_76128_c(entityIn.field_70163_u); -+ int k = MathHelper.func_76128_c(entityIn.field_70161_v); +@@ -855,9 +919,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); @@ -326,62 +260,18 @@ float f3 = (float)(l >> 16 & 255) / 255.0F; float f4 = (float)(l >> 8 & 255) / 255.0F; float f5 = (float)(l & 255) / 255.0F; - f3 = f3 * f1; - f4 = f4 * f1; - f5 = f5 * f1; -- float f6 = this.func_72867_j(p_72833_2_); -+ float f6 = this.func_72867_j(partialTicks); - if (f6 > 0.0F) { - float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F; - float f8 = 1.0F - f6 * 0.75F; -@@ -870,7 +933,7 @@ - f5 = f5 * f8 + f7 * (1.0F - f8); - } - -- float f10 = this.func_72819_i(p_72833_2_); -+ float f10 = this.func_72819_i(partialTicks); - if (f10 > 0.0F) { - float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F; - float f9 = 1.0F - f10 * 0.75F; -@@ -880,7 +943,7 @@ - } - - if (this.field_73016_r > 0) { -- float f12 = (float)this.field_73016_r - p_72833_2_; -+ float f12 = (float)this.field_73016_r - partialTicks; - if (f12 > 1.0F) { - f12 = 1.0F; - } -@@ -901,13 +964,17 @@ +@@ -904,6 +966,10 @@ @OnlyIn(Dist.CLIENT) public Vec3d func_72824_f(float p_72824_1_) { -- float f = this.func_72826_c(p_72824_1_); + return this.field_73011_w.getCloudColor(p_72824_1_); + } + @OnlyIn(Dist.CLIENT) -+ public Vec3d getCloudColorBody(float partialTicks) { -+ float f = this.func_72826_c(partialTicks); ++ 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); - float f2 = 1.0F; - float f3 = 1.0F; - float f4 = 1.0F; -- float f5 = this.func_72867_j(p_72824_1_); -+ float f5 = this.func_72867_j(partialTicks); - if (f5 > 0.0F) { - float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F; - float f7 = 1.0F - f5 * 0.95F; -@@ -919,7 +986,7 @@ - f2 = f2 * (f1 * 0.9F + 0.1F); - f3 = f3 * (f1 * 0.9F + 0.1F); - f4 = f4 * (f1 * 0.85F + 0.15F); -- float f9 = this.func_72819_i(p_72824_1_); -+ float f9 = this.func_72819_i(partialTicks); - if (f9 > 0.0F) { - float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F; - float f8 = 1.0F - f9 * 0.95F; -@@ -939,10 +1006,7 @@ +@@ -942,10 +1008,7 @@ @OnlyIn(Dist.CLIENT) public float func_72880_h(float p_72880_1_) { @@ -393,7 +283,7 @@ } public void func_72939_s() { -@@ -954,6 +1018,7 @@ +@@ -957,6 +1020,7 @@ try { ++entity.field_70173_aa; @@ -401,7 +291,7 @@ entity.func_70071_h_(); } catch (Throwable throwable2) { CrashReport crashreport = CrashReport.func_85055_a(throwable2, "Ticking entity"); -@@ -964,6 +1029,10 @@ +@@ -967,6 +1031,10 @@ entity.func_85029_a(crashreportcategory); } @@ -412,7 +302,7 @@ throw new ReportedException(crashreport); } -@@ -1006,11 +1075,17 @@ +@@ -1009,11 +1077,17 @@ this.field_72984_F.func_76320_a("tick"); if (!entity2.field_70128_L && !(entity2 instanceof EntityPlayerMP)) { try { @@ -430,7 +320,7 @@ throw new ReportedException(crashreport1); } } -@@ -1032,30 +1107,41 @@ +@@ -1035,30 +1109,41 @@ } this.field_72984_F.func_76318_c("blockEntities"); @@ -476,7 +366,7 @@ throw new ReportedException(crashreport2); } } -@@ -1065,7 +1151,10 @@ +@@ -1068,7 +1153,10 @@ iterator.remove(); this.field_147482_g.remove(tileentity); if (this.func_175667_e(tileentity.func_174877_v())) { @@ -488,7 +378,7 @@ } } } -@@ -1100,10 +1189,15 @@ +@@ -1103,10 +1191,15 @@ } public boolean func_175700_a(TileEntity p_175700_1_) { @@ -504,7 +394,7 @@ if (this.field_72995_K) { BlockPos blockpos = p_175700_1_.func_174877_v(); -@@ -1116,6 +1210,11 @@ +@@ -1119,6 +1212,11 @@ public void func_147448_a(Collection p_147448_1_) { if (this.field_147481_N) { @@ -516,20 +406,30 @@ this.field_147484_a.addAll(p_147448_1_); } else { for(TileEntity tileentity : p_147448_1_) { -@@ -1134,7 +1233,11 @@ +@@ -1137,9 +1235,10 @@ int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t); int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v); int k = 32; - if (p_72866_2_ && !this.func_175663_a(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) { -+ boolean isForced = getPersistentChunks().containsKey(new net.minecraft.util.math.ChunkPos(i >> 4, j >> 4)); -+ int range = isForced ? 0 : 32; +- return; +- } ++ int range = func_212416_f(i >> 4, j >> 4) ? 0 : 32; + boolean canUpdate = !p_72866_2_ || this.func_175663_a(i - range, 0, j - range, i + range, 0, j + range, true); + if (!canUpdate) canUpdate = net.minecraftforge.event.ForgeEventFactory.canEntityUpdate(p_72866_1_); -+ if (!canUpdate) { - return; - } ++ if (!canUpdate) return; } -@@ -1197,6 +1300,7 @@ + + p_72866_1_.field_70142_S = p_72866_1_.field_70165_t; +@@ -1153,7 +1252,7 @@ + p_72866_1_.func_70098_U(); + } else { + this.field_72984_F.func_194340_a(() -> { +- return IRegistry.field_212629_r.func_177774_c(p_72866_1_.func_200600_R()).toString(); ++ return p_72866_1_.func_200600_R().getRegistryName().toString(); + }); + p_72866_1_.func_70071_h_(); + this.field_72984_F.func_76319_b(); +@@ -1200,6 +1299,7 @@ if (p_72866_2_ && p_72866_1_.field_70175_ag) { for(Entity entity : p_72866_1_.func_184188_bt()) { if (!entity.field_70128_L && entity.func_184187_bx() == p_72866_1_) { @@ -537,7 +437,7 @@ this.func_72870_g(entity); } else { entity.func_184210_p(); -@@ -1236,7 +1340,7 @@ +@@ -1239,7 +1339,7 @@ for(int l1 = k; l1 < l; ++l1) { for(int i2 = i1; i2 < j1; ++i2) { IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2)); @@ -546,7 +446,7 @@ boolean flag = true; return flag; } -@@ -1260,10 +1364,13 @@ +@@ -1263,10 +1363,13 @@ for(int k1 = i; k1 < j; ++k1) { for(int l1 = k; l1 < l; ++l1) { for(int i2 = i1; i2 < j1; ++i2) { @@ -561,7 +461,7 @@ } } } -@@ -1343,6 +1450,7 @@ +@@ -1346,6 +1449,7 @@ if (p_211529_2_ != null) { explosion.func_199592_a(p_211529_2_); } @@ -569,7 +469,7 @@ explosion.func_77278_a(); explosion.func_77279_a(true); -@@ -1436,10 +1544,13 @@ +@@ -1439,10 +1543,13 @@ } public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_) { @@ -583,7 +483,7 @@ Iterator iterator = this.field_147484_a.iterator(); while(iterator.hasNext()) { -@@ -1452,7 +1563,8 @@ +@@ -1455,7 +1562,8 @@ this.field_147484_a.add(p_175690_2_); } else { @@ -593,7 +493,7 @@ this.func_175700_a(p_175690_2_); } } -@@ -1465,6 +1577,8 @@ +@@ -1468,6 +1576,8 @@ if (tileentity != null && this.field_147481_N) { tileentity.func_145843_s(); this.field_147484_a.remove(tileentity); @@ -602,7 +502,7 @@ } else { if (tileentity != null) { this.field_147484_a.remove(tileentity); -@@ -1474,6 +1588,7 @@ +@@ -1477,6 +1587,7 @@ this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_); } @@ -610,7 +510,7 @@ } -@@ -1495,7 +1610,7 @@ +@@ -1498,7 +1609,7 @@ } public boolean func_195595_w(BlockPos p_195595_1_) { @@ -619,15 +519,15 @@ } public void func_72966_v() { -@@ -1509,6 +1624,7 @@ +@@ -1512,6 +1623,7 @@ public void func_72891_a(boolean p_72891_1_, boolean p_72891_2_) { 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() { -@@ -1516,6 +1632,10 @@ + public void func_72835_b(BooleanSupplier p_72835_1_) { +@@ -1520,6 +1632,10 @@ } protected void func_72947_a() { @@ -638,7 +538,7 @@ if (this.field_72986_A.func_76059_o()) { this.field_73004_o = 1.0F; if (this.field_72986_A.func_76061_m()) { -@@ -1530,6 +1650,10 @@ +@@ -1534,6 +1650,10 @@ } protected void func_72979_l() { @@ -649,7 +549,7 @@ if (this.field_73011_w.func_191066_m()) { if (!this.field_72995_K) { boolean flag = this.func_82736_K().func_82766_b("doWeatherCycle"); -@@ -1616,9 +1740,9 @@ +@@ -1620,9 +1740,9 @@ return 15; } else { IBlockState iblockstate = this.func_180495_p(p_175638_1_); @@ -661,7 +561,7 @@ j = 1; } -@@ -1627,7 +1751,7 @@ +@@ -1631,7 +1751,7 @@ } if (j >= 15) { @@ -670,7 +570,7 @@ } else if (i >= 14) { return i; } else { -@@ -1652,11 +1776,12 @@ +@@ -1656,11 +1776,12 @@ } public boolean func_180500_c(EnumLightType p_180500_1_, BlockPos p_180500_2_) { @@ -684,7 +584,7 @@ this.field_72984_F.func_76320_a("getBrightness"); int k = this.func_175642_b(p_180500_1_, p_180500_2_); int l = this.func_175638_a(p_180500_2_, p_180500_1_); -@@ -1682,7 +1807,7 @@ +@@ -1686,7 +1807,7 @@ int j3 = MathHelper.func_76130_a(i2 - i1); int k3 = MathHelper.func_76130_a(j2 - j1); int l3 = MathHelper.func_76130_a(k2 - k1); @@ -693,7 +593,7 @@ try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s()) { for(EnumFacing enumfacing : field_200007_a) { int i4 = i2 + enumfacing.func_82601_c(); -@@ -1722,7 +1847,7 @@ +@@ -1726,7 +1847,7 @@ int l6 = Math.abs(k5 - j1); int i7 = Math.abs(l5 - k1); boolean flag = j < this.field_72994_J.length - 6; @@ -702,10 +602,10 @@ if (this.func_175642_b(p_180500_1_, blockpos1.func_177976_e()) < j6) { this.field_72994_J[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12); } -@@ -1762,10 +1887,10 @@ +@@ -1767,10 +1888,10 @@ public List func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate p_175674_3_) { - List list = Lists.newArrayList(); + List list = Lists.newArrayList(); - int i = MathHelper.func_76128_c((p_175674_2_.field_72340_a - 2.0D) / 16.0D); - int j = MathHelper.func_76128_c((p_175674_2_.field_72336_d + 2.0D) / 16.0D); - int k = MathHelper.func_76128_c((p_175674_2_.field_72339_c - 2.0D) / 16.0D); @@ -717,7 +617,7 @@ for(int i1 = i; i1 <= j; ++i1) { for(int j1 = k; j1 <= l; ++j1) { -@@ -1807,10 +1932,10 @@ +@@ -1812,10 +1933,10 @@ } public List func_175647_a(Class p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate p_175647_3_) { @@ -729,24 +629,19 @@ + int j = MathHelper.func_76143_f((p_175647_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); + int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); + int l = MathHelper.func_76143_f((p_175647_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); - List list = Lists.newArrayList(); + List list = Lists.newArrayList(); for(int i1 = i; i1 < j; ++i1) { -@@ -1874,10 +1999,12 @@ +@@ -1891,7 +2012,7 @@ } - public void func_175650_b(Collection p_175650_1_) { -- this.field_72996_f.addAll(p_175650_1_); - - for(Entity entity : p_175650_1_) { -+ if (!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); -+ } - } - - } -@@ -1943,7 +2070,7 @@ + public void func_212420_a(Stream p_212420_1_) { +- p_212420_1_.forEach((p_212418_1_) -> { ++ p_212420_1_.filter(e -> !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(e, this))).forEach((p_212418_1_) -> { + this.field_72996_f.add(p_212418_1_); + this.func_72923_a(p_212418_1_); + }); +@@ -1958,7 +2079,7 @@ public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_) { IBlockState iblockstate = this.func_180495_p(p_175651_1_); @@ -755,7 +650,7 @@ } public boolean func_175640_z(BlockPos p_175640_1_) { -@@ -2049,6 +2176,8 @@ +@@ -2096,6 +2217,8 @@ d2 *= MoreObjects.firstNonNull(p_184150_11_.apply(entityplayer1), 1.0D); } @@ -764,7 +659,7 @@ 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; entityplayer = entityplayer1; -@@ -2097,7 +2226,7 @@ +@@ -2144,7 +2267,7 @@ } public long func_72905_C() { @@ -773,7 +668,7 @@ } public long func_82737_E() { -@@ -2105,15 +2234,15 @@ +@@ -2152,15 +2275,15 @@ } public long func_72820_D() { @@ -792,7 +687,7 @@ if (!this.func_175723_af().func_177746_a(blockpos)) { blockpos = this.func_205770_a(Heightmap.Type.MOTION_BLOCKING, new BlockPos(this.func_175723_af().func_177731_f(), 0.0D, this.func_175723_af().func_177721_g())); } -@@ -2122,7 +2251,7 @@ +@@ -2169,7 +2292,7 @@ } public void func_175652_B(BlockPos p_175652_1_) { @@ -801,7 +696,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -2138,12 +2267,17 @@ +@@ -2185,12 +2308,17 @@ } if (!this.field_72996_f.contains(p_72897_1_)) { @@ -819,7 +714,7 @@ return true; } -@@ -2218,8 +2352,7 @@ +@@ -2265,8 +2393,7 @@ } public boolean func_180502_D(BlockPos p_180502_1_) { @@ -829,7 +724,7 @@ } @Nullable -@@ -2269,16 +2402,15 @@ +@@ -2303,16 +2430,15 @@ } public int func_72800_K() { @@ -849,7 +744,7 @@ } public CrashReportCategory func_72914_a(CrashReport p_72914_1_) { -@@ -2315,16 +2447,16 @@ +@@ -2349,16 +2475,16 @@ public abstract Scoreboard func_96441_U(); public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_) { @@ -871,7 +766,7 @@ iblockstate.func_189546_a(this, blockpos, p_175666_2_, p_175666_1_); } } -@@ -2397,4 +2529,30 @@ +@@ -2464,4 +2590,28 @@ public abstract RecipeManager func_199532_z(); public abstract NetworkTagManager func_205772_D(); @@ -879,25 +774,23 @@ + protected void initCapabilities() { + net.minecraftforge.common.capabilities.ICapabilityProvider parent = field_73011_w.initCapabilities(); + this.gatherCapabilities(parent); -+ net.minecraftforge.common.util.WorldCapabilityData data = (net.minecraftforge.common.util.WorldCapabilityData)perWorldStorage.func_201067_a(net.minecraftforge.common.util.WorldCapabilityData::new, net.minecraftforge.common.util.WorldCapabilityData.ID); ++ net.minecraftforge.common.util.WorldCapabilityData data = func_175693_T().func_212426_a(func_201675_m().func_186058_p(), net.minecraftforge.common.util.WorldCapabilityData::new, net.minecraftforge.common.util.WorldCapabilityData.ID); + if (data == null) { + capabilityData = new net.minecraftforge.common.util.WorldCapabilityData(getCapabilities()); -+ perWorldStorage.func_75745_a(capabilityData.func_195925_e(), capabilityData); ++ func_175693_T().func_212424_a(func_201675_m().func_186058_p(), capabilityData.func_195925_e(), capabilityData); + } else { + capabilityData = data; + capabilityData.setCapabilities(field_73011_w, getCapabilities()); + } + } + -+ public WorldSavedDataStorage getPerWorldStorage() { -+ return perWorldStorage; -+ } -+ -+ public int countEntities(net.minecraft.entity.EnumCreatureType type, boolean forSpawnCount) { ++ public int countEntities(net.minecraft.entity.EnumCreatureType type, int max, boolean forSpawnCount) { + int ret = 0; + for(Entity entity : this.field_72996_f) { -+ if (entity.isCreatureType(type, forSpawnCount)) -+ ret++; ++ if (entity.isCreatureType(type, forSpawnCount)) { ++ if (ret++ > max) ++ return ret; ++ } + } + return ret; + } diff --git a/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch b/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch index 4ee6ffa64..30c3c37c1 100644 --- a/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldEntitySpawner.java.patch @@ -1,81 +1,79 @@ --- a/net/minecraft/world/WorldEntitySpawner.java +++ b/net/minecraft/world/WorldEntitySpawner.java -@@ -71,13 +71,15 @@ - +@@ -72,12 +72,14 @@ for(EnumCreatureType enumcreaturetype : EnumCreatureType.values()) { if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_)) { -- int l4 = p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a()); -+ int l4 = p_77192_1_.countEntities(enumcreaturetype, true); - int i5 = enumcreaturetype.func_75601_b() * i / field_180268_a; - if (l4 <= i5) { + int l4 = enumcreaturetype.func_75601_b() * i / field_180268_a; +- int i5 = p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a(), l4); ++ int i5 = p_77192_1_.countEntities(enumcreaturetype, l4, true); + if (i5 <= l4) { BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + java.util.ArrayList shuffled = new java.util.ArrayList<>(this.field_77193_b); + java.util.Collections.shuffle(shuffled); - label142: + label158: - 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(); int l1 = blockpos.func_177956_o(); -@@ -125,7 +127,9 @@ - } - - 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_205019_a(p_77192_1_)) { -+ int canSpawn = net.minecraftforge.common.ForgeHooks.canEntitySpawn(entityliving, p_77192_1_, f, i3, f1, null); -+ if (canSpawn == 1 || (canSpawn == 0 && entityliving.func_70601_bi() && entityliving.func_205019_a(p_77192_1_))) { -+ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, p_77192_1_, f, i3, f1, null)) - ientitylivingdata = entityliving.func_204210_a(p_77192_1_.func_175649_E(new BlockPos(entityliving)), ientitylivingdata, (NBTTagCompound)null); - if (entityliving.func_205019_a(p_77192_1_)) { - ++j2; -@@ -135,7 +139,7 @@ - entityliving.func_70106_y(); +@@ -128,7 +130,9 @@ } -- if (j2 >= entityliving.func_70641_bl()) { -+ if (j2 >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(entityliving)) { - continue label142; - } + entityliving.func_70012_b((double)f, (double)i3, (double)f1, p_77192_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); +- if ((d0 <= 16384.0D || !entityliving.func_70692_ba()) && entityliving.func_205020_a(p_77192_1_, false) && entityliving.func_205019_a(p_77192_1_)) { ++ int canSpawn = net.minecraftforge.common.ForgeHooks.canEntitySpawn(entityliving, p_77192_1_, f, i3, f1, null); ++ if ((d0 <= 16384.0D || !entityliving.func_70692_ba()) && (canSpawn == 1 || (canSpawn == 0 && entityliving.func_205020_a(p_77192_1_, false) && entityliving.func_205019_a(p_77192_1_)))) { ++ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, p_77192_1_, f, i3, f1, null)) + ientitylivingdata = entityliving.func_204210_a(p_77192_1_.func_175649_E(new BlockPos(entityliving)), ientitylivingdata, (NBTTagCompound)null); + if (entityliving.func_205019_a(p_77192_1_)) { + ++j2; +@@ -138,7 +142,7 @@ + entityliving.func_70106_y(); + } -@@ -183,18 +187,25 @@ +- if (j2 >= entityliving.func_70641_bl()) { ++ if (j2 >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(entityliving)) { + continue label158; + } + +@@ -187,6 +191,13 @@ public static boolean func_209382_a(EntitySpawnPlacementRegistry.SpawnPlacementType p_209382_0_, IWorldReaderBase p_209382_1_, BlockPos p_209382_2_, @Nullable EntityType p_209382_3_) { if (p_209382_3_ != null && p_209382_1_.func_175723_af().func_177746_a(p_209382_2_)) { -- IBlockState iblockstate = p_209382_1_.func_180495_p(p_209382_2_); -- IFluidState ifluidstate = p_209382_1_.func_204610_c(p_209382_2_); -- switch(p_209382_0_) { + return p_209382_0_.canSpawnAt(p_209382_1_, p_209382_2_, p_209382_3_); + } + return false; + } + -+ public static boolean canSpawnAtBody(EntitySpawnPlacementRegistry.SpawnPlacementType placeType, IWorldReaderBase worldIn, BlockPos pos, @Nullable EntityType entityTypeIn) { -+ if (true) { -+ IBlockState iblockstate = worldIn.func_180495_p(pos); -+ IFluidState ifluidstate = worldIn.func_204610_c(pos); -+ switch(placeType) { - case IN_WATER: -- return ifluidstate.func_206884_a(FluidTags.field_206959_a) && p_209382_1_.func_204610_c(p_209382_2_.func_177977_b()).func_206884_a(FluidTags.field_206959_a) && !p_209382_1_.func_180495_p(p_209382_2_.func_177984_a()).func_185915_l(); -+ return ifluidstate.func_206884_a(FluidTags.field_206959_a) && worldIn.func_204610_c(pos.func_177977_b()).func_206884_a(FluidTags.field_206959_a) && !worldIn.func_180495_p(pos.func_177984_a()).func_185915_l(); ++ public static boolean canSpawnAtBody(EntitySpawnPlacementRegistry.SpawnPlacementType p_209382_0_, IWorldReaderBase p_209382_1_, BlockPos p_209382_2_, @Nullable EntityType p_209382_3_) { ++ { + IBlockState iblockstate = p_209382_1_.func_180495_p(p_209382_2_); + IFluidState ifluidstate = p_209382_1_.func_204610_c(p_209382_2_); + switch(p_209382_0_) { +@@ -195,7 +206,7 @@ case ON_GROUND: default: -- IBlockState iblockstate1 = p_209382_1_.func_180495_p(p_209382_2_.func_177977_b()); + IBlockState iblockstate1 = p_209382_1_.func_180495_p(p_209382_2_.func_177977_b()); - if (iblockstate1.func_185896_q() || p_209382_3_ != null && EntitySpawnPlacementRegistry.func_209345_a(p_209382_3_, iblockstate1)) { -+ IBlockState iblockstate1 = worldIn.func_180495_p(pos.func_177977_b()); -+ if (iblockstate.canCreatureSpawn(worldIn, pos, placeType, entityTypeIn)) { ++ if (iblockstate.canCreatureSpawn(p_209382_1_, p_209382_2_, p_209382_0_, p_209382_3_)) { Block block = iblockstate1.func_177230_c(); boolean flag = block != Blocks.field_150357_h && block != Blocks.field_180401_cv; -- return flag && func_206851_a(iblockstate, ifluidstate) && func_206851_a(p_209382_1_.func_180495_p(p_209382_2_.func_177984_a()), p_209382_1_.func_204610_c(p_209382_2_.func_177984_a())); -+ return flag && func_206851_a(iblockstate, ifluidstate) && func_206851_a(worldIn.func_180495_p(pos.func_177984_a()), worldIn.func_204610_c(pos.func_177984_a())); - } else { + return flag && func_206851_a(iblockstate, ifluidstate) && func_206851_a(p_209382_1_.func_180495_p(p_209382_2_.func_177984_a()), p_209382_1_.func_204610_c(p_209382_2_.func_177984_a())); +@@ -203,8 +214,6 @@ return false; } -@@ -235,6 +246,7 @@ + } +- } else { +- return false; + } + } - float f = MathHelper.func_76131_a((float)l, (float)i + entityliving.field_70130_N, (float)(i + 16) - entityliving.field_70130_N); - float f1 = MathHelper.func_76131_a((float)i1, (float)j + entityliving.field_70130_N, (float)(j + 16) - entityliving.field_70130_N); -+ if (net.minecraftforge.common.ForgeHooks.canEntitySpawn(entityliving, p_77191_0_, f, blockpos.func_177956_o(), f1, null) == -1) continue; - entityliving.func_70012_b((double)f, (double)blockpos.func_177956_o(), (double)f1, p_77191_4_.nextFloat() * 360.0F, 0.0F); - if (entityliving.func_205020_a(p_77191_0_) && entityliving.func_205019_a(p_77191_0_)) { +@@ -239,6 +248,7 @@ + + double d0 = MathHelper.func_151237_a((double)l, (double)i + (double)entityliving.field_70130_N, (double)i + 16.0D - (double)entityliving.field_70130_N); + double d1 = MathHelper.func_151237_a((double)i1, (double)j + (double)entityliving.field_70130_N, (double)j + 16.0D - (double)entityliving.field_70130_N); ++ if (net.minecraftforge.common.ForgeHooks.canEntitySpawn(entityliving, p_77191_0_, d0, blockpos.func_177956_o(), d1, null) == -1) continue; + entityliving.func_70012_b(d0, (double)blockpos.func_177956_o(), d1, p_77191_4_.nextFloat() * 360.0F, 0.0F); + if (entityliving.func_205020_a(p_77191_0_, false) && entityliving.func_205019_a(p_77191_0_)) { ientitylivingdata = entityliving.func_204210_a(p_77191_0_.func_175649_E(new BlockPos(entityliving)), ientitylivingdata, (NBTTagCompound)null); diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index b5c388ead..84e36ff95 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/WorldServer.java +++ b/net/minecraft/world/WorldServer.java -@@ -85,7 +85,7 @@ +@@ -86,7 +86,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,46 +9,42 @@ private static final Logger field_147491_a = LogManager.getLogger(); private final MinecraftServer field_73061_a; private final EntityTracker field_73062_L; -@@ -106,26 +106,35 @@ - ObjectLinkedOpenHashSet field_147490_S = new ObjectLinkedOpenHashSet(); +@@ -106,6 +106,9 @@ + protected final VillageSiege field_175740_d = new VillageSiege(this); + ObjectLinkedOpenHashSet field_147490_S = new ObjectLinkedOpenHashSet<>(); private boolean field_211159_Q; - + /** Stores the recently processed (lighting) chunks */ + protected java.util.Set doneChunks = new java.util.HashSet(); + public List customTeleporters = new java.util.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.getId(); - this.field_73011_w.func_76558_a(this); -+ this.field_73011_w.setId(providerDim); - this.field_73020_y = this.func_72970_h(); -+ perWorldStorage = new WorldSavedDataStorage(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, p_i45921_1_); - } - public IWorld func_175643_b() { - this.field_72988_C = new WorldSavedDataStorage(this.field_73019_z); + public WorldServer(MinecraftServer p_i49819_1_, ISaveHandler p_i49819_2_, WorldSavedDataStorage p_i49819_3_, WorldInfo p_i49819_4_, DimensionType p_i49819_5_, Profiler p_i49819_6_) { + super(p_i49819_2_, p_i49819_3_, p_i49819_4_, p_i49819_5_.func_186070_d(), p_i49819_6_, false); +@@ -122,19 +125,20 @@ + + public WorldServer func_212251_i__() { String s = VillageCollection.func_176062_a(this.field_73011_w); -- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_201067_a(VillageCollection::new, s); -+ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_201067_a(VillageCollection::new, s); +- VillageCollection villagecollection = this.func_212411_a(DimensionType.OVERWORLD, VillageCollection::new, s); ++ DimensionType key = func_201675_m().func_186058_p().isVanilla() ? DimensionType.OVERWORLD : func_201675_m().func_186058_p(); ++ VillageCollection villagecollection = this.func_212411_a(key, VillageCollection::new, 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); +- this.func_212409_a(DimensionType.OVERWORLD, s, this.field_72982_D); ++ this.func_212409_a(key, s, this.field_72982_D); } else { this.field_72982_D = villagecollection; this.field_72982_D.func_82566_a(this); -@@ -150,6 +159,7 @@ + } + +- ScoreboardSaveData scoreboardsavedata = this.func_212411_a(DimensionType.OVERWORLD, ScoreboardSaveData::new, "scoreboard"); ++ ScoreboardSaveData scoreboardsavedata = this.func_212411_a(func_201675_m().func_186058_p(), ScoreboardSaveData::new, "scoreboard"); + if (scoreboardsavedata == null) { + scoreboardsavedata = new ScoreboardSaveData(); +- this.func_212409_a(DimensionType.OVERWORLD, "scoreboard", scoreboardsavedata); ++ this.func_212409_a(func_201675_m().func_186058_p(), "scoreboard", scoreboardsavedata); + } + + scoreboardsavedata.func_96499_a(this.field_73061_a.func_200251_aP()); +@@ -150,6 +154,7 @@ this.func_175723_af().func_177750_a(this.field_72986_A.func_176137_E()); } @@ -56,7 +52,7 @@ return this; } -@@ -163,8 +173,8 @@ +@@ -163,8 +168,8 @@ this.field_73020_y.func_201711_g().func_202090_b().func_73660_a(); if (this.func_73056_e()) { if (this.func_82736_K().func_82766_b("doDaylightCycle")) { @@ -67,7 +63,7 @@ } this.func_73053_d(); -@@ -185,7 +195,7 @@ +@@ -185,7 +190,7 @@ this.field_72986_A.func_82572_b(this.field_72986_A.func_82573_f() + 1L); if (this.func_82736_K().func_82766_b("doDaylightCycle")) { @@ -76,23 +72,20 @@ } this.field_72984_F.func_76318_c("tickPending"); -@@ -199,6 +209,10 @@ +@@ -199,6 +204,7 @@ 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()); -+ } ++ customTeleporters.forEach(t -> t.func_85189_a(func_82737_E())); this.field_72984_F.func_76319_b(); this.func_147488_Z(); this.field_211159_Q = false; -@@ -211,11 +225,13 @@ +@@ -211,11 +217,13 @@ @Nullable 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.isEmpty() ? null : (Biome.SpawnListEntry)WeightedRandom.func_76271_a(this.field_73012_v, list); + return list.isEmpty() ? null : WeightedRandom.func_76271_a(this.field_73012_v, list); } public boolean func_175732_a(EnumCreatureType p_175732_1_, Biome.SpawnListEntry p_175732_2_, BlockPos p_175732_3_) { @@ -101,7 +94,7 @@ return list != null && !list.isEmpty() ? list.contains(p_175732_2_) : false; } -@@ -256,10 +272,7 @@ +@@ -256,10 +264,7 @@ } private void func_73051_P() { @@ -113,16 +106,31 @@ } public boolean func_73056_e() { -@@ -336,7 +349,7 @@ +@@ -286,7 +291,7 @@ + int j = this.field_72986_A.func_76074_e(); + int k = 0; + +- while(this.func_184141_c(new BlockPos(i, 0, j)).func_196958_f()) { ++ while(this.func_184141_c(new BlockPos(i, 0, j)).isAir(this, new BlockPos(i, 0, j))) { + i += this.field_73012_v.nextInt(8) - this.field_73012_v.nextInt(8); + j += this.field_73012_v.nextInt(8) - this.field_73012_v.nextInt(8); + ++k; +@@ -336,7 +341,13 @@ 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()) { ++ //Forge: Tick forced loaded chunks as well as normal chunks. ++ Stream chunks = Stream.concat( ++ java.util.stream.StreamSupport.stream(java.util.Spliterators.spliteratorUnknownSize(this.field_73063_M.func_187300_b(), 0), false), ++ func_212412_ag().stream().map(l -> func_72964_e(ChunkPos.func_212578_a(l), ChunkPos.func_212579_b(l))) ++ ).distinct();// We need distinct so we don't double tick chunks. ++ ++ for(Iterator iterator = chunks.iterator(); iterator.hasNext(); this.field_72984_F.func_76319_b()) { this.field_72984_F.func_76320_a("getChunk"); Chunk chunk = iterator.next(); int j = chunk.field_76635_g * 16; -@@ -346,7 +359,7 @@ +@@ -346,7 +357,7 @@ this.field_72984_F.func_76318_c("tickChunk"); chunk.func_150804_b(false); this.field_72984_F.func_76318_c("thunder"); @@ -131,31 +139,31 @@ this.field_73005_l = this.field_73005_l * 3 + 1013904223; int l = this.field_73005_l >> 2; BlockPos blockpos = this.func_175736_a(new BlockPos(j + (l & 15), 0, k + (l >> 8 & 15))); -@@ -366,12 +379,13 @@ +@@ -366,12 +377,13 @@ } 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_205770_a(Heightmap.Type.MOTION_BLOCKING, new BlockPos(j + (j2 & 15), 0, k + (j2 >> 8 & 15))); + int i2 = this.field_73005_l >> 2; + BlockPos blockpos1 = this.func_205770_a(Heightmap.Type.MOTION_BLOCKING, new BlockPos(j + (i2 & 15), 0, k + (i2 >> 8 & 15))); BlockPos blockpos2 = blockpos1.func_177977_b(); Biome biome = this.func_180494_b(blockpos1); + if (this.func_175648_a(blockpos2, 1, false)) // Forge: check area to avoid loading neighbors in unloaded chunks if (biome.func_201848_a(this, blockpos2)) { this.func_175656_a(blockpos2, Blocks.field_150432_aD.func_176223_P()); } -@@ -435,7 +449,7 @@ +@@ -435,7 +447,7 @@ } public void func_72939_s() { - if (this.field_73010_i.isEmpty()) { -+ if (this.field_73010_i.isEmpty() && getPersistentChunks().isEmpty()) { ++ if (this.field_73010_i.isEmpty() && func_212412_ag().isEmpty()) { if (this.field_80004_Q++ >= 300) { return; } -@@ -541,10 +555,15 @@ +@@ -541,10 +553,15 @@ protected IChunkProvider func_72970_h() { IChunkLoader ichunkloader = this.field_73019_z.func_75763_a(this.field_73011_w); @@ -172,7 +180,7 @@ 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_); } -@@ -594,6 +613,7 @@ +@@ -594,6 +611,7 @@ } else if (this.field_72986_A.func_76067_t() == WorldType.field_180272_g) { this.field_72986_A.func_176143_a(BlockPos.field_177992_a.func_177984_a()); } else { @@ -180,41 +188,24 @@ BiomeProvider biomeprovider = this.field_73020_y.func_201711_g().func_202090_b(); List list = biomeprovider.func_76932_a(); Random random = new Random(this.func_72905_C()); -@@ -676,6 +696,7 @@ - p_73044_2_.func_200209_c(new TextComponentTranslation("menu.savingChunks", new Object[0])); +@@ -676,6 +694,7 @@ + p_73044_2_.func_200209_c(new TextComponentTranslation("menu.savingChunks")); } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Save(this)); chunkproviderserver.func_186027_a(p_73044_1_); for(Chunk chunk : Lists.newArrayList(chunkproviderserver.func_189548_a())) { -@@ -715,6 +736,7 @@ - this.field_72986_A.func_201356_c(this.field_73061_a.func_201300_aS().func_201380_c()); - 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(); - } +@@ -723,7 +742,7 @@ - public boolean func_72838_d(Entity p_72838_1_) { -@@ -723,7 +745,7 @@ - - public void func_175650_b(Collection p_175650_1_) { - 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); + public void func_212420_a(Stream p_212420_1_) { + p_212420_1_.forEach((p_212421_1_) -> { +- if (this.func_184165_i(p_212421_1_)) { ++ if (this.func_184165_i(p_212421_1_) && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_212421_1_, this))) { + this.field_72996_f.add(p_212421_1_); + this.func_72923_a(p_212421_1_); } -@@ -785,7 +807,7 @@ - - public boolean func_72942_c(Entity p_72942_1_) { - 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.getId(), new SPacketSpawnGlobalEntity(p_72942_1_)); - return true; - } else { - return false; -@@ -802,6 +824,7 @@ +@@ -802,6 +821,7 @@ public Explosion func_211529_a(@Nullable Entity p_211529_1_, DamageSource p_211529_2_, double p_211529_3_, double p_211529_5_, double p_211529_7_, float p_211529_9_, boolean p_211529_10_, boolean p_211529_11_) { Explosion explosion = new Explosion(this, p_211529_1_, p_211529_3_, p_211529_5_, p_211529_7_, p_211529_9_, p_211529_10_, p_211529_11_); @@ -222,26 +213,8 @@ if (p_211529_2_ != null) { explosion.func_199592_a(p_211529_2_); } -@@ -829,7 +852,7 @@ - while(!this.field_147490_S.isEmpty()) { - BlockEventData blockeventdata = this.field_147490_S.removeFirst(); - 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.getId(), new SPacketBlockAction(blockeventdata.func_180328_a(), blockeventdata.func_151337_f(), blockeventdata.func_151339_d(), blockeventdata.func_151338_e())); - } - } - -@@ -849,22 +872,26 @@ - boolean flag = this.func_72896_J(); - super.func_72979_l(); - 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.getId()); - } - - 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.getId()); +@@ -856,15 +876,19 @@ + this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.func_186058_p()); } + /* The function in use here has been replaced in order to only send the weather info to players in the correct dimension, @@ -251,34 +224,24 @@ 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.getId()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(2, 0.0F), this.field_73011_w.func_186058_p()); } 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.getId()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(1, 0.0F), this.field_73011_w.func_186058_p()); } - 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.getId()); -+ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.getId()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.func_186058_p()); ++ this.field_73061_a.func_184103_al().func_148537_a(new SPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.func_186058_p()); } } -@@ -957,4 +984,18 @@ +@@ -957,4 +981,8 @@ public NetworkTagManager func_205772_D() { return this.field_73061_a.func_199731_aO(); } + -+ private long[] tickTime = new long[100]; -+ -+ public void setTickTime(int tick, long time) { -+ this.tickTime[tick % 100] = time; -+ } -+ -+ public long[] getTickTimes() { -+ return this.tickTime; -+ } -+ + public java.io.File getChunkSaveLocation() { + return ((net.minecraft.world.chunk.storage.AnvilChunkLoader)func_72863_F().field_73247_e).field_75825_d; + } diff --git a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch index 0621184c5..cdd487c49 100644 --- a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch @@ -1,41 +1,37 @@ --- a/net/minecraft/world/WorldServerMulti.java +++ b/net/minecraft/world/WorldServerMulti.java -@@ -10,11 +10,12 @@ +@@ -10,9 +10,12 @@ + import net.minecraft.world.storage.ISaveHandler; 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() { ++ private final WorldServer delegate; ++ private final IBorderListener borderListener; + public WorldServerMulti(MinecraftServer p_i49820_1_, ISaveHandler p_i49820_2_, DimensionType p_i49820_3_, WorldServer p_i49820_4_, Profiler p_i49820_5_) { + super(p_i49820_1_, p_i49820_2_, p_i49820_4_.func_175693_T(), new DerivedWorldInfo(p_i49820_4_.func_72912_H()), p_i49820_3_, p_i49820_5_); +- p_i49820_4_.func_175723_af().func_177737_a(new IBorderListener() { ++ this.delegate = p_i49820_4_; ++ this.borderListener = (new IBorderListener() { public void func_177694_a(WorldBorder p_177694_1_, double p_177694_2_) { WorldServerMulti.this.func_175723_af().func_177750_a(p_177694_2_); } -@@ -42,28 +43,37 @@ - public void func_177695_c(WorldBorder p_177695_1_, double p_177695_2_) { +@@ -41,6 +44,7 @@ WorldServerMulti.this.func_175723_af().func_177724_b(p_177695_2_); } -- }); -+ }; -+ p_i45923_4_.func_175723_af().func_177737_a(this.borderListener); + }); ++ p_i49820_4_.func_175723_af().func_177737_a(this.borderListener); } protected void func_73042_a() { -+ this.perWorldStorage.func_75744_a(); - } +@@ -48,19 +52,26 @@ - public IWorld func_175643_b() { - this.field_72988_C = this.field_175743_a.func_175693_T(); + public WorldServerMulti func_212251_i__() { String s = VillageCollection.func_176062_a(this.field_73011_w); -- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_201067_a(VillageCollection::new, s); -+ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_201067_a(VillageCollection::new, s); +- VillageCollection villagecollection = this.func_212411_a(DimensionType.OVERWORLD, VillageCollection::new, s); ++ VillageCollection villagecollection = this.func_212411_a(func_201675_m().func_186058_p(), VillageCollection::new, 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); +- this.func_212409_a(DimensionType.OVERWORLD, s, this.field_72982_D); ++ this.func_212409_a(func_201675_m().func_186058_p(), s, this.field_72982_D); } else { this.field_72982_D = villagecollection; this.field_72982_D.func_82566_a(this); @@ -52,6 +48,6 @@ + @Override + public void close() { + super.close(); -+ this.field_175743_a.func_175723_af().removeListener(this.borderListener); // Unlink ourselves, to prevent world leak. ++ this.delegate.func_175723_af().removeListener(this.borderListener); // Unlink ourselves, to prevent world leak. + } } diff --git a/patches/minecraft/net/minecraft/world/biome/Biome.java.patch b/patches/minecraft/net/minecraft/world/biome/Biome.java.patch index a1f9ca01b..97c36a7b2 100644 --- a/patches/minecraft/net/minecraft/world/biome/Biome.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/Biome.java.patch @@ -9,29 +9,12 @@ public static final Logger field_150586_aC = LogManager.getLogger(); public static final WorldCarver field_201907_b = new CaveWorldCarver(); public static final WorldCarver field_201908_c = new NetherCaveWorldCarver(); -@@ -233,7 +233,7 @@ - public static final ObjectIntIdentityMap field_185373_j = new ObjectIntIdentityMap(); - protected static final NoiseGeneratorPerlin field_150605_ac = new NoiseGeneratorPerlin(new Random(1234L), 1); - public static final NoiseGeneratorPerlin field_180281_af = new NoiseGeneratorPerlin(new Random(2345L), 1); -- public static final RegistryNamespaced field_185377_q = new RegistryNamespaced(); -+ public static final RegistryNamespaced field_185377_q = net.minecraftforge.registries.GameData.getWrapper(Biome.class); - @Nullable - protected String field_205405_aL; - protected final float field_76748_D; -@@ -299,7 +299,6 @@ - for(EnumCreatureType enumcreaturetype : EnumCreatureType.values()) { - this.field_201880_ax.put(enumcreaturetype, Lists.newArrayList()); - } -- - } else { - throw new IllegalStateException("You are missing parameters to build a proper biome for " + this.getClass().getSimpleName() + "\n" + p_i48975_1_); - } -@@ -332,11 +331,11 @@ +@@ -322,11 +322,11 @@ } public void func_201866_a(EnumCreatureType p_201866_1_, Biome.SpawnListEntry p_201866_2_) { -- (this.field_201880_ax.get(p_201866_1_)).add(p_201866_2_); -+ (this.field_201880_ax.computeIfAbsent(p_201866_1_, k -> Lists.newArrayList())).add(p_201866_2_); +- this.field_201880_ax.get(p_201866_1_).add(p_201866_2_); ++ this.field_201880_ax.computeIfAbsent(p_201866_1_, k -> Lists.newArrayList()).add(p_201866_2_); } public List func_76747_a(EnumCreatureType p_76747_1_) { @@ -40,7 +23,7 @@ } public Biome.RainType func_201851_b() { -@@ -393,7 +392,7 @@ +@@ -383,7 +383,7 @@ } else { if (p_201850_2_.func_177956_o() >= 0 && p_201850_2_.func_177956_o() < 256 && p_201850_1_.func_175642_b(EnumLightType.BLOCK, p_201850_2_) < 10) { IBlockState iblockstate = p_201850_1_.func_180495_p(p_201850_2_); @@ -49,7 +32,7 @@ return true; } } -@@ -752,6 +751,18 @@ +@@ -737,6 +737,18 @@ } } diff --git a/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch b/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch index 4babd2fc3..4b08b4e90 100644 --- a/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch +++ b/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/border/WorldBorder.java +++ b/net/minecraft/world/border/WorldBorder.java -@@ -174,6 +174,10 @@ +@@ -125,6 +125,10 @@ this.field_177758_a.add(p_177737_1_); } @@ -10,4 +10,4 @@ + public void func_177725_a(int p_177725_1_) { this.field_177762_h = p_177725_1_; - } + this.field_212674_i.func_212652_j(); diff --git a/patches/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch b/patches/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch index 7673e0605..aea607613 100644 --- a/patches/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/BlockStateContainer.java.patch @@ -13,7 +13,7 @@ + this.field_186024_e = bitsIn; if (this.field_186024_e <= 4) { this.field_186024_e = 4; - this.field_186022_c = new BlockStatePaletteLinear(this.field_205523_d, this.field_186024_e, this, this.field_205524_e); + this.field_186022_c = new BlockStatePaletteLinear<>(this.field_205523_d, this.field_186024_e, this, this.field_205524_e); @@ -73,6 +76,8 @@ } else { this.field_186022_c = this.field_205521_b; diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch index 6e131913e..94986812c 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/chunk/Chunk.java +++ b/net/minecraft/world/chunk/Chunk.java -@@ -53,7 +53,7 @@ +@@ -55,7 +55,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -8,16 +8,16 @@ +public class Chunk extends net.minecraftforge.common.capabilities.CapabilityProvider implements IChunk, net.minecraftforge.common.extensions.IForgeChunk { private static final Logger field_150817_t = LogManager.getLogger(); public static final ChunkSection field_186036_a = null; - private final ChunkSection[] field_76652_q; -@@ -93,6 +93,7 @@ + private final ChunkSection[] field_76652_q = new ChunkSection[16]; +@@ -95,6 +95,7 @@ } public Chunk(World p_i49379_1_, int p_i49379_2_, int p_i49379_3_, Biome[] p_i49379_4_, UpgradeData p_i49379_5_, ITickList p_i49379_6_, ITickList p_i49379_7_, long p_i49379_8_) { + super(Chunk.class); - this.field_76652_q = new ChunkSection[16]; - this.field_76639_c = new boolean[256]; - this.field_201618_i = Maps.newHashMap(); -@@ -125,6 +126,7 @@ + this.field_76645_j = new ClassInheritanceMultiMap[16]; + this.field_76637_e = p_i49379_1_; + this.field_76635_g = p_i49379_2_; +@@ -116,6 +117,7 @@ this.field_201621_s = p_i49379_6_; this.field_205325_u = p_i49379_7_; this.field_111204_q = p_i49379_8_; @@ -25,7 +25,7 @@ } public Chunk(World p_i48703_1_, ChunkPrimer p_i48703_2_, int p_i48703_3_, int p_i48703_4_) { -@@ -423,6 +425,7 @@ +@@ -414,6 +416,7 @@ Block block = p_177436_2_.func_177230_c(); Block block1 = iblockstate.func_177230_c(); ChunkSection chunksection = this.field_76652_q[j >> 4]; @@ -33,8 +33,8 @@ boolean flag = false; if (chunksection == field_186036_a) { if (p_177436_2_.func_196958_f()) { -@@ -441,7 +444,7 @@ - ((Heightmap)this.field_76634_f.get(Heightmap.Type.WORLD_SURFACE)).func_202270_a(i, j, k, p_177436_2_); +@@ -432,7 +435,7 @@ + this.field_76634_f.get(Heightmap.Type.WORLD_SURFACE).func_202270_a(i, j, k, p_177436_2_); if (!this.field_76637_e.field_72995_K) { iblockstate.func_196947_b(this.field_76637_e, p_177436_1_, p_177436_2_, p_177436_3_); - } else if (block1 != block && block1 instanceof ITileEntityProvider) { @@ -42,7 +42,7 @@ this.field_76637_e.func_175713_t(p_177436_1_); } -@@ -452,14 +455,13 @@ +@@ -443,14 +446,13 @@ this.func_76603_b(); } else { int i1 = p_177436_2_.func_200016_a(this.field_76637_e, p_177436_1_); @@ -58,7 +58,7 @@ TileEntity tileentity = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); if (tileentity != null) { tileentity.func_145836_u(); -@@ -470,10 +472,10 @@ +@@ -461,10 +463,10 @@ p_177436_2_.func_196945_a(this.field_76637_e, p_177436_1_, iblockstate); } @@ -71,7 +71,7 @@ this.field_76637_e.func_175690_a(p_177436_1_, tileentity1); } else { tileentity1.func_145836_u(); -@@ -588,11 +590,13 @@ +@@ -579,11 +581,13 @@ k = this.field_76645_j.length - 1; } @@ -85,7 +85,7 @@ } public void func_201607_a(Heightmap.Type p_201607_1_, long[] p_201607_2_) { -@@ -613,6 +617,7 @@ +@@ -604,6 +608,7 @@ } this.field_76645_j[p_76608_2_].remove(p_76608_1_); @@ -93,7 +93,7 @@ } public boolean func_177444_d(BlockPos p_177444_1_) { -@@ -630,7 +635,7 @@ +@@ -621,7 +626,7 @@ private TileEntity func_177422_i(BlockPos p_177422_1_) { IBlockState iblockstate = this.func_180495_p(p_177422_1_); Block block = iblockstate.func_177230_c(); @@ -102,7 +102,7 @@ } @Nullable -@@ -641,16 +646,17 @@ +@@ -632,6 +637,11 @@ @Nullable public TileEntity func_177424_a(BlockPos p_177424_1_, Chunk.EnumCreateEntityType p_177424_2_) { TileEntity tileentity = this.field_150816_i.get(p_177424_1_); @@ -110,8 +110,11 @@ + field_150816_i.remove(p_177424_1_); + tileentity = null; + } ++ if (tileentity == null) { - if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE) { + NBTTagCompound nbttagcompound = this.field_201618_i.remove(p_177424_1_); + if (nbttagcompound != null) { +@@ -647,11 +657,8 @@ tileentity = this.func_177422_i(p_177424_1_); this.field_76637_e.func_175690_a(p_177424_1_, tileentity); } else if (p_177424_2_ == Chunk.EnumCreateEntityType.QUEUED) { @@ -124,7 +127,7 @@ } return tileentity; -@@ -665,9 +671,10 @@ +@@ -666,9 +673,10 @@ } public void func_177426_a(BlockPos p_177426_1_, TileEntity p_177426_2_) { @@ -134,17 +137,13 @@ - if (this.func_180495_p(p_177426_1_).func_177230_c() instanceof ITileEntityProvider) { + if (this.func_180495_p(p_177426_1_).hasTileEntity()) { if (this.field_150816_i.containsKey(p_177426_1_)) { - ((TileEntity)this.field_150816_i.get(p_177426_1_)).func_145843_s(); + this.field_150816_i.get(p_177426_1_).func_145843_s(); } -@@ -696,12 +703,14 @@ - this.field_76637_e.func_147448_a(this.field_150816_i.values()); - - 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)); +@@ -702,9 +710,11 @@ + })); } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(this)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(this)); } public void func_76623_d() { @@ -152,7 +151,7 @@ this.field_76636_d = false; for(TileEntity tileentity : this.field_150816_i.values()) { -@@ -711,6 +720,7 @@ +@@ -714,6 +724,7 @@ for(ClassInheritanceMultiMap classinheritancemultimap : this.field_76645_j) { this.field_76637_e.func_175681_c(classinheritancemultimap); } @@ -160,7 +159,7 @@ } -@@ -719,8 +729,8 @@ +@@ -722,8 +733,8 @@ } public void func_177414_a(@Nullable Entity p_177414_1_, AxisAlignedBB p_177414_2_, List p_177414_3_, Predicate p_177414_4_) { @@ -171,7 +170,7 @@ 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); -@@ -748,8 +758,8 @@ +@@ -751,8 +762,8 @@ } public void func_177430_a(Class p_177430_1_, AxisAlignedBB p_177430_2_, List p_177430_3_, @Nullable Predicate p_177430_4_) { @@ -182,7 +181,7 @@ 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); -@@ -788,7 +798,7 @@ +@@ -791,7 +802,7 @@ while(!this.field_177447_w.isEmpty()) { BlockPos blockpos = this.field_177447_w.poll(); @@ -191,7 +190,7 @@ TileEntity tileentity = this.func_177422_i(blockpos); this.field_76637_e.func_175690_a(blockpos, tileentity); this.field_76637_e.func_175704_b(blockpos, blockpos); -@@ -838,6 +848,10 @@ +@@ -841,6 +852,10 @@ @OnlyIn(Dist.CLIENT) public void func_186033_a(PacketBuffer p_186033_1_, int p_186033_2_, boolean p_186033_3_) { @@ -202,7 +201,7 @@ if (p_186033_3_) { this.field_150816_i.clear(); } else { -@@ -926,10 +940,10 @@ +@@ -929,10 +944,10 @@ for(int i1 = 0; i1 < 16; ++i1) { 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; @@ -215,20 +214,20 @@ this.field_76637_e.func_175664_x(blockpos2); } } -@@ -1087,9 +1101,9 @@ - if (this.func_175625_s(blockpos1) == null) { - TileEntity tileentity; - if ("DUMMY".equals(nbttagcompound.func_74779_i("id"))) { -- Block block = this.func_180495_p(blockpos1).func_177230_c(); -- if (block instanceof ITileEntityProvider) { -- tileentity = ((ITileEntityProvider)block).func_196283_a_(this.field_76637_e); -+ IBlockState state = this.func_180495_p(blockpos1); -+ if (state.hasTileEntity()) { -+ tileentity = state.createTileEntity(this.field_76637_e); - } else { - tileentity = null; - field_150817_t.warn("Tried to load a DUMMY block entity @ {} but found not tile entity block {} at location", blockpos1, this.func_180495_p(blockpos1)); -@@ -1164,4 +1178,30 @@ +@@ -1097,9 +1112,9 @@ + private TileEntity func_212815_a(BlockPos p_212815_1_, NBTTagCompound p_212815_2_) { + TileEntity tileentity; + if ("DUMMY".equals(p_212815_2_.func_74779_i("id"))) { +- Block block = this.func_180495_p(p_212815_1_).func_177230_c(); +- if (block instanceof ITileEntityProvider) { +- tileentity = ((ITileEntityProvider)block).func_196283_a_(this.field_76637_e); ++ IBlockState state = this.func_180495_p(p_212815_1_); ++ if (state.hasTileEntity()) { ++ tileentity = state.createTileEntity(this.field_76637_e); + } else { + tileentity = null; + field_150817_t.warn("Tried to load a DUMMY block entity @ {} but found not block entity block {} at location", p_212815_1_, this.func_180495_p(p_212815_1_)); +@@ -1170,4 +1185,30 @@ QUEUED, CHECK; } diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch index 5dc5ce6ff..b656eb63c 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +++ b/net/minecraft/world/chunk/storage/AnvilChunkLoader.java -@@ -214,6 +214,9 @@ +@@ -225,6 +225,9 @@ this.func_202156_a((ChunkPrimer)p_75816_2_, p_75816_1_, nbttagcompound1); } @@ -10,7 +10,7 @@ this.func_75824_a(chunkpos, nbttagcompound); } catch (Exception exception) { field_151505_a.error("Failed to save chunk", (Throwable)exception); -@@ -391,10 +394,14 @@ +@@ -388,10 +391,14 @@ for(int j = 0; j < p_75820_1_.func_177429_s().length; ++j) { for(Entity entity : p_75820_1_.func_177429_s()[j]) { NBTTagCompound nbttagcompound = new NBTTagCompound(); @@ -25,7 +25,7 @@ } } -@@ -405,7 +412,11 @@ +@@ -402,7 +409,11 @@ TileEntity tileentity = p_75820_1_.func_175625_s(blockpos); if (tileentity != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); @@ -38,7 +38,7 @@ nbttagcompound1.func_74757_a("keepPacked", false); nbttaglist2.add((INBTBase)nbttagcompound1); } else { -@@ -445,6 +456,16 @@ +@@ -442,6 +453,16 @@ p_75820_3_.func_74782_a("Heightmaps", nbttagcompound2); p_75820_3_.func_74782_a("Structures", this.func_202160_a(p_75820_1_.field_76635_g, p_75820_1_.field_76647_h, p_75820_1_.func_201609_c(), p_75820_1_.func_201604_d())); @@ -55,7 +55,7 @@ } private Chunk func_75823_a(IWorld p_75823_1_, NBTTagCompound p_75823_2_) { -@@ -511,6 +532,10 @@ +@@ -508,6 +529,10 @@ chunk.func_177427_f(true); } @@ -66,7 +66,7 @@ return chunk; } -@@ -813,4 +838,8 @@ +@@ -809,4 +834,8 @@ return flag; } 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 de30ce33e..000000000 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -+++ b/net/minecraft/world/chunk/storage/AnvilSaveHandler.java -@@ -19,12 +19,8 @@ - - public IChunkLoader func_75763_a(Dimension p_75763_1_) { - File file1 = this.func_75765_b(); -- if (p_75763_1_ instanceof NetherDimension) { -- File file3 = new File(file1, "DIM-1"); -- file3.mkdirs(); -- return new AnvilChunkLoader(file3, this.field_186341_a); -- } else if (p_75763_1_ instanceof EndDimension) { -- File file2 = new File(file1, "DIM1"); -+ if (p_75763_1_.getSaveFolder() != null) { -+ File file2 = new File(file1, p_75763_1_.getSaveFolder()); - file2.mkdirs(); - return new AnvilChunkLoader(file2, this.field_186341_a); - } else { diff --git a/patches/minecraft/net/minecraft/world/dimension/Dimension.java.patch b/patches/minecraft/net/minecraft/world/dimension/Dimension.java.patch index b4ef43445..9d337b118 100644 --- a/patches/minecraft/net/minecraft/world/dimension/Dimension.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/Dimension.java.patch @@ -35,7 +35,7 @@ public abstract IChunkGenerator func_186060_c(); @Nullable -@@ -141,4 +142,72 @@ +@@ -141,4 +142,61 @@ public abstract boolean func_76568_b(int p_76568_1_, int p_76568_2_); public abstract DimensionType func_186058_p(); @@ -44,17 +44,6 @@ + private net.minecraftforge.client.IRenderHandler skyRenderer = null; + private net.minecraftforge.client.IRenderHandler cloudRenderer = null; + private net.minecraftforge.client.IRenderHandler weatherRenderer = null; -+ private int dimensionId; -+ -+ @Override -+ public void setId(int id) { -+ this.dimensionId = id; -+ } -+ -+ @Override -+ public int getId() { -+ return this.dimensionId; -+ } + + @Nullable + @OnlyIn(Dist.CLIENT) diff --git a/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch b/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch index 5c2a89e66..643d960c7 100644 --- a/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/DimensionType.java.patch @@ -1,42 +1,85 @@ --- a/net/minecraft/world/dimension/DimensionType.java +++ b/net/minecraft/world/dimension/DimensionType.java -@@ -2,7 +2,7 @@ +@@ -6,14 +6,17 @@ + import net.minecraft.util.ResourceLocation; + import net.minecraft.util.registry.IRegistry; - import java.util.function.Supplier; - --public enum DimensionType { -+public enum DimensionType implements net.minecraftforge.common.IExtensibleEnum { - OVERWORLD(0, "overworld", "", OverworldDimension::new), - NETHER(-1, "the_nether", "_nether", NetherDimension::new), - THE_END(1, "the_end", "_end", EndDimension::new); -@@ -11,12 +11,19 @@ - private final String field_186075_e; +-public class DimensionType { ++public class DimensionType extends net.minecraftforge.registries.ForgeRegistryEntry { + public static final DimensionType OVERWORLD = func_212677_a("overworld", new DimensionType(1, "", "", OverworldDimension::new)); + public static final DimensionType NETHER = func_212677_a("the_nether", new DimensionType(0, "_nether", "DIM-1", NetherDimension::new)); + public static final DimensionType THE_END = func_212677_a("the_end", new DimensionType(2, "_end", "DIM1", EndDimension::new)); + private final int field_186074_d; private final String field_186076_f; - private final Supplier field_201038_g; -+ private final boolean shouldLoadSpawn; + private final String field_212682_f; +- private final Supplier field_201038_g; ++ private final java.util.function.Function field_201038_g; ++ private final boolean isVanilla; ++ private final net.minecraftforge.common.ModDimension modType; ++ private final net.minecraft.network.PacketBuffer data; - private DimensionType(int p_i48278_3_, String p_i48278_4_, String p_i48278_5_, Supplier p_i48278_6_) { -+ this(p_i48278_3_, p_i48278_4_, p_i48278_5_, p_i48278_6_, p_i48278_3_ == 0); -+ } -+ -+ private DimensionType(int p_i48278_3_, String p_i48278_4_, String p_i48278_5_, Supplier p_i48278_6_, boolean shouldLoadSpawn) -+ { - this.field_186074_d = p_i48278_3_; - this.field_186075_e = p_i48278_4_; - this.field_186076_f = p_i48278_5_; - this.field_201038_g = p_i48278_6_; -+ this.shouldLoadSpawn = shouldLoadSpawn; + public static void func_212680_a() { + } +@@ -23,11 +26,19 @@ + return p_212677_1_; } - public int func_186068_a() { -@@ -54,4 +61,10 @@ - - throw new IllegalArgumentException("Invalid dimension " + p_193417_0_); - } -+ -+ public boolean shouldLoadSpawn(){ return this.shouldLoadSpawn; } -+ -+ public static DimensionType create(String enumName, int id, String name, String suffix, Supplier provider, boolean shouldLoadSpawn) { -+ throw new IllegalStateException("Enum not extended"); +- protected DimensionType(int p_i49807_1_, String p_i49807_2_, String p_i49807_3_, Supplier p_i49807_4_) { ++ public DimensionType(int p_i49807_1_, String p_i49807_2_, String p_i49807_3_, Supplier p_i49807_4_) { ++ this(p_i49807_1_, p_i49807_2_, p_i49807_3_, type -> p_i49807_4_.get(), null, null); + } - } ++ ++ //Forge, Internal use only. Use DimensionManager instead. ++ public DimensionType(int p_i49807_1_, String p_i49807_2_, String p_i49807_3_, java.util.function.Function p_i49807_4_, @Nullable net.minecraftforge.common.ModDimension modType, @Nullable net.minecraft.network.PacketBuffer data) { + this.field_186074_d = p_i49807_1_; + this.field_186076_f = p_i49807_2_; + this.field_212682_f = p_i49807_3_; + this.field_201038_g = p_i49807_4_; ++ this.isVanilla = this.field_186074_d >= 0 && this.field_186074_d <= 2; ++ this.modType = modType; ++ this.data = data; + } + + public static Iterable func_212681_b() { +@@ -38,8 +49,9 @@ + return this.field_186074_d + -1; + } + ++ @Deprecated //Forge Do not use, only used for villages backwards compatibility + public String func_186067_c() { +- return this.field_186076_f; ++ return isVanilla ? this.field_186076_f : ""; + } + + public File func_212679_a(File p_212679_1_) { +@@ -47,7 +59,7 @@ + } + + public Dimension func_186070_d() { +- return this.field_201038_g.get(); ++ return this.field_201038_g.apply(this); + } + + public String toString() { +@@ -59,7 +71,21 @@ + return IRegistry.field_212622_k.func_148754_a(p_186069_0_ - -1); + } + ++ public boolean isVanilla() { ++ return this.isVanilla; ++ } ++ + @Nullable ++ public net.minecraftforge.common.ModDimension getModType() { ++ return this.modType; ++ } ++ ++ @Nullable ++ public net.minecraft.network.PacketBuffer getData() { ++ return this.data; ++ } ++ ++ @Nullable + public static DimensionType func_193417_a(ResourceLocation p_193417_0_) { + return IRegistry.field_212622_k.func_212608_b(p_193417_0_); + } diff --git a/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch b/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch index e9641b6ac..b8cbf8941 100644 --- a/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/EndDimension.java.patch @@ -1,24 +1,40 @@ --- a/net/minecraft/world/dimension/EndDimension.java +++ b/net/minecraft/world/dimension/EndDimension.java -@@ -23,7 +23,7 @@ +@@ -20,9 +20,14 @@ + public class EndDimension extends Dimension { + public static final BlockPos field_209958_g = new BlockPos(100, 50, 0); private DragonFightManager field_186064_g; ++ private final DimensionType type; ++ public EndDimension() { this(DimensionType.THE_END); } ++ public EndDimension(DimensionType type) { ++ this.type = type; ++ } public void func_76572_b() { - 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.getId()); ++ NBTTagCompound nbttagcompound = this.field_76579_a.func_72912_H().func_186347_a(this.field_76579_a.field_73011_w.func_186058_p()); this.field_186064_g = this.field_76579_a instanceof WorldServer ? new DragonFightManager((WorldServer)this.field_76579_a, nbttagcompound.func_74775_l("DragonFight")) : null; this.field_191067_f = false; } -@@ -109,7 +109,7 @@ +@@ -99,7 +104,7 @@ + } + + public DimensionType func_186058_p() { +- return DimensionType.THE_END; ++ return type; + } + + public void func_186057_q() { +@@ -108,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.getId(), nbttagcompound); ++ this.field_76579_a.func_72912_H().func_186345_a(this.field_76579_a.field_73011_w.func_186058_p(), nbttagcompound); } public void func_186059_r() { -@@ -123,4 +123,18 @@ +@@ -122,4 +127,18 @@ public DragonFightManager func_186063_s() { return this.field_186064_g; } diff --git a/patches/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch b/patches/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch new file mode 100644 index 000000000..c6ec98384 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/dimension/NetherDimension.java.patch @@ -0,0 +1,23 @@ +--- a/net/minecraft/world/dimension/NetherDimension.java ++++ b/net/minecraft/world/dimension/NetherDimension.java +@@ -15,6 +15,12 @@ + import net.minecraftforge.api.distmarker.OnlyIn; + + public class NetherDimension extends Dimension { ++ private final DimensionType type; ++ public NetherDimension() { this(DimensionType.NETHER); } ++ public NetherDimension(DimensionType type) { ++ this.type = type; ++ } ++ + public void func_76572_b() { + this.field_76575_d = true; + this.field_76576_e = true; +@@ -83,6 +89,6 @@ + } + + public DimensionType func_186058_p() { +- return DimensionType.NETHER; ++ return type; + } + } diff --git a/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch b/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch index 8540611af..eabd1883d 100644 --- a/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch +++ b/patches/minecraft/net/minecraft/world/dimension/OverworldDimension.java.patch @@ -1,11 +1,23 @@ --- a/net/minecraft/world/dimension/OverworldDimension.java +++ b/net/minecraft/world/dimension/OverworldDimension.java -@@ -51,7 +51,7 @@ +@@ -47,12 +47,18 @@ + import net.minecraftforge.api.distmarker.OnlyIn; + + public class OverworldDimension extends Dimension { ++ private final DimensionType type; ++ public OverworldDimension() { this(DimensionType.OVERWORLD); } ++ public OverworldDimension(DimensionType type) { ++ this.type = type; ++ } ++ + public DimensionType func_186058_p() { +- return DimensionType.OVERWORLD; ++ return type; } 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(); +- return !this.field_76579_a.func_72916_c(p_186056_1_, p_186056_2_) && super.func_186056_c(p_186056_1_, p_186056_2_); ++ return (this.type != DimensionType.OVERWORLD || !this.field_76579_a.func_72916_c(p_186056_1_, p_186056_2_)) && super.func_186056_c(p_186056_1_, p_186056_2_); } protected void func_76572_b() { diff --git a/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch b/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch index 646eb076e..13684dcda 100644 --- a/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch +++ b/patches/minecraft/net/minecraft/world/end/DragonFightManager.java.patch @@ -29,5 +29,5 @@ + } + class LoadManager { - private DragonFightManager.LoadState field_210826_b; + private DragonFightManager.LoadState field_210826_b = DragonFightManager.LoadState.UNKNOWN; diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index 8f6b33c7a..ce4a098ae 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -1,26 +1,18 @@ --- a/net/minecraft/world/gen/ChunkProviderServer.java +++ b/net/minecraft/world/gen/ChunkProviderServer.java -@@ -248,6 +248,7 @@ +@@ -239,6 +239,7 @@ + Chunk chunk = this.field_73244_f.get(olong); + if (chunk != null) { + 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.field_73244_f.remove(olong); + this.field_212472_f = null; +@@ -250,6 +251,7 @@ - public boolean func_73156_b() { - if (!this.field_73251_h.field_73058_d) { -+ field_73251_h.getPersistentChunks().keySet().forEach(pos -> field_73248_b.remove(ChunkPos.func_77272_a(pos.field_77276_a, pos.field_77275_b))); - if (!this.field_73248_b.isEmpty()) { - Iterator iterator = this.field_73248_b.iterator(); - -@@ -256,6 +257,7 @@ - Chunk chunk = (Chunk)this.field_73244_f.get(olong); - 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); -@@ -264,6 +266,7 @@ - } - } - -+ if (this.field_73244_f.isEmpty()) net.minecraftforge.common.DimensionManager.unloadWorld(this.field_73251_h.field_73011_w.getId()); - this.field_201723_f.func_208484_a(); - this.field_73247_e.func_75817_a(); + this.field_201723_f.func_208484_a(p_73156_1_); } ++ if (this.field_73244_f.isEmpty()) net.minecraftforge.common.DimensionManager.unloadWorld(this.field_73251_h); + + return false; + } diff --git a/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch b/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch index 13fa30a5b..13c548ef1 100644 --- a/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/WorldGenRegion.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/WorldGenRegion.java +++ b/net/minecraft/world/gen/WorldGenRegion.java -@@ -128,7 +128,7 @@ +@@ -121,7 +121,7 @@ } public boolean func_175623_d(BlockPos p_175623_1_) { @@ -9,7 +9,7 @@ } public Biome func_180494_b(BlockPos p_180494_1_) { -@@ -180,7 +180,7 @@ +@@ -173,7 +173,7 @@ NBTTagCompound nbttagcompound = ichunk.func_201579_g(p_175625_1_); if (nbttagcompound != null) { if ("DUMMY".equals(nbttagcompound.func_74779_i("id"))) { @@ -18,7 +18,7 @@ } else { tileentity = TileEntity.func_203403_c(nbttagcompound); } -@@ -191,7 +191,7 @@ +@@ -184,7 +184,7 @@ } } @@ -27,7 +27,7 @@ field_208303_a.warn("Tried to access a block entity before it was created. {}", (Object)p_175625_1_); } -@@ -203,9 +203,9 @@ +@@ -196,9 +196,9 @@ IChunk ichunk = this.func_205771_y(p_180501_1_); IBlockState iblockstate = ichunk.func_177436_a(p_180501_1_, p_180501_2_, false); Block block = p_180501_2_.func_177230_c(); @@ -39,7 +39,7 @@ } else { NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.func_74768_a("x", p_180501_1_.func_177958_n()); -@@ -214,7 +214,7 @@ +@@ -207,7 +207,7 @@ nbttagcompound.func_74778_a("id", "DUMMY"); ichunk.func_201591_a(nbttagcompound); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/BigRedMushroomFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/BigRedMushroomFeature.java.patch index d2c6d7846..df778f380 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/BigRedMushroomFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/BigRedMushroomFeature.java.patch @@ -15,7 +15,7 @@ blockpos$mutableblockpos.func_189533_g(p_212245_4_).func_196234_d(l2, l1, k1); - if (!p_212245_1_.func_180495_p(blockpos$mutableblockpos).func_200015_d(p_212245_1_, blockpos$mutableblockpos)) { + if (p_212245_1_.func_180495_p(blockpos$mutableblockpos).canBeReplacedByLeaves(p_212245_1_, blockpos$mutableblockpos)) { - this.func_202278_a(p_212245_1_, blockpos$mutableblockpos, (IBlockState)((IBlockState)((IBlockState)((IBlockState)((IBlockState)iblockstate1.func_206870_a(BlockHugeMushroom.field_196465_z, Boolean.valueOf(l1 >= i - 1))).func_206870_a(BlockHugeMushroom.field_196464_y, Boolean.valueOf(l2 < 0))).func_206870_a(BlockHugeMushroom.field_196461_b, Boolean.valueOf(l2 > 0))).func_206870_a(BlockHugeMushroom.field_196459_a, Boolean.valueOf(k1 < 0))).func_206870_a(BlockHugeMushroom.field_196463_c, Boolean.valueOf(k1 > 0))); + this.func_202278_a(p_212245_1_, blockpos$mutableblockpos, iblockstate1.func_206870_a(BlockHugeMushroom.field_196465_z, Boolean.valueOf(l1 >= i - 1)).func_206870_a(BlockHugeMushroom.field_196464_y, Boolean.valueOf(l2 < 0)).func_206870_a(BlockHugeMushroom.field_196461_b, Boolean.valueOf(l2 > 0)).func_206870_a(BlockHugeMushroom.field_196459_a, Boolean.valueOf(k1 < 0)).func_206870_a(BlockHugeMushroom.field_196463_c, Boolean.valueOf(k1 > 0))); } } @@ -73,7 +73,7 @@ diff --git a/patches/minecraft/net/minecraft/world/gen/feature/BigTreeFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/BigTreeFeature.java.patch index 41c4551d7..7884e39fc 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/BigTreeFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/BigTreeFeature.java.patch @@ -12,13 +12,22 @@ @@ -86,7 +86,7 @@ BlockPos blockpos1 = p_208523_3_.func_177963_a((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); if (p_208523_5_) { - this.func_208520_a(p_208523_1_, p_208523_2_, blockpos1, (IBlockState)field_208530_a.func_206870_a(BlockLog.field_176298_M, this.func_197170_b(p_208523_3_, blockpos1))); + this.func_208520_a(p_208523_1_, p_208523_2_, blockpos1, field_208530_a.func_206870_a(BlockLog.field_176298_M, this.func_197170_b(p_208523_3_, blockpos1))); - } else if (!this.func_150523_a(p_208523_2_.func_180495_p(blockpos1).func_177230_c())) { + } else if (!this.canGrowInto(p_208523_2_, blockpos1)) { return j; } } -@@ -205,8 +205,7 @@ +@@ -156,7 +156,7 @@ + if (i == -1) { + return false; + } else { +- this.func_175921_a(p_208519_2_, p_208519_4_.func_177977_b()); ++ this.setDirtAt(p_208519_2_, p_208519_4_.func_177977_b(), p_208519_4_); + int j = (int)((double)i * 0.618D); + if (j >= i) { + j = i - 1; +@@ -206,8 +206,7 @@ } private int func_208528_b(Set p_208528_1_, IWorld p_208528_2_, BlockPos p_208528_3_, int p_208528_4_) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/GlowStoneFeature.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/GlowStoneFeature.java.patch index 21bc8f723..0bce0778f 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/GlowStoneFeature.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/GlowStoneFeature.java.patch @@ -1,11 +1,11 @@ ---- a/net/minecraft/world/gen/feature/GlowStoneFeature.java -+++ b/net/minecraft/world/gen/feature/GlowStoneFeature.java +--- a/net/minecraft/world/gen/feature/GlowstoneFeature.java ++++ b/net/minecraft/world/gen/feature/GlowstoneFeature.java @@ -19,7 +19,7 @@ for(int i = 0; i < 1500; ++i) { BlockPos blockpos = p_212245_4_.func_177982_a(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), -p_212245_3_.nextInt(12), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8)); - if (p_212245_1_.func_180495_p(blockpos).func_196958_f()) { -+ if (p_212245_1_.func_175623_d(blockpos)) { ++ if (p_212245_1_.func_180495_p(blockpos).isAir(p_212245_1_, blockpos)) { int j = 0; for(EnumFacing enumfacing : EnumFacing.values()) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch index bf4d58d91..8bc6513f2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/structure/StructureStart.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/gen/feature/structure/StructureStart.java +++ b/net/minecraft/world/gen/feature/structure/StructureStart.java -@@ -68,6 +68,9 @@ +@@ -70,6 +70,9 @@ } public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) { @@ -10,7 +10,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); if (this.func_75069_d()) { nbttagcompound.func_74778_a("id", StructureIO.func_143033_a(this)); -@@ -105,7 +108,8 @@ +@@ -109,7 +112,8 @@ NBTTagList nbttaglist = p_143020_2_.func_150295_c("Children", 10); for(int i = 0; i < nbttaglist.size(); ++i) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/structure/VillagePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/structure/VillagePieces.java.patch index c070a4637..231af1482 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/structure/VillagePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/structure/VillagePieces.java.patch @@ -19,8 +19,8 @@ return villagepieces$village; @@ -1288,17 +1291,24 @@ public List field_74931_h; - public List field_74932_i = Lists.newArrayList(); - public List field_74930_j = Lists.newArrayList(); + public List field_74932_i = Lists.newArrayList(); + public List field_74930_j = Lists.newArrayList(); + public @javax.annotation.Nullable net.minecraft.world.biome.Biome biome; public Start() { diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch index f360db959..6d4e5ca79 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch @@ -1,32 +1,28 @@ --- a/net/minecraft/world/gen/layer/GenLayerBiome.java +++ b/net/minecraft/world/gen/layer/GenLayerBiome.java -@@ -24,18 +24,36 @@ - private static final int field_202740_n = Biome.func_185362_a(Biomes.field_76780_h); - private static final int field_202741_o = Biome.func_185362_a(Biomes.field_76768_g); - private static final int field_202742_p = Biome.func_185362_a(Biomes.field_150584_S); +@@ -24,17 +24,33 @@ + private static final int field_202740_n = IRegistry.field_212624_m.func_148757_b(Biomes.field_76780_h); + private static final int field_202741_o = IRegistry.field_212624_m.func_148757_b(Biomes.field_76768_g); + private static final int field_202742_p = IRegistry.field_212624_m.func_148757_b(Biomes.field_150584_S); - private static final int[] field_202743_q = new int[]{field_202728_b, field_202730_d, field_202729_c, field_202740_n, field_202736_j, field_202741_o}; - private static final int[] field_202744_r = new int[]{field_202728_b, field_202728_b, field_202728_b, field_202739_m, field_202739_m, field_202736_j}; - private static final int[] field_202745_s = new int[]{field_202730_d, field_202738_l, field_202729_c, field_202736_j, field_202727_a, field_202740_n}; - private static final int[] field_202746_t = new int[]{field_202730_d, field_202729_c, field_202741_o, field_202736_j}; - private static final int[] field_202747_u = new int[]{field_202731_e, field_202731_e, field_202731_e, field_202742_p}; -+ + @SuppressWarnings("unchecked") + private java.util.List[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType.values().length]; -+ private final OverworldGenSettings field_175973_g; -- private int[] field_151623_c; +- private int[] field_151623_c = field_202744_r; public GenLayerBiome(WorldType p_i48641_1_, OverworldGenSettings p_i48641_2_) { -- this.field_151623_c = field_202744_r; -+ for (net.minecraftforge.common.BiomeManager.BiomeType type : net.minecraftforge.common.BiomeManager.BiomeType.values()) -+ { ++ 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)); @@ -45,37 +41,37 @@ this.field_175973_g = null; } else { this.field_175973_g = p_i48641_2_; -@@ -56,21 +74,21 @@ +@@ -55,21 +71,21 @@ return p_202726_1_.func_202696_a(3) == 0 ? field_202733_g : field_202734_h; } - return this.field_151623_c[p_202726_1_.func_202696_a(this.field_151623_c.length)]; -+ return Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT, p_202726_1_).biome); ++ return IRegistry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT, p_202726_1_).biome); case 2: if (i > 0) { return field_202732_f; } - return field_202745_s[p_202726_1_.func_202696_a(field_202745_s.length)]; -+ return Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM, p_202726_1_).biome); ++ return IRegistry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM, p_202726_1_).biome); case 3: if (i > 0) { return field_202737_k; } - return field_202746_t[p_202726_1_.func_202696_a(field_202746_t.length)]; -+ return Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL, p_202726_1_).biome); ++ return IRegistry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL, p_202726_1_).biome); case 4: - return field_202747_u[p_202726_1_.func_202696_a(field_202747_u.length)]; -+ return Biome.func_185362_a(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY, p_202726_1_).biome); ++ return IRegistry.field_212624_m.func_148757_b(getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY, p_202726_1_).biome); default: return field_202735_i; } -@@ -79,4 +97,11 @@ +@@ -78,4 +94,11 @@ } } } -+ ++ + protected net.minecraftforge.common.BiomeManager.BiomeEntry getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType type, IContext context) { + java.util.List biomeList = biomes[type.ordinal()]; + int totalWeight = net.minecraft.util.WeightedRandom.func_76272_a(biomeList); diff --git a/patches/minecraft/net/minecraft/world/gen/layer/LayerUtil.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/LayerUtil.java.patch index 0738dff08..3fdf5bc26 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/LayerUtil.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/LayerUtil.java.patch @@ -1,26 +1,24 @@ --- a/net/minecraft/world/gen/layer/LayerUtil.java +++ b/net/minecraft/world/gen/layer/LayerUtil.java -@@ -67,12 +67,12 @@ - if (p_202828_0_ == WorldType.field_77135_d) { +@@ -69,11 +69,11 @@ i = 6; } -+ -+ i = getModdedBiomeSize(p_202828_0_, i); ++ i = getModdedBiomeSize(p_202828_0_, i); ++ IAreaFactory lvt_7_1_ = func_202829_a(1000L, GenLayerZoom.NORMAL, iareafactory, 0, p_202828_2_); lvt_7_1_ = GenLayerRiverInit.INSTANCE.func_202713_a((IContextExtended)p_202828_2_.apply(100L), lvt_7_1_); -- IAreaFactory lvt_8_1_ = (new GenLayerBiome(p_202828_0_, p_202828_1_)).func_202713_a((IContextExtended)p_202828_2_.apply(200L), iareafactory); +- IAreaFactory lvt_8_1_ = (new GenLayerBiome(p_202828_0_, p_202828_1_)).func_202713_a(p_202828_2_.apply(200L), iareafactory); - lvt_8_1_ = func_202829_a(1000L, GenLayerZoom.NORMAL, lvt_8_1_, 2, p_202828_2_); - lvt_8_1_ = GenLayerBiomeEdge.INSTANCE.func_202713_a((IContextExtended)p_202828_2_.apply(1000L), lvt_8_1_); + IAreaFactory lvt_8_1_ = p_202828_0_.getBiomeLayer(iareafactory, p_202828_1_, p_202828_2_); IAreaFactory lvt_9_1_ = func_202829_a(1000L, GenLayerZoom.NORMAL, lvt_7_1_, 2, p_202828_2_); lvt_8_1_ = GenLayerHills.INSTANCE.func_202707_a((IContextExtended)p_202828_2_.apply(1000L), lvt_8_1_, lvt_9_1_); lvt_7_1_ = func_202829_a(1000L, GenLayerZoom.NORMAL, lvt_7_1_, 2, p_202828_2_); -@@ -133,6 +133,15 @@ - } +@@ -135,6 +135,15 @@ } } -+ + + /* ======================================== FORGE START =====================================*/ + public static int getModdedBiomeSize(net.minecraft.world.WorldType worldType, int original) + { @@ -29,6 +27,7 @@ + return event.getNewSize(); + } + /* ========================================= FORGE END ======================================*/ - ++ protected static boolean func_202827_a(int p_202827_0_) { return p_202827_0_ == field_203632_a || p_202827_0_ == field_203633_b || p_202827_0_ == field_202832_c || p_202827_0_ == field_203634_d || p_202827_0_ == field_202831_b || p_202827_0_ == field_203635_f || p_202827_0_ == field_203636_g || p_202827_0_ == field_202830_a || p_202827_0_ == field_203637_i || p_202827_0_ == field_203638_j; + } 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 de7dec1cf..000000000 --- a/patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/net/minecraft/world/storage/DerivedWorldInfo.java -+++ b/net/minecraft/world/storage/DerivedWorldInfo.java -@@ -179,11 +179,21 @@ - public void func_180783_e(boolean p_180783_1_) { - } - -+ @Deprecated //Use int dimension ID - 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_); - } - -+ public void setDimensionData(int dim, NBTTagCompound nbt) { -+ this.field_76115_a.setDimensionData(dim, nbt); -+ } -+ -+ @Deprecated //Use int dimension ID - public NBTTagCompound func_186347_a(DimensionType p_186347_1_) { - return this.field_76115_a.func_186347_a(p_186347_1_); - } -+ -+ public NBTTagCompound getDimensionData(int dim) { -+ return this.field_76115_a.getDimensionData(dim); -+ } - } diff --git a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch index 84beaaf3e..8bc790ddd 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -1,46 +1,10 @@ --- a/net/minecraft/world/storage/MapData.java +++ b/net/minecraft/world/storage/MapData.java -@@ -24,7 +24,7 @@ - public class MapData extends WorldSavedData { - public int field_76201_a; - public int field_76199_b; -- public byte field_76200_c; -+ public int field_76200_c; //Forge: byte->int - public boolean field_186210_e; - public boolean field_191096_f; - public byte field_76197_d; -@@ -41,7 +41,7 @@ - public void func_195926_a(int p_195926_1_, int p_195926_2_, int p_195926_3_, boolean p_195926_4_, boolean p_195926_5_, int p_195926_6_) { - this.field_76197_d = (byte)p_195926_3_; - this.func_176054_a((double)p_195926_1_, (double)p_195926_2_, this.field_76197_d); -- this.field_76200_c = (byte)p_195926_6_; -+ this.field_76200_c = p_195926_6_; - this.field_186210_e = p_195926_4_; - this.field_191096_f = p_195926_5_; - this.func_76188_b(); -@@ -56,7 +56,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 = (byte)MathHelper.func_76125_a(p_76184_1_.func_74771_c("scale"), 0, 4); -@@ -78,7 +78,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); -@@ -172,8 +172,8 @@ +@@ -198,8 +198,8 @@ if (f >= -63.0F && f1 >= -63.0F && f <= 63.0F && f1 <= 63.0F) { 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 && p_191095_2_ != null) { +- if (this.field_76200_c == DimensionType.NETHER && p_191095_2_ != null) { - int l = (int)(p_191095_2_.func_72912_H().func_76073_f() / 10L); + if (p_191095_2_ != null && p_191095_2_.func_201672_e().field_73011_w.shouldMapSpin(p_191095_3_, p_191095_4_, p_191095_6_, p_191095_8_)) { + int l = (int)(p_191095_2_.func_201672_e().func_72820_D() / 10L); diff --git a/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch b/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch index e6788b63b..7483017f2 100644 --- a/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/storage/SaveHandler.java +++ b/net/minecraft/world/storage/SaveHandler.java -@@ -96,14 +96,14 @@ +@@ -94,14 +94,14 @@ public WorldInfo func_75757_d() { File file1 = new File(this.field_75770_b, "level.dat"); if (file1.exists()) { @@ -17,7 +17,7 @@ } public void func_75755_a(WorldInfo p_75755_1_, @Nullable NBTTagCompound p_75755_2_) { -@@ -150,6 +150,7 @@ +@@ -148,6 +148,7 @@ } file1.renameTo(file2); @@ -25,7 +25,7 @@ } catch (Exception var5) { field_151478_a.warn("Failed to save player data for {}", (Object)p_75753_1_.func_200200_C_().getString()); } -@@ -173,6 +174,7 @@ +@@ -171,6 +172,7 @@ int i = nbttagcompound.func_150297_b("DataVersion", 3) ? nbttagcompound.func_74762_e("DataVersion") : -1; p_75752_1_.func_70020_e(NBTUtil.func_210822_a(this.field_186341_a, DataFixTypes.PLAYER, nbttagcompound, i)); } diff --git a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch index ba547a2a7..b53e17b67 100644 --- a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch @@ -1,61 +1,10 @@ --- a/net/minecraft/world/storage/WorldInfo.java +++ b/net/minecraft/world/storage/WorldInfo.java -@@ -76,7 +76,7 @@ - private int field_176155_J = 15; - private final Set field_197721_N = Sets.newHashSet(); - private final Set field_197722_O = Sets.newLinkedHashSet(); -- private final Map field_186348_N = Maps.newEnumMap(DimensionType.class); -+ private final Map field_186348_N = Maps.newHashMap(); - private NBTTagCompound field_201358_Q; - private final GameRules field_82577_x = new GameRules(); - -@@ -215,7 +215,7 @@ - NBTTagCompound nbttagcompound1 = p_i49564_1_.func_74775_l("DimensionData"); - - 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)); - } - } - -@@ -324,8 +324,9 @@ - p_76064_1_.func_74782_a("GameRules", this.field_82577_x.func_82770_a()); +@@ -325,6 +325,7 @@ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); -- for(Entry entry : this.field_186348_N.entrySet()) { -- nbttagcompound1.func_74782_a(String.valueOf(((DimensionType)entry.getKey()).func_186068_a()), entry.getValue()); -+ for(Entry entry : this.field_186348_N.entrySet()) { + for(Entry entry : this.field_186348_N.entrySet()) { + if (entry.getValue() == null || entry.getValue().isEmpty()) continue; -+ nbttagcompound1.func_74782_a(String.valueOf(entry.getKey()), entry.getValue()); + nbttagcompound1.func_74782_a(String.valueOf(entry.getKey().func_186068_a()), entry.getValue()); } - p_76064_1_.func_74782_a("DimensionData", nbttagcompound1); -@@ -692,15 +693,26 @@ - }); - } - -+ @Deprecated //Use int dimension 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 dim) { -+ NBTTagCompound nbttagcompound = this.field_186348_N.get(dim); - return nbttagcompound == null ? new NBTTagCompound() : nbttagcompound; - } - -+ @Deprecated //Use int dimension 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.field_186348_N.put(p_186345_1_.func_186068_a(), p_186345_2_); - } - -+ //Dimension numerical ID version of setter, as two dimensions could have the same DimensionType. ID should be grabbed from the world NOT the Type -+ public void setDimensionData(int dim, NBTTagCompound nbt) { -+ this.field_186348_N.put(dim, nbt); -+ } -+ - @OnlyIn(Dist.CLIENT) - public int func_186344_K() { - return this.field_186350_c; diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch index 7fb232bf0..c889d8519 100644 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/loot/LootEntryItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/storage/loot/LootEntryItem.java +++ b/net/minecraft/world/storage/loot/LootEntryItem.java -@@ -17,8 +17,8 @@ +@@ -18,8 +18,8 @@ protected final Item field_186368_a; protected final LootFunction[] field_186369_b; @@ -11,7 +11,7 @@ this.field_186368_a = p_i46644_1_; this.field_186369_b = p_i46644_4_; } -@@ -33,7 +33,7 @@ +@@ -34,7 +34,7 @@ } if (!itemstack.func_190926_b()) { @@ -20,7 +20,7 @@ p_186363_1_.add(itemstack); } else { int i = itemstack.func_190916_E(); -@@ -71,6 +71,6 @@ +@@ -72,6 +72,6 @@ alootfunction = new LootFunction[0]; } diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch index 3fd6b9b5b..72bfcbfb4 100644 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/loot/LootPool.java.patch @@ -76,9 +76,9 @@ 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"); @@ -78,18 +117,20 @@ - 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); + LootCondition[] alootcondition = JsonUtils.func_188177_a(jsonobject, "conditions", new LootCondition[0], p_deserialize_3_, LootCondition[].class); + RandomValueRange randomvaluerange = JsonUtils.func_188174_a(jsonobject, "rolls", p_deserialize_3_, RandomValueRange.class); + RandomValueRange randomvaluerange1 = 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, net.minecraftforge.common.ForgeHooks.readPoolName(jsonobject)); } diff --git a/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch index 6f45cf284..9a53b626e 100644 --- a/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/loot/LootTableManager.java.patch @@ -4,8 +4,8 @@ ResourceLocation resourcelocation1 = new ResourceLocation(resourcelocation.func_110624_b(), s.substring(field_195435_a, s.length() - field_195436_b)); try (IResource iresource = p_195410_1_.func_199002_a(resourcelocation)) { -- LootTable loottable = (LootTable)JsonUtils.func_188178_a(field_186526_b, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), LootTable.class); -+ LootTable loottable = net.minecraftforge.common.ForgeHooks.loadLootTable(field_186526_b, resourcelocation, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), iresource.func_199026_d().equals("Default"), this); +- LootTable loottable = JsonUtils.func_188178_a(field_186526_b, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), LootTable.class); ++ LootTable loottable =net.minecraftforge.common.ForgeHooks.loadLootTable(field_186526_b, resourcelocation, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), iresource.func_199026_d().equals("Default"), this); if (loottable != null) { this.field_186527_c.put(resourcelocation1, loottable); } diff --git a/patches/minecraft/net/minecraft/world/storage/loot/functions/Smelt.java.patch b/patches/minecraft/net/minecraft/world/storage/loot/functions/Smelt.java.patch index 639582384..1717733bc 100644 --- a/patches/minecraft/net/minecraft/world/storage/loot/functions/Smelt.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/loot/functions/Smelt.java.patch @@ -1,13 +1,13 @@ --- a/net/minecraft/world/storage/loot/functions/Smelt.java +++ b/net/minecraft/world/storage/loot/functions/Smelt.java -@@ -43,8 +43,8 @@ +@@ -42,8 +42,8 @@ @Nullable public static IRecipe func_202880_a(LootContext p_202880_0_, ItemStack p_202880_1_) { - for(IRecipe irecipe : p_202880_0_.func_202879_g().func_199532_z().func_199510_b()) { -- if (irecipe instanceof FurnaceRecipe && ((Ingredient)irecipe.func_192400_c().get(0)).test(p_202880_1_)) { +- if (irecipe instanceof FurnaceRecipe && irecipe.func_192400_c().get(0).test(p_202880_1_)) { + for(IRecipe irecipe : p_202880_0_.func_202879_g().func_199532_z().getRecipes(net.minecraftforge.common.crafting.VanillaRecipeTypes.SMELTING)) { -+ if (((Ingredient)irecipe.func_192400_c().get(0)).test(p_202880_1_)) { ++ if (irecipe.func_192400_c().get(0).test(p_202880_1_)) { return irecipe; } } diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index fe9b4b3fd..86d50a85b 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -28,6 +28,7 @@ import static org.lwjgl.opengl.GL20.*; import java.io.File; import java.nio.ByteBuffer; import java.nio.FloatBuffer; +import java.util.Map; import java.util.Optional; import java.util.Random; @@ -55,20 +56,20 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.FogRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderGlobal; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.BlockFaceUV; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemTransformVec3f; -import net.minecraft.client.renderer.block.model.ModelManager; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.client.renderer.block.model.SimpleBakedModel; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.BlockFaceUV; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.ItemTransformVec3f; +import net.minecraft.client.renderer.model.ModelManager; +import net.minecraft.client.renderer.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelRotation; +import net.minecraft.client.renderer.model.SimpleBakedModel; import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.client.renderer.color.ItemColors; import net.minecraft.client.renderer.entity.model.ModelBiped; @@ -140,17 +141,17 @@ public class ForgeHooksClient return result != null ? result : _default; } - public static boolean onDrawBlockHighlight(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, float partialTicks) + public static boolean onDrawBlockHighlight(WorldRenderer context, EntityPlayer player, RayTraceResult target, int subID, float partialTicks) { return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent(context, player, target, subID, partialTicks)); } - public static void dispatchRenderLast(RenderGlobal context, float partialTicks) + public static void dispatchRenderLast(WorldRenderer context, float partialTicks) { MinecraftForge.EVENT_BUS.post(new RenderWorldLastEvent(context, partialTicks)); } - public static boolean renderFirstPersonHand(RenderGlobal context, float partialTicks) + public static boolean renderFirstPersonHand(WorldRenderer context, float partialTicks) { return MinecraftForge.EVENT_BUS.post(new RenderHandEvent(context, partialTicks)); } @@ -234,7 +235,7 @@ public class ForgeHooksClient return fovUpdateEvent.getNewfov(); } - public static double getFOVModifier(EntityRenderer renderer, Entity entity, IBlockState blockState, IFluidState fluidState, double renderPartialTicks, double fov) { + public static double getFOVModifier(GameRenderer renderer, Entity entity, IBlockState blockState, IFluidState fluidState, double renderPartialTicks, double fov) { EntityViewRenderEvent.FOVModifier event = new EntityViewRenderEvent.FOVModifier(renderer, entity, blockState, fluidState, renderPartialTicks, fov); MinecraftForge.EVENT_BUS.post(event); return event.getFOV(); @@ -348,26 +349,26 @@ public class ForgeHooksClient MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Post(screen, mouseX, mouseY, partialTicks)); } - public static float getFogDensity(FogRenderer fogRenderer, EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, float partial, float density) + public static float getFogDensity(FogRenderer fogRenderer, GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, float partial, float density) { EntityViewRenderEvent.FogDensity event = new EntityViewRenderEvent.FogDensity(fogRenderer, renderer, entity, state, fluidState, partial, density); if (MinecraftForge.EVENT_BUS.post(event)) return event.getDensity(); return -1; } - public static void onFogRender(FogRenderer fogRenderer, EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, float partial, int mode, float distance) + public static void onFogRender(FogRenderer fogRenderer, GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, float partial, int mode, float distance) { MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(fogRenderer, renderer, entity, state, fluidState, partial, mode, distance)); } - public static void onModelBake(ModelManager modelManager, IRegistry modelRegistry, ModelLoader modelLoader) + public static void onModelBake(ModelManager modelManager, Map modelRegistry, ModelLoader modelLoader) { MinecraftForge.EVENT_BUS.post(new ModelBakeEvent(modelManager, modelRegistry, modelLoader)); modelLoader.onPostBakeEvent(modelRegistry); } @SuppressWarnings("deprecation") - public static Matrix4f getMatrix(net.minecraft.client.renderer.block.model.ItemTransformVec3f transform) + public static Matrix4f getMatrix(net.minecraft.client.renderer.model.ItemTransformVec3f transform) { javax.vecmath.Matrix4f m = new javax.vecmath.Matrix4f(), t = new javax.vecmath.Matrix4f(); m.setIdentity(); @@ -600,7 +601,7 @@ public class ForgeHooksClient return Optional.of(new TRSRTransformation(matrix)); } - public static void loadEntityShader(Entity entity, EntityRenderer entityRenderer) + public static void loadEntityShader(Entity entity, GameRenderer entityRenderer) { if (entity != null) { diff --git a/src/main/java/net/minecraftforge/client/GuiIngameForge.java b/src/main/java/net/minecraftforge/client/GuiIngameForge.java index 8d00ef1c5..a27ee037e 100644 --- a/src/main/java/net/minecraftforge/client/GuiIngameForge.java +++ b/src/main/java/net/minecraftforge/client/GuiIngameForge.java @@ -119,10 +119,9 @@ public class GuiIngameForge extends GuiIngame fontrenderer = mc.fontRenderer; //mc.entityRenderer.setupOverlayRendering(); GlStateManager.enableBlend(); - if (renderVignette && Minecraft.isFancyGraphicsEnabled()) { - renderVignette(mc.player.getBrightness()); + func_212303_b(mc.getRenderViewEntity()); } else { @@ -254,7 +253,7 @@ public class GuiIngameForge extends GuiIngame } @Override - protected void renderVignette(float lightLevel) + protected void func_212303_b(Entity entity) { if (pre(VIGNETTE)) { @@ -263,7 +262,7 @@ public class GuiIngameForge extends GuiIngame GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); return; } - super.renderVignette(lightLevel); + super.func_212303_b(entity); post(VIGNETTE); } diff --git a/src/main/java/net/minecraftforge/client/ItemModelMesherForge.java b/src/main/java/net/minecraftforge/client/ItemModelMesherForge.java index 5353cbe93..5bb1c2db7 100644 --- a/src/main/java/net/minecraftforge/client/ItemModelMesherForge.java +++ b/src/main/java/net/minecraftforge/client/ItemModelMesherForge.java @@ -27,10 +27,10 @@ import javax.annotation.Nullable; import com.google.common.collect.Maps; import net.minecraft.client.renderer.ItemModelMesher; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelManager; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelManager; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.registries.IRegistryDelegate; diff --git a/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java b/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java index 3800f2eb0..ad39ed633 100644 --- a/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java +++ b/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java @@ -29,13 +29,13 @@ import java.util.function.Supplier; import javax.annotation.Nonnull; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.chunk.RenderChunkCache; import net.minecraft.client.renderer.texture.NativeImage; import net.minecraft.resources.IResource; import net.minecraft.resources.IResourceManager; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ChunkCache; import net.minecraft.world.World; import org.apache.commons.lang3.tuple.Pair; @@ -102,25 +102,28 @@ public class MinecraftForgeClient } } - private static final LoadingCache, ChunkCache> regionCache = CacheBuilder.newBuilder() + private static final LoadingCache, RenderChunkCache> regionCache = CacheBuilder.newBuilder() .maximumSize(500) .concurrencyLevel(5) .expireAfterAccess(1, TimeUnit.SECONDS) - .build(new CacheLoader, ChunkCache>() + .build(new CacheLoader, RenderChunkCache>() { @Override - public ChunkCache load(Pair key) + public RenderChunkCache load(Pair key) { - return new ChunkCache(key.getLeft(), key.getRight().add(-1, -1, -1), key.getRight().add(16, 16, 16), 1); + return RenderChunkCache.func_212397_a(key.getLeft(), key.getRight().add(-1, -1, -1), key.getRight().add(16, 16, 16), 1); } }); - public static void onRebuildChunk(World world, BlockPos position, ChunkCache cache) + public static void onRebuildChunk(World world, BlockPos position, RenderChunkCache cache) { - regionCache.put(Pair.of(world, position), cache); + if (cache == null) + regionCache.invalidate(Pair.of(world, position)); + else + regionCache.put(Pair.of(world, position), cache); } - public static ChunkCache getRegionRenderCache(World world, BlockPos pos) + public static RenderChunkCache getRegionRenderCache(World world, BlockPos pos) { int x = pos.getX() & ~0xF; int y = pos.getY() & ~0xF; diff --git a/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java b/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java index a992b3aec..653ecb3be 100644 --- a/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java +++ b/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java @@ -23,18 +23,18 @@ import net.minecraftforge.eventbus.api.Cancelable; import net.minecraftforge.eventbus.api.Event; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.WorldRenderer; @Cancelable public class DrawBlockHighlightEvent extends Event { - private final RenderGlobal context; + private final WorldRenderer context; private final EntityPlayer player; private final RayTraceResult target; private final int subID; private final float partialTicks; - public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, float partialTicks) + public DrawBlockHighlightEvent(WorldRenderer context, EntityPlayer player, RayTraceResult target, int subID, float partialTicks) { this.context = context; this.player = player; @@ -43,7 +43,7 @@ public class DrawBlockHighlightEvent extends Event this.partialTicks= partialTicks; } - public RenderGlobal getContext() { return context; } + public WorldRenderer getContext() { return context; } public EntityPlayer getPlayer() { return player; } public RayTraceResult getTarget() { return target; } public int getSubID() { return subID; } diff --git a/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java b/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java index 2c983aaed..b3ec1dd50 100644 --- a/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java +++ b/src/main/java/net/minecraftforge/client/event/EntityViewRenderEvent.java @@ -20,7 +20,7 @@ package net.minecraftforge.client.event; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.FogRenderer; import net.minecraft.entity.Entity; import net.minecraft.fluid.IFluidState; @@ -30,18 +30,18 @@ import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.Event.HasResult; /** - * Event that hooks into EntityRenderer, allowing any feature to customize visual attributes + * Event that hooks into GameRenderer, allowing any feature to customize visual attributes * the player sees. */ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.api.Event { - private final EntityRenderer renderer; + private final GameRenderer renderer; private final Entity entity; private final IBlockState state; private final IFluidState fluidState; private final double renderPartialTicks; - public EntityViewRenderEvent(EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks) + public EntityViewRenderEvent(GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks) { this.renderer = renderer; this.entity = entity; @@ -50,7 +50,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. this.renderPartialTicks = renderPartialTicks; } - public EntityRenderer getRenderer() + public GameRenderer getRenderer() { return renderer; } @@ -79,7 +79,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. { private final FogRenderer fogRenderer; - protected FogEvent(FogRenderer fogRenderer, EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks) + protected FogEvent(FogRenderer fogRenderer, GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks) { super(renderer, entity, state, fluidState, renderPartialTicks); this.fogRenderer = fogRenderer; @@ -97,7 +97,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. { private float density; - public FogDensity(FogRenderer fogRenderer, EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, float density) + public FogDensity(FogRenderer fogRenderer, GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, float density) { super(fogRenderer, renderer, entity, state, fluidState, renderPartialTicks); this.setDensity(density); @@ -123,7 +123,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. private final int fogMode; private final float farPlaneDistance; - public RenderFogEvent(FogRenderer fogRenderer, EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, int fogMode, float farPlaneDistance) + public RenderFogEvent(FogRenderer fogRenderer, GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, int fogMode, float farPlaneDistance) { super(fogRenderer, renderer, entity, state, fluidState, renderPartialTicks); this.fogMode = fogMode; @@ -151,7 +151,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. private float green; private float blue; - public FogColors(FogRenderer fogRenderer, EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, float red, float green, float blue) + public FogColors(FogRenderer fogRenderer, GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, float red, float green, float blue) { super(fogRenderer, renderer, entity, state, fluidState, renderPartialTicks); this.setRed(red); @@ -176,7 +176,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. private float pitch; private float roll; - public CameraSetup(EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, float yaw, float pitch, float roll) + public CameraSetup(GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, float yaw, float pitch, float roll) { super(renderer, entity, state, fluidState, renderPartialTicks); this.setYaw(yaw); @@ -200,7 +200,7 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus. { private double fov; - public FOVModifier(EntityRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, double fov) { + public FOVModifier(GameRenderer renderer, Entity entity, IBlockState state, IFluidState fluidState, double renderPartialTicks, double fov) { super(renderer, entity, state, fluidState, renderPartialTicks); this.setFOV(fov); } diff --git a/src/main/java/net/minecraftforge/client/event/ModelBakeEvent.java b/src/main/java/net/minecraftforge/client/event/ModelBakeEvent.java index 643ff525c..b45b9bdad 100644 --- a/src/main/java/net/minecraftforge/client/event/ModelBakeEvent.java +++ b/src/main/java/net/minecraftforge/client/event/ModelBakeEvent.java @@ -19,12 +19,12 @@ package net.minecraftforge.client.event; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ModelManager; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.util.registry.IRegistry; +import java.util.Map; + +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ModelManager; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.eventbus.api.Event; /** * Fired when the ModelManager is notified of the resource manager reloading. @@ -34,10 +34,10 @@ import net.minecraftforge.eventbus.api.Event; public class ModelBakeEvent extends net.minecraftforge.eventbus.api.Event { private final ModelManager modelManager; - private final IRegistry modelRegistry; + private final Map modelRegistry; private final ModelLoader modelLoader; - public ModelBakeEvent(ModelManager modelManager, IRegistry modelRegistry, ModelLoader modelLoader) + public ModelBakeEvent(ModelManager modelManager, Map modelRegistry, ModelLoader modelLoader) { this.modelManager = modelManager; this.modelRegistry = modelRegistry; @@ -49,7 +49,7 @@ public class ModelBakeEvent extends net.minecraftforge.eventbus.api.Event return modelManager; } - public IRegistry getModelRegistry() + public Map getModelRegistry() { return modelRegistry; } diff --git a/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java b/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java index 45dd1ca33..6d780f1d6 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderHandEvent.java @@ -21,7 +21,7 @@ package net.minecraftforge.client.event; import net.minecraftforge.eventbus.api.Cancelable; import net.minecraftforge.eventbus.api.Event; -import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.WorldRenderer; /** * This event is fired on {@link net.minecraftforge.common.MinecraftForge#EVENT_BUS} @@ -33,15 +33,15 @@ import net.minecraft.client.renderer.RenderGlobal; @net.minecraftforge.eventbus.api.Cancelable public class RenderHandEvent extends net.minecraftforge.eventbus.api.Event { - private final RenderGlobal context; + private final WorldRenderer context; private final float partialTicks; - public RenderHandEvent(RenderGlobal context, float partialTicks) + public RenderHandEvent(WorldRenderer context, float partialTicks) { this.context = context; this.partialTicks = partialTicks; } - public RenderGlobal getContext() + public WorldRenderer getContext() { return context; } diff --git a/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java b/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java index 79c775fa2..7fc242527 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderWorldLastEvent.java @@ -20,19 +20,19 @@ package net.minecraftforge.client.event; import net.minecraftforge.eventbus.api.Event; -import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.WorldRenderer; public class RenderWorldLastEvent extends net.minecraftforge.eventbus.api.Event { - private final RenderGlobal context; + private final WorldRenderer context; private final float partialTicks; - public RenderWorldLastEvent(RenderGlobal context, float partialTicks) + public RenderWorldLastEvent(WorldRenderer context, float partialTicks) { this.context = context; this.partialTicks = partialTicks; } - public RenderGlobal getContext() + public WorldRenderer getContext() { return context; } diff --git a/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java b/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java index 126fa470b..d2f32914e 100644 --- a/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java +++ b/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java @@ -20,8 +20,8 @@ package net.minecraftforge.client.extensions; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms; public interface IForgeBakedModel { diff --git a/src/main/java/net/minecraftforge/client/extensions/IForgeRenderChunk.java b/src/main/java/net/minecraftforge/client/extensions/IForgeRenderChunk.java index 628a0ec7d..622f18b0b 100644 --- a/src/main/java/net/minecraftforge/client/extensions/IForgeRenderChunk.java +++ b/src/main/java/net/minecraftforge/client/extensions/IForgeRenderChunk.java @@ -19,8 +19,8 @@ package net.minecraftforge.client.extensions; +import net.minecraft.client.renderer.chunk.RenderChunkCache; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ChunkCache; import net.minecraft.world.World; public interface IForgeRenderChunk @@ -38,8 +38,8 @@ public interface IForgeRenderChunk * the cache a 20x20x20 cube, for a total of 8000 states in the cache. * @return new RegionRenderCache instance */ - default ChunkCache createRegionRenderCache(World world, BlockPos from, BlockPos to, int subtract) + default RenderChunkCache createRegionRenderCache(World world, BlockPos from, BlockPos to, int subtract) { - return new ChunkCache(world, from, to, subtract); + return RenderChunkCache.func_212397_a(world, from, to, subtract); } } diff --git a/src/main/java/net/minecraftforge/client/model/BakedItemModel.java b/src/main/java/net/minecraftforge/client/model/BakedItemModel.java index f489815e8..473bc0ae5 100644 --- a/src/main/java/net/minecraftforge/client/model/BakedItemModel.java +++ b/src/main/java/net/minecraftforge/client/model/BakedItemModel.java @@ -28,10 +28,10 @@ import java.util.Random; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.model.TRSRTransformation; diff --git a/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java b/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java index 3a55da9d9..1015c8f64 100644 --- a/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java +++ b/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java @@ -25,10 +25,10 @@ import java.util.List; import java.util.Random; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.EnumFacing; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/main/java/net/minecraftforge/client/model/BlockStateLoader.java b/src/main/java/net/minecraftforge/client/model/BlockStateLoader.java index aa8d827ec..05c5d125d 100644 --- a/src/main/java/net/minecraftforge/client/model/BlockStateLoader.java +++ b/src/main/java/net/minecraftforge/client/model/BlockStateLoader.java @@ -29,11 +29,11 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ModelBlockDefinition; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.client.renderer.block.model.Variant; -import net.minecraft.client.renderer.block.model.VariantList; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ModelBlockDefinition; +import net.minecraft.client.renderer.model.ModelRotation; +import net.minecraft.client.renderer.model.Variant; +import net.minecraft.client.renderer.model.VariantList; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.model.IModelState; import net.minecraftforge.common.model.TRSRTransformation; diff --git a/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java b/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java index 05b7c8f32..a609d9d36 100644 --- a/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java +++ b/src/main/java/net/minecraftforge/client/model/FancyMissingModel.java @@ -28,11 +28,11 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.util.EnumFacing; diff --git a/src/main/java/net/minecraftforge/client/model/ForgeBlockStateV1.java b/src/main/java/net/minecraftforge/client/model/ForgeBlockStateV1.java index bb0e58659..fd0913332 100644 --- a/src/main/java/net/minecraftforge/client/model/ForgeBlockStateV1.java +++ b/src/main/java/net/minecraftforge/client/model/ForgeBlockStateV1.java @@ -38,8 +38,8 @@ import javax.vecmath.Vector3f; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ModelRotation; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ModelRotation; import net.minecraft.util.JsonUtils; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.BlockStateLoader.Marker; diff --git a/src/main/java/net/minecraftforge/client/model/ICustomModelLoader.java b/src/main/java/net/minecraftforge/client/model/ICustomModelLoader.java index f8973ab2f..b4af67900 100644 --- a/src/main/java/net/minecraftforge/client/model/ICustomModelLoader.java +++ b/src/main/java/net/minecraftforge/client/model/ICustomModelLoader.java @@ -21,7 +21,7 @@ package net.minecraftforge.client.model; import java.util.function.Predicate; -import net.minecraft.client.renderer.block.model.IUnbakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.resources.IResourceManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.resource.IResourceType; diff --git a/src/main/java/net/minecraftforge/client/model/IModel.java b/src/main/java/net/minecraftforge/client/model/IModel.java index bce118dbb..29a461637 100644 --- a/src/main/java/net/minecraftforge/client/model/IModel.java +++ b/src/main/java/net/minecraftforge/client/model/IModel.java @@ -26,8 +26,8 @@ import javax.annotation.Nullable; import com.google.common.collect.ImmutableMap; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/net/minecraftforge/client/model/ISmartVariant.java b/src/main/java/net/minecraftforge/client/model/ISmartVariant.java index f89e26463..f459339ac 100644 --- a/src/main/java/net/minecraftforge/client/model/ISmartVariant.java +++ b/src/main/java/net/minecraftforge/client/model/ISmartVariant.java @@ -19,7 +19,7 @@ package net.minecraftforge.client.model; -import net.minecraft.client.renderer.block.model.IUnbakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; public interface ISmartVariant { diff --git a/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java b/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java index b7ddac26f..5ed19cf66 100644 --- a/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java +++ b/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java @@ -23,12 +23,12 @@ import javax.vecmath.Vector4f; import net.minecraftforge.versions.forge.ForgeVersion; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.block.model.ModelBlock; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; +import net.minecraft.client.renderer.model.ModelBlock; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.resources.IResourceManager; diff --git a/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java b/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java index 2b41a6903..8520c227e 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java +++ b/src/main/java/net/minecraftforge/client/model/ModelDynBucket.java @@ -28,12 +28,12 @@ import javax.annotation.Nullable; import javax.vecmath.Quat4f; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.texture.PngSizeInfo; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; diff --git a/src/main/java/net/minecraftforge/client/model/ModelFluid.java b/src/main/java/net/minecraftforge/client/model/ModelFluid.java index 6edb9ad4b..73c461fee 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelFluid.java +++ b/src/main/java/net/minecraftforge/client/model/ModelFluid.java @@ -33,11 +33,11 @@ import javax.vecmath.Matrix4f; import javax.vecmath.Vector4f; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.resources.IResourceManager; diff --git a/src/main/java/net/minecraftforge/client/model/ModelLoader.java b/src/main/java/net/minecraftforge/client/model/ModelLoader.java index 2c3530352..2b2dfa294 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelLoader.java +++ b/src/main/java/net/minecraftforge/client/model/ModelLoader.java @@ -42,31 +42,31 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockModelShapes; import net.minecraft.client.renderer.ItemModelMesher; import net.minecraft.client.renderer.Vector3f; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.BlockPart; -import net.minecraft.client.renderer.block.model.BlockPartFace; -import net.minecraft.client.renderer.block.model.BlockPartRotation; -import net.minecraft.client.renderer.block.model.BuiltInModel; -import net.minecraft.client.renderer.block.model.FaceBakery; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemModelGenerator; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelBlock; -import net.minecraft.client.renderer.block.model.ModelBlockDefinition; -import net.minecraft.client.renderer.block.model.ModelBlockDefinition.ContainerHolder; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.client.renderer.block.model.MultipartBakedModel; -import net.minecraft.client.renderer.block.model.SimpleBakedModel; -import net.minecraft.client.renderer.block.model.Variant; -import net.minecraft.client.renderer.block.model.VariantList; -import net.minecraft.client.renderer.block.model.WeightedBakedModel; -import net.minecraft.client.renderer.block.model.multipart.Multipart; -import net.minecraft.client.renderer.block.model.multipart.Selector; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.BlockPart; +import net.minecraft.client.renderer.model.BlockPartFace; +import net.minecraft.client.renderer.model.BlockPartRotation; +import net.minecraft.client.renderer.model.BuiltInModel; +import net.minecraft.client.renderer.model.FaceBakery; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemModelGenerator; +import net.minecraft.client.renderer.model.ItemOverrideList; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBlock; +import net.minecraft.client.renderer.model.ModelBlockDefinition; +import net.minecraft.client.renderer.model.ModelBlockDefinition.ContainerHolder; +import net.minecraft.client.renderer.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelRotation; +import net.minecraft.client.renderer.model.MultipartBakedModel; +import net.minecraft.client.renderer.model.SimpleBakedModel; +import net.minecraft.client.renderer.model.Variant; +import net.minecraft.client.renderer.model.VariantList; +import net.minecraft.client.renderer.model.WeightedBakedModel; +import net.minecraft.client.renderer.model.multipart.Multipart; +import net.minecraft.client.renderer.model.multipart.Selector; import net.minecraft.client.renderer.texture.MissingTextureSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; @@ -951,7 +951,7 @@ public final class ModelLoader extends ModelBakery /** * Internal, do not use. */ - public void onPostBakeEvent(IRegistry modelRegistry) + public void onPostBakeEvent(Map modelRegistry) { IBakedModel missingModel = modelRegistry.get(MODEL_MISSING); for(Map.Entry entry : loadingExceptions.entrySet()) diff --git a/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java b/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java index 71ed64e62..c33ed2da8 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java +++ b/src/main/java/net/minecraftforge/client/model/ModelLoaderRegistry.java @@ -34,8 +34,8 @@ import com.google.common.collect.Queues; import com.google.common.collect.Sets; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.resources.IReloadableResourceManager; import net.minecraft.resources.IResourceManager; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/net/minecraftforge/client/model/MultiLayerModel.java b/src/main/java/net/minecraftforge/client/model/MultiLayerModel.java index 2d683d85a..638a45658 100644 --- a/src/main/java/net/minecraftforge/client/model/MultiLayerModel.java +++ b/src/main/java/net/minecraftforge/client/model/MultiLayerModel.java @@ -27,12 +27,12 @@ import javax.annotation.Nullable; import javax.vecmath.Matrix4f; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.resources.IResourceManager; diff --git a/src/main/java/net/minecraftforge/client/model/MultiModel.java b/src/main/java/net/minecraftforge/client/model/MultiModel.java index d2572055a..8f4d4fb49 100644 --- a/src/main/java/net/minecraftforge/client/model/MultiModel.java +++ b/src/main/java/net/minecraftforge/client/model/MultiModel.java @@ -32,12 +32,12 @@ import javax.annotation.Nullable; import javax.vecmath.Matrix4f; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/net/minecraftforge/client/model/PerspectiveMapWrapper.java b/src/main/java/net/minecraftforge/client/model/PerspectiveMapWrapper.java index 035d5dc2e..aaa0de111 100644 --- a/src/main/java/net/minecraftforge/client/model/PerspectiveMapWrapper.java +++ b/src/main/java/net/minecraftforge/client/model/PerspectiveMapWrapper.java @@ -25,10 +25,10 @@ import java.util.Random; import com.google.common.collect.ImmutableMap; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.model.IModelState; diff --git a/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java b/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java index 1e3553db0..7852f5c5d 100644 --- a/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java +++ b/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java @@ -31,7 +31,7 @@ import com.google.common.collect.ImmutableList; import net.minecraft.client.GameSettings; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.vertex.VertexFormat; diff --git a/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java b/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java index d44e70abf..4e3baf5a7 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java +++ b/src/main/java/net/minecraftforge/client/model/animation/AnimationItemOverrideList.java @@ -22,10 +22,10 @@ package net.minecraftforge.client.model.animation; import java.util.List; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemOverride; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemOverride; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.entity.EntityLivingBase; @@ -68,7 +68,7 @@ public final class AnimationItemOverrideList extends ItemOverrideList public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity) { return stack.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null) - .map(asm -> + .map(asm -> { World w = world; // TODO caching? diff --git a/src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java b/src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java index 4ff755ef1..5ad8b2fa5 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java +++ b/src/main/java/net/minecraftforge/client/model/animation/AnimationModelBase.java @@ -26,10 +26,10 @@ import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.client.renderer.entity.model.ModelBase; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; diff --git a/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java b/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java index 7e9f1d41d..22050f1ed 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java +++ b/src/main/java/net/minecraftforge/client/model/animation/ModelBlockAnimation.java @@ -40,7 +40,7 @@ import javax.vecmath.Vector3f; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import net.minecraft.client.renderer.block.model.BlockPart; +import net.minecraft.client.renderer.model.BlockPart; import net.minecraft.resources.IResource; import net.minecraft.resources.IResourceManager; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java b/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java index 5fc1c3d5f..674ca60a3 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java +++ b/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererAnimation.java @@ -23,7 +23,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; @@ -40,7 +40,7 @@ import net.minecraftforge.common.util.LazyOptional; import java.util.Random; /** - * Generic {@link TileEntityRenderer} that works with the Forge model system and animations. + * Generic {@link TileGameRenderer} that works with the Forge model system and animations. */ public class TileEntityRendererAnimation extends TileEntityRendererFast implements IEventHandler { diff --git a/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererFast.java b/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererFast.java index 3e440fbf7..b03ea655a 100644 --- a/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererFast.java +++ b/src/main/java/net/minecraftforge/client/model/animation/TileEntityRendererFast.java @@ -33,7 +33,7 @@ import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.tileentity.TileEntity; /** - * A special case {@link TileEntityRenderer} which can be batched with other + * A special case {@link TileGameRenderer} which can be batched with other * renderers that are also instances of this class. *

* Advantages: @@ -49,7 +49,7 @@ import net.minecraft.tileentity.TileEntity; *

  • All renderers must use the same {@link VertexFormat} * ({@link DefaultVertexFormats#BLOCK})
  • * - * + * * @param The type of {@link TileEntity} being rendered. */ public abstract class TileEntityRendererFast extends TileEntityRenderer diff --git a/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java b/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java index 14e3f2278..54c9f12f1 100644 --- a/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java +++ b/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java @@ -35,11 +35,11 @@ import javax.vecmath.Matrix4f; import javax.vecmath.Vector3f; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.resources.IResource; diff --git a/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java b/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java index b217ea97f..0250aa044 100644 --- a/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java +++ b/src/main/java/net/minecraftforge/client/model/obj/OBJLoader.java @@ -25,7 +25,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import net.minecraft.client.renderer.block.model.IUnbakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.resources.IResource; import net.minecraft.resources.IResourceManager; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java b/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java index ba8bc7690..5016a745c 100644 --- a/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java +++ b/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java @@ -42,11 +42,11 @@ import javax.vecmath.Vector3f; import javax.vecmath.Vector4f; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.resources.IResource; diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java b/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java index 8f29ff06c..09870678e 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/ForgeBlockModelRenderer.java @@ -26,8 +26,8 @@ import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.BlockModelRenderer; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java b/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java index 100a03308..33b79e54c 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/LightUtil.java @@ -21,7 +21,7 @@ package net.minecraftforge.client.model.pipeline; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormatElement; import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java b/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java index ce1204f9e..659f508a6 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java @@ -19,7 +19,7 @@ package net.minecraftforge.client.model.pipeline; -import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormatElement; diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java b/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java index be3d07657..c66d39a9b 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/VertexLighterFlat.java @@ -22,7 +22,7 @@ package net.minecraftforge.client.model.pipeline; import javax.vecmath.Vector3f; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; diff --git a/src/main/java/net/minecraftforge/common/DimensionManager.java b/src/main/java/net/minecraftforge/common/DimensionManager.java index cceb80e9e..df5a5660d 100644 --- a/src/main/java/net/minecraftforge/common/DimensionManager.java +++ b/src/main/java/net/minecraftforge/common/DimensionManager.java @@ -16,46 +16,46 @@ * 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.common; -import java.io.File; import java.util.ArrayList; -import java.util.Arrays; -import java.util.BitSet; -import java.util.IdentityHashMap; +import java.util.Collections; +import java.util.HashMap; import java.util.List; -import java.util.ListIterator; import java.util.Map; import java.util.concurrent.ConcurrentMap; -import java.util.stream.Stream; +import java.util.stream.Collectors; import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMaps; import it.unimi.dsi.fastutil.ints.IntIterator; import it.unimi.dsi.fastutil.ints.IntLinkedOpenHashSet; -import it.unimi.dsi.fastutil.ints.IntOpenHashSet; -import it.unimi.dsi.fastutil.ints.IntRBTreeSet; import it.unimi.dsi.fastutil.ints.IntSet; import it.unimi.dsi.fastutil.ints.IntSets; -import it.unimi.dsi.fastutil.ints.IntSortedSet; - import com.google.common.collect.HashMultiset; import com.google.common.collect.Lists; import com.google.common.collect.MapMaker; import com.google.common.collect.Multiset; +import io.netty.buffer.Unpooled; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.PacketBuffer; import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.IRegistry; import net.minecraft.world.World; import net.minecraft.world.ServerWorldEventHandler; import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServerMulti; -import net.minecraft.world.dimension.Dimension; import net.minecraft.world.dimension.DimensionType; -import net.minecraft.world.storage.ISaveHandler; +import net.minecraftforge.event.world.RegisterDimensionsEvent; import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.registries.ClearableRegistry; +import net.minecraftforge.registries.ForgeRegistries; + +import org.apache.commons.lang3.Validate; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; @@ -67,340 +67,193 @@ public class DimensionManager { private static final Logger LOGGER = LogManager.getLogger(); private static final Marker DIMMGR = MarkerManager.getMarker("DIMS"); - private static class DimensionData - { - private final DimensionType type; - private int ticksWaited; - private DimensionData(DimensionType type) - { - this.type = type; - this.ticksWaited = 0; - } - } - private static boolean hasInit = false; + private static final ClearableRegistry REGISTRY = new ClearableRegistry<>(new ResourceLocation("dimension_type")); - private static final Int2ObjectMap worlds = Int2ObjectMaps.synchronize(new Int2ObjectLinkedOpenHashMap<>()); - private static final Int2ObjectMap dimensions = Int2ObjectMaps.synchronize(new Int2ObjectLinkedOpenHashMap<>()); - private static final IntSet keepLoaded = IntSets.synchronize(new IntOpenHashSet()); + private static final Int2ObjectMap dimensions = Int2ObjectMaps.synchronize(new Int2ObjectLinkedOpenHashMap<>()); private static final IntSet unloadQueue = IntSets.synchronize(new IntLinkedOpenHashSet()); - private static final BitSet dimensionMap = new BitSet(Long.SIZE << 4); private static final ConcurrentMap weakWorldMap = new MapMaker().weakKeys().weakValues().makeMap(); private static final Multiset leakedWorlds = HashMultiset.create(); + private static final Map savedEntries = new HashMap<>(); /** - * Returns a list of dimensions associated with this DimensionType. + * Registers a real unique dimension, Should be called on server init, or when the dimension is created. + * On the client, the list will be reset/reloaded every time a InternalServer is refreshed. + * + * Forge will save this data and keep track of registered values, syncing automatically from the remote server. + * + * @param name Registry name for this new dimension. + * @param type Dimension Type. + * @param data Configuration data for this dimension, passed into */ - public static int[] getDimensions(DimensionType type) + public static void registerDimension(ResourceLocation name, ModDimension type, PacketBuffer data) { - int[] ret = new int[dimensions.size()]; - int x = 0; - for (Int2ObjectMap.Entry ent : dimensions.int2ObjectEntrySet()) + Validate.notNull(name, "Can not register a dimesnion with null name"); + Validate.isTrue(!REGISTRY.func_212607_c(name), "Dimension: " + name + " Already registered"); + Validate.notNull(type, "Can not register a null dimension type"); + + int id = REGISTRY.getNextId(); + SavedEntry old = savedEntries.get(name); + if (old != null) { - if (ent.getValue().type == type) - { - ret[x++] = ent.getIntKey(); - } - } - - return Arrays.copyOf(ret, x); - } - - public static Map getRegisteredDimensions() - { - Map map = new IdentityHashMap<>(); - for (Int2ObjectMap.Entry entry : dimensions.int2ObjectEntrySet()) - { - map.computeIfAbsent(entry.getValue().type, k -> new IntRBTreeSet()).add(entry.getIntKey()); - } - return map; - } - - public static void init() - { - if (hasInit) - { - return; - } - - hasInit = true; - - registerDimension( 0, DimensionType.OVERWORLD); - registerDimension(-1, DimensionType.NETHER); - registerDimension( 1, DimensionType.THE_END); - } - - public static void registerDimension(int id, DimensionType type) - { - DimensionType.getById(type.getId()); //Check if type is invalid {will throw an error} No clue how it would be invalid tho... - if (dimensions.containsKey(id)) - { - throw new IllegalArgumentException(String.format("Failed to register dimension for id %d, One is already registered", id)); - } - dimensions.put(id, new DimensionData(type)); - if (id >= 0) - { - dimensionMap.set(id); + id = old.getId(); + if (!type.getRegistryName().equals(old.getType())) + LOGGER.info(DIMMGR, "Changing ModDimension for '{}' from '{}' to '{}'", name.toString(), old.getType() == null ? null : old.getType().toString(), type.getRegistryName().toString()); + savedEntries.remove(name); } + DimensionType instance = new DimensionType(id, "", name.getNamespace() + "/" + name.getPath(), type.getFactory(), type, data); + REGISTRY.register(id, name, instance); + LOGGER.info(DIMMGR, "Registered dimension {} of type {} and id {}", name.toString(), type.getRegistryName().toString(), id); } /** - * For unregistering a dimension when the save is changed (disconnected from a server or loaded a new save + * Configures if the dimension will stay loaded in memory even if all chunks are unloaded. + * + * @param dim The dimension + * @param value True to keep loaded, false to allow unloading + * @return The old value for this dimension. */ - public static void unregisterDimension(int id) + public static boolean keepLoaded(DimensionType dim, boolean value) { - if (!dimensions.containsKey(id)) - { - throw new IllegalArgumentException(String.format("Failed to unregister dimension for id %d; No provider registered", id)); - } - dimensions.remove(id); - } - - public static boolean isDimensionRegistered(int dim) - { - return dimensions.containsKey(dim); - } - - public static DimensionType getProviderType(int dim) - { - if (!dimensions.containsKey(dim)) - { - throw new IllegalArgumentException(String.format("Could not get provider type for dimension %d, does not exist", dim)); - } - return dimensions.get(dim).type; - } - - public static Dimension getProvider(int dim) - { - return getWorld(dim).dimension; - } - - public static Integer[] getIDs(boolean check) - { - if (check) - { - List allWorlds = Lists.newArrayList(weakWorldMap.keySet()); - allWorlds.removeAll(worlds.values()); - for (ListIterator li = allWorlds.listIterator(); li.hasNext(); ) - { - World w = li.next(); - leakedWorlds.add(System.identityHashCode(w)); - } - for (World w : allWorlds) - { - int leakCount = leakedWorlds.count(System.identityHashCode(w)); - if (leakCount == 5) - { - LOGGER.debug(DIMMGR,"The world {} ({}) may have leaked: first encounter (5 occurrences).\n", Integer.toHexString(System.identityHashCode(w)), w.getWorldInfo().getWorldName()); - } - else if (leakCount % 5 == 0) - { - LOGGER.debug(DIMMGR,"The world {} ({}) may have leaked: seen {} times.\n", Integer.toHexString(System.identityHashCode(w)), w.getWorldInfo().getWorldName(), leakCount); - } - } - } - return getIDs(); - } - - public static Integer[] getIDs() - { - return worlds.keySet().toArray(new Integer[0]); // Only loaded dims, since usually used to cycle through loaded worlds - } - - public static Stream getIDStream() - { - return worlds.keySet().stream(); - } - - public static void setWorld(int id, @Nullable WorldServer world, MinecraftServer server) - { - if (world != null) - { - worlds.put(id, world); - weakWorldMap.put(world, world); - LOGGER.info(DIMMGR,"Loading dimension {} ({}) ({})", id, world.getWorldInfo().getWorldName(), world.getServer()); - } - else - { - worlds.remove(id); - LOGGER.info(DIMMGR,"Unloading dimension {}", id); - } - - ArrayList tmp = new ArrayList(); - if (worlds.get( 0) != null) - tmp.add(worlds.get( 0)); - if (worlds.get(-1) != null) - tmp.add(worlds.get(-1)); - if (worlds.get( 1) != null) - tmp.add(worlds.get( 1)); - - for (Int2ObjectMap.Entry entry : worlds.int2ObjectEntrySet()) - { - int dim = entry.getIntKey(); - if (dim >= -1 && dim <= 1) - { - continue; - } - tmp.add(entry.getValue()); - } - - server.worlds = tmp.toArray(new WorldServer[0]); - } - - public static void initDimension(int dim) - { - WorldServer overworld = getWorld(0); - if (overworld == null) - { - throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!"); - } - try - { - DimensionManager.getProviderType(dim); - } - catch (Exception e) - { - LOGGER.error(DIMMGR,"Cannot Hotload Dim: {}", dim, e); - return; // If a provider hasn't been registered then we can't hotload the dim - } - MinecraftServer mcServer = overworld.getServer(); - ISaveHandler savehandler = overworld.getSaveHandler(); - //WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo()); - - WorldServer world = (dim == 0 ? overworld : (WorldServer)(new WorldServerMulti(mcServer, savehandler, dim, overworld, mcServer.profiler).init())); - world.addEventListener(new ServerWorldEventHandler(mcServer, world)); - MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); - if (!mcServer.isSinglePlayer()) - { - world.getWorldInfo().setGameType(mcServer.getGameType()); - } - - mcServer.setDifficultyForAllWorlds(mcServer.getDifficulty()); - } - - public static WorldServer getWorld(int id) - { - return getWorld(id, false); - } - - public static WorldServer getWorld(int id, boolean resetUnloadDelay) - { - return getWorld(id, resetUnloadDelay, false); - } - - public static WorldServer getWorld(int id, boolean resetUnloadDelay, boolean forceLoad) - { - if (resetUnloadDelay && unloadQueue.contains(id)) - { - dimensions.get(id).ticksWaited = 0; - } - WorldServer ret = worlds.get(id); - if (ret == null && forceLoad) - { - initDimension(id); - ret = worlds.get(id); - } + Validate.notNull(dim, "Dimension type must not be null"); + Data data = getData(dim); + boolean ret = data.keepLoaded; + data.keepLoaded = value; return ret; } - public static WorldServer[] getWorlds() + /** + * Determines if the dimension will stay loaded in memory even if all chunks are unloaded. + * @param dim The dimension + * @return True if the dimension will stay loaded with no chunks loaded. + */ + public static boolean keepLoaded(DimensionType dim) { - return worlds.values().toArray(new WorldServer[0]); - } - - static - { - init(); + Validate.notNull(dim, "Dimension type must not be null"); + Data data = dimensions.get(dim.getId()); + return data == null ? false : data.keepLoaded; } /** - * Not public API: used internally to get dimensions that should load at - * server startup + * Retrieves the world from the server allowing for null return, and optionally resetting it's unload timer. + * + * @param server The server that controlls this world. + * @param dim Dimension to load. + * @param resetUnloadDelay True to reset the unload timer, which is a delay that is used to prevent constant world loading/unloading cycle. + * @param forceLoad True to attempt to load the dimension if the server has it unloaded. + * @return The world, null if unloaded and not loadable. */ - public static Integer[] getStaticDimensionIDs() + @Nullable + public static WorldServer getWorld(MinecraftServer server, DimensionType dim, boolean resetUnloadDelay, boolean forceLoad) { - return dimensions.keySet().toArray(new Integer[0]); + Validate.notNull(server, "Must provide server when creating world"); + Validate.notNull(dim, "Dimension type must not be null"); + + if (resetUnloadDelay && unloadQueue.contains(dim.getId())) + getData(dim).ticksWaited = 0; + + @SuppressWarnings("deprecation") + WorldServer ret = server.forgeGetWorldMap().get(dim); + if (ret == null && forceLoad) + ret = initWorld(server, dim); + return ret; } - public static Dimension createProviderFor(int dim) + //========================================================================================================== + // FORGE INTERNAL + //========================================================================================================== + + public static void unregisterDimension(int id) { - try - { - if (dimensions.containsKey(dim)) - { - Dimension ret = getProviderType(dim).create(); - ret.setId(dim); - return ret; - } - else - { - throw new RuntimeException(String.format("No WorldProvider bound for dimension %d", dim)); //It's going to crash anyway at this point. Might as well be informative - } - } - catch (Exception e) - { - LOGGER.error(DIMMGR,"An error occurred trying to create an instance of WorldProvider {} ({})", - dim, getProviderType(dim), e); - throw new RuntimeException(e); - } + Validate.isTrue(dimensions.containsKey(id), String.format("Failed to unregister dimension for id %d; No provider registered", id)); + dimensions.remove(id); } - /** - * Sets if a dimension should stay loaded. - * @param dim the dimension ID - * @param keep whether or not the dimension should be kept loaded - * @return true iff the dimension's status changed - */ - public static boolean keepDimensionLoaded(int dim, boolean keep) + public static void registerDimensionInternal(int id, ResourceLocation name, ModDimension type, PacketBuffer data) { - return keep ? keepLoaded.add(dim) : keepLoaded.remove(dim); + Validate.notNull(name, "Can not register a dimesnion with null name"); + Validate.notNull(type, "Can not register a null dimension type"); + Validate.isTrue(!REGISTRY.func_212607_c(name), "Dimension: " + name + " Already registered"); + Validate.isTrue(REGISTRY.get(id) == null, "Dimension with id " + id + " already registered as name " + REGISTRY.getKey(REGISTRY.get(id))); + + DimensionType instance = new DimensionType(id, "", name.getNamespace() + "/" + name.getPath(), type.getFactory(), type, data); + REGISTRY.register(id, name, instance); + LOGGER.info(DIMMGR, "Registered dimension {} of type {} and id {}", name.toString(), type.getRegistryName().toString(), id); + } + + @SuppressWarnings("deprecation") + public static WorldServer initWorld(MinecraftServer server, DimensionType dim) + { + Validate.isTrue(dim != DimensionType.OVERWORLD, "Can not hotload overworld. This must be loaded at all times by main Server."); + Validate.notNull(server, "Must provide server when creating world"); + Validate.notNull(dim, "Must provide dimension when creating world"); + + WorldServer overworld = getWorld(server, DimensionType.OVERWORLD, false, false); + Validate.notNull(overworld, "Cannot Hotload Dim: Overworld is not Loaded!"); + + @SuppressWarnings("resource") + WorldServer world = new WorldServerMulti(server, overworld.getSaveHandler(), dim, overworld, server.profiler).func_212251_i__(); + world.addEventListener(new ServerWorldEventHandler(server, world)); + if (!server.isSinglePlayer()) + world.getWorldInfo().setGameType(server.getGameType()); + server.forgeGetWorldMap().put(dim, world); + + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); + + server.setDifficultyForAllWorlds(server.getDifficulty()); + + return world; } private static boolean canUnloadWorld(WorldServer world) { - return ForgeChunkManager.getPersistentChunksFor(world).isEmpty() + return world.func_212412_ag().isEmpty() && world.playerEntities.isEmpty() - && !world.dimension.getType().shouldLoadSpawn() - && !keepLoaded.contains(world.dimension.getId()); + //&& !world.dimension.getType().shouldLoadSpawn() + && !getData(world.getDimension().getType()).keepLoaded; } /** * Queues a dimension to unload, if it can be unloaded. * @param id The id of the dimension */ - public static void unloadWorld(int id) + public static void unloadWorld(WorldServer world) { - WorldServer world = worlds.get(id); - if (world == null || !canUnloadWorld(world)) return; + if (world == null || !canUnloadWorld(world)) + return; + int id = world.getDimension().getType().getId(); if (unloadQueue.add(id)) - { LOGGER.debug(DIMMGR,"Queueing dimension {} to unload", id); - } } - public static boolean isWorldQueuedToUnload(int id) - { - return unloadQueue.contains(id); - } - - /* - * To be called by the server at the appropriate time, do not call from mod code. - */ - public static void unloadWorlds() + @SuppressWarnings("deprecation") + public static void unloadWorlds(MinecraftServer server, boolean checkLeaks) { IntIterator queueIterator = unloadQueue.iterator(); while (queueIterator.hasNext()) { int id = queueIterator.nextInt(); - DimensionData dimension = dimensions.get(id); + DimensionType dim = DimensionType.getById(id); + + if (dim == null) + { + LOGGER.warn(DIMMGR, "Dimension with unknown type '{}' added to unload queue, removing", id); + queueIterator.remove(); + continue; + } + + Data dimension = dimensions.computeIfAbsent(id, k -> new Data()); if (dimension.ticksWaited < ForgeConfig.SERVER.dimensionUnloadQueueDelay.get()) { dimension.ticksWaited++; continue; } - WorldServer w = worlds.get(id); + queueIterator.remove(); + + WorldServer w = server.forgeGetWorldMap().get(dim); + dimension.ticksWaited = 0; // Don't unload the world if the status changed if (w == null || !canUnloadWorld(w)) @@ -420,97 +273,179 @@ public class DimensionManager { MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w)); w.close(); - setWorld(id, null, w.getServer()); + server.forgeGetWorldMap().remove(dim); + } + } + + if (checkLeaks) + { + List allWorlds = Lists.newArrayList(weakWorldMap.keySet()); + allWorlds.removeAll(server.forgeGetWorldMap().values()); + allWorlds.stream().map(System::identityHashCode).forEach(leakedWorlds::add); + + for (World w : allWorlds) + { + int hash = System.identityHashCode(w); + int leakCount = leakedWorlds.count(hash); + if (leakCount == 5) + LOGGER.debug(DIMMGR,"The world {} ({}) may have leaked: first encounter (5 occurrences).\n", Integer.toHexString(hash), w.getWorldInfo().getWorldName()); + else if (leakCount % 5 == 0) + LOGGER.debug(DIMMGR,"The world {} ({}) may have leaked: seen {} times.\n", Integer.toHexString(hash), w.getWorldInfo().getWorldName(), leakCount); } } } - /** - * Return the next free dimension ID. Note: you are not guaranteed a contiguous - * block of free ids. Always call for each individual ID you wish to get. - * @return the next free dimension ID - */ - public static int getNextFreeDimId() { - int next = 0; - while (true) + public static void writeRegistry(NBTTagCompound data) + { + data.setInt("version", 1); + List list = new ArrayList<>(); + for (DimensionType type : REGISTRY) + list.add(new SavedEntry(type)); + savedEntries.values().forEach(list::add); + + Collections.sort(list, (a, b) -> a.id - b.id); + NBTTagList lst = new NBTTagList(); + list.forEach(e -> lst.add(e.write())); + + data.setTag("entries", lst); + } + + public static void readRegistry(NBTTagCompound data) + { + int version = data.getInt("version"); + if (version != 1) + throw new IllegalStateException("Attempted to load world with unknown Dimension data format: " + version); + + LOGGER.debug(DIMMGR, "Reading Dimension Entries."); + Map vanilla = REGISTRY.stream().filter(DimensionType::isVanilla).collect(Collectors.toMap(REGISTRY::getKey, v -> v)); + REGISTRY.clear(); + vanilla.forEach((key, value) -> { + LOGGER.debug(DIMMGR, "Registering vanilla entry ID: {} Name: {} Value: {}", value.getId() + 1, key.toString(), value.toString()); + REGISTRY.register(value.getId() + 1, key, value); + }); + + savedEntries.clear(); + + boolean error = false; + NBTTagList list = data.getList("entries", 10); + for (int x = 0; x < list.size(); x++) { - next = dimensionMap.nextClearBit(next); - if (dimensions.containsKey(next)) + SavedEntry entry = new SavedEntry(list.getCompound(x)); + if (entry.type == null) { - dimensionMap.set(next); + DimensionType type = REGISTRY.func_212608_b(entry.name); + if (type == null) + { + LOGGER.error(DIMMGR, "Vanilla entry '{}' id {} in save file not found in registry.", entry.name.toString(), entry.id); + error = true; + continue; + } + int id = REGISTRY.getId(type); + if (id != entry.id) + { + LOGGER.error(DIMMGR, "Vanilla entry '{}' id {} in save file has incorrect in {} in registry.", entry.name.toString(), entry.id, id); + error = true; + continue; + } } else { - return next; - } - } - } - - public static NBTTagCompound saveDimensionDataMap() - { - int[] data = new int[(dimensionMap.length() + Integer.SIZE - 1 )/ Integer.SIZE]; - NBTTagCompound dimMap = new NBTTagCompound(); - for (int i = 0; i < data.length; i++) - { - int val = 0; - for (int j = 0; j < Integer.SIZE; j++) - { - val |= dimensionMap.get(i * Integer.SIZE + j) ? (1 << j) : 0; - } - data[i] = val; - } - dimMap.setIntArray("DimensionArray", data); - return dimMap; - } - - public static void loadDimensionDataMap(@Nullable NBTTagCompound compoundTag) - { - dimensionMap.clear(); - if (compoundTag == null) - { - IntIterator iterator = dimensions.keySet().iterator(); - while (iterator.hasNext()) - { - int id = iterator.nextInt(); - if (id >= 0) + ModDimension mod = ForgeRegistries.MOD_DIMENSIONS.getValue(entry.type); + if (mod == null) { - dimensionMap.set(id); + LOGGER.error(DIMMGR, "Modded dimension entry '{}' id {} in save file missing ModDimension.", entry.name.toString(), entry.id, entry.type.toString()); + savedEntries.put(entry.name, entry); + continue; } + registerDimensionInternal(entry.id, entry.name, mod, entry.data == null ? null : new PacketBuffer(Unpooled.wrappedBuffer(entry.data))); } } - else + + //Allow modders to register dimensions/claim the missing. + MinecraftForge.EVENT_BUS.post(new RegisterDimensionsEvent(savedEntries)); + + if (!savedEntries.isEmpty()) { - int[] intArray = compoundTag.getIntArray("DimensionArray"); - for (int i = 0; i < intArray.length; i++) - { - for (int j = 0; j < Integer.SIZE; j++) - { - dimensionMap.set(i * Integer.SIZE + j, (intArray[i] & (1 << j)) != 0); - } - } + savedEntries.values().forEach(entry -> { + LOGGER.warn(DIMMGR, "Missing Dimension Name: '{}' Id: {} Type: '{}", entry.name.toString(), entry.id, entry.type.toString()); + }); } } - /** - * Return the current root directory for the world save. Accesses getSaveHandler from the overworld - * @return the root directory of the save - */ - @Nullable - public static File getCurrentSaveRootDirectory() + @Deprecated //Forge: Internal use only. + public static IRegistry getRegistry() { - if (DimensionManager.getWorld(0) != null) + return REGISTRY; + } + + private static Data getData(DimensionType dim) + { + return dimensions.computeIfAbsent(dim.getId(), k -> new Data()); + } + + private static class Data + { + int ticksWaited = 0; + boolean keepLoaded = false; + } + + public static class SavedEntry + { + int id; + ResourceLocation name; + ResourceLocation type; + byte[] data; + + public int getId() { - return DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory(); - }/* - else if (MinecraftServer.getServer() != null) + return id; + } + + public ResourceLocation getName() { - MinecraftServer srv = MinecraftServer.getServer(); - SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false); - return saveHandler.getWorldDirectory(); - }*/ - else + return name; + } + + @Nullable + public ResourceLocation getType() { - return null; + return type; + } + + @Nullable + public byte[] getData() + { + return data; + } + + private SavedEntry(NBTTagCompound data) + { + this.id = data.getInt("id"); + this.name = new ResourceLocation(data.getString("name")); + this.type = data.contains("type", 8) ? new ResourceLocation(data.getString("type")) : null; + this.data = data.contains("data", 7) ? data.getByteArray("data") : null; + } + + private SavedEntry(DimensionType data) + { + this.id = REGISTRY.getId(data); + this.name = REGISTRY.getKey(data); + if (data.getModType() != null) + this.type = data.getModType().getRegistryName(); + if (data.getData() != null) + this.data = data.getData().array(); + } + + private NBTTagCompound write() + { + NBTTagCompound ret = new NBTTagCompound(); + ret.setInt("id", id); + ret.setString("name", name.toString()); + if (type != null) + ret.setString("type", type.toString()); + if (data != null) + ret.setByteArray("data", data); + return ret; } } } diff --git a/src/main/java/net/minecraftforge/common/ForgeConfig.java b/src/main/java/net/minecraftforge/common/ForgeConfig.java index 28e8908da..e1e4b5344 100644 --- a/src/main/java/net/minecraftforge/common/ForgeConfig.java +++ b/src/main/java/net/minecraftforge/common/ForgeConfig.java @@ -41,74 +41,74 @@ public class ForgeConfig public static class Server { public final BooleanValue removeErroringEntities; public final BooleanValue removeErroringTileEntities; - + public final BooleanValue fullBoundingBoxLadders; - + public final DoubleValue zombieBaseSummonChance; public final DoubleValue zombieBabyChance; - + public final BooleanValue logCascadingWorldGeneration; public final BooleanValue fixVanillaCascading; - + public final IntValue dimensionUnloadQueueDelay; - + public final IntValue clumpingThreshold; - + Server(ForgeConfigSpec.Builder builder) { builder.comment("Server configuration settings") .push("server"); - + removeErroringEntities = builder .comment("Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES.") .translation("forge.configgui.removeErroringEntities") .worldRestart() .define("removeErroringEntities", false); - + removeErroringTileEntities = builder .comment("Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES.") .translation("forge.configgui.removeErroringTileEntities") .worldRestart() .define("removeErroringTileEntities", false); - + fullBoundingBoxLadders = builder .comment("Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. Default: false") .translation("forge.configgui.fullBoundingBoxLadders") .worldRestart() .define("fullBoundingBoxLadders", false); - + zombieBaseSummonChance = builder .comment("Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic.") .translation("forge.configgui.zombieBaseSummonChance") .worldRestart() .defineInRange("zombieBaseSummonChance", 0.1D, 0.0D, 1.0D); - + zombieBabyChance = builder .comment("Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic.") .translation("forge.configgui.zombieBabyChance") .worldRestart() .defineInRange("zombieBabyChance", 0.05D, 0.0D, 1.0D); - + logCascadingWorldGeneration = builder .comment("Log cascading chunk generation issues during terrain population.") .translation("forge.configgui.logCascadingWorldGeneration") .define("logCascadingWorldGeneration", true); - + fixVanillaCascading = builder .comment("Fix vanilla issues that cause worldgen cascading. This DOES change vanilla worldgen so DO NOT report bugs related to world differences if this flag is on.") .translation("forge.configgui.fixVanillaCascading") .define("fixVanillaCascading", false); - + dimensionUnloadQueueDelay = builder .comment("The time in ticks the server will wait when a dimension was queued to unload. This can be useful when rapidly loading and unloading dimensions, like e.g. throwing items through a nether portal a few time per second.") .translation("forge.configgui.dimensionUnloadQueueDelay") .defineInRange("dimensionUnloadQueueDelay", 0, 0, Integer.MAX_VALUE); - + clumpingThreshold = builder .comment("Controls the number threshold at which Packet51 is preferred over Packet52, default and minimum 64, maximum 1024") .translation("forge.configgui.clumpingThreshold") .worldRestart() .defineInRange("clumpingThreshold", 64, 64, 1024); - + builder.pop(); } } @@ -120,55 +120,55 @@ public class ForgeConfig public final BooleanValue zoomInMissingModelTextInGui; public final BooleanValue forgeCloudsEnabled; - + public final BooleanValue disableStairSlabCulling; public final BooleanValue alwaysSetupTerrainOffThread; public final BooleanValue forgeLightPipelineEnabled; - + public final BooleanValue selectiveResourceReloadEnabled; - + Client(ForgeConfigSpec.Builder builder) { builder.comment("Client only settings, mostly things related to rendering") .push("client"); - + zoomInMissingModelTextInGui = builder .comment("Toggle off to make missing model text in the gui fit inside the slot.") .translation("forge.configgui.zoomInMissingModelTextInGui") .define("zoomInMissingModelTextInGui", false); - + forgeCloudsEnabled = builder .comment("Enable uploading cloud geometry to the GPU for faster rendering.") .translation("forge.configgui.forgeCloudsEnabled") .define("forgeCloudsEnabled", true); - + disableStairSlabCulling = builder .comment("Disable culling of hidden faces next to stairs and slabs. Causes extra rendering, but may fix some resource packs that exploit this vanilla mechanic.") .translation("forge.configgui.disableStairSlabCulling") .define("disableStairSlabCulling", false); - - alwaysSetupTerrainOffThread = builder + + alwaysSetupTerrainOffThread = builder .comment("Enable forge to queue all chunk updates to the Chunk Update thread.", "May increase FPS significantly, but may also cause weird rendering lag.", "Not recommended for computers without a significant number of cores available.") .translation("forge.configgui.alwaysSetupTerrainOffThread") .define("alwaysSetupTerrainOffThread", false); - + forgeLightPipelineEnabled = builder .comment("Enable the forge block rendering pipeline - fixes the lighting of custom models.") .translation("forge.configgui.forgeLightPipelineEnabled") .define("forgeLightPipelineEnabled", true); - + selectiveResourceReloadEnabled = builder .comment("When enabled, makes specific reload tasks such as language changing quicker to run.") .translation("forge.configgui.selectiveResourceReloadEnabled") .define("selectiveResourceReloadEnabled", true); - + builder.pop(); } } - + static final ForgeConfigSpec clientSpec; public static final Client CLIENT; static { diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index 19506678d..0555c2a27 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -101,6 +101,7 @@ import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.event.ClickEvent; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; +import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.GameType; import net.minecraft.world.IBlockReader; @@ -749,7 +750,7 @@ public class ForgeHooks return stack.isEmpty() || !stack.getItem().onLeftClickEntity(stack, player, target); } - public static boolean onTravelToDimension(Entity entity, int dimension) + public static boolean onTravelToDimension(Entity entity, DimensionType dimension) { EntityTravelToDimensionEvent event = new EntityTravelToDimensionEvent(entity, dimension); MinecraftForge.EVENT_BUS.post(event); @@ -1100,7 +1101,7 @@ public class ForgeHooks return event.getVanillaNoteId(); } - public static int canEntitySpawn(EntityLiving entity, IWorld world, float x, float y, float z, MobSpawnerBaseLogic spawner) { + public static int canEntitySpawn(EntityLiving entity, IWorld world, double x, double y, double z, MobSpawnerBaseLogic spawner) { Result res = ForgeEventFactory.canEntitySpawn(entity, world, x, y, z, null); return res == Result.DEFAULT ? 0 : res == Result.DENY ? -1 : 1; } diff --git a/src/main/java/net/minecraftforge/common/ForgeMod.java b/src/main/java/net/minecraftforge/common/ForgeMod.java index 92891416e..9e38d5717 100644 --- a/src/main/java/net/minecraftforge/common/ForgeMod.java +++ b/src/main/java/net/minecraftforge/common/ForgeMod.java @@ -69,7 +69,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook public static boolean forgeLightPipelineEnabled = true; public static boolean zoomInMissingModelTextInGui = false; public static boolean disableStairSlabCulling = false; // Also known as the "DontCullStairsBecauseIUseACrappyTexturePackThatBreaksBasicBlockShapesSoICantTrustBasicBlockCulling" flag - public static boolean alwaysSetupTerrainOffThread = false; // In RenderGlobal.setupTerrain, always force the chunk render updates to be queued to the thread + public static boolean alwaysSetupTerrainOffThread = false; // In WorldRenderer.setupTerrain, always force the chunk render updates to be queued to the thread public static boolean logCascadingWorldGeneration = true; // see Chunk#logCascadingWorldGeneration() public static boolean fixVanillaCascading = false; // There are various places in vanilla that cause cascading worldgen. Enabling this WILL change where blocks are placed to prevent this. // DO NOT contact Forge about worldgen not 'matching' vanilla if this flag is set. @@ -130,7 +130,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook public void playerLogin(PlayerEvent.PlayerLoggedInEvent event) { - UsernameCache.setUsername(event.player.getUniqueID(), event.player.getGameProfile().getName()); + UsernameCache.setUsername(event.getPlayer().getUniqueID(), event.getPlayer().getGameProfile().getName()); } @@ -204,8 +204,10 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info) { NBTTagCompound forgeData = new NBTTagCompound(); - NBTTagCompound dimData = DimensionManager.saveDimensionDataMap(); - forgeData.setTag("DimensionData", dimData); + NBTTagCompound dims = new NBTTagCompound(); + DimensionManager.writeRegistry(dims); + if (!dims.isEmpty()) + forgeData.setTag("dims", dims); // TODO fluids FluidRegistry.writeDefaultFluidList(forgeData); return forgeData; } @@ -213,7 +215,8 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook @Override public void readData(SaveHandler handler, WorldInfo info, NBTTagCompound tag) { - DimensionManager.loadDimensionDataMap(tag.hasKey("DimensionData") ? tag.getCompound("DimensionData") : null); + if (tag.contains("dims", 10)) + DimensionManager.readRegistry(tag.getCompound("dims")); // TODO fluids FluidRegistry.loadFluidDefaults(tag); } diff --git a/src/main/java/net/minecraftforge/common/ModDimension.java b/src/main/java/net/minecraftforge/common/ModDimension.java new file mode 100644 index 000000000..8a205a55c --- /dev/null +++ b/src/main/java/net/minecraftforge/common/ModDimension.java @@ -0,0 +1,55 @@ +/* + * Minecraft Forge + * Copyright (c) 2016-2019. + * + * 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.common; + +import java.util.function.Function; + +import net.minecraft.network.PacketBuffer; +import net.minecraft.world.dimension.Dimension; +import net.minecraft.world.dimension.DimensionType; +import net.minecraftforge.registries.ForgeRegistryEntry; + +/** + * In 1.13.2, Mojang made DimensionType as the unique holder/identifier for each Dimension. + * We used to be able to create custom Dimensions separate from DimensionType. + * But now that they are hard linked to a single instance, this is the new class that + * defines the 'template' for new dimensions. + */ +public abstract class ModDimension extends ForgeRegistryEntry +{ + public abstract Function getFactory(); + + /** + * Serialize any necessary data, this is called both when saving the world on the server. + * And when sent over the network to the client. + * + * @param buffer The data buffer to write to. + * @param network true when sent over the network, so you can only data needed by the client. + */ + public void write(PacketBuffer buffer, boolean network){} + + /** + * Deserialize any necessary data, this is called both when saving the world on the server. + * And when sent over the network to the client. + * + * @param buffer The data buffer to write to. + * @param network true when sent over the network, so you can only data needed by the client. + */ + public void read(PacketBuffer buffer, boolean network){} +} diff --git a/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java b/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java deleted file mode 100644 index b78a25143..000000000 --- a/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Minecraft Forge - * Copyright (c) 2016-2019. - * - * 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.common; - -import java.io.File; -import java.io.IOException; - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import com.google.common.io.Files; -import com.mojang.datafixers.DataFixer; - -import net.minecraft.world.chunk.storage.IChunkLoader; -import net.minecraft.world.dimension.Dimension; -import net.minecraft.world.gen.feature.template.TemplateManager; -import net.minecraft.world.storage.IPlayerFileData; -import net.minecraft.world.storage.ISaveHandler; -import net.minecraft.world.storage.SessionLockException; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.storage.WorldInfo; -import net.minecraft.world.WorldServer; - -//Class used internally to provide the world specific data directories. - -public class WorldSpecificSaveHandler implements ISaveHandler -{ - private static final Logger LOGGER = LogManager.getLogger(); - - private WorldServer world; - private ISaveHandler parent; - private File dataDir; - - public WorldSpecificSaveHandler(WorldServer world, ISaveHandler parent) - { - this.world = world; - this.parent = parent; - } - - @Override public WorldInfo loadWorldInfo() { return parent.loadWorldInfo(); } - @Override public void checkSessionLock() throws SessionLockException { parent.checkSessionLock(); } - @Override public IChunkLoader getChunkLoader(Dimension var1) { return parent.getChunkLoader(var1); } - @Override public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { parent.saveWorldInfoWithPlayer(var1, var2); } - @Override public void saveWorldInfo(WorldInfo var1){ parent.saveWorldInfo(var1); } - @Override public IPlayerFileData getPlayerNBTManager() { return parent.getPlayerNBTManager(); } - @Override public void flush() { parent.flush(); } - @Override public File getWorldDirectory() { return parent.getWorldDirectory(); } - @Override public DataFixer getFixer() { return parent.getFixer(); } - - @Override - public File getMapFileFromName(String name) - { - if (dataDir == null) //Delayed down here do that world has time to be initialized first. - { - dataDir = new File(world.getChunkSaveLocation(), "data"); - dataDir.mkdirs(); - } - File file = new File(dataDir, name + ".dat"); - if (!file.exists()) - { - switch (world.dimension.getId()) - { - case -1: - if (name.equalsIgnoreCase("FORTRESS")) copyFile(name, file); - break; - case 1: - if (name.equalsIgnoreCase("VILLAGES_END")) copyFile(name, file); - break; - } - } - return file; - } - - private void copyFile(String name, File to) - { - File parentFile = parent.getMapFileFromName(name); - if (parentFile.exists()) - { - try - { - Files.copy(parentFile, to); - } - catch (IOException e) - { - LOGGER.error("A critical error occurred copying {} to world specific dat folder - new file will be created.", parentFile.getName(), e); - } - } - } - - @Override - public TemplateManager getStructureTemplateManager() - { - return parent.getStructureTemplateManager(); - } -} diff --git a/src/main/java/net/minecraftforge/common/chunkio/ChunkIOExecutor.java b/src/main/java/net/minecraftforge/common/chunkio/ChunkIOExecutor.java index a4344610d..b94a57476 100644 --- a/src/main/java/net/minecraftforge/common/chunkio/ChunkIOExecutor.java +++ b/src/main/java/net/minecraftforge/common/chunkio/ChunkIOExecutor.java @@ -35,6 +35,7 @@ import com.google.common.collect.Maps; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.storage.AnvilChunkLoader; +import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.gen.ChunkProviderServer; public class ChunkIOExecutor @@ -124,7 +125,7 @@ public class ChunkIOExecutor ChunkIOProvider task = tasks.get(key); if (task == null) { - LOGGER.warn("Attempted to dequeue chunk that wasn't queued? {} @ ({}, {})", world.dimension.getId(), x, z); + LOGGER.warn("Attempted to dequeue chunk that wasn't queued? {} @ ({}, {})", DimensionType.func_212678_a(world.dimension.getType()).toString(), x, z); return; } diff --git a/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java b/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java index 9920533cb..5c0238488 100644 --- a/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java +++ b/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java @@ -20,6 +20,7 @@ package net.minecraftforge.common.chunkio; import net.minecraft.world.World; +import net.minecraft.world.dimension.DimensionType; class QueuedChunk { final int x; @@ -57,7 +58,7 @@ class QueuedChunk { result.append(" x: " + x + NEW_LINE); result.append(" z: " + z + NEW_LINE); result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE); - result.append(" dimension: " + world.dimension.getId() + NEW_LINE); + result.append(" dimension: " + DimensionType.func_212678_a(world.dimension.getType()).toString() + NEW_LINE); result.append(" provider: " + world.dimension.getClass().getName() + NEW_LINE); result.append("}"); diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java index cbad9188a..f5c25fecb 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java @@ -38,7 +38,7 @@ import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.IBlockState; import net.minecraft.client.particle.ParticleManager; import net.minecraft.client.renderer.ActiveRenderInfo; -import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java index 9b69d7e81..3b4dd423d 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java @@ -26,7 +26,7 @@ import javax.annotation.Nullable; import net.minecraft.block.*; import net.minecraft.block.state.IBlockState; import net.minecraft.client.particle.ParticleManager; -import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java b/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java index f3166b542..3d5bbce46 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeDimension.java @@ -24,6 +24,7 @@ import javax.annotation.Nullable; import net.minecraft.client.audio.MusicTicker; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -31,6 +32,7 @@ import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.dimension.Dimension; +import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.NetherDimension; import net.minecraft.world.dimension.OverworldDimension; import net.minecraft.world.storage.WorldInfo; @@ -44,7 +46,7 @@ public interface IForgeDimension { return (Dimension) this; } - + World getWorld(); /** @@ -81,7 +83,7 @@ public interface IForgeDimension } return 1.0; } - + /** * If this method returns true, then chunks received by the client will * have {@link net.minecraft.world.chunk.Chunk#resetRelightChecks} called @@ -98,17 +100,6 @@ public interface IForgeDimension return !(this instanceof OverworldDimension); } - /** - * 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 id Dimension ID - */ - void setId(int id); - - int getId(); - @OnlyIn(Dist.CLIENT) @Nullable IRenderHandler getSkyRenderer(); @@ -129,7 +120,7 @@ public interface IForgeDimension @OnlyIn(Dist.CLIENT) void setWeatherRenderer(IRenderHandler renderer); - + /** * Allows for manipulating the coloring of the lightmap texture. * Will be called for each 16*16 combination of sky/block light values. @@ -140,7 +131,7 @@ public interface IForgeDimension * @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) + * @see net.minecraft.client.renderer.GameRenderer#updateLightmap(float) */ default void getLightmapColors(float partialTicks, float sunBrightness, float skyLight, float blockLight, float[] colors) {} @@ -167,7 +158,7 @@ public interface IForgeDimension { return null; } - + /** * Determines if the player can sleep in this world (or if the bed should explode for example). * @@ -316,11 +307,6 @@ public interface IForgeDimension return getWorld().getWorldInfo().getTerrainType().getHorizon(getWorld()); } - default String getSaveFolder() - { - return getId() == 0 ? null : "DIM" + getId(); - } - /** * Determine if the cursor on the map should 'spin' when rendered, like it does for the player in the nether. * @@ -332,7 +318,7 @@ public interface IForgeDimension */ default boolean shouldMapSpin(String entity, double x, double z, double rotation) { - return getId() < 0; + return getDimension().getType() == DimensionType.NETHER; } /** @@ -341,7 +327,7 @@ public interface IForgeDimension * @param player The player that is respawning * @return The dimension to respawn the player in */ - default int getRespawnDimension(net.minecraft.entity.player.EntityPlayerMP player) + default DimensionType getRespawnDimension(EntityPlayerMP player) { return player.getSpawnDimension(); } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java b/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java index fb246b86d..db1d1a7c1 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeFluid.java @@ -22,7 +22,7 @@ package net.minecraftforge.common.extensions; import javax.annotation.Nullable; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.entity.Entity; import net.minecraft.fluid.Fluid; import net.minecraft.fluid.IFluidState; diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeFluidState.java b/src/main/java/net/minecraftforge/common/extensions/IForgeFluidState.java index 290e007a5..59a99c9eb 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeFluidState.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeFluidState.java @@ -21,7 +21,7 @@ package net.minecraftforge.common.extensions; import javax.annotation.Nullable; -import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.entity.Entity; import net.minecraft.fluid.Fluid; import net.minecraft.fluid.IFluidState; diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java b/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java index 5a1ff8c81..72ab747a8 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java @@ -23,6 +23,7 @@ import java.util.Set; import javax.annotation.Nullable; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Multimap; import net.minecraft.block.state.IBlockState; @@ -36,7 +37,6 @@ import net.minecraft.entity.passive.HorseArmorType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.EntityEquipmentSlot; -import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.Item; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemGroup; @@ -44,14 +44,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumActionResult; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.registry.RegistrySimple; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.animation.ITimeValue; // TODO review most of the methods in this "patch" public interface IForgeItem @@ -679,16 +678,10 @@ public interface IForgeItem return null; } - default com.google.common.collect.ImmutableMap getAnimationParameters(final ItemStack stack, - final World world, final EntityLivingBase entity) + default 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 : ((RegistrySimple) getItem().properties).getKeys()) - { - final IItemPropertyGetter parameter = getItem().properties.get(location); - builder.put(location.toString(), input -> parameter.call(stack, world, entity)); - } + com.google.common.collect.ImmutableMap.Builder builder = ImmutableMap.builder(); + getItem().properties.forEach((k,v) -> builder.put(k.toString(), input -> v.call(stack, world, entity))); return builder.build(); } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeWorld.java b/src/main/java/net/minecraftforge/common/extensions/IForgeWorld.java index 4a54397f0..ea6c50aa8 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeWorld.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeWorld.java @@ -19,17 +19,6 @@ package net.minecraftforge.common.extensions; -import java.util.Iterator; -import java.util.Objects; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSetMultimap; - -import net.minecraft.util.math.ChunkPos; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.ForgeChunkManager; -import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.capabilities.ICapabilityProvider; public interface IForgeWorld extends ICapabilityProvider @@ -40,23 +29,4 @@ public interface IForgeWorld extends ICapabilityProvider * of one of there entities. */ public static double MAX_ENTITY_RADIUS = 2.0D; - - default ImmutableSetMultimap getPersistentChunks() - { - return ForgeChunkManager.getPersistentChunksFor((World)this); - } - - default Iterator getPersistentChunkIterable(Iterator chunkIterator) - { - @SuppressWarnings("resource") - World world = (World)this; - final ImmutableSetMultimap persistentChunksFor = getPersistentChunks(); - final ImmutableSet.Builder builder = ImmutableSet.builder(); - world.profiler.startSection("forcedChunkLoading"); - builder.addAll(persistentChunksFor.keys().stream().filter(Objects::nonNull).map(input -> world.getChunk(input.x, input.z)).iterator()); - world.profiler.endStartSection("regularChunkLoading"); - builder.addAll(chunkIterator); - world.profiler.endSection(); - return builder.build().iterator(); - } } diff --git a/src/main/java/net/minecraftforge/common/model/TRSRTransformation.java b/src/main/java/net/minecraftforge/common/model/TRSRTransformation.java index 1a7d35df9..25769e6c6 100644 --- a/src/main/java/net/minecraftforge/common/model/TRSRTransformation.java +++ b/src/main/java/net/minecraftforge/common/model/TRSRTransformation.java @@ -35,8 +35,8 @@ import javax.vecmath.Tuple4f; import javax.vecmath.Vector3f; import javax.vecmath.Vector4f; -import net.minecraft.client.renderer.block.model.ItemTransformVec3f; -import net.minecraft.client.renderer.block.model.ModelRotation; +import net.minecraft.client.renderer.model.ItemTransformVec3f; +import net.minecraft.client.renderer.model.ModelRotation; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.Vec3i; import net.minecraftforge.api.distmarker.Dist; @@ -536,7 +536,7 @@ public final class TRSRTransformation implements IModelState, ITransformation */ @Deprecated @OnlyIn(Dist.CLIENT) - public net.minecraft.client.renderer.block.model.ItemTransformVec3f toItemTransform() + public net.minecraft.client.renderer.model.ItemTransformVec3f toItemTransform() { return new ItemTransformVec3f(toMojang(toXYZDegrees(getLeftRot())), toMojang(getTranslation()), toMojang(getScale())); } diff --git a/src/main/java/net/minecraftforge/common/model/animation/Clips.java b/src/main/java/net/minecraftforge/common/model/animation/Clips.java index ba1db2638..be28b3fa1 100644 --- a/src/main/java/net/minecraftforge/common/model/animation/Clips.java +++ b/src/main/java/net/minecraftforge/common/model/animation/Clips.java @@ -21,8 +21,8 @@ package net.minecraftforge.common.model.animation; import java.io.IOException; -import net.minecraft.client.renderer.block.model.IUnbakedModel; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.IUnbakedModel; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.MathHelper; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/net/minecraftforge/common/network/DimensionMessageHandler.java b/src/main/java/net/minecraftforge/common/network/DimensionMessageHandler.java index 74e602d7c..5b190a80c 100644 --- a/src/main/java/net/minecraftforge/common/network/DimensionMessageHandler.java +++ b/src/main/java/net/minecraftforge/common/network/DimensionMessageHandler.java @@ -21,10 +21,8 @@ package net.minecraftforge.common.network; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; -import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.network.ForgeMessage.DimensionRegisterMessage; -import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -36,9 +34,9 @@ public class DimensionMessageHandler extends SimpleChannelInboundHandler missing; + private final Set keys; + + public RegisterDimensionsEvent(Map missing) + { + this.missing = missing; + this.keys = Collections.unmodifiableSet(this.missing.keySet()); + } + + public Set getMissingNames() + { + return keys; + } + + @Nullable + public SavedEntry getEntry(ResourceLocation key) + { + return missing.get(key); + } +} diff --git a/src/main/java/net/minecraftforge/fluids/UniversalBucket.java b/src/main/java/net/minecraftforge/fluids/UniversalBucket.java index 3529ca2bb..feeec4bf2 100644 --- a/src/main/java/net/minecraftforge/fluids/UniversalBucket.java +++ b/src/main/java/net/minecraftforge/fluids/UniversalBucket.java @@ -40,9 +40,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.event.entity.player.FillBucketEvent; import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; import net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper; -import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.items.ItemHandlerHelper; @@ -50,8 +48,6 @@ import net.minecraftforge.items.ItemHandlerHelper; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import net.minecraft.item.Item.Builder; - /** * A universal bucket that can hold any liquid */ @@ -63,9 +59,9 @@ public class UniversalBucket extends Item private final ItemStack empty; // empty item to return and recognize when filling private final boolean nbtSensitive; - public UniversalBucket(Builder builder) + public UniversalBucket(Properties properties) { - this(builder, Fluid.BUCKET_VOLUME, new ItemStack(Items.BUCKET), false); + this(properties, Fluid.BUCKET_VOLUME, new ItemStack(Items.BUCKET), false); } /** @@ -73,13 +69,13 @@ public class UniversalBucket extends Item * @param empty Item used for filling with the bucket event and returned when emptied * @param nbtSensitive Whether the empty item is NBT sensitive (usually true if empty and full are the same items) */ - public UniversalBucket(Builder builder, int capacity, @Nonnull ItemStack empty, boolean nbtSensitive) + public UniversalBucket(Properties properties, int capacity, @Nonnull ItemStack empty, boolean nbtSensitive) { - super(builder); + super(properties); this.capacity = capacity; this.empty = empty; this.nbtSensitive = nbtSensitive; - + /* TODO move to builder construction this.setMaxStackSize(1); diff --git a/src/main/java/net/minecraftforge/fluids/capability/ItemFluidContainer.java b/src/main/java/net/minecraftforge/fluids/capability/ItemFluidContainer.java index b1b8570b4..8ae53186a 100644 --- a/src/main/java/net/minecraftforge/fluids/capability/ItemFluidContainer.java +++ b/src/main/java/net/minecraftforge/fluids/capability/ItemFluidContainer.java @@ -40,9 +40,9 @@ public class ItemFluidContainer extends Item /** * @param capacity The maximum capacity of this fluid container. */ - public ItemFluidContainer(Item.Builder builder, int capacity) + public ItemFluidContainer(Item.Properties properties, int capacity) { - super(builder); + super(properties); this.capacity = capacity; } diff --git a/src/main/java/net/minecraftforge/fml/client/registry/ClientRegistry.java b/src/main/java/net/minecraftforge/fml/client/registry/ClientRegistry.java index 721d84ef9..8c099a8d8 100644 --- a/src/main/java/net/minecraftforge/fml/client/registry/ClientRegistry.java +++ b/src/main/java/net/minecraftforge/fml/client/registry/ClientRegistry.java @@ -43,7 +43,7 @@ public class ClientRegistry */ public static synchronized void bindTileEntitySpecialRenderer(Class tileEntityClass, TileEntityRenderer specialRenderer) { - TileEntityRendererDispatcher.instance.renderers.put(tileEntityClass, specialRenderer); + TileEntityRendererDispatcher.instance.setSpecialRenderer(tileEntityClass, specialRenderer); specialRenderer.setRendererDispatcher(TileEntityRendererDispatcher.instance); } diff --git a/src/main/java/net/minecraftforge/fml/common/gameevent/PlayerEvent.java b/src/main/java/net/minecraftforge/fml/common/gameevent/PlayerEvent.java index 3b8be7dd9..ffd01558a 100644 --- a/src/main/java/net/minecraftforge/fml/common/gameevent/PlayerEvent.java +++ b/src/main/java/net/minecraftforge/fml/common/gameevent/PlayerEvent.java @@ -23,17 +23,23 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.eventbus.api.Event; import javax.annotation.Nonnull; public class PlayerEvent extends Event { - public final EntityPlayer player; + private final EntityPlayer player; private PlayerEvent(EntityPlayer player) { this.player = player; } + public EntityPlayer getPlayer() + { + return this.player; + } + public static class ItemPickupEvent extends PlayerEvent { /** * Original EntityItem with current remaining stack size @@ -61,23 +67,40 @@ public class PlayerEvent extends Event { public static class ItemCraftedEvent extends PlayerEvent { @Nonnull - public final ItemStack crafting; - public final IInventory craftMatrix; + private final ItemStack crafting; + private final IInventory craftMatrix; public ItemCraftedEvent(EntityPlayer player, @Nonnull ItemStack crafting, IInventory craftMatrix) { super(player); this.crafting = crafting; this.craftMatrix = craftMatrix; } + + @Nonnull + public ItemStack getCrafting() + { + return this.crafting; + } + + public IInventory getInventory() + { + return this.craftMatrix; + } } public static class ItemSmeltedEvent extends PlayerEvent { @Nonnull - public final ItemStack smelting; + private final ItemStack smelting; public ItemSmeltedEvent(EntityPlayer player, @Nonnull ItemStack crafting) { super(player); this.smelting = crafting; } + + @Nonnull + public ItemStack getSmelting() + { + return this.smelting; + } } public static class PlayerLoggedInEvent extends PlayerEvent { @@ -116,13 +139,23 @@ public class PlayerEvent extends Event { } public static class PlayerChangedDimensionEvent extends PlayerEvent { - public final int fromDim; - public final int toDim; - public PlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim) + private final DimensionType fromDim; + private final DimensionType toDim; + public PlayerChangedDimensionEvent(EntityPlayer player, DimensionType fromDim, DimensionType toDim) { super(player); this.fromDim = fromDim; this.toDim = toDim; } + + public DimensionType getFrom() + { + return this.fromDim; + } + + public DimensionType getTo() + { + return this.toDim; + } } } diff --git a/src/main/java/net/minecraftforge/fml/common/registry/VillagerRegistry.java b/src/main/java/net/minecraftforge/fml/common/registry/VillagerRegistry.java index 3a068066d..b008e724c 100644 --- a/src/main/java/net/minecraftforge/fml/common/registry/VillagerRegistry.java +++ b/src/main/java/net/minecraftforge/fml/common/registry/VillagerRegistry.java @@ -129,7 +129,7 @@ public class VillagerRegistry return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, facing, p5); } - RegistryNamespaced REGISTRY = GameData.getWrapper(VillagerProfession.class); + RegistryNamespaced REGISTRY = GameData.getWrapper(VillagerProfession.class); private void register(VillagerProfession prof, int id) { diff --git a/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java b/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java index 11b07633d..6f063cb4c 100644 --- a/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java +++ b/src/main/java/net/minecraftforge/fml/hooks/BasicEventHooks.java @@ -24,6 +24,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.client.model.animation.Animation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.LogicalSide; @@ -43,7 +44,7 @@ public class BasicEventHooks MinecraftForge.EVENT_BUS.post(new InputEvent.KeyInputEvent()); } - public static void firePlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim) + public static void firePlayerChangedDimensionEvent(EntityPlayer player, DimensionType fromDim, DimensionType toDim) { MinecraftForge.EVENT_BUS.post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim)); } diff --git a/src/main/java/net/minecraftforge/fml/network/FMLHandshakeHandler.java b/src/main/java/net/minecraftforge/fml/network/FMLHandshakeHandler.java index 5e255ea6d..1e13149fe 100644 --- a/src/main/java/net/minecraftforge/fml/network/FMLHandshakeHandler.java +++ b/src/main/java/net/minecraftforge/fml/network/FMLHandshakeHandler.java @@ -22,10 +22,9 @@ package net.minecraftforge.fml.network; import io.netty.util.AttributeKey; import net.minecraft.network.NetworkManager; import net.minecraft.network.PacketBuffer; -import net.minecraft.server.network.NetHandlerLoginServer; +import net.minecraft.network.NetHandlerLoginServer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextComponentString; -import net.minecraftforge.fml.Logging; import net.minecraftforge.fml.network.simple.SimpleChannel; import net.minecraftforge.fml.util.ThreeConsumer; import net.minecraftforge.registries.RegistryManager; diff --git a/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java b/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java index 02b90bd59..636b37423 100644 --- a/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java +++ b/src/main/java/net/minecraftforge/fml/network/FMLPlayMessages.java @@ -29,6 +29,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraftforge.fml.ExtensionPoint; import net.minecraftforge.fml.ModList; +import net.minecraft.util.registry.IRegistry; import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData; import java.util.UUID; @@ -50,7 +51,7 @@ public class FMLPlayMessages SpawnEntity(Entity e) { this.entity = e; - this.typeId = EntityType.REGISTRY.getId(e.getType()); + this.typeId = IRegistry.field_212629_r.getId(e.getType()); this.entityId = e.getEntityId(); this.uuid = e.getUniqueID(); this.posX = e.posX; @@ -121,7 +122,7 @@ public class FMLPlayMessages public static void handle(SpawnEntity msg, Supplier ctx) { ctx.get().enqueueWork(() -> { - EntityType type = EntityType.REGISTRY.get(msg.typeId); + EntityType type = IRegistry.field_212629_r.get(msg.typeId); if (type == null) { throw new RuntimeException(String.format("Could not spawn entity (id %d) with unknown type at (%f, %f, %f)", msg.entityId, msg.posX, msg.posY, msg.posZ)); diff --git a/src/main/java/net/minecraftforge/fml/network/NetworkHooks.java b/src/main/java/net/minecraftforge/fml/network/NetworkHooks.java index 494ebd4de..bc6685e0c 100644 --- a/src/main/java/net/minecraftforge/fml/network/NetworkHooks.java +++ b/src/main/java/net/minecraftforge/fml/network/NetworkHooks.java @@ -28,7 +28,7 @@ import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.PacketBuffer; import net.minecraft.network.handshake.client.CPacketHandshake; -import net.minecraft.server.network.NetHandlerLoginServer; +import net.minecraft.network.NetHandlerLoginServer; import net.minecraft.util.ResourceLocation; import net.minecraft.world.IInteractionObject; import net.minecraftforge.common.MinecraftForge; diff --git a/src/main/java/net/minecraftforge/logging/ModelLoaderErrorMessage.java b/src/main/java/net/minecraftforge/logging/ModelLoaderErrorMessage.java index e0bb22e08..25e5a4084 100644 --- a/src/main/java/net/minecraftforge/logging/ModelLoaderErrorMessage.java +++ b/src/main/java/net/minecraftforge/logging/ModelLoaderErrorMessage.java @@ -24,7 +24,7 @@ import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.BlockModelShapes; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.registries.ForgeRegistries; diff --git a/src/main/java/net/minecraftforge/registries/ClearableRegistry.java b/src/main/java/net/minecraftforge/registries/ClearableRegistry.java new file mode 100644 index 000000000..ab9f9613a --- /dev/null +++ b/src/main/java/net/minecraftforge/registries/ClearableRegistry.java @@ -0,0 +1,175 @@ +/* + * Minecraft Forge + * Copyright (c) 2016-2019. + * + * 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.registries; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Set; + +import javax.annotation.Nullable; + +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; + +import net.minecraft.util.IntIdentityHashBiMap; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.IRegistry; + +/** + * A IRegistry implementation that allows for removing of objects. This is a internal helper + * class used by Forge for managing things that reset during Server initialization. + */ +public class ClearableRegistry implements IRegistry +{ + private static final Logger LOGGER = LogManager.getLogger(); + private static final Marker REGISTRY = MarkerManager.getMarker("REGISTRY"); + + private final IntIdentityHashBiMap ids = new IntIdentityHashBiMap<>(256); + private final BiMap map = HashBiMap.create(); + private final Set keys = Collections.unmodifiableSet(map.keySet()); + private List values = new ArrayList<>(); + private final ResourceLocation name; + private int nextId = 0; + + public ClearableRegistry(ResourceLocation name) + { + this.name = name; + } + + @Override + @Nullable + public ResourceLocation getKey(V value) + { + return map.inverse().get(value); + } + + @Override + public V get(ResourceLocation key) + { + throw new UnsupportedOperationException("No default value"); + } + + @Override + public ResourceLocation func_212609_b() + { + throw new UnsupportedOperationException("No default key"); + } + + @Override + @Nullable + public int getId(V value) + { + return ids.getId(value); + } + + @Override + @Nullable + public V get(int id) + { + return ids.get(id); + } + + @Override + public Iterator iterator() + { + return ids.iterator(); + } + + @Override + @Nullable + public V func_212608_b(ResourceLocation key) + { + return map.get(key); + } + + @Override + public void register(int id, ResourceLocation key, V value) + { + Validate.isTrue(id >= 0, "Invalid ID, can not be < 0"); + Validate.notNull(key); + Validate.notNull(value); + + V old = map.get(key); + if (old != null) + { + LOGGER.debug(REGISTRY, "{}: Adding suplicate key '{}' to registry. Old: {} New: {}", name, key, old, value); + values.remove(old); + } + + map.put(key, value); + ids.put(value, id); + values.add(value); + if (nextId <= id) + nextId = id + 1; + } + + @Override + public void put(ResourceLocation key, V value) + { + register(nextId, key, value); + } + + @Override + public Set getKeys() + { + return keys; + } + + @Override + public boolean isEmpty() + { + return map.isEmpty(); + } + + @Override + @Nullable + public V getRandom(Random random) + { + return values.isEmpty() ? null : values.get(random.nextInt(values.size())); + } + + @Override + public boolean func_212607_c(ResourceLocation key) + { + return map.containsKey(key); + } + + public void clear() + { + LOGGER.debug(REGISTRY, "{}: Clearing registry", name); + map.clear(); + values.clear(); + ids.clear(); + nextId = 0; + } + + public int getNextId() + { + return nextId; + } +} diff --git a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java index 279bba4f3..eedcb7ceb 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java +++ b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java @@ -30,6 +30,7 @@ import net.minecraft.potion.PotionType; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.SoundEvent; import net.minecraft.world.biome.Biome; +import net.minecraftforge.common.ModDimension; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.VillagerRegistry; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; @@ -52,8 +53,9 @@ public class ForgeRegistries public static final IForgeRegistry POTION_TYPES = RegistryManager.ACTIVE.getRegistry(PotionType.class); public static final IForgeRegistry ENCHANTMENTS = RegistryManager.ACTIVE.getRegistry(Enchantment.class); public static final IForgeRegistry VILLAGER_PROFESSIONS = RegistryManager.ACTIVE.getRegistry(VillagerProfession.class); - public static final IForgeRegistry> ENTITIES = (IForgeRegistry)RegistryManager.ACTIVE.getRegistry(EntityType.class); - public static final IForgeRegistry> TILE_ENTITIES = (IForgeRegistry)RegistryManager.ACTIVE.getRegistry(TileEntityType.class); + public static final IForgeRegistry> ENTITIES = RegistryManager.ACTIVE.getRegistry(EntityType.class); + public static final IForgeRegistry> TILE_ENTITIES = RegistryManager.ACTIVE.getRegistry(TileEntityType.class); + public static final IForgeRegistry MOD_DIMENSIONS = RegistryManager.ACTIVE.getRegistry(ModDimension.class); /** * This function is just to make sure static inializers in other classes have run and setup their registries before we query them. */ diff --git a/src/main/java/net/minecraftforge/registries/ForgeRegistry.java b/src/main/java/net/minecraftforge/registries/ForgeRegistry.java index d259c3b66..c78fab53f 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeRegistry.java +++ b/src/main/java/net/minecraftforge/registries/ForgeRegistry.java @@ -28,6 +28,8 @@ import java.util.Map; import java.util.Map.Entry; import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import net.minecraftforge.fml.loading.AdvancedLogMessageAdapter; @@ -272,6 +274,12 @@ public class ForgeRegistry> implements IForgeRe Validate.notNull(this.defaultValue, "Missing default of ForgeRegistry: " + this.defaultKey + " Type: " + this.superType); } + @Nullable + public ResourceLocation getDefaultKey() + { + return this.defaultKey; + } + ForgeRegistry copy(RegistryManager stage) { return new ForgeRegistry<>(stage, name, builder); @@ -358,7 +366,7 @@ public class ForgeRegistry> implements IForgeRe return idToUse; } - private V getRaw(ResourceLocation key) + public V getRaw(ResourceLocation key) { V ret = this.names.get(key); key = this.aliases.get(key); diff --git a/src/main/java/net/minecraftforge/registries/GameData.java b/src/main/java/net/minecraftforge/registries/GameData.java index 7cdbd6b94..880eafb4f 100644 --- a/src/main/java/net/minecraftforge/registries/GameData.java +++ b/src/main/java/net/minecraftforge/registries/GameData.java @@ -39,6 +39,7 @@ import net.minecraft.util.registry.RegistryNamespaced; import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey; import net.minecraft.world.biome.Biome; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.ModDimension; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.RegistryEvent.MissingMappings; import net.minecraftforge.fml.LifecycleEventProvider; @@ -84,15 +85,16 @@ public class GameData public static final ResourceLocation ENTITIES = new ResourceLocation("minecraft:entities"); public static final ResourceLocation TILEENTITIES = new ResourceLocation("minecraft:tileentities"); public static final ResourceLocation PROFESSIONS = new ResourceLocation("minecraft:villagerprofessions"); + public static final ResourceLocation MODDIMENSIONS = new ResourceLocation("forge:moddimensions"); + private static final int MAX_REGISTRY_SIZE = Integer.MAX_VALUE >> 5; private static final int MAX_BLOCK_ID = 4095; - private static final int MIN_ITEM_ID = MAX_BLOCK_ID + 1; private static final int MAX_ITEM_ID = 31999; private static final int MAX_POTION_ID = 255; // SPacketEntityEffect sends bytes, we can only use 255 private static final int MAX_BIOME_ID = 255; // Maximum number in a byte in the chunk private static final int MAX_SOUND_ID = Integer.MAX_VALUE >> 5; // Varint (SPacketSoundEffect) - private static final int MAX_POTIONTYPE_ID = Integer.MAX_VALUE >> 5; // Int (SPacketEffect) + private static final int MAX_POTIONTYPE_ID = MAX_REGISTRY_SIZE; // Int (SPacketEffect) private static final int MAX_ENCHANTMENT_ID = Short.MAX_VALUE - 1; // Short - serialized as a short in ItemStack NBTs. - private static final int MAX_ENTITY_ID = Integer.MAX_VALUE >> 5; // Varint (SPacketSpawnMob) + private static final int MAX_ENTITY_ID = MAX_REGISTRY_SIZE; // Varint (SPacketSpawnMob) private static final int MAX_TILE_ENTITY_ID = Integer.MAX_VALUE; //Doesnt seem to be serialized anywhere, so no max. private static final int MAX_PROFESSION_ID = 1024; //TODO: Is this serialized anywhere anymore? @@ -118,7 +120,7 @@ public class GameData return; hasInit = true; makeRegistry(BLOCKS, Block.class, MAX_BLOCK_ID, new ResourceLocation("air")).addCallback(BlockCallbacks.INSTANCE).create(); - makeRegistry(ITEMS, Item.class, MIN_ITEM_ID, MAX_ITEM_ID).addCallback(ItemCallbacks.INSTANCE).create(); + makeRegistry(ITEMS, Item.class, MAX_ITEM_ID).addCallback(ItemCallbacks.INSTANCE).create(); makeRegistry(POTIONS, Potion.class, MAX_POTION_ID).create(); makeRegistry(BIOMES, Biome.class, MAX_BIOME_ID).create(); makeRegistry(SOUNDEVENTS, SoundEvent.class, MAX_SOUND_ID).create(); @@ -128,12 +130,9 @@ public class GameData // TODO do we need the callback and the static field anymore? makeRegistry(ENTITIES, EntityType.class, MAX_ENTITY_ID).create(); makeRegistry(TILEENTITIES, TileEntityType.class, MAX_TILE_ENTITY_ID).disableSaving().create(); + makeRegistry(MODDIMENSIONS, ModDimension.class, MAX_REGISTRY_SIZE).disableSaving().create(); } - private static > RegistryBuilder makeRegistry(ResourceLocation name, Class type, int min, int max) - { - return new RegistryBuilder().setName(name).setType(type).setIDRange(min, max).addCallback(new NamespacedWrapper.Factory()); - } private static > RegistryBuilder makeRegistry(ResourceLocation name, Class type, int max) { return new RegistryBuilder().setName(name).setType(type).setMaxID(max).addCallback(new NamespacedWrapper.Factory()); @@ -143,22 +142,22 @@ public class GameData return new RegistryBuilder().setName(name).setType(type).setMaxID(max).addCallback(new NamespacedDefaultedWrapper.Factory()).setDefaultKey(_default); } - public static > RegistryNamespacedDefaultedByKey getWrapperDefaulted(Class cls) + public static > RegistryNamespacedDefaultedByKey getWrapperDefaulted(Class cls) { IForgeRegistry reg = RegistryManager.ACTIVE.getRegistry(cls); Validate.notNull(reg, "Attempted to get vanilla wrapper for unknown registry: " + cls.toString()); @SuppressWarnings("unchecked") - RegistryNamespacedDefaultedByKey ret = reg.getSlaveMap(NamespacedDefaultedWrapper.Factory.ID, NamespacedDefaultedWrapper.class); + RegistryNamespacedDefaultedByKey ret = reg.getSlaveMap(NamespacedDefaultedWrapper.Factory.ID, NamespacedDefaultedWrapper.class); Validate.notNull(ret, "Attempted to get vanilla wrapper for registry created incorrectly: " + cls.toString()); return ret; } - public static > RegistryNamespaced getWrapper(Class cls) + public static > RegistryNamespaced getWrapper(Class cls) { IForgeRegistry reg = RegistryManager.ACTIVE.getRegistry(cls); Validate.notNull(reg, "Attempted to get vanilla wrapper for unknown registry: " + cls.toString()); @SuppressWarnings("unchecked") - RegistryNamespaced ret = reg.getSlaveMap(NamespacedWrapper.Factory.ID, NamespacedWrapper.class); + RegistryNamespaced ret = reg.getSlaveMap(NamespacedWrapper.Factory.ID, NamespacedWrapper.class); Validate.notNull(ret, "Attempted to get vanilla wrapper for registry created incorrectly: " + cls.toString()); return ret; } @@ -382,7 +381,7 @@ public class GameData @Override public Block createDummy(ResourceLocation key) { - Block ret = new BlockDummyAir(Block.Builder.create(Material.AIR)); + Block ret = new BlockDummyAir(Block.Properties.create(Material.AIR)); GameData.forceRegistryName(ret, key); return ret; } @@ -404,9 +403,9 @@ public class GameData private static class BlockDummyAir extends BlockAir //A named class so DummyBlockReplacementTest can detect if its a dummy { - private BlockDummyAir(Block.Builder builder) + private BlockDummyAir(Block.Properties properties) { - super(builder); + super(properties); } @Override diff --git a/src/main/java/net/minecraftforge/registries/IForgeRegistry.java b/src/main/java/net/minecraftforge/registries/IForgeRegistry.java index 9e00b8486..fd6e0a1af 100644 --- a/src/main/java/net/minecraftforge/registries/IForgeRegistry.java +++ b/src/main/java/net/minecraftforge/registries/IForgeRegistry.java @@ -47,6 +47,7 @@ public interface IForgeRegistry> extends Iterab @Nullable V getValue(ResourceLocation key); @Nullable ResourceLocation getKey(V value); + @Nullable ResourceLocation getDefaultKey(); @Nonnull Set getKeys(); @Nonnull Collection getValues(); diff --git a/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java b/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java index d62510f4f..4a664cd16 100644 --- a/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java +++ b/src/main/java/net/minecraftforge/registries/NamespacedDefaultedWrapper.java @@ -33,7 +33,7 @@ import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -class NamespacedDefaultedWrapper> extends RegistryNamespacedDefaultedByKey implements ILockableRegistry +class NamespacedDefaultedWrapper> extends RegistryNamespacedDefaultedByKey implements ILockableRegistry { private static final Logger LOGGER = LogManager.getLogger(); private boolean locked = false; @@ -66,18 +66,19 @@ class NamespacedDefaultedWrapper> extends Regis register(-1, key, value); } + // Reading Functions @Override - public void validateKey() + @Nullable + public V func_212608_b(@Nullable ResourceLocation name) { - this.delegate.validateKey(); + return this.delegate.getRaw(name); //get without default } - // Reading Functions @Override @Nullable public V get(@Nullable ResourceLocation name) { - return this.delegate.getValue(name); + return this.delegate.getValue(name); //getOrDefault } @Override @@ -88,7 +89,7 @@ class NamespacedDefaultedWrapper> extends Regis } @Override - public boolean containsKey(ResourceLocation key) + public boolean func_212607_c(ResourceLocation key) { return this.delegate.containsKey(key); } @@ -126,6 +127,12 @@ class NamespacedDefaultedWrapper> extends Regis return values.stream().skip(random.nextInt(values.size())).findFirst().orElse(null); } + @Override + public ResourceLocation func_212609_b() + { + return this.delegate.getDefaultKey(); + } + //internal @Override public void lock(){ this.locked = true; } diff --git a/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java b/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java index 6a3b3de3c..f27cfd09a 100644 --- a/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java +++ b/src/main/java/net/minecraftforge/registries/NamespacedWrapper.java @@ -33,7 +33,7 @@ import net.minecraft.util.registry.RegistryNamespaced; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -class NamespacedWrapper> extends RegistryNamespaced implements ILockableRegistry +class NamespacedWrapper> extends RegistryNamespaced implements ILockableRegistry { private static final Logger LOGGER = LogManager.getLogger(); private boolean locked = false; @@ -70,9 +70,9 @@ class NamespacedWrapper> extends RegistryNamesp // Reading Functions @Override @Nullable - public V get(@Nullable ResourceLocation name) + public V func_212608_b(@Nullable ResourceLocation name) { - return this.delegate.getValue(name); + return this.delegate.getRaw(name); //get without default } @Override @@ -83,7 +83,7 @@ class NamespacedWrapper> extends RegistryNamesp } @Override - public boolean containsKey(ResourceLocation key) + public boolean func_212607_c(ResourceLocation key) { return this.delegate.containsKey(key); } diff --git a/src/main/java/net/minecraftforge/server/command/ChunkGenWorker.java b/src/main/java/net/minecraftforge/server/command/ChunkGenWorker.java index fd3b1ca68..81e9330a6 100644 --- a/src/main/java/net/minecraftforge/server/command/ChunkGenWorker.java +++ b/src/main/java/net/minecraftforge/server/command/ChunkGenWorker.java @@ -31,6 +31,7 @@ import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.WorldServer; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.storage.AnvilChunkLoader; +import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.storage.SessionLockException; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.WorldWorkerManager.IWorker; @@ -40,7 +41,7 @@ public class ChunkGenWorker implements IWorker private final CommandSource listener; protected final BlockPos start; protected final int total; - private final int dim; + private final DimensionType dim; private final Queue queue; private final int notificationFrequency; private int lastNotification = 0; @@ -48,7 +49,7 @@ public class ChunkGenWorker implements IWorker private int genned = 0; private Boolean keepingLoaded; - public ChunkGenWorker(CommandSource listener, BlockPos start, int total, int dim, int interval) + public ChunkGenWorker(CommandSource listener, BlockPos start, int total, DimensionType dim, int interval) { this.listener = listener; this.start = start; @@ -99,11 +100,10 @@ public class ChunkGenWorker implements IWorker @Override public boolean doWork() { - WorldServer world = DimensionManager.getWorld(dim); + WorldServer world = DimensionManager.getWorld(listener.getServer(), dim, false, false); if (world == null) { - DimensionManager.initDimension(dim); - world = DimensionManager.getWorld(dim); + world = DimensionManager.initWorld(listener.getServer(), dim); if (world == null) { listener.sendFeedback(new TextComponentTranslation("commands.forge.gen.dim_fail", dim), true); @@ -131,7 +131,7 @@ public class ChunkGenWorker implements IWorker // While we work we don't want to cause world load spam so pause unloading the world. if (keepingLoaded == null) { - keepingLoaded = DimensionManager.keepDimensionLoaded(dim, true); + keepingLoaded = DimensionManager.keepLoaded(dim, true); } if (++lastNotification >= notificationFrequency || lastNotifcationTime < System.currentTimeMillis() - 60*1000) @@ -180,9 +180,9 @@ public class ChunkGenWorker implements IWorker if (queue.size() == 0) { listener.sendFeedback(new TextComponentTranslation("commands.forge.gen.complete", genned, total, dim), true); - if (keepingLoaded != null && keepingLoaded) + if (keepingLoaded != null && !keepingLoaded) { - DimensionManager.keepDimensionLoaded(dim, false); + DimensionManager.keepLoaded(dim, false); } return false; } diff --git a/src/main/java/net/minecraftforge/server/command/CommandDimensions.java b/src/main/java/net/minecraftforge/server/command/CommandDimensions.java index 7073d7412..1d39f8de8 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandDimensions.java +++ b/src/main/java/net/minecraftforge/server/command/CommandDimensions.java @@ -19,15 +19,16 @@ package net.minecraftforge.server.command; -import it.unimi.dsi.fastutil.ints.IntSortedSet; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.dimension.DimensionType; -import net.minecraftforge.common.DimensionManager; - +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import com.mojang.brigadier.builder.ArgumentBuilder; @@ -39,10 +40,15 @@ public class CommandDimensions .requires(cs->cs.hasPermissionLevel(0)) //permission .executes(ctx -> { ctx.getSource().sendFeedback(new TextComponentTranslation("commands.forge.dimensions.list"), true); - for (Map.Entry entry : DimensionManager.getRegisteredDimensions().entrySet()) - { - ctx.getSource().sendFeedback(new TextComponentString(entry.getKey().getName() + ": " + entry.getValue()), true); + Map> types = new HashMap<>(); + for (DimensionType dim : DimensionType.func_212681_b()) { + String key = dim.getModType() == null ? "Vanilla" : dim.getModType().getRegistryName().toString(); + types.computeIfAbsent(key, k -> new ArrayList<>()).add(DimensionType.func_212678_a(dim).toString()); } + + types.keySet().stream().sorted().forEach(key -> { + ctx.getSource().sendFeedback(new TextComponentString(key + ": " + types.get(key).stream().sorted().collect(Collectors.joining(", "))), true); + }); return 0; }); } diff --git a/src/main/java/net/minecraftforge/server/command/CommandEntity.java b/src/main/java/net/minecraftforge/server/command/CommandEntity.java index 7804dc4d1..59a42e3de 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandEntity.java +++ b/src/main/java/net/minecraftforge/server/command/CommandEntity.java @@ -19,9 +19,7 @@ package net.minecraftforge.server.command; -import javax.annotation.Nullable; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; @@ -29,27 +27,23 @@ import java.util.Set; import java.util.stream.Collectors; import com.google.common.collect.Maps; -import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; -import net.minecraft.command.CommandException; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.command.ISuggestionProvider; -import net.minecraft.command.arguments.BlockPosArgument; +import net.minecraft.command.arguments.DimensionArgument; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.server.MinecraftServer; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.WorldServer; +import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.registries.ForgeRegistries; @@ -75,16 +69,15 @@ class CommandEntity .requires(cs->cs.hasPermissionLevel(2)) //permission .then(Commands.argument("filter", StringArgumentType.string()) .suggests((ctx, builder) -> ISuggestionProvider.suggest(ForgeRegistries.ENTITIES.getKeys().stream().map(id -> id.toString()), builder)) - .then(Commands.argument("dim", IntegerArgumentType.integer()) - .suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder)) - .executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), IntegerArgumentType.getInteger(ctx, "dim"))) + .then(Commands.argument("dim", DimensionArgument.func_212595_a()) + .executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), DimensionArgument.func_212592_a(ctx, "dim"))) ) - .executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), ctx.getSource().getWorld().dimension.getId())) + .executes(ctx -> execute(ctx.getSource(), StringArgumentType.getString(ctx, "filter"), ctx.getSource().getWorld().dimension.getType())) ) - .executes(ctx -> execute(ctx.getSource(), "*", ctx.getSource().getWorld().dimension.getId())); + .executes(ctx -> execute(ctx.getSource(), "*", ctx.getSource().getWorld().dimension.getType())); } - private static int execute(CommandSource sender, String filter, int dim) throws CommandSyntaxException + private static int execute(CommandSource sender, String filter, DimensionType dim) throws CommandSyntaxException { final String cleanFilter = filter.replace("?", ".?").replace("*", ".*?"); @@ -93,7 +86,7 @@ class CommandEntity if (names.isEmpty()) throw INVALID_FILTER.create(); - WorldServer world = DimensionManager.getWorld(dim); + WorldServer world = DimensionManager.getWorld(sender.getServer(), dim, false, false); if (world == null) throw INVALID_DIMENSION.create(dim); diff --git a/src/main/java/net/minecraftforge/server/command/CommandGenerate.java b/src/main/java/net/minecraftforge/server/command/CommandGenerate.java index 46b41aeca..d9859f541 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandGenerate.java +++ b/src/main/java/net/minecraftforge/server/command/CommandGenerate.java @@ -36,6 +36,7 @@ import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.command.ISuggestionProvider; import net.minecraft.command.arguments.BlockPosArgument; +import net.minecraft.command.arguments.DimensionArgument; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentString; @@ -52,14 +53,13 @@ class CommandGenerate .requires(cs->cs.hasPermissionLevel(4)) //permission .then(Commands.argument("pos", BlockPosArgument.blockPos()) .then(Commands.argument("count", IntegerArgumentType.integer(1)) - .then(Commands.argument("dim", IntegerArgumentType.integer()) - .suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder)) + .then(Commands.argument("dim", DimensionArgument.func_212595_a()) .then(Commands.argument("interval", IntegerArgumentType.integer()) - .executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), getInt(ctx, "dim"), getInt(ctx, "interval"))) + .executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.func_212592_a(ctx, "dim"), getInt(ctx, "interval"))) ) - .executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), getInt(ctx, "dim"), -1)) + .executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), DimensionArgument.func_212592_a(ctx, "dim"), -1)) ) - .executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), ctx.getSource().getWorld().dimension.getId(), -1)) + .executes(ctx -> execute(ctx.getSource(), BlockPosArgument.getBlockPos(ctx, "pos"), getInt(ctx, "count"), ctx.getSource().getWorld().dimension.getType(), -1)) ) ); } @@ -69,14 +69,14 @@ class CommandGenerate return IntegerArgumentType.getInteger(ctx, name); } - private static int execute(CommandSource source, BlockPos pos, int count, int dim, int interval) throws CommandException + private static int execute(CommandSource source, BlockPos pos, int count, DimensionType dim, int interval) throws CommandException { BlockPos chunkpos = new BlockPos(pos.getX() >> 4, 0, pos.getZ() >> 4); ChunkGenWorker worker = new ChunkGenWorker(source, chunkpos, count, dim, interval); source.sendFeedback(worker.getStartMessage(source), true); WorldWorkerManager.addWorker(worker); - + return 0; } } diff --git a/src/main/java/net/minecraftforge/server/command/CommandSetDimension.java b/src/main/java/net/minecraftforge/server/command/CommandSetDimension.java index 1535cd8d7..a5990216f 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandSetDimension.java +++ b/src/main/java/net/minecraftforge/server/command/CommandSetDimension.java @@ -19,36 +19,24 @@ package net.minecraftforge.server.command; -import net.minecraft.command.CommandException; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; -import net.minecraft.command.ISuggestionProvider; import net.minecraft.command.arguments.BlockPosArgument; +import net.minecraft.command.arguments.DimensionArgument; import net.minecraft.command.arguments.EntityArgument; import net.minecraft.entity.Entity; -import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; import net.minecraft.world.dimension.DimensionType; -import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.ITeleporter; -import javax.annotation.Nullable; - -import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; -import it.unimi.dsi.fastutil.ints.IntSortedSet; - import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; public class CommandSetDimension { @@ -59,24 +47,23 @@ public class CommandSetDimension return Commands.literal("setdimension") .requires(cs->cs.hasPermissionLevel(2)) //permission .then(Commands.argument("targets", EntityArgument.multipleEntities()) - .then(Commands.argument("dim", IntegerArgumentType.integer()) - .suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder)) + .then(Commands.argument("dim", DimensionArgument.func_212595_a()) .then(Commands.argument("pos", BlockPosArgument.blockPos()) - .executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), IntegerArgumentType.getInteger(ctx, "dim"), BlockPosArgument.getBlockPos(ctx, "pos"))) + .executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.func_212592_a(ctx, "dim"), BlockPosArgument.getBlockPos(ctx, "pos"))) ) - .executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), IntegerArgumentType.getInteger(ctx, "dim"), new BlockPos(ctx.getSource().getPos()))) + .executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntitiesAllowingNone(ctx, "targets"), DimensionArgument.func_212592_a(ctx, "dim"), new BlockPos(ctx.getSource().getPos()))) ) ); } - private static int execute(CommandSource sender, Collection entities, int dim, BlockPos pos) throws CommandSyntaxException + private static int execute(CommandSource sender, Collection entities, DimensionType dim, BlockPos pos) throws CommandSyntaxException { entities.removeIf(CommandSetDimension::checkEntity); if (entities.isEmpty()) throw NO_ENTITIES.create(); - if (!DimensionManager.isDimensionRegistered(dim)) - throw INVALID_DIMENSION.create(dim); + //if (!DimensionManager.isDimensionRegistered(dim)) + // throw INVALID_DIMENSION.create(dim); final ITeleporter teleporter = new CommandTeleporter(pos); entities.stream().filter(e -> e.dimension == dim).forEach(e -> sender.sendFeedback(new TextComponentTranslation("commands.forge.setdim.invalid.nochange", e.getDisplayName(), dim), true)); diff --git a/src/main/java/net/minecraftforge/server/command/CommandTps.java b/src/main/java/net/minecraftforge/server/command/CommandTps.java index 906a530c0..377cdaf46 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandTps.java +++ b/src/main/java/net/minecraftforge/server/command/CommandTps.java @@ -21,33 +21,31 @@ package net.minecraftforge.server.command; import java.text.DecimalFormat; import java.util.stream.Collectors; +import java.util.stream.StreamSupport; -import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; -import net.minecraft.command.ISuggestionProvider; +import net.minecraft.command.arguments.DimensionArgument; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.dimension.DimensionType; -import net.minecraftforge.common.DimensionManager; class CommandTps { - private static final DynamicCommandExceptionType INVALID_DIMENSION = new DynamicCommandExceptionType(dim -> new TextComponentTranslation("commands.forge.tps.invalid", dim, DimensionManager.getIDStream().sorted().map(id -> id.toString()).collect(Collectors.joining(", ")))); + private static final DynamicCommandExceptionType INVALID_DIMENSION = new DynamicCommandExceptionType(dim -> new TextComponentTranslation("commands.forge.tps.invalid", dim, StreamSupport.stream(DimensionType.func_212681_b().spliterator(), false).map(d -> DimensionType.func_212678_a(d).toString()).sorted().collect(Collectors.joining(", ")))); private static final DecimalFormat TIME_FORMATTER = new DecimalFormat("########0.000"); static ArgumentBuilder register() { return Commands.literal("tps") .requires(cs->cs.hasPermissionLevel(0)) //permission - .then(Commands.argument("dim", IntegerArgumentType.integer()) - .suggests((ctx, builder) -> ISuggestionProvider.suggest(DimensionManager.getIDStream().sorted().map(id -> id.toString()), builder)) - .executes(ctx -> sendTime(ctx.getSource(), IntegerArgumentType.getInteger(ctx, "dim"))) + .then(Commands.argument("dim", DimensionArgument.func_212595_a()) + .executes(ctx -> sendTime(ctx.getSource(), DimensionArgument.func_212592_a(ctx, "dim"))) ) .executes(ctx -> { - for (Integer dim : (Iterable)DimensionManager.getIDStream().sorted()::iterator) + for (DimensionType dim : DimensionType.func_212681_b()) sendTime(ctx.getSource(), dim); double meanTickTime = mean(ctx.getSource().getServer().tickTimeArray) * 1.0E-6D; @@ -59,26 +57,16 @@ class CommandTps ); } - private static long[] getTimes(int dim) + private static int sendTime(CommandSource cs, DimensionType dim) throws CommandSyntaxException { - //TODO: Implement, needs patch. - return null; - } - - private static int sendTime(CommandSource cs, int dim) throws CommandSyntaxException - { - long[] times = getTimes(dim); + long[] times = cs.getServer().getTickTime(dim); if (times == null) - throw INVALID_DIMENSION.create(dim); + throw INVALID_DIMENSION.create(DimensionType.func_212678_a(dim)); double worldTickTime = mean(times) * 1.0E-6D; double worldTPS = Math.min(1000.0 / worldTickTime, 20); - DimensionType type = DimensionManager.getProviderType(dim); - if (type == null) - cs.sendFeedback(new TextComponentTranslation("commands.forge.tps.summary.basic", dim, TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), true); - else - cs.sendFeedback(new TextComponentTranslation("commands.forge.tps.summary.named", dim, type.getName(), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), true); + cs.sendFeedback(new TextComponentTranslation("commands.forge.tps.summary.named", dim.getId(), DimensionType.func_212678_a(dim), TIME_FORMATTER.format(worldTickTime), TIME_FORMATTER.format(worldTPS)), true); return 1; } diff --git a/src/main/java/net/minecraftforge/server/command/CommandTrack.java b/src/main/java/net/minecraftforge/server/command/CommandTrack.java index acfbb3643..e45073e26 100644 --- a/src/main/java/net/minecraftforge/server/command/CommandTrack.java +++ b/src/main/java/net/minecraftforge/server/command/CommandTrack.java @@ -44,6 +44,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.registry.IRegistry; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.dimension.DimensionType; @@ -154,21 +155,6 @@ class CommandTrack } return 0; } - - /** - * Translates a world dimension ID into a name - * - * @param dimId The dimension ID - * @return The name of the dimension - */ - protected static String getWorldName(int dimId) - { - DimensionType type = DimensionManager.getProviderType(dimId); - if (type == null) - return "Dim " + dimId; - else - return type.getName(); - } } private static class TrackResultsEntity @@ -185,7 +171,7 @@ class CommandTrack double averageTimings = data.getAverageTimings(); String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "�s" : "ms"); - return new TextComponentTranslation("commands.forge.tracking.timing_entry", entity.getType().getRegistryName(), TrackResults.getWorldName(entity.world.dimension.getId()), pos.getX(), pos.getY(), pos.getZ(), tickTime); + return new TextComponentTranslation("commands.forge.tracking.timing_entry", entity.getType().getRegistryName(), DimensionType.func_212678_a(entity.world.dimension.getType()), pos.getX(), pos.getY(), pos.getZ(), tickTime); }) ); } @@ -205,7 +191,7 @@ class CommandTrack double averageTimings = data.getAverageTimings(); String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "�s" : "ms"); - return new TextComponentTranslation("commands.forge.tracking.timing_entry", te.getType().getRegistryName(), TrackResults.getWorldName(te.getWorld().dimension.getId()), pos.getX(), pos.getY(), pos.getZ(), tickTime); + return new TextComponentTranslation("commands.forge.tracking.timing_entry", te.getType().getRegistryName(), DimensionType.func_212678_a(te.getWorld().dimension.getType()), pos.getX(), pos.getY(), pos.getZ(), tickTime); }) ); } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 50323554e..45a200bf7 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -76,6 +76,7 @@ protected net.minecraft.client.gui.GuiIngame * protected net.minecraft.client.gui.GuiIngame func_194798_c(F)V protected net.minecraft.client.gui.GuiIngame func_194800_d(F)V protected net.minecraft.client.gui.GuiIngame func_194805_e(F)V +protected net.minecraft.client.gui.GuiIngame func_212303_b(Lnet/minecraft/entity/Entity;)V protected net.minecraft.client.gui.GuiIngame func_194808_p()V protected net.minecraft.client.gui.GuiIngame func_194802_a(Lnet/minecraft/scoreboard/ScoreObjective;)V # ItemStack @@ -116,60 +117,56 @@ protected net.minecraft.block.state.BlockStateContainer$StateImplementation ()V +protected net.minecraft.client.renderer.model.ItemOverrideList ()V # EnumFacing public net.minecraft.util.EnumFacing field_82609_l # VALUES public net.minecraft.util.EnumFacing field_176754_o # HORIZONTALS public net.minecraft.client.renderer.BufferBuilder func_78909_a(I)I # getColorIndex public net.minecraft.client.renderer.BufferBuilder func_178972_a(IIII)V # putColorRGB -- Add A? -# ModelBlock Constructor -#public net.minecraft.client.renderer.block.model.ModelBlock (Lnet/minecraft/util/ResourceLocation;Ljava/util/List;Ljava/util/Map;ZZLnet/minecraft/client/renderer/block/model/ItemCameraTransforms;)V -# RenderLivingEntity -#public net.minecraft.client.renderer.entity.RenderLivingBase func_177094_a(Lnet/minecraft/client/renderer/entity/layers/LayerRenderer;)Z # addLayer # S00PacketServerInfo public net.minecraft.network.status.server.SPacketServerInfo field_149297_a # GSON @@ -179,20 +176,13 @@ public net.minecraft.resources.FallbackResourceManager field_199023_a # resource public net.minecraft.resources.AbstractResourcePack field_195771_a # file #Main FML Access Transformer configuration file -# EntityList addMappings -#public net.minecraft.entity.EntityList func_75618_a(Ljava/lang/Class;Ljava/lang/String;I)V -#public net.minecraft.entity.EntityList func_75614_a(Ljava/lang/Class;Ljava/lang/String;III)V -#public net.minecraft.entity.EntityList field_75625_b #nameToClassMap -#public net.minecraft.entity.EntityList field_75626_c #classToNameMap -#public net.minecraft.entity.EntityList field_75623_d #idToClassMap -## RenderManager +# RenderManager public net.minecraft.client.renderer.entity.RenderManager field_78729_o #renderers -## TileEntityRendererDispatcher -public net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher field_147559_m +# TileEntityRendererDispatcher public net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher field_147557_n # fontRenderer - needed for rendering text in TESR items before entering world -## EntityRenderer -public net.minecraft.client.renderer.EntityRenderer func_175069_a(Lnet/minecraft/util/ResourceLocation;)V #loadShader -## WeightedRandomItem +# GameRenderer +public net.minecraft.client.renderer.GameRenderer func_175069_a(Lnet/minecraft/util/ResourceLocation;)V #loadShader +# WeightedRandomItem public net.minecraft.util.WeightedRandom$Item field_76292_a #probability # EntityPlayer public net.minecraft.entity.player.EntityPlayer func_184816_a(Lnet/minecraft/entity/item/EntityItem;)Lnet/minecraft/item/ItemStack; # dropItemAndGetStack @@ -200,15 +190,15 @@ protected net.minecraft.entity.player.EntityPlayer field_71077_c # spawnPos protected net.minecraft.entity.player.EntityPlayer field_82248_d # spawnForced # EntityPlayerSP public net.minecraft.client.entity.EntityPlayerSP func_184816_a(Lnet/minecraft/entity/item/EntityItem;)Lnet/minecraft/item/ItemStack; # dropItemAndGetStack -## EntityPlayerMP getNextWindowId +# EntityPlayerMP getNextWindowId public net.minecraft.entity.player.EntityPlayerMP func_71117_bO()V public net.minecraft.entity.player.EntityPlayerMP field_71139_cq -## EntityAITaskEntry +# EntityAITaskEntry public net.minecraft.entity.ai.EntityAITasks$EntityAITaskEntry -## EntityLiving +# EntityLiving public net.minecraft.entity.EntityLiving field_70714_bg #tasks public net.minecraft.entity.EntityLiving field_70715_bh #targetTasks -## EntityMinecartContainer +# EntityMinecartContainer public net.minecraft.entity.item.EntityMinecartContainer field_94112_b #dropContentsWhenDead # GuiScreen public net.minecraft.client.gui.GuiScreen field_146297_k # minecraft instance - public because gui's outside access it @@ -220,15 +210,14 @@ public net.minecraft.client.Minecraft func_180510_a(Lnet/minecraft/client/render public net.minecraft.client.Minecraft func_184119_a(Lnet/minecraft/item/ItemStack;Lnet/minecraft/tileentity/TileEntity;)Lnet/minecraft/item/ItemStack; # storeTEInStack # MinecraftServer protected net.minecraft.server.MinecraftServer field_211151_aa # serverTime -## DedicatedServer +# DedicatedServer public net.minecraft.server.dedicated.DedicatedServer field_71341_l # pendingCommandList -## SaveFormatOld +# SaveFormatOld public net.minecraft.world.storage.SaveFormatOld field_75808_a # savesDirectory protected net.minecraft.util.ObjectIntIdentityMap field_148749_a # internal map protected net.minecraft.util.ObjectIntIdentityMap field_148748_b # internal index list protected net.minecraft.util.ObjectIntIdentityMap field_195868_a # nextId -#protected-f net.minecraft.util.RegistryNamespaced field_148759_a # identitymap # GuiButton public net.minecraft.client.gui.GuiButton field_146120_f # width - needed for config GUI stuff diff --git a/src/main/resources/forge.exc b/src/main/resources/forge.exc index 8ce1f6c05..be2369edf 100644 --- a/src/main/resources/forge.exc +++ b/src/main/resources/forge.exc @@ -1,94 +1,50 @@ -#net/minecraft/client/particle/EntityDiggingFX.(Lnet/minecraft/world/World;DDDDDDLnet/minecraft/block/Block;II)V=|p_i1234_1_,p_i1234_2_,p_i1234_4_,p_i1234_6_,p_i1234_8_,p_i1234_10_,p_i1234_12_,p_i1234_14_,p_i1234_15_,side -#net/minecraft/client/renderer/ItemRenderer.renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V=|p_78443_1_,p_78443_2_,p_78443_3_,type -#net/minecraft/client/renderer/RenderGlobal.drawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V=|p_72717_1_,p_72717_2_,p_72717_3_ -#net/minecraft/client/renderer/entity/RenderItem.renderDroppedItem(Lnet/minecraft/entity/item/EntityItem;Lnet/minecraft/util/IIcon;IFFFFI)V=|p_77020_1_,p_77020_2_,p_77020_3_,p_77020_4_,p_77020_5_,p_77020_6_,p_77020_7_,pass -#net/minecraft/client/renderer/entity/RenderItem.renderItemIntoGUI(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;IIZ)V=|p_77015_1_,p_77015_2_,p_77015_3_,p_77015_4_,p_77015_5_,renderEffect +net/minecraft/block/BlockFire.tryCatchFire(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;ILjava/util/Random;ILnet/minecraft/util/EnumFacing;)V=|p_176536_1_,p_176536_2_,p_176536_3_,p_176536_4_,p_176536_5_,face +net/minecraft/block/BlockNetherWart.getDrops(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/NonNullList;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;I)V=|p_196255_1_,drops,p_196255_2_,p_196255_3_,p_196255_5_ +net/minecraft/block/BlockRailPowered.(Lnet/minecraft/block/Block$Properties;Z)=|p_i48349_1_,isActivator +net/minecraft/block/BlockRedstoneWire.canConnectTo(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/world/IBlockReader;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;)Z=|p_176343_0_,world,pos,p_176343_1_ -net/minecraft/entity/Entity.changeDimension(ILnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_184204_1_,teleporter -#net/minecraft/entity/item/EntityEnderPearl.changeDimension(ILnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_184204_1_,teleporter -#net/minecraft/entity/item/EntityItem.changeDimension(ILnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_184204_1_,teleporter -#net/minecraft/entity/item/EntityMinecartContainer.changeDimension(ILnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_184204_1_,teleporter -net/minecraft/entity/player/EntityPlayerMP.changeDimension(ILnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_184204_1_,teleporter +net/minecraft/client/renderer/model/BakedQuad.([IILnet/minecraft/util/EnumFacing;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)V=|p_i46574_1_,p_i46574_2_,p_i46574_3_,p_i46574_4_,applyDiffuseLighting,format +net/minecraft/client/renderer/model/FaceBakery.makeBakedQuad(Lnet/minecraft/client/renderer/Vector3f;Lnet/minecraft/client/renderer/Vector3f;Lnet/minecraft/client/renderer/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/common/model/ITransformation;Lnet/minecraft/client/renderer/model/BlockPartRotation;ZZ)Lnet/minecraft/client/renderer/model/BakedQuad;=|p_199332_1_,p_199332_2_,p_199332_3_,p_199332_4_,p_199332_5_,p_199332_6_,p_199332_7_,p_199332_8_,p_199332_9_ +net/minecraft/client/renderer/model/FaceBakery.makeQuadVertexData(Lnet/minecraft/client/renderer/model/BlockFaceUV;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;[FLnet/minecraftforge/common/model/ITransformation;Lnet/minecraft/client/renderer/model/BlockPartRotation;Z)[I=|p_188012_1_,p_188012_2_,p_188012_3_,p_188012_4_,p_188012_5_,p_188012_6_,p_188012_7_ +net/minecraft/client/renderer/model/FaceBakery.fillVertexData([IILnet/minecraft/util/EnumFacing;Lnet/minecraft/client/renderer/model/BlockFaceUV;[FLnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraftforge/common/model/ITransformation;Lnet/minecraft/client/renderer/model/BlockPartRotation;Z)V=|p_188015_1_,p_188015_2_,p_188015_3_,p_188015_4_,p_188015_5_,p_188015_6_,p_188015_7_,p_188015_8_,p_188015_9_ +net/minecraft/client/renderer/model/ItemOverrideList.(Lnet/minecraft/client/renderer/model/IUnbakedModel;Ljava/util/function/Function;Ljava/util/function/Function;Ljava/util/List;)V=|p_i49525_1_,p_i49525_2_,p_i49525_3_,p_i49525_4_ +net/minecraft/client/renderer/model/ModelBlock.bake(Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)Lnet/minecraft/client/renderer/model/IBakedModel;=|p_209558_1_,p_209558_2_,p_209558_3_,p_209558_4_,format +net/minecraft/client/renderer/model/ModelBlock.bake(Lnet/minecraft/client/renderer/model/ModelBlock;Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;Z)Lnet/minecraft/client/renderer/model/IBakedModel;=|p_209565_1_,p_209565_2_,p_209565_3_,p_209565_4_,p_209565_5_ +net/minecraft/client/renderer/model/ModelBlock.fromJson(Lnet/minecraft/client/renderer/model/ModelBlockDefinition$ContainerHolder;Ljava/io/Reader;Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/model/ModelBlockDefinition;=|p_209577_0_,p_209577_1_,location +net/minecraft/client/renderer/model/ModelBlock.makeBakedQuad(Lnet/minecraft/client/renderer/model/BlockPart;Lnet/minecraft/client/renderer/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/common/model/IModelState;Z)Lnet/minecraft/client/renderer/model/BakedQuad;=|p_209567_0,p_209567_1_,p_209567_2_,p_209567_3_,p_209567_4_,p_209567_5_ +net/minecraft/client/renderer/model/VariantList.bake(Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)Lnet/minecraft/client/renderer/model/IBakedModel;=|p_209558_1_,p_209558_2_,p_209558_3_,p_209558_4_,format +net/minecraft/client/renderer/model/multipart/Multipart.bake(Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)Lnet/minecraft/client/renderer/model/IBakedModel;=|p_209558_1_,p_209558_2_,p_209558_3_,p_209558_4_,format + +net/minecraft/entity/Entity.changeDimension(Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_212321_1_,teleporter +net/minecraft/entity/EnumCreatureType.create(Ljava/lang/String;Ljava/lang/Class;IZZ)Lnet/minecraft/entity/EnumCreatureType;=|name,p_i47849_3_,p_i47849_4_,p_i47849_5_,p_i47849_6_ +net/minecraft/entity/item/EntityEnderPearl.changeDimension(Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_212321_1_,teleporter +net/minecraft/entity/item/EntityItem.changeDimension(Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_212321_1_,teleporter +net/minecraft/entity/item/EntityMinecartContainer.changeDimension(Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_212321_1_,teleporter net/minecraft/entity/player/EntityPlayer.getDigSpeed(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F=|p_184813_1_,pos -net/minecraft/server/management/PlayerList.changePlayerDimension(Lnet/minecraft/entity/player/EntityPlayerMP;ILnet/minecraftforge/common/util/ITeleporter;)V=|p_187242_1_,p_187242_2_,teleporter -net/minecraft/server/management/PlayerList.transferEntityToWorld(Lnet/minecraft/entity/Entity;ILnet/minecraft/world/WorldServer;Lnet/minecraft/world/WorldServer;Lnet/minecraftforge/common/util/ITeleporter;)V=|p_82448_1_,p_82448_2_,p_82448_3_,p_82448_4_,teleporter +net/minecraft/entity/player/EntityPlayerMP.changeDimension(Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraftforge/common/util/ITeleporter;)Lnet/minecraft/entity/Entity;=|p_212321_1_,teleporter -#net/minecraft/world/World.getBiomeGenForCoordsBody(II)Lnet/minecraft/world/biome/Biome;=|p_72807_1_,p_72807_2_ -#net/minecraft/world/World.getSunBrightnessFactor(F)F=|p_72967_1_ -#net/minecraft/world/World.getSunBrightnessBody(F)F=|p_72971_1_ -#net/minecraft/world/World.getSkyColorBody(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/util/math/Vec3d;=|p_72833_1_,p_72833_2_ -#net/minecraft/world/World.drawCloudColorBody(F)Lnet/minecraft/util/math/Vec3d;=|p_72824_1_ -#net/minecraft/world/World.getStarBrightnessBody(F)F=|p_72880_1_ -#net/minecraft/world/World.canBlockFreezeBody(Lnet/minecraft/util/math/BlockPos;Z)Z=|p_175670_1_,p_175670_2_, -#net/minecraft/world/World.canSnowAtBody(Lnet/minecraft/util/math/BlockPos;Z)Z=|p_175708_1_,p_175708_2_ -#net/minecraft/world/World.canMineBlockBody(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/util/math/BlockPos;)Z=|p_175660_1_,p_175660_2_ -#net/minecraft/world/World.getBiomeForCoordsBody(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/world/biome/Biome;=|p_180494_1_ -#net/minecraft/world/World.markAndNotifyBlock(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/block/state/IBlockState;I)V=|p_180501_1_,chunk,iblockstate,p_180501_2_,p_180501_3_ -#net/minecraft/world/World.getCloudColorBody(F)Lnet/minecraft/util/math/Vec3d;=|p_72824_1_ -net/minecraft/world/WorldServer.canMineBlockBody(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/util/math/BlockPos;)Z=|p_175660_1_,p_175660_2_ -#net/minecraft/world/WorldEntitySpawner.canCreatureTypeSpawnBody(Lnet/minecraft/entity/EntityLiving$SpawnPlacementType;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Z=|p_180267_0_,p_180267_1_,p_180267_2_ - -#net/minecraft/world/biome/Biome.(IZ)V=|p_i1971_1_,register -#net/minecraft/world/chunk/storage/AnvilChunkLoader.loadChunk__Async(Lnet/minecraft/world/World;II)[Ljava/lang/Object;=|p_75815_1_,p_75815_2_,p_75815_3_ -#net/minecraft/world/chunk/storage/AnvilChunkLoader.checkedReadChunkFromNBT__Async(Lnet/minecraft/world/World;IILnet/minecraft/nbt/NBTTagCompound;)[Ljava/lang/Object;=|p_75822_1_,p_75822_2_,p_75822_3_,p_75822_4_ -#net/minecraft/world/chunk/storage/AnvilChunkLoader.loadEntities(Lnet/minecraft/world/World;Lnet/minecraft/nbt/NBTTagCompound;Lnet/minecraft/world/chunk/Chunk;)V=|p_75823_1_,p_75823_2_,chunk -#net/minecraft/world/gen/ChunkProviderServer.loadChunk(IILjava/lang/Runnable;)Lnet/minecraft/world/chunk/Chunk;=|p_186028_1_,p_186028_2_,runnable - -#net/minecraft/block/BlockFire.tryCatchFire(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;ILjava/util/Random;ILnet/minecraft/util/EnumFacing;)V=|p_176536_1_,p_176536_2_,p_176536_3_,p_176536_4_,p_176536_5_,face -#net/minecraft/block/BlockSkull.getDrops(Lnet/minecraft/util/NonNullList;Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;I)V=|drops,p_180663_1_,p_180663_2_,p_180663_3_,fortune -#net/minecraft/item/ItemDye.applyBonemeal(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/EntityPlayer;)Z=|p_179234_0_,p_179234_1_,p_179234_2_,player -#net/minecraft/item/ItemDye.applyBonemeal(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/util/EnumHand;)Z=|p_179234_0_,p_179234_1_,p_179234_2_,player,hand -#net/minecraft/server/management/ItemInWorldManager.removeBlock(Lnet/minecraft/util/math/BlockPos;Z)Z=|p_180235_1_,canHarvest -#net/minecraft/client/gui/GuiScreen.drawHoveringText(Ljava/util/List;IILnet/minecraft/client/gui/FontRenderer;)V=|p_146283_1_,p_146283_2_,p_146283_3_,font -#net/minecraft/block/state/BlockState.(Lnet/minecraft/block/Block;[Lnet/minecraft/block/properties/IProperty;Lcom/google/common/collect/ImmutableMap;)V=|p_i45663_1_,p_i45663_2_,unlistedProperties -#net/minecraft/client/renderer/entity/RenderItem.applyVanillaTransform(Lnet/minecraft/client/renderer/block/model/ItemTransformVec3f;)V=|p_175034_1_ -#net/minecraft/client/renderer/block/model/ModelBakery.bakeModel(Lnet/minecraft/client/renderer/block/model/ModelBlock;Lnet/minecraftforge/common/model/ITransformation;Z)Lnet/minecraft/client/renderer/block/model/IBakedModel;=|p_177578_1_,p_177578_2_,p_177578_3_ -#net/minecraft/client/renderer/block/model/ModelBakery.makeBakedQuad(Lnet/minecraft/client/renderer/block/model/BlockPart;Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/common/model/ITransformation;Z)Lnet/minecraft/client/renderer/block/model/BakedQuad;=|p_177589_1_,p_177589_2_,p_177589_3_,p_177589_4_,p_177589_5_,p_177589_6_ -net/minecraft/client/renderer/block/model/FaceBakery.makeBakedQuad(Lnet/minecraft/client/renderer/Vector3f;Lnet/minecraft/client/renderer/Vector3f;Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/common/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;ZZ)Lnet/minecraft/client/renderer/block/model/BakedQuad;=|p_199332_1_,p_199332_2_,p_199332_3_,p_199332_4_,p_199332_5_,p_199332_6_,p_199332_7_,p_199332_8_,p_199332_9_ -net/minecraft/client/renderer/block/model/FaceBakery.makeQuadVertexData(Lnet/minecraft/client/renderer/block/model/BlockFaceUV;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;[FLnet/minecraftforge/common/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;Z)[I=|p_188012_1_,p_188012_2_,p_188012_3_,p_188012_4_,p_188012_5_,p_188012_6_,p_188012_7_ -net/minecraft/client/renderer/block/model/FaceBakery.fillVertexData([IILnet/minecraft/util/EnumFacing;Lnet/minecraft/client/renderer/block/model/BlockFaceUV;[FLnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraftforge/common/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;Z)V=|p_188015_1_,p_188015_2_,p_188015_3_,p_188015_4_,p_188015_5_,p_188015_6_,p_188015_7_,p_188015_8_,p_188015_9_ -#net/minecraft/client/renderer/block/model/FaceBakery.rotateVertex(Lorg/lwjgl/util/vector/Vector3f;Lnet/minecraft/util/EnumFacing;ILnet/minecraftforge/common/model/ITransformation)I=|p_188011_1_,p_188011_2_,p_188011_3_,p_188011_4_ -net/minecraft/client/renderer/block/model/multipart/Multipart.bake(Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)Lnet/minecraft/client/renderer/block/model/IBakedModel;=|p_209558_1_,p_209558_2_,p_209558_3_,p_209558_4_,format -net/minecraft/client/renderer/block/model/ModelBlock.bake(Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)Lnet/minecraft/client/renderer/block/model/IBakedModel;=|p_209558_1_,p_209558_2_,p_209558_3_,p_209558_4_,format -net/minecraft/client/renderer/block/model/ModelBlock.bake(Lnet/minecraft/client/renderer/block/model/ModelBlock;Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;Z)Lnet/minecraft/client/renderer/block/model/IBakedModel;=|p_209565_1_,p_209565_2_,p_209565_3_,p_209565_4_,p_209565_5_ -net/minecraft/client/renderer/block/model/ModelBlock.makeBakedQuad(Lnet/minecraft/client/renderer/block/model/BlockPart;Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/common/model/IModelState;Z)Lnet/minecraft/client/renderer/block/model/BakedQuad;=|p_209567_0,p_209567_1_,p_209567_2_,p_209567_3_,p_209567_4_,p_209567_5_ -net/minecraft/client/renderer/block/model/VariantList.bake(Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraftforge/common/model/IModelState;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)Lnet/minecraft/client/renderer/block/model/IBakedModel;=|p_209558_1_,p_209558_2_,p_209558_3_,p_209558_4_,format -net/minecraft/client/renderer/block/model/ItemOverrideList.(Lnet/minecraft/client/renderer/block/model/IUnbakedModel;Ljava/util/function/Function;Ljava/util/function/Function;Ljava/util/List;)V=|p_i49525_1_,p_i49525_2_,p_i49525_3_,p_i49525_4_ - -#net/minecraft/item/ItemBlock.setTileEntityNBT(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/EntityPlayer;)Z=|p_179224_0_,p_179224_1_,p_179224_2_,player - -#net/minecraft/server/management/PlayerList.initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V=|p_72355_1_,p_72355_2_,nethandlerplayserver - -#net/minecraft/stats/StatList.replaceAllSimilarBlocks([Lnet/minecraft/stats/StatBase;Z)V=|p_75924_0_,useItemIds -#net/minecraft/stats/StatList.mergeStatBases([Lnet/minecraft/stats/StatBase;Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;Z)V=|p_151180_0_,p_151180_1_,p_151180_2_,useItemIds +net/minecraft/item/ArmorMaterial.create(Ljava/lang/String;Ljava/lang/String;I[IILnet/minecraft/util/SoundEvent;FLjava/util/function/Supplier;)Lnet/minecraft/item/ArmorMaterial;=|name,p_i48533_3_,p_i48533_4_,p_i48533_5_,p_i48533_6_,p_i48533_7_,p_i48533_8_,p_i48533_9_ net/minecraft/item/ItemStack.(Lnet/minecraft/util/IItemProvider;ILnet/minecraft/nbt/NBTTagCompound;)V=|p_i48204_1_,p_i48204_2_,capNBT -#net/minecraft/block/BlockRedstoneWire.canConnectTo(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;)Z=|p_176343_0_,p_176343_1_,world,pos -net/minecraft/client/renderer/block/model/BakedQuad.([IILnet/minecraft/util/EnumFacing;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;ZLnet/minecraft/client/renderer/vertex/VertexFormat;)V=|p_i46574_1_,p_i46574_2_,p_i46574_3_,p_i46574_4_,applyDiffuseLighting,format -#net/minecraft/client/renderer/texture/TextureMap.(Ljava/lang/String;Lnet/minecraft/client/renderer/texture/ITextureMapPopulator;Z)V=|p_i46100_1_,p_i46100_2_,skipFirst -#net/minecraft/client/renderer/texture/TextureMap.loadTexture(Lnet/minecraft/client/renderer/texture/Stitcher;Lnet/minecraft/client/resources/IResourceManager;Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraftforge/fml/common/ProgressManager$ProgressBar;II)I=|stitcher,p_110571_1_,location,textureatlassprite,bar,j,k +net/minecraft/network/PacketBuffer.writeItemStack(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/network/PacketBuffer;=|p_150788_1_,limitedTag -net/minecraft/world/storage/SaveFormatOld.getWorldData(Ljava/io/File;Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/world/storage/SaveHandler;)Lnet/minecraft/world/storage/WorldInfo;=|p_186353_0_,p_186353_1_,saveHandler +net/minecraft/server/management/PlayerList.changePlayerDimension(Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraftforge/common/util/ITeleporter;)V=|p_187242_1_,p_187242_2_,teleporter +net/minecraft/server/management/PlayerList.transferEntityToWorld(Lnet/minecraft/entity/Entity;Lnet/minecraft/world/dimension/DimensionType;Lnet/minecraft/world/WorldServer;Lnet/minecraft/world/WorldServer;Lnet/minecraftforge/common/util/ITeleporter;)V=|p_82448_1_,p_82448_2_,p_82448_3_,p_82448_4_,teleporter -net/minecraft/world/storage/loot/LootPool.([Lnet/minecraft/world/storage/loot/LootEntry;[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Lnet/minecraft/world/storage/loot/RandomValueRange;Lnet/minecraft/world/storage/loot/RandomValueRange;Ljava/lang/String;)V=|p_i46643_1_,p_i46643_2_,p_i46643_3_,p_i46643_4_ -net/minecraft/world/storage/loot/LootEntry.(II[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46642_1_,p_i46642_2_,p_i46642_3_,entryName -net/minecraft/world/storage/loot/LootEntryItem.(Lnet/minecraft/item/Item;II[Lnet/minecraft/world/storage/loot/functions/LootFunction;[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46644_1_,p_i46644_2_,p_i46644_3_,p_i46644_4_,p_i46644_5_,entryName -net/minecraft/world/storage/loot/LootEntryTable.(Lnet/minecraft/util/ResourceLocation;II[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46639_1_,p_i46639_2_,p_i46639_3_,p_i46639_4_,entryName -net/minecraft/world/storage/loot/LootEntryEmpty.(II[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46645_1_,p_i46645_2_,p_i46645_3_,entryName - -#net/minecraft/world/chunk/BlockStateContainer.setBits(IZ)V=|p_186012_1_,forceBits net/minecraft/village/Village.getPlayerReputation(Ljava/util/UUID;)I=|p_82684_1_ net/minecraft/village/Village.modifyPlayerReputation(Ljava/util/UUID;I)I=|p_82688_1_,p_82688_2_ -#net/minecraft/command/EntitySelector.matchEntitiesDefault(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;Ljava/lang/Class;)Ljava/util/List;=|p_179656_0_,p_179656_1_,p_179656_2_ -#net/minecraft/command/EntitySelector.matchesMultiplePlayersDefault(Ljava/lang/String;)Z=|p_82377_0_ -#net/minecraft/command/EntitySelector.isSelectorDefault(Ljava/lang/String;)Z=|p_82378_0_ - -#net/minecraft/client/util/RecipeItemHelper.accountStack(Lnet/minecraft/item/ItemStack;I)V=|p_194112_1_,forceCount -#net/minecraft/client/renderer/ActiveRenderInfo.updateRenderInfo(Lnet/minecraft/entity/Entity;Z)V=|p_74583_0_,p_74583_1_ -#net/minecraft/client/audio/SoundManager.setListener(Lnet/minecraft/entity/Entity;F)V=|p_148615_1_,p_148615_2_ - -net/minecraft/item/ArmorMaterial.create(Ljava/lang/String;Ljava/lang/String;I[IILnet/minecraft/util/SoundEvent;FLjava/util/function/Supplier;)Lnet/minecraft/item/ArmorMaterial;=|name,p_i48533_3_,p_i48533_4_,p_i48533_5_,p_i48533_6_,p_i48533_7_,p_i48533_8_,p_i48533_9_ -net/minecraft/entity/EnumCreatureType.create(Ljava/lang/String;Ljava/lang/Class;IZZ)Lnet/minecraft/entity/EnumCreatureType;=|name,p_i47849_3_,p_i47849_4_,p_i47849_5_,p_i47849_6_ - -net/minecraft/network/PacketBuffer.writeItemStack(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/network/PacketBuffer;=|p_150788_1_,limitedTag \ No newline at end of file +net/minecraft/world/World.getBiomeBody(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/world/biome/Biome;=|p_180494_1_ +net/minecraft/world/World.markAndNotifyBlock(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/block/state/IBlockState;I)V=|p_180501_1_,chunk,iblockstate,p_180501_2_,p_180501_3_ +net/minecraft/world/World.getSunBrightnessFactor(F)F=|p_72967_1_ +net/minecraft/world/World.getSunBrightnessBody(F)F=|p_72971_1_ +net/minecraft/world/World.getSkyColorBody(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/util/math/Vec3d;=|p_72833_1_,p_72833_2_ +net/minecraft/world/World.getCloudColorBody(F)Lnet/minecraft/util/math/Vec3d;=|p_72824_1_ +net/minecraft/world/WorldServer.canMineBlockBody(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/util/math/BlockPos;)Z=|p_175660_1_,p_175660_2_ +net/minecraft/world/WorldEntitySpawner.canSpawnAtBody(Lnet/minecraft/entity/EntitySpawnPlacementRegistry$SpawnPlacementType;Lnet/minecraft/world/IWorldReaderBase;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/EntityType;)Z=|p_209382_0_,p_209382_1_,p_209382_2_,p_209382_3_ +net/minecraft/world/storage/SaveFormatOld.getWorldData(Ljava/io/File;Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/world/storage/SaveHandler;)Lnet/minecraft/world/storage/WorldInfo;=|p_186353_0_,p_186353_1_,saveHandler +net/minecraft/world/storage/loot/LootEntry.(II[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46642_1_,p_i46642_2_,p_i46642_3_,entryName +net/minecraft/world/storage/loot/LootEntryEmpty.(II[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46645_1_,p_i46645_2_,p_i46645_3_,entryName +net/minecraft/world/storage/loot/LootEntryItem.(Lnet/minecraft/item/Item;II[Lnet/minecraft/world/storage/loot/functions/LootFunction;[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46644_1_,p_i46644_2_,p_i46644_3_,p_i46644_4_,p_i46644_5_,entryName +net/minecraft/world/storage/loot/LootEntryTable.(Lnet/minecraft/util/ResourceLocation;II[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Ljava/lang/String;)V=|p_i46639_1_,p_i46639_2_,p_i46639_3_,p_i46639_4_,entryName +net/minecraft/world/storage/loot/LootPool.([Lnet/minecraft/world/storage/loot/LootEntry;[Lnet/minecraft/world/storage/loot/conditions/LootCondition;Lnet/minecraft/world/storage/loot/RandomValueRange;Lnet/minecraft/world/storage/loot/RandomValueRange;Ljava/lang/String;)V=|p_i46643_1_,p_i46643_2_,p_i46643_3_,p_i46643_4_ diff --git a/src/test/java/net/minecraftforge/debug/block/MaterialFogColorTest.java b/src/test/java/net/minecraftforge/debug/block/MaterialFogColorTest.java index 58aa40314..0566bf7d4 100644 --- a/src/test/java/net/minecraftforge/debug/block/MaterialFogColorTest.java +++ b/src/test/java/net/minecraftforge/debug/block/MaterialFogColorTest.java @@ -22,7 +22,7 @@ package net.minecraftforge.debug.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; diff --git a/src/test/java/net/minecraftforge/debug/block/ParticleEffectsTest.java b/src/test/java/net/minecraftforge/debug/block/ParticleEffectsTest.java index 699bbcf81..6fedea679 100644 --- a/src/test/java/net/minecraftforge/debug/block/ParticleEffectsTest.java +++ b/src/test/java/net/minecraftforge/debug/block/ParticleEffectsTest.java @@ -23,7 +23,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.particle.ParticleManager; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; diff --git a/src/test/java/net/minecraftforge/debug/block/PathNodeTypeTest.java b/src/test/java/net/minecraftforge/debug/block/PathNodeTypeTest.java index 1fdb0c8f5..ffe7e70e7 100644 --- a/src/test/java/net/minecraftforge/debug/block/PathNodeTypeTest.java +++ b/src/test/java/net/minecraftforge/debug/block/PathNodeTypeTest.java @@ -22,7 +22,7 @@ package net.minecraftforge.debug.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.item.Item; import net.minecraft.pathfinding.PathNodeType; import net.minecraft.util.math.BlockPos; diff --git a/src/test/java/net/minecraftforge/debug/block/SlipperinessTest.java b/src/test/java/net/minecraftforge/debug/block/SlipperinessTest.java index f78fd13c3..4ef62ef6b 100644 --- a/src/test/java/net/minecraftforge/debug/block/SlipperinessTest.java +++ b/src/test/java/net/minecraftforge/debug/block/SlipperinessTest.java @@ -22,7 +22,7 @@ package net.minecraftforge.debug.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityBoat; diff --git a/src/test/java/net/minecraftforge/debug/block/StickyBlockTest.java b/src/test/java/net/minecraftforge/debug/block/StickyBlockTest.java index 3a9a351ff..71ded772b 100644 --- a/src/test/java/net/minecraftforge/debug/block/StickyBlockTest.java +++ b/src/test/java/net/minecraftforge/debug/block/StickyBlockTest.java @@ -25,7 +25,7 @@ import net.minecraft.block.SoundType; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemMultiTexture; diff --git a/src/test/java/net/minecraftforge/debug/client/model/AnimatedModelTest.java b/src/test/java/net/minecraftforge/debug/client/model/AnimatedModelTest.java index a00d98317..b71c92a7f 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/AnimatedModelTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/AnimatedModelTest.java @@ -26,7 +26,7 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; diff --git a/src/test/java/net/minecraftforge/debug/client/model/BlockstateRetextureTest.java b/src/test/java/net/minecraftforge/debug/client/model/BlockstateRetextureTest.java index 1524a04c1..8bb83673b 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/BlockstateRetextureTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/BlockstateRetextureTest.java @@ -24,8 +24,8 @@ import java.util.function.Function; import com.google.common.collect.ImmutableMap; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; diff --git a/src/test/java/net/minecraftforge/debug/client/model/ForgeBlockStatesLoaderTest.java b/src/test/java/net/minecraftforge/debug/client/model/ForgeBlockStatesLoaderTest.java index 1c44048b5..f0b0e66bd 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/ForgeBlockStatesLoaderTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/ForgeBlockStatesLoaderTest.java @@ -23,7 +23,7 @@ import com.google.common.collect.Maps; import net.minecraft.block.Block; import net.minecraft.block.BlockWall; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.IStateMapper; import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.init.Blocks; diff --git a/src/test/java/net/minecraftforge/debug/client/model/ItemLayerModelTest.java b/src/test/java/net/minecraftforge/debug/client/model/ItemLayerModelTest.java index def4d10b6..17d303c17 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/ItemLayerModelTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/ItemLayerModelTest.java @@ -20,7 +20,7 @@ package net.minecraftforge.debug.client.model; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/test/java/net/minecraftforge/debug/client/model/ItemModelConflictTest.java b/src/test/java/net/minecraftforge/debug/client/model/ItemModelConflictTest.java index 454477c62..8e94d32e0 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/ItemModelConflictTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/ItemModelConflictTest.java @@ -21,7 +21,7 @@ package net.minecraftforge.debug.client.model; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; diff --git a/src/test/java/net/minecraftforge/debug/client/model/ItemModelGenerationTest.java b/src/test/java/net/minecraftforge/debug/client/model/ItemModelGenerationTest.java index ea74e8e94..e095f2cde 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/ItemModelGenerationTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/ItemModelGenerationTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.client.model; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.api.distmarker.Dist; diff --git a/src/test/java/net/minecraftforge/debug/client/model/ModelBakeEventTest.java b/src/test/java/net/minecraftforge/debug/client/model/ModelBakeEventTest.java index 04c03aabd..995313e4a 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/ModelBakeEventTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/ModelBakeEventTest.java @@ -30,10 +30,10 @@ import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemOverrideList; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; diff --git a/src/test/java/net/minecraftforge/debug/client/model/ModelFluidTest.java b/src/test/java/net/minecraftforge/debug/client/model/ModelFluidTest.java index 94befaeb1..30c17c389 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/ModelFluidTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/ModelFluidTest.java @@ -22,8 +22,8 @@ package net.minecraftforge.debug.client.model; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/client/model/ModelLoaderRegistryTest.java b/src/test/java/net/minecraftforge/debug/client/model/ModelLoaderRegistryTest.java index 7efde5d01..df485c8ef 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/ModelLoaderRegistryTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/ModelLoaderRegistryTest.java @@ -30,7 +30,7 @@ import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/test/java/net/minecraftforge/debug/client/model/MultiLayerModelTest.java b/src/test/java/net/minecraftforge/debug/client/model/MultiLayerModelTest.java index 7278f2528..1eee6898d 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/MultiLayerModelTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/MultiLayerModelTest.java @@ -22,7 +22,7 @@ package net.minecraftforge.debug.client.model; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; diff --git a/src/test/java/net/minecraftforge/debug/client/rendering/FastTESRTransparentTest.java b/src/test/java/net/minecraftforge/debug/client/rendering/FastTESRTransparentTest.java index 0107ac6f7..6feb616fb 100644 --- a/src/test/java/net/minecraftforge/debug/client/rendering/FastTESRTransparentTest.java +++ b/src/test/java/net/minecraftforge/debug/client/rendering/FastTESRTransparentTest.java @@ -30,7 +30,7 @@ import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; diff --git a/src/test/java/net/minecraftforge/debug/client/rendering/ItemTESRTest.java b/src/test/java/net/minecraftforge/debug/client/rendering/ItemTESRTest.java index 4d3033f9d..35e1bdc8d 100644 --- a/src/test/java/net/minecraftforge/debug/client/rendering/ItemTESRTest.java +++ b/src/test/java/net/minecraftforge/debug/client/rendering/ItemTESRTest.java @@ -24,7 +24,7 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/entity/player/ReachDistanceAttributeTest.java b/src/test/java/net/minecraftforge/debug/entity/player/ReachDistanceAttributeTest.java index 68cdb030b..eeec3ce23 100644 --- a/src/test/java/net/minecraftforge/debug/entity/player/ReachDistanceAttributeTest.java +++ b/src/test/java/net/minecraftforge/debug/entity/player/ReachDistanceAttributeTest.java @@ -20,7 +20,7 @@ package net.minecraftforge.debug.entity.player; import com.google.common.collect.Multimap; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.EntityEquipmentSlot; diff --git a/src/test/java/net/minecraftforge/debug/entity/player/SwimSpeedAttributeTest.java b/src/test/java/net/minecraftforge/debug/entity/player/SwimSpeedAttributeTest.java index 5de6213d6..27fe42243 100644 --- a/src/test/java/net/minecraftforge/debug/entity/player/SwimSpeedAttributeTest.java +++ b/src/test/java/net/minecraftforge/debug/entity/player/SwimSpeedAttributeTest.java @@ -20,7 +20,7 @@ package net.minecraftforge.debug.entity.player; import com.google.common.collect.Multimap; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.EntityLivingBase; import net.minecraft.inventory.EntityEquipmentSlot; diff --git a/src/test/java/net/minecraftforge/debug/fluid/DynBucketTest.java b/src/test/java/net/minecraftforge/debug/fluid/DynBucketTest.java index c04265f43..f14960853 100644 --- a/src/test/java/net/minecraftforge/debug/fluid/DynBucketTest.java +++ b/src/test/java/net/minecraftforge/debug/fluid/DynBucketTest.java @@ -24,8 +24,8 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.ItemMeshDefinition; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; diff --git a/src/test/java/net/minecraftforge/debug/fluid/FluidPlacementTest.java b/src/test/java/net/minecraftforge/debug/fluid/FluidPlacementTest.java index 2d5aea2e0..d7f77ca26 100644 --- a/src/test/java/net/minecraftforge/debug/fluid/FluidPlacementTest.java +++ b/src/test/java/net/minecraftforge/debug/fluid/FluidPlacementTest.java @@ -22,8 +22,8 @@ package net.minecraftforge.debug.fluid; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; diff --git a/src/test/java/net/minecraftforge/debug/gameplay/AnytimeSleepingTest.java b/src/test/java/net/minecraftforge/debug/gameplay/AnytimeSleepingTest.java index 57479258e..9e9aae537 100644 --- a/src/test/java/net/minecraftforge/debug/gameplay/AnytimeSleepingTest.java +++ b/src/test/java/net/minecraftforge/debug/gameplay/AnytimeSleepingTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.gameplay; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/gameplay/FurnaceFuelBurnTimeEventTest.java b/src/test/java/net/minecraftforge/debug/gameplay/FurnaceFuelBurnTimeEventTest.java index 339d97382..70d76af49 100644 --- a/src/test/java/net/minecraftforge/debug/gameplay/FurnaceFuelBurnTimeEventTest.java +++ b/src/test/java/net/minecraftforge/debug/gameplay/FurnaceFuelBurnTimeEventTest.java @@ -19,8 +19,8 @@ package net.minecraftforge.debug.gameplay; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/gameplay/NoBedSleepingTest.java b/src/test/java/net/minecraftforge/debug/gameplay/NoBedSleepingTest.java index 5a2b91609..5f59dfeac 100644 --- a/src/test/java/net/minecraftforge/debug/gameplay/NoBedSleepingTest.java +++ b/src/test/java/net/minecraftforge/debug/gameplay/NoBedSleepingTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.gameplay; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/test/java/net/minecraftforge/debug/gameplay/RecipeMatchingTest.java b/src/test/java/net/minecraftforge/debug/gameplay/RecipeMatchingTest.java index 854419709..e722a27cb 100644 --- a/src/test/java/net/minecraftforge/debug/gameplay/RecipeMatchingTest.java +++ b/src/test/java/net/minecraftforge/debug/gameplay/RecipeMatchingTest.java @@ -21,7 +21,7 @@ package net.minecraftforge.debug.gameplay; import java.util.Random; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/item/CanApplyAtEnchantingTableTest.java b/src/test/java/net/minecraftforge/debug/item/CanApplyAtEnchantingTableTest.java index d93601254..d5df49a28 100644 --- a/src/test/java/net/minecraftforge/debug/item/CanApplyAtEnchantingTableTest.java +++ b/src/test/java/net/minecraftforge/debug/item/CanApplyAtEnchantingTableTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.item; -import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.enchantment.Enchantment; import net.minecraft.init.Enchantments; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/item/HorseArmorTest.java b/src/test/java/net/minecraftforge/debug/item/HorseArmorTest.java index 7642eadaf..50861c17c 100644 --- a/src/test/java/net/minecraftforge/debug/item/HorseArmorTest.java +++ b/src/test/java/net/minecraftforge/debug/item/HorseArmorTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.item; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.passive.HorseArmorType; import net.minecraft.init.MobEffects; diff --git a/src/test/java/net/minecraftforge/debug/item/IsBookEnchantableTest.java b/src/test/java/net/minecraftforge/debug/item/IsBookEnchantableTest.java index 7f882c039..d8f7b2d93 100644 --- a/src/test/java/net/minecraftforge/debug/item/IsBookEnchantableTest.java +++ b/src/test/java/net/minecraftforge/debug/item/IsBookEnchantableTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.item; -import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/item/MapDataTest.java b/src/test/java/net/minecraftforge/debug/item/MapDataTest.java index 968f91fb1..78056b843 100644 --- a/src/test/java/net/minecraftforge/debug/item/MapDataTest.java +++ b/src/test/java/net/minecraftforge/debug/item/MapDataTest.java @@ -23,8 +23,8 @@ import io.netty.buffer.ByteBuf; import net.minecraft.block.material.MapColor; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.MapItemRenderer; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/item/NBTShareTagTest.java b/src/test/java/net/minecraftforge/debug/item/NBTShareTagTest.java index 4923c017b..d09cbb83e 100644 --- a/src/test/java/net/minecraftforge/debug/item/NBTShareTagTest.java +++ b/src/test/java/net/minecraftforge/debug/item/NBTShareTagTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.item; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/item/OnItemUseFirstTest.java b/src/test/java/net/minecraftforge/debug/item/OnItemUseFirstTest.java index 037203221..bde1bf599 100644 --- a/src/test/java/net/minecraftforge/debug/item/OnItemUseFirstTest.java +++ b/src/test/java/net/minecraftforge/debug/item/OnItemUseFirstTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.item; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/item/PotionCurabilityTest.java b/src/test/java/net/minecraftforge/debug/item/PotionCurabilityTest.java index 659f3d45c..6a4a14fef 100644 --- a/src/test/java/net/minecraftforge/debug/item/PotionCurabilityTest.java +++ b/src/test/java/net/minecraftforge/debug/item/PotionCurabilityTest.java @@ -19,7 +19,7 @@ package net.minecraftforge.debug.item; -import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; diff --git a/src/test/java/net/minecraftforge/debug/item/ShieldTest.java b/src/test/java/net/minecraftforge/debug/item/ShieldTest.java index d6ba148c7..bd5f6eee0 100644 --- a/src/test/java/net/minecraftforge/debug/item/ShieldTest.java +++ b/src/test/java/net/minecraftforge/debug/item/ShieldTest.java @@ -20,7 +20,7 @@ package net.minecraftforge.debug.item; import com.google.common.collect.Multimap; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; diff --git a/src/test/java/net/minecraftforge/debug/util/RotatingWrench.java b/src/test/java/net/minecraftforge/debug/util/RotatingWrench.java index 0fd9dc86f..c79ee7ee5 100644 --- a/src/test/java/net/minecraftforge/debug/util/RotatingWrench.java +++ b/src/test/java/net/minecraftforge/debug/util/RotatingWrench.java @@ -21,8 +21,8 @@ package net.minecraftforge.debug.util; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/test/java/net/minecraftforge/debug/world/TileEntityLoadingTest.java b/src/test/java/net/minecraftforge/debug/world/TileEntityLoadingTest.java index cb9fc3401..728d66da8 100644 --- a/src/test/java/net/minecraftforge/debug/world/TileEntityLoadingTest.java +++ b/src/test/java/net/minecraftforge/debug/world/TileEntityLoadingTest.java @@ -22,7 +22,7 @@ package net.minecraftforge.debug.world; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock;