From 44c689f1712fcfb7ccb13262d1c02f0a880055be Mon Sep 17 00:00:00 2001 From: SizableShrimp Date: Fri, 24 Feb 2023 08:58:27 -0600 Subject: [PATCH] Forge 1.19.4 Properly move `ServerStatusPing` to codec Reimplement custom display contexts Co-authored-by: Matyrobbrt Co-authored-by: coehlrich Signed-off-by: SizableShrimp --- build.gradle | 6 +- .../platform/GlStateManager.java.patch | 4 +- .../mojang/blaze3d/platform/Window.java.patch | 2 +- .../com/mojang/math/Transformation.java.patch | 8 +- .../RealmsNotificationsScreen.java.patch | 15 + .../net/minecraft/SharedConstants.java.patch | 2 +- .../minecraft/net/minecraft/Util.java.patch | 8 +- .../advancements/Advancement.java.patch | 4 +- .../client/ClientRecipeBook.java.patch | 4 +- .../client/KeyboardHandler.java.patch | 10 +- .../net/minecraft/client/Minecraft.java.patch | 84 +-- .../minecraft/client/MouseHandler.java.patch | 12 +- .../net/minecraft/client/Options.java.patch | 18 +- .../client/color/block/BlockColors.java.patch | 4 +- .../net/minecraft/client/gui/Font.java.patch | 4 +- .../net/minecraft/client/gui/Gui.java.patch | 31 +- .../gui/components/AbstractButton.java.patch | 11 + .../AbstractSelectionList.java.patch | 6 +- .../gui/components/AbstractWidget.java.patch | 15 +- .../components/BossHealthOverlay.java.patch | 4 +- .../toasts/ToastComponent.java.patch | 2 +- .../gui/screens/LoadingOverlay.java.patch | 6 +- .../client/gui/screens/MenuScreens.java.patch | 4 +- .../gui/screens/OptionsScreen.java.patch | 2 +- .../client/gui/screens/Screen.java.patch | 75 ++- .../client/gui/screens/TitleScreen.java.patch | 24 +- .../advancements/AdvancementTab.java.patch | 6 +- .../AdvancementsScreen.java.patch | 18 +- .../screens/controls/KeyBindsList.java.patch | 48 +- .../controls/KeyBindsScreen.java.patch | 6 +- .../AbstractContainerScreen.java.patch | 50 +- .../CreativeModeInventoryScreen.java.patch | 67 ++- .../EffectRenderingInventoryScreen.java.patch | 12 +- .../inventory/EnchantmentScreen.java.patch | 10 +- .../HangingSignEditScreen.java.patch | 4 +- .../inventory/InventoryScreen.java.patch | 20 +- .../inventory/MerchantScreen.java.patch | 16 +- .../JoinMultiplayerScreen.java.patch | 2 +- .../ServerSelectionList.java.patch | 2 +- .../packs/PackSelectionModel.java.patch | 4 +- .../packs/PackSelectionScreen.java.patch | 14 +- .../recipebook/RecipeBookComponent.java.patch | 4 +- .../recipebook/RecipeBookPage.java.patch | 2 +- .../CreateWorldScreen.java.patch | 30 +- .../WorldCreationContext.java.patch | 13 + .../worldselection/WorldOpenFlows.java.patch | 8 +- .../WorldSelectionList.java.patch | 6 +- .../net/minecraft/client/main/Main.java.patch | 11 +- .../client/model/HumanoidModel.java.patch | 8 +- .../model/geom/LayerDefinitions.java.patch | 2 +- .../client/model/geom/ModelLayers.java.patch | 10 +- .../multiplayer/ClientChunkCache.java.patch | 2 +- .../client/multiplayer/ClientLevel.java.patch | 16 +- .../ClientPacketListener.java.patch | 30 +- .../client/multiplayer/ServerData.java.patch | 4 +- .../multiplayer/ServerStatusPinger.java.patch | 6 +- .../client/particle/ParticleEngine.java.patch | 24 +- .../player/AbstractClientPlayer.java.patch | 2 +- .../client/player/LocalPlayer.java.patch | 46 +- .../client/player/RemotePlayer.java.patch | 2 +- .../client/renderer/GameRenderer.java.patch | 19 +- .../renderer/ItemBlockRenderTypes.java.patch | 20 +- .../renderer/ItemInHandRenderer.java.patch | 10 +- .../client/renderer/LevelRenderer.java.patch | 74 +-- .../client/renderer/LightTexture.java.patch | 4 +- .../client/renderer/RenderType.java.patch | 19 +- .../renderer/ScreenEffectRenderer.java.patch | 5 +- .../client/renderer/ShaderInstance.java.patch | 13 +- .../client/renderer/Sheets.java.patch | 12 +- .../block/BlockRenderDispatcher.java.patch | 4 +- .../block/model/BlockModel.java.patch | 34 +- .../block/model/ItemOverrides.java.patch | 8 +- .../block/model/ItemTransforms.java.patch | 120 +---- .../renderer/entity/BoatRenderer.java.patch | 6 +- .../entity/FallingBlockRenderer.java.patch | 2 +- .../entity/ItemEntityRenderer.java.patch | 4 +- .../entity/ItemFrameRenderer.java.patch | 2 +- .../renderer/entity/ItemRenderer.java.patch | 46 +- .../entity/LivingEntityRenderer.java.patch | 4 +- .../layers/HumanoidArmorLayer.java.patch | 18 +- .../entity/player/PlayerRenderer.java.patch | 12 +- .../renderer/item/ItemProperties.java.patch | 4 +- .../renderer/texture/SpriteLoader.java.patch | 30 +- .../renderer/texture/Stitcher.java.patch | 2 +- .../renderer/texture/TextureAtlas.java.patch | 6 +- .../texture/TextureManager.java.patch | 2 +- .../language/ClientLanguage.java.patch | 2 +- .../language/LanguageInfo.java.patch | 24 - .../language/LanguageManager.java.patch | 24 + .../resources/model/ModelManager.java.patch | 10 +- .../model/MultiPartBakedModel.java.patch | 2 +- .../model/WeightedBakedModel.java.patch | 2 +- .../client/server/IntegratedServer.java.patch | 2 +- .../client/sounds/SoundEngine.java.patch | 40 +- .../minecraft/commands/Commands.java.patch | 14 +- .../coordinates/BlockPosArgument.java.patch | 14 +- .../ArgumentTypeInfos.java.patch | 6 +- .../core/RegistrySetBuilder.java.patch | 4 +- .../core/RegistrySynchronization.java.patch | 6 +- .../BoatDispenseItemBehavior.java.patch | 4 +- .../dispenser/DispenseItemBehavior.java.patch | 4 +- .../registries/BuiltInRegistries.java.patch | 16 +- .../minecraft/data/DataGenerator.java.patch | 2 +- .../net/minecraft/data/HashCache.java.patch | 2 +- .../net/minecraft/data/Main.java.patch | 4 +- .../data/loot/BlockLootSubProvider.java.patch | 2 +- .../loot/EntityLootSubProvider.java.patch | 35 +- .../registries/VanillaRegistries.java.patch | 6 +- .../data/tags/BiomeTagsProvider.java.patch | 4 +- .../tags/GameEventTagsProvider.java.patch | 2 +- .../IntrinsicHolderTagsProvider.java.patch | 17 +- .../data/tags/ItemTagsProvider.java.patch | 29 +- .../data/tags/TagsProvider.java.patch | 55 +- .../net/minecraft/locale/Language.java.patch | 8 +- .../net/minecraft/nbt/CompoundTag.java.patch | 6 +- .../net/minecraft/nbt/NbtIo.java.patch | 2 +- .../minecraft/network/Connection.java.patch | 18 +- .../network/FriendlyByteBuf.java.patch | 12 +- .../contents/TranslatableContents.java.patch | 2 +- .../ClientIntentionPacket.java.patch | 2 +- ...ClientboundStatusResponsePacket.java.patch | 19 +- .../protocol/status/ServerStatus.java.patch | 124 +---- .../syncher/EntityDataSerializers.java.patch | 4 +- .../resources/HolderSetCodec.java.patch | 10 +- .../resources/RegistryDataLoader.java.patch | 16 +- .../resources/RegistryOps.java.patch | 10 +- .../resources/ResourceLocation.java.patch | 2 +- .../net/minecraft/server/Main.java.patch | 35 +- .../server/MinecraftServer.java.patch | 80 +-- .../server/PlayerAdvancements.java.patch | 29 +- .../AdvancementVisibilityEvaluator.java.patch | 18 + .../commands/SpreadPlayersCommand.java.patch | 2 +- .../commands/TeleportCommand.java.patch | 6 +- .../server/level/ChunkMap.java.patch | 14 +- .../server/level/ServerEntity.java.patch | 12 +- .../server/level/ServerLevel.java.patch | 38 +- .../server/level/ServerPlayer.java.patch | 50 +- .../ServerConnectionListener.java.patch | 12 +- .../ServerGamePacketListenerImpl.java.patch | 24 +- ...rverHandshakePacketListenerImpl.java.patch | 11 +- .../ServerStatusPacketListenerImpl.java.patch | 29 ++ .../packs/AbstractPackResources.java.patch | 2 +- .../server/packs/repository/Pack.java.patch | 24 +- .../repository/PackRepository.java.patch | 4 +- ...impleJsonResourceReloadListener.java.patch | 2 +- .../server/players/PlayerList.java.patch | 31 +- .../net/minecraft/tags/BlockTags.java.patch | 2 +- .../net/minecraft/tags/ItemTags.java.patch | 2 +- .../net/minecraft/tags/TagLoader.java.patch | 2 +- .../damagesource/DamageSource.java.patch | 11 + .../world/effect/MobEffect.java.patch | 6 +- .../world/effect/MobEffectInstance.java.patch | 18 +- .../minecraft/world/entity/Entity.java.patch | 94 ++-- .../world/entity/EntityType.java.patch | 47 +- .../world/entity/ExperienceOrb.java.patch | 4 +- .../world/entity/FlyingMob.java.patch | 12 +- .../world/entity/LivingEntity.java.patch | 208 ++++---- .../net/minecraft/world/entity/Mob.java.patch | 8 +- .../world/entity/TamableAnimal.java.patch | 8 +- .../attributes/DefaultAttributes.java.patch | 4 +- .../entity/ai/control/MoveControl.java.patch | 2 +- .../entity/ai/goal/RemoveBlockGoal.java.patch | 2 +- .../ai/navigation/PathNavigation.java.patch | 4 +- .../WallClimberNavigation.java.patch | 4 +- .../world/entity/animal/Bee.java.patch | 2 +- .../world/entity/animal/Cat.java.patch | 4 +- .../world/entity/animal/Fox.java.patch | 8 +- .../entity/animal/MushroomCow.java.patch | 8 +- .../world/entity/animal/Ocelot.java.patch | 2 +- .../world/entity/animal/Pig.java.patch | 4 +- .../world/entity/animal/SnowGolem.java.patch | 24 +- .../entity/animal/allay/Allay.java.patch | 2 +- .../animal/horse/AbstractHorse.java.patch | 10 +- .../boss/enderdragon/EnderDragon.java.patch | 14 +- .../entity/boss/wither/WitherBoss.java.patch | 6 +- .../entity/decoration/ArmorStand.java.patch | 2 +- .../entity/item/FallingBlockEntity.java.patch | 2 +- .../world/entity/item/ItemEntity.java.patch | 44 +- .../monster/AbstractSkeleton.java.patch | 4 +- .../world/entity/monster/EnderMan.java.patch | 8 +- .../world/entity/monster/MagmaCube.java.patch | 2 +- .../world/entity/monster/Ravager.java.patch | 2 +- .../world/entity/monster/Shulker.java.patch | 4 +- .../entity/monster/Silverfish.java.patch | 2 +- ...opHoldingItemIfNoLongerAdmiring.java.patch | 8 +- .../world/entity/npc/Villager.java.patch | 6 +- .../world/entity/player/Inventory.java.patch | 16 +- .../world/entity/player/Player.java.patch | 91 ++-- .../FireworkRocketEntity.java.patch | 4 +- .../entity/projectile/FishingHook.java.patch | 8 +- .../projectile/LargeFireball.java.patch | 4 +- .../entity/projectile/LlamaSpit.java.patch | 2 +- .../entity/projectile/Projectile.java.patch | 2 +- .../projectile/ShulkerBullet.java.patch | 2 +- .../projectile/SmallFireball.java.patch | 2 +- .../projectile/ThrownEnderpearl.java.patch | 14 +- .../AbstractMinecartContainer.java.patch | 2 +- .../world/entity/vehicle/Boat.java.patch | 14 +- .../world/entity/vehicle/ChestBoat.java.patch | 10 +- .../entity/vehicle/ContainerEntity.java.patch | 2 +- .../minecraft/world/food/FoodData.java.patch | 5 +- .../world/inventory/AnvilMenu.java.patch | 10 +- .../world/inventory/MenuType.java.patch | 14 +- .../minecraft/world/inventory/Slot.java.patch | 4 +- .../minecraft/world/item/ArmorItem.java.patch | 4 +- .../world/item/CreativeModeTab.java.patch | 24 +- .../world/item/CreativeModeTabs.java.patch | 69 ++- .../world/item/CrossbowItem.java.patch | 2 +- .../world/item/ElytraItem.java.patch | 8 +- .../net/minecraft/world/item/Item.java.patch | 30 +- .../world/item/ItemDisplayContext.java.patch | 60 +++ .../minecraft/world/item/ItemStack.java.patch | 44 +- .../net/minecraft/world/item/Items.java.patch | 2 +- .../world/item/PotionItem.java.patch | 10 - .../world/item/RecordItem.java.patch | 6 +- .../world/item/ShearsItem.java.patch | 4 +- .../world/item/ShieldItem.java.patch | 10 +- .../minecraft/world/item/UseAnim.java.patch | 8 +- .../crafting/BannerDuplicateRecipe.java.patch | 2 +- .../crafting/BookCloningRecipe.java.patch | 2 +- .../crafting/LegacyUpgradeRecipe.java.patch | 11 + .../world/item/crafting/Recipe.java.patch | 4 +- .../item/crafting/RecipeSerializer.java.patch | 6 +- .../item/crafting/RepairItemRecipe.java.patch | 6 +- .../item/crafting/ShapedRecipe.java.patch | 12 +- .../item/crafting/ShapelessRecipe.java.patch | 12 +- .../crafting/ShulkerBoxColoring.java.patch | 8 +- .../item/crafting/UpgradeRecipe.java.patch | 11 - .../item/enchantment/Enchantment.java.patch | 8 +- .../EnchantmentCategory.java.patch | 4 +- .../enchantment/EnchantmentHelper.java.patch | 6 +- .../world/level/Explosion.java.patch | 8 +- .../minecraft/world/level/Level.java.patch | 46 +- .../world/level/NaturalSpawner.java.patch | 12 +- .../world/level/biome/Biome.java.patch | 4 +- .../world/level/biome/BiomeSource.java.patch | 30 -- .../level/biome/MobSpawnSettings.java.patch | 2 +- .../level/block/BaseFireBlock.java.patch | 4 +- .../world/level/block/Block.java.patch | 20 +- .../world/level/block/Blocks.java.patch | 4 +- .../world/level/block/ButtonBlock.java.patch | 11 + .../world/level/block/CactusBlock.java.patch | 10 +- .../level/block/CampfireBlock.java.patch | 2 +- .../level/block/DecoratedPotBlock.java.patch | 11 + .../world/level/block/DoorBlock.java.patch | 11 + .../world/level/block/FarmBlock.java.patch | 6 +- .../world/level/block/FireBlock.java.patch | 26 +- .../world/level/block/LeavesBlock.java.patch | 2 +- .../world/level/block/MagmaBlock.java.patch | 2 +- .../world/level/block/NoteBlock.java.patch | 4 +- .../level/block/PinkPetalsBlock.java.patch | 11 + .../level/block/PressurePlateBlock.java.patch | 11 + .../world/level/block/SoundType.java.patch | 2 +- .../block/SweetBerryBushBlock.java.patch | 2 +- .../world/level/block/TntBlock.java.patch | 2 +- .../level/block/TrapDoorBlock.java.patch | 11 +- .../world/level/block/VineBlock.java.patch | 14 +- .../WeightedPressurePlateBlock.java.patch | 11 + .../AbstractFurnaceBlockEntity.java.patch | 64 +-- .../entity/BrewingStandBlockEntity.java.patch | 8 +- .../entity/ConduitBlockEntity.java.patch | 2 +- .../block/entity/HopperBlockEntity.java.patch | 2 +- .../grower/AbstractMegaTreeGrower.java.patch | 2 +- .../grower/AbstractTreeGrower.java.patch | 2 +- .../block/state/BlockBehaviour.java.patch | 18 +- .../state/properties/WoodType.java.patch | 14 - .../world/level/chunk/LevelChunk.java.patch | 14 +- .../chunk/storage/ChunkSerializer.java.patch | 2 +- .../chunk/storage/EntityStorage.java.patch | 2 +- .../StructureProcessor.java.patch | 6 +- .../StructureTemplate.java.patch | 30 +- .../AmphibiousNodeEvaluator.java.patch | 2 +- .../pathfinder/BlockPathTypes.java.patch | 3 +- .../pathfinder/WalkNodeEvaluator.java.patch | 38 +- .../storage/LevelStorageSource.java.patch | 6 +- .../level/storage/LevelSummary.java.patch | 2 +- .../storage/PlayerDataStorage.java.patch | 4 +- .../level/storage/PrimaryLevelData.java.patch | 2 +- .../functions/SmeltItemFunction.java.patch | 2 +- .../assets/minecraft/models/item/stick.json | 6 +- .../client/ForgeHooksClient.java | 28 +- .../client/ForgeRenderTypes.java | 1 - .../client/ItemDecoratorHandler.java | 1 - .../event/RegisterParticleProvidersEvent.java | 8 + .../client/extensions/IForgeBakedModel.java | 3 +- .../client/extensions/IForgeMinecraft.java | 2 +- .../client/gui/ModListScreen.java | 2 +- .../client/gui/ScreenUtils.java | 2 - .../client/gui/overlay/ForgeGui.java | 17 +- .../client/gui/overlay/VanillaGuiOverlay.java | 16 +- .../client/gui/widget/ExtendedButton.java | 7 +- .../client/gui/widget/ForgeSlider.java | 8 +- .../client/gui/widget/ScrollPanel.java | 2 - .../client/gui/widget/UnicodeGlyphButton.java | 5 +- .../client/loading/ClientModLoader.java | 4 +- .../client/model/BakedModelWrapper.java | 3 +- .../client/model/SeparateTransformsModel.java | 23 +- .../client/model/generators/ModelBuilder.java | 16 +- .../SeparateTransformsModelBuilder.java | 5 +- .../net/minecraftforge/common/ForgeHooks.java | 2 +- .../net/minecraftforge/common/ForgeMod.java | 2 +- .../common/IExtensibleEnum.java | 4 +- .../common/TierSortingRegistry.java | 2 +- .../common/data/ForgeItemTagsProvider.java | 2 +- .../common/extensions/IForgeBlock.java | 3 +- .../common/extensions/IForgeMenuType.java | 3 +- .../common/loot/IGlobalLootModifier.java | 4 +- .../common/util/FakePlayer.java | 5 +- .../common/world/ClimateSettingsBuilder.java | 26 +- .../event/CreativeModeTabEvent.java | 17 +- .../net/minecraftforge/fluids/FluidType.java | 2 +- .../gametest/BlockPosValueConverter.java | 2 +- .../minecraftforge/items/SlotItemHandler.java | 2 +- .../network/ConnectionData.java | 4 +- .../minecraftforge/network/NetworkHooks.java | 2 +- .../network/NetworkRegistry.java | 25 +- .../network/ServerStatusPing.java | 478 ++++++++---------- .../ForgeDeferredRegistriesSetup.java | 1 + .../registries/ForgeRegistries.java | 11 + .../registries/ForgeRegistry.java | 13 +- .../minecraftforge/registries/GameData.java | 14 + .../registries/IForgeRegistryInternal.java | 3 + .../server/ServerLifecycleHooks.java | 1 - .../server/command/TagsCommand.java | 2 +- .../resources/META-INF/accesstransformer.cfg | 38 +- src/main/resources/forge.exc | 13 +- .../debug/CreativeModeTabTest.java | 6 +- .../debug/DataGeneratorTest.java | 15 +- .../debug/ManyMobEffectsTest.java | 2 +- .../debug/block/CustomSignsTest.java | 3 +- .../debug/chat/ClientCommandTest.java | 2 +- .../debug/client/CustomArmorModelTest.java | 10 +- .../debug/client/CustomColorResolverTest.java | 3 +- .../debug/client/CustomTooltipTest.java | 2 +- ...java => CustomItemDisplayContextTest.java} | 23 +- .../client/model/NewModelLoaderTest.java | 4 +- .../rendering/CustomItemDecorationsTest.java | 2 - .../client/rendering/RenderableTest.java | 2 +- .../loot/GlobalLootModifiersTest.java | 2 +- .../debug/item/EnderMaskTest.java | 2 +- .../debug/item/SnowBootsTest.java | 2 +- .../RecipeBookExtensionClientHelper.java | 3 +- .../recipe/recipebook/RecipeBookTestMenu.java | 2 +- .../recipebook/RecipeBookTestRecipe.java | 15 +- .../RecipeBookTestRecipeSerializer.java | 5 +- .../debug/world/BiomeModifierTest.java | 5 +- .../worldgen/biome/desert.json | 2 +- 347 files changed, 2545 insertions(+), 2436 deletions(-) create mode 100644 patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch create mode 100644 patches/minecraft/net/minecraft/client/gui/components/AbstractButton.java.patch create mode 100644 patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch delete mode 100644 patches/minecraft/net/minecraft/client/resources/language/LanguageInfo.java.patch create mode 100644 patches/minecraft/net/minecraft/client/resources/language/LanguageManager.java.patch create mode 100644 patches/minecraft/net/minecraft/server/advancements/AdvancementVisibilityEvaluator.java.patch create mode 100644 patches/minecraft/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch create mode 100644 patches/minecraft/net/minecraft/world/damagesource/DamageSource.java.patch create mode 100644 patches/minecraft/net/minecraft/world/item/ItemDisplayContext.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/item/PotionItem.java.patch create mode 100644 patches/minecraft/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/item/crafting/UpgradeRecipe.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/level/biome/BiomeSource.java.patch create mode 100644 patches/minecraft/net/minecraft/world/level/block/ButtonBlock.java.patch create mode 100644 patches/minecraft/net/minecraft/world/level/block/DecoratedPotBlock.java.patch create mode 100644 patches/minecraft/net/minecraft/world/level/block/DoorBlock.java.patch create mode 100644 patches/minecraft/net/minecraft/world/level/block/PinkPetalsBlock.java.patch create mode 100644 patches/minecraft/net/minecraft/world/level/block/PressurePlateBlock.java.patch create mode 100644 patches/minecraft/net/minecraft/world/level/block/WeightedPressurePlateBlock.java.patch delete mode 100644 patches/minecraft/net/minecraft/world/level/block/state/properties/WoodType.java.patch rename src/test/java/net/minecraftforge/debug/client/model/{CustomTransformTypeTest.java => CustomItemDisplayContextTest.java} (94%) diff --git a/build.gradle b/build.gradle index 010b5bf835..cc082e51d2 100644 --- a/build.gradle +++ b/build.gradle @@ -42,10 +42,10 @@ ext { ] } MAPPING_CHANNEL = 'official' - MAPPING_VERSION = '1.19.3' - MC_VERSION = '1.19.3' + MAPPING_VERSION = '1.19.4' + MC_VERSION = '1.19.4' MC_NEXT_VERSION = '1.20' - MCP_VERSION = '20221207.122022' + MCP_VERSION = '20230314.122934' SPI_VERSION = '6.0.0' ACCESSTRANSFORMERS_VERSION = '8.0.4' COREMODS_VERSION = '5.0.1' diff --git a/patches/minecraft/com/mojang/blaze3d/platform/GlStateManager.java.patch b/patches/minecraft/com/mojang/blaze3d/platform/GlStateManager.java.patch index 3ffab13337..989a90c8ec 100644 --- a/patches/minecraft/com/mojang/blaze3d/platform/GlStateManager.java.patch +++ b/patches/minecraft/com/mojang/blaze3d/platform/GlStateManager.java.patch @@ -1,7 +1,7 @@ --- a/com/mojang/blaze3d/platform/GlStateManager.java +++ b/com/mojang/blaze3d/platform/GlStateManager.java -@@ -510,9 +_,16 @@ - f_84077_[f_84076_].f_84800_ = false; +@@ -500,9 +_,16 @@ + } + /* Stores the last values sent into glMultiTexCoord2f */ diff --git a/patches/minecraft/com/mojang/blaze3d/platform/Window.java.patch b/patches/minecraft/com/mojang/blaze3d/platform/Window.java.patch index 240d6002a8..f6b8fa7f5e 100644 --- a/patches/minecraft/com/mojang/blaze3d/platform/Window.java.patch +++ b/patches/minecraft/com/mojang/blaze3d/platform/Window.java.patch @@ -9,7 +9,7 @@ if (monitor != null) { VideoMode videomode = monitor.m_84948_(this.f_85355_ ? this.f_85354_ : Optional.empty()); this.f_85350_ = this.f_85357_ = monitor.m_84951_() + videomode.m_85332_() / 2 - this.f_85359_ / 2; -@@ -263,6 +_,7 @@ +@@ -260,6 +_,7 @@ GLFW.glfwGetFramebufferSize(this.f_85349_, aint, aint1); this.f_85361_ = aint[0] > 0 ? aint[0] : 1; this.f_85362_ = aint1[0] > 0 ? aint1[0] : 1; diff --git a/patches/minecraft/com/mojang/math/Transformation.java.patch b/patches/minecraft/com/mojang/math/Transformation.java.patch index 334eda319d..6f77b734da 100644 --- a/patches/minecraft/com/mojang/math/Transformation.java.patch +++ b/patches/minecraft/com/mojang/math/Transformation.java.patch @@ -1,15 +1,15 @@ --- a/com/mojang/math/Transformation.java +++ b/com/mojang/math/Transformation.java -@@ -12,7 +_,7 @@ +@@ -14,7 +_,7 @@ import org.joml.Vector3f; import org.joml.Vector3fc; -public final class Transformation { +public final class Transformation implements net.minecraftforge.client.extensions.IForgeTransformation { private final Matrix4f f_121078_; - private boolean f_121079_; - @Nullable -@@ -139,6 +_,19 @@ + public static final Codec f_268453_ = RecordCodecBuilder.create((p_269604_) -> { + return p_269604_.group(ExtraCodecs.f_252432_.fieldOf("translation").forGetter((p_269599_) -> { +@@ -163,6 +_,19 @@ public int hashCode() { return Objects.hash(this.f_121078_); } diff --git a/patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch b/patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch new file mode 100644 index 0000000000..55671954eb --- /dev/null +++ b/patches/minecraft/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch @@ -0,0 +1,15 @@ +--- a/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java ++++ b/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java +@@ -47,9 +_,9 @@ + } + }; + private final RealmsNotificationsScreen.DataFetcherConfiguration f_273849_ = new RealmsNotificationsScreen.DataFetcherConfiguration() { +- public DataFetcher.Subscription m_274316_(RealmsDataFetcher p_275731_) { +- DataFetcher.Subscription datafetcher$subscription = p_275731_.f_238549_.m_239139_(); +- RealmsNotificationsScreen.this.m_274585_(p_275731_, datafetcher$subscription); ++ public DataFetcher.Subscription m_274316_(RealmsDataFetcher p_275318_) { ++ DataFetcher.Subscription datafetcher$subscription = p_275318_.f_238549_.m_239139_(); ++ RealmsNotificationsScreen.this.m_274585_(p_275318_, datafetcher$subscription); + return datafetcher$subscription; + } + diff --git a/patches/minecraft/net/minecraft/SharedConstants.java.patch b/patches/minecraft/net/minecraft/SharedConstants.java.patch index 7145ef6610..9010dcb701 100644 --- a/patches/minecraft/net/minecraft/SharedConstants.java.patch +++ b/patches/minecraft/net/minecraft/SharedConstants.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/SharedConstants.java +++ b/net/minecraft/SharedConstants.java -@@ -214,6 +_,7 @@ +@@ -205,6 +_,7 @@ } static { diff --git a/patches/minecraft/net/minecraft/Util.java.patch b/patches/minecraft/net/minecraft/Util.java.patch index 93e6856bd0..1467c6c9ef 100644 --- a/patches/minecraft/net/minecraft/Util.java.patch +++ b/patches/minecraft/net/minecraft/Util.java.patch @@ -9,12 +9,12 @@ + @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT1 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } }; + @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT2 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } }; + - public static ExecutorService m_183988_() { - return f_137443_; + public static ExecutorService m_183991_() { + return f_137444_; } -@@ -242,7 +_,7 @@ +@@ -238,7 +_,7 @@ try { - type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_183709_().getWorldVersion())).getChoiceType(p_137552_, p_137553_); + type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_183709_().m_183476_().m_193006_())).getChoiceType(p_137552_, p_137553_); } catch (IllegalArgumentException illegalargumentexception) { - f_137446_.error("No data fixer registered for {}", (Object)p_137553_); + f_137446_.debug("No data fixer registered for {}", (Object)p_137553_); diff --git a/patches/minecraft/net/minecraft/advancements/Advancement.java.patch b/patches/minecraft/net/minecraft/advancements/Advancement.java.patch index 1889d49045..601c037b38 100644 --- a/patches/minecraft/net/minecraft/advancements/Advancement.java.patch +++ b/patches/minecraft/net/minecraft/advancements/Advancement.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/advancements/Advancement.java +++ b/net/minecraft/advancements/Advancement.java -@@ -127,7 +_,7 @@ +@@ -144,7 +_,7 @@ return this.f_138305_; } @@ -9,7 +9,7 @@ @Nullable private ResourceLocation f_138332_; @Nullable -@@ -308,7 +_,14 @@ +@@ -325,7 +_,14 @@ return "Task Advancement{parentId=" + this.f_138332_ + ", display=" + this.f_138334_ + ", rewards=" + this.f_138335_ + ", criteria=" + this.f_138336_ + ", requirements=" + Arrays.deepToString(this.f_138337_) + "}"; } diff --git a/patches/minecraft/net/minecraft/client/ClientRecipeBook.java.patch b/patches/minecraft/net/minecraft/client/ClientRecipeBook.java.patch index 3bfe868c4e..410833f64a 100644 --- a/patches/minecraft/net/minecraft/client/ClientRecipeBook.java.patch +++ b/patches/minecraft/net/minecraft/client/ClientRecipeBook.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/ClientRecipeBook.java +++ b/net/minecraft/client/ClientRecipeBook.java -@@ -51,7 +_,7 @@ +@@ -54,7 +_,7 @@ for(Recipe recipe : p_90643_) { if (!recipe.m_5598_() && !recipe.m_142505_()) { RecipeBookCategories recipebookcategories = m_90646_(recipe); @@ -9,7 +9,7 @@ if (s.isEmpty()) { map.computeIfAbsent(recipebookcategories, (p_90645_) -> { return Lists.newArrayList(); -@@ -138,6 +_,8 @@ +@@ -141,6 +_,8 @@ } else if (recipetype == RecipeType.f_44113_) { return RecipeBookCategories.SMITHING; } else { diff --git a/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch b/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch index 1abb83aa27..fc160abf2b 100644 --- a/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/client/KeyboardHandler.java +++ b/net/minecraft/client/KeyboardHandler.java -@@ -298,7 +_,9 @@ +@@ -328,7 +_,9 @@ + } } - Screen screen = this.f_90867_.f_91080_; - if (p_90897_ == 1 && (!(this.f_90867_.f_91080_ instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).f_193976_ <= Util.m_137550_() - 20L)) { + + if ((!(this.f_90867_.f_91080_ instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).f_193976_ <= Util.m_137550_() - 20L)) { @@ -11,7 +11,7 @@ if (this.f_90867_.f_91066_.f_92105_.m_90832_(p_90895_, p_90896_)) { this.f_90867_.m_91268_().m_85438_(); this.f_90867_.f_91066_.m_231829_().m_231514_(this.f_90867_.m_91268_().m_85440_()); -@@ -316,6 +_,8 @@ +@@ -346,6 +_,8 @@ }); return; } @@ -20,7 +20,7 @@ } if (this.f_90867_.m_240477_().m_93316_()) { -@@ -338,11 +_,15 @@ +@@ -368,11 +_,15 @@ Screen.m_96579_(() -> { if (p_90897_ != 1 && p_90897_ != 2) { if (p_90897_ == 0) { @@ -38,7 +38,7 @@ } }, "keyPressed event handler", screen.getClass().getCanonicalName()); -@@ -395,22 +_,26 @@ +@@ -425,22 +_,26 @@ } } } diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index cc76127817..e570be48c5 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 -@@ -245,7 +_,7 @@ +@@ -247,7 +_,7 @@ import org.slf4j.Logger; @OnlyIn(Dist.CLIENT) @@ -9,7 +9,7 @@ static Minecraft f_90981_; private static final Logger f_90982_ = LogUtils.getLogger(); public static final boolean f_91002_ = Util.m_137581_() == Util.OS.OSX; -@@ -410,7 +_,6 @@ +@@ -412,7 +_,6 @@ this.f_231339_ = SignatureValidator.m_216358_(this.f_231338_.getServicesKey()); this.f_90998_ = p_91084_.f_101905_.f_101942_; f_90982_.info("Setting user: {}", (Object)this.f_90998_.m_92546_()); @@ -17,7 +17,7 @@ this.f_91033_ = p_91084_.f_101908_.f_101926_; this.f_91034_ = !p_91084_.f_101908_.f_101929_; this.f_91035_ = !p_91084_.f_101908_.f_101930_; -@@ -459,7 +_,7 @@ +@@ -462,7 +_,7 @@ this.f_90990_.m_85380_(this.f_91066_.m_232035_().m_231551_()); this.f_91067_ = new MouseHandler(this); @@ -26,7 +26,7 @@ this.f_91068_ = new KeyboardHandler(this); this.f_91068_.m_90887_(this.f_90990_.m_85439_()); RenderSystem.m_69580_(this.f_91066_.f_92035_, false); -@@ -467,6 +_,7 @@ +@@ -470,6 +_,7 @@ this.f_91042_.m_83931_(0.0F, 0.0F, 0.0F, 0.0F); this.f_91042_.m_83954_(f_91002_); this.f_91036_ = new ReloadableResourceManager(PackType.CLIENT_RESOURCES); @@ -34,7 +34,7 @@ this.f_91038_.m_10506_(); this.f_91066_.m_92145_(this.f_91038_); this.f_91039_ = new LanguageManager(this.f_91066_.f_92075_); -@@ -511,10 +_,13 @@ +@@ -514,10 +_,13 @@ this.f_91063_ = new GameRenderer(this, this.f_90994_.m_234586_(), this.f_91036_, this.f_90993_); this.f_91036_.m_7217_(this.f_91063_.m_247116_()); this.f_91060_ = new LevelRenderer(this, this.f_90994_, this.f_167845_, this.f_90993_); @@ -49,7 +49,7 @@ this.f_91036_.m_7217_(this.f_91061_); this.f_91053_ = new PaintingTextureManager(this.f_90987_); this.f_91036_.m_7217_(this.f_91053_); -@@ -523,7 +_,9 @@ +@@ -526,7 +_,9 @@ this.f_91047_ = new GpuWarnlistManager(); this.f_91036_.m_7217_(this.f_91047_); this.f_91036_.m_7217_(this.f_205120_); @@ -60,7 +60,7 @@ this.f_91064_ = new DebugRenderer(this); this.f_238717_ = new RealmsDataFetcher(RealmsClient.m_239151_(this)); RenderSystem.m_69900_(this::m_91113_); -@@ -542,6 +_,21 @@ +@@ -545,6 +_,21 @@ TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false); } @@ -82,7 +82,7 @@ this.f_90990_.m_85409_(this.f_91066_.m_231817_().m_231551_()); this.f_90990_.m_85424_(this.f_91066_.m_232123_().m_231551_()); this.f_90990_.m_85426_(); -@@ -565,24 +_,24 @@ +@@ -568,26 +_,24 @@ } this.f_167847_.m_168556_(); @@ -117,13 +117,15 @@ - - this.m_91152_(new TitleScreen(true)); - }, this.m_239210_())); +- } else if (this.f_91066_.f_263744_) { +- this.m_91152_(new AccessibilityOnboardingScreen(this.f_91066_)); - } else { - this.m_91152_(new TitleScreen(true)); - } } -@@ -634,6 +_,8 @@ +@@ -639,6 +_,8 @@ private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) { try { @@ -132,7 +134,7 @@ return p_193586_.createUserApiService(p_193587_.f_101905_.f_101942_.m_92547_()); } catch (AuthenticationException authenticationexception) { f_90982_.error("Failed to verify authentication", (Throwable)authenticationexception); -@@ -646,7 +_,7 @@ +@@ -651,7 +_,7 @@ } private void m_91239_(Throwable p_91240_) { @@ -141,7 +143,7 @@ this.m_91241_(p_91240_, (Component)null); } else { Util.m_137559_(p_91240_); -@@ -723,7 +_,10 @@ +@@ -743,7 +_,10 @@ } public void m_91271_() { @@ -153,7 +155,7 @@ return new FullTextSearchTree<>((p_210797_) -> { return p_210797_.m_41651_((Player)null, TooltipFlag.Default.f_256752_.m_257777_()).stream().map((p_210807_) -> { return ChatFormatting.m_126649_(p_210807_.getString()).trim(); -@@ -734,7 +_,8 @@ +@@ -754,7 +_,8 @@ return Stream.of(BuiltInRegistries.f_257033_.m_7981_(p_91317_.m_41720_())); }, p_231451_); }); @@ -163,7 +165,7 @@ return new IdSearchTree<>((p_231353_) -> { return p_231353_.m_204131_().map(TagKey::f_203868_); }, p_231430_); -@@ -754,9 +_,12 @@ +@@ -774,9 +_,12 @@ }); }, p_231389_); }); @@ -179,7 +181,7 @@ }); } -@@ -808,13 +_,13 @@ +@@ -828,13 +_,13 @@ Bootstrap.m_135875_(p_91333_.m_127526_()); if (p_91333_.m_127527_() != null) { Bootstrap.m_135875_("#@!@# Game crashed! Crash report saved to: #@!@# " + p_91333_.m_127527_()); @@ -196,7 +198,7 @@ } } -@@ -932,10 +_,6 @@ +@@ -959,10 +_,6 @@ f_90982_.error("setScreen called from non-game thread"); } @@ -207,7 +209,7 @@ if (p_91153_ == null && this.f_91073_ == null) { p_91153_ = new TitleScreen(); } else if (p_91153_ == null && this.f_91074_.m_21224_()) { -@@ -946,6 +_,19 @@ +@@ -973,6 +_,19 @@ } } @@ -225,9 +227,9 @@ + } + this.f_91080_ = p_91153_; - BufferUploader.m_166835_(); - if (p_91153_ != null) { -@@ -1091,11 +_,14 @@ + if (this.f_91080_ != null) { + this.f_91080_.m_274333_(); +@@ -1118,9 +_,12 @@ RenderSystem.m_69481_(); this.f_91026_.m_7238_(); if (!this.f_91079_) { @@ -235,14 +237,12 @@ + net.minecraftforge.event.ForgeEventFactory.onRenderTickStart(this.realPartialTick); this.f_91026_.m_6182_("gameRenderer"); this.f_91063_.m_109093_(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_, i, p_91384_); - this.f_91026_.m_6182_("toasts"); - this.f_91003_.m_94920_(new PoseStack()); this.f_91026_.m_7238_(); + net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(this.realPartialTick); } if (this.f_91056_ != null) { -@@ -1223,10 +_,12 @@ +@@ -1243,10 +_,12 @@ this.f_90990_.m_85378_((double)i); if (this.f_91080_ != null) { this.f_91080_.m_6574_(this, this.f_90990_.m_85445_(), this.f_90990_.m_85446_()); @@ -255,7 +255,7 @@ this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_()); this.f_91067_.m_91599_(); } -@@ -1499,6 +_,7 @@ +@@ -1520,6 +_,7 @@ } public void m_91395_() { @@ -263,7 +263,7 @@ this.f_91019_ = false; } -@@ -1528,10 +_,18 @@ +@@ -1549,10 +_,18 @@ if (p_91387_ && this.f_91077_ != null && this.f_91077_.m_6662_() == HitResult.Type.BLOCK) { BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_; BlockPos blockpos = blockhitresult.m_82425_(); @@ -285,7 +285,7 @@ this.f_91074_.m_6674_(InteractionHand.MAIN_HAND); } } -@@ -1560,14 +_,20 @@ +@@ -1581,14 +_,20 @@ return false; } else { boolean flag = false; @@ -308,7 +308,7 @@ this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_()); if (this.f_91073_.m_8055_(blockpos).m_60795_()) { flag = true; -@@ -1580,8 +_,10 @@ +@@ -1601,8 +_,10 @@ } this.f_91074_.m_36334_(); @@ -319,7 +319,7 @@ this.f_91074_.m_6674_(InteractionHand.MAIN_HAND); return flag; } -@@ -1597,6 +_,11 @@ +@@ -1618,6 +_,11 @@ } for(InteractionHand interactionhand : InteractionHand.values()) { @@ -331,7 +331,7 @@ ItemStack itemstack = this.f_91074_.m_21120_(interactionhand); if (!itemstack.m_246617_(this.f_91073_.m_246046_())) { return; -@@ -1611,13 +_,14 @@ +@@ -1632,13 +_,14 @@ return; } @@ -347,7 +347,7 @@ this.f_91074_.m_6674_(interactionhand); } -@@ -1629,7 +_,7 @@ +@@ -1650,7 +_,7 @@ int i = itemstack.m_41613_(); InteractionResult interactionresult1 = this.f_91072_.m_233732_(this.f_91074_, interactionhand, blockhitresult); if (interactionresult1.m_19077_()) { @@ -356,7 +356,7 @@ this.f_91074_.m_6674_(interactionhand); if (!itemstack.m_41619_() && (itemstack.m_41613_() != i || this.f_91072_.m_105290_())) { this.f_91063_.f_109055_.m_109320_(interactionhand); -@@ -1645,6 +_,9 @@ +@@ -1666,6 +_,9 @@ } } @@ -366,7 +366,7 @@ if (!itemstack.m_41619_()) { InteractionResult interactionresult2 = this.f_91072_.m_233721_(this.f_91074_, interactionhand); if (interactionresult2.m_19077_()) { -@@ -1671,6 +_,8 @@ +@@ -1692,6 +_,8 @@ --this.f_91011_; } @@ -375,7 +375,7 @@ this.f_91026_.m_6180_("gui"); this.f_240378_.m_240688_(); this.f_91065_.m_193832_(this.f_91012_); -@@ -1766,6 +_,7 @@ +@@ -1787,6 +_,7 @@ this.f_91005_.m_120596_(); @@ -383,7 +383,7 @@ try { this.f_91073_.m_104726_(() -> { return true; -@@ -1781,6 +_,7 @@ +@@ -1802,6 +_,7 @@ throw new ReportedException(crashreport); } @@ -391,7 +391,7 @@ } this.f_91026_.m_6182_("animateTick"); -@@ -1800,6 +_,8 @@ +@@ -1821,6 +_,8 @@ this.f_91026_.m_6182_("keyboard"); this.f_91068_.m_90931_(); this.f_91026_.m_7238_(); @@ -400,7 +400,7 @@ } private boolean m_91278_() { -@@ -1996,6 +_,7 @@ +@@ -2017,6 +_,7 @@ } public void m_91156_(ClientLevel p_91157_) { @@ -408,7 +408,7 @@ ProgressScreen progressscreen = new ProgressScreen(true); progressscreen.m_6309_(Component.m_237115_("connect.joining")); this.m_91362_(progressscreen); -@@ -2029,10 +_,12 @@ +@@ -2050,10 +_,12 @@ IntegratedServer integratedserver = this.f_91007_; this.f_91007_ = null; this.f_91063_.m_109150_(); @@ -421,15 +421,15 @@ if (integratedserver != null) { this.f_91026_.m_6180_("waitForServer"); -@@ -2046,6 +_,7 @@ +@@ -2067,6 +_,7 @@ this.f_243981_.m_246151_(); this.f_91065_.m_93089_(); this.f_91010_ = false; + net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(f_91073_); - this.f_91004_.m_90740_(); } -@@ -2153,6 +_,7 @@ + this.f_91073_ = null; +@@ -2173,6 +_,7 @@ private void m_91280_() { if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) { @@ -437,7 +437,7 @@ boolean flag = this.f_91074_.m_150110_().f_35937_; BlockEntity blockentity = null; HitResult.Type hitresult$type = this.f_91077_.m_6662_(); -@@ -2165,10 +_,7 @@ +@@ -2185,10 +_,7 @@ } Block block = blockstate.m_60734_(); @@ -449,7 +449,7 @@ if (flag && Screen.m_96637_() && blockstate.m_155947_()) { blockentity = this.f_91073_.m_7702_(blockpos); -@@ -2179,7 +_,7 @@ +@@ -2199,7 +_,7 @@ } Entity entity = ((EntityHitResult)this.f_91077_).m_82443_(); @@ -458,7 +458,7 @@ if (itemstack == null) { return; } -@@ -2721,6 +_,19 @@ +@@ -2737,6 +_,19 @@ public void m_91312_(int p_91313_) { this.f_91051_.m_119410_(p_91313_); diff --git a/patches/minecraft/net/minecraft/client/MouseHandler.java.patch b/patches/minecraft/net/minecraft/client/MouseHandler.java.patch index d40024713f..24a71833e9 100644 --- a/patches/minecraft/net/minecraft/client/MouseHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/MouseHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/MouseHandler.java +++ b/net/minecraft/client/MouseHandler.java -@@ -69,6 +_,7 @@ +@@ -73,6 +_,7 @@ this.f_91510_ = -1; } @@ -8,7 +8,7 @@ boolean[] aboolean = new boolean[]{false}; if (this.f_91503_.m_91265_() == null) { if (this.f_91503_.f_91080_ == null) { -@@ -82,11 +_,19 @@ +@@ -86,11 +_,19 @@ if (flag) { screen.m_169415_(); Screen.m_96579_(() -> { @@ -30,7 +30,7 @@ }, "mouseReleased event handler", screen.getClass().getCanonicalName()); } } -@@ -110,19 +_,26 @@ +@@ -114,19 +_,26 @@ } } } @@ -60,7 +60,7 @@ } else if (this.f_91503_.f_91074_ != null) { if (this.f_91518_ != 0.0D && Math.signum(d0) != Math.signum(this.f_91518_)) { this.f_91518_ = 0.0D; -@@ -135,6 +_,7 @@ +@@ -139,6 +_,7 @@ } this.f_91518_ -= (double)i; @@ -68,7 +68,7 @@ if (this.f_91503_.f_91074_.m_5833_()) { if (this.f_91503_.f_91065_.m_93085_().m_94768_()) { this.f_91503_.f_91065_.m_93085_().m_205380_(-i); -@@ -203,7 +_,9 @@ +@@ -207,7 +_,9 @@ double d2 = (p_91563_ - this.f_91507_) * (double)this.f_91503_.m_91268_().m_85445_() / (double)this.f_91503_.m_91268_().m_85443_(); double d3 = (p_91564_ - this.f_91508_) * (double)this.f_91503_.m_91268_().m_85446_() / (double)this.f_91503_.m_91268_().m_85444_(); Screen.m_96579_(() -> { @@ -79,7 +79,7 @@ }, "mouseDragged event handler", screen.getClass().getCanonicalName()); } -@@ -286,6 +_,14 @@ +@@ -290,6 +_,14 @@ public double m_91594_() { return this.f_91508_; diff --git a/patches/minecraft/net/minecraft/client/Options.java.patch b/patches/minecraft/net/minecraft/client/Options.java.patch index cbb162e479..a405230e79 100644 --- a/patches/minecraft/net/minecraft/client/Options.java.patch +++ b/patches/minecraft/net/minecraft/client/Options.java.patch @@ -1,16 +1,16 @@ --- a/net/minecraft/client/Options.java +++ b/net/minecraft/client/Options.java -@@ -507,7 +_,8 @@ +@@ -544,7 +_,8 @@ }, new OptionInstance.LazyEnum<>(() -> { return Stream.concat(Stream.of(""), Minecraft.m_91087_().m_91106_().m_194525_().stream()).toList(); }, (p_232011_) -> { - return Minecraft.m_91087_().m_91396_() && p_232011_ != "" && !Minecraft.m_91087_().m_91106_().m_194525_().contains(p_232011_) ? Optional.empty() : Optional.of(p_232011_); + // FORGE: fix incorrect string comparison - PR #8767 + return Minecraft.m_91087_().m_91396_() && (p_232011_ == null || !p_232011_.isEmpty()) && !Minecraft.m_91087_().m_91106_().m_194525_().contains(p_232011_) ? Optional.empty() : Optional.of(p_232011_); - }, Codec.STRING), "", (p_231994_) -> { + }, Codec.STRING), "", (p_275584_) -> { SoundManager soundmanager = Minecraft.m_91087_().m_91106_(); soundmanager.m_194526_(); -@@ -788,6 +_,7 @@ +@@ -868,6 +_,7 @@ } public Options(Minecraft p_92138_, File p_92139_) { @@ -18,9 +18,9 @@ this.f_92060_ = p_92138_; this.f_92110_ = new File(p_92139_, "options.txt"); boolean flag = p_92138_.m_91103_(); -@@ -904,11 +_,20 @@ - p_168428_.m_213982_("panoramaScrollSpeed", this.f_244402_); +@@ -989,11 +_,20 @@ p_168428_.m_213982_("telemetryOptInExtra", this.f_260461_); + this.f_263744_ = p_168428_.m_142682_("onboardAccessibility", this.f_263744_); + processOptionsForge(p_168428_); + } @@ -41,7 +41,7 @@ } } -@@ -927,6 +_,9 @@ +@@ -1012,6 +_,9 @@ } public void m_92140_() { @@ -51,7 +51,7 @@ try { if (!this.f_92110_.exists()) { return; -@@ -955,7 +_,8 @@ +@@ -1040,7 +_,8 @@ } } @@ -61,7 +61,7 @@ @Nullable private String m_168458_(String p_168459_) { return compoundtag1.m_128441_(p_168459_) ? compoundtag1.m_128461_(p_168459_) : null; -@@ -1118,6 +_,7 @@ +@@ -1203,6 +_,7 @@ } public void m_92172_() { @@ -69,7 +69,7 @@ if (this.f_92060_.f_91074_ != null) { int i = 0; -@@ -1182,6 +_,23 @@ +@@ -1267,6 +_,23 @@ } p_92146_.m_10509_(set); diff --git a/patches/minecraft/net/minecraft/client/color/block/BlockColors.java.patch b/patches/minecraft/net/minecraft/client/color/block/BlockColors.java.patch index 7fd181a6f7..fcfa2a859c 100644 --- a/patches/minecraft/net/minecraft/client/color/block/BlockColors.java.patch +++ b/patches/minecraft/net/minecraft/client/color/block/BlockColors.java.patch @@ -10,7 +10,7 @@ private final Map>> f_92572_ = Maps.newHashMap(); public static BlockColors m_92574_() { -@@ -73,11 +_,12 @@ +@@ -80,11 +_,12 @@ blockcolors.m_92589_((p_92596_, p_92597_, p_92598_, p_92599_) -> { return p_92597_ != null && p_92598_ != null ? 2129968 : 7455580; }, Blocks.f_50196_); @@ -24,7 +24,7 @@ if (blockcolor != null) { return blockcolor.m_92566_(p_92583_, (BlockAndTintGetter)null, (BlockPos)null, 0); } else { -@@ -87,13 +_,15 @@ +@@ -94,13 +_,15 @@ } public int m_92577_(BlockState p_92578_, @Nullable BlockAndTintGetter p_92579_, @Nullable BlockPos p_92580_, int p_92581_) { diff --git a/patches/minecraft/net/minecraft/client/gui/Font.java.patch b/patches/minecraft/net/minecraft/client/gui/Font.java.patch index a7ee8318a8..4f198f6b3e 100644 --- a/patches/minecraft/net/minecraft/client/gui/Font.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/Font.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/Font.java +++ b/net/minecraft/client/gui/Font.java -@@ -34,7 +_,7 @@ +@@ -33,7 +_,7 @@ import org.joml.Vector3f; @OnlyIn(Dist.CLIENT) @@ -9,7 +9,7 @@ private static final float f_168643_ = 0.01F; private static final Vector3f f_92712_ = new Vector3f(0.0F, 0.0F, 0.03F); public static final int f_193827_ = 8; -@@ -261,6 +_,8 @@ +@@ -260,6 +_,8 @@ public StringSplitter m_92865_() { return this.f_92714_; } diff --git a/patches/minecraft/net/minecraft/client/gui/Gui.java.patch b/patches/minecraft/net/minecraft/client/gui/Gui.java.patch index c8e5eb3dd8..f3d72067d4 100644 --- a/patches/minecraft/net/minecraft/client/gui/Gui.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/Gui.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/Gui.java +++ b/net/minecraft/client/gui/Gui.java -@@ -392,6 +_,7 @@ +@@ -374,6 +_,7 @@ if (this.f_92986_.f_91076_ != null && this.f_92986_.f_91076_ instanceof LivingEntity && f >= 1.0F) { flag = this.f_92986_.f_91074_.m_36333_() > 5.0F; flag &= this.f_92986_.f_91076_.m_6084_(); @@ -8,7 +8,7 @@ } int j = this.f_92978_ / 2 - 7 + 16; -@@ -444,6 +_,10 @@ +@@ -428,6 +_,10 @@ for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) { MobEffect mobeffect = mobeffectinstance.m_19544_(); @@ -19,15 +19,15 @@ if (mobeffectinstance.m_19575_()) { int i = this.f_92977_; int j = 1; -@@ -472,6 +_,7 @@ +@@ -456,6 +_,7 @@ } } -+ if (renderer.renderGuiIcon(mobeffectinstance, this, p_93029_, i, j, this.m_93252_(), f)) continue; ++ if (renderer.renderGuiIcon(mobeffectinstance, this, p_93029_, i, j, 0, f)) continue; TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect); - int l = i; int i1 = j; -@@ -603,12 +_,13 @@ + float f1 = f; +@@ -583,12 +_,13 @@ public void m_93069_(PoseStack p_93070_) { this.f_92986_.m_91307_().m_6180_("selectedItemName"); if (this.f_92993_ > 0 && !this.f_92994_.m_41619_()) { @@ -43,9 +43,9 @@ int j = (this.f_92977_ - i) / 2; int k = this.f_92978_ - 59; if (!this.f_92986_.f_91072_.m_105205_()) { -@@ -624,7 +_,13 @@ - RenderSystem.m_69478_(); - RenderSystem.m_69453_(); +@@ -602,7 +_,13 @@ + + if (l > 0) { m_93172_(p_93070_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.f_92986_.f_91066_.m_92143_(0)); - this.m_93082_().m_92763_(p_93070_, mutablecomponent, (float)j, (float)k, 16777215 + (l << 24)); + Font font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(f_92994_).getFont(f_92994_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.SELECTED_ITEM_NAME); @@ -55,10 +55,19 @@ + j = (this.f_92977_ - font.m_92852_(highlightTip)) / 2; + font.m_92763_(p_93070_, highlightTip, (float)j, (float)k, 16777215 + (l << 24)); + } - RenderSystem.m_69461_(); } } -@@ -1138,7 +_,7 @@ + +@@ -924,7 +_,7 @@ + RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); + } + +- public void m_264541_(PoseStack p_265563_, float p_265127_) { ++ protected void m_264541_(PoseStack p_265563_, float p_265127_) { + RenderSystem.m_69465_(); + RenderSystem.m_69458_(false); + float f = (float)Math.min(this.f_92977_, this.f_92978_); +@@ -1054,7 +_,7 @@ ItemStack itemstack = this.f_92986_.f_91074_.m_150109_().m_36056_(); if (itemstack.m_41619_()) { this.f_92993_ = 0; diff --git a/patches/minecraft/net/minecraft/client/gui/components/AbstractButton.java.patch b/patches/minecraft/net/minecraft/client/gui/components/AbstractButton.java.patch new file mode 100644 index 0000000000..367c41c254 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/components/AbstractButton.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/gui/components/AbstractButton.java ++++ b/net/minecraft/client/gui/components/AbstractButton.java +@@ -32,7 +_,7 @@ + RenderSystem.m_69482_(); + m_275833_(p_275468_, this.m_252754_(), this.m_252907_(), this.m_5711_(), this.m_93694_(), 20, 4, 200, 20, 0, this.m_274533_()); + RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); +- int i = this.f_93623_ ? 16777215 : 10526880; ++ int i = getFGColor(); + this.m_274375_(p_275468_, minecraft.f_91062_, i | Mth.m_14167_(this.f_93625_ * 255.0F) << 24); + } + diff --git a/patches/minecraft/net/minecraft/client/gui/components/AbstractSelectionList.java.patch b/patches/minecraft/net/minecraft/client/gui/components/AbstractSelectionList.java.patch index 058d0ec6ad..d142c31c58 100644 --- a/patches/minecraft/net/minecraft/client/gui/components/AbstractSelectionList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/components/AbstractSelectionList.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/client/gui/components/AbstractSelectionList.java +++ b/net/minecraft/client/gui/components/AbstractSelectionList.java -@@ -536,6 +_,13 @@ - +@@ -515,6 +_,13 @@ + return new ScreenRectangle(this.f_93393_, this.f_93390_, this.f_93392_ - this.f_93393_, this.f_93391_ - this.f_93390_); } + public int getWidth() { return this.f_93388_; } @@ -12,5 +12,5 @@ + public int getRight() { return this.f_93392_; } + @OnlyIn(Dist.CLIENT) - public abstract static class Entry> implements GuiEventListener { + protected abstract static class Entry> implements GuiEventListener { /** @deprecated */ diff --git a/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch b/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch index e4acb16f72..632d4d329c 100644 --- a/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch @@ -1,15 +1,6 @@ --- a/net/minecraft/client/gui/components/AbstractWidget.java +++ b/net/minecraft/client/gui/components/AbstractWidget.java -@@ -130,7 +_,7 @@ - this.m_93228_(p_93676_, this.m_252754_(), this.m_252907_(), 0, 46 + i * 20, this.f_93618_ / 2, this.f_93619_); - this.m_93228_(p_93676_, this.m_252754_() + this.f_93618_ / 2, this.m_252907_(), 200 - this.f_93618_ / 2, 46 + i * 20, this.f_93618_ / 2, this.f_93619_); - this.m_7906_(p_93676_, minecraft, p_93677_, p_93678_); -- int j = this.f_93623_ ? 16777215 : 10526880; -+ int j = getFGColor(); - m_93215_(p_93676_, font, this.m_6035_(), this.m_252754_() + this.f_93618_ / 2, this.m_252907_() + (this.f_93619_ - 8) / 2, j | Mth.m_14167_(this.f_93625_ * 255.0F) << 24); - } - -@@ -222,6 +_,10 @@ +@@ -231,6 +_,10 @@ this.f_93618_ = p_93675_; } @@ -20,9 +11,9 @@ public void m_93650_(float p_93651_) { this.f_93625_ = p_93651_; } -@@ -244,6 +_,19 @@ +@@ -261,6 +_,19 @@ - protected void m_93692_(boolean p_93693_) { + public void m_93692_(boolean p_93693_) { this.f_93616_ = p_93693_; + } + diff --git a/patches/minecraft/net/minecraft/client/gui/components/BossHealthOverlay.java.patch b/patches/minecraft/net/minecraft/client/gui/components/BossHealthOverlay.java.patch index dc9bff42cf..5ff74c5bb1 100644 --- a/patches/minecraft/net/minecraft/client/gui/components/BossHealthOverlay.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/components/BossHealthOverlay.java.patch @@ -6,10 +6,10 @@ int k = i / 2 - 91; + var event = net.minecraftforge.client.ForgeHooksClient.onCustomizeBossEventProgress(p_93705_, this.f_93698_.m_91268_(), lerpingbossevent, k, j, 10 + this.f_93698_.f_91062_.f_92710_); + if (!event.isCanceled()) { - RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.m_157456_(0, f_93697_); this.m_93706_(p_93705_, k, j, lerpingbossevent); -@@ -42,7 +_,8 @@ + Component component = lerpingbossevent.m_18861_(); +@@ -41,7 +_,8 @@ int i1 = i / 2 - l / 2; int j1 = j - 9; this.f_93698_.f_91062_.m_92763_(p_93705_, component, (float)i1, (float)j1, 16777215); diff --git a/patches/minecraft/net/minecraft/client/gui/components/toasts/ToastComponent.java.patch b/patches/minecraft/net/minecraft/client/gui/components/toasts/ToastComponent.java.patch index 1c28e1f2a8..8ffabd5e66 100644 --- a/patches/minecraft/net/minecraft/client/gui/components/toasts/ToastComponent.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/components/toasts/ToastComponent.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/components/toasts/ToastComponent.java +++ b/net/minecraft/client/gui/components/toasts/ToastComponent.java -@@ -103,6 +_,7 @@ +@@ -102,6 +_,7 @@ } public void m_94922_(Toast p_94923_) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/LoadingOverlay.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/LoadingOverlay.java.patch index eb571f0e2f..3fd6dfddbe 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/LoadingOverlay.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/LoadingOverlay.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/LoadingOverlay.java +++ b/net/minecraft/client/gui/screens/LoadingOverlay.java -@@ -121,6 +_,7 @@ +@@ -119,6 +_,7 @@ int k1 = (int)((double)this.f_96163_.m_91268_().m_85446_() * 0.8325D); float f6 = this.f_96164_.m_7750_(); this.f_96167_ = Mth.m_14036_(this.f_96167_ * 0.95F + f6 * 0.050000012F, 0.0F, 1.0F); @@ -8,7 +8,7 @@ if (f < 1.0F) { this.m_96182_(p_96178_, i / 2 - j1, k1 - 5, i / 2 + j1, k1 + 5, 1.0F - Mth.m_14036_(f, 0.0F, 1.0F)); } -@@ -130,6 +_,7 @@ +@@ -128,6 +_,7 @@ } if (this.f_96168_ == -1L && this.f_96164_.m_7746_() && (!this.f_96166_ || f1 >= 2.0F)) { @@ -16,7 +16,7 @@ try { this.f_96164_.m_7748_(); this.f_96165_.accept(Optional.empty()); -@@ -137,7 +_,6 @@ +@@ -135,7 +_,6 @@ this.f_96165_.accept(Optional.of(throwable)); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch index 366ec53b4e..af1e81768d 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/MenuScreens.java +++ b/net/minecraft/client/gui/screens/MenuScreens.java -@@ -40,6 +_,10 @@ +@@ -41,6 +_,10 @@ private static final Map, MenuScreens.ScreenConstructor> f_96196_ = Maps.newHashMap(); public static void m_96201_(@Nullable MenuType p_96202_, Minecraft p_96203_, int p_96204_, Component p_96205_) { @@ -11,7 +11,7 @@ if (p_96202_ == null) { f_96195_.warn("Trying to open invalid screen with name: {}", (Object)p_96205_.getString()); } else { -@@ -47,9 +_,10 @@ +@@ -48,9 +_,10 @@ if (screenconstructor == null) { f_96195_.warn("Failed to create screen for menu type: {}", (Object)BuiltInRegistries.f_256818_.m_7981_(p_96202_)); } else { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/OptionsScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/OptionsScreen.java.patch index 1c7a7f0d79..291e851d3c 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/OptionsScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/OptionsScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/OptionsScreen.java +++ b/net/minecraft/client/gui/screens/OptionsScreen.java -@@ -168,6 +_,14 @@ +@@ -151,6 +_,14 @@ super.m_86412_(p_96249_, p_96250_, p_96251_, p_96252_); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/Screen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/Screen.java.patch index c8cf5c4265..baec367d7f 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/Screen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/Screen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/Screen.java +++ b/net/minecraft/client/gui/screens/Screen.java -@@ -143,7 +_,7 @@ +@@ -214,7 +_,7 @@ } public void m_7379_() { @@ -9,7 +9,7 @@ } protected T m_142416_(T p_169406_) { -@@ -180,15 +_,29 @@ +@@ -251,15 +_,29 @@ this.f_169368_.clear(); } @@ -43,7 +43,7 @@ this.m_262809_(p_169389_, list, p_169392_, p_169393_, DefaultTooltipPositioner.f_262752_); } -@@ -201,24 +_,48 @@ +@@ -272,24 +_,48 @@ } public void m_96597_(PoseStack p_96598_, List p_96599_, int p_96600_, int p_96601_) { @@ -94,18 +94,16 @@ if (k > i) { i = k; } -@@ -226,8 +_,8 @@ +@@ -297,7 +_,7 @@ j += clienttooltipcomponent.m_142103_(); } -- int k1 = p_263065_ + 12; -- int l1 = p_262996_ - 12; -+ int k1 = preEvent.getX() + 12; -+ int l1 = preEvent.getY() - 12; - Vector2ic vector2ic = p_262920_.m_262814_(this, k1, l1, i, j); - k1 = vector2ic.x(); - l1 = vector2ic.y(); -@@ -240,6 +_,8 @@ +- Vector2ic vector2ic = p_262920_.m_262814_(this, p_263065_, p_262996_, i, j); ++ Vector2ic vector2ic = p_262920_.m_262814_(this, preEvent.getX(), preEvent.getY(), i, j); + int l = vector2ic.x(); + int i1 = vector2ic.y(); + p_263064_.m_85836_(); +@@ -307,6 +_,8 @@ RenderSystem.m_157427_(GameRenderer::m_172811_); bufferbuilder.m_166779_(VertexFormat.Mode.QUADS, DefaultVertexFormat.f_85815_); Matrix4f matrix4f = p_263064_.m_85850_().m_252922_(); @@ -113,29 +111,29 @@ + // net.minecraftforge.client.event.RenderTooltipEvent.Color colorEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipColor(this.tooltipStack, p_263064_, k1, l1, preEvent.getFont(), p_262990_); TooltipRenderUtil.m_262796_((p_262872_, p_262873_, p_262874_, p_262875_, p_262876_, p_262877_, p_262878_, p_262879_, p_262880_) -> { GuiComponent.m_93123_(p_262872_, p_262873_, p_262874_, p_262875_, p_262876_, p_262877_, p_262878_, p_262879_, p_262880_); - }, matrix4f, bufferbuilder, k1, l1, i, j, 400); -@@ -256,7 +_,7 @@ + }, matrix4f, bufferbuilder, l, i1, i, j, 400); +@@ -320,7 +_,7 @@ - for(int j1 = 0; j1 < p_262990_.size(); ++j1) { - ClientTooltipComponent clienttooltipcomponent1 = p_262990_.get(j1); -- clienttooltipcomponent1.m_142440_(this.f_96547_, k1, i1, matrix4f, multibuffersource$buffersource); -+ clienttooltipcomponent1.m_142440_(preEvent.getFont(), k1, i1, matrix4f, multibuffersource$buffersource); - i1 += clienttooltipcomponent1.m_142103_() + (j1 == 0 ? 2 : 0); + for(int l1 = 0; l1 < p_262990_.size(); ++l1) { + ClientTooltipComponent clienttooltipcomponent1 = p_262990_.get(l1); +- clienttooltipcomponent1.m_142440_(this.f_96547_, l, k1, matrix4f, multibuffersource$buffersource); ++ clienttooltipcomponent1.m_142440_(preEvent.getFont(), l, k1, matrix4f, multibuffersource$buffersource); + k1 += clienttooltipcomponent1.m_142103_() + (l1 == 0 ? 2 : 0); } -@@ -266,7 +_,7 @@ +@@ -329,7 +_,7 @@ for(int i2 = 0; i2 < p_262990_.size(); ++i2) { ClientTooltipComponent clienttooltipcomponent2 = p_262990_.get(i2); -- clienttooltipcomponent2.m_183452_(this.f_96547_, k1, i1, p_263064_, this.f_96542_, 400); -+ clienttooltipcomponent2.m_183452_(preEvent.getFont(), k1, i1, p_263064_, this.f_96542_, 400); - i1 += clienttooltipcomponent2.m_142103_() + (i2 == 0 ? 2 : 0); +- clienttooltipcomponent2.m_183452_(this.f_96547_, l, k1, p_263064_, this.f_96542_); ++ clienttooltipcomponent2.m_183452_(preEvent.getFont(), k1, i1, p_263064_, this.f_96542_); + k1 += clienttooltipcomponent2.m_142103_() + (i2 == 0 ? 2 : 0); } -@@ -368,9 +_,19 @@ - this.f_96547_ = p_96607_.f_91062_; - this.f_96543_ = p_96608_; - this.f_96544_ = p_96609_; +@@ -438,8 +_,18 @@ + } + + this.f_267454_ = true; + java.util.function.Consumer add = (b) -> { + if (b instanceof Renderable r) + this.f_169369_.add(r); @@ -144,7 +142,6 @@ + f_96540_.add(b); + }; + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.Init.Pre(this, this.f_96540_, add, this::m_169411_))) { - this.m_232761_(); this.m_169407_(false); this.m_169378_(f_169370_); + } @@ -152,23 +149,23 @@ } protected void m_232761_() { -@@ -399,6 +_,7 @@ - public void m_96558_(PoseStack p_96559_, int p_96560_) { +@@ -467,6 +_,7 @@ + public void m_7333_(PoseStack p_96557_) { if (this.f_96541_.f_91073_ != null) { - this.m_93179_(p_96559_, 0, 0, this.f_96543_, this.f_96544_, -1072689136, -804253680); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_96559_)); + m_93179_(p_96557_, 0, 0, this.f_96543_, this.f_96544_, -1072689136, -804253680); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_96557_)); } else { - this.m_96626_(p_96560_); + this.m_264065_(p_96557_); } -@@ -418,6 +_,7 @@ - bufferbuilder.m_5483_((double)this.f_96543_, 0.0D, 0.0D).m_7421_((float)this.f_96543_ / 32.0F, (float)p_96627_).m_6122_(64, 64, 64, 255).m_5752_(); - bufferbuilder.m_5483_(0.0D, 0.0D, 0.0D).m_7421_(0.0F, (float)p_96627_).m_6122_(64, 64, 64, 255).m_5752_(); - tesselator.m_85914_(); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, new PoseStack())); +@@ -479,6 +_,7 @@ + int i = 32; + m_93143_(p_265092_, 0, 0, 0, 0.0F, 0.0F, this.f_96543_, this.f_96544_, 32, 32); + RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_265092_)); } public boolean m_7043_() { -@@ -503,6 +_,10 @@ +@@ -570,6 +_,10 @@ } public void m_7400_(List p_96591_) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch index 2f0d593f17..99a35a1d49 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/client/gui/screens/TitleScreen.java +++ b/net/minecraft/client/gui/screens/TitleScreen.java -@@ -68,6 +_,7 @@ - private long f_96715_; +@@ -63,6 +_,7 @@ @Nullable private TitleScreen.WarningLabel f_232768_; + private final LogoRenderer f_263781_; + private net.minecraftforge.client.gui.TitleScreenModUpdateIndicator modUpdateNotification; public TitleScreen() { this(false); -@@ -112,11 +_,15 @@ +@@ -113,11 +_,15 @@ int j = this.f_96543_ - i - 2; int k = 24; int l = this.f_96544_ / 4 + 48; @@ -24,7 +24,7 @@ this.m_142416_(new ImageButton(this.f_96543_ / 2 - 124, l + 72 + 12, 20, 20, 0, 106, 20, Button.f_93617_, 256, 256, (p_96791_) -> { this.f_96541_.m_91152_(new LanguageSelectScreen(this, this.f_96541_.f_91066_, this.f_96541_.m_91102_())); -@@ -161,7 +_,7 @@ +@@ -162,7 +_,7 @@ }).m_252987_(this.f_96543_ / 2 - 100, p_96764_ + p_96765_ * 1, 200, 20).m_257505_(tooltip).m_253136_())).f_93623_ = flag; (this.m_142416_(Button.m_253074_(Component.m_237115_("menu.online"), (p_210872_) -> { this.m_96793_(); @@ -33,31 +33,31 @@ } @Nullable -@@ -267,6 +_,7 @@ - this.f_232768_.m_232790_(p_96739_, l); +@@ -245,6 +_,7 @@ + this.f_232768_.m_232790_(p_96739_, i); } -+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_96739_, this.f_96547_, this.f_96543_, this.f_96544_, l); ++ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_96739_, this.f_96547_, this.f_96543_, this.f_96544_, i); if (this.f_96721_ != null) { p_96739_.m_85836_(); p_96739_.m_252880_((float)(this.f_96543_ / 2 + 90), 70.0F, 0.0F); -@@ -289,7 +_,14 @@ +@@ -267,7 +_,14 @@ s = s + I18n.m_118938_("menu.modded"); } -- m_93236_(p_96739_, this.f_96547_, s, 2, this.f_96544_ - 10, 16777215 | l); +- m_93236_(p_96739_, this.f_96547_, s, 2, this.f_96544_ - 10, 16777215 | i); + net.minecraftforge.internal.BrandingControl.forEachLine(true, true, (brdline, brd) -> -+ m_93236_(p_96739_, this.f_96547_, brd, 2, this.f_96544_ - ( 10 + brdline * (this.f_96547_.f_92710_ + 1)), 16777215 | l) ++ m_93236_(p_96739_, this.f_96547_, brd, 2, this.f_96544_ - ( 10 + brdline * (this.f_96547_.f_92710_ + 1)), 16777215 | i) + ); + + net.minecraftforge.internal.BrandingControl.forEachAboveCopyrightLine((brdline, brd) -> -+ m_93236_(p_96739_, this.f_96547_, brd, this.f_96543_ - f_96547_.m_92895_(brd), this.f_96544_ - (10 + (brdline + 1) * ( this.f_96547_.f_92710_ + 1)), 16777215 | l) ++ m_93236_(p_96739_, this.f_96547_, brd, this.f_96543_ - f_96547_.m_92895_(brd), this.f_96544_ - (10 + (brdline + 1) * ( this.f_96547_.f_92710_ + 1)), 16777215 | i) + ); + for(GuiEventListener guieventlistener : this.m_6702_()) { if (guieventlistener instanceof AbstractWidget) { -@@ -302,6 +_,7 @@ +@@ -280,6 +_,7 @@ RenderSystem.m_69482_(); this.f_96726_.m_86412_(p_96739_, p_96740_, p_96741_, p_96742_); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch index c00f842b5d..de58051e5f 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/advancements/AdvancementTab.java +++ b/net/minecraft/client/gui/screens/advancements/AdvancementTab.java -@@ -39,6 +_,7 @@ +@@ -38,6 +_,7 @@ private int f_97141_ = Integer.MIN_VALUE; private float f_97142_; private boolean f_97143_; @@ -8,7 +8,7 @@ public AdvancementTab(Minecraft p_97145_, AdvancementsScreen p_97146_, AdvancementTabType p_97147_, int p_97148_, Advancement p_97149_, DisplayInfo p_97150_) { this.f_97126_ = p_97145_; -@@ -53,6 +_,15 @@ +@@ -52,6 +_,15 @@ this.m_97175_(this.f_97134_, p_97149_); } @@ -24,7 +24,7 @@ public AdvancementTabType m_169538_() { return this.f_97128_; } -@@ -165,8 +_,8 @@ +@@ -151,8 +_,8 @@ return null; } else { for(AdvancementTabType advancementtabtype : AdvancementTabType.values()) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch index 788213ac72..781746a455 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java +++ b/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java -@@ -42,6 +_,7 @@ +@@ -41,6 +_,7 @@ @Nullable private AdvancementTab f_97336_; private boolean f_97337_; @@ -8,7 +8,7 @@ public AdvancementsScreen(ClientAdvancements p_97340_) { super(GameNarrator.f_93310_); -@@ -57,7 +_,15 @@ +@@ -56,7 +_,15 @@ } else { this.f_97334_.m_104401_(this.f_97336_ == null ? null : this.f_97336_.m_97182_(), true); } @@ -25,7 +25,7 @@ } public void m_7861_() { -@@ -75,7 +_,7 @@ +@@ -74,7 +_,7 @@ int j = (this.f_96544_ - 140) / 2; for(AdvancementTab advancementtab : this.f_97335_.values()) { @@ -34,7 +34,7 @@ this.f_97334_.m_104401_(advancementtab.m_97182_(), true); break; } -@@ -99,6 +_,11 @@ +@@ -98,6 +_,11 @@ int i = (this.f_96543_ - 252) / 2; int j = (this.f_96544_ - 140) / 2; this.m_7333_(p_97361_); @@ -46,7 +46,7 @@ this.m_97373_(p_97361_, p_97362_, p_97363_, i, j); this.m_97356_(p_97361_, i, j); this.m_97381_(p_97361_, p_97362_, p_97363_, i, j); -@@ -149,12 +_,14 @@ +@@ -138,10 +_,12 @@ RenderSystem.m_157456_(0, f_97330_); for(AdvancementTab advancementtab : this.f_97335_.values()) { @@ -54,14 +54,12 @@ advancementtab.m_97165_(p_97357_, p_97358_, p_97359_, advancementtab == this.f_97336_); } - RenderSystem.m_69453_(); - for(AdvancementTab advancementtab1 : this.f_97335_.values()) { + if (advancementtab1.getPage() == tabPage) - advancementtab1.m_97159_(p_97358_, p_97359_, this.f_96542_); + advancementtab1.m_274613_(p_97357_, p_97358_, p_97359_, this.f_96542_); } - -@@ -180,7 +_,7 @@ + } +@@ -161,7 +_,7 @@ if (this.f_97335_.size() > 1) { for(AdvancementTab advancementtab : this.f_97335_.values()) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsList.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsList.java.patch index 1f77eda1ab..0e96eff3de 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/controls/KeyBindsList.java +++ b/net/minecraft/client/gui/screens/controls/KeyBindsList.java -@@ -50,7 +_,7 @@ +@@ -65,7 +_,7 @@ } protected int m_5756_() { @@ -9,48 +9,34 @@ } public int m_5759_() { -@@ -108,10 +_,11 @@ - this.f_193911_ = p_193917_; - this.f_193912_ = Button.m_253074_(p_193917_, (p_193939_) -> { +@@ -130,10 +_,11 @@ + this.f_193912_ = Button.m_253074_(p_193917_, (p_269618_) -> { KeyBindsList.this.f_193858_.f_193975_ = p_193916_; + KeyBindsList.this.m_269130_(); - }).m_252987_(0, 0, 75, 20).m_252778_((p_253311_) -> { + }).m_252987_(0, 0, 75 + 20 /* Forge: Add space */, 20).m_252778_((p_253311_) -> { return p_193916_.m_90862_() ? Component.m_237110_("narrator.controls.unbound", p_193917_) : Component.m_237110_("narrator.controls.bound", p_193917_, p_253311_.get()); }).m_253136_(); - this.f_193913_ = Button.m_253074_(Component.m_237115_("controls.reset"), (p_193935_) -> { + this.f_193913_ = Button.m_253074_(Component.m_237115_("controls.reset"), (p_269616_) -> { + this.f_193910_.setToDefault(); KeyBindsList.this.f_93386_.f_91066_.m_92159_(p_193916_, p_193916_.m_90861_()); - KeyMapping.m_90854_(); + KeyBindsList.this.m_269130_(); }).m_252987_(0, 0, 50, 20).m_252778_((p_253313_) -> { -@@ -123,7 +_,7 @@ - boolean flag = KeyBindsList.this.f_193858_.f_193975_ == this.f_193910_; +@@ -145,7 +_,7 @@ + public void m_6311_(PoseStack p_193923_, int p_193924_, int p_193925_, int p_193926_, int p_193927_, int p_193928_, int p_193929_, int p_193930_, boolean p_193931_, float p_193932_) { float f = (float)(p_193926_ + 90 - KeyBindsList.this.f_193859_); KeyBindsList.this.f_93386_.f_91062_.m_92889_(p_193923_, this.f_193911_, f, (float)(p_193925_ + p_193928_ / 2 - 9 / 2), 16777215); - this.f_193913_.m_252865_(p_193926_ + 190); + this.f_193913_.m_252865_(p_193926_ + 190 + 20); - this.f_193913_.m_252888_(p_193925_); - this.f_193913_.f_93623_ = !this.f_193910_.m_90864_(); + this.f_193913_.m_253211_(p_193925_); this.f_193913_.m_86412_(p_193923_, p_193929_, p_193930_, p_193932_); -@@ -131,11 +_,12 @@ - this.f_193912_.m_252888_(p_193925_); - this.f_193912_.m_93666_(this.f_193910_.m_90863_()); - boolean flag1 = false; -+ boolean keyCodeModifierConflict = true; // gracefully handle conflicts like SHIFT vs SHIFT+G + this.f_193912_.m_252865_(p_193926_ + 105); +@@ -174,7 +_,7 @@ + MutableComponent mutablecomponent = Component.m_237119_(); if (!this.f_193910_.m_90862_()) { for(KeyMapping keymapping : KeyBindsList.this.f_93386_.f_91066_.f_92059_) { - if (keymapping != this.f_193910_ && this.f_193910_.m_90850_(keymapping)) { - flag1 = true; -- break; -+ keyCodeModifierConflict &= keymapping.hasKeyModifierConflict(this.f_193910_); - } - } - } -@@ -143,7 +_,7 @@ - if (flag) { - this.f_193912_.m_93666_(Component.m_237113_("> ").m_7220_(this.f_193912_.m_6035_().m_6881_().m_130940_(ChatFormatting.YELLOW)).m_130946_(" <").m_130940_(ChatFormatting.YELLOW)); - } else if (flag1) { -- this.f_193912_.m_93666_(this.f_193912_.m_6035_().m_6881_().m_130940_(ChatFormatting.RED)); -+ this.f_193912_.m_93666_(this.f_193912_.m_6035_().m_6881_().m_130940_(keyCodeModifierConflict ? ChatFormatting.GOLD : ChatFormatting.RED)); - } - - this.f_193912_.m_86412_(p_193923_, p_193929_, p_193930_, p_193932_); +- if (keymapping != this.f_193910_ && this.f_193910_.m_90850_(keymapping)) { ++ if ((keymapping != this.f_193910_ && this.f_193910_.m_90850_(keymapping)) || keymapping.hasKeyModifierConflict(this.f_193910_)) { // FORGE: gracefully handle conflicts like SHIFT vs SHIFT+G + if (this.f_268447_) { + mutablecomponent.m_130946_(", "); + } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch index a3102196d1..6f85bdd4e3 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch @@ -2,13 +2,13 @@ +++ b/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java @@ -31,7 +_,7 @@ this.m_7787_(this.f_193977_); - this.f_193978_ = this.m_142416_(Button.m_253074_(Component.m_237115_("controls.resetAll"), (p_193999_) -> { + this.f_193978_ = this.m_142416_(Button.m_253074_(Component.m_237115_("controls.resetAll"), (p_269619_) -> { for(KeyMapping keymapping : this.f_96282_.f_92059_) { - keymapping.m_90848_(keymapping.m_90861_()); + keymapping.setToDefault(); } - KeyMapping.m_90854_(); + this.f_193977_.m_269130_(); @@ -55,11 +_,14 @@ public boolean m_7933_(int p_193987_, int p_193988_, int p_193989_) { if (this.f_193975_ != null) { @@ -23,4 +23,4 @@ + if(!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(this.f_193975_.getKey())) this.f_193975_ = null; this.f_193976_ = Util.m_137550_(); - KeyMapping.m_90854_(); + this.f_193977_.m_269130_(); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch index 238674d467..7bd0dd8dfe 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch @@ -1,19 +1,19 @@ --- a/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java +++ b/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java -@@ -89,6 +_,7 @@ +@@ -88,6 +_,7 @@ int i = this.f_97735_; int j = this.f_97736_; this.m_7286_(p_97795_, p_97798_, p_97796_, p_97797_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.Render.Background(this, p_97795_, p_97796_, p_97797_)); RenderSystem.m_69465_(); super.m_86412_(p_97795_, p_97796_, p_97797_, p_97798_); - PoseStack posestack = RenderSystem.m_157191_(); -@@ -110,11 +_,12 @@ + p_97795_.m_85836_(); +@@ -104,11 +_,12 @@ this.f_97734_ = slot; int l = slot.f_40220_; int i1 = slot.f_40221_; -- m_169606_(p_97795_, l, i1, this.m_93252_()); -+ renderSlotHighlight(p_97795_, l, i1, this.m_93252_(), this.getSlotColor(k)); +- m_169606_(p_97795_, l, i1, 0); ++ renderSlotHighlight(p_97795_, l, i1, 0, this.getSlotColor(k)); } } @@ -22,7 +22,7 @@ ItemStack itemstack = this.f_97711_.m_41619_() ? this.f_97732_.m_142621_() : this.f_97711_; if (!itemstack.m_41619_()) { int l1 = 8; -@@ -154,9 +_,13 @@ +@@ -147,9 +_,13 @@ } public static void m_169606_(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_) { @@ -37,19 +37,17 @@ RenderSystem.m_69444_(true, true, true, true); RenderSystem.m_69482_(); } -@@ -174,8 +_,10 @@ - RenderSystem.m_157182_(); - this.m_93250_(200); - this.f_96542_.f_115093_ = 200.0F; -+ var font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_97783_).getFont(p_97783_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.ITEM_COUNT); -+ if (font == null) font = this.f_96547_; - this.f_96542_.m_115203_(p_97783_, p_97784_, p_97785_); -- this.f_96542_.m_115174_(this.f_96547_, p_97783_, p_97784_, p_97785_ - (this.f_97711_.m_41619_() ? 0 : 8), p_97786_); -+ this.f_96542_.m_115174_(font, p_97783_, p_97784_, p_97785_ - (this.f_97711_.m_41619_() ? 0 : 8), p_97786_); - this.m_93250_(0); - this.f_96542_.f_115093_ = 0.0F; +@@ -165,7 +_,8 @@ + p_275498_.m_85836_(); + p_275498_.m_252880_(0.0F, 0.0F, 232.0F); + this.f_96542_.m_274369_(p_275498_, p_275341_, p_275289_, p_275690_); +- this.f_96542_.m_274364_(p_275498_, this.f_96547_, p_275341_, p_275289_, p_275690_ - (this.f_97711_.m_41619_() ? 0 : 8), p_275201_); ++ var font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_275341_).getFont(p_275341_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.ITEM_COUNT); ++ this.f_96542_.m_274364_(p_275498_, font == null ? this.f_96547_ : font, p_275341_, p_275289_, p_275690_ - (this.f_97711_.m_41619_() ? 0 : 8), p_275201_); + p_275498_.m_85849_(); } -@@ -285,7 +_,8 @@ + +@@ -272,7 +_,8 @@ if (super.m_6375_(p_97748_, p_97749_, p_97750_)) { return true; } else { @@ -59,7 +57,7 @@ Slot slot = this.m_97744_(p_97748_, p_97749_); long i = Util.m_137550_(); this.f_97723_ = this.f_97709_ == slot && i - this.f_97721_ < 250L && this.f_97722_ == p_97750_; -@@ -296,6 +_,7 @@ +@@ -283,6 +_,7 @@ int j = this.f_97735_; int k = this.f_97736_; boolean flag1 = this.m_7467_(p_97748_, p_97749_, j, k, p_97750_); @@ -67,7 +65,7 @@ int l = -1; if (slot != null) { l = slot.f_40219_; -@@ -321,7 +_,7 @@ +@@ -308,7 +_,7 @@ } } else if (!this.f_97738_) { if (this.f_97732_.m_142621_().m_41619_()) { @@ -76,7 +74,7 @@ this.m_6597_(slot, l, p_97750_, ClickType.CLONE); } else { boolean flag2 = l != -999 && (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340) || InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 344)); -@@ -345,7 +_,7 @@ +@@ -332,7 +_,7 @@ this.f_97717_ = 0; } else if (p_97750_ == 1) { this.f_97717_ = 1; @@ -85,7 +83,7 @@ this.f_97717_ = 2; } } -@@ -414,10 +_,13 @@ +@@ -401,10 +_,13 @@ } public boolean m_6348_(double p_97812_, double p_97813_, int p_97814_) { @@ -99,7 +97,7 @@ int k = -1; if (slot != null) { k = slot.f_40219_; -@@ -431,7 +_,7 @@ +@@ -418,7 +_,7 @@ if (m_96638_()) { if (!this.f_97724_.m_41619_()) { for(Slot slot2 : this.f_97732_.f_38839_) { @@ -108,7 +106,7 @@ this.m_6597_(slot2, slot2.f_40219_, p_97814_, ClickType.QUICK_MOVE); } } -@@ -494,7 +_,7 @@ +@@ -481,7 +_,7 @@ this.m_6597_((Slot)null, -999, AbstractContainerMenu.m_38930_(2, this.f_97717_), ClickType.QUICK_CRAFT); } else if (!this.f_97732_.m_142621_().m_41619_()) { @@ -117,7 +115,7 @@ this.m_6597_(slot, k, p_97814_, ClickType.CLONE); } else { boolean flag1 = k != -999 && (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340) || InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 344)); -@@ -541,34 +_,39 @@ +@@ -528,34 +_,39 @@ } public boolean m_7933_(int p_97765_, int p_97766_, int p_97767_) { @@ -164,7 +162,7 @@ this.m_6597_(this.f_97734_, this.f_97734_.f_40219_, i, ClickType.SWAP); return true; } -@@ -603,6 +_,18 @@ +@@ -590,6 +_,18 @@ public T m_6262_() { return this.f_97732_; diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch index f88dbcadb5..042be843d3 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch @@ -92,16 +92,17 @@ } (this.f_97732_).f_98639_.addAll(searchtree.m_6293_(s.toLowerCase(Locale.ROOT))); -@@ -416,7 +_,7 @@ +@@ -415,7 +_,8 @@ + protected void m_7027_(PoseStack p_98616_, int p_98617_, int p_98618_) { if (f_98507_.m_40789_()) { - RenderSystem.m_69461_(); - this.f_96547_.m_92889_(p_98616_, f_98507_.m_40786_(), 8.0F, 6.0F, 4210752); ++ RenderSystem.m_69461_(); + this.f_96547_.m_92889_(p_98616_, f_98507_.m_40786_(), 8.0F, 6.0F, f_98507_.getLabelColor()); } } -@@ -426,7 +_,7 @@ +@@ -425,7 +_,7 @@ double d0 = p_98531_ - (double)this.f_97735_; double d1 = p_98532_ - (double)this.f_97736_; @@ -110,7 +111,7 @@ if (this.m_98562_(creativemodetab, d0, d1)) { return true; } -@@ -447,7 +_,7 @@ +@@ -446,7 +_,7 @@ double d1 = p_98623_ - (double)this.f_97736_; this.f_98509_ = false; @@ -119,7 +120,7 @@ if (this.m_98562_(creativemodetab, d0, d1)) { this.m_98560_(creativemodetab); return true; -@@ -465,6 +_,7 @@ +@@ -464,6 +_,7 @@ private void m_98560_(CreativeModeTab p_98561_) { CreativeModeTab creativemodetab = f_98507_; f_98507_ = p_98561_; @@ -127,7 +128,7 @@ this.f_97737_.clear(); (this.f_97732_).f_98639_.clear(); this.m_238391_(); -@@ -541,13 +_,15 @@ +@@ -540,13 +_,15 @@ this.f_98511_ = null; } @@ -135,7 +136,7 @@ + if (f_98507_.hasSearchBar()) { this.f_98510_.m_94194_(true); this.f_98510_.m_94190_(false); - this.f_98510_.m_94178_(true); + this.f_98510_.m_93692_(true); if (creativemodetab != p_98561_) { this.f_98510_.m_94144_(""); } @@ -144,7 +145,7 @@ this.m_98630_(); } else { -@@ -604,7 +_,7 @@ +@@ -603,7 +_,7 @@ this.m_7333_(p_98577_); super.m_86412_(p_98577_, p_98578_, p_98579_, p_98580_); @@ -153,23 +154,22 @@ if (this.m_98584_(p_98577_, creativemodetab, p_98578_, p_98579_)) { break; } -@@ -614,6 +_,15 @@ +@@ -613,13 +_,22 @@ this.m_96602_(p_98577_, f_98506_, p_98578_, p_98579_); } + if (this.pages.size() != 1) { + Component page = Component.m_237113_(String.format("%d / %d", this.pages.indexOf(this.currentPage) + 1, this.pages.size())); -+ this.m_93250_(300); -+ this.f_96542_.f_115093_ = 300.0F; ++ p_98577_.m_85836_(); ++ p_98577_.m_252880_(0F, 0F, 300F); + f_96547_.m_92744_(p_98577_, page.m_7532_(), f_97735_ + (f_97726_ / 2f) - (f_96547_.m_92852_(page) / 2f), f_97736_ - 44, -1); -+ this.m_93250_(0); -+ this.f_96542_.f_115093_ = 0.0F; ++ p_98577_.m_85849_(); + } + - RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); ++ RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); this.m_7025_(p_98577_, p_98578_, p_98579_); } -@@ -621,7 +_,7 @@ + protected void m_6057_(PoseStack p_98590_, ItemStack p_98591_, int p_98592_, int p_98593_) { boolean flag = this.f_97734_ != null && this.f_97734_ instanceof CreativeModeInventoryScreen.CustomCreativeSlot; boolean flag1 = f_98507_.m_257962_() == CreativeModeTab.Type.CATEGORY; @@ -178,7 +178,7 @@ TooltipFlag.Default tooltipflag$default = this.f_96541_.f_91066_.f_92125_ ? TooltipFlag.Default.f_256730_ : TooltipFlag.Default.f_256752_; TooltipFlag tooltipflag = flag ? tooltipflag$default.m_257777_() : tooltipflag$default; List list = p_98591_.m_41651_(this.f_96541_.f_91074_, tooltipflag); -@@ -641,20 +_,20 @@ +@@ -639,35 +_,36 @@ int i = 1; @@ -196,37 +196,32 @@ } protected void m_7286_(PoseStack p_98572_, float p_98573_, int p_98574_, int p_98575_) { - RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); - - for(CreativeModeTab creativemodetab : CreativeModeTabs.m_257388_()) { + for(CreativeModeTab creativemodetab : currentPage.getVisibleTabs()) { - RenderSystem.m_157427_(GameRenderer::m_172817_); RenderSystem.m_157456_(0, f_98504_); if (creativemodetab != f_98507_) { -@@ -663,7 +_,7 @@ + this.m_98581_(p_98572_, creativemodetab); + } } - RenderSystem.m_157427_(GameRenderer::m_172817_); - RenderSystem.m_157456_(0, new ResourceLocation("textures/gui/container/creative_inventory/tab_" + f_98507_.m_40788_())); + RenderSystem.m_157456_(0, f_98507_.getBackgroundLocation()); - this.m_93228_(p_98572_, this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_); + m_93228_(p_98572_, this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_); this.f_98510_.m_86412_(p_98572_, p_98574_, p_98575_, p_98573_); - RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); -@@ -671,11 +_,12 @@ + int j = this.f_97735_ + 175; int k = this.f_97736_ + 18; int i = k + 112; - RenderSystem.m_157427_(GameRenderer::m_172817_); - RenderSystem.m_157456_(0, f_98504_); + RenderSystem.m_157456_(0, f_98507_.getTabsImage()); if (f_98507_.m_40791_()) { - this.m_93228_(p_98572_, j, k + (int)((float)(i - k - 17) * this.f_98508_), 232 + (this.m_98631_() ? 0 : 12), 0, 12, 15); + m_93228_(p_98572_, j, k + (int)((float)(i - k - 17) * this.f_98508_), 232 + (this.m_98631_() ? 0 : 12), 0, 12, 15); } + if (currentPage.getVisibleTabs().contains(f_98507_)) //Forge: only display tab selection when the selected tab is on the current page this.m_98581_(p_98572_, f_98507_); if (f_98507_.m_257962_() == CreativeModeTab.Type.INVENTORY) { - InventoryScreen.m_98850_(this.f_97735_ + 88, this.f_97736_ + 45, 20, (float)(this.f_97735_ + 88 - p_98574_), (float)(this.f_97736_ + 45 - 30 - p_98575_), this.f_96541_.f_91074_); -@@ -684,7 +_,7 @@ + InventoryScreen.m_274545_(p_98572_, this.f_97735_ + 88, this.f_97736_ + 45, 20, (float)(this.f_97735_ + 88 - p_98574_), (float)(this.f_97736_ + 45 - 30 - p_98575_), this.f_96541_.f_91074_); +@@ -676,7 +_,7 @@ } private int m_258094_(CreativeModeTab p_260136_) { @@ -235,7 +230,7 @@ int j = 27; int k = 27 * i; if (p_260136_.m_6563_()) { -@@ -696,7 +_,7 @@ +@@ -688,7 +_,7 @@ private int m_257995_(CreativeModeTab p_260181_) { int i = 0; @@ -244,7 +239,7 @@ i -= 32; } else { i += this.f_97727_; -@@ -724,8 +_,8 @@ +@@ -716,8 +_,8 @@ protected void m_98581_(PoseStack p_98582_, CreativeModeTab p_98583_) { boolean flag = p_98583_ == f_98507_; @@ -255,15 +250,15 @@ int j = i * 26; int k = 0; int l = this.f_97735_ + this.m_258094_(p_98583_); -@@ -742,6 +_,7 @@ +@@ -734,6 +_,7 @@ i1 += this.f_97727_ - 4; } + RenderSystem.m_69478_(); //Forge: Make sure blend is enabled else tabs show a white border. - this.m_93228_(p_98582_, l, i1, j, k, 26, 32); - this.f_96542_.f_115093_ = 100.0F; - l += 5; -@@ -784,6 +_,14 @@ + m_93228_(p_98582_, l, i1, j, k, 26, 32); + p_98582_.m_85836_(); + p_98582_.m_252880_(0.0F, 0.0F, 100.0F); +@@ -777,6 +_,14 @@ } @@ -278,7 +273,7 @@ @OnlyIn(Dist.CLIENT) static class CustomCreativeSlot extends Slot { public CustomCreativeSlot(Container p_98633_, int p_98634_, int p_98635_, int p_98636_) { -@@ -947,6 +_,22 @@ +@@ -944,6 +_,22 @@ public boolean m_8010_(Player p_98665_) { return this.f_98655_.m_8010_(p_98665_); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch index 3fd50f982b..d2b2a4e2ff 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java +++ b/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java @@ -42,12 +_,17 @@ + Collection collection = this.f_96541_.f_91074_.m_21220_(); if (!collection.isEmpty() && j >= 32) { - RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F); boolean flag = j >= 120; + var event = net.minecraftforge.client.ForgeHooksClient.onScreenPotionSize(this, j, !flag, i); + if (event.isCanceled()) return; @@ -19,27 +19,27 @@ this.m_194002_(p_194015_, i, k, iterable, flag); this.m_194008_(p_194015_, i, k, iterable, flag); if (flag) { -@@ -95,6 +_,11 @@ +@@ -94,6 +_,11 @@ int i = this.f_97736_; for(MobEffectInstance mobeffectinstance : p_194012_) { + var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance); -+ if (renderer.renderInventoryIcon(mobeffectinstance, this, p_194009_, p_194010_ + (p_194013_ ? 6 : 7), i, this.m_93252_())) { ++ if (renderer.renderInventoryIcon(mobeffectinstance, this, p_194009_, p_194010_ + (p_194013_ ? 6 : 7), i, 0)) { + i += p_194011_; + continue; + } MobEffect mobeffect = mobeffectinstance.m_19544_(); TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect); RenderSystem.m_157456_(0, textureatlassprite.m_247685_()); -@@ -108,6 +_,11 @@ +@@ -107,6 +_,11 @@ int i = this.f_97736_; for(MobEffectInstance mobeffectinstance : p_98726_) { + var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance); -+ if (renderer.renderInventoryText(mobeffectinstance, this, p_98723_, p_98724_, i, this.m_93252_())) { ++ if (renderer.renderInventoryText(mobeffectinstance, this, p_98723_, p_98724_, i, 0)) { + i += p_98725_; + continue; + } Component component = this.m_194000_(mobeffectinstance); this.f_96547_.m_92763_(p_98723_, component, (float)(p_98724_ + 10 + 18), (float)(i + 6), 16777215); - String s = MobEffectUtil.m_19581_(mobeffectinstance, 1.0F); + Component component1 = MobEffectUtil.m_267641_(mobeffectinstance, 1.0F); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch index 5b535dc91b..a2ebe76bce 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java +++ b/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java -@@ -147,7 +_,7 @@ +@@ -140,7 +_,7 @@ int i2 = 86 - this.f_96547_.m_92895_(s); FormattedText formattedtext = EnchantmentNames.m_98734_().m_98737_(this.f_96547_, i2); int j2 = 6839882; - if ((l < i1 + 1 || this.f_96541_.f_91074_.f_36078_ < l1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) { + if (((l < i1 + 1 || this.f_96541_.f_91074_.f_36078_ < l1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) || this.f_97732_.f_39447_[i1] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels - this.m_93228_(p_98762_, j1, j + 14 + 19 * i1, 0, 185, 108, 19); - this.m_93228_(p_98762_, j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16); - this.f_96547_.m_92857_(formattedtext, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1); -@@ -186,10 +_,13 @@ + m_93228_(p_98762_, j1, j + 14 + 19 * i1, 0, 185, 108, 19); + m_93228_(p_98762_, j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16); + this.f_96547_.m_274535_(p_98762_, formattedtext, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1); +@@ -179,10 +_,13 @@ Enchantment enchantment = Enchantment.m_44697_((this.f_97732_).f_39447_[j]); int l = (this.f_97732_).f_39448_[j]; int i1 = j + 1; diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch index b6774ab31b..b5d4589888 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch @@ -4,8 +4,8 @@ private static final Vector3f f_243728_ = new Vector3f(1.0F, 1.0F, 1.0F); private static final int f_244604_ = 16; private static final int f_244207_ = 16; -- private final ResourceLocation f_243720_ = new ResourceLocation("textures/gui/hanging_signs/" + this.f_244069_.m_61846_() + ".png"); -+ private final ResourceLocation f_243720_ = new ResourceLocation(this.f_244069_.m_61846_() + ".png").m_246208_("textures/gui/hanging_signs/"); +- private final ResourceLocation f_243720_ = new ResourceLocation("textures/gui/hanging_signs/" + this.f_244069_.f_61839_() + ".png"); ++ private final ResourceLocation f_243720_ = new ResourceLocation(this.f_244069_.f_61839_() + ".png").m_246208_("textures/gui/hanging_signs/"); public HangingSignEditScreen(SignBlockEntity p_249425_, boolean p_250356_) { super(p_249425_, p_250356_, Component.m_237115_("hanging_sign.edit")); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/InventoryScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/InventoryScreen.java.patch index e712f70d84..147c6e9987 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/InventoryScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/InventoryScreen.java.patch @@ -1,14 +1,16 @@ --- a/net/minecraft/client/gui/screens/inventory/InventoryScreen.java +++ b/net/minecraft/client/gui/screens/inventory/InventoryScreen.java -@@ -99,6 +_,11 @@ - public static void m_98850_(int p_98851_, int p_98852_, int p_98853_, float p_98854_, float p_98855_, LivingEntity p_98856_) { - float f = (float)Math.atan((double)(p_98854_ / 40.0F)); - float f1 = (float)Math.atan((double)(p_98855_ / 40.0F)); -+ renderEntityInInventoryRaw(p_98851_, p_98852_, p_98853_, f, f1, p_98856_); +@@ -98,6 +_,13 @@ + public static void m_274545_(PoseStack p_275396_, int p_275688_, int p_275245_, int p_275535_, float p_275604_, float p_275546_, LivingEntity p_275689_) { + float f = (float)Math.atan((double)(p_275604_ / 40.0F)); + float f1 = (float)Math.atan((double)(p_275546_ / 40.0F)); ++ // Forge: Allow passing in direct angle components instead of mouse position ++ renderEntityInInventoryFollowsAngle(p_275396_, p_275688_, p_275245_, p_275535_, f, f1, p_275689_); + } -+ public static void renderEntityInInventoryRaw(int p_98851_, int p_98852_, int p_98853_, float angleXComponent, float angleYComponent, LivingEntity p_98856_) { ++ ++ public static void renderEntityInInventoryFollowsAngle(PoseStack p_275396_, int p_275688_, int p_275245_, int p_275535_, float angleXComponent, float angleYComponent, LivingEntity p_275689_) { + float f = angleXComponent; + float f1 = angleYComponent; - PoseStack posestack = RenderSystem.m_157191_(); - posestack.m_85836_(); - posestack.m_252880_((float)p_98851_, (float)p_98852_, 1050.0F); + Quaternionf quaternionf = (new Quaternionf()).rotateZ((float)Math.PI); + Quaternionf quaternionf1 = (new Quaternionf()).rotateX(f1 * 20.0F * ((float)Math.PI / 180F)); + quaternionf.mul(quaternionf1); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch index 505948d5be..3396a62449 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch @@ -1,16 +1,16 @@ --- a/net/minecraft/client/gui/screens/inventory/MerchantScreen.java +++ b/net/minecraft/client/gui/screens/inventory/MerchantScreen.java -@@ -240,7 +_,12 @@ - this.f_96542_.m_115169_(this.f_96547_, p_99164_, p_99166_, p_99167_); +@@ -234,7 +_,12 @@ + this.f_96542_.m_274412_(p_99163_, this.f_96547_, p_99164_, p_99166_, p_99167_); } else { - this.f_96542_.m_115174_(this.f_96547_, p_99165_, p_99166_, p_99167_, p_99165_.m_41613_() == 1 ? "1" : null); -- this.f_96542_.m_115174_(this.f_96547_, p_99164_, p_99166_ + 14, p_99167_, p_99164_.m_41613_() == 1 ? "1" : null); + this.f_96542_.m_274364_(p_99163_, this.f_96547_, p_99165_, p_99166_, p_99167_, p_99165_.m_41613_() == 1 ? "1" : null); +- this.f_96542_.m_274364_(p_99163_, this.f_96547_, p_99164_, p_99166_ + 14, p_99167_, p_99164_.m_41613_() == 1 ? "1" : null); + // Forge: fixes Forge-8806, code for count rendering taken from ItemRenderer#renderGuiItemDecorations + PoseStack posestack = new PoseStack(); -+ posestack.m_85837_(0.0D, 0.0D, (f_96542_.f_115093_ + 200.0F)); ++ posestack.m_85837_(0.0D, 0.0D, 200F); + net.minecraft.client.renderer.MultiBufferSource.BufferSource bufferSource = net.minecraft.client.renderer.MultiBufferSource.m_109898_(com.mojang.blaze3d.vertex.Tesselator.m_85913_().m_85915_()); -+ f_96547_.m_252905_(String.valueOf(p_99164_.m_41613_()), (p_99166_ + 14) + 19 - 2 - f_96547_.m_92895_(String.valueOf(p_99164_.m_41613_())), p_99167_ + 6 + 3, 0xFFFFFF, true, posestack.m_85850_().m_252922_(), bufferSource, false, 0, 15728880); ++ f_96547_.m_272078_(String.valueOf(p_99164_.m_41613_()), (float) (p_99166_ + 14) + 19 - 2 - f_96547_.m_92895_(String.valueOf(p_99164_.m_41613_())), (float)p_99167_ + 6 + 3, 0xFFFFFF, true, posestack.m_85850_().m_252922_(), bufferSource, net.minecraft.client.gui.Font.DisplayMode.NORMAL, 0, 15728880, false); + bufferSource.m_109911_(); - RenderSystem.m_157427_(GameRenderer::m_172817_); RenderSystem.m_157456_(0, f_99113_); - this.m_93250_(this.m_93252_() + 300); + p_99163_.m_85836_(); + p_99163_.m_252880_(0.0F, 0.0F, 300.0F); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java.patch index fdd1788d0e..f9042d2063 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java +++ b/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java -@@ -259,6 +_,11 @@ +@@ -281,6 +_,11 @@ } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch index c5c9b3e9ad..3768972d23 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java +++ b/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java -@@ -321,6 +_,8 @@ +@@ -330,6 +_,8 @@ this.f_99855_.m_99707_(list1); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionModel.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionModel.java.patch index 13567ec115..6d006d71b6 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionModel.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionModel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/packs/PackSelectionModel.java +++ b/net/minecraft/client/gui/screens/packs/PackSelectionModel.java -@@ -102,6 +_,8 @@ +@@ -110,6 +_,8 @@ boolean m_7802_(); boolean m_7803_(); @@ -9,7 +9,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -176,6 +_,11 @@ +@@ -198,6 +_,11 @@ public void m_7845_() { this.m_99938_(1); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch index 622c50a811..fe40b5f5c1 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java +++ b/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java @@ -130,7 +_,7 @@ - private void m_100013_(TransferableSelectionList p_100014_, Stream p_100015_) { - p_100014_.m_6702_().clear(); + TransferableSelectionList.PackEntry transferableselectionlist$packentry = p_100014_.m_93511_(); + String s = transferableselectionlist$packentry == null ? "" : transferableselectionlist$packentry.m_264411_(); p_100014_.m_6987_((TransferableSelectionList.PackEntry)null); -- p_100015_.forEach((p_170000_) -> { -+ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_170000_) -> { - p_100014_.m_6702_().add(new TransferableSelectionList.PackEntry(this.f_96541_, p_100014_, this, p_170000_)); - }); - } +- p_100015_.forEach((p_264692_) -> { ++ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_264692_) -> { + TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.f_96541_, p_100014_, p_264692_); + p_100014_.m_6702_().add(transferableselectionlist$packentry1); + if (p_264692_.m_264249_().equals(s)) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch index cd516dbeaa..dcac82aae0 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java +++ b/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java -@@ -108,7 +_,7 @@ +@@ -106,7 +_,7 @@ this.m_5674_(); this.f_100279_.clear(); @@ -9,7 +9,7 @@ this.f_100279_.add(new RecipeBookTabButton(recipebookcategories)); } -@@ -305,7 +_,7 @@ +@@ -297,7 +_,7 @@ } if (itemstack != null && this.f_100272_.f_91080_ != null) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookPage.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookPage.java.patch index 215f0c4ac8..2938450fe8 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookPage.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/recipebook/RecipeBookPage.java.patch @@ -5,7 +5,7 @@ public void m_100417_(PoseStack p_100418_, int p_100419_, int p_100420_) { if (this.f_100397_.f_91080_ != null && this.f_100395_ != null && !this.f_100396_.m_100212_()) { - this.f_100397_.f_91080_.m_96597_(p_100418_, this.f_100395_.m_100477_(this.f_100397_.f_91080_), p_100419_, p_100420_); -+ this.f_100397_.f_91080_.renderComponentTooltip(p_100418_, this.f_100395_.m_100477_(this.f_100397_.f_91080_), p_100419_, p_100420_, this.f_100395_.m_100488_().m_8043_()); ++ this.f_100397_.f_91080_.renderComponentTooltip(p_100418_, this.f_100395_.m_100477_(this.f_100397_.f_91080_), p_100419_, p_100420_, this.f_100395_.m_100488_().m_8043_(f_100397_.f_91073_.m_9598_())); } } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch index 83c681e0c0..adcf4211a7 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java +++ b/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java -@@ -113,7 +_,8 @@ +@@ -119,7 +_,8 @@ public static void m_232896_(Minecraft p_232897_, @Nullable Screen p_232898_) { m_232899_(p_232897_, f_232866_); PackRepository packrepository = new PackRepository(new ServerPacksSource()); @@ -10,28 +10,28 @@ CompletableFuture completablefuture = WorldLoader.m_214362_(worldloader$initconfig, (p_247792_) -> { return new WorldLoader.DataLoadOutput<>(new CreateWorldScreen.DataPackReloadCookie(new WorldGenSettings(WorldOptions.m_247394_(), WorldPresets.m_246552_(p_247792_.f_244104_())), p_247792_.f_244127_()), p_247792_.f_243759_()); }, (p_247798_, p_247799_, p_247800_, p_247801_) -> { -@@ -121,7 +_,10 @@ +@@ -127,7 +_,10 @@ return new WorldCreationContext(p_247801_.f_243966_(), p_247800_, p_247799_, p_247801_.f_243979_()); }, Util.m_183991_(), p_232897_); p_232897_.m_18701_(completablefuture::isDone); -- p_232897_.m_91152_(new CreateWorldScreen(p_232898_, WorldDataConfiguration.f_244649_, new WorldGenSettingsComponent(completablefuture.join(), Optional.of(WorldPresets.f_226437_), OptionalLong.empty()))); +- p_232897_.m_91152_(new CreateWorldScreen(p_232897_, p_232898_, completablefuture.join(), Optional.of(WorldPresets.f_226437_), OptionalLong.empty())); + // FORGE: Force load mods' datapacks after setting screen and ensure datapack selection reverts to vanilla if invalid. -+ CreateWorldScreen createWorldScreen = new CreateWorldScreen(p_232898_, new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_), new WorldGenSettingsComponent(completablefuture.join(), Optional.of(WorldPresets.f_226437_), OptionalLong.empty())); ++ CreateWorldScreen createWorldScreen = new CreateWorldScreen(p_232897_, p_232898_, completablefuture.join().withDataConfiguration(new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_)), Optional.of(WorldPresets.f_226437_), OptionalLong.empty()); + p_232897_.m_91152_(createWorldScreen); -+ createWorldScreen.m_100878_(packrepository); ++ createWorldScreen.m_269443_(packrepository, true, createWorldScreen::m_267734_); } - public static CreateWorldScreen m_247077_(@Nullable Screen p_249522_, LevelSettings p_249091_, WorldCreationContext p_249742_, @Nullable Path p_252076_) { -@@ -491,7 +_,7 @@ - if (p_232949_) { - this.m_100975_(); - } else { -- this.f_244371_ = WorldDataConfiguration.f_244649_; -+ this.f_244371_ = new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_); // FORGE: Revert to *actual* vanilla data - this.f_96541_.m_91152_(this); - } + public static CreateWorldScreen m_275847_(Minecraft p_276017_, @Nullable Screen p_276029_, LevelSettings p_276055_, WorldCreationContext p_276028_, @Nullable Path p_276040_) { +@@ -368,7 +_,7 @@ + if (p_269627_) { + p_270552_.accept(this.f_267389_.m_267573_().f_243842_()); + } else { +- p_270552_.accept(WorldDataConfiguration.f_244649_); ++ p_270552_.accept(new WorldDataConfiguration(new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()), FeatureFlags.f_244332_)); // FORGE: Revert to *actual* vanilla data + } -@@ -612,6 +_,7 @@ + }, Component.m_237115_("dataPack.validation.failed"), CommonComponents.f_237098_, Component.m_237115_("dataPack.validation.back"), Component.m_237115_("dataPack.validation.reset"))); +@@ -482,6 +_,7 @@ if (path != null) { if (this.f_100832_ == null) { this.f_100832_ = ServerPacksSource.m_245786_(path); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch new file mode 100644 index 0000000000..231523eeb1 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java ++++ b/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java +@@ -38,6 +_,10 @@ + return new WorldCreationContext(this.f_244272_, this.f_244375_, p_250676_.apply(this.m_246480_(), this.f_243796_), this.f_243708_, this.f_232990_, this.f_243842_); + } + ++ public WorldCreationContext withDataConfiguration(WorldDataConfiguration dataConfiguration) { ++ return new WorldCreationContext(this.f_244272_, this.f_244375_, this.f_243796_, this.f_243708_, this.f_232990_, dataConfiguration); ++ } ++ + public RegistryAccess.Frozen m_246480_() { + return this.f_243708_.m_247579_(); + } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch index e913d0929c..61cb12c660 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java +++ b/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java -@@ -158,13 +_,23 @@ +@@ -159,13 +_,23 @@ } private void m_233145_(Screen p_233146_, String p_233147_, boolean p_233148_, boolean p_233149_) { @@ -23,8 +23,8 @@ + } } catch (Exception exception) { f_233088_.warn("Failed to load level data or datapacks, can't proceed with server load", (Throwable)exception); - this.f_233089_.m_91152_(new DatapackLoadFailureScreen(() -> { -@@ -177,7 +_,9 @@ + if (!p_233148_) { +@@ -185,7 +_,9 @@ WorldData worlddata = worldstem.f_206895_(); boolean flag = worlddata.m_246337_().m_247070_(); boolean flag1 = worlddata.m_5754_() != Lifecycle.stable(); @@ -35,7 +35,7 @@ this.f_233089_.m_247489_().m_247400_(levelstoragesource$levelstorageaccess).thenApply((p_233177_) -> { return true; }).exceptionallyComposeAsync((p_233183_) -> { -@@ -199,9 +_,11 @@ +@@ -207,9 +_,11 @@ return null; }); } else { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch index 25ba8f12aa..f55a7e6c71 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java +++ b/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java -@@ -65,6 +_,7 @@ +@@ -63,6 +_,7 @@ static final DateFormat f_101646_ = new SimpleDateFormat(); static final ResourceLocation f_101647_ = new ResourceLocation("textures/misc/unknown_server.png"); static final ResourceLocation f_101648_ = new ResourceLocation("textures/gui/world_selection.png"); @@ -8,7 +8,7 @@ static final Component f_101649_ = Component.m_237115_("selectWorld.tooltip.fromNewerVersion1").m_130940_(ChatFormatting.RED); static final Component f_101650_ = Component.m_237115_("selectWorld.tooltip.fromNewerVersion2").m_130940_(ChatFormatting.RED); static final Component f_101651_ = Component.m_237115_("selectWorld.tooltip.snapshot1").m_130940_(ChatFormatting.GOLD); -@@ -325,6 +_,7 @@ +@@ -313,6 +_,7 @@ RenderSystem.m_69478_(); GuiComponent.m_93133_(p_101721_, p_101724_, p_101723_, 0.0F, 0.0F, 32, 32, 32, 32); RenderSystem.m_69461_(); @@ -16,7 +16,7 @@ if (this.f_101693_.f_91066_.m_231828_().m_231551_() || p_101729_) { RenderSystem.m_157456_(0, WorldSelectionList.f_101648_); GuiComponent.m_93172_(p_101721_, p_101724_, p_101723_, p_101724_ + 32, p_101723_ + 32, -1601138544); -@@ -560,6 +_,21 @@ +@@ -545,6 +_,21 @@ public boolean m_214209_() { return !this.f_101695_.m_164916_(); diff --git a/patches/minecraft/net/minecraft/client/main/Main.java.patch b/patches/minecraft/net/minecraft/client/main/Main.java.patch index ef087553e5..a937b1fc33 100644 --- a/patches/minecraft/net/minecraft/client/main/Main.java.patch +++ b/patches/minecraft/net/minecraft/client/main/Main.java.patch @@ -1,15 +1,6 @@ --- a/net/minecraft/client/main/Main.java +++ b/net/minecraft/client/main/Main.java -@@ -48,7 +_,7 @@ - - @DontObfuscate - public static void main(String[] p_129642_) { -- m_239872_(p_129642_, true); -+ m_239872_(p_129642_, !net.minecraftforge.fml.loading.FMLConfig.isOptimizedDFUDisabled()); - } - - public static void m_239872_(String[] p_239873_, boolean p_239874_) { -@@ -142,7 +_,7 @@ +@@ -135,7 +_,7 @@ } CrashReport.m_127529_(); diff --git a/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch b/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch index f31293050a..7f0754cf99 100644 --- a/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch +++ b/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/model/HumanoidModel.java +++ b/net/minecraft/client/model/HumanoidModel.java -@@ -264,6 +_,8 @@ +@@ -270,6 +_,8 @@ case TOOT_HORN: this.f_102811_.f_104203_ = Mth.m_14036_(this.f_102808_.f_104203_, -1.2F, 1.2F) - 1.4835298F; this.f_102811_.f_104204_ = this.f_102808_.f_104204_ - ((float)Math.PI / 6F); @@ -9,7 +9,7 @@ } } -@@ -304,6 +_,8 @@ +@@ -314,6 +_,8 @@ case TOOT_HORN: this.f_102812_.f_104203_ = Mth.m_14036_(this.f_102808_.f_104203_, -1.2F, 1.2F) - 1.4835298F; this.f_102812_.f_104204_ = this.f_102808_.f_104204_ + ((float)Math.PI / 6F); @@ -18,7 +18,7 @@ } } -@@ -396,7 +_,7 @@ +@@ -406,7 +_,7 @@ } @OnlyIn(Dist.CLIENT) @@ -27,7 +27,7 @@ EMPTY(false), ITEM(false), BLOCK(false), -@@ -411,10 +_,29 @@ +@@ -422,10 +_,29 @@ private ArmPose(boolean p_102896_) { this.f_102890_ = p_102896_; diff --git a/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch b/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch index 21e232dc2e..ab4e24cbeb 100644 --- a/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch +++ b/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/model/geom/LayerDefinitions.java +++ b/net/minecraft/client/model/geom/LayerDefinitions.java -@@ -313,6 +_,7 @@ +@@ -319,6 +_,7 @@ WoodType.m_61843_().forEach((p_247864_) -> { builder.put(ModelLayers.m_247439_(p_247864_), layerdefinition24); }); diff --git a/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch b/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch index 1f918f5773..4b2cd06100 100644 --- a/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch +++ b/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch @@ -1,17 +1,17 @@ --- a/net/minecraft/client/model/geom/ModelLayers.java +++ b/net/minecraft/client/model/geom/ModelLayers.java -@@ -217,11 +_,13 @@ +@@ -220,11 +_,13 @@ } public static ModelLayerLocation m_171291_(WoodType p_171292_) { -- return m_171300_("sign/" + p_171292_.m_61846_(), "main"); -+ ResourceLocation location = new ResourceLocation(p_171292_.m_61846_()); +- return m_171300_("sign/" + p_171292_.f_61839_(), "main"); ++ ResourceLocation location = new ResourceLocation(p_171292_.f_61839_()); + return new ModelLayerLocation(new ResourceLocation(location.m_135827_(), "sign/" + location.m_135815_()), "main"); } public static ModelLayerLocation m_247439_(WoodType p_252225_) { -- return m_171300_("hanging_sign/" + p_252225_.m_61846_(), "main"); -+ ResourceLocation location = new ResourceLocation(p_252225_.m_61846_()); +- return m_171300_("hanging_sign/" + p_252225_.f_61839_(), "main"); ++ ResourceLocation location = new ResourceLocation(p_252225_.f_61839_()); + return new ModelLayerLocation(new ResourceLocation(location.m_135827_(), "hanging_sign/" + location.m_135815_()), "main"); } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientChunkCache.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientChunkCache.java.patch index d1d64256db..d595d17988 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientChunkCache.java.patch @@ -8,7 +8,7 @@ this.f_104410_.m_104487_(i, levelchunk, (LevelChunk)null); } -@@ -100,6 +_,7 @@ +@@ -115,6 +_,7 @@ } this.f_104411_.m_171649_(chunkpos); diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch index 22b3b7ea3f..ee28723c4e 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ClientLevel.java +++ b/net/minecraft/client/multiplayer/ClientLevel.java -@@ -117,12 +_,15 @@ +@@ -116,12 +_,15 @@ p_194170_.put(BiomeColors.f_108791_, new BlockTintCache((p_194168_) -> { return this.m_104762_(p_194168_, BiomeColors.f_108791_); })); @@ -16,7 +16,7 @@ public void m_233651_(int p_233652_) { this.f_233599_.m_233856_(p_233652_, this); -@@ -176,6 +_,8 @@ +@@ -175,6 +_,8 @@ this.f_194123_ = p_205510_; this.m_46465_(); this.m_46466_(); @@ -25,7 +25,7 @@ } public void m_194171_(Runnable p_194172_) { -@@ -262,6 +_,7 @@ +@@ -261,6 +_,7 @@ this.m_46473_().m_6521_(() -> { return BuiltInRegistries.f_256780_.m_7981_(p_104640_.m_6095_()).toString(); }); @@ -33,7 +33,7 @@ p_104640_.m_8119_(); this.m_46473_().m_7238_(); -@@ -324,8 +_,10 @@ +@@ -323,8 +_,10 @@ } private void m_104739_(int p_104740_, Entity p_104741_) { @@ -44,7 +44,7 @@ } public void m_171642_(int p_171643_, Entity.RemovalReason p_171644_) { -@@ -452,6 +_,12 @@ +@@ -451,6 +_,12 @@ } public void m_262808_(@Nullable Player p_263381_, double p_263372_, double p_263404_, double p_263365_, Holder p_263335_, SoundSource p_263417_, float p_263416_, float p_263349_, long p_263408_) { @@ -57,7 +57,7 @@ if (p_263381_ == this.f_104565_.f_91074_) { this.m_233602_(p_263372_, p_263404_, p_263365_, p_263335_.m_203334_(), p_263417_, p_263416_, p_263349_, false, p_263408_); } -@@ -459,6 +_,12 @@ +@@ -458,6 +_,12 @@ } public void m_213890_(@Nullable Player p_263514_, Entity p_263536_, Holder p_263518_, SoundSource p_263487_, float p_263538_, float p_263524_, long p_263509_) { @@ -70,7 +70,7 @@ if (p_263514_ == this.f_104565_.f_91074_) { this.f_104565_.m_91106_().m_120367_(new EntityBoundSoundInstance(p_263518_.m_203334_(), p_263487_, p_263538_, p_263524_, p_263536_, p_263509_)); } -@@ -907,6 +_,7 @@ +@@ -902,6 +_,7 @@ } public void m_104851_(Difficulty p_104852_) { @@ -78,7 +78,7 @@ this.f_104840_ = p_104852_; } -@@ -944,14 +_,46 @@ +@@ -939,14 +_,46 @@ ClientLevel.this.f_104566_.add((AbstractClientPlayer)p_171712_); } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch index dc7c9f093a..4222814ad5 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch @@ -1,33 +1,33 @@ --- a/net/minecraft/client/multiplayer/ClientPacketListener.java +++ b/net/minecraft/client/multiplayer/ClientPacketListener.java -@@ -398,6 +_,7 @@ +@@ -411,6 +_,7 @@ this.f_104888_.f_91064_.m_113434_(); this.f_104888_.f_91074_.m_172530_(); -+ net.minecraftforge.client.ForgeHooksClient.firePlayerLogin(this.f_104888_.f_91072_, this.f_104888_.f_91074_, this.f_104888_.m_91403_().m_6198_()); ++ net.minecraftforge.client.ForgeHooksClient.firePlayerLogin(this.f_104888_.f_91072_, this.f_104888_.f_91074_, this.f_104888_.m_91403_().f_104885_); int i = p_105030_.f_132360_(); this.f_104888_.f_91074_.m_20234_(i); this.f_104889_.m_104630_(i, this.f_104888_.f_91074_); -@@ -410,6 +_,7 @@ +@@ -423,6 +_,7 @@ this.f_104888_.f_91074_.m_219749_(p_105030_.f_238174_()); this.f_104888_.f_91072_.m_171805_(p_105030_.f_132363_(), p_105030_.f_132364_()); this.f_104888_.f_91066_.m_193770_(p_105030_.f_132370_()); + net.minecraftforge.network.NetworkHooks.sendMCRegistryPackets(f_104885_, "PLAY_TO_SERVER"); this.f_104888_.f_91066_.m_92172_(); this.f_104885_.m_129512_(new ServerboundCustomPayloadPacket(ServerboundCustomPayloadPacket.f_133979_, (new FriendlyByteBuf(Unpooled.buffer())).m_130070_(ClientBrandRetriever.m_129629_()))); - this.f_244346_ = new LastSeenMessagesTracker(20); -@@ -1003,8 +_,10 @@ + this.f_252517_ = null; +@@ -1055,8 +_,10 @@ localplayer1.m_21204_().m_22159_(localplayer.m_21204_()); } + localplayer1.updateSyncFields(localplayer); // Forge: fix MC-10657 localplayer1.m_172530_(); localplayer1.m_108748_(s); -+ net.minecraftforge.client.ForgeHooksClient.firePlayerRespawn(this.f_104888_.f_91072_, localplayer, localplayer1, localplayer1.f_108617_.m_6198_()); ++ net.minecraftforge.client.ForgeHooksClient.firePlayerRespawn(this.f_104888_.f_91072_, localplayer, localplayer1, localplayer1.f_108617_.f_104885_); this.f_104889_.m_104630_(i, localplayer1); localplayer1.m_146922_(-180.0F); localplayer1.f_108618_ = new KeyboardInput(this.f_104888_.f_91066_); -@@ -1109,10 +_,7 @@ +@@ -1161,10 +_,7 @@ PacketUtils.m_131363_(p_104976_, this, this.f_104888_); BlockPos blockpos = p_104976_.m_131704_(); this.f_104888_.f_91073_.m_141902_(blockpos, p_104976_.m_195645_()).ifPresent((p_205557_) -> { @@ -39,7 +39,7 @@ if (p_205557_ instanceof CommandBlockEntity && this.f_104888_.f_91080_ instanceof CommandBlockEditScreen) { ((CommandBlockEditScreen)this.f_104888_.f_91080_).m_98398_(); -@@ -1257,7 +_,9 @@ +@@ -1310,7 +_,9 @@ public void m_7443_(ClientboundCommandsPacket p_104990_) { PacketUtils.m_131363_(p_104990_, this, this.f_104888_); @@ -50,15 +50,15 @@ } public void m_7183_(ClientboundStopSoundPacket p_105116_) { -@@ -1276,6 +_,7 @@ +@@ -1329,6 +_,7 @@ ClientRecipeBook clientrecipebook = this.f_104888_.f_91074_.m_108631_(); - clientrecipebook.m_90625_(this.f_104900_.m_44051_()); + clientrecipebook.m_266394_(this.f_104900_.m_44051_(), this.f_104888_.f_91073_.m_9598_()); this.f_104888_.m_231374_(SearchRegistry.f_119943_, clientrecipebook.m_90639_()); + net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(this.f_104900_); } public void m_7244_(ClientboundPlayerLookAtPacket p_105054_) { -@@ -1368,7 +_,8 @@ +@@ -1424,7 +_,8 @@ Blocks.m_50758_(); } @@ -68,7 +68,7 @@ } public void m_241155_(ClientboundUpdateEnabledFeaturesPacket p_251591_) { -@@ -1753,6 +_,7 @@ +@@ -1826,6 +_,7 @@ } public void m_7413_(ClientboundCustomPayloadPacket p_105004_) { @@ -76,7 +76,7 @@ PacketUtils.m_131363_(p_105004_, this, this.f_104888_); ResourceLocation resourcelocation = p_105004_.m_132042_(); FriendlyByteBuf friendlybytebuf = null; -@@ -1950,7 +_,7 @@ +@@ -2023,7 +_,7 @@ int j5 = friendlybytebuf.m_130242_(); this.f_104888_.f_91064_.f_173815_.m_173830_(positionsource, j5); } else { @@ -85,7 +85,7 @@ } } finally { if (friendlybytebuf != null) { -@@ -2284,6 +_,8 @@ +@@ -2370,6 +_,8 @@ } public void m_246175_(String p_249888_) { @@ -94,7 +94,7 @@ Instant instant = Instant.now(); long i = Crypt.SaltSupplier.m_216113_(); LastSeenMessagesTracker.Update lastseenmessagestracker$update = this.f_244346_.m_246442_(); -@@ -2292,6 +_,7 @@ +@@ -2378,6 +_,7 @@ } public void m_246623_(String p_250092_) { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch index 1b35ebfaac..c7d8bd426f 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/client/multiplayer/ServerData.java +++ b/net/minecraft/client/multiplayer/ServerData.java -@@ -26,6 +_,7 @@ - private String f_105372_; +@@ -32,6 +_,7 @@ + private byte[] f_271511_; private boolean f_105373_; private boolean f_242950_; + public net.minecraftforge.client.ExtendedServerListData forgeData = null; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch index 892f7f7fa5..8ec08429b7 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/client/multiplayer/ServerStatusPinger.java +++ b/net/minecraft/client/multiplayer/ServerStatusPinger.java -@@ -124,6 +_,7 @@ - p_105461_.run(); - } +@@ -116,6 +_,7 @@ + } + }); + net.minecraftforge.client.ForgeHooksClient.processForgeListPingData(serverstatus, p_105460_); this.f_105477_ = Util.m_137550_(); connection.m_129512_(new ServerboundPingRequestPacket(this.f_105477_)); diff --git a/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch b/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch index 3c912fef3e..5d79a30ff8 100644 --- a/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch @@ -14,7 +14,7 @@ private final Queue f_107294_ = Queues.newArrayDeque(); private final Map f_107295_ = Maps.newHashMap(); private final TextureAtlas f_107296_; -@@ -188,14 +_,18 @@ +@@ -191,10 +_,14 @@ this.m_107378_(ParticleTypes.f_235901_, ShriekParticle.Provider::new); } @@ -25,6 +25,15 @@ + this.f_107293_.put(BuiltInRegistries.f_257034_.m_7981_(p_107382_), p_107383_); } ++ /** @deprecated Register via {@link net.minecraftforge.client.event.RegisterParticleProvidersEvent} */ ++ @Deprecated + public void m_272137_(ParticleType p_273423_, ParticleProvider.Sprite p_273134_) { + this.m_107378_(p_273423_, (p_272320_) -> { + return (p_272323_, p_272324_, p_272325_, p_272326_, p_272327_, p_272328_, p_272329_, p_272330_) -> { +@@ -208,10 +_,12 @@ + }); + } + + /** @deprecated Register via {@link net.minecraftforge.client.event.RegisterParticleProvidersEvent} */ + @Deprecated public void m_107378_(ParticleType p_107379_, ParticleEngine.SpriteParticleRegistration p_107380_) { @@ -35,7 +44,7 @@ } public CompletableFuture m_5540_(PreparableReloadListener.PreparationBarrier p_107305_, ResourceManager p_107306_, ProfilerFiller p_107307_, ProfilerFiller p_107308_, Executor p_107309_, Executor p_107310_) { -@@ -313,7 +_,7 @@ +@@ -310,7 +_,7 @@ @Nullable private Particle m_107395_(T p_107396_, double p_107397_, double p_107398_, double p_107399_, double p_107400_, double p_107401_, double p_107402_) { @@ -44,7 +53,7 @@ return particleprovider == null ? null : particleprovider.m_6966_(p_107396_, this.f_107287_, p_107397_, p_107398_, p_107399_, p_107400_, p_107401_, p_107402_); } -@@ -394,15 +_,25 @@ +@@ -391,15 +_,24 @@ } } @@ -58,7 +67,6 @@ p_107339_.m_109896_(); RenderSystem.m_69482_(); + RenderSystem.m_69388_(org.lwjgl.opengl.GL13.GL_TEXTURE2); -+ RenderSystem.m_69493_(); + RenderSystem.m_69388_(org.lwjgl.opengl.GL13.GL_TEXTURE0); PoseStack posestack = RenderSystem.m_157191_(); posestack.m_85836_(); @@ -71,7 +79,7 @@ Iterable iterable = this.f_107289_.get(particlerendertype); if (iterable != null) { RenderSystem.m_157427_(GameRenderer::m_172829_); -@@ -412,6 +_,7 @@ +@@ -408,6 +_,7 @@ particlerendertype.m_6505_(bufferbuilder, this.f_107291_); for(Particle particle : iterable) { @@ -79,7 +87,7 @@ try { particle.m_5744_(bufferbuilder, p_107340_, p_107341_); } catch (Throwable throwable) { -@@ -441,7 +_,7 @@ +@@ -437,7 +_,7 @@ } public void m_107355_(BlockPos p_107356_, BlockState p_107357_) { @@ -88,7 +96,7 @@ VoxelShape voxelshape = p_107357_.m_60808_(this.f_107287_, p_107356_); double d0 = 0.25D; voxelshape.m_83286_((p_172273_, p_172274_, p_172275_, p_172276_, p_172277_, p_172278_) -> { -@@ -461,7 +_,7 @@ +@@ -457,7 +_,7 @@ double d7 = d4 * d1 + p_172273_; double d8 = d5 * d2 + p_172274_; double d9 = d6 * d3 + p_172275_; @@ -97,7 +105,7 @@ } } } -@@ -505,12 +_,18 @@ +@@ -501,12 +_,18 @@ d0 = (double)i + aabb.f_82291_ + (double)0.1F; } diff --git a/patches/minecraft/net/minecraft/client/player/AbstractClientPlayer.java.patch b/patches/minecraft/net/minecraft/client/player/AbstractClientPlayer.java.patch index 9128e05de3..4aae4ddda4 100644 --- a/patches/minecraft/net/minecraft/client/player/AbstractClientPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/player/AbstractClientPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/player/AbstractClientPlayer.java +++ b/net/minecraft/client/player/AbstractClientPlayer.java -@@ -136,6 +_,6 @@ +@@ -147,6 +_,6 @@ } } diff --git a/patches/minecraft/net/minecraft/client/player/LocalPlayer.java.patch b/patches/minecraft/net/minecraft/client/player/LocalPlayer.java.patch index 48192aaffe..96893d2c6c 100644 --- a/patches/minecraft/net/minecraft/client/player/LocalPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/player/LocalPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/player/LocalPlayer.java +++ b/net/minecraft/client/player/LocalPlayer.java -@@ -150,6 +_,7 @@ +@@ -149,6 +_,7 @@ } public boolean m_6469_(DamageSource p_108662_, float p_108663_) { @@ -8,7 +8,7 @@ return false; } -@@ -276,6 +_,7 @@ +@@ -275,6 +_,7 @@ public boolean m_108700_(boolean p_108701_) { ServerboundPlayerActionPacket.Action serverboundplayeractionpacket$action = p_108701_ ? ServerboundPlayerActionPacket.Action.DROP_ALL_ITEMS : ServerboundPlayerActionPacket.Action.DROP_ITEM; @@ -16,7 +16,7 @@ ItemStack itemstack = this.m_150109_().m_182403_(p_108701_); this.f_108617_.m_104955_(new ServerboundPlayerActionPacket(serverboundplayeractionpacket$action, BlockPos.f_121853_, Direction.DOWN)); return !itemstack.m_41619_(); -@@ -462,7 +_,14 @@ +@@ -456,7 +_,14 @@ } public void m_5496_(SoundEvent p_108651_, float p_108652_, float p_108653_) { @@ -32,7 +32,7 @@ } public void m_6330_(SoundEvent p_108655_, SoundSource p_108656_, float p_108657_, float p_108658_) { -@@ -634,6 +_,7 @@ +@@ -627,6 +_,7 @@ this.f_108601_ = !this.m_150110_().f_35935_ && !this.m_6069_() && this.m_20175_(Pose.CROUCHING) && (this.m_6144_() || !this.m_5803_() && !this.m_20175_(Pose.STANDING)); float f = Mth.m_14036_(0.3F + EnchantmentHelper.m_220302_(this), 0.0F, 1.0F); this.f_108618_.m_214106_(this.m_108635_(), f); @@ -40,37 +40,37 @@ this.f_108619_.m_91301_().m_120586_(this.f_108618_); if (this.m_6117_() && !this.m_20159_()) { this.f_108618_.f_108566_ *= 0.2F; -@@ -660,7 +_,7 @@ - } - - boolean flag4 = this.m_255269_(); -- if ((this.f_19861_ || this.m_5842_() || this.m_20159_() && this.m_20202_().m_20096_()) && !flag1 && !flag2 && this.m_108733_() && !this.m_20142_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_)) { -+ if ((this.f_19861_ || this.m_5842_() || this.m_20159_() && this.m_20202_().m_20096_() || this.canStartSwimming()) && !flag1 && !flag2 && this.m_108733_() && !this.m_20142_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_)) { +@@ -655,7 +_,7 @@ + boolean flag4 = this.m_264082_(); + boolean flag5 = this.m_20159_() ? this.m_20202_().m_20096_() : this.f_19861_; + boolean flag6 = !flag1 && !flag2; +- if ((flag5 || this.m_5842_()) && flag6 && flag4) { ++ if ((flag5 || this.m_5842_() || this.canStartSwimming()) && flag6 && flag4) { if (this.f_108583_ <= 0 && !this.f_108619_.f_91066_.f_92091_.m_90857_()) { this.f_108583_ = 7; } else { -@@ -668,15 +_,15 @@ +@@ -663,15 +_,15 @@ } } -- if (!this.m_20142_() && (!this.m_20069_() || this.m_5842_()) && this.m_108733_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_) && this.f_108619_.f_91066_.f_92091_.m_90857_()) { +- if ((!this.m_20069_() || this.m_5842_()) && flag4 && this.f_108619_.f_91066_.f_92091_.m_90857_()) { + if (!this.m_20142_() && (!(this.m_20069_() || this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType))) || (this.m_5842_() || this.canStartSwimming())) && this.m_108733_() && flag4 && !this.m_6117_() && !this.m_21023_(MobEffects.f_19610_) && this.f_108619_.f_91066_.f_92091_.m_90857_()) { this.m_6858_(true); } if (this.m_20142_()) { - boolean flag5 = !this.f_108618_.m_108577_() || !flag4; -- boolean flag6 = flag5 || this.f_19862_ && !this.f_185931_ || this.m_20069_() && !this.m_5842_(); -+ boolean flag6 = flag5 || this.f_19862_ && !this.f_185931_ || (this.m_20069_() && !this.m_5842_()) || (this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)) && !this.canStartSwimming()); + boolean flag7 = !this.f_108618_.m_108577_() || !this.m_255269_(); +- boolean flag8 = flag7 || this.f_19862_ && !this.f_185931_ || this.m_20069_() && !this.m_5842_(); ++ boolean flag8 = flag7 || this.f_19862_ && !this.f_185931_ || this.m_20069_() && !this.m_5842_() || (this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)) && !this.canStartSwimming()); if (this.m_6069_()) { -- if (!this.f_19861_ && !this.f_108618_.f_108573_ && flag5 || !this.m_20069_()) { +- if (!this.f_19861_ && !this.f_108618_.f_108573_ && flag7 || !this.m_20069_()) { + if (!this.f_19861_ && !this.f_108618_.f_108573_ && flag5 || !(this.m_20069_() || this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)))) { this.m_6858_(false); } - } else if (flag6) { -@@ -706,14 +_,15 @@ + } else if (flag8) { +@@ -701,14 +_,15 @@ - if (this.f_108618_.f_108572_ && !flag7 && !flag && !this.m_150110_().f_35935_ && !this.m_20159_() && !this.m_6147_()) { + if (this.f_108618_.f_108572_ && !flag9 && !flag && !this.m_150110_().f_35935_ && !this.m_20159_() && !this.m_6147_()) { ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST); - if (itemstack.m_150930_(Items.f_42741_) && ElytraItem.m_41140_(itemstack) && this.m_36319_()) { + if (itemstack.canElytraFly(this) && this.m_36319_()) { @@ -87,15 +87,15 @@ } if (this.m_204029_(FluidTags.f_13131_)) { -@@ -824,6 +_,7 @@ +@@ -819,6 +_,7 @@ public void m_6083_() { super.m_6083_(); + if (this.m_36342_() && this.m_20159_()) this.f_108618_.f_108573_ = false; this.f_108611_ = false; - if (this.m_20202_() instanceof Boat) { - Boat boat = (Boat)this.m_20202_(); -@@ -1041,6 +_,18 @@ + Entity entity = this.m_275832_(); + if (entity instanceof Boat boat) { +@@ -1044,6 +_,18 @@ } else { return super.m_7398_(p_108758_); } diff --git a/patches/minecraft/net/minecraft/client/player/RemotePlayer.java.patch b/patches/minecraft/net/minecraft/client/player/RemotePlayer.java.patch index e71c7c13a6..96edea9c15 100644 --- a/patches/minecraft/net/minecraft/client/player/RemotePlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/player/RemotePlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/player/RemotePlayer.java +++ b/net/minecraft/client/player/RemotePlayer.java -@@ -28,6 +_,7 @@ +@@ -32,6 +_,7 @@ } public boolean m_6469_(DamageSource p_108772_, float p_108773_) { diff --git a/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch index c7016e0488..b3f876abef 100644 --- a/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/GameRenderer.java +++ b/net/minecraft/client/renderer/GameRenderer.java -@@ -299,6 +_,8 @@ +@@ -304,6 +_,8 @@ this.m_109128_(new ResourceLocation("shaders/post/spider.json")); } else if (p_109107_ instanceof EnderMan) { this.m_109128_(new ResourceLocation("shaders/post/invert.json")); @@ -9,7 +9,7 @@ } } -@@ -586,6 +_,7 @@ +@@ -597,6 +_,7 @@ list1.add(Pair.of(new ShaderInstance(p_250719_, "rendertype_crumbling", DefaultVertexFormat.f_85811_), (p_234230_) -> { f_172607_ = p_234230_; })); @@ -17,7 +17,7 @@ } catch (IOException ioexception) { list1.forEach((p_172729_) -> { p_172729_.getFirst().close(); -@@ -667,19 +_,21 @@ +@@ -678,19 +_,21 @@ boolean flag = false; int i = 3; double d1 = d0; @@ -42,16 +42,16 @@ d1 = this.f_109059_.f_91077_.m_82450_().m_82557_(vec3); } -@@ -694,7 +_,7 @@ +@@ -705,7 +_,7 @@ Entity entity1 = entityhitresult.m_82443_(); Vec3 vec33 = entityhitresult.m_82450_(); double d2 = vec3.m_82557_(vec33); - if (flag && d2 > 9.0D) { + if (false && flag && d2 > 9.0D) { //Forge: Always keep the entity result to allow for extended reach interactions. - this.f_109059_.f_91077_ = BlockHitResult.m_82426_(vec33, Direction.m_122366_(vec31.f_82479_, vec31.f_82480_, vec31.f_82481_), new BlockPos(vec33)); + this.f_109059_.f_91077_ = BlockHitResult.m_82426_(vec33, Direction.m_122366_(vec31.f_82479_, vec31.f_82480_, vec31.f_82481_), BlockPos.m_274446_(vec33)); } else if (d2 < d1 || this.f_109059_.f_91077_ == null) { this.f_109059_.f_91077_ = entityhitresult; -@@ -748,7 +_,7 @@ +@@ -759,7 +_,7 @@ d0 *= Mth.m_14139_(this.f_109059_.f_91066_.m_231925_().m_231551_(), 1.0D, (double)0.85714287F); } @@ -60,7 +60,7 @@ } } -@@ -883,11 +_,11 @@ +@@ -894,12 +_,12 @@ Window window = this.f_109059_.m_91268_(); RenderSystem.m_69421_(256, Minecraft.f_91002_); @@ -68,13 +68,14 @@ + Matrix4f matrix4f = (new Matrix4f()).setOrtho(0.0F, (float)((double)window.m_85441_() / window.m_85449_()), (float)((double)window.m_85442_() / window.m_85449_()), 0.0F, 1000.0F, net.minecraftforge.client.ForgeHooksClient.getGuiFarPlane()); RenderSystem.m_252934_(matrix4f); PoseStack posestack = RenderSystem.m_157191_(); + posestack.m_85836_(); posestack.m_166856_(); - posestack.m_252880_(0.0F, 0.0F, -2000.0F); + posestack.m_85837_(0.0D, 0.0D, 1000F-net.minecraftforge.client.ForgeHooksClient.getGuiFarPlane()); RenderSystem.m_157182_(); Lighting.m_84931_(); PoseStack posestack1 = new PoseStack(); -@@ -923,7 +_,7 @@ +@@ -935,7 +_,7 @@ } } else if (this.f_109059_.f_91080_ != null) { try { @@ -83,7 +84,7 @@ } catch (Throwable throwable1) { CrashReport crashreport1 = CrashReport.m_127521_(throwable1, "Rendering screen"); CrashReportCategory crashreportcategory1 = crashreport1.m_127514_("Screen render details"); -@@ -1068,12 +_,19 @@ +@@ -1085,12 +_,19 @@ Matrix4f matrix4f = posestack.m_85850_().m_252922_(); this.m_252879_(matrix4f); camera.m_90575_(this.f_109059_.f_91073_, (Entity)(this.f_109059_.m_91288_() == null ? this.f_109059_.f_91074_ : this.f_109059_.m_91288_()), !this.f_109059_.f_91066_.m_92176_().m_90612_(), this.f_109059_.f_91066_.m_92176_().m_90613_(), p_109090_); diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch index 261b4f6eda..8626fd82d7 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch @@ -5,18 +5,18 @@ @OnlyIn(Dist.CLIENT) public class ItemBlockRenderTypes { + @Deprecated - private static final Map f_109275_ = Util.m_137469_(Maps.newHashMap(), (p_109296_) -> { + private static final Map f_109275_ = Util.m_137469_(Maps.newHashMap(), (p_272331_) -> { RenderType rendertype = RenderType.m_110503_(); - p_109296_.put(Blocks.f_50267_, rendertype); -@@ -298,6 +_,7 @@ - p_109296_.put(Blocks.f_50628_, rendertype3); - p_109296_.put(Blocks.f_152498_, rendertype3); + p_272331_.put(Blocks.f_50267_, rendertype); +@@ -307,6 +_,7 @@ + p_272331_.put(Blocks.f_50628_, rendertype3); + p_272331_.put(Blocks.f_152498_, rendertype3); }); + @Deprecated private static final Map f_109276_ = Util.m_137469_(Maps.newHashMap(), (p_109290_) -> { RenderType rendertype = RenderType.m_110466_(); p_109290_.put(Fluids.f_76192_, rendertype); -@@ -305,6 +_,8 @@ +@@ -314,6 +_,8 @@ }); private static boolean f_109277_; @@ -25,7 +25,7 @@ public static RenderType m_109282_(BlockState p_109283_) { Block block = p_109283_.m_60734_(); if (block instanceof LeavesBlock) { -@@ -315,6 +_,8 @@ +@@ -324,6 +_,8 @@ } } @@ -34,7 +34,7 @@ public static RenderType m_109293_(BlockState p_109294_) { Block block = p_109294_.m_60734_(); if (block instanceof LeavesBlock) { -@@ -329,6 +_,8 @@ +@@ -338,6 +_,8 @@ } } @@ -43,7 +43,7 @@ public static RenderType m_109284_(BlockState p_109285_, boolean p_109286_) { RenderType rendertype = m_109282_(p_109285_); if (rendertype == RenderType.m_110466_()) { -@@ -342,6 +_,8 @@ +@@ -351,6 +_,8 @@ } } @@ -52,7 +52,7 @@ public static RenderType m_109279_(ItemStack p_109280_, boolean p_109281_) { Item item = p_109280_.m_41720_(); if (item instanceof BlockItem) { -@@ -353,8 +_,73 @@ +@@ -362,8 +_,73 @@ } public static RenderType m_109287_(FluidState p_109288_) { diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemInHandRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemInHandRenderer.java.patch index 93347e8f51..0e58401414 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemInHandRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemInHandRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/ItemInHandRenderer.java +++ b/net/minecraft/client/renderer/ItemInHandRenderer.java -@@ -286,12 +_,14 @@ +@@ -312,12 +_,14 @@ if (iteminhandrenderer$handrenderselection.f_172921_) { float f4 = interactionhand == InteractionHand.MAIN_HAND ? f : 0.0F; float f5 = 1.0F - Mth.m_14179_(p_109315_, this.f_109303_, this.f_109302_); @@ -15,7 +15,7 @@ this.m_109371_(p_109318_, p_109315_, f1, InteractionHand.OFF_HAND, f6, this.f_109301_, f7, p_109316_, p_109317_, p_109319_); } -@@ -342,7 +_,7 @@ +@@ -368,7 +_,7 @@ } else { this.m_109353_(p_109379_, p_109380_, p_109381_, p_109378_, humanoidarm, p_109376_, p_109377_); } @@ -24,15 +24,15 @@ boolean flag1 = CrossbowItem.m_40932_(p_109377_); boolean flag2 = humanoidarm == HumanoidArm.RIGHT; int i = flag2 ? 1 : -1; -@@ -384,6 +_,7 @@ - this.m_109322_(p_109372_, p_109377_, flag2 ? ItemTransforms.TransformType.FIRST_PERSON_RIGHT_HAND : ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND, !flag2, p_109379_, p_109380_, p_109381_); +@@ -410,6 +_,7 @@ + this.m_269530_(p_109372_, p_109377_, flag2 ? ItemDisplayContext.FIRST_PERSON_RIGHT_HAND : ItemDisplayContext.FIRST_PERSON_LEFT_HAND, !flag2, p_109379_, p_109380_, p_109381_); } else { boolean flag3 = humanoidarm == HumanoidArm.RIGHT; + if (!net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_109377_).applyForgeHandTransform(p_109379_, f_109299_.f_91074_, humanoidarm, p_109377_, p_109373_, p_109378_, p_109376_)) // FORGE: Allow items to define custom arm animation if (p_109372_.m_6117_() && p_109372_.m_21212_() > 0 && p_109372_.m_7655_() == p_109375_) { int k = flag3 ? 1 : -1; switch (p_109377_.m_41780_()) { -@@ -487,8 +_,16 @@ +@@ -516,8 +_,16 @@ this.f_109304_ = Mth.m_14036_(this.f_109304_ - 0.4F, 0.0F, 1.0F); } else { float f = localplayer.m_36403_(1.0F); diff --git a/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch index 12a5c18fcb..7689cde917 100644 --- a/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/LevelRenderer.java +++ b/net/minecraft/client/renderer/LevelRenderer.java -@@ -264,6 +_,8 @@ +@@ -265,6 +_,8 @@ } private void m_109703_(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) { @@ -18,7 +18,7 @@ float f = this.f_109461_.f_91073_.m_46722_(1.0F) / (Minecraft.m_91405_() ? 1.0F : 2.0F); if (!(f <= 0.0F)) { RandomSource randomsource = RandomSource.m_216335_((long)this.f_109477_ * 312987231L); -@@ -1141,11 +_,13 @@ +@@ -1144,11 +_,13 @@ RenderSystem.m_69421_(16640, Minecraft.f_91002_); float f = p_109605_.m_109152_(); boolean flag2 = this.f_109461_.f_91073_.m_104583_().m_5781_(Mth.m_14107_(d0), Mth.m_14107_(d1)) || this.f_109461_.f_91065_.m_93090_().m_93715_(); @@ -32,7 +32,7 @@ profilerfiller.m_6182_("fog"); FogRenderer.m_234172_(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f, 32.0F), flag2, p_109601_); profilerfiller.m_6182_("terrain_setup"); -@@ -1154,7 +_,9 @@ +@@ -1157,7 +_,9 @@ this.m_194370_(p_109604_); profilerfiller.m_6182_("terrain"); this.m_172993_(RenderType.m_110451_(), p_109600_, d0, d1, d2, p_254120_); @@ -42,7 +42,7 @@ this.m_172993_(RenderType.m_110463_(), p_109600_, d0, d1, d2, p_254120_); if (this.f_109465_.m_104583_().m_108885_()) { Lighting.m_252995_(p_109600_.m_85850_().m_252922_()); -@@ -1186,7 +_,7 @@ +@@ -1189,7 +_,7 @@ for(Entity entity : this.f_109465_.m_104735_()) { if (this.f_109463_.m_114397_(entity, frustum, d0, d1, d2) || entity.m_20367_(this.f_109461_.f_91074_)) { BlockPos blockpos = entity.m_20183_(); @@ -51,9 +51,9 @@ ++this.f_109439_; if (entity.f_19797_ == 0) { entity.f_19790_ = entity.m_20185_(); -@@ -1206,6 +_,9 @@ - int i1 = i & 255; - outlinebuffersource.m_109929_(k, l, i1, 255); +@@ -1205,6 +_,9 @@ + int i = entity.m_19876_(); + outlinebuffersource.m_109929_(FastColor.ARGB32.m_13665_(i), FastColor.ARGB32.m_13667_(i), FastColor.ARGB32.m_13669_(i), 255); } else { + if (this.m_109817_() && entity.hasCustomOutlineRendering(this.f_109461_.f_91074_)) { // FORGE: allow custom outline rendering + flag3 = true; @@ -61,7 +61,7 @@ multibuffersource = multibuffersource$buffersource; } -@@ -1220,12 +_,14 @@ +@@ -1219,12 +_,14 @@ multibuffersource$buffersource.m_109912_(RenderType.m_110452_(TextureAtlas.f_118259_)); multibuffersource$buffersource.m_109912_(RenderType.m_110458_(TextureAtlas.f_118259_)); multibuffersource$buffersource.m_109912_(RenderType.m_110476_(TextureAtlas.f_118259_)); @@ -76,7 +76,7 @@ BlockPos blockpos4 = blockentity1.m_58899_(); MultiBufferSource multibuffersource1 = multibuffersource$buffersource; p_109600_.m_85836_(); -@@ -1242,6 +_,9 @@ +@@ -1241,6 +_,9 @@ }; } } @@ -86,7 +86,7 @@ this.f_172946_.m_112267_(blockentity1, p_109601_, p_109600_, multibuffersource1); p_109600_.m_85849_(); -@@ -1251,9 +_,13 @@ +@@ -1250,9 +_,13 @@ synchronized(this.f_109468_) { for(BlockEntity blockentity : this.f_109468_) { @@ -100,7 +100,7 @@ this.f_172946_.m_112267_(blockentity, p_109601_, p_109600_, multibuffersource$buffersource); p_109600_.m_85849_(); } -@@ -1276,6 +_,7 @@ +@@ -1275,6 +_,7 @@ this.f_109461_.m_91385_().m_83947_(false); } @@ -108,17 +108,17 @@ profilerfiller.m_6182_("destroyProgress"); for(Long2ObjectMap.Entry> entry : this.f_109409_.long2ObjectEntrySet()) { -@@ -1291,7 +_,8 @@ +@@ -1290,7 +_,8 @@ p_109600_.m_85837_((double)blockpos2.m_123341_() - d0, (double)blockpos2.m_123342_() - d1, (double)blockpos2.m_123343_() - d2); - PoseStack.Pose posestack$pose = p_109600_.m_85850_(); - VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(this.f_109464_.m_110108_().m_6299_(ModelBakery.f_119229_.get(k1)), posestack$pose.m_252922_(), posestack$pose.m_252943_(), 1.0F); + PoseStack.Pose posestack$pose1 = p_109600_.m_85850_(); + VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(this.f_109464_.m_110108_().m_6299_(ModelBakery.f_119229_.get(k)), posestack$pose1.m_252922_(), posestack$pose1.m_252943_(), 1.0F); - this.f_109461_.m_91289_().m_110918_(this.f_109465_.m_8055_(blockpos2), blockpos2, this.f_109465_, p_109600_, vertexconsumer1); + net.minecraftforge.client.model.data.ModelData modelData = f_109465_.getModelDataManager().getAt(blockpos2); + this.f_109461_.m_91289_().renderBreakingTexture(this.f_109465_.m_8055_(blockpos2), blockpos2, this.f_109465_, p_109600_, vertexconsumer1, modelData == null ? net.minecraftforge.client.model.data.ModelData.EMPTY : modelData); p_109600_.m_85849_(); } } -@@ -1303,10 +_,13 @@ +@@ -1302,10 +_,13 @@ profilerfiller.m_6182_("outline"); BlockPos blockpos1 = ((BlockHitResult)hitresult).m_82425_(); BlockState blockstate = this.f_109465_.m_8055_(blockpos1); @@ -131,8 +131,8 @@ + net.minecraftforge.client.ForgeHooksClient.onDrawHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource); } - PoseStack posestack = RenderSystem.m_157191_(); -@@ -1341,7 +_,8 @@ + this.f_109461_.f_91064_.m_113457_(p_109600_, multibuffersource$buffersource, d0, d1, d2); +@@ -1337,7 +_,8 @@ this.f_109415_.m_83945_(this.f_109461_.m_91385_()); RenderStateShard.f_110126_.m_110185_(); profilerfiller.m_6182_("particles"); @@ -142,7 +142,7 @@ RenderStateShard.f_110126_.m_110188_(); } else { profilerfiller.m_6182_("translucent"); -@@ -1355,7 +_,8 @@ +@@ -1351,7 +_,8 @@ profilerfiller.m_6182_("string"); this.m_172993_(RenderType.m_110503_(), p_109600_, d0, d1, d2, p_254120_); profilerfiller.m_6182_("particles"); @@ -152,7 +152,7 @@ } posestack.m_85836_(); -@@ -1379,6 +_,7 @@ +@@ -1375,6 +_,7 @@ RenderStateShard.f_110127_.m_110185_(); profilerfiller.m_6182_("weather"); this.m_109703_(p_109606_, p_109601_, d0, d1, d2); @@ -160,7 +160,7 @@ this.m_173012_(p_109604_); RenderStateShard.f_110127_.m_110188_(); this.f_109418_.m_110023_(p_109601_); -@@ -1387,6 +_,7 @@ +@@ -1383,6 +_,7 @@ RenderSystem.m_69458_(false); profilerfiller.m_6182_("weather"); this.m_109703_(p_109606_, p_109601_, d0, d1, d2); @@ -168,7 +168,7 @@ this.m_173012_(p_109604_); RenderSystem.m_69458_(true); } -@@ -1521,6 +_,7 @@ +@@ -1526,6 +_,7 @@ shaderinstance.m_173362_(); VertexBuffer.m_85931_(); this.f_109461_.m_91307_().m_7238_(); @@ -176,7 +176,7 @@ p_172994_.m_110188_(); } -@@ -1782,6 +_,8 @@ +@@ -1740,6 +_,8 @@ } public void m_202423_(PoseStack p_202424_, Matrix4f p_254034_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) { @@ -185,7 +185,7 @@ p_202429_.run(); if (!p_202428_) { FogType fogtype = p_202427_.m_167685_(); -@@ -1914,6 +_,8 @@ +@@ -1861,6 +_,8 @@ } public void m_253054_(PoseStack p_254145_, Matrix4f p_254537_, float p_254364_, double p_253843_, double p_253663_, double p_253795_) { @@ -194,7 +194,7 @@ float f = this.f_109465_.m_104583_().m_108871_(); if (!Float.isNaN(f)) { RenderSystem.m_69464_(); -@@ -2100,7 +_,7 @@ +@@ -2047,7 +_,7 @@ boolean flag = false; if (this.f_109461_.f_91066_.m_232080_().m_231551_() == PrioritizeChunkUpdates.NEARBY) { BlockPos blockpos1 = chunkrenderdispatcher$renderchunk.m_112839_().m_7918_(8, 8, 8); @@ -203,7 +203,7 @@ } else if (this.f_109461_.f_91066_.m_232080_().m_231551_() == PrioritizeChunkUpdates.PLAYER_AFFECTED) { flag = chunkrenderdispatcher$renderchunk.m_112842_(); } -@@ -2400,7 +_,12 @@ +@@ -2354,7 +_,12 @@ this.f_109469_.m_110859_(p_109502_, p_109503_, p_109504_, p_109505_); } @@ -216,7 +216,7 @@ SoundInstance soundinstance = this.f_109410_.get(p_109516_); if (soundinstance != null) { this.f_109461_.m_91106_().m_120399_(soundinstance); -@@ -2408,7 +_,7 @@ +@@ -2362,7 +_,7 @@ } if (p_109515_ != null) { @@ -225,16 +225,7 @@ if (recorditem != null) { this.f_109461_.f_91065_.m_93055_(recorditem.m_43050_()); } -@@ -2548,7 +_,7 @@ - break; - case 1010: - if (Item.m_41445_(p_234307_) instanceof RecordItem) { -- this.m_109514_(((RecordItem)Item.m_41445_(p_234307_)).m_43051_(), p_234306_); -+ this.playStreamingMusic(((RecordItem)Item.m_41445_(p_234307_)).m_43051_(), p_234306_, (RecordItem) Item.m_41445_(p_234307_)); - } else { - this.m_109514_((SoundEvent)null, p_234306_); - } -@@ -2700,7 +_,7 @@ +@@ -2656,7 +_,7 @@ case 2001: BlockState blockstate = Block.m_49803_(p_234307_); if (!blockstate.m_60795_()) { @@ -243,7 +234,16 @@ this.f_109465_.m_245747_(p_234306_, soundtype.m_56775_(), SoundSource.BLOCKS, (soundtype.m_56773_() + 1.0F) / 2.0F, soundtype.m_56774_() * 0.8F, false); } -@@ -2915,7 +_,7 @@ +@@ -2751,7 +_,7 @@ + break; + case 3002: + if (p_234307_ >= 0 && p_234307_ < Direction.Axis.f_122448_.length) { +- ParticleUtils.m_144967_(Direction.Axis.f_122448_[p_234307_], this.f_109465_, p_234306_, 0.125D, ParticleTypes.f_175830_, UniformInt.m_146622_(10, 19)); ++ this.playStreamingMusic(((RecordItem)Item.m_41445_(p_234307_)).m_43051_(), p_234306_, (RecordItem) Item.m_41445_(p_234307_)); + } else { + ParticleUtils.m_216313_(this.f_109465_, p_234306_, ParticleTypes.f_175830_, UniformInt.m_146622_(3, 5)); + } +@@ -2875,7 +_,7 @@ } else { int i = p_109538_.m_45517_(LightLayer.SKY, p_109540_); int j = p_109538_.m_45517_(LightLayer.BLOCK, p_109540_); diff --git a/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch b/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch index 7ff7a7dfa1..dae4524bc8 100644 --- a/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/LightTexture.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/LightTexture.java +++ b/net/minecraft/client/renderer/LightTexture.java -@@ -136,6 +_,8 @@ +@@ -135,6 +_,8 @@ } } @@ -9,7 +9,7 @@ if (f5 > 0.0F) { float f13 = Math.max(vector3f1.x(), Math.max(vector3f1.y(), vector3f1.z())); if (f13 < 1.0F) { -@@ -193,7 +_,7 @@ +@@ -192,7 +_,7 @@ } public static int m_109883_(int p_109884_) { diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch index 82cb85d540..291271e09f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch @@ -1,26 +1,21 @@ --- a/net/minecraft/client/renderer/RenderType.java +++ b/net/minecraft/client/renderer/RenderType.java -@@ -301,27 +_,27 @@ - } - - public static RenderType m_110497_(ResourceLocation p_110498_) { -- return f_173173_.apply(p_110498_); -+ return net.minecraftforge.client.ForgeRenderTypes.getText(p_110498_); +@@ -316,19 +_,19 @@ } public static RenderType m_173237_(ResourceLocation p_173238_) { - return f_173174_.apply(p_173238_); -+ return net.minecraftforge.client.ForgeRenderTypes.getTextIntensity(p_173238_); ++ return net.minecraftforge.client.ForgeRenderTypes.getText(p_173238_); } public static RenderType m_181444_(ResourceLocation p_181445_) { - return f_181442_.apply(p_181445_); -+ return net.minecraftforge.client.ForgeRenderTypes.getTextPolygonOffset(p_181445_); ++ return net.minecraftforge.client.ForgeRenderTypes.getTextIntensity(p_181445_); } public static RenderType m_181446_(ResourceLocation p_181447_) { - return f_181443_.apply(p_181447_); -+ return net.minecraftforge.client.ForgeRenderTypes.getTextIntensityPolygonOffset(p_181447_); ++ return net.minecraftforge.client.ForgeRenderTypes.getTextPolygonOffset(p_181447_); } public static RenderType m_110500_(ResourceLocation p_110501_) { @@ -28,13 +23,17 @@ + return net.minecraftforge.client.ForgeRenderTypes.getTextSeeThrough(p_110501_); } + public static RenderType m_269508_() { +@@ -336,7 +_,7 @@ + } + public static RenderType m_173240_(ResourceLocation p_173241_) { - return f_173176_.apply(p_173241_); + return net.minecraftforge.client.ForgeRenderTypes.getTextIntensitySeeThrough(p_173241_); } public static RenderType m_110502_() { -@@ -608,4 +_,17 @@ +@@ -635,4 +_,17 @@ return this.f_110696_; } } diff --git a/patches/minecraft/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch index 8cb221d2ff..c57696c14a 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch @@ -47,7 +47,7 @@ } } -@@ -90,9 +_,13 @@ +@@ -90,8 +_,12 @@ } private static void m_110725_(Minecraft p_110726_, PoseStack p_110727_) { @@ -56,9 +56,8 @@ + + public static void renderFluid(Minecraft p_110726_, PoseStack p_110727_, ResourceLocation texture) { RenderSystem.m_157427_(GameRenderer::m_172817_); - RenderSystem.m_69493_(); - RenderSystem.m_157456_(0, f_110714_); + RenderSystem.m_157456_(0, texture); BufferBuilder bufferbuilder = Tesselator.m_85913_().m_85915_(); - BlockPos blockpos = new BlockPos(p_110726_.f_91074_.m_20185_(), p_110726_.f_91074_.m_20188_(), p_110726_.f_91074_.m_20189_()); + BlockPos blockpos = BlockPos.m_274561_(p_110726_.f_91074_.m_20185_(), p_110726_.f_91074_.m_20188_(), p_110726_.f_91074_.m_20189_()); float f = LightTexture.m_234316_(p_110726_.f_91074_.f_19853_.m_6042_(), p_110726_.f_91074_.f_19853_.m_46803_(blockpos)); diff --git a/patches/minecraft/net/minecraft/client/renderer/ShaderInstance.java.patch b/patches/minecraft/net/minecraft/client/renderer/ShaderInstance.java.patch index 4be487649c..e364c6f162 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ShaderInstance.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ShaderInstance.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/ShaderInstance.java +++ b/net/minecraft/client/renderer/ShaderInstance.java -@@ -96,10 +_,14 @@ +@@ -98,10 +_,14 @@ @Nullable public final Uniform f_173320_; @@ -17,7 +17,7 @@ try (Reader reader = p_173336_.m_215597_(resourcelocation)) { JsonObject jsonobject = GsonHelper.m_13859_(reader); -@@ -205,8 +_,10 @@ +@@ -208,8 +_,10 @@ Program program1 = p_173342_.m_85570_().get(p_173343_); Program program; if (program1 == null) { @@ -30,7 +30,7 @@ try (InputStream inputstream = resource.m_215507_()) { final String s1 = FileUtil.m_179922_(s); -@@ -214,11 +_,11 @@ +@@ -217,16 +_,17 @@ private final Set f_173369_ = Sets.newHashSet(); public String m_142138_(boolean p_173374_, String p_173375_) { @@ -43,11 +43,8 @@ } else { - ResourceLocation resourcelocation = new ResourceLocation(p_173375_); - try { - String s2; -@@ -228,7 +_,8 @@ - - return s2; + try (Reader reader = p_173341_.m_215597_(resourcelocation)) { + return IOUtils.toString(reader); } catch (IOException ioexception) { - ShaderInstance.f_173323_.error("Could not open GLSL import {}: {}", p_173375_, ioexception.getMessage()); + // FORGE: specify the namespace of the failed import in case of duplicates from multiple mods diff --git a/patches/minecraft/net/minecraft/client/renderer/Sheets.java.patch b/patches/minecraft/net/minecraft/client/renderer/Sheets.java.patch index 787be9d473..a72a4f0950 100644 --- a/patches/minecraft/net/minecraft/client/renderer/Sheets.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/Sheets.java.patch @@ -1,22 +1,22 @@ --- a/net/minecraft/client/renderer/Sheets.java +++ b/net/minecraft/client/renderer/Sheets.java -@@ -135,11 +_,13 @@ +@@ -145,11 +_,13 @@ } private static Material m_173385_(WoodType p_173386_) { -- return new Material(f_110739_, new ResourceLocation("entity/signs/" + p_173386_.m_61846_())); -+ ResourceLocation location = new ResourceLocation(p_173386_.m_61846_()); +- return new Material(f_110739_, new ResourceLocation("entity/signs/" + p_173386_.f_61839_())); ++ ResourceLocation location = new ResourceLocation(p_173386_.f_61839_()); + return new Material(f_110739_, new ResourceLocation(location.m_135827_(), "entity/signs/" + location.m_135815_())); } private static Material m_245275_(WoodType p_251735_) { -- return new Material(f_110739_, new ResourceLocation("entity/signs/hanging/" + p_251735_.m_61846_())); -+ ResourceLocation location = new ResourceLocation(p_251735_.m_61846_()); +- return new Material(f_110739_, new ResourceLocation("entity/signs/hanging/" + p_251735_.f_61839_())); ++ ResourceLocation location = new ResourceLocation(p_251735_.f_61839_()); + return new Material(f_110739_, new ResourceLocation(location.m_135827_(), "entity/signs/hanging/" + location.m_135815_())); } public static Material m_173381_(WoodType p_173382_) { -@@ -190,5 +_,13 @@ +@@ -209,5 +_,13 @@ default: return p_110773_; } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch index 6441a7f245..7a4c7658b2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch @@ -63,9 +63,9 @@ + this.f_110900_.renderModel(p_110914_.m_85850_(), p_110915_.m_6299_(renderType != null ? renderType : net.minecraftforge.client.RenderTypeHelper.getEntityRenderType(rt, false)), p_110913_, bakedmodel, f, f1, f2, p_110916_, p_110917_, modelData, rt); break; case ENTITYBLOCK_ANIMATED: -- this.f_173397_.m_108829_(new ItemStack(p_110913_.m_60734_()), ItemTransforms.TransformType.NONE, p_110914_, p_110915_, p_110916_, p_110917_); +- this.f_173397_.m_108829_(new ItemStack(p_110913_.m_60734_()), ItemDisplayContext.NONE, p_110914_, p_110915_, p_110916_, p_110917_); + ItemStack stack = new ItemStack(p_110913_.m_60734_()); -+ net.minecraftforge.client.extensions.common.IClientItemExtensions.of(stack).getCustomRenderer().m_108829_(stack, ItemTransforms.TransformType.NONE, p_110914_, p_110915_, p_110916_, p_110917_); ++ net.minecraftforge.client.extensions.common.IClientItemExtensions.of(stack).getCustomRenderer().m_108829_(stack, ItemDisplayContext.NONE, p_110914_, p_110915_, p_110916_, p_110917_); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/BlockModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/BlockModel.java.patch index fc0b0fdd0c..b3223973da 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BlockModel.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/BlockModel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/block/model/BlockModel.java +++ b/net/minecraft/client/renderer/block/model/BlockModel.java -@@ -65,9 +_,10 @@ +@@ -68,9 +_,10 @@ public BlockModel f_111418_; @Nullable protected ResourceLocation f_111419_; @@ -12,8 +12,8 @@ } public static BlockModel m_111463_(String p_111464_) { -@@ -84,10 +_,15 @@ - this.f_111426_ = p_111435_; +@@ -87,10 +_,15 @@ + this.f_111426_ = p_273099_; } + @Deprecated @@ -26,9 +26,9 @@ + public ResourceLocation getParentLocation() { return f_111419_; } + public boolean m_111476_() { - return this.f_111418_ != null ? this.f_111418_.m_111476_() : this.f_111424_; - } -@@ -112,6 +_,10 @@ + if (this.f_111424_ != null) { + return this.f_111424_; +@@ -119,6 +_,10 @@ return this.f_111426_.isEmpty() ? ItemOverrides.f_111734_ : new ItemOverrides(p_250138_, p_251800_, this.f_111426_); } @@ -39,7 +39,7 @@ public Collection m_7970_() { Set set = Sets.newHashSet(); -@@ -127,6 +_,10 @@ +@@ -134,6 +_,10 @@ } public void m_5500_(Function p_249059_) { @@ -50,7 +50,7 @@ Set set = Sets.newLinkedHashSet(); for(BlockModel blockmodel = this; blockmodel.f_111419_ != null && blockmodel.f_111418_ == null; blockmodel = blockmodel.f_111418_) { -@@ -161,11 +_,24 @@ +@@ -168,11 +_,24 @@ }); } @@ -75,16 +75,16 @@ TextureAtlasSprite textureatlassprite = p_111452_.apply(this.m_111480_("particle")); if (this.m_111490_() == ModelBakery.f_119233_) { return new BuiltInModel(this.m_111491_(), this.m_246736_(p_249720_, p_111451_), textureatlassprite, this.m_111479_().m_111526_()); -@@ -248,7 +_,18 @@ - ItemTransform itemtransform5 = this.m_111444_(ItemTransforms.TransformType.GUI); - ItemTransform itemtransform6 = this.m_111444_(ItemTransforms.TransformType.GROUND); - ItemTransform itemtransform7 = this.m_111444_(ItemTransforms.TransformType.FIXED); +@@ -255,7 +_,18 @@ + ItemTransform itemtransform5 = this.m_269178_(ItemDisplayContext.GUI); + ItemTransform itemtransform6 = this.m_269178_(ItemDisplayContext.GROUND); + ItemTransform itemtransform7 = this.m_269178_(ItemDisplayContext.FIXED); - return new ItemTransforms(itemtransform, itemtransform1, itemtransform2, itemtransform3, itemtransform4, itemtransform5, itemtransform6, itemtransform7); + -+ var builder = com.google.common.collect.ImmutableMap.builder(); -+ for(ItemTransforms.TransformType type : ItemTransforms.TransformType.values()) { ++ var builder = com.google.common.collect.ImmutableMap.builder(); ++ for(ItemDisplayContext type : ItemDisplayContext.values()) { + if (type.isModded()) { -+ var transform = this.m_111444_(type); ++ var transform = this.m_269178_(type); + if (transform != ItemTransform.f_111754_) { + builder.put(type, transform); + } @@ -94,8 +94,8 @@ + return new ItemTransforms(itemtransform, itemtransform1, itemtransform2, itemtransform3, itemtransform4, itemtransform5, itemtransform6, itemtransform7, builder.build()); } - private ItemTransform m_111444_(ItemTransforms.TransformType p_111445_) { -@@ -367,6 +_,8 @@ + private ItemTransform m_269178_(ItemDisplayContext p_270662_) { +@@ -373,6 +_,8 @@ public boolean m_111526_() { return this == SIDE; } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrides.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrides.java.patch index cc710ac3f7..e75dc89330 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrides.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemOverrides.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/block/model/ItemOverrides.java +++ b/net/minecraft/client/renderer/block/model/ItemOverrides.java -@@ -31,7 +_,15 @@ +@@ -32,7 +_,15 @@ this.f_173461_ = new ResourceLocation[0]; } @@ -16,7 +16,7 @@ this.f_173461_ = p_111743_.stream().flatMap(ItemOverride::m_173449_).map(ItemOverride.Predicate::m_173459_).distinct().toArray((p_173479_) -> { return new ResourceLocation[p_173479_]; }); -@@ -45,7 +_,7 @@ +@@ -46,7 +_,7 @@ for(int j = p_111743_.size() - 1; j >= 0; --j) { ItemOverride itemoverride = p_111743_.get(j); @@ -25,7 +25,7 @@ ItemOverrides.PropertyMatcher[] aitemoverrides$propertymatcher = itemoverride.m_173449_().map((p_173477_) -> { int k = object2intmap.getInt(p_173477_.m_173459_()); return new ItemOverrides.PropertyMatcher(k, p_173477_.m_173460_()); -@@ -59,9 +_,9 @@ +@@ -60,9 +_,9 @@ } @Nullable @@ -37,7 +37,7 @@ } @Nullable -@@ -94,6 +_,10 @@ +@@ -95,6 +_,10 @@ } return p_173465_; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransforms.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransforms.java.patch index ea27ebe179..92fa476d71 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransforms.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransforms.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/client/renderer/block/model/ItemTransforms.java +++ b/net/minecraft/client/renderer/block/model/ItemTransforms.java -@@ -20,11 +_,13 @@ +@@ -21,11 +_,13 @@ public final ItemTransform f_111792_; public final ItemTransform f_111793_; public final ItemTransform f_111794_; -+ public final com.google.common.collect.ImmutableMap moddedTransforms; ++ public final com.google.common.collect.ImmutableMap moddedTransforms; private ItemTransforms() { this(ItemTransform.f_111754_, ItemTransform.f_111754_, ItemTransform.f_111754_, ItemTransform.f_111754_, ItemTransform.f_111754_, ItemTransform.f_111754_, ItemTransform.f_111754_, ItemTransform.f_111754_); @@ -14,7 +14,7 @@ public ItemTransforms(ItemTransforms p_111807_) { this.f_111787_ = p_111807_.f_111787_; this.f_111788_ = p_111807_.f_111788_; -@@ -34,9 +_,16 @@ +@@ -35,9 +_,16 @@ this.f_111792_ = p_111807_.f_111792_; this.f_111793_ = p_111807_.f_111793_; this.f_111794_ = p_111807_.f_111794_; @@ -27,41 +27,41 @@ + } + + public ItemTransforms(ItemTransform p_111798_, ItemTransform p_111799_, ItemTransform p_111800_, ItemTransform p_111801_, ItemTransform p_111802_, ItemTransform p_111803_, ItemTransform p_111804_, ItemTransform p_111805_, -+ com.google.common.collect.ImmutableMap moddedTransforms) { ++ com.google.common.collect.ImmutableMap moddedTransforms) { this.f_111787_ = p_111798_; this.f_111788_ = p_111799_; this.f_111789_ = p_111800_; -@@ -45,6 +_,7 @@ +@@ -46,6 +_,7 @@ this.f_111792_ = p_111803_; this.f_111793_ = p_111804_; this.f_111794_ = p_111805_; + this.moddedTransforms = moddedTransforms; } - public ItemTransform m_111808_(ItemTransforms.TransformType p_111809_) { -@@ -66,7 +_,7 @@ - case FIXED: - return this.f_111794_; + public ItemTransform m_269404_(ItemDisplayContext p_270619_) { +@@ -76,7 +_,7 @@ + itemtransform = this.f_111794_; + break; default: -- return ItemTransform.f_111754_; -+ return moddedTransforms.getOrDefault(p_111809_, ItemTransform.f_111754_); +- itemtransform = ItemTransform.f_111754_; ++ return moddedTransforms.getOrDefault(p_270619_, ItemTransform.f_111754_); } - } -@@ -94,7 +_,23 @@ - ItemTransform itemtransform5 = this.m_111815_(p_111822_, jsonobject, "gui"); - ItemTransform itemtransform6 = this.m_111815_(p_111822_, jsonobject, "ground"); - ItemTransform itemtransform7 = this.m_111815_(p_111822_, jsonobject, "fixed"); + return itemtransform; +@@ -106,7 +_,23 @@ + ItemTransform itemtransform5 = this.m_269518_(p_111822_, jsonobject, ItemDisplayContext.GUI); + ItemTransform itemtransform6 = this.m_269518_(p_111822_, jsonobject, ItemDisplayContext.GROUND); + ItemTransform itemtransform7 = this.m_269518_(p_111822_, jsonobject, ItemDisplayContext.FIXED); - return new ItemTransforms(itemtransform1, itemtransform, itemtransform3, itemtransform2, itemtransform4, itemtransform5, itemtransform6, itemtransform7); + -+ var builder = com.google.common.collect.ImmutableMap.builder(); -+ for (TransformType type : TransformType.values()) { ++ var builder = com.google.common.collect.ImmutableMap.builder(); ++ for (ItemDisplayContext type : ItemDisplayContext.values()) { + if (type.isModded()) { -+ var transform = this.m_111815_(p_111822_, jsonobject, type.getSerializeName()); ++ var transform = this.m_269518_(p_111822_, jsonobject, type); + var fallbackType = type; -+ while (transform == ItemTransform.f_111754_ && fallbackType.fallback != null) { -+ fallbackType = fallbackType.fallback; -+ transform = this.m_111815_(p_111822_, jsonobject, fallbackType.getSerializeName()); ++ while (transform == ItemTransform.f_111754_ && fallbackType.fallback() != null) { ++ fallbackType = fallbackType.fallback(); ++ transform = this.m_269518_(p_111822_, jsonobject, fallbackType); + } + if (transform != ItemTransform.f_111754_){ + builder.put(type, transform); @@ -72,78 +72,4 @@ + return new ItemTransforms(itemtransform1, itemtransform, itemtransform3, itemtransform2, itemtransform4, itemtransform5, itemtransform6, itemtransform7, builder.build()); } - private ItemTransform m_111815_(JsonDeserializationContext p_111816_, JsonObject p_111817_, String p_111818_) { -@@ -103,19 +_,63 @@ - } - - @OnlyIn(Dist.CLIENT) -- public static enum TransformType { -- NONE, -- THIRD_PERSON_LEFT_HAND, -- THIRD_PERSON_RIGHT_HAND, -- FIRST_PERSON_LEFT_HAND, -- FIRST_PERSON_RIGHT_HAND, -- HEAD, -- GUI, -- GROUND, -- FIXED; -+ public static enum TransformType implements net.minecraftforge.common.IExtensibleEnum { -+ NONE("none"), -+ THIRD_PERSON_LEFT_HAND("thirdperson_lefthand"), -+ THIRD_PERSON_RIGHT_HAND("thirdperson_righthand"), -+ FIRST_PERSON_LEFT_HAND("firstperson_lefthand"), -+ FIRST_PERSON_RIGHT_HAND("firstperson_righthand"), -+ HEAD("head"), -+ GUI("gui"), -+ GROUND("ground"), -+ FIXED("fixed"); - - public boolean m_111841_() { - return this == FIRST_PERSON_LEFT_HAND || this == FIRST_PERSON_RIGHT_HAND; -+ } -+ -+ // Forge start -+ private final String serializeName; -+ private final boolean isModded; -+ @javax.annotation.Nullable -+ private final TransformType fallback; -+ -+ private TransformType(String name) { -+ serializeName = name; -+ isModded = false; -+ fallback = null; -+ } -+ -+ private TransformType(net.minecraft.resources.ResourceLocation serializeName) { -+ this.serializeName = java.util.Objects.requireNonNull(serializeName, "Modded TransformTypes must have a non-null serializeName").toString(); -+ isModded = true; -+ fallback = null; -+ } -+ -+ private TransformType(net.minecraft.resources.ResourceLocation serializeName, TransformType fallback) { -+ this.serializeName = java.util.Objects.requireNonNull(serializeName, "Modded TransformTypes must have a non-null serializeName").toString(); -+ isModded = true; -+ this.fallback = fallback; -+ } -+ -+ public boolean isModded() { -+ return isModded; -+ } -+ -+ @javax.annotation.Nullable -+ public TransformType fallback() { -+ return fallback; -+ } -+ -+ public String getSerializeName() { -+ return serializeName; -+ } -+ -+ public static TransformType create(String keyName, net.minecraft.resources.ResourceLocation serializeName) { -+ throw new IllegalStateException("Enum not extended!"); -+ } -+ public static TransformType create(String keyName, net.minecraft.resources.ResourceLocation serializeName, TransformType fallback) { -+ throw new IllegalStateException("Enum not extended!"); - } - } - } + private ItemTransform m_269518_(JsonDeserializationContext p_270385_, JsonObject p_270436_, ItemDisplayContext p_270100_) { diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/BoatRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/BoatRenderer.java.patch index 2c4300d088..ffbf39d31d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/BoatRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/BoatRenderer.java.patch @@ -4,7 +4,7 @@ p_113932_.m_252781_((new Quaternionf()).setAngleAxis(p_113929_.m_38352_(p_113931_) * ((float)Math.PI / 180F), 1.0F, 0.0F, 1.0F)); } -- Pair> pair = this.f_173934_.get(p_113929_.m_262365_()); +- Pair> pair = this.f_173934_.get(p_113929_.m_28554_()); + Pair> pair = getModelWithLocation(p_113929_); ResourceLocation resourcelocation = pair.getFirst(); ListModel listmodel = pair.getSecond(); @@ -15,9 +15,9 @@ + @Deprecated // forge: override getModelWithLocation to change the texture / model public ResourceLocation m_5478_(Boat p_113927_) { -- return this.f_173934_.get(p_113927_.m_262365_()).getFirst(); +- return this.f_173934_.get(p_113927_.m_28554_()).getFirst(); + return getModelWithLocation(p_113927_).getFirst(); } + -+ public Pair> getModelWithLocation(Boat boat) { return this.f_173934_.get(boat.m_262365_()); } ++ public Pair> getModelWithLocation(Boat boat) { return this.f_173934_.get(boat.m_28554_()); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch index 6602e74b44..ce0373618a 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/client/renderer/entity/FallingBlockRenderer.java @@ -34,7 +_,9 @@ p_114637_.m_85836_(); - BlockPos blockpos = new BlockPos(p_114634_.m_20185_(), p_114634_.m_20191_().f_82292_, p_114634_.m_20189_()); + BlockPos blockpos = BlockPos.m_274561_(p_114634_.m_20185_(), p_114634_.m_20191_().f_82292_, p_114634_.m_20189_()); p_114637_.m_85837_(-0.5D, 0.0D, -0.5D); - this.f_234617_.m_110937_().m_234379_(level, this.f_234617_.m_110910_(blockstate), blockstate, blockpos, p_114637_, p_114638_.m_6299_(ItemBlockRenderTypes.m_109293_(blockstate)), false, RandomSource.m_216327_(), blockstate.m_60726_(p_114634_.m_31978_()), OverlayTexture.f_118083_); + var model = this.f_234617_.m_110910_(blockstate); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch index 4e5afb3e5e..349d7cc100 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch @@ -6,7 +6,7 @@ float f = 0.25F; - float f1 = Mth.m_14031_(((float)p_115036_.m_32059_() + p_115038_) / 10.0F + p_115036_.f_31983_) * 0.1F + 0.1F; + float f1 = shouldBob() ? Mth.m_14031_(((float)p_115036_.m_32059_() + p_115038_) / 10.0F + p_115036_.f_31983_) * 0.1F + 0.1F : 0; - float f2 = bakedmodel.m_7442_().m_111808_(ItemTransforms.TransformType.GROUND).f_111757_.y(); + float f2 = bakedmodel.m_7442_().m_269404_(ItemDisplayContext.GROUND).f_111757_.y(); p_115039_.m_252880_(0.0F, f1 + 0.25F * f2, 0.0F); float f3 = p_115036_.m_32008_(p_115038_); p_115039_.m_252781_(Axis.f_252436_.m_252961_(f3)); @@ -37,7 +37,7 @@ } } - this.f_115019_.m_115143_(itemstack, ItemTransforms.TransformType.GROUND, false, p_115039_, p_115040_, p_115041_, OverlayTexture.f_118083_, bakedmodel); + this.f_115019_.m_115143_(itemstack, ItemDisplayContext.GROUND, false, p_115039_, p_115040_, p_115041_, OverlayTexture.f_118083_, bakedmodel); p_115039_.m_85849_(); if (!flag) { - p_115039_.m_252880_(0.0F * f4, 0.0F * f5, 0.09375F * f6); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch index 2bb631475b..69470aa905 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch @@ -32,7 +32,7 @@ } else { int k = this.m_174208_(p_115076_, 15728880, p_115081_); p_115079_.m_85841_(0.5F, 0.5F, 0.5F); - this.f_115047_.m_174269_(itemstack, ItemTransforms.TransformType.FIXED, k, OverlayTexture.f_118083_, p_115079_, p_115080_, p_115076_.m_19879_()); + this.f_115047_.m_269128_(itemstack, ItemDisplayContext.FIXED, k, OverlayTexture.f_118083_, p_115079_, p_115080_, p_115076_.f_19853_, p_115076_.m_19879_()); } + } } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/ItemRenderer.java.patch index cd44be1c4f..27d28d7e63 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/ItemRenderer.java.patch @@ -1,24 +1,24 @@ --- a/net/minecraft/client/renderer/entity/ItemRenderer.java +++ b/net/minecraft/client/renderer/entity/ItemRenderer.java -@@ -83,7 +_,7 @@ - - public ItemRenderer(TextureManager p_174225_, ModelManager p_174226_, ItemColors p_174227_, BlockEntityWithoutLevelRenderer p_174228_) { - this.f_115096_ = p_174225_; -- this.f_115095_ = new ItemModelShaper(p_174226_); -+ this.f_115095_ = new net.minecraftforge.client.model.ForgeItemModelShaper(p_174226_); - this.f_174223_ = p_174228_; +@@ -80,7 +_,7 @@ + public ItemRenderer(Minecraft p_266926_, TextureManager p_266774_, ModelManager p_266850_, ItemColors p_267016_, BlockEntityWithoutLevelRenderer p_267049_) { + this.f_265848_ = p_266926_; + this.f_115096_ = p_266774_; +- this.f_115095_ = new ItemModelShaper(p_266850_); ++ this.f_115095_ = new net.minecraftforge.client.model.ForgeItemModelShaper(p_266850_); + this.f_174223_ = p_267049_; for(Item item : BuiltInRegistries.f_257033_) { -@@ -124,7 +_,7 @@ +@@ -121,7 +_,7 @@ } } -- p_115151_.m_7442_().m_111808_(p_115145_).m_111763_(p_115146_, p_115147_); -+ p_115151_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_115147_, p_115151_, p_115145_, p_115146_); +- p_115151_.m_7442_().m_269404_(p_270188_).m_111763_(p_115146_, p_115147_); ++ p_115151_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_115147_, p_115151_, p_270188_, p_115146_); p_115147_.m_252880_(-0.5F, -0.5F, -0.5F); if (!p_115151_.m_7521_() && (!p_115144_.m_150930_(Items.f_42713_) || flag)) { boolean flag1; -@@ -134,8 +_,8 @@ +@@ -131,8 +_,8 @@ } else { flag1 = true; } @@ -29,7 +29,7 @@ VertexConsumer vertexconsumer; if (p_115144_.m_204117_(ItemTags.f_215866_) && p_115144_.m_41790_()) { p_115147_.m_85836_(); -@@ -159,9 +_,11 @@ +@@ -156,9 +_,11 @@ vertexconsumer = m_115211_(p_115148_, rendertype, true, p_115144_.m_41790_()); } @@ -38,12 +38,12 @@ + } + } } else { -- this.f_174223_.m_108829_(p_115144_, p_115145_, p_115147_, p_115148_, p_115149_, p_115150_); -+ net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_115144_).getCustomRenderer().m_108829_(p_115144_, p_115145_, p_115147_, p_115148_, p_115149_, p_115150_); +- this.f_174223_.m_108829_(p_115144_, p_270188_, p_115147_, p_115148_, p_115149_, p_115150_); ++ net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_115144_).getCustomRenderer().m_108829_(p_115144_, p_270188_, p_115147_, p_115148_, p_115149_, p_115150_); } p_115147_.m_85849_(); -@@ -205,7 +_,7 @@ +@@ -202,7 +_,7 @@ float f = (float)(i >> 16 & 255) / 255.0F; float f1 = (float)(i >> 8 & 255) / 255.0F; float f2 = (float)(i & 255) / 255.0F; @@ -52,24 +52,22 @@ } } -@@ -308,6 +_,7 @@ +@@ -303,6 +_,7 @@ crashreportcategory.m_128165_("Item Type", () -> { - return String.valueOf((Object)p_174237_.m_41720_()); + return String.valueOf((Object)p_275431_.m_41720_()); }); -+ crashreportcategory.m_128165_("Registry Name", () -> String.valueOf(net.minecraftforge.registries.ForgeRegistries.ITEMS.getKey(p_174237_.m_41720_()))); ++ crashreportcategory.m_128165_("Registry Name", () -> String.valueOf(net.minecraftforge.registries.ForgeRegistries.ITEMS.getKey(p_275431_.m_41720_()))); crashreportcategory.m_128165_("Item Damage", () -> { - return String.valueOf(p_174237_.m_41773_()); + return String.valueOf(p_275431_.m_41773_()); }); -@@ -368,6 +_,7 @@ - RenderSystem.m_69482_(); +@@ -356,10 +_,15 @@ } -+ net.minecraftforge.client.ItemDecoratorHandler.of(p_115176_).render(p_115175_, p_115176_, p_115177_, p_115178_, f_115093_); + p_275269_.m_85849_(); ++ net.minecraftforge.client.ItemDecoratorHandler.of(p_275590_).render(p_275652_, p_275590_, p_275202_, p_275508_, 0); } } -@@ -383,5 +_,9 @@ - public void m_6213_(ResourceManager p_115105_) { this.f_115095_.m_109403_(); + } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch index bb5f913fc5..8729499de1 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch @@ -26,8 +26,8 @@ float f5 = 0.0F; - if (!p_115308_.m_20159_() && p_115308_.m_6084_()) { + if (!shouldSit && p_115308_.m_6084_()) { - f8 = Mth.m_14179_(p_115310_, p_115308_.f_20923_, p_115308_.f_20924_); - f5 = p_115308_.f_20925_ - p_115308_.f_20924_ * (1.0F - p_115310_); + f8 = p_115308_.f_267362_.m_267711_(p_115310_); + f5 = p_115308_.f_267362_.m_267590_(p_115310_); if (p_115308_.m_6162_()) { @@ -131,6 +_,7 @@ diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch index ab57676888..fdb388ceee 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch @@ -1,12 +1,12 @@ --- a/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java +++ b/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java -@@ -46,17 +_,18 @@ +@@ -56,17 +_,18 @@ if (armoritem.m_40402_() == p_117122_) { this.m_117386_().m_102872_(p_117124_); this.m_117125_(p_117124_, p_117122_); + net.minecraft.client.model.Model model = getArmorModelHook(p_117121_, itemstack, p_117122_, p_117124_); - boolean flag = this.m_117128_(p_117122_); - boolean flag1 = itemstack.m_41790_(); + boolean flag1 = this.m_117128_(p_117122_); + boolean flag = itemstack.m_41790_(); - if (armoritem instanceof DyeableArmorItem) { - int i = ((DyeableArmorItem)armoritem).m_41121_(itemstack); + if (armoritem instanceof net.minecraft.world.item.DyeableLeatherItem) { @@ -14,17 +14,17 @@ float f = (float)(i >> 16 & 255) / 255.0F; float f1 = (float)(i >> 8 & 255) / 255.0F; float f2 = (float)(i & 255) / 255.0F; -- this.m_117106_(p_117119_, p_117120_, p_117123_, armoritem, flag1, p_117124_, flag, f, f1, f2, (String)null); -- this.m_117106_(p_117119_, p_117120_, p_117123_, armoritem, flag1, p_117124_, flag, 1.0F, 1.0F, 1.0F, "overlay"); +- this.m_117106_(p_117119_, p_117120_, p_117123_, armoritem, flag, p_117124_, flag1, f, f1, f2, (String)null); +- this.m_117106_(p_117119_, p_117120_, p_117123_, armoritem, flag, p_117124_, flag1, 1.0F, 1.0F, 1.0F, "overlay"); + this.renderModel(p_117119_, p_117120_, p_117123_, flag1, model, f, f1, f2, this.getArmorResource(p_117121_, itemstack, p_117122_, null)); + this.renderModel(p_117119_, p_117120_, p_117123_, flag1, model, 1.0F, 1.0F, 1.0F, this.getArmorResource(p_117121_, itemstack, p_117122_, "overlay")); } else { -- this.m_117106_(p_117119_, p_117120_, p_117123_, armoritem, flag1, p_117124_, flag, 1.0F, 1.0F, 1.0F, (String)null); +- this.m_117106_(p_117119_, p_117120_, p_117123_, armoritem, flag, p_117124_, flag1, 1.0F, 1.0F, 1.0F, (String)null); + this.renderModel(p_117119_, p_117120_, p_117123_, flag1, model, 1.0F, 1.0F, 1.0F, this.getArmorResource(p_117121_, itemstack, p_117122_, null)); } - } -@@ -88,7 +_,10 @@ + if (p_117121_.f_19853_.m_246046_().m_245372_(FeatureFlags.f_244168_)) { +@@ -104,7 +_,10 @@ } private void m_117106_(PoseStack p_117107_, MultiBufferSource p_117108_, int p_117109_, ArmorItem p_117110_, boolean p_117111_, A p_117112_, boolean p_117113_, float p_117114_, float p_117115_, float p_117116_, @Nullable String p_117117_) { @@ -36,7 +36,7 @@ p_117112_.m_7695_(p_117107_, vertexconsumer, p_117109_, OverlayTexture.f_118083_, p_117114_, p_117115_, p_117116_, 1.0F); } -@@ -100,8 +_,50 @@ +@@ -122,8 +_,50 @@ return p_117129_ == EquipmentSlot.LEGS; } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch index 24fe6fe938..2fae918bf2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/entity/player/PlayerRenderer.java +++ b/net/minecraft/client/renderer/entity/player/PlayerRenderer.java -@@ -57,7 +_,9 @@ +@@ -59,7 +_,9 @@ public void m_7392_(AbstractClientPlayer p_117788_, float p_117789_, float p_117790_, PoseStack p_117791_, MultiBufferSource p_117792_, int p_117793_) { this.m_117818_(p_117788_); @@ -10,9 +10,9 @@ } public Vec3 m_7860_(AbstractClientPlayer p_117785_, float p_117786_) { -@@ -126,10 +_,13 @@ - if (useanim == UseAnim.TOOT_HORN) { - return HumanoidModel.ArmPose.TOOT_HORN; +@@ -132,10 +_,13 @@ + if (useanim == UseAnim.BRUSH) { + return HumanoidModel.ArmPose.BRUSH; } - } else if (!p_117795_.f_20911_ && itemstack.m_150930_(Items.f_42717_) && CrossbowItem.m_40932_(itemstack)) { + } else if (!p_117795_.f_20911_ && itemstack.m_41720_() instanceof CrossbowItem && CrossbowItem.m_40932_(itemstack)) { @@ -25,7 +25,7 @@ return HumanoidModel.ArmPose.ITEM; } } -@@ -161,10 +_,12 @@ +@@ -167,10 +_,12 @@ } public void m_117770_(PoseStack p_117771_, MultiBufferSource p_117772_, int p_117773_, AbstractClientPlayer p_117774_) { @@ -38,7 +38,7 @@ this.m_117775_(p_117814_, p_117815_, p_117816_, p_117817_, (this.f_115290_).f_102812_, (this.f_115290_).f_103374_); } -@@ -202,7 +_,7 @@ +@@ -208,7 +_,7 @@ } } else if (f > 0.0F) { super.m_7523_(p_117802_, p_117803_, p_117804_, p_117805_, p_117806_); diff --git a/patches/minecraft/net/minecraft/client/renderer/item/ItemProperties.java.patch b/patches/minecraft/net/minecraft/client/renderer/item/ItemProperties.java.patch index 575fae77f9..fe9ac5b760 100644 --- a/patches/minecraft/net/minecraft/client/renderer/item/ItemProperties.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/item/ItemProperties.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/item/ItemProperties.java +++ b/net/minecraft/client/renderer/item/ItemProperties.java -@@ -41,6 +_,9 @@ +@@ -47,6 +_,9 @@ private static final Map> f_117825_ = Maps.newHashMap(); private static ClampedItemPropertyFunction m_174581_(ResourceLocation p_174582_, ClampedItemPropertyFunction p_174583_) { @@ -10,7 +10,7 @@ f_117820_.put(p_174582_, p_174583_); return p_174583_; } -@@ -50,6 +_,9 @@ +@@ -56,6 +_,9 @@ } private static void m_174570_(Item p_174571_, ResourceLocation p_174572_, ClampedItemPropertyFunction p_174573_) { diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/SpriteLoader.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/SpriteLoader.java.patch index 87423ce24f..c6c4aee8ea 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/SpriteLoader.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/SpriteLoader.java.patch @@ -1,33 +1,33 @@ --- a/net/minecraft/client/renderer/texture/SpriteLoader.java +++ b/net/minecraft/client/renderer/texture/SpriteLoader.java -@@ -64,7 +_,7 @@ - int i1 = Math.min(j, k); - int j1 = Mth.m_14173_(i1); - int k1; -- if (j1 < p_261919_) { +@@ -68,7 +_,7 @@ + int j1 = Math.min(j, k); + int k1 = Mth.m_14173_(j1); + int l1; +- if (k1 < p_261919_) { + if (false) { // Forge: Do not lower the mipmap level - f_244357_.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", this.f_244500_, p_261919_, j1, i1); - k1 = j1; + f_244357_.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", this.f_244500_, p_261919_, k1, j1); + l1 = k1; } else { -@@ -138,6 +_,9 @@ +@@ -144,6 +_,9 @@ FrameSize framesize = animationmetadatasection.m_245821_(nativeimage.m_84982_(), nativeimage.m_85084_()); - if (Mth.m_246985_(nativeimage.m_84982_(), framesize.f_244129_()) && Mth.m_246985_(nativeimage.m_85084_(), framesize.f_244503_())) { + if (Mth.m_264612_(nativeimage.m_84982_(), framesize.f_244129_()) && Mth.m_264612_(nativeimage.m_85084_(), framesize.f_244503_())) { + SpriteContents contents = net.minecraftforge.client.ForgeHooksClient.loadSpriteContents(p_251630_, p_250558_, framesize, nativeimage, animationmetadatasection); + if (contents != null) + return contents; return new SpriteContents(p_251630_, framesize, nativeimage, animationmetadatasection); } else { f_244357_.error("Image {} size {},{} is not multiple of frame size {},{}", p_251630_, nativeimage.m_84982_(), nativeimage.m_85084_(), framesize.f_244129_(), framesize.f_244503_()); -@@ -151,6 +_,11 @@ - int i = p_249904_.m_118174_(); - int j = p_249904_.m_118187_(); - p_249904_.m_118180_((p_251421_, p_250533_, p_251913_) -> { -+ TextureAtlasSprite sprite = net.minecraftforge.client.ForgeHooksClient.loadTextureAtlasSprite(this.f_244500_, p_251421_, i, j, p_250533_, p_251913_, p_251421_.f_243731_.length - 1); +@@ -155,6 +_,11 @@ + private Map m_276091_(Stitcher p_276117_, int p_276111_, int p_276112_) { + Map map = new HashMap<>(); + p_276117_.m_118180_((p_251421_, p_250533_, p_251913_) -> { ++ TextureAtlasSprite sprite = net.minecraftforge.client.ForgeHooksClient.loadTextureAtlasSprite(this.f_244500_, p_251421_, p_276111_, p_276112_, p_250533_, p_251913_, p_251421_.f_243731_.length - 1); + if (sprite != null) { + map.put(p_251421_.m_246162_(), sprite); + return; + } - map.put(p_251421_.m_246162_(), new TextureAtlasSprite(this.f_244500_, p_251421_, i, j, p_250533_, p_251913_)); + map.put(p_251421_.m_246162_(), new TextureAtlasSprite(this.f_244500_, p_251421_, p_276111_, p_276112_, p_250533_, p_251913_)); }); return map; 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 f78eaf6a5b..baaead7c18 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -24,7 +24,7 @@ throw new StitcherException(holder.f_244486_, list.stream().map((p_247946_) -> { return p_247946_.f_244486_; }).collect(ImmutableList.toImmutableList())); -@@ -97,7 +_,7 @@ +@@ -95,7 +_,7 @@ boolean flag4 = flag2 && j != l; boolean flag; if (flag3 ^ flag4) { diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch index ba5c751cb9..0812e45027 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/texture/TextureAtlas.java +++ b/net/minecraft/client/renderer/texture/TextureAtlas.java -@@ -74,6 +_,8 @@ +@@ -80,6 +_,8 @@ this.f_118263_ = List.copyOf(list); this.f_118262_ = List.copyOf(list1); @@ -8,8 +8,8 @@ + net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this); } - private void m_246472_(int p_252243_, int p_251110_, int p_249203_) { -@@ -145,5 +_,12 @@ + public void m_276079_(ResourceLocation p_276106_, Path p_276127_) throws IOException { +@@ -151,5 +_,12 @@ public void m_247255_(SpriteLoader.Preparations p_251993_) { this.m_117960_(false, p_251993_.f_244353_() > 0); diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch index 4492bc4a35..901211b6dd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/texture/TextureManager.java +++ b/net/minecraft/client/renderer/texture/TextureManager.java -@@ -166,6 +_,7 @@ +@@ -168,6 +_,7 @@ public void m_118513_(ResourceLocation p_118514_) { AbstractTexture abstracttexture = this.m_174786_(p_118514_, MissingTextureAtlasSprite.m_118080_()); if (abstracttexture != MissingTextureAtlasSprite.m_118080_()) { diff --git a/patches/minecraft/net/minecraft/client/resources/language/ClientLanguage.java.patch b/patches/minecraft/net/minecraft/client/resources/language/ClientLanguage.java.patch index a934f7dcf0..284c72425d 100644 --- a/patches/minecraft/net/minecraft/client/resources/language/ClientLanguage.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/language/ClientLanguage.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/resources/language/ClientLanguage.java +++ b/net/minecraft/client/resources/language/ClientLanguage.java -@@ -80,4 +_,9 @@ +@@ -74,4 +_,9 @@ public FormattedCharSequence m_5536_(FormattedText p_118925_) { return FormattedBidiReorder.m_118931_(p_118925_, this.f_118911_); } diff --git a/patches/minecraft/net/minecraft/client/resources/language/LanguageInfo.java.patch b/patches/minecraft/net/minecraft/client/resources/language/LanguageInfo.java.patch deleted file mode 100644 index d443cbc236..0000000000 --- a/patches/minecraft/net/minecraft/client/resources/language/LanguageInfo.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/net/minecraft/client/resources/language/LanguageInfo.java -+++ b/net/minecraft/client/resources/language/LanguageInfo.java -@@ -17,6 +_,12 @@ - this.f_118944_ = p_118949_; - this.f_118945_ = p_118950_; - this.f_118946_ = p_118951_; -+ String[] splitLangCode = f_118943_.split("_", 2); -+ if (splitLangCode.length == 1) { // Vanilla has some languages without underscores -+ this.javaLocale = new java.util.Locale(f_118943_); -+ } else { -+ this.javaLocale = new java.util.Locale(splitLangCode[0], splitLangCode[1]); -+ } - } - - public String getCode() { -@@ -54,4 +_,8 @@ - public int compareTo(LanguageInfo p_118954_) { - return this.f_118943_.compareTo(p_118954_.f_118943_); - } -+ -+ // Forge: add access to Locale so modders can create correct string and number formatters -+ private final java.util.Locale javaLocale; -+ public java.util.Locale getJavaLocale() { return javaLocale; } - } diff --git a/patches/minecraft/net/minecraft/client/resources/language/LanguageManager.java.patch b/patches/minecraft/net/minecraft/client/resources/language/LanguageManager.java.patch new file mode 100644 index 0000000000..f611e14e34 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/resources/language/LanguageManager.java.patch @@ -0,0 +1,24 @@ +--- a/net/minecraft/client/resources/language/LanguageManager.java ++++ b/net/minecraft/client/resources/language/LanguageManager.java +@@ -29,7 +_,7 @@ + private String f_118967_; + + public LanguageManager(String p_118971_) { +- this.f_118967_ = p_118971_; ++ m_264110_(p_118971_); + } + + private static Map m_118981_(Stream p_118982_) { +@@ -66,8 +_,12 @@ + Language.m_128114_(clientlanguage); + } + ++ private java.util.Locale javaLocale; // Forge: add locale information for modders ++ public java.util.Locale getJavaLocale() { return javaLocale; } + public void m_264110_(String p_265224_) { + this.f_118967_ = p_265224_; ++ final String[] langSplit = p_265224_.split("_", 2); ++ this.javaLocale = langSplit.length == 1 ? new java.util.Locale(langSplit[0]) : new java.util.Locale(langSplit[0], langSplit[1]); + } + + public String m_264236_() { diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch b/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch index f1aa662aaa..3513236bac 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch @@ -3,7 +3,7 @@ @@ -42,13 +_,14 @@ public class ModelManager implements PreparableReloadListener, AutoCloseable { private static final Logger f_243848_ = LogUtils.getLogger(); - private static final Map f_244614_ = Map.of(Sheets.f_110737_, new ResourceLocation("banner_patterns"), Sheets.f_110736_, new ResourceLocation("beds"), Sheets.f_110740_, new ResourceLocation("chests"), Sheets.f_110738_, new ResourceLocation("shield_patterns"), Sheets.f_110739_, new ResourceLocation("signs"), Sheets.f_110735_, new ResourceLocation("shulker_boxes"), TextureAtlas.f_118259_, new ResourceLocation("blocks")); + private static final Map f_244614_ = Map.of(Sheets.f_110737_, new ResourceLocation("banner_patterns"), Sheets.f_110736_, new ResourceLocation("beds"), Sheets.f_110740_, new ResourceLocation("chests"), Sheets.f_110738_, new ResourceLocation("shield_patterns"), Sheets.f_110739_, new ResourceLocation("signs"), Sheets.f_110735_, new ResourceLocation("shulker_boxes"), Sheets.f_265912_, new ResourceLocation("armor_trims"), Sheets.f_271463_, new ResourceLocation("decorated_pot"), TextureAtlas.f_118259_, new ResourceLocation("blocks")); - private Map f_119397_; + private Map f_119397_ = new java.util.HashMap<>(); private final AtlasSet f_119398_; @@ -35,7 +35,7 @@ CompletableFuture> completablefuture = m_246704_(p_251134_, p_250550_); CompletableFuture>> completablefuture1 = m_246899_(p_251134_, p_250550_); CompletableFuture completablefuture2 = completablefuture.thenCombineAsync(completablefuture1, (p_251201_, p_251281_) -> { -@@ -172,6 +_,8 @@ +@@ -164,6 +_,8 @@ return " " + p_248692_.m_119193_() + ":" + p_248692_.m_119203_(); }).collect(Collectors.joining("\n"))); }); @@ -44,7 +44,7 @@ p_252136_.m_6182_("dispatch"); Map map = p_248945_.m_119251_(); BakedModel bakedmodel = map.get(ModelBakery.f_119230_); -@@ -201,6 +_,8 @@ +@@ -193,6 +_,8 @@ this.f_119397_ = modelbakery.m_119251_(); this.f_119404_ = modelbakery.m_119355_(); this.f_119403_ = p_248996_.f_244619_; @@ -53,7 +53,7 @@ p_251960_.m_6182_("cache"); this.f_119399_.m_245515_(p_248996_.f_244561_); p_251960_.m_7238_(); -@@ -226,6 +_,7 @@ +@@ -218,6 +_,7 @@ } public TextureAtlas m_119428_(ResourceLocation p_119429_) { @@ -61,7 +61,7 @@ return this.f_119398_.m_245433_(p_119429_); } -@@ -235,6 +_,10 @@ +@@ -227,6 +_,10 @@ public void m_119410_(int p_119411_) { this.f_119402_ = p_119411_; diff --git a/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch b/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch index d2b12f3a5a..87146d200c 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch @@ -98,7 +98,7 @@ return this.f_119457_; + } + -+ public BakedModel applyTransform(net.minecraft.client.renderer.block.model.ItemTransforms.TransformType transformType, com.mojang.blaze3d.vertex.PoseStack poseStack, boolean applyLeftHandTransform) { ++ public BakedModel applyTransform(net.minecraft.world.item.ItemDisplayContext transformType, com.mojang.blaze3d.vertex.PoseStack poseStack, boolean applyLeftHandTransform) { + return this.defaultModel.applyTransform(transformType, poseStack, applyLeftHandTransform); + } + diff --git a/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.java.patch b/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.java.patch index c11a179234..598074e098 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.java.patch @@ -51,7 +51,7 @@ return this.f_119542_.m_7442_(); + } + -+ public BakedModel applyTransform(net.minecraft.client.renderer.block.model.ItemTransforms.TransformType transformType, com.mojang.blaze3d.vertex.PoseStack poseStack, boolean applyLeftHandTransform) { ++ public BakedModel applyTransform(net.minecraft.world.item.ItemDisplayContext transformType, com.mojang.blaze3d.vertex.PoseStack poseStack, boolean applyLeftHandTransform) { + return this.f_119542_.applyTransform(transformType, poseStack, applyLeftHandTransform); + } + diff --git a/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch index bd8e7a777f..3b038a5049 100644 --- a/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch @@ -14,7 +14,7 @@ } public void m_5705_(BooleanSupplier p_120049_) { -@@ -188,6 +_,7 @@ +@@ -192,6 +_,7 @@ } public void m_7570_(boolean p_120053_) { diff --git a/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch b/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch index d8f4657754..097331c275 100644 --- a/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch +++ b/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/sounds/SoundEngine.java +++ b/net/minecraft/client/sounds/SoundEngine.java -@@ -75,6 +_,7 @@ +@@ -76,6 +_,7 @@ this.f_120217_ = p_120236_; this.f_120218_ = p_120237_; this.f_120222_ = new SoundBufferLibrary(p_249332_); @@ -8,7 +8,7 @@ } public void m_120239_() { -@@ -90,6 +_,7 @@ +@@ -93,6 +_,7 @@ this.m_120304_(); this.m_120323_(); @@ -16,7 +16,7 @@ } private synchronized void m_120323_() { -@@ -321,7 +_,8 @@ +@@ -324,7 +_,8 @@ public void m_120312_(SoundInstance p_120313_) { if (this.f_120219_) { @@ -26,26 +26,26 @@ WeighedSoundEvents weighedsoundevents = p_120313_.m_6775_(this.f_120217_); ResourceLocation resourcelocation = p_120313_.m_7904_(); if (weighedsoundevents == null) { -@@ -389,18 +_,21 @@ - p_194488_.m_83654_(vec3); - p_194488_.m_83670_(flag); - }); +@@ -393,18 +_,21 @@ + p_194488_.m_83654_(vec3); + p_194488_.m_83670_(flag); + }); + final SoundInstance soundinstance = p_120313_; - if (!flag3) { - this.f_120222_.m_120202_(sound.m_119790_()).thenAccept((p_194501_) -> { - channelaccess$channelhandle.m_120154_((p_194495_) -> { - p_194495_.m_83656_(p_194501_); - p_194495_.m_83672_(); + if (!flag3) { + this.f_120222_.m_120202_(sound.m_119790_()).thenAccept((p_194501_) -> { + channelaccess$channelhandle.m_120154_((p_194495_) -> { + p_194495_.m_83656_(p_194501_); + p_194495_.m_83672_(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, soundinstance, p_194495_)); + }); }); - }); - } else { -- this.f_120222_.m_120204_(sound.m_119790_(), flag2).thenAccept((p_194504_) -> { + } else { +- this.f_120222_.m_120204_(sound.m_119790_(), flag2).thenAccept((p_194504_) -> { + soundinstance.getStream(this.f_120222_, sound, flag2).thenAccept((p_194504_) -> { - channelaccess$channelhandle.m_120154_((p_194498_) -> { - p_194498_.m_83658_(p_194504_); - p_194498_.m_83672_(); + channelaccess$channelhandle.m_120154_((p_194498_) -> { + p_194498_.m_83658_(p_194504_); + p_194498_.m_83672_(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, soundinstance, p_194498_)); + }); }); - }); - } + } diff --git a/patches/minecraft/net/minecraft/commands/Commands.java.patch b/patches/minecraft/net/minecraft/commands/Commands.java.patch index 69e8966321..abc8bb5349 100644 --- a/patches/minecraft/net/minecraft/commands/Commands.java.patch +++ b/patches/minecraft/net/minecraft/commands/Commands.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/commands/Commands.java +++ b/net/minecraft/commands/Commands.java -@@ -186,7 +_,7 @@ +@@ -191,7 +_,7 @@ JfrCommand.m_183645_(this.f_82090_); } - if (SharedConstants.f_136183_) { + if (net.minecraftforge.gametest.ForgeGameTestHooks.isGametestEnabled()) { TestCommand.m_127946_(this.f_82090_); + SpawnArmorTrimsCommand.m_266283_(this.f_82090_); } - -@@ -210,6 +_,7 @@ +@@ -216,9 +_,11 @@ if (p_230943_.f_82144_) { PublishCommand.m_138184_(this.f_82090_); } @@ -17,7 +17,11 @@ this.f_82090_.setConsumer((p_230954_, p_230955_, p_230956_) -> { p_230954_.getSource().m_81342_(p_230954_, p_230955_, p_230956_); -@@ -235,7 +_,16 @@ ++ p_230954_.getSource().m_81342_(p_230954_, p_230955_, p_230956_); + }); + } + +@@ -241,7 +_,16 @@ try { try { @@ -35,7 +39,7 @@ } catch (CommandRuntimeException commandruntimeexception) { commandsourcestack.m_81352_(commandruntimeexception.m_79226_()); return 0; -@@ -291,7 +_,8 @@ +@@ -297,7 +_,8 @@ Map, CommandNode> map = Maps.newHashMap(); RootCommandNode rootcommandnode = new RootCommandNode<>(); map.put(this.f_82090_.getRoot(), rootcommandnode); diff --git a/patches/minecraft/net/minecraft/commands/arguments/coordinates/BlockPosArgument.java.patch b/patches/minecraft/net/minecraft/commands/arguments/coordinates/BlockPosArgument.java.patch index 9be17e4505..4a018f7730 100644 --- a/patches/minecraft/net/minecraft/commands/arguments/coordinates/BlockPosArgument.java.patch +++ b/patches/minecraft/net/minecraft/commands/arguments/coordinates/BlockPosArgument.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/commands/arguments/coordinates/BlockPosArgument.java +++ b/net/minecraft/commands/arguments/coordinates/BlockPosArgument.java -@@ -30,9 +_,9 @@ +@@ -36,9 +_,9 @@ - public static BlockPos m_118242_(CommandContext p_118243_, String p_118244_) throws CommandSyntaxException { - BlockPos blockpos = p_118243_.getArgument(p_118244_, Coordinates.class).m_119568_(p_118243_.getSource()); -- if (!p_118243_.getSource().m_81372_().m_46805_(blockpos)) { -+ if (!p_118243_.getSource().getUnsidedLevel().m_46805_(blockpos)) { + public static BlockPos m_264205_(CommandContext p_265283_, ServerLevel p_265219_, String p_265677_) throws CommandSyntaxException { + BlockPos blockpos = m_264582_(p_265283_, p_265677_); +- if (!p_265219_.m_46805_(blockpos)) { ++ if (!p_265283_.getSource().getUnsidedLevel().m_46805_(blockpos)) { throw f_118234_.create(); -- } else if (!p_118243_.getSource().m_81372_().m_46739_(blockpos)) { -+ } else if (!p_118243_.getSource().getUnsidedLevel().m_46739_(blockpos)) { +- } else if (!p_265219_.m_46739_(blockpos)) { ++ } else if (!p_265283_.getSource().getUnsidedLevel().m_46739_(blockpos)) { throw f_118235_.create(); } else { return blockpos; diff --git a/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch b/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch index 40dc4e3e61..e85f4c442c 100644 --- a/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch +++ b/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/commands/synchronization/ArgumentTypeInfos.java +++ b/net/minecraft/commands/synchronization/ArgumentTypeInfos.java -@@ -64,6 +_,20 @@ +@@ -65,6 +_,20 @@ public class ArgumentTypeInfos { private static final Map, ArgumentTypeInfo> f_235379_ = Maps.newHashMap(); @@ -21,10 +21,10 @@ private static , T extends ArgumentTypeInfo.Template> ArgumentTypeInfo m_235386_(Registry> p_235387_, String p_235388_, Class p_235389_, ArgumentTypeInfo p_235390_) { f_235379_.put(p_235389_, p_235390_); return Registry.m_122961_(p_235387_, p_235388_, p_235390_); -@@ -117,12 +_,14 @@ - m_235386_(p_235385_, "resource_key", m_235395_(ResourceKeyArgument.class), new ResourceKeyArgument.Info()); +@@ -119,12 +_,14 @@ m_235386_(p_235385_, "template_mirror", TemplateMirrorArgument.class, SingletonArgumentInfo.m_235451_(TemplateMirrorArgument::m_234343_)); m_235386_(p_235385_, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.m_235451_(TemplateRotationArgument::m_234414_)); + m_235386_(p_235385_, "heightmap", HeightmapTypeArgument.class, SingletonArgumentInfo.m_235451_(HeightmapTypeArgument::m_274509_)); - if (SharedConstants.f_136183_) { + // Forge: Register before gametest arguments to provide forge server <-> vanilla client interop and matching int ids + var uuidInfo = m_235386_(p_235385_, "uuid", UuidArgument.class, SingletonArgumentInfo.m_235451_(UuidArgument::m_113850_)); diff --git a/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch b/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch index 6c3e27d22c..0df1638722 100644 --- a/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch +++ b/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch @@ -11,7 +11,7 @@ private RegistrySetBuilder.BuildState m_254900_(RegistryAccess p_256400_) { RegistrySetBuilder.BuildState registrysetbuilder$buildstate = RegistrySetBuilder.BuildState.m_255369_(p_256400_, this.f_254732_.stream().map(RegistrySetBuilder.RegistryStub::f_254738_)); this.f_254732_.forEach((p_255629_) -> { -@@ -81,7 +_,7 @@ +@@ -87,7 +_,7 @@ RegistrySetBuilder.UniversalLookup registrysetbuilder$universallookup = new RegistrySetBuilder.UniversalLookup(registrysetbuilder$compositeowner); ImmutableMap.Builder> builder = ImmutableMap.builder(); p_255995_.m_206193_().forEach((p_258197_) -> { @@ -20,7 +20,7 @@ }); p_256495_.forEach((p_256603_) -> { builder.put(p_256603_.m_135782_(), registrysetbuilder$universallookup); -@@ -102,6 +_,11 @@ +@@ -108,6 +_,11 @@ public HolderGetter m_255420_(ResourceKey> p_255961_) { return (HolderGetter) BuildState.this.f_254690_.getOrDefault(p_255961_.m_135782_(), BuildState.this.f_254749_); diff --git a/patches/minecraft/net/minecraft/core/RegistrySynchronization.java.patch b/patches/minecraft/net/minecraft/core/RegistrySynchronization.java.patch index 8b23e5718d..2d98d0205d 100644 --- a/patches/minecraft/net/minecraft/core/RegistrySynchronization.java.patch +++ b/patches/minecraft/net/minecraft/core/RegistrySynchronization.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/core/RegistrySynchronization.java +++ b/net/minecraft/core/RegistrySynchronization.java -@@ -23,7 +_,7 @@ - m_245912_(builder, Registries.f_256952_, Biome.f_47430_); - m_245912_(builder, Registries.f_256873_, ChatType.f_237005_); +@@ -29,7 +_,7 @@ + m_245912_(builder, Registries.f_266076_, TrimMaterial.f_266095_); m_245912_(builder, Registries.f_256787_, DimensionType.f_63843_); + m_245912_(builder, Registries.f_268580_, DamageType.f_268510_); - return builder.build(); + return net.minecraftforge.registries.DataPackRegistriesHooks.grabNetworkableRegistries(builder); // FORGE: Keep the map so custom registries can be added later }); diff --git a/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch b/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch index f972f649a3..4ae38e72fe 100644 --- a/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch +++ b/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch @@ -5,7 +5,7 @@ double d2 = p_123375_.m_7094_() + (double)((float)direction.m_122431_() * 1.125F); BlockPos blockpos = p_123375_.m_7961_().m_121945_(direction); + Boat boat = (Boat)(this.f_235889_ ? new ChestBoat(level, d0, d1, d2) : new Boat(level, d0, d1, d2)); -+ boat.m_262362_(this.f_123369_); ++ boat.m_28464_(this.f_123369_); + boat.m_146922_(direction.m_122435_()); double d3; - if (level.m_6425_(blockpos).m_205070_(FluidTags.f_13131_)) { @@ -21,7 +21,7 @@ } - Boat boat = (Boat)(this.f_235889_ ? new ChestBoat(level, d0, d1 + d3, d2) : new Boat(level, d0, d1 + d3, d2)); -- boat.m_262362_(this.f_123369_); +- boat.m_28464_(this.f_123369_); - boat.m_146922_(direction.m_122435_()); + boat.m_6034_(d0, d1 + d3, d2); level.m_7967_(boat); diff --git a/patches/minecraft/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch b/patches/minecraft/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch index 09653a594c..170ce9114d 100644 --- a/patches/minecraft/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch +++ b/patches/minecraft/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -346,7 +_,7 @@ +@@ -352,7 +_,7 @@ DispensibleContainerItem dispensiblecontaineritem = (DispensibleContainerItem)p_123562_.m_41720_(); BlockPos blockpos = p_123561_.m_7961_().m_121945_(p_123561_.m_6414_().m_61143_(DispenserBlock.f_52659_)); Level level = p_123561_.m_7727_(); @@ -9,7 +9,7 @@ dispensiblecontaineritem.m_142131_((Player)null, level, p_123562_, blockpos); return new ItemStack(Items.f_42446_); } else { -@@ -405,9 +_,10 @@ +@@ -411,9 +_,10 @@ level.m_46597_(blockpos, BaseFireBlock.m_49245_(level, blockpos)); level.m_142346_((Entity)null, GameEvent.f_157797_, blockpos); } else if (!CampfireBlock.m_51321_(blockstate) && !CandleBlock.m_152845_(blockstate) && !CandleCakeBlock.m_152910_(blockstate)) { diff --git a/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch b/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch index 7f50f77c63..f783af62bf 100644 --- a/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch +++ b/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/core/registries/BuiltInRegistries.java +++ b/net/minecraft/core/registries/BuiltInRegistries.java -@@ -110,41 +_,89 @@ +@@ -111,41 +_,89 @@ public static final DefaultedRegistry f_256726_ = m_257834_(Registries.f_256827_, "step", (p_260052_) -> { return GameEvent.f_157785_; }); @@ -102,7 +102,7 @@ return ChunkStatus.f_62314_; }); public static final Registry> f_256978_ = m_258002_(Registries.f_256947_, (p_259641_) -> { -@@ -153,42 +_,90 @@ +@@ -154,42 +_,90 @@ public static final Registry> f_256957_ = m_258002_(Registries.f_257009_, (p_259262_) -> { return PosRuleTestType.f_74205_; }); @@ -205,7 +205,7 @@ return Activity.f_37979_; }); public static final Registry f_257035_ = m_258002_(Registries.f_257032_, (p_260042_) -> { -@@ -221,10 +_,18 @@ +@@ -222,10 +_,18 @@ public static final Registry> f_256906_ = m_258002_(Registries.f_256774_, (p_260006_) -> { return BlockPredicateType.f_190444_; }); @@ -226,7 +226,7 @@ return Feature.f_65731_; }); public static final Registry> f_256950_ = m_258002_(Registries.f_256888_, (p_259179_) -> { -@@ -239,10 +_,18 @@ +@@ -240,10 +_,18 @@ public static final Registry> f_256986_ = m_258002_(Registries.f_256843_, (p_260335_) -> { return PlacementModifierType.f_191853_; }); @@ -247,7 +247,7 @@ return FoliagePlacerType.f_68591_; }); public static final Registry> f_256920_ = m_258002_(Registries.f_256963_, (p_259690_) -> { -@@ -251,7 +_,11 @@ +@@ -252,7 +_,11 @@ public static final Registry> f_256742_ = m_258002_(Registries.f_256768_, (p_259493_) -> { return RootPlacerType.f_225898_; }); @@ -260,7 +260,7 @@ return TreeDecoratorType.f_70043_; }); public static final Registry> f_256958_ = m_258002_(Registries.f_256720_, (p_259370_) -> { -@@ -280,10 +_,18 @@ +@@ -282,10 +_,18 @@ return m_258073_(p_260095_, Lifecycle.stable(), p_259057_); } @@ -279,7 +279,7 @@ private static DefaultedRegistry m_257834_(ResourceKey> p_259296_, String p_259101_, BuiltInRegistries.RegistryBootstrap p_259485_) { return m_257762_(p_259296_, p_259101_, Lifecycle.stable(), p_259485_); } -@@ -292,10 +_,19 @@ +@@ -294,10 +_,19 @@ return m_257895_(p_259121_, new MappedRegistry<>(p_259121_, p_259977_, false), p_259874_, p_259977_); } @@ -299,7 +299,7 @@ private static DefaultedRegistry m_257762_(ResourceKey> p_260010_, String p_260220_, Lifecycle p_260139_, BuiltInRegistries.RegistryBootstrap p_260185_) { return m_257895_(p_260010_, new DefaultedMappedRegistry<>(p_260220_, p_260010_, p_260139_, true), p_260185_, p_260139_); } -@@ -341,7 +_,7 @@ +@@ -343,7 +_,7 @@ if (p_259410_ instanceof DefaultedRegistry) { ResourceLocation resourcelocation = ((DefaultedRegistry)p_259410_).m_122315_(); diff --git a/patches/minecraft/net/minecraft/data/DataGenerator.java.patch b/patches/minecraft/net/minecraft/data/DataGenerator.java.patch index 4be8ddca44..2f8dad623d 100644 --- a/patches/minecraft/net/minecraft/data/DataGenerator.java.patch +++ b/patches/minecraft/net/minecraft/data/DataGenerator.java.patch @@ -9,7 +9,7 @@ public DataGenerator(Path p_251724_, WorldVersion p_250554_, boolean p_251323_) { this.f_243753_ = p_251724_; @@ -38,6 +_,7 @@ - f_123905_.debug("Generator {} already run for version {}", p_254418_, this.f_236027_.getName()); + f_123905_.debug("Generator {} already run for version {}", p_254418_, this.f_236027_.m_132493_()); } else { f_123905_.info("Starting provider: {}", (Object)p_254418_); + net.minecraftforge.fml.StartupMessageManager.addModMessage("Generating: " + p_254418_); diff --git a/patches/minecraft/net/minecraft/data/HashCache.java.patch b/patches/minecraft/net/minecraft/data/HashCache.java.patch index 6f8c55f829..1b4de6bf04 100644 --- a/patches/minecraft/net/minecraft/data/HashCache.java.patch +++ b/patches/minecraft/net/minecraft/data/HashCache.java.patch @@ -25,7 +25,7 @@ p_253379_.m_236142_(this.f_236079_, path, DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(LocalDateTime.now()) + "\t" + p_253378_); } -@@ -211,10 +_,11 @@ +@@ -208,10 +_,11 @@ bufferedwriter.write(p_236145_); bufferedwriter.newLine(); diff --git a/patches/minecraft/net/minecraft/data/Main.java.patch b/patches/minecraft/net/minecraft/data/Main.java.patch index 3b850dfb92..e7a9f857c8 100644 --- a/patches/minecraft/net/minecraft/data/Main.java.patch +++ b/patches/minecraft/net/minecraft/data/Main.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/Main.java +++ b/net/minecraft/data/Main.java -@@ -69,8 +_,15 @@ +@@ -73,8 +_,15 @@ OptionSpec optionspec6 = optionparser.accepts("all", "Include all generators"); OptionSpec optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated"); OptionSpec optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg(); @@ -17,7 +17,7 @@ Path path = Paths.get(optionspec7.value(optionset)); boolean flag = optionset.has(optionspec6); boolean flag1 = flag || optionset.has(optionspec2); -@@ -78,10 +_,14 @@ +@@ -82,10 +_,14 @@ boolean flag3 = flag || optionset.has(optionspec3); boolean flag4 = flag || optionset.has(optionspec4); boolean flag5 = flag || optionset.has(optionspec5); diff --git a/patches/minecraft/net/minecraft/data/loot/BlockLootSubProvider.java.patch b/patches/minecraft/net/minecraft/data/loot/BlockLootSubProvider.java.patch index b06da11cbe..01a8ef2f49 100644 --- a/patches/minecraft/net/minecraft/data/loot/BlockLootSubProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/loot/BlockLootSubProvider.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/loot/BlockLootSubProvider.java +++ b/net/minecraft/data/loot/BlockLootSubProvider.java -@@ -252,11 +_,15 @@ +@@ -260,11 +_,15 @@ protected abstract void m_245660_(); diff --git a/patches/minecraft/net/minecraft/data/loot/EntityLootSubProvider.java.patch b/patches/minecraft/net/minecraft/data/loot/EntityLootSubProvider.java.patch index fc2e0bc626..2a480ce2ec 100644 --- a/patches/minecraft/net/minecraft/data/loot/EntityLootSubProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/loot/EntityLootSubProvider.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/loot/EntityLootSubProvider.java +++ b/net/minecraft/data/loot/EntityLootSubProvider.java -@@ -45,10 +_,14 @@ +@@ -51,23 +_,27 @@ public abstract void m_246942_(); @@ -11,12 +11,37 @@ public void m_245126_(BiConsumer p_251751_) { this.m_246942_(); Set set = Sets.newHashSet(); -- BuiltInRegistries.f_256780_.m_203611_().forEach((p_249003_) -> { +- BuiltInRegistries.f_256780_.m_203611_().forEach((p_266624_) -> { +- EntityType entitytype = p_266624_.m_203334_(); + this.getKnownEntityTypes().map(EntityType::m_204041_).forEach((p_249003_) -> { - EntityType entitytype = p_249003_.m_203334_(); - if (entitytype.m_245993_(this.f_244045_)) { ++ EntityType entitytype = p_249003_.m_203334_(); + if (entitytype.m_245993_(this.f_265862_)) { if (m_245552_(entitytype)) { -@@ -81,7 +_,7 @@ + Map map = this.f_244213_.remove(entitytype); + ResourceLocation resourcelocation = entitytype.m_20677_(); + if (!resourcelocation.equals(BuiltInLootTables.f_78712_) && entitytype.m_245993_(this.f_266009_) && (map == null || !map.containsKey(resourcelocation))) { +- throw new IllegalStateException(String.format(Locale.ROOT, "Missing loottable '%s' for '%s'", resourcelocation, p_266624_.m_205785_().m_135782_())); ++ throw new IllegalStateException(String.format(Locale.ROOT, "Missing loottable '%s' for '%s'", resourcelocation, p_249003_.m_205785_().m_135782_())); + } + + if (map != null) { + map.forEach((p_250376_, p_250972_) -> { + if (!set.add(p_250376_)) { +- throw new IllegalStateException(String.format(Locale.ROOT, "Duplicate loottable '%s' for '%s'", p_250376_, p_266624_.m_205785_().m_135782_())); ++ throw new IllegalStateException(String.format(Locale.ROOT, "Duplicate loottable '%s' for '%s'", p_250376_, p_249003_.m_205785_().m_135782_())); + } else { + p_251751_.accept(p_250376_, p_250972_); + } +@@ -76,7 +_,7 @@ + } else { + Map map1 = this.f_244213_.remove(entitytype); + if (map1 != null) { +- throw new IllegalStateException(String.format(Locale.ROOT, "Weird loottables '%s' for '%s', not a LivingEntity so should not have loot", map1.keySet().stream().map(ResourceLocation::toString).collect(Collectors.joining(",")), p_266624_.m_205785_().m_135782_())); ++ throw new IllegalStateException(String.format(Locale.ROOT, "Weird loottables '%s' for '%s', not a LivingEntity so should not have loot", map1.keySet().stream().map(ResourceLocation::toString).collect(Collectors.joining(",")), p_249003_.m_205785_().m_135782_())); + } + } + +@@ -87,7 +_,7 @@ } } diff --git a/patches/minecraft/net/minecraft/data/registries/VanillaRegistries.java.patch b/patches/minecraft/net/minecraft/data/registries/VanillaRegistries.java.patch index 85a6aa7e3e..db99361b71 100644 --- a/patches/minecraft/net/minecraft/data/registries/VanillaRegistries.java.patch +++ b/patches/minecraft/net/minecraft/data/registries/VanillaRegistries.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/data/registries/VanillaRegistries.java +++ b/net/minecraft/data/registries/VanillaRegistries.java -@@ -31,6 +_,7 @@ +@@ -36,6 +_,7 @@ public class VanillaRegistries { - private static final RegistrySetBuilder f_254635_ = (new RegistrySetBuilder()).m_254916_(Registries.f_256787_, DimensionTypes::m_236473_).m_254916_(Registries.f_257003_, (RegistrySetBuilder.RegistryBootstrap)Carvers::m_254873_).m_254916_(Registries.f_256911_, (RegistrySetBuilder.RegistryBootstrap)FeatureUtils::m_254925_).m_254916_(Registries.f_256988_, PlacementUtils::m_255199_).m_254916_(Registries.f_256944_, Structures::m_255324_).m_254916_(Registries.f_256998_, StructureSets::m_255117_).m_254916_(Registries.f_257011_, ProcessorLists::m_254888_).m_254916_(Registries.f_256948_, Pools::m_255181_).m_254916_(Registries.f_256952_, Biomes::m_254912_).m_254916_(Registries.f_256865_, NoiseData::m_236475_).m_254916_(Registries.f_257040_, NoiseRouterData::m_255288_).m_254916_(Registries.f_256932_, NoiseGeneratorSettings::m_254959_).m_254916_(Registries.f_256729_, WorldPresets::m_254897_).m_254916_(Registries.f_256724_, FlatLevelGeneratorPresets::m_254848_).m_254916_(Registries.f_256873_, ChatType::m_237021_); + private static final RegistrySetBuilder f_254635_ = (new RegistrySetBuilder()).m_254916_(Registries.f_256787_, DimensionTypes::m_236473_).m_254916_(Registries.f_257003_, (RegistrySetBuilder.RegistryBootstrap)Carvers::m_254873_).m_254916_(Registries.f_256911_, (RegistrySetBuilder.RegistryBootstrap)FeatureUtils::m_254925_).m_254916_(Registries.f_256988_, PlacementUtils::m_255199_).m_254916_(Registries.f_256944_, Structures::m_255324_).m_254916_(Registries.f_256998_, StructureSets::m_255117_).m_254916_(Registries.f_257011_, ProcessorLists::m_254888_).m_254916_(Registries.f_256948_, Pools::m_255181_).m_254916_(Registries.f_256952_, BiomeData::m_272174_).m_254916_(Registries.f_273919_, MultiNoiseBiomeSourceParameterLists::m_274553_).m_254916_(Registries.f_256865_, NoiseData::m_236475_).m_254916_(Registries.f_257040_, NoiseRouterData::m_255288_).m_254916_(Registries.f_256932_, NoiseGeneratorSettings::m_254959_).m_254916_(Registries.f_256729_, WorldPresets::m_254897_).m_254916_(Registries.f_256724_, FlatLevelGeneratorPresets::m_254848_).m_254916_(Registries.f_256873_, ChatType::m_237021_).m_254916_(Registries.f_266063_, TrimPatterns::m_266400_).m_254916_(Registries.f_266076_, TrimMaterials::m_266479_).m_254916_(Registries.f_268580_, DamageTypes::m_269594_); + public static final List>> DATAPACK_REGISTRY_KEYS = f_254635_.getEntryKeys(); private static void m_255148_(HolderLookup.Provider p_256242_) { - HolderGetter holdergetter = p_256242_.m_255025_(Registries.f_256988_); + m_271867_(p_256242_.m_255025_(Registries.f_256988_), p_256242_.m_255025_(Registries.f_256952_)); diff --git a/patches/minecraft/net/minecraft/data/tags/BiomeTagsProvider.java.patch b/patches/minecraft/net/minecraft/data/tags/BiomeTagsProvider.java.patch index 7a5cd9398c..659b734c24 100644 --- a/patches/minecraft/net/minecraft/data/tags/BiomeTagsProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/tags/BiomeTagsProvider.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/data/tags/BiomeTagsProvider.java +++ b/net/minecraft/data/tags/BiomeTagsProvider.java -@@ -11,8 +_,13 @@ - import net.minecraft.world.level.biome.MultiNoiseBiomeSource; +@@ -10,8 +_,13 @@ + import net.minecraft.world.level.biome.MultiNoiseBiomeSourceParameterList; public class BiomeTagsProvider extends TagsProvider { + /** @deprecated Forge: Use the {@linkplain #BiomeTagsProvider(PackOutput, CompletableFuture, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} */ diff --git a/patches/minecraft/net/minecraft/data/tags/GameEventTagsProvider.java.patch b/patches/minecraft/net/minecraft/data/tags/GameEventTagsProvider.java.patch index 905e5d52d1..e960ea5e19 100644 --- a/patches/minecraft/net/minecraft/data/tags/GameEventTagsProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/tags/GameEventTagsProvider.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/data/tags/GameEventTagsProvider.java @@ -12,10 +_,15 @@ @VisibleForTesting - static final GameEvent[] f_236425_ = new GameEvent[]{GameEvent.f_157791_, GameEvent.f_157792_, GameEvent.f_157793_, GameEvent.f_157794_, GameEvent.f_157795_, GameEvent.f_157796_, GameEvent.f_157797_, GameEvent.f_223702_, GameEvent.f_223703_, GameEvent.f_157802_, GameEvent.f_157803_, GameEvent.f_157804_, GameEvent.f_223704_, GameEvent.f_157806_, GameEvent.f_223705_, GameEvent.f_223706_, GameEvent.f_223707_, GameEvent.f_223708_, GameEvent.f_157810_, GameEvent.f_223709_, GameEvent.f_223710_, GameEvent.f_157811_, GameEvent.f_157812_, GameEvent.f_157816_, GameEvent.f_157769_, GameEvent.f_157770_, GameEvent.f_223696_, GameEvent.f_223697_, GameEvent.f_157772_, GameEvent.f_223699_, GameEvent.f_157774_, GameEvent.f_157775_, GameEvent.f_157776_, GameEvent.f_157777_, GameEvent.f_157778_, GameEvent.f_157781_, GameEvent.f_157784_, GameEvent.f_157785_, GameEvent.f_157786_, GameEvent.f_238175_}; + static final GameEvent[] f_236425_ = new GameEvent[]{GameEvent.f_157791_, GameEvent.f_157792_, GameEvent.f_157793_, GameEvent.f_157794_, GameEvent.f_157795_, GameEvent.f_157796_, GameEvent.f_157797_, GameEvent.f_223702_, GameEvent.f_223703_, GameEvent.f_157802_, GameEvent.f_157803_, GameEvent.f_157804_, GameEvent.f_223704_, GameEvent.f_157806_, GameEvent.f_223705_, GameEvent.f_223706_, GameEvent.f_223707_, GameEvent.f_268533_, GameEvent.f_223708_, GameEvent.f_268500_, GameEvent.f_157810_, GameEvent.f_223709_, GameEvent.f_223710_, GameEvent.f_157811_, GameEvent.f_157812_, GameEvent.f_157816_, GameEvent.f_157769_, GameEvent.f_157770_, GameEvent.f_223696_, GameEvent.f_223697_, GameEvent.f_157772_, GameEvent.f_223699_, GameEvent.f_157774_, GameEvent.f_157775_, GameEvent.f_157776_, GameEvent.f_157777_, GameEvent.f_157778_, GameEvent.f_157781_, GameEvent.f_157784_, GameEvent.f_157785_, GameEvent.f_157786_, GameEvent.f_238175_}; + /** @deprecated Forge: Use the {@linkplain #GameEventTagsProvider(PackOutput, CompletableFuture, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} */ + @Deprecated diff --git a/patches/minecraft/net/minecraft/data/tags/IntrinsicHolderTagsProvider.java.patch b/patches/minecraft/net/minecraft/data/tags/IntrinsicHolderTagsProvider.java.patch index 9e9e4c0978..4d14bd33d1 100644 --- a/patches/minecraft/net/minecraft/data/tags/IntrinsicHolderTagsProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/tags/IntrinsicHolderTagsProvider.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/tags/IntrinsicHolderTagsProvider.java +++ b/net/minecraft/data/tags/IntrinsicHolderTagsProvider.java -@@ -13,21 +_,28 @@ +@@ -13,26 +_,40 @@ public abstract class IntrinsicHolderTagsProvider extends TagsProvider { private final Function> f_254687_; @@ -17,6 +17,19 @@ this.f_254687_ = p_256168_; } ++ /** ++ * @deprecated Forge: Use the {@linkplain #IntrinsicHolderTagsProvider(PackOutput, ResourceKey, CompletableFuture, CompletableFuture, Function, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} ++ */ ++ @Deprecated + public IntrinsicHolderTagsProvider(PackOutput p_275304_, ResourceKey> p_275709_, CompletableFuture p_275227_, CompletableFuture> p_275311_, Function> p_275566_) { +- super(p_275304_, p_275709_, p_275227_, p_275311_); ++ this(p_275304_, p_275709_, p_275227_, p_275311_, p_275566_, "vanilla", null); ++ } ++ public IntrinsicHolderTagsProvider(PackOutput p_275304_, ResourceKey> p_275709_, CompletableFuture p_275227_, CompletableFuture> p_275311_, Function> p_275566_, String modId, @org.jetbrains.annotations.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { ++ super(p_275304_, p_275709_, p_275227_, p_275311_, modId, existingFileHelper); + this.f_254687_ = p_275566_; + } + protected IntrinsicHolderTagsProvider.IntrinsicTagAppender m_206424_(TagKey p_255730_) { TagBuilder tagbuilder = this.m_236451_(p_255730_); - return new IntrinsicHolderTagsProvider.IntrinsicTagAppender<>(tagbuilder, this.f_254687_); @@ -34,7 +47,7 @@ this.f_254707_ = p_256433_; } -@@ -45,6 +_,11 @@ +@@ -50,6 +_,11 @@ public final IntrinsicHolderTagsProvider.IntrinsicTagAppender m_255179_(T... p_255868_) { Stream.of(p_255868_).map(this.f_254707_).forEach(this::m_255204_); return this; diff --git a/patches/minecraft/net/minecraft/data/tags/ItemTagsProvider.java.patch b/patches/minecraft/net/minecraft/data/tags/ItemTagsProvider.java.patch index 56a97742cf..6aa5780655 100644 --- a/patches/minecraft/net/minecraft/data/tags/ItemTagsProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/tags/ItemTagsProvider.java.patch @@ -1,21 +1,32 @@ --- a/net/minecraft/data/tags/ItemTagsProvider.java +++ b/net/minecraft/data/tags/ItemTagsProvider.java -@@ -13,10 +_,17 @@ - public abstract class ItemTagsProvider extends IntrinsicHolderTagsProvider { - private final Function, TagBuilder> f_126528_; +@@ -16,14 +_,28 @@ + private final CompletableFuture> f_126528_; + private final Map, TagKey> f_273814_ = new HashMap<>(); + /** -+ * @deprecated Forge: Use the {@link #ItemTagsProvider(PackOutput, CompletableFuture, TagsProvider, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} ++ * @deprecated Forge: Use the {@linkplain #ItemTagsProvider(PackOutput, CompletableFuture, CompletableFuture, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} + */ + @Deprecated - public ItemTagsProvider(PackOutput p_255871_, CompletableFuture p_256035_, TagsProvider p_256467_) { -+ this(p_255871_, p_256035_, p_256467_, "vanilla", null); + public ItemTagsProvider(PackOutput p_275343_, CompletableFuture p_275729_, CompletableFuture> p_275322_) { ++ this(p_275343_, p_275729_, p_275322_, "vanilla", null); + } -+ public ItemTagsProvider(PackOutput p_255871_, CompletableFuture p_256035_, TagsProvider p_256467_, String modId, @org.jetbrains.annotations.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { - super(p_255871_, Registries.f_256913_, p_256035_, (p_255790_) -> { ++ public ItemTagsProvider(PackOutput p_275343_, CompletableFuture p_275729_, CompletableFuture> p_275322_, String modId, @org.jetbrains.annotations.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { + super(p_275343_, Registries.f_256913_, p_275729_, (p_255790_) -> { return p_255790_.m_204114_().m_205785_(); - }); + }, modId, existingFileHelper); - this.f_126528_ = p_256467_::m_236451_; + this.f_126528_ = p_275322_; } ++ /** ++ * @deprecated Forge: Use the {@linkplain #ItemTagsProvider(PackOutput, CompletableFuture, CompletableFuture, CompletableFuture, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} ++ */ ++ @Deprecated + public ItemTagsProvider(PackOutput p_275204_, CompletableFuture p_275194_, CompletableFuture> p_275207_, CompletableFuture> p_275634_) { ++ this(p_275204_, p_275194_, p_275207_, p_275634_, "vanilla", null); ++ } ++ public ItemTagsProvider(PackOutput p_275204_, CompletableFuture p_275194_, CompletableFuture> p_275207_, CompletableFuture> p_275634_, String modId, @org.jetbrains.annotations.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { + super(p_275204_, Registries.f_256913_, p_275194_, p_275207_, (p_274765_) -> { + return p_274765_.m_204114_().m_205785_(); + }); diff --git a/patches/minecraft/net/minecraft/data/tags/TagsProvider.java.patch b/patches/minecraft/net/minecraft/data/tags/TagsProvider.java.patch index 30ecc47e56..ea4fd4bd0b 100644 --- a/patches/minecraft/net/minecraft/data/tags/TagsProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/tags/TagsProvider.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/data/tags/TagsProvider.java +++ b/net/minecraft/data/tags/TagsProvider.java -@@ -32,15 +_,37 @@ - protected final CompletableFuture f_254646_; +@@ -36,20 +_,48 @@ + private final CompletableFuture> f_273855_; protected final ResourceKey> f_254716_; protected final Map f_126543_ = Maps.newLinkedHashMap(); + protected final String modId; @@ -13,18 +13,30 @@ + /** + * @deprecated Forge: Use the {@linkplain #TagsProvider(PackOutput, ResourceKey, CompletableFuture, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} + */ -+ @Deprecated protected TagsProvider(PackOutput p_256596_, ResourceKey> p_255886_, CompletableFuture p_256513_) { +- this(p_256596_, p_255886_, p_256513_, CompletableFuture.completedFuture(TagsProvider.TagLookup.m_274566_())); + this(p_256596_, p_255886_, p_256513_, "vanilla", null); + } + protected TagsProvider(PackOutput p_256596_, ResourceKey> p_255886_, CompletableFuture p_256513_, String modId, @org.jetbrains.annotations.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { - this.f_236439_ = p_256596_.m_245269_(PackOutput.Target.DATA_PACK, TagManager.m_203918_(p_255886_)); - this.f_254646_ = p_256513_; - this.f_254716_ = p_255886_; ++ this(p_256596_, p_255886_, p_256513_, CompletableFuture.completedFuture(TagsProvider.TagLookup.m_274566_()), modId, existingFileHelper); + } + ++ /** ++ * @deprecated Forge: Use the {@linkplain #TagsProvider(PackOutput, ResourceKey, CompletableFuture, CompletableFuture, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} ++ */ ++ @Deprecated + protected TagsProvider(PackOutput p_275432_, ResourceKey> p_275476_, CompletableFuture p_275222_, CompletableFuture> p_275565_) { ++ this(p_275432_, p_275476_, p_275222_, p_275565_, "vanilla", null); ++ } ++ protected TagsProvider(PackOutput p_275432_, ResourceKey> p_275476_, CompletableFuture p_275222_, CompletableFuture> p_275565_, String modId, @org.jetbrains.annotations.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) { + this.f_236439_ = p_275432_.m_245269_(PackOutput.Target.DATA_PACK, TagManager.m_203918_(p_275476_)); + this.f_254716_ = p_275476_; + this.f_273855_ = p_275565_; + this.f_275752_ = p_275222_; + this.modId = modId; + this.existingFileHelper = existingFileHelper; -+ this.resourceType = new net.minecraftforge.common.data.ExistingFileHelper.ResourceType(net.minecraft.server.packs.PackType.SERVER_DATA, ".json", TagManager.m_203918_(p_255886_)); -+ this.elementResourceType = new net.minecraftforge.common.data.ExistingFileHelper.ResourceType(net.minecraft.server.packs.PackType.SERVER_DATA, ".json", net.minecraftforge.common.ForgeHooks.prefixNamespace(p_255886_.m_135782_())); ++ this.resourceType = new net.minecraftforge.common.data.ExistingFileHelper.ResourceType(net.minecraft.server.packs.PackType.SERVER_DATA, ".json", TagManager.m_203918_(p_275476_)); ++ this.elementResourceType = new net.minecraftforge.common.data.ExistingFileHelper.ResourceType(net.minecraft.server.packs.PackType.SERVER_DATA, ".json", net.minecraftforge.common.ForgeHooks.prefixNamespace(p_275476_.m_135782_())); + } + + // Forge: Allow customizing the path for a given tag or returning null @@ -39,12 +51,12 @@ } protected abstract void m_6577_(HolderLookup.Provider p_256380_); -@@ -49,7 +_,13 @@ - return this.f_254646_.thenCompose((p_255494_) -> { - this.f_126543_.clear(); - this.m_6577_(p_255494_); -- HolderLookup.RegistryLookup registrylookup = p_255494_.m_255025_(this.f_254716_); -+ HolderLookup.RegistryLookup registrylookup = p_255494_.m_254861_(this.f_254716_).orElseThrow(() -> { +@@ -64,7 +_,13 @@ + + return new CombinedData<>(p_274778_, p_274779_); + }).thenCompose((p_274774_) -> { +- HolderLookup.RegistryLookup registrylookup = p_274774_.f_273893_.m_255025_(this.f_254716_); ++ HolderLookup.RegistryLookup registrylookup = p_274774_.f_273893_.m_254861_(this.f_254716_).orElseThrow(() -> { + // FORGE: Throw a more descriptive error message if this is a Forge registry without tags enabled + if (net.minecraftforge.registries.RegistryManager.ACTIVE.getRegistry(this.f_254716_) != null) { + return new IllegalStateException("Forge registry " + this.f_254716_.m_135782_() + " does not have support for tags"); @@ -54,10 +66,10 @@ Predicate predicate = (p_255496_) -> { return registrylookup.m_254902_(ResourceKey.m_135785_(this.f_254716_, p_255496_)).isPresent(); }; -@@ -59,12 +_,13 @@ +@@ -77,12 +_,13 @@ List list = tagbuilder.m_215904_(); - List list1 = list.stream().filter((p_255492_) -> { - return !p_255492_.m_215940_(predicate, this.f_126543_::containsKey); + List list1 = list.stream().filter((p_274771_) -> { + return !p_274771_.m_215940_(predicate, predicate1); - }).toList(); + }).filter(this::missing).toList(); // Forge: Add validation via existing resources if (!list1.isEmpty()) { @@ -71,7 +83,7 @@ return DataProvider.m_253162_(p_253684_, jsonelement, path); } }).toArray((p_253442_) -> { -@@ -73,22 +_,34 @@ +@@ -91,13 +_,23 @@ }); } @@ -96,6 +108,9 @@ return TagBuilder.m_215899_(); }); } +@@ -118,11 +_,13 @@ + }); + } - public static class TagAppender { + public static class TagAppender implements net.minecraftforge.common.extensions.IForgeTagAppender { @@ -110,7 +125,7 @@ } public final TagsProvider.TagAppender m_255204_(ResourceKey p_256138_) { -@@ -118,6 +_,19 @@ +@@ -152,6 +_,19 @@ public TagsProvider.TagAppender m_176841_(ResourceLocation p_176842_) { this.f_126568_.m_215909_(p_176842_); return this; @@ -129,4 +144,4 @@ + return modId; } } - } + diff --git a/patches/minecraft/net/minecraft/locale/Language.java.patch b/patches/minecraft/net/minecraft/locale/Language.java.patch index 5aa36be141..4e11b48cbc 100644 --- a/patches/minecraft/net/minecraft/locale/Language.java.patch +++ b/patches/minecraft/net/minecraft/locale/Language.java.patch @@ -8,8 +8,8 @@ + final Map map = new java.util.HashMap<>(builder.build()); + net.minecraftforge.server.LanguageHook.captureLanguageMap(map); return new Language() { - public String m_6834_(String p_128127_) { - return map.getOrDefault(p_128127_, p_128127_); + public String m_118919_(String p_128127_, String p_265421_) { + return map.getOrDefault(p_128127_, p_265421_); @@ -62,6 +_,11 @@ }, Style.f_131099_).isPresent(); }; @@ -30,5 +30,5 @@ + // FORGE START + public Map getLanguageData() { return ImmutableMap.of(); } - public abstract String m_6834_(String p_128111_); - + public String m_6834_(String p_128111_) { + return this.m_118919_(p_128111_, p_128111_); diff --git a/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch b/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch index a1da8d3250..edcf429537 100644 --- a/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch +++ b/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/nbt/CompoundTag.java +++ b/net/minecraft/nbt/CompoundTag.java -@@ -39,6 +_,7 @@ +@@ -41,6 +_,7 @@ while((b0 = CompoundTag.m_128420_(p_128485_, p_128487_)) != 0) { String s = CompoundTag.m_128432_(p_128485_, p_128487_); p_128487_.m_128926_((long)(28 + 2 * s.length())); @@ -8,7 +8,7 @@ Tag tag = CompoundTag.m_128413_(TagTypes.m_129397_(b0), s, p_128485_, p_128486_ + 1, p_128487_); if (map.put(s, tag) == null) { p_128487_.m_128926_(36L); -@@ -165,6 +_,7 @@ +@@ -167,6 +_,7 @@ @Nullable public Tag m_128365_(String p_128366_, Tag p_128367_) { @@ -16,7 +16,7 @@ return this.f_128329_.put(p_128366_, p_128367_); } -@@ -457,11 +_,12 @@ +@@ -459,11 +_,12 @@ } static byte m_128420_(DataInput p_128421_, NbtAccounter p_128422_) throws IOException { diff --git a/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch b/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch index 524b9e04dc..dd9745e5c6 100644 --- a/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/nbt/NbtIo.java +++ b/net/minecraft/nbt/NbtIo.java -@@ -148,10 +_,12 @@ +@@ -142,10 +_,12 @@ private static Tag m_128930_(DataInput p_128931_, int p_128932_, NbtAccounter p_128933_) throws IOException { byte b0 = p_128931_.readByte(); diff --git a/patches/minecraft/net/minecraft/network/Connection.java.patch b/patches/minecraft/net/minecraft/network/Connection.java.patch index 0f2888997e..db17bdde82 100644 --- a/patches/minecraft/net/minecraft/network/Connection.java.patch +++ b/patches/minecraft/net/minecraft/network/Connection.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/Connection.java +++ b/net/minecraft/network/Connection.java -@@ -82,6 +_,7 @@ +@@ -84,6 +_,7 @@ private float f_129477_; private int f_129478_; private boolean f_129479_; @@ -8,7 +8,7 @@ public Connection(PacketFlow p_129482_) { this.f_129466_ = p_129482_; -@@ -91,6 +_,7 @@ +@@ -93,6 +_,7 @@ super.channelActive(p_129525_); this.f_129468_ = p_129525_.channel(); this.f_129469_ = this.f_129468_.remoteAddress(); @@ -16,16 +16,16 @@ try { this.m_129498_(ConnectionProtocol.HANDSHAKING); -@@ -186,7 +_,7 @@ - ++this.f_129475_; - if (connectionprotocol1 != connectionprotocol) { +@@ -193,7 +_,7 @@ + } + f_129465_.debug("Disabled auto read"); - this.f_129468_.config().setAutoRead(false); + this.f_129468_.eventLoop().execute(()->this.f_129468_.config().setAutoRead(false)); } if (this.f_129468_.eventLoop().inEventLoop()) { -@@ -292,7 +_,9 @@ +@@ -299,7 +_,9 @@ } public static Connection m_178300_(InetSocketAddress p_178301_, boolean p_178302_) { @@ -35,15 +35,15 @@ Class oclass; LazyLoadedValue lazyloadedvalue; if (Epoll.isAvailable() && p_178302_) { -@@ -318,6 +_,7 @@ +@@ -332,6 +_,7 @@ public static Connection m_129493_(SocketAddress p_129494_) { final Connection connection = new Connection(PacketFlow.CLIENTBOUND); + connection.activationHandler = net.minecraftforge.network.NetworkHooks::registerClientLoginChannel; (new Bootstrap()).group(f_129464_.m_13971_()).handler(new ChannelInitializer() { protected void initChannel(Channel p_129557_) { - p_129557_.pipeline().addLast("packet_handler", connection); -@@ -404,6 +_,14 @@ + ChannelPipeline channelpipeline = p_129557_.pipeline(); +@@ -419,6 +_,14 @@ public float m_129543_() { return this.f_129477_; diff --git a/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch b/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch index f0f9b37553..466a838bad 100644 --- a/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch +++ b/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/network/FriendlyByteBuf.java +++ b/net/minecraft/network/FriendlyByteBuf.java -@@ -71,7 +_,7 @@ - import net.minecraft.world.phys.BlockHitResult; - import net.minecraft.world.phys.Vec3; +@@ -78,7 +_,7 @@ + import org.joml.Quaternionf; + import org.joml.Vector3f; -public class FriendlyByteBuf extends ByteBuf { +public class FriendlyByteBuf extends ByteBuf implements net.minecraftforge.common.extensions.IForgeFriendlyByteBuf { private static final int f_178335_ = 5; private static final int f_178336_ = 10; public static final int f_178337_ = 2097152; -@@ -578,6 +_,15 @@ +@@ -622,6 +_,15 @@ } public FriendlyByteBuf m_130055_(ItemStack p_130056_) { @@ -25,7 +25,7 @@ if (p_130056_.m_41619_()) { this.writeBoolean(false); } else { -@@ -586,8 +_,8 @@ +@@ -630,8 +_,8 @@ this.m_236818_(BuiltInRegistries.f_257033_, item); this.writeByte(p_130056_.m_41613_()); CompoundTag compoundtag = null; @@ -36,7 +36,7 @@ } this.m_130079_(compoundtag); -@@ -603,7 +_,7 @@ +@@ -647,7 +_,7 @@ Item item = this.m_236816_(BuiltInRegistries.f_257033_); int i = this.readByte(); ItemStack itemstack = new ItemStack(item, i); diff --git a/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch b/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch index b52ad45486..d4b8601c09 100644 --- a/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch +++ b/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/chat/contents/TranslatableContents.java +++ b/net/minecraft/network/chat/contents/TranslatableContents.java -@@ -92,6 +_,11 @@ +@@ -91,6 +_,11 @@ } } diff --git a/patches/minecraft/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java.patch b/patches/minecraft/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java.patch index 60b59dc6ca..e4f230e60f 100644 --- a/patches/minecraft/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java.patch +++ b/patches/minecraft/net/minecraft/network/protocol/handshake/ClientIntentionPacket.java.patch @@ -7,7 +7,7 @@ + private String fmlVersion = net.minecraftforge.network.NetworkConstants.NETVERSION; public ClientIntentionPacket(String p_134726_, int p_134727_, ConnectionProtocol p_134728_) { - this.f_134720_ = SharedConstants.m_183709_().getProtocolVersion(); + this.f_134720_ = SharedConstants.m_183709_().m_132495_(); @@ -21,14 +_,16 @@ public ClientIntentionPacket(FriendlyByteBuf p_179801_) { diff --git a/patches/minecraft/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java.patch b/patches/minecraft/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java.patch index 6074133519..ad03db7971 100644 --- a/patches/minecraft/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java.patch +++ b/patches/minecraft/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java.patch @@ -1,11 +1,22 @@ --- a/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java +++ b/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java -@@ -22,7 +_,7 @@ +@@ -3,12 +_,18 @@ + import net.minecraft.network.FriendlyByteBuf; + import net.minecraft.network.protocol.Packet; + +-public record ClientboundStatusResponsePacket(ServerStatus f_134886_) implements Packet { ++public record ClientboundStatusResponsePacket(ServerStatus f_134886_, @org.jetbrains.annotations.Nullable String cachedStatus) implements Packet { ++ public ClientboundStatusResponsePacket(ServerStatus f_134886_) { ++ this(f_134886_, null); ++ } ++ + public ClientboundStatusResponsePacket(FriendlyByteBuf p_179834_) { + this(p_179834_.m_271872_(ServerStatus.f_271163_)); } public void m_5779_(FriendlyByteBuf p_134899_) { -- p_134899_.m_130070_(f_134885_.toJson(this.f_134886_)); -+ p_134899_.m_130070_(this.f_134886_.getJson()); //Forge: Let the response cache the JSON ++ if (cachedStatus != null) p_134899_.m_130070_(cachedStatus); ++ else + p_134899_.m_272073_(ServerStatus.f_271163_, this.f_134886_); } - public void m_5797_(ClientStatusPacketListener p_134896_) { diff --git a/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch b/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch index 9810c89a13..5a7a7975f1 100644 --- a/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch +++ b/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch @@ -1,118 +1,14 @@ --- a/net/minecraft/network/protocol/status/ServerStatus.java +++ b/net/minecraft/network/protocol/status/ServerStatus.java -@@ -27,6 +_,17 @@ - @Nullable - private String f_134903_; - private boolean f_242955_; -+ private transient net.minecraftforge.network.ServerStatusPing forgeData; -+ -+ @Nullable -+ public net.minecraftforge.network.ServerStatusPing getForgeData() { -+ return this.forgeData; -+ } -+ -+ public void setForgeData(net.minecraftforge.network.ServerStatusPing data) { -+ this.forgeData = data; -+ invalidateJson(); -+ } +@@ -15,9 +_,9 @@ + import net.minecraft.network.chat.Component; + import net.minecraft.util.ExtraCodecs; - @Nullable - public Component m_134905_() { -@@ -35,6 +_,7 @@ +-public record ServerStatus(Component f_134900_, Optional f_134901_, Optional f_134902_, Optional f_134903_, boolean f_242955_) { ++public record ServerStatus(Component f_134900_, Optional f_134901_, Optional f_134902_, Optional f_134903_, boolean f_242955_, Optional forgeData) { + public static final Codec f_271163_ = RecordCodecBuilder.create((p_273270_) -> { +- return p_273270_.group(ExtraCodecs.f_252442_.optionalFieldOf("description", CommonComponents.f_237098_).forGetter(ServerStatus::f_134900_), ServerStatus.Players.f_271480_.optionalFieldOf("players").forGetter(ServerStatus::f_134901_), ServerStatus.Version.f_271272_.optionalFieldOf("version").forGetter(ServerStatus::f_134902_), ServerStatus.Favicon.f_271281_.optionalFieldOf("favicon").forGetter(ServerStatus::f_134903_), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::f_242955_)).apply(p_273270_, ServerStatus::new); ++ return p_273270_.group(ExtraCodecs.f_252442_.optionalFieldOf("description", CommonComponents.f_237098_).forGetter(ServerStatus::f_134900_), ServerStatus.Players.f_271480_.optionalFieldOf("players").forGetter(ServerStatus::f_134901_), ServerStatus.Version.f_271272_.optionalFieldOf("version").forGetter(ServerStatus::f_134902_), ServerStatus.Favicon.f_271281_.optionalFieldOf("favicon").forGetter(ServerStatus::f_134903_), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::f_242955_), net.minecraftforge.network.ServerStatusPing.CODEC.optionalFieldOf("forgeData").forGetter(ServerStatus::forgeData)).apply(p_273270_, ServerStatus::new); + }); - public void m_134908_(Component p_134909_) { - this.f_134900_ = p_134909_; -+ invalidateJson(); - } - - @Nullable -@@ -44,6 +_,7 @@ - - public void m_134910_(ServerStatus.Players p_134911_) { - this.f_134901_ = p_134911_; -+ invalidateJson(); - } - - @Nullable -@@ -53,10 +_,12 @@ - - public void m_134912_(ServerStatus.Version p_134913_) { - this.f_134902_ = p_134913_; -+ invalidateJson(); - } - - public void m_134906_(String p_134907_) { - this.f_134903_ = p_134907_; -+ invalidateJson(); - } - - @Nullable -@@ -66,12 +_,46 @@ - - public void m_242958_(boolean p_242968_) { - this.f_242955_ = p_242968_; -+ invalidateJson(); - } - - public boolean m_242963_() { - return this.f_242955_; - } - -+ private java.util.concurrent.Semaphore mutex = new java.util.concurrent.Semaphore(1); -+ private String json = null; -+ /** -+ * Returns this object as a Json string. -+ * Converting to JSON if a cached version is not available. -+ * -+ * Also to prevent potentially large memory allocations on the server -+ * this is moved from the SPacketServerInfo writePacket function -+ * -+ * As this method is called from the impl threads so thread safety is important! -+ */ -+ public String getJson() { -+ String ret = this.json; -+ if (ret == null) { -+ mutex.acquireUninterruptibly(); -+ ret = this.json; -+ if (ret == null) { -+ ret = net.minecraft.network.protocol.status.ClientboundStatusResponsePacket.f_134885_.toJson(this); -+ this.json = ret; -+ } -+ mutex.release(); -+ } -+ return ret; -+ } -+ -+ /** -+ * Invalidates the cached json, causing the next call to getJson to rebuild it. -+ * This is needed externally because PlayerCountData.setPlayer's is public. -+ */ -+ public void invalidateJson() { -+ this.json = null; -+ } -+ - public static class Players { - private final int f_134917_; - private final int f_134918_; -@@ -170,6 +_,10 @@ - serverstatus.m_242958_(GsonHelper.m_13912_(jsonobject, "enforcesSecureChat")); - } - -+ if (jsonobject.has("forgeData")) { -+ serverstatus.setForgeData(net.minecraftforge.network.ServerStatusPing.Serializer.deserialize(GsonHelper.m_13930_(jsonobject, "forgeData"))); -+ } -+ - return serverstatus; - } - -@@ -190,6 +_,10 @@ - - if (p_134951_.m_134916_() != null) { - jsonobject.addProperty("favicon", p_134951_.m_134916_()); -+ } -+ -+ if (p_134951_.getForgeData() != null) { -+ jsonobject.add("forgeData", net.minecraftforge.network.ServerStatusPing.Serializer.serialize(p_134951_.getForgeData())); - } - - return jsonobject; + public static record Favicon(byte[] f_271462_) { diff --git a/patches/minecraft/net/minecraft/network/syncher/EntityDataSerializers.java.patch b/patches/minecraft/net/minecraft/network/syncher/EntityDataSerializers.java.patch index 8d987e4a42..2d6c628ccb 100644 --- a/patches/minecraft/net/minecraft/network/syncher/EntityDataSerializers.java.patch +++ b/patches/minecraft/net/minecraft/network/syncher/EntityDataSerializers.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/network/syncher/EntityDataSerializers.java +++ b/net/minecraft/network/syncher/EntityDataSerializers.java -@@ -135,16 +_,16 @@ - public static final EntityDataSerializer> f_238116_ = EntityDataSerializer.m_238081_(BuiltInRegistries.f_257051_.m_206115_()); +@@ -142,16 +_,16 @@ + public static final EntityDataSerializer f_268624_ = EntityDataSerializer.m_238095_(FriendlyByteBuf::m_269101_, FriendlyByteBuf::m_269131_); public static void m_135050_(EntityDataSerializer p_135051_) { - f_135046_.m_13569_(p_135051_); diff --git a/patches/minecraft/net/minecraft/resources/HolderSetCodec.java.patch b/patches/minecraft/net/minecraft/resources/HolderSetCodec.java.patch index ea3f13b0d0..18431a8639 100644 --- a/patches/minecraft/net/minecraft/resources/HolderSetCodec.java.patch +++ b/patches/minecraft/net/minecraft/resources/HolderSetCodec.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/resources/HolderSetCodec.java +++ b/net/minecraft/resources/HolderSetCodec.java -@@ -22,6 +_,8 @@ +@@ -21,6 +_,8 @@ private final Codec> f_206656_; private final Codec>> f_206657_; private final Codec, List>>> f_206658_; @@ -8,8 +8,8 @@ + private final Codec, Either, List>>>> combinedCodec; private static Codec>> m_206667_(Codec> p_206668_, boolean p_206669_) { - Function>, DataResult>>> function = ExtraCodecs.m_203984_(Holder::m_203376_); -@@ -44,6 +_,10 @@ + Codec>> codec = ExtraCodecs.m_264370_(p_206668_.listOf(), ExtraCodecs.m_203984_(Holder::m_203376_)); +@@ -42,6 +_,10 @@ this.f_206656_ = p_206661_; this.f_206657_ = m_206667_(p_206661_, p_206662_); this.f_206658_ = Codec.either(TagKey.m_203886_(p_206660_), this.f_206657_); @@ -20,7 +20,7 @@ } public DataResult, T>> decode(DynamicOps p_206696_, T p_206697_) { -@@ -51,9 +_,10 @@ +@@ -49,9 +_,10 @@ Optional> optional = registryops.m_255006_(this.f_206655_); if (optional.isPresent()) { HolderGetter holdergetter = optional.get(); @@ -34,7 +34,7 @@ }); } @@ -70,6 +_,9 @@ - return DataResult.error("HolderSet " + p_206674_ + " is not valid in current registry set"); + }); } + // FORGE: use the dispatch codec to encode custom holdersets, otherwise fall back to vanilla tag/list diff --git a/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch b/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch index 1b1ecb4448..4242e7b376 100644 --- a/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch +++ b/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/resources/RegistryDataLoader.java +++ b/net/minecraft/resources/RegistryDataLoader.java -@@ -119,7 +_,7 @@ +@@ -123,7 +_,7 @@ } private static String m_246502_(ResourceLocation p_252033_) { @@ -9,11 +9,11 @@ } static void m_255048_(RegistryOps.RegistryInfoLookup p_256369_, ResourceManager p_256349_, ResourceKey> p_255792_, WritableRegistry p_256211_, Decoder p_256232_, Map, Exception> p_255884_) { -@@ -136,6 +_,7 @@ - try (Reader reader = resource.m_215508_()) { - JsonElement jsonelement = JsonParser.parseReader(reader); - DataResult dataresult = p_256232_.parse(registryops, jsonelement); +@@ -139,6 +_,7 @@ + try (Reader reader = resource.m_215508_()) { + JsonElement jsonelement = JsonParser.parseReader(reader); + DataResult dataresult = p_256232_.parse(registryops, jsonelement); + if (!net.minecraftforge.common.crafting.conditions.ICondition.shouldRegisterEntry(jsonelement)) continue; - E e = dataresult.getOrThrow(false, (p_248715_) -> { - }); - p_256211_.m_255290_(resourcekey, e, resource.m_247137_() ? Lifecycle.stable() : dataresult.lifecycle()); + E e = dataresult.getOrThrow(false, (p_248715_) -> { + }); + p_256211_.m_255290_(resourcekey, e, resource.m_247137_() ? Lifecycle.stable() : dataresult.lifecycle()); diff --git a/patches/minecraft/net/minecraft/resources/RegistryOps.java.patch b/patches/minecraft/net/minecraft/resources/RegistryOps.java.patch index f287b43809..791739d1e7 100644 --- a/patches/minecraft/net/minecraft/resources/RegistryOps.java.patch +++ b/patches/minecraft/net/minecraft/resources/RegistryOps.java.patch @@ -1,23 +1,23 @@ --- a/net/minecraft/resources/RegistryOps.java +++ b/net/minecraft/resources/RegistryOps.java -@@ -70,6 +_,20 @@ +@@ -74,6 +_,20 @@ }); } + public static com.mojang.serialization.MapCodec> retrieveRegistryLookup(ResourceKey> resourceKey) { + return ExtraCodecs.m_203976_(ops -> { + if (!(ops instanceof RegistryOps registryOps)) -+ return DataResult.error("Not a registry ops"); ++ return DataResult.error(() -> "Not a registry ops"); + + return registryOps.f_254668_.m_254838_(resourceKey).map(registryInfo -> { + if (!(registryInfo.f_254675_() instanceof HolderLookup.RegistryLookup registryLookup)) -+ return DataResult.>error("Found holder getter but was not a registry lookup for " + resourceKey); ++ return DataResult.>error(() -> "Found holder getter but was not a registry lookup for " + resourceKey); + + return DataResult.success(registryLookup, registryInfo.f_254751_()); -+ }).orElseGet(() -> DataResult.error("Unknown registry: " + resourceKey)); ++ }).orElseGet(() -> DataResult.error(() -> "Unknown registry: " + resourceKey)); + }); + } + public static RecordCodecBuilder> m_254866_(ResourceKey p_256347_) { ResourceKey> resourcekey = ResourceKey.m_135788_(p_256347_.m_211136_()); - return ExtraCodecs.m_203976_((p_255521_) -> { + return ExtraCodecs.m_203976_((p_274808_) -> { diff --git a/patches/minecraft/net/minecraft/resources/ResourceLocation.java.patch b/patches/minecraft/net/minecraft/resources/ResourceLocation.java.patch index 5d522fefbe..ae5427f962 100644 --- a/patches/minecraft/net/minecraft/resources/ResourceLocation.java.patch +++ b/patches/minecraft/net/minecraft/resources/ResourceLocation.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/resources/ResourceLocation.java +++ b/net/minecraft/resources/ResourceLocation.java -@@ -137,6 +_,12 @@ +@@ -143,6 +_,12 @@ return i; } diff --git a/patches/minecraft/net/minecraft/server/Main.java.patch b/patches/minecraft/net/minecraft/server/Main.java.patch index 65aaa9c741..fa0b00183d 100644 --- a/patches/minecraft/net/minecraft/server/Main.java.patch +++ b/patches/minecraft/net/minecraft/server/Main.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/server/Main.java +++ b/net/minecraft/server/Main.java -@@ -79,6 +_,15 @@ - OptionSpec optionspec12 = optionparser.accepts("serverId").withRequiredArg(); +@@ -84,6 +_,15 @@ OptionSpec optionspec13 = optionparser.accepts("jfrProfile"); - OptionSpec optionspec14 = optionparser.nonOptions(); + OptionSpec optionspec14 = optionparser.accepts("pidFile").withRequiredArg().withValuesConvertedBy(new PathConverter()); + OptionSpec optionspec15 = optionparser.nonOptions(); + optionparser.accepts("allowUpdates").withRequiredArg().ofType(Boolean.class).defaultsTo(Boolean.TRUE); // Forge: allow mod updates to proceed + optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File(".")); //Forge: Consume this argument, we use it in the launcher, and the client side. + final OptionSpec spawnPosOpt; @@ -16,32 +16,31 @@ try { OptionSet optionset = optionparser.parse(p_129699_); -@@ -86,6 +_,13 @@ +@@ -91,6 +_,13 @@ optionparser.printHelpOn(System.err); return; } -+ Path path1 = Paths.get("eula.txt"); -+ Eula eula = new Eula(path1); ++ Path path2 = Paths.get("eula.txt"); ++ Eula eula = new Eula(path2); + + if (!eula.m_135944_()) { + f_129670_.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); + return; + } - CrashReport.m_127529_(); - if (optionset.has(optionspec13)) { -@@ -95,26 +_,25 @@ - Bootstrap.m_135870_(); + Path path = optionset.valueOf(optionspec14); + if (path != null) { +@@ -106,25 +_,24 @@ Bootstrap.m_135889_(); Util.m_137584_(); + Path path1 = Paths.get("server.properties"); + if (!optionset.has(optionspec1)) net.minecraftforge.server.loading.ServerModLoader.load(); // Load mods before we load almost anything else anymore. Single spot now. Only loads if they haven't passed the initserver param - Path path = Paths.get("server.properties"); - DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(path); + DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(path1); dedicatedserversettings.m_139780_(); -- Path path1 = Paths.get("eula.txt"); -- Eula eula = new Eula(path1); +- Path path2 = Paths.get("eula.txt"); +- Eula eula = new Eula(path2); if (optionset.has(optionspec1)) { - f_129670_.info("Initialized '{}' and '{}'", path.toAbsolutePath(), path1.toAbsolutePath()); + f_129670_.info("Initialized '{}' and '{}'", path1.toAbsolutePath(), path2.toAbsolutePath()); return; } @@ -63,7 +62,7 @@ LevelSummary levelsummary = levelstoragesource$levelstorageaccess.m_78308_(); if (levelsummary != null) { if (levelsummary.m_193020_()) { -@@ -160,6 +_,8 @@ +@@ -170,6 +_,8 @@ worlddimensions = dedicatedserverproperties.m_246483_(p_248079_.f_244104_()); } @@ -72,7 +71,7 @@ WorldDimensions.Complete worlddimensions$complete = worlddimensions.m_245300_(registry); Lifecycle lifecycle = worlddimensions$complete.m_245945_().add(p_248079_.f_244104_().m_211816_()); return new WorldLoader.DataLoadOutput<>(new PrimaryLevelData(levelsettings, worldoptions, worlddimensions$complete.f_244634_(), lifecycle), worlddimensions$complete.m_245593_()); -@@ -180,22 +_,33 @@ +@@ -190,22 +_,33 @@ WorldData worlddata = worldstem.f_206895_(); levelstoragesource$levelstorageaccess.m_78287_(registryaccess$frozen, worlddata); @@ -92,7 +91,7 @@ dedicatedserver1.m_129801_(optionset.valueOf(optionspec11)); dedicatedserver1.m_129975_(optionset.has(optionspec2)); dedicatedserver1.m_129948_(optionset.valueOf(optionspec12)); - boolean flag1 = !optionset.has(optionspec) && !optionset.valuesOf(optionspec14).contains("nogui"); + boolean flag1 = !optionset.has(optionspec) && !optionset.valuesOf(optionspec15).contains("nogui"); - if (flag1 && !GraphicsEnvironment.isHeadless()) { - dedicatedserver1.m_139667_(); + if (dedicatedserver1 instanceof DedicatedServer dedicatedServer && flag1 && !GraphicsEnvironment.isHeadless()) { diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index f1f997d307..afb65df5a7 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -247,7 +_,7 @@ +@@ -248,7 +_,7 @@ public static S m_129872_(Function p_129873_) { AtomicReference atomicreference = new AtomicReference<>(); @@ -9,7 +9,7 @@ atomicreference.get().m_130011_(); }, "Server thread"); thread.setUncaughtExceptionHandler((p_177909_, p_177910_) -> { -@@ -340,6 +_,7 @@ +@@ -341,6 +_,7 @@ this.m_129841_(dimensiondatastorage); this.f_129732_ = new CommandStorage(dimensiondatastorage); WorldBorder worldborder = serverlevel.m_6857_(); @@ -17,7 +17,7 @@ if (!serverleveldata.m_6535_()) { try { m_177896_(serverlevel, serverleveldata, worldoptions.m_245100_(), flag); -@@ -374,6 +_,7 @@ +@@ -375,6 +_,7 @@ ServerLevel serverlevel1 = new ServerLevel(this, this.f_129738_, this.f_129744_, derivedleveldata, resourcekey1, entry.getValue(), p_129816_, flag, j, ImmutableList.of(), false); worldborder.m_61929_(new BorderChangeListener.DelegateBorderChangeListener(serverlevel1.m_6857_())); this.f_129762_.put(resourcekey1, serverlevel1); @@ -25,7 +25,7 @@ } } -@@ -385,6 +_,7 @@ +@@ -386,6 +_,7 @@ p_177898_.m_7250_(BlockPos.f_121853_.m_6630_(80), 0.0F); } else { ServerChunkCache serverchunkcache = p_177897_.m_7726_(); @@ -33,7 +33,7 @@ ChunkPos chunkpos = new ChunkPos(serverchunkcache.m_214994_().m_224579_().m_183230_()); int i = serverchunkcache.m_8481_().m_142051_(p_177897_); if (i < p_177897_.m_141937_()) { -@@ -468,6 +_,7 @@ +@@ -469,6 +_,7 @@ ChunkPos chunkpos = new ChunkPos(i); serverlevel1.m_7726_().m_6692_(chunkpos, true); } @@ -41,7 +41,7 @@ } } -@@ -538,6 +_,8 @@ +@@ -539,6 +_,8 @@ } public void m_7041_() { @@ -50,7 +50,7 @@ if (this.f_177872_.m_142763_()) { this.m_236737_(); } -@@ -582,6 +_,7 @@ +@@ -583,6 +_,7 @@ for(ServerLevel serverlevel2 : this.m_129785_()) { if (serverlevel2 != null) { try { @@ -58,15 +58,19 @@ serverlevel2.close(); } catch (IOException ioexception1) { f_129750_.error("Exception closing the level", (Throwable)ioexception1); -@@ -630,6 +_,7 @@ +@@ -631,9 +_,11 @@ throw new IllegalStateException("Failed to initialize server"); } + net.minecraftforge.server.ServerLifecycleHooks.handleServerStarted(this); this.f_129726_ = Util.m_137550_(); - this.f_129757_.m_134908_(Component.m_237113_(this.f_129709_)); - this.f_129757_.m_134912_(new ServerStatus.Version(SharedConstants.m_183709_().getName(), SharedConstants.m_183709_().getProtocolVersion())); -@@ -663,6 +_,8 @@ + this.f_271173_ = this.m_272273_().orElse((ServerStatus.Favicon)null); + this.f_129757_ = this.m_271988_(); ++ resetStatusCache(f_129757_); + + while(this.f_129764_) { + long i = Util.m_137550_() - this.f_129726_; +@@ -662,6 +_,8 @@ this.f_129717_ = true; JvmProfiler.f_185340_.m_183597_(this.f_129737_); } @@ -75,7 +79,7 @@ } catch (Throwable throwable1) { f_129750_.error("Encountered an unexpected exception", throwable1); CrashReport crashreport = m_206568_(throwable1); -@@ -674,6 +_,7 @@ +@@ -673,6 +_,7 @@ f_129750_.error("We were unable to save this crash report to disk."); } @@ -83,7 +87,7 @@ this.m_7268_(crashreport); } finally { try { -@@ -686,6 +_,7 @@ +@@ -685,6 +_,7 @@ this.f_236721_.f_214336_().m_196559_(); } @@ -91,7 +95,7 @@ this.m_6988_(); } -@@ -799,6 +_,7 @@ +@@ -799,11 +_,13 @@ public void m_5705_(BooleanSupplier p_129871_) { long i = Util.m_137569_(); @@ -99,23 +103,37 @@ ++this.f_129766_; this.m_5703_(p_129871_); if (i - this.f_129724_ >= 5000000000L) { -@@ -820,6 +_,7 @@ - Collections.shuffle(Arrays.asList(agameprofile)); - this.f_129757_.m_134914_().m_134924_(agameprofile); - } -+ this.f_129757_.invalidateJson(); + this.f_129724_ = i; + this.f_129757_ = this.m_271988_(); ++ resetStatusCache(f_129757_); } if (this.f_129766_ % 6000 == 0) { -@@ -836,6 +_,7 @@ - long i1 = Util.m_137569_(); - this.f_129735_.m_13755_(i1 - i); +@@ -820,11 +_,22 @@ + long k = Util.m_137569_(); + this.f_129735_.m_13755_(k - i); this.f_129754_.m_7238_(); + net.minecraftforge.event.ForgeEventFactory.onPostServerTick(p_129871_, this); ++ } ++ ++ private static final com.google.gson.Gson GSON = new com.google.gson.Gson(); ++ private String cachedServerStatus; // FORGE: cache the server status json in case a client spams requests ++ private void resetStatusCache(ServerStatus status) { ++ this.cachedServerStatus = GSON.toJson(ServerStatus.f_271163_.encodeStart(com.mojang.serialization.JsonOps.INSTANCE, status) ++ .result().orElseThrow()); ++ } ++ public String getStatusJson() { ++ return cachedServerStatus; } - public void m_5703_(BooleanSupplier p_129954_) { -@@ -843,7 +_,8 @@ + private ServerStatus m_271988_() { + ServerStatus.Players serverstatus$players = this.m_271961_(); +- return new ServerStatus(Component.m_130674_(this.f_129709_), Optional.of(serverstatus$players), Optional.of(ServerStatus.Version.m_272202_()), Optional.ofNullable(this.f_271173_), this.m_214005_()); ++ return new ServerStatus(Component.m_130674_(this.f_129709_), Optional.of(serverstatus$players), Optional.of(ServerStatus.Version.m_272202_()), Optional.ofNullable(this.f_271173_), this.m_214005_(), Optional.of(new net.minecraftforge.network.ServerStatusPing())); + } + + private ServerStatus.Players m_271961_() { +@@ -852,7 +_,8 @@ this.m_129890_().m_136128_(); this.f_129754_.m_6182_("levels"); @@ -125,7 +143,7 @@ this.f_129754_.m_6521_(() -> { return serverlevel + " " + serverlevel.m_46472_().m_135782_(); }); -@@ -854,6 +_,7 @@ +@@ -863,6 +_,7 @@ } this.f_129754_.m_6180_("tick"); @@ -133,7 +151,7 @@ try { serverlevel.m_8793_(p_129954_); -@@ -862,16 +_,18 @@ +@@ -871,16 +_,18 @@ serverlevel.m_6026_(crashreport); throw new ReportedException(crashreport); } @@ -153,7 +171,7 @@ GameTestTicker.f_177648_.m_127790_(); } -@@ -939,7 +_,7 @@ +@@ -962,7 +_,7 @@ @DontObfuscate public String m_130001_() { @@ -162,7 +180,7 @@ } public SystemReport m_177935_(SystemReport p_177936_) { -@@ -1286,6 +_,7 @@ +@@ -1310,6 +_,7 @@ this.m_6846_().m_11315_(); this.f_129734_.m_136120_(this.f_129740_.f_206585_.m_206860_()); this.f_236720_.m_230370_(this.f_129740_.f_206584_); @@ -170,7 +188,7 @@ }, this); if (this.m_18695_()) { this.m_18701_(completablefuture::isDone); -@@ -1295,10 +_,13 @@ +@@ -1319,10 +_,13 @@ } public static WorldDataConfiguration m_246048_(PackRepository p_248681_, DataPackConfig p_248920_, boolean p_249869_, FeatureFlagSet p_251243_) { @@ -186,7 +204,7 @@ } else { Set set = Sets.newLinkedHashSet(); -@@ -1464,6 +_,31 @@ +@@ -1488,6 +_,31 @@ public abstract boolean m_7779_(GameProfile p_129840_); @@ -218,7 +236,7 @@ public void m_142116_(Path p_177911_) throws IOException { } -@@ -1639,6 +_,10 @@ +@@ -1651,6 +_,10 @@ public WorldData m_129910_() { return this.f_129749_; diff --git a/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch b/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch index 1c017d899b..209564de68 100644 --- a/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch +++ b/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch @@ -1,17 +1,6 @@ --- a/net/minecraft/server/PlayerAdvancements.java +++ b/net/minecraft/server/PlayerAdvancements.java -@@ -164,6 +_,10 @@ - } - - this.m_136002_(p_136007_); -+ -+ if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get()) -+ net.minecraftforge.common.AdvancementLoadFix.loadVisibility(this, this.f_135965_, this.f_135966_, this.f_135964_, this.f_135967_, this::m_136012_); -+ else - this.m_136001_(); - this.m_135994_(p_136007_); - } -@@ -197,6 +_,8 @@ +@@ -167,6 +_,8 @@ } public boolean m_135988_(Advancement p_135989_, String p_135990_) { @@ -20,7 +9,7 @@ boolean flag = false; AdvancementProgress advancementprogress = this.m_135996_(p_135989_); boolean flag1 = advancementprogress.m_8193_(); -@@ -204,11 +_,14 @@ +@@ -174,11 +_,14 @@ this.m_136008_(p_135989_); this.f_135967_.add(p_135989_); flag = true; @@ -35,11 +24,21 @@ } } -@@ -226,6 +_,7 @@ +@@ -197,6 +_,7 @@ this.m_136004_(p_135999_); this.f_135967_.add(p_135999_); flag = true; + net.minecraftforge.event.ForgeEventFactory.onAdvancementProgressedEvent(this.f_135968_, p_135999_, advancementprogress, p_136000_, net.minecraftforge.event.entity.player.AdvancementEvent.AdvancementProgressEvent.ProgressType.REVOKE); } - if (!advancementprogress.m_8206_()) { + if (flag1 && !advancementprogress.m_8193_()) { +@@ -253,6 +_,9 @@ + Set set = new HashSet<>(); + Set set1 = new HashSet<>(); + ++ if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get()) ++ net.minecraftforge.common.AdvancementLoadFix.loadVisibility(this, this.f_135965_, this.f_263821_, this.f_263740_, this.f_135967_, advancement -> AdvancementVisibilityEvaluator.isVisible(advancement, adv -> m_135996_(adv).m_8193_())); ++ else + for(Advancement advancement : this.f_263821_) { + this.m_264265_(advancement, set, set1); + } diff --git a/patches/minecraft/net/minecraft/server/advancements/AdvancementVisibilityEvaluator.java.patch b/patches/minecraft/net/minecraft/server/advancements/AdvancementVisibilityEvaluator.java.patch new file mode 100644 index 0000000000..db82f7700e --- /dev/null +++ b/patches/minecraft/net/minecraft/server/advancements/AdvancementVisibilityEvaluator.java.patch @@ -0,0 +1,18 @@ +--- a/net/minecraft/server/advancements/AdvancementVisibilityEvaluator.java ++++ b/net/minecraft/server/advancements/AdvancementVisibilityEvaluator.java +@@ -62,6 +_,15 @@ + m_264402_(advancement, stack, p_265359_, p_265303_); + } + ++ public static boolean isVisible(Advancement advancement, Predicate test) { ++ Stack stack = new ObjectArrayList<>(); ++ ++ for(int i = 0; i <= 2; ++i) { ++ stack.push(AdvancementVisibilityEvaluator.VisibilityRule.NO_CHANGE); ++ } ++ return m_264402_(advancement.m_264348_(), stack, test, (p_265639_, p_265580_) -> {}); ++ } ++ + @FunctionalInterface + public interface Output { + void m_264135_(Advancement p_265639_, boolean p_265580_); diff --git a/patches/minecraft/net/minecraft/server/commands/SpreadPlayersCommand.java.patch b/patches/minecraft/net/minecraft/server/commands/SpreadPlayersCommand.java.patch index 854f4c8778..aa99815077 100644 --- a/patches/minecraft/net/minecraft/server/commands/SpreadPlayersCommand.java.patch +++ b/patches/minecraft/net/minecraft/server/commands/SpreadPlayersCommand.java.patch @@ -4,7 +4,7 @@ spreadplayerscommand$position = p_138732_[i++]; } -- entity.m_20324_((double)Mth.m_14107_(spreadplayerscommand$position.f_138749_) + 0.5D, (double)spreadplayerscommand$position.m_138758_(p_138731_, p_138733_), (double)Mth.m_14107_(spreadplayerscommand$position.f_138750_) + 0.5D); +- entity.m_264318_(p_138731_, (double)Mth.m_14107_(spreadplayerscommand$position.f_138749_) + 0.5D, (double)spreadplayerscommand$position.m_138758_(p_138731_, p_138733_), (double)Mth.m_14107_(spreadplayerscommand$position.f_138750_) + 0.5D, Set.of(), entity.m_146908_(), entity.m_146909_()); + net.minecraftforge.event.entity.EntityTeleportEvent.SpreadPlayersCommand event = net.minecraftforge.event.ForgeEventFactory.onEntityTeleportSpreadPlayersCommand(entity, (double)Mth.m_14107_(spreadplayerscommand$position.f_138749_) + 0.5D, (double)spreadplayerscommand$position.m_138758_(p_138731_, p_138733_), (double)Mth.m_14107_(spreadplayerscommand$position.f_138750_) + 0.5D); + if (!event.isCanceled()) entity.m_20324_(event.getTargetX(), event.getTargetY(), event.getTargetZ()); double d2 = Double.MAX_VALUE; diff --git a/patches/minecraft/net/minecraft/server/commands/TeleportCommand.java.patch b/patches/minecraft/net/minecraft/server/commands/TeleportCommand.java.patch index 347d7a80b0..fdfd1adcb5 100644 --- a/patches/minecraft/net/minecraft/server/commands/TeleportCommand.java.patch +++ b/patches/minecraft/net/minecraft/server/commands/TeleportCommand.java.patch @@ -1,12 +1,12 @@ --- a/net/minecraft/server/commands/TeleportCommand.java +++ b/net/minecraft/server/commands/TeleportCommand.java -@@ -126,6 +_,9 @@ +@@ -124,6 +_,9 @@ } - private static void m_139014_(CommandSourceStack p_139015_, Entity p_139016_, ServerLevel p_139017_, double p_139018_, double p_139019_, double p_139020_, Set p_139021_, float p_139022_, float p_139023_, @Nullable TeleportCommand.LookAt p_139024_) throws CommandSyntaxException { + private static void m_139014_(CommandSourceStack p_139015_, Entity p_139016_, ServerLevel p_139017_, double p_139018_, double p_139019_, double p_139020_, Set p_139021_, float p_139022_, float p_139023_, @Nullable TeleportCommand.LookAt p_139024_) throws CommandSyntaxException { + net.minecraftforge.event.entity.EntityTeleportEvent.TeleportCommand event = net.minecraftforge.event.ForgeEventFactory.onEntityTeleportCommand(p_139016_, p_139018_, p_139019_, p_139020_); + if (event.isCanceled()) return; + p_139018_ = event.getTargetX(); p_139019_ = event.getTargetY(); p_139020_ = event.getTargetZ(); - BlockPos blockpos = new BlockPos(p_139018_, p_139019_, p_139020_); + BlockPos blockpos = BlockPos.m_274561_(p_139018_, p_139019_, p_139020_); if (!Level.m_46741_(blockpos)) { throw f_139006_.create(); diff --git a/patches/minecraft/net/minecraft/server/level/ChunkMap.java.patch b/patches/minecraft/net/minecraft/server/level/ChunkMap.java.patch index 601483bc80..2fcf85dc76 100644 --- a/patches/minecraft/net/minecraft/server/level/ChunkMap.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ChunkMap.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ChunkMap.java +++ b/net/minecraft/server/level/ChunkMap.java -@@ -395,6 +_,7 @@ +@@ -398,6 +_,7 @@ this.f_140140_ = true; } @@ -8,7 +8,7 @@ return p_140179_; } } -@@ -500,6 +_,7 @@ +@@ -503,6 +_,7 @@ if (this.f_140131_.remove(p_140182_, p_140183_) && p_203002_ != null) { if (p_203002_ instanceof LevelChunk) { ((LevelChunk)p_203002_).m_62913_(false); @@ -16,7 +16,7 @@ } this.m_140258_(p_203002_); -@@ -699,8 +_,14 @@ +@@ -702,8 +_,14 @@ levelchunk.m_62952_(); if (this.f_140132_.add(chunkpos.m_45588_())) { levelchunk.m_62913_(true); @@ -31,7 +31,7 @@ } return levelchunk; -@@ -803,6 +_,7 @@ +@@ -806,6 +_,7 @@ this.f_140133_.m_46473_().m_6174_("chunkSave"); CompoundTag compoundtag = ChunkSerializer.m_63454_(this.f_140133_, p_140259_); @@ -39,7 +39,7 @@ this.m_63502_(chunkpos, compoundtag); this.m_140229_(chunkpos, chunkstatus.m_62494_()); return true; -@@ -873,6 +_,7 @@ +@@ -876,6 +_,7 @@ if (!p_183759_ && p_183758_) { p_183755_.m_9088_(p_183756_); @@ -47,7 +47,7 @@ } } -@@ -1115,7 +_,7 @@ +@@ -1118,7 +_,7 @@ } protected void m_140199_(Entity p_140200_) { @@ -56,7 +56,7 @@ EntityType entitytype = p_140200_.m_6095_(); int i = entitytype.m_20681_() * 16; if (i != 0) { -@@ -1262,6 +_,7 @@ +@@ -1268,6 +_,7 @@ } } diff --git a/patches/minecraft/net/minecraft/server/level/ServerEntity.java.patch b/patches/minecraft/net/minecraft/server/level/ServerEntity.java.patch index a1e6e509b8..3a75958cce 100644 --- a/patches/minecraft/net/minecraft/server/level/ServerEntity.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ServerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerEntity.java +++ b/net/minecraft/server/level/ServerEntity.java -@@ -85,10 +_,9 @@ +@@ -96,10 +_,9 @@ if ($$11 instanceof ItemFrame itemframe) { if (this.f_8521_ % 10 == 0) { ItemStack itemstack = itemframe.m_31822_(); @@ -14,7 +14,7 @@ for(ServerPlayer serverplayer : this.f_8509_.m_6907_()) { mapitemsaveddata.m_77918_(serverplayer, itemstack); Packet packet = mapitemsaveddata.m_164796_(integer, serverplayer); -@@ -97,11 +_,12 @@ +@@ -108,11 +_,12 @@ } } } @@ -28,7 +28,7 @@ if (this.f_8521_ % this.f_8511_ == 0 || this.f_8510_.f_19812_ || this.f_8510_.m_20088_().m_135352_()) { if (this.f_8510_.m_20159_()) { -@@ -194,11 +_,13 @@ +@@ -221,6 +_,7 @@ public void m_8534_(ServerPlayer p_8535_) { this.f_8510_.m_6452_(p_8535_); p_8535_.f_8906_.m_9829_(new ClientboundRemoveEntitiesPacket(this.f_8510_.m_19879_())); @@ -36,9 +36,11 @@ } public void m_8541_(ServerPlayer p_8542_) { - this.m_8536_(p_8542_.f_8906_::m_9829_); +@@ -228,6 +_,7 @@ + this.m_8536_(list::add); + p_8542_.f_8906_.m_9829_(new ClientboundBundlePacket(list)); this.f_8510_.m_6457_(p_8542_); + net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(this.f_8510_, p_8542_); } - public void m_8536_(Consumer> p_8537_) { + public void m_8536_(Consumer> p_8537_) { diff --git a/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch b/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch index 2c627d26f0..edf7273114 100644 --- a/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -187,10 +_,11 @@ +@@ -185,10 +_,11 @@ private final List f_8558_; @Nullable private final EndDragonFight f_8559_; @@ -12,8 +12,8 @@ + private net.minecraftforge.common.util.LevelCapabilityData capabilityData; public ServerLevel(MinecraftServer p_214999_, Executor p_215000_, LevelStorageSource.LevelStorageAccess p_215001_, ServerLevelData p_215002_, ResourceKey p_215003_, LevelStem p_215004_, ChunkProgressListener p_215005_, boolean p_215006_, long p_215007_, List p_215008_, boolean p_215009_) { - super(p_215002_, p_215003_, p_215004_.f_63975_(), p_214999_::m_129905_, false, p_215006_, p_215007_, p_214999_.m_213994_()); -@@ -231,6 +_,7 @@ + super(p_215002_, p_215003_, p_214999_.m_206579_(), p_215004_.f_63975_(), p_214999_::m_129905_, false, p_215006_, p_215007_, p_214999_.m_213994_()); +@@ -229,6 +_,7 @@ this.f_143245_ = new SleepStatus(); this.f_243695_ = new GameEventDispatcher(this); @@ -21,7 +21,7 @@ } public void m_8606_(int p_8607_, int p_8608_, boolean p_8609_, boolean p_8610_) { -@@ -259,8 +_,8 @@ +@@ -257,8 +_,8 @@ int i = this.m_46469_().m_46215_(GameRules.f_151486_); if (this.f_143245_.m_144002_(i) && this.f_143245_.m_144004_(i, this.f_8546_)) { if (this.m_46469_().m_46207_(GameRules.f_46140_)) { @@ -32,7 +32,7 @@ } this.m_8804_(); -@@ -289,7 +_,7 @@ +@@ -287,7 +_,7 @@ this.m_8807_(); this.f_8557_ = false; profilerfiller.m_7238_(); @@ -41,7 +41,7 @@ if (flag) { this.m_8886_(); } -@@ -321,7 +_,9 @@ +@@ -319,7 +_,9 @@ } profilerfiller.m_6180_("tick"); @@ -52,7 +52,7 @@ profilerfiller.m_7238_(); } } -@@ -414,6 +_,7 @@ +@@ -412,6 +_,7 @@ BlockPos blockpos1 = this.m_5452_(Heightmap.Types.MOTION_BLOCKING, this.m_46496_(i, 0, j, 15)); BlockPos blockpos2 = blockpos1.m_7495_(); Biome biome = this.m_204166_(blockpos1).m_203334_(); @@ -60,7 +60,7 @@ if (biome.m_47477_(this, blockpos2)) { this.m_46597_(blockpos2, Blocks.f_50126_.m_49966_()); } -@@ -615,15 +_,19 @@ +@@ -611,15 +_,19 @@ this.f_8548_.m_6846_().m_11270_(new ClientboundGameEventPacket(ClientboundGameEventPacket.f_132161_, this.f_46440_), this.m_46472_()); } @@ -84,7 +84,7 @@ } } -@@ -682,6 +_,7 @@ +@@ -678,6 +_,7 @@ return BuiltInRegistries.f_256780_.m_7981_(p_8664_.m_6095_()).toString(); }); profilerfiller.m_6174_("tickPassenger"); @@ -92,7 +92,7 @@ p_8664_.m_6083_(); profilerfiller.m_7238_(); -@@ -718,6 +_,7 @@ +@@ -714,6 +_,7 @@ this.f_143244_.m_157554_(); } @@ -100,7 +100,7 @@ } } -@@ -810,6 +_,7 @@ +@@ -806,6 +_,7 @@ } private void m_8853_(ServerPlayer p_8854_) { @@ -108,7 +108,7 @@ Entity entity = this.m_142646_().m_142694_(p_8854_.m_20148_()); if (entity != null) { f_8566_.warn("Force-added player with duplicate UUID {}", (Object)p_8854_.m_20148_().toString()); -@@ -817,7 +_,8 @@ +@@ -813,7 +_,8 @@ this.m_143261_((ServerPlayer)entity, Entity.RemovalReason.DISCARDED); } @@ -118,7 +118,7 @@ } private boolean m_8872_(Entity p_8873_) { -@@ -825,7 +_,12 @@ +@@ -821,7 +_,12 @@ f_8566_.warn("Tried to add entity {} but it was marked as removed already", (Object)EntityType.m_20613_(p_8873_.m_6095_())); return false; } else { @@ -132,7 +132,7 @@ } } -@@ -862,10 +_,22 @@ +@@ -858,10 +_,22 @@ } public void m_262808_(@Nullable Player p_263330_, double p_263393_, double p_263369_, double p_263354_, Holder p_263412_, SoundSource p_263338_, float p_263352_, float p_263390_, long p_263403_) { @@ -155,7 +155,7 @@ this.f_8548_.m_6846_().m_11241_(p_263545_, p_263544_.m_20185_(), p_263544_.m_20186_(), p_263544_.m_20189_(), (double)p_263491_.m_203334_().m_215668_(p_263530_), this.m_46472_(), new ClientboundSoundEntityPacket(p_263491_, p_263542_, p_263544_, p_263530_, p_263520_, p_263490_)); } -@@ -887,6 +_,7 @@ +@@ -883,6 +_,7 @@ } public void m_214171_(GameEvent p_215041_, Vec3 p_215042_, GameEvent.Context p_215043_) { @@ -163,7 +163,7 @@ this.f_243695_.m_245905_(p_215041_, p_215042_, p_215043_); } -@@ -923,10 +_,15 @@ +@@ -919,10 +_,15 @@ } public void m_46672_(BlockPos p_215045_, Block p_215046_) { @@ -179,7 +179,7 @@ this.f_220350_.m_214152_(p_215052_, p_215053_, p_215054_); } -@@ -1362,6 +_,12 @@ +@@ -1358,6 +_,12 @@ }); } @@ -192,7 +192,7 @@ public LevelEntityGetter m_142646_() { return this.f_143244_.m_157567_(); } -@@ -1449,8 +_,8 @@ +@@ -1445,8 +_,8 @@ ServerLevel.this.f_143246_.add(mob); } @@ -203,7 +203,7 @@ ServerLevel.this.f_143247_.put(enderdragonpart.m_19879_(), enderdragonpart); } } -@@ -1474,17 +_,25 @@ +@@ -1470,17 +_,25 @@ ServerLevel.this.f_143246_.remove(mob); } diff --git a/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch b/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch index f91e3b8a3e..37d678e719 100644 --- a/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -565,6 +_,7 @@ +@@ -570,6 +_,7 @@ public void m_6667_(DamageSource p_9035_) { this.m_146850_(GameEvent.f_223707_); @@ -8,7 +8,7 @@ boolean flag = this.f_19853_.m_46469_().m_46207_(GameRules.f_46142_); if (flag) { Component component = this.m_21231_().m_19293_(); -@@ -707,11 +_,12 @@ +@@ -716,11 +_,12 @@ } @Nullable @@ -23,7 +23,7 @@ this.m_19877_(); this.m_9236_().m_143261_(this, Entity.RemovalReason.CHANGED_DIMENSION); if (!this.f_8944_) { -@@ -728,13 +_,14 @@ +@@ -737,13 +_,14 @@ PlayerList playerlist = this.f_8924_.m_6846_(); playerlist.m_11289_(this); serverlevel.m_143261_(this, Entity.RemovalReason.CHANGED_DIMENSION); @@ -38,10 +38,10 @@ this.f_8933_ = this.m_20182_(); - } else if (p_9180_.m_46472_() == Level.f_46430_) { + } else if (spawnPortal && p_9180_.m_46472_() == Level.f_46430_) { - this.m_9006_(p_9180_, new BlockPos(portalinfo.f_77676_)); + this.m_9006_(p_9180_, BlockPos.m_274446_(portalinfo.f_77676_)); } -@@ -746,6 +_,9 @@ +@@ -755,6 +_,9 @@ p_9180_.m_8817_(this); serverlevel.m_46473_().m_7238_(); this.m_9209_(serverlevel); @@ -51,7 +51,7 @@ this.f_8906_.m_9829_(new ClientboundPlayerAbilitiesPacket(this.m_150110_())); playerlist.m_11229_(this, p_9180_); playerlist.m_11292_(this); -@@ -754,10 +_,12 @@ +@@ -763,10 +_,12 @@ this.f_8906_.m_9829_(new ClientboundUpdateMobEffectPacket(this.m_19879_(), mobeffectinstance)); } @@ -64,7 +64,7 @@ } return this; -@@ -821,6 +_,9 @@ +@@ -830,6 +_,9 @@ } public Either m_7720_(BlockPos p_9115_) { @@ -74,7 +74,7 @@ Direction direction = this.f_19853_.m_8055_(p_9115_).m_61143_(HorizontalDirectionalBlock.f_54117_); if (!this.m_5803_() && this.m_6084_()) { if (!this.f_19853_.m_6042_().f_63858_()) { -@@ -831,7 +_,7 @@ +@@ -840,7 +_,7 @@ return Either.left(Player.BedSleepingProblem.OBSTRUCTED); } else { this.m_9158_(this.f_19853_.m_46472_(), p_9115_, this.m_146908_(), false, true); @@ -83,7 +83,7 @@ return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW); } else { if (!this.m_7500_()) { -@@ -869,6 +_,7 @@ +@@ -878,6 +_,7 @@ } private boolean m_9116_(BlockPos p_9117_, Direction p_9118_) { @@ -91,7 +91,7 @@ return this.m_9222_(p_9117_) || this.m_9222_(p_9117_.m_121945_(p_9118_.m_122424_())); } -@@ -977,6 +_,7 @@ +@@ -959,6 +_,7 @@ this.f_8906_.m_9829_(new ClientboundOpenScreenPacket(abstractcontainermenu.f_38840_, abstractcontainermenu.m_6772_(), p_9033_.m_5446_())); this.m_143399_(abstractcontainermenu); this.f_36096_ = abstractcontainermenu; @@ -99,7 +99,7 @@ return OptionalInt.of(this.f_8940_); } } -@@ -995,6 +_,7 @@ +@@ -977,6 +_,7 @@ this.f_8906_.m_9829_(new ClientboundHorseScreenOpenPacket(this.f_8940_, p_9060_.m_6643_(), p_9059_.m_19879_())); this.f_36096_ = new HorseInventoryMenu(this.f_8940_, this.m_150109_(), p_9060_, p_9059_); this.m_143399_(this.f_36096_); @@ -107,7 +107,7 @@ } public void m_6986_(ItemStack p_9082_, InteractionHand p_9083_) { -@@ -1020,6 +_,7 @@ +@@ -1002,6 +_,7 @@ public void m_9230_() { this.f_36096_.m_6877_(this); this.f_36095_.m_150414_(this.f_36096_); @@ -115,7 +115,7 @@ this.f_36096_ = this.f_36095_; } -@@ -1149,6 +_,15 @@ +@@ -1131,6 +_,15 @@ this.m_36362_(p_9016_.m_36331_()); this.m_36364_(p_9016_.m_36332_()); this.m_219749_(p_9016_.m_219759_()); @@ -140,7 +140,7 @@ if (!this.f_8941_.m_143473_(p_143404_)) { return false; } else { -@@ -1275,6 +_,7 @@ +@@ -1278,6 +_,7 @@ this.f_184127_ = p_9157_.f_195812_(); this.m_20088_().m_135381_(f_36089_, (byte)p_9157_.f_133867_()); this.m_20088_().m_135381_(f_36090_, (byte)(p_9157_.f_133868_() == HumanoidArm.LEFT ? 0 : 1)); @@ -148,15 +148,15 @@ } public boolean m_143432_() { -@@ -1334,6 +_,7 @@ +@@ -1337,6 +_,7 @@ public void m_9213_(@Nullable Entity p_9214_) { Entity entity = this.m_8954_(); this.f_8926_ = (Entity)(p_9214_ == null ? this : p_9214_); + while (this.f_8926_ instanceof net.minecraftforge.entity.PartEntity partEntity) this.f_8926_ = partEntity.getParent(); // FORGE: fix MC-46486 if (entity != this.f_8926_) { - this.f_8906_.m_9829_(new ClientboundSetCameraPacket(this.f_8926_)); - this.f_8906_.m_9774_(this.f_8926_.m_20185_(), this.f_8926_.m_20186_(), this.f_8926_.m_20189_(), this.m_146908_(), this.m_146909_()); -@@ -1364,7 +_,11 @@ + Level level = this.f_8926_.m_9236_(); + if (level instanceof ServerLevel) { +@@ -1376,7 +_,11 @@ @Nullable public Component m_8957_() { @@ -169,7 +169,7 @@ } public void m_6674_(InteractionHand p_9031_) { -@@ -1389,21 +_,23 @@ +@@ -1401,21 +_,23 @@ this.m_8127_(); if (p_9000_ == this.f_19853_) { this.f_8906_.m_9774_(p_9001_, p_9002_, p_9003_, p_9004_, p_9005_); @@ -195,7 +195,7 @@ } } -@@ -1426,6 +_,7 @@ +@@ -1438,6 +_,7 @@ } public void m_9158_(ResourceKey p_9159_, @Nullable BlockPos p_9160_, float p_9161_, boolean p_9162_, boolean p_9163_) { @@ -203,7 +203,7 @@ if (p_9160_ != null) { boolean flag = p_9160_.equals(this.f_8936_) && p_9159_.equals(this.f_8935_); if (p_9163_ && !flag) { -@@ -1477,6 +_,8 @@ +@@ -1489,6 +_,8 @@ if (itementity == null) { return null; } else { @@ -212,7 +212,7 @@ this.f_19853_.m_7967_(itementity); ItemStack itemstack = itementity.m_32055_(); if (p_9087_) { -@@ -1491,6 +_,76 @@ +@@ -1503,6 +_,76 @@ } } @@ -289,7 +289,7 @@ public TextFilter m_8967_() { return this.f_8939_; } -@@ -1550,11 +_,14 @@ +@@ -1562,11 +_,14 @@ public boolean m_182294_(boolean p_182295_) { Inventory inventory = this.m_150109_(); @@ -297,8 +297,8 @@ + if (selected.m_41619_() || !selected.onDroppedByPlayer(this)) return false; + if (m_6117_() && m_7655_() == InteractionHand.MAIN_HAND && (p_182295_ || selected.m_41613_() == 1)) m_5810_(); // Forge: fix MC-231097 on the serverside ItemStack itemstack = inventory.m_182403_(p_182295_); - this.f_36096_.m_182417_(inventory, inventory.f_35977_).ifPresent((p_182293_) -> { - this.f_36096_.m_150404_(p_182293_, inventory.m_36056_()); + this.f_36096_.m_182417_(inventory, inventory.f_35977_).ifPresent((p_274840_) -> { + this.f_36096_.m_150404_(p_274840_, inventory.m_36056_()); }); - return this.m_7197_(itemstack, false, true) != null; + return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, itemstack, true) != null; diff --git a/patches/minecraft/net/minecraft/server/network/ServerConnectionListener.java.patch b/patches/minecraft/net/minecraft/server/network/ServerConnectionListener.java.patch index 793b891964..7338d6507f 100644 --- a/patches/minecraft/net/minecraft/server/network/ServerConnectionListener.java.patch +++ b/patches/minecraft/net/minecraft/server/network/ServerConnectionListener.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerConnectionListener.java +++ b/net/minecraft/server/network/ServerConnectionListener.java -@@ -50,11 +_,12 @@ +@@ -47,11 +_,12 @@ public class ServerConnectionListener { private static final Logger f_9701_ = LogUtils.getLogger(); @@ -15,7 +15,7 @@ }); final MinecraftServer f_9702_; public volatile boolean f_9700_; -@@ -67,6 +_,8 @@ +@@ -64,6 +_,8 @@ } public void m_9711_(@Nullable InetAddress p_9712_, int p_9713_) throws IOException { @@ -24,12 +24,12 @@ synchronized(this.f_9703_) { Class oclass; LazyLoadedValue lazyloadedvalue; -@@ -87,7 +_,7 @@ +@@ -84,7 +_,7 @@ } catch (ChannelException channelexception) { } -- p_9729_.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyQueryHandler(ServerConnectionListener.this)).addLast("splitter", new Varint21FrameDecoder()).addLast("decoder", new PacketDecoder(PacketFlow.SERVERBOUND)).addLast("prepender", new Varint21LengthFieldPrepender()).addLast("encoder", new PacketEncoder(PacketFlow.CLIENTBOUND)); -+ p_9729_.pipeline().addLast("timeout", new ReadTimeoutHandler(READ_TIMEOUT)).addLast("legacy_query", new LegacyQueryHandler(ServerConnectionListener.this)).addLast("splitter", new Varint21FrameDecoder()).addLast("decoder", new PacketDecoder(PacketFlow.SERVERBOUND)).addLast("prepender", new Varint21LengthFieldPrepender()).addLast("encoder", new PacketEncoder(PacketFlow.CLIENTBOUND)); +- ChannelPipeline channelpipeline = p_9729_.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyQueryHandler(ServerConnectionListener.this)); ++ ChannelPipeline channelpipeline = p_9729_.pipeline().addLast("timeout", new ReadTimeoutHandler(READ_TIMEOUT)).addLast("legacy_query", new LegacyQueryHandler(ServerConnectionListener.this)); + Connection.m_264299_(channelpipeline, PacketFlow.SERVERBOUND); int i = ServerConnectionListener.this.f_9702_.m_7032_(); Connection connection = (Connection)(i > 0 ? new RateKickingConnection(i) : new Connection(PacketFlow.SERVERBOUND)); - ServerConnectionListener.this.f_9704_.add(connection); diff --git a/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 742990765d..ef3a139d77 100644 --- a/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -182,6 +_,12 @@ +@@ -184,6 +_,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, TickablePacketListener, ServerGamePacketListener { static final Logger f_9744_ = LogUtils.getLogger(); private static final int f_143608_ = 15000; @@ -13,7 +13,7 @@ public static final double f_215198_ = Mth.m_144952_(6.0D); private static final int f_215199_ = -1; private static final int f_244471_ = 4096; -@@ -426,9 +_,11 @@ +@@ -428,9 +_,11 @@ } entity.m_19890_(d3, d4, d5, f, f1); @@ -25,7 +25,7 @@ this.f_9742_.m_129512_(new ClientboundMoveVehiclePacket(entity)); return; } -@@ -445,7 +_,7 @@ +@@ -447,7 +_,7 @@ } private boolean m_9793_(Entity p_9794_) { @@ -34,7 +34,7 @@ } public void m_7376_(ServerboundAcceptTeleportationPacket p_9835_) { -@@ -1036,7 +_,7 @@ +@@ -1030,7 +_,7 @@ Vec3 vec3 = blockhitresult.m_82450_(); BlockPos blockpos = blockhitresult.m_82425_(); Vec3 vec31 = Vec3.m_82512_(blockpos); @@ -43,7 +43,7 @@ Vec3 vec32 = vec3.m_82546_(vec31); double d0 = 1.0000001D; if (Math.abs(vec32.m_7096_()) < 1.0000001D && Math.abs(vec32.m_7098_()) < 1.0000001D && Math.abs(vec32.m_7094_()) < 1.0000001D) { -@@ -1044,7 +_,7 @@ +@@ -1038,7 +_,7 @@ this.f_9743_.m_9243_(); int i = this.f_9743_.f_19853_.m_151558_(); if (blockpos.m_123342_() < i) { @@ -52,7 +52,7 @@ InteractionResult interactionresult = this.f_9743_.f_8941_.m_7179_(this.f_9743_, serverlevel, itemstack, interactionhand, blockhitresult); if (direction == Direction.UP && !interactionresult.m_19077_() && blockpos.m_123342_() >= i - 1 && m_9790_(this.f_9743_, itemstack)) { Component component = Component.m_237110_("build.tooHigh", i - 1).m_130940_(ChatFormatting.RED); -@@ -1188,10 +_,13 @@ +@@ -1182,10 +_,13 @@ } CompletableFuture completablefuture = this.m_243132_(playerchatmessage.m_245728_()); @@ -68,11 +68,11 @@ this.m_243086_(playerchatmessage1); }, p_248212_); }); -@@ -1434,9 +_,10 @@ - return; +@@ -1435,9 +_,10 @@ } -- if (entity.m_20238_(this.f_9743_.m_146892_()) < f_215198_) { + AABB aabb = entity.m_20191_(); +- if (aabb.m_272282_(this.f_9743_.m_146892_()) < f_215198_) { + if (true) { //Forge: Perform distance checks below since interactions and attacks differ. p_9866_.m_179617_(new ServerboundInteractPacket.Handler() { private void m_143678_(InteractionHand p_143679_, ServerGamePacketListenerImpl.EntityInteraction p_143680_) { @@ -80,7 +80,7 @@ ItemStack itemstack = ServerGamePacketListenerImpl.this.f_9743_.m_21120_(p_143679_); if (itemstack.m_246617_(serverlevel.m_246046_())) { ItemStack itemstack1 = itemstack.m_41777_(); -@@ -1457,6 +_,8 @@ +@@ -1458,6 +_,8 @@ public void m_142143_(InteractionHand p_143682_, Vec3 p_143683_) { this.m_143678_(p_143682_, (p_143686_, p_143687_, p_143688_) -> { @@ -89,7 +89,7 @@ return p_143687_.m_7111_(p_143686_, p_143683_, p_143688_); }); } -@@ -1465,6 +_,8 @@ +@@ -1466,6 +_,8 @@ if (!(entity instanceof ItemEntity) && !(entity instanceof ExperienceOrb) && !(entity instanceof AbstractArrow) && entity != ServerGamePacketListenerImpl.this.f_9743_) { ItemStack itemstack = ServerGamePacketListenerImpl.this.f_9743_.m_21120_(InteractionHand.MAIN_HAND); if (itemstack.m_246617_(serverlevel.m_246046_())) { @@ -98,7 +98,7 @@ ServerGamePacketListenerImpl.this.f_9743_.m_5706_(entity); } } else { -@@ -1669,6 +_,7 @@ +@@ -1670,6 +_,7 @@ } public void m_7423_(ServerboundCustomPayloadPacket p_9860_) { diff --git a/patches/minecraft/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java.patch index 3a64fec787..987e3c0daf 100644 --- a/patches/minecraft/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java.patch +++ b/patches/minecraft/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -@@ -20,6 +_,7 @@ +@@ -21,6 +_,7 @@ } public void m_7322_(ClientIntentionPacket p_9975_) { @@ -8,3 +8,12 @@ switch (p_9975_.m_134735_()) { case LOGIN: this.f_9966_.m_129498_(ConnectionProtocol.LOGIN); +@@ -42,7 +_,7 @@ + ServerStatus serverstatus = this.f_9965_.m_129928_(); + if (this.f_9965_.m_6373_() && serverstatus != null) { + this.f_9966_.m_129498_(ConnectionProtocol.STATUS); +- this.f_9966_.m_129505_(new ServerStatusPacketListenerImpl(serverstatus, this.f_9966_)); ++ this.f_9966_.m_129505_(new ServerStatusPacketListenerImpl(serverstatus, this.f_9966_, this.f_9965_.getStatusJson())); + } else { + this.f_9966_.m_129507_(f_9964_); + } diff --git a/patches/minecraft/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch new file mode 100644 index 0000000000..c3cc5992f0 --- /dev/null +++ b/patches/minecraft/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch @@ -0,0 +1,29 @@ +--- a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java ++++ b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +@@ -12,12 +_,17 @@ + public class ServerStatusPacketListenerImpl implements ServerStatusPacketListener { + private static final Component f_10081_ = Component.m_237115_("multiplayer.status.request_handled"); + private final ServerStatus f_271204_; ++ private final @org.jetbrains.annotations.Nullable String statusCache; // FORGE: cache status JSON + private final Connection f_10083_; + private boolean f_10084_; + + public ServerStatusPacketListenerImpl(ServerStatus p_272864_, Connection p_273586_) { ++ this(p_272864_, p_273586_, null); ++ } ++ public ServerStatusPacketListenerImpl(ServerStatus p_272864_, Connection p_273586_, @org.jetbrains.annotations.Nullable String statusCache) { + this.f_271204_ = p_272864_; + this.f_10083_ = p_273586_; ++ this.statusCache = statusCache; + } + + public void m_7026_(Component p_10091_) { +@@ -32,7 +_,7 @@ + this.f_10083_.m_129507_(f_10081_); + } else { + this.f_10084_ = true; +- this.f_10083_.m_129512_(new ClientboundStatusResponsePacket(this.f_271204_)); ++ this.f_10083_.m_129512_(new ClientboundStatusResponsePacket(this.f_271204_, this.statusCache)); + } + } + diff --git a/patches/minecraft/net/minecraft/server/packs/AbstractPackResources.java.patch b/patches/minecraft/net/minecraft/server/packs/AbstractPackResources.java.patch index a90395f330..0645550e38 100644 --- a/patches/minecraft/net/minecraft/server/packs/AbstractPackResources.java.patch +++ b/patches/minecraft/net/minecraft/server/packs/AbstractPackResources.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/packs/AbstractPackResources.java +++ b/net/minecraft/server/packs/AbstractPackResources.java -@@ -67,4 +_,10 @@ +@@ -64,4 +_,10 @@ public boolean m_246538_() { return this.f_254645_; } diff --git a/patches/minecraft/net/minecraft/server/packs/repository/Pack.java.patch b/patches/minecraft/net/minecraft/server/packs/repository/Pack.java.patch index ea69d81655..612561ee8d 100644 --- a/patches/minecraft/net/minecraft/server/packs/repository/Pack.java.patch +++ b/patches/minecraft/net/minecraft/server/packs/repository/Pack.java.patch @@ -16,17 +16,17 @@ } @Nullable -@@ -68,7 +_,8 @@ - - FeatureFlagsMetadataSection featureflagsmetadatasection = packresources.m_5550_(FeatureFlagsMetadataSection.f_244642_); - FeatureFlagSet featureflagset = featureflagsmetadatasection != null ? featureflagsmetadatasection.f_244197_() : FeatureFlagSet.m_246902_(); -- pack$info = new Pack.Info(packmetadatasection.m_10373_(), packmetadatasection.m_10374_(), featureflagset); -+ // Forge: Allow separate pack formats for server data and client resources and setting isHidden -+ pack$info = new Pack.Info(packmetadatasection.m_10373_(), packmetadatasection.getPackFormat(PackType.SERVER_DATA), packmetadatasection.getPackFormat(PackType.CLIENT_RESOURCES), featureflagset, packresources.isHidden()); - } - - return pack$info; -@@ -127,6 +_,8 @@ +@@ -62,7 +_,8 @@ + } else { + FeatureFlagsMetadataSection featureflagsmetadatasection = packresources.m_5550_(FeatureFlagsMetadataSection.f_244642_); + FeatureFlagSet featureflagset = featureflagsmetadatasection != null ? featureflagsmetadatasection.f_244197_() : FeatureFlagSet.m_246902_(); +- return new Pack.Info(packmetadatasection.m_10373_(), packmetadatasection.m_10374_(), featureflagset); ++ // Forge: Allow separate pack formats for server data and client resources and setting isHidden ++ return new Pack.Info(packmetadatasection.m_10373_(), packmetadatasection.getPackFormat(PackType.SERVER_DATA), packmetadatasection.getPackFormat(PackType.CLIENT_RESOURCES), featureflagset, packresources.isHidden()); + } + } catch (Exception exception) { + f_10399_.warn("Failed to read pack metadata", (Throwable)exception); +@@ -116,6 +_,8 @@ return this.f_10409_; } @@ -35,7 +35,7 @@ public boolean equals(Object p_10448_) { if (this == p_10448_) { return true; -@@ -142,9 +_,17 @@ +@@ -131,9 +_,17 @@ return this.f_10401_.hashCode(); } diff --git a/patches/minecraft/net/minecraft/server/packs/repository/PackRepository.java.patch b/patches/minecraft/net/minecraft/server/packs/repository/PackRepository.java.patch index 6d2cf03a5e..2dc02ac6c3 100644 --- a/patches/minecraft/net/minecraft/server/packs/repository/PackRepository.java.patch +++ b/patches/minecraft/net/minecraft/server/packs/repository/PackRepository.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/packs/repository/PackRepository.java +++ b/net/minecraft/server/packs/repository/PackRepository.java -@@ -22,7 +_,7 @@ +@@ -23,7 +_,7 @@ private List f_10499_ = ImmutableList.of(); public PackRepository(RepositorySource... p_251886_) { @@ -9,7 +9,7 @@ } public void m_10506_() { -@@ -86,6 +_,10 @@ +@@ -111,6 +_,10 @@ @Nullable public Pack m_10507_(String p_10508_) { return this.f_10498_.get(p_10508_); diff --git a/patches/minecraft/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java.patch b/patches/minecraft/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java.patch index aceeb04c34..fe30aef19e 100644 --- a/patches/minecraft/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java.patch +++ b/patches/minecraft/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java +++ b/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java -@@ -48,4 +_,8 @@ +@@ -45,4 +_,8 @@ return map; } diff --git a/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch index 3e288bf5d6..83fea84619 100644 --- a/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch +++ b/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -131,6 +_,7 @@ +@@ -132,6 +_,7 @@ private boolean f_11209_; private static final boolean f_143988_ = false; private int f_11210_; @@ -8,7 +8,7 @@ public PlayerList(MinecraftServer p_203842_, LayeredRegistryAccess p_251844_, PlayerDataStorage p_203844_, int p_203845_) { this.f_11195_ = p_203842_; -@@ -167,6 +_,7 @@ +@@ -168,6 +_,7 @@ LevelData leveldata = serverlevel1.m_6106_(); p_11263_.m_143427_(compoundtag); ServerGamePacketListenerImpl servergamepacketlistenerimpl = new ServerGamePacketListenerImpl(this.f_11195_, p_11262_, p_11263_); @@ -16,7 +16,7 @@ GameRules gamerules = serverlevel1.m_46469_(); boolean flag = gamerules.m_46207_(GameRules.f_46156_); boolean flag1 = gamerules.m_46207_(GameRules.f_46145_); -@@ -176,6 +_,7 @@ +@@ -177,6 +_,7 @@ servergamepacketlistenerimpl.m_9829_(new ClientboundChangeDifficultyPacket(leveldata.m_5472_(), leveldata.m_5474_())); servergamepacketlistenerimpl.m_9829_(new ClientboundPlayerAbilitiesPacket(p_11263_.m_150110_())); servergamepacketlistenerimpl.m_9829_(new ClientboundSetCarriedItemPacket(p_11263_.m_150109_().f_35977_)); @@ -24,7 +24,7 @@ servergamepacketlistenerimpl.m_9829_(new ClientboundUpdateRecipesPacket(this.f_11195_.m_129894_().m_44051_())); servergamepacketlistenerimpl.m_9829_(new ClientboundUpdateTagsPacket(TagNetworkSerialization.m_245799_(this.f_243858_))); this.m_11289_(p_11263_); -@@ -244,6 +_,7 @@ +@@ -249,6 +_,7 @@ } p_11263_.m_143429_(); @@ -32,7 +32,7 @@ } protected void m_11273_(ServerScoreboard p_11274_, ServerPlayer p_11275_) { -@@ -304,6 +_,7 @@ +@@ -309,6 +_,7 @@ compoundtag1 = compoundtag; p_11225_.m_20258_(compoundtag); f_11188_.debug("loading single player"); @@ -40,7 +40,7 @@ } else { compoundtag1 = this.f_11204_.m_78435_(p_11225_); } -@@ -312,6 +_,7 @@ +@@ -317,6 +_,7 @@ } protected void m_6765_(ServerPlayer p_11277_) { @@ -48,7 +48,7 @@ this.f_11204_.m_78433_(p_11277_); ServerStatsCounter serverstatscounter = this.f_11202_.get(p_11277_.m_20148_()); if (serverstatscounter != null) { -@@ -326,6 +_,7 @@ +@@ -331,6 +_,7 @@ } public void m_11286_(ServerPlayer p_11287_) { @@ -56,7 +56,7 @@ ServerLevel serverlevel = p_11287_.m_9236_(); p_11287_.m_36220_(Stats.f_12989_); this.m_6765_(p_11287_); -@@ -467,6 +_,7 @@ +@@ -472,6 +_,7 @@ this.f_11197_.put(serverplayer.m_20148_(), serverplayer); serverplayer.m_143429_(); serverplayer.m_21153_(serverplayer.m_21223_()); @@ -64,7 +64,7 @@ if (flag2) { serverplayer.f_8906_.m_9829_(new ClientboundSoundPacket(SoundEvents.f_12377_, SoundSource.BLOCKS, (double)blockpos.m_123341_(), (double)blockpos.m_123342_(), (double)blockpos.m_123343_(), 1.0F, 1.0F, serverlevel1.m_213780_().m_188505_())); } -@@ -551,6 +_,7 @@ +@@ -556,6 +_,7 @@ } public void m_5749_(GameProfile p_11254_) { @@ -72,7 +72,7 @@ this.f_11200_.m_11381_(new ServerOpListEntry(p_11254_, this.f_11195_.m_7022_(), this.f_11200_.m_11351_(p_11254_))); ServerPlayer serverplayer = this.m_11259_(p_11254_.getId()); if (serverplayer != null) { -@@ -560,6 +_,7 @@ +@@ -565,6 +_,7 @@ } public void m_5750_(GameProfile p_11281_) { @@ -80,7 +80,7 @@ this.f_11200_.m_11393_(p_11281_); ServerPlayer serverplayer = this.m_11259_(p_11281_.getId()); if (serverplayer != null) { -@@ -774,13 +_,6 @@ +@@ -779,13 +_,6 @@ if (serverstatscounter == null) { File file1 = this.f_11195_.m_129843_(LevelResource.f_78175_).toFile(); File file2 = new File(file1, uuid + ".json"); @@ -94,8 +94,11 @@ serverstatscounter = new ServerStatsCounter(this.f_11195_, file2); this.f_11202_.put(uuid, serverstatscounter); -@@ -799,6 +_,8 @@ +@@ -801,8 +_,11 @@ + Path path = this.f_11195_.m_129843_(LevelResource.f_78174_).resolve(uuid + ".json"); + playeradvancements = new PlayerAdvancements(this.f_11195_.m_129933_(), this, this.f_11195_.m_129889_(), path, p_11297_); this.f_11203_.put(uuid, playeradvancements); ++ this.f_11203_.put(uuid, playeradvancements); } + // Forge: don't overwrite active player with a fake one. @@ -103,7 +106,7 @@ playeradvancements.m_135979_(p_11297_); return playeradvancements; } -@@ -828,7 +_,7 @@ +@@ -832,7 +_,7 @@ } public List m_11314_() { @@ -112,7 +115,7 @@ } @Nullable -@@ -845,6 +_,7 @@ +@@ -849,6 +_,7 @@ playeradvancements.m_135981_(this.f_11195_.m_129889_()); } diff --git a/patches/minecraft/net/minecraft/tags/BlockTags.java.patch b/patches/minecraft/net/minecraft/tags/BlockTags.java.patch index f4b1b08277..c023c185b2 100644 --- a/patches/minecraft/net/minecraft/tags/BlockTags.java.patch +++ b/patches/minecraft/net/minecraft/tags/BlockTags.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/tags/BlockTags.java +++ b/net/minecraft/tags/BlockTags.java -@@ -169,4 +_,8 @@ +@@ -172,4 +_,8 @@ private static TagKey m_203846_(String p_203847_) { return TagKey.m_203882_(Registries.f_256747_, new ResourceLocation(p_203847_)); } diff --git a/patches/minecraft/net/minecraft/tags/ItemTags.java.patch b/patches/minecraft/net/minecraft/tags/ItemTags.java.patch index e509d6e076..415b856061 100644 --- a/patches/minecraft/net/minecraft/tags/ItemTags.java.patch +++ b/patches/minecraft/net/minecraft/tags/ItemTags.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/tags/ItemTags.java +++ b/net/minecraft/tags/ItemTags.java -@@ -93,4 +_,8 @@ +@@ -108,4 +_,8 @@ private static TagKey m_203854_(String p_203855_) { return TagKey.m_203882_(Registries.f_256913_, new ResourceLocation(p_203855_)); } diff --git a/patches/minecraft/net/minecraft/tags/TagLoader.java.patch b/patches/minecraft/net/minecraft/tags/TagLoader.java.patch index ddb36da1ab..7cc7a4d7f2 100644 --- a/patches/minecraft/net/minecraft/tags/TagLoader.java.patch +++ b/patches/minecraft/net/minecraft/tags/TagLoader.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/tags/TagLoader.java +++ b/net/minecraft/tags/TagLoader.java -@@ -146,7 +_,7 @@ +@@ -143,7 +_,7 @@ p_203899_.keySet().forEach((p_216008_) -> { m_144523_(p_203899_, multimap, set, p_216008_, (p_215984_, p_215985_) -> { this.m_215978_(lookup, p_215985_).ifLeft((p_215977_) -> { diff --git a/patches/minecraft/net/minecraft/world/damagesource/DamageSource.java.patch b/patches/minecraft/net/minecraft/world/damagesource/DamageSource.java.patch new file mode 100644 index 0000000000..9ea6a8ae08 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/damagesource/DamageSource.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/damagesource/DamageSource.java ++++ b/net/minecraft/world/damagesource/DamageSource.java +@@ -32,7 +_,7 @@ + return this.f_268569_ != this.f_268595_; + } + +- public DamageSource(Holder p_270906_, @Nullable Entity p_270796_, @Nullable Entity p_270459_, @Nullable Vec3 p_270623_) { ++ private DamageSource(Holder p_270906_, @Nullable Entity p_270796_, @Nullable Entity p_270459_, @Nullable Vec3 p_270623_) { + this.f_268495_ = p_270906_; + this.f_268569_ = p_270459_; + this.f_268595_ = p_270796_; diff --git a/patches/minecraft/net/minecraft/world/effect/MobEffect.java.patch b/patches/minecraft/net/minecraft/world/effect/MobEffect.java.patch index 63a0d87255..46e5798b61 100644 --- a/patches/minecraft/net/minecraft/world/effect/MobEffect.java.patch +++ b/patches/minecraft/net/minecraft/world/effect/MobEffect.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/effect/MobEffect.java +++ b/net/minecraft/world/effect/MobEffect.java -@@ -18,7 +_,7 @@ +@@ -17,7 +_,7 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.player.Player; @@ -9,7 +9,7 @@ private final Map f_19446_ = Maps.newHashMap(); private final MobEffectCategory f_19447_; private final int f_19448_; -@@ -44,6 +_,7 @@ +@@ -43,6 +_,7 @@ protected MobEffect(MobEffectCategory p_19451_, int p_19452_) { this.f_19447_ = p_19451_; this.f_19448_ = p_19452_; @@ -17,7 +17,7 @@ } public Optional m_216881_() { -@@ -195,4 +_,29 @@ +@@ -194,4 +_,29 @@ public boolean m_19486_() { return this.f_19447_ == MobEffectCategory.BENEFICIAL; } diff --git a/patches/minecraft/net/minecraft/world/effect/MobEffectInstance.java.patch b/patches/minecraft/net/minecraft/world/effect/MobEffectInstance.java.patch index 68825a6b37..39dd6908d3 100644 --- a/patches/minecraft/net/minecraft/world/effect/MobEffectInstance.java.patch +++ b/patches/minecraft/net/minecraft/world/effect/MobEffectInstance.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/effect/MobEffectInstance.java +++ b/net/minecraft/world/effect/MobEffectInstance.java -@@ -14,7 +_,7 @@ +@@ -15,7 +_,7 @@ import net.minecraft.world.entity.LivingEntity; import org.slf4j.Logger; -public class MobEffectInstance implements Comparable { +public class MobEffectInstance implements Comparable, net.minecraftforge.common.extensions.IForgeMobEffectInstance { private static final Logger f_19501_ = LogUtils.getLogger(); + public static final int f_267388_ = -1; private final MobEffect f_19502_; - int f_19503_; -@@ -73,6 +_,7 @@ +@@ -75,6 +_,7 @@ this.f_19506_ = p_19549_.f_19506_; this.f_19508_ = p_19549_.f_19508_; this.f_19509_ = p_19549_.f_19509_; @@ -17,7 +17,7 @@ } public boolean m_19558_(MobEffectInstance p_19559_) { -@@ -129,7 +_,7 @@ +@@ -140,7 +_,7 @@ } public MobEffect m_19544_() { @@ -26,7 +26,7 @@ } public int m_19557_() { -@@ -230,6 +_,7 @@ +@@ -252,6 +_,7 @@ public CompoundTag m_19555_(CompoundTag p_19556_) { p_19556_.m_128405_("Id", MobEffect.m_19459_(this.m_19544_())); @@ -34,7 +34,7 @@ this.m_19567_(p_19556_); return p_19556_; } -@@ -245,6 +_,7 @@ +@@ -267,6 +_,7 @@ this.f_19510_.m_19555_(compoundtag); p_19568_.m_128365_("HiddenEffect", compoundtag); } @@ -42,7 +42,7 @@ this.f_216885_.ifPresent((p_216903_) -> { MobEffectInstance.FactorData.f_216907_.encodeStart(NbtOps.f_128958_, p_216903_).resultOrPartial(f_19501_::error).ifPresent((p_216906_) -> { -@@ -255,8 +_,9 @@ +@@ -277,8 +_,9 @@ @Nullable public static MobEffectInstance m_19560_(CompoundTag p_19561_) { @@ -53,7 +53,7 @@ return mobeffect == null ? null : m_19545_(mobeffect, p_19561_); } -@@ -286,12 +_,38 @@ +@@ -308,12 +_,38 @@ optional = Optional.empty(); } @@ -63,7 +63,7 @@ public int compareTo(MobEffectInstance p_19566_) { int i = 32147; -- return (this.m_19557_() <= 32147 || p_19566_.m_19557_() <= 32147) && (!this.m_19571_() || !p_19566_.m_19571_()) ? ComparisonChain.start().compare(this.m_19571_(), p_19566_.m_19571_()).compare(this.m_19557_(), p_19566_.m_19557_()).compare(this.m_19544_().m_19484_(), p_19566_.m_19544_().m_19484_()).result() : ComparisonChain.start().compare(this.m_19571_(), p_19566_.m_19571_()).compare(this.m_19544_().m_19484_(), p_19566_.m_19544_().m_19484_()).result(); +- return (this.m_19557_() <= 32147 || p_19566_.m_19557_() <= 32147) && (!this.m_19571_() || !p_19566_.m_19571_()) ? ComparisonChain.start().compareFalseFirst(this.m_19571_(), p_19566_.m_19571_()).compareFalseFirst(this.m_267577_(), p_19566_.m_267577_()).compare(this.m_19557_(), p_19566_.m_19557_()).compare(this.m_19544_().m_19484_(), p_19566_.m_19544_().m_19484_()).result() : ComparisonChain.start().compare(this.m_19571_(), p_19566_.m_19571_()).compare(this.m_19544_().m_19484_(), p_19566_.m_19544_().m_19484_()).result(); + return (this.m_19557_() <= 32147 || p_19566_.m_19557_() <= 32147) && (!this.m_19571_() || !p_19566_.m_19571_()) ? ComparisonChain.start().compare(this.m_19571_(), p_19566_.m_19571_()).compare(this.m_19557_(), p_19566_.m_19557_()).compare(this.m_19544_().getSortOrder(this), p_19566_.m_19544_().getSortOrder(this)).result() : ComparisonChain.start().compare(this.m_19571_(), p_19566_.m_19571_()).compare(this.m_19544_().getSortOrder(this), p_19566_.m_19544_().getSortOrder(this)).result(); + } + diff --git a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch index 24a954a257..79e9e4a958 100644 --- a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -118,7 +_,7 @@ +@@ -120,7 +_,7 @@ import net.minecraft.world.scores.Team; import org.slf4j.Logger; @@ -9,7 +9,7 @@ private static final Logger f_19849_ = LogUtils.getLogger(); public static final String f_146815_ = "id"; public static final String f_146816_ = "Passengers"; -@@ -137,6 +_,7 @@ +@@ -139,6 +_,7 @@ private static final double f_146812_ = 0.0023333333333333335D; public static final String f_146824_ = "UUID"; private static double f_19846_ = 1.0D; @@ -17,7 +17,7 @@ private final EntityType f_19847_; private int f_19848_ = f_19843_.incrementAndGet(); public boolean f_19850_; -@@ -177,14 +_,17 @@ +@@ -179,14 +_,17 @@ public double f_19790_; public double f_19791_; public double f_19792_; @@ -35,7 +35,7 @@ private final Set> f_19801_ = new HashSet<>(); public int f_19802_; protected boolean f_19803_ = true; -@@ -231,6 +_,7 @@ +@@ -233,6 +_,7 @@ private BlockState f_185934_ = null; public Entity(EntityType p_19870_, Level p_19871_) { @@ -43,7 +43,7 @@ this.f_19847_ = p_19870_; this.f_19853_ = p_19871_; this.f_19815_ = p_19870_.m_20680_(); -@@ -248,7 +_,11 @@ +@@ -250,7 +_,11 @@ this.f_19804_.m_135372_(f_146800_, 0); this.m_8097_(); this.m_6034_(0.0D, 0.0D, 0.0D); @@ -56,7 +56,7 @@ } public boolean m_20039_(BlockPos p_20040_, BlockState p_20041_) { -@@ -338,6 +_,7 @@ +@@ -340,6 +_,7 @@ public void m_142687_(Entity.RemovalReason p_146834_) { this.m_142467_(p_146834_); @@ -64,7 +64,7 @@ } public void m_142036_() { -@@ -455,7 +_,7 @@ +@@ -457,7 +_,7 @@ if (this.m_20077_()) { this.m_20093_(); @@ -73,7 +73,7 @@ } this.m_146871_(); -@@ -623,7 +_,7 @@ +@@ -625,7 +_,7 @@ double d1 = vec3.f_82479_; double d2 = vec3.f_82480_; double d3 = vec3.f_82481_; @@ -82,7 +82,7 @@ boolean flag1 = blockstate.m_204336_(BlockTags.f_13082_) || blockstate.m_60713_(Blocks.f_152499_); if (!flag1) { d2 = 0.0D; -@@ -662,25 +_,23 @@ +@@ -664,25 +_,23 @@ this.m_146872_(); float f2 = this.m_6041_(); @@ -122,7 +122,7 @@ } } -@@ -736,10 +_,10 @@ +@@ -738,10 +_,10 @@ int j = Mth.m_14107_(this.f_19825_.f_82480_ - (double)p_216987_); int k = Mth.m_14107_(this.f_19825_.f_82481_); BlockPos blockpos = new BlockPos(i, j, k); @@ -135,14 +135,14 @@ return blockpos1; } } -@@ -812,10 +_,11 @@ +@@ -814,10 +_,11 @@ boolean flag1 = p_20273_.f_82480_ != vec3.f_82480_; boolean flag2 = p_20273_.f_82481_ != vec3.f_82481_; boolean flag3 = this.f_19861_ || flag1 && p_20273_.f_82480_ < 0.0D; -- if (this.f_19793_ > 0.0F && flag3 && (flag || flag2)) { -- Vec3 vec31 = m_198894_(this, new Vec3(p_20273_.f_82479_, (double)this.f_19793_, p_20273_.f_82481_), aabb, this.f_19853_, list); -- Vec3 vec32 = m_198894_(this, new Vec3(0.0D, (double)this.f_19793_, 0.0D), aabb.m_82363_(p_20273_.f_82479_, 0.0D, p_20273_.f_82481_), this.f_19853_, list); -- if (vec32.f_82480_ < (double)this.f_19793_) { +- if (this.m_274421_() > 0.0F && flag3 && (flag || flag2)) { +- Vec3 vec31 = m_198894_(this, new Vec3(p_20273_.f_82479_, (double)this.m_274421_(), p_20273_.f_82481_), aabb, this.f_19853_, list); +- Vec3 vec32 = m_198894_(this, new Vec3(0.0D, (double)this.m_274421_(), 0.0D), aabb.m_82363_(p_20273_.f_82479_, 0.0D, p_20273_.f_82481_), this.f_19853_, list); +- if (vec32.f_82480_ < (double)this.m_274421_()) { + float stepHeight = getStepHeight(); + if (stepHeight > 0.0F && flag3 && (flag || flag2)) { + Vec3 vec31 = m_198894_(this, new Vec3(p_20273_.f_82479_, (double)stepHeight, p_20273_.f_82481_), aabb, this.f_19853_, list); @@ -151,7 +151,7 @@ Vec3 vec33 = m_198894_(this, new Vec3(p_20273_.f_82479_, 0.0D, p_20273_.f_82481_), aabb.m_82383_(vec32), this.f_19853_, list).m_82549_(vec32); if (vec33.m_165925_() > vec31.m_165925_()) { vec31 = vec33; -@@ -943,7 +_,7 @@ +@@ -945,7 +_,7 @@ BlockState blockstate = this.f_19853_.m_8055_(p_20135_.m_7494_()); boolean flag = blockstate.m_204336_(BlockTags.f_144271_); if (flag || !p_20136_.m_60767_().m_76332_()) { @@ -160,7 +160,7 @@ this.m_5496_(soundtype.m_56776_(), soundtype.m_56773_() * 0.15F, soundtype.m_56774_()); } } -@@ -1068,19 +_,22 @@ +@@ -1074,19 +_,22 @@ public void m_5844_() { if (this.m_6069_()) { @@ -188,7 +188,7 @@ } void m_20074_() { -@@ -1109,6 +_,7 @@ +@@ -1115,6 +_,7 @@ private void m_20323_() { this.f_19800_ = this.m_204029_(FluidTags.f_13131_); this.f_19801_.clear(); @@ -196,7 +196,7 @@ double d0 = this.m_20188_() - (double)0.11111111F; Entity entity = this.m_20202_(); if (entity instanceof Boat boat) { -@@ -1121,7 +_,7 @@ +@@ -1127,7 +_,7 @@ FluidState fluidstate = this.f_19853_.m_6425_(blockpos); double d1 = (double)((float)blockpos.m_123342_() + fluidstate.m_76155_(this.f_19853_, blockpos)); if (d1 > d0) { @@ -205,7 +205,7 @@ } } -@@ -1165,7 +_,7 @@ +@@ -1171,7 +_,7 @@ } public boolean m_5843_() { @@ -214,7 +214,7 @@ } protected void m_20076_() { -@@ -1174,19 +_,23 @@ +@@ -1180,19 +_,23 @@ int k = Mth.m_14107_(this.m_20189_()); BlockPos blockpos = new BlockPos(i, j, k); BlockState blockstate = this.f_19853_.m_8055_(blockpos); @@ -240,7 +240,7 @@ } public void m_19920_(float p_19921_, Vec3 p_19922_) { -@@ -1500,6 +_,8 @@ +@@ -1510,6 +_,8 @@ p_20241_.m_128379_("HasVisualFire", this.f_146813_); } @@ -249,7 +249,7 @@ if (!this.f_19841_.isEmpty()) { ListTag listtag = new ListTag(); -@@ -1510,6 +_,10 @@ +@@ -1520,6 +_,10 @@ p_20241_.m_128365_("Tags", listtag); } @@ -260,7 +260,7 @@ this.m_7380_(p_20241_); if (this.m_20160_()) { ListTag listtag1 = new ListTag(); -@@ -1585,6 +_,9 @@ +@@ -1595,6 +_,9 @@ this.m_146915_(p_20259_.m_128471_("Glowing")); this.m_146917_(p_20259_.m_128451_("TicksFrozen")); this.f_146813_ = p_20259_.m_128471_("HasVisualFire"); @@ -270,7 +270,7 @@ if (p_20259_.m_128425_("Tags", 9)) { this.f_19841_.clear(); ListTag listtag3 = p_20259_.m_128437_("Tags", 8); -@@ -1673,6 +_,8 @@ +@@ -1683,6 +_,8 @@ } else { ItemEntity itementity = new ItemEntity(this.f_19853_, this.m_20185_(), this.m_20186_() + (double)p_19986_, this.m_20189_(), p_19985_); itementity.m_32060_(); @@ -279,7 +279,7 @@ this.f_19853_.m_7967_(itementity); return itementity; } -@@ -1709,6 +_,7 @@ +@@ -1719,6 +_,7 @@ public void m_6083_() { this.m_20256_(Vec3.f_82478_); @@ -287,7 +287,7 @@ this.m_8119_(); if (this.m_20159_()) { this.m_20202_().m_7332_(this); -@@ -1755,6 +_,7 @@ +@@ -1767,6 +_,7 @@ } } @@ -295,7 +295,7 @@ if (p_19967_ || this.m_7341_(p_19966_) && p_19966_.m_7310_(this)) { if (this.m_20159_()) { this.m_8127_(); -@@ -1793,6 +_,7 @@ +@@ -1805,6 +_,7 @@ public void m_6038_() { if (this.f_19824_ != null) { Entity entity = this.f_19824_; @@ -303,16 +303,16 @@ this.f_19824_ = null; entity.m_20351_(this); } -@@ -1972,6 +_,8 @@ - return !this.f_19823_.isEmpty(); +@@ -1857,6 +_,8 @@ + return this.f_19823_.isEmpty(); } + /** @deprecated Forge: Use {@link #canBeRiddenUnderFluidType(net.minecraftforge.fluids.FluidType, Entity) rider sensitive version} */ + @Deprecated - public boolean m_6146_() { + protected boolean m_269011_() { return true; } -@@ -2021,7 +_,7 @@ +@@ -2038,7 +_,7 @@ } public boolean m_20143_() { @@ -321,16 +321,16 @@ } public void m_20282_(boolean p_20283_) { -@@ -2127,7 +_,7 @@ +@@ -2144,7 +_,7 @@ this.m_20254_(8); } -- this.m_6469_(DamageSource.f_19306_, 5.0F); -+ this.m_6469_(DamageSource.f_19306_, p_19928_.getDamage()); +- this.m_6469_(this.m_269291_().m_269548_(), 5.0F); ++ this.m_6469_(this.m_269291_().m_269548_(), p_19928_.getDamage()); } public void m_6845_(boolean p_20313_) { -@@ -2223,7 +_,7 @@ +@@ -2240,7 +_,7 @@ } protected Component m_5677_() { @@ -339,7 +339,7 @@ } public boolean m_7306_(Entity p_20356_) { -@@ -2279,14 +_,20 @@ +@@ -2296,14 +_,20 @@ @Nullable public Entity m_5489_(ServerLevel p_20118_) { @@ -361,7 +361,7 @@ this.f_19853_.m_46473_().m_6182_("reloading"); Entity entity = this.m_6095_().m_20615_(p_20118_); if (entity != null) { -@@ -2294,17 +_,19 @@ +@@ -2311,17 +_,19 @@ entity.m_7678_(portalinfo.f_77676_.f_82479_, portalinfo.f_77676_.f_82480_, portalinfo.f_77676_.f_82481_, portalinfo.f_77678_, entity.m_146909_()); entity.m_20256_(portalinfo.f_77677_); p_20118_.m_143334_(entity); @@ -383,7 +383,7 @@ } } else { return null; -@@ -2426,6 +_,7 @@ +@@ -2443,6 +_,7 @@ return this.f_19821_; } @@ -391,7 +391,7 @@ public boolean m_6063_() { return true; } -@@ -2518,8 +_,10 @@ +@@ -2560,8 +_,10 @@ EntityDimensions entitydimensions = this.f_19815_; Pose pose = this.m_20089_(); EntityDimensions entitydimensions1 = this.m_6972_(pose); @@ -403,7 +403,7 @@ this.m_20090_(); boolean flag = (double)entitydimensions1.f_20377_ <= 4.0D && (double)entitydimensions1.f_20378_ <= 4.0D; if (!this.f_19853_.f_46443_ && !this.f_19803_ && !this.f_19794_ && flag && (entitydimensions1.f_20377_ > entitydimensions.f_20377_ || entitydimensions1.f_20378_ > entitydimensions.f_20378_) && !(this instanceof Player)) { -@@ -2527,8 +_,9 @@ +@@ -2569,8 +_,9 @@ double d0 = (double)Math.max(0.0F, entitydimensions1.f_20377_ - entitydimensions.f_20377_) + 1.0E-6D; double d1 = (double)Math.max(0.0F, entitydimensions1.f_20378_ - entitydimensions.f_20378_) + 1.0E-6D; VoxelShape voxelshape = Shapes.m_83064_(AABB.m_165882_(vec3, d0, d1, d0)); @@ -414,7 +414,7 @@ }); } -@@ -2807,9 +_,17 @@ +@@ -2861,9 +_,17 @@ this.f_19859_ = this.m_146908_(); } @@ -433,7 +433,7 @@ } else { AABB aabb = this.m_20191_().m_82406_(0.001D); int i = Mth.m_14107_(aabb.f_82288_); -@@ -2824,25 +_,28 @@ +@@ -2878,25 +_,28 @@ Vec3 vec3 = Vec3.f_82478_; int k1 = 0; BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); @@ -469,7 +469,7 @@ } } } -@@ -2850,27 +_,28 @@ +@@ -2904,27 +_,28 @@ } } @@ -508,7 +508,7 @@ } } -@@ -2883,7 +_,10 @@ +@@ -2937,7 +_,10 @@ return !this.f_19853_.m_151572_(i, k, j, l); } @@ -519,7 +519,7 @@ return this.f_19799_.getDouble(p_204037_); } -@@ -3015,6 +_,7 @@ +@@ -3069,6 +_,7 @@ this.f_146801_.m_142044_(); } @@ -527,7 +527,7 @@ } -@@ -3130,6 +_,103 @@ +@@ -3196,6 +_,103 @@ public boolean m_142265_(Level p_146843_, BlockPos p_146844_) { return true; } diff --git a/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch b/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch index e748486733..050b11ec5a 100644 --- a/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/EntityType.java +++ b/net/minecraft/world/entity/EntityType.java -@@ -300,6 +_,11 @@ +@@ -307,6 +_,11 @@ private final EntityDimensions f_20547_; private final FeatureFlagSet f_244139_; @@ -12,20 +12,35 @@ private static EntityType m_20634_(String p_20635_, EntityType.Builder p_20636_) { return Registry.m_122961_(BuiltInRegistries.f_256780_, p_20635_, p_20636_.m_20712_(p_20635_)); } -@@ -313,6 +_,9 @@ +@@ -320,17 +_,24 @@ } - public EntityType(EntityType.EntityFactory p_251402_, MobCategory p_251431_, boolean p_251439_, boolean p_251973_, boolean p_252007_, boolean p_250908_, ImmutableSet p_250201_, EntityDimensions p_251742_, int p_250479_, int p_249249_, FeatureFlagSet p_250427_) { -+ this(p_251402_, p_251431_, p_251439_, p_251973_, p_252007_, p_250908_, p_250201_, p_251742_, p_250479_, p_249249_, p_250427_, EntityType::defaultVelocitySupplier, EntityType::defaultTrackingRangeSupplier, EntityType::defaultUpdateIntervalSupplier, null); + public EntityType(EntityType.EntityFactory p_273268_, MobCategory p_272918_, boolean p_273417_, boolean p_273389_, boolean p_273556_, boolean p_272654_, ImmutableSet p_273631_, EntityDimensions p_272946_, int p_272895_, int p_273451_, FeatureFlagSet p_273518_) { +- this.f_20535_ = p_273268_; +- this.f_20536_ = p_272918_; +- this.f_20541_ = p_272654_; +- this.f_20538_ = p_273417_; +- this.f_20539_ = p_273389_; +- this.f_20540_ = p_273556_; +- this.f_20537_ = p_273631_; +- this.f_20547_ = p_272946_; +- this.f_20542_ = p_272895_; +- this.f_20543_ = p_273451_; +- this.f_244139_ = p_273518_; ++ this(p_273268_, p_272918_, p_273417_, p_273389_, p_273556_, p_272654_, p_273631_, p_272946_, p_272895_, p_273451_, p_273518_, EntityType::defaultVelocitySupplier, EntityType::defaultTrackingRangeSupplier, EntityType::defaultUpdateIntervalSupplier, null); + } + public EntityType(EntityType.EntityFactory p_251402_, MobCategory p_251431_, boolean p_251439_, boolean p_251973_, boolean p_252007_, boolean p_250908_, ImmutableSet p_250201_, EntityDimensions p_251742_, int p_250479_, int p_249249_, FeatureFlagSet p_250427_, final java.util.function.Predicate> velocityUpdateSupplier, final java.util.function.ToIntFunction> trackingRangeSupplier, final java.util.function.ToIntFunction> updateIntervalSupplier, final java.util.function.BiFunction customClientFactory) { - this.f_20535_ = p_251402_; - this.f_20536_ = p_251431_; - this.f_20541_ = p_250908_; -@@ -324,6 +_,10 @@ - this.f_20542_ = p_250479_; - this.f_20543_ = p_249249_; - this.f_244139_ = p_250427_; ++ this.f_20535_ = p_251402_; ++ this.f_20536_ = p_251431_; ++ this.f_20541_ = p_250908_; ++ this.f_20538_ = p_251439_; ++ this.f_20539_ = p_251973_; ++ this.f_20540_ = p_252007_; ++ this.f_20537_ = p_250201_; ++ this.f_20547_ = p_251742_; ++ this.f_20542_ = p_250479_; ++ this.f_20543_ = p_249249_; ++ this.f_244139_ = p_250427_; + this.velocityUpdateSupplier = velocityUpdateSupplier; + this.trackingRangeSupplier = trackingRangeSupplier; + this.updateIntervalSupplier = updateIntervalSupplier; @@ -33,7 +48,7 @@ } @Nullable -@@ -371,6 +_,7 @@ +@@ -380,6 +_,7 @@ public T m_262455_(ServerLevel p_262704_, @Nullable CompoundTag p_262603_, @Nullable Consumer p_262621_, BlockPos p_262672_, MobSpawnType p_262644_, boolean p_262690_, boolean p_262590_) { T t = this.m_262451_(p_262704_, p_262603_, p_262621_, p_262672_, p_262644_, p_262690_, p_262590_); if (t != null) { @@ -41,7 +56,7 @@ p_262704_.m_47205_(t); } -@@ -591,14 +_,23 @@ +@@ -600,14 +_,23 @@ } public int m_20681_() { @@ -65,7 +80,7 @@ return this != f_20532_ && this != f_20467_ && this != f_20496_ && this != f_20549_ && this != f_20462_ && this != f_147033_ && this != f_20464_ && this != f_20506_ && this != f_20564_ && this != f_20569_; } -@@ -621,6 +_,12 @@ +@@ -630,6 +_,12 @@ return this.f_204038_; } @@ -78,7 +93,7 @@ public static class Builder { private final EntityType.EntityFactory f_20685_; private final MobCategory f_20686_; -@@ -634,6 +_,11 @@ +@@ -643,6 +_,11 @@ private EntityDimensions f_20694_ = EntityDimensions.m_20395_(0.6F, 1.8F); private FeatureFlagSet f_244453_ = FeatureFlags.f_244377_; @@ -90,7 +105,7 @@ private Builder(EntityType.EntityFactory p_20696_, MobCategory p_20697_) { this.f_20685_ = p_20696_; this.f_20686_ = p_20697_; -@@ -695,12 +_,36 @@ +@@ -704,12 +_,36 @@ return this; } diff --git a/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch b/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch index 962626e1fe..f3090e1499 100644 --- a/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch @@ -4,8 +4,8 @@ this.m_6478_(MoverType.SELF, this.m_20184_()); float f = 0.98F; if (this.f_19861_) { -- f = this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.98F; -+ BlockPos pos =new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_()); +- f = this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.98F; ++ BlockPos pos = BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_()); + f = this.f_19853_.m_8055_(pos).getFriction(this.f_19853_, pos, this) * 0.98F; } diff --git a/patches/minecraft/net/minecraft/world/entity/FlyingMob.java.patch b/patches/minecraft/net/minecraft/world/entity/FlyingMob.java.patch index cdc4e7f808..fc4c60a7b5 100644 --- a/patches/minecraft/net/minecraft/world/entity/FlyingMob.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/FlyingMob.java.patch @@ -1,21 +1,21 @@ --- a/net/minecraft/world/entity/FlyingMob.java +++ b/net/minecraft/world/entity/FlyingMob.java -@@ -29,15 +_,16 @@ +@@ -24,15 +_,16 @@ this.m_6478_(MoverType.SELF, this.m_20184_()); this.m_20256_(this.m_20184_().m_82490_(0.5D)); } else { -+ BlockPos ground = new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_()); ++ BlockPos ground = BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_()); float f = 0.91F; if (this.f_19861_) { -- f = this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.91F; -+ f = this.f_19853_.m_8055_(ground).getFriction(this.f_19853_, ground, this) * 0.91F; +- f = this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.91F; ++ f = this.f_19853_.m_8055_(ground).getFriction(this.f_19853_, ground, this) * 0.91F; } float f1 = 0.16277137F / (f * f * f); f = 0.91F; if (this.f_19861_) { -- f = this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.91F; -+ f = this.f_19853_.m_8055_(ground).getFriction(this.f_19853_, ground, this) * 0.91F; +- f = this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.91F; ++ f = this.f_19853_.m_8055_(ground).getFriction(this.f_19853_, ground, this) * 0.91F; } this.m_19920_(this.f_19861_ ? 0.1F * f1 : 0.02F, p_20818_); diff --git a/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch index 071f7fbb2f..68495b84ef 100644 --- a/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -119,12 +_,14 @@ +@@ -117,12 +_,14 @@ import net.minecraft.world.scores.PlayerTeam; import org.slf4j.Logger; --public abstract class LivingEntity extends Entity { +-public abstract class LivingEntity extends Entity implements Attackable { +public abstract class LivingEntity extends Entity implements net.minecraftforge.common.extensions.IForgeLivingEntity { private static final Logger f_201943_ = LogUtils.getLogger(); private static final UUID f_20929_ = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); @@ -16,7 +16,7 @@ public static final int f_147166_ = 2; public static final int f_147167_ = 4; public static final int f_147168_ = 98; -@@ -275,7 +_,7 @@ +@@ -270,7 +_,7 @@ } public static AttributeSupplier.Builder m_21183_() { @@ -25,7 +25,7 @@ } protected void m_7840_(double p_20990_, boolean p_20991_, BlockState p_20992_, BlockPos p_20993_) { -@@ -293,13 +_,15 @@ +@@ -288,13 +_,15 @@ if (!p_20992_.m_60795_()) { double d0 = Math.min((double)(0.2F + f / 15.0F), 2.5D); int i = (int)(150.0D * d0); @@ -42,32 +42,32 @@ public boolean m_6040_() { return this.m_6336_() == MobType.f_21641_; } -@@ -340,8 +_,8 @@ +@@ -335,8 +_,8 @@ } } -- if (this.m_204029_(FluidTags.f_13131_) && !this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20188_(), this.m_20189_())).m_60713_(Blocks.f_50628_)) { +- if (this.m_204029_(FluidTags.f_13131_) && !this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20188_(), this.m_20189_())).m_60713_(Blocks.f_50628_)) { - boolean flag1 = !this.m_6040_() && !MobEffectUtil.m_19588_(this) && (!flag || !((Player)this).m_150110_().f_35934_); -+ if (!this.getEyeInFluidType().isAir() && !this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20188_(), this.m_20189_())).m_60713_(Blocks.f_50628_)) { ++ if (!this.getEyeInFluidType().isAir() && !this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20188_(), this.m_20189_())).m_60713_(Blocks.f_50628_)) { + boolean flag1 = this.canDrownInFluidType(this.getEyeInFluidType()) && !MobEffectUtil.m_19588_(this) && (!flag || !((Player)this).m_150110_().f_35934_); if (flag1) { this.m_20301_(this.m_7302_(this.m_20146_())); if (this.m_20146_() == -20) { -@@ -359,10 +_,11 @@ +@@ -354,10 +_,11 @@ } } -- if (!this.f_19853_.f_46443_ && this.m_20159_() && this.m_20202_() != null && !this.m_20202_().m_6146_()) { +- if (!this.f_19853_.f_46443_ && this.m_20159_() && this.m_20202_() != null && this.m_20202_().m_275843_()) { + if (!this.f_19853_.f_46443_ && this.m_20159_() && this.m_20202_() != null && !this.m_20202_().canBeRiddenUnderFluidType(this.getEyeInFluidType(), this)) { this.m_8127_(); } - } else if (this.m_20146_() < this.m_6062_()) { + } // Forge: Move to if statement since we need to increase the air supply if in bubble column or can't drown -+ if (this.m_20146_() < this.m_6062_() && (!this.canDrownInFluidType(this.getEyeInFluidType()) || this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20188_(), this.m_20189_())).m_60713_(Blocks.f_50628_))) { ++ if (this.m_20146_() < this.m_6062_() && (!this.canDrownInFluidType(this.getEyeInFluidType()) || this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20188_(), this.m_20189_())).m_60713_(Blocks.f_50628_))) { this.m_20301_(this.m_7305_(this.m_20146_())); } -@@ -375,7 +_,7 @@ +@@ -370,7 +_,7 @@ } } @@ -76,7 +76,7 @@ this.m_252836_(); } -@@ -739,7 +_,7 @@ +@@ -732,7 +_,7 @@ if (!mobeffectinstance.m_19552_(this, () -> { this.m_141973_(mobeffectinstance, true, (Entity)null); })) { @@ -85,7 +85,7 @@ iterator.remove(); this.m_7285_(mobeffectinstance); } -@@ -789,8 +_,10 @@ +@@ -782,8 +_,10 @@ this.m_6842_(false); } else { Collection collection = this.f_20945_.values(); @@ -98,7 +98,7 @@ this.m_6842_(this.m_21023_(MobEffects.f_19609_)); } -@@ -826,7 +_,7 @@ +@@ -819,7 +_,7 @@ d0 *= 0.5D; } } @@ -107,7 +107,7 @@ return d0; } -@@ -869,7 +_,9 @@ +@@ -862,7 +_,9 @@ boolean flag; for(flag = false; iterator.hasNext(); flag = true) { @@ -118,7 +118,7 @@ iterator.remove(); } -@@ -903,6 +_,7 @@ +@@ -896,6 +_,7 @@ return false; } else { MobEffectInstance mobeffectinstance = this.f_20945_.get(p_147208_.m_19544_()); @@ -126,7 +126,7 @@ if (mobeffectinstance == null) { this.f_20945_.put(p_147208_.m_19544_(), p_147208_); this.m_142540_(p_147208_, p_147209_); -@@ -917,6 +_,9 @@ +@@ -910,6 +_,9 @@ } public boolean m_7301_(MobEffectInstance p_21197_) { @@ -136,7 +136,7 @@ if (this.m_6336_() == MobType.f_21641_) { MobEffect mobeffect = p_21197_.m_19544_(); if (mobeffect == MobEffects.f_19605_ || mobeffect == MobEffects.f_19614_) { -@@ -949,6 +_,7 @@ +@@ -942,6 +_,7 @@ } public boolean m_21195_(MobEffect p_21196_) { @@ -144,7 +144,7 @@ MobEffectInstance mobeffectinstance = this.m_6234_(p_21196_); if (mobeffectinstance != null) { this.m_7285_(mobeffectinstance); -@@ -985,6 +_,8 @@ +@@ -978,6 +_,8 @@ } public void m_5634_(float p_21116_) { @@ -153,7 +153,7 @@ float f = this.m_21223_(); if (f > 0.0F) { this.m_21153_(f + p_21116_); -@@ -1005,6 +_,7 @@ +@@ -998,6 +_,7 @@ } public boolean m_6469_(DamageSource p_21016_, float p_21017_) { @@ -161,7 +161,7 @@ if (this.m_6673_(p_21016_)) { return false; } else if (this.f_19853_.f_46443_) { -@@ -1023,9 +_,11 @@ +@@ -1016,9 +_,11 @@ boolean flag = false; float f1 = 0.0F; if (p_21017_ > 0.0F && this.m_21275_(p_21016_)) { @@ -173,34 +173,33 @@ + if(ev.shieldTakesDamage()) this.m_7909_(p_21017_); + f1 = ev.getBlockedDamage(); + p_21017_ -= ev.getBlockedDamage(); - if (!p_21016_.m_19360_()) { + if (!p_21016_.m_269533_(DamageTypeTags.f_268524_)) { Entity entity = p_21016_.m_7640_(); if (entity instanceof LivingEntity) { -@@ -1036,6 +_,7 @@ - - flag = true; +@@ -1033,6 +_,7 @@ + if (p_21016_.m_269533_(DamageTypeTags.f_268419_) && this.m_6095_().m_204039_(EntityTypeTags.f_144295_)) { + p_21017_ *= 5.0F; } + } - this.f_20924_ = 1.5F; + this.f_267362_.m_267771_(1.5F); boolean flag1 = true; -@@ -1070,11 +_,11 @@ - if (entity1 instanceof Player) { +@@ -1070,11 +_,10 @@ + Player player1 = (Player)entity1; this.f_20889_ = 100; - this.f_20888_ = (Player)entity1; + this.f_20888_ = player1; - } else if (entity1 instanceof Wolf) { - Wolf wolf = (Wolf)entity1; - if (wolf.m_21824_()) { -+ } else if (entity1 instanceof net.minecraft.world.entity.TamableAnimal) { -+ net.minecraft.world.entity.TamableAnimal tamableEntity = (net.minecraft.world.entity.TamableAnimal)entity1; ++ } else if (entity1 instanceof net.minecraft.world.entity.TamableAnimal tamableEntity) { + if (tamableEntity.m_21824_()) { this.f_20889_ = 100; -- LivingEntity livingentity1 = wolf.m_21826_(); -+ LivingEntity livingentity1 = tamableEntity.m_21826_(); - if (livingentity1 != null && livingentity1.m_6095_() == EntityType.f_20532_) { - this.f_20888_ = (Player)livingentity1; - } else { -@@ -1147,7 +_,7 @@ +- LivingEntity livingentity2 = wolf.m_269323_(); ++ LivingEntity livingentity2 = tamableEntity.m_269323_(); + if (livingentity2 instanceof Player) { + Player player = (Player)livingentity2; + this.f_20888_ = player; +@@ -1133,7 +_,7 @@ if (this instanceof ServerPlayer) { CriteriaTriggers.f_10574_.m_35174_((ServerPlayer)this, p_21016_, f, p_21017_, flag); if (f1 > 0.0F && f1 < 3.4028235E37F) { @@ -209,7 +208,7 @@ } } -@@ -1175,7 +_,7 @@ +@@ -1161,7 +_,7 @@ for(InteractionHand interactionhand : InteractionHand.values()) { ItemStack itemstack1 = this.m_21120_(interactionhand); @@ -218,7 +217,7 @@ itemstack = itemstack1.m_41777_(); itemstack1.m_41774_(1); break; -@@ -1185,7 +_,7 @@ +@@ -1171,7 +_,7 @@ if (itemstack != null) { if (this instanceof ServerPlayer) { ServerPlayer serverplayer = (ServerPlayer)this; @@ -227,7 +226,7 @@ CriteriaTriggers.f_10551_.m_74431_(serverplayer, itemstack); } -@@ -1254,6 +_,7 @@ +@@ -1240,6 +_,7 @@ } public void m_6667_(DamageSource p_21014_) { @@ -235,7 +234,7 @@ if (!this.m_213877_() && !this.f_20890_) { Entity entity = p_21014_.m_7639_(); LivingEntity livingentity = this.m_21232_(); -@@ -1289,10 +_,10 @@ +@@ -1275,10 +_,10 @@ if (!this.f_19853_.f_46443_) { boolean flag = false; if (p_21269_ instanceof WitherBoss) { @@ -248,7 +247,7 @@ this.f_19853_.m_7731_(blockpos, blockstate, 3); flag = true; } -@@ -1309,12 +_,9 @@ +@@ -1295,12 +_,9 @@ protected void m_6668_(DamageSource p_21192_) { Entity entity = p_21192_.m_7639_(); @@ -264,7 +263,7 @@ boolean flag = this.f_20889_ > 0; if (this.m_6125_() && this.f_19853_.m_46469_().m_46207_(GameRules.f_46135_)) { -@@ -1324,6 +_,10 @@ +@@ -1310,6 +_,10 @@ this.m_5907_(); this.m_21226_(); @@ -275,7 +274,7 @@ } protected void m_5907_() { -@@ -1331,7 +_,8 @@ +@@ -1317,7 +_,8 @@ protected void m_21226_() { if (this.f_19853_ instanceof ServerLevel && !this.m_217046_() && (this.m_6124_() || this.f_20889_ > 0 && this.m_6149_() && this.f_19853_.m_46469_().m_46207_(GameRules.f_46135_))) { @@ -285,7 +284,7 @@ } } -@@ -1347,7 +_,8 @@ +@@ -1333,7 +_,8 @@ ResourceLocation resourcelocation = this.m_5743_(); LootTable loottable = this.f_19853_.m_7654_().m_129898_().m_79217_(resourcelocation); LootContext.Builder lootcontext$builder = this.m_7771_(p_21022_, p_21021_); @@ -295,7 +294,7 @@ } protected LootContext.Builder m_7771_(boolean p_21105_, DamageSource p_21106_) { -@@ -1360,6 +_,11 @@ +@@ -1346,6 +_,11 @@ } public void m_147240_(double p_147241_, double p_147242_, double p_147243_) { @@ -307,7 +306,7 @@ p_147241_ *= 1.0D - this.m_21133_(Attributes.f_22278_); if (!(p_147241_ <= 0.0D)) { this.f_19812_ = true; -@@ -1430,15 +_,9 @@ +@@ -1423,15 +_,9 @@ } else { BlockPos blockpos = this.m_20183_(); BlockState blockstate = this.m_146900_(); @@ -326,7 +325,7 @@ } } -@@ -1458,6 +_,11 @@ +@@ -1451,6 +_,11 @@ } public boolean m_142535_(float p_147187_, float p_147188_, DamageSource p_147189_) { @@ -338,7 +337,7 @@ boolean flag = super.m_142535_(p_147187_, p_147188_, p_147189_); int i = this.m_5639_(p_147187_, p_147188_); if (i > 0) { -@@ -1481,9 +_,10 @@ +@@ -1478,9 +_,10 @@ int i = Mth.m_14107_(this.m_20185_()); int j = Mth.m_14107_(this.m_20186_() - (double)0.2F); int k = Mth.m_14107_(this.m_20189_()); @@ -351,7 +350,7 @@ this.m_5496_(soundtype.m_56779_(), soundtype.m_56773_() * 0.5F, soundtype.m_56774_() * 0.75F); } -@@ -1531,9 +_,9 @@ +@@ -1527,9 +_,9 @@ float f2 = f1 - p_21194_; if (f2 > 0.0F && f2 < 3.4028235E37F) { if (this instanceof ServerPlayer) { @@ -363,7 +362,7 @@ } } } -@@ -1555,19 +_,22 @@ +@@ -1551,6 +_,8 @@ protected void m_6475_(DamageSource p_21240_, float p_21241_) { if (!this.m_6673_(p_21240_)) { @@ -371,21 +370,23 @@ + if (p_21241_ <= 0) return; p_21241_ = this.m_21161_(p_21240_, p_21241_); p_21241_ = this.m_6515_(p_21240_, p_21241_); - float f2 = Math.max(p_21241_ - this.m_6103_(), 0.0F); - this.m_7911_(this.m_6103_() - (p_21241_ - f2)); - float f = p_21241_ - f2; - if (f > 0.0F && f < 3.4028235E37F && p_21240_.m_7639_() instanceof ServerPlayer) { -- ((ServerPlayer)p_21240_.m_7639_()).m_36222_(Stats.f_12929_, Math.round(f * 10.0F)); + float f1 = Math.max(p_21241_ - this.m_6103_(), 0.0F); +@@ -1560,14 +_,16 @@ + Entity entity = p_21240_.m_7639_(); + if (entity instanceof ServerPlayer) { + ServerPlayer serverplayer = (ServerPlayer)entity; +- serverplayer.m_36222_(Stats.f_12929_, Math.round(f * 10.0F)); + } + ((ServerPlayer)p_21240_.m_7639_()).m_6278_(Stats.f_12988_.m_12902_(Stats.f_12929_), Math.round(f * 10.0F)); } -+ f2 = net.minecraftforge.common.ForgeHooks.onLivingDamage(this, p_21240_, f2); - if (f2 != 0.0F) { - float f1 = this.m_21223_(); -- this.m_21153_(f1 - f2); - this.m_21231_().m_19289_(p_21240_, f1, f2); ++ f1 = net.minecraftforge.common.ForgeHooks.onLivingDamage(this, p_21240_, f1); + if (f1 != 0.0F) { + float f2 = this.m_21223_(); + this.m_21231_().m_19289_(p_21240_, f2, f1); + this.m_21153_(f2 - f1); + this.m_21153_(f1 - f2); // Forge: moved to fix MC-121048 - this.m_7911_(this.m_6103_() - f2); + this.m_7911_(this.m_6103_() - f1); this.m_146850_(GameEvent.f_223706_); } @@ -1622,6 +_,8 @@ @@ -397,7 +398,7 @@ if (!this.f_20911_ || this.f_20913_ >= this.m_21304_() / 2 || this.f_20913_ < 0) { this.f_20913_ = -1; this.f_20911_ = true; -@@ -1989,14 +_,17 @@ +@@ -1927,14 +_,17 @@ } this.f_19812_ = true; @@ -417,9 +418,9 @@ } protected float m_6108_() { -@@ -2010,14 +_,19 @@ +@@ -1948,14 +_,19 @@ public void m_7023_(Vec3 p_21280_) { - if (this.m_6142_() || this.m_6109_()) { + if (this.m_6109_()) { double d0 = 0.08D; + AttributeInstance gravity = this.m_21051_(net.minecraftforge.common.ForgeMod.ENTITY_GRAVITY.get()); boolean flag = this.m_20184_().f_82480_ <= 0.0D; @@ -439,7 +440,7 @@ double d9 = this.m_20186_(); float f4 = this.m_20142_() ? 0.9F : this.m_6108_(); float f5 = 0.02F; -@@ -2039,6 +_,7 @@ +@@ -1977,6 +_,7 @@ f4 = 0.96F; } @@ -447,7 +448,7 @@ this.m_19920_(f5, p_21280_); this.m_6478_(MoverType.SELF, this.m_20184_()); Vec3 vec36 = this.m_20184_(); -@@ -2052,6 +_,7 @@ +@@ -1990,6 +_,7 @@ if (this.f_19862_ && this.m_20229_(vec32.f_82479_, vec32.f_82480_ + (double)0.6F - this.m_20186_() + d9, vec32.f_82481_)) { this.m_20334_(vec32.f_82479_, (double)0.3F, vec32.f_82481_); } @@ -455,7 +456,7 @@ } else if (this.m_20077_() && this.m_6129_() && !this.m_203441_(fluidstate)) { double d8 = this.m_20186_(); this.m_19920_(0.02F, p_21280_); -@@ -2114,7 +_,7 @@ +@@ -2052,7 +_,7 @@ } } else { BlockPos blockpos = this.m_20099_(); @@ -464,7 +465,7 @@ float f3 = this.f_19861_ ? f2 * 0.91F : 0.91F; Vec3 vec35 = this.m_21074_(p_21280_, f2); double d2 = vec35.f_82480_; -@@ -2190,7 +_,7 @@ +@@ -2149,7 +_,7 @@ double d0 = Mth.m_14008_(p_21298_.f_82479_, (double)-0.15F, (double)0.15F); double d1 = Mth.m_14008_(p_21298_.f_82481_, (double)-0.15F, (double)0.15F); double d2 = Math.max(p_21298_.f_82480_, (double)-0.15F); @@ -473,7 +474,7 @@ d2 = 0.0D; } -@@ -2218,6 +_,7 @@ +@@ -2181,6 +_,7 @@ } public void m_8119_() { @@ -481,7 +482,7 @@ super.m_8119_(); this.m_21329_(); this.m_21333_(); -@@ -2369,6 +_,7 @@ +@@ -2332,6 +_,7 @@ ItemStack itemstack1 = this.m_6844_(equipmentslot); if (this.m_246525_(itemstack, itemstack1)) { @@ -489,7 +490,7 @@ if (map == null) { map = Maps.newEnumMap(EquipmentSlot.class); } -@@ -2523,6 +_,9 @@ +@@ -2477,6 +_,9 @@ this.f_19853_.m_46473_().m_6180_("jump"); if (this.f_20899_ && this.m_6129_()) { double d7; @@ -499,12 +500,12 @@ if (this.m_20077_()) { d7 = this.m_204036_(FluidTags.f_13132_); } else { -@@ -2533,15 +_,17 @@ +@@ -2487,15 +_,17 @@ double d8 = this.m_20204_(); - if (!flag1 || this.f_19861_ && !(d7 > d8)) { + if (!flag || this.f_19861_ && !(d7 > d8)) { if (!this.m_20077_() || this.f_19861_ && !(d7 > d8)) { + if (fluidType.isAir() || this.f_19861_ && !(d7 > d8)) { - if ((this.f_19861_ || flag1 && d7 <= d8) && this.f_20954_ == 0) { + if ((this.f_19861_ || flag && d7 <= d8) && this.f_20954_ == 0) { this.m_6135_(); this.f_20954_ = 10; } @@ -519,7 +520,7 @@ } } else { this.f_20954_ = 0; -@@ -2596,6 +_,8 @@ +@@ -2555,6 +_,8 @@ boolean flag = this.m_20291_(7); if (flag && !this.f_19861_ && !this.m_20159_() && !this.m_21023_(MobEffects.f_19620_)) { ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST); @@ -528,7 +529,7 @@ if (itemstack.m_150930_(Items.f_42741_) && ElytraItem.m_41140_(itemstack)) { flag = true; int i = this.f_20937_ + 1; -@@ -2831,8 +_,16 @@ +@@ -2786,8 +_,16 @@ private void m_21329_() { if (this.m_6117_()) { @@ -547,7 +548,7 @@ this.m_142106_(this.f_20935_); } else { this.m_5810_(); -@@ -2855,7 +_,7 @@ +@@ -2810,7 +_,7 @@ private boolean m_21332_() { int i = this.m_21212_(); @@ -556,7 +557,7 @@ boolean flag = foodproperties != null && foodproperties.m_38748_(); flag |= i <= this.f_20935_.m_41779_() - 7; return flag && i % 4 == 0; -@@ -2885,8 +_,10 @@ +@@ -2840,8 +_,10 @@ public void m_6672_(InteractionHand p_21159_) { ItemStack itemstack = this.m_21120_(p_21159_); if (!itemstack.m_41619_() && !this.m_6117_()) { @@ -568,7 +569,7 @@ if (!this.f_19853_.f_46443_) { this.m_21155_(1, true); this.m_21155_(2, p_21159_ == InteractionHand.OFF_HAND); -@@ -2947,6 +_,9 @@ +@@ -2902,6 +_,9 @@ vec31 = vec31.m_82496_(-this.m_146909_() * ((float)Math.PI / 180F)); vec31 = vec31.m_82524_(-this.m_146908_() * ((float)Math.PI / 180F)); vec31 = vec31.m_82520_(this.m_20185_(), this.m_20188_(), this.m_20189_()); @@ -578,17 +579,17 @@ this.f_19853_.m_7106_(new ItemParticleOption(ParticleTypes.f_123752_, p_21061_), vec31.f_82479_, vec31.f_82480_, vec31.f_82481_, vec3.f_82479_, vec3.f_82480_ + 0.05D, vec3.f_82481_); } -@@ -2960,7 +_,8 @@ +@@ -2915,7 +_,8 @@ } else { if (!this.f_20935_.m_41619_() && this.m_6117_()) { this.m_21137_(this.f_20935_, 16); - ItemStack itemstack = this.f_20935_.m_41671_(this.f_19853_, this); -+ ItemStack copy = this.f_20935_.m_41777_(); -+ ItemStack itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, copy, m_21212_(), this.f_20935_.m_41671_(this.f_19853_, this)); ++ ItemStack copy = this.f_20935_.m_41777_(); ++ ItemStack itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, copy, m_21212_(), this.f_20935_.m_41671_(this.f_19853_, this)); if (itemstack != this.f_20935_) { this.m_21008_(interactionhand, itemstack); } -@@ -2986,7 +_,11 @@ +@@ -2941,7 +_,11 @@ public void m_21253_() { if (!this.f_20935_.m_41619_()) { @@ -600,7 +601,7 @@ if (this.f_20935_.m_41781_()) { this.m_21329_(); } -@@ -2996,6 +_,7 @@ +@@ -2951,6 +_,7 @@ } public void m_5810_() { @@ -608,7 +609,7 @@ if (!this.f_19853_.f_46443_) { boolean flag = this.m_6117_(); this.m_21155_(1, false); -@@ -3011,7 +_,7 @@ +@@ -2966,7 +_,7 @@ public boolean m_21254_() { if (this.m_6117_() && !this.f_20935_.m_41619_()) { Item item = this.f_20935_.m_41720_(); @@ -617,7 +618,7 @@ return false; } else { return item.m_8105_(this.f_20935_) - this.f_20936_ >= 5; -@@ -3133,8 +_,8 @@ +@@ -3092,8 +_,8 @@ } BlockState blockstate = this.f_19853_.m_8055_(p_21141_); @@ -628,12 +629,12 @@ } this.m_20124_(Pose.SLEEPING); -@@ -3150,16 +_,16 @@ +@@ -3109,16 +_,16 @@ private boolean m_21334_() { - return this.m_21257_().map((p_147236_) -> { -- return this.f_19853_.m_8055_(p_147236_).m_60734_() instanceof BedBlock; -+ return net.minecraftforge.event.ForgeEventFactory.fireSleepingLocationCheck(this, p_147236_); + return this.m_21257_().map((p_269792_) -> { +- return this.f_19853_.m_8055_(p_269792_).m_60734_() instanceof BedBlock; ++ return net.minecraftforge.event.ForgeEventFactory.fireSleepingLocationCheck(this, p_269792_); }).orElse(false); } @@ -648,7 +649,7 @@ Vec3 vec31 = BedBlock.m_260958_(this.m_6095_(), this.f_19853_, p_261435_, direction, this.m_146908_()).orElseGet(() -> { BlockPos blockpos = p_261435_.m_7494_(); return new Vec3((double)blockpos.m_123341_() + 0.5D, (double)blockpos.m_123342_() + 0.1D, (double)blockpos.m_123343_() + 0.5D); -@@ -3181,7 +_,9 @@ +@@ -3140,7 +_,9 @@ @Nullable public Direction m_21259_() { BlockPos blockpos = this.m_21257_().orElse((BlockPos)null); @@ -659,7 +660,7 @@ } public boolean m_5830_() { -@@ -3197,7 +_,7 @@ +@@ -3156,7 +_,7 @@ } public ItemStack m_6298_(ItemStack p_21272_) { @@ -668,7 +669,7 @@ } public ItemStack m_5584_(Level p_21067_, ItemStack p_21068_) { -@@ -3217,7 +_,7 @@ +@@ -3176,7 +_,7 @@ private void m_21063_(ItemStack p_21064_, Level p_21065_, LivingEntity p_21066_) { Item item = p_21064_.m_41720_(); if (item.m_41472_()) { @@ -677,7 +678,7 @@ if (!p_21065_.f_46443_ && pair.getFirst() != null && p_21065_.f_46441_.m_188501_() < pair.getSecond()) { p_21066_.m_7292_(new MobEffectInstance(pair.getFirst())); } -@@ -3253,6 +_,64 @@ +@@ -3212,6 +_,64 @@ this.m_21166_(p_21191_ == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); } @@ -742,21 +743,12 @@ public AABB m_6921_() { if (this.m_6844_(EquipmentSlot.HEAD).m_150930_(Items.f_42683_)) { float f = 0.5F; -@@ -3263,6 +_,8 @@ +@@ -3222,6 +_,8 @@ } public static EquipmentSlot m_147233_(ItemStack p_147234_) { + final EquipmentSlot slot = p_147234_.getEquipmentSlot(); + if (slot != null) return slot; // FORGE: Allow modders to set a non-default equipment slot for a stack; e.g. a non-armor chestplate-slot item - Item item = p_147234_.m_41720_(); - if (!p_147234_.m_150930_(Items.f_42047_) && (!(item instanceof BlockItem) || !(((BlockItem)item).m_40614_() instanceof AbstractSkullBlock))) { - if (item instanceof ArmorItem) { -@@ -3270,7 +_,7 @@ - } else if (p_147234_.m_150930_(Items.f_42741_)) { - return EquipmentSlot.CHEST; - } else { -- return p_147234_.m_150930_(Items.f_42740_) ? EquipmentSlot.OFFHAND : EquipmentSlot.MAINHAND; -+ return p_147234_.canPerformAction(net.minecraftforge.common.ToolActions.SHIELD_BLOCK) ? EquipmentSlot.OFFHAND : EquipmentSlot.MAINHAND; - } - } else { - return EquipmentSlot.HEAD; + Equipable equipable = Equipable.m_269088_(p_147234_); + return equipable != null ? equipable.m_40402_() : EquipmentSlot.MAINHAND; + } diff --git a/patches/minecraft/net/minecraft/world/entity/Mob.java.patch b/patches/minecraft/net/minecraft/world/entity/Mob.java.patch index 71b47c8319..efe7e8a70b 100644 --- a/patches/minecraft/net/minecraft/world/entity/Mob.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/Mob.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -210,7 +_,11 @@ +@@ -224,7 +_,11 @@ } public void m_6710_(@Nullable LivingEntity p_21544_) { @@ -13,7 +13,7 @@ } public boolean m_6549_(EntityType p_21399_) { -@@ -499,9 +_,9 @@ +@@ -513,9 +_,9 @@ public void m_8107_() { super.m_8107_(); this.f_19853_.m_46473_().m_6180_("looting"); @@ -24,7 +24,7 @@ for(ItemEntity itementity : this.f_19853_.m_45976_(ItemEntity.class, this.m_20191_().m_82377_((double)vec3i.m_123341_(), (double)vec3i.m_123342_(), (double)vec3i.m_123343_()))) { if (!itementity.m_213877_() && !itementity.m_32055_().m_41619_() && !itementity.m_32063_() && this.m_7243_(itementity.m_32055_())) { this.m_7581_(itementity); -@@ -673,6 +_,14 @@ +@@ -687,6 +_,14 @@ this.m_146870_(); } else if (!this.m_21532_() && !this.m_8023_()) { Entity entity = this.f_19853_.m_45930_(this, -1.0D); @@ -39,7 +39,7 @@ if (entity != null) { double d0 = entity.m_20280_(this); int i = this.m_6095_().m_20674_().m_21611_(); -@@ -1398,13 +_,23 @@ +@@ -1410,13 +_,23 @@ return false; } diff --git a/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch b/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch index 6ff6bc62e3..8b8c8c0573 100644 --- a/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/TamableAnimal.java +++ b/net/minecraft/world/entity/TamableAnimal.java -@@ -196,11 +_,15 @@ +@@ -186,11 +_,15 @@ } public void m_6667_(DamageSource p_21809_) { @@ -9,9 +9,9 @@ + super.m_6667_(p_21809_); + + if (this.f_20890_) - if (!this.f_19853_.f_46443_ && this.f_19853_.m_46469_().m_46207_(GameRules.f_46142_) && this.m_21826_() instanceof ServerPlayer) { -- this.m_21826_().m_213846_(this.m_21231_().m_19293_()); -+ this.m_21826_().m_213846_(deathMessage); + if (!this.f_19853_.f_46443_ && this.f_19853_.m_46469_().m_46207_(GameRules.f_46142_) && this.m_269323_() instanceof ServerPlayer) { +- this.m_269323_().m_213846_(this.m_21231_().m_19293_()); ++ this.m_269323_().m_213846_(deathMessage); } - super.m_6667_(p_21809_); diff --git a/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch b/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch index 42e5039d86..03a92cba9a 100644 --- a/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java +++ b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java -@@ -82,11 +_,12 @@ - private static final Map, AttributeSupplier> f_22294_ = ImmutableMap., AttributeSupplier>builder().put(EntityType.f_217014_, Allay.m_218388_().m_22265_()).put(EntityType.f_20529_, LivingEntity.m_21183_().m_22265_()).put(EntityType.f_147039_, Axolotl.m_149176_().m_22265_()).put(EntityType.f_20549_, Bat.m_27455_().m_22265_()).put(EntityType.f_20550_, Bee.m_27858_().m_22265_()).put(EntityType.f_20551_, Blaze.m_32238_().m_22265_()).put(EntityType.f_20553_, Cat.m_28168_().m_22265_()).put(EntityType.f_243976_, Camel.m_247319_().m_22265_()).put(EntityType.f_20554_, CaveSpider.m_32267_().m_22265_()).put(EntityType.f_20555_, Chicken.m_28263_().m_22265_()).put(EntityType.f_20556_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20557_, Cow.m_28307_().m_22265_()).put(EntityType.f_20558_, Creeper.m_32318_().m_22265_()).put(EntityType.f_20559_, Dolphin.m_28379_().m_22265_()).put(EntityType.f_20560_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20562_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20563_, ElderGuardian.m_32471_().m_22265_()).put(EntityType.f_20566_, EnderMan.m_32541_().m_22265_()).put(EntityType.f_20567_, Endermite.m_32619_().m_22265_()).put(EntityType.f_20565_, EnderDragon.m_31167_().m_22265_()).put(EntityType.f_20568_, Evoker.m_32657_().m_22265_()).put(EntityType.f_20452_, Fox.m_28553_().m_22265_()).put(EntityType.f_217012_, Frog.m_218525_().m_22265_()).put(EntityType.f_20453_, Ghast.m_32752_().m_22265_()).put(EntityType.f_20454_, Giant.m_32796_().m_22265_()).put(EntityType.f_147034_, GlowSquid.m_29988_().m_22265_()).put(EntityType.f_147035_, Goat.m_149401_().m_22265_()).put(EntityType.f_20455_, Guardian.m_32853_().m_22265_()).put(EntityType.f_20456_, Hoglin.m_34551_().m_22265_()).put(EntityType.f_20457_, AbstractHorse.m_30627_().m_22265_()).put(EntityType.f_20458_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20459_, Illusioner.m_32931_().m_22265_()).put(EntityType.f_20460_, IronGolem.m_28883_().m_22265_()).put(EntityType.f_20466_, Llama.m_30824_().m_22265_()).put(EntityType.f_20468_, MagmaCube.m_33000_().m_22265_()).put(EntityType.f_20504_, Cow.m_28307_().m_22265_()).put(EntityType.f_20503_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20505_, Ocelot.m_29036_().m_22265_()).put(EntityType.f_20507_, Panda.m_29157_().m_22265_()).put(EntityType.f_20508_, Parrot.m_29438_().m_22265_()).put(EntityType.f_20509_, Monster.m_33035_().m_22265_()).put(EntityType.f_20510_, Pig.m_29503_().m_22265_()).put(EntityType.f_20511_, Piglin.m_34770_().m_22265_()).put(EntityType.f_20512_, PiglinBrute.m_35075_().m_22265_()).put(EntityType.f_20513_, Pillager.m_33307_().m_22265_()).put(EntityType.f_20532_, Player.m_36340_().m_22265_()).put(EntityType.f_20514_, PolarBear.m_29560_().m_22265_()).put(EntityType.f_20516_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20517_, Rabbit.m_29717_().m_22265_()).put(EntityType.f_20518_, Ravager.m_33371_().m_22265_()).put(EntityType.f_20519_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20520_, Sheep.m_29873_().m_22265_()).put(EntityType.f_20521_, Shulker.m_33477_().m_22265_()).put(EntityType.f_20523_, Silverfish.m_33551_().m_22265_()).put(EntityType.f_20524_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20525_, SkeletonHorse.m_30918_().m_22265_()).put(EntityType.f_20526_, Monster.m_33035_().m_22265_()).put(EntityType.f_20528_, SnowGolem.m_29934_().m_22265_()).put(EntityType.f_20479_, Spider.m_33815_().m_22265_()).put(EntityType.f_20480_, Squid.m_29988_().m_22265_()).put(EntityType.f_20481_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20482_, Strider.m_33937_().m_22265_()).put(EntityType.f_217013_, Tadpole.m_218720_().m_22265_()).put(EntityType.f_20488_, Llama.m_30824_().m_22265_()).put(EntityType.f_20489_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20490_, Turtle.m_30207_().m_22265_()).put(EntityType.f_20491_, Vex.m_34040_().m_22265_()).put(EntityType.f_20492_, Villager.m_35503_().m_22265_()).put(EntityType.f_20493_, Vindicator.m_34104_().m_22265_()).put(EntityType.f_217015_, Warden.m_219463_().m_22265_()).put(EntityType.f_20494_, Mob.m_21552_().m_22265_()).put(EntityType.f_20495_, Witch.m_34155_().m_22265_()).put(EntityType.f_20496_, WitherBoss.m_31501_().m_22265_()).put(EntityType.f_20497_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20499_, Wolf.m_30425_().m_22265_()).put(EntityType.f_20500_, Zoglin.m_34257_().m_22265_()).put(EntityType.f_20501_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20502_, ZombieHorse.m_31008_().m_22265_()).put(EntityType.f_20530_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20531_, ZombifiedPiglin.m_34470_().m_22265_()).build(); +@@ -83,11 +_,12 @@ + private static final Map, AttributeSupplier> f_22294_ = ImmutableMap., AttributeSupplier>builder().put(EntityType.f_217014_, Allay.m_218388_().m_22265_()).put(EntityType.f_20529_, LivingEntity.m_21183_().m_22265_()).put(EntityType.f_147039_, Axolotl.m_149176_().m_22265_()).put(EntityType.f_20549_, Bat.m_27455_().m_22265_()).put(EntityType.f_20550_, Bee.m_27858_().m_22265_()).put(EntityType.f_20551_, Blaze.m_32238_().m_22265_()).put(EntityType.f_20553_, Cat.m_28168_().m_22265_()).put(EntityType.f_243976_, Camel.m_247319_().m_22265_()).put(EntityType.f_20554_, CaveSpider.m_32267_().m_22265_()).put(EntityType.f_20555_, Chicken.m_28263_().m_22265_()).put(EntityType.f_20556_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20557_, Cow.m_28307_().m_22265_()).put(EntityType.f_20558_, Creeper.m_32318_().m_22265_()).put(EntityType.f_20559_, Dolphin.m_28379_().m_22265_()).put(EntityType.f_20560_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20562_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20563_, ElderGuardian.m_32471_().m_22265_()).put(EntityType.f_20566_, EnderMan.m_32541_().m_22265_()).put(EntityType.f_20567_, Endermite.m_32619_().m_22265_()).put(EntityType.f_20565_, EnderDragon.m_31167_().m_22265_()).put(EntityType.f_20568_, Evoker.m_32657_().m_22265_()).put(EntityType.f_20452_, Fox.m_28553_().m_22265_()).put(EntityType.f_217012_, Frog.m_218525_().m_22265_()).put(EntityType.f_20453_, Ghast.m_32752_().m_22265_()).put(EntityType.f_20454_, Giant.m_32796_().m_22265_()).put(EntityType.f_147034_, GlowSquid.m_29988_().m_22265_()).put(EntityType.f_147035_, Goat.m_149401_().m_22265_()).put(EntityType.f_20455_, Guardian.m_32853_().m_22265_()).put(EntityType.f_20456_, Hoglin.m_34551_().m_22265_()).put(EntityType.f_20457_, AbstractHorse.m_30627_().m_22265_()).put(EntityType.f_20458_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20459_, Illusioner.m_32931_().m_22265_()).put(EntityType.f_20460_, IronGolem.m_28883_().m_22265_()).put(EntityType.f_20466_, Llama.m_30824_().m_22265_()).put(EntityType.f_20468_, MagmaCube.m_33000_().m_22265_()).put(EntityType.f_20504_, Cow.m_28307_().m_22265_()).put(EntityType.f_20503_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20505_, Ocelot.m_29036_().m_22265_()).put(EntityType.f_20507_, Panda.m_29157_().m_22265_()).put(EntityType.f_20508_, Parrot.m_29438_().m_22265_()).put(EntityType.f_20509_, Monster.m_33035_().m_22265_()).put(EntityType.f_20510_, Pig.m_29503_().m_22265_()).put(EntityType.f_20511_, Piglin.m_34770_().m_22265_()).put(EntityType.f_20512_, PiglinBrute.m_35075_().m_22265_()).put(EntityType.f_20513_, Pillager.m_33307_().m_22265_()).put(EntityType.f_20532_, Player.m_36340_().m_22265_()).put(EntityType.f_20514_, PolarBear.m_29560_().m_22265_()).put(EntityType.f_20516_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20517_, Rabbit.m_29717_().m_22265_()).put(EntityType.f_20518_, Ravager.m_33371_().m_22265_()).put(EntityType.f_20519_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20520_, Sheep.m_29873_().m_22265_()).put(EntityType.f_20521_, Shulker.m_33477_().m_22265_()).put(EntityType.f_20523_, Silverfish.m_33551_().m_22265_()).put(EntityType.f_20524_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20525_, SkeletonHorse.m_30918_().m_22265_()).put(EntityType.f_20526_, Monster.m_33035_().m_22265_()).put(EntityType.f_271264_, Sniffer.m_271876_().m_22265_()).put(EntityType.f_20528_, SnowGolem.m_29934_().m_22265_()).put(EntityType.f_20479_, Spider.m_33815_().m_22265_()).put(EntityType.f_20480_, Squid.m_29988_().m_22265_()).put(EntityType.f_20481_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20482_, Strider.m_33937_().m_22265_()).put(EntityType.f_217013_, Tadpole.m_218720_().m_22265_()).put(EntityType.f_20488_, Llama.m_30824_().m_22265_()).put(EntityType.f_20489_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20490_, Turtle.m_30207_().m_22265_()).put(EntityType.f_20491_, Vex.m_34040_().m_22265_()).put(EntityType.f_20492_, Villager.m_35503_().m_22265_()).put(EntityType.f_20493_, Vindicator.m_34104_().m_22265_()).put(EntityType.f_217015_, Warden.m_219463_().m_22265_()).put(EntityType.f_20494_, Mob.m_21552_().m_22265_()).put(EntityType.f_20495_, Witch.m_34155_().m_22265_()).put(EntityType.f_20496_, WitherBoss.m_31501_().m_22265_()).put(EntityType.f_20497_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20499_, Wolf.m_30425_().m_22265_()).put(EntityType.f_20500_, Zoglin.m_34257_().m_22265_()).put(EntityType.f_20501_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20502_, ZombieHorse.m_31008_().m_22265_()).put(EntityType.f_20530_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20531_, ZombifiedPiglin.m_34470_().m_22265_()).build(); public static AttributeSupplier m_22297_(EntityType p_22298_) { - return f_22294_.get(p_22298_); diff --git a/patches/minecraft/net/minecraft/world/entity/ai/control/MoveControl.java.patch b/patches/minecraft/net/minecraft/world/entity/ai/control/MoveControl.java.patch index a8c72f7191..cc20556194 100644 --- a/patches/minecraft/net/minecraft/world/entity/ai/control/MoveControl.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ai/control/MoveControl.java.patch @@ -4,7 +4,7 @@ BlockPos blockpos = this.f_24974_.m_20183_(); BlockState blockstate = this.f_24974_.f_19853_.m_8055_(blockpos); VoxelShape voxelshape = blockstate.m_60812_(this.f_24974_.f_19853_, blockpos); -- if (d2 > (double)this.f_24974_.f_19793_ && d0 * d0 + d1 * d1 < (double)Math.max(1.0F, this.f_24974_.m_20205_()) || !voxelshape.m_83281_() && this.f_24974_.m_20186_() < voxelshape.m_83297_(Direction.Axis.Y) + (double)blockpos.m_123342_() && !blockstate.m_204336_(BlockTags.f_13103_) && !blockstate.m_204336_(BlockTags.f_13039_)) { +- if (d2 > (double)this.f_24974_.m_274421_() && d0 * d0 + d1 * d1 < (double)Math.max(1.0F, this.f_24974_.m_20205_()) || !voxelshape.m_83281_() && this.f_24974_.m_20186_() < voxelshape.m_83297_(Direction.Axis.Y) + (double)blockpos.m_123342_() && !blockstate.m_204336_(BlockTags.f_13103_) && !blockstate.m_204336_(BlockTags.f_13039_)) { + if (d2 > (double)this.f_24974_.getStepHeight() && d0 * d0 + d1 * d1 < (double)Math.max(1.0F, this.f_24974_.m_20205_()) || !voxelshape.m_83281_() && this.f_24974_.m_20186_() < voxelshape.m_83297_(Direction.Axis.Y) + (double)blockpos.m_123342_() && !blockstate.m_204336_(BlockTags.f_13103_) && !blockstate.m_204336_(BlockTags.f_13039_)) { this.f_24974_.m_21569_().m_24901_(); this.f_24981_ = MoveControl.Operation.JUMPING; diff --git a/patches/minecraft/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java.patch b/patches/minecraft/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java.patch index 2ba113c4ea..76f975036b 100644 --- a/patches/minecraft/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java.patch @@ -9,7 +9,7 @@ return false; } else if (this.f_25600_ > 0) { --this.f_25600_; -@@ -133,6 +_,7 @@ +@@ -129,6 +_,7 @@ if (chunkaccess == null) { return false; } else { diff --git a/patches/minecraft/net/minecraft/world/entity/ai/navigation/PathNavigation.java.patch b/patches/minecraft/net/minecraft/world/entity/ai/navigation/PathNavigation.java.patch index 88d95f0349..9e61f7ddf8 100644 --- a/patches/minecraft/net/minecraft/world/entity/ai/navigation/PathNavigation.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ai/navigation/PathNavigation.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java -@@ -228,10 +_,10 @@ +@@ -229,10 +_,10 @@ Vec3 vec3 = this.m_7475_(); this.f_26505_ = this.f_26494_.m_20205_() > 0.75F ? this.f_26494_.m_20205_() / 2.0F : 0.75F - this.f_26494_.m_20205_() / 2.0F; Vec3i vec3i = this.f_26496_.m_77400_(); @@ -11,6 +11,6 @@ - boolean flag = d0 < (double)this.f_26505_ && d2 < (double)this.f_26505_ && d1 < 1.0D; + double d2 = Math.abs(this.f_26494_.m_20189_() - ((double)vec3i.m_123343_() + (this.f_26494_.m_20205_() + 1) / 2D)); //Forge: Fix MC-94054 + boolean flag = d0 <= (double)this.f_26505_ && d2 <= (double)this.f_26505_ && d1 < 1.0D; //Forge: Fix MC-94054 - if (flag || this.f_26494_.m_21481_(this.f_26496_.m_77401_().f_77282_) && this.m_26559_(vec3)) { + if (flag || this.m_264193_(this.f_26496_.m_77401_().f_77282_) && this.m_26559_(vec3)) { this.f_26496_.m_77374_(); } diff --git a/patches/minecraft/net/minecraft/world/entity/ai/navigation/WallClimberNavigation.java.patch b/patches/minecraft/net/minecraft/world/entity/ai/navigation/WallClimberNavigation.java.patch index c26f6f14bf..f5e69a692c 100644 --- a/patches/minecraft/net/minecraft/world/entity/ai/navigation/WallClimberNavigation.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ai/navigation/WallClimberNavigation.java.patch @@ -4,9 +4,9 @@ super.m_7638_(); } else { if (this.f_26578_ != null) { -- if (!this.f_26578_.m_203195_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !(new BlockPos((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_())).m_203195_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()))) { +- if (!this.f_26578_.m_203195_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !BlockPos.m_274561_((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_()).m_203195_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()))) { + // FORGE: Fix MC-94054 -+ if (!this.f_26578_.m_203195_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !(new BlockPos((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_())).m_203195_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)))) { ++ if (!this.f_26578_.m_203195_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !(BlockPos.m_274561_((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_())).m_203195_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)))) { this.f_26494_.m_21566_().m_6849_((double)this.f_26578_.m_123341_(), (double)this.f_26578_.m_123342_(), (double)this.f_26578_.m_123343_(), this.f_26497_); } else { this.f_26578_ = null; diff --git a/patches/minecraft/net/minecraft/world/entity/animal/Bee.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/Bee.java.patch index fa0b24c948..d73a32a75b 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/Bee.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/Bee.java.patch @@ -9,7 +9,7 @@ } } -@@ -617,8 +_,18 @@ +@@ -613,8 +_,18 @@ return MobType.f_21642_; } diff --git a/patches/minecraft/net/minecraft/world/entity/animal/Cat.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/Cat.java.patch index e66f2a0192..6955ebed62 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/Cat.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/Cat.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/Cat.java +++ b/net/minecraft/world/entity/animal/Cat.java -@@ -367,8 +_,8 @@ +@@ -365,8 +_,8 @@ if (this.m_21830_(p_28153_)) { if (!(item instanceof DyeItem)) { if (item.m_41472_() && this.m_6898_(itemstack) && this.m_21223_() < this.m_21233_()) { @@ -10,7 +10,7 @@ return InteractionResult.CONSUME; } -@@ -393,7 +_,7 @@ +@@ -391,7 +_,7 @@ } } else if (this.m_6898_(itemstack)) { this.m_142075_(p_28153_, p_28154_, itemstack); diff --git a/patches/minecraft/net/minecraft/world/entity/animal/Fox.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/Fox.java.patch index a13c5abd75..893fc0b355 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/Fox.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/Fox.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/Fox.java +++ b/net/minecraft/world/entity/animal/Fox.java -@@ -652,13 +_,16 @@ +@@ -653,13 +_,16 @@ } protected void m_6668_(DamageSource p_28536_) { @@ -18,7 +18,7 @@ } public static boolean m_28471_(Fox p_28472_, LivingEntity p_28473_) { -@@ -808,6 +_,17 @@ +@@ -809,6 +_,17 @@ protected void m_8026_() { ServerLevel serverlevel = (ServerLevel)this.f_25114_; Fox fox = (Fox)this.f_25113_.m_142606_(serverlevel, this.f_25115_); @@ -36,7 +36,7 @@ if (fox != null) { ServerPlayer serverplayer = this.f_25113_.m_27592_(); ServerPlayer serverplayer1 = this.f_25115_.m_27592_(); -@@ -879,7 +_,7 @@ +@@ -880,7 +_,7 @@ } protected void m_28686_() { @@ -45,7 +45,7 @@ BlockState blockstate = Fox.this.f_19853_.m_8055_(this.f_25602_); if (blockstate.m_60713_(Blocks.f_50685_)) { this.m_148928_(blockstate); -@@ -934,7 +_,7 @@ +@@ -935,7 +_,7 @@ } public boolean m_8036_() { diff --git a/patches/minecraft/net/minecraft/world/entity/animal/MushroomCow.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/MushroomCow.java.patch index 5f87496d5d..69ec6d5bbc 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/MushroomCow.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/MushroomCow.java.patch @@ -42,8 +42,8 @@ + java.util.List items = new java.util.ArrayList<>(); for(int i = 0; i < 5; ++i) { -- this.f_19853_.m_7967_(new ItemEntity(this.f_19853_, this.m_20185_(), this.m_20227_(1.0D), this.m_20189_(), new ItemStack(this.m_262365_().f_28961_.m_60734_()))); -+ items.add(new ItemStack(this.m_262365_().f_28961_.m_60734_())); +- this.f_19853_.m_7967_(new ItemEntity(this.f_19853_, this.m_20185_(), this.m_20227_(1.0D), this.m_20189_(), new ItemStack(this.m_28554_().f_28961_.m_60734_()))); ++ items.add(new ItemStack(this.m_28554_().f_28961_.m_60734_())); } + return items; } @@ -53,7 +53,7 @@ } @@ -183,6 +_,7 @@ - p_28944_.m_128359_("Type", this.m_262365_().m_7912_()); + p_28944_.m_128359_("Type", this.m_28554_().m_7912_()); if (this.f_28909_ != null) { p_28944_.m_128405_("EffectId", MobEffect.m_19459_(this.f_28909_)); + net.minecraftforge.common.ForgeHooks.saveMobEffect(p_28944_, "forge:effect_id", this.f_28909_); @@ -61,7 +61,7 @@ } @@ -193,6 +_,7 @@ - this.m_262362_(MushroomCow.MushroomType.m_28976_(p_28936_.m_128461_("Type"))); + this.m_28464_(MushroomCow.MushroomType.m_28976_(p_28936_.m_128461_("Type"))); if (p_28936_.m_128425_("EffectId", 1)) { this.f_28909_ = MobEffect.m_19453_(p_28936_.m_128451_("EffectId")); + this.f_28909_ = net.minecraftforge.common.ForgeHooks.loadMobEffect(p_28936_, "forge:effect_id", this.f_28909_); diff --git a/patches/minecraft/net/minecraft/world/entity/animal/Ocelot.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/Ocelot.java.patch index b72623eb00..a7d0920ef8 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/Ocelot.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/Ocelot.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/Ocelot.java +++ b/net/minecraft/world/entity/animal/Ocelot.java -@@ -164,7 +_,7 @@ +@@ -160,7 +_,7 @@ if ((this.f_28984_ == null || this.f_28984_.m_25955_()) && !this.m_29038_() && this.m_6898_(itemstack) && p_29021_.m_20280_(this) < 9.0D) { this.m_142075_(p_29021_, p_29022_, itemstack); if (!this.f_19853_.f_46443_) { diff --git a/patches/minecraft/net/minecraft/world/entity/animal/Pig.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/Pig.java.patch index 0bee89a04d..6cd396b00e 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/Pig.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/Pig.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/Pig.java +++ b/net/minecraft/world/entity/animal/Pig.java -@@ -200,7 +_,7 @@ +@@ -201,7 +_,7 @@ } public void m_8038_(ServerLevel p_29473_, LightningBolt p_29474_) { @@ -9,7 +9,7 @@ ZombifiedPiglin zombifiedpiglin = EntityType.f_20531_.m_20615_(p_29473_); if (zombifiedpiglin != null) { zombifiedpiglin.m_8061_(EquipmentSlot.MAINHAND, new ItemStack(Items.f_42430_)); -@@ -213,6 +_,7 @@ +@@ -214,6 +_,7 @@ } zombifiedpiglin.m_21530_(); diff --git a/patches/minecraft/net/minecraft/world/entity/animal/SnowGolem.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/SnowGolem.java.patch index 4e44d76da6..e57c04d2c4 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/SnowGolem.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/SnowGolem.java.patch @@ -9,8 +9,8 @@ private static final EntityDataAccessor f_29899_ = SynchedEntityData.m_135353_(SnowGolem.class, EntityDataSerializers.f_135027_); private static final byte f_149047_ = 16; private static final float f_149048_ = 1.7F; -@@ -97,7 +_,7 @@ - this.m_6469_(DamageSource.f_19307_, 1.0F); +@@ -92,7 +_,7 @@ + this.m_6469_(this.m_269291_().m_269549_(), 1.0F); } - if (!this.f_19853_.m_46469_().m_46207_(GameRules.f_46132_)) { @@ -18,16 +18,16 @@ return; } -@@ -108,7 +_,7 @@ - j = Mth.m_14107_(this.m_20186_()); - k = Mth.m_14107_(this.m_20189_() + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); - BlockPos blockpos1 = new BlockPos(i, j, k); -- if (this.f_19853_.m_8055_(blockpos1).m_60795_() && blockstate.m_60710_(this.f_19853_, blockpos1)) { -+ if (this.f_19853_.m_46859_(blockpos1) && blockstate.m_60710_(this.f_19853_, blockpos1)) { - this.f_19853_.m_46597_(blockpos1, blockstate); - this.f_19853_.m_220407_(GameEvent.f_157797_, blockpos1, GameEvent.Context.m_223719_(this, blockstate)); +@@ -103,7 +_,7 @@ + int k = Mth.m_14107_(this.m_20186_()); + int l = Mth.m_14107_(this.m_20189_() + (double)((float)(i / 2 % 2 * 2 - 1) * 0.25F)); + BlockPos blockpos = new BlockPos(j, k, l); +- if (this.f_19853_.m_8055_(blockpos).m_60795_() && blockstate.m_60710_(this.f_19853_, blockpos)) { ++ if (this.f_19853_.m_46859_(blockpos) && blockstate.m_60710_(this.f_19853_, blockpos)) { + this.f_19853_.m_46597_(blockpos, blockstate); + this.f_19853_.m_220407_(GameEvent.f_157797_, blockpos, GameEvent.Context.m_223719_(this, blockstate)); } -@@ -135,7 +_,7 @@ +@@ -130,7 +_,7 @@ protected InteractionResult m_6071_(Player p_29920_, InteractionHand p_29921_) { ItemStack itemstack = p_29920_.m_21120_(p_29921_); @@ -36,7 +36,7 @@ this.m_5851_(SoundSource.PLAYERS); this.m_146852_(GameEvent.f_157781_, p_29920_); if (!this.f_19853_.f_46443_) { -@@ -194,5 +_,22 @@ +@@ -189,5 +_,22 @@ public Vec3 m_7939_() { return new Vec3(0.0D, (double)(0.75F * this.m_20192_()), (double)(this.m_20205_() * 0.4F)); diff --git a/patches/minecraft/net/minecraft/world/entity/animal/allay/Allay.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/allay/Allay.java.patch index 25a45a2a1b..2a1d7e6521 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/allay/Allay.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/allay/Allay.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/allay/Allay.java +++ b/net/minecraft/world/entity/animal/allay/Allay.java -@@ -329,7 +_,7 @@ +@@ -325,7 +_,7 @@ public boolean m_7243_(ItemStack p_218387_) { ItemStack itemstack = this.m_21120_(InteractionHand.MAIN_HAND); diff --git a/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch index 33de9b9b0c..526a3b1d5a 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/net/minecraft/world/entity/animal/horse/AbstractHorse.java -@@ -306,6 +_,7 @@ +@@ -331,6 +_,7 @@ this.f_30520_.m_19164_(this); this.m_7493_(); @@ -8,7 +8,7 @@ } protected void m_7493_() { -@@ -353,9 +_,9 @@ +@@ -378,9 +_,9 @@ protected void m_7355_(BlockPos p_30584_, BlockState p_30585_) { if (!p_30585_.m_60767_().m_76332_()) { BlockState blockstate = this.f_19853_.m_8055_(p_30584_.m_7494_()); @@ -20,15 +20,15 @@ } if (this.m_20160_() && this.f_30523_) { -@@ -770,6 +_,7 @@ +@@ -786,6 +_,7 @@ this.m_20334_(vec3.f_82479_, d1, vec3.f_82481_); this.m_30655_(true); this.f_19812_ = true; + net.minecraftforge.common.ForgeHooks.onLivingJump(this); - if (p_251655_ > 0.0F) { + if (p_275435_.f_82481_ > 0.0D) { float f = Mth.m_14031_(this.m_146908_() * ((float)Math.PI / 180F)); float f1 = Mth.m_14089_(this.m_146908_() * ((float)Math.PI / 180F)); -@@ -1078,6 +_,25 @@ +@@ -1119,6 +_,25 @@ this.m_214179_(p_30555_.m_213780_()); return super.m_6518_(p_30555_, p_30556_, p_30557_, p_30558_, p_30559_); diff --git a/patches/minecraft/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch b/patches/minecraft/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch index 97139efd69..092f12636a 100644 --- a/patches/minecraft/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -106,6 +_,14 @@ +@@ -107,6 +_,14 @@ } this.f_31074_ = new EnderDragonPhaseManager(this); @@ -15,7 +15,7 @@ } public static AttributeSupplier.Builder m_31167_() { -@@ -149,7 +_,11 @@ +@@ -150,7 +_,11 @@ return adouble; } @@ -27,7 +27,7 @@ this.m_146874_(); if (this.f_19853_.f_46443_) { this.m_21153_(this.m_21223_()); -@@ -419,7 +_,7 @@ +@@ -420,7 +_,7 @@ BlockPos blockpos = new BlockPos(k1, l1, i2); BlockState blockstate = this.f_19853_.m_8055_(blockpos); if (!blockstate.m_60795_() && !blockstate.m_204336_(BlockTags.f_215822_)) { @@ -36,7 +36,7 @@ flag1 = this.f_19853_.m_7471_(blockpos, false) || flag1; } else { flag = true; -@@ -510,7 +_,8 @@ +@@ -511,7 +_,8 @@ if (this.f_19853_ instanceof ServerLevel) { if (this.f_31084_ > 150 && this.f_31084_ % 5 == 0 && flag) { @@ -46,8 +46,8 @@ } if (this.f_31084_ == 1 && !this.m_20067_()) { -@@ -523,7 +_,8 @@ - this.f_20883_ = this.m_146908_(); +@@ -522,7 +_,8 @@ + this.m_6478_(MoverType.SELF, new Vec3(0.0D, (double)0.1F, 0.0D)); if (this.f_31084_ == 200 && this.f_19853_ instanceof ServerLevel) { if (flag) { - ExperienceOrb.m_147082_((ServerLevel)this.f_19853_, this.m_20182_(), Mth.m_14143_((float)i * 0.2F)); @@ -56,7 +56,7 @@ } if (this.f_31073_ != null) { -@@ -846,8 +_,19 @@ +@@ -845,8 +_,19 @@ return false; } diff --git a/patches/minecraft/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch b/patches/minecraft/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch index ae139399cf..548805cb11 100644 --- a/patches/minecraft/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java -@@ -278,7 +_,7 @@ +@@ -279,7 +_,7 @@ if (this.f_31429_ > 0) { --this.f_31429_; @@ -9,7 +9,7 @@ int j1 = Mth.m_14107_(this.m_20186_()); int i2 = Mth.m_14107_(this.m_20185_()); int j2 = Mth.m_14107_(this.m_20189_()); -@@ -292,7 +_,7 @@ +@@ -293,7 +_,7 @@ int i1 = j2 + k2; BlockPos blockpos = new BlockPos(l2, l, i1); BlockState blockstate = this.f_19853_.m_8055_(blockpos); @@ -18,7 +18,7 @@ flag = this.f_19853_.m_46953_(blockpos, true, this) || flag; } } -@@ -313,6 +_,10 @@ +@@ -314,6 +_,10 @@ } } diff --git a/patches/minecraft/net/minecraft/world/entity/decoration/ArmorStand.java.patch b/patches/minecraft/net/minecraft/world/entity/decoration/ArmorStand.java.patch index 06b5e501e2..15bcac0432 100644 --- a/patches/minecraft/net/minecraft/world/entity/decoration/ArmorStand.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/decoration/ArmorStand.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -71,7 +_,7 @@ +@@ -72,7 +_,7 @@ public static final EntityDataAccessor f_31550_ = SynchedEntityData.m_135353_(ArmorStand.class, EntityDataSerializers.f_135037_); public static final EntityDataAccessor f_31527_ = SynchedEntityData.m_135353_(ArmorStand.class, EntityDataSerializers.f_135037_); private static final Predicate f_31537_ = (p_31582_) -> { diff --git a/patches/minecraft/net/minecraft/world/entity/item/FallingBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/item/FallingBlockEntity.java.patch index 4ab472cf5a..33c817c97e 100644 --- a/patches/minecraft/net/minecraft/world/entity/item/FallingBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/item/FallingBlockEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -119,11 +_,11 @@ +@@ -120,11 +_,11 @@ if (!this.f_19853_.f_46443_) { BlockPos blockpos = this.m_20183_(); boolean flag = this.f_31946_.m_60734_() instanceof ConcretePowderBlock; diff --git a/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch index d36f84786c..b191605902 100644 --- a/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/entity/item/ItemEntity.java +++ b/net/minecraft/world/entity/item/ItemEntity.java -@@ -41,6 +_,10 @@ +@@ -42,6 +_,10 @@ @Nullable - private UUID f_31982_; + private UUID f_265881_; public final float f_31983_; + /** + * The maximum age of this EntityItem. The item is expired once this is reached. @@ -11,7 +11,7 @@ public ItemEntity(EntityType p_31991_, Level p_31992_) { super(p_31991_, p_31992_); -@@ -57,6 +_,7 @@ +@@ -58,6 +_,7 @@ this.m_6034_(p_149664_, p_149665_, p_149666_); this.m_20334_(p_149668_, p_149669_, p_149670_); this.m_32045_(p_149667_); @@ -19,7 +19,7 @@ } private ItemEntity(ItemEntity p_31994_) { -@@ -84,6 +_,7 @@ +@@ -94,6 +_,7 @@ } public void m_8119_() { @@ -27,7 +27,7 @@ if (this.m_32055_().m_41619_()) { this.m_146870_(); } else { -@@ -97,6 +_,9 @@ +@@ -107,6 +_,9 @@ this.f_19856_ = this.m_20189_(); Vec3 vec3 = this.m_20184_(); float f = this.m_20192_() - 0.11111111F; @@ -37,16 +37,16 @@ if (this.m_20069_() && this.m_204036_(FluidTags.f_13131_) > (double)f) { this.m_32067_(); } else if (this.m_20077_() && this.m_204036_(FluidTags.f_13132_) > (double)f) { -@@ -118,7 +_,7 @@ +@@ -128,7 +_,7 @@ this.m_6478_(MoverType.SELF, this.m_20184_()); float f1 = 0.98F; if (this.f_19861_) { -- f1 = this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.98F; -+ f1 = this.f_19853_.m_8055_(new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).getFriction(f_19853_, new BlockPos(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_()), this) * 0.98F; +- f1 = this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).m_60734_().m_49958_() * 0.98F; ++ f1 = this.f_19853_.m_8055_(BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_())).getFriction(f_19853_, BlockPos.m_274561_(this.m_20185_(), this.m_20186_() - 1.0D, this.m_20189_()), this) * 0.98F; } this.m_20256_(this.m_20184_().m_82542_((double)f1, 0.98D, (double)f1)); -@@ -148,7 +_,14 @@ +@@ -158,7 +_,14 @@ } } @@ -62,7 +62,7 @@ this.m_146870_(); } -@@ -206,6 +_,8 @@ +@@ -216,6 +_,8 @@ return false; } else if (p_32028_.m_41782_() ^ p_32027_.m_41782_()) { return false; @@ -71,15 +71,15 @@ } else { return !p_32028_.m_41782_() || p_32028_.m_41783_().equals(p_32027_.m_41783_()); } -@@ -239,6 +_,7 @@ +@@ -249,6 +_,7 @@ } public boolean m_6469_(DamageSource p_32013_, float p_32014_) { + if (this.f_19853_.f_46443_ || this.m_213877_()) return false; //Forge: Fixes MC-53850 if (this.m_6673_(p_32013_)) { return false; - } else if (!this.m_32055_().m_41619_() && this.m_32055_().m_150930_(Items.f_42686_) && p_32013_.m_19372_()) { -@@ -252,7 +_,7 @@ + } else if (!this.m_32055_().m_41619_() && this.m_32055_().m_150930_(Items.f_42686_) && p_32013_.m_269533_(DamageTypeTags.f_268415_)) { +@@ -262,7 +_,7 @@ this.f_31987_ = (int)((float)this.f_31987_ - p_32014_); this.m_146852_(GameEvent.f_223706_, p_32013_.m_7639_()); if (this.f_31987_ <= 0) { @@ -88,23 +88,23 @@ this.m_146870_(); } -@@ -264,6 +_,7 @@ +@@ -274,6 +_,7 @@ p_32050_.m_128376_("Health", (short)this.f_31987_); p_32050_.m_128376_("Age", (short)this.f_31985_); p_32050_.m_128376_("PickupDelay", (short)this.f_31986_); + p_32050_.m_128405_("Lifespan", lifespan); - if (this.m_32057_() != null) { - p_32050_.m_128362_("Thrower", this.m_32057_()); + if (this.f_31988_ != null) { + p_32050_.m_128362_("Thrower", this.f_31988_); } -@@ -284,6 +_,7 @@ +@@ -294,6 +_,7 @@ if (p_32034_.m_128441_("PickupDelay")) { this.f_31986_ = p_32034_.m_128448_("PickupDelay"); } + if (p_32034_.m_128441_("Lifespan")) lifespan = p_32034_.m_128451_("Lifespan"); if (p_32034_.m_128403_("Owner")) { - this.f_31982_ = p_32034_.m_128342_("Owner"); -@@ -303,10 +_,18 @@ + this.f_265881_ = p_32034_.m_128342_("Owner"); +@@ -313,10 +_,18 @@ public void m_6123_(Player p_32040_) { if (!this.f_19853_.f_46443_) { @@ -112,19 +112,19 @@ ItemStack itemstack = this.m_32055_(); Item item = itemstack.m_41720_(); int i = itemstack.m_41613_(); -- if (this.f_31986_ == 0 && (this.f_31982_ == null || this.f_31982_.equals(p_32040_.m_20148_())) && p_32040_.m_150109_().m_36054_(itemstack)) { +- if (this.f_31986_ == 0 && (this.f_265881_ == null || this.f_265881_.equals(p_32040_.m_20148_())) && p_32040_.m_150109_().m_36054_(itemstack)) { + + int hook = net.minecraftforge.event.ForgeEventFactory.onItemPickup(this, p_32040_); + if (hook < 0) return; + + ItemStack copy = itemstack.m_41777_(); -+ if (this.f_31986_ == 0 && (this.f_31982_ == null || lifespan - this.f_31985_ <= 200 || this.f_31982_.equals(p_32040_.m_20148_())) && (hook == 1 || i <= 0 || p_32040_.m_150109_().m_36054_(itemstack))) { ++ if (this.f_31986_ == 0 && (this.m_19749_() == null || lifespan - this.f_31985_ <= 200 || this.m_19749_().m_20148_().equals(p_32040_.m_20148_())) && (hook == 1 || i <= 0 || p_32040_.m_150109_().m_36054_(itemstack))) { + copy.m_41764_(copy.m_41613_() - m_32055_().m_41613_()); + net.minecraftforge.event.ForgeEventFactory.firePlayerItemPickupEvent(p_32040_, this, copy); p_32040_.m_7938_(this, i); if (itemstack.m_41619_()) { this.m_146870_(); -@@ -330,8 +_,8 @@ +@@ -340,8 +_,8 @@ } @Nullable diff --git a/patches/minecraft/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch index 45da9144ab..fa2161d50e 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/net/minecraft/world/entity/monster/AbstractSkeleton.java -@@ -154,7 +_,7 @@ +@@ -155,7 +_,7 @@ if (this.f_19853_ != null && !this.f_19853_.f_46443_) { this.f_21345_.m_25363_(this.f_32131_); this.f_21345_.m_25363_(this.f_32130_); @@ -9,7 +9,7 @@ if (itemstack.m_150930_(Items.f_42411_)) { int i = 20; if (this.f_19853_.m_46791_() != Difficulty.HARD) { -@@ -171,8 +_,10 @@ +@@ -172,8 +_,10 @@ } public void m_6504_(LivingEntity p_32141_, float p_32142_) { diff --git a/patches/minecraft/net/minecraft/world/entity/monster/EnderMan.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/EnderMan.java.patch index 33b919bffd..baa035de64 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/EnderMan.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/EnderMan.java.patch @@ -37,7 +37,7 @@ if (flag2) { this.f_19853_.m_214171_(GameEvent.f_238175_, vec3, GameEvent.Context.m_223717_(this)); if (!this.m_20067_()) { -@@ -422,7 +_,7 @@ +@@ -419,7 +_,7 @@ public boolean m_8036_() { if (this.f_32554_.m_32530_() == null) { return false; @@ -46,7 +46,7 @@ return false; } else { return this.f_32554_.m_217043_().m_188503_(m_186073_(2000)) == 0; -@@ -442,7 +_,7 @@ +@@ -439,7 +_,7 @@ BlockState blockstate2 = this.f_32554_.m_32530_(); if (blockstate2 != null) { blockstate2 = Block.m_49931_(blockstate2, this.f_32554_.f_19853_, blockpos); @@ -55,7 +55,7 @@ level.m_7731_(blockpos, blockstate2, 3); level.m_220407_(GameEvent.f_157797_, blockpos, GameEvent.Context.m_223719_(this.f_32554_, blockstate2)); this.f_32554_.m_32521_((BlockState)null); -@@ -452,7 +_,7 @@ +@@ -449,7 +_,7 @@ } private boolean m_32558_(Level p_32559_, BlockPos p_32560_, BlockState p_32561_, BlockState p_32562_, BlockState p_32563_, BlockPos p_32564_) { @@ -64,7 +64,7 @@ } } -@@ -544,7 +_,7 @@ +@@ -551,7 +_,7 @@ public boolean m_8036_() { if (this.f_32583_.m_32530_() != null) { return false; diff --git a/patches/minecraft/net/minecraft/world/entity/monster/MagmaCube.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/MagmaCube.java.patch index ac7453dd05..13d7d20ec2 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/MagmaCube.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/MagmaCube.java.patch @@ -30,4 +30,4 @@ + this.jumpInLiquidInternal(() -> type == net.minecraftforge.common.ForgeMod.LAVA_TYPE.get(), () -> super.jumpInFluid(type)); } - public boolean m_142535_(float p_149717_, float p_149718_, DamageSource p_149719_) { + protected boolean m_7483_() { diff --git a/patches/minecraft/net/minecraft/world/entity/monster/Ravager.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/Ravager.java.patch index b27b8d7798..0525ed421b 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/Ravager.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/Ravager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/Ravager.java +++ b/net/minecraft/world/entity/monster/Ravager.java -@@ -145,7 +_,7 @@ +@@ -139,7 +_,7 @@ this.m_21051_(Attributes.f_22279_).m_22100_(Mth.m_14139_(0.1D, d1, d0)); } diff --git a/patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch index f595f3544e..3f2b71907e 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch @@ -1,12 +1,12 @@ --- a/net/minecraft/world/entity/monster/Shulker.java +++ b/net/minecraft/world/entity/monster/Shulker.java -@@ -359,6 +_,12 @@ +@@ -360,6 +_,12 @@ if (blockpos1.m_123342_() > this.f_19853_.m_141937_() && this.f_19853_.m_46859_(blockpos1) && this.f_19853_.m_6857_().m_61937_(blockpos1) && this.f_19853_.m_45756_(this, (new AABB(blockpos1)).m_82406_(1.0E-6D))) { Direction direction = this.m_149810_(blockpos1); if (direction != null) { + net.minecraftforge.event.entity.EntityTeleportEvent.EnderEntity event = net.minecraftforge.event.ForgeEventFactory.onEnderTeleport(this, blockpos1.m_123341_(), blockpos1.m_123342_(), blockpos1.m_123343_()); + if (event.isCanceled()) direction = null; -+ blockpos1 = new BlockPos(event.getTargetX(), event.getTargetY(), event.getTargetZ()); ++ blockpos1 = BlockPos.m_274561_(event.getTargetX(), event.getTargetY(), event.getTargetZ()); + } + + if (direction != null) { diff --git a/patches/minecraft/net/minecraft/world/entity/monster/Silverfish.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/Silverfish.java.patch index cb77e7b61f..c7202b3120 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/Silverfish.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/Silverfish.java.patch @@ -7,7 +7,7 @@ - if (this.f_25725_.f_19853_.m_46469_().m_46207_(GameRules.f_46132_) && randomsource.m_188503_(m_186073_(10)) == 0) { + if (net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.f_25725_.f_19853_, this.f_25725_) && randomsource.m_188503_(m_186073_(10)) == 0) { this.f_33555_ = Direction.m_235672_(randomsource); - BlockPos blockpos = (new BlockPos(this.f_25725_.m_20185_(), this.f_25725_.m_20186_() + 0.5D, this.f_25725_.m_20189_())).m_121945_(this.f_33555_); + BlockPos blockpos = BlockPos.m_274561_(this.f_25725_.m_20185_(), this.f_25725_.m_20186_() + 0.5D, this.f_25725_.m_20189_()).m_121945_(this.f_33555_); BlockState blockstate = this.f_25725_.f_19853_.m_8055_(blockpos); @@ -209,7 +_,7 @@ BlockState blockstate = level.m_8055_(blockpos1); diff --git a/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch index ebbe260f86..de4fecfe70 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch @@ -3,9 +3,9 @@ @@ -10,7 +_,7 @@ return BehaviorBuilder.m_258034_((p_259197_) -> { return p_259197_.group(p_259197_.m_258080_(MemoryModuleType.f_26336_)).apply(p_259197_, (p_259512_) -> { - return (p_259681_, p_260321_, p_259451_) -> { -- if (!p_260321_.m_21206_().m_41619_() && !p_260321_.m_21206_().m_150930_(Items.f_42740_)) { -+ if (!p_260321_.m_21206_().m_41619_() && !p_260321_.m_21206_().canPerformAction(net.minecraftforge.common.ToolActions.SHIELD_BLOCK)) { - PiglinAi.m_34867_(p_260321_, true); + return (p_275996_, p_275997_, p_275998_) -> { +- if (!p_275997_.m_21206_().m_41619_() && !p_275997_.m_21206_().m_150930_(Items.f_42740_)) { ++ if (!p_275997_.m_21206_().m_41619_() && !p_275997_.m_21206_().canPerformAction(net.minecraftforge.common.ToolActions.SHIELD_BLOCK)) { + PiglinAi.m_34867_(p_275997_, true); return true; } else { diff --git a/patches/minecraft/net/minecraft/world/entity/npc/Villager.java.patch b/patches/minecraft/net/minecraft/world/entity/npc/Villager.java.patch index 36df415a77..daf93f99cc 100644 --- a/patches/minecraft/net/minecraft/world/entity/npc/Villager.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/npc/Villager.java.patch @@ -9,7 +9,7 @@ if (this.m_6162_()) { this.m_35518_(); return InteractionResult.m_19078_(this.f_19853_.f_46443_); -@@ -657,7 +_,8 @@ +@@ -668,7 +_,8 @@ } protected Component m_5677_() { @@ -19,7 +19,7 @@ } public void m_7822_(byte p_35391_) { -@@ -710,7 +_,7 @@ +@@ -721,7 +_,7 @@ } public void m_8038_(ServerLevel p_35409_, LightningBolt p_35410_) { @@ -28,7 +28,7 @@ f_201976_.info("Villager {} was struck by lightning {}.", this, p_35410_); Witch witch = EntityType.f_20495_.m_20615_(p_35409_); if (witch != null) { -@@ -723,6 +_,7 @@ +@@ -734,6 +_,7 @@ } witch.m_21530_(); diff --git a/patches/minecraft/net/minecraft/world/entity/player/Inventory.java.patch b/patches/minecraft/net/minecraft/world/entity/player/Inventory.java.patch index afd02fce9f..c716779590 100644 --- a/patches/minecraft/net/minecraft/world/entity/player/Inventory.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/player/Inventory.java.patch @@ -1,6 +1,10 @@ --- a/net/minecraft/world/entity/player/Inventory.java +++ b/net/minecraft/world/entity/player/Inventory.java -@@ -129,7 +_,7 @@ +@@ -126,14 +_,14 @@ + if (this.f_35974_.get(j).m_41619_()) { + return j; + } +- } for(int k = 0; k < 9; ++k) { int l = (this.f_35977_ + k) % 9; @@ -9,7 +13,11 @@ return l; } } -@@ -177,7 +_,8 @@ ++ } + + return this.f_35977_; + } +@@ -178,7 +_,8 @@ int i = p_36049_.m_41613_(); ItemStack itemstack = this.m_8020_(p_36048_); if (itemstack.m_41619_()) { @@ -19,7 +27,7 @@ if (p_36049_.m_41782_()) { itemstack.m_41751_(p_36049_.m_41783_().m_6426_()); } -@@ -228,7 +_,7 @@ +@@ -229,7 +_,7 @@ } } } @@ -28,7 +36,7 @@ } public boolean m_36054_(ItemStack p_36055_) { -@@ -277,6 +_,8 @@ +@@ -278,6 +_,8 @@ } catch (Throwable throwable) { CrashReport crashreport = CrashReport.m_127521_(throwable, "Adding item to inventory"); CrashReportCategory crashreportcategory = crashreport.m_127514_("Item being added"); diff --git a/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch b/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch index 5a0606ab69..5fd3f72612 100644 --- a/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -112,7 +_,8 @@ +@@ -114,7 +_,8 @@ import net.minecraft.world.scores.Team; import org.slf4j.Logger; @@ -10,17 +10,17 @@ private static final Logger f_219722_ = LogUtils.getLogger(); public static final int f_150082_ = 16; public static final int f_150083_ = 20; -@@ -164,6 +_,9 @@ - private Optional f_238176_ = Optional.empty(); +@@ -167,6 +_,9 @@ @Nullable public FishingHook f_36083_; + protected float f_263750_; + private final java.util.Collection prefixes = new java.util.LinkedList<>(); + private final java.util.Collection suffixes = new java.util.LinkedList<>(); + @Nullable private Pose forcedPose; public Player(Level p_250508_, BlockPos p_250289_, float p_251702_, GameProfile p_252153_) { super(EntityType.f_20532_, p_250508_); -@@ -189,7 +_,7 @@ +@@ -192,7 +_,7 @@ } public static AttributeSupplier.Builder m_36340_() { @@ -29,7 +29,7 @@ } protected void m_8097_() { -@@ -203,6 +_,7 @@ +@@ -206,6 +_,7 @@ } public void m_8119_() { @@ -37,7 +37,7 @@ this.f_19794_ = this.m_5833_(); if (this.m_5833_()) { this.f_19861_ = false; -@@ -218,7 +_,7 @@ +@@ -221,7 +_,7 @@ this.f_36110_ = 100; } @@ -46,7 +46,7 @@ this.m_6145_(false, true); } } else if (this.f_36110_ > 0) { -@@ -273,6 +_,7 @@ +@@ -276,6 +_,7 @@ this.m_36372_(); this.f_36087_.m_41518_(); this.m_7594_(); @@ -54,7 +54,7 @@ } public boolean m_36341_() { -@@ -348,6 +_,10 @@ +@@ -351,6 +_,10 @@ } protected void m_7594_() { @@ -65,7 +65,7 @@ if (this.m_20175_(Pose.SWIMMING)) { Pose pose; if (this.m_21255_()) { -@@ -574,6 +_,7 @@ +@@ -572,6 +_,7 @@ } public void m_6667_(DamageSource p_36152_) { @@ -73,7 +73,7 @@ super.m_6667_(p_36152_); this.m_20090_(); if (!this.m_5833_()) { -@@ -631,7 +_,7 @@ +@@ -621,7 +_,7 @@ @Nullable public ItemEntity m_36176_(ItemStack p_36177_, boolean p_36178_) { @@ -82,7 +82,7 @@ } @Nullable -@@ -669,7 +_,12 @@ +@@ -659,7 +_,12 @@ } } @@ -95,7 +95,7 @@ float f = this.f_36093_.m_36020_(p_36282_); if (f > 1.0F) { int i = EnchantmentHelper.m_44926_(this); -@@ -711,11 +_,12 @@ +@@ -701,11 +_,12 @@ f /= 5.0F; } @@ -109,15 +109,15 @@ } public void m_7378_(CompoundTag p_36215_) { -@@ -801,6 +_,7 @@ +@@ -791,6 +_,7 @@ } public boolean m_6469_(DamageSource p_36154_, float p_36155_) { + if (!net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_36154_, p_36155_)) return false; if (this.m_6673_(p_36154_)) { return false; - } else if (this.f_36077_.f_35934_ && !p_36154_.m_19378_()) { -@@ -835,7 +_,7 @@ + } else if (this.f_36077_.f_35934_ && !p_36154_.m_269533_(DamageTypeTags.f_268738_)) { +@@ -825,7 +_,7 @@ protected void m_6728_(LivingEntity p_36295_) { super.m_6728_(p_36295_); @@ -126,7 +126,7 @@ this.m_36384_(true); } -@@ -864,7 +_,7 @@ +@@ -854,7 +_,7 @@ } protected void m_7909_(float p_36383_) { @@ -135,7 +135,7 @@ if (!this.f_19853_.f_46443_) { this.m_36246_(Stats.f_12982_.m_12902_(this.f_20935_.m_41720_())); } -@@ -874,6 +_,8 @@ +@@ -864,6 +_,8 @@ InteractionHand interactionhand = this.m_7655_(); this.f_20935_.m_41622_(i, this, (p_219739_) -> { p_219739_.m_21190_(interactionhand); @@ -144,7 +144,7 @@ }); if (this.f_20935_.m_41619_()) { if (interactionhand == InteractionHand.MAIN_HAND) { -@@ -892,10 +_,13 @@ +@@ -882,10 +_,13 @@ protected void m_6475_(DamageSource p_36312_, float p_36313_) { if (!this.m_6673_(p_36312_)) { @@ -158,17 +158,16 @@ float f = p_36313_ - f2; if (f > 0.0F && f < 3.4028235E37F) { this.m_36222_(Stats.f_12933_, Math.round(f * 10.0F)); -@@ -904,8 +_,8 @@ - if (f2 != 0.0F) { +@@ -895,7 +_,7 @@ this.m_36399_(p_36312_.m_19377_()); float f1 = this.m_21223_(); -- this.m_21153_(this.m_21223_() - f2); this.m_21231_().m_19289_(p_36312_, f1, f2); +- this.m_21153_(this.m_21223_() - f2); + this.m_21153_(f1 - f2); // Forge: moved to fix MC-121048 if (f2 < 3.4028235E37F) { this.m_36222_(Stats.f_12931_, Math.round(f2 * 10.0F)); } -@@ -958,6 +_,8 @@ +@@ -948,6 +_,8 @@ return InteractionResult.PASS; } else { @@ -177,7 +176,7 @@ ItemStack itemstack = this.m_21120_(p_36159_); ItemStack itemstack1 = itemstack.m_41777_(); InteractionResult interactionresult = p_36158_.m_6096_(this, p_36159_); -@@ -966,6 +_,9 @@ +@@ -956,6 +_,9 @@ itemstack.m_41764_(itemstack1.m_41613_()); } @@ -187,15 +186,15 @@ return interactionresult; } else { if (!itemstack.m_41619_() && p_36158_ instanceof LivingEntity) { -@@ -976,6 +_,7 @@ - InteractionResult interactionresult1 = itemstack.m_41647_(this, (LivingEntity)p_36158_, p_36159_); +@@ -967,6 +_,7 @@ if (interactionresult1.m_19077_()) { + this.f_19853_.m_214171_(GameEvent.f_223708_, p_36158_.m_20182_(), GameEvent.Context.m_223717_(this)); if (itemstack.m_41619_() && !this.f_36077_.f_35937_) { + net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, itemstack1, p_36159_); this.m_21008_(p_36159_, ItemStack.f_41583_); } -@@ -1005,6 +_,7 @@ +@@ -996,6 +_,7 @@ return !this.f_36077_.f_35935_; } @@ -203,11 +202,11 @@ protected Vec3 m_5763_(Vec3 p_36201_, MoverType p_36202_) { if (!this.f_36077_.f_35935_ && p_36201_.f_82480_ <= 0.0D && (p_36202_ == MoverType.SELF || p_36202_ == MoverType.PLAYER) && this.m_36343_() && this.m_36386_()) { double d0 = p_36201_.f_82479_; -@@ -1056,10 +_,11 @@ +@@ -1047,10 +_,11 @@ } private boolean m_36386_() { -- return this.f_19861_ || this.f_19789_ < this.f_19793_ && !this.f_19853_.m_45756_(this, this.m_20191_().m_82386_(0.0D, (double)(this.f_19789_ - this.f_19793_), 0.0D)); +- return this.f_19861_ || this.f_19789_ < this.m_274421_() && !this.f_19853_.m_45756_(this, this.m_20191_().m_82386_(0.0D, (double)(this.f_19789_ - this.m_274421_()), 0.0D)); + return this.f_19861_ || this.f_19789_ < this.getStepHeight() && !this.f_19853_.m_45756_(this, this.m_20191_().m_82386_(0.0D, (double)(this.f_19789_ - this.getStepHeight()), 0.0D)); } @@ -216,7 +215,7 @@ if (p_36347_.m_6097_()) { if (!p_36347_.m_7313_(this)) { float f = (float)this.m_21133_(Attributes.f_22281_); -@@ -1073,11 +_,10 @@ +@@ -1064,11 +_,10 @@ float f2 = this.m_36403_(0.5F); f *= 0.2F + f2 * f2 * 0.8F; f1 *= f2; @@ -229,7 +228,7 @@ i += EnchantmentHelper.m_44894_(this); if (this.m_20142_() && flag) { this.f_19853_.m_6263_((Player)null, this.m_20185_(), this.m_20186_(), this.m_20189_(), SoundEvents.f_12314_, this.m_5720_(), 1.0F, 1.0F); -@@ -1087,8 +_,10 @@ +@@ -1078,8 +_,10 @@ boolean flag2 = flag && this.f_19789_ > 0.0F && !this.f_19861_ && !this.m_6147_() && !this.m_20069_() && !this.m_21023_(MobEffects.f_19610_) && !this.m_20159_() && p_36347_ instanceof LivingEntity; flag2 = flag2 && !this.m_20142_(); @@ -241,7 +240,7 @@ } f += f1; -@@ -1096,9 +_,7 @@ +@@ -1087,9 +_,7 @@ double d0 = (double)(this.f_19787_ - this.f_19867_); if (flag && !flag2 && !flag1 && this.f_19861_ && d0 < (double)this.m_6113_()) { ItemStack itemstack = this.m_21120_(InteractionHand.MAIN_HAND); @@ -252,7 +251,7 @@ } float f4 = 0.0F; -@@ -1129,8 +_,8 @@ +@@ -1120,8 +_,8 @@ if (flag3) { float f3 = 1.0F + EnchantmentHelper.m_44821_(this) * f; @@ -261,9 +260,9 @@ + for(LivingEntity livingentity : this.f_19853_.m_45976_(LivingEntity.class, this.m_21120_(InteractionHand.MAIN_HAND).getSweepHitBox(this, p_36347_))) { + if (livingentity != this && livingentity != p_36347_ && !this.m_7307_(livingentity) && (!(livingentity instanceof ArmorStand) || !((ArmorStand)livingentity).m_31677_()) && this.canHit(livingentity, 0)) { // Original check was dist < 3, range is 3, so vanilla used padding=0 livingentity.m_147240_((double)0.4F, (double)Mth.m_14031_(this.m_146908_() * ((float)Math.PI / 180F)), (double)(-Mth.m_14089_(this.m_146908_() * ((float)Math.PI / 180F)))); - livingentity.m_6469_(DamageSource.m_19344_(this), f3); + livingentity.m_6469_(this.m_269291_().m_269075_(this), f3); } -@@ -1171,13 +_,15 @@ +@@ -1162,13 +_,15 @@ EnchantmentHelper.m_44896_(this, p_36347_); ItemStack itemstack1 = this.m_21205_(); Entity entity = p_36347_; @@ -281,7 +280,7 @@ this.m_21008_(InteractionHand.MAIN_HAND, ItemStack.f_41583_); } } -@@ -1203,6 +_,7 @@ +@@ -1194,6 +_,7 @@ } } } @@ -289,7 +288,7 @@ } } -@@ -1219,7 +_,7 @@ +@@ -1210,7 +_,7 @@ } if (this.f_19796_.m_188501_() < f) { @@ -298,7 +297,7 @@ this.m_5810_(); this.f_19853_.m_7605_(this, (byte)30); } -@@ -1283,6 +_,7 @@ +@@ -1274,6 +_,7 @@ } public void m_6145_(boolean p_36226_, boolean p_36227_) { @@ -306,7 +305,7 @@ super.m_5796_(); if (this.f_19853_ instanceof ServerLevel && p_36227_) { ((ServerLevel)this.f_19853_).m_8878_(); -@@ -1308,7 +_,7 @@ +@@ -1299,7 +_,7 @@ } else if (block instanceof BedBlock && BedBlock.m_49488_(p_36131_)) { return BedBlock.m_260958_(EntityType.f_20532_, p_36131_, p_36132_, blockstate.m_61143_(BedBlock.f_54117_), p_36133_); } else if (!p_36134_) { @@ -315,7 +314,7 @@ } else { boolean flag = block.m_5568_(); boolean flag1 = p_36131_.m_8055_(p_36132_.m_7494_()).m_60734_().m_5568_(); -@@ -1488,6 +_,7 @@ +@@ -1476,6 +_,7 @@ public boolean m_142535_(float p_150093_, float p_150094_, DamageSource p_150095_) { if (this.f_36077_.f_35936_) { @@ -323,7 +322,7 @@ return false; } else { if (p_150093_ >= 2.0F) { -@@ -1501,7 +_,7 @@ +@@ -1489,7 +_,7 @@ public boolean m_36319_() { if (!this.f_19861_ && !this.m_21255_() && !this.m_20069_() && !this.m_21023_(MobEffects.f_19620_)) { ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST); @@ -332,7 +331,7 @@ this.m_36320_(); return true; } -@@ -1543,6 +_,10 @@ +@@ -1531,6 +_,10 @@ } public void m_6756_(int p_36291_) { @@ -343,7 +342,7 @@ this.m_36401_(p_36291_); this.f_36080_ += (float)p_36291_ / (float)this.m_36323_(); this.f_36079_ = Mth.m_14045_(this.f_36079_ + p_36291_, 0, Integer.MAX_VALUE); -@@ -1571,7 +_,7 @@ +@@ -1559,7 +_,7 @@ } public void m_7408_(ItemStack p_36172_, int p_36173_) { @@ -352,7 +351,7 @@ if (this.f_36078_ < 0) { this.f_36078_ = 0; this.f_36080_ = 0.0F; -@@ -1582,6 +_,10 @@ +@@ -1570,6 +_,10 @@ } public void m_6749_(int p_36276_) { @@ -363,7 +362,7 @@ this.f_36078_ += p_36276_; if (this.f_36078_ < 0) { this.f_36078_ = 0; -@@ -1773,7 +_,11 @@ +@@ -1765,7 +_,11 @@ } public Component m_5446_() { @@ -376,7 +375,7 @@ return this.m_36218_(mutablecomponent); } -@@ -1910,24 +_,24 @@ +@@ -1902,24 +_,24 @@ Predicate predicate = ((ProjectileWeaponItem)p_36349_.m_41720_()).m_6442_(); ItemStack itemstack = ProjectileWeaponItem.m_43010_(this, predicate); if (!itemstack.m_41619_()) { @@ -405,7 +404,7 @@ this.m_36246_(Stats.f_12982_.m_12902_(p_36186_.m_41720_())); p_36185_.m_6263_((Player)null, this.m_20185_(), this.m_20186_(), this.m_20189_(), SoundEvents.f_12321_, SoundSource.PLAYERS, 0.5F, p_36185_.f_46441_.m_188501_() * 0.1F + 0.9F); if (this instanceof ServerPlayer) { -@@ -2014,5 +_,63 @@ +@@ -2027,5 +_,63 @@ public Component m_36423_() { return this.f_36413_; } diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch index 10fb4d333e..11b1da7b41 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/FireworkRocketEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java +++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -@@ -151,6 +_,13 @@ +@@ -150,6 +_,13 @@ } @@ -13,4 +13,4 @@ + private void m_37080_() { this.f_19853_.m_7605_(this, (byte)17); - this.m_146852_(GameEvent.f_157812_, this.m_37282_()); + this.m_146852_(GameEvent.f_157812_, this.m_19749_()); diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/FishingHook.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/FishingHook.java.patch index 6c34b13958..9cf881cf5d 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/FishingHook.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/FishingHook.java.patch @@ -23,7 +23,7 @@ @@ -296,7 +_,7 @@ double d1 = (double)((float)Mth.m_14107_(this.m_20186_()) + 1.0F); double d2 = this.m_20189_() + (double)(f2 * (float)this.f_37091_ * 0.1F); - BlockState blockstate = serverlevel.m_8055_(new BlockPos(d0, d1 - 1.0D, d2)); + BlockState blockstate = serverlevel.m_8055_(BlockPos.m_274561_(d0, d1 - 1.0D, d2)); - if (blockstate.m_60713_(Blocks.f_49990_)) { + if (serverlevel.m_8055_(new BlockPos((int)d0, (int)d1 - 1, (int)d2)).m_60767_() == net.minecraft.world.level.material.Material.f_76305_) { if (this.f_19796_.m_188501_() < 0.15F) { @@ -32,9 +32,9 @@ @@ -332,7 +_,7 @@ double d5 = (double)((float)Mth.m_14107_(this.m_20186_()) + 1.0F); double d6 = this.m_20189_() + (double)(Mth.m_14089_(f6) * f7) * 0.1D; - BlockState blockstate1 = serverlevel.m_8055_(new BlockPos(d4, d5 - 1.0D, d6)); + BlockState blockstate1 = serverlevel.m_8055_(BlockPos.m_274561_(d4, d5 - 1.0D, d6)); - if (blockstate1.m_60713_(Blocks.f_49990_)) { -+ if (serverlevel.m_8055_(new BlockPos(d4, d5 - 1.0D, d6)).m_60767_() == net.minecraft.world.level.material.Material.f_76305_) { ++ if (blockstate1.m_60767_() == net.minecraft.world.level.material.Material.f_76305_) { serverlevel.m_8767_(ParticleTypes.f_123769_, d4, d5, d6, 2 + this.f_19796_.m_188503_(2), (double)0.1F, 0.0D, (double)0.1F, 0.0D); } } @@ -50,7 +50,7 @@ i = this.f_37094_ instanceof ItemEntity ? 3 : 5; } else if (this.f_37089_ > 0) { LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerLevel)this.f_19853_)).m_78972_(LootContextParams.f_81460_, this.m_20182_()).m_78972_(LootContextParams.f_81463_, p_37157_).m_78972_(LootContextParams.f_81455_, this).m_230911_(this.f_19796_).m_78963_((float)this.f_37096_ + player.m_36336_()); -+ lootcontext$builder.m_78972_(LootContextParams.f_81458_, this.m_37282_()).m_78972_(LootContextParams.f_81455_, this); ++ lootcontext$builder.m_78972_(LootContextParams.f_81458_, this.m_19749_()).m_78972_(LootContextParams.f_81455_, this); LootTable loottable = this.f_19853_.m_7654_().m_129898_().m_79217_(BuiltInLootTables.f_78720_); List list = loottable.m_230922_(lootcontext$builder.m_78975_(LootContextParamSets.f_81414_)); + event = new net.minecraftforge.event.entity.player.ItemFishedEvent(list, this.f_19861_ ? 2 : 1, this); diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/LargeFireball.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/LargeFireball.java.patch index 86a03b827b..bfd00ca250 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/LargeFireball.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/LargeFireball.java.patch @@ -1,12 +1,12 @@ --- a/net/minecraft/world/entity/projectile/LargeFireball.java +++ b/net/minecraft/world/entity/projectile/LargeFireball.java -@@ -25,7 +_,8 @@ +@@ -24,7 +_,8 @@ protected void m_6532_(HitResult p_37218_) { super.m_6532_(p_37218_); if (!this.f_19853_.f_46443_) { - boolean flag = this.f_19853_.m_46469_().m_46207_(GameRules.f_46132_); + // TODO 1.19.3: The creation of Level.ExplosionInteraction means this code path will fire EntityMobGriefingEvent twice. Should we try and fix it? -SS -+ boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.f_19853_, this.m_37282_()); ++ boolean flag = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.f_19853_, this.m_19749_()); this.f_19853_.m_255391_(this, this.m_20185_(), this.m_20186_(), this.m_20189_(), (float)this.f_37197_, flag, Level.ExplosionInteraction.MOB); this.m_146870_(); } diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/LlamaSpit.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/LlamaSpit.java.patch index cd74a985e3..0565b0215a 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/LlamaSpit.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/LlamaSpit.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/LlamaSpit.java +++ b/net/minecraft/world/entity/projectile/LlamaSpit.java -@@ -30,6 +_,7 @@ +@@ -29,6 +_,7 @@ super.m_8119_(); Vec3 vec3 = this.m_20184_(); HitResult hitresult = ProjectileUtil.m_37294_(this, this::m_5603_); diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch index 327fdc44d9..5ed12bc06f 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/Projectile.java +++ b/net/minecraft/world/entity/projectile/Projectile.java -@@ -212,7 +_,7 @@ +@@ -213,7 +_,7 @@ if (entity instanceof Player) { return entity.m_142265_(p_150167_, p_150168_); } else { diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch index b6847b227b..31fba1a948 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/ShulkerBullet.java +++ b/net/minecraft/world/entity/projectile/ShulkerBullet.java -@@ -211,7 +_,7 @@ +@@ -212,7 +_,7 @@ } HitResult hitresult = ProjectileUtil.m_37294_(this, this::m_5603_); diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/SmallFireball.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/SmallFireball.java.patch index 17bc89767b..fb83e39184 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/SmallFireball.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/SmallFireball.java.patch @@ -3,7 +3,7 @@ @@ -46,7 +_,7 @@ super.m_8060_(p_37384_); if (!this.f_19853_.f_46443_) { - Entity entity = this.m_37282_(); + Entity entity = this.m_19749_(); - if (!(entity instanceof Mob) || this.f_19853_.m_46469_().m_46207_(GameRules.f_46132_)) { + if (!(entity instanceof Mob) || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.f_19853_, entity)) { BlockPos blockpos = p_37384_.m_82425_().m_121945_(p_37384_.m_82434_()); diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch index f4c0de75d3..b680796a03 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch @@ -1,33 +1,33 @@ --- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java +++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java -@@ -47,6 +_,8 @@ +@@ -46,6 +_,8 @@ if (entity instanceof ServerPlayer) { ServerPlayer serverplayer = (ServerPlayer)entity; - if (serverplayer.f_8906_.m_6198_().m_129536_() && serverplayer.f_19853_ == this.f_19853_ && !serverplayer.m_5803_()) { + if (serverplayer.f_8906_.m_6198_() && serverplayer.f_19853_ == this.f_19853_ && !serverplayer.m_5803_()) { + net.minecraftforge.event.entity.EntityTeleportEvent.EnderPearl event = net.minecraftforge.event.ForgeEventFactory.onEnderPearlLand(serverplayer, this.m_20185_(), this.m_20186_(), this.m_20189_(), this, 5.0F, p_37504_); + if (!event.isCanceled()) { // Don't indent to lower patch size if (this.f_19796_.m_188501_() < 0.05F && this.f_19853_.m_46469_().m_46207_(GameRules.f_46134_)) { Endermite endermite = EntityType.f_20567_.m_20615_(this.f_19853_); if (endermite != null) { -@@ -61,8 +_,10 @@ +@@ -60,8 +_,10 @@ entity.m_6021_(this.m_20185_(), this.m_20186_(), this.m_20189_()); } + entity.m_6021_(event.getTargetX(), event.getTargetY(), event.getTargetZ()); entity.m_183634_(); -- entity.m_6469_(DamageSource.f_19315_, 5.0F); -+ entity.m_6469_(DamageSource.f_19315_, event.getAttackDamage()); +- entity.m_6469_(this.m_269291_().m_268989_(), 5.0F); ++ entity.m_6469_(this.m_269291_().m_268989_(), event.getAttackDamage()); + } //Forge: End } } else if (entity != null) { entity.m_6021_(this.m_20185_(), this.m_20186_(), this.m_20189_()); -@@ -85,12 +_,12 @@ +@@ -84,12 +_,12 @@ } @Nullable - public Entity m_5489_(ServerLevel p_37506_) { + public Entity changeDimension(ServerLevel p_37506_, net.minecraftforge.common.util.ITeleporter teleporter) { - Entity entity = this.m_37282_(); + Entity entity = this.m_19749_(); if (entity != null && entity.f_19853_.m_46472_() != p_37506_.m_46472_()) { this.m_5602_((Entity)null); } diff --git a/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch b/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch index 6f9162be26..7217e80531 100644 --- a/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java.patch @@ -6,7 +6,7 @@ public InteractionResult m_6096_(Player p_38232_, InteractionHand p_38233_) { + InteractionResult ret = super.m_6096_(p_38232_, p_38233_); + if (ret.m_19077_()) return ret; - return this.m_219931_(this::m_146852_, p_38232_); + return this.m_268996_(p_38232_); } @@ -119,6 +_,28 @@ diff --git a/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch b/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch index abb2347b62..c6e2761d1d 100644 --- a/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch @@ -9,7 +9,7 @@ private static final EntityDataAccessor f_38282_ = SynchedEntityData.m_135353_(Boat.class, EntityDataSerializers.f_135028_); private static final EntityDataAccessor f_38283_ = SynchedEntityData.m_135353_(Boat.class, EntityDataSerializers.f_135028_); private static final EntityDataAccessor f_38284_ = SynchedEntityData.m_135353_(Boat.class, EntityDataSerializers.f_135029_); -@@ -452,7 +_,7 @@ +@@ -455,7 +_,7 @@ for(int i2 = i1; i2 < j1; ++i2) { blockpos$mutableblockpos.m_122178_(l1, k1, i2); FluidState fluidstate = this.f_19853_.m_6425_(blockpos$mutableblockpos); @@ -18,7 +18,7 @@ f = Math.max(f, fluidstate.m_76155_(this.f_19853_, blockpos$mutableblockpos)); } -@@ -493,7 +_,7 @@ +@@ -496,7 +_,7 @@ blockpos$mutableblockpos.m_122178_(l1, k2, i2); BlockState blockstate = this.f_19853_.m_8055_(blockpos$mutableblockpos); if (!(blockstate.m_60734_() instanceof WaterlilyBlock) && Shapes.m_83157_(blockstate.m_60812_(this.f_19853_, blockpos$mutableblockpos).m_83216_((double)l1, (double)k2, (double)i2), voxelshape, BooleanOp.f_82689_)) { @@ -27,7 +27,7 @@ ++k1; } } -@@ -522,7 +_,7 @@ +@@ -525,7 +_,7 @@ for(int i2 = i1; i2 < j1; ++i2) { blockpos$mutableblockpos.m_122178_(k1, l1, i2); FluidState fluidstate = this.f_19853_.m_6425_(blockpos$mutableblockpos); @@ -36,7 +36,7 @@ float f = (float)l1 + fluidstate.m_76155_(this.f_19853_, blockpos$mutableblockpos); this.f_38277_ = Math.max((double)f, this.f_38277_); flag |= aabb.f_82289_ < (double)f; -@@ -552,7 +_,7 @@ +@@ -555,7 +_,7 @@ for(int i2 = i1; i2 < j1; ++i2) { blockpos$mutableblockpos.m_122178_(k1, l1, i2); FluidState fluidstate = this.f_19853_.m_6425_(blockpos$mutableblockpos); @@ -45,7 +45,7 @@ if (!fluidstate.m_76170_()) { return Boat.Status.UNDER_FLOWING_WATER; } -@@ -766,7 +_,7 @@ +@@ -773,7 +_,7 @@ } this.m_183634_(); @@ -54,7 +54,7 @@ this.f_19789_ -= (float)p_38307_; } -@@ -822,7 +_,7 @@ +@@ -829,7 +_,7 @@ } protected boolean m_7310_(Entity p_38390_) { @@ -63,7 +63,7 @@ } protected int m_213801_() { -@@ -843,6 +_,16 @@ +@@ -858,6 +_,16 @@ public boolean m_5842_() { return this.f_38279_ == Boat.Status.UNDER_WATER || this.f_38279_ == Boat.Status.UNDER_FLOWING_WATER; diff --git a/patches/minecraft/net/minecraft/world/entity/vehicle/ChestBoat.java.patch b/patches/minecraft/net/minecraft/world/entity/vehicle/ChestBoat.java.patch index c2850b0312..3009347203 100644 --- a/patches/minecraft/net/minecraft/world/entity/vehicle/ChestBoat.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/vehicle/ChestBoat.java.patch @@ -1,10 +1,9 @@ --- a/net/minecraft/world/entity/vehicle/ChestBoat.java +++ b/net/minecraft/world/entity/vehicle/ChestBoat.java -@@ -190,4 +_,26 @@ - public void m_213775_() { +@@ -204,6 +_,28 @@ this.f_219864_ = NonNullList.m_122780_(this.m_6643_(), ItemStack.f_41583_); } -+ + + // Forge Start + private net.minecraftforge.common.util.LazyOptional itemHandler = net.minecraftforge.common.util.LazyOptional.of(() -> new net.minecraftforge.items.wrapper.InvWrapper(this)); + @@ -26,4 +25,7 @@ + super.reviveCaps(); + itemHandler = net.minecraftforge.common.util.LazyOptional.of(() -> new net.minecraftforge.items.wrapper.InvWrapper(this)); + } - } ++ + public void m_5785_(Player p_270286_) { + this.f_19853_.m_214171_(GameEvent.f_157802_, this.m_20182_(), GameEvent.Context.m_223717_(p_270286_)); + } diff --git a/patches/minecraft/net/minecraft/world/entity/vehicle/ContainerEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/vehicle/ContainerEntity.java.patch index 590c5c081a..35e1c302f4 100644 --- a/patches/minecraft/net/minecraft/world/entity/vehicle/ContainerEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/vehicle/ContainerEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/vehicle/ContainerEntity.java +++ b/net/minecraft/world/entity/vehicle/ContainerEntity.java -@@ -111,6 +_,9 @@ +@@ -103,6 +_,9 @@ this.m_214199_((ResourceLocation)null); LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerLevel)this.m_9236_())).m_78972_(LootContextParams.f_81460_, this.m_20182_()).m_78965_(this.m_213803_()); diff --git a/patches/minecraft/net/minecraft/world/food/FoodData.java.patch b/patches/minecraft/net/minecraft/world/food/FoodData.java.patch index 15549a40ef..07048f02cf 100644 --- a/patches/minecraft/net/minecraft/world/food/FoodData.java.patch +++ b/patches/minecraft/net/minecraft/world/food/FoodData.java.patch @@ -1,7 +1,10 @@ --- a/net/minecraft/world/food/FoodData.java +++ b/net/minecraft/world/food/FoodData.java -@@ -24,9 +_,15 @@ +@@ -21,11 +_,18 @@ + public void m_38707_(int p_38708_, float p_38709_) { + this.f_38696_ = Math.min(p_38708_ + this.f_38696_, 20); this.f_38697_ = Math.min(this.f_38697_ + (float)p_38708_ * p_38709_ * 2.0F, (float)this.f_38696_); ++ this.f_38697_ = Math.min(this.f_38697_ + (float)p_38708_ * p_38709_ * 2.0F, (float)this.f_38696_); } + // Use the LivingEntity sensitive version in favour of this. diff --git a/patches/minecraft/net/minecraft/world/inventory/AnvilMenu.java.patch b/patches/minecraft/net/minecraft/world/inventory/AnvilMenu.java.patch index 8566aff68b..5fc26a4bba 100644 --- a/patches/minecraft/net/minecraft/world/inventory/AnvilMenu.java.patch +++ b/patches/minecraft/net/minecraft/world/inventory/AnvilMenu.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/inventory/AnvilMenu.java +++ b/net/minecraft/world/inventory/AnvilMenu.java -@@ -53,6 +_,8 @@ +@@ -68,6 +_,8 @@ p_150474_.m_6749_(-this.f_39002_.m_6501_()); } @@ -9,7 +9,7 @@ this.f_39769_.m_6836_(0, ItemStack.f_41583_); if (this.f_39000_ > 0) { ItemStack itemstack = this.f_39769_.m_8020_(1); -@@ -69,7 +_,7 @@ +@@ -84,7 +_,7 @@ this.f_39002_.m_6422_(0); this.f_39770_.m_39292_((p_150479_, p_150480_) -> { BlockState blockstate = p_150479_.m_8055_(p_150480_); @@ -18,7 +18,7 @@ BlockState blockstate1 = AnvilBlock.m_48824_(blockstate); if (blockstate1 == null) { p_150479_.m_7471_(p_150480_, false); -@@ -100,8 +_,11 @@ +@@ -115,8 +_,11 @@ Map map = EnchantmentHelper.m_44831_(itemstack1); j += itemstack.m_41610_() + (itemstack2.m_41619_() ? 0 : itemstack2.m_41610_()); this.f_39000_ = 0; @@ -31,7 +31,7 @@ if (itemstack1.m_41763_() && itemstack1.m_41720_().m_6832_(itemstack, itemstack2)) { int l2 = Math.min(itemstack1.m_41773_(), itemstack1.m_41776_() / 4); if (l2 <= 0) { -@@ -218,6 +_,7 @@ +@@ -233,6 +_,7 @@ i += k; itemstack1.m_41714_(Component.m_237113_(this.f_39001_)); } @@ -39,7 +39,7 @@ this.f_39002_.m_6422_(j + i); if (i <= 0) { -@@ -271,5 +_,9 @@ +@@ -286,5 +_,9 @@ public int m_39028_() { return this.f_39002_.m_6501_(); diff --git a/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch b/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch index 778090bb13..46395d76e0 100644 --- a/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch +++ b/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/inventory/MenuType.java +++ b/net/minecraft/world/inventory/MenuType.java -@@ -4,7 +_,7 @@ - import net.minecraft.core.registries.BuiltInRegistries; - import net.minecraft.world.entity.player.Inventory; +@@ -8,7 +_,7 @@ + import net.minecraft.world.flag.FeatureFlagSet; + import net.minecraft.world.flag.FeatureFlags; --public class MenuType { -+public class MenuType implements net.minecraftforge.common.extensions.IForgeMenuType { +-public class MenuType implements FeatureElement { ++public class MenuType implements FeatureElement, net.minecraftforge.common.extensions.IForgeMenuType { public static final MenuType f_39957_ = m_39988_("generic_9x1", ChestMenu::m_39234_); public static final MenuType f_39958_ = m_39988_("generic_9x2", ChestMenu::m_39243_); public static final MenuType f_39959_ = m_39988_("generic_9x3", ChestMenu::m_39255_); -@@ -43,6 +_,14 @@ +@@ -54,6 +_,14 @@ public T m_39985_(int p_39986_, Inventory p_39987_) { return this.f_39981_.m_39994_(p_39986_, p_39987_); @@ -23,4 +23,4 @@ + return m_39985_(windowId, playerInv); } - public interface MenuSupplier { + public FeatureFlagSet m_245183_() { diff --git a/patches/minecraft/net/minecraft/world/inventory/Slot.java.patch b/patches/minecraft/net/minecraft/world/inventory/Slot.java.patch index 8fa5b7819b..5f226c8879 100644 --- a/patches/minecraft/net/minecraft/world/inventory/Slot.java.patch +++ b/patches/minecraft/net/minecraft/world/inventory/Slot.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/inventory/Slot.java +++ b/net/minecraft/world/inventory/Slot.java -@@ -79,7 +_,7 @@ +@@ -78,7 +_,7 @@ @Nullable public Pair m_7543_() { @@ -9,7 +9,7 @@ } public ItemStack m_6201_(int p_40227_) { -@@ -92,6 +_,38 @@ +@@ -91,6 +_,38 @@ public boolean m_6659_() { return true; diff --git a/patches/minecraft/net/minecraft/world/item/ArmorItem.java.patch b/patches/minecraft/net/minecraft/world/item/ArmorItem.java.patch index ec3edebf7c..5568942694 100644 --- a/patches/minecraft/net/minecraft/world/item/ArmorItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/ArmorItem.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/item/ArmorItem.java +++ b/net/minecraft/world/item/ArmorItem.java -@@ -70,7 +_,7 @@ - UUID uuid = f_40380_[p_40387_.m_20749_()]; +@@ -75,7 +_,7 @@ + UUID uuid = f_265987_.get(p_266831_); builder.put(Attributes.f_22284_, new AttributeModifier(uuid, "Armor modifier", (double)this.f_40381_, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.f_22285_, new AttributeModifier(uuid, "Armor toughness", (double)this.f_40382_, AttributeModifier.Operation.ADDITION)); - if (p_40386_ == ArmorMaterials.NETHERITE) { diff --git a/patches/minecraft/net/minecraft/world/item/CreativeModeTab.java.patch b/patches/minecraft/net/minecraft/world/item/CreativeModeTab.java.patch index 262c182deb..c38cfa3e4f 100644 --- a/patches/minecraft/net/minecraft/world/item/CreativeModeTab.java.patch +++ b/patches/minecraft/net/minecraft/world/item/CreativeModeTab.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/CreativeModeTab.java +++ b/net/minecraft/world/item/CreativeModeTab.java -@@ -28,14 +_,30 @@ +@@ -29,14 +_,30 @@ private Consumer> f_256965_; private final Supplier f_256912_; private final CreativeModeTab.DisplayItemsGenerator f_256824_; @@ -32,7 +32,7 @@ } public static CreativeModeTab.Builder m_257815_(CreativeModeTab.Row p_259342_, int p_260312_) { -@@ -54,6 +_,10 @@ +@@ -55,6 +_,10 @@ return this.f_40770_; } @@ -43,16 +43,16 @@ public String m_40788_() { return this.f_40766_; } -@@ -92,7 +_,7 @@ +@@ -93,7 +_,7 @@ - public void m_258021_(FeatureFlagSet p_260125_, boolean p_259855_) { - CreativeModeTab.ItemDisplayBuilder creativemodetab$itemdisplaybuilder = new CreativeModeTab.ItemDisplayBuilder(this, p_260125_); -- this.f_256824_.m_257865_(p_260125_, creativemodetab$itemdisplaybuilder, p_259855_); -+ net.minecraftforge.client.ForgeHooksClient.onCreativeModeTabBuildContents(this, this.f_256824_, p_260125_, creativemodetab$itemdisplaybuilder, p_259855_); + public void m_269498_(CreativeModeTab.ItemDisplayParameters p_270156_) { + CreativeModeTab.ItemDisplayBuilder creativemodetab$itemdisplaybuilder = new CreativeModeTab.ItemDisplayBuilder(this, p_270156_.f_268709_); +- this.f_256824_.m_257865_(p_270156_, creativemodetab$itemdisplaybuilder); ++ net.minecraftforge.client.ForgeHooksClient.onCreativeModeTabBuildContents(this, this.f_256824_, p_270156_, creativemodetab$itemdisplaybuilder); this.f_243839_ = creativemodetab$itemdisplaybuilder.f_244363_; this.f_243841_ = creativemodetab$itemdisplaybuilder.f_244585_; this.m_257466_(); -@@ -121,9 +_,34 @@ +@@ -122,9 +_,34 @@ } @@ -81,13 +81,13 @@ + } + public static class Builder { - private static final CreativeModeTab.DisplayItemsGenerator f_256756_ = (p_259074_, p_259433_, p_260293_) -> { + private static final CreativeModeTab.DisplayItemsGenerator f_256756_ = (p_270422_, p_259433_) -> { }; + private static final net.minecraft.resources.ResourceLocation CREATIVE_INVENTORY_TABS_IMAGE = new net.minecraft.resources.ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); private final CreativeModeTab.Row f_256796_; private final int f_256977_; private Component f_256856_ = Component.m_237119_(); -@@ -136,6 +_,14 @@ +@@ -137,6 +_,14 @@ private boolean f_256854_ = false; private CreativeModeTab.Type f_256847_ = CreativeModeTab.Type.CATEGORY; private String f_257036_ = "items.png"; @@ -102,7 +102,7 @@ public Builder(CreativeModeTab.Row p_259171_, int p_259661_) { this.f_256796_ = p_259171_; -@@ -174,11 +_,49 @@ +@@ -175,11 +_,49 @@ protected CreativeModeTab.Builder m_257623_(CreativeModeTab.Type p_259283_) { this.f_256847_ = p_259283_; @@ -153,7 +153,7 @@ return this; } -@@ -186,11 +_,12 @@ +@@ -187,11 +_,12 @@ if ((this.f_256847_ == CreativeModeTab.Type.HOTBAR || this.f_256847_ == CreativeModeTab.Type.INVENTORY) && this.f_256953_ != f_256756_) { throw new IllegalStateException("Special tabs can't have display items"); } else { diff --git a/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch b/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch index 595cf3be0a..2f84b2469d 100644 --- a/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch +++ b/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/item/CreativeModeTabs.java +++ b/net/minecraft/world/item/CreativeModeTabs.java -@@ -1027,7 +_,7 @@ - }).m_257501_((p_261440_, p_261441_, p_261442_) -> { +@@ -1063,7 +_,7 @@ + }).m_257501_((p_270987_, p_261441_) -> { Set set = ItemStackLinkedSet.m_261170_(); - for(CreativeModeTab creativemodetab : CreativeModeTabs.f_243931_) { @@ -9,14 +9,13 @@ if (creativemodetab.m_257962_() != CreativeModeTab.Type.SEARCH) { set.addAll(creativemodetab.m_261235_()); } -@@ -1450,11 +_,15 @@ - return new ItemStack(Blocks.f_50087_); - }).m_257609_("inventory.png").m_257809_().m_257826_().m_257623_(CreativeModeTab.Type.INVENTORY).m_257794_().m_257652_(); - private static final List f_243931_ = m_257615_(f_256788_, f_256725_, f_256776_, f_256791_, f_257028_, f_256917_, f_256750_, f_256869_, f_256797_, f_256839_, f_256968_, f_256731_, f_256837_, f_257039_); +@@ -1524,10 +_,14 @@ + private static final Comparator> f_268478_ = Comparator.comparing(Holder::m_203334_, Comparator.comparingInt((p_270004_) -> { + return p_270004_.m_218909_() * p_270004_.m_218908_(); + }).thenComparing(PaintingVariant::m_218908_)); + private static final List DEFAULT_TABS = com.google.common.collect.ImmutableList.of(f_256917_, f_256750_, f_256837_, f_257039_); @Nullable - public static FeatureFlagSet f_256842_; - public static boolean f_256844_ = false; + private static CreativeModeTab.ItemDisplayParameters f_268496_; + private static final List FORGE_TABS_VIEW = net.minecraftforge.common.util.ConcatenatedListView.of(net.minecraftforge.common.CreativeModeTabRegistry.getSortedCreativeModeTabs(), DEFAULT_TABS); private static List m_257615_(CreativeModeTab... p_259856_) { @@ -25,7 +24,7 @@ Map, String> map = new HashMap<>(); for(CreativeModeTab creativemodetab : p_259856_) { -@@ -1469,7 +_,7 @@ +@@ -1542,7 +_,7 @@ } public static CreativeModeTab m_257543_() { @@ -33,26 +32,26 @@ + return net.minecraftforge.common.CreativeModeTabRegistry.getSortedCreativeModeTabs().stream().filter(CreativeModeTab::m_257497_).findFirst().orElse(f_256788_); } - private static void m_247461_(CreativeModeTab.Output p_249919_, Item p_249272_, CreativeModeTab.TabVisibility p_251809_) { -@@ -1483,7 +_,7 @@ + private static void m_269246_(CreativeModeTab.Output p_270129_, HolderLookup p_270334_, Item p_270968_, CreativeModeTab.TabVisibility p_270778_) { +@@ -1557,7 +_,7 @@ - private static void m_247563_(CreativeModeTab.Output p_249134_, Set p_251824_, CreativeModeTab.TabVisibility p_250904_) { - for(Enchantment enchantment : BuiltInRegistries.f_256876_) { -- if (p_251824_.contains(enchantment.f_44672_)) { -+ if (enchantment.allowedInCreativeTab(Items.f_42690_, p_251824_)) { - p_249134_.m_246267_(EnchantedBookItem.m_41161_(new EnchantmentInstance(enchantment, enchantment.m_6586_())), p_250904_); - } - } -@@ -1492,7 +_,7 @@ + private static void m_269182_(CreativeModeTab.Output p_270868_, HolderLookup p_270903_, Set p_270380_, CreativeModeTab.TabVisibility p_270407_) { + p_270903_.m_214062_().map(Holder::m_203334_).filter((p_270008_) -> { +- return p_270380_.contains(p_270008_.f_44672_); ++ return p_270008_.allowedInCreativeTab(Items.f_42690_, p_270380_); + }).map((p_270038_) -> { + return EnchantedBookItem.m_41161_(new EnchantmentInstance(p_270038_, p_270038_.m_6586_())); + }).forEach((p_269989_) -> { +@@ -1567,7 +_,7 @@ - private static void m_245641_(CreativeModeTab.Output p_249319_, Set p_249855_, CreativeModeTab.TabVisibility p_251772_) { - for(Enchantment enchantment : BuiltInRegistries.f_256876_) { -- if (p_249855_.contains(enchantment.f_44672_)) { -+ if (enchantment.allowedInCreativeTab(Items.f_42690_, p_249855_)) { - for(int i = enchantment.m_44702_(); i <= enchantment.m_6586_(); ++i) { - p_249319_.m_246267_(EnchantedBookItem.m_41161_(new EnchantmentInstance(enchantment, i)), p_251772_); - } -@@ -1531,11 +_,11 @@ + private static void m_269335_(CreativeModeTab.Output p_270961_, HolderLookup p_270628_, Set p_271024_, CreativeModeTab.TabVisibility p_270805_) { + p_270628_.m_214062_().map(Holder::m_203334_).filter((p_269991_) -> { +- return p_271024_.contains(p_269991_.f_44672_); ++ return p_269991_.allowedInCreativeTab(Items.f_42690_, p_271024_); + }).flatMap((p_270024_) -> { + return IntStream.rangeClosed(p_270024_.m_44702_(), p_270024_.m_6586_()).mapToObj((p_270006_) -> { + return EnchantedBookItem.m_41161_(new EnchantmentInstance(p_270024_, p_270006_)); +@@ -1619,11 +_,11 @@ } public static List m_257388_() { @@ -66,23 +65,23 @@ } public static CreativeModeTab m_258007_() { -@@ -1543,12 +_,12 @@ +@@ -1631,12 +_,12 @@ } - private static void m_257534_(FeatureFlagSet p_259307_, boolean p_260177_) { + private static void m_269421_(CreativeModeTab.ItemDisplayParameters p_270447_) { - f_243931_.stream().filter((p_259647_) -> { + m_257478_().stream().filter((p_259647_) -> { return p_259647_.m_257962_() == CreativeModeTab.Type.CATEGORY; - }).forEach((p_259425_) -> { - p_259425_.m_258021_(p_259307_, p_260177_); + }).forEach((p_269997_) -> { + p_269997_.m_269498_(p_270447_); }); - f_243931_.stream().filter((p_260124_) -> { + m_257478_().stream().filter((p_260124_) -> { return p_260124_.m_257962_() != CreativeModeTab.Type.CATEGORY; - }).forEach((p_259952_) -> { - p_259952_.m_258021_(p_259307_, p_260177_); -@@ -1568,5 +_,9 @@ - m_257534_(f_256842_, f_256844_); + }).forEach((p_270002_) -> { + p_270002_.m_269498_(p_270447_); +@@ -1651,5 +_,9 @@ + m_269421_(f_268496_); return true; } + } diff --git a/patches/minecraft/net/minecraft/world/item/CrossbowItem.java.patch b/patches/minecraft/net/minecraft/world/item/CrossbowItem.java.patch index 0ecf23d3c4..f659deca02 100644 --- a/patches/minecraft/net/minecraft/world/item/CrossbowItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/CrossbowItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/CrossbowItem.java +++ b/net/minecraft/world/item/CrossbowItem.java -@@ -240,6 +_,7 @@ +@@ -241,6 +_,7 @@ } public static void m_40887_(Level p_40888_, LivingEntity p_40889_, InteractionHand p_40890_, ItemStack p_40891_, float p_40892_, float p_40893_) { diff --git a/patches/minecraft/net/minecraft/world/item/ElytraItem.java.patch b/patches/minecraft/net/minecraft/world/item/ElytraItem.java.patch index fa14b50725..4950d40030 100644 --- a/patches/minecraft/net/minecraft/world/item/ElytraItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/ElytraItem.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/item/ElytraItem.java +++ b/net/minecraft/world/item/ElytraItem.java -@@ -43,6 +_,25 @@ - } +@@ -27,6 +_,25 @@ + return this.m_269277_(this, p_41137_, p_41138_, p_41139_); } + @Override @@ -23,6 +23,6 @@ + return true; + } + - @Nullable - public SoundEvent m_142602_() { + public SoundEvent m_150681_() { return SoundEvents.f_11674_; + } diff --git a/patches/minecraft/net/minecraft/world/item/Item.java.patch b/patches/minecraft/net/minecraft/world/item/Item.java.patch index 2bf5870184..96b194587d 100644 --- a/patches/minecraft/net/minecraft/world/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/world/item/Item.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/Item.java +++ b/net/minecraft/world/item/Item.java -@@ -49,9 +_,9 @@ +@@ -50,9 +_,9 @@ import net.minecraft.world.phys.Vec3; import org.slf4j.Logger; @@ -12,7 +12,7 @@ protected static final UUID f_41374_ = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); protected static final UUID f_41375_ = UUID.fromString("FA233E1C-4180-4865-B01B-BCCE9785ACA3"); public static final int f_150884_ = 64; -@@ -98,7 +_,8 @@ +@@ -99,7 +_,8 @@ f_150883_.error("Item classes should end with Item and {} doesn't.", (Object)s); } } @@ -22,7 +22,7 @@ } /** @deprecated */ -@@ -107,6 +_,8 @@ +@@ -108,6 +_,8 @@ return this.f_204113_; } @@ -31,7 +31,7 @@ public void m_5929_(Level p_41428_, LivingEntity p_41429_, ItemStack p_41430_, int p_41431_) { } -@@ -133,9 +_,9 @@ +@@ -134,9 +_,9 @@ } public InteractionResultHolder m_7203_(Level p_41432_, Player p_41433_, InteractionHand p_41434_) { @@ -44,7 +44,7 @@ p_41433_.m_6672_(p_41434_); return InteractionResultHolder.m_19096_(itemstack); } else { -@@ -150,10 +_,12 @@ +@@ -151,10 +_,12 @@ return this.m_41472_() ? p_41411_.m_5584_(p_41410_, p_41409_) : p_41409_; } @@ -57,7 +57,7 @@ public final int m_41462_() { return this.f_41371_; } -@@ -167,11 +_,12 @@ +@@ -168,11 +_,12 @@ } public int m_142158_(ItemStack p_150900_) { @@ -72,7 +72,7 @@ return Mth.m_14169_(f / 3.0F, 1.0F, 1.0F); } -@@ -228,10 +_,12 @@ +@@ -229,10 +_,12 @@ } @Nullable @@ -85,7 +85,7 @@ public boolean m_41470_() { return this.f_41378_ != null; } -@@ -252,7 +_,7 @@ +@@ -253,7 +_,7 @@ public int m_8105_(ItemStack p_41454_) { if (p_41454_.m_41720_().m_41472_()) { @@ -94,7 +94,7 @@ } else { return 0; } -@@ -294,7 +_,7 @@ +@@ -295,7 +_,7 @@ } public boolean m_8120_(ItemStack p_41456_) { @@ -103,7 +103,7 @@ } protected static BlockHitResult m_41435_(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) { -@@ -307,11 +_,13 @@ +@@ -308,11 +_,13 @@ float f5 = Mth.m_14031_(-f * ((float)Math.PI / 180F)); float f6 = f3 * f4; float f7 = f2 * f4; @@ -119,7 +119,7 @@ public int m_6473_() { return 0; } -@@ -320,12 +_,20 @@ +@@ -321,12 +_,20 @@ return false; } @@ -141,7 +141,7 @@ } public ItemStack m_7968_() { -@@ -336,6 +_,8 @@ +@@ -337,6 +_,8 @@ return this.f_41380_ != null; } @@ -150,7 +150,7 @@ @Nullable public FoodProperties m_41473_() { return this.f_41380_; -@@ -370,6 +_,32 @@ +@@ -366,6 +_,32 @@ return this.f_243811_; } @@ -183,7 +183,7 @@ public static class Properties { int f_41478_ = 64; int f_41479_; -@@ -380,6 +_,7 @@ +@@ -376,6 +_,7 @@ FoodProperties f_41483_; boolean f_41484_; FeatureFlagSet f_244559_ = FeatureFlags.f_244377_; @@ -191,7 +191,7 @@ public Item.Properties m_41489_(FoodProperties p_41490_) { this.f_41483_ = p_41490_; -@@ -417,6 +_,11 @@ +@@ -413,6 +_,11 @@ public Item.Properties m_41486_() { this.f_41484_ = true; diff --git a/patches/minecraft/net/minecraft/world/item/ItemDisplayContext.java.patch b/patches/minecraft/net/minecraft/world/item/ItemDisplayContext.java.patch new file mode 100644 index 0000000000..369273855b --- /dev/null +++ b/patches/minecraft/net/minecraft/world/item/ItemDisplayContext.java.patch @@ -0,0 +1,60 @@ +--- a/net/minecraft/world/item/ItemDisplayContext.java ++++ b/net/minecraft/world/item/ItemDisplayContext.java +@@ -5,7 +_,7 @@ + import net.minecraft.util.ByIdMap; + import net.minecraft.util.StringRepresentable; + +-public enum ItemDisplayContext implements StringRepresentable { ++public enum ItemDisplayContext implements StringRepresentable, net.minecraftforge.common.IExtensibleEnum { + NONE(0, "none"), + THIRD_PERSON_LEFT_HAND(1, "thirdperson_lefthand"), + THIRD_PERSON_RIGHT_HAND(2, "thirdperson_righthand"), +@@ -16,14 +_,16 @@ + GROUND(7, "ground"), + FIXED(8, "fixed"); + +- public static final Codec f_268458_ = StringRepresentable.m_216439_(ItemDisplayContext::values); +- public static final IntFunction f_268648_ = ByIdMap.m_262839_(ItemDisplayContext::m_269462_, values(), ByIdMap.OutOfBoundsStrategy.ZERO); ++ public static final Codec f_268458_ = net.minecraft.util.ExtraCodecs.m_184415_(() -> net.minecraftforge.registries.ForgeRegistries.DISPLAY_CONTEXTS.get().getCodec()); ++ public static final IntFunction f_268648_ = id -> java.util.Objects.requireNonNullElse(((net.minecraftforge.registries.IForgeRegistryInternal) net.minecraftforge.registries.ForgeRegistries.DISPLAY_CONTEXTS.get()).getValue(id < 0 ? Byte.MAX_VALUE + -id : id), NONE); + private byte f_268735_; + private final String f_268747_; + + private ItemDisplayContext(int p_270624_, String p_270851_) { + this.f_268747_ = p_270851_; + this.f_268735_ = (byte)p_270624_; ++ this.isModded = false; ++ this.fallback = null; + } + + public String m_7912_() { +@@ -37,4 +_,29 @@ + public boolean m_269069_() { + return this == FIRST_PERSON_LEFT_HAND || this == FIRST_PERSON_RIGHT_HAND; + } ++ ++ // Forge start ++ private final boolean isModded; ++ @javax.annotation.Nullable ++ private final ItemDisplayContext fallback; ++ ++ private ItemDisplayContext(net.minecraft.resources.ResourceLocation serializeName, ItemDisplayContext fallback) { ++ this.f_268735_ = 0; // If the context is never registered then it should be treated as the NONE one ++ this.f_268747_ = java.util.Objects.requireNonNull(serializeName, "Modded ItemDisplayContexts must have a non-null serializeName").toString(); ++ this.isModded = true; ++ this.fallback = fallback; ++ } ++ ++ public boolean isModded() { ++ return isModded; ++ } ++ ++ public @javax.annotation.Nullable ItemDisplayContext fallback() { ++ return fallback; ++ } ++ ++ public static ItemDisplayContext create(String keyName, net.minecraft.resources.ResourceLocation serializedName, @javax.annotation.Nullable ItemDisplayContext fallback) { ++ throw new IllegalStateException("Enum not extended!"); ++ } ++ public static final net.minecraftforge.registries.IForgeRegistry.AddCallback ADD_CALLBACK = (owner, stage, id, key, obj, oldObj) -> obj.f_268735_ = id > Byte.MAX_VALUE ? (byte) -(id - Byte.MAX_VALUE) : (byte) id; // if the ID is > 127 start doing negative IDs + } diff --git a/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch index d440aedccf..513c3c028b 100644 --- a/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java -@@ -73,7 +_,7 @@ +@@ -74,7 +_,7 @@ import net.minecraft.world.level.block.state.pattern.BlockInWorld; import org.slf4j.Logger; @@ -9,7 +9,7 @@ public static final Codec f_41582_ = RecordCodecBuilder.create((p_258963_) -> { return p_258963_.group(BuiltInRegistries.f_257033_.m_194605_().fieldOf("id").forGetter((p_150946_) -> { return p_150946_.f_41589_; -@@ -83,6 +_,9 @@ +@@ -84,6 +_,9 @@ return Optional.ofNullable(p_150939_.f_41590_); })).apply(p_258963_, ItemStack::new); }); @@ -19,7 +19,7 @@ private static final Logger f_41585_ = LogUtils.getLogger(); public static final ItemStack f_41583_ = new ItemStack((Item)null); public static final DecimalFormat f_41584_ = Util.m_137469_(new DecimalFormat("#.##"), (p_41704_) -> { -@@ -138,10 +_,15 @@ +@@ -139,10 +_,15 @@ this(p_220155_.m_203334_(), p_220156_); } @@ -39,7 +39,7 @@ this.m_41721_(this.m_41773_()); } -@@ -154,14 +_,19 @@ +@@ -155,14 +_,19 @@ } private ItemStack(CompoundTag p_41608_) { @@ -60,7 +60,7 @@ this.m_41721_(this.m_41773_()); } -@@ -200,7 +_,7 @@ +@@ -201,7 +_,7 @@ } public Item m_41720_() { @@ -69,7 +69,7 @@ } public Holder m_220173_() { -@@ -228,6 +_,15 @@ +@@ -229,6 +_,15 @@ } public InteractionResult m_41661_(UseOnContext p_41662_) { @@ -85,7 +85,7 @@ Player player = p_41662_.m_43723_(); BlockPos blockpos = p_41662_.m_8083_(); BlockInWorld blockinworld = new BlockInWorld(p_41662_.m_43725_(), blockpos, false); -@@ -235,7 +_,7 @@ +@@ -236,7 +_,7 @@ return InteractionResult.PASS; } else { Item item = this.m_41720_(); @@ -94,7 +94,7 @@ if (player != null && interactionresult.m_146666_()) { player.m_36246_(Stats.f_12982_.m_12902_(item)); } -@@ -264,11 +_,15 @@ +@@ -265,11 +_,15 @@ p_41740_.m_128365_("tag", this.f_41590_.m_6426_()); } @@ -111,7 +111,7 @@ } public boolean m_41753_() { -@@ -276,7 +_,7 @@ +@@ -277,7 +_,7 @@ } public boolean m_41763_() { @@ -120,7 +120,7 @@ CompoundTag compoundtag = this.m_41783_(); return compoundtag == null || !compoundtag.m_128471_("Unbreakable"); } else { -@@ -285,19 +_,19 @@ +@@ -286,19 +_,19 @@ } public boolean m_41768_() { @@ -144,7 +144,7 @@ } public boolean m_220157_(int p_220158_, RandomSource p_220159_, @Nullable ServerPlayer p_220160_) { -@@ -333,6 +_,7 @@ +@@ -334,6 +_,7 @@ public void m_41622_(int p_41623_, T p_41624_, Consumer p_41625_) { if (!p_41624_.f_19853_.f_46443_ && (!(p_41624_ instanceof Player) || !((Player)p_41624_).m_150110_().f_35937_)) { if (this.m_41763_()) { @@ -152,7 +152,7 @@ if (this.m_220157_(p_41623_, p_41624_.m_217043_(), p_41624_ instanceof ServerPlayer ? (ServerPlayer)p_41624_ : null)) { p_41625_.accept(p_41624_); Item item = this.m_41720_(); -@@ -385,7 +_,7 @@ +@@ -386,7 +_,7 @@ } public boolean m_41735_(BlockState p_41736_) { @@ -161,7 +161,7 @@ } public InteractionResult m_41647_(Player p_41648_, LivingEntity p_41649_, InteractionHand p_41650_) { -@@ -396,7 +_,7 @@ +@@ -397,7 +_,7 @@ if (this.m_41619_()) { return f_41583_; } else { @@ -170,7 +170,7 @@ itemstack.m_41754_(this.m_41612_()); if (this.f_41590_ != null) { itemstack.f_41590_ = this.f_41590_.m_6426_(); -@@ -419,7 +_,7 @@ +@@ -420,7 +_,7 @@ if (p_41659_.f_41590_ == null && p_41660_.f_41590_ != null) { return false; } else { @@ -179,7 +179,7 @@ } } else { return false; -@@ -442,7 +_,7 @@ +@@ -443,7 +_,7 @@ } else if (this.f_41590_ == null && p_41745_.f_41590_ != null) { return false; } else { @@ -188,7 +188,7 @@ } } -@@ -550,7 +_,7 @@ +@@ -551,7 +_,7 @@ public void m_41751_(@Nullable CompoundTag p_41752_) { this.f_41590_ = p_41752_; @@ -197,7 +197,7 @@ this.m_41721_(this.m_41773_()); } -@@ -611,7 +_,7 @@ +@@ -612,7 +_,7 @@ public List m_41651_(@Nullable Player p_41652_, TooltipFlag p_41653_) { List list = Lists.newArrayList(); @@ -206,7 +206,7 @@ if (this.m_41788_()) { mutablecomponent.m_130940_(ChatFormatting.ITALIC); } -@@ -754,6 +_,7 @@ +@@ -759,6 +_,7 @@ list.add(f_243862_); } @@ -214,7 +214,7 @@ return list; } -@@ -762,7 +_,7 @@ +@@ -767,7 +_,7 @@ } private int m_41618_() { @@ -223,7 +223,7 @@ } public void m_41654_(ItemStack.TooltipPart p_41655_) { -@@ -877,9 +_,10 @@ +@@ -882,9 +_,10 @@ } } } else { @@ -235,7 +235,7 @@ return multimap; } -@@ -907,7 +_,7 @@ +@@ -912,7 +_,7 @@ MutableComponent mutablecomponent1 = ComponentUtils.m_130748_(mutablecomponent); if (!this.f_41591_) { @@ -244,7 +244,7 @@ return p_220170_.m_131144_(new HoverEvent(HoverEvent.Action.f_130832_, new HoverEvent.ItemStackInfo(this))); }); } -@@ -960,12 +_,31 @@ +@@ -965,12 +_,31 @@ this.m_41720_().m_5929_(p_41732_, p_41733_, this, p_41734_); } diff --git a/patches/minecraft/net/minecraft/world/item/Items.java.patch b/patches/minecraft/net/minecraft/world/item/Items.java.patch index c502b84431..91adca6647 100644 --- a/patches/minecraft/net/minecraft/world/item/Items.java.patch +++ b/patches/minecraft/net/minecraft/world/item/Items.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/Items.java +++ b/net/minecraft/world/item/Items.java -@@ -1210,11 +_,23 @@ +@@ -1252,11 +_,23 @@ } private static Item m_245048_(Block p_252092_, Block... p_248886_) { diff --git a/patches/minecraft/net/minecraft/world/item/PotionItem.java.patch b/patches/minecraft/net/minecraft/world/item/PotionItem.java.patch deleted file mode 100644 index 10e55f9670..0000000000 --- a/patches/minecraft/net/minecraft/world/item/PotionItem.java.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/world/item/PotionItem.java -+++ b/net/minecraft/world/item/PotionItem.java -@@ -124,6 +_,6 @@ - } - - public boolean m_5812_(ItemStack p_42999_) { -- return super.m_5812_(p_42999_) || !PotionUtils.m_43547_(p_42999_).isEmpty(); -+ return super.m_5812_(p_42999_) || PotionUtils.m_43579_(p_42999_).isFoil(p_42999_); - } - } diff --git a/patches/minecraft/net/minecraft/world/item/RecordItem.java.patch b/patches/minecraft/net/minecraft/world/item/RecordItem.java.patch index 5a3299821d..bb1c90c696 100644 --- a/patches/minecraft/net/minecraft/world/item/RecordItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/RecordItem.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/item/RecordItem.java +++ b/net/minecraft/world/item/RecordItem.java -@@ -19,17 +_,42 @@ - import net.minecraft.world.level.block.state.BlockState; +@@ -22,17 +_,42 @@ + import net.minecraft.world.level.gameevent.GameEvent; public class RecordItem extends Item { + @Deprecated // Forge: refer to WorldRender#playRecord. Modders: there's no need to reflectively modify this map! @@ -43,7 +43,7 @@ } public InteractionResult m_6225_(UseOnContext p_43048_) { -@@ -72,7 +_,7 @@ +@@ -80,7 +_,7 @@ } public SoundEvent m_43051_() { diff --git a/patches/minecraft/net/minecraft/world/item/ShearsItem.java.patch b/patches/minecraft/net/minecraft/world/item/ShearsItem.java.patch index 512c77fd79..c6187a45cf 100644 --- a/patches/minecraft/net/minecraft/world/item/ShearsItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/ShearsItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/ShearsItem.java +++ b/net/minecraft/world/item/ShearsItem.java -@@ -48,6 +_,31 @@ +@@ -49,6 +_,31 @@ } } @@ -8,7 +8,7 @@ + public net.minecraft.world.InteractionResult m_6880_(ItemStack stack, net.minecraft.world.entity.player.Player playerIn, LivingEntity entity, net.minecraft.world.InteractionHand hand) { + if (entity instanceof net.minecraftforge.common.IForgeShearable target) { + if (entity.f_19853_.f_46443_) return net.minecraft.world.InteractionResult.SUCCESS; -+ BlockPos pos = new BlockPos(entity.m_20185_(), entity.m_20186_(), entity.m_20189_()); ++ BlockPos pos = BlockPos.m_274446_(entity.m_20182_()); + if (target.isShearable(stack, entity.f_19853_, pos)) { + java.util.List drops = target.onSheared(playerIn, stack, entity.f_19853_, pos, + net.minecraft.world.item.enchantment.EnchantmentHelper.m_44843_(net.minecraft.world.item.enchantment.Enchantments.f_44987_, stack)); diff --git a/patches/minecraft/net/minecraft/world/item/ShieldItem.java.patch b/patches/minecraft/net/minecraft/world/item/ShieldItem.java.patch index 2722f5ca08..26fb5f77e1 100644 --- a/patches/minecraft/net/minecraft/world/item/ShieldItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/ShieldItem.java.patch @@ -1,14 +1,16 @@ --- a/net/minecraft/world/item/ShieldItem.java +++ b/net/minecraft/world/item/ShieldItem.java -@@ -51,4 +_,11 @@ - CompoundTag compoundtag = BlockItem.m_186336_(p_43103_); +@@ -53,6 +_,13 @@ return compoundtag != null ? DyeColor.m_41053_(compoundtag.m_128451_("Base")) : DyeColor.WHITE; } -+ + + /* ******************** FORGE START ******************** */ + + @Override + public boolean canPerformAction(ItemStack stack, net.minecraftforge.common.ToolAction toolAction) { + return net.minecraftforge.common.ToolActions.DEFAULT_SHIELD_ACTIONS.contains(toolAction); + } - } ++ + public EquipmentSlot m_40402_() { + return EquipmentSlot.OFFHAND; + } diff --git a/patches/minecraft/net/minecraft/world/item/UseAnim.java.patch b/patches/minecraft/net/minecraft/world/item/UseAnim.java.patch index de3eec1480..9c2e316780 100644 --- a/patches/minecraft/net/minecraft/world/item/UseAnim.java.patch +++ b/patches/minecraft/net/minecraft/world/item/UseAnim.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/item/UseAnim.java +++ b/net/minecraft/world/item/UseAnim.java -@@ -9,5 +_,10 @@ - SPEAR, +@@ -10,5 +_,10 @@ CROSSBOW, SPYGLASS, -- TOOT_HORN; -+ TOOT_HORN, + TOOT_HORN, +- BRUSH; ++ BRUSH, + /** + * Items with custom arm animation should return this in `Item#getUseAnimation` + * to prevent vanilla from also trying to animate same item diff --git a/patches/minecraft/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch index 68a9782d85..3e46b76332 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java +++ b/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java -@@ -81,8 +_,8 @@ +@@ -82,8 +_,8 @@ for(int i = 0; i < nonnulllist.size(); ++i) { ItemStack itemstack = p_43791_.m_8020_(i); if (!itemstack.m_41619_()) { diff --git a/patches/minecraft/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch index 8d522c838c..c1ffeaea66 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/BookCloningRecipe.java +++ b/net/minecraft/world/item/crafting/BookCloningRecipe.java -@@ -79,8 +_,8 @@ +@@ -80,8 +_,8 @@ for(int i = 0; i < nonnulllist.size(); ++i) { ItemStack itemstack = p_43820_.m_8020_(i); diff --git a/patches/minecraft/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java.patch new file mode 100644 index 0000000000..3c70ba118d --- /dev/null +++ b/patches/minecraft/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java ++++ b/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java +@@ -72,7 +_,7 @@ + + public boolean m_142505_() { + return Stream.of(this.f_265911_, this.f_265910_).anyMatch((p_267290_) -> { +- return p_267290_.m_43908_().length == 0; ++ return net.minecraftforge.common.ForgeHooks.hasNoElements(p_267290_); + }); + } + diff --git a/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch index f6ea233cbb..442efbd6f8 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/Recipe.java +++ b/net/minecraft/world/item/crafting/Recipe.java -@@ -21,9 +_,9 @@ +@@ -22,9 +_,9 @@ NonNullList nonnulllist = NonNullList.m_122780_(p_44004_.m_6643_(), ItemStack.f_41583_); for(int i = 0; i < nonnulllist.size(); ++i) { @@ -13,7 +13,7 @@ } } -@@ -55,7 +_,7 @@ +@@ -60,7 +_,7 @@ default boolean m_142505_() { NonNullList nonnulllist = this.m_7527_(); return nonnulllist.isEmpty() || nonnulllist.stream().anyMatch((p_151268_) -> { diff --git a/patches/minecraft/net/minecraft/world/item/crafting/RecipeSerializer.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/RecipeSerializer.java.patch index 1fbeaa9c79..00db70dd3b 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/RecipeSerializer.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/RecipeSerializer.java.patch @@ -9,9 +9,9 @@ RecipeSerializer f_44076_ = m_44098_("crafting_shaped", new ShapedRecipe.Serializer()); RecipeSerializer f_44077_ = m_44098_("crafting_shapeless", new ShapelessRecipe.Serializer()); RecipeSerializer f_44078_ = m_44098_("crafting_special_armordye", new SimpleCraftingRecipeSerializer<>(ArmorDyeRecipe::new)); -@@ -29,8 +_,10 @@ - RecipeSerializer f_44095_ = m_44098_("stonecutting", new SingleItemRecipe.Serializer<>(StonecutterRecipe::new)); - RecipeSerializer f_44096_ = m_44098_("smithing", new UpgradeRecipe.Serializer()); +@@ -32,8 +_,10 @@ + RecipeSerializer f_265968_ = m_44098_("smithing_trim", new SmithingTrimRecipe.Serializer()); + RecipeSerializer f_271437_ = m_44098_("crafting_decorated_pot", new SimpleCraftingRecipeSerializer<>(DecoratedPotRecipe::new)); + //Forge: use fromJson with IContext if you need the context T m_6729_(ResourceLocation p_44103_, JsonObject p_44104_); diff --git a/patches/minecraft/net/minecraft/world/item/crafting/RepairItemRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/RepairItemRecipe.java.patch index 932886a22f..18ac94ae6b 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/RepairItemRecipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/RepairItemRecipe.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/RepairItemRecipe.java +++ b/net/minecraft/world/item/crafting/RepairItemRecipe.java -@@ -27,7 +_,7 @@ +@@ -28,7 +_,7 @@ list.add(itemstack); if (list.size() > 1) { ItemStack itemstack1 = list.get(0); @@ -9,7 +9,7 @@ return false; } } -@@ -46,7 +_,7 @@ +@@ -47,7 +_,7 @@ list.add(itemstack); if (list.size() > 1) { ItemStack itemstack1 = list.get(0); @@ -18,7 +18,7 @@ return ItemStack.f_41583_; } } -@@ -56,12 +_,12 @@ +@@ -57,12 +_,12 @@ if (list.size() == 2) { ItemStack itemstack3 = list.get(0); ItemStack itemstack4 = list.get(1); diff --git a/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch index 48b578ef8c..2c9b353d0d 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/ShapedRecipe.java +++ b/net/minecraft/world/item/crafting/ShapedRecipe.java -@@ -21,7 +_,20 @@ +@@ -22,7 +_,20 @@ import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; @@ -22,7 +22,7 @@ final int f_44146_; final int f_44147_; final NonNullList f_44148_; -@@ -115,10 +_,20 @@ +@@ -126,10 +_,20 @@ return this.f_44146_; } @@ -43,7 +43,7 @@ static NonNullList m_44202_(String[] p_44203_, Map p_44204_, int p_44205_, int p_44206_) { NonNullList nonnulllist = NonNullList.m_122780_(p_44205_ * p_44206_, Ingredient.f_43901_); Set set = Sets.newHashSet(p_44204_.keySet()); -@@ -185,7 +_,7 @@ +@@ -196,7 +_,7 @@ return nonnulllist.isEmpty() || nonnulllist.stream().filter((p_151277_) -> { return !p_151277_.m_43947_(); }).anyMatch((p_151273_) -> { @@ -52,7 +52,7 @@ }); } -@@ -207,15 +_,15 @@ +@@ -218,15 +_,15 @@ static String[] m_44196_(JsonArray p_44197_) { String[] astring = new String[p_44197_.size()]; @@ -72,7 +72,7 @@ } if (i > 0 && astring[0].length() != s.length()) { -@@ -249,17 +_,7 @@ +@@ -260,17 +_,7 @@ } public static ItemStack m_151274_(JsonObject p_151275_) { @@ -91,7 +91,7 @@ } public static Item m_151278_(JsonObject p_151279_) { -@@ -275,6 +_,7 @@ +@@ -286,6 +_,7 @@ } public static class Serializer implements RecipeSerializer { diff --git a/patches/minecraft/net/minecraft/world/item/crafting/ShapelessRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/ShapelessRecipe.java.patch index e63685313b..8b806e91b5 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/ShapelessRecipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/ShapelessRecipe.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/ShapelessRecipe.java +++ b/net/minecraft/world/item/crafting/ShapelessRecipe.java -@@ -19,6 +_,7 @@ +@@ -20,6 +_,7 @@ final CraftingBookCategory f_244076_; final ItemStack f_44243_; final NonNullList f_44244_; @@ -8,7 +8,7 @@ public ShapelessRecipe(ResourceLocation p_251840_, String p_249640_, CraftingBookCategory p_249390_, ItemStack p_252071_, NonNullList p_250689_) { this.f_44241_ = p_251840_; -@@ -26,6 +_,7 @@ +@@ -27,6 +_,7 @@ this.f_244076_ = p_249390_; this.f_44243_ = p_252071_; this.f_44244_ = p_250689_; @@ -16,7 +16,7 @@ } public ResourceLocation m_6423_() { -@@ -54,17 +_,20 @@ +@@ -55,17 +_,20 @@ public boolean m_5818_(CraftingContainer p_44262_, Level p_44263_) { StackedContents stackedcontents = new StackedContents(); @@ -37,8 +37,8 @@ + return i == this.f_44244_.size() && (isSimple ? stackedcontents.m_36475_(this, (IntList)null) : net.minecraftforge.common.util.RecipeMatcher.findMatches(inputs, this.f_44244_) != null); } - public ItemStack m_5874_(CraftingContainer p_44260_) { -@@ -76,14 +_,15 @@ + public ItemStack m_5874_(CraftingContainer p_44260_, RegistryAccess p_266797_) { +@@ -77,14 +_,15 @@ } public static class Serializer implements RecipeSerializer { @@ -56,7 +56,7 @@ } else { ItemStack itemstack = ShapedRecipe.m_151274_(GsonHelper.m_13930_(p_44291_, "result")); return new ShapelessRecipe(p_44290_, s, craftingbookcategory, itemstack, nonnulllist); -@@ -95,7 +_,7 @@ +@@ -96,7 +_,7 @@ for(int i = 0; i < p_44276_.size(); ++i) { Ingredient ingredient = Ingredient.m_43917_(p_44276_.get(i)); diff --git a/patches/minecraft/net/minecraft/world/item/crafting/ShulkerBoxColoring.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/ShulkerBoxColoring.java.patch index 51f3a55ae4..c4d797c654 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/ShulkerBoxColoring.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/ShulkerBoxColoring.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/ShulkerBoxColoring.java +++ b/net/minecraft/world/item/crafting/ShulkerBoxColoring.java -@@ -25,7 +_,7 @@ +@@ -26,7 +_,7 @@ if (Block.m_49814_(itemstack.m_41720_()) instanceof ShulkerBoxBlock) { ++i; } else { @@ -9,16 +9,16 @@ return false; } -@@ -43,7 +_,7 @@ +@@ -44,7 +_,7 @@ - public ItemStack m_5874_(CraftingContainer p_44322_) { + public ItemStack m_5874_(CraftingContainer p_44322_, RegistryAccess p_266985_) { ItemStack itemstack = ItemStack.f_41583_; - DyeItem dyeitem = (DyeItem)Items.f_42535_; + net.minecraft.world.item.DyeColor dyecolor = net.minecraft.world.item.DyeColor.WHITE; for(int i = 0; i < p_44322_.m_6643_(); ++i) { ItemStack itemstack1 = p_44322_.m_8020_(i); -@@ -51,13 +_,14 @@ +@@ -52,13 +_,14 @@ Item item = itemstack1.m_41720_(); if (Block.m_49814_(item) instanceof ShulkerBoxBlock) { itemstack = itemstack1; diff --git a/patches/minecraft/net/minecraft/world/item/crafting/UpgradeRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/UpgradeRecipe.java.patch deleted file mode 100644 index 2e37c49fff..0000000000 --- a/patches/minecraft/net/minecraft/world/item/crafting/UpgradeRecipe.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/item/crafting/UpgradeRecipe.java -+++ b/net/minecraft/world/item/crafting/UpgradeRecipe.java -@@ -68,7 +_,7 @@ - - public boolean m_142505_() { - return Stream.of(this.f_44518_, this.f_44519_).anyMatch((p_151284_) -> { -- return p_151284_.m_43908_().length == 0; -+ return net.minecraftforge.common.ForgeHooks.hasNoElements(p_151284_); - }); - } - diff --git a/patches/minecraft/net/minecraft/world/item/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/world/item/enchantment/Enchantment.java.patch index e2421104a2..f88e1775f2 100644 --- a/patches/minecraft/net/minecraft/world/item/enchantment/Enchantment.java.patch +++ b/patches/minecraft/net/minecraft/world/item/enchantment/Enchantment.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/enchantment/Enchantment.java +++ b/net/minecraft/world/item/enchantment/Enchantment.java -@@ -15,7 +_,7 @@ +@@ -16,7 +_,7 @@ import net.minecraft.world.entity.MobType; import net.minecraft.world.item.ItemStack; @@ -9,7 +9,7 @@ private final EquipmentSlot[] f_44671_; private final Enchantment.Rarity f_44674_; public final EnchantmentCategory f_44672_; -@@ -70,6 +_,7 @@ +@@ -71,6 +_,7 @@ return 0; } @@ -17,7 +17,7 @@ public float m_7335_(int p_44682_, MobType p_44683_) { return 0.0F; } -@@ -110,7 +_,7 @@ +@@ -111,7 +_,7 @@ } public boolean m_6081_(ItemStack p_44689_) { @@ -26,7 +26,7 @@ } public void m_7677_(LivingEntity p_44686_, Entity p_44687_, int p_44688_) { -@@ -132,6 +_,24 @@ +@@ -133,6 +_,24 @@ } public boolean m_6592_() { diff --git a/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentCategory.java.patch b/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentCategory.java.patch index 16b5f15580..8115a61931 100644 --- a/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentCategory.java.patch +++ b/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentCategory.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/item/enchantment/EnchantmentCategory.java +++ b/net/minecraft/world/item/enchantment/EnchantmentCategory.java @@ -13,7 +_,7 @@ - import net.minecraft.world.item.Wearable; + import net.minecraft.world.item.Vanishable; import net.minecraft.world.level.block.Block; -public enum EnchantmentCategory { @@ -9,7 +9,7 @@ ARMOR { public boolean m_7454_(Item p_44751_) { return p_44751_ instanceof ArmorItem; -@@ -85,5 +_,19 @@ +@@ -109,5 +_,19 @@ } }; diff --git a/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch index ec7f06a013..7d67c5cbb8 100644 --- a/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch @@ -54,7 +54,7 @@ if (p_44897_ instanceof Player) { m_44850_(enchantmenthelper$enchantmentvisitor, p_44897_.m_21205_()); } -@@ -302,7 +_,7 @@ +@@ -306,7 +_,7 @@ public static int m_220287_(RandomSource p_220288_, int p_220289_, int p_220290_, ItemStack p_220291_) { Item item = p_220291_.m_41720_(); @@ -63,7 +63,7 @@ if (i <= 0) { return 0; } else { -@@ -340,7 +_,7 @@ +@@ -344,7 +_,7 @@ public static List m_220297_(RandomSource p_220298_, ItemStack p_220299_, int p_220300_, boolean p_220301_) { List list = Lists.newArrayList(); Item item = p_220299_.m_41720_(); @@ -72,7 +72,7 @@ if (i <= 0) { return list; } else { -@@ -396,7 +_,7 @@ +@@ -400,7 +_,7 @@ boolean flag = p_44819_.m_150930_(Items.f_42517_); for(Enchantment enchantment : BuiltInRegistries.f_256876_) { diff --git a/patches/minecraft/net/minecraft/world/level/Explosion.java.patch b/patches/minecraft/net/minecraft/world/level/Explosion.java.patch index 40dfc7c398..4abf438b36 100644 --- a/patches/minecraft/net/minecraft/world/level/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/level/Explosion.java.patch @@ -10,7 +10,7 @@ this(p_46024_, p_46025_, p_46026_, p_46027_, p_46028_, p_46029_, false, Explosion.BlockInteraction.DESTROY_WITH_DECAY, p_46030_); @@ -81,6 +_,7 @@ this.f_46010_ = p_46060_; - this.f_46018_ = p_46053_ == null ? DamageSource.m_19358_(this) : p_46053_; + this.f_46018_ = p_46053_ == null ? p_46051_.m_269111_().m_269093_(this) : p_46053_; this.f_46019_ = p_46054_ == null ? this.m_46062_(p_46052_) : p_46054_; + this.position = new Vec3(this.f_46013_, this.f_46014_, this.f_46015_); } @@ -24,7 +24,7 @@ Vec3 vec3 = new Vec3(this.f_46013_, this.f_46014_, this.f_46015_); for(int k2 = 0; k2 < list.size(); ++k2) { -@@ -238,7 +_,7 @@ +@@ -245,7 +_,7 @@ if (!blockstate.m_60795_()) { BlockPos blockpos1 = blockpos.m_7949_(); this.f_46012_.m_46473_().m_6180_("explosion_blocks"); @@ -33,7 +33,7 @@ Level $$9 = this.f_46012_; if ($$9 instanceof ServerLevel) { ServerLevel serverlevel = (ServerLevel)$$9; -@@ -255,8 +_,7 @@ +@@ -262,8 +_,7 @@ } } @@ -43,7 +43,7 @@ this.f_46012_.m_46473_().m_7238_(); } } -@@ -347,6 +_,15 @@ +@@ -354,6 +_,15 @@ public List m_46081_() { return this.f_46020_; diff --git a/patches/minecraft/net/minecraft/world/level/Level.java.patch b/patches/minecraft/net/minecraft/world/level/Level.java.patch index 3f45a398da..45fa364f39 100644 --- a/patches/minecraft/net/minecraft/world/level/Level.java.patch +++ b/patches/minecraft/net/minecraft/world/level/Level.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -68,7 +_,7 @@ +@@ -70,7 +_,7 @@ import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.Scoreboard; @@ -9,9 +9,9 @@ public static final Codec> f_46427_ = ResourceKey.m_195966_(Registries.f_256858_); public static final ResourceKey f_46428_ = ResourceKey.m_135785_(Registries.f_256858_, new ResourceLocation("overworld")); public static final ResourceKey f_46429_ = ResourceKey.m_135785_(Registries.f_256858_, new ResourceLocation("the_nether")); -@@ -107,8 +_,14 @@ - private final BiomeManager f_46420_; - private final ResourceKey f_46421_; +@@ -111,8 +_,14 @@ + private final RegistryAccess f_268710_; + private final DamageSources f_268497_; private long f_186455_; + public boolean restoringBlockSnapshots = false; + public boolean captureBlockSnapshots = false; @@ -19,12 +19,12 @@ + private final java.util.ArrayList freshBlockEntities = new java.util.ArrayList<>(); + private final java.util.ArrayList pendingFreshBlockEntities = new java.util.ArrayList<>(); - protected Level(WritableLevelData p_220352_, ResourceKey p_220353_, Holder p_220354_, Supplier p_220355_, boolean p_220356_, boolean p_220357_, long p_220358_, int p_220359_) { + protected Level(WritableLevelData p_270739_, ResourceKey p_270683_, RegistryAccess p_270200_, Holder p_270240_, Supplier p_270692_, boolean p_270904_, boolean p_270470_, long p_270248_, int p_270466_) { + super(Level.class); - this.f_46446_ = p_220355_; - this.f_46442_ = p_220352_; - this.f_204147_ = p_220354_; -@@ -193,17 +_,45 @@ + this.f_46446_ = p_270692_; + this.f_46442_ = p_270739_; + this.f_204147_ = p_270240_; +@@ -199,17 +_,45 @@ } else { LevelChunk levelchunk = this.m_46745_(p_46605_); Block block = p_46606_.m_60734_(); @@ -71,7 +71,7 @@ if (blockstate1 == p_46606_) { if (blockstate != blockstate1) { this.m_6550_(p_46605_, blockstate, blockstate1); -@@ -228,9 +_,8 @@ +@@ -234,9 +_,8 @@ } this.m_6559_(p_46605_, blockstate, blockstate1); @@ -82,7 +82,7 @@ } } } -@@ -280,6 +_,7 @@ +@@ -286,6 +_,7 @@ } public void m_46672_(BlockPos p_46673_, Block p_46674_) { @@ -90,7 +90,7 @@ } public void m_46590_(BlockPos p_46591_, Block p_46592_, Direction p_46593_) { -@@ -399,10 +_,26 @@ +@@ -405,10 +_,26 @@ (this.f_151504_ ? this.f_151503_ : this.f_151512_).add(p_151526_); } @@ -117,7 +117,7 @@ if (!this.f_151503_.isEmpty()) { this.f_151512_.addAll(this.f_151503_); this.f_151503_.clear(); -@@ -425,12 +_,19 @@ +@@ -431,12 +_,19 @@ public void m_46653_(Consumer p_46654_, T p_46655_) { try { @@ -137,7 +137,7 @@ } } -@@ -472,7 +_,7 @@ +@@ -478,7 +_,7 @@ explosion$blockinteraction1 = this.m_255157_(GameRules.f_254629_); break; case MOB: @@ -146,7 +146,7 @@ break; case TNT: explosion$blockinteraction1 = this.m_255157_(GameRules.f_254705_); -@@ -483,6 +_,7 @@ +@@ -489,6 +_,7 @@ Explosion.BlockInteraction explosion$blockinteraction = explosion$blockinteraction1; Explosion explosion = new Explosion(this, p_256233_, p_255861_, p_255867_, p_256447_, p_255732_, p_255717_, p_256013_, p_256228_, explosion$blockinteraction); @@ -154,7 +154,7 @@ explosion.m_46061_(); explosion.m_46075_(p_256377_); return explosion; -@@ -514,6 +_,7 @@ +@@ -520,6 +_,7 @@ if (!this.m_151570_(p_46748_)) { this.m_46745_(p_46748_).m_8114_(p_46748_); } @@ -162,7 +162,7 @@ } public boolean m_46749_(BlockPos p_46750_) { -@@ -584,6 +_,7 @@ +@@ -590,6 +_,7 @@ list.add(p_151522_); } @@ -170,7 +170,7 @@ if (p_151522_ instanceof EnderDragon) { for(EnderDragonPart enderdragonpart : ((EnderDragon)p_151522_).m_31156_()) { if (p_151522_ != p_46536_ && p_46538_.test(enderdragonpart)) { -@@ -593,6 +_,11 @@ +@@ -599,6 +_,11 @@ } }); @@ -182,7 +182,7 @@ return list; } -@@ -616,6 +_,8 @@ +@@ -622,6 +_,8 @@ } } @@ -191,7 +191,7 @@ if (p_261454_ instanceof EnderDragon enderdragon) { for(EnderDragonPart enderdragonpart : enderdragon.m_31156_()) { T t = p_261885_.m_141992_(enderdragonpart); -@@ -630,6 +_,15 @@ +@@ -636,6 +_,15 @@ return AbortableIterationConsumer.Continuation.CONTINUE; }); @@ -207,7 +207,7 @@ } @Nullable -@@ -684,7 +_,7 @@ +@@ -690,7 +_,7 @@ public int m_46681_(BlockPos p_46682_, Direction p_46683_) { BlockState blockstate = this.m_8055_(p_46682_); int i = blockstate.m_60746_(this, p_46682_, p_46683_); @@ -216,7 +216,7 @@ } public boolean m_46753_(BlockPos p_46754_) { -@@ -837,16 +_,15 @@ +@@ -841,16 +_,15 @@ public abstract Scoreboard m_6188_(); public void m_46717_(BlockPos p_46718_, Block p_46719_) { @@ -237,7 +237,7 @@ this.m_213960_(blockstate, blockpos, p_46719_, p_46718_, false); } } -@@ -931,6 +_,18 @@ +@@ -935,6 +_,18 @@ public BiomeManager m_7062_() { return this.f_46420_; diff --git a/patches/minecraft/net/minecraft/world/level/NaturalSpawner.java.patch b/patches/minecraft/net/minecraft/world/level/NaturalSpawner.java.patch index 827476501c..1421193737 100644 --- a/patches/minecraft/net/minecraft/world/level/NaturalSpawner.java.patch +++ b/patches/minecraft/net/minecraft/world/level/NaturalSpawner.java.patch @@ -15,9 +15,9 @@ - MobCategory mobcategory = entity.m_6095_().m_20674_(); + MobCategory mobcategory = entity.getClassification(true); if (mobcategory != MobCategory.MISC) { - Entity entity_f = entity; BlockPos blockpos = entity.m_20183_(); -@@ -172,13 +_,15 @@ + p_186527_.m_47103_(ChunkPos.m_151388_(blockpos), (p_275163_) -> { +@@ -171,13 +_,15 @@ } mob.m_7678_(d0, (double)i, d1, p_47040_.f_46441_.m_188501_() * 360.0F, 0.0F); @@ -35,7 +35,7 @@ return; } -@@ -259,7 +_,8 @@ +@@ -258,7 +_,8 @@ } private static WeightedRandomList m_220443_(ServerLevel p_220444_, StructureManager p_220445_, ChunkGenerator p_220446_, MobCategory p_220447_, BlockPos p_220448_, @Nullable Holder p_220449_) { @@ -45,7 +45,7 @@ } public static boolean m_220455_(BlockPos p_220456_, ServerLevel p_220457_, MobCategory p_220458_, StructureManager p_220459_) { -@@ -298,6 +_,13 @@ +@@ -297,6 +_,13 @@ if (p_47052_ == SpawnPlacements.Type.NO_RESTRICTIONS) { return true; } else if (p_47055_ != null && p_47053_.m_6857_().m_61937_(p_47054_)) { @@ -59,7 +59,7 @@ BlockState blockstate = p_47053_.m_8055_(p_47054_); FluidState fluidstate = p_47053_.m_6425_(p_47054_); BlockPos blockpos = p_47054_.m_7494_(); -@@ -310,14 +_,12 @@ +@@ -309,14 +_,12 @@ case ON_GROUND: default: BlockState blockstate1 = p_47053_.m_8055_(blockpos1); @@ -75,7 +75,7 @@ } } -@@ -367,6 +_,7 @@ +@@ -366,6 +_,7 @@ entity.m_7678_(d0, (double)blockpos.m_123342_(), d1, p_220454_.m_188501_() * 360.0F, 0.0F); if (entity instanceof Mob) { Mob mob = (Mob)entity; diff --git a/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch b/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch index f592a6f6e6..80300c9389 100644 --- a/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch +++ b/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch @@ -28,7 +28,7 @@ + return this.modifiableBiomeInfo().get().mobSpawnSettings(); } - public Biome.Precipitation m_47530_() { + public boolean m_264473_() { @@ -188,7 +_,7 @@ } @@ -38,7 +38,7 @@ } public int m_47539_() { -@@ -393,4 +_,34 @@ +@@ -373,4 +_,34 @@ return this.f_47738_; } } diff --git a/patches/minecraft/net/minecraft/world/level/biome/BiomeSource.java.patch b/patches/minecraft/net/minecraft/world/level/biome/BiomeSource.java.patch deleted file mode 100644 index 876392a5cd..0000000000 --- a/patches/minecraft/net/minecraft/world/level/biome/BiomeSource.java.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/net/minecraft/world/level/biome/BiomeSource.java -+++ b/net/minecraft/world/level/biome/BiomeSource.java -@@ -23,20 +_,24 @@ - - public abstract class BiomeSource implements BiomeResolver { - public static final Codec f_47888_ = BuiltInRegistries.f_256737_.m_194605_().dispatchStable(BiomeSource::m_5820_, Function.identity()); -- private final Set> f_47891_; -+ private final java.util.function.Supplier>> lazyPossibleBiomes; // FORGE: Allow custom biome sources to lazily evaluate possible biomes. - - protected BiomeSource(Stream> p_47896_) { - this(p_47896_.distinct().toList()); - } - - protected BiomeSource(List> p_47894_) { -- this.f_47891_ = new ObjectLinkedOpenHashSet<>(p_47894_); -+ this(() -> p_47894_); // FORGE: Redirect vanilla constructor to forge's lazy constructor. -+ } -+ -+ protected BiomeSource(java.util.function.Supplier>> biomes) { -+ this.lazyPossibleBiomes = com.google.common.base.Suppliers.memoize(() -> new ObjectLinkedOpenHashSet<>(biomes.get())); - } - - protected abstract Codec m_5820_(); - - public Set> m_207840_() { -- return this.f_47891_; -+ return this.lazyPossibleBiomes.get(); // FORGE: Patch getter to use the lazy field. - } - - public Set> m_183399_(int p_186705_, int p_186706_, int p_186707_, int p_186708_, Climate.Sampler p_186709_) { diff --git a/patches/minecraft/net/minecraft/world/level/biome/MobSpawnSettings.java.patch b/patches/minecraft/net/minecraft/world/level/biome/MobSpawnSettings.java.patch index 4018482d52..92c49ecccd 100644 --- a/patches/minecraft/net/minecraft/world/level/biome/MobSpawnSettings.java.patch +++ b/patches/minecraft/net/minecraft/world/level/biome/MobSpawnSettings.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/biome/MobSpawnSettings.java +++ b/net/minecraft/world/level/biome/MobSpawnSettings.java -@@ -38,20 +_,32 @@ +@@ -40,20 +_,32 @@ private final float f_48328_; private final Map> f_48329_; private final Map, MobSpawnSettings.MobSpawnCost> f_48330_; diff --git a/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch index 2aef63fb15..084e2455e2 100644 --- a/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/BaseFireBlock.java +++ b/net/minecraft/world/level/block/BaseFireBlock.java -@@ -125,6 +_,7 @@ +@@ -124,6 +_,7 @@ if (!p_49282_.m_60713_(p_49279_.m_60734_())) { if (m_49248_(p_49280_)) { Optional optional = PortalShape.m_77708_(p_49280_, p_49281_, Direction.Axis.X); @@ -8,7 +8,7 @@ if (optional.isPresent()) { optional.get().m_77743_(); return; -@@ -170,7 +_,7 @@ +@@ -169,7 +_,7 @@ boolean flag = false; for(Direction direction : Direction.values()) { diff --git a/patches/minecraft/net/minecraft/world/level/block/Block.java.patch b/patches/minecraft/net/minecraft/world/level/block/Block.java.patch index 4cb069b95d..30297f210c 100644 --- a/patches/minecraft/net/minecraft/world/level/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/Block.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java -@@ -62,10 +_,11 @@ +@@ -61,10 +_,11 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.slf4j.Logger; @@ -14,7 +14,7 @@ private static final LoadingCache f_49785_ = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader() { public Boolean load(VoxelShape p_49972_) { return !Shapes.m_83157_(Shapes.m_83144_(), p_49972_, BooleanOp.f_82687_); -@@ -178,7 +_,7 @@ +@@ -177,7 +_,7 @@ f_49790_.error("Block classes should end with Block and {} doesn't.", (Object)s); } } @@ -23,7 +23,7 @@ } public static boolean m_152463_(BlockState p_152464_) { -@@ -193,6 +_,8 @@ +@@ -192,6 +_,8 @@ BlockState blockstate = p_152446_.m_8055_(p_152449_); if (p_152445_.m_60719_(blockstate, p_152448_)) { return false; @@ -32,7 +32,7 @@ } else if (blockstate.m_60815_()) { Block.BlockStatePairKey block$blockstatepairkey = new Block.BlockStatePairKey(p_152445_, blockstate, p_152448_); Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = f_49789_.get(); -@@ -324,7 +_,7 @@ +@@ -323,7 +_,7 @@ } private static void m_152440_(Level p_152441_, Supplier p_152442_, ItemStack p_152443_) { @@ -41,7 +41,7 @@ ItemEntity itementity = p_152442_.get(); itementity.m_32060_(); p_152441_.m_7967_(itementity); -@@ -332,12 +_,13 @@ +@@ -331,12 +_,13 @@ } public void m_49805_(ServerLevel p_49806_, BlockPos p_49807_, int p_49808_) { @@ -56,7 +56,7 @@ public float m_7325_() { return this.f_60444_; } -@@ -384,8 +_,10 @@ +@@ -383,8 +_,10 @@ public void m_5548_(BlockGetter p_49821_, Entity p_49822_) { p_49822_.m_20256_(p_49822_.m_20184_().m_82542_(1.0D, 0.0D, 1.0D)); @@ -67,7 +67,7 @@ public ItemStack m_7397_(BlockGetter p_49823_, BlockPos p_49824_, BlockState p_49825_) { return new ItemStack(this); } -@@ -418,6 +_,7 @@ +@@ -417,6 +_,7 @@ public void m_141997_(BlockState p_152450_, Level p_152451_, BlockPos p_152452_, Biome.Precipitation p_152453_) { } @@ -75,7 +75,7 @@ public boolean m_6903_(Explosion p_49826_) { return true; } -@@ -453,6 +_,7 @@ +@@ -452,6 +_,7 @@ return p_152456_.m_61124_(p_152457_, p_152455_.m_61143_(p_152457_)); } @@ -83,7 +83,7 @@ public SoundType m_49962_(BlockState p_49963_) { return this.f_60446_; } -@@ -462,7 +_,7 @@ +@@ -461,7 +_,7 @@ this.f_49788_ = Item.m_41439_(this); } @@ -92,7 +92,7 @@ } public boolean m_49967_() { -@@ -483,6 +_,75 @@ +@@ -482,6 +_,75 @@ protected ImmutableMap m_152458_(Function p_152459_) { return this.f_49792_.m_61056_().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), p_152459_)); } diff --git a/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch b/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch index 2827d53bfb..a1e0b2156d 100644 --- a/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/Blocks.java +++ b/net/minecraft/world/level/block/Blocks.java -@@ -153,7 +_,7 @@ +@@ -161,7 +_,7 @@ public static final Block f_50027_ = m_50795_("green_bed", m_50764_(DyeColor.GREEN)); public static final Block f_50028_ = m_50795_("red_bed", m_50764_(DyeColor.RED)); public static final Block f_50029_ = m_50795_("black_bed", m_50764_(DyeColor.BLACK)); @@ -9,7 +9,7 @@ public static final Block f_50031_ = m_50795_("detector_rail", new DetectorRailBlock(BlockBehaviour.Properties.m_60939_(Material.f_76310_).m_60910_().m_60978_(0.7F).m_60918_(SoundType.f_56743_))); public static final Block f_50032_ = m_50795_("sticky_piston", m_50798_(true)); public static final Block f_50033_ = m_50795_("cobweb", new WebBlock(BlockBehaviour.Properties.m_60939_(Material.f_76311_).m_60910_().m_60999_().m_60978_(4.0F))); -@@ -1207,17 +_,5 @@ +@@ -1229,17 +_,5 @@ public static void m_50758_() { Block.f_49791_.forEach(BlockBehaviour.BlockStateBase::m_60611_); diff --git a/patches/minecraft/net/minecraft/world/level/block/ButtonBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/ButtonBlock.java.patch new file mode 100644 index 0000000000..34e5f6e70e --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/ButtonBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/ButtonBlock.java ++++ b/net/minecraft/world/level/block/ButtonBlock.java +@@ -53,7 +_,7 @@ + private final int f_244105_; + private final boolean f_243959_; + +- public ButtonBlock(BlockBehaviour.Properties p_273290_, BlockSetType p_273462_, int p_273212_, boolean p_272786_) { ++ protected ButtonBlock(BlockBehaviour.Properties p_273290_, BlockSetType p_273462_, int p_273212_, boolean p_272786_) { + super(p_273290_.m_60918_(p_273462_.f_271136_())); + this.f_271519_ = p_273462_; + this.m_49959_(this.f_49792_.m_61090_().m_61124_(f_54117_, Direction.NORTH).m_61124_(f_51045_, Boolean.valueOf(false)).m_61124_(f_53179_, AttachFace.WALL)); diff --git a/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch index 6d0ed45625..4d9ad8e1ba 100644 --- a/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/CactusBlock.java +++ b/net/minecraft/world/level/block/CactusBlock.java -@@ -21,7 +_,7 @@ +@@ -20,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -9,7 +9,7 @@ public static final IntegerProperty f_51131_ = BlockStateProperties.f_61410_; public static final int f_152740_ = 15; protected static final int f_152741_ = 1; -@@ -34,6 +_,7 @@ +@@ -33,6 +_,7 @@ } public void m_213897_(BlockState p_220908_, ServerLevel p_220909_, BlockPos p_220910_, RandomSource p_220911_) { @@ -17,7 +17,7 @@ if (!p_220908_.m_60710_(p_220909_, p_220910_)) { p_220909_.m_46961_(p_220910_, true); } -@@ -49,15 +_,17 @@ +@@ -48,15 +_,17 @@ if (i < 3) { int j = p_220913_.m_61143_(f_51131_); @@ -39,7 +39,7 @@ } } } -@@ -88,7 +_,7 @@ +@@ -87,7 +_,7 @@ } BlockState blockstate1 = p_51154_.m_8055_(p_51155_.m_7495_()); @@ -48,7 +48,7 @@ } public void m_7892_(BlockState p_51148_, Level p_51149_, BlockPos p_51150_, Entity p_51151_) { -@@ -101,5 +_,15 @@ +@@ -100,5 +_,15 @@ public boolean m_7357_(BlockState p_51143_, BlockGetter p_51144_, BlockPos p_51145_, PathComputationType p_51146_) { return false; diff --git a/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch index 45d6f01f4b..db9cbaef0b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/CampfireBlock.java +++ b/net/minecraft/world/level/block/CampfireBlock.java -@@ -204,7 +_,7 @@ +@@ -203,7 +_,7 @@ return true; } diff --git a/patches/minecraft/net/minecraft/world/level/block/DecoratedPotBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DecoratedPotBlock.java.patch new file mode 100644 index 0000000000..ae477f4eb1 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/DecoratedPotBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/DecoratedPotBlock.java ++++ b/net/minecraft/world/level/block/DecoratedPotBlock.java +@@ -30,7 +_,7 @@ + private static final DirectionProperty f_271251_ = BlockStateProperties.f_61374_; + private static final BooleanProperty f_271222_ = BlockStateProperties.f_61362_; + +- public DecoratedPotBlock(BlockBehaviour.Properties p_273064_) { ++ protected DecoratedPotBlock(BlockBehaviour.Properties p_273064_) { + super(p_273064_); + this.m_49959_(this.f_49792_.m_61090_().m_61124_(f_271251_, Direction.NORTH).m_61124_(f_271222_, Boolean.valueOf(false))); + } diff --git a/patches/minecraft/net/minecraft/world/level/block/DoorBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DoorBlock.java.patch new file mode 100644 index 0000000000..7655530ff0 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/DoorBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/DoorBlock.java ++++ b/net/minecraft/world/level/block/DoorBlock.java +@@ -48,7 +_,7 @@ + protected static final VoxelShape f_52734_ = Block.m_49796_(0.0D, 0.0D, 0.0D, 3.0D, 16.0D, 16.0D); + private final BlockSetType f_271255_; + +- public DoorBlock(BlockBehaviour.Properties p_273303_, BlockSetType p_272854_) { ++ protected DoorBlock(BlockBehaviour.Properties p_273303_, BlockSetType p_272854_) { + super(p_273303_.m_60918_(p_272854_.f_271136_())); + this.f_271255_ = p_272854_; + this.m_49959_(this.f_49792_.m_61090_().m_61124_(f_52726_, Direction.NORTH).m_61124_(f_52727_, Boolean.valueOf(false)).m_61124_(f_52728_, DoorHingeSide.LEFT).m_61124_(f_52729_, Boolean.valueOf(false)).m_61124_(f_52730_, DoubleBlockHalf.LOWER)); diff --git a/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch index 4c0d964541..635af8ab9b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/block/FarmBlock.java +++ b/net/minecraft/world/level/block/FarmBlock.java -@@ -81,7 +_,7 @@ +@@ -83,7 +_,7 @@ } public void m_142072_(Level p_153227_, BlockState p_153228_, BlockPos p_153229_, Entity p_153230_, float p_153231_) { - if (!p_153227_.f_46443_ && p_153227_.f_46441_.m_188501_() < p_153231_ - 0.5F && p_153230_ instanceof LivingEntity && (p_153230_ instanceof Player || p_153227_.m_46469_().m_46207_(GameRules.f_46132_)) && p_153230_.m_20205_() * p_153230_.m_20205_() * p_153230_.m_20206_() > 0.512F) { + if (!p_153227_.f_46443_ && net.minecraftforge.common.ForgeHooks.onFarmlandTrample(p_153227_, p_153229_, Blocks.f_50493_.m_49966_(), p_153231_, p_153230_)) { // Forge: Move logic to Entity#canTrample - m_53296_(p_153228_, p_153227_, p_153229_); + m_269406_(p_153230_, p_153228_, p_153227_, p_153229_); } -@@ -93,18 +_,20 @@ +@@ -97,18 +_,20 @@ } private static boolean m_53250_(BlockGetter p_53251_, BlockPos p_53252_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch index 511d01baf7..ce8b6343e4 100644 --- a/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/FireBlock.java +++ b/net/minecraft/world/level/block/FireBlock.java -@@ -103,13 +_,13 @@ +@@ -104,13 +_,13 @@ protected BlockState m_53470_(BlockGetter p_53471_, BlockPos p_53472_) { BlockPos blockpos = p_53472_.m_7495_(); BlockState blockstate = p_53471_.m_8055_(blockpos); @@ -16,7 +16,11 @@ } } -@@ -132,7 +_,7 @@ +@@ -129,14 +_,14 @@ + p_221161_.m_186460_(p_221162_, this, m_221148_(p_221161_.f_46441_)); + if (p_221161_.m_46469_().m_46207_(GameRules.f_46131_)) { + if (!p_221160_.m_60710_(p_221161_, p_221162_)) { +- p_221161_.m_7471_(p_221162_, false); } BlockState blockstate = p_221161_.m_8055_(p_221162_.m_7495_()); @@ -25,7 +29,11 @@ int i = p_221160_.m_61143_(f_53408_); if (!flag && p_221161_.m_46471_() && this.m_53428_(p_221161_, p_221162_) && p_221163_.m_188501_() < 0.2F + (float)i * 0.03F) { p_221161_.m_7471_(p_221162_, false); -@@ -153,7 +_,7 @@ ++ p_221161_.m_7471_(p_221162_, false); + } else { + int j = Math.min(15, i + p_221163_.m_188503_(3) / 2); + if (i != j) { +@@ -154,7 +_,7 @@ return; } @@ -34,9 +42,9 @@ p_221161_.m_7471_(p_221162_, false); return; } -@@ -161,12 +_,12 @@ +@@ -162,12 +_,12 @@ - boolean flag1 = p_221161_.m_46761_(p_221162_); + boolean flag1 = p_221161_.m_204166_(p_221162_).m_203656_(BiomeTags.f_263839_); int k = flag1 ? -50 : 0; - this.m_221150_(p_221161_, p_221162_.m_122029_(), 300 + k, p_221163_, i); - this.m_221150_(p_221161_, p_221162_.m_122024_(), 300 + k, p_221163_, i); @@ -53,7 +61,7 @@ BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for(int l = -1; l <= 1; ++l) { -@@ -204,29 +_,28 @@ +@@ -205,29 +_,28 @@ return p_53429_.m_46758_(p_53430_) || p_53429_.m_46758_(p_53430_.m_122024_()) || p_53429_.m_46758_(p_53430_.m_122029_()) || p_53429_.m_46758_(p_53430_.m_122012_()) || p_53429_.m_46758_(p_53430_.m_122019_()); } @@ -94,7 +102,7 @@ } } -@@ -238,7 +_,7 @@ +@@ -239,7 +_,7 @@ private boolean m_53485_(BlockGetter p_53486_, BlockPos p_53487_) { for(Direction direction : Direction.values()) { @@ -103,7 +111,7 @@ return true; } } -@@ -254,13 +_,14 @@ +@@ -255,13 +_,14 @@ for(Direction direction : Direction.values()) { BlockState blockstate = p_221157_.m_8055_(p_221158_.m_121945_(direction)); @@ -119,7 +127,7 @@ protected boolean m_7599_(BlockState p_53489_) { return this.m_221166_(p_53489_) > 0; } -@@ -279,8 +_,21 @@ +@@ -280,8 +_,21 @@ } private void m_53444_(Block p_53445_, int p_53446_, int p_53447_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch index bf0c70943e..ac102c21c4 100644 --- a/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/LeavesBlock.java +++ b/net/minecraft/world/level/block/LeavesBlock.java -@@ -21,7 +_,7 @@ +@@ -22,7 +_,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; diff --git a/patches/minecraft/net/minecraft/world/level/block/MagmaBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/MagmaBlock.java.patch index a98781f495..20c92adf14 100644 --- a/patches/minecraft/net/minecraft/world/level/block/MagmaBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/MagmaBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/MagmaBlock.java +++ b/net/minecraft/world/level/block/MagmaBlock.java -@@ -47,7 +_,7 @@ +@@ -46,7 +_,7 @@ public void m_213898_(BlockState p_221420_, ServerLevel p_221421_, BlockPos p_221422_, RandomSource p_221423_) { BlockPos blockpos = p_221422_.m_7494_(); diff --git a/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch index cc84053a80..97b6d70730 100644 --- a/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/NoteBlock.java +++ b/net/minecraft/world/level/block/NoteBlock.java -@@ -89,7 +_,9 @@ +@@ -98,7 +_,9 @@ if (p_55035_.f_46443_) { return InteractionResult.SUCCESS; } else { @@ -11,7 +11,7 @@ p_55035_.m_7731_(p_55036_, p_55034_, 3); this.m_260916_(p_55037_, p_55034_, p_55035_, p_55036_); p_55037_.m_36220_(Stats.f_12960_); -@@ -105,6 +_,9 @@ +@@ -114,6 +_,9 @@ } public boolean m_8133_(BlockState p_55023_, Level p_55024_, BlockPos p_55025_, int p_55026_, int p_55027_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/PinkPetalsBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/PinkPetalsBlock.java.patch new file mode 100644 index 0000000000..f9c7a8e179 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/PinkPetalsBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/PinkPetalsBlock.java ++++ b/net/minecraft/world/level/block/PinkPetalsBlock.java +@@ -24,7 +_,7 @@ + public static final DirectionProperty f_271347_ = BlockStateProperties.f_61374_; + public static final IntegerProperty f_271373_ = BlockStateProperties.f_271526_; + +- public PinkPetalsBlock(BlockBehaviour.Properties p_273335_) { ++ protected PinkPetalsBlock(BlockBehaviour.Properties p_273335_) { + super(p_273335_); + this.m_49959_(this.f_49792_.m_61090_().m_61124_(f_271347_, Direction.NORTH).m_61124_(f_271373_, Integer.valueOf(1))); + } diff --git a/patches/minecraft/net/minecraft/world/level/block/PressurePlateBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/PressurePlateBlock.java.patch new file mode 100644 index 0000000000..215e19bb6b --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/PressurePlateBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/PressurePlateBlock.java ++++ b/net/minecraft/world/level/block/PressurePlateBlock.java +@@ -17,7 +_,7 @@ + public static final BooleanProperty f_55249_ = BlockStateProperties.f_61448_; + private final PressurePlateBlock.Sensitivity f_55250_; + +- public PressurePlateBlock(PressurePlateBlock.Sensitivity p_273523_, BlockBehaviour.Properties p_273571_, BlockSetType p_273284_) { ++ protected PressurePlateBlock(PressurePlateBlock.Sensitivity p_273523_, BlockBehaviour.Properties p_273571_, BlockSetType p_273284_) { + super(p_273571_, p_273284_); + this.m_49959_(this.f_49792_.m_61090_().m_61124_(f_55249_, Boolean.valueOf(false))); + this.f_55250_ = p_273523_; diff --git a/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch b/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch index 9a39c1123f..74384c8237 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SoundType.java +++ b/net/minecraft/world/level/block/SoundType.java -@@ -105,6 +_,7 @@ +@@ -112,6 +_,7 @@ private final SoundEvent f_56737_; private final SoundEvent f_56738_; diff --git a/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch index dfec107788..ad740156f5 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SweetBerryBushBlock.java +++ b/net/minecraft/world/level/block/SweetBerryBushBlock.java -@@ -58,10 +_,11 @@ +@@ -57,10 +_,11 @@ public void m_213898_(BlockState p_222563_, ServerLevel p_222564_, BlockPos p_222565_, RandomSource p_222566_) { int i = p_222563_.m_61143_(f_57244_); diff --git a/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch index 591cc10d77..f775d2a92b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch @@ -58,7 +58,7 @@ if (!p_57453_.m_7500_()) { @@ -109,7 +_,7 @@ BlockPos blockpos = p_57431_.m_82425_(); - Entity entity = p_57432_.m_37282_(); + Entity entity = p_57432_.m_19749_(); if (p_57432_.m_6060_() && p_57432_.m_142265_(p_57429_, blockpos)) { - m_57436_(p_57429_, blockpos, entity instanceof LivingEntity ? (LivingEntity)entity : null); + onCaughtFire(p_57430_, p_57429_, blockpos, null, entity instanceof LivingEntity ? (LivingEntity)entity : null); diff --git a/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch index 1b7e22b9c3..206aa72359 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch @@ -1,6 +1,15 @@ --- a/net/minecraft/world/level/block/TrapDoorBlock.java +++ b/net/minecraft/world/level/block/TrapDoorBlock.java -@@ -151,4 +_,17 @@ +@@ -42,7 +_,7 @@ + protected static final VoxelShape f_57523_ = Block.m_49796_(0.0D, 13.0D, 0.0D, 16.0D, 16.0D, 16.0D); + private final BlockSetType f_271458_; + +- public TrapDoorBlock(BlockBehaviour.Properties p_273079_, BlockSetType p_272964_) { ++ protected TrapDoorBlock(BlockBehaviour.Properties p_273079_, BlockSetType p_272964_) { + super(p_273079_.m_60918_(p_272964_.f_271136_())); + this.f_271458_ = p_272964_; + this.m_49959_(this.f_49792_.m_61090_().m_61124_(f_54117_, Direction.NORTH).m_61124_(f_57514_, Boolean.valueOf(false)).m_61124_(f_57515_, Half.BOTTOM).m_61124_(f_57516_, Boolean.valueOf(false)).m_61124_(f_57517_, Boolean.valueOf(false))); +@@ -149,4 +_,17 @@ return super.m_7417_(p_57554_, p_57555_, p_57556_, p_57557_, p_57558_, p_57559_); } diff --git a/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch index e2a7399bf7..95cce03229 100644 --- a/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/VineBlock.java +++ b/net/minecraft/world/level/block/VineBlock.java -@@ -22,7 +_,7 @@ +@@ -23,7 +_,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; @@ -9,12 +9,12 @@ public static final BooleanProperty f_57833_ = PipeBlock.f_55152_; public static final BooleanProperty f_57834_ = PipeBlock.f_55148_; public static final BooleanProperty f_57835_ = PipeBlock.f_55149_; -@@ -156,7 +_,7 @@ - } +@@ -158,7 +_,7 @@ public void m_213898_(BlockState p_222655_, ServerLevel p_222656_, BlockPos p_222657_, RandomSource p_222658_) { -- if (p_222658_.m_188503_(4) == 0) { + if (p_222656_.m_46469_().m_46207_(GameRules.f_268705_)) { +- if (p_222658_.m_188503_(4) == 0) { + if (p_222656_.f_46441_.m_188503_(4) == 0 && p_222656_.isAreaLoaded(p_222657_, 4)) { // Forge: check area to prevent loading unloaded chunks - Direction direction = Direction.m_235672_(p_222658_); - BlockPos blockpos = p_222657_.m_7494_(); - if (direction.m_122434_().m_122479_() && !p_222655_.m_61143_(m_57883_(direction))) { + Direction direction = Direction.m_235672_(p_222658_); + BlockPos blockpos = p_222657_.m_7494_(); + if (direction.m_122434_().m_122479_() && !p_222655_.m_61143_(m_57883_(direction))) { diff --git a/patches/minecraft/net/minecraft/world/level/block/WeightedPressurePlateBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/WeightedPressurePlateBlock.java.patch new file mode 100644 index 0000000000..37d18aa9a1 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/WeightedPressurePlateBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/WeightedPressurePlateBlock.java ++++ b/net/minecraft/world/level/block/WeightedPressurePlateBlock.java +@@ -15,7 +_,7 @@ + public static final IntegerProperty f_58198_ = BlockStateProperties.f_61426_; + private final int f_58199_; + +- public WeightedPressurePlateBlock(int p_273669_, BlockBehaviour.Properties p_273512_, BlockSetType p_272868_) { ++ protected WeightedPressurePlateBlock(int p_273669_, BlockBehaviour.Properties p_273512_, BlockSetType p_272868_) { + super(p_273512_, p_272868_); + this.m_49959_(this.f_49792_.m_61090_().m_61124_(f_58198_, Integer.valueOf(0))); + this.f_58199_ = p_273669_; diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch index e475d63735..37595a83f5 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -58,6 +_,7 @@ +@@ -59,6 +_,7 @@ public static final int f_154987_ = 4; public static final int f_154988_ = 200; public static final int f_154989_ = 2; @@ -8,7 +8,7 @@ protected NonNullList f_58310_ = NonNullList.m_122780_(3, ItemStack.f_41583_); int f_58316_; int f_58317_; -@@ -106,8 +_,10 @@ +@@ -107,8 +_,10 @@ protected AbstractFurnaceBlockEntity(BlockEntityType p_154991_, BlockPos p_154992_, BlockState p_154993_, RecipeType p_154994_) { super(p_154991_, p_154992_, p_154993_); this.f_222691_ = RecipeManager.m_220267_((RecipeType)p_154994_); @@ -19,7 +19,7 @@ public static Map m_58423_() { Map map = Maps.newLinkedHashMap(); m_58374_(map, Items.f_42448_, 20000); -@@ -204,9 +_,9 @@ +@@ -205,9 +_,9 @@ super.m_142466_(p_155025_); this.f_58310_ = NonNullList.m_122780_(this.m_6643_(), ItemStack.f_41583_); ContainerHelper.m_18980_(p_155025_, this.f_58310_); @@ -32,7 +32,7 @@ this.f_58317_ = this.m_7743_(this.f_58310_.get(1)); CompoundTag compoundtag = p_155025_.m_128469_("RecipesUsed"); -@@ -218,9 +_,9 @@ +@@ -219,9 +_,9 @@ protected void m_183515_(CompoundTag p_187452_) { super.m_183515_(p_187452_); @@ -45,12 +45,12 @@ ContainerHelper.m_18973_(p_187452_, this.f_58310_); CompoundTag compoundtag = new CompoundTag(); this.f_58320_.forEach((p_187449_, p_187450_) -> { -@@ -248,28 +_,30 @@ +@@ -249,28 +_,30 @@ } int i = p_155017_.m_6893_(); -- if (!p_155017_.m_58425_() && m_155005_(recipe, p_155017_.f_58310_, i)) { -+ if (!p_155017_.m_58425_() && p_155017_.m_155005_(recipe, p_155017_.f_58310_, i)) { +- if (!p_155017_.m_58425_() && m_155005_(p_155014_.m_9598_(), recipe, p_155017_.f_58310_, i)) { ++ if (!p_155017_.m_58425_() && p_155017_.m_155005_(p_155014_.m_9598_(), recipe, p_155017_.f_58310_, i)) { p_155017_.f_58316_ = p_155017_.m_7743_(itemstack); p_155017_.f_58317_ = p_155017_.f_58316_; if (p_155017_.m_58425_()) { @@ -70,30 +70,30 @@ } } -- if (p_155017_.m_58425_() && m_155005_(recipe, p_155017_.f_58310_, i)) { -+ if (p_155017_.m_58425_() && p_155017_.m_155005_(recipe, p_155017_.f_58310_, i)) { +- if (p_155017_.m_58425_() && m_155005_(p_155014_.m_9598_(), recipe, p_155017_.f_58310_, i)) { ++ if (p_155017_.m_58425_() && p_155017_.m_155005_(p_155014_.m_9598_(), recipe, p_155017_.f_58310_, i)) { ++p_155017_.f_58318_; if (p_155017_.f_58318_ == p_155017_.f_58319_) { p_155017_.f_58318_ = 0; p_155017_.f_58319_ = m_222692_(p_155014_, p_155017_); -- if (m_155026_(recipe, p_155017_.f_58310_, i)) { -+ if (p_155017_.m_155026_(recipe, p_155017_.f_58310_, i)) { +- if (m_266209_(p_155014_.m_9598_(), recipe, p_155017_.f_58310_, i)) { ++ if (p_155017_.m_266209_(p_155014_.m_9598_(), recipe, p_155017_.f_58310_, i)) { p_155017_.m_6029_(recipe); } -@@ -294,9 +_,9 @@ +@@ -295,9 +_,9 @@ } -- private static boolean m_155005_(@Nullable Recipe p_155006_, NonNullList p_155007_, int p_155008_) { -+ private boolean m_155005_(@Nullable Recipe p_155006_, NonNullList p_155007_, int p_155008_) { +- private static boolean m_155005_(RegistryAccess p_266924_, @Nullable Recipe p_155006_, NonNullList p_155007_, int p_155008_) { ++ private boolean m_155005_(RegistryAccess p_266924_, @Nullable Recipe p_155006_, NonNullList p_155007_, int p_155008_) { if (!p_155007_.get(0).m_41619_() && p_155006_ != null) { -- ItemStack itemstack = p_155006_.m_8043_(); -+ ItemStack itemstack = ((Recipe) p_155006_).m_5874_(this); +- ItemStack itemstack = p_155006_.m_8043_(p_266924_); ++ ItemStack itemstack = ((Recipe) p_155006_).m_5874_(this, p_266924_); if (itemstack.m_41619_()) { return false; } else { -@@ -305,10 +_,10 @@ +@@ -306,10 +_,10 @@ return true; } else if (!itemstack1.m_41656_(itemstack)) { return false; @@ -106,27 +106,27 @@ } } } else { -@@ -316,15 +_,15 @@ +@@ -317,15 +_,15 @@ } } -- private static boolean m_155026_(@Nullable Recipe p_155027_, NonNullList p_155028_, int p_155029_) { -- if (p_155027_ != null && m_155005_(p_155027_, p_155028_, p_155029_)) { -+ private boolean m_155026_(@Nullable Recipe p_155027_, NonNullList p_155028_, int p_155029_) { -+ if (p_155027_ != null && this.m_155005_(p_155027_, p_155028_, p_155029_)) { - ItemStack itemstack = p_155028_.get(0); -- ItemStack itemstack1 = p_155027_.m_8043_(); -+ ItemStack itemstack1 = ((Recipe) p_155027_).m_5874_(this); - ItemStack itemstack2 = p_155028_.get(2); +- private static boolean m_266209_(RegistryAccess p_266740_, @Nullable Recipe p_266780_, NonNullList p_267073_, int p_267157_) { +- if (p_266780_ != null && m_155005_(p_266740_, p_266780_, p_267073_, p_267157_)) { ++ private boolean m_266209_(RegistryAccess p_266740_, @Nullable Recipe p_266780_, NonNullList p_267073_, int p_267157_) { ++ if (p_266780_ != null && this.m_155005_(p_266740_, p_266780_, p_267073_, p_267157_)) { + ItemStack itemstack = p_267073_.get(0); +- ItemStack itemstack1 = p_266780_.m_8043_(p_266740_); ++ ItemStack itemstack1 = ((Recipe) p_266780_).m_5874_(this, p_266740_); + ItemStack itemstack2 = p_267073_.get(2); if (itemstack2.m_41619_()) { - p_155028_.set(2, itemstack1.m_41777_()); + p_267073_.set(2, itemstack1.m_41777_()); } else if (itemstack2.m_150930_(itemstack1.m_41720_())) { - itemstack2.m_41769_(1); + itemstack2.m_41769_(itemstack1.m_41613_()); } - if (itemstack.m_150930_(Blocks.f_50057_.m_5456_()) && !p_155028_.get(1).m_41619_() && p_155028_.get(1).m_150930_(Items.f_42446_)) { -@@ -343,7 +_,7 @@ + if (itemstack.m_150930_(Blocks.f_50057_.m_5456_()) && !p_267073_.get(1).m_41619_() && p_267073_.get(1).m_150930_(Items.f_42446_)) { +@@ -344,7 +_,7 @@ return 0; } else { Item item = p_58343_.m_41720_(); @@ -135,7 +135,7 @@ } } -@@ -352,7 +_,7 @@ +@@ -353,7 +_,7 @@ } public static boolean m_58399_(ItemStack p_58400_) { @@ -144,7 +144,7 @@ } public int[] m_7071_(Direction p_58363_) { -@@ -432,7 +_,7 @@ +@@ -429,7 +_,7 @@ return true; } else { ItemStack itemstack = this.f_58310_.get(1); @@ -153,7 +153,7 @@ } } -@@ -490,5 +_,34 @@ +@@ -487,5 +_,34 @@ p_58342_.m_36491_(itemstack); } diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch index 99dce97a99..996cfe8503 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java +++ b/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java -@@ -147,6 +_,7 @@ +@@ -148,6 +_,7 @@ private static boolean m_155294_(NonNullList p_155295_) { ItemStack itemstack = p_155295_.get(3); @@ -8,7 +8,7 @@ if (itemstack.m_41619_()) { return false; } else if (!PotionBrewing.m_43506_(itemstack)) { -@@ -164,21 +_,21 @@ +@@ -165,21 +_,21 @@ } private static void m_155290_(Level p_155291_, BlockPos p_155292_, NonNullList p_155293_) { @@ -37,7 +37,7 @@ p_155293_.set(3, itemstack); p_155291_.m_46796_(1035, p_155292_, 0); -@@ -228,11 +_,11 @@ +@@ -225,11 +_,11 @@ public boolean m_7013_(int p_59017_, ItemStack p_59018_) { if (p_59017_ == 3) { @@ -51,7 +51,7 @@ } } -@@ -258,5 +_,34 @@ +@@ -255,5 +_,34 @@ protected AbstractContainerMenu m_6555_(int p_58990_, Inventory p_58991_) { return new BrewingStandMenu(p_58990_, p_58991_, this, this.f_58971_); diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch index 86ee9c3673..68f250be34 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/entity/ConduitBlockEntity.java +++ b/net/minecraft/world/level/block/entity/ConduitBlockEntity.java -@@ -153,10 +_,8 @@ +@@ -152,10 +_,8 @@ BlockPos blockpos1 = p_155416_.m_7918_(j1, k1, l1); BlockState blockstate = p_155415_.m_8055_(blockpos1); diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch index 9481d8e9ef..11a219562c 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/HopperBlockEntity.java.patch @@ -28,7 +28,7 @@ Container container = m_155596_(p_155553_, p_155554_); if (container != null) { Direction direction = Direction.DOWN; -@@ -397,5 +_,14 @@ +@@ -417,5 +_,14 @@ protected AbstractContainerMenu m_6555_(int p_59312_, Inventory p_59313_) { return new HopperMenu(p_59312_, p_59313_, this); diff --git a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java.patch b/patches/minecraft/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java.patch index 4626b4796d..8f28ece8ee 100644 --- a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java.patch @@ -3,7 +3,7 @@ @@ -36,6 +_,9 @@ return false; } else { - Holder> holder = p_222897_.m_8891_().m_175515_(Registries.f_256911_).m_203636_(resourcekey).orElse((Holder.Reference>)null); + Holder> holder = p_222897_.m_9598_().m_175515_(Registries.f_256911_).m_203636_(resourcekey).orElse((Holder.Reference>)null); + var event = net.minecraftforge.event.ForgeEventFactory.blockGrowFeature(p_222897_, p_222901_, p_222899_, holder); + holder = event.getFeature(); + if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return false; diff --git a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractTreeGrower.java.patch b/patches/minecraft/net/minecraft/world/level/block/grower/AbstractTreeGrower.java.patch index 98ec44c97e..58a2a80ac5 100644 --- a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractTreeGrower.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/grower/AbstractTreeGrower.java.patch @@ -3,7 +3,7 @@ @@ -23,6 +_,9 @@ return false; } else { - Holder> holder = p_222905_.m_8891_().m_175515_(Registries.f_256911_).m_203636_(resourcekey).orElse((Holder.Reference>)null); + Holder> holder = p_222905_.m_9598_().m_175515_(Registries.f_256911_).m_203636_(resourcekey).orElse((Holder.Reference>)null); + var event = net.minecraftforge.event.ForgeEventFactory.blockGrowFeature(p_222905_, p_222909_, p_222907_, holder); + holder = event.getFeature(); + if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return false; diff --git a/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch index 93a1d8ff78..a99d0406f9 100644 --- a/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -101,6 +_,17 @@ +@@ -102,6 +_,17 @@ this.f_60438_ = p_60452_.f_60903_; this.f_243733_ = p_60452_.f_244138_; this.f_60439_ = p_60452_; @@ -18,7 +18,7 @@ } /** @deprecated */ -@@ -149,7 +_,7 @@ +@@ -150,7 +_,7 @@ /** @deprecated */ @Deprecated public void m_6810_(BlockState p_60515_, Level p_60516_, BlockPos p_60517_, BlockState p_60518_, boolean p_60519_) { @@ -27,7 +27,7 @@ p_60516_.m_46747_(p_60517_); } -@@ -230,7 +_,7 @@ +@@ -231,7 +_,7 @@ /** @deprecated */ @Deprecated public boolean m_6864_(BlockState p_60470_, BlockPlaceContext p_60471_) { @@ -36,7 +36,7 @@ } /** @deprecated */ -@@ -360,8 +_,8 @@ +@@ -361,8 +_,8 @@ if (f == -1.0F) { return 0.0F; } else { @@ -47,7 +47,7 @@ } } -@@ -394,8 +_,7 @@ +@@ -395,8 +_,7 @@ public final ResourceLocation m_60589_() { if (this.f_60440_ == null) { @@ -57,7 +57,7 @@ } return this.f_60440_; -@@ -418,6 +_,14 @@ +@@ -419,6 +_,14 @@ return this.f_60439_.f_60888_; } @@ -72,7 +72,7 @@ public abstract static class BlockStateBase extends StateHolder { private final int f_60594_; private final boolean f_60595_; -@@ -508,18 +_,22 @@ +@@ -509,18 +_,22 @@ return this.f_60595_; } @@ -97,7 +97,7 @@ public BlockState m_60717_(Rotation p_60718_) { return this.m_60734_().m_6843_(this.m_7160_(), p_60718_); } -@@ -911,8 +_,9 @@ +@@ -908,8 +_,9 @@ boolean f_60895_ = true; boolean f_60896_; boolean f_243850_ = true; @@ -108,7 +108,7 @@ }; BlockBehaviour.StatePredicate f_60898_ = (p_60985_, p_60986_, p_60987_) -> { return p_60985_.m_60767_().m_76337_() && p_60985_.m_60838_(p_60986_, p_60987_); -@@ -1046,9 +_,15 @@ +@@ -1041,9 +_,15 @@ return this; } diff --git a/patches/minecraft/net/minecraft/world/level/block/state/properties/WoodType.java.patch b/patches/minecraft/net/minecraft/world/level/block/state/properties/WoodType.java.patch deleted file mode 100644 index 6106183fc5..0000000000 --- a/patches/minecraft/net/minecraft/world/level/block/state/properties/WoodType.java.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/net/minecraft/world/level/block/state/properties/WoodType.java -+++ b/net/minecraft/world/level/block/state/properties/WoodType.java -@@ -34,4 +_,11 @@ - public String m_61846_() { - return this.f_61839_; - } -+ -+ /** -+ * Use this to create a new {@link WoodType}. Make sure to register its rendering by enqueuing Atlases.addWoodType(...) during client setup.. -+ */ -+ public static WoodType create(String name) { -+ return new WoodType(name); -+ } - } diff --git a/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch b/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch index 64bb2071c2..fa9826ca84 100644 --- a/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch +++ b/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch @@ -87,7 +87,7 @@ } }); -@@ -465,7 +_,7 @@ +@@ -472,7 +_,7 @@ public Stream m_6267_() { return StreamSupport.stream(BlockPos.m_121976_(this.f_187604_.m_45604_(), this.m_141937_(), this.f_187604_.m_45605_(), this.f_187604_.m_45608_(), this.m_151558_() - 1, this.f_187604_.m_45609_()).spliterator(), false).filter((p_187990_) -> { @@ -96,7 +96,7 @@ }); } -@@ -553,6 +_,7 @@ +@@ -560,6 +_,7 @@ } public void m_187957_() { @@ -104,7 +104,7 @@ this.f_187610_.values().forEach(BlockEntity::m_7651_); this.f_187610_.clear(); this.f_156362_.values().forEach((p_187966_) -> { -@@ -562,6 +_,7 @@ +@@ -569,6 +_,7 @@ } public void m_156369_() { @@ -112,7 +112,7 @@ this.f_187610_.values().forEach((p_187988_) -> { Level level = this.f_62776_; if (level instanceof ServerLevel serverlevel) { -@@ -618,6 +_,41 @@ +@@ -625,6 +_,41 @@ this.f_196848_ = p_196865_; } @@ -154,7 +154,7 @@ class BoundTickingBlockEntity implements TickingBlockEntity { private final T f_156428_; private final BlockEntityTicker f_156429_; -@@ -634,6 +_,7 @@ +@@ -641,6 +_,7 @@ if (LevelChunk.this.m_156410_(blockpos)) { try { ProfilerFiller profilerfiller = LevelChunk.this.f_62776_.m_46473_(); @@ -162,7 +162,7 @@ profilerfiller.m_6521_(this::m_142280_); BlockState blockstate = LevelChunk.this.m_8055_(blockpos); if (this.f_156428_.m_58903_().m_155262_(blockstate)) { -@@ -649,6 +_,12 @@ +@@ -656,6 +_,12 @@ CrashReport crashreport = CrashReport.m_127521_(throwable, "Ticking block entity"); CrashReportCategory crashreportcategory = crashreport.m_127514_("Block entity being ticked"); this.f_156428_.m_58886_(crashreportcategory); @@ -175,7 +175,7 @@ throw new ReportedException(crashreport); } } -@@ -677,6 +_,34 @@ +@@ -684,6 +_,34 @@ IMMEDIATE, QUEUED, CHECK; diff --git a/patches/minecraft/net/minecraft/world/level/chunk/storage/ChunkSerializer.java.patch b/patches/minecraft/net/minecraft/world/level/chunk/storage/ChunkSerializer.java.patch index 3d1cea2de5..1d9d208855 100644 --- a/patches/minecraft/net/minecraft/world/level/chunk/storage/ChunkSerializer.java.patch +++ b/patches/minecraft/net/minecraft/world/level/chunk/storage/ChunkSerializer.java.patch @@ -33,7 +33,7 @@ return protochunk1; } } -@@ -364,6 +_,15 @@ +@@ -363,6 +_,15 @@ } compoundtag.m_128365_("CarvingMasks", compoundtag4); diff --git a/patches/minecraft/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch b/patches/minecraft/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch index a771146601..4d10e42090 100644 --- a/patches/minecraft/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch +++ b/patches/minecraft/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/chunk/storage/EntityStorage.java +++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java -@@ -90,8 +_,12 @@ +@@ -89,8 +_,12 @@ ListTag listtag = new ListTag(); p_156559_.m_156792_().forEach((p_156567_) -> { CompoundTag compoundtag1 = new CompoundTag(); diff --git a/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureProcessor.java.patch b/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureProcessor.java.patch index a48f683f10..9389bac6a1 100644 --- a/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureProcessor.java.patch +++ b/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureProcessor.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/levelgen/structure/templatesystem/StructureProcessor.java +++ b/net/minecraft/world/level/levelgen/structure/templatesystem/StructureProcessor.java -@@ -6,7 +_,34 @@ +@@ -8,9 +_,36 @@ public abstract class StructureProcessor { @Nullable @@ -35,4 +35,6 @@ + public StructureTemplate.StructureEntityInfo processEntity(LevelReader world, BlockPos seedPos, StructureTemplate.StructureEntityInfo rawEntityInfo, StructureTemplate.StructureEntityInfo entityInfo, StructurePlaceSettings placementSettings, StructureTemplate template) { + return entityInfo; + } - } + + public void m_271697_(LevelAccessor p_273167_, BlockPos p_273713_, BlockPos p_272620_, StructurePlaceSettings p_272830_, List p_273019_) { + } diff --git a/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java.patch b/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java.patch index 8756f652ac..ccdf0cf22d 100644 --- a/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java.patch +++ b/patches/minecraft/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java +++ b/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java -@@ -202,6 +_,10 @@ +@@ -200,6 +_,10 @@ return m_74593_(p_74565_, p_74564_.m_74401_(), p_74564_.m_74404_(), p_74564_.m_74407_()); } @@ -11,7 +11,7 @@ public boolean m_230328_(ServerLevelAccessor p_230329_, BlockPos p_230330_, BlockPos p_230331_, StructurePlaceSettings p_230332_, RandomSource p_230333_, int p_230334_) { if (this.f_74482_.isEmpty()) { return false; -@@ -219,7 +_,7 @@ +@@ -217,7 +_,7 @@ int i1 = Integer.MIN_VALUE; int j1 = Integer.MIN_VALUE; @@ -20,7 +20,7 @@ BlockPos blockpos = structuretemplate$structureblockinfo.f_74675_; if (boundingbox == null || boundingbox.m_71051_(blockpos)) { FluidState fluidstate = p_230332_.m_74413_() ? p_230329_.m_6425_(blockpos) : null; -@@ -331,7 +_,7 @@ +@@ -329,7 +_,7 @@ } if (!p_230332_.m_74408_()) { @@ -29,7 +29,7 @@ } return true; -@@ -360,14 +_,19 @@ +@@ -358,14 +_,19 @@ }); } @@ -50,7 +50,7 @@ } if (structuretemplate$structureblockinfo1 != null) { -@@ -378,13 +_,29 @@ +@@ -380,13 +_,29 @@ return list; } @@ -86,17 +86,17 @@ ListTag listtag = new ListTag(); listtag.add(DoubleTag.m_128500_(vec31.f_82479_)); listtag.add(DoubleTag.m_128500_(vec31.f_82480_)); -@@ -392,10 +_,10 @@ +@@ -394,10 +_,10 @@ compoundtag.m_128365_("Pos", listtag); compoundtag.m_128473_("UUID"); - m_74543_(p_74524_, compoundtag).ifPresent((p_205061_) -> { -- float f = p_205061_.m_7890_(p_74527_); -- f += p_205061_.m_6961_(p_74526_) - p_205061_.m_146908_(); -+ float f = p_205061_.m_7890_(placementIn.m_74404_()); -+ f += p_205061_.m_6961_(placementIn.m_74401_()) - p_205061_.m_146908_(); - p_205061_.m_7678_(vec31.f_82479_, vec31.f_82480_, vec31.f_82481_, f, p_205061_.m_146909_()); -- if (p_74530_ && p_205061_ instanceof Mob) { -+ if (placementIn.m_74414_() && p_205061_ instanceof Mob) { - ((Mob)p_205061_).m_6518_(p_74524_, p_74524_.m_6436_(new BlockPos(vec31)), MobSpawnType.STRUCTURE, (SpawnGroupData)null, compoundtag); + m_74543_(p_74524_, compoundtag).ifPresent((p_275190_) -> { +- float f = p_275190_.m_7890_(p_74527_); +- f += p_275190_.m_6961_(p_74526_) - p_275190_.m_146908_(); ++ float f = p_275190_.m_7890_(placementIn.m_74404_()); ++ f += p_275190_.m_6961_(placementIn.m_74401_()) - p_275190_.m_146908_(); + p_275190_.m_7678_(vec31.f_82479_, vec31.f_82480_, vec31.f_82481_, f, p_275190_.m_146909_()); +- if (p_74530_ && p_275190_ instanceof Mob) { ++ if (placementIn.m_74414_() && p_275190_ instanceof Mob) { + ((Mob)p_275190_).m_6518_(p_74524_, p_74524_.m_6436_(BlockPos.m_274446_(vec31)), MobSpawnType.STRUCTURE, (SpawnGroupData)null, compoundtag); } diff --git a/patches/minecraft/net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java.patch b/patches/minecraft/net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java.patch index e15f11e1cd..590b44281b 100644 --- a/patches/minecraft/net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java.patch +++ b/patches/minecraft/net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java.patch @@ -4,7 +4,7 @@ BlockPathTypes blockpathtypes1 = this.m_77567_(this.f_77313_, p_164677_.f_77271_, p_164677_.f_77272_, p_164677_.f_77273_); int j; if (this.f_77313_.m_21439_(blockpathtypes) >= 0.0F && blockpathtypes1 != BlockPathTypes.STICKY_HONEY) { -- j = Mth.m_14143_(Math.max(1.0F, this.f_77313_.f_19793_)); +- j = Mth.m_14143_(Math.max(1.0F, this.f_77313_.m_274421_())); + j = Mth.m_14143_(Math.max(1.0F, this.f_77313_.getStepHeight())); } else { j = 0; diff --git a/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch b/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch index 684c57c414..020802c621 100644 --- a/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch +++ b/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch @@ -8,7 +8,7 @@ BLOCKED(-1.0F), OPEN(0.0F), WALKABLE(0.0F), -@@ -36,5 +_,18 @@ +@@ -34,5 +_,17 @@ public float m_77124_() { return this.f_77117_; @@ -17,7 +17,6 @@ + @org.jetbrains.annotations.Nullable + public BlockPathTypes getDanger() { + return (this == DAMAGE_FIRE || this == DANGER_FIRE ) ? DANGER_FIRE : -+ (this == DAMAGE_CACTUS || this == DANGER_CACTUS) ? DANGER_CACTUS : + (this == DAMAGE_OTHER || this == DANGER_OTHER ) ? DANGER_OTHER : + (this == LAVA) ? DAMAGE_FIRE : + null; diff --git a/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch b/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch index f26b93a7bf..90f4ec7826 100644 --- a/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch +++ b/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch @@ -4,12 +4,12 @@ BlockPathTypes blockpathtypes = this.m_77567_(this.f_77313_, p_77641_.f_77271_, p_77641_.f_77272_ + 1, p_77641_.f_77273_); BlockPathTypes blockpathtypes1 = this.m_77567_(this.f_77313_, p_77641_.f_77271_, p_77641_.f_77272_, p_77641_.f_77273_); if (this.f_77313_.m_21439_(blockpathtypes) >= 0.0F && blockpathtypes1 != BlockPathTypes.STICKY_HONEY) { -- j = Mth.m_14143_(Math.max(1.0F, this.f_77313_.f_19793_)); +- j = Mth.m_14143_(Math.max(1.0F, this.f_77313_.m_274421_())); + j = Mth.m_14143_(Math.max(1.0F, this.f_77313_.getStepHeight())); } double d0 = this.m_142213_(new BlockPos(p_77641_.f_77271_, p_77641_.f_77272_, p_77641_.f_77273_)); -@@ -459,6 +_,11 @@ +@@ -451,6 +_,11 @@ if (l != 0 || j1 != 0) { p_77609_.m_122178_(i + l, j + i1, k + j1); BlockState blockstate = p_77608_.m_8055_(p_77609_); @@ -18,10 +18,10 @@ + FluidState fluidState = blockstate.m_60819_(); + BlockPathTypes fluidPathType = fluidState.getAdjacentBlockPathType(p_77608_, p_77609_, null, p_77610_); + if (fluidPathType != null) return fluidPathType; - if (blockstate.m_60713_(Blocks.f_50128_)) { - return BlockPathTypes.DANGER_CACTUS; + if (blockstate.m_60713_(Blocks.f_50128_) || blockstate.m_60713_(Blocks.f_50685_)) { + return BlockPathTypes.DANGER_OTHER; } -@@ -484,6 +_,8 @@ +@@ -472,6 +_,8 @@ protected static BlockPathTypes m_77643_(BlockGetter p_77644_, BlockPos p_77645_) { BlockState blockstate = p_77644_.m_8055_(p_77645_); @@ -30,21 +30,21 @@ Block block = blockstate.m_60734_(); Material material = blockstate.m_60767_(); if (blockstate.m_60795_()) { -@@ -501,6 +_,8 @@ - return BlockPathTypes.COCOA; - } else { - FluidState fluidstate = p_77644_.m_6425_(p_77645_); +@@ -486,6 +_,8 @@ + return BlockPathTypes.COCOA; + } else { + FluidState fluidstate = p_77644_.m_6425_(p_77645_); + BlockPathTypes nonLoggableFluidPathType = fluidstate.getBlockPathType(p_77644_, p_77645_, null, false); + if (nonLoggableFluidPathType != null) return nonLoggableFluidPathType; - if (fluidstate.m_205070_(FluidTags.f_13132_)) { - return BlockPathTypes.LAVA; - } else if (m_77622_(blockstate)) { -@@ -519,6 +_,8 @@ - if (!blockstate.m_60647_(p_77644_, p_77645_, PathComputationType.LAND)) { - return BlockPathTypes.BLOCKED; - } else { + if (fluidstate.m_205070_(FluidTags.f_13132_)) { + return BlockPathTypes.LAVA; + } else if (m_77622_(blockstate)) { +@@ -504,6 +_,8 @@ + if (!blockstate.m_60647_(p_77644_, p_77645_, PathComputationType.LAND)) { + return BlockPathTypes.BLOCKED; + } else { + BlockPathTypes loggableFluidPathType = fluidstate.getBlockPathType(p_77644_, p_77645_, null, true); + if (loggableFluidPathType != null) return loggableFluidPathType; - return fluidstate.m_205070_(FluidTags.f_13131_) ? BlockPathTypes.WATER : BlockPathTypes.OPEN; - } - } else { + return fluidstate.m_205070_(FluidTags.f_13131_) ? BlockPathTypes.WATER : BlockPathTypes.OPEN; + } + } else { diff --git a/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch b/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch index 8f6095f45b..cffbc32e7b 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/storage/LevelStorageSource.java +++ b/net/minecraft/world/level/storage/LevelStorageSource.java -@@ -389,6 +_,19 @@ +@@ -388,6 +_,19 @@ return LevelStorageSource.this.m_230817_(this.f_230867_, LevelStorageSource.m_245503_(p_248747_, p_251873_, p_249187_, p_249736_)); } @@ -20,7 +20,7 @@ @Nullable public WorldDataConfiguration m_247706_() { this.m_78313_(); -@@ -405,6 +_,8 @@ +@@ -404,6 +_,8 @@ CompoundTag compoundtag1 = new CompoundTag(); compoundtag1.m_128365_("Data", compoundtag); @@ -29,7 +29,7 @@ try { File file2 = File.createTempFile("level", ".dat", file1); NbtIo.m_128944_(compoundtag1, file2); -@@ -419,6 +_,10 @@ +@@ -418,6 +_,10 @@ public Optional m_182514_() { return !this.f_78270_.m_13639_() ? Optional.empty() : Optional.of(this.f_230867_.m_230860_()); diff --git a/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch b/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch index be7cef9aed..895950034d 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/storage/LevelSummary.java +++ b/net/minecraft/world/level/storage/LevelSummary.java -@@ -189,4 +_,8 @@ +@@ -192,4 +_,8 @@ return this.f_164922_; } } diff --git a/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch b/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch index 521dd6bd3d..b2917337cc 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch @@ -9,8 +9,8 @@ f_78426_.warn("Failed to save player data for {}", (Object)p_78434_.m_7755_().getString()); } @@ -54,6 +_,7 @@ - int i = compoundtag.m_128425_("DataVersion", 3) ? compoundtag.m_128451_("DataVersion") : -1; - p_78436_.m_20258_(NbtUtils.m_129213_(this.f_78425_, DataFixTypes.PLAYER, compoundtag, i)); + int i = NbtUtils.m_264487_(compoundtag, -1); + p_78436_.m_20258_(DataFixTypes.PLAYER.m_264218_(this.f_78425_, compoundtag, i)); } + net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_78436_, f_78427_, p_78436_.m_20149_()); diff --git a/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch b/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch index c6d9b3448a..e333a90e95 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch @@ -9,7 +9,7 @@ private PrimaryLevelData(@Nullable DataFixer p_249266_, int p_249857_, @Nullable CompoundTag p_249309_, boolean p_251525_, int p_249614_, int p_252310_, int p_250544_, float p_250495_, long p_250393_, long p_252085_, int p_250455_, int p_248981_, int p_249051_, boolean p_249672_, int p_249807_, boolean p_252350_, boolean p_250231_, boolean p_249788_, WorldBorder.Settings p_251494_, int p_249519_, int p_250649_, @Nullable UUID p_248892_, Set p_251898_, TimerQueue p_251119_, @Nullable CompoundTag p_248915_, CompoundTag p_252274_, LevelSettings p_248619_, WorldOptions p_251512_, PrimaryLevelData.SpecialWorldProperty p_251396_, Lifecycle p_252247_) { this.f_78452_ = p_249266_; @@ -124,7 +_,7 @@ - }); + }).convert(NbtOps.f_128958_).getValue(); return new PrimaryLevelData(p_78532_, p_78533_, p_78534_, p_78531_.get("WasModded").asBoolean(false), p_78531_.get("SpawnX").asInt(0), p_78531_.get("SpawnY").asInt(0), p_78531_.get("SpawnZ").asInt(0), p_78531_.get("SpawnAngle").asFloat(0.0F), i, p_78531_.get("DayTime").asLong(i), p_78536_.m_78389_(), p_78531_.get("clearWeatherTime").asInt(0), p_78531_.get("rainTime").asInt(0), p_78531_.get("raining").asBoolean(false), p_78531_.get("thunderTime").asInt(0), p_78531_.get("thundering").asBoolean(false), p_78531_.get("initialized").asBoolean(true), p_78531_.get("DifficultyLocked").asBoolean(false), WorldBorder.Settings.m_62037_(p_78531_, WorldBorder.f_61907_), p_78531_.get("WanderingTraderSpawnDelay").asInt(0), p_78531_.get("WanderingTraderSpawnChance").asInt(0), p_78531_.get("WanderingTraderId").read(UUIDUtil.f_235867_).result().orElse((UUID)null), p_78531_.get("ServerBrands").asStream().flatMap((p_78529_) -> { return p_78529_.asString().result().stream(); - }).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new TimerQueue<>(TimerCallbacks.f_82226_, p_78531_.get("ScheduledEvents").asStream()), (CompoundTag)p_78531_.get("CustomBossEvents").orElseEmptyMap().getValue(), compoundtag, p_78535_, p_251864_, p_250651_, p_78538_); diff --git a/patches/minecraft/net/minecraft/world/level/storage/loot/functions/SmeltItemFunction.java.patch b/patches/minecraft/net/minecraft/world/level/storage/loot/functions/SmeltItemFunction.java.patch index a866765cbf..eaf30a375e 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/loot/functions/SmeltItemFunction.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/loot/functions/SmeltItemFunction.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/level/storage/loot/functions/SmeltItemFunction.java +++ b/net/minecraft/world/level/storage/loot/functions/SmeltItemFunction.java @@ -32,7 +_,7 @@ - ItemStack itemstack = optional.get().m_8043_(); + ItemStack itemstack = optional.get().m_8043_(p_81269_.m_78952_().m_9598_()); if (!itemstack.m_41619_()) { ItemStack itemstack1 = itemstack.m_41777_(); - itemstack1.m_41764_(p_81268_.m_41613_()); diff --git a/src/generated_test/resources/assets/minecraft/models/item/stick.json b/src/generated_test/resources/assets/minecraft/models/item/stick.json index e3c18581e5..f278065d0f 100644 --- a/src/generated_test/resources/assets/minecraft/models/item/stick.json +++ b/src/generated_test/resources/assets/minecraft/models/item/stick.json @@ -3,19 +3,19 @@ "display": { "custom_transformtype_test:hanging": { "rotation": [ - 62, + 180, 147, 40 ], "scale": [ - 0.48, + 1, 0.48, 0.48 ], "translation": [ -2.25, 1.5, - -0.25 + -3 ] } }, diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index c57b8b0737..8d70aabb7b 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -94,6 +94,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.flag.FeatureFlagSet; import net.minecraft.world.inventory.tooltip.TooltipComponent; import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStackLinkedSet; import net.minecraft.world.item.crafting.RecipeManager; @@ -154,6 +155,7 @@ import net.minecraftforge.fml.VersionChecker; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.network.NetworkConstants; import net.minecraftforge.network.NetworkRegistry; +import net.minecraftforge.network.ServerStatusPing; import net.minecraftforge.registries.GameData; import net.minecraftforge.versions.forge.ForgeVersion; import org.apache.commons.lang3.tuple.Pair; @@ -484,7 +486,7 @@ public class ForgeHooksClient ModLoader.get().postEvent(new ModelEvent.BakingCompleted(modelManager, Collections.unmodifiableMap(models), modelBakery)); } - public static BakedModel handleCameraTransforms(PoseStack poseStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean applyLeftHandTransform) + public static BakedModel handleCameraTransforms(PoseStack poseStack, BakedModel model, ItemDisplayContext cameraTransformType, boolean applyLeftHandTransform) { model = model.applyTransform(cameraTransformType, poseStack, applyLeftHandTransform); return model; @@ -818,10 +820,11 @@ public class ForgeHooksClient public static void processForgeListPingData(ServerStatus packet, ServerData target) { - if (packet.getForgeData() != null) { - final Map mods = packet.getForgeData().getRemoteModData(); - final Map> remoteChannels = packet.getForgeData().getRemoteChannels(); - final int fmlver = packet.getForgeData().getFMLNetworkVersion(); + packet.forgeData().ifPresentOrElse(forgeData -> + { + final Map mods = forgeData.getRemoteModData(); + final Map remoteChannels = forgeData.getRemoteChannels(); + final int fmlver = forgeData.getFMLNetworkVersion(); boolean fmlNetMatches = fmlver == NetworkConstants.FMLNETVERSION; boolean channelsMatch = NetworkRegistry.checkListPingCompatibilityForClient(remoteChannels); @@ -867,11 +870,8 @@ public class ForgeHooksClient if (fmlver > NetworkConstants.FMLNETVERSION) { extraReason = "fml.menu.multiplayer.clientoutdated"; } - target.forgeData = new ExtendedServerListData("FML", extraServerMods.isEmpty() && fmlNetMatches && channelsMatch && modsMatch, mods.size(), extraReason, packet.getForgeData().isTruncated()); - } else { - target.forgeData = new ExtendedServerListData("VANILLA", NetworkRegistry.canConnectToVanillaServer(),0, null); - } - + target.forgeData = new ExtendedServerListData("FML", extraServerMods.isEmpty() && fmlNetMatches && channelsMatch && modsMatch, mods.size(), extraReason, forgeData.isTruncated()); + }, () -> target.forgeData = new ExtendedServerListData("VANILLA", NetworkRegistry.canConnectToVanillaServer(),0, null)); } private static final ResourceLocation ICON_SHEET = new ResourceLocation(ForgeVersion.MOD_ID, "textures/gui/icons.png"); @@ -1202,7 +1202,7 @@ public class ForgeHooksClient return new ResourceLocation(loc.getNamespace(), normalised); } - public static void onCreativeModeTabBuildContents(CreativeModeTab tab, CreativeModeTab.DisplayItemsGenerator originalGenerator, FeatureFlagSet flags, CreativeModeTab.Output output, boolean hasPermisions) + public static void onCreativeModeTabBuildContents(CreativeModeTab tab, CreativeModeTab.DisplayItemsGenerator originalGenerator, CreativeModeTab.ItemDisplayParameters params, CreativeModeTab.Output output) { final var entries = new MutableHashedLinkedMap(ItemStackLinkedSet.TYPE_AND_TAG, (key, left, right) -> { @@ -1213,13 +1213,13 @@ public class ForgeHooksClient } ); - originalGenerator.accept(flags, (stack, vis) -> { + originalGenerator.accept(params, (stack, vis) -> { if (stack.getCount() != 1) throw new IllegalArgumentException("The stack count must be 1"); entries.put(stack, vis); - }, hasPermisions); + }); - ModLoader.get().postEvent(new CreativeModeTabEvent.BuildContents(tab, flags, hasPermisions, entries)); + ModLoader.get().postEvent(new CreativeModeTabEvent.BuildContents(tab, params, entries)); for (var entry : entries) output.accept(entry.getKey(), entry.getValue()); diff --git a/src/main/java/net/minecraftforge/client/ForgeRenderTypes.java b/src/main/java/net/minecraftforge/client/ForgeRenderTypes.java index 3af7140d65..0ffa33e151 100644 --- a/src/main/java/net/minecraftforge/client/ForgeRenderTypes.java +++ b/src/main/java/net/minecraftforge/client/ForgeRenderTypes.java @@ -371,7 +371,6 @@ public enum ForgeRenderTypes this.setupState = () -> { this.blur = blur.get(); this.mipmap = mipmap.get(); - RenderSystem.enableTexture(); TextureManager texturemanager = Minecraft.getInstance().getTextureManager(); texturemanager.getTexture(resLoc).setFilter(this.blur, this.mipmap); RenderSystem.setShaderTexture(0, resLoc); diff --git a/src/main/java/net/minecraftforge/client/ItemDecoratorHandler.java b/src/main/java/net/minecraftforge/client/ItemDecoratorHandler.java index 4c1410ae60..6eb96a5c47 100644 --- a/src/main/java/net/minecraftforge/client/ItemDecoratorHandler.java +++ b/src/main/java/net/minecraftforge/client/ItemDecoratorHandler.java @@ -65,7 +65,6 @@ public final class ItemDecoratorHandler private void resetRenderState() { - RenderSystem.enableTexture(); RenderSystem.enableDepthTest(); RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); diff --git a/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java b/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java index e64be904ba..eacb569436 100644 --- a/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java @@ -47,11 +47,18 @@ public class RegisterParticleProvidersEvent extends Event implements IModBusEven * or a redundant texture list error will occur when particle jsons load. * @param provider ParticleProvider responsible for providing that ParticleType's particles. */ + @SuppressWarnings("deprecation") public void register(ParticleType type, ParticleProvider provider) { particleEngine.register(type, provider); } + @SuppressWarnings("deprecation") + public void register(ParticleType type, ParticleProvider.Sprite sprite) + { + particleEngine.register(type, sprite); + } + /** * Registers a ParticleProvider for a json-based ParticleType. * Particle jsons define a list of texture sprites which the particle can use to render itself. @@ -61,6 +68,7 @@ public class RegisterParticleProvidersEvent extends Event implements IModBusEven * or a missing texture list error will occur when particle jsons load. * @param registration SpriteParticleRegistration responsible for providing that ParticleType's particles. */ + @SuppressWarnings("deprecation") public void register(ParticleType type, ParticleEngine.SpriteParticleRegistration registration) { particleEngine.register(type, registration); diff --git a/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java b/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java index 0724feaf88..382f8d6fb6 100644 --- a/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java +++ b/src/main/java/net/minecraftforge/client/extensions/IForgeBakedModel.java @@ -15,6 +15,7 @@ import net.minecraft.client.resources.model.BakedModel; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.util.RandomSource; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.block.state.BlockState; @@ -59,7 +60,7 @@ public interface IForgeBakedModel * Applies a transform for the given {@link ItemTransforms.TransformType} and {@code applyLeftHandTransform}, and * returns the model to be rendered. */ - default BakedModel applyTransform(ItemTransforms.TransformType transformType, PoseStack poseStack, boolean applyLeftHandTransform) + default BakedModel applyTransform(ItemDisplayContext transformType, PoseStack poseStack, boolean applyLeftHandTransform) { self().getTransforms().getTransform(transformType).apply(applyLeftHandTransform, poseStack); return self(); diff --git a/src/main/java/net/minecraftforge/client/extensions/IForgeMinecraft.java b/src/main/java/net/minecraftforge/client/extensions/IForgeMinecraft.java index fc282a8033..a0d4b4f665 100644 --- a/src/main/java/net/minecraftforge/client/extensions/IForgeMinecraft.java +++ b/src/main/java/net/minecraftforge/client/extensions/IForgeMinecraft.java @@ -45,6 +45,6 @@ public interface IForgeMinecraft */ default Locale getLocale() { - return self().getLanguageManager().getSelected().getJavaLocale(); + return self().getLanguageManager().getJavaLocale(); } } diff --git a/src/main/java/net/minecraftforge/client/gui/ModListScreen.java b/src/main/java/net/minecraftforge/client/gui/ModListScreen.java index 7426092168..75f2e1522d 100644 --- a/src/main/java/net/minecraftforge/client/gui/ModListScreen.java +++ b/src/main/java/net/minecraftforge/client/gui/ModListScreen.java @@ -283,7 +283,7 @@ public class ModListScreen extends Screen this.addRenderableWidget(configButton); this.addRenderableWidget(openModsFolderButton); - search.setFocus(false); + search.setFocused(false); search.setCanLoseFocus(true); configButton.active = false; diff --git a/src/main/java/net/minecraftforge/client/gui/ScreenUtils.java b/src/main/java/net/minecraftforge/client/gui/ScreenUtils.java index babda8d2ee..2bedad5433 100644 --- a/src/main/java/net/minecraftforge/client/gui/ScreenUtils.java +++ b/src/main/java/net/minecraftforge/client/gui/ScreenUtils.java @@ -212,7 +212,6 @@ public class ScreenUtils float endBlue = (float)(endColor & 255) / 255.0F; RenderSystem.enableDepthTest(); - RenderSystem.disableTexture(); RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); RenderSystem.setShader(GameRenderer::getPositionColorShader); @@ -227,7 +226,6 @@ public class ScreenUtils tessellator.end(); RenderSystem.disableBlend(); - RenderSystem.enableTexture(); } public static void blitInscribed(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight) diff --git a/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java b/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java index ddbe808536..6199c0039a 100644 --- a/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java +++ b/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java @@ -105,13 +105,8 @@ public class ForgeGui extends Gui if (texture != null) { - RenderSystem.enableTexture(); bind(texture); } - else - { - RenderSystem.disableTexture(); - } RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getPositionTexShader); @@ -172,7 +167,7 @@ public class ForgeGui extends Gui minecraft.getProfiler().pop(); } - void renderSpyglassOverlay() + void renderSpyglassOverlay(PoseStack stack) { float deltaFrame = this.minecraft.getDeltaFrameTime(); this.scopeScale = Mth.lerp(0.5F * deltaFrame, this.scopeScale, 1.125F); @@ -180,7 +175,7 @@ public class ForgeGui extends Gui { if (this.minecraft.player.isScoping()) { - this.renderSpyglassOverlay(this.scopeScale); + this.renderSpyglassOverlay(stack, this.scopeScale); } else { @@ -198,7 +193,7 @@ public class ForgeGui extends Gui Item item = itemstack.getItem(); if (item == Blocks.CARVED_PUMPKIN.asItem()) { - renderTextureOverlay(PUMPKIN_BLUR_LOCATION, 1.0F); + renderTextureOverlay(poseStack, PUMPKIN_BLUR_LOCATION, 1.0F); } else { @@ -211,7 +206,7 @@ public class ForgeGui extends Gui { if (this.minecraft.player.getTicksFrozen() > 0) { - this.renderTextureOverlay(POWDER_SNOW_OUTLINE_LOCATION, this.minecraft.player.getPercentFrozen()); + this.renderTextureOverlay(pStack, POWDER_SNOW_OUTLINE_LOCATION, this.minecraft.player.getPercentFrozen()); } } @@ -247,13 +242,13 @@ public class ForgeGui extends Gui } @Override - protected void renderPortalOverlay(float partialTick) + protected void renderPortalOverlay(PoseStack stack, float partialTick) { float f1 = Mth.lerp(partialTick, this.minecraft.player.oPortalTime, this.minecraft.player.portalTime); if (f1 > 0.0F) { - super.renderPortalOverlay(f1); + super.renderPortalOverlay(stack, f1); } } diff --git a/src/main/java/net/minecraftforge/client/gui/overlay/VanillaGuiOverlay.java b/src/main/java/net/minecraftforge/client/gui/overlay/VanillaGuiOverlay.java index b8f536b8d3..29436540dc 100644 --- a/src/main/java/net/minecraftforge/client/gui/overlay/VanillaGuiOverlay.java +++ b/src/main/java/net/minecraftforge/client/gui/overlay/VanillaGuiOverlay.java @@ -27,12 +27,12 @@ public enum VanillaGuiOverlay if (Minecraft.useFancyGraphics()) { gui.setupOverlayRenderState(true, false); - gui.renderVignette(gui.getMinecraft().getCameraEntity()); + gui.renderVignette(poseStack, gui.getMinecraft().getCameraEntity()); } }), SPYGLASS("spyglass", (gui, poseStack, partialTick, screenWidth, screenHeight) -> { gui.setupOverlayRenderState(true, false); - gui.renderSpyglassOverlay(); + gui.renderSpyglassOverlay(poseStack); }), HELMET("helmet", (gui, poseStack, partialTick, screenWidth, screenHeight) -> { gui.setupOverlayRenderState(true, false); @@ -47,7 +47,7 @@ public enum VanillaGuiOverlay if (!gui.getMinecraft().player.hasEffect(MobEffects.CONFUSION)) { gui.setupOverlayRenderState(true, false); - gui.renderPortalOverlay(partialTick); + gui.renderPortalOverlay(poseStack, partialTick); } }), @@ -69,18 +69,22 @@ public enum VanillaGuiOverlay if (!gui.getMinecraft().options.hideGui) { gui.setupOverlayRenderState(true, false); - gui.setBlitOffset(-90); + poseStack.pushPose(); + poseStack.translate(0, 0, -90); gui.renderCrosshair(poseStack); + poseStack.popPose(); } }), BOSS_EVENT_PROGRESS("boss_event_progress", (gui, poseStack, partialTick, screenWidth, screenHeight) -> { if (!gui.getMinecraft().options.hideGui) { gui.setupOverlayRenderState(true, false); - gui.setBlitOffset(-90); + poseStack.pushPose(); + poseStack.translate(0, 0, -90); gui.renderBossHealth(poseStack); + poseStack.popPose(); } }), PLAYER_HEALTH("player_health", (gui, poseStack, partialTick, screenWidth, screenHeight) -> { @@ -138,7 +142,7 @@ public enum VanillaGuiOverlay if (!gui.getMinecraft().options.hideGui) { gui.setupOverlayRenderState(true, false); - if (gui.getMinecraft().options.heldItemTooltips && gui.getMinecraft().gameMode.getPlayerMode() != GameType.SPECTATOR) + if (gui.getMinecraft().gameMode.getPlayerMode() != GameType.SPECTATOR) { gui.renderSelectedItemName(poseStack); } diff --git a/src/main/java/net/minecraftforge/client/gui/widget/ExtendedButton.java b/src/main/java/net/minecraftforge/client/gui/widget/ExtendedButton.java index b7b76a6f15..fcb445e670 100644 --- a/src/main/java/net/minecraftforge/client/gui/widget/ExtendedButton.java +++ b/src/main/java/net/minecraftforge/client/gui/widget/ExtendedButton.java @@ -44,12 +44,11 @@ public class ExtendedButton extends Button * Draws this button to the screen. */ @Override - public void renderButton(PoseStack poseStack, int mouseX, int mouseY, float partialTick) + public void renderWidget(PoseStack poseStack, int mouseX, int mouseY, float partialTick) { Minecraft mc = Minecraft.getInstance(); - int k = this.getYImage(this.isHoveredOrFocused()); - ScreenUtils.blitWithBorder(poseStack, WIDGETS_LOCATION, this.getX(), this.getY(), 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset()); - this.renderBg(poseStack, mc, mouseX, mouseY); + int k = !this.active ? 0 : (this.isHoveredOrFocused() ? 2 : 1); + ScreenUtils.blitWithBorder(poseStack, WIDGETS_LOCATION, this.getX(), this.getY(), 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, 0); final FormattedText buttonText = mc.font.ellipsize(this.getMessage(), this.width - 6); // Remove 6 pixels so that the text is always contained within the button's borders drawCenteredString(poseStack, mc.font, Language.getInstance().getVisualOrder(buttonText), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, getFGColor()); diff --git a/src/main/java/net/minecraftforge/client/gui/widget/ForgeSlider.java b/src/main/java/net/minecraftforge/client/gui/widget/ForgeSlider.java index 4c913d6019..9d9f9e6887 100644 --- a/src/main/java/net/minecraftforge/client/gui/widget/ForgeSlider.java +++ b/src/main/java/net/minecraftforge/client/gui/widget/ForgeSlider.java @@ -226,17 +226,17 @@ public class ForgeSlider extends AbstractSliderButton protected void applyValue() {} @Override - public void renderButton(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) + public void renderWidget(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderTexture(0, WIDGETS_LOCATION); final Minecraft mc = Minecraft.getInstance(); - final int bgYImage = this.getYImage(this.isHoveredOrFocused()); - ScreenUtils.blitWithBorder(poseStack, this.getX(), this.getY(), 0, 46 + bgYImage * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset()); + final int bgYImage = !this.active ? 0 : (this.isHoveredOrFocused() ? 2 : 1); + ScreenUtils.blitWithBorder(poseStack, this.getX(), this.getY(), 0, 46 + bgYImage * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, 0); final int sliderYImage = (this.isHoveredOrFocused() ? 2 : 1) * 20; - ScreenUtils.blitWithBorder(poseStack, this.getX() + (int)(this.value * (double)(this.width - 8)), this.getY(), 0, 46 + sliderYImage, 8, this.height, 200, 20 , 2, 3, 2, 2, this.getBlitOffset()); + ScreenUtils.blitWithBorder(poseStack, this.getX() + (int)(this.value * (double)(this.width - 8)), this.getY(), 0, 46 + sliderYImage, 8, this.height, 200, 20 , 2, 3, 2, 2, 0); final FormattedText message = mc.font.ellipsize(getMessage(), this.width - 6); drawCenteredString(poseStack, mc.font, Language.getInstance().getVisualOrder(message), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, getFGColor()); diff --git a/src/main/java/net/minecraftforge/client/gui/widget/ScrollPanel.java b/src/main/java/net/minecraftforge/client/gui/widget/ScrollPanel.java index fc20aa5a56..c8929debea 100644 --- a/src/main/java/net/minecraftforge/client/gui/widget/ScrollPanel.java +++ b/src/main/java/net/minecraftforge/client/gui/widget/ScrollPanel.java @@ -328,7 +328,6 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen int barBgBlue = this.barBgColor & 0xff; RenderSystem.setShader(GameRenderer::getPositionColorShader); - RenderSystem.disableTexture(); worldr.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR); worldr.vertex(barLeft, this.bottom, 0.0D).color(barBgRed, barBgGreen, barBgBlue, barBgAlpha).endVertex(); worldr.vertex(barLeft + barWidth, this.bottom, 0.0D).color(barBgRed, barBgGreen, barBgBlue, barBgAlpha).endVertex(); @@ -361,7 +360,6 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen tess.end(); } - RenderSystem.enableTexture(); RenderSystem.disableBlend(); RenderSystem.disableScissor(); } diff --git a/src/main/java/net/minecraftforge/client/gui/widget/UnicodeGlyphButton.java b/src/main/java/net/minecraftforge/client/gui/widget/UnicodeGlyphButton.java index f26c2025c1..988d204f44 100644 --- a/src/main/java/net/minecraftforge/client/gui/widget/UnicodeGlyphButton.java +++ b/src/main/java/net/minecraftforge/client/gui/widget/UnicodeGlyphButton.java @@ -35,9 +35,8 @@ public class UnicodeGlyphButton extends ExtendedButton { Minecraft mc = Minecraft.getInstance(); this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.width && mouseY < this.getY() + this.height; - int k = this.getYImage(this.isHoveredOrFocused()); - ScreenUtils.blitWithBorder(poseStack, WIDGETS_LOCATION, this.getX(), this.getY(), 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset()); - this.renderBg(poseStack, mc, mouseX, mouseY); + int k = !this.active ? 0 : (this.isHoveredOrFocused() ? 2 : 1); + ScreenUtils.blitWithBorder(poseStack, WIDGETS_LOCATION, this.getX(), this.getY(), 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, 0); Component buttonText = this.createNarrationMessage(); int glyphWidth = (int) (mc.font.width(glyph) * glyphScale); diff --git a/src/main/java/net/minecraftforge/client/loading/ClientModLoader.java b/src/main/java/net/minecraftforge/client/loading/ClientModLoader.java index 4da23531b6..e92b9d0f66 100644 --- a/src/main/java/net/minecraftforge/client/loading/ClientModLoader.java +++ b/src/main/java/net/minecraftforge/client/loading/ClientModLoader.java @@ -140,8 +140,6 @@ public class ClientModLoader public static boolean completeModLoading() { - RenderSystem.disableTexture(); - RenderSystem.enableTexture(); List warnings = ModLoader.get().getWarnings(); boolean showWarnings = true; try { @@ -209,7 +207,7 @@ public class ClientModLoader // Create a resource pack merging all mod resources that should be hidden final Pack modResourcesPack = Pack.readMetaAndCreate("mod_resources", Component.literal("Mod Resources"), true, id -> new DelegatingPackResources(id, false, new PackMetadataSection(Component.translatable("fml.resources.modresources", hiddenPacks.size()), - PackType.CLIENT_RESOURCES.getVersion(SharedConstants.getCurrentVersion())), hiddenPacks), + SharedConstants.getCurrentVersion().getPackVersion(PackType.CLIENT_RESOURCES)), hiddenPacks), PackType.CLIENT_RESOURCES, Pack.Position.BOTTOM, PackSource.DEFAULT); packAcceptor.accept(modResourcesPack); } diff --git a/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java b/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java index 44d1532c53..7f639087db 100644 --- a/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java +++ b/src/main/java/net/minecraftforge/client/model/BakedModelWrapper.java @@ -15,6 +15,7 @@ import net.minecraft.client.resources.model.BakedModel; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.util.RandomSource; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.block.state.BlockState; @@ -100,7 +101,7 @@ public abstract class BakedModelWrapper implements BakedMo } @Override - public BakedModel applyTransform(ItemTransforms.TransformType cameraTransformType, PoseStack poseStack, boolean applyLeftHandTransform) + public BakedModel applyTransform(ItemDisplayContext cameraTransformType, PoseStack poseStack, boolean applyLeftHandTransform) { return originalModel.applyTransform(cameraTransformType, poseStack, applyLeftHandTransform); } diff --git a/src/main/java/net/minecraftforge/client/model/SeparateTransformsModel.java b/src/main/java/net/minecraftforge/client/model/SeparateTransformsModel.java index 6c027dcc0b..abe1dca770 100644 --- a/src/main/java/net/minecraftforge/client/model/SeparateTransformsModel.java +++ b/src/main/java/net/minecraftforge/client/model/SeparateTransformsModel.java @@ -29,6 +29,7 @@ import net.minecraft.core.Direction; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.GsonHelper; import net.minecraft.util.RandomSource; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.client.ChunkRenderTypeSet; import net.minecraftforge.client.model.data.ModelData; @@ -41,22 +42,22 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** - * A model composed of multiple sub-models which are picked based on the {@link ItemTransforms.TransformType} being used. + * A model composed of multiple sub-models which are picked based on the {@link ItemDisplayContext} being used. */ public class SeparateTransformsModel implements IUnbakedGeometry { private static final Logger LOGGER = LogManager.getLogger(); private final BlockModel baseModel; - private final ImmutableMap perspectives; + private final ImmutableMap perspectives; private final boolean deprecatedLoader; - public SeparateTransformsModel(BlockModel baseModel, ImmutableMap perspectives) + public SeparateTransformsModel(BlockModel baseModel, ImmutableMap perspectives) { this(baseModel, perspectives, false); } - private SeparateTransformsModel(BlockModel baseModel, ImmutableMap perspectives, boolean deprecatedLoader) + private SeparateTransformsModel(BlockModel baseModel, ImmutableMap perspectives, boolean deprecatedLoader) { this.baseModel = baseModel; this.perspectives = perspectives; @@ -94,9 +95,9 @@ public class SeparateTransformsModel implements IUnbakedGeometry perspectives; + private final ImmutableMap perspectives; - public Baked(boolean isAmbientOcclusion, boolean isGui3d, boolean isSideLit, TextureAtlasSprite particle, ItemOverrides overrides, BakedModel baseModel, ImmutableMap perspectives) + public Baked(boolean isAmbientOcclusion, boolean isGui3d, boolean isSideLit, TextureAtlasSprite particle, ItemOverrides overrides, BakedModel baseModel, ImmutableMap perspectives) { this.isAmbientOcclusion = isAmbientOcclusion; this.isGui3d = isGui3d; @@ -157,7 +158,7 @@ public class SeparateTransformsModel implements IUnbakedGeometry perspectives = new HashMap<>(); - for (ItemTransforms.TransformType transform : ItemTransforms.TransformType.values()) + Map perspectives = new HashMap<>(); + for (ItemDisplayContext transform : ItemDisplayContext.values()) { - if (perspectiveData.has(transform.getSerializeName())) + if (perspectiveData.has(transform.getSerializedName())) { - BlockModel perspectiveModel = deserializationContext.deserialize(GsonHelper.getAsJsonObject(perspectiveData, transform.getSerializeName()), BlockModel.class); + BlockModel perspectiveModel = deserializationContext.deserialize(GsonHelper.getAsJsonObject(perspectiveData, transform.getSerializedName()), BlockModel.class); perspectives.put(transform, perspectiveModel); } } diff --git a/src/main/java/net/minecraftforge/client/model/generators/ModelBuilder.java b/src/main/java/net/minecraftforge/client/model/generators/ModelBuilder.java index 1163dfa822..6b0ce16b77 100644 --- a/src/main/java/net/minecraftforge/client/model/generators/ModelBuilder.java +++ b/src/main/java/net/minecraftforge/client/model/generators/ModelBuilder.java @@ -27,12 +27,12 @@ import net.minecraft.client.renderer.block.model.BlockModel.GuiLight; import net.minecraft.client.renderer.block.model.BlockElement; import net.minecraft.client.renderer.block.model.BlockElementFace; import net.minecraft.client.renderer.block.model.BlockElementRotation; -import net.minecraft.client.renderer.block.model.ItemTransforms.TransformType; import net.minecraft.client.renderer.block.model.ItemTransform; import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite; import net.minecraft.core.Direction; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraftforge.client.model.ForgeFaceData; import net.minecraftforge.common.data.ExistingFileHelper; import org.jetbrains.annotations.Nullable; @@ -245,10 +245,10 @@ public class ModelBuilder> extends ModelFile { root.addProperty("render_type", this.renderType); } - Map transforms = this.transforms.build(); + Map transforms = this.transforms.build(); if (!transforms.isEmpty()) { JsonObject display = new JsonObject(); - for (Entry e : transforms.entrySet()) { + for (Entry e : transforms.entrySet()) { JsonObject transform = new JsonObject(); ItemTransform vec = e.getValue(); if (vec.equals(ItemTransform.NO_TRANSFORM)) continue; @@ -265,7 +265,7 @@ public class ModelBuilder> extends ModelFile { if (hasRightRotation) { transform.add("right_rotation", serializeVector3f(vec.rightRotation)); } - display.add(e.getKey().getSerializeName(), transform); + display.add(e.getKey().getSerializedName(), transform); } root.add("display", display); } @@ -716,7 +716,7 @@ public class ModelBuilder> extends ModelFile { public class TransformsBuilder { - private final Map transforms = new LinkedHashMap<>(); + private final Map transforms = new LinkedHashMap<>(); /** * Begin building a new transform for the given perspective. @@ -725,12 +725,12 @@ public class ModelBuilder> extends ModelFile { * @return the builder for the given perspective * @throws NullPointerException if {@code type} is {@code null} */ - public TransformVecBuilder transform(TransformType type) { + public TransformVecBuilder transform(ItemDisplayContext type) { Preconditions.checkNotNull(type, "Perspective cannot be null"); return transforms.computeIfAbsent(type, TransformVecBuilder::new); } - Map build() { + Map build() { return this.transforms.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().build(), (k1, k2) -> { throw new IllegalArgumentException(); }, LinkedHashMap::new)); } @@ -744,7 +744,7 @@ public class ModelBuilder> extends ModelFile { private Vector3f scale = new Vector3f(ItemTransform.Deserializer.DEFAULT_SCALE); private Vector3f rightRotation = new Vector3f(ItemTransform.Deserializer.DEFAULT_ROTATION); - TransformVecBuilder(TransformType type) { + TransformVecBuilder(ItemDisplayContext type) { // param unused for functional match } diff --git a/src/main/java/net/minecraftforge/client/model/generators/loaders/SeparateTransformsModelBuilder.java b/src/main/java/net/minecraftforge/client/model/generators/loaders/SeparateTransformsModelBuilder.java index e5d3009106..228e60f3ea 100644 --- a/src/main/java/net/minecraftforge/client/model/generators/loaders/SeparateTransformsModelBuilder.java +++ b/src/main/java/net/minecraftforge/client/model/generators/loaders/SeparateTransformsModelBuilder.java @@ -9,6 +9,7 @@ import com.google.common.base.Preconditions; import com.google.gson.JsonObject; import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraftforge.client.model.generators.CustomLoaderBuilder; import net.minecraftforge.client.model.generators.ModelBuilder; import net.minecraftforge.common.data.ExistingFileHelper; @@ -38,11 +39,11 @@ public class SeparateTransformsModelBuilder> extends C return this; } - public SeparateTransformsModelBuilder perspective(ItemTransforms.TransformType perspective, T modelBuilder) + public SeparateTransformsModelBuilder perspective(ItemDisplayContext perspective, T modelBuilder) { Preconditions.checkNotNull(perspective, "layer must not be null"); Preconditions.checkNotNull(modelBuilder, "modelBuilder must not be null"); - childModels.put(perspective.getSerializeName(), modelBuilder); + childModels.put(perspective.getSerializedName(), modelBuilder); return this; } diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index 93731a8f5e..0866060c4d 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -1549,7 +1549,7 @@ public class ForgeHooks private static String makePackFormatKey(PackType packType) { - return "forge:" + packType.bridgeType.name().toLowerCase(Locale.ROOT) + "_pack_format"; + return "forge:" + packType.name().toLowerCase(Locale.ROOT) + "_pack_format"; } /** diff --git a/src/main/java/net/minecraftforge/common/ForgeMod.java b/src/main/java/net/minecraftforge/common/ForgeMod.java index 0f3477b273..4fdb612925 100644 --- a/src/main/java/net/minecraftforge/common/ForgeMod.java +++ b/src/main/java/net/minecraftforge/common/ForgeMod.java @@ -483,7 +483,7 @@ public class ForgeMod ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); ForgeBlockTagsProvider blockTags = new ForgeBlockTagsProvider(packOutput, lookupProvider, existingFileHelper); gen.addProvider(event.includeServer(), blockTags); - gen.addProvider(event.includeServer(), new ForgeItemTagsProvider(packOutput, lookupProvider, blockTags, existingFileHelper)); + gen.addProvider(event.includeServer(), new ForgeItemTagsProvider(packOutput, lookupProvider, blockTags.contentsGetter(), existingFileHelper)); gen.addProvider(event.includeServer(), new ForgeEntityTypeTagsProvider(packOutput, lookupProvider, existingFileHelper)); gen.addProvider(event.includeServer(), new ForgeFluidTagsProvider(packOutput, lookupProvider, existingFileHelper)); gen.addProvider(event.includeServer(), new ForgeRecipeProvider(packOutput)); diff --git a/src/main/java/net/minecraftforge/common/IExtensibleEnum.java b/src/main/java/net/minecraftforge/common/IExtensibleEnum.java index ff7501ce20..5f09c4a878 100644 --- a/src/main/java/net/minecraftforge/common/IExtensibleEnum.java +++ b/src/main/java/net/minecraftforge/common/IExtensibleEnum.java @@ -51,11 +51,11 @@ public interface IExtensibleEnum either -> either.map( str -> { var val = enumValueFromNameFunction.apply(str); - return val != null ? DataResult.success(val) : DataResult.error("Unknown enum value name: " + str); + return val != null ? DataResult.success(val) : DataResult.error(() -> "Unknown enum value name: " + str); }, num -> { var values = valuesSupplier.get(); - return num >= 0 && num < values.length ? DataResult.success(values[num]) : DataResult.error("Unknown enum id: " + num); + return num >= 0 && num < values.length ? DataResult.success(values[num]) : DataResult.error(() -> "Unknown enum id: " + num); } ), value -> Either.left(value.getSerializedName()) diff --git a/src/main/java/net/minecraftforge/common/TierSortingRegistry.java b/src/main/java/net/minecraftforge/common/TierSortingRegistry.java index 75679eaa7b..6709971086 100644 --- a/src/main/java/net/minecraftforge/common/TierSortingRegistry.java +++ b/src/main/java/net/minecraftforge/common/TierSortingRegistry.java @@ -351,7 +351,7 @@ public class TierSortingRegistry private static void syncToPlayer(ServerPlayer serverPlayer) { - if (SYNC_CHANNEL.isRemotePresent(serverPlayer.connection.getConnection()) && !serverPlayer.connection.getConnection().isMemoryConnection()) + if (SYNC_CHANNEL.isRemotePresent(serverPlayer.connection.connection) && !serverPlayer.connection.connection.isMemoryConnection()) { SYNC_CHANNEL.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new SyncPacket(sortedTiers.stream().map(TierSortingRegistry::getName).toList())); } diff --git a/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java b/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java index 70f81e9ade..d1a5cb2c11 100644 --- a/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java +++ b/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java @@ -24,7 +24,7 @@ import java.util.function.Consumer; public final class ForgeItemTagsProvider extends ItemTagsProvider { - public ForgeItemTagsProvider(PackOutput output, CompletableFuture lookupProvider, TagsProvider blockTagProvider, ExistingFileHelper existingFileHelper) + public ForgeItemTagsProvider(PackOutput output, CompletableFuture lookupProvider, CompletableFuture> blockTagProvider, ExistingFileHelper existingFileHelper) { super(output, lookupProvider, blockTagProvider, "forge", existingFileHelper); } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java index eb64bd3e9c..b9b8a77797 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java @@ -543,8 +543,7 @@ public interface IForgeBlock @Nullable default BlockPathTypes getAdjacentBlockPathType(BlockState state, BlockGetter level, BlockPos pos, @Nullable Mob mob, BlockPathTypes originalType) { - if (state.is(Blocks.CACTUS)) return BlockPathTypes.DANGER_CACTUS; - else if (state.is(Blocks.SWEET_BERRY_BUSH)) return BlockPathTypes.DANGER_OTHER; + if (state.is(Blocks.SWEET_BERRY_BUSH)) return BlockPathTypes.DANGER_OTHER; else if (WalkNodeEvaluator.isBurningBlock(state)) return BlockPathTypes.DANGER_FIRE; else return null; } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeMenuType.java b/src/main/java/net/minecraftforge/common/extensions/IForgeMenuType.java index 0634ae7a8a..8c624b3216 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeMenuType.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeMenuType.java @@ -6,6 +6,7 @@ package net.minecraftforge.common.extensions; import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.MenuType; import net.minecraft.network.FriendlyByteBuf; @@ -15,7 +16,7 @@ public interface IForgeMenuType { static MenuType create(IContainerFactory factory) { - return new MenuType<>(factory); + return new MenuType<>(factory, FeatureFlags.DEFAULT_FLAGS); } T create(int windowId, Inventory playerInv, FriendlyByteBuf extraData); diff --git a/src/main/java/net/minecraftforge/common/loot/IGlobalLootModifier.java b/src/main/java/net/minecraftforge/common/loot/IGlobalLootModifier.java index f98073b86b..72f70d5598 100644 --- a/src/main/java/net/minecraftforge/common/loot/IGlobalLootModifier.java +++ b/src/main/java/net/minecraftforge/common/loot/IGlobalLootModifier.java @@ -42,7 +42,7 @@ public interface IGlobalLootModifier { catch (JsonSyntaxException e) { LootModifierManager.LOGGER.warn("Unable to decode loot conditions", e); - return DataResult.error(e.getMessage()); + return DataResult.error(e::getMessage); } }, conditions -> @@ -55,7 +55,7 @@ public interface IGlobalLootModifier { catch (JsonSyntaxException e) { LootModifierManager.LOGGER.warn("Unable to encode loot conditions", e); - return DataResult.error(e.getMessage()); + return DataResult.error(e::getMessage); } } ); diff --git a/src/main/java/net/minecraftforge/common/util/FakePlayer.java b/src/main/java/net/minecraftforge/common/util/FakePlayer.java index 4c3b5b71e7..ca605b4859 100644 --- a/src/main/java/net/minecraftforge/common/util/FakePlayer.java +++ b/src/main/java/net/minecraftforge/common/util/FakePlayer.java @@ -69,6 +69,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.stats.Stat; import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.RelativeMovement; import net.minecraft.world.entity.player.Player; import net.minecraftforge.server.ServerLifecycleHooks; import org.jetbrains.annotations.Nullable; @@ -125,7 +126,6 @@ public class FakePlayer extends ServerPlayer @Override public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) { } @Override public void handleMovePlayer(ServerboundMovePlayerPacket packet) { } @Override public void teleport(double x, double y, double z, float yaw, float pitch) { } - @Override public void teleport(double x, double y, double z, float yaw, float pitch, Set flags) { } @Override public void handlePlayerAction(ServerboundPlayerActionPacket packet) { } @Override public void handleUseItemOn(ServerboundUseItemOnPacket packet) { } @Override public void handleUseItem(ServerboundUseItemPacket packet) { } @@ -153,8 +153,7 @@ public class FakePlayer extends ServerPlayer @Override public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { } @Override public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { } @Override public void handleLockDifficulty(ServerboundLockDifficultyPacket packet) { } - @Override public void dismount(double x, double y, double z, float yaw, float pitch) { } - @Override public void teleport(double x, double y, double z, float yaw, float pitch, Set relativeSet, boolean dismountVehicle) { } + @Override public void teleport(double x, double y, double z, float yaw, float pitch, Set relativeSet) { } @Override public void ackBlockChangesUpTo(int sequence) { } @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { } @Override public void handleChatAck(ServerboundChatAckPacket packet) { } diff --git a/src/main/java/net/minecraftforge/common/world/ClimateSettingsBuilder.java b/src/main/java/net/minecraftforge/common/world/ClimateSettingsBuilder.java index 346e0bf62d..ea2914d70a 100644 --- a/src/main/java/net/minecraftforge/common/world/ClimateSettingsBuilder.java +++ b/src/main/java/net/minecraftforge/common/world/ClimateSettingsBuilder.java @@ -14,7 +14,7 @@ import net.minecraft.world.level.biome.Biome.TemperatureModifier; */ public class ClimateSettingsBuilder { - private Precipitation precipitation; + private boolean hasPrecipitation; private float temperature; private TemperatureModifier temperatureModifier; private float downfall; @@ -25,11 +25,11 @@ public class ClimateSettingsBuilder */ public static ClimateSettingsBuilder copyOf(ClimateSettings settings) { - return create(settings.precipitation(), settings.temperature(), settings.temperatureModifier(), settings.downfall()); + return create(settings.hasPrecipitation(), settings.temperature(), settings.temperatureModifier(), settings.downfall()); } /** - * @param precipitation Synced to clients, determines weather effects + * @param hasPrecipitation Synced to clients, determines weather effects * @param temperature Synced to clients, affects foliage color, freezing, and weather effects. * Vanilla values are in the range [-0.5, 2.0] * @param temperatureModifier Synced to clients, applies a positional modifier to temperature. @@ -38,14 +38,14 @@ public class ClimateSettingsBuilder * Biomes with downfall > 0.85 count as humid, inhibiting fire spread. * @return a new builder with the given values */ - public static ClimateSettingsBuilder create(Precipitation precipitation, float temperature, TemperatureModifier temperatureModifier, float downfall) + public static ClimateSettingsBuilder create(boolean hasPrecipitation, float temperature, TemperatureModifier temperatureModifier, float downfall) { - return new ClimateSettingsBuilder(precipitation, temperature, temperatureModifier, downfall); + return new ClimateSettingsBuilder(hasPrecipitation, temperature, temperatureModifier, downfall); } - private ClimateSettingsBuilder(Precipitation precipitation, float temperature, TemperatureModifier temperatureModifier, float downfall) + private ClimateSettingsBuilder(boolean hasPrecipitation, float temperature, TemperatureModifier temperatureModifier, float downfall) { - this.precipitation = precipitation; + this.hasPrecipitation = hasPrecipitation; this.temperature = temperature; this.temperatureModifier = temperatureModifier; this.downfall = downfall; @@ -56,23 +56,23 @@ public class ClimateSettingsBuilder */ public ClimateSettings build() { - return new ClimateSettings(this.precipitation, this.temperature, this.temperatureModifier, this.downfall); + return new ClimateSettings(true, this.temperature, this.temperatureModifier, this.downfall); } /** * @return Synced to clients, determines weather effects. */ - public Precipitation getPrecipitation() + public boolean hasPrecipitation() { - return precipitation; + return hasPrecipitation; } /** - * @param precipitation Synced to clients, determines weather effects. + * @param hasPrecipitation Synced to clients, determines weather effects. */ - public void setPrecipitation(Precipitation precipitation) + public void setHasPrecipitation(boolean hasPrecipitation) { - this.precipitation = precipitation; + this.hasPrecipitation = hasPrecipitation; } /** diff --git a/src/main/java/net/minecraftforge/event/CreativeModeTabEvent.java b/src/main/java/net/minecraftforge/event/CreativeModeTabEvent.java index dde0f33b9b..2d1f23d97b 100644 --- a/src/main/java/net/minecraftforge/event/CreativeModeTabEvent.java +++ b/src/main/java/net/minecraftforge/event/CreativeModeTabEvent.java @@ -112,16 +112,14 @@ public class CreativeModeTabEvent extends Event implements IModBusEvent public static final class BuildContents extends CreativeModeTabEvent implements Output { private final CreativeModeTab tab; - private final FeatureFlagSet flags; - private final boolean hasPermissions; + private final CreativeModeTab.ItemDisplayParameters parameters; private final MutableHashedLinkedMap entries; @ApiStatus.Internal - public BuildContents(CreativeModeTab tab, FeatureFlagSet flags, boolean hasPermissions, MutableHashedLinkedMap entries) + public BuildContents(CreativeModeTab tab, CreativeModeTab.ItemDisplayParameters parameters, MutableHashedLinkedMap entries) { this.tab = tab; - this.flags = flags; - this.hasPermissions = hasPermissions; + this.parameters = parameters; this.entries = entries; } @@ -135,12 +133,17 @@ public class CreativeModeTabEvent extends Event implements IModBusEvent public FeatureFlagSet getFlags() { - return this.flags; + return this.parameters.enabledFeatures(); + } + + public CreativeModeTab.ItemDisplayParameters getParameters() + { + return parameters; } public boolean hasPermissions() { - return this.hasPermissions; + return this.parameters.hasPermissions(); } public MutableHashedLinkedMap getEntries() diff --git a/src/main/java/net/minecraftforge/fluids/FluidType.java b/src/main/java/net/minecraftforge/fluids/FluidType.java index c1d7d57531..a2a308a5ef 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidType.java +++ b/src/main/java/net/minecraftforge/fluids/FluidType.java @@ -365,7 +365,7 @@ public class FluidType */ public boolean canRideVehicleUnder(Entity vehicle, Entity rider) { - if (this == ForgeMod.WATER_TYPE.get()) return vehicle.rideableUnderWater(); + if (this == ForgeMod.WATER_TYPE.get()) return !vehicle.dismountsUnderwater(); return true; } diff --git a/src/main/java/net/minecraftforge/gametest/BlockPosValueConverter.java b/src/main/java/net/minecraftforge/gametest/BlockPosValueConverter.java index b32c9b5e66..f7960e09c2 100644 --- a/src/main/java/net/minecraftforge/gametest/BlockPosValueConverter.java +++ b/src/main/java/net/minecraftforge/gametest/BlockPosValueConverter.java @@ -14,7 +14,7 @@ public class BlockPosValueConverter implements ValueConverter public BlockPos convert(String value) { String[] split = value.split(","); - return new BlockPos(Double.parseDouble(split[0]), Double.parseDouble(split[1]), Double.parseDouble(split[2])); + return BlockPos.containing(Double.parseDouble(split[0]), Double.parseDouble(split[1]), Double.parseDouble(split[2])); } @Override diff --git a/src/main/java/net/minecraftforge/items/SlotItemHandler.java b/src/main/java/net/minecraftforge/items/SlotItemHandler.java index 18f656ab08..1c784a2fe4 100644 --- a/src/main/java/net/minecraftforge/items/SlotItemHandler.java +++ b/src/main/java/net/minecraftforge/items/SlotItemHandler.java @@ -49,7 +49,7 @@ public class SlotItemHandler extends Slot } // Override if your IItemHandler does not implement IItemHandlerModifiable - @Override + // @Override public void initialize(ItemStack stack) { ((IItemHandlerModifiable) this.getItemHandler()).setStackInSlot(index, stack); diff --git a/src/main/java/net/minecraftforge/network/ConnectionData.java b/src/main/java/net/minecraftforge/network/ConnectionData.java index e23474c5bc..2a44df3487 100644 --- a/src/main/java/net/minecraftforge/network/ConnectionData.java +++ b/src/main/java/net/minecraftforge/network/ConnectionData.java @@ -107,7 +107,7 @@ public class ConnectionData public static ModMismatchData registry(Multimap mismatchedRegistryData, ConnectionData connectionData) { List mismatchedRegistryMods = mismatchedRegistryData.values().stream().map(ResourceLocation::getNamespace).distinct().map(id -> new ResourceLocation(id, "")).toList(); - Map mismatchedRegistryModData = mismatchedRegistryMods.stream().map(id -> ModList.get().getModContainerById(id.getNamespace()).map(modContainer -> Pair.of(id, modContainer.getModInfo().getVersion().toString())).orElse(Pair.of(id, NetworkRegistry.ABSENT))).collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); + Map mismatchedRegistryModData = mismatchedRegistryMods.stream().map(id -> ModList.get().getModContainerById(id.getNamespace()).map(modContainer -> Pair.of(id, modContainer.getModInfo().getVersion().toString())).orElse(Pair.of(id, NetworkRegistry.ABSENT.version()))).collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); Map> presentModData = getServerSidePresentModData(mismatchedRegistryModData.keySet(), connectionData); return new ModMismatchData(mismatchedRegistryModData, presentModData, false); @@ -140,7 +140,7 @@ public class ConnectionData { mismatchedModVersions = ModList.get().getMods().stream().map(info -> Pair.of(info.getModId(), info.getVersion().toString())).collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); } - return mismatchedChannels.keySet().stream().map(channel -> Pair.of(channel, mismatchedChannels.get(channel).equals(NetworkRegistry.ABSENT) ? NetworkRegistry.ABSENT : mismatchedModVersions.getOrDefault(channel.getNamespace(), NetworkRegistry.ABSENT))).collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); + return mismatchedChannels.keySet().stream().map(channel -> Pair.of(channel, mismatchedChannels.get(channel).equals(NetworkRegistry.ABSENT.version()) ? NetworkRegistry.ABSENT.version() : mismatchedModVersions.getOrDefault(channel.getNamespace(), NetworkRegistry.ABSENT.version()))).collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); } diff --git a/src/main/java/net/minecraftforge/network/NetworkHooks.java b/src/main/java/net/minecraftforge/network/NetworkHooks.java index 054fa7d16d..85b1ff8ebb 100644 --- a/src/main/java/net/minecraftforge/network/NetworkHooks.java +++ b/src/main/java/net/minecraftforge/network/NetworkHooks.java @@ -204,7 +204,7 @@ public class NetworkHooks AbstractContainerMenu c = containerSupplier.createMenu(openContainerId, player.getInventory(), player); MenuType type = c.getType(); PlayMessages.OpenContainer msg = new PlayMessages.OpenContainer(type, openContainerId, containerSupplier.getDisplayName(), output); - NetworkConstants.playChannel.sendTo(msg, player.connection.getConnection(), NetworkDirection.PLAY_TO_CLIENT); + NetworkConstants.playChannel.sendTo(msg, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); player.containerMenu = c; player.initMenu(player.containerMenu); diff --git a/src/main/java/net/minecraftforge/network/NetworkRegistry.java b/src/main/java/net/minecraftforge/network/NetworkRegistry.java index cc507547c4..3dfabbc892 100644 --- a/src/main/java/net/minecraftforge/network/NetworkRegistry.java +++ b/src/main/java/net/minecraftforge/network/NetworkRegistry.java @@ -45,10 +45,8 @@ public class NetworkRegistry * Special value for clientAcceptedVersions and serverAcceptedVersions predicates indicating the other side lacks * this channel. */ - @SuppressWarnings("RedundantStringConstructorCall") - public static String ABSENT = new String("ABSENT \uD83E\uDD14"); + public static ServerStatusPing.ChannelData ABSENT = new ServerStatusPing.ChannelData(new ResourceLocation("absent"), "ABSENT \uD83E\uDD14", false); - @SuppressWarnings("RedundantStringConstructorCall") public static String ACCEPTVANILLA = new String("ALLOWVANILLA \uD83D\uDC93\uD83D\uDC93\uD83D\uDC93"); /** @@ -68,7 +66,7 @@ public class NetworkRegistry */ public static Predicate acceptMissingOr(Predicate versionCheck) { - return versionCheck.or(ABSENT::equals).or(ACCEPTVANILLA::equals); + return versionCheck.or(ABSENT.version()::equals).or(ACCEPTVANILLA::equals); } public static List getServerNonVanillaNetworkMods() @@ -172,11 +170,10 @@ public class NetworkRegistry * @see HandshakeMessages.S2CModList * @see HandshakeMessages.C2SModListReply */ - static Map> buildChannelVersionsForListPing() { + static Map buildChannelVersionsForListPing() { return instances.entrySet().stream(). - map( p -> Pair.of(p.getKey(), Pair.of(p.getValue().getNetworkProtocolVersion(), p.getValue().tryClientVersionOnServer(ABSENT)))). - filter(p -> !p.getLeft().getNamespace().equals("fml")). - collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); + filter(p -> !p.getKey().getNamespace().equals("fml")). + collect(Collectors.toMap(Map.Entry::getKey, val -> new ServerStatusPing.ChannelData(val.getKey(), val.getValue().getNetworkProtocolVersion(), val.getValue().tryClientVersionOnServer(ABSENT.version())))); } static List listRejectedVanillaMods(BiFunction testFunction) { @@ -186,7 +183,7 @@ public class NetworkRegistry final boolean test = testFunction.apply(ni, incomingVersion); LOGGER.debug(NETREGISTRY, "Channel '{}' : Vanilla acceptance test: {}", ni.getChannelName(), test ? "ACCEPTED" : "REJECTED"); return Pair.of(ni.getChannelName(), test); - }).filter(p->!p.getRight()).collect(Collectors.toList()); + }).filter(p->!p.getRight()).toList(); if (!results.isEmpty()) { LOGGER.error(NETREGISTRY, "Channels [{}] rejected vanilla connections", @@ -228,7 +225,7 @@ public class NetworkRegistry private static Map validateChannels(final Map incoming, final String originName, BiFunction testFunction) { final Map results = instances.values().stream(). map(ni -> { - final String incomingVersion = incoming.getOrDefault(ni.getChannelName(), ABSENT); + final String incomingVersion = incoming.getOrDefault(ni.getChannelName(), ABSENT.version()); final boolean test = testFunction.apply(ni, incomingVersion); LOGGER.debug(NETREGISTRY, "Channel '{}' : Version test of '{}' from {} : {}", ni.getChannelName(), incomingVersion, originName, test ? "ACCEPTED" : "REJECTED"); return Pair.of(Pair.of(ni.getChannelName(), incomingVersion), test); @@ -258,20 +255,20 @@ public class NetworkRegistry return gatheredPayloads; } - public static boolean checkListPingCompatibilityForClient(Map> incoming) { + public static boolean checkListPingCompatibilityForClient(Map incoming) { Set handled = new HashSet<>(); final List> results = instances.values().stream(). filter(p -> !p.getChannelName().getNamespace().equals("fml")). map(ni -> { - final Pair incomingVersion = incoming.getOrDefault(ni.getChannelName(), Pair.of(ABSENT, true)); - final boolean test = ni.tryServerVersionOnClient(incomingVersion.getLeft()); + final ServerStatusPing.ChannelData incomingVersion = incoming.getOrDefault(ni.getChannelName(), ABSENT); + final boolean test = ni.tryServerVersionOnClient(incomingVersion.version()); handled.add(ni.getChannelName()); LOGGER.debug(NETREGISTRY, "Channel '{}' : Version test of '{}' during listping : {}", ni.getChannelName(), incomingVersion, test ? "ACCEPTED" : "REJECTED"); return Pair.of(ni.getChannelName(), test); }).filter(p->!p.getRight()).collect(Collectors.toList()); final List missingButRequired = incoming.entrySet().stream(). filter(p -> !p.getKey().getNamespace().equals("fml")). - filter(p -> !p.getValue().getRight()). + filter(p -> !p.getValue().required()). filter(p -> !handled.contains(p.getKey())). map(Map.Entry::getKey). collect(Collectors.toList()); diff --git a/src/main/java/net/minecraftforge/network/ServerStatusPing.java b/src/main/java/net/minecraftforge/network/ServerStatusPing.java index 9c62b251cd..df2e4a843e 100644 --- a/src/main/java/net/minecraftforge/network/ServerStatusPing.java +++ b/src/main/java/net/minecraftforge/network/ServerStatusPing.java @@ -5,31 +5,24 @@ package net.minecraftforge.network; -import com.google.common.collect.ImmutableMap; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonSyntaxException; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.ResourceLocationException; +import net.minecraft.Util; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.util.GsonHelper; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.fml.IExtensionPoint; import net.minecraftforge.fml.ModList; -import org.apache.commons.lang3.tuple.Pair; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; +import java.util.function.Function; import java.util.function.Supplier; - import java.util.stream.Collectors; -import java.util.stream.StreamSupport; /** * Represents additional data sent by FML when a server is pinged. @@ -59,14 +52,11 @@ import java.util.stream.StreamSupport; * *

* Modern versions will send binary data, which is encoded in a custom format optimized for UTF-16 code point count. - * See {@link Serializer#encodeOptimized(ByteBuf)} and {@link Serializer#decodeOptimized(String)}. + * See {@link #encodeOptimized(ByteBuf)} and {@link #decodeOptimized(String)}. * Essentially 15 bits of binary data are encoded into every UTF-16 code point. The resulting string is then stored in * the "d" property of the resulting JSON. * *

- * For the format of the binary data see {@link Serializer#serialize(ServerStatusPing)}. - * - *

* The "channels" and "mods" properties are retained for backwards compatibility, * but left empty. A client that cannot read the old format would not be able to connect anyways, but the properties * must exist to not cause exceptions. @@ -81,48 +71,49 @@ import java.util.stream.StreamSupport; * } * */ -public class ServerStatusPing +public record ServerStatusPing( + Map channels, + Map mods, + int fmlNetworkVer, + boolean truncated +) { - private static final Logger LOGGER = LogManager.getLogger(); + private static final Codec BYTE_BUF_CODEC = Codec.STRING + .xmap(ServerStatusPing::decodeOptimized, ServerStatusPing::encodeOptimized); + + public static final Codec CODEC = RecordCodecBuilder.create(in -> in.group( + Codec.INT.fieldOf("fmlNetworkVersion").forGetter(ServerStatusPing::getFMLNetworkVersion), + + ServerStatusPing.BYTE_BUF_CODEC.optionalFieldOf("d").forGetter(ping -> Optional.of(ping.toBuf())), + + ChannelData.CODEC.listOf().optionalFieldOf("channels").forGetter(ping -> Optional.of(List.of())), + ModInfo.CODEC.listOf().optionalFieldOf("mods").forGetter(ping -> Optional.of(List.of())), + + // legacy versions see truncated lists, modern versions ignore this truncated flag (binary data has its own) + Codec.BOOL.optionalFieldOf("truncated").forGetter(ping -> Optional.of(ping.isTruncated())) + ).apply(in, (fmlVer, buf, channels, mods, truncated) -> buf.map(byteBuf -> deserializeOptimized(fmlVer, byteBuf)) + .orElseGet(() -> new ServerStatusPing( + channels.orElseGet(List::of).stream().collect(Collectors.toMap(ChannelData::res, Function.identity())), + mods.orElseGet(List::of).stream().collect(Collectors.toMap(ModInfo::modId, ModInfo::modmarker)), + fmlVer, truncated.orElse(false) + )))); - private final transient Map> channels; - private final transient Map mods; - private final transient int fmlNetworkVer; - private final transient boolean truncated; public ServerStatusPing() { - this.channels = NetworkRegistry.buildChannelVersionsForListPing(); - this.mods = new HashMap<>(); - ModList.get().forEachModContainer((modid, mc) -> - mods.put(modid, mc.getCustomExtension(IExtensionPoint.DisplayTest.class) - .map(IExtensionPoint.DisplayTest::suppliedVersion) - .map(Supplier::get) - .orElse(NetworkConstants.IGNORESERVERONLY))); - this.fmlNetworkVer = NetworkConstants.FMLNETVERSION; - this.truncated = false; + this( + NetworkRegistry.buildChannelVersionsForListPing(), + Util.make(new HashMap<>(), map -> ModList.get().forEachModContainer((modid, mc) -> + map.put(modid, mc.getCustomExtension(IExtensionPoint.DisplayTest.class) + .map(IExtensionPoint.DisplayTest::suppliedVersion) + .map(Supplier::get) + .orElse(NetworkConstants.IGNORESERVERONLY)))), + NetworkConstants.FMLNETVERSION, + false + ); } - private ServerStatusPing(Map> deserialized, Map modMarkers, int fmlNetVer, boolean truncated) { - this.channels = ImmutableMap.copyOf(deserialized); - this.mods = modMarkers; - this.fmlNetworkVer = fmlNetVer; - this.truncated = truncated; - } - - @Override - public String toString() - { - return "FMLStatusPing{" + - "channels=" + channels + - ", mods=" + mods + - ", fmlNetworkVer=" - + fmlNetworkVer + - ", truncated=" + truncated + - '}'; - } - - @Override + @Override // Don't compare the truncated flag as it is irrelevant public boolean equals(Object o) { if (this == o) return true; @@ -136,266 +127,220 @@ public class ServerStatusPing return Objects.hash(channels, mods, fmlNetworkVer); } - private List>> getChannelsForMod(String modId) + private List> getChannelsForMod(String modId) { return channels.entrySet().stream() .filter(c -> c.getKey().getNamespace().equals(modId)) .toList(); } - private List>> getNonModChannels() + private List> getNonModChannels() { return channels.entrySet().stream() .filter(c -> !mods.containsKey(c.getKey().getNamespace())) .toList(); } - public static class Serializer - { - public static ServerStatusPing deserialize(JsonObject forgeData) + public ByteBuf toBuf() { + // The following techniques are used to keep the size down: + // 1. Try and group channels by ModID, this relies on the assumption that a mod "examplemod" uses a channel + // like "examplemod:network". In that case only the "path" of the ResourceLocation is written + // 2. Avoid sending IGNORESERVERONLY in plain text, instead use a flag (if set, no version string is sent) + // + // The size can be estimated as follows (assuming there are no non-mod network channels) + // bytes = 2 + // + mod_count * (avg_mod_id_length + avg_mod_version_length + 1) + // + (mod_count * avg_channel_count_per_mod) * (avg_mod_channel_length + avg_mod_channel_version_length + 1) + // + 1 + // for 600 mods with an average ModID and channel length of 20, an average channel of 1 per mod and an + // average version length of 5 this turns out to be 31203 bytes, which easily fits into the upper limit of + // roughly 60000 bytes. As such it is estimated that the upper limit will never be reached. + // we still check though and potentially truncate the list + var reachedSizeLimit = false; + var buf = new FriendlyByteBuf(Unpooled.buffer()); + buf.writeBoolean(false); // placeholder for whether we are truncating + buf.writeShort(mods.size()); // short so that we can replace it later in case of truncation + int writtenCount = 0; + for (var modEntry : mods.entrySet()) { - try + var isIgnoreServerOnly = modEntry.getValue().equals(NetworkConstants.IGNORESERVERONLY); + + var channelsForMod = getChannelsForMod(modEntry.getKey()); + var channelSizeAndVersionFlag = channelsForMod.size() << 1; + if (isIgnoreServerOnly) { - if (forgeData.has("d")) - { - return deserializeOptimized(forgeData); - } - final Map> channels = StreamSupport.stream(GsonHelper.getAsJsonArray(forgeData, "channels").spliterator(), false). - map(JsonElement::getAsJsonObject). - collect(Collectors.toMap(jo -> new ResourceLocation(GsonHelper.getAsString(jo, "res")), - jo -> Pair.of(GsonHelper.getAsString(jo, "version"), GsonHelper.getAsBoolean(jo, "required"))) - ); - - final Map mods = StreamSupport.stream(GsonHelper.getAsJsonArray(forgeData, "mods").spliterator(), false). - map(JsonElement::getAsJsonObject). - collect(Collectors.toMap(jo -> GsonHelper.getAsString(jo, "modId"), jo->GsonHelper.getAsString(jo, "modmarker"))); - - final int remoteFMLVersion = GsonHelper.getAsInt(forgeData, "fmlNetworkVersion"); - final boolean truncated = GsonHelper.getAsBoolean(forgeData, "truncated", false); - return new ServerStatusPing(channels, mods, remoteFMLVersion, truncated); + channelSizeAndVersionFlag |= VERSION_FLAG_IGNORESERVERONLY; } - catch (JsonSyntaxException | IndexOutOfBoundsException | ResourceLocationException e) + buf.writeVarInt(channelSizeAndVersionFlag); + + buf.writeUtf(modEntry.getKey()); + if (!isIgnoreServerOnly) { - LOGGER.debug(NetworkConstants.NETWORK, "Encountered an error parsing status ping data", e); - return null; + buf.writeUtf(modEntry.getValue()); + } + + // write the channels for this mod, if any + for (var entry : channelsForMod) + { + buf.writeUtf(entry.getKey().getPath()); + buf.writeUtf(entry.getValue().version()); + buf.writeBoolean(entry.getValue().required()); + } + + writtenCount++; + + if (buf.readableBytes() >= 60000) + { + reachedSizeLimit = true; + break; } } - - public static JsonObject serialize(ServerStatusPing forgeData) + if (!reachedSizeLimit) { - // The following techniques are used to keep the size down: - // 1. Try and group channels by ModID, this relies on the assumption that a mod "examplemod" uses a channel - // like "examplemod:network". In that case only the "path" of the ResourceLocation is written - // 2. Avoid sending IGNORESERVERONLY in plain text, instead use a flag (if set, no version string is sent) - // - // The size can be estimated as follows (assuming there are no non-mod network channels) - // bytes = 2 - // + mod_count * (avg_mod_id_length + avg_mod_version_length + 1) - // + (mod_count * avg_channel_count_per_mod) * (avg_mod_channel_length + avg_mod_channel_version_length + 1) - // + 1 - // for 600 mods with an average ModID and channel length of 20, an average channel of 1 per mod and an - // average version length of 5 this turns out to be 31203 bytes, which easily fits into the upper limit of - // roughly 60000 bytes. As such it is estimated that the upper limit will never be reached. - // we still check though and potentially truncate the list - - var reachedSizeLimit = false; - var buf = new FriendlyByteBuf(Unpooled.buffer()); - buf.writeBoolean(false); // placeholder for whether we are truncating - buf.writeShort(forgeData.mods.size()); // short so that we can replace it later in case of truncation - int writtenCount = 0; - for (var modEntry : forgeData.mods.entrySet()) + // write any channels that don't match up with a ModID. + var nonModChannels = getNonModChannels(); + buf.writeVarInt(nonModChannels.size()); + for (var entry : nonModChannels) { - var isIgnoreServerOnly = modEntry.getValue().equals(NetworkConstants.IGNORESERVERONLY); - - var channelsForMod = forgeData.getChannelsForMod(modEntry.getKey()); - var channelSizeAndVersionFlag = channelsForMod.size() << 1; - if (isIgnoreServerOnly) - { - channelSizeAndVersionFlag |= VERSION_FLAG_IGNORESERVERONLY; - } - buf.writeVarInt(channelSizeAndVersionFlag); - - buf.writeUtf(modEntry.getKey()); - if (!isIgnoreServerOnly) - { - buf.writeUtf(modEntry.getValue()); - } - - // write the channels for this mod, if any - for (var entry : channelsForMod) - { - buf.writeUtf(entry.getKey().getPath()); - buf.writeUtf(entry.getValue().getLeft()); - buf.writeBoolean(entry.getValue().getRight()); - } - - writtenCount++; - - if (buf.readableBytes() >= 60000) - { - reachedSizeLimit = true; - break; - } + buf.writeResourceLocation(entry.getKey()); + buf.writeUtf(entry.getValue().version()); + buf.writeBoolean(entry.getValue().required()); } - - if (!reachedSizeLimit) - { - // write any channels that don't match up with a ModID. - var nonModChannels = forgeData.getNonModChannels(); - buf.writeVarInt(nonModChannels.size()); - for (var entry : nonModChannels) - { - buf.writeResourceLocation(entry.getKey()); - buf.writeUtf(entry.getValue().getLeft()); - buf.writeBoolean(entry.getValue().getRight()); - } - } - else - { - buf.setShort(1, writtenCount); - buf.writeVarInt(0); - } - - buf.setBoolean(0, reachedSizeLimit); - - var obj = new JsonObject(); - obj.addProperty("fmlNetworkVersion", forgeData.fmlNetworkVer); - obj.addProperty("d", encodeOptimized(buf)); - - // add dummy properties, so old versions do not crash when deserializing - obj.add("channels", new JsonArray()); - obj.add("mods", new JsonArray()); - // legacy versions see truncated lists, modern versions ignore this truncated flag (binary data has its own) - obj.addProperty("truncated", true); - return obj; + } + else + { + buf.setShort(1, writtenCount); + buf.writeVarInt(0); } - private static final int VERSION_FLAG_IGNORESERVERONLY = 0b1; + buf.setBoolean(0, reachedSizeLimit); + return buf; + } - private static ServerStatusPing deserializeOptimized(JsonObject forgeData) + private static final int VERSION_FLAG_IGNORESERVERONLY = 0b1; + + private static ServerStatusPing deserializeOptimized(int fmlNetworkVersion, ByteBuf bbuf) { + var buf = new FriendlyByteBuf(bbuf); + boolean truncated; + Map channels; + Map mods; + + try { - int remoteFMLVersion = GsonHelper.getAsInt(forgeData, "fmlNetworkVersion"); - var buf = new FriendlyByteBuf(decodeOptimized(GsonHelper.getAsString(forgeData, "d"))); - - boolean truncated; - Map> channels; - Map mods; - - try - { - truncated = buf.readBoolean(); - var modsSize = buf.readUnsignedShort(); - mods = new HashMap<>(); - channels = new HashMap<>(); - for (var i = 0; i < modsSize; i++) { - var channelSizeAndVersionFlag = buf.readVarInt(); - var channelSize = channelSizeAndVersionFlag >>> 1; - var isIgnoreServerOnly = (channelSizeAndVersionFlag & VERSION_FLAG_IGNORESERVERONLY) != 0; - var modId = buf.readUtf(); - var modVersion = isIgnoreServerOnly ? NetworkConstants.IGNORESERVERONLY : buf.readUtf(); - for (var i1 = 0; i1 < channelSize; i1++) { - var channelName = buf.readUtf(); - var channelVersion = buf.readUtf(); - var requiredOnClient = buf.readBoolean(); - channels.put(new ResourceLocation(modId, channelName), Pair.of(channelVersion, requiredOnClient)); - } - - mods.put(modId, modVersion); - } - - var nonModChannelCount = buf.readVarInt(); - for (var i = 0; i < nonModChannelCount; i++) { - var channelName = buf.readResourceLocation(); + truncated = buf.readBoolean(); + var modsSize = buf.readUnsignedShort(); + mods = new HashMap<>(); + channels = new HashMap<>(); + for (var i = 0; i < modsSize; i++) { + var channelSizeAndVersionFlag = buf.readVarInt(); + var channelSize = channelSizeAndVersionFlag >>> 1; + var isIgnoreServerOnly = (channelSizeAndVersionFlag & VERSION_FLAG_IGNORESERVERONLY) != 0; + var modId = buf.readUtf(); + var modVersion = isIgnoreServerOnly ? NetworkConstants.IGNORESERVERONLY : buf.readUtf(); + for (var i1 = 0; i1 < channelSize; i1++) { + var channelName = buf.readUtf(); var channelVersion = buf.readUtf(); var requiredOnClient = buf.readBoolean(); - channels.put(channelName, Pair.of(channelVersion, requiredOnClient)); + final ResourceLocation id = new ResourceLocation(modId, channelName); + channels.put(id, new ChannelData(id, channelVersion, requiredOnClient)); } - } - finally - { - buf.release(); + + mods.put(modId, modVersion); } - return new ServerStatusPing(channels, mods, remoteFMLVersion, truncated); + var nonModChannelCount = buf.readVarInt(); + for (var i = 0; i < nonModChannelCount; i++) { + var channelName = buf.readResourceLocation(); + var channelVersion = buf.readUtf(); + var requiredOnClient = buf.readBoolean(); + channels.put(channelName, new ChannelData(channelName, channelVersion, requiredOnClient)); + } + } + finally + { + buf.release(); } - /** - * Encode given ByteBuf to a String. This is optimized for UTF-16 Code-Point count. - * Supports at most 2^30 bytes in length - */ - private static String encodeOptimized(ByteBuf buf) + return new ServerStatusPing(channels, mods, fmlNetworkVersion, truncated); + } + + /** + * Encode given ByteBuf to a String. This is optimized for UTF-16 Code-Point count. + * Supports at most 2^30 bytes in length + */ + private static String encodeOptimized(ByteBuf buf) + { + var byteLength = buf.readableBytes(); + var sb = new StringBuilder(); + sb.append((char) (byteLength & 0x7FFF)); + sb.append((char) ((byteLength >>> 15) & 0x7FFF)); + + int buffer = 0; // we will need at most 8 + 14 = 22 bits of buffer, so an int is enough + int bitsInBuf = 0; + while (buf.isReadable()) { - var byteLength = buf.readableBytes(); - var sb = new StringBuilder(); - sb.append((char) (byteLength & 0x7FFF)); - sb.append((char) ((byteLength >>> 15) & 0x7FFF)); - - int buffer = 0; // we will need at most 8 + 14 = 22 bits of buffer, so an int is enough - int bitsInBuf = 0; - while (buf.isReadable()) - { - if (bitsInBuf >= 15) - { - char c = (char) (buffer & 0x7FFF); - sb.append(c); - buffer >>>= 15; - bitsInBuf -= 15; - } - var b = buf.readUnsignedByte(); - buffer |= (int) b << bitsInBuf; - bitsInBuf += 8; - } - - if (bitsInBuf > 0) + if (bitsInBuf >= 15) { char c = (char) (buffer & 0x7FFF); sb.append(c); + buffer >>>= 15; + bitsInBuf -= 15; } - return sb.toString(); + var b = buf.readUnsignedByte(); + buffer |= (int) b << bitsInBuf; + bitsInBuf += 8; } + buf.release(); - /** - * Decode binary data encoded by {@link #encodeOptimized} - */ - private static ByteBuf decodeOptimized(String s) + if (bitsInBuf > 0) { - var size0 = ((int) s.charAt(0)); - var size1 = ((int) s.charAt(1)); - var size = size0 | (size1 << 15); + char c = (char) (buffer & 0x7FFF); + sb.append(c); + } + return sb.toString(); + } - var buf = Unpooled.buffer(size); + /** + * Decode binary data encoded by {@link #encodeOptimized} + */ + private static ByteBuf decodeOptimized(String s) + { + var size0 = ((int) s.charAt(0)); + var size1 = ((int) s.charAt(1)); + var size = size0 | (size1 << 15); - int stringIndex = 2; - int buffer = 0; // we will need at most 8 + 14 = 22 bits of buffer, so an int is enough - int bitsInBuf = 0; - while (stringIndex < s.length()) - { - while (bitsInBuf >= 8) - { - buf.writeByte(buffer); - buffer >>>= 8; - bitsInBuf -= 8; - } + var buf = Unpooled.buffer(size); - var c = s.charAt(stringIndex); - buffer |= (((int) c) & 0x7FFF) << bitsInBuf; - bitsInBuf += 15; - stringIndex++; - } - - // write any leftovers - while (buf.readableBytes() < size) + int stringIndex = 2; + int buffer = 0; // we will need at most 8 + 14 = 22 bits of buffer, so an int is enough + int bitsInBuf = 0; + while (stringIndex < s.length()) + { + while (bitsInBuf >= 8) { buf.writeByte(buffer); buffer >>>= 8; bitsInBuf -= 8; } - return buf; + + var c = s.charAt(stringIndex); + buffer |= (((int) c) & 0x7FFF) << bitsInBuf; + bitsInBuf += 15; + stringIndex++; } + + // write any leftovers + while (buf.readableBytes() < size) + { + buf.writeByte(buffer); + buffer >>>= 8; + bitsInBuf -= 8; + } + return buf; } - public Map> getRemoteChannels() + public Map getRemoteChannels() { return this.channels; } @@ -414,4 +359,19 @@ public class ServerStatusPing { return truncated; } + + public record ModInfo(String modId, String modmarker) { + public static final Codec CODEC = RecordCodecBuilder.create(in -> in.group( + Codec.STRING.fieldOf("modId").forGetter(ModInfo::modId), + Codec.STRING.fieldOf("modmarker").forGetter(ModInfo::modmarker) + ).apply(in, ModInfo::new)); + } + + public record ChannelData(ResourceLocation res, String version, boolean required) { + public static final Codec CODEC = RecordCodecBuilder.create(in -> in.group( + ResourceLocation.CODEC.fieldOf("res").forGetter(ChannelData::res), + Codec.STRING.fieldOf("version").forGetter(ChannelData::version), + Codec.BOOL.fieldOf("required").forGetter(ChannelData::required) + ).apply(in, ChannelData::new)); + } } diff --git a/src/main/java/net/minecraftforge/registries/ForgeDeferredRegistriesSetup.java b/src/main/java/net/minecraftforge/registries/ForgeDeferredRegistriesSetup.java index 46770abdd4..72f53f65f5 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeDeferredRegistriesSetup.java +++ b/src/main/java/net/minecraftforge/registries/ForgeDeferredRegistriesSetup.java @@ -27,6 +27,7 @@ public class ForgeDeferredRegistriesSetup ForgeRegistries.DEFERRED_FLUID_TYPES.register(modEventBus); ForgeRegistries.DEFERRED_STRUCTURE_MODIFIER_SERIALIZERS.register(modEventBus); ForgeRegistries.DEFERRED_HOLDER_SET_TYPES.register(modEventBus); + ForgeRegistries.DEFERRED_DISPLAY_CONTEXTS.register(modEventBus); setup = true; } diff --git a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java index e18c3a9145..2e14b2bd90 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeRegistries.java +++ b/src/main/java/net/minecraftforge/registries/ForgeRegistries.java @@ -9,6 +9,7 @@ import com.mojang.serialization.Codec; import net.minecraft.commands.synchronization.ArgumentTypeInfo; import net.minecraft.network.syncher.EntityDataSerializer; import net.minecraft.world.entity.decoration.PaintingVariant; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.block.Block; import net.minecraft.world.item.enchantment.Enchantment; @@ -48,7 +49,9 @@ import net.minecraftforge.fluids.FluidType; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.holdersets.HolderSetType; +import java.util.Arrays; import java.util.function.Consumer; +import java.util.function.Predicate; import java.util.function.Supplier; import net.minecraftforge.common.world.StructureModifier; @@ -137,6 +140,13 @@ public class ForgeRegistries */ public static final Supplier> HOLDER_SET_TYPES = DEFERRED_HOLDER_SET_TYPES.makeRegistry(GameData::getHolderSetTypeRegistryBuilder); + static final DeferredRegister DEFERRED_DISPLAY_CONTEXTS = DeferredRegister.create(Keys.DISPLAY_CONTEXTS, "forge"); + /** + * Calling {@link Supplier#get()} before {@link NewRegistryEvent} is fired will result in a null registry returned. + * Use {@link Keys#DISPLAY_CONTEXTS} to create a {@link DeferredRegister}. + */ + public static final Supplier> DISPLAY_CONTEXTS = DEFERRED_DISPLAY_CONTEXTS.makeRegistry(GameData::getItemDisplayContextRegistryBuilder); + public static final class Keys { //Vanilla public static final ResourceKey> BLOCKS = key("block"); @@ -179,6 +189,7 @@ public class ForgeRegistries public static final ResourceKey>> STRUCTURE_MODIFIER_SERIALIZERS = key("forge:structure_modifier_serializers"); public static final ResourceKey> FLUID_TYPES = key("forge:fluid_type"); public static final ResourceKey> HOLDER_SET_TYPES = key("forge:holder_set_type"); + public static final ResourceKey> DISPLAY_CONTEXTS = key("forge:display_contexts"); // Forge Dynamic public static final ResourceKey> BIOME_MODIFIERS = key("forge:biome_modifier"); diff --git a/src/main/java/net/minecraftforge/registries/ForgeRegistry.java b/src/main/java/net/minecraftforge/registries/ForgeRegistry.java index 4c83885310..1846aa35b0 100644 --- a/src/main/java/net/minecraftforge/registries/ForgeRegistry.java +++ b/src/main/java/net/minecraftforge/registries/ForgeRegistry.java @@ -7,6 +7,7 @@ package net.minecraftforge.registries; import java.util.*; import java.util.Map.Entry; +import java.util.function.IntFunction; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Codec; @@ -351,6 +352,7 @@ public class ForgeRegistry implements IForgeRegistryInternal, IForgeRegist return getIDRaw(this.names.get(name)); } + @Override public V getValue(int id) { V ret = this.ids.get(id); @@ -381,6 +383,11 @@ public class ForgeRegistry implements IForgeRegistryInternal, IForgeRegist return new ForgeRegistry<>(stage, name, builder); } + @Override + public void register(int id, ResourceLocation key, V value) { + add(id, key, value, key.getNamespace()); + } + int add(int id, ResourceLocation key, V value) { final String owner = ModLoadingContext.get().getActiveNamespace(); @@ -995,7 +1002,7 @@ public class ForgeRegistry implements IForgeRegistryInternal, IForgeRegist int id = n.intValue(); if (ids.get(id) == null) { - return DataResult.error("Unknown registry id in " + ForgeRegistry.this.key + ": " + n); + return DataResult.error(() -> "Unknown registry id in " + ForgeRegistry.this.key + ": " + n); } V val = ForgeRegistry.this.getValue(id); return DataResult.success(val); @@ -1004,7 +1011,7 @@ public class ForgeRegistry implements IForgeRegistryInternal, IForgeRegist else { return ResourceLocation.CODEC.decode(ops, input).flatMap(keyValuePair -> !ForgeRegistry.this.containsKey(keyValuePair.getFirst()) - ? DataResult.error("Unknown registry key in " + ForgeRegistry.this.key + ": " + keyValuePair.getFirst()) + ? DataResult.error(() -> "Unknown registry key in " + ForgeRegistry.this.key + ": " + keyValuePair.getFirst()) : DataResult.success(keyValuePair.mapFirst(ForgeRegistry.this::getValue))); } } @@ -1015,7 +1022,7 @@ public class ForgeRegistry implements IForgeRegistryInternal, IForgeRegist ResourceLocation key = getKey(input); if (key == null) { - return DataResult.error("Unknown registry element in " + ForgeRegistry.this.key + ": " + input); + return DataResult.error(() -> "Unknown registry element in " + ForgeRegistry.this.key + ": " + input); } T toMerge = ops.compressMaps() ? ops.createInt(getID(input)) : ops.createString(key.toString()); return ops.mergeToPrimitive(prefix, toMerge); diff --git a/src/main/java/net/minecraftforge/registries/GameData.java b/src/main/java/net/minecraftforge/registries/GameData.java index ae8ed713d0..737c43790e 100644 --- a/src/main/java/net/minecraftforge/registries/GameData.java +++ b/src/main/java/net/minecraftforge/registries/GameData.java @@ -11,6 +11,7 @@ import com.google.common.collect.Maps; import com.google.common.collect.Multimap; import com.mojang.serialization.Codec; import com.mojang.serialization.Lifecycle; +import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.HashMap; @@ -22,6 +23,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.function.BiConsumer; +import java.util.function.Predicate; import java.util.stream.Collectors; import net.minecraft.core.IdMapper; import net.minecraft.core.MappedRegistry; @@ -37,6 +39,7 @@ import net.minecraft.world.entity.ai.attributes.DefaultAttributes; import net.minecraft.world.entity.ai.village.poi.PoiType; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.level.block.AirBlock; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; @@ -201,6 +204,17 @@ public class GameData return new RegistryBuilder().disableSaving().disableSync(); } + static RegistryBuilder getItemDisplayContextRegistryBuilder() + { + return new RegistryBuilder() + .setMaxID(128 * 2) /* 0 -> 127 gets positive ID, 128 -> 256 gets negative ID */.disableOverrides().disableSaving() + .setDefaultKey(new ResourceLocation("minecraft:none")) + .onCreate((owner, stage) -> Arrays.stream(ItemDisplayContext.values()) + .filter(Predicate.not(ItemDisplayContext::isModded)) + .forEach(ctx -> owner.register(ctx.getId(), new ResourceLocation("minecraft", ctx.getSerializedName()), ctx))) + .onAdd(ItemDisplayContext.ADD_CALLBACK); + } + private static RegistryBuilder makeRegistry(ResourceKey> key) { return new RegistryBuilder().setName(key.location()).setMaxID(MAX_VARINT).hasWrapper(); diff --git a/src/main/java/net/minecraftforge/registries/IForgeRegistryInternal.java b/src/main/java/net/minecraftforge/registries/IForgeRegistryInternal.java index f4ba3d7890..ad2c8bfd01 100644 --- a/src/main/java/net/minecraftforge/registries/IForgeRegistryInternal.java +++ b/src/main/java/net/minecraftforge/registries/IForgeRegistryInternal.java @@ -10,4 +10,7 @@ import net.minecraft.resources.ResourceLocation; public interface IForgeRegistryInternal extends IForgeRegistry { void setSlaveMap(ResourceLocation name, Object obj); + + void register(int id, ResourceLocation key, V value); + V getValue(int id); } diff --git a/src/main/java/net/minecraftforge/server/ServerLifecycleHooks.java b/src/main/java/net/minecraftforge/server/ServerLifecycleHooks.java index ef5f7f6765..995360d89a 100644 --- a/src/main/java/net/minecraftforge/server/ServerLifecycleHooks.java +++ b/src/main/java/net/minecraftforge/server/ServerLifecycleHooks.java @@ -86,7 +86,6 @@ public class ServerLifecycleHooks public static boolean handleServerAboutToStart(final MinecraftServer server) { currentServer = server; - currentServer.getStatus().setForgeData(new ServerStatusPing()); //gathers NetworkRegistry data // on the dedi server we need to force the stuff to setup properly LogicalSidedProvider.setServer(()->server); ConfigTracker.INSTANCE.loadConfigs(ModConfig.Type.SERVER, getServerConfigPath(server)); diff --git a/src/main/java/net/minecraftforge/server/command/TagsCommand.java b/src/main/java/net/minecraftforge/server/command/TagsCommand.java index 25f8a25241..c11e24f415 100644 --- a/src/main/java/net/minecraftforge/server/command/TagsCommand.java +++ b/src/main/java/net/minecraftforge/server/command/TagsCommand.java @@ -198,7 +198,7 @@ class TagsCommand { final String allElementNames = names.get().sorted().collect(Collectors.joining("\n")); final long totalPages = (count - 1) / PAGE_SIZE + 1; - final long actualPage = Mth.clamp(currentPage, 1, totalPages); + final long actualPage = (long) Mth.clamp(currentPage, 1, totalPages); MutableComponent containsComponent = Component.translatable(containsText, count); if (count > 0) // Highlight the count text, make it clickable, and append page counters diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 7e26bde0f0..74115acec7 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -52,15 +52,15 @@ protected net.minecraft.client.gui.Gui f_93000_ # titleTime protected net.minecraft.client.gui.Gui f_93001_ # title protected net.minecraft.client.gui.Gui f_93002_ # subtitle #endgroup -protected net.minecraft.client.gui.Gui m_168675_(F)V # renderSpyglassOverlay protected net.minecraft.client.gui.Gui m_168688_(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/world/entity/player/Player;IIIIFIIIZ)V # renderHearts -protected net.minecraft.client.gui.Gui m_168708_(Lnet/minecraft/resources/ResourceLocation;F)V # renderTextureOverlay -protected net.minecraft.client.gui.Gui m_93007_(F)V # renderPortalOverlay +public net.minecraft.client.gui.Gui m_264148_(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/world/entity/Entity;)V # renderVignette +protected net.minecraft.client.gui.Gui m_264464_(Lcom/mojang/blaze3d/vertex/PoseStack;F)V # renderPortalOverlay +public net.minecraft.client.gui.Gui m_264541_(Lcom/mojang/blaze3d/vertex/PoseStack;F)V # renderSpyglassOverlay +protected net.minecraft.client.gui.Gui m_264571_(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/resources/ResourceLocation;F)V # renderTextureOverlay public net.minecraft.client.gui.Gui m_93009_(FLcom/mojang/blaze3d/vertex/PoseStack;)V # renderHotbar public net.minecraft.client.gui.Gui m_93028_(Lcom/mojang/blaze3d/vertex/PoseStack;)V # renderEffects public net.minecraft.client.gui.Gui m_93036_(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/world/scores/Objective;)V # displayScoreboardSidebar protected net.minecraft.client.gui.Gui m_93039_(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/gui/Font;III)V # drawBackdrop -public net.minecraft.client.gui.Gui m_93067_(Lnet/minecraft/world/entity/Entity;)V # renderVignette public net.minecraft.client.gui.Gui m_93080_(Lcom/mojang/blaze3d/vertex/PoseStack;)V # renderCrosshair protected net.minecraft.client.gui.components.AbstractSelectionList$Entry f_93521_ # list protected net.minecraft.client.gui.components.DebugScreenOverlay f_94032_ # block @@ -73,6 +73,7 @@ public net.minecraft.client.model.geom.LayerDefinitions f_171107_ # INNER_ARMOR_ public net.minecraft.client.multiplayer.ClientPacketListener f_104899_ # commands public net.minecraft.client.particle.ParticleEngine m_107378_(Lnet/minecraft/core/particles/ParticleType;Lnet/minecraft/client/particle/ParticleEngine$SpriteParticleRegistration;)V # register public net.minecraft.client.particle.ParticleEngine m_107381_(Lnet/minecraft/core/particles/ParticleType;Lnet/minecraft/client/particle/ParticleProvider;)V # register +public net.minecraft.client.particle.ParticleEngine m_272137_(Lnet/minecraft/core/particles/ParticleType;Lnet/minecraft/client/particle/ParticleProvider$Sprite;)V # register public net.minecraft.client.particle.ParticleEngine$SpriteParticleRegistration public net.minecraft.client.player.LocalPlayer m_8088_()I # getPermissionLevel public net.minecraft.client.renderer.GameRenderer m_109128_(Lnet/minecraft/resources/ResourceLocation;)V # loadEffect @@ -192,7 +193,6 @@ protected net.minecraft.data.tags.TagsProvider f_126543_ # builders public-f net.minecraft.data.tags.TagsProvider m_6055_()Ljava/lang/String; # getName public net.minecraft.data.tags.TagsProvider$TagAppender public net.minecraft.gametest.framework.GameTestServer (Ljava/lang/Thread;Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lnet/minecraft/server/packs/repository/PackRepository;Lnet/minecraft/server/WorldStem;Ljava/util/Collection;Lnet/minecraft/core/BlockPos;)V # constructor -public net.minecraft.network.protocol.status.ClientboundStatusResponsePacket f_134885_ # GSON public net.minecraft.resources.ResourceLocation m_135835_(C)Z # validNamespaceChar public net.minecraft.resources.ResourceLocation m_135841_(Ljava/lang/String;)Z # isValidPath public net.minecraft.resources.ResourceLocation m_135843_(Ljava/lang/String;)Z # isValidNamespace @@ -204,22 +204,17 @@ public net.minecraft.server.level.ServerLevel m_142646_()Lnet/minecraft/world/le public net.minecraft.server.level.ServerPlayer f_8940_ # containerCounter public net.minecraft.server.level.ServerPlayer m_143399_(Lnet/minecraft/world/inventory/AbstractContainerMenu;)V # initMenu public net.minecraft.server.level.ServerPlayer m_9217_()V # nextContainerCounter +public net.minecraft.server.network.ServerGamePacketListenerImpl f_9742_ # connection public net.minecraft.server.network.ServerLoginPacketListenerImpl f_10021_ # gameProfile -public net.minecraft.server.packs.PackType f_143750_ # bridgeType public net.minecraft.server.packs.repository.ServerPacksSource m_246173_()Lnet/minecraft/server/packs/VanillaPackResources; # createVanillaPackSource public net.minecraft.server.packs.resources.FallbackResourceManager f_10599_ # fallbacks public net.minecraft.util.ExtraCodecs$EitherCodec public net.minecraft.util.datafix.fixes.StructuresBecomeConfiguredFix$Conversion public net.minecraft.util.thread.BlockableEventLoop m_18689_(Ljava/lang/Runnable;)Ljava/util/concurrent/CompletableFuture; # submitAsync #group public net.minecraft.world.damagesource.DamageSource *() #All methods public, most are already -public net.minecraft.world.damagesource.DamageSource (Ljava/lang/String;)V # constructor -public net.minecraft.world.damagesource.DamageSource m_146706_()Lnet/minecraft/world/damagesource/DamageSource; # damageHelmet -public net.minecraft.world.damagesource.DamageSource m_19380_()Lnet/minecraft/world/damagesource/DamageSource; # bypassArmor -public net.minecraft.world.damagesource.DamageSource m_19381_()Lnet/minecraft/world/damagesource/DamageSource; # bypassInvul -public net.minecraft.world.damagesource.DamageSource m_19382_()Lnet/minecraft/world/damagesource/DamageSource; # bypassMagic -public net.minecraft.world.damagesource.DamageSource m_19383_()Lnet/minecraft/world/damagesource/DamageSource; # setIsFire -public net.minecraft.world.damagesource.DamageSource m_238403_()Lnet/minecraft/world/damagesource/DamageSource; # bypassEnchantments +public net.minecraft.world.damagesource.DamageSource (Lnet/minecraft/core/Holder;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/phys/Vec3;)V # constructor #endgroup +public net.minecraft.world.entity.Entity f_19793_ # maxUpStep protected net.minecraft.world.entity.Entity f_19843_ # ENTITY_COUNTER public net.minecraft.world.entity.Entity m_20078_()Ljava/lang/String; # getEncodeId public net.minecraft.world.entity.ExperienceOrb f_20770_ # value @@ -240,7 +235,7 @@ private-f net.minecraft.world.entity.raid.Raid$RaiderType f_37813_ # VALUES public net.minecraft.world.entity.schedule.Activity (Ljava/lang/String;)V # constructor protected net.minecraft.world.entity.vehicle.AbstractMinecart m_213728_()Lnet/minecraft/world/item/Item; # getDropItem - make AbstractMinecart implementable public net.minecraft.world.inventory.AnvilMenu f_39000_ # repairItemCountCost -public net.minecraft.world.inventory.MenuType (Lnet/minecraft/world/inventory/MenuType$MenuSupplier;)V # constructor +public net.minecraft.world.inventory.MenuType (Lnet/minecraft/world/inventory/MenuType$MenuSupplier;Lnet/minecraft/world/flag/FeatureFlagSet;)V # constructor public net.minecraft.world.inventory.MenuType$MenuSupplier public net.minecraft.world.item.CreativeModeTab$Output public net.minecraft.world.item.CreativeModeTab$TabVisibility @@ -265,6 +260,7 @@ public net.minecraft.world.item.HoeItem (Lnet/minecraft/world/item/Tier;IF public net.minecraft.world.item.PickaxeItem (Lnet/minecraft/world/item/Tier;IFLnet/minecraft/world/item/Item$Properties;)V # constructor public net.minecraft.world.item.RecordItem (ILnet/minecraft/sounds/SoundEvent;Lnet/minecraft/world/item/Item$Properties;I)V # constructor #endgroup +private-f net.minecraft.world.item.ItemDisplayContext f_268735_ # id public net.minecraft.world.item.ItemStackLinkedSet f_260558_ # TYPE_AND_TAG public net.minecraft.world.item.alchemy.PotionBrewing$Mix public net.minecraft.world.item.alchemy.PotionBrewing$Mix f_43533_ # ingredient @@ -319,7 +315,7 @@ public net.minecraft.world.level.block.BigDripleafBlock (Lnet/minecraft/wo public net.minecraft.world.level.block.BigDripleafStemBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BlastFurnaceBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BushBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.ButtonBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;IZLnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V # constructor +public net.minecraft.world.level.block.ButtonBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;IZ)V # constructor public net.minecraft.world.level.block.CactusBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CakeBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CandleCakeBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor @@ -335,9 +331,10 @@ public net.minecraft.world.level.block.CraftingTableBlock (Lnet/minecraft/ public net.minecraft.world.level.block.CropBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CrossCollisionBlock (FFFFFLnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.DeadBushBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.DecoratedPotBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.DirtPathBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.DispenserBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.DoorBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V # constructor +public net.minecraft.world.level.block.DoorBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor public net.minecraft.world.level.block.EnchantmentTableBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EndGatewayBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EndPortalBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor @@ -365,11 +362,12 @@ public net.minecraft.world.level.block.MangroveRootsBlock (Lnet/minecraft/ public net.minecraft.world.level.block.MelonBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.NetherWartBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.NyliumBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.PinkPetalsBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PipeBlock (FLnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PlayerHeadBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PlayerWallHeadBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PoweredRailBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.PressurePlateBlock (Lnet/minecraft/world/level/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V # constructor +public net.minecraft.world.level.block.PressurePlateBlock (Lnet/minecraft/world/level/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor public net.minecraft.world.level.block.PumpkinBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.RailBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.RedstoneTorchBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor @@ -395,11 +393,11 @@ public net.minecraft.world.level.block.StructureVoidBlock (Lnet/minecraft/ public net.minecraft.world.level.block.SugarCaneBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.TallGrassBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.TorchBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V # constructor -public net.minecraft.world.level.block.TrapDoorBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V # constructor +public net.minecraft.world.level.block.TrapDoorBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor public net.minecraft.world.level.block.WallSkullBlock (Lnet/minecraft/world/level/block/SkullBlock$Type;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WallTorchBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V # constructor public net.minecraft.world.level.block.WaterlilyBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.WeightedPressurePlateBlock (ILnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundEvent;)V # constructor +public net.minecraft.world.level.block.WeightedPressurePlateBlock (ILnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor public net.minecraft.world.level.block.WetSpongeBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WitherSkullBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WitherWallSkullBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor @@ -454,4 +452,4 @@ public net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType < protected net.minecraft.world.level.portal.PortalForcer f_77648_ # level public net.minecraft.world.level.storage.LevelResource (Ljava/lang/String;)V # constructor private-f net.minecraft.world.level.storage.loot.LootPool f_79028_ # rolls -private-f net.minecraft.world.level.storage.loot.LootPool f_79029_ # bonusRolls +private-f net.minecraft.world.level.storage.loot.LootPool f_79029_ # bonusRolls \ No newline at end of file diff --git a/src/main/resources/forge.exc b/src/main/resources/forge.exc index 94c09b5d84..b8a399bf1c 100644 --- a/src/main/resources/forge.exc +++ b/src/main/resources/forge.exc @@ -2,7 +2,7 @@ com/mojang/blaze3d/vertex/VertexConsumer.putBulkData(Lcom/mojang/blaze3d/vertex/ net/minecraft/advancements/Advancement$Builder.fromJson(Lcom/google/gson/JsonObject;Lnet/minecraft/advancements/critereon/DeserializationContext;Lnet/minecraftforge/common/crafting/conditions/ICondition$IContext;)Lnet/minecraft/advancements/Advancement$Builder;=|p_138381_,p_138382_,context net/minecraft/client/Options.processOptionsForge(Lnet/minecraft/client/Options$FieldAccess;)V=|p_168428_ net/minecraft/client/gui/screens/MenuScreens.getScreenFactory(Lnet/minecraft/world/inventory/MenuType;Lnet/minecraft/client/Minecraft;ILnet/minecraft/network/chat/Component;)Ljava/util/Optional;=|p_96202_,p_96203_,p_96204_,p_96205_ -net/minecraft/client/gui/screens/inventory/InventoryScreen.renderEntityInInventoryRaw(IIIFFLnet/minecraft/world/entity/LivingEntity;)V=|p_98851_,p_98852_,p_98853_,angleXComponent,angleYComponent,p_98856_ +net/minecraft/client/gui/screens/inventory/InventoryScreen.renderEntityInInventoryFollowsAngle(Lcom/mojang/blaze3d/vertex/PoseStack;IIIFFLnet/minecraft/world/entity/LivingEntity;)V=|p_275396_,p_275688_,p_275245_,p_275535_,angleXComponent,angleYComponent,p_275689_ net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.doLoadLevel(Lnet/minecraft/client/gui/screens/Screen;Ljava/lang/String;ZZZ)V=|p_233146_,p_233147_,p_233148_,p_233149_,confirmExperimentalWarning net/minecraft/client/renderer/ScreenEffectRenderer.getOverlayBlock(Lnet/minecraft/world/entity/player/Player;)Lorg/apache/commons/lang3/tuple/Pair;=|p_110717_ net/minecraft/client/renderer/ScreenEffectRenderer.renderFluid(Lnet/minecraft/client/Minecraft;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/resources/ResourceLocation;)V=|p_110726_,p_110727_,texture @@ -18,6 +18,8 @@ net/minecraft/client/renderer/block/ModelBlockRenderer.tesselateBlock(Lnet/minec net/minecraft/client/renderer/block/ModelBlockRenderer.tesselateWithAO(Lnet/minecraft/world/level/BlockAndTintGetter;Lnet/minecraft/client/resources/model/BakedModel;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/BlockPos;Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;ZLnet/minecraft/util/RandomSource;JILnet/minecraftforge/client/model/data/ModelData;Lnet/minecraft/client/renderer/RenderType;)V=|p_111079_,p_111080_,p_111081_,p_111082_,p_111083_,p_111084_,p_111085_,p_111086_,p_111087_,p_111088_,modelData,renderType net/minecraft/client/renderer/block/ModelBlockRenderer.tesselateWithoutAO(Lnet/minecraft/world/level/BlockAndTintGetter;Lnet/minecraft/client/resources/model/BakedModel;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/BlockPos;Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;ZLnet/minecraft/util/RandomSource;JILnet/minecraftforge/client/model/data/ModelData;Lnet/minecraft/client/renderer/RenderType;)V=|p_111091_,p_111092_,p_111093_,p_111094_,p_111095_,p_111096_,p_111097_,p_111098_,p_111099_,p_111100_,modelData,renderType net/minecraft/client/renderer/block/model/BakedQuad.([IILnet/minecraft/core/Direction;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;ZZ)V=|p_111298_,p_111299_,p_111300_,p_111301_,p_111302_,hasAmbientOcclusion +net/minecraft/client/renderer/block/model/BlockElement.(Lorg/joml/Vector3f;Lorg/joml/Vector3f;Ljava/util/Map;Lnet/minecraft/client/renderer/block/model/BlockElementRotation;ZLnet/minecraftforge/client/model/ForgeFaceData;)V=|p_253626_,p_254426_,p_254454_,p_254229_,p_253661_,faceData +net/minecraft/client/renderer/block/model/BlockElementFace.(Lnet/minecraft/core/Direction;ILjava/lang/String;Lnet/minecraft/client/renderer/block/model/BlockFaceUV;Lnet/minecraftforge/client/model/ForgeFaceData;)V=|p_111359_,p_111360_,p_111361_,p_111362_,faceData net/minecraft/client/renderer/block/model/BlockModel.bakeVanilla(Lnet/minecraft/client/resources/model/ModelBaker;Lnet/minecraft/client/renderer/block/model/BlockModel;Ljava/util/function/Function;Lnet/minecraft/client/resources/model/ModelState;Lnet/minecraft/resources/ResourceLocation;ZLnet/minecraftforge/client/RenderTypeGroup;)Lnet/minecraft/client/resources/model/BakedModel;=|p_249720_,p_111451_,p_111452_,p_111453_,p_111454_,p_111455_,renderTypes net/minecraft/client/renderer/block/model/ItemTransform.(Lorg/joml/Vector3f;Lorg/joml/Vector3f;Lorg/joml/Vector3f;Lorg/joml/Vector3f;)V=|p_254427_,p_254496_,p_254022_,rightRotation net/minecraft/client/renderer/block/model/ItemTransforms.(Lnet/minecraft/client/renderer/block/model/ItemTransform;Lnet/minecraft/client/renderer/block/model/ItemTransform;Lnet/minecraft/client/renderer/block/model/ItemTransform;Lnet/minecraft/client/renderer/block/model/ItemTransform;Lnet/minecraft/client/renderer/block/model/ItemTransform;Lnet/minecraft/client/renderer/block/model/ItemTransform;Lnet/minecraft/client/renderer/block/model/ItemTransform;Lnet/minecraft/client/renderer/block/model/ItemTransform;Lcom/google/common/collect/ImmutableMap;)V=|p_111798_,p_111799_,p_111800_,p_111801_,p_111802_,p_111803_,p_111804_,p_111805_,moddedTransforms @@ -41,12 +43,15 @@ net/minecraft/data/tags/GameEventTagsProvider.(Lnet/minecraft/data/PackOut net/minecraft/data/tags/InstrumentTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_256418_,p_256038_,modId,existingFileHelper net/minecraft/data/tags/IntrinsicHolderTagsProvider$IntrinsicTagAppender.(Lnet/minecraft/tags/TagBuilder;Ljava/util/function/Function;Ljava/lang/String;)V=|p_256108_,p_256433_,modId net/minecraft/data/tags/IntrinsicHolderTagsProvider.(Lnet/minecraft/data/PackOutput;Lnet/minecraft/resources/ResourceKey;Ljava/util/concurrent/CompletableFuture;Ljava/util/function/Function;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_256164_,p_256155_,p_256488_,p_256168_,modId,existingFileHelper -net/minecraft/data/tags/ItemTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Lnet/minecraft/data/tags/TagsProvider;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_255871_,p_256035_,p_256467_,modId,existingFileHelper +net/minecraft/data/tags/IntrinsicHolderTagsProvider.(Lnet/minecraft/data/PackOutput;Lnet/minecraft/resources/ResourceKey;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/CompletableFuture;Ljava/util/function/Function;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_275304_,p_275709_,p_275227_,p_275311_,p_275566_,modId,existingFileHelper +net/minecraft/data/tags/ItemTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_275204_,p_275194_,p_275207_,p_275634_,modId,existingFileHelper +net/minecraft/data/tags/ItemTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_275343_,p_275729_,p_275322_,modId,existingFileHelper net/minecraft/data/tags/PaintingVariantTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_255750_,p_256184_,modId,existingFileHelper net/minecraft/data/tags/PoiTypeTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_256012_,p_256617_,modId,existingFileHelper net/minecraft/data/tags/StructureTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_256522_,p_256661_,modId,existingFileHelper net/minecraft/data/tags/TagsProvider$TagAppender.(Lnet/minecraft/tags/TagBuilder;Ljava/lang/String;)V=|p_236454_,modId net/minecraft/data/tags/TagsProvider.(Lnet/minecraft/data/PackOutput;Lnet/minecraft/resources/ResourceKey;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_256596_,p_255886_,p_256513_,modId,existingFileHelper +net/minecraft/data/tags/TagsProvider.(Lnet/minecraft/data/PackOutput;Lnet/minecraft/resources/ResourceKey;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_275432_,p_275476_,p_275222_,p_275565_,modId,existingFileHelper net/minecraft/data/tags/WorldPresetTagsProvider.(Lnet/minecraft/data/PackOutput;Ljava/util/concurrent/CompletableFuture;Ljava/lang/String;Lnet/minecraftforge/common/data/ExistingFileHelper;)V=|p_255701_,p_255974_,modId,existingFileHelper net/minecraft/gametest/framework/GameTestRegistry.register(Ljava/lang/reflect/Method;Ljava/util/Set;)V=|p_177504_,allowedNamespaces net/minecraft/network/FriendlyByteBuf.writeItemStack(Lnet/minecraft/world/item/ItemStack;Z)Lnet/minecraft/network/FriendlyByteBuf;=|p_130056_,limitedTag @@ -89,6 +94,4 @@ net/minecraft/world/level/block/LiquidBlock.(Ljava/util/function/Supplier; net/minecraft/world/level/block/PoweredRailBlock.(Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Z)V=|p_55218_,isPoweredRail net/minecraft/world/level/entity/PersistentEntitySectionManager.addEntityWithoutEvent(Lnet/minecraft/world/level/entity/EntityAccess;Z)Z=|p_157539_,p_157540_ net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.processEntityInfos(Lnet/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate;Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/levelgen/structure/templatesystem/StructurePlaceSettings;Ljava/util/List;)Ljava/util/List;=|template,p_215387_0_,p_215387_1_,p_215387_2_,p_215387_3_ -net/minecraft/world/level/storage/loot/LootPool.([Lnet/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer;[Lnet/minecraft/world/level/storage/loot/predicates/LootItemCondition;[Lnet/minecraft/world/level/storage/loot/functions/LootItemFunction;Lnet/minecraft/world/level/storage/loot/providers/number/NumberProvider;Lnet/minecraft/world/level/storage/loot/providers/number/NumberProvider;Ljava/lang/String;)V=|p_165128_,p_165129_,p_165130_,p_165131_,p_165132_,name -net/minecraft/client/renderer/block/model/BlockElement.(Lorg/joml/Vector3f;Lorg/joml/Vector3f;Ljava/util/Map;Lnet/minecraft/client/renderer/block/model/BlockElementRotation;ZLnet/minecraftforge/client/model/ForgeFaceData;)V=|p_253626_,p_254426_,p_254454_,p_254229_,p_253661_,faceData -net/minecraft/client/renderer/block/model/BlockElementFace.(Lnet/minecraft/core/Direction;ILjava/lang/String;Lnet/minecraft/client/renderer/block/model/BlockFaceUV;Lnet/minecraftforge/client/model/ForgeFaceData;)V=|p_111359_,p_111360_,p_111361_,p_111362_,faceData \ No newline at end of file +net/minecraft/world/level/storage/loot/LootPool.([Lnet/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer;[Lnet/minecraft/world/level/storage/loot/predicates/LootItemCondition;[Lnet/minecraft/world/level/storage/loot/functions/LootItemFunction;Lnet/minecraft/world/level/storage/loot/providers/number/NumberProvider;Lnet/minecraft/world/level/storage/loot/providers/number/NumberProvider;Ljava/lang/String;)V=|p_165128_,p_165129_,p_165130_,p_165131_,p_165132_,name \ No newline at end of file diff --git a/src/test/java/net/minecraftforge/debug/CreativeModeTabTest.java b/src/test/java/net/minecraftforge/debug/CreativeModeTabTest.java index adfe5f0d9b..3eac08a73c 100644 --- a/src/test/java/net/minecraftforge/debug/CreativeModeTabTest.java +++ b/src/test/java/net/minecraftforge/debug/CreativeModeTabTest.java @@ -47,7 +47,7 @@ public class CreativeModeTabTest LOGS = event.registerCreativeModeTab(new ResourceLocation(MOD_ID, "logs"), builder -> builder.icon(() -> new ItemStack(Blocks.ACACIA_LOG)) .title(Component.literal("Logs")) .withLabelColor(0x00FF00) - .displayItems((features, output, hasPermissions) -> { + .displayItems((params, output) -> { output.accept(new ItemStack(Blocks.ACACIA_LOG)); output.accept(new ItemStack(Blocks.BIRCH_LOG)); output.accept(new ItemStack(Blocks.DARK_OAK_LOG)); @@ -59,7 +59,7 @@ public class CreativeModeTabTest STONE = event.registerCreativeModeTab(new ResourceLocation(MOD_ID, "stone"), List.of(CreativeModeTabs.BUILDING_BLOCKS), List.of(), builder -> builder.icon(() -> new ItemStack(Blocks.STONE)) .title(Component.literal("Stone")) .withLabelColor(0x0000FF) - .displayItems((features, output, hasPermissions) -> { + .displayItems((params, output) -> { output.accept(new ItemStack(Blocks.STONE)); output.accept(new ItemStack(Blocks.GRANITE)); output.accept(new ItemStack(Blocks.DIORITE)); @@ -67,7 +67,7 @@ public class CreativeModeTabTest })); event.registerCreativeModeTab(new ResourceLocation(MOD_ID, "colors"), builder -> builder.title(Component.literal("Colors")) - .displayItems((features, output, hasPermissions) -> + .displayItems((params, output) -> { for (DyeColor color : DyeColor.values()) { diff --git a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java index 2f9f0145ca..c51da773b2 100644 --- a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java +++ b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java @@ -41,6 +41,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceKey; import net.minecraft.sounds.SoundEvents; import net.minecraft.tags.ItemTags; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.biome.Biome; @@ -775,27 +776,27 @@ public class DataGeneratorTest ModelFile block = models().getBuilder("block") .guiLight(GuiLight.SIDE) .transforms() - .transform(ItemTransforms.TransformType.GUI) + .transform(ItemDisplayContext.GUI) .rotation(30, 225, 0) .scale(0.625f) .end() - .transform(ItemTransforms.TransformType.GROUND) + .transform(ItemDisplayContext.GROUND) .translation(0, 3, 0) .scale(0.25f) .end() - .transform(ItemTransforms.TransformType.FIXED) + .transform(ItemDisplayContext.FIXED) .scale(0.5f) .end() - .transform(ItemTransforms.TransformType.THIRD_PERSON_RIGHT_HAND) + .transform(ItemDisplayContext.THIRD_PERSON_RIGHT_HAND) .rotation(75, 45, 0) .translation(0, 2.5f, 0) .scale(0.375f) .end() - .transform(ItemTransforms.TransformType.FIRST_PERSON_RIGHT_HAND) + .transform(ItemDisplayContext.FIRST_PERSON_RIGHT_HAND) .rotation(0, 45, 0) .scale(0.4f) .end() - .transform(ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND) + .transform(ItemDisplayContext.FIRST_PERSON_LEFT_HAND) .rotation(0, 225, 0) .scale(0.4f) .end() @@ -1131,7 +1132,7 @@ public class DataGeneratorTest } else if (generatedDisplay != null) { // Both must be non-null ItemTransforms generatedTransforms = GSON.fromJson(generatedDisplay, ItemTransforms.class); ItemTransforms vanillaTransforms = GSON.fromJson(vanillaDisplay, ItemTransforms.class); - for (ItemTransforms.TransformType type : ItemTransforms.TransformType.values()) { + for (ItemDisplayContext type : ItemDisplayContext.values()) { if (!generatedTransforms.getTransform(type).equals(vanillaTransforms.getTransform(type))) { ret.add("Model " + loc + " has transforms that differ from vanilla equivalent for perspective " + type.name()); return; diff --git a/src/test/java/net/minecraftforge/debug/ManyMobEffectsTest.java b/src/test/java/net/minecraftforge/debug/ManyMobEffectsTest.java index 98c6126757..faf73f8742 100644 --- a/src/test/java/net/minecraftforge/debug/ManyMobEffectsTest.java +++ b/src/test/java/net/minecraftforge/debug/ManyMobEffectsTest.java @@ -93,7 +93,7 @@ public class ManyMobEffectsTest MinecraftForge.EVENT_BUS.addListener(ManyMobEffectsTest::mobInteract); modBus.addListener((CreativeModeTabEvent.Register event) -> event.registerCreativeModeTab(new ResourceLocation(MODID, "many_mob_effects_test"), builder -> builder.withSearchBar() .icon(() -> new ItemStack(Items.POTION)) - .displayItems((flags, output, isOperator) -> { + .displayItems((params, output) -> { var stack = new ItemStack(Items.POTION); PotionUtils.setCustomEffects(stack, List.of(new MobEffectInstance(LAST_EFFECT.get(), 1000))); output.accept(stack); diff --git a/src/test/java/net/minecraftforge/debug/block/CustomSignsTest.java b/src/test/java/net/minecraftforge/debug/block/CustomSignsTest.java index 791eddca7d..19d439eb9d 100644 --- a/src/test/java/net/minecraftforge/debug/block/CustomSignsTest.java +++ b/src/test/java/net/minecraftforge/debug/block/CustomSignsTest.java @@ -13,6 +13,7 @@ import net.minecraft.world.item.HangingSignItem; import net.minecraft.world.level.block.CeilingHangingSignBlock; import net.minecraft.world.level.block.WallHangingSignBlock; import net.minecraft.world.level.block.entity.HangingSignBlockEntity; +import net.minecraft.world.level.block.state.properties.BlockSetType; import net.minecraft.world.level.material.Material; import net.minecraft.client.renderer.Sheets; import net.minecraft.client.renderer.blockentity.SignRenderer; @@ -46,7 +47,7 @@ public class CustomSignsTest public static final boolean ENABLE = false; // TODO fix public static final String MODID = "custom_signs_test"; - public static final WoodType TEST_WOOD_TYPE = WoodType.create(new ResourceLocation(MODID, "test").toString()); + public static final WoodType TEST_WOOD_TYPE = WoodType.register(new WoodType(new ResourceLocation(MODID, "test").toString(), BlockSetType.ACACIA)); private static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID); public static final RegistryObject TEST_STANDING_SIGN = BLOCKS.register("test_sign", () -> new CustomStandingSignBlock(Properties.of(Material.WOOD).noCollission().strength(1.0F).sound(SoundType.WOOD), CustomSignsTest.TEST_WOOD_TYPE)); diff --git a/src/test/java/net/minecraftforge/debug/chat/ClientCommandTest.java b/src/test/java/net/minecraftforge/debug/chat/ClientCommandTest.java index 85b0b4d3b0..a85da5b25f 100644 --- a/src/test/java/net/minecraftforge/debug/chat/ClientCommandTest.java +++ b/src/test/java/net/minecraftforge/debug/chat/ClientCommandTest.java @@ -80,7 +80,7 @@ public class ClientCommandTest .then(Commands.argument("recipe", ResourceLocationArgument.id()) .executes((context) -> { context.getSource() - .sendSuccess(ResourceLocationArgument.getRecipe(context, "recipe").getResultItem().getDisplayName(), false); + .sendSuccess(ResourceLocationArgument.getRecipe(context, "recipe").getResultItem(context.getSource().registryAccess()).getDisplayName(), false); return 1; }))) // Used for checking if getting a team works on the client side diff --git a/src/test/java/net/minecraftforge/debug/client/CustomArmorModelTest.java b/src/test/java/net/minecraftforge/debug/client/CustomArmorModelTest.java index 5a39125e23..994008830a 100644 --- a/src/test/java/net/minecraftforge/debug/client/CustomArmorModelTest.java +++ b/src/test/java/net/minecraftforge/debug/client/CustomArmorModelTest.java @@ -39,10 +39,10 @@ public class CustomArmorModelTest static final String MOD_ID = "custom_armor_model_test"; private static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID); // demonstrates custom non-humanoid model - private static final RegistryObject RED_LEGGINGS = ITEMS.register("red_leggings", () -> new TintedArmorItem(ArmorMaterials.DIAMOND, EquipmentSlot.LEGS, new Properties().stacksTo(1))); + private static final RegistryObject RED_LEGGINGS = ITEMS.register("red_leggings", () -> new TintedArmorItem(ArmorMaterials.DIAMOND, ArmorItem.Type.LEGGINGS, new Properties().stacksTo(1))); // demonstrates the properties are copied from the vanilla model - private static final RegistryObject ENDERMAN_CHESTPLATE = ITEMS.register("enderman_chestplate", () -> new EndermanArmorItem(ArmorMaterials.GOLD, EquipmentSlot.CHEST, new Properties().stacksTo(1))); - private static final RegistryObject ENDERMAN_BOOTS = ITEMS.register("enderman_boots", () -> new EndermanArmorItem(ArmorMaterials.GOLD, EquipmentSlot.FEET, new Properties().stacksTo(1))); + private static final RegistryObject ENDERMAN_CHESTPLATE = ITEMS.register("enderman_chestplate", () -> new EndermanArmorItem(ArmorMaterials.GOLD, ArmorItem.Type.CHESTPLATE, new Properties().stacksTo(1))); + private static final RegistryObject ENDERMAN_BOOTS = ITEMS.register("enderman_boots", () -> new EndermanArmorItem(ArmorMaterials.GOLD, ArmorItem.Type.BOOTS, new Properties().stacksTo(1))); public CustomArmorModelTest() { @@ -63,7 +63,7 @@ public class CustomArmorModelTest private static class TintedArmorItem extends ArmorItem { - public TintedArmorItem(ArmorMaterial material, EquipmentSlot slot, Properties props) + public TintedArmorItem(ArmorMaterial material, ArmorItem.Type slot, Properties props) { super(material, slot, props); } @@ -85,7 +85,7 @@ public class CustomArmorModelTest private static class EndermanArmorItem extends ArmorItem { - public EndermanArmorItem(ArmorMaterial material, EquipmentSlot slot, Properties props) + public EndermanArmorItem(ArmorMaterial material, ArmorItem.Type slot, Properties props) { super(material, slot, props); } diff --git a/src/test/java/net/minecraftforge/debug/client/CustomColorResolverTest.java b/src/test/java/net/minecraftforge/debug/client/CustomColorResolverTest.java index 0556ac91e6..e9ba1be272 100644 --- a/src/test/java/net/minecraftforge/debug/client/CustomColorResolverTest.java +++ b/src/test/java/net/minecraftforge/debug/client/CustomColorResolverTest.java @@ -5,6 +5,7 @@ package net.minecraftforge.debug.client; +import net.minecraft.core.BlockPos; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.ColorResolver; @@ -49,7 +50,7 @@ public class CustomColorResolverTest private static class ClientHandler { - private static final ColorResolver COLOR_RESOLVER = (biome, x, z) -> biome.getPrecipitation() == Biome.Precipitation.NONE ? 0xFF0000 : 0x0000FF; + private static final ColorResolver COLOR_RESOLVER = (biome, x, z) -> biome.getPrecipitationAt(BlockPos.containing(x, 0, z)) == Biome.Precipitation.NONE ? 0xFF0000 : 0x0000FF; @SubscribeEvent static void registerColorResolver(RegisterColorHandlersEvent.ColorResolvers event) diff --git a/src/test/java/net/minecraftforge/debug/client/CustomTooltipTest.java b/src/test/java/net/minecraftforge/debug/client/CustomTooltipTest.java index 013cf52eb0..ec54122a8b 100644 --- a/src/test/java/net/minecraftforge/debug/client/CustomTooltipTest.java +++ b/src/test/java/net/minecraftforge/debug/client/CustomTooltipTest.java @@ -94,7 +94,7 @@ public class CustomTooltipTest } @Override - public void renderImage(Font font, int x, int y, PoseStack poseStack, ItemRenderer itemRenderer_, int zIndex) + public void renderImage(Font font, int x, int y, PoseStack poseStack, ItemRenderer itemRenderer_) { GuiComponent.fill(poseStack, x, y, x + 10, y+ 10, tooltip.color); } diff --git a/src/test/java/net/minecraftforge/debug/client/model/CustomTransformTypeTest.java b/src/test/java/net/minecraftforge/debug/client/model/CustomItemDisplayContextTest.java similarity index 94% rename from src/test/java/net/minecraftforge/debug/client/model/CustomTransformTypeTest.java rename to src/test/java/net/minecraftforge/debug/client/model/CustomItemDisplayContextTest.java index 9599dfbe76..40e4cd0ff9 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/CustomTransformTypeTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/CustomItemDisplayContextTest.java @@ -8,7 +8,6 @@ package net.minecraftforge.debug.client.model; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.renderer.entity.ItemRenderer; @@ -48,10 +47,11 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.data.event.GatherDataEvent; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.RegisterEvent; import net.minecraftforge.registries.RegistryObject; import org.jetbrains.annotations.Nullable; -/* +/** * Test mod for the custom transform types feature. * This test mod adds an item that should be held in the main hand, while another item is in the offhand. * When right-clicked on a block, the item will "hang" the stack from the offhand slot on the wall. @@ -60,25 +60,26 @@ import org.jetbrains.annotations.Nullable; * when compared to similar items such as a fishing rod. * Editing that model json will reflect ingame after a resource reload (F3+T). */ -@Mod(CustomTransformTypeTest.MODID) -public class CustomTransformTypeTest +@Mod(CustomItemDisplayContextTest.MODID) +public class CustomItemDisplayContextTest { public static final String MODID = "custom_transformtype_test"; - @Mod.EventBusSubscriber(value= Dist.CLIENT, modid = MODID, bus= Mod.EventBusSubscriber.Bus.MOD) + @Mod.EventBusSubscriber(value= Dist.CLIENT, modid = MODID, bus= Mod.EventBusSubscriber.Bus.MOD) private static class RendererEvents { - public static final ItemTransforms.TransformType HANGING = ItemTransforms.TransformType.create( - "custom_transformtype_test_hanging", - new ResourceLocation("custom_transformtype_test", "hanging") - ); - + public static final ItemDisplayContext HANGING = ItemDisplayContext.create("custom_transformtype_test_hanging", new ResourceLocation("custom_transformtype_test", "hanging"), null); @SubscribeEvent public static void registerRenderers(EntityRenderersEvent.RegisterRenderers event) { event.registerBlockEntityRenderer(ITEM_HANGER_BE.get(), ItemHangerBlockEntityRenderer::new); } + @SubscribeEvent + public static void registerContext(final RegisterEvent event) { + event.register(ForgeRegistries.Keys.DISPLAY_CONTEXTS, helper -> helper.register("hanging", HANGING)); + } + private static class ItemHangerBlockEntityRenderer implements BlockEntityRenderer { @@ -121,7 +122,7 @@ public class CustomTransformTypeTest public static final RegistryObject ITEM_HANGER_ITEM = ITEMS.register("item_hanger", () -> new ItemHangerItem(ITEM_HANGER_BLOCK.get(), new Item.Properties())); - public CustomTransformTypeTest() + public CustomItemDisplayContextTest() { var modBus = FMLJavaModLoadingContext.get().getModEventBus(); modBus.addListener(this::gatherData); diff --git a/src/test/java/net/minecraftforge/debug/client/model/NewModelLoaderTest.java b/src/test/java/net/minecraftforge/debug/client/model/NewModelLoaderTest.java index b43d05460e..165cac38e9 100644 --- a/src/test/java/net/minecraftforge/debug/client/model/NewModelLoaderTest.java +++ b/src/test/java/net/minecraftforge/debug/client/model/NewModelLoaderTest.java @@ -209,8 +209,8 @@ public class NewModelLoaderTest withExistingParent(NewModelLoaderTest.separate_perspective.getId().getPath(), "forge:item/default") .customLoader(SeparateTransformsModelBuilder::begin) .base(nested().parent(getExistingFile(mcLoc("minecraft:item/coal")))) - .perspective(ItemTransforms.TransformType.GUI, nested().parent(getExistingFile(mcLoc("minecraft:item/snowball")))) - .perspective(ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND, nested().parent(getExistingFile(mcLoc("minecraft:item/bone")))) + .perspective(ItemDisplayContext.GUI, nested().parent(getExistingFile(mcLoc("minecraft:item/snowball")))) + .perspective(ItemDisplayContext.FIRST_PERSON_LEFT_HAND, nested().parent(getExistingFile(mcLoc("minecraft:item/bone")))) .end(); } } diff --git a/src/test/java/net/minecraftforge/debug/client/rendering/CustomItemDecorationsTest.java b/src/test/java/net/minecraftforge/debug/client/rendering/CustomItemDecorationsTest.java index b4d9a6b1a7..c4c9f074d1 100644 --- a/src/test/java/net/minecraftforge/debug/client/rendering/CustomItemDecorationsTest.java +++ b/src/test/java/net/minecraftforge/debug/client/rendering/CustomItemDecorationsTest.java @@ -51,7 +51,6 @@ public class CustomItemDecorationsTest @Override public boolean render(Font font, ItemStack stack, int xOffset, int yOffset, float blitOffset) { - RenderSystem.disableTexture(); RenderSystem.disableBlend(); Tesselator tesselator = Tesselator.getInstance(); BufferBuilder bufferbuilder = tesselator.getBuilder(); @@ -61,7 +60,6 @@ public class CustomItemDecorationsTest fillRect(bufferbuilder, xOffset + 2, yOffset, blitOffset + 189, 13, 2, 0, 0, 0); fillRect(bufferbuilder, xOffset + 2, yOffset, blitOffset + 190, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255); RenderSystem.enableBlend(); - RenderSystem.enableTexture(); return true; } diff --git a/src/test/java/net/minecraftforge/debug/client/rendering/RenderableTest.java b/src/test/java/net/minecraftforge/debug/client/rendering/RenderableTest.java index 3367267cbd..2ad788b0b3 100644 --- a/src/test/java/net/minecraftforge/debug/client/rendering/RenderableTest.java +++ b/src/test/java/net/minecraftforge/debug/client/rendering/RenderableTest.java @@ -170,7 +170,7 @@ public class RenderableTest private static void render(Stage stage, PoseStack poseStack, int renderTick, float partialTick, double camX, double camY, double camZ, int xOffset) { double x = camX, y = camY, z = camZ; - if (!new BlockPos(0, y, 0).closerThan(new BlockPos(x, y, z), 100)) + if (!BlockPos.containing(0, y, 0).closerThan(BlockPos.containing(x, y, z), 100)) return; var profiler = Minecraft.getInstance().getProfiler(); diff --git a/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java b/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java index 6be8c2625a..5d10b19214 100644 --- a/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java +++ b/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java @@ -148,7 +148,7 @@ public class GlobalLootModifiersTest { private static ItemStack smelt(ItemStack stack, LootContext context) { return context.getLevel().getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(stack), context.getLevel()) - .map(SmeltingRecipe::getResultItem) + .map(smeltingRecipe -> smeltingRecipe.getResultItem(context.getLevel().registryAccess())) .filter(itemStack -> !itemStack.isEmpty()) .map(itemStack -> ItemHandlerHelper.copyStackWithSize(itemStack, stack.getCount() * itemStack.getCount())) .orElse(stack); diff --git a/src/test/java/net/minecraftforge/debug/item/EnderMaskTest.java b/src/test/java/net/minecraftforge/debug/item/EnderMaskTest.java index af17fa00bd..46e8f18f70 100644 --- a/src/test/java/net/minecraftforge/debug/item/EnderMaskTest.java +++ b/src/test/java/net/minecraftforge/debug/item/EnderMaskTest.java @@ -24,7 +24,7 @@ public class EnderMaskTest public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); public static RegistryObject ENDER_MASK = ITEMS.register("ender_mask", () -> - new ArmorItem(ArmorMaterials.LEATHER, EquipmentSlot.HEAD, (new Item.Properties())) + new ArmorItem(ArmorMaterials.LEATHER, ArmorItem.Type.HELMET, (new Item.Properties())) { @Override public boolean isEnderMask(ItemStack stack, Player player, EnderMan endermanEntity) diff --git a/src/test/java/net/minecraftforge/debug/item/SnowBootsTest.java b/src/test/java/net/minecraftforge/debug/item/SnowBootsTest.java index ce0697d754..4712e323f9 100644 --- a/src/test/java/net/minecraftforge/debug/item/SnowBootsTest.java +++ b/src/test/java/net/minecraftforge/debug/item/SnowBootsTest.java @@ -23,7 +23,7 @@ public class SnowBootsTest public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); public static RegistryObject SNOW_BOOTS = ITEMS.register("snow_boots", () -> - new ArmorItem(ArmorMaterials.DIAMOND, EquipmentSlot.FEET, (new Item.Properties())) + new ArmorItem(ArmorMaterials.DIAMOND, ArmorItem.Type.BOOTS, (new Item.Properties())) { @Override public boolean canWalkOnPowderedSnow(ItemStack stack, LivingEntity wearer) { diff --git a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookExtensionClientHelper.java b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookExtensionClientHelper.java index 10d650d218..f12a4bcf7c 100644 --- a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookExtensionClientHelper.java +++ b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookExtensionClientHelper.java @@ -7,6 +7,7 @@ package net.minecraftforge.debug.recipe.recipebook; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; +import net.minecraft.client.Minecraft; import net.minecraft.client.RecipeBookCategories; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -26,7 +27,7 @@ public class RecipeBookExtensionClientHelper event.registerAggregateCategory(TESTING_SEARCH.get(), ImmutableList.of(TESTING_CAT_1.get(), TESTING_CAT_2.get())); event.registerRecipeCategoryFinder(RecipeBookExtensionTest.RECIPE_BOOK_TEST_RECIPE_TYPE.get(), r -> { - if (r.getResultItem().getItem() == Items.DIAMOND_BLOCK) + if (r.getResultItem(Minecraft.getInstance().level.registryAccess()).getItem() == Items.DIAMOND_BLOCK) return TESTING_CAT_1.get(); else return TESTING_CAT_2.get(); }); diff --git a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestMenu.java b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestMenu.java index 159803882f..702de70d99 100644 --- a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestMenu.java +++ b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestMenu.java @@ -166,7 +166,7 @@ public class RecipeBookTestMenu extends RecipeBookMenu if (recipe.isEmpty()) this.resultContainer.setItem(0, ItemStack.EMPTY); else if (player instanceof ServerPlayer sp && this.resultContainer.setRecipeUsed(level, sp, recipe.get())) { - ItemStack stack = recipe.get().assemble(this.container); + ItemStack stack = recipe.get().assemble(this.container, level.registryAccess()); this.resultContainer.setItem(0, stack); } } diff --git a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipe.java b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipe.java index b94fbaa13d..facec3a79b 100644 --- a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipe.java +++ b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipe.java @@ -13,6 +13,7 @@ import com.mojang.serialization.Dynamic; import com.mojang.serialization.JsonOps; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; +import net.minecraft.core.RegistryAccess; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -95,9 +96,9 @@ public class RecipeBookTestRecipe implements Recipe pattern, Map recipe, ItemStack result) { private static final Function> VERIFY_LENGTH_2 = s -> s.length() == 2 ? DataResult.success(s) : - DataResult.error("Key row length must be of 2!"); + DataResult.error(() -> "Key row length must be of 2!"); private static final Function, DataResult>> VERIFY_SIZE = l -> { if (l.size() <= 4 && l.size() >= 1) @@ -169,10 +170,10 @@ public class RecipeBookTestRecipe implements Recipe "Pattern must have between 1 and 4 rows of keys"); }; private static final Function> VERIFY_LENGTH_1 = s -> s.length() == 1 ? DataResult.success(s) : - DataResult.error("Key must be a single character!"); + DataResult.error(() -> "Key must be a single character!"); public static final Codec INGREDIENT_CODEC = Codec.PASSTHROUGH.comapFlatMap(obj -> { @@ -183,7 +184,7 @@ public class RecipeBookTestRecipe implements Recipe "Failed to parse ingredient: " + e.getMessage()); } }, ingredient -> new Dynamic<>(JsonOps.INSTANCE, ingredient.toJson())); diff --git a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipeSerializer.java b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipeSerializer.java index a7874ad8a9..d589925536 100644 --- a/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipeSerializer.java +++ b/src/test/java/net/minecraftforge/debug/recipe/recipebook/RecipeBookTestRecipeSerializer.java @@ -7,6 +7,7 @@ package net.minecraftforge.debug.recipe.recipebook; import com.google.gson.JsonObject; import com.mojang.serialization.JsonOps; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.RecipeSerializer; @@ -26,13 +27,13 @@ public class RecipeBookTestRecipeSerializer implements RecipeSerializer> MODIFY_BIOMES = BIOME_MODIFIER_SERIALIZERS.register("modify_biomes", () -> RecordCodecBuilder.create(builder -> builder.group( Biome.LIST_CODEC.fieldOf("biomes").forGetter(TestModifier::biomes), - Precipitation.CODEC.fieldOf("precipitation").forGetter(TestModifier::precipitation), + Codec.STRING.xmap(s -> Precipitation.valueOf(s.toUpperCase(Locale.ROOT)), e -> e.name().toLowerCase(Locale.ROOT)).fieldOf("precipitation").forGetter(TestModifier::precipitation), Codec.INT.fieldOf("water_color").forGetter(TestModifier::waterColor) ).apply(builder, TestModifier::new)) ); @@ -167,7 +168,7 @@ public class BiomeModifierTest { if (phase == Phase.MODIFY && this.biomes.contains(biome)) { - builder.getClimateSettings().setPrecipitation(this.precipitation); + builder.getClimateSettings().setHasPrecipitation(true); builder.getSpecialEffects().waterColor(this.waterColor); if (this.precipitation == Precipitation.SNOW) builder.getClimateSettings().setTemperature(0F); diff --git a/src/test/resources/data/biome_loading_event_test/worldgen/biome/desert.json b/src/test/resources/data/biome_loading_event_test/worldgen/biome/desert.json index 0c4ebf6aae..a9295f82c3 100644 --- a/src/test/resources/data/biome_loading_event_test/worldgen/biome/desert.json +++ b/src/test/resources/data/biome_loading_event_test/worldgen/biome/desert.json @@ -169,7 +169,7 @@ }, "spawn_costs": {}, "player_spawn_friendly": false, - "precipitation": "none", + "has_precipitation": false, "temperature": 2.0, "downfall": 0.0, "category": "desert",