From 64f25dfa3e18a59e75b59ea2fd400e7c45425292 Mon Sep 17 00:00:00 2001 From: Mgazul Date: Fri, 13 Sep 2024 06:33:51 +0800 Subject: [PATCH] Some patch --- gradle/wrapper/gradle-wrapper.jar | Bin 43453 -> 43583 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 7 +- gradlew.bat | 2 + .../blaze3d/pipeline/RenderTarget.java.patch | 13 +- .../RealmsNotificationsScreen.java.patch | 11 ++ .../minecraft/CrashReportCategory.java.patch | 10 +- .../minecraft/client/KeyMapping.java.patch | 12 +- .../client/KeyboardHandler.java.patch | 20 --- .../net/minecraft/client/Minecraft.java.patch | 13 +- .../net/minecraft/client/gui/Gui.java.patch | 28 ++- .../client/gui/GuiGraphics.java.patch | 9 +- .../client/gui/MapRenderer.java.patch | 13 ++ .../components/DebugScreenOverlay.java.patch | 40 +++-- .../client/gui/components/EditBox.java.patch | 60 +++++++ .../providers/GlyphProviderType.java.patch | 22 +++ .../client/gui/screens/Screen.java.patch | 9 + .../client/gui/screens/TitleScreen.java.patch | 21 +-- .../CreativeModeInventoryScreen.java.patch | 8 +- .../EffectRenderingInventoryScreen.java.patch | 9 + .../controls/KeyBindsScreen.java.patch | 81 ++++++++- .../client/model/HierarchicalModel.java.patch | 48 ++++++ .../model/geom/LayerDefinitions.java.patch | 9 + .../client/model/geom/ModelLayers.java.patch | 26 ++- .../ClientCommonPacketListenerImpl.java.patch | 12 +- .../client/multiplayer/ClientLevel.java.patch | 48 +++++- .../ClientPacketListener.java.patch | 35 +++- .../multiplayer/SessionSearchTrees.java.patch | 12 +- .../particle/AttackSweepParticle.java.patch | 11 ++ .../client/particle/BlockMarker.java.patch | 11 ++ .../particle/BreakingItemParticle.java.patch | 9 + .../BubbleColumnUpParticle.java.patch | 11 ++ .../client/particle/BubbleParticle.java.patch | 11 ++ .../particle/BubblePopParticle.java.patch | 11 ++ .../particle/CampfireSmokeParticle.java.patch | 11 ++ .../client/particle/CritParticle.java.patch | 11 ++ .../particle/DragonBreathParticle.java.patch | 11 ++ .../client/particle/DripParticle.java.patch | 11 ++ .../client/particle/EndRodParticle.java.patch | 11 ++ .../particle/FallingDustParticle.java.patch | 11 ++ .../particle/FireworkParticles.java.patch | 18 ++ .../client/particle/FlameParticle.java.patch | 11 ++ .../FlyStraightTowardsParticle.java.patch | 11 ++ .../FlyTowardsPositionParticle.java.patch | 11 ++ .../client/particle/GlowParticle.java.patch | 11 ++ .../particle/GustSeedParticle.java.patch | 11 ++ .../client/particle/HeartParticle.java.patch | 11 ++ .../HugeExplosionSeedParticle.java.patch | 11 ++ .../client/particle/LavaParticle.java.patch | 11 ++ .../particle/MobAppearanceParticle.java.patch | 11 ++ .../client/particle/NoteParticle.java.patch | 11 ++ .../particle/PlayerCloudParticle.java.patch | 11 ++ .../particle/ReversePortalParticle.java.patch | 9 + .../particle/SculkChargeParticle.java.patch | 11 ++ .../SculkChargePopParticle.java.patch | 11 ++ .../client/particle/ShriekParticle.java.patch | 11 ++ .../client/particle/SoulParticle.java.patch | 11 ++ .../client/particle/SpellParticle.java.patch | 11 ++ .../client/particle/SpitParticle.java.patch | 11 ++ .../client/particle/SplashParticle.java.patch | 11 ++ .../particle/SquidInkParticle.java.patch | 11 ++ .../particle/SuspendedParticle.java.patch | 11 ++ .../particle/SuspendedTownParticle.java.patch | 11 ++ .../client/particle/TotemParticle.java.patch | 11 ++ .../VibrationSignalParticle.java.patch | 9 + .../client/particle/WakeParticle.java.patch | 11 ++ .../WaterCurrentDownParticle.java.patch | 11 ++ .../renderer/ItemBlockRenderTypes.java.patch | 33 ++-- .../renderer/ItemInHandRenderer.java.patch | 18 +- .../client/renderer/LevelRenderer.java.patch | 35 +++- .../renderer/PanoramaRenderer.java.patch | 11 ++ .../client/renderer/RenderType.java.patch | 10 +- .../block/LiquidBlockRenderer.java.patch | 11 +- .../block/ModelBlockRenderer.java.patch | 27 +++ .../renderer/entity/BoatRenderer.java.patch | 28 ++- .../entity/layers/ElytraLayer.java.patch | 26 +-- .../layers/HumanoidArmorLayer.java.patch | 19 ++- .../texture/TextureAtlasSprite.java.patch | 2 +- .../resources/sounds/SoundInstance.java.patch | 5 +- .../client/server/LanServerPinger.java.patch | 2 +- .../client/sounds/MusicManager.java.patch | 19 +++ .../arguments/EntityArgument.java.patch | 15 +- .../arguments/MessageArgument.java.patch | 4 +- .../arguments/ScoreHolderArgument.java.patch | 64 +++++++ .../selector/EntitySelectorParser.java.patch | 38 ++++- patches/net/minecraft/core/Holder.java.patch | 23 ++- .../dispenser/DispenseItemBehavior.java.patch | 11 +- .../ShearsDispenseItemBehavior.java.patch | 26 +++ .../registries/BuiltInRegistries.java.patch | 102 ++++++++++- .../minecraft/data/DataProvider.java.patch | 2 +- .../data/recipes/RecipeProvider.java.patch | 37 +++- .../RegistriesDatapackGenerator.java.patch | 39 ++++- .../data/tags/TagsProvider.java.patch | 21 ++- .../net/minecraft/locale/Language.java.patch | 2 +- .../chat/contents/EntityDataSource.java.patch | 11 ++ .../chat/contents/ScoreContents.java.patch | 11 ++ .../chat/contents/SelectorContents.java.patch | 11 ++ .../recipebook/PlaceRecipe.java.patch | 11 -- .../resources/FileToIdConverter.java.patch | 29 ++++ .../resources/HolderSetCodec.java.patch | 2 +- .../server/MinecraftServer.java.patch | 25 ++- .../packs/OverlayMetadataSection.java.patch | 8 +- .../server/packs/repository/Pack.java.patch | 9 +- .../server/players/PlayerList.java.patch | 13 ++ .../stats/RecipeBookSettings.java.patch | 26 ++- .../world/entity/LivingEntity.java.patch | 18 ++ .../world/food/FoodProperties.java.patch | 23 +++ .../AbstractContainerMenu.java.patch | 20 ++- .../world/inventory/AnvilMenu.java.patch | 13 ++ .../inventory/EnchantmentMenu.java.patch | 19 +++ .../world/inventory/RecipeBookType.java.patch | 9 +- .../minecraft/world/item/ArmorItem.java.patch | 11 ++ .../minecraft/world/item/BlockItem.java.patch | 4 +- .../minecraft/world/item/BowItem.java.patch | 10 +- .../minecraft/world/item/DyeColor.java.patch | 28 ++- .../world/item/FireChargeItem.java.patch | 32 ++++ .../world/item/FishingRodItem.java.patch | 6 +- .../world/item/FlintAndSteelItem.java.patch | 32 ++++ .../world/item/HoneycombItem.java.patch | 33 ++++ .../net/minecraft/world/item/Item.java.patch | 60 ++++--- .../minecraft/world/item/ItemStack.java.patch | 42 ++++- .../net/minecraft/world/item/Items.java.patch | 4 +- .../item/ProjectileWeaponItem.java.patch | 43 +++++ .../world/item/ShearsItem.java.patch | 49 +++++- .../world/item/ShieldItem.java.patch | 12 +- .../world/item/ShovelItem.java.patch | 14 +- .../item/StandingAndWallBlockItem.java.patch | 4 +- .../world/item/TooltipFlag.java.patch | 30 ++++ .../ItemContainerContents.java.patch | 12 +- .../world/item/crafting/Ingredient.java.patch | 36 ++-- .../item/crafting/ShapedRecipe.java.patch | 6 +- .../item/enchantment/Enchantment.java.patch | 106 +++++++++++- .../enchantment/EnchantmentHelper.java.patch | 47 ++++- .../level/ForcedChunksSavedData.java.patch | 2 +- .../minecraft/world/level/Level.java.patch | 53 +++++- .../world/level/biome/Biome.java.patch | 12 +- .../world/level/block/Block.java.patch | 49 ++---- .../world/level/block/Blocks.java.patch | 19 +++ .../world/level/block/CrafterBlock.java.patch | 11 ++ .../world/level/block/FireBlock.java.patch | 2 +- .../level/block/FlowerPotBlock.java.patch | 24 ++- .../level/block/PoweredRailBlock.java.patch | 2 +- .../level/block/SculkSensorBlock.java.patch | 2 +- .../level/block/TrapDoorBlock.java.patch | 6 +- .../level/block/WeatheringCopper.java.patch | 45 +++++ .../level/block/entity/BlockEntity.java.patch | 25 ++- .../block/entity/BlockEntityType.java.patch | 30 ++-- .../block/state/BlockBehaviour.java.patch | 14 +- .../world/level/chunk/ChunkAccess.java.patch | 6 +- .../world/level/chunk/LevelChunk.java.patch | 37 ++-- .../PersistentEntitySectionManager.java.patch | 6 +- .../EnvironmentScanPlacement.java.patch | 2 +- .../levelgen/structure/Structure.java.patch | 10 +- .../level/saveddata/SavedData.java.patch | 9 + .../saveddata/maps/MapDecoration.java.patch | 11 -- .../maps/MapItemSavedData.java.patch | 20 +++ .../level/storage/DerivedLevelData.java.patch | 29 ++++ .../storage/DimensionDataStorage.java.patch | 21 +-- .../level/storage/PrimaryLevelData.java.patch | 63 ++++++- .../level/storage/ServerLevelData.java.patch | 13 ++ .../level/storage/loot/LootContext.java.patch | 8 +- .../level/storage/loot/LootPool.java.patch | 52 ++++-- .../level/storage/loot/LootTable.java.patch | 28 ++- .../EnchantRandomlyFunction.java.patch | 11 ++ .../LootContextParamSets.java.patch | 2 +- .../arguments/EntityArgument.java.patch.rej | 25 +++ .../arguments/MessageArgument.java.patch.rej | 11 ++ .../EntitySelectorParser.java.patch.rej | 41 +++++ .../block/SculkSensorBlock.java.patch.rej | 19 +++ .../block/entity/BlockEntity.java.patch.rej | 92 ++++++++++ .../level/chunk/LevelChunk.java.patch.rej | 160 ++++++++++++++++++ 171 files changed, 2955 insertions(+), 536 deletions(-) create mode 100644 patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch create mode 100644 patches/net/minecraft/client/gui/MapRenderer.java.patch create mode 100644 patches/net/minecraft/client/gui/components/EditBox.java.patch create mode 100644 patches/net/minecraft/client/gui/font/providers/GlyphProviderType.java.patch create mode 100644 patches/net/minecraft/client/model/HierarchicalModel.java.patch create mode 100644 patches/net/minecraft/client/particle/AttackSweepParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/BlockMarker.java.patch create mode 100644 patches/net/minecraft/client/particle/BubbleColumnUpParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/BubbleParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/BubblePopParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/CampfireSmokeParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/CritParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/DragonBreathParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/DripParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/EndRodParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/FallingDustParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/FlameParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/FlyStraightTowardsParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/FlyTowardsPositionParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/GlowParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/GustSeedParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/HeartParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/HugeExplosionSeedParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/LavaParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/MobAppearanceParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/NoteParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/PlayerCloudParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SculkChargeParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SculkChargePopParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/ShriekParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SoulParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SpellParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SpitParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SplashParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SquidInkParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SuspendedParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/SuspendedTownParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/TotemParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/WakeParticle.java.patch create mode 100644 patches/net/minecraft/client/particle/WaterCurrentDownParticle.java.patch create mode 100644 patches/net/minecraft/client/renderer/PanoramaRenderer.java.patch create mode 100644 patches/net/minecraft/client/sounds/MusicManager.java.patch create mode 100644 patches/net/minecraft/commands/arguments/ScoreHolderArgument.java.patch create mode 100644 patches/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java.patch create mode 100644 patches/net/minecraft/network/chat/contents/EntityDataSource.java.patch create mode 100644 patches/net/minecraft/network/chat/contents/ScoreContents.java.patch create mode 100644 patches/net/minecraft/network/chat/contents/SelectorContents.java.patch delete mode 100644 patches/net/minecraft/recipebook/PlaceRecipe.java.patch create mode 100644 patches/net/minecraft/resources/FileToIdConverter.java.patch create mode 100644 patches/net/minecraft/world/item/ArmorItem.java.patch create mode 100644 patches/net/minecraft/world/item/FireChargeItem.java.patch create mode 100644 patches/net/minecraft/world/item/FlintAndSteelItem.java.patch create mode 100644 patches/net/minecraft/world/item/HoneycombItem.java.patch create mode 100644 patches/net/minecraft/world/item/TooltipFlag.java.patch create mode 100644 patches/net/minecraft/world/level/block/CrafterBlock.java.patch create mode 100644 patches/net/minecraft/world/level/block/WeatheringCopper.java.patch delete mode 100644 patches/net/minecraft/world/level/saveddata/maps/MapDecoration.java.patch create mode 100644 patches/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch create mode 100644 patches/net/minecraft/world/level/storage/DerivedLevelData.java.patch create mode 100644 patches/net/minecraft/world/level/storage/ServerLevelData.java.patch create mode 100644 patches/net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction.java.patch create mode 100644 rejects/net/minecraft/commands/arguments/EntityArgument.java.patch.rej create mode 100644 rejects/net/minecraft/commands/arguments/MessageArgument.java.patch.rej create mode 100644 rejects/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch.rej create mode 100644 rejects/net/minecraft/world/level/block/SculkSensorBlock.java.patch.rej create mode 100644 rejects/net/minecraft/world/level/block/entity/BlockEntity.java.patch.rej create mode 100644 rejects/net/minecraft/world/level/chunk/LevelChunk.java.patch.rej diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f3d4ba8a0da8d277868979cfbc8ad796..a4b76b9530d66f5e68d973ea569d8e19de379189 100644 GIT binary patch delta 12612 zcmY+pRa6|n(lttO3GVLh?(Xh3xVuAe26uONcL=V5;I6?T_zdn2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QOq12&iUVC!a`#O;dBLf=d?&4*B zI~LgAO7E0qxK(uRTM;IgJ}+z^gD+bi-6I!3x{r9`l~%8TRP%UE0V8E*Sz>Nl1NVG<<7(wDHZ+HcOkQm$O&k+vyx)y)x{Pz!U8hS$*m zByc0h6BUI*BOpuL==P+H|Hx%`>7!W+1H!l9vi&)`V zyn2o9{z=lc+VX*!Vh~SF=)L}Z40XeG>LF6cP^b+R$NxSeUqbK^Q*UTalKzP8X%{9@RSCXm_NhF>{=S2 zi}ezam_^P`S!!-cyEW9y7DBbK93roz@Raccy*v}?mKXScU9E_4g;hBU7}zSofAFda zKYEe?{{I54 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b415..0aaefbca 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..f5feea6d 100644 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30db..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch b/patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch index 0e0bf186..da006f8e 100644 --- a/patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch +++ b/patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch @@ -26,13 +26,15 @@ } this.checkStatus(); -@@ -258,4 +_,27 @@ +@@ -257,5 +_,28 @@ + public int getDepthTextureId() { return this.depthBufferId; - } ++ } + -+ /*================================ FORGE START ================================================*/ ++ // Neo: Injected stencil control + private boolean stencilEnabled = false; ++ + /** + * Attempts to enable 8 bits of stencil buffer on this FrameBuffer. + * Modders must call this directly to set things up. @@ -46,11 +48,10 @@ + } + + /** -+ * Returns wither or not this FBO has been successfully initialized with stencil bits. ++ * Returns whether this FBO has been successfully initialized with stencil bits. + * If not, and a modder wishes it to be, they must call enableStencil. + */ + public boolean isStencilEnabled() { + return this.stencilEnabled; -+ } -+ /*================================ FORGE END ================================================*/ + } } diff --git a/patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch b/patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch new file mode 100644 index 00000000..0757213a --- /dev/null +++ b/patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch @@ -0,0 +1,11 @@ +--- a/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java ++++ b/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java +@@ -127,7 +_,7 @@ + private void drawIcons(GuiGraphics p_282966_) { + int i = this.numberOfPendingInvites; + int j = 24; +- int k = this.height / 4 + 48; ++ int k = this.height / 4 + (inTitleScreen() ? 32 : 48); + int l = this.width / 2 + 100; + int i1 = k + 48 + 2; + int j1 = l - 3; diff --git a/patches/net/minecraft/CrashReportCategory.java.patch b/patches/net/minecraft/CrashReportCategory.java.patch index 50c9e729..e8b649ff 100644 --- a/patches/net/minecraft/CrashReportCategory.java.patch +++ b/patches/net/minecraft/CrashReportCategory.java.patch @@ -13,7 +13,7 @@ return this.stackTrace.length; } } -@@ -165,16 +_,16 @@ +@@ -165,16 +_,22 @@ if (this.stackTrace != null && this.stackTrace.length > 0) { p_128169_.append("\nStacktrace:"); @@ -30,8 +30,14 @@ return this.stackTrace; + } + ++ /** @deprecated Neo: Use {@link #setStackTrace(StackTraceElement[])} instead. */ ++ @Deprecated(forRemoval = true, since = "1.21.1") + public void applyStackTrace(Throwable t) { -+ this.stackTrace = t.getStackTrace(); ++ setStackTrace(t.getStackTrace()); ++ } ++ ++ public void setStackTrace(StackTraceElement[] stackTrace) { ++ this.stackTrace = stackTrace; } public static void populateBlockDetails(CrashReportCategory p_178951_, LevelHeightAccessor p_178952_, BlockPos p_178953_, @Nullable BlockState p_178954_) { diff --git a/patches/net/minecraft/client/KeyMapping.java.patch b/patches/net/minecraft/client/KeyMapping.java.patch index f0a66100..05cdbda2 100644 --- a/patches/net/minecraft/client/KeyMapping.java.patch +++ b/patches/net/minecraft/client/KeyMapping.java.patch @@ -97,16 +97,18 @@ } public String saveString() { -@@ -177,4 +_,84 @@ +@@ -176,5 +_,86 @@ + public void setDown(boolean p_90846_) { this.isDown = p_90846_; - } ++ } + -+ /****************** Forge Start *****************************/ ++ // Neo: Injected Key Mapping controls + private net.neoforged.neoforge.client.settings.KeyModifier keyModifierDefault = net.neoforged.neoforge.client.settings.KeyModifier.NONE; + private net.neoforged.neoforge.client.settings.KeyModifier keyModifier = net.neoforged.neoforge.client.settings.KeyModifier.NONE; + private net.neoforged.neoforge.client.settings.IKeyConflictContext keyConflictContext = net.neoforged.neoforge.client.settings.KeyConflictContext.UNIVERSAL; + ++ // Neo: Injected Key Mapping constructors to assist modders + /** + * Convenience constructor for creating KeyBindings with keyConflictContext set. + */ @@ -146,6 +148,7 @@ + CATEGORIES.add(category); + } + ++ // Neo: Implemented IKeyMappingExtension methods into vanilla + @Override + public InputConstants.Key getKey() { + return this.key; @@ -179,6 +182,5 @@ + MAP.remove(this); + this.keyModifier = keyModifier; + MAP.put(keyCode, this); -+ } -+ /****************** Forge End *****************************/ + } } diff --git a/patches/net/minecraft/client/KeyboardHandler.java.patch b/patches/net/minecraft/client/KeyboardHandler.java.patch index 8f1b17d3..2c5ce4a4 100644 --- a/patches/net/minecraft/client/KeyboardHandler.java.patch +++ b/patches/net/minecraft/client/KeyboardHandler.java.patch @@ -1,25 +1,5 @@ --- a/net/minecraft/client/KeyboardHandler.java +++ b/net/minecraft/client/KeyboardHandler.java -@@ -366,7 +_,9 @@ - } - } - -- if (p_90897_ == 1 && (!(this.minecraft.screen instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).lastKeySelection <= Util.getMillis() - 20L)) { -+ -+ if ((!(this.minecraft.screen instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).lastKeySelection <= Util.getMillis() - 20L)) { -+ if (p_90897_ == 1) { - if (this.minecraft.options.keyFullscreen.matches(p_90895_, p_90896_)) { - this.minecraft.getWindow().toggleFullScreen(); - this.minecraft.options.fullscreen().set(this.minecraft.getWindow().isFullscreen()); -@@ -384,6 +_,8 @@ - ); - return; - } -+ } else if (p_90897_ == 0 /*GLFW_RELEASE*/ && this.minecraft.screen instanceof KeyBindsScreen && net.neoforged.neoforge.client.settings.KeyModifier.getActiveModifier() != net.neoforged.neoforge.client.settings.KeyModifier.NONE) -+ ((KeyBindsScreen)this.minecraft.screen).selectedKey = null; //Forge: Unset pure modifiers. - } - - if (p_90897_ != 0) { @@ -407,9 +_,13 @@ Screen.wrapScreenError(() -> { if (p_90897_ == 1 || p_90897_ == 2) { diff --git a/patches/net/minecraft/client/Minecraft.java.patch b/patches/net/minecraft/client/Minecraft.java.patch index 8a4c36f8..13ff259e 100644 --- a/patches/net/minecraft/client/Minecraft.java.patch +++ b/patches/net/minecraft/client/Minecraft.java.patch @@ -89,14 +89,11 @@ ); this.quickPlayLog = QuickPlayLog.of(p_91084_.quickPlay.path()); } -@@ -663,6 +_,11 @@ +@@ -663,6 +_,8 @@ runnable = () -> this.setScreen(screen); } -+ if (net.neoforged.neoforge.client.loading.ClientModLoader.completeModLoading()) -+ { -+ runnable = () -> { }; //Forge: Do not override the error screen -+ } ++ runnable = net.neoforged.neoforge.client.loading.ClientModLoader.completeModLoading(runnable); + return runnable; } @@ -329,14 +326,16 @@ } private boolean isLevelRunningNormally() { -@@ -2056,6 +_,7 @@ +@@ -2056,7 +_,8 @@ } public void setLevel(ClientLevel p_91157_, ReceivingLevelScreen.Reason p_341652_) { +- this.updateScreenAndTick(new ReceivingLevelScreen(() -> false, p_341652_)); + if (this.level != null) net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.level.LevelEvent.Unload(this.level)); - this.updateScreenAndTick(new ReceivingLevelScreen(() -> false, p_341652_)); ++ this.updateScreenAndTick(net.neoforged.neoforge.client.DimensionTransitionScreenManager.getScreenFromLevel(p_91157_, this.level).create(() -> false, p_341652_)); this.level = p_91157_; this.updateLevelInEngines(p_91157_); + if (!this.isLocalServer) { @@ -2093,6 +_,7 @@ IntegratedServer integratedserver = this.singleplayerServer; this.singleplayerServer = null; diff --git a/patches/net/minecraft/client/gui/Gui.java.patch b/patches/net/minecraft/client/gui/Gui.java.patch index 21dbe3ae..dc1055a5 100644 --- a/patches/net/minecraft/client/gui/Gui.java.patch +++ b/patches/net/minecraft/client/gui/Gui.java.patch @@ -115,6 +115,26 @@ int j; if (this.animateOverlayMessageColor) { j = Mth.hsvToArgb(f / 50.0F, 0.7F, 0.6F, i); +@@ -323,9 +_,19 @@ + private void renderChat(GuiGraphics p_316307_, DeltaTracker p_348631_) { + if (!this.chat.isChatFocused()) { + Window window = this.minecraft.getWindow(); ++ // Neo: Allow customizing position of chat component ++ var chatBottomMargin = 40; // See ChatComponent#BOTTOM_MARGIN (used in translate calls in ChatComponent#render) ++ var event = net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post( ++ new net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent.Chat(window, p_316307_, p_348631_, 0, p_316307_.guiHeight() - chatBottomMargin) ++ ); ++ ++ // The event is given the absolute Y position; account for chat component's own offsetting here ++ p_316307_.pose().pushPose(); ++ p_316307_.pose().translate(event.getPosX(), (event.getPosY() - p_316307_.guiHeight() + chatBottomMargin) / this.chat.getScale(), 0.0F); + int i = Mth.floor(this.minecraft.mouseHandler.xpos() * (double)window.getGuiScaledWidth() / (double)window.getScreenWidth()); + int j = Mth.floor(this.minecraft.mouseHandler.ypos() * (double)window.getGuiScaledHeight() / (double)window.getScreenHeight()); + this.chat.render(p_316307_, this.tickCount, i, j, false); ++ p_316307_.pose().popPose(); + } + } + @@ -441,6 +_,8 @@ List list = Lists.newArrayListWithExpectedSize(collection.size()); @@ -242,7 +262,7 @@ private void renderDemoOverlay(GuiGraphics p_281825_, DeltaTracker p_348679_) { - if (this.minecraft.isDemo()) { -+ if (this.minecraft.isDemo() && !this.getDebugOverlay().showDebugScreen()) { // NEO: Hide demo timer when F3 debug overlay is open; fixes MC-271166 ++ if (this.minecraft.isDemo() && !this.getDebugOverlay().showDebugScreen()) { // Neo: Hide demo timer when F3 debug overlay is open; fixes MC-271166 this.minecraft.getProfiler().push("demo"); Component component; if (this.minecraft.level.getGameTime() >= 120500L) { @@ -370,7 +390,7 @@ this.toolHighlightTimer = (int)(40.0 * this.minecraft.options.notificationDisplayTime().get()); } else if (this.toolHighlightTimer > 0) { this.toolHighlightTimer--; -@@ -1292,8 +_,13 @@ +@@ -1292,8 +_,17 @@ } } @@ -378,6 +398,10 @@ + public void initModdedOverlays() { + this.layerManager.initModdedLayers(); + } ++ ++ public int getLayerCount() { ++ return this.layerManager.getLayerCount(); ++ } + @OnlyIn(Dist.CLIENT) - public static enum HeartType { diff --git a/patches/net/minecraft/client/gui/GuiGraphics.java.patch b/patches/net/minecraft/client/gui/GuiGraphics.java.patch index 51f62a0f..9ce42c48 100644 --- a/patches/net/minecraft/client/gui/GuiGraphics.java.patch +++ b/patches/net/minecraft/client/gui/GuiGraphics.java.patch @@ -65,7 +65,7 @@ this.renderTooltipInternal(p_283128_, list, p_283678_, p_281696_, DefaultTooltipPositioner.INSTANCE); } -@@ -894,7 +_,15 @@ +@@ -894,7 +_,22 @@ } public void renderComponentTooltip(Font p_282739_, List p_281832_, int p_282191_, int p_282446_) { @@ -78,6 +78,13 @@ + this.tooltipStack = stack; + List components = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponents(stack, tooltips, mouseX, guiWidth(), guiHeight(), font); + this.renderTooltipInternal(font, components, mouseX, mouseY, DefaultTooltipPositioner.INSTANCE); ++ this.tooltipStack = ItemStack.EMPTY; ++ } ++ ++ public void renderComponentTooltipFromElements(Font font, List> elements, int mouseX, int mouseY, ItemStack stack) { ++ this.tooltipStack = stack; ++ List components = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponentsFromElements(stack, elements, mouseX, guiWidth(), guiHeight(), font); ++ this.renderTooltipInternal(font, components, mouseX, mouseY, DefaultTooltipPositioner.INSTANCE); + this.tooltipStack = ItemStack.EMPTY; } diff --git a/patches/net/minecraft/client/gui/MapRenderer.java.patch b/patches/net/minecraft/client/gui/MapRenderer.java.patch new file mode 100644 index 00000000..756bcda9 --- /dev/null +++ b/patches/net/minecraft/client/gui/MapRenderer.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/client/gui/MapRenderer.java ++++ b/net/minecraft/client/gui/MapRenderer.java +@@ -122,6 +_,10 @@ + + for (MapDecoration mapdecoration : this.data.getDecorations()) { + if (!p_93294_ || mapdecoration.renderOnFrame()) { ++ if (net.neoforged.neoforge.client.gui.map.MapDecorationRendererManager.render(mapdecoration, p_93292_, p_93293_, data, MapRenderer.this.decorationTextures, p_93294_, p_93295_, k)) { ++ k++; ++ continue; ++ } + p_93292_.pushPose(); + p_93292_.translate(0.0F + (float)mapdecoration.x() / 2.0F + 64.0F, 0.0F + (float)mapdecoration.y() / 2.0F + 64.0F, -0.02F); + p_93292_.mulPose(Axis.ZP.rotationDegrees((float)(mapdecoration.rot() * 360) / 16.0F)); diff --git a/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch b/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch index 7860de31..d47bc314 100644 --- a/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch +++ b/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch @@ -1,42 +1,60 @@ --- a/net/minecraft/client/gui/components/DebugScreenOverlay.java +++ b/net/minecraft/client/gui/components/DebugScreenOverlay.java -@@ -135,8 +_,13 @@ +@@ -135,8 +_,15 @@ this.block = entity.pick(20.0, 0.0F, false); this.liquid = entity.pick(20.0, 0.0F, true); p_281427_.drawManaged(() -> { - this.drawGameInformation(p_281427_); - this.drawSystemInformation(p_281427_); -+ final List gameInformation = new java.util.ArrayList<>(); -+ final List systemInformation = new java.util.ArrayList<>(); ++ final List gameInformation = this.collectGameInformationText(); ++ final List systemInformation = this.collectSystemInformationText(); ++ + var event = new net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent.DebugText(minecraft.getWindow(), p_281427_, minecraft.getTimer(), gameInformation, systemInformation); + net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(event); + -+ this.drawGameInformation(p_281427_, gameInformation); -+ this.drawSystemInformation(p_281427_, systemInformation); ++ this.renderLines(p_281427_, gameInformation, true); ++ this.renderLines(p_281427_, systemInformation, false); ++ if (this.renderFpsCharts) { int i = p_281427_.guiWidth(); int j = i / 2; -@@ -161,7 +_,7 @@ +@@ -161,7 +_,11 @@ this.minecraft.getProfiler().pop(); } - protected void drawGameInformation(GuiGraphics p_281525_) { -+ protected void drawGameInformation(GuiGraphics p_281525_, List gameInformation) { ++ /** ++ * Neo: Extracted body of {@link DebugScreenOverlay#drawGameInformation} to return game information ++ * without drawing for {@link net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent.DebugText} to modify ++ */ ++ protected List collectGameInformationText() { List list = this.getGameInformation(); list.add(""); boolean flag = this.minecraft.getSingleplayerServer() != null; -@@ -176,11 +_,13 @@ +@@ -176,11 +_,25 @@ + (this.renderNetworkCharts ? " visible" : " hidden") ); list.add("For help: press F3 + Q"); -+ list.addAll(gameInformation); ++ return list; ++ } ++ ++ protected void drawGameInformation(GuiGraphics p_281525_) { ++ List list = this.collectGameInformationText(); this.renderLines(p_281525_, list, true); } - protected void drawSystemInformation(GuiGraphics p_281261_) { -+ protected void drawSystemInformation(GuiGraphics p_281261_, List systemInformation) { ++ /** ++ * Neo: Extracted body of {@link DebugScreenOverlay#drawSystemInformation} to return system information ++ * without drawing for {@link net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent.DebugText} to modify ++ */ ++ protected List collectSystemInformationText() { List list = this.getSystemInformation(); -+ list.addAll(systemInformation); ++ return list; ++ } ++ ++ protected void drawSystemInformation(GuiGraphics p_281261_) { ++ List list = this.collectSystemInformationText(); this.renderLines(p_281261_, list, false); } diff --git a/patches/net/minecraft/client/gui/components/EditBox.java.patch b/patches/net/minecraft/client/gui/components/EditBox.java.patch new file mode 100644 index 00000000..32de9ee7 --- /dev/null +++ b/patches/net/minecraft/client/gui/components/EditBox.java.patch @@ -0,0 +1,60 @@ +--- a/net/minecraft/client/gui/components/EditBox.java ++++ b/net/minecraft/client/gui/components/EditBox.java +@@ -56,6 +_,7 @@ + @Nullable + private Component hint; + private long focusedTime = Util.getMillis(); ++ private boolean textShadow = true; // Neo: Allow modders to disable the default shadow for the text. + + public EditBox(Font p_294485_, int p_294264_, int p_295938_, Component p_294624_) { + this(p_294485_, 0, 0, p_294264_, p_295938_, p_294624_); +@@ -383,7 +_,7 @@ + int i1 = Mth.clamp(this.highlightPos - this.displayPos, 0, s.length()); + if (!s.isEmpty()) { + String s1 = flag ? s.substring(0, i) : s; +- l = p_283252_.drawString(this.font, this.formatter.apply(s1, this.displayPos), j, k, l1); ++ l = p_283252_.drawString(this.font, this.formatter.apply(s1, this.displayPos), j, k, l1, this.textShadow); + } + + boolean flag2 = this.cursorPos < this.value.length() || this.value.length() >= this.getMaxLength(); +@@ -396,22 +_,22 @@ + } + + if (!s.isEmpty() && flag && i < s.length()) { +- p_283252_.drawString(this.font, this.formatter.apply(s.substring(i), this.cursorPos), l, k, l1); ++ p_283252_.drawString(this.font, this.formatter.apply(s.substring(i), this.cursorPos), l, k, l1, this.textShadow); + } + + if (this.hint != null && s.isEmpty() && !this.isFocused()) { +- p_283252_.drawString(this.font, this.hint, l, k, l1); ++ p_283252_.drawString(this.font, this.hint, l, k, l1, this.textShadow); + } + + if (!flag2 && this.suggestion != null) { +- p_283252_.drawString(this.font, this.suggestion, j1 - 1, k, -8355712); ++ p_283252_.drawString(this.font, this.suggestion, j1 - 1, k, -8355712, this.textShadow); + } + + if (flag1) { + if (flag2) { + p_283252_.fill(RenderType.guiOverlay(), j1, k - 1, j1 + 1, k + 1 + 9, -3092272); + } else { +- p_283252_.drawString(this.font, "_", j1, k, l1); ++ p_283252_.drawString(this.font, "_", j1, k, l1, this.textShadow); + } + } + +@@ -552,5 +_,13 @@ + + public void setHint(Component p_259584_) { + this.hint = p_259584_; ++ } ++ ++ public void setTextShadow(boolean textShadow) { ++ this.textShadow = textShadow; ++ } ++ ++ public boolean getTextShadow() { ++ return this.textShadow; + } + } diff --git a/patches/net/minecraft/client/gui/font/providers/GlyphProviderType.java.patch b/patches/net/minecraft/client/gui/font/providers/GlyphProviderType.java.patch new file mode 100644 index 00000000..f3abf97d --- /dev/null +++ b/patches/net/minecraft/client/gui/font/providers/GlyphProviderType.java.patch @@ -0,0 +1,22 @@ +--- a/net/minecraft/client/gui/font/providers/GlyphProviderType.java ++++ b/net/minecraft/client/gui/font/providers/GlyphProviderType.java +@@ -8,7 +_,8 @@ + import net.neoforged.api.distmarker.OnlyIn; + + @OnlyIn(Dist.CLIENT) +-public enum GlyphProviderType implements StringRepresentable { ++@net.neoforged.fml.common.asm.enumextension.NamedEnum ++public enum GlyphProviderType implements StringRepresentable, net.neoforged.fml.common.asm.enumextension.IExtensibleEnum { + BITMAP("bitmap", BitmapProvider.Definition.CODEC), + TTF("ttf", TrueTypeGlyphProviderDefinition.CODEC), + SPACE("space", SpaceProvider.Definition.CODEC), +@@ -31,5 +_,9 @@ + + public MapCodec mapCodec() { + return this.codec; ++ } ++ ++ public static net.neoforged.fml.common.asm.enumextension.ExtensionInfo getExtensionInfo() { ++ return net.neoforged.fml.common.asm.enumextension.ExtensionInfo.nonExtended(GlyphProviderType.class); + } + } diff --git a/patches/net/minecraft/client/gui/screens/Screen.java.patch b/patches/net/minecraft/client/gui/screens/Screen.java.patch index 8ac1f65f..cc93b39e 100644 --- a/patches/net/minecraft/client/gui/screens/Screen.java.patch +++ b/patches/net/minecraft/client/gui/screens/Screen.java.patch @@ -17,6 +17,15 @@ } protected T addRenderableWidget(T p_169406_) { +@@ -242,7 +_,7 @@ + return p_282833_.getTooltipLines( + Item.TooltipContext.of(p_281881_.level), + p_281881_.player, +- p_281881_.options.advancedItemTooltips ? TooltipFlag.Default.ADVANCED : TooltipFlag.Default.NORMAL ++ net.neoforged.neoforge.client.ClientTooltipFlag.of(p_281881_.options.advancedItemTooltips ? TooltipFlag.Default.ADVANCED : TooltipFlag.Default.NORMAL) + ); + } + @@ -312,8 +_,11 @@ this.width = p_96608_; this.height = p_96609_; diff --git a/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch b/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch index 6d13ab4c..b4069b56 100644 --- a/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch +++ b/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch @@ -1,28 +1,21 @@ --- a/net/minecraft/client/gui/screens/TitleScreen.java +++ b/net/minecraft/client/gui/screens/TitleScreen.java -@@ -115,10 +_,13 @@ +@@ -114,11 +_,14 @@ + int i = this.font.width(COPYRIGHT_TEXT); int j = this.width - i - 2; int k = 24; - int l = this.height / 4 + 48; -+ Button modButton = null; +- int l = this.height / 4 + 48; ++ int l = this.height / 4 + 32; if (this.minecraft.isDemo()) { this.createDemoMenuOptions(l, 24); } else { this.createNormalMenuOptions(l, 24); -+ modButton = this.addRenderableWidget(new net.neoforged.neoforge.client.gui.widget.ModsButton(Button.builder(Component.translatable("fml.menu.mods"), button -> this.minecraft.setScreen(new net.neoforged.neoforge.client.gui.ModListScreen(this))) -+ .pos(this.width / 2 - 100, l + 24 * 2).size(98, 20))); ++ this.addRenderableWidget(new net.neoforged.neoforge.client.gui.widget.ModsButton(Button.builder(Component.translatable("fml.menu.mods"), button -> this.minecraft.setScreen(new net.neoforged.neoforge.client.gui.ModListScreen(this))) ++ .pos(this.width / 2 - 100, l + 24 * 3).size(200, 20))); ++ l += 22; // Move down Options, Quit, Language, and Accessibility buttons to make room for mods button } SpriteIconButton spriteiconbutton = this.addRenderableWidget( -@@ -168,7 +_,7 @@ - }).bounds(this.width / 2 - 100, p_96764_ + p_96765_ * 1, 200, 20).tooltip(tooltip).build()).active = flag; - this.addRenderableWidget( - Button.builder(Component.translatable("menu.online"), p_315821_ -> this.minecraft.setScreen(new RealmsMainScreen(this))) -- .bounds(this.width / 2 - 100, p_96764_ + p_96765_ * 2, 200, 20) -+ .bounds(this.width / 2 + 2, p_96764_ + p_96765_ * 2, 98, 20) - .tooltip(tooltip) - .build() - ) @@ -285,6 +_,7 @@ if ((i & -67108864) != 0) { super.render(p_282860_, p_281753_, p_283539_, p_282628_); diff --git a/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch index ae61eab0..67ef56ca 100644 --- a/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch +++ b/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch @@ -185,7 +185,7 @@ this.renderTooltip(p_283000_, p_281317_, p_282770_); } -@@ -684,7 +_,7 @@ +@@ -684,10 +_,10 @@ public List getTooltipFromContainerItem(ItemStack p_281769_) { boolean flag = this.hoveredSlot != null && this.hoveredSlot instanceof CreativeModeInventoryScreen.CustomCreativeSlot; boolean flag1 = selectedTab.getType() == CreativeModeTab.Type.CATEGORY; @@ -193,7 +193,11 @@ + boolean flag2 = selectedTab.hasSearchBar(); TooltipFlag.Default tooltipflag$default = this.minecraft.options.advancedItemTooltips ? TooltipFlag.Default.ADVANCED : TooltipFlag.Default.NORMAL; TooltipFlag tooltipflag = flag ? tooltipflag$default.asCreative() : tooltipflag$default; - List list = p_281769_.getTooltipLines(Item.TooltipContext.of(this.minecraft.level), this.minecraft.player, tooltipflag); +- List list = p_281769_.getTooltipLines(Item.TooltipContext.of(this.minecraft.level), this.minecraft.player, tooltipflag); ++ List list = p_281769_.getTooltipLines(Item.TooltipContext.of(this.minecraft.level), this.minecraft.player, net.neoforged.neoforge.client.ClientTooltipFlag.of(tooltipflag)); + if (flag1 && flag) { + return list; + } else { @@ -703,7 +_,7 @@ int i = 1; diff --git a/patches/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch index 1a68a571..e194f8c3 100644 --- a/patches/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch +++ b/patches/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch @@ -19,6 +19,15 @@ this.renderBackgrounds(p_281945_, i, k, iterable, flag); this.renderIcons(p_281945_, i, k, iterable, flag); if (flag) { +@@ -74,6 +_,8 @@ + this.getEffectName(mobeffectinstance), + MobEffectUtil.formatDuration(mobeffectinstance, 1.0F, this.minecraft.level.tickRateManager().tickrate()) + ); ++ // Neo: Allow mods to adjust the tooltip shown when hovering a mob effect. ++ list = net.neoforged.neoforge.client.ClientHooks.getEffectTooltip(this, mobeffectinstance, list); + p_281945_.renderTooltip(this.font, list, Optional.empty(), p_282601_, p_282335_); + } + } @@ -99,6 +_,11 @@ int i = this.topPos; diff --git a/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch b/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch index da27465d..99b5c71d 100644 --- a/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch +++ b/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch @@ -1,5 +1,17 @@ --- a/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java +++ b/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java +@@ -23,6 +_,11 @@ + public long lastKeySelection; + private KeyBindsList keyBindsList; + private Button resetButton; ++ // Neo: These are to hold the last key and modifier pressed so they can be checked in keyReleased ++ private InputConstants.Key lastPressedKey = InputConstants.UNKNOWN; ++ private InputConstants.Key lastPressedModifier = InputConstants.UNKNOWN; ++ private boolean isLastKeyHeldDown = false; ++ private boolean isLastModifierHeldDown = false; + + public KeyBindsScreen(Screen p_344996_, Options p_344771_) { + super(p_344996_, p_344771_, TITLE); @@ -41,7 +_,7 @@ protected void addFooter() { this.resetButton = Button.builder(Component.translatable("controls.resetAll"), p_346345_ -> { @@ -9,18 +21,73 @@ } this.keyBindsList.resetMappingAndUpdateButtons(); -@@ -73,11 +_,14 @@ +@@ -72,18 +_,65 @@ + @Override public boolean keyPressed(int p_345810_, int p_345447_, int p_344981_) { if (this.selectedKey != null) { - if (p_345810_ == 256) { -+ this.selectedKey.setKeyModifierAndCode(net.neoforged.neoforge.client.settings.KeyModifier.getActiveModifier(), InputConstants.UNKNOWN); +- if (p_345810_ == 256) { ++ var key = InputConstants.getKey(p_345810_, p_345447_); ++ if (net.neoforged.neoforge.client.settings.KeyModifier.isKeyCodeModifier(key)) { ++ lastPressedModifier = key; ++ isLastModifierHeldDown = true; ++ } else { ++ lastPressedKey = key; ++ isLastKeyHeldDown = true; ++ } ++ return true; ++ } else { ++ return super.keyPressed(p_345810_, p_345447_, p_344981_); ++ } ++ } ++ ++ // Neo: This method is override to more easily handle modifier keys ++ @Override ++ public boolean keyReleased(int p_94715_, int p_94716_, int p_94717_) { ++ if (this.selectedKey != null) { ++ if (p_94715_ == 256) { ++ this.selectedKey.setKeyModifierAndCode(net.neoforged.neoforge.client.settings.KeyModifier.NONE, InputConstants.UNKNOWN); this.options.setKey(this.selectedKey, InputConstants.UNKNOWN); ++ lastPressedKey = InputConstants.UNKNOWN; ++ lastPressedModifier = InputConstants.UNKNOWN; ++ isLastKeyHeldDown = false; ++ isLastModifierHeldDown = false; } else { -+ this.selectedKey.setKeyModifierAndCode(net.neoforged.neoforge.client.settings.KeyModifier.getActiveModifier(), InputConstants.getKey(p_345810_, p_345447_)); - this.options.setKey(this.selectedKey, InputConstants.getKey(p_345810_, p_345447_)); - } +- this.options.setKey(this.selectedKey, InputConstants.getKey(p_345810_, p_345447_)); +- } ++ var key = InputConstants.getKey(p_94715_, p_94716_); ++ if (lastPressedKey.equals(key)) { ++ isLastKeyHeldDown = false; ++ } else if (lastPressedModifier.equals(key)) { ++ isLastModifierHeldDown = false; ++ } -+ if(!net.neoforged.neoforge.client.settings.KeyModifier.isKeyCodeModifier(this.selectedKey.getKey())) ++ if (!isLastKeyHeldDown && !isLastModifierHeldDown) { ++ if (!lastPressedKey.equals(InputConstants.UNKNOWN)) { ++ this.selectedKey.setKeyModifierAndCode( ++ net.neoforged.neoforge.client.settings.KeyModifier.getKeyModifier(lastPressedModifier), ++ lastPressedKey ++ ); ++ this.options.setKey(this.selectedKey, lastPressedKey); ++ } else { ++ this.selectedKey.setKeyModifierAndCode( ++ net.neoforged.neoforge.client.settings.KeyModifier.NONE, ++ lastPressedModifier ++ ); ++ this.options.setKey(this.selectedKey, lastPressedModifier); ++ } ++ lastPressedKey = InputConstants.UNKNOWN; ++ lastPressedModifier = InputConstants.UNKNOWN; ++ } else { ++ return true; ++ } ++ } this.selectedKey = null; this.lastKeySelection = Util.getMillis(); this.keyBindsList.resetMappingAndUpdateButtons(); + return true; + } else { +- return super.keyPressed(p_345810_, p_345447_, p_344981_); ++ return super.keyReleased(p_94715_, p_94716_, p_94717_); + } + } + diff --git a/patches/net/minecraft/client/model/HierarchicalModel.java.patch b/patches/net/minecraft/client/model/HierarchicalModel.java.patch new file mode 100644 index 00000000..b9e5a58f --- /dev/null +++ b/patches/net/minecraft/client/model/HierarchicalModel.java.patch @@ -0,0 +1,48 @@ +--- a/net/minecraft/client/model/HierarchicalModel.java ++++ b/net/minecraft/client/model/HierarchicalModel.java +@@ -27,6 +_,10 @@ + super(p_170623_); + } + ++ protected static net.neoforged.neoforge.client.entity.animation.json.AnimationHolder getAnimation(ResourceLocation key) { ++ return net.neoforged.neoforge.client.entity.animation.json.AnimationLoader.INSTANCE.getAnimationHolder(key); ++ } ++ + @Override + public void renderToBuffer(PoseStack p_170625_, VertexConsumer p_170626_, int p_170627_, int p_170628_, int p_350603_) { + this.root().render(p_170625_, p_170626_, p_170627_, p_170628_, p_350603_); +@@ -44,18 +_,34 @@ + this.animate(p_233382_, p_233383_, p_233384_, 1.0F); + } + ++ protected void animate(AnimationState animationState, net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation, float ageInTicks) { ++ this.animate(animationState, animation.get(), ageInTicks); ++ } ++ + protected void animateWalk(AnimationDefinition p_268159_, float p_268057_, float p_268347_, float p_268138_, float p_268165_) { + long i = (long)(p_268057_ * 50.0F * p_268138_); + float f = Math.min(p_268347_ * p_268165_, 1.0F); + KeyframeAnimations.animate(this, p_268159_, i, f, ANIMATION_VECTOR_CACHE); + } + ++ protected void animateWalk(net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation, float limbSwing, float limbSwingAmount, float maxAnimationSpeed, float animationScaleFactor) { ++ this.animateWalk(animation.get(), limbSwing, limbSwingAmount, maxAnimationSpeed, animationScaleFactor); ++ } ++ + protected void animate(AnimationState p_233386_, AnimationDefinition p_233387_, float p_233388_, float p_233389_) { + p_233386_.updateTime(p_233388_, p_233389_); + p_233386_.ifStarted(p_233392_ -> KeyframeAnimations.animate(this, p_233387_, p_233392_.getAccumulatedTime(), 1.0F, ANIMATION_VECTOR_CACHE)); + } + ++ protected void animate(AnimationState animationState, net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation, float ageInTicks, float speed) { ++ this.animate(animationState, animation.get(), ageInTicks, speed); ++ } ++ + protected void applyStatic(AnimationDefinition p_288996_) { + KeyframeAnimations.animate(this, p_288996_, 0L, 1.0F, ANIMATION_VECTOR_CACHE); ++ } ++ ++ protected void applyStatic(net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation) { ++ this.applyStatic(animation.get()); + } + } diff --git a/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch b/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch index 2a800711..2bb68d95 100644 --- a/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch +++ b/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/client/model/geom/LayerDefinitions.java +++ b/net/minecraft/client/model/geom/LayerDefinitions.java +@@ -316,7 +_,7 @@ + LayerDefinition layerdefinition22 = ChestRaftModel.createBodyModel(); + + for (Boat.Type boat$type : Boat.Type.values()) { +- if (boat$type == Boat.Type.BAMBOO) { ++ if (boat$type.isRaft()) { + builder.put(ModelLayers.createBoatModelName(boat$type), layerdefinition21); + builder.put(ModelLayers.createChestBoatModelName(boat$type), layerdefinition22); + } else { @@ -329,6 +_,7 @@ WoodType.values().forEach(p_171114_ -> builder.put(ModelLayers.createSignModelName(p_171114_), layerdefinition23)); LayerDefinition layerdefinition24 = HangingSignRenderer.createHangingSignLayer(); diff --git a/patches/net/minecraft/client/model/geom/ModelLayers.java.patch b/patches/net/minecraft/client/model/geom/ModelLayers.java.patch index f6582422..cbb66bf8 100644 --- a/patches/net/minecraft/client/model/geom/ModelLayers.java.patch +++ b/patches/net/minecraft/client/model/geom/ModelLayers.java.patch @@ -1,6 +1,30 @@ --- a/net/minecraft/client/model/geom/ModelLayers.java +++ b/net/minecraft/client/model/geom/ModelLayers.java -@@ -229,11 +_,13 @@ +@@ -213,27 +_,33 @@ + } + + public static ModelLayerLocation createRaftModelName(Boat.Type p_252002_) { +- return createLocation("raft/" + p_252002_.getName(), "main"); ++ ResourceLocation location = ResourceLocation.parse(p_252002_.getName()); ++ return new ModelLayerLocation(location.withPrefix("raft/"), "main"); + } + + public static ModelLayerLocation createChestRaftModelName(Boat.Type p_248520_) { +- return createLocation("chest_raft/" + p_248520_.getName(), "main"); ++ ResourceLocation location = ResourceLocation.parse(p_248520_.getName()); ++ return new ModelLayerLocation(location.withPrefix("chest_raft/"), "main"); + } + + public static ModelLayerLocation createBoatModelName(Boat.Type p_171290_) { +- return createLocation("boat/" + p_171290_.getName(), "main"); ++ ResourceLocation location = ResourceLocation.parse(p_171290_.getName()); ++ return new ModelLayerLocation(location.withPrefix("boat/"), "main"); + } + + public static ModelLayerLocation createChestBoatModelName(Boat.Type p_233551_) { +- return createLocation("chest_boat/" + p_233551_.getName(), "main"); ++ ResourceLocation location = ResourceLocation.parse(p_233551_.getName()); ++ return new ModelLayerLocation(location.withPrefix("chest_boat/"), "main"); } public static ModelLayerLocation createSignModelName(WoodType p_171292_) { diff --git a/patches/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch b/patches/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch index 49028294..8bc8fe4f 100644 --- a/patches/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch +++ b/patches/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch @@ -20,7 +20,7 @@ } @Override -@@ -149,6 +_,23 @@ +@@ -149,6 +_,33 @@ @Override public void handleCustomPayload(ClientboundCustomPayloadPacket p_295727_) { @@ -35,6 +35,16 @@ + return; + } + ++ if (p_295727_.payload() instanceof net.neoforged.neoforge.network.payload.CommonVersionPayload commonVersionPayload) { ++ net.neoforged.neoforge.network.registration.NetworkRegistry.checkCommonVersion(this, commonVersionPayload); ++ return; ++ } ++ ++ if (p_295727_.payload() instanceof net.neoforged.neoforge.network.payload.CommonRegisterPayload commonRegisterPayload) { ++ net.neoforged.neoforge.network.registration.NetworkRegistry.onCommonRegister(this, commonRegisterPayload); ++ return; ++ } ++ + // Neo: Handle modded payloads. Vanilla payloads do not get sent to the modded handling pass. Additional payloads cannot be registered in the minecraft domain. + if (net.neoforged.neoforge.network.registration.NetworkRegistry.isModdedPayload(p_295727_.payload())) { + net.neoforged.neoforge.network.registration.NetworkRegistry.handleModdedPayload(this, p_295727_); diff --git a/patches/net/minecraft/client/multiplayer/ClientLevel.java.patch b/patches/net/minecraft/client/multiplayer/ClientLevel.java.patch index 10a92778..d7f42b23 100644 --- a/patches/net/minecraft/client/multiplayer/ClientLevel.java.patch +++ b/patches/net/minecraft/client/multiplayer/ClientLevel.java.patch @@ -41,6 +41,15 @@ } public void queueLightUpdate(Runnable p_194172_) { +@@ -238,7 +_,7 @@ + private void tickTime() { + this.setGameTime(this.levelData.getGameTime() + 1L); + if (this.levelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { +- this.setDayTime(this.levelData.getDayTime() + 1L); ++ this.setDayTime(this.levelData.getDayTime() + advanceDaytime()); + } + } + @@ -282,7 +_,11 @@ p_104640_.setOldPosAndRot(); p_104640_.tickCount++; @@ -61,7 +70,7 @@ + if (net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.entity.EntityJoinLevelEvent(p_104741_, this)).isCanceled()) return; this.removeEntity(p_104741_.getId(), Entity.RemovalReason.DISCARDED); this.entityStorage.addEntity(p_104741_); -+ p_104741_.onAddedToWorld(); ++ p_104741_.onAddedToLevel(); } public void removeEntity(int p_171643_, Entity.RemovalReason p_171644_) { @@ -92,6 +101,15 @@ if (p_263514_ == this.minecraft.player) { this.minecraft.getSoundManager().play(new EntityBoundSoundInstance(p_263518_.value(), p_263487_, p_263538_, p_263524_, p_263536_, p_263509_)); } +@@ -906,7 +_,7 @@ + } + + @Override +- public LevelEntityGetter getEntities() { ++ protected LevelEntityGetter getEntities() { + return this.entityStorage.getEntityGetter(); + } + @@ -1033,6 +_,7 @@ } @@ -100,7 +118,7 @@ this.difficulty = p_104852_; } -@@ -1069,14 +_,51 @@ +@@ -1069,14 +_,75 @@ if (p_171712_ instanceof AbstractClientPlayer) { ClientLevel.this.players.add((AbstractClientPlayer)p_171712_); } @@ -115,7 +133,7 @@ p_171716_.unRide(); ClientLevel.this.players.remove(p_171716_); + -+ p_171716_.onRemovedFromWorld(); ++ p_171716_.onRemovedFromLevel(); + net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.entity.EntityLeaveLevelEvent(p_171716_, ClientLevel.this)); + + if (p_171716_.isMultipartEntity()) { @@ -150,5 +168,29 @@ + if (!shade) + return constantAmbientLight ? 0.9F : 1.0F; + return net.neoforged.neoforge.client.model.lighting.QuadLighter.calculateShade(normalX, normalY, normalZ, constantAmbientLight); ++ } ++ ++ // Neo: Variable day time code ++ ++ private float dayTimeFraction = 0.0f; ++ private float dayTimePerTick = -1.0f; ++ ++ @org.jetbrains.annotations.ApiStatus.Internal ++ public void setDayTimeFraction(float dayTimeFraction) { ++ this.dayTimeFraction = dayTimeFraction; ++ } ++ ++ @org.jetbrains.annotations.ApiStatus.Internal ++ public float getDayTimeFraction() { ++ return dayTimeFraction; ++ } ++ ++ public float getDayTimePerTick() { ++ return dayTimePerTick; ++ } ++ ++ @org.jetbrains.annotations.ApiStatus.Internal ++ public void setDayTimePerTick(float dayTimePerTick) { ++ this.dayTimePerTick = dayTimePerTick; } } diff --git a/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch b/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch index 4ca1a328..ba17981a 100644 --- a/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch +++ b/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch @@ -16,7 +16,7 @@ this.potionBrewing = PotionBrewing.bootstrap(this.enabledFeatures); } -@@ -427,6 +_,7 @@ +@@ -427,12 +_,13 @@ this.minecraft.debugRenderer.clear(); this.minecraft.player.resetPos(); @@ -24,6 +24,13 @@ this.minecraft.player.setId(p_105030_.playerId()); this.level.addEntity(this.minecraft.player); this.minecraft.player.input = new KeyboardInput(this.minecraft.options); + this.minecraft.gameMode.adjustPlayer(this.minecraft.player); + this.minecraft.cameraEntity = this.minecraft.player; +- this.startWaitingForNewLevel(this.minecraft.player, this.level, ReceivingLevelScreen.Reason.OTHER); ++ this.startWaitingForNewLevel(this.minecraft.player, this.level, ReceivingLevelScreen.Reason.OTHER, null, null); + this.minecraft.player.setReducedDebugInfo(p_105030_.reducedDebugInfo()); + this.minecraft.player.setShowDeathScreen(p_105030_.showDeathScreen()); + this.minecraft.player.setDoLimitedCrafting(p_105030_.doLimitedCrafting()); @@ -828,7 +_,8 @@ chatcomponent$state, this.strictErrorHandling, @@ -34,6 +41,15 @@ ) ) ); +@@ -1142,7 +_,7 @@ + localplayer1 = this.minecraft.gameMode.createPlayer(this.level, localplayer.getStats(), localplayer.getRecipeBook()); + } + +- this.startWaitingForNewLevel(localplayer1, this.level, receivinglevelscreen$reason); ++ this.startWaitingForNewLevel(localplayer1, this.level, receivinglevelscreen$reason, localplayer.isDeadOrDying() ? null : resourcekey, localplayer.isDeadOrDying() ? null : resourcekey1); + localplayer1.setId(localplayer.getId()); + this.minecraft.player = localplayer1; + if (flag) { @@ -1164,6 +_,7 @@ } @@ -54,6 +70,23 @@ if (p_337415_ instanceof CommandBlockEntity && this.minecraft.screen instanceof CommandBlockEditScreen) { ((CommandBlockEditScreen)this.minecraft.screen).updateGui(); +@@ -1420,9 +_,15 @@ + } + } + ++ /** @deprecated Neo: use {@link #startWaitingForNewLevel(LocalPlayer, ClientLevel, ReceivingLevelScreen.Reason, ResourceKey, ResourceKey)} instead. */ ++ @Deprecated + private void startWaitingForNewLevel(LocalPlayer p_304688_, ClientLevel p_304528_, ReceivingLevelScreen.Reason p_341690_) { ++ this.startWaitingForNewLevel(p_304688_, p_304528_, p_341690_, null, null); ++ } ++ ++ private void startWaitingForNewLevel(LocalPlayer p_304688_, ClientLevel p_304528_, ReceivingLevelScreen.Reason p_341690_, @Nullable ResourceKey toDimension, @Nullable ResourceKey fromDimension) { + this.levelLoadStatusManager = new LevelLoadStatusManager(p_304688_, p_304528_, this.minecraft.levelRenderer); +- this.minecraft.setScreen(new ReceivingLevelScreen(this.levelLoadStatusManager::levelReady, p_341690_)); ++ this.minecraft.setScreen(net.neoforged.neoforge.client.DimensionTransitionScreenManager.getScreen(toDimension, fromDimension).create(this.levelLoadStatusManager::levelReady, p_341690_)); + } + + @Override @@ -1471,7 +_,9 @@ @Override public void handleCommands(ClientboundCommandsPacket p_104990_) { diff --git a/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch b/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch index 3bd75c83..70a7eabf 100644 --- a/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch +++ b/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/client/multiplayer/SessionSearchTrees.java +++ b/net/minecraft/client/multiplayer/SessionSearchTrees.java +@@ -60,7 +_,7 @@ + List list = p_346233_.getCollections(); + Registry registry = p_345600_.registryOrThrow(Registries.ITEM); + Item.TooltipContext item$tooltipcontext = Item.TooltipContext.of(p_345600_); +- TooltipFlag tooltipflag = TooltipFlag.Default.NORMAL; ++ TooltipFlag tooltipflag = net.neoforged.neoforge.client.ClientTooltipFlag.of(TooltipFlag.Default.NORMAL); + CompletableFuture completablefuture = this.recipeSearch; + this.recipeSearch = CompletableFuture.supplyAsync( + () -> new FullTextSearchTree<>( @@ -86,44 +_,60 @@ } @@ -43,9 +52,10 @@ + key, () -> { Item.TooltipContext item$tooltipcontext = Item.TooltipContext.of(p_345391_); - TooltipFlag tooltipflag = TooltipFlag.Default.NORMAL.asCreative(); +- TooltipFlag tooltipflag = TooltipFlag.Default.NORMAL.asCreative(); - CompletableFuture completablefuture = this.creativeByNameSearch; - this.creativeByNameSearch = CompletableFuture.supplyAsync( ++ TooltipFlag tooltipflag = net.neoforged.neoforge.client.ClientTooltipFlag.of(TooltipFlag.Default.NORMAL.asCreative()); + CompletableFuture completablefuture = net.neoforged.neoforge.client.CreativeModeTabSearchRegistry.getNameSearchTree(key); + net.neoforged.neoforge.client.CreativeModeTabSearchRegistry.putNameSearchTree(key, CompletableFuture.supplyAsync( () -> new FullTextSearchTree<>( diff --git a/patches/net/minecraft/client/particle/AttackSweepParticle.java.patch b/patches/net/minecraft/client/particle/AttackSweepParticle.java.patch new file mode 100644 index 00000000..68182108 --- /dev/null +++ b/patches/net/minecraft/client/particle/AttackSweepParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/AttackSweepParticle.java ++++ b/net/minecraft/client/particle/AttackSweepParticle.java +@@ -9,7 +_,7 @@ + public class AttackSweepParticle extends TextureSheetParticle { + private final SpriteSet sprites; + +- AttackSweepParticle(ClientLevel p_105546_, double p_105547_, double p_105548_, double p_105549_, double p_105550_, SpriteSet p_105551_) { ++ protected AttackSweepParticle(ClientLevel p_105546_, double p_105547_, double p_105548_, double p_105549_, double p_105550_, SpriteSet p_105551_) { + super(p_105546_, p_105547_, p_105548_, p_105549_, 0.0, 0.0, 0.0); + this.sprites = p_105551_; + this.lifetime = 4; diff --git a/patches/net/minecraft/client/particle/BlockMarker.java.patch b/patches/net/minecraft/client/particle/BlockMarker.java.patch new file mode 100644 index 00000000..dfaf8e63 --- /dev/null +++ b/patches/net/minecraft/client/particle/BlockMarker.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/BlockMarker.java ++++ b/net/minecraft/client/particle/BlockMarker.java +@@ -9,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class BlockMarker extends TextureSheetParticle { +- BlockMarker(ClientLevel p_194267_, double p_194268_, double p_194269_, double p_194270_, BlockState p_194271_) { ++ protected BlockMarker(ClientLevel p_194267_, double p_194268_, double p_194269_, double p_194270_, BlockState p_194271_) { + super(p_194267_, p_194268_, p_194269_, p_194270_); + this.setSprite(Minecraft.getInstance().getBlockRenderer().getBlockModelShaper().getParticleIcon(p_194271_)); + this.gravity = 0.0F; diff --git a/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch b/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch index dc96475e..021bbf32 100644 --- a/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch +++ b/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/client/particle/BreakingItemParticle.java +++ b/net/minecraft/client/particle/BreakingItemParticle.java +@@ -14,7 +_,7 @@ + private final float uo; + private final float vo; + +- BreakingItemParticle( ++ protected BreakingItemParticle( + ClientLevel p_105646_, double p_105647_, double p_105648_, double p_105649_, double p_105650_, double p_105651_, double p_105652_, ItemStack p_105653_ + ) { + this(p_105646_, p_105647_, p_105648_, p_105649_, p_105653_); @@ -33,7 +_,8 @@ protected BreakingItemParticle(ClientLevel p_105665_, double p_105666_, double p_105667_, double p_105668_, ItemStack p_105669_) { diff --git a/patches/net/minecraft/client/particle/BubbleColumnUpParticle.java.patch b/patches/net/minecraft/client/particle/BubbleColumnUpParticle.java.patch new file mode 100644 index 00000000..dafcdba3 --- /dev/null +++ b/patches/net/minecraft/client/particle/BubbleColumnUpParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/BubbleColumnUpParticle.java ++++ b/net/minecraft/client/particle/BubbleColumnUpParticle.java +@@ -9,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class BubbleColumnUpParticle extends TextureSheetParticle { +- BubbleColumnUpParticle(ClientLevel p_105733_, double p_105734_, double p_105735_, double p_105736_, double p_105737_, double p_105738_, double p_105739_) { ++ protected BubbleColumnUpParticle(ClientLevel p_105733_, double p_105734_, double p_105735_, double p_105736_, double p_105737_, double p_105738_, double p_105739_) { + super(p_105733_, p_105734_, p_105735_, p_105736_); + this.gravity = -0.125F; + this.friction = 0.85F; diff --git a/patches/net/minecraft/client/particle/BubbleParticle.java.patch b/patches/net/minecraft/client/particle/BubbleParticle.java.patch new file mode 100644 index 00000000..ec5402ed --- /dev/null +++ b/patches/net/minecraft/client/particle/BubbleParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/BubbleParticle.java ++++ b/net/minecraft/client/particle/BubbleParticle.java +@@ -9,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class BubbleParticle extends TextureSheetParticle { +- BubbleParticle(ClientLevel p_105773_, double p_105774_, double p_105775_, double p_105776_, double p_105777_, double p_105778_, double p_105779_) { ++ protected BubbleParticle(ClientLevel p_105773_, double p_105774_, double p_105775_, double p_105776_, double p_105777_, double p_105778_, double p_105779_) { + super(p_105773_, p_105774_, p_105775_, p_105776_); + this.setSize(0.02F, 0.02F); + this.quadSize = this.quadSize * (this.random.nextFloat() * 0.6F + 0.2F); diff --git a/patches/net/minecraft/client/particle/BubblePopParticle.java.patch b/patches/net/minecraft/client/particle/BubblePopParticle.java.patch new file mode 100644 index 00000000..e47c9f2a --- /dev/null +++ b/patches/net/minecraft/client/particle/BubblePopParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/BubblePopParticle.java ++++ b/net/minecraft/client/particle/BubblePopParticle.java +@@ -9,7 +_,7 @@ + public class BubblePopParticle extends TextureSheetParticle { + private final SpriteSet sprites; + +- BubblePopParticle( ++ protected BubblePopParticle( + ClientLevel p_105814_, double p_105815_, double p_105816_, double p_105817_, double p_105818_, double p_105819_, double p_105820_, SpriteSet p_105821_ + ) { + super(p_105814_, p_105815_, p_105816_, p_105817_); diff --git a/patches/net/minecraft/client/particle/CampfireSmokeParticle.java.patch b/patches/net/minecraft/client/particle/CampfireSmokeParticle.java.patch new file mode 100644 index 00000000..ce9b04f1 --- /dev/null +++ b/patches/net/minecraft/client/particle/CampfireSmokeParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/CampfireSmokeParticle.java ++++ b/net/minecraft/client/particle/CampfireSmokeParticle.java +@@ -7,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class CampfireSmokeParticle extends TextureSheetParticle { +- CampfireSmokeParticle( ++ protected CampfireSmokeParticle( + ClientLevel p_105856_, double p_105857_, double p_105858_, double p_105859_, double p_105860_, double p_105861_, double p_105862_, boolean p_105863_ + ) { + super(p_105856_, p_105857_, p_105858_, p_105859_); diff --git a/patches/net/minecraft/client/particle/CritParticle.java.patch b/patches/net/minecraft/client/particle/CritParticle.java.patch new file mode 100644 index 00000000..be8f0636 --- /dev/null +++ b/patches/net/minecraft/client/particle/CritParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/CritParticle.java ++++ b/net/minecraft/client/particle/CritParticle.java +@@ -8,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class CritParticle extends TextureSheetParticle { +- CritParticle(ClientLevel p_105919_, double p_105920_, double p_105921_, double p_105922_, double p_105923_, double p_105924_, double p_105925_) { ++ protected CritParticle(ClientLevel p_105919_, double p_105920_, double p_105921_, double p_105922_, double p_105923_, double p_105924_, double p_105925_) { + super(p_105919_, p_105920_, p_105921_, p_105922_, 0.0, 0.0, 0.0); + this.friction = 0.7F; + this.gravity = 0.5F; diff --git a/patches/net/minecraft/client/particle/DragonBreathParticle.java.patch b/patches/net/minecraft/client/particle/DragonBreathParticle.java.patch new file mode 100644 index 00000000..1551156a --- /dev/null +++ b/patches/net/minecraft/client/particle/DragonBreathParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/DragonBreathParticle.java ++++ b/net/minecraft/client/particle/DragonBreathParticle.java +@@ -19,7 +_,7 @@ + private boolean hasHitGround; + private final SpriteSet sprites; + +- DragonBreathParticle( ++ protected DragonBreathParticle( + ClientLevel p_106005_, double p_106006_, double p_106007_, double p_106008_, double p_106009_, double p_106010_, double p_106011_, SpriteSet p_106012_ + ) { + super(p_106005_, p_106006_, p_106007_, p_106008_); diff --git a/patches/net/minecraft/client/particle/DripParticle.java.patch b/patches/net/minecraft/client/particle/DripParticle.java.patch new file mode 100644 index 00000000..ff566b5e --- /dev/null +++ b/patches/net/minecraft/client/particle/DripParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/DripParticle.java ++++ b/net/minecraft/client/particle/DripParticle.java +@@ -20,7 +_,7 @@ + private final Fluid type; + protected boolean isGlowing; + +- DripParticle(ClientLevel p_106051_, double p_106052_, double p_106053_, double p_106054_, Fluid p_106055_) { ++ protected DripParticle(ClientLevel p_106051_, double p_106052_, double p_106053_, double p_106054_, Fluid p_106055_) { + super(p_106051_, p_106052_, p_106053_, p_106054_); + this.setSize(0.01F, 0.01F); + this.gravity = 0.06F; diff --git a/patches/net/minecraft/client/particle/EndRodParticle.java.patch b/patches/net/minecraft/client/particle/EndRodParticle.java.patch new file mode 100644 index 00000000..edcac260 --- /dev/null +++ b/patches/net/minecraft/client/particle/EndRodParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/EndRodParticle.java ++++ b/net/minecraft/client/particle/EndRodParticle.java +@@ -7,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class EndRodParticle extends SimpleAnimatedParticle { +- EndRodParticle( ++ protected EndRodParticle( + ClientLevel p_106531_, double p_106532_, double p_106533_, double p_106534_, double p_106535_, double p_106536_, double p_106537_, SpriteSet p_106538_ + ) { + super(p_106531_, p_106532_, p_106533_, p_106534_, p_106538_, 0.0125F); diff --git a/patches/net/minecraft/client/particle/FallingDustParticle.java.patch b/patches/net/minecraft/client/particle/FallingDustParticle.java.patch new file mode 100644 index 00000000..42bd8450 --- /dev/null +++ b/patches/net/minecraft/client/particle/FallingDustParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/FallingDustParticle.java ++++ b/net/minecraft/client/particle/FallingDustParticle.java +@@ -17,7 +_,7 @@ + private final float rotSpeed; + private final SpriteSet sprites; + +- FallingDustParticle( ++ protected FallingDustParticle( + ClientLevel p_106610_, double p_106611_, double p_106612_, double p_106613_, float p_106614_, float p_106615_, float p_106616_, SpriteSet p_106617_ + ) { + super(p_106610_, p_106611_, p_106612_, p_106613_); diff --git a/patches/net/minecraft/client/particle/FireworkParticles.java.patch b/patches/net/minecraft/client/particle/FireworkParticles.java.patch index 709c4d39..c40fed37 100644 --- a/patches/net/minecraft/client/particle/FireworkParticles.java.patch +++ b/patches/net/minecraft/client/particle/FireworkParticles.java.patch @@ -1,5 +1,23 @@ --- a/net/minecraft/client/particle/FireworkParticles.java +++ b/net/minecraft/client/particle/FireworkParticles.java +@@ -49,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public static class OverlayParticle extends TextureSheetParticle { +- OverlayParticle(ClientLevel p_106677_, double p_106678_, double p_106679_, double p_106680_) { ++ protected OverlayParticle(ClientLevel p_106677_, double p_106678_, double p_106679_, double p_106680_) { + super(p_106677_, p_106678_, p_106679_, p_106680_); + this.lifetime = 4; + } +@@ -81,7 +_,7 @@ + private float fadeB; + private boolean hasFade; + +- SparkParticle( ++ protected SparkParticle( + ClientLevel p_106702_, + double p_106703_, + double p_106704_, @@ -253,6 +_,10 @@ intlist = IntList.of(DyeColor.BLACK.getFireworkColor()); } diff --git a/patches/net/minecraft/client/particle/FlameParticle.java.patch b/patches/net/minecraft/client/particle/FlameParticle.java.patch new file mode 100644 index 00000000..0e4be06b --- /dev/null +++ b/patches/net/minecraft/client/particle/FlameParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/FlameParticle.java ++++ b/net/minecraft/client/particle/FlameParticle.java +@@ -8,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class FlameParticle extends RisingParticle { +- FlameParticle(ClientLevel p_106800_, double p_106801_, double p_106802_, double p_106803_, double p_106804_, double p_106805_, double p_106806_) { ++ protected FlameParticle(ClientLevel p_106800_, double p_106801_, double p_106802_, double p_106803_, double p_106804_, double p_106805_, double p_106806_) { + super(p_106800_, p_106801_, p_106802_, p_106803_, p_106804_, p_106805_, p_106806_); + } + diff --git a/patches/net/minecraft/client/particle/FlyStraightTowardsParticle.java.patch b/patches/net/minecraft/client/particle/FlyStraightTowardsParticle.java.patch new file mode 100644 index 00000000..e4fae4f0 --- /dev/null +++ b/patches/net/minecraft/client/particle/FlyStraightTowardsParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/FlyStraightTowardsParticle.java ++++ b/net/minecraft/client/particle/FlyStraightTowardsParticle.java +@@ -15,7 +_,7 @@ + private final int startColor; + private final int endColor; + +- FlyStraightTowardsParticle( ++ protected FlyStraightTowardsParticle( + ClientLevel p_338359_, + double p_338512_, + double p_338787_, diff --git a/patches/net/minecraft/client/particle/FlyTowardsPositionParticle.java.patch b/patches/net/minecraft/client/particle/FlyTowardsPositionParticle.java.patch new file mode 100644 index 00000000..af5db3e4 --- /dev/null +++ b/patches/net/minecraft/client/particle/FlyTowardsPositionParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/FlyTowardsPositionParticle.java ++++ b/net/minecraft/client/particle/FlyTowardsPositionParticle.java +@@ -15,7 +_,7 @@ + private final boolean isGlowing; + private final Particle.LifetimeAlpha lifetimeAlpha; + +- FlyTowardsPositionParticle( ++ protected FlyTowardsPositionParticle( + ClientLevel p_323658_, double p_324523_, double p_324079_, double p_324377_, double p_324144_, double p_324286_, double p_323511_ + ) { + this(p_323658_, p_324523_, p_324079_, p_324377_, p_324144_, p_324286_, p_323511_, false, Particle.LifetimeAlpha.ALWAYS_OPAQUE); diff --git a/patches/net/minecraft/client/particle/GlowParticle.java.patch b/patches/net/minecraft/client/particle/GlowParticle.java.patch new file mode 100644 index 00000000..f51e0b22 --- /dev/null +++ b/patches/net/minecraft/client/particle/GlowParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/GlowParticle.java ++++ b/net/minecraft/client/particle/GlowParticle.java +@@ -12,7 +_,7 @@ + static final RandomSource RANDOM = RandomSource.create(); + private final SpriteSet sprites; + +- GlowParticle( ++ protected GlowParticle( + ClientLevel p_172136_, double p_172137_, double p_172138_, double p_172139_, double p_172140_, double p_172141_, double p_172142_, SpriteSet p_172143_ + ) { + super(p_172136_, p_172137_, p_172138_, p_172139_, p_172140_, p_172141_, p_172142_); diff --git a/patches/net/minecraft/client/particle/GustSeedParticle.java.patch b/patches/net/minecraft/client/particle/GustSeedParticle.java.patch new file mode 100644 index 00000000..02dae0d1 --- /dev/null +++ b/patches/net/minecraft/client/particle/GustSeedParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/GustSeedParticle.java ++++ b/net/minecraft/client/particle/GustSeedParticle.java +@@ -11,7 +_,7 @@ + private final double scale; + private final int tickDelayInBetween; + +- GustSeedParticle(ClientLevel p_311842_, double p_312103_, double p_312358_, double p_312614_, double p_326153_, int p_326148_, int p_326155_) { ++ protected GustSeedParticle(ClientLevel p_311842_, double p_312103_, double p_312358_, double p_312614_, double p_326153_, int p_326148_, int p_326155_) { + super(p_311842_, p_312103_, p_312358_, p_312614_, 0.0, 0.0, 0.0); + this.scale = p_326153_; + this.lifetime = p_326148_; diff --git a/patches/net/minecraft/client/particle/HeartParticle.java.patch b/patches/net/minecraft/client/particle/HeartParticle.java.patch new file mode 100644 index 00000000..3cbd8fdd --- /dev/null +++ b/patches/net/minecraft/client/particle/HeartParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/HeartParticle.java ++++ b/net/minecraft/client/particle/HeartParticle.java +@@ -8,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class HeartParticle extends TextureSheetParticle { +- HeartParticle(ClientLevel p_106847_, double p_106848_, double p_106849_, double p_106850_) { ++ protected HeartParticle(ClientLevel p_106847_, double p_106848_, double p_106849_, double p_106850_) { + super(p_106847_, p_106848_, p_106849_, p_106850_, 0.0, 0.0, 0.0); + this.speedUpWhenYMotionIsBlocked = true; + this.friction = 0.86F; diff --git a/patches/net/minecraft/client/particle/HugeExplosionSeedParticle.java.patch b/patches/net/minecraft/client/particle/HugeExplosionSeedParticle.java.patch new file mode 100644 index 00000000..b002e941 --- /dev/null +++ b/patches/net/minecraft/client/particle/HugeExplosionSeedParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/HugeExplosionSeedParticle.java ++++ b/net/minecraft/client/particle/HugeExplosionSeedParticle.java +@@ -8,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class HugeExplosionSeedParticle extends NoRenderParticle { +- HugeExplosionSeedParticle(ClientLevel p_106947_, double p_106948_, double p_106949_, double p_106950_) { ++ protected HugeExplosionSeedParticle(ClientLevel p_106947_, double p_106948_, double p_106949_, double p_106950_) { + super(p_106947_, p_106948_, p_106949_, p_106950_, 0.0, 0.0, 0.0); + this.lifetime = 8; + } diff --git a/patches/net/minecraft/client/particle/LavaParticle.java.patch b/patches/net/minecraft/client/particle/LavaParticle.java.patch new file mode 100644 index 00000000..201fe2c1 --- /dev/null +++ b/patches/net/minecraft/client/particle/LavaParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/LavaParticle.java ++++ b/net/minecraft/client/particle/LavaParticle.java +@@ -8,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class LavaParticle extends TextureSheetParticle { +- LavaParticle(ClientLevel p_107074_, double p_107075_, double p_107076_, double p_107077_) { ++ protected LavaParticle(ClientLevel p_107074_, double p_107075_, double p_107076_, double p_107077_) { + super(p_107074_, p_107075_, p_107076_, p_107077_, 0.0, 0.0, 0.0); + this.gravity = 0.75F; + this.friction = 0.999F; diff --git a/patches/net/minecraft/client/particle/MobAppearanceParticle.java.patch b/patches/net/minecraft/client/particle/MobAppearanceParticle.java.patch new file mode 100644 index 00000000..7c3dcd6d --- /dev/null +++ b/patches/net/minecraft/client/particle/MobAppearanceParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/MobAppearanceParticle.java ++++ b/net/minecraft/client/particle/MobAppearanceParticle.java +@@ -24,7 +_,7 @@ + private final Model model; + private final RenderType renderType = RenderType.entityTranslucent(ElderGuardianRenderer.GUARDIAN_ELDER_LOCATION); + +- MobAppearanceParticle(ClientLevel p_107114_, double p_107115_, double p_107116_, double p_107117_) { ++ protected MobAppearanceParticle(ClientLevel p_107114_, double p_107115_, double p_107116_, double p_107117_) { + super(p_107114_, p_107115_, p_107116_, p_107117_); + this.model = new GuardianModel(Minecraft.getInstance().getEntityModels().bakeLayer(ModelLayers.ELDER_GUARDIAN)); + this.gravity = 0.0F; diff --git a/patches/net/minecraft/client/particle/NoteParticle.java.patch b/patches/net/minecraft/client/particle/NoteParticle.java.patch new file mode 100644 index 00000000..d1c81e55 --- /dev/null +++ b/patches/net/minecraft/client/particle/NoteParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/NoteParticle.java ++++ b/net/minecraft/client/particle/NoteParticle.java +@@ -8,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class NoteParticle extends TextureSheetParticle { +- NoteParticle(ClientLevel p_107167_, double p_107168_, double p_107169_, double p_107170_, double p_107171_) { ++ protected NoteParticle(ClientLevel p_107167_, double p_107168_, double p_107169_, double p_107170_, double p_107171_) { + super(p_107167_, p_107168_, p_107169_, p_107170_, 0.0, 0.0, 0.0); + this.friction = 0.66F; + this.speedUpWhenYMotionIsBlocked = true; diff --git a/patches/net/minecraft/client/particle/PlayerCloudParticle.java.patch b/patches/net/minecraft/client/particle/PlayerCloudParticle.java.patch new file mode 100644 index 00000000..3a49c31e --- /dev/null +++ b/patches/net/minecraft/client/particle/PlayerCloudParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/PlayerCloudParticle.java ++++ b/net/minecraft/client/particle/PlayerCloudParticle.java +@@ -11,7 +_,7 @@ + public class PlayerCloudParticle extends TextureSheetParticle { + private final SpriteSet sprites; + +- PlayerCloudParticle( ++ protected PlayerCloudParticle( + ClientLevel p_107483_, double p_107484_, double p_107485_, double p_107486_, double p_107487_, double p_107488_, double p_107489_, SpriteSet p_107490_ + ) { + super(p_107483_, p_107484_, p_107485_, p_107486_, 0.0, 0.0, 0.0); diff --git a/patches/net/minecraft/client/particle/ReversePortalParticle.java.patch b/patches/net/minecraft/client/particle/ReversePortalParticle.java.patch index cfae8e80..28ca9c44 100644 --- a/patches/net/minecraft/client/particle/ReversePortalParticle.java.patch +++ b/patches/net/minecraft/client/particle/ReversePortalParticle.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/client/particle/ReversePortalParticle.java +++ b/net/minecraft/client/particle/ReversePortalParticle.java +@@ -7,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class ReversePortalParticle extends PortalParticle { +- ReversePortalParticle(ClientLevel p_107590_, double p_107591_, double p_107592_, double p_107593_, double p_107594_, double p_107595_, double p_107596_) { ++ protected ReversePortalParticle(ClientLevel p_107590_, double p_107591_, double p_107592_, double p_107593_, double p_107594_, double p_107595_, double p_107596_) { + super(p_107590_, p_107591_, p_107592_, p_107593_, p_107594_, p_107595_, p_107596_); + this.quadSize *= 1.5F; + this.lifetime = (int)(Math.random() * 2.0) + 60; @@ -31,6 +_,7 @@ this.x = this.x + this.xd * (double)f; this.y = this.y + this.yd * (double)f; diff --git a/patches/net/minecraft/client/particle/SculkChargeParticle.java.patch b/patches/net/minecraft/client/particle/SculkChargeParticle.java.patch new file mode 100644 index 00000000..2b153db4 --- /dev/null +++ b/patches/net/minecraft/client/particle/SculkChargeParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SculkChargeParticle.java ++++ b/net/minecraft/client/particle/SculkChargeParticle.java +@@ -9,7 +_,7 @@ + public class SculkChargeParticle extends TextureSheetParticle { + private final SpriteSet sprites; + +- SculkChargeParticle( ++ protected SculkChargeParticle( + ClientLevel p_233892_, double p_233893_, double p_233894_, double p_233895_, double p_233896_, double p_233897_, double p_233898_, SpriteSet p_233899_ + ) { + super(p_233892_, p_233893_, p_233894_, p_233895_, p_233896_, p_233897_, p_233898_); diff --git a/patches/net/minecraft/client/particle/SculkChargePopParticle.java.patch b/patches/net/minecraft/client/particle/SculkChargePopParticle.java.patch new file mode 100644 index 00000000..8d38eaa6 --- /dev/null +++ b/patches/net/minecraft/client/particle/SculkChargePopParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SculkChargePopParticle.java ++++ b/net/minecraft/client/particle/SculkChargePopParticle.java +@@ -9,7 +_,7 @@ + public class SculkChargePopParticle extends TextureSheetParticle { + private final SpriteSet sprites; + +- SculkChargePopParticle( ++ protected SculkChargePopParticle( + ClientLevel p_233932_, double p_233933_, double p_233934_, double p_233935_, double p_233936_, double p_233937_, double p_233938_, SpriteSet p_233939_ + ) { + super(p_233932_, p_233933_, p_233934_, p_233935_, p_233936_, p_233937_, p_233938_); diff --git a/patches/net/minecraft/client/particle/ShriekParticle.java.patch b/patches/net/minecraft/client/particle/ShriekParticle.java.patch new file mode 100644 index 00000000..12c81175 --- /dev/null +++ b/patches/net/minecraft/client/particle/ShriekParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/ShriekParticle.java ++++ b/net/minecraft/client/particle/ShriekParticle.java +@@ -14,7 +_,7 @@ + private static final float MAGICAL_X_ROT = 1.0472F; + private int delay; + +- ShriekParticle(ClientLevel p_233976_, double p_233977_, double p_233978_, double p_233979_, int p_233980_) { ++ protected ShriekParticle(ClientLevel p_233976_, double p_233977_, double p_233978_, double p_233979_, int p_233980_) { + super(p_233976_, p_233977_, p_233978_, p_233979_, 0.0, 0.0, 0.0); + this.quadSize = 0.85F; + this.delay = p_233980_; diff --git a/patches/net/minecraft/client/particle/SoulParticle.java.patch b/patches/net/minecraft/client/particle/SoulParticle.java.patch new file mode 100644 index 00000000..d03d965e --- /dev/null +++ b/patches/net/minecraft/client/particle/SoulParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SoulParticle.java ++++ b/net/minecraft/client/particle/SoulParticle.java +@@ -10,7 +_,7 @@ + private final SpriteSet sprites; + protected boolean isGlowing; + +- SoulParticle( ++ protected SoulParticle( + ClientLevel p_107717_, double p_107718_, double p_107719_, double p_107720_, double p_107721_, double p_107722_, double p_107723_, SpriteSet p_107724_ + ) { + super(p_107717_, p_107718_, p_107719_, p_107720_, p_107721_, p_107722_, p_107723_); diff --git a/patches/net/minecraft/client/particle/SpellParticle.java.patch b/patches/net/minecraft/client/particle/SpellParticle.java.patch new file mode 100644 index 00000000..8dd0e6bd --- /dev/null +++ b/patches/net/minecraft/client/particle/SpellParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SpellParticle.java ++++ b/net/minecraft/client/particle/SpellParticle.java +@@ -16,7 +_,7 @@ + private final SpriteSet sprites; + private float originalAlpha = 1.0F; + +- SpellParticle( ++ protected SpellParticle( + ClientLevel p_107762_, double p_107763_, double p_107764_, double p_107765_, double p_107766_, double p_107767_, double p_107768_, SpriteSet p_107769_ + ) { + super(p_107762_, p_107763_, p_107764_, p_107765_, 0.5 - RANDOM.nextDouble(), p_107767_, 0.5 - RANDOM.nextDouble()); diff --git a/patches/net/minecraft/client/particle/SpitParticle.java.patch b/patches/net/minecraft/client/particle/SpitParticle.java.patch new file mode 100644 index 00000000..b6906be2 --- /dev/null +++ b/patches/net/minecraft/client/particle/SpitParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SpitParticle.java ++++ b/net/minecraft/client/particle/SpitParticle.java +@@ -7,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class SpitParticle extends ExplodeParticle { +- SpitParticle( ++ protected SpitParticle( + ClientLevel p_107888_, double p_107889_, double p_107890_, double p_107891_, double p_107892_, double p_107893_, double p_107894_, SpriteSet p_107895_ + ) { + super(p_107888_, p_107889_, p_107890_, p_107891_, p_107892_, p_107893_, p_107894_, p_107895_); diff --git a/patches/net/minecraft/client/particle/SplashParticle.java.patch b/patches/net/minecraft/client/particle/SplashParticle.java.patch new file mode 100644 index 00000000..adea6e75 --- /dev/null +++ b/patches/net/minecraft/client/particle/SplashParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SplashParticle.java ++++ b/net/minecraft/client/particle/SplashParticle.java +@@ -7,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class SplashParticle extends WaterDropParticle { +- SplashParticle(ClientLevel p_107929_, double p_107930_, double p_107931_, double p_107932_, double p_107933_, double p_107934_, double p_107935_) { ++ protected SplashParticle(ClientLevel p_107929_, double p_107930_, double p_107931_, double p_107932_, double p_107933_, double p_107934_, double p_107935_) { + super(p_107929_, p_107930_, p_107931_, p_107932_); + this.gravity = 0.04F; + if (p_107934_ == 0.0 && (p_107933_ != 0.0 || p_107935_ != 0.0)) { diff --git a/patches/net/minecraft/client/particle/SquidInkParticle.java.patch b/patches/net/minecraft/client/particle/SquidInkParticle.java.patch new file mode 100644 index 00000000..048714e7 --- /dev/null +++ b/patches/net/minecraft/client/particle/SquidInkParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SquidInkParticle.java ++++ b/net/minecraft/client/particle/SquidInkParticle.java +@@ -9,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class SquidInkParticle extends SimpleAnimatedParticle { +- SquidInkParticle( ++ protected SquidInkParticle( + ClientLevel p_172325_, + double p_172326_, + double p_172327_, diff --git a/patches/net/minecraft/client/particle/SuspendedParticle.java.patch b/patches/net/minecraft/client/particle/SuspendedParticle.java.patch new file mode 100644 index 00000000..40dbb2ea --- /dev/null +++ b/patches/net/minecraft/client/particle/SuspendedParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SuspendedParticle.java ++++ b/net/minecraft/client/particle/SuspendedParticle.java +@@ -11,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class SuspendedParticle extends TextureSheetParticle { +- SuspendedParticle(ClientLevel p_172403_, SpriteSet p_172404_, double p_172405_, double p_172406_, double p_172407_) { ++ protected SuspendedParticle(ClientLevel p_172403_, SpriteSet p_172404_, double p_172405_, double p_172406_, double p_172407_) { + super(p_172403_, p_172405_, p_172406_ - 0.125, p_172407_); + this.setSize(0.01F, 0.01F); + this.pickSprite(p_172404_); diff --git a/patches/net/minecraft/client/particle/SuspendedTownParticle.java.patch b/patches/net/minecraft/client/particle/SuspendedTownParticle.java.patch new file mode 100644 index 00000000..6d11e27b --- /dev/null +++ b/patches/net/minecraft/client/particle/SuspendedTownParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/SuspendedTownParticle.java ++++ b/net/minecraft/client/particle/SuspendedTownParticle.java +@@ -7,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class SuspendedTownParticle extends TextureSheetParticle { +- SuspendedTownParticle(ClientLevel p_108104_, double p_108105_, double p_108106_, double p_108107_, double p_108108_, double p_108109_, double p_108110_) { ++ protected SuspendedTownParticle(ClientLevel p_108104_, double p_108105_, double p_108106_, double p_108107_, double p_108108_, double p_108109_, double p_108110_) { + super(p_108104_, p_108105_, p_108106_, p_108107_, p_108108_, p_108109_, p_108110_); + float f = this.random.nextFloat() * 0.1F + 0.2F; + this.rCol = f; diff --git a/patches/net/minecraft/client/particle/TotemParticle.java.patch b/patches/net/minecraft/client/particle/TotemParticle.java.patch new file mode 100644 index 00000000..f0579cba --- /dev/null +++ b/patches/net/minecraft/client/particle/TotemParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/TotemParticle.java ++++ b/net/minecraft/client/particle/TotemParticle.java +@@ -7,7 +_,7 @@ + + @OnlyIn(Dist.CLIENT) + public class TotemParticle extends SimpleAnimatedParticle { +- TotemParticle( ++ protected TotemParticle( + ClientLevel p_108346_, double p_108347_, double p_108348_, double p_108349_, double p_108350_, double p_108351_, double p_108352_, SpriteSet p_108353_ + ) { + super(p_108346_, p_108347_, p_108348_, p_108349_, p_108353_, 1.25F); diff --git a/patches/net/minecraft/client/particle/VibrationSignalParticle.java.patch b/patches/net/minecraft/client/particle/VibrationSignalParticle.java.patch index 05b6502a..8a8ddc04 100644 --- a/patches/net/minecraft/client/particle/VibrationSignalParticle.java.patch +++ b/patches/net/minecraft/client/particle/VibrationSignalParticle.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/client/particle/VibrationSignalParticle.java +++ b/net/minecraft/client/particle/VibrationSignalParticle.java +@@ -20,7 +_,7 @@ + private float pitch; + private float pitchO; + +- VibrationSignalParticle(ClientLevel p_234105_, double p_234106_, double p_234107_, double p_234108_, PositionSource p_234109_, int p_234110_) { ++ protected VibrationSignalParticle(ClientLevel p_234105_, double p_234106_, double p_234107_, double p_234108_, PositionSource p_234109_, int p_234110_) { + super(p_234105_, p_234106_, p_234107_, p_234108_, 0.0, 0.0, 0.0); + this.quadSize = 0.3F; + this.target = p_234109_; @@ -76,6 +_,7 @@ this.x = Mth.lerp(d0, this.x, vec3.x()); this.y = Mth.lerp(d0, this.y, vec3.y()); diff --git a/patches/net/minecraft/client/particle/WakeParticle.java.patch b/patches/net/minecraft/client/particle/WakeParticle.java.patch new file mode 100644 index 00000000..d7c90c86 --- /dev/null +++ b/patches/net/minecraft/client/particle/WakeParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/WakeParticle.java ++++ b/net/minecraft/client/particle/WakeParticle.java +@@ -9,7 +_,7 @@ + public class WakeParticle extends TextureSheetParticle { + private final SpriteSet sprites; + +- WakeParticle( ++ protected WakeParticle( + ClientLevel p_108407_, double p_108408_, double p_108409_, double p_108410_, double p_108411_, double p_108412_, double p_108413_, SpriteSet p_108414_ + ) { + super(p_108407_, p_108408_, p_108409_, p_108410_, 0.0, 0.0, 0.0); diff --git a/patches/net/minecraft/client/particle/WaterCurrentDownParticle.java.patch b/patches/net/minecraft/client/particle/WaterCurrentDownParticle.java.patch new file mode 100644 index 00000000..649df2ff --- /dev/null +++ b/patches/net/minecraft/client/particle/WaterCurrentDownParticle.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/particle/WaterCurrentDownParticle.java ++++ b/net/minecraft/client/particle/WaterCurrentDownParticle.java +@@ -12,7 +_,7 @@ + public class WaterCurrentDownParticle extends TextureSheetParticle { + private float angle; + +- WaterCurrentDownParticle(ClientLevel p_108450_, double p_108451_, double p_108452_, double p_108453_) { ++ protected WaterCurrentDownParticle(ClientLevel p_108450_, double p_108451_, double p_108452_, double p_108453_) { + super(p_108450_, p_108451_, p_108452_, p_108453_); + this.lifetime = (int)(Math.random() * 60.0) + 30; + this.hasPhysics = false; diff --git a/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch b/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch index c0e16a19..d66d2a4c 100644 --- a/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch +++ b/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch @@ -52,14 +52,13 @@ public static RenderType getRenderType(ItemStack p_109280_, boolean p_109281_) { Item item = p_109280_.getItem(); if (item instanceof BlockItem) { -@@ -392,6 +_,67 @@ - public static RenderType getRenderLayer(FluidState p_109288_) { - RenderType rendertype = TYPE_BY_FLUID.get(p_109288_.getType()); - return rendertype != null ? rendertype : RenderType.solid(); +@@ -396,5 +_,78 @@ + + public static void setFancy(boolean p_109292_) { + renderCutout = p_109292_; + } + -+ // FORGE START -+ ++ // Neo: Injected new ChunkRenderTypeSets for Blocks to be able to use + private static final net.neoforged.neoforge.client.ChunkRenderTypeSet CUTOUT_MIPPED = net.neoforged.neoforge.client.ChunkRenderTypeSet.of(RenderType.cutoutMipped()); + private static final net.neoforged.neoforge.client.ChunkRenderTypeSet SOLID = net.neoforged.neoforge.client.ChunkRenderTypeSet.of(RenderType.solid()); + @@ -82,26 +81,39 @@ + } + } + -+ /** @deprecated Set your render type in your block model's JSON (eg. {@code "render_type": "cutout"}) or override {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)} */ ++ // Neo: RenderType for block setters injected ++ /** ++ * Helper to set the RenderType for Blocks ++ * @deprecated Set your render type in your block model's JSON (eg. {@code "render_type": "cutout"}) or override {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)} ++ * */ + @Deprecated(since = "1.19") + public static void setRenderLayer(Block block, RenderType type) { + com.google.common.base.Preconditions.checkArgument(type.getChunkLayerId() >= 0, "The argument must be a valid chunk render type returned by RenderType#chunkBufferLayers()."); + setRenderLayer(block, net.neoforged.neoforge.client.ChunkRenderTypeSet.of(type)); + } + -+ /** @deprecated Set your render type in your block model's JSON (eg. {@code "render_type": "cutout"}) or override {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)} */ ++ /** ++ * Helper to set the matching RenderType for Blocks ++ * @deprecated Set your render type in your block model's JSON (eg. {@code "render_type": "cutout"}) or override {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)} ++ * */ + @Deprecated(since = "1.19") + public static synchronized void setRenderLayer(Block block, java.util.function.Predicate predicate) { + setRenderLayer(block, createSetFromPredicate(predicate)); + } + -+ /** @deprecated Set your render type in your block model's JSON (eg. {@code "render_type": "cutout"}) or override {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)} */ ++ /** ++ * Helper to set the ChunkRenderTypeSet for Blocks ++ * @deprecated Set your render type in your block model's JSON (eg. {@code "render_type": "cutout"}) or override {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)} ++ * */ + @Deprecated(since = "1.19") + public static synchronized void setRenderLayer(Block block, net.neoforged.neoforge.client.ChunkRenderTypeSet layers) { + checkClientLoading(); + BLOCK_RENDER_TYPES.put(block, layers); + } + ++ /** ++ * Helper to set the RenderType for Fluids ++ */ + public static synchronized void setRenderLayer(Fluid fluid, RenderType type) { + com.google.common.base.Preconditions.checkArgument(type.getChunkLayerId() >= 0, "The argument must be a valid chunk render type returned by RenderType#chunkBufferLayers()."); + checkClientLoading(); @@ -118,5 +130,4 @@ + private static net.neoforged.neoforge.client.ChunkRenderTypeSet createSetFromPredicate(java.util.function.Predicate predicate) { + return net.neoforged.neoforge.client.ChunkRenderTypeSet.of(RenderType.chunkBufferLayers().stream().filter(predicate).toArray(RenderType[]::new)); } - - public static void setFancy(boolean p_109292_) { + } diff --git a/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch b/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch index c0f8f8bd..8497dbd1 100644 --- a/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/client/renderer/ItemInHandRenderer.java +++ b/net/minecraft/client/renderer/ItemInHandRenderer.java +@@ -226,7 +_,7 @@ + p_109367_.translate(-0.5F, -0.5F, 0.0F); + p_109367_.scale(0.0078125F, 0.0078125F, 0.0078125F); + MapId mapid = p_109370_.get(DataComponents.MAP_ID); +- MapItemSavedData mapitemsaveddata = MapItem.getSavedData(mapid, this.minecraft.level); ++ MapItemSavedData mapitemsaveddata = MapItem.getSavedData(p_109370_, this.minecraft.level); + VertexConsumer vertexconsumer = p_109368_.getBuffer(mapitemsaveddata == null ? MAP_BACKGROUND : MAP_BACKGROUND_CHECKERBOARD); + Matrix4f matrix4f = p_109367_.last().pose(); + vertexconsumer.addVertex(matrix4f, -7.0F, 135.0F, 0.0F).setColor(-1).setUv(0.0F, 1.0F).setLight(p_109369_); @@ -334,12 +_,14 @@ if (iteminhandrenderer$handrenderselection.renderMainHand) { float f4 = interactionhand == InteractionHand.MAIN_HAND ? f : 0.0F; @@ -15,7 +24,14 @@ this.renderArmWithItem(p_109318_, p_109315_, f1, InteractionHand.OFF_HAND, f6, this.offHandItem, f7, p_109316_, p_109317_, p_109319_); } -@@ -405,7 +_,7 @@ +@@ -399,13 +_,13 @@ + if (flag && !p_109372_.isInvisible()) { + this.renderPlayerArm(p_109379_, p_109380_, p_109381_, p_109378_, p_109376_, humanoidarm); + } +- } else if (p_109377_.is(Items.FILLED_MAP)) { ++ } else if (p_109377_.getItem() instanceof MapItem) { + if (flag && this.offHandItem.isEmpty()) { + this.renderTwoHandedMap(p_109379_, p_109380_, p_109381_, p_109374_, p_109378_, p_109376_); } else { this.renderOneHandedMap(p_109379_, p_109380_, p_109381_, p_109378_, humanoidarm, p_109376_, p_109377_); } diff --git a/patches/net/minecraft/client/renderer/LevelRenderer.java.patch b/patches/net/minecraft/client/renderer/LevelRenderer.java.patch index e01b57bb..82e084e8 100644 --- a/patches/net/minecraft/client/renderer/LevelRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/LevelRenderer.java.patch @@ -1,5 +1,16 @@ --- a/net/minecraft/client/renderer/LevelRenderer.java +++ b/net/minecraft/client/renderer/LevelRenderer.java +@@ -233,6 +_,10 @@ + private int rainSoundTime; + private final float[] rainSizeX = new float[1024]; + private final float[] rainSizeZ = new float[1024]; ++ /** ++ * Neo: Indicates whether outline effect post-processing was requested for the current frame outside of vanilla codepaths ++ */ ++ private boolean outlineEffectRequested = false; + + public LevelRenderer(Minecraft p_234245_, EntityRenderDispatcher p_234246_, BlockEntityRenderDispatcher p_234247_, RenderBuffers p_234248_) { + this.minecraft = p_234245_; @@ -256,6 +_,8 @@ } @@ -45,7 +56,7 @@ || p_109604_.getEntity() instanceof LivingEntity && ((LivingEntity)p_109604_.getEntity()).isSleeping() ) - && (!(entity instanceof LocalPlayer) || p_109604_.getEntity() == entity)) { -+ && (!(entity instanceof LocalPlayer) || p_109604_.getEntity() == entity || (entity == minecraft.player && !minecraft.player.isSpectator()))) { // NEO: render local player entity when it is not the camera entity ++ && (!(entity instanceof LocalPlayer) || p_109604_.getEntity() == entity || (entity == minecraft.player && !minecraft.player.isSpectator()))) { // Neo: render local player entity when it is not the camera entity this.renderedEntities++; if (entity.tickCount == 0) { entity.xOld = entity.getX(); @@ -98,7 +109,17 @@ this.blockEntityRenderDispatcher.render(blockentity, f, posestack, multibuffersource$buffersource); posestack.popPose(); } -@@ -1085,6 +_,7 @@ +@@ -1080,11 +_,17 @@ + multibuffersource$buffersource.endBatch(Sheets.hangingSignSheet()); + multibuffersource$buffersource.endBatch(Sheets.chestSheet()); + this.renderBuffers.outlineBufferSource().endOutlineBatch(); ++ // Neo: handle outline effect requests outside glowing entities ++ if (this.outlineEffectRequested) { ++ flag2 |= this.shouldShowEntityOutlines(); ++ this.outlineEffectRequested = false; ++ } + if (flag2) { + this.entityEffect.process(p_348530_.getGameTimeDeltaTicks()); this.minecraft.getMainRenderTarget().bindWrite(false); } @@ -199,7 +220,7 @@ float f = this.level.effects().getCloudHeight(); if (!Float.isNaN(f)) { float f1 = 12.0F; -@@ -2488,6 +_,23 @@ +@@ -2488,6 +_,31 @@ this.viewArea.setDirty(p_109502_, p_109503_, p_109504_, p_109505_); } @@ -219,6 +240,14 @@ + this.globalBlockEntities.forEach(blockEntityConsumer); + } + } ++ ++ /** ++ * Neo: Request outline effect post-processing to be enabled for the current frame. Must be called before block ++ * entities are done rendering, ideally early during the frame ++ */ ++ public void requestOutlineEffect() { ++ this.outlineEffectRequested = true; ++ } + public void playJukeboxSong(Holder p_350918_, BlockPos p_350830_) { if (this.level != null) { diff --git a/patches/net/minecraft/client/renderer/PanoramaRenderer.java.patch b/patches/net/minecraft/client/renderer/PanoramaRenderer.java.patch new file mode 100644 index 00000000..4111b68d --- /dev/null +++ b/patches/net/minecraft/client/renderer/PanoramaRenderer.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/client/renderer/PanoramaRenderer.java ++++ b/net/minecraft/client/renderer/PanoramaRenderer.java +@@ -30,6 +_,8 @@ + p_334063_.blit(PANORAMA_OVERLAY, 0, 0, p_333839_, p_333923_, 0.0F, 0.0F, 16, 128, 16, 128); + p_334063_.setColor(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.disableBlend(); ++ // Neo: disable depth test again to prevent issues with extended far plane values for screen layers and HUD layers ++ RenderSystem.disableDepthTest(); + } + + private static float wrap(float p_249058_, float p_249548_) { diff --git a/patches/net/minecraft/client/renderer/RenderType.java.patch b/patches/net/minecraft/client/renderer/RenderType.java.patch index c91bd869..568f0746 100644 --- a/patches/net/minecraft/client/renderer/RenderType.java.patch +++ b/patches/net/minecraft/client/renderer/RenderType.java.patch @@ -42,12 +42,13 @@ } public static RenderType lightning() { -@@ -1454,4 +_,17 @@ +@@ -1453,5 +_,17 @@ + public String toString() { return this.name; } - } ++ } + -+ // FORGE START ++ // Neo: Assign internal IDs for RenderType to be used in rendering + private int chunkLayerId = -1; + /** {@return the unique ID of this {@link RenderType} for chunk rendering purposes, or {@literal -1} if this is not a chunk {@link RenderType}} */ + public final int getChunkLayerId() { @@ -57,6 +58,5 @@ + int i = 0; + for (var layer : chunkBufferLayers()) + layer.chunkLayerId = i++; -+ } -+ // FORGE END + } } diff --git a/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch b/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch index 23c0f028..5eab04bb 100644 --- a/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch @@ -81,15 +81,16 @@ - this.vertex(p_234372_, f51, f37 + f45, f52, f33, f34, f35, f58, f60, j); - this.vertex(p_234372_, f51, f37 + f16, f52, f33, f34, f35, f58, f31, j); - this.vertex(p_234372_, f47, f37 + f16, f49, f33, f34, f35, f56, f31, j); -+ this.vertex(p_234372_, f47, f37 + f44, f49, f33, f34, f35, alpha, f56, f59, j); -+ this.vertex(p_234372_, f51, f37 + f45, f52, f33, f34, f35, alpha, f58, f60, j); -+ this.vertex(p_234372_, f51, f37 + f16, f52, f33, f34, f35, alpha, f58, f31, j); -+ this.vertex(p_234372_, f47, f37 + f16, f49, f33, f34, f35, alpha, f56, f31, j); - if (textureatlassprite2 != this.waterOverlay) { +- if (textureatlassprite2 != this.waterOverlay) { - this.vertex(p_234372_, f47, f37 + f16, f49, f33, f34, f35, f56, f31, j); - this.vertex(p_234372_, f51, f37 + f16, f52, f33, f34, f35, f58, f31, j); - this.vertex(p_234372_, f51, f37 + f45, f52, f33, f34, f35, f58, f60, j); - this.vertex(p_234372_, f47, f37 + f44, f49, f33, f34, f35, f56, f59, j); ++ this.vertex(p_234372_, f47, f37 + f44, f49, f33, f34, f35, alpha, f56, f59, j); ++ this.vertex(p_234372_, f51, f37 + f45, f52, f33, f34, f35, alpha, f58, f60, j); ++ this.vertex(p_234372_, f51, f37 + f16, f52, f33, f34, f35, alpha, f58, f31, j); ++ this.vertex(p_234372_, f47, f37 + f16, f49, f33, f34, f35, alpha, f56, f31, j); ++ if (textureatlassprite2 != atextureatlassprite[2]) { // Neo: use custom fluid's overlay texture + this.vertex(p_234372_, f47, f37 + f16, f49, f33, f34, f35, alpha, f56, f31, j); + this.vertex(p_234372_, f51, f37 + f16, f52, f33, f34, f35, alpha, f58, f31, j); + this.vertex(p_234372_, f51, f37 + f45, f52, f33, f34, f35, alpha, f58, f60, j); diff --git a/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch b/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch index 451d81cf..94bd0b01 100644 --- a/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch @@ -194,3 +194,30 @@ } private static void renderQuadList( +@@ -724,22 +_,22 @@ + int l = modelblockrenderer$cache.getLightColor(blockstate3, p_111168_, blockpos$mutableblockpos); + float f3 = modelblockrenderer$cache.getShadeBrightness(blockstate3, p_111168_, blockpos$mutableblockpos); + BlockState blockstate4 = p_111168_.getBlockState( +- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[0]).move(p_111171_) ++ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[0]) // Neo: remove move() to avoid oversampling (MC-43968) + ); + boolean flag = !blockstate4.isViewBlocking(p_111168_, blockpos$mutableblockpos) + || blockstate4.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0; + BlockState blockstate5 = p_111168_.getBlockState( +- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[1]).move(p_111171_) ++ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[1]) // Neo: remove move() to avoid oversampling (MC-43968) + ); + boolean flag1 = !blockstate5.isViewBlocking(p_111168_, blockpos$mutableblockpos) + || blockstate5.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0; + BlockState blockstate6 = p_111168_.getBlockState( +- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[2]).move(p_111171_) ++ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[2]) // Neo: remove move() to avoid oversampling (MC-43968) + ); + boolean flag2 = !blockstate6.isViewBlocking(p_111168_, blockpos$mutableblockpos) + || blockstate6.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0; + BlockState blockstate7 = p_111168_.getBlockState( +- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[3]).move(p_111171_) ++ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[3]) // Neo: remove move() to avoid oversampling (MC-43968) + ); + boolean flag3 = !blockstate7.isViewBlocking(p_111168_, blockpos$mutableblockpos) + || blockstate7.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0; diff --git a/patches/net/minecraft/client/renderer/entity/BoatRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/BoatRenderer.java.patch index 4dba862a..efa87185 100644 --- a/patches/net/minecraft/client/renderer/entity/BoatRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/entity/BoatRenderer.java.patch @@ -1,5 +1,25 @@ --- a/net/minecraft/client/renderer/entity/BoatRenderer.java +++ b/net/minecraft/client/renderer/entity/BoatRenderer.java +@@ -45,7 +_,7 @@ + private ListModel createBoatModel(EntityRendererProvider.Context p_248834_, Boat.Type p_249317_, boolean p_250093_) { + ModelLayerLocation modellayerlocation = p_250093_ ? ModelLayers.createChestBoatModelName(p_249317_) : ModelLayers.createBoatModelName(p_249317_); + ModelPart modelpart = p_248834_.bakeLayer(modellayerlocation); +- if (p_249317_ == Boat.Type.BAMBOO) { ++ if (p_249317_.isRaft()) { + return (ListModel)(p_250093_ ? new ChestRaftModel(modelpart) : new RaftModel(modelpart)); + } else { + return (ListModel)(p_250093_ ? new ChestBoatModel(modelpart) : new BoatModel(modelpart)); +@@ -54,8 +_,8 @@ + + private static ResourceLocation getTextureLocation(Boat.Type p_234566_, boolean p_234567_) { + return p_234567_ +- ? ResourceLocation.withDefaultNamespace("textures/entity/chest_boat/" + p_234566_.getName() + ".png") +- : ResourceLocation.withDefaultNamespace("textures/entity/boat/" + p_234566_.getName() + ".png"); ++ ? ResourceLocation.parse(p_234566_.getName()).withPrefix("textures/entity/chest_boat/").withSuffix(".png") ++ : ResourceLocation.parse(p_234566_.getName()).withPrefix("textures/entity/boat/").withSuffix(".png"); + } + + public void render(Boat p_113929_, float p_113930_, float p_113931_, PoseStack p_113932_, MultiBufferSource p_113933_, int p_113934_) { @@ -77,7 +_,7 @@ p_113932_.mulPose(new Quaternionf().setAngleAxis(p_113929_.getBubbleAngle(p_113931_) * (float) (Math.PI / 180.0), 1.0F, 0.0F, 1.0F)); } @@ -9,7 +29,7 @@ ResourceLocation resourcelocation = pair.getFirst(); ListModel listmodel = pair.getSecond(); p_113932_.scale(-1.0F, -1.0F, 1.0F); -@@ -96,7 +_,10 @@ +@@ -96,7 +_,12 @@ super.render(p_113929_, p_113930_, p_113931_, p_113932_, p_113933_, p_113934_); } @@ -17,7 +37,9 @@ public ResourceLocation getTextureLocation(Boat p_113927_) { - return this.boatResources.get(p_113927_.getVariant()).getFirst(); + return getModelWithLocation(p_113927_).getFirst(); - } ++ } + -+ public Pair> getModelWithLocation(Boat boat) { return this.boatResources.get(boat.getVariant()); } ++ public Pair> getModelWithLocation(Boat boat) { ++ return this.boatResources.get(boat.getVariant()); + } } diff --git a/patches/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch b/patches/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch index f9f36616..d64f1997 100644 --- a/patches/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch +++ b/patches/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch @@ -1,29 +1,7 @@ --- a/net/minecraft/client/renderer/entity/layers/ElytraLayer.java +++ b/net/minecraft/client/renderer/entity/layers/ElytraLayer.java -@@ -33,19 +_,19 @@ - } - - public void render( -- PoseStack p_116951_, -- MultiBufferSource p_116952_, -- int p_116953_, -- T p_116954_, -- float p_116955_, -- float p_116956_, -- float p_116957_, -- float p_116958_, -- float p_116959_, -- float p_116960_ -+ PoseStack p_116951_, -+ MultiBufferSource p_116952_, -+ int p_116953_, -+ T p_116954_, -+ float p_116955_, -+ float p_116956_, -+ float p_116957_, -+ float p_116958_, -+ float p_116959_, -+ float p_116960_ +@@ -45,7 +_,7 @@ + float p_116960_ ) { ItemStack itemstack = p_116954_.getItemBySlot(EquipmentSlot.CHEST); - if (itemstack.is(Items.ELYTRA)) { diff --git a/patches/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch b/patches/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch index 1b6543d3..545f030b 100644 --- a/patches/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch +++ b/patches/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch @@ -1,19 +1,26 @@ --- a/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java +++ b/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java -@@ -66,22 +_,24 @@ +@@ -66,22 +_,28 @@ if (armoritem.getEquipmentSlot() == p_117122_) { this.getParentModel().copyPropertiesTo(p_117124_); this.setPartVisibility(p_117124_, p_117122_); + net.minecraft.client.model.Model model = getArmorModelHook(p_117121_, itemstack, p_117122_, p_117124_); boolean flag = this.usesInnerModel(p_117122_); ArmorMaterial armormaterial = armoritem.getMaterial().value(); - int i = itemstack.is(ItemTags.DYEABLE) ? FastColor.ARGB32.opaque(DyedItemColor.getOrDefault(itemstack, -6265536)) : -1; +- int i = itemstack.is(ItemTags.DYEABLE) ? FastColor.ARGB32.opaque(DyedItemColor.getOrDefault(itemstack, -6265536)) : -1; - for (ArmorMaterial.Layer armormaterial$layer : armormaterial.layers()) { - int j = armormaterial$layer.dyeable() ? i : -1; +- for (ArmorMaterial.Layer armormaterial$layer : armormaterial.layers()) { +- int j = armormaterial$layer.dyeable() ? i : -1; - this.renderModel(p_117119_, p_117120_, p_117123_, p_117124_, j, armormaterial$layer.texture(flag)); -+ var texture = net.neoforged.neoforge.client.ClientHooks.getArmorTexture(p_117121_, itemstack, armormaterial$layer, flag, p_117122_); -+ this.renderModel(p_117119_, p_117120_, p_117123_, model, j, texture); ++ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions extensions = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack); ++ int fallbackColor = extensions.getDefaultDyeColor(itemstack); ++ for (int layerIdx = 0; layerIdx < armormaterial.layers().size(); layerIdx++) { ++ ArmorMaterial.Layer armormaterial$layer = armormaterial.layers().get(layerIdx); ++ int j = extensions.getArmorLayerTintColor(itemstack, p_117121_, armormaterial$layer, layerIdx, fallbackColor); ++ if (j != 0) { ++ var texture = net.neoforged.neoforge.client.ClientHooks.getArmorTexture(p_117121_, itemstack, armormaterial$layer, flag, p_117122_); ++ this.renderModel(p_117119_, p_117120_, p_117123_, model, j, texture); ++ } } ArmorTrim armortrim = itemstack.get(DataComponents.TRIM); diff --git a/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch index 8dc7ff77..3c47d4cc 100644 --- a/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch +++ b/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -5,7 +5,7 @@ void close(); } + -+ // Forge Start ++ // Neo: Exposed a pixel RGBA getter + public int getPixelRGBA(int frameIndex, int x, int y) { + if (this.contents.animatedTexture != null) { + x += this.contents.animatedTexture.getFrameX(frameIndex) * this.contents.width; diff --git a/patches/net/minecraft/client/resources/sounds/SoundInstance.java.patch b/patches/net/minecraft/client/resources/sounds/SoundInstance.java.patch index 121ac7a8..73a2251d 100644 --- a/patches/net/minecraft/client/resources/sounds/SoundInstance.java.patch +++ b/patches/net/minecraft/client/resources/sounds/SoundInstance.java.patch @@ -1,12 +1,11 @@ --- a/net/minecraft/client/resources/sounds/SoundInstance.java +++ b/net/minecraft/client/resources/sounds/SoundInstance.java -@@ -55,4 +_,10 @@ +@@ -55,4 +_,9 @@ NONE, LINEAR; } + -+ /*================================ FORGE START ================================================*/ -+ ++ // Neo: Allow SoundInstances to change source of audio stream if needed + default java.util.concurrent.CompletableFuture getStream(net.minecraft.client.sounds.SoundBufferLibrary soundBuffers, Sound sound, boolean looping) { + return soundBuffers.getStream(sound.getPath(), looping); + } diff --git a/patches/net/minecraft/client/server/LanServerPinger.java.patch b/patches/net/minecraft/client/server/LanServerPinger.java.patch index 1bff6736..d703b96a 100644 --- a/patches/net/minecraft/client/server/LanServerPinger.java.patch +++ b/patches/net/minecraft/client/server/LanServerPinger.java.patch @@ -5,7 +5,7 @@ import org.slf4j.Logger; -@OnlyIn(Dist.CLIENT) -+// NeoForge: Make this client-only class also available on the server ++// Neo: Make this client-only class also available on the server public class LanServerPinger extends Thread { private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0); private static final Logger LOGGER = LogUtils.getLogger(); diff --git a/patches/net/minecraft/client/sounds/MusicManager.java.patch b/patches/net/minecraft/client/sounds/MusicManager.java.patch new file mode 100644 index 00000000..9772e14a --- /dev/null +++ b/patches/net/minecraft/client/sounds/MusicManager.java.patch @@ -0,0 +1,19 @@ +--- a/net/minecraft/client/sounds/MusicManager.java ++++ b/net/minecraft/client/sounds/MusicManager.java +@@ -24,7 +_,15 @@ + } + + public void tick() { +- Music music = this.minecraft.getSituationalMusic(); ++ Music music = net.neoforged.neoforge.client.ClientHooks.selectMusic(this.minecraft.getSituationalMusic(), this.currentMusic); ++ if (music == null) { ++ if (this.currentMusic != null) { ++ this.stopPlaying(); ++ } ++ this.nextSongDelay = 0; ++ return; ++ } ++ + if (this.currentMusic != null) { + if (!music.getEvent().value().getLocation().equals(this.currentMusic.getLocation()) && music.replaceCurrentMusic()) { + this.minecraft.getSoundManager().stop(this.currentMusic); diff --git a/patches/net/minecraft/commands/arguments/EntityArgument.java.patch b/patches/net/minecraft/commands/arguments/EntityArgument.java.patch index 06aa5d16..d55d3e35 100644 --- a/patches/net/minecraft/commands/arguments/EntityArgument.java.patch +++ b/patches/net/minecraft/commands/arguments/EntityArgument.java.patch @@ -1,21 +1,10 @@ --- a/net/minecraft/commands/arguments/EntityArgument.java +++ b/net/minecraft/commands/arguments/EntityArgument.java -@@ -94,6 +_,10 @@ - } - } - -+ public EntitySelector parse(StringReader stringreader, boolean overridePermissions) throws CommandSyntaxException { -+ throw new RuntimeException("Not Implemented"); -+ } -+ - public EntitySelector parse(StringReader p_91451_) throws CommandSyntaxException { - int i = 0; - EntitySelectorParser entityselectorparser = new EntitySelectorParser(p_91451_); -@@ -119,7 +_,7 @@ +@@ -127,7 +_,7 @@ if (p_91482_.getSource() instanceof SharedSuggestionProvider sharedsuggestionprovider) { StringReader stringreader = new StringReader(p_91483_.getInput()); stringreader.setCursor(p_91483_.getStart()); -- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, sharedsuggestionprovider.hasPermission(2)); +- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, EntitySelectorParser.allowSelectors(sharedsuggestionprovider)); + EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, net.neoforged.neoforge.common.CommonHooks.canUseEntitySelectors(sharedsuggestionprovider)); try { diff --git a/patches/net/minecraft/commands/arguments/MessageArgument.java.patch b/patches/net/minecraft/commands/arguments/MessageArgument.java.patch index 6f7fe190..bd2531e3 100644 --- a/patches/net/minecraft/commands/arguments/MessageArgument.java.patch +++ b/patches/net/minecraft/commands/arguments/MessageArgument.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/commands/arguments/MessageArgument.java +++ b/net/minecraft/commands/arguments/MessageArgument.java -@@ -84,7 +_,7 @@ +@@ -89,7 +_,7 @@ public static record Message(String text, MessageArgument.Part[] parts) { Component resolveComponent(CommandSourceStack p_232197_) throws CommandSyntaxException { -- return this.toComponent(p_232197_, p_232197_.hasPermission(2)); +- return this.toComponent(p_232197_, EntitySelectorParser.allowSelectors(p_232197_)); + return this.toComponent(p_232197_, net.neoforged.neoforge.common.CommonHooks.canUseEntitySelectors(p_232197_)); } diff --git a/patches/net/minecraft/commands/arguments/ScoreHolderArgument.java.patch b/patches/net/minecraft/commands/arguments/ScoreHolderArgument.java.patch new file mode 100644 index 00000000..f2440333 --- /dev/null +++ b/patches/net/minecraft/commands/arguments/ScoreHolderArgument.java.patch @@ -0,0 +1,64 @@ +--- a/net/minecraft/commands/arguments/ScoreHolderArgument.java ++++ b/net/minecraft/commands/arguments/ScoreHolderArgument.java +@@ -30,10 +_,10 @@ + import net.minecraft.world.scores.ScoreHolder; + + public class ScoreHolderArgument implements ArgumentType { +- public static final SuggestionProvider SUGGEST_SCORE_HOLDERS = (p_353117_, p_353118_) -> { +- StringReader stringreader = new StringReader(p_353118_.getInput()); +- stringreader.setCursor(p_353118_.getStart()); +- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, EntitySelectorParser.allowSelectors(p_353117_.getSource())); ++ public static final SuggestionProvider SUGGEST_SCORE_HOLDERS = (p_108221_, p_108222_) -> { ++ StringReader stringreader = new StringReader(p_108222_.getInput()); ++ stringreader.setCursor(p_108222_.getStart()); ++ EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader); + + try { + entityselectorparser.parse(); +@@ -41,7 +_,7 @@ + } + + return entityselectorparser.fillSuggestions( +- p_353118_, p_171606_ -> SharedSuggestionProvider.suggest(p_353117_.getSource().getOnlinePlayerNames(), p_171606_) ++ p_108222_, p_171606_ -> SharedSuggestionProvider.suggest(p_108221_.getSource().getOnlinePlayerNames(), p_171606_) + ); + }; + private static final Collection EXAMPLES = Arrays.asList("Player", "0123", "*", "@e"); +@@ -82,30 +_,22 @@ + } + + public ScoreHolderArgument.Result parse(StringReader p_108219_) throws CommandSyntaxException { +- return this.parse(p_108219_, true); +- } +- +- public ScoreHolderArgument.Result parse(StringReader p_353125_, S p_353126_) throws CommandSyntaxException { +- return this.parse(p_353125_, EntitySelectorParser.allowSelectors(p_353126_)); +- } +- +- private ScoreHolderArgument.Result parse(StringReader p_353140_, boolean p_353127_) throws CommandSyntaxException { +- if (p_353140_.canRead() && p_353140_.peek() == '@') { +- EntitySelectorParser entityselectorparser = new EntitySelectorParser(p_353140_, p_353127_); ++ if (p_108219_.canRead() && p_108219_.peek() == '@') { ++ EntitySelectorParser entityselectorparser = new EntitySelectorParser(p_108219_); + EntitySelector entityselector = entityselectorparser.parse(); + if (!this.multiple && entityselector.getMaxResults() > 1) { +- throw EntityArgument.ERROR_NOT_SINGLE_ENTITY.createWithContext(p_353140_); ++ throw EntityArgument.ERROR_NOT_SINGLE_ENTITY.createWithContext(p_108219_); + } else { + return new ScoreHolderArgument.SelectorResult(entityselector); + } + } else { +- int i = p_353140_.getCursor(); ++ int i = p_108219_.getCursor(); + +- while (p_353140_.canRead() && p_353140_.peek() != ' ') { +- p_353140_.skip(); ++ while (p_108219_.canRead() && p_108219_.peek() != ' ') { ++ p_108219_.skip(); + } + +- String s = p_353140_.getString().substring(i, p_353140_.getCursor()); ++ String s = p_108219_.getString().substring(i, p_108219_.getCursor()); + if (s.equals("*")) { + return (p_108231_, p_108232_) -> { + Collection collection = p_108232_.get(); diff --git a/patches/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch b/patches/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch index 71b11606..6dcfc88e 100644 --- a/patches/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch +++ b/patches/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch @@ -1,6 +1,38 @@ --- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java +++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java -@@ -199,6 +_,14 @@ +@@ -21,7 +_,6 @@ + import javax.annotation.Nullable; + import net.minecraft.advancements.critereon.MinMaxBounds; + import net.minecraft.advancements.critereon.WrappedMinMaxBounds; +-import net.minecraft.commands.SharedSuggestionProvider; + import net.minecraft.commands.arguments.selector.options.EntitySelectorOptions; + import net.minecraft.network.chat.Component; + import net.minecraft.server.level.ServerPlayer; +@@ -116,19 +_,15 @@ + private boolean hasAdvancements; + private boolean usesSelectors; + ++ public EntitySelectorParser(StringReader p_121218_) { ++ this(p_121218_, true); ++ } ++ + public EntitySelectorParser(StringReader p_121220_, boolean p_121221_) { + this.reader = p_121220_; + this.allowSelectors = p_121221_; + } + +- public static boolean allowSelectors(S p_353135_) { +- if (p_353135_ instanceof SharedSuggestionProvider sharedsuggestionprovider && sharedsuggestionprovider.hasPermission(2)) { +- return true; +- } +- +- return false; +- } +- + public EntitySelector getSelector() { + AABB aabb; + if (this.deltaX == null && this.deltaY == null && this.deltaZ == null) { +@@ -204,6 +_,14 @@ }; } @@ -15,7 +47,7 @@ protected void parseSelector() throws CommandSyntaxException { this.usesSelectors = true; this.suggestions = this::suggestSelector; -@@ -476,6 +_,9 @@ +@@ -481,6 +_,9 @@ } this.reader.skip(); @@ -25,7 +57,7 @@ this.parseSelector(); } else { this.parseNameOrUUID(); -@@ -492,6 +_,7 @@ +@@ -497,6 +_,7 @@ p_121248_.suggest("@s", Component.translatable("argument.entity.selector.self")); p_121248_.suggest("@e", Component.translatable("argument.entity.selector.allEntities")); p_121248_.suggest("@n", Component.translatable("argument.entity.selector.nearestEntity")); diff --git a/patches/net/minecraft/core/Holder.java.patch b/patches/net/minecraft/core/Holder.java.patch index f5d65b8c..f4b396b6 100644 --- a/patches/net/minecraft/core/Holder.java.patch +++ b/patches/net/minecraft/core/Holder.java.patch @@ -24,32 +24,37 @@ void bindTags(Collection> p_205770_) { this.tags = Set.copyOf(p_205770_); } -@@ -233,6 +_,28 @@ +@@ -232,6 +_,33 @@ + @Override public String toString() { return "Reference{" + this.key + "=" + this.value + "}"; - } ++ } + -+ // Neo Start ++ // Neo: Add key getter that doesn't allocate ++ @Override ++ @org.jetbrains.annotations.Nullable ++ public ResourceKey getKey() { ++ return this.key; ++ } + -+ // Neo: Add DeferredHolder-compatible hashCode() and equals() overrides ++ // Neo: Add DeferredHolder-compatible hashCode() overrides + @Override + public int hashCode() { + return key().hashCode(); + } + ++ // Neo: Add DeferredHolder-compatible equals() overrides + @Override + public boolean equals(Object obj) { + if (this == obj) return true; -+ return obj instanceof Holder h && h.kind() == Kind.REFERENCE && h.unwrapKey().orElseThrow() == this.key(); ++ return obj instanceof Holder h && h.kind() == Kind.REFERENCE && h.getKey() == this.key(); + } + ++ // Neo: Helper method to get the registry lookup from a holder + @Override + @org.jetbrains.annotations.Nullable + public HolderLookup.RegistryLookup unwrapLookup() { + return this.owner instanceof HolderLookup.RegistryLookup rl ? rl : null; -+ } -+ -+ // Neo End + } protected static enum Type { - STAND_ALONE, diff --git a/patches/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch b/patches/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch index 9890188f..9f0b115a 100644 --- a/patches/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch +++ b/patches/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch @@ -9,9 +9,14 @@ dispensiblecontaineritem.checkExtraContent(null, level, p_338251_, blockpos); return this.consumeWithRemainder(p_338850_, p_338251_, new ItemStack(Items.BUCKET)); } else { -@@ -282,9 +_,10 @@ - } else if (CampfireBlock.canLight(blockstate) || CandleBlock.canLight(blockstate) || CandleCakeBlock.canLight(blockstate)) { - serverlevel.setBlockAndUpdate(blockpos, blockstate.setValue(BlockStateProperties.LIT, Boolean.valueOf(true))); +@@ -279,12 +_,13 @@ + if (BaseFireBlock.canBePlacedAt(serverlevel, blockpos, direction)) { + serverlevel.setBlockAndUpdate(blockpos, BaseFireBlock.getState(serverlevel, blockpos)); + serverlevel.gameEvent(null, GameEvent.BLOCK_PLACE, blockpos); +- } else if (CampfireBlock.canLight(blockstate) || CandleBlock.canLight(blockstate) || CandleCakeBlock.canLight(blockstate)) { +- serverlevel.setBlockAndUpdate(blockpos, blockstate.setValue(BlockStateProperties.LIT, Boolean.valueOf(true))); ++ } else if (blockstate.getToolModifiedState(new net.minecraft.world.item.context.UseOnContext(p_338494_.level(), null, net.minecraft.world.InteractionHand.MAIN_HAND, p_338444_, new net.minecraft.world.phys.BlockHitResult(blockpos.getCenter(), direction.getOpposite(), blockpos, false)), net.neoforged.neoforge.common.ItemAbilities.FIRESTARTER_LIGHT, false) instanceof BlockState blockstate2) { ++ serverlevel.setBlockAndUpdate(blockpos, blockstate2); serverlevel.gameEvent(null, GameEvent.BLOCK_CHANGE, blockpos); - } else if (blockstate.getBlock() instanceof TntBlock) { - TntBlock.explode(serverlevel, blockpos); diff --git a/patches/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java.patch b/patches/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java.patch new file mode 100644 index 00000000..0ab82269 --- /dev/null +++ b/patches/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java.patch @@ -0,0 +1,26 @@ +--- a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java ++++ b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java +@@ -24,7 +_,7 @@ + ServerLevel serverlevel = p_302443_.level(); + if (!serverlevel.isClientSide()) { + BlockPos blockpos = p_302443_.pos().relative(p_302443_.state().getValue(DispenserBlock.FACING)); +- this.setSuccess(tryShearBeehive(serverlevel, blockpos) || tryShearLivingEntity(serverlevel, blockpos)); ++ this.setSuccess(net.neoforged.neoforge.common.CommonHooks.tryDispenseShearsHarvestBlock(p_302443_, p_123581_, serverlevel, blockpos) || tryShearBeehive(serverlevel, blockpos) || tryShearLivingEntity(serverlevel, blockpos, p_123581_)); + if (this.isSuccess()) { + p_123581_.hurtAndBreak(1, serverlevel, null, p_348118_ -> { + }); +@@ -51,10 +_,11 @@ + return false; + } + +- private static boolean tryShearLivingEntity(ServerLevel p_123583_, BlockPos p_123584_) { ++ private static boolean tryShearLivingEntity(ServerLevel p_123583_, BlockPos p_123584_, ItemStack stack) { + for (LivingEntity livingentity : p_123583_.getEntitiesOfClass(LivingEntity.class, new AABB(p_123584_), EntitySelector.NO_SPECTATORS)) { +- if (livingentity instanceof Shearable shearable && shearable.readyForShearing()) { +- shearable.shear(SoundSource.BLOCKS); ++ if (livingentity instanceof net.neoforged.neoforge.common.IShearable shearable && shearable.isShearable(null, stack, p_123583_, p_123584_)) { ++ shearable.onSheared(null, stack, p_123583_, p_123584_) ++ .forEach(drop -> shearable.spawnShearedDrop(p_123583_, p_123584_, drop)); + p_123583_.gameEvent(null, GameEvent.SHEAR, p_123584_); + return true; + } diff --git a/patches/net/minecraft/core/registries/BuiltInRegistries.java.patch b/patches/net/minecraft/core/registries/BuiltInRegistries.java.patch index e693d8f2..0a13f1ab 100644 --- a/patches/net/minecraft/core/registries/BuiltInRegistries.java.patch +++ b/patches/net/minecraft/core/registries/BuiltInRegistries.java.patch @@ -1,13 +1,101 @@ --- a/net/minecraft/core/registries/BuiltInRegistries.java +++ b/net/minecraft/core/registries/BuiltInRegistries.java -@@ -356,6 +_,10 @@ - }); - } +@@ -163,7 +_,7 @@ + public static final Registry> POSITION_SOURCE_TYPE = registerSimple( + Registries.POSITION_SOURCE_TYPE, p_259113_ -> PositionSourceType.BLOCK + ); +- public static final Registry> COMMAND_ARGUMENT_TYPE = registerSimple(Registries.COMMAND_ARGUMENT_TYPE, ArgumentTypeInfos::bootstrap); ++ public static final Registry> COMMAND_ARGUMENT_TYPE = registerSimple(Registries.COMMAND_ARGUMENT_TYPE, (RegistryBootstrap)ArgumentTypeInfos::bootstrap); + public static final Registry> STAT_TYPE = registerSimple(Registries.STAT_TYPE, p_259967_ -> Stats.ITEM_USED); + public static final DefaultedRegistry VILLAGER_TYPE = registerDefaulted(Registries.VILLAGER_TYPE, "plains", p_259473_ -> VillagerType.PLAINS); + public static final DefaultedRegistry VILLAGER_PROFESSION = registerDefaulted( +@@ -232,18 +_,18 @@ + public static final Registry> FEATURE_SIZE_TYPE = registerSimple( + Registries.FEATURE_SIZE_TYPE, p_259370_ -> FeatureSizeType.TWO_LAYERS_FEATURE_SIZE + ); +- public static final Registry> BIOME_SOURCE = registerSimple(Registries.BIOME_SOURCE, BiomeSources::bootstrap); +- public static final Registry> CHUNK_GENERATOR = registerSimple(Registries.CHUNK_GENERATOR, ChunkGenerators::bootstrap); ++ public static final Registry> BIOME_SOURCE = registerSimple(Registries.BIOME_SOURCE, (RegistryBootstrap)BiomeSources::bootstrap); ++ public static final Registry> CHUNK_GENERATOR = registerSimple(Registries.CHUNK_GENERATOR, (RegistryBootstrap)ChunkGenerators::bootstrap); + public static final Registry> MATERIAL_CONDITION = registerSimple( +- Registries.MATERIAL_CONDITION, SurfaceRules.ConditionSource::bootstrap ++ Registries.MATERIAL_CONDITION, (RegistryBootstrap)SurfaceRules.ConditionSource::bootstrap + ); + public static final Registry> MATERIAL_RULE = registerSimple( +- Registries.MATERIAL_RULE, SurfaceRules.RuleSource::bootstrap ++ Registries.MATERIAL_RULE, (RegistryBootstrap)SurfaceRules.RuleSource::bootstrap + ); + public static final Registry> DENSITY_FUNCTION_TYPE = registerSimple( +- Registries.DENSITY_FUNCTION_TYPE, DensityFunctions::bootstrap ++ Registries.DENSITY_FUNCTION_TYPE, (RegistryBootstrap)DensityFunctions::bootstrap + ); +- public static final Registry> BLOCK_TYPE = registerSimple(Registries.BLOCK_TYPE, BlockTypes::bootstrap); ++ public static final Registry> BLOCK_TYPE = registerSimple(Registries.BLOCK_TYPE, (RegistryBootstrap)BlockTypes::bootstrap); + public static final Registry> STRUCTURE_PROCESSOR = registerSimple( + Registries.STRUCTURE_PROCESSOR, p_259305_ -> StructureProcessorType.BLOCK_IGNORE + ); +@@ -251,41 +_,41 @@ + Registries.STRUCTURE_POOL_ELEMENT, p_259361_ -> StructurePoolElementType.EMPTY + ); + public static final Registry> POOL_ALIAS_BINDING_TYPE = registerSimple( +- Registries.POOL_ALIAS_BINDING, PoolAliasBindings::bootstrap ++ Registries.POOL_ALIAS_BINDING, (RegistryBootstrap)PoolAliasBindings::bootstrap + ); + public static final Registry CAT_VARIANT = registerSimple(Registries.CAT_VARIANT, CatVariant::bootstrap); + public static final Registry FROG_VARIANT = registerSimple(Registries.FROG_VARIANT, FrogVariant::bootstrap); + public static final Registry INSTRUMENT = registerSimple(Registries.INSTRUMENT, Instruments::bootstrap); + public static final Registry DECORATED_POT_PATTERN = registerSimple(Registries.DECORATED_POT_PATTERN, DecoratedPotPatterns::bootstrap); + public static final Registry CREATIVE_MODE_TAB = registerSimple(Registries.CREATIVE_MODE_TAB, CreativeModeTabs::bootstrap); +- public static final Registry> TRIGGER_TYPES = registerSimple(Registries.TRIGGER_TYPE, CriteriaTriggers::bootstrap); +- public static final Registry> NUMBER_FORMAT_TYPE = registerSimple(Registries.NUMBER_FORMAT_TYPE, NumberFormatTypes::bootstrap); ++ public static final Registry> TRIGGER_TYPES = registerSimple(Registries.TRIGGER_TYPE, (RegistryBootstrap)CriteriaTriggers::bootstrap); ++ public static final Registry> NUMBER_FORMAT_TYPE = registerSimple(Registries.NUMBER_FORMAT_TYPE, (RegistryBootstrap)NumberFormatTypes::bootstrap); + public static final Registry ARMOR_MATERIAL = registerSimple(Registries.ARMOR_MATERIAL, ArmorMaterials::bootstrap); +- public static final Registry> DATA_COMPONENT_TYPE = registerSimple(Registries.DATA_COMPONENT_TYPE, DataComponents::bootstrap); ++ public static final Registry> DATA_COMPONENT_TYPE = registerSimple(Registries.DATA_COMPONENT_TYPE, (RegistryBootstrap)DataComponents::bootstrap); + public static final Registry> ENTITY_SUB_PREDICATE_TYPE = registerSimple( +- Registries.ENTITY_SUB_PREDICATE_TYPE, EntitySubPredicates::bootstrap ++ Registries.ENTITY_SUB_PREDICATE_TYPE, (RegistryBootstrap)EntitySubPredicates::bootstrap + ); + public static final Registry> ITEM_SUB_PREDICATE_TYPE = registerSimple( +- Registries.ITEM_SUB_PREDICATE_TYPE, ItemSubPredicates::bootstrap ++ Registries.ITEM_SUB_PREDICATE_TYPE, (RegistryBootstrap)ItemSubPredicates::bootstrap + ); + public static final Registry MAP_DECORATION_TYPE = registerSimple(Registries.MAP_DECORATION_TYPE, MapDecorationTypes::bootstrap); + public static final Registry> ENCHANTMENT_EFFECT_COMPONENT_TYPE = registerSimple( +- Registries.ENCHANTMENT_EFFECT_COMPONENT_TYPE, EnchantmentEffectComponents::bootstrap ++ Registries.ENCHANTMENT_EFFECT_COMPONENT_TYPE, (RegistryBootstrap)EnchantmentEffectComponents::bootstrap + ); + public static final Registry> ENCHANTMENT_LEVEL_BASED_VALUE_TYPE = registerSimple( +- Registries.ENCHANTMENT_LEVEL_BASED_VALUE_TYPE, LevelBasedValue::bootstrap ++ Registries.ENCHANTMENT_LEVEL_BASED_VALUE_TYPE, (RegistryBootstrap)LevelBasedValue::bootstrap + ); + public static final Registry> ENCHANTMENT_ENTITY_EFFECT_TYPE = registerSimple( +- Registries.ENCHANTMENT_ENTITY_EFFECT_TYPE, EnchantmentEntityEffect::bootstrap ++ Registries.ENCHANTMENT_ENTITY_EFFECT_TYPE, (RegistryBootstrap)EnchantmentEntityEffect::bootstrap + ); + public static final Registry> ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE = registerSimple( +- Registries.ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE, EnchantmentLocationBasedEffect::bootstrap ++ Registries.ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE, (RegistryBootstrap)EnchantmentLocationBasedEffect::bootstrap + ); + public static final Registry> ENCHANTMENT_VALUE_EFFECT_TYPE = registerSimple( +- Registries.ENCHANTMENT_VALUE_EFFECT_TYPE, EnchantmentValueEffect::bootstrap ++ Registries.ENCHANTMENT_VALUE_EFFECT_TYPE, (RegistryBootstrap)EnchantmentValueEffect::bootstrap + ); + public static final Registry> ENCHANTMENT_PROVIDER_TYPE = registerSimple( +- Registries.ENCHANTMENT_PROVIDER_TYPE, EnchantmentProviderTypes::bootstrap ++ Registries.ENCHANTMENT_PROVIDER_TYPE, (RegistryBootstrap)EnchantmentProviderTypes::bootstrap + ); + public static final Registry> REGISTRY = WRITABLE_REGISTRY; -+ public static java.util.Set getVanillaRegistrationOrder() { -+ return java.util.Collections.unmodifiableSet(LOADERS.keySet()); +@@ -354,6 +_,10 @@ + Validate.notNull(p_339350_.get(resourcelocation), "Missing default of DefaultedMappedRegistry: " + resourcelocation); + } + }); + } + ++ public static java.util.Set getVanillaRegistrationOrder() { ++ return java.util.Collections.unmodifiableSet(LOADERS.keySet()); + } + @FunctionalInterface - interface RegistryBootstrap { - Object run(Registry p_260128_); diff --git a/patches/net/minecraft/data/DataProvider.java.patch b/patches/net/minecraft/data/DataProvider.java.patch index aeed3b41..24c97360 100644 --- a/patches/net/minecraft/data/DataProvider.java.patch +++ b/patches/net/minecraft/data/DataProvider.java.patch @@ -4,7 +4,7 @@ public interface DataProvider { ToIntFunction FIXED_ORDER_FIELDS = Util.make(new Object2IntOpenHashMap<>(), p_236070_ -> { -+ // NeoForge: conditions go first ++ // Neo: conditions go first + p_236070_.put("neoforge:conditions", -1); p_236070_.put("type", 0); p_236070_.put("parent", 1); diff --git a/patches/net/minecraft/data/recipes/RecipeProvider.java.patch b/patches/net/minecraft/data/recipes/RecipeProvider.java.patch index ca88e83b..ec1d44e0 100644 --- a/patches/net/minecraft/data/recipes/RecipeProvider.java.patch +++ b/patches/net/minecraft/data/recipes/RecipeProvider.java.patch @@ -23,22 +23,47 @@ RecipeProvider.this.advancementPathProvider.json(p_311794_.id()) ) ); -@@ -113,12 +_,16 @@ +@@ -107,18 +_,26 @@ + public Advancement.Builder advancement() { + return Advancement.Builder.recipeAdvancement().parent(RecipeBuilder.ROOT_RECIPE_ADVANCEMENT); + } +- } ++ }, p_324248_ + ); + return CompletableFuture.allOf(list.toArray(CompletableFuture[]::new)); } protected CompletableFuture buildAdvancement(CachedOutput p_253674_, HolderLookup.Provider p_323646_, AdvancementHolder p_301116_) { - return DataProvider.saveStable(p_253674_, p_323646_, Advancement.CODEC, p_301116_.value(), this.advancementPathProvider.json(p_301116_.id())); +- } +- +- protected abstract void buildRecipes(RecipeOutput p_301172_); +- +- protected static void generateForEnabledBlockFamilies(RecipeOutput p_301146_, FeatureFlagSet p_251836_) { + return buildAdvancement(p_253674_, p_323646_, p_301116_, new net.neoforged.neoforge.common.conditions.ICondition[0]); + } + + protected CompletableFuture buildAdvancement(CachedOutput p_253674_, HolderLookup.Provider p_323646_, AdvancementHolder p_301116_, net.neoforged.neoforge.common.conditions.ICondition... conditions) { + return DataProvider.saveStable(p_253674_, p_323646_, Advancement.CONDITIONAL_CODEC, Optional.of(new net.neoforged.neoforge.common.conditions.WithConditions<>(p_301116_.value(), conditions)), this.advancementPathProvider.json(p_301116_.id())); - } - - protected abstract void buildRecipes(RecipeOutput p_301172_); - -- protected static void generateForEnabledBlockFamilies(RecipeOutput p_301146_, FeatureFlagSet p_251836_) { ++ } ++ ++ protected void buildRecipes(RecipeOutput recipeOutput, HolderLookup.Provider holderLookup) { ++ buildRecipes(recipeOutput); ++ } ++ ++ protected void buildRecipes(RecipeOutput p_301172_) {} ++ + protected void generateForEnabledBlockFamilies(RecipeOutput p_301146_, FeatureFlagSet p_251836_) { BlockFamilies.getAllFamilies().filter(BlockFamily::shouldGenerateRecipe).forEach(p_313461_ -> generateRecipes(p_301146_, p_313461_, p_251836_)); } +@@ -611,8 +_,7 @@ + } + + protected static void waxRecipes(RecipeOutput p_301254_, FeatureFlagSet p_313879_) { +- HoneycombItem.WAXABLES +- .get() ++ net.neoforged.neoforge.common.DataMapHooks.INVERSE_WAXABLES_DATAMAP + .forEach( + (p_337490_, p_337491_) -> { + if (p_337491_.requiredFeatures().isSubsetOf(p_313879_)) { diff --git a/patches/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch b/patches/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch index 5fc14b54..53007c8f 100644 --- a/patches/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch +++ b/patches/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/registries/RegistriesDatapackGenerator.java +++ b/net/minecraft/data/registries/RegistriesDatapackGenerator.java -@@ -17,11 +_,22 @@ +@@ -17,13 +_,30 @@ import net.minecraft.resources.RegistryDataLoader; import net.minecraft.resources.ResourceKey; @@ -12,17 +12,25 @@ private final PackOutput output; private final CompletableFuture registries; + private final java.util.function.Predicate namespacePredicate; ++ private final java.util.Map, java.util.List> conditions; + @Deprecated public RegistriesDatapackGenerator(PackOutput p_256643_, CompletableFuture p_255780_) { -+ this(p_256643_, p_255780_, null); ++ this(p_256643_, p_255780_, null, java.util.Map.of()); + } + + public RegistriesDatapackGenerator(PackOutput p_256643_, CompletableFuture p_255780_, @org.jetbrains.annotations.Nullable java.util.Set modIds) { ++ this(p_256643_, p_255780_, modIds, java.util.Map.of()); ++ } ++ ++ public RegistriesDatapackGenerator(PackOutput p_256643_, CompletableFuture p_255780_, @org.jetbrains.annotations.Nullable java.util.Set modIds, java.util.Map, java.util.List> conditions) { + this.namespacePredicate = modIds == null ? namespace -> true : modIds::contains; this.registries = p_255780_; this.output = p_256643_; ++ this.conditions = conditions; } + + @Override @@ -33,8 +_,7 @@ p_326736_ -> { DynamicOps dynamicops = p_326736_.createSerializationContext(JsonOps.INSTANCE); @@ -33,7 +41,14 @@ .flatMap( p_256552_ -> this.dumpRegistryCap(p_255785_, p_326736_, dynamicops, (RegistryDataLoader.RegistryData)p_256552_).stream() ) -@@ -54,6 +_,7 @@ +@@ -48,19 +_,21 @@ + CachedOutput p_256502_, HolderLookup.Provider p_256492_, DynamicOps p_256000_, RegistryDataLoader.RegistryData p_256449_ + ) { + ResourceKey> resourcekey = p_256449_.key(); ++ var conditionalCodec = net.neoforged.neoforge.common.conditions.ConditionalOps.createConditionalCodecWithConditions(p_256449_.elementCodec()); + return p_256492_.lookup(resourcekey) + .map( + p_349921_ -> { PackOutput.PathProvider packoutput$pathprovider = this.output.createRegistryElementsPathProvider(resourcekey); return CompletableFuture.allOf( p_349921_.listElements() @@ -41,3 +56,21 @@ .map( p_256105_ -> dumpValue( packoutput$pathprovider.json(p_256105_.key().location()), + p_256502_, + p_256000_, +- p_256449_.elementCodec(), +- p_256105_.value() ++ conditionalCodec, ++ Optional.of(new net.neoforged.neoforge.common.conditions.WithConditions<>(conditions.getOrDefault(p_256105_.key(), java.util.List.of()), p_256105_.value())) + ) + ) + .toArray(CompletableFuture[]::new) +@@ -70,7 +_,7 @@ + } + + private static CompletableFuture dumpValue( +- Path p_255678_, CachedOutput p_256438_, DynamicOps p_256127_, Encoder p_255938_, E p_256590_ ++ Path p_255678_, CachedOutput p_256438_, DynamicOps p_256127_, Encoder>> p_255938_, java.util.Optional> p_256590_ + ) { + return p_255938_.encodeStart(p_256127_, p_256590_) + .mapOrElse( diff --git a/patches/net/minecraft/data/tags/TagsProvider.java.patch b/patches/net/minecraft/data/tags/TagsProvider.java.patch index f52c3bdc..7cf15ff1 100644 --- a/patches/net/minecraft/data/tags/TagsProvider.java.patch +++ b/patches/net/minecraft/data/tags/TagsProvider.java.patch @@ -108,24 +108,28 @@ return this.builders.computeIfAbsent(p_236452_.location(), p_236442_ -> TagBuilder.create()); } -@@ -127,11 +_,13 @@ +@@ -127,11 +_,19 @@ }); } - public static class TagAppender { + public static class TagAppender implements net.neoforged.neoforge.common.extensions.ITagAppenderExtension { private final TagBuilder builder; -+ private final String modId; -- protected TagAppender(TagBuilder p_256426_) { -- this.builder = p_256426_; -+ protected TagAppender(TagBuilder p_236454_, String modId) { -+ this.builder = p_236454_; + protected TagAppender(TagBuilder p_256426_) { ++ this(p_256426_, ""); ++ } ++ ++ private final String modId; ++ /** @deprecated Neo: The additional mod ID parameter is unused; use the one-parameter constructor instead. */ ++ @Deprecated(forRemoval = true, since = "1.21.1") ++ protected TagAppender(TagBuilder p_256426_, String modId) { + this.builder = p_256426_; + this.modId = modId; } public final TagsProvider.TagAppender add(ResourceKey p_256138_) { -@@ -169,6 +_,19 @@ +@@ -169,6 +_,22 @@ public TagsProvider.TagAppender addOptionalTag(ResourceLocation p_176842_) { this.builder.addOptionalTag(p_176842_); return this; @@ -136,10 +140,13 @@ + return this; + } + ++ // TODO: In 1.21.2, mark this as @ApiStatus.Internal + public TagBuilder getInternalBuilder() { + return builder; + } + ++ /** @deprecated Neo: Avoid using this method to get the mod ID, as this method will be removed in 1.21.2. */ ++ @Deprecated(forRemoval = true, since = "1.21.1") + public String getModID() { + return modId; } diff --git a/patches/net/minecraft/locale/Language.java.patch b/patches/net/minecraft/locale/Language.java.patch index 57a252d0..9f3cb451 100644 --- a/patches/net/minecraft/locale/Language.java.patch +++ b/patches/net/minecraft/locale/Language.java.patch @@ -72,7 +72,7 @@ instance = p_128115_; + } + -+ // FORGE START ++ // Neo: All helpers methods below are injected by Neo to ease modder's usage of Language + public Map getLanguageData() { return ImmutableMap.of(); } + + public @org.jetbrains.annotations.Nullable net.minecraft.network.chat.Component getComponent(String key) { diff --git a/patches/net/minecraft/network/chat/contents/EntityDataSource.java.patch b/patches/net/minecraft/network/chat/contents/EntityDataSource.java.patch new file mode 100644 index 00000000..07cce89a --- /dev/null +++ b/patches/net/minecraft/network/chat/contents/EntityDataSource.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/network/chat/contents/EntityDataSource.java ++++ b/net/minecraft/network/chat/contents/EntityDataSource.java +@@ -29,7 +_,7 @@ + @Nullable + private static EntitySelector compileSelector(String p_237336_) { + try { +- EntitySelectorParser entityselectorparser = new EntitySelectorParser(new StringReader(p_237336_), true); ++ EntitySelectorParser entityselectorparser = new EntitySelectorParser(new StringReader(p_237336_)); + return entityselectorparser.parse(); + } catch (CommandSyntaxException commandsyntaxexception) { + return null; diff --git a/patches/net/minecraft/network/chat/contents/ScoreContents.java.patch b/patches/net/minecraft/network/chat/contents/ScoreContents.java.patch new file mode 100644 index 00000000..aee59361 --- /dev/null +++ b/patches/net/minecraft/network/chat/contents/ScoreContents.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/network/chat/contents/ScoreContents.java ++++ b/net/minecraft/network/chat/contents/ScoreContents.java +@@ -40,7 +_,7 @@ + @Nullable + private static EntitySelector parseSelector(String p_237448_) { + try { +- return new EntitySelectorParser(new StringReader(p_237448_), true).parse(); ++ return new EntitySelectorParser(new StringReader(p_237448_)).parse(); + } catch (CommandSyntaxException commandsyntaxexception) { + return null; + } diff --git a/patches/net/minecraft/network/chat/contents/SelectorContents.java.patch b/patches/net/minecraft/network/chat/contents/SelectorContents.java.patch new file mode 100644 index 00000000..8969e94a --- /dev/null +++ b/patches/net/minecraft/network/chat/contents/SelectorContents.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/network/chat/contents/SelectorContents.java ++++ b/net/minecraft/network/chat/contents/SelectorContents.java +@@ -48,7 +_,7 @@ + EntitySelector entityselector = null; + + try { +- EntitySelectorParser entityselectorparser = new EntitySelectorParser(new StringReader(p_237472_), true); ++ EntitySelectorParser entityselectorparser = new EntitySelectorParser(new StringReader(p_237472_)); + entityselector = entityselectorparser.parse(); + } catch (CommandSyntaxException commandsyntaxexception) { + LOGGER.warn("Invalid selector component: {}: {}", p_237472_, commandsyntaxexception.getMessage()); diff --git a/patches/net/minecraft/recipebook/PlaceRecipe.java.patch b/patches/net/minecraft/recipebook/PlaceRecipe.java.patch deleted file mode 100644 index 1abbdfb9..00000000 --- a/patches/net/minecraft/recipebook/PlaceRecipe.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/recipebook/PlaceRecipe.java -+++ b/net/minecraft/recipebook/PlaceRecipe.java -@@ -9,7 +_,7 @@ - default void placeRecipe(int p_135409_, int p_135410_, int p_135411_, RecipeHolder p_301225_, Iterator p_135413_, int p_135414_) { - int i = p_135409_; - int j = p_135410_; -- if (p_301225_.value() instanceof ShapedRecipe shapedrecipe) { -+ if (p_301225_.value() instanceof net.neoforged.neoforge.common.crafting.IShapedRecipe shapedrecipe) { - i = shapedrecipe.getWidth(); - j = shapedrecipe.getHeight(); - } diff --git a/patches/net/minecraft/resources/FileToIdConverter.java.patch b/patches/net/minecraft/resources/FileToIdConverter.java.patch new file mode 100644 index 00000000..f9081441 --- /dev/null +++ b/patches/net/minecraft/resources/FileToIdConverter.java.patch @@ -0,0 +1,29 @@ +--- a/net/minecraft/resources/FileToIdConverter.java ++++ b/net/minecraft/resources/FileToIdConverter.java +@@ -34,4 +_,26 @@ + public Map> listMatchingResourceStacks(ResourceManager p_249881_) { + return p_249881_.listResourceStacks(this.prefix, p_248700_ -> p_248700_.getPath().endsWith(this.extension)); + } ++ ++ /** ++ * List all resources under the given namespace which match this converter ++ * ++ * @param manager The resource manager to collect the resources from ++ * @param namespace The namespace to search under ++ * @return All resources from the given namespace which match this converter ++ */ ++ public Map listMatchingResourcesFromNamespace(ResourceManager manager, String namespace) { ++ return manager.listResources(this.prefix, path -> path.getNamespace().equals(namespace) && path.getPath().endsWith(this.extension)); ++ } ++ ++ /** ++ * List all resource stacks under the given namespace which match this converter ++ * ++ * @param manager The resource manager to collect the resources from ++ * @param namespace The namespace to search under ++ * @return All resource stacks from the given namespace which match this converter ++ */ ++ public Map> listMatchingResourceStacksFromNamespace(ResourceManager manager, String namespace) { ++ return manager.listResourceStacks(this.prefix, path -> path.getNamespace().equals(namespace) && path.getPath().endsWith(this.extension)); ++ } + } diff --git a/patches/net/minecraft/resources/HolderSetCodec.java.patch b/patches/net/minecraft/resources/HolderSetCodec.java.patch index 4cdd27b3..6c9fbdae 100644 --- a/patches/net/minecraft/resources/HolderSetCodec.java.patch +++ b/patches/net/minecraft/resources/HolderSetCodec.java.patch @@ -26,7 +26,7 @@ HolderGetter holdergetter = optional.get(); - return this.registryAwareCodec - .decode(p_206696_, p_206697_) -+ // NEO: use the wrapped codec to decode custom/tag/list instead of just tag/list ++ // Neo: use the wrapped codec to decode custom/tag/list instead of just tag/list + return this.combinedCodec.decode(p_206696_, p_206697_) .flatMap( p_337522_ -> { diff --git a/patches/net/minecraft/server/MinecraftServer.java.patch b/patches/net/minecraft/server/MinecraftServer.java.patch index b7ad7c61..9cf25ce9 100644 --- a/patches/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/net/minecraft/server/MinecraftServer.java.patch @@ -210,7 +210,7 @@ } + private static final com.google.gson.Gson GSON = new com.google.gson.Gson(); -+ private String cachedServerStatus; // NEO: cache the server status json in case a client spams requests ++ private String cachedServerStatus; // Neo: cache the server status json in case a client spams requests + private void resetStatusCache(ServerStatus status) { + this.cachedServerStatus = GSON.toJson(ServerStatus.CODEC.encodeStart(com.mojang.serialization.JsonOps.INSTANCE, status) + .result().orElseThrow()); @@ -270,6 +270,29 @@ GameTestTicker.SINGLETON.tick(); } +@@ -1043,11 +_,17 @@ + } + + private void synchronizeTime(ServerLevel p_276371_) { +- this.playerList +- .broadcastAll( +- new ClientboundSetTimePacket(p_276371_.getGameTime(), p_276371_.getDayTime(), p_276371_.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)), +- p_276371_.dimension() +- ); ++ ClientboundSetTimePacket vanillaPacket = new ClientboundSetTimePacket(p_276371_.getGameTime(), p_276371_.getDayTime(), p_276371_.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)); ++ net.neoforged.neoforge.network.payload.ClientboundCustomSetTimePayload neoPacket = new net.neoforged.neoforge.network.payload.ClientboundCustomSetTimePayload(p_276371_.getGameTime(), p_276371_.getDayTime(), p_276371_.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT), p_276371_.getDayTimeFraction(), p_276371_.getDayTimePerTick()); ++ for (ServerPlayer serverplayer : playerList.getPlayers()) { ++ if (serverplayer.level().dimension() == p_276371_.dimension()) { ++ if (serverplayer.connection.hasChannel(net.neoforged.neoforge.network.payload.ClientboundCustomSetTimePayload.TYPE)) { ++ serverplayer.connection.send(neoPacket); ++ } else { ++ serverplayer.connection.send(vanillaPacket); ++ } ++ } ++ } + } + + public void forceTimeSynchronization() { @@ -1118,7 +_,7 @@ @DontObfuscate diff --git a/patches/net/minecraft/server/packs/OverlayMetadataSection.java.patch b/patches/net/minecraft/server/packs/OverlayMetadataSection.java.patch index 2e54cc86..4e52d426 100644 --- a/patches/net/minecraft/server/packs/OverlayMetadataSection.java.patch +++ b/patches/net/minecraft/server/packs/OverlayMetadataSection.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/packs/OverlayMetadataSection.java +++ b/net/minecraft/server/packs/OverlayMetadataSection.java -@@ -12,7 +_,7 @@ +@@ -12,10 +_,13 @@ public record OverlayMetadataSection(List overlays) { private static final Pattern DIR_VALIDATOR = Pattern.compile("[-_a-zA-Z0-9.]+"); private static final Codec CODEC = RecordCodecBuilder.create( @@ -9,3 +9,9 @@ .apply(p_294898_, OverlayMetadataSection::new) ); public static final MetadataSectionType TYPE = MetadataSectionType.fromCodec("overlays", CODEC); ++ // Neo: alternative metadata section that will only be loaded on neoforged. Useful for making datapacks with special ++ // logic on different modloaders, or when running on neo vs in vanilla, without having to invert the main pack and overlays ++ public static final MetadataSectionType NEOFORGE_TYPE = MetadataSectionType.fromCodec("neoforge:overlays", CODEC); + + private static DataResult validateOverlayDir(String p_296447_) { + return !DIR_VALIDATOR.matcher(p_296447_).matches() diff --git a/patches/net/minecraft/server/packs/repository/Pack.java.patch b/patches/net/minecraft/server/packs/repository/Pack.java.patch index 3649bf6b..ccd09d63 100644 --- a/patches/net/minecraft/server/packs/repository/Pack.java.patch +++ b/patches/net/minecraft/server/packs/repository/Pack.java.patch @@ -52,11 +52,18 @@ this.location = p_326123_; this.resources = p_249377_; this.metadata = p_326375_; -@@ -55,7 +_,7 @@ +@@ -55,7 +_,14 @@ PackCompatibility packcompatibility = PackCompatibility.forVersion(inclusiverange, p_326341_); OverlayMetadataSection overlaymetadatasection = packresources.getMetadataSection(OverlayMetadataSection.TYPE); List list = overlaymetadatasection != null ? overlaymetadatasection.overlaysForVersion(p_326341_) : List.of(); - pack$metadata = new Pack.Metadata(packmetadatasection.description(), packcompatibility, featureflagset, list); ++ // Neo: add `neoforge:overlays` overlays as well ++ var neoOverlays = packresources.getMetadataSection(OverlayMetadataSection.NEOFORGE_TYPE); ++ if (neoOverlays != null) { ++ list = new java.util.ArrayList<>(list); ++ list.addAll(neoOverlays.overlaysForVersion(p_326341_)); ++ list = List.copyOf(list); ++ } + pack$metadata = new Pack.Metadata(packmetadatasection.description(), packcompatibility, featureflagset, list, packresources.isHidden()); } diff --git a/patches/net/minecraft/server/players/PlayerList.java.patch b/patches/net/minecraft/server/players/PlayerList.java.patch index bb2e03ab..963108bb 100644 --- a/patches/net/minecraft/server/players/PlayerList.java.patch +++ b/patches/net/minecraft/server/players/PlayerList.java.patch @@ -103,6 +103,19 @@ this.ops.remove(p_11281_); ServerPlayer serverplayer = this.getPlayer(p_11281_.getId()); if (serverplayer != null) { +@@ -682,8 +_,12 @@ + public void sendLevelInfo(ServerPlayer p_11230_, ServerLevel p_11231_) { + WorldBorder worldborder = this.server.overworld().getWorldBorder(); + p_11230_.connection.send(new ClientboundInitializeBorderPacket(worldborder)); ++ if (p_11230_.connection.hasChannel(net.neoforged.neoforge.network.payload.ClientboundCustomSetTimePayload.TYPE)) { ++ p_11230_.connection.send(new net.neoforged.neoforge.network.payload.ClientboundCustomSetTimePayload(p_11231_.getGameTime(), p_11231_.getDayTime(), p_11231_.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT), p_11231_.getDayTimeFraction(), p_11231_.getDayTimePerTick())); ++ } else { + p_11230_.connection + .send(new ClientboundSetTimePacket(p_11231_.getGameTime(), p_11231_.getDayTime(), p_11231_.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); ++ } + p_11230_.connection.send(new ClientboundSetDefaultSpawnPositionPacket(p_11231_.getSharedSpawnPos(), p_11231_.getSharedSpawnAngle())); + if (p_11231_.isRaining()) { + p_11230_.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.START_RAINING, 0.0F)); @@ -808,13 +_,6 @@ if (serverstatscounter == null) { File file1 = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile(); diff --git a/patches/net/minecraft/stats/RecipeBookSettings.java.patch b/patches/net/minecraft/stats/RecipeBookSettings.java.patch index 4e0a5a31..19309732 100644 --- a/patches/net/minecraft/stats/RecipeBookSettings.java.patch +++ b/patches/net/minecraft/stats/RecipeBookSettings.java.patch @@ -1,13 +1,11 @@ --- a/net/minecraft/stats/RecipeBookSettings.java +++ b/net/minecraft/stats/RecipeBookSettings.java -@@ -11,7 +_,9 @@ +@@ -11,7 +_,7 @@ import net.minecraft.world.inventory.RecipeBookType; public final class RecipeBookSettings { - private static final Map> TAG_FIELDS = ImmutableMap.of( -+ -+ //PATCH 1.20.2: Turn this into an event, and make it immutable again........ -+ private static final Map> TAG_FIELDS = new java.util.HashMap<>(ImmutableMap.of( ++ private static final Map> TAG_FIELDS = net.neoforged.neoforge.common.CommonHooks.buildRecipeBookTypeTagFields(ImmutableMap.of( RecipeBookType.CRAFTING, Pair.of("isGuiOpen", "isFilteringCraftable"), RecipeBookType.FURNACE, @@ -20,13 +18,13 @@ private final Map states; private RecipeBookSettings(Map p_12730_) { -@@ -158,5 +_,9 @@ - public String toString() { - return "[open=" + this.open + ", filtering=" + this.filtering + "]"; - } -+ } -+ //FORGE -- called automatically on Enum creation - used for serialization -+ public static void addTagsForType(RecipeBookType type, String openTag, String filteringTag) { -+ TAG_FIELDS.put(type, Pair.of(openTag, filteringTag)); - } - } +@@ -54,7 +_,8 @@ + public static RecipeBookSettings read(FriendlyByteBuf p_12753_) { + Map map = Maps.newEnumMap(RecipeBookType.class); + +- for (RecipeBookType recipebooktype : RecipeBookType.values()) { ++ // Neo: filter out modded RecipeBookTypes when connected to a vanilla server ++ for (RecipeBookType recipebooktype : net.neoforged.neoforge.common.CommonHooks.getFilteredRecipeBookTypeValues()) { + boolean flag = p_12753_.readBoolean(); + boolean flag1 = p_12753_.readBoolean(); + map.put(recipebooktype, new RecipeBookSettings.TypeSettings(flag, flag1)); diff --git a/patches/net/minecraft/world/entity/LivingEntity.java.patch b/patches/net/minecraft/world/entity/LivingEntity.java.patch index 8f66e074..c0c39cc7 100644 --- a/patches/net/minecraft/world/entity/LivingEntity.java.patch +++ b/patches/net/minecraft/world/entity/LivingEntity.java.patch @@ -364,6 +364,15 @@ p_147241_ *= 1.0 - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE); if (!(p_147241_ <= 0.0)) { this.hasImpulse = true; +@@ -1484,7 +_,7 @@ + return 0.0F; + } + +- public AABB getHitbox() { ++ protected AABB getHitbox() { + AABB aabb = this.getBoundingBox(); + Entity entity = this.getVehicle(); + if (entity != null) { @@ -1521,15 +_,9 @@ } else { BlockPos blockpos = this.blockPosition(); @@ -463,6 +472,15 @@ } } +@@ -1734,7 +_,7 @@ + this.entityData.set(DATA_STINGER_COUNT_ID, p_21322_); + } + +- public int getCurrentSwingDuration() { ++ private int getCurrentSwingDuration() { + if (MobEffectUtil.hasDigSpeed(this)) { + return 6 - (1 + MobEffectUtil.getDigSpeedAmplification(this)); + } else { @@ -1747,6 +_,8 @@ } diff --git a/patches/net/minecraft/world/food/FoodProperties.java.patch b/patches/net/minecraft/world/food/FoodProperties.java.patch index d6266f15..feb3b071 100644 --- a/patches/net/minecraft/world/food/FoodProperties.java.patch +++ b/patches/net/minecraft/world/food/FoodProperties.java.patch @@ -1,5 +1,28 @@ --- a/net/minecraft/world/food/FoodProperties.java +++ b/net/minecraft/world/food/FoodProperties.java +@@ -49,6 +_,22 @@ + return (int)(this.eatSeconds * 20.0F); + } + ++ public boolean equals(Object otherObject) {// Neo: Fix MC-272643 ++ if(otherObject == this) return true; ++ if (!(otherObject instanceof FoodProperties other)) return false; ++ boolean ans = nutrition == other.nutrition && ++ saturation == other.saturation && ++ canAlwaysEat == other.canAlwaysEat && ++ eatSeconds == other.eatSeconds; ++ if (!ans) return false; ++ if (!effects.equals(other.effects)) return false; ++ ItemStack selfContainer = usingConvertsTo.orElse(null); ++ ItemStack otherContainer = other.usingConvertsTo.orElse(null); ++ if (selfContainer == otherContainer) return true; ++ if (selfContainer == null || otherContainer == null) return false; ++ return selfContainer.getCount() == otherContainer.getCount() && ItemStack.isSameItemSameComponents(selfContainer, otherContainer); ++ } ++ + public static class Builder { + private int nutrition; + private float saturationModifier; @@ -77,11 +_,18 @@ return this; } diff --git a/patches/net/minecraft/world/inventory/AbstractContainerMenu.java.patch b/patches/net/minecraft/world/inventory/AbstractContainerMenu.java.patch index 18d8e30e..6581ab64 100644 --- a/patches/net/minecraft/world/inventory/AbstractContainerMenu.java.patch +++ b/patches/net/minecraft/world/inventory/AbstractContainerMenu.java.patch @@ -81,11 +81,15 @@ public void removeSlotListener(ContainerListener p_38944_) { this.containerListeners.remove(p_38944_); } -@@ -401,6 +_,7 @@ - ItemStack itemstack10 = this.getCarried(); - p_150434_.updateTutorialInventoryAction(itemstack10, slot7.getItem(), clickaction); - if (!this.tryItemClickBehaviourOverride(p_150434_, clickaction, slot7, itemstack9, itemstack10)) { -+ if (!net.neoforged.neoforge.common.CommonHooks.onItemStackedOn(itemstack9, itemstack10, slot7, clickaction, p_150434_, createCarriedSlotAccess())) - if (itemstack9.isEmpty()) { - if (!itemstack10.isEmpty()) { - int i3 = clickaction == ClickAction.PRIMARY ? itemstack10.getCount() : 1; +@@ -511,6 +_,11 @@ + } + + private boolean tryItemClickBehaviourOverride(Player p_249615_, ClickAction p_250300_, Slot p_249384_, ItemStack p_251073_, ItemStack p_252026_) { ++ // Neo: Fire the ItemStackedOnOtherEvent, and return true if it was cancelled (meaning the event was handled). Returning true will trigger the container to stop processing further logic. ++ if (net.neoforged.neoforge.common.CommonHooks.onItemStackedOn(p_251073_, p_252026_, p_249384_, p_250300_, p_249615_, createCarriedSlotAccess())) { ++ return true; ++ } ++ + FeatureFlagSet featureflagset = p_249615_.level().enabledFeatures(); + return p_252026_.isItemEnabled(featureflagset) && p_252026_.overrideStackedOnOther(p_249384_, p_250300_, p_249615_) + ? true diff --git a/patches/net/minecraft/world/inventory/AnvilMenu.java.patch b/patches/net/minecraft/world/inventory/AnvilMenu.java.patch index 38ae222f..255c8259 100644 --- a/patches/net/minecraft/world/inventory/AnvilMenu.java.patch +++ b/patches/net/minecraft/world/inventory/AnvilMenu.java.patch @@ -30,6 +30,19 @@ if (itemstack1.isDamageableItem() && itemstack1.getItem().isValidRepairItem(itemstack, itemstack2)) { int l2 = Math.min(itemstack1.getDamageValue(), itemstack1.getMaxDamage() / 4); if (l2 <= 0) { +@@ -176,8 +_,10 @@ + int j2 = entry.getIntValue(); + j2 = i2 == j2 ? j2 + 1 : Math.max(j2, i2); + Enchantment enchantment = holder.value(); +- boolean flag1 = enchantment.canEnchant(itemstack); +- if (this.player.getAbilities().instabuild || itemstack.is(Items.ENCHANTED_BOOK)) { ++ // Neo: Respect IItemExtension#supportsEnchantment - we also delegate the logic for Enchanted Books to this method. ++ // Though we still allow creative players to combine any item with any enchantment in the anvil here. ++ boolean flag1 = itemstack.supportsEnchantment(holder); ++ if (this.player.getAbilities().instabuild) { + flag1 = true; + } + @@ -228,6 +_,7 @@ i += k; itemstack1.remove(DataComponents.CUSTOM_NAME); diff --git a/patches/net/minecraft/world/inventory/EnchantmentMenu.java.patch b/patches/net/minecraft/world/inventory/EnchantmentMenu.java.patch index 56ba5ce4..817bb84f 100644 --- a/patches/net/minecraft/world/inventory/EnchantmentMenu.java.patch +++ b/patches/net/minecraft/world/inventory/EnchantmentMenu.java.patch @@ -37,6 +37,25 @@ } for (int l = 0; l < 3; l++) { +@@ -163,14 +_,10 @@ + List list = this.getEnchantmentList(p_347276_.registryAccess(), itemstack, p_39466_, this.costs[p_39466_]); + if (!list.isEmpty()) { + p_39465_.onEnchantmentPerformed(itemstack, i); +- if (itemstack.is(Items.BOOK)) { +- itemstack2 = itemstack.transmuteCopy(Items.ENCHANTED_BOOK); +- this.enchantSlots.setItem(0, itemstack2); +- } +- +- for (EnchantmentInstance enchantmentinstance : list) { +- itemstack2.enchant(enchantmentinstance.enchantment, enchantmentinstance.level); +- } ++ // Neo: Allow items to transform themselves when enchanted, instead of relying on hardcoded transformations for Items.BOOK ++ itemstack2 = itemstack.getItem().applyEnchantments(itemstack, list); ++ this.enchantSlots.setItem(0, itemstack2); ++ net.neoforged.neoforge.common.CommonHooks.onPlayerEnchantItem(p_39465_, itemstack2, list); + + itemstack1.consume(i, p_39465_); + if (itemstack1.isEmpty()) { @@ -249,7 +_,7 @@ if (!this.moveItemStackTo(itemstack1, 2, 38, true)) { return ItemStack.EMPTY; diff --git a/patches/net/minecraft/world/inventory/RecipeBookType.java.patch b/patches/net/minecraft/world/inventory/RecipeBookType.java.patch index 067d9041..a178e91a 100644 --- a/patches/net/minecraft/world/inventory/RecipeBookType.java.patch +++ b/patches/net/minecraft/world/inventory/RecipeBookType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/inventory/RecipeBookType.java +++ b/net/minecraft/world/inventory/RecipeBookType.java -@@ -1,8 +_,20 @@ +@@ -1,8 +_,13 @@ package net.minecraft.world.inventory; -public enum RecipeBookType { @@ -11,13 +11,6 @@ BLAST_FURNACE, SMOKER; + -+ RecipeBookType() { -+ if (ordinal() >= 4) { -+ String name = this.name().toLowerCase(java.util.Locale.ROOT).replace("_", ""); -+ net.minecraft.stats.RecipeBookSettings.addTagsForType(this, "is" + name + "GuiOpen", "is" + name + "FilteringCraftable"); -+ } -+ } -+ + public static net.neoforged.fml.common.asm.enumextension.ExtensionInfo getExtensionInfo() { + return net.neoforged.fml.common.asm.enumextension.ExtensionInfo.nonExtended(RecipeBookType.class); + } diff --git a/patches/net/minecraft/world/item/ArmorItem.java.patch b/patches/net/minecraft/world/item/ArmorItem.java.patch new file mode 100644 index 00000000..5f30afe0 --- /dev/null +++ b/patches/net/minecraft/world/item/ArmorItem.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/ArmorItem.java ++++ b/net/minecraft/world/item/ArmorItem.java +@@ -49,6 +_,8 @@ + } else { + LivingEntity livingentity = list.get(0); + EquipmentSlot equipmentslot = livingentity.getEquipmentSlotForItem(p_40400_); ++ // Neo: Respect IItemExtension#canEquip in dispenseArmor ++ if (!p_40400_.canEquip(equipmentslot, livingentity)) return false; + ItemStack itemstack = p_40400_.split(1); + livingentity.setItemSlot(equipmentslot, itemstack); + if (livingentity instanceof Mob) { diff --git a/patches/net/minecraft/world/item/BlockItem.java.patch b/patches/net/minecraft/world/item/BlockItem.java.patch index a8ef2e4e..eed7cf8e 100644 --- a/patches/net/minecraft/world/item/BlockItem.java.patch +++ b/patches/net/minecraft/world/item/BlockItem.java.patch @@ -31,12 +31,14 @@ @Nullable public BlockPlaceContext updatePlacementContext(BlockPlaceContext p_40609_) { return p_40609_; -@@ -193,6 +_,10 @@ +@@ -193,6 +_,12 @@ public void registerBlocks(Map p_40607_, Item p_40608_) { p_40607_.put(this.getBlock(), p_40608_); + } + ++ /** @deprecated Neo: To be removed without replacement since registry replacement is not a feature anymore. */ ++ @Deprecated(forRemoval = true, since = "1.21.1") + public void removeFromBlockToItemMap(Map blockToItemMap, Item itemIn) { + blockToItemMap.remove(this.getBlock()); } diff --git a/patches/net/minecraft/world/item/BowItem.java.patch b/patches/net/minecraft/world/item/BowItem.java.patch index 68d21070..88e532ec 100644 --- a/patches/net/minecraft/world/item/BowItem.java.patch +++ b/patches/net/minecraft/world/item/BowItem.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/world/item/BowItem.java +++ b/net/minecraft/world/item/BowItem.java -@@ -26,7 +_,7 @@ - public void releaseUsing(ItemStack p_40667_, Level p_40668_, LivingEntity p_40669_, int p_40670_) { - if (p_40669_ instanceof Player player) { +@@ -28,6 +_,8 @@ ItemStack itemstack = player.getProjectile(p_40667_); -- if (!itemstack.isEmpty()) { -+ if (!itemstack.isEmpty()) { // Porting 1.20.5 redo EventHooks.onArrowLoose + if (!itemstack.isEmpty()) { int i = this.getUseDuration(p_40667_, p_40669_) - p_40670_; ++ i = net.neoforged.neoforge.event.EventHooks.onArrowLoose(p_40667_, p_40668_, player, i, !itemstack.isEmpty()); ++ if (i < 0) return; float f = getPowerForTime(i); if (!((double)f < 0.1)) { + List list = draw(p_40667_, itemstack, player); @@ -82,6 +_,10 @@ public InteractionResultHolder use(Level p_40672_, Player p_40673_, InteractionHand p_40674_) { ItemStack itemstack = p_40673_.getItemInHand(p_40674_); diff --git a/patches/net/minecraft/world/item/DyeColor.java.patch b/patches/net/minecraft/world/item/DyeColor.java.patch index cb8e8005..641da941 100644 --- a/patches/net/minecraft/world/item/DyeColor.java.patch +++ b/patches/net/minecraft/world/item/DyeColor.java.patch @@ -1,29 +1,43 @@ --- a/net/minecraft/world/item/DyeColor.java +++ b/net/minecraft/world/item/DyeColor.java -@@ -43,6 +_,7 @@ +@@ -43,6 +_,8 @@ private final MapColor mapColor; private final int textureDiffuseColor; private final int fireworkColor; -+ private final net.minecraft.tags.TagKey tag; ++ private final net.minecraft.tags.TagKey dyesTag; ++ private final net.minecraft.tags.TagKey dyedTag; private final int textColor; private DyeColor(int p_41046_, String p_41047_, int p_41048_, MapColor p_285297_, int p_41050_, int p_41051_) { -@@ -50,6 +_,7 @@ +@@ -50,6 +_,8 @@ this.name = p_41047_; this.mapColor = p_285297_; this.textColor = p_41051_; -+ this.tag = net.minecraft.tags.ItemTags.create(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("c", "dyes/" + p_41047_)); ++ this.dyesTag = net.minecraft.tags.ItemTags.create(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("c", "dyes/" + p_41047_)); ++ this.dyedTag = net.minecraft.tags.ItemTags.create(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("c", "dyed/" + p_41047_)); this.textureDiffuseColor = FastColor.ARGB32.opaque(p_41048_); this.fireworkColor = p_41050_; } -@@ -102,5 +_,23 @@ +@@ -102,5 +_,35 @@ @Override public String getSerializedName() { return this.name; + } + ++ /** ++ * Gets the tag key representing the set of items which provide this dye color. ++ * @return A {@link net.minecraft.tags.TagKey} representing the set of items which provide this dye color. ++ */ + public net.minecraft.tags.TagKey getTag() { -+ return tag; ++ return dyesTag; ++ } ++ ++ /** ++ * Gets the tag key representing the set of items which are dyed with this color. ++ * @return A {@link net.minecraft.tags.TagKey} representing the set of items which are dyed with this color. ++ */ ++ public net.minecraft.tags.TagKey getDyedTag() { ++ return dyedTag; + } + + @Nullable @@ -34,7 +48,7 @@ + for (int x = 0; x < BLACK.getId(); x++) { + DyeColor color = byId(x); + if (stack.is(color.getTag())) -+ return color; ++ return color; + } + + return null; diff --git a/patches/net/minecraft/world/item/FireChargeItem.java.patch b/patches/net/minecraft/world/item/FireChargeItem.java.patch new file mode 100644 index 00000000..7e5ab3ba --- /dev/null +++ b/patches/net/minecraft/world/item/FireChargeItem.java.patch @@ -0,0 +1,32 @@ +--- a/net/minecraft/world/item/FireChargeItem.java ++++ b/net/minecraft/world/item/FireChargeItem.java +@@ -33,7 +_,8 @@ + BlockPos blockpos = p_41204_.getClickedPos(); + BlockState blockstate = level.getBlockState(blockpos); + boolean flag = false; +- if (!CampfireBlock.canLight(blockstate) && !CandleBlock.canLight(blockstate) && !CandleCakeBlock.canLight(blockstate)) { ++ BlockState blockstate2 = blockstate.getToolModifiedState(p_41204_, net.neoforged.neoforge.common.ItemAbilities.FIRESTARTER_LIGHT, false); ++ if (blockstate2 == null) { + blockpos = blockpos.relative(p_41204_.getClickedFace()); + if (BaseFireBlock.canBePlacedAt(level, blockpos, p_41204_.getHorizontalDirection())) { + this.playSound(level, blockpos); +@@ -43,7 +_,7 @@ + } + } else { + this.playSound(level, blockpos); +- level.setBlockAndUpdate(blockpos, blockstate.setValue(BlockStateProperties.LIT, Boolean.valueOf(true))); ++ level.setBlockAndUpdate(blockpos, blockstate2); + level.gameEvent(p_41204_.getPlayer(), GameEvent.BLOCK_CHANGE, blockpos); + flag = true; + } +@@ -87,5 +_,10 @@ + .power(1.0F) + .overrideDispenseEvent(1018) + .build(); ++ } ++ ++ @Override ++ public boolean canPerformAction(ItemStack stack, net.neoforged.neoforge.common.ItemAbility itemAbility) { ++ return net.neoforged.neoforge.common.ItemAbilities.DEFAULT_FIRECHARGE_ACTIONS.contains(itemAbility); + } + } diff --git a/patches/net/minecraft/world/item/FishingRodItem.java.patch b/patches/net/minecraft/world/item/FishingRodItem.java.patch index 1a36fc39..250a7e3a 100644 --- a/patches/net/minecraft/world/item/FishingRodItem.java.patch +++ b/patches/net/minecraft/world/item/FishingRodItem.java.patch @@ -12,15 +12,13 @@ } p_41290_.playSound( -@@ -65,5 +_,12 @@ +@@ -65,5 +_,10 @@ @Override public int getEnchantmentValue() { return 1; + } + -+ /* ******************** FORGE START ******************** */ -+ -+ @Override ++ @Override + public boolean canPerformAction(ItemStack stack, net.neoforged.neoforge.common.ItemAbility itemAbility) { + return net.neoforged.neoforge.common.ItemAbilities.DEFAULT_FISHING_ROD_ACTIONS.contains(itemAbility); } diff --git a/patches/net/minecraft/world/item/FlintAndSteelItem.java.patch b/patches/net/minecraft/world/item/FlintAndSteelItem.java.patch new file mode 100644 index 00000000..3a550060 --- /dev/null +++ b/patches/net/minecraft/world/item/FlintAndSteelItem.java.patch @@ -0,0 +1,32 @@ +--- a/net/minecraft/world/item/FlintAndSteelItem.java ++++ b/net/minecraft/world/item/FlintAndSteelItem.java +@@ -29,7 +_,8 @@ + Level level = p_41297_.getLevel(); + BlockPos blockpos = p_41297_.getClickedPos(); + BlockState blockstate = level.getBlockState(blockpos); +- if (!CampfireBlock.canLight(blockstate) && !CandleBlock.canLight(blockstate) && !CandleCakeBlock.canLight(blockstate)) { ++ BlockState blockstate2 = blockstate.getToolModifiedState(p_41297_, net.neoforged.neoforge.common.ItemAbilities.FIRESTARTER_LIGHT, false); ++ if (blockstate2 == null) { + BlockPos blockpos1 = blockpos.relative(p_41297_.getClickedFace()); + if (BaseFireBlock.canBePlacedAt(level, blockpos1, p_41297_.getHorizontalDirection())) { + level.playSound(player, blockpos1, SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, level.getRandom().nextFloat() * 0.4F + 0.8F); +@@ -48,7 +_,7 @@ + } + } else { + level.playSound(player, blockpos, SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, level.getRandom().nextFloat() * 0.4F + 0.8F); +- level.setBlock(blockpos, blockstate.setValue(BlockStateProperties.LIT, Boolean.valueOf(true)), 11); ++ level.setBlock(blockpos, blockstate2, 11); + level.gameEvent(player, GameEvent.BLOCK_CHANGE, blockpos); + if (player != null) { + p_41297_.getItemInHand().hurtAndBreak(1, player, LivingEntity.getSlotForHand(p_41297_.getHand())); +@@ -56,5 +_,10 @@ + + return InteractionResult.sidedSuccess(level.isClientSide()); + } ++ } ++ ++ @Override ++ public boolean canPerformAction(ItemStack stack, net.neoforged.neoforge.common.ItemAbility itemAbility) { ++ return net.neoforged.neoforge.common.ItemAbilities.DEFAULT_FLINT_ACTIONS.contains(itemAbility); + } + } diff --git a/patches/net/minecraft/world/item/HoneycombItem.java.patch b/patches/net/minecraft/world/item/HoneycombItem.java.patch new file mode 100644 index 00000000..46a6d312 --- /dev/null +++ b/patches/net/minecraft/world/item/HoneycombItem.java.patch @@ -0,0 +1,33 @@ +--- a/net/minecraft/world/item/HoneycombItem.java ++++ b/net/minecraft/world/item/HoneycombItem.java +@@ -20,6 +_,10 @@ + import net.minecraft.world.level.gameevent.GameEvent; + + public class HoneycombItem extends Item implements SignApplicator { ++ /** ++ * @deprecated Neo: Use the {@link net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps#WAXABLES data map}, this field will be ignored in a future version ++ */ ++ @Deprecated + public static final Supplier> WAXABLES = Suppliers.memoize( + () -> ImmutableBiMap.builder() + .put(Blocks.COPPER_BLOCK, Blocks.WAXED_COPPER_BLOCK) +@@ -60,6 +_,10 @@ + .put(Blocks.OXIDIZED_COPPER_BULB, Blocks.WAXED_OXIDIZED_COPPER_BULB) + .build() + ); ++ /** ++ * @deprecated Use the {@link net.neoforged.neoforge.common.DataMapHooks#INVERSE_WAXABLES_DATAMAP inverse map} generated from the data map, this field will be ignored in a future version ++ */ ++ @Deprecated + public static final Supplier> WAX_OFF_BY_BLOCK = Suppliers.memoize(() -> WAXABLES.get().inverse()); + + public HoneycombItem(Item.Properties p_150867_) { +@@ -87,7 +_,7 @@ + } + + public static Optional getWaxed(BlockState p_150879_) { +- return Optional.ofNullable(WAXABLES.get().get(p_150879_.getBlock())).map(p_150877_ -> p_150877_.withPropertiesOf(p_150879_)); ++ return Optional.ofNullable(net.neoforged.neoforge.common.DataMapHooks.getBlockWaxed(p_150879_.getBlock())).map(p_150877_ -> p_150877_.withPropertiesOf(p_150879_)); + } + + @Override diff --git a/patches/net/minecraft/world/item/Item.java.patch b/patches/net/minecraft/world/item/Item.java.patch index 2ed18265..4054c635 100644 --- a/patches/net/minecraft/world/item/Item.java.patch +++ b/patches/net/minecraft/world/item/Item.java.patch @@ -12,7 +12,7 @@ public static final ResourceLocation BASE_ATTACK_DAMAGE_ID = ResourceLocation.withDefaultNamespace("base_attack_damage"); public static final ResourceLocation BASE_ATTACK_SPEED_ID = ResourceLocation.withDefaultNamespace("base_attack_speed"); public static final int DEFAULT_MAX_STACK_SIZE = 64; -@@ -89,12 +_,14 @@ +@@ -89,12 +_,13 @@ this.components = p_41383_.buildAndValidateComponents(); this.craftingRemainingItem = p_41383_.craftingRemainingItem; this.requiredFeatures = p_41383_.requiredFeatures; @@ -24,7 +24,6 @@ } } + this.canRepair = p_41383_.canRepair; -+ initClient(); } @Deprecated @@ -143,36 +142,18 @@ } public ItemStack getDefaultInstance() { -@@ -341,13 +_,40 @@ +@@ -341,13 +_,22 @@ return this.requiredFeatures; } - public static class Properties { -+ // NEO START -+ private Object renderProperties; -+ -+ /* -+ DO NOT CALL, IT WILL DISAPPEAR IN THE FUTURE -+ Call RenderProperties.get instead -+ */ -+ public Object getRenderPropertiesInternal() { -+ return renderProperties; -+ } -+ -+ private void initClient() { -+ // Minecraft instance isn't available in datagen, so don't call initializeClient if in datagen -+ if (net.neoforged.fml.loading.FMLEnvironment.dist == net.neoforged.api.distmarker.Dist.CLIENT && !net.neoforged.neoforge.data.loading.DatagenModLoader.isRunningDataGen()) { -+ initializeClient(properties -> { -+ if (properties == this) -+ throw new IllegalStateException("Don't extend IItemRenderProperties in your item, use an anonymous class instead."); -+ this.renderProperties = properties; -+ }); -+ } -+ } -+ ++ /** ++ * Neo: Allowing mods to define client behavior for their Items ++ * @deprecated Use {@link net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent} instead ++ */ ++ @Deprecated(forRemoval = true, since = "1.21") + public void initializeClient(java.util.function.Consumer consumer) { + } -+ // END NEO + + public static class Properties implements net.neoforged.neoforge.common.extensions.IItemPropertiesExtensions { private static final Interner COMPONENT_INTERNER = Interners.newStrongInterner(); @@ -215,3 +196,30 @@ if (datacomponentmap.has(DataComponents.DAMAGE) && datacomponentmap.getOrDefault(DataComponents.MAX_STACK_SIZE, 1) > 1) { throw new IllegalStateException("Item cannot have both durability and be stackable"); } else { +@@ -441,6 +_,14 @@ + @Nullable + MapItemSavedData mapData(MapId p_339670_); + ++ /** ++ * Neo: Returns the level if it's available. ++ */ ++ @Nullable ++ default Level level() { ++ return null; ++ } ++ + static Item.TooltipContext of(@Nullable final Level p_339599_) { + return p_339599_ == null ? EMPTY : new Item.TooltipContext() { + @Override +@@ -456,6 +_,11 @@ + @Override + public MapItemSavedData mapData(MapId p_339628_) { + return p_339599_.getMapData(p_339628_); ++ } ++ ++ @Override ++ public Level level() { ++ return p_339599_; + } + }; + } diff --git a/patches/net/minecraft/world/item/ItemStack.java.patch b/patches/net/minecraft/world/item/ItemStack.java.patch index d7f1a13a..4c1f77b5 100644 --- a/patches/net/minecraft/world/item/ItemStack.java.patch +++ b/patches/net/minecraft/world/item/ItemStack.java.patch @@ -29,23 +29,19 @@ } public boolean is(HolderSet p_298683_) { -@@ -351,13 +_,30 @@ +@@ -351,13 +_,26 @@ } public InteractionResult useOn(UseOnContext p_41662_) { -+ if (p_41662_.getPlayer() != null) { // TODO 1.20.5: Make event accept nullable player, and remove this check. -+ var e = net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent(p_41662_, net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent.UsePhase.ITEM_AFTER_BLOCK)); -+ if (e.isCanceled()) return e.getCancellationResult().result(); -+ } ++ var e = net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent(p_41662_, net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent.UsePhase.ITEM_AFTER_BLOCK)); ++ if (e.isCanceled()) return e.getCancellationResult().result(); + if (!p_41662_.getLevel().isClientSide) return net.neoforged.neoforge.common.CommonHooks.onPlaceItemIntoWorld(p_41662_); + return onItemUse(p_41662_, (c) -> getItem().useOn(p_41662_)); + } + + public InteractionResult onItemUseFirst(UseOnContext p_41662_) { -+ if (p_41662_.getPlayer() != null) { // TODO 1.20.5: Make event accept nullable player, and remove this check. -+ var e = net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent(p_41662_, net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent.UsePhase.ITEM_BEFORE_BLOCK)); -+ if (e.isCanceled()) return e.getCancellationResult().result(); -+ } ++ var e = net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent(p_41662_, net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent.UsePhase.ITEM_BEFORE_BLOCK)); ++ if (e.isCanceled()) return e.getCancellationResult().result(); + return onItemUse(p_41662_, (c) -> getItem().onItemUseFirst(this, p_41662_)); + } + @@ -61,6 +57,26 @@ if (player != null && interactionresult.indicateItemUse()) { player.awardStat(Stats.ITEM_USED.get(item)); } +@@ -382,7 +_,8 @@ + if (this.isEmpty()) { + throw new IllegalStateException("Cannot encode empty ItemStack"); + } else { +- return CODEC.encode(this, p_331900_.createSerializationContext(NbtOps.INSTANCE), p_330830_).getOrThrow(); ++ // Neo: Logs extra information about this ItemStack on error ++ return net.neoforged.neoforge.common.util.DataComponentUtil.wrapEncodingExceptions(this, CODEC, p_331900_, p_330830_); + } + } + +@@ -390,7 +_,8 @@ + if (this.isEmpty()) { + throw new IllegalStateException("Cannot encode empty ItemStack"); + } else { +- return CODEC.encodeStart(p_332160_.createSerializationContext(NbtOps.INSTANCE), this).getOrThrow(); ++ // Neo: Logs extra information about this ItemStack on error ++ return net.neoforged.neoforge.common.util.DataComponentUtil.wrapEncodingExceptions(this, CODEC, p_332160_); + } + } + @@ -399,7 +_,7 @@ } @@ -226,3 +242,11 @@ public void onDestroyed(ItemEntity p_150925_) { this.getItem().onDestroyed(p_150925_); } +@@ -1031,6 +_,7 @@ + } + + public boolean canBeHurtBy(DamageSource p_335431_) { ++ if (!getItem().canBeHurtBy(this, p_335431_)) return false; + return !this.has(DataComponents.FIRE_RESISTANT) || !p_335431_.is(DamageTypeTags.IS_FIRE); + } + } diff --git a/patches/net/minecraft/world/item/Items.java.patch b/patches/net/minecraft/world/item/Items.java.patch index 64125c3d..5967553b 100644 --- a/patches/net/minecraft/world/item/Items.java.patch +++ b/patches/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 -@@ -2092,11 +_,23 @@ +@@ -2092,11 +_,25 @@ } public static Item registerBlock(Block p_252092_, Block... p_248886_) { @@ -17,6 +17,8 @@ - for (Block block : p_248886_) { - Item.BY_BLOCK.put(block, blockitem); - } ++ /** @deprecated Neo: To be removed without replacement since registry replacement is not a feature anymore. */ ++ @Deprecated(forRemoval = true, since = "1.21.1") + @Override + public void removeFromBlockToItemMap(java.util.Map map, Item self) { + super.removeFromBlockToItemMap(map, self); diff --git a/patches/net/minecraft/world/item/ProjectileWeaponItem.java.patch b/patches/net/minecraft/world/item/ProjectileWeaponItem.java.patch index f38197c6..06d8d427 100644 --- a/patches/net/minecraft/world/item/ProjectileWeaponItem.java.patch +++ b/patches/net/minecraft/world/item/ProjectileWeaponItem.java.patch @@ -1,5 +1,48 @@ --- a/net/minecraft/world/item/ProjectileWeaponItem.java +++ b/net/minecraft/world/item/ProjectileWeaponItem.java +@@ -24,12 +_,42 @@ + super(p_43009_); + } + ++ /** ++ * @deprecated Use ItemStack sensitive version {@link ProjectileWeaponItem#getSupportedHeldProjectiles(ItemStack)} ++ */ ++ @Deprecated + public Predicate getSupportedHeldProjectiles() { + return this.getAllSupportedProjectiles(); + } + ++ /** ++ * @deprecated Use ItemStack sensitive version {@link ProjectileWeaponItem#getAllSupportedProjectiles(ItemStack)} ++ */ ++ @Deprecated + public abstract Predicate getAllSupportedProjectiles(); + ++ /** ++ * Override this method if the weapon stack allows special projectile that would only be used if it's in hand. ++ * The default return value is a union-predicate of {@link ProjectileWeaponItem#getAllSupportedProjectiles(ItemStack)} ++ * and {@link ProjectileWeaponItem#getSupportedHeldProjectiles()} ++ * ++ * @param stack The ProjectileWeapon stack ++ * @return A predicate that returns true for supported projectile stack in hand ++ */ ++ public Predicate getSupportedHeldProjectiles(ItemStack stack) { ++ return getAllSupportedProjectiles(stack).or(getSupportedHeldProjectiles()); ++ } ++ ++ /** ++ * Override this method if the allowed projectile is weapon stack dependent. ++ * ++ * @param stack The ProjectileWeapon stack ++ * @return A predicate that returns true for all supported projectile stack ++ */ ++ public Predicate getAllSupportedProjectiles(ItemStack stack) { ++ return getAllSupportedProjectiles(); ++ } ++ + public static ItemStack getHeldProjectile(LivingEntity p_43011_, Predicate p_43012_) { + if (p_43012_.test(p_43011_.getItemInHand(InteractionHand.OFF_HAND))) { + return p_43011_.getItemInHand(InteractionHand.OFF_HAND); @@ -92,7 +_,7 @@ abstractarrow.setCritArrow(true); } diff --git a/patches/net/minecraft/world/item/ShearsItem.java.patch b/patches/net/minecraft/world/item/ShearsItem.java.patch index f1dd49f9..6f0ad827 100644 --- a/patches/net/minecraft/world/item/ShearsItem.java.patch +++ b/patches/net/minecraft/world/item/ShearsItem.java.patch @@ -1,20 +1,38 @@ --- a/net/minecraft/world/item/ShearsItem.java +++ b/net/minecraft/world/item/ShearsItem.java -@@ -55,6 +_,27 @@ +@@ -54,20 +_,57 @@ + || p_43080_.is(BlockTags.WOOL); } - @Override ++ /** ++ * Neo: Migrate shear behavior into {@link ShearsItem#interactLivingEntity} to call into IShearable instead of relying on {@link net.minecraft.world.entity.Mob#mobInteract} ++ *

++ * To preserve vanilla behavior, this method retains the original flow shared by the various mobInteract overrides. ++ */ ++ @Override + public InteractionResult interactLivingEntity(ItemStack stack, Player player, LivingEntity entity, net.minecraft.world.InteractionHand hand) { + if (entity instanceof net.neoforged.neoforge.common.IShearable target) { -+ if (entity.level().isClientSide) return InteractionResult.CONSUME; + BlockPos pos = entity.blockPosition(); ++ boolean isClient = entity.level().isClientSide(); ++ // Check isShearable on both sides (mirrors vanilla readyForShearing()) + if (target.isShearable(player, stack, entity.level(), pos)) { -+ target.onSheared(player, stack, entity.level(), pos) -+ .forEach(drop -> target.spawnShearedDrop(entity.level(), pos, drop)); ++ // Call onSheared on both sides (mirrors vanilla shear()) ++ List drops = target.onSheared(player, stack, entity.level(), pos); ++ // Spawn drops on the server side using spawnShearedDrop to retain vanilla mob-specific behavior ++ if (!isClient) { ++ for(ItemStack drop : drops) { ++ target.spawnShearedDrop(entity.level(), pos, drop); ++ } ++ } ++ // Call GameEvent.SHEAR on both sides + entity.gameEvent(GameEvent.SHEAR, player); -+ stack.hurtAndBreak(1, player, hand == net.minecraft.world.InteractionHand.MAIN_HAND ? net.minecraft.world.entity.EquipmentSlot.MAINHAND : net.minecraft.world.entity.EquipmentSlot.OFFHAND); ++ // Damage the shear item stack by 1 on the server side ++ if (!isClient) { ++ stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand)); ++ } ++ // Return sided success if the entity was shearable ++ return InteractionResult.sidedSuccess(isClient); + } -+ return InteractionResult.SUCCESS; + } + return InteractionResult.PASS; + } @@ -24,7 +42,22 @@ + return net.neoforged.neoforge.common.ItemAbilities.DEFAULT_SHEARS_ACTIONS.contains(itemAbility); + } + -+ @Override + @Override public InteractionResult useOn(UseOnContext p_186371_) { Level level = p_186371_.getLevel(); BlockPos blockpos = p_186371_.getClickedPos(); + BlockState blockstate = level.getBlockState(blockpos); +- if (blockstate.getBlock() instanceof GrowingPlantHeadBlock growingplantheadblock && !growingplantheadblock.isMaxAge(blockstate)) { ++ BlockState blockstate1 = blockstate.getToolModifiedState(p_186371_, net.neoforged.neoforge.common.ItemAbilities.SHEARS_TRIM, false); ++ if (blockstate1 != null) { + Player player = p_186371_.getPlayer(); + ItemStack itemstack = p_186371_.getItemInHand(); + if (player instanceof ServerPlayer) { + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockpos, itemstack); + } + +- level.playSound(player, blockpos, SoundEvents.GROWING_PLANT_CROP, SoundSource.BLOCKS, 1.0F, 1.0F); +- BlockState blockstate1 = growingplantheadblock.getMaxAgeState(blockstate); + level.setBlockAndUpdate(blockpos, blockstate1); + level.gameEvent(GameEvent.BLOCK_CHANGE, blockpos, GameEvent.Context.of(p_186371_.getPlayer(), blockstate1)); + if (player != null) { diff --git a/patches/net/minecraft/world/item/ShieldItem.java.patch b/patches/net/minecraft/world/item/ShieldItem.java.patch index 77f5c321..e22dccf4 100644 --- a/patches/net/minecraft/world/item/ShieldItem.java.patch +++ b/patches/net/minecraft/world/item/ShieldItem.java.patch @@ -1,16 +1,12 @@ --- a/net/minecraft/world/item/ShieldItem.java +++ b/net/minecraft/world/item/ShieldItem.java -@@ -54,6 +_,13 @@ - return p_43092_.is(ItemTags.PLANKS) || super.isValidRepairItem(p_43091_, p_43092_); +@@ -58,4 +_,9 @@ + public EquipmentSlot getEquipmentSlot() { + return EquipmentSlot.OFFHAND; } - -+ /* ******************** FORGE START ******************** */ + + @Override + public boolean canPerformAction(ItemStack stack, net.neoforged.neoforge.common.ItemAbility itemAbility) { + return net.neoforged.neoforge.common.ItemAbilities.DEFAULT_SHIELD_ACTIONS.contains(itemAbility); + } -+ - @Override - public EquipmentSlot getEquipmentSlot() { - return EquipmentSlot.OFFHAND; + } diff --git a/patches/net/minecraft/world/item/ShovelItem.java.patch b/patches/net/minecraft/world/item/ShovelItem.java.patch index 0723dbe8..8918f698 100644 --- a/patches/net/minecraft/world/item/ShovelItem.java.patch +++ b/patches/net/minecraft/world/item/ShovelItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/ShovelItem.java +++ b/net/minecraft/world/item/ShovelItem.java -@@ -44,7 +_,7 @@ +@@ -44,18 +_,16 @@ return InteractionResult.PASS; } else { Player player = p_43119_.getPlayer(); @@ -9,6 +9,18 @@ BlockState blockstate2 = null; if (blockstate1 != null && level.getBlockState(blockpos.above()).isAir()) { level.playSound(player, blockpos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); + blockstate2 = blockstate1; +- } else if (blockstate.getBlock() instanceof CampfireBlock && blockstate.getValue(CampfireBlock.LIT)) { ++ } else if ((blockstate2 = blockstate.getToolModifiedState(p_43119_, net.neoforged.neoforge.common.ItemAbilities.SHOVEL_DOUSE, false)) != null) { + if (!level.isClientSide()) { + level.levelEvent(null, 1009, blockpos, 0); + } + +- CampfireBlock.dowse(p_43119_.getPlayer(), level, blockpos, blockstate); +- blockstate2 = blockstate.setValue(CampfireBlock.LIT, Boolean.valueOf(false)); + } + + if (blockstate2 != null) { @@ -72,5 +_,15 @@ return InteractionResult.PASS; } diff --git a/patches/net/minecraft/world/item/StandingAndWallBlockItem.java.patch b/patches/net/minecraft/world/item/StandingAndWallBlockItem.java.patch index 781b756b..c119b7fa 100644 --- a/patches/net/minecraft/world/item/StandingAndWallBlockItem.java.patch +++ b/patches/net/minecraft/world/item/StandingAndWallBlockItem.java.patch @@ -1,10 +1,12 @@ --- a/net/minecraft/world/item/StandingAndWallBlockItem.java +++ b/net/minecraft/world/item/StandingAndWallBlockItem.java -@@ -50,4 +_,9 @@ +@@ -50,4 +_,11 @@ super.registerBlocks(p_43252_, p_43253_); p_43252_.put(this.wallBlock, p_43253_); } + ++ /** @deprecated Neo: To be removed without replacement since registry replacement is not a feature anymore. */ ++ @Deprecated(forRemoval = true, since = "1.21.1") + public void removeFromBlockToItemMap(Map blockToItemMap, Item itemIn) { + super.removeFromBlockToItemMap(blockToItemMap, itemIn); + blockToItemMap.remove(this.wallBlock); diff --git a/patches/net/minecraft/world/item/TooltipFlag.java.patch b/patches/net/minecraft/world/item/TooltipFlag.java.patch new file mode 100644 index 00000000..4a7b43a2 --- /dev/null +++ b/patches/net/minecraft/world/item/TooltipFlag.java.patch @@ -0,0 +1,30 @@ +--- a/net/minecraft/world/item/TooltipFlag.java ++++ b/net/minecraft/world/item/TooltipFlag.java +@@ -8,6 +_,27 @@ + + boolean isCreative(); + ++ /** ++ * Neo: Returns the state of the Control key (as reported by Screen) on the client, or {@code false} on the server. ++ */ ++ default boolean hasControlDown() { ++ return false; ++ } ++ ++ /** ++ * Neo: Returns the state of the Shift key (as reported by Screen) on the client, or {@code false} on the server. ++ */ ++ default boolean hasShiftDown() { ++ return false; ++ } ++ ++ /** ++ * Neo: Returns the state of the Alt key (as reported by Screen) on the client, or {@code false} on the server. ++ */ ++ default boolean hasAltDown() { ++ return false; ++ } ++ + public static record Default(boolean advanced, boolean creative) implements TooltipFlag { + @Override + public boolean isAdvanced() { diff --git a/patches/net/minecraft/world/item/component/ItemContainerContents.java.patch b/patches/net/minecraft/world/item/component/ItemContainerContents.java.patch index b7234561..abf6b0d7 100644 --- a/patches/net/minecraft/world/item/component/ItemContainerContents.java.patch +++ b/patches/net/minecraft/world/item/component/ItemContainerContents.java.patch @@ -1,12 +1,11 @@ --- a/net/minecraft/world/item/component/ItemContainerContents.java +++ b/net/minecraft/world/item/component/ItemContainerContents.java -@@ -146,6 +_,39 @@ +@@ -146,6 +_,35 @@ return this.hashCode; } -+ // Neo Start -+ + /** ++ * Neo: + * {@return the number of slots in this container} + */ + public int getSlots() { @@ -14,7 +13,7 @@ + } + + /** -+ * Gets a copy of the stack at a particular slot. ++ * Neo: Gets a copy of the stack at a particular slot. + * + * @param slot The slot to check. Must be within [0, {@link #getSlots()}] + * @return A copy of the stack in that slot @@ -26,16 +25,13 @@ + } + + /** -+ * Throws {@link UnsupportedOperationException} if the provided slot index is invalid. ++ * Neo: Throws {@link UnsupportedOperationException} if the provided slot index is invalid. + */ + private void validateSlotIndex(int slot) { + if (slot < 0 || slot >= getSlots()) { + throw new UnsupportedOperationException("Slot " + slot + " not in valid range - [0," + getSlots() + ")"); + } + } -+ -+ // Neo End -+ + static record Slot(int index, ItemStack item) { public static final Codec CODEC = RecordCodecBuilder.create( diff --git a/patches/net/minecraft/world/item/crafting/Ingredient.java.patch b/patches/net/minecraft/world/item/crafting/Ingredient.java.patch index 3443d4f5..856f32ab 100644 --- a/patches/net/minecraft/world/item/crafting/Ingredient.java.patch +++ b/patches/net/minecraft/world/item/crafting/Ingredient.java.patch @@ -1,8 +1,11 @@ --- a/net/minecraft/world/item/crafting/Ingredient.java +++ b/net/minecraft/world/item/crafting/Ingredient.java -@@ -29,15 +_,54 @@ +@@ -27,17 +_,56 @@ + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.level.ItemLike; - public class Ingredient implements Predicate { +-public class Ingredient implements Predicate { ++public final class Ingredient implements Predicate { public static final Ingredient EMPTY = new Ingredient(Stream.empty()); - public static final StreamCodec CONTENTS_STREAM_CODEC = ItemStack.LIST_STREAM_CODEC - .map(p_319730_ -> fromValues(p_319730_.stream().map(Ingredient.ItemValue::new)), p_319731_ -> Arrays.asList(p_319731_.getItems())); @@ -59,7 +62,7 @@ public Ingredient(Stream p_43907_) { this.values = p_43907_.toArray(Ingredient.Value[]::new); -@@ -47,9 +_,20 @@ +@@ -47,9 +_,19 @@ this.values = p_301044_; } @@ -70,13 +73,13 @@ + public ItemStack[] getItems() { if (this.itemStacks == null) { -+ if (this.customIngredient != null) { -+ this.itemStacks = this.customIngredient.getItems() -+ .distinct()//Mimic vanilla that calls distinct on the stacks -+ .toArray(ItemStack[]::new); -+ } else { - this.itemStacks = Arrays.stream(this.values).flatMap(p_43916_ -> p_43916_.getItems().stream()).distinct().toArray(ItemStack[]::new); -+ } +- this.itemStacks = Arrays.stream(this.values).flatMap(p_43916_ -> p_43916_.getItems().stream()).distinct().toArray(ItemStack[]::new); ++ // Neo: vanilla used Stream.distinct() here which has basically no effect as ItemStack does not override hashCode() and equals(). ++ // Using ItemStackLinkedSet::createTypeAndComponentsSet instead for a real distinct result. ++ final Stream stream = this.customIngredient == null ++ ? Arrays.stream(this.values).flatMap(value -> value.getItems().stream()) ++ : this.customIngredient.getItems(); ++ this.itemStacks = stream.collect(java.util.stream.Collectors.toCollection(net.minecraft.world.item.ItemStackLinkedSet::createTypeAndComponentsSet)).toArray(ItemStack[]::new); } return this.itemStacks; @@ -178,6 +181,19 @@ @Override public boolean equals(Object p_301316_) { +@@ -156,6 +_,12 @@ + : ingredient$itemvalue.item.getItem().equals(this.item.getItem()) && ingredient$itemvalue.item.getCount() == this.item.getCount(); + } + ++ // Neo: Add a hashCode() implementation that matches equals() ++ @Override ++ public int hashCode() { ++ return 31 * item.getItem().hashCode() + item.getCount(); ++ } ++ + @Override + public Collection getItems() { + return Collections.singleton(this.item); @@ -163,10 +_,11 @@ } diff --git a/patches/net/minecraft/world/item/crafting/ShapedRecipe.java.patch b/patches/net/minecraft/world/item/crafting/ShapedRecipe.java.patch index 6d065d84..10ccf24e 100644 --- a/patches/net/minecraft/world/item/crafting/ShapedRecipe.java.patch +++ b/patches/net/minecraft/world/item/crafting/ShapedRecipe.java.patch @@ -1,14 +1,16 @@ --- a/net/minecraft/world/item/crafting/ShapedRecipe.java +++ b/net/minecraft/world/item/crafting/ShapedRecipe.java -@@ -11,7 +_,7 @@ +@@ -11,8 +_,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -public class ShapedRecipe implements CraftingRecipe { +- public final ShapedRecipePattern pattern; +public class ShapedRecipe implements CraftingRecipe, net.neoforged.neoforge.common.crafting.IShapedRecipe { - final ShapedRecipePattern pattern; ++ final ShapedRecipePattern pattern; final ItemStack result; final String group; + final CraftingBookCategory category; @@ -84,7 +_,7 @@ @Override public boolean isIncomplete() { diff --git a/patches/net/minecraft/world/item/enchantment/Enchantment.java.patch b/patches/net/minecraft/world/item/enchantment/Enchantment.java.patch index 939f9a52..9290b598 100644 --- a/patches/net/minecraft/world/item/enchantment/Enchantment.java.patch +++ b/patches/net/minecraft/world/item/enchantment/Enchantment.java.patch @@ -1,16 +1,120 @@ --- a/net/minecraft/world/item/enchantment/Enchantment.java +++ b/net/minecraft/world/item/enchantment/Enchantment.java -@@ -132,6 +_,10 @@ +@@ -124,6 +_,10 @@ + return map; + } + ++ /** ++ * @deprecated Neo: Use {@link ItemStack#supportsEnchantment(Holder)} ++ */ ++ @Deprecated + public HolderSet getSupportedItems() { + return this.definition.supportedItems(); + } +@@ -132,10 +_,20 @@ return this.definition.slots().stream().anyMatch(p_345027_ -> p_345027_.test(p_345146_)); } + /** + * @deprecated Neo: Use {@link ItemStack#isPrimaryItemFor(Holder)} ++ * ++ * This method does not respect {@link ItemStack#supportsEnchantment(Holder)} since the {@link Holder} is not available, which makes the result of calling it invalid. + */ + @Deprecated public boolean isPrimaryItem(ItemStack p_336088_) { return this.isSupportedItem(p_336088_) && (this.definition.primaryItems.isEmpty() || p_336088_.is(this.definition.primaryItems.get())); } + ++ /** ++ * @deprecated Neo: Use {@link ItemStack#supportsEnchantment(Holder)} ++ */ ++ @Deprecated + public boolean isSupportedItem(ItemStack p_344865_) { + return p_344865_.is(this.definition.supportedItems); + } +@@ -188,6 +_,10 @@ + return mutablecomponent; + } + ++ /** ++ * @deprecated Neo: Use {@link ItemStack#supportsEnchantment(Holder)} ++ */ ++ @Deprecated + public boolean canEnchant(ItemStack p_44689_) { + return this.definition.supportedItems().contains(p_44689_.getItemHolder()); + } +@@ -355,7 +_,7 @@ + ); + } + +- private void modifyItemFilteredCount( ++ public void modifyItemFilteredCount( + DataComponentType>> p_345794_, + ServerLevel p_345992_, + int p_345038_, +@@ -369,7 +_,7 @@ + ); + } + +- private void modifyEntityFilteredValue( ++ public void modifyEntityFilteredValue( + DataComponentType>> p_345986_, + ServerLevel p_345473_, + int p_345352_, +@@ -384,7 +_,7 @@ + ); + } + +- private void modifyDamageFilteredValue( ++ public void modifyDamageFilteredValue( + DataComponentType>> p_345367_, + ServerLevel p_345784_, + int p_344796_, +@@ -412,7 +_,7 @@ + return new LootContext.Builder(lootparams).create(Optional.empty()); + } + +- private static LootContext itemContext(ServerLevel p_345514_, int p_345186_, ItemStack p_344997_) { ++ public static LootContext itemContext(ServerLevel p_345514_, int p_345186_, ItemStack p_344997_) { + LootParams lootparams = new LootParams.Builder(p_345514_) + .withParameter(LootContextParams.TOOL, p_344997_) + .withParameter(LootContextParams.ENCHANTMENT_LEVEL, p_345186_) +@@ -420,7 +_,7 @@ + return new LootContext.Builder(lootparams).create(Optional.empty()); + } + +- private static LootContext locationContext(ServerLevel p_345134_, int p_346182_, Entity p_345416_, boolean p_345862_) { ++ public static LootContext locationContext(ServerLevel p_345134_, int p_346182_, Entity p_345416_, boolean p_345862_) { + LootParams lootparams = new LootParams.Builder(p_345134_) + .withParameter(LootContextParams.THIS_ENTITY, p_345416_) + .withParameter(LootContextParams.ENCHANTMENT_LEVEL, p_346182_) +@@ -430,7 +_,7 @@ + return new LootContext.Builder(lootparams).create(Optional.empty()); + } + +- private static LootContext entityContext(ServerLevel p_346134_, int p_346059_, Entity p_346146_, Vec3 p_345814_) { ++ public static LootContext entityContext(ServerLevel p_346134_, int p_346059_, Entity p_346146_, Vec3 p_345814_) { + LootParams lootparams = new LootParams.Builder(p_346134_) + .withParameter(LootContextParams.THIS_ENTITY, p_346146_) + .withParameter(LootContextParams.ENCHANTMENT_LEVEL, p_346059_) +@@ -439,7 +_,7 @@ + return new LootContext.Builder(lootparams).create(Optional.empty()); + } + +- private static LootContext blockHitContext(ServerLevel p_350329_, int p_350503_, Entity p_350451_, Vec3 p_350874_, BlockState p_350311_) { ++ public static LootContext blockHitContext(ServerLevel p_350329_, int p_350503_, Entity p_350451_, Vec3 p_350874_, BlockState p_350311_) { + LootParams lootparams = new LootParams.Builder(p_350329_) + .withParameter(LootContextParams.THIS_ENTITY, p_350451_) + .withParameter(LootContextParams.ENCHANTMENT_LEVEL, p_350503_) +@@ -449,7 +_,7 @@ + return new LootContext.Builder(lootparams).create(Optional.empty()); + } + +- private static void applyEffects(List> p_345860_, LootContext p_345578_, Consumer p_346164_) { ++ public static void applyEffects(List> p_345860_, LootContext p_345578_, Consumer p_346164_) { + for (ConditionalEffect conditionaleffect : p_345860_) { + if (conditionaleffect.matches(p_345578_)) { + p_346164_.accept(conditionaleffect.effect()); @@ -503,6 +_,15 @@ public static Enchantment.Builder enchantment(Enchantment.EnchantmentDefinition p_345873_) { return new Enchantment.Builder(p_345873_); diff --git a/patches/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch b/patches/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch index be15334e..c4589cad 100644 --- a/patches/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch +++ b/patches/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch @@ -20,8 +20,21 @@ ItemEnchantments itemenchantments = p_44845_.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); return itemenchantments.getLevel(p_346179_); } -@@ -122,6 +_,12 @@ - private static void runIterationOnItem(ItemStack p_345425_, EnchantmentHelper.EnchantmentVisitor p_345023_) { +@@ -78,7 +_,7 @@ + return p_330538_.getOrDefault(getComponentType(p_330538_), ItemEnchantments.EMPTY); + } + +- private static DataComponentType getComponentType(ItemStack p_331909_) { ++ public static DataComponentType getComponentType(ItemStack p_331909_) { + return p_331909_.is(Items.ENCHANTED_BOOK) ? DataComponents.STORED_ENCHANTMENTS : DataComponents.ENCHANTMENTS; + } + +@@ -119,19 +_,29 @@ + } + } + +- private static void runIterationOnItem(ItemStack p_345425_, EnchantmentHelper.EnchantmentVisitor p_345023_) { ++ public static void runIterationOnItem(ItemStack p_345425_, EnchantmentHelper.EnchantmentVisitor p_345023_) { ItemEnchantments itemenchantments = p_345425_.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); + // Neo: Respect gameplay-only enchantments when doing iterations @@ -33,7 +46,11 @@ for (Entry> entry : itemenchantments.entrySet()) { p_345023_.accept(entry.getKey(), entry.getIntValue()); } -@@ -132,6 +_,10 @@ + } + +- private static void runIterationOnItem( ++ public static void runIterationOnItem( + ItemStack p_44852_, EquipmentSlot p_345566_, LivingEntity p_345792_, EnchantmentHelper.EnchantmentInSlotVisitor p_345683_ ) { if (!p_44852_.isEmpty()) { ItemEnchantments itemenchantments = p_44852_.get(DataComponents.ENCHANTMENTS); @@ -44,6 +61,15 @@ if (itemenchantments != null && !itemenchantments.isEmpty()) { EnchantedItemInUse enchantediteminuse = new EnchantedItemInUse(p_44852_, p_345566_, p_345792_); +@@ -145,7 +_,7 @@ + } + } + +- private static void runIterationOnEquipment(LivingEntity p_344744_, EnchantmentHelper.EnchantmentInSlotVisitor p_345709_) { ++ public static void runIterationOnEquipment(LivingEntity p_344744_, EnchantmentHelper.EnchantmentInSlotVisitor p_345709_) { + for (EquipmentSlot equipmentslot : EquipmentSlot.values()) { + runIterationOnItem(p_344744_.getItemBySlot(equipmentslot), equipmentslot, p_344744_, p_345709_); + } @@ -417,6 +_,12 @@ public static boolean hasTag(ItemStack p_345665_, TagKey p_345928_) { ItemEnchantments itemenchantments = p_345665_.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); @@ -86,3 +112,18 @@ Enchantment enchantment = p_344478_.value(); for (int i = enchantment.getMaxLevel(); i >= enchantment.getMinLevel(); i--) { +@@ -598,12 +_,12 @@ + } + + @FunctionalInterface +- interface EnchantmentInSlotVisitor { ++ public interface EnchantmentInSlotVisitor { + void accept(Holder p_346326_, int p_346009_, EnchantedItemInUse p_345960_); + } + + @FunctionalInterface +- interface EnchantmentVisitor { ++ public interface EnchantmentVisitor { + void accept(Holder p_346050_, int p_44946_); + } + } diff --git a/patches/net/minecraft/world/level/ForcedChunksSavedData.java.patch b/patches/net/minecraft/world/level/ForcedChunksSavedData.java.patch index 5fe433a7..1de88d82 100644 --- a/patches/net/minecraft/world/level/ForcedChunksSavedData.java.patch +++ b/patches/net/minecraft/world/level/ForcedChunksSavedData.java.patch @@ -21,7 +21,7 @@ return this.chunks; + } + -+ /* ======================================== FORGE START =====================================*/ ++ // Neo: Keep track of forced loaded chunks caused by entities or blocks. + private final net.neoforged.neoforge.common.world.chunk.ForcedChunkManager.TicketTracker blockForcedChunks = new net.neoforged.neoforge.common.world.chunk.ForcedChunkManager.TicketTracker<>(); + private final net.neoforged.neoforge.common.world.chunk.ForcedChunkManager.TicketTracker entityForcedChunks = new net.neoforged.neoforge.common.world.chunk.ForcedChunkManager.TicketTracker<>(); + diff --git a/patches/net/minecraft/world/level/Level.java.patch b/patches/net/minecraft/world/level/Level.java.patch index 3bf087df..027f7bed 100644 --- a/patches/net/minecraft/world/level/Level.java.patch +++ b/patches/net/minecraft/world/level/Level.java.patch @@ -291,12 +291,10 @@ this.neighborChanged(blockstate, blockpos, p_46719_, p_46718_, false); } } -@@ -1076,6 +_,18 @@ - @Override - public BiomeManager getBiomeManager() { +@@ -1078,6 +_,18 @@ return this.biomeManager; -+ } -+ + } + + private double maxEntityRadius = 2.0D; + @Override + public double getMaxEntityRadius() { @@ -307,6 +305,47 @@ + if (value > maxEntityRadius) + maxEntityRadius = value; + return maxEntityRadius; - } - ++ } ++ public final boolean isDebug() { + return this.isDebug; + } +@@ -1118,5 +_,38 @@ + public String getSerializedName() { + return this.id; + } ++ } ++ ++ // Neo: Variable day time code ++ ++ @org.jetbrains.annotations.ApiStatus.Internal ++ public abstract void setDayTimeFraction(float dayTimeFraction); ++ ++ @org.jetbrains.annotations.ApiStatus.Internal ++ public abstract float getDayTimeFraction(); ++ ++ /** ++ * Returns the current ratio between game ticks and clock ticks. If this value is negative, no ++ * speed has been set and those two are coupled 1:1 (i.e. vanilla mode). ++ */ ++ public abstract float getDayTimePerTick(); ++ ++ /** ++ * DO NOT CALL. ++ *

++ * Use {@link net.minecraft.server.level.ServerLevel#setDayTimePerTick(float)} instead. ++ */ ++ public abstract void setDayTimePerTick(float dayTimePerTick); ++ ++ // advances the fractional daytime, returns the integer part of it ++ @org.jetbrains.annotations.ApiStatus.Internal ++ protected long advanceDaytime() { ++ if (getDayTimePerTick() < 0) { ++ return 1L; // avoid doing math (and rounding errors) if no speed has been set ++ } ++ float dayTimeStep = getDayTimeFraction() + getDayTimePerTick(); ++ long result = (long)dayTimeStep; ++ setDayTimeFraction(dayTimeStep - result); ++ return result; + } + } diff --git a/patches/net/minecraft/world/level/biome/Biome.java.patch b/patches/net/minecraft/world/level/biome/Biome.java.patch index 8d8591cb..756ca8a3 100644 --- a/patches/net/minecraft/world/level/biome/Biome.java.patch +++ b/patches/net/minecraft/world/level/biome/Biome.java.patch @@ -49,13 +49,13 @@ } public int getFogColor() { -@@ -415,4 +_,34 @@ +@@ -414,5 +_,32 @@ + public String getSerializedName() { return this.name; } - } -+ -+ // FORGE START ++ } + ++ // Neo: Grant ability to modify Biomes in specific ways such as adding new features or change temperature + private final net.neoforged.neoforge.common.world.ModifiableBiomeInfo modifiableBiomeInfo; + + /** @@ -80,7 +80,5 @@ + */ + public BiomeSpecialEffects getModifiedSpecialEffects() { + return this.modifiableBiomeInfo().get().effects(); -+ } -+ -+ // FORGE END + } } diff --git a/patches/net/minecraft/world/level/block/Block.java.patch b/patches/net/minecraft/world/level/block/Block.java.patch index c071202b..ca575a2e 100644 --- a/patches/net/minecraft/world/level/block/Block.java.patch +++ b/patches/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 -@@ -61,11 +_,12 @@ +@@ -61,11 +_,11 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.slf4j.Logger; @@ -10,12 +10,11 @@ private static final Logger LOGGER = LogUtils.getLogger(); private final Holder.Reference builtInRegistryHolder = BuiltInRegistries.BLOCK.createIntrusiveHolder(this); - public static final IdMapper BLOCK_STATE_REGISTRY = new IdMapper<>(); -+ @Deprecated //Forge: Do not use, use GameRegistry + public static final IdMapper BLOCK_STATE_REGISTRY = net.neoforged.neoforge.registries.GameData.getBlockStateIDMap(); private static final LoadingCache SHAPE_FULL_BLOCK_CACHE = CacheBuilder.newBuilder() .maximumSize(512L) .weakKeys() -@@ -186,12 +_,13 @@ +@@ -186,7 +_,7 @@ this.createBlockStateDefinition(builder); this.stateDefinition = builder.create(Block::defaultBlockState, BlockState::new); this.registerDefaultState(this.stateDefinition.any()); @@ -24,12 +23,6 @@ String s = this.getClass().getSimpleName(); if (!s.endsWith("Block")) { LOGGER.error("Block classes should end with Block and {} doesn't.", s); - } - } -+ initClient(); - } - - public static boolean isExceptionForConnection(BlockState p_152464_) { @@ -208,6 +_,8 @@ BlockState blockstate = p_152446_.getBlockState(p_152449_); if (p_152445_.skipRendering(blockstate, p_152448_)) { @@ -123,15 +116,13 @@ public boolean dropFromExplosion(Explosion p_49826_) { return true; } -@@ -485,6 +_,63 @@ +@@ -485,6 +_,43 @@ return this.stateDefinition.getPossibleStates().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), p_152459_)); } -+ /* ======================================== FORGE START =====================================*/ -+ + /** -+ * Short-lived holder of dropped item entities. -+ * ++ * Neo: Short-lived holder of dropped item entities. Used mainly for Neo hooks and event logic. ++ *

+ * When not null, records all item entities from {@link #popResource(Level, Supplier, ItemStack)} instead of adding them to the world. + */ + @Nullable @@ -139,7 +130,7 @@ + + /** + * Initializes {@link #capturedDrops}, starting the drop capture process. -+ * ++ *

+ * Must only be called on the server thread. + */ + private static void beginCapturingDrops() { @@ -148,7 +139,7 @@ + + /** + * Ends the drop capture process by setting {@link #capturedDrops} to null and returning the old list. -+ * ++ *

+ * Must only be called on the server thread. + */ + private static List stopCapturingDrops() { @@ -157,32 +148,14 @@ + return drops; + } + -+ private Object renderProperties; -+ -+ /* -+ DO NOT CALL, IT WILL DISAPPEAR IN THE FUTURE -+ Call RenderProperties.get instead ++ /** ++ * Neo: Allowing mods to define client behavior for their Blocks ++ * @deprecated Use {@link net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent} instead + */ -+ public Object getRenderPropertiesInternal() { -+ return renderProperties; -+ } -+ -+ private void initClient() { -+ // Minecraft instance isn't available in datagen, so don't call initializeClient if in datagen -+ if (net.neoforged.fml.loading.FMLEnvironment.dist == net.neoforged.api.distmarker.Dist.CLIENT && !net.neoforged.neoforge.data.loading.DatagenModLoader.isRunningDataGen()) { -+ initializeClient(properties -> { -+ if (properties == this) -+ throw new IllegalStateException("Don't extend IBlockRenderProperties in your block, use an anonymous class instead."); -+ this.renderProperties = properties; -+ }); -+ } -+ } -+ ++ @Deprecated(forRemoval = true, since = "1.21") + public void initializeClient(java.util.function.Consumer consumer) { + } + -+ /* ========================================= FORGE END ======================================*/ -+ + /** @deprecated */ @Deprecated public Holder.Reference builtInRegistryHolder() { diff --git a/patches/net/minecraft/world/level/block/Blocks.java.patch b/patches/net/minecraft/world/level/block/Blocks.java.patch index 2985e101..8a0f08a8 100644 --- a/patches/net/minecraft/world/level/block/Blocks.java.patch +++ b/patches/net/minecraft/world/level/block/Blocks.java.patch @@ -9,6 +9,25 @@ ); public static final Block DETECTOR_RAIL = register( "detector_rail", new DetectorRailBlock(BlockBehaviour.Properties.of().noCollission().strength(0.7F).sound(SoundType.METAL)) +@@ -7635,15 +_,15 @@ + return p_341578_ -> p_341578_.getValue(BlockStateProperties.WATERLOGGED) ? MapColor.WATER : p_341621_; + } + +- public static Boolean never(BlockState p_50779_, BlockGetter p_50780_, BlockPos p_50781_, EntityType p_50782_) { ++ private static Boolean never(BlockState p_50779_, BlockGetter p_50780_, BlockPos p_50781_, EntityType p_50782_) { + return false; + } + +- public static Boolean always(BlockState p_50810_, BlockGetter p_50811_, BlockPos p_50812_, EntityType p_50813_) { ++ private static Boolean always(BlockState p_50810_, BlockGetter p_50811_, BlockPos p_50812_, EntityType p_50813_) { + return true; + } + +- public static Boolean ocelotOrParrot(BlockState p_50822_, BlockGetter p_50823_, BlockPos p_50824_, EntityType p_50825_) { ++ private static Boolean ocelotOrParrot(BlockState p_50822_, BlockGetter p_50823_, BlockPos p_50824_, EntityType p_50825_) { + return p_50825_ == EntityType.OCELOT || p_50825_ == EntityType.PARROT; + } + @@ -7806,7 +_,8 @@ static { for (Block block : BuiltInRegistries.BLOCK) { diff --git a/patches/net/minecraft/world/level/block/CrafterBlock.java.patch b/patches/net/minecraft/world/level/block/CrafterBlock.java.patch new file mode 100644 index 00000000..ac39be32 --- /dev/null +++ b/patches/net/minecraft/world/level/block/CrafterBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/CrafterBlock.java ++++ b/net/minecraft/world/level/block/CrafterBlock.java +@@ -221,6 +_,8 @@ + break; + } + } ++ } else { ++ itemstack = net.neoforged.neoforge.items.VanillaInventoryCodeHooks.insertCrafterOutput(p_335887_, p_307620_, p_307387_, itemstack); + } + + if (!itemstack.isEmpty()) { diff --git a/patches/net/minecraft/world/level/block/FireBlock.java.patch b/patches/net/minecraft/world/level/block/FireBlock.java.patch index 0842498c..0e6d1d83 100644 --- a/patches/net/minecraft/world/level/block/FireBlock.java.patch +++ b/patches/net/minecraft/world/level/block/FireBlock.java.patch @@ -21,7 +21,7 @@ BlockState blockstate = p_221161_.getBlockState(p_221162_.below()); - boolean flag = blockstate.is(p_221161_.dimensionType().infiniburn()); -+ boolean flag = blockstate.isFireSource(p_221161_, p_221162_, Direction.UP); ++ boolean flag = blockstate.isFireSource(p_221161_, p_221162_.below(), Direction.UP); int i = p_221160_.getValue(AGE); if (!flag && p_221161_.isRaining() && this.isNearRain(p_221161_, p_221162_) && p_221163_.nextFloat() < 0.2F + (float)i * 0.03F) { p_221161_.removeBlock(p_221162_, false); diff --git a/patches/net/minecraft/world/level/block/FlowerPotBlock.java.patch b/patches/net/minecraft/world/level/block/FlowerPotBlock.java.patch index fc5bc0ea..e2a75a86 100644 --- a/patches/net/minecraft/world/level/block/FlowerPotBlock.java.patch +++ b/patches/net/minecraft/world/level/block/FlowerPotBlock.java.patch @@ -61,7 +61,7 @@ p_316655_.gameEvent(p_316338_, GameEvent.BLOCK_CHANGE, p_316654_); return InteractionResult.sidedSuccess(p_316655_.isClientSide); } -@@ -107,11 +_,32 @@ +@@ -107,11 +_,44 @@ } public Block getPotted() { @@ -72,26 +72,38 @@ @Override protected boolean isPathfindable(BlockState p_53535_, PathComputationType p_53538_) { return false; - } ++ } + -+ //Forge Start ++ // Neo: Maps flower blocks to the filled flower pot equivalent + private final Map> fullPots; ++ ++ @org.jetbrains.annotations.Nullable + private final java.util.function.Supplier emptyPot; ++ + private final java.util.function.Supplier flowerDelegate; + + public FlowerPotBlock getEmptyPot() { + return emptyPot == null ? this : emptyPot.get(); + } + ++ /** ++ * Maps the given flower to the filled pot it is for. ++ * Call this on the empty pot block. Attempting to call this on a filled pot will throw an exception. ++ * ++ * @param flower The ResourceLocation of the flower block. Not flower item ++ * @param fullPot The filled flower pot to map the flower block to ++ */ + public void addPlant(net.minecraft.resources.ResourceLocation flower, java.util.function.Supplier fullPot) { + if (getEmptyPot() != this) { -+ throw new IllegalArgumentException("Cannot add plant to non-empty pot: " + this); ++ throw new IllegalArgumentException("Cannot add plant to non-empty pot: " + this + " (Please call addPlant on the empty pot instead)"); + } + fullPots.put(flower, fullPot); + } + ++ /** ++ * Returns all the filled pots that can be spawned from filling this pot. (If this pot is filled, returned map will be empty) ++ */ + public Map> getFullPotsView() { + return java.util.Collections.unmodifiableMap(fullPots); -+ } -+ //Forge End + } } diff --git a/patches/net/minecraft/world/level/block/PoweredRailBlock.java.patch b/patches/net/minecraft/world/level/block/PoweredRailBlock.java.patch index 8f925a70..7e5da26d 100644 --- a/patches/net/minecraft/world/level/block/PoweredRailBlock.java.patch +++ b/patches/net/minecraft/world/level/block/PoweredRailBlock.java.patch @@ -10,7 +10,7 @@ + this(p_55218_, false); + } + -+ protected PoweredRailBlock(BlockBehaviour.Properties p_55218_, boolean isPoweredRail) { ++ public PoweredRailBlock(BlockBehaviour.Properties p_55218_, boolean isPoweredRail) { super(true, p_55218_); + this.isActivator = !isPoweredRail; + this.registerDefaultState(); diff --git a/patches/net/minecraft/world/level/block/SculkSensorBlock.java.patch b/patches/net/minecraft/world/level/block/SculkSensorBlock.java.patch index de183fc8..12f47c32 100644 --- a/patches/net/minecraft/world/level/block/SculkSensorBlock.java.patch +++ b/patches/net/minecraft/world/level/block/SculkSensorBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SculkSensorBlock.java +++ b/net/minecraft/world/level/block/SculkSensorBlock.java -@@ -292,8 +_,13 @@ +@@ -291,8 +_,13 @@ @Override protected void spawnAfterBreak(BlockState p_222142_, ServerLevel p_222143_, BlockPos p_222144_, ItemStack p_222145_, boolean p_222146_) { super.spawnAfterBreak(p_222142_, p_222143_, p_222144_, p_222145_, p_222146_); diff --git a/patches/net/minecraft/world/level/block/TrapDoorBlock.java.patch b/patches/net/minecraft/world/level/block/TrapDoorBlock.java.patch index 859fd42e..6fb22ca4 100644 --- a/patches/net/minecraft/world/level/block/TrapDoorBlock.java.patch +++ b/patches/net/minecraft/world/level/block/TrapDoorBlock.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/world/level/block/TrapDoorBlock.java +++ b/net/minecraft/world/level/block/TrapDoorBlock.java -@@ -200,6 +_,19 @@ +@@ -200,6 +_,17 @@ return super.updateShape(p_57554_, p_57555_, p_57556_, p_57557_, p_57558_, p_57559_); } -+ //Forge Start ++ // Neo: Allows Trapdoors to be climbable if any ladder, even modded ladders, is below Trapdoor + @Override + public boolean isLadder(BlockState state, net.minecraft.world.level.LevelReader world, BlockPos pos, net.minecraft.world.entity.LivingEntity entity) { + if (state.getValue(OPEN)) { @@ -14,8 +14,6 @@ + } + return false; + } -+ //Forge End -+ + protected BlockSetType getType() { return this.type; diff --git a/patches/net/minecraft/world/level/block/WeatheringCopper.java.patch b/patches/net/minecraft/world/level/block/WeatheringCopper.java.patch new file mode 100644 index 00000000..2efc36e5 --- /dev/null +++ b/patches/net/minecraft/world/level/block/WeatheringCopper.java.patch @@ -0,0 +1,45 @@ +--- a/net/minecraft/world/level/block/WeatheringCopper.java ++++ b/net/minecraft/world/level/block/WeatheringCopper.java +@@ -10,6 +_,10 @@ + import net.minecraft.world.level.block.state.BlockState; + + public interface WeatheringCopper extends ChangeOverTimeBlock { ++ /** ++ * @deprecated Neo: Use {@link net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps#OXIDIZABLES the data map}, this field will be ignored in a future version ++ */ ++ @Deprecated + Supplier> NEXT_BY_BLOCK = Suppliers.memoize( + () -> ImmutableBiMap.builder() + .put(Blocks.COPPER_BLOCK, Blocks.EXPOSED_COPPER) +@@ -41,16 +_,20 @@ + .put(Blocks.WEATHERED_COPPER_BULB, Blocks.OXIDIZED_COPPER_BULB) + .build() + ); ++ /** ++ * @deprecated Neo: Use the {@link net.neoforged.neoforge.common.DataMapHooks#INVERSE_OXIDIZABLES_DATAMAP inverse map} generated from the data map, this field will be ignored in a future version ++ */ ++ @Deprecated + Supplier> PREVIOUS_BY_BLOCK = Suppliers.memoize(() -> NEXT_BY_BLOCK.get().inverse()); + + static Optional getPrevious(Block p_154891_) { +- return Optional.ofNullable(PREVIOUS_BY_BLOCK.get().get(p_154891_)); ++ return Optional.ofNullable(net.neoforged.neoforge.common.DataMapHooks.getPreviousOxidizedStage(p_154891_)); + } + + static Block getFirst(Block p_154898_) { + Block block = p_154898_; + +- for (Block block1 = PREVIOUS_BY_BLOCK.get().get(p_154898_); block1 != null; block1 = PREVIOUS_BY_BLOCK.get().get(block1)) { ++ for (Block block1 = net.neoforged.neoforge.common.DataMapHooks.getPreviousOxidizedStage(p_154898_); block1 != null; block1 = net.neoforged.neoforge.common.DataMapHooks.getPreviousOxidizedStage(block1)) { + block = block1; + } + +@@ -62,7 +_,7 @@ + } + + static Optional getNext(Block p_154905_) { +- return Optional.ofNullable(NEXT_BY_BLOCK.get().get(p_154905_)); ++ return Optional.ofNullable(net.neoforged.neoforge.common.DataMapHooks.getNextOxidizedStage(p_154905_)); + } + + static BlockState getFirst(BlockState p_154907_) { diff --git a/patches/net/minecraft/world/level/block/entity/BlockEntity.java.patch b/patches/net/minecraft/world/level/block/entity/BlockEntity.java.patch index 26b89617..ab720f4a 100644 --- a/patches/net/minecraft/world/level/block/entity/BlockEntity.java.patch +++ b/patches/net/minecraft/world/level/block/entity/BlockEntity.java.patch @@ -1,14 +1,16 @@ --- a/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -27,7 +_,7 @@ +@@ -27,8 +_,9 @@ import net.minecraft.world.level.block.state.BlockState; import org.slf4j.Logger; -public abstract class BlockEntity { +public abstract class BlockEntity extends net.neoforged.neoforge.attachment.AttachmentHolder implements net.neoforged.neoforge.common.extensions.IBlockEntityExtension { private static final Logger LOGGER = LogUtils.getLogger(); ++ @Deprecated // Neo: always use getType() private final BlockEntityType type; @Nullable + public Level level; @@ -36,6 +_,8 @@ protected boolean remove; private BlockState blockState; @@ -18,7 +20,16 @@ public BlockEntity(BlockEntityType p_155228_, BlockPos p_155229_, BlockState p_155230_) { this.type = p_155228_; -@@ -61,6 +_,8 @@ +@@ -51,7 +_,7 @@ + } + + public boolean isValidBlockState(BlockState p_353131_) { +- return this.type.isValid(p_353131_); ++ return this.getType().isValid(p_353131_); // Neo: use getter so correct type is checked for modded subclasses + } + + public static BlockPos getPosFromTag(CompoundTag p_187473_) { +@@ -72,6 +_,8 @@ } protected void loadAdditional(CompoundTag p_338466_, HolderLookup.Provider p_338445_) { @@ -27,7 +38,7 @@ } public final void loadWithComponents(CompoundTag p_338356_, HolderLookup.Provider p_338558_) { -@@ -76,6 +_,9 @@ +@@ -87,6 +_,9 @@ } protected void saveAdditional(CompoundTag p_187471_, HolderLookup.Provider p_323635_) { @@ -37,7 +48,7 @@ } public final CompoundTag saveWithFullMetadata(HolderLookup.Provider p_323767_) { -@@ -205,10 +_,14 @@ +@@ -216,10 +_,14 @@ public void setRemoved() { this.remove = true; @@ -52,7 +63,7 @@ } public boolean triggerEvent(int p_58889_, int p_58890_) { -@@ -231,6 +_,27 @@ +@@ -246,6 +_,27 @@ return this.type; } @@ -79,8 +90,8 @@ + @Deprecated public void setBlockState(BlockState p_155251_) { - this.blockState = p_155251_; -@@ -309,5 +_,15 @@ + this.validateBlockState(p_155251_); +@@ -325,5 +_,15 @@ T get(DataComponentType p_338658_); T getOrDefault(DataComponentType p_338573_, T p_338734_); diff --git a/patches/net/minecraft/world/level/block/entity/BlockEntityType.java.patch b/patches/net/minecraft/world/level/block/entity/BlockEntityType.java.patch index 467125fa..62798620 100644 --- a/patches/net/minecraft/world/level/block/entity/BlockEntityType.java.patch +++ b/patches/net/minecraft/world/level/block/entity/BlockEntityType.java.patch @@ -1,14 +1,24 @@ --- a/net/minecraft/world/level/block/entity/BlockEntityType.java +++ b/net/minecraft/world/level/block/entity/BlockEntityType.java -@@ -301,6 +_,11 @@ - return this.validBlocks.contains(p_155263_.getBlock()); - } - -+ // Neo: Add block getter -+ public Set getValidBlocks() { -+ return java.util.Collections.unmodifiableSet(this.validBlocks); +@@ -268,6 +_,7 @@ + ); + public static final BlockEntityType VAULT = register("vault", BlockEntityType.Builder.of(VaultBlockEntity::new, Blocks.VAULT)); + private final BlockEntityType.BlockEntitySupplier factory; ++ // Neo: This field will be modified by BlockEntityTypeAddBlocksEvent event. Please use the event to add to this field for vanilla or other mod's BlockEntityTypes. + private final Set validBlocks; + private final Type dataType; + private final Holder.Reference> builtInRegistryHolder = BuiltInRegistries.BLOCK_ENTITY_TYPE.createIntrusiveHolder(this); +@@ -295,6 +_,13 @@ + @Nullable + public T create(BlockPos p_155265_, BlockState p_155266_) { + return (T)this.factory.create(p_155265_, p_155266_); + } + - @Nullable - public Holder.Reference> builtInRegistryHolder() { - return this.builtInRegistryHolder; ++ /** ++ * Neo: Add getter for an immutable view of the set of valid blocks. ++ */ ++ public Set getValidBlocks() { ++ return java.util.Collections.unmodifiableSet(this.validBlocks); + } + + public boolean isValid(BlockState p_155263_) { diff --git a/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch index c2a77fce..851387e2 100644 --- a/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch +++ b/patches/net/minecraft/world/level/block/state/BlockBehaviour.java.patch @@ -18,15 +18,6 @@ } public BlockBehaviour.Properties properties() { -@@ -159,7 +_,7 @@ - } - - protected void onRemove(BlockState p_60515_, Level p_60516_, BlockPos p_60517_, BlockState p_60518_, boolean p_60519_) { -- if (p_60515_.hasBlockEntity() && !p_60515_.is(p_60518_.getBlock())) { -+ if (p_60515_.hasBlockEntity() && (!p_60515_.is(p_60518_.getBlock()) || !p_60518_.hasBlockEntity())) { - p_60516_.removeBlockEntity(p_60517_); - } - } @@ -168,7 +_,7 @@ if (!p_311951_.isAir() && p_312925_.getBlockInteraction() != Explosion.BlockInteraction.TRIGGER_BLOCK) { Block block = p_311951_.getBlock(); @@ -75,7 +66,7 @@ protected SoundType getSoundType(BlockState p_320941_) { return this.soundType; } -@@ -393,6 +_,14 @@ +@@ -393,6 +_,13 @@ return this.properties.destroyTime; } @@ -83,9 +74,8 @@ + return ((BlockStateBase)state).isAir; + } + -+ /* ======================================== FORGE START ===================================== */ ++ // Neo: Holds the loot table for this block's drops. Used for getLootTable method. + private final java.util.function.Supplier> lootTableSupplier; -+ /* ========================================= FORGE END ====================================== */ + public abstract static class BlockStateBase extends StateHolder { private final int lightEmission; diff --git a/patches/net/minecraft/world/level/chunk/ChunkAccess.java.patch b/patches/net/minecraft/world/level/chunk/ChunkAccess.java.patch index 1d88216f..311f7f49 100644 --- a/patches/net/minecraft/world/level/chunk/ChunkAccess.java.patch +++ b/patches/net/minecraft/world/level/chunk/ChunkAccess.java.patch @@ -42,12 +42,12 @@ } } } -@@ -476,4 +_,70 @@ +@@ -476,4 +_,72 @@ public static record TicksToSave(SerializableTickContainer blocks, SerializableTickContainer fluids) { } + -+ // FORGE START ++ // Neo: Hook in AttachmentHolder to chunks for data storage and retrieval + private final net.neoforged.neoforge.attachment.AttachmentHolder.AsField attachmentHolder = new net.neoforged.neoforge.attachment.AttachmentHolder.AsField(this); + + @Override @@ -110,6 +110,8 @@ + protected net.neoforged.neoforge.attachment.AttachmentHolder.AsField getAttachmentHolder() { + return attachmentHolder; + } ++ ++ // Neo: Allow for exposing the Level a chunk is tied to if available + @Nullable + public net.minecraft.world.level.Level getLevel() { return null; } } diff --git a/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch b/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch index 99f94c84..a47b0de4 100644 --- a/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch +++ b/patches/net/minecraft/world/level/chunk/LevelChunk.java.patch @@ -17,15 +17,7 @@ for (Entry entry : p_196851_.getHeightmaps()) { if (ChunkStatus.FULL.heightmapsAfter().contains(entry.getKey())) { this.setHeightmap(entry.getKey(), entry.getValue().getRawData()); -@@ -271,14 +_,14 @@ - boolean flag2 = blockstate.hasBlockEntity(); - if (!this.level.isClientSide) { - blockstate.onRemove(this.level, p_62865_, p_62866_, p_62867_); -- } else if (!blockstate.is(block) && flag2) { -+ } else if ((!blockstate.is(block) || !p_62866_.hasBlockEntity()) && flag2) { - this.removeBlockEntity(p_62865_); - } - +@@ -278,7 +_,7 @@ if (!levelchunksection.getBlockState(j, k, l).is(block)) { return null; } else { @@ -34,7 +26,7 @@ p_62866_.onPlace(this.level, p_62865_, blockstate, p_62867_); } -@@ -322,6 +_,10 @@ +@@ -327,6 +_,10 @@ @Nullable public BlockEntity getBlockEntity(BlockPos p_62868_, LevelChunk.EntityCreationType p_62869_) { BlockEntity blockentity = this.blockEntities.get(p_62868_); @@ -45,7 +37,7 @@ if (blockentity == null) { CompoundTag compoundtag = this.pendingBlockEntities.remove(p_62868_); if (compoundtag != null) { -@@ -339,9 +_,6 @@ +@@ -344,9 +_,6 @@ this.addAndRegisterBlockEntity(blockentity); } } @@ -55,7 +47,7 @@ } return blockentity; -@@ -355,6 +_,7 @@ +@@ -360,6 +_,7 @@ } this.updateBlockEntityTicker(p_156391_); @@ -63,7 +55,7 @@ } } -@@ -398,6 +_,7 @@ +@@ -403,6 +_,7 @@ BlockEntity blockentity = this.blockEntities.put(blockpos.immutable(), p_156374_); if (blockentity != null && blockentity != p_156374_) { blockentity.setRemoved(); @@ -71,7 +63,7 @@ } } } -@@ -407,9 +_,14 @@ +@@ -412,9 +_,14 @@ public CompoundTag getBlockEntityNbtForSaving(BlockPos p_62932_, HolderLookup.Provider p_323699_) { BlockEntity blockentity = this.getBlockEntity(p_62932_); if (blockentity != null && !blockentity.isRemoved()) { @@ -86,7 +78,7 @@ } else { CompoundTag compoundtag = this.pendingBlockEntities.get(p_62932_); if (compoundtag != null) { -@@ -431,6 +_,7 @@ +@@ -436,6 +_,7 @@ } blockentity.setRemoved(); @@ -94,7 +86,7 @@ } } -@@ -491,7 +_,7 @@ +@@ -496,7 +_,7 @@ p_187974_.accept((p_338077_, p_338078_, p_338079_) -> { BlockEntity blockentity = this.getBlockEntity(p_338077_, LevelChunk.EntityCreationType.IMMEDIATE); if (blockentity != null && p_338079_ != null && blockentity.getType() == p_338078_) { @@ -103,7 +95,7 @@ } }); } -@@ -599,6 +_,7 @@ +@@ -604,6 +_,7 @@ } public void clearAllBlockEntities() { @@ -111,7 +103,7 @@ this.blockEntities.values().forEach(BlockEntity::setRemoved); this.blockEntities.clear(); this.tickersInLevel.values().forEach(p_187966_ -> p_187966_.rebind(NULL_TICKER)); -@@ -606,6 +_,7 @@ +@@ -611,6 +_,7 @@ } public void registerAllBlockEntitiesAfterLevelLoad() { @@ -119,23 +111,22 @@ this.blockEntities.values().forEach(p_187988_ -> { if (this.level instanceof ServerLevel serverlevel) { this.addGameEventListener(p_187988_, serverlevel); -@@ -657,6 +_,15 @@ +@@ -662,6 +_,14 @@ return new LevelChunk.BoundTickingBlockEntity<>(p_156376_, p_156377_); } -+ // FORGE START ++ // Neo: Threadsafe lighting system for BlockEntities that change lighting based on dynamic data changing. + private final net.neoforged.neoforge.common.world.LevelChunkAuxiliaryLightManager auxLightManager = new net.neoforged.neoforge.common.world.LevelChunkAuxiliaryLightManager(this); + + @Override + public net.neoforged.neoforge.common.world.LevelChunkAuxiliaryLightManager getAuxLightManager(ChunkPos pos) { + return auxLightManager; + } -+ // FORGE END + class BoundTickingBlockEntity implements TickingBlockEntity { private final T blockEntity; private final BlockEntityTicker ticker; -@@ -674,6 +_,7 @@ +@@ -679,6 +_,7 @@ if (LevelChunk.this.isTicking(blockpos)) { try { ProfilerFiller profilerfiller = LevelChunk.this.level.getProfiler(); @@ -143,7 +134,7 @@ profilerfiller.push(this::getType); BlockState blockstate = LevelChunk.this.getBlockState(blockpos); if (this.blockEntity.getType().isValid(blockstate)) { -@@ -695,7 +_,15 @@ +@@ -700,7 +_,15 @@ CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking block entity"); CrashReportCategory crashreportcategory = crashreport.addCategory("Block entity being ticked"); this.blockEntity.fillCrashReportCategory(crashreportcategory); diff --git a/patches/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch b/patches/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch index 3ad91c2b..2edad897 100644 --- a/patches/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch +++ b/patches/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch @@ -24,7 +24,7 @@ - p_157553_.forEach(p_157607_ -> this.addEntity((T)p_157607_, true)); + p_157553_.forEach(p_157607_ -> { + this.addEntity(p_157607_, true); -+ if (p_157607_ instanceof Entity entity) entity.onAddedToWorld(); ++ if (p_157607_ instanceof Entity entity) entity.onAddedToLevel(); + }); } @@ -32,7 +32,7 @@ - p_157560_.forEach(p_157605_ -> this.addEntity((T)p_157605_, false)); + p_157560_.forEach(p_157605_ -> { + this.addEntity(p_157605_, false); -+ if (p_157605_ instanceof Entity entity) entity.onAddedToWorld(); ++ if (p_157605_ instanceof Entity entity) entity.onAddedToLevel(); + }); } @@ -44,7 +44,7 @@ - chunkentities.getEntities().forEach(p_157593_ -> this.addEntity((T)p_157593_, true)); + chunkentities.getEntities().forEach(p_157593_ -> { + this.addEntity(p_157593_, true); -+ if (p_157593_ instanceof Entity entity) entity.onAddedToWorld(); ++ if (p_157593_ instanceof Entity entity) entity.onAddedToLevel(); + }); this.chunkLoadStatuses.put(chunkentities.getPos().toLong(), PersistentEntitySectionManager.ChunkLoadStatus.LOADED); } diff --git a/patches/net/minecraft/world/level/levelgen/placement/EnvironmentScanPlacement.java.patch b/patches/net/minecraft/world/level/levelgen/placement/EnvironmentScanPlacement.java.patch index 8cf2c5bd..d6bfca67 100644 --- a/patches/net/minecraft/world/level/levelgen/placement/EnvironmentScanPlacement.java.patch +++ b/patches/net/minecraft/world/level/levelgen/placement/EnvironmentScanPlacement.java.patch @@ -5,7 +5,7 @@ public static final MapCodec CODEC = RecordCodecBuilder.mapCodec( p_191650_ -> p_191650_.group( - Direction.VERTICAL_CODEC.fieldOf("direction_of_search").forGetter(p_191672_ -> p_191672_.directionOfSearch), -+ // NeoForge: Allow any direction, not just vertical. The code already handles it fine. ++ // Neo: Allow any direction, not just vertical. The code already handles it fine. + Direction.CODEC.fieldOf("direction_of_search").forGetter(p_191672_ -> p_191672_.directionOfSearch), BlockPredicate.CODEC.fieldOf("target_condition").forGetter(p_191670_ -> p_191670_.targetCondition), BlockPredicate.CODEC diff --git a/patches/net/minecraft/world/level/levelgen/structure/Structure.java.patch b/patches/net/minecraft/world/level/levelgen/structure/Structure.java.patch index 207e90d9..62c16261 100644 --- a/patches/net/minecraft/world/level/levelgen/structure/Structure.java.patch +++ b/patches/net/minecraft/world/level/levelgen/structure/Structure.java.patch @@ -22,13 +22,12 @@ } public HolderSet biomes() { -@@ -196,6 +_,29 @@ +@@ -196,6 +_,25 @@ } public abstract StructureType type(); + -+ // FORGE START -+ ++ // Neo: Grant ability to modify Structures in specific ways such as adding new natural mob spawns to structures + private final net.neoforged.neoforge.common.world.ModifiableStructureInfo modifiableStructureInfo; + + /** @@ -36,8 +35,7 @@ + * Modified structure data is set by server after datapacks and serverconfigs load. + * Settings field reads are coremodded to redirect to this. + **/ -+ public net.neoforged.neoforge.common.world.ModifiableStructureInfo modifiableStructureInfo() -+ { ++ public net.neoforged.neoforge.common.world.ModifiableStructureInfo modifiableStructureInfo() { + return this.modifiableStructureInfo; + } + @@ -47,8 +45,6 @@ + public StructureSettings getModifiedStructureSettings() { + return this.modifiableStructureInfo().get().structureSettings(); + } -+ -+ // FORGE END public static record GenerationContext( RegistryAccess registryAccess, diff --git a/patches/net/minecraft/world/level/saveddata/SavedData.java.patch b/patches/net/minecraft/world/level/saveddata/SavedData.java.patch index e637ec22..ac130d73 100644 --- a/patches/net/minecraft/world/level/saveddata/SavedData.java.patch +++ b/patches/net/minecraft/world/level/saveddata/SavedData.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/world/level/saveddata/SavedData.java +++ b/net/minecraft/world/level/saveddata/SavedData.java +@@ -37,7 +_,7 @@ + NbtUtils.addCurrentDataVersion(compoundtag); + + try { +- NbtIo.writeCompressed(compoundtag, p_77758_.toPath()); ++ net.neoforged.neoforge.common.IOUtilities.writeNbtCompressed(compoundtag, p_77758_.toPath()); + } catch (IOException ioexception) { + LOGGER.error("Could not save data {}", this, ioexception); + } @@ -47,7 +_,10 @@ } diff --git a/patches/net/minecraft/world/level/saveddata/maps/MapDecoration.java.patch b/patches/net/minecraft/world/level/saveddata/maps/MapDecoration.java.patch deleted file mode 100644 index b194cb2a..00000000 --- a/patches/net/minecraft/world/level/saveddata/maps/MapDecoration.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/level/saveddata/maps/MapDecoration.java -+++ b/net/minecraft/world/level/saveddata/maps/MapDecoration.java -@@ -9,7 +_,7 @@ - import net.minecraft.network.codec.StreamCodec; - import net.minecraft.resources.ResourceLocation; - --public record MapDecoration(Holder type, byte x, byte y, byte rot, Optional name) { -+public record MapDecoration(Holder type, byte x, byte y, byte rot, Optional name) { // Porting 1.20.5 this is synced now reevaluate shouldRenderForIndex - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - MapDecorationType.STREAM_CODEC, - MapDecoration::type, diff --git a/patches/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch b/patches/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch new file mode 100644 index 00000000..ab312154 --- /dev/null +++ b/patches/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch @@ -0,0 +1,20 @@ +--- a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java ++++ b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +@@ -268,7 +_,7 @@ + } + } + +- public void removeDecoration(String p_164800_) { ++ private void removeDecoration(String p_164800_) { + MapDecoration mapdecoration = this.decorations.remove(p_164800_); + if (mapdecoration != null && mapdecoration.type().value().trackCount()) { + this.trackedDecorationCount--; +@@ -285,7 +_,7 @@ + } + } + +- public void addDecoration( ++ private void addDecoration( + Holder p_335830_, + @Nullable LevelAccessor p_77939_, + String p_77940_, diff --git a/patches/net/minecraft/world/level/storage/DerivedLevelData.java.patch b/patches/net/minecraft/world/level/storage/DerivedLevelData.java.patch new file mode 100644 index 00000000..5a829f98 --- /dev/null +++ b/patches/net/minecraft/world/level/storage/DerivedLevelData.java.patch @@ -0,0 +1,29 @@ +--- a/net/minecraft/world/level/storage/DerivedLevelData.java ++++ b/net/minecraft/world/level/storage/DerivedLevelData.java +@@ -191,4 +_,26 @@ + p_164852_.setDetail("Derived", true); + this.wrapped.fillCrashReportCategory(p_164852_, p_164853_); + } ++ ++ // Neo: Variable day time code ++ ++ @Override ++ public float getDayTimeFraction() { ++ return wrapped.getDayTimeFraction(); ++ } ++ ++ @Override ++ public float getDayTimePerTick() { ++ return wrapped.getDayTimePerTick(); ++ } ++ ++ @Override ++ public void setDayTimeFraction(float dayTimeFraction) { ++ wrapped.setDayTimeFraction(dayTimeFraction); ++ } ++ ++ @Override ++ public void setDayTimePerTick(float dayTimePerTick) { ++ wrapped.setDayTimePerTick(dayTimePerTick); ++ } + } diff --git a/patches/net/minecraft/world/level/storage/DimensionDataStorage.java.patch b/patches/net/minecraft/world/level/storage/DimensionDataStorage.java.patch index 2ecb5333..ecf3e431 100644 --- a/patches/net/minecraft/world/level/storage/DimensionDataStorage.java.patch +++ b/patches/net/minecraft/world/level/storage/DimensionDataStorage.java.patch @@ -1,19 +1,6 @@ --- a/net/minecraft/world/level/storage/DimensionDataStorage.java +++ b/net/minecraft/world/level/storage/DimensionDataStorage.java -@@ -54,16 +_,20 @@ - @Nullable - public T get(SavedData.Factory p_295091_, String p_164860_) { - SavedData saveddata = this.cache.get(p_164860_); -+ if (saveddata == net.neoforged.neoforge.common.util.DummySavedData.DUMMY) return null; - if (saveddata == null && !this.cache.containsKey(p_164860_)) { - saveddata = this.readSavedData(p_295091_.deserializer(), p_295091_.type(), p_164860_); - this.cache.put(p_164860_, saveddata); -+ } else if (saveddata == null) { -+ this.cache.put(p_164860_, net.neoforged.neoforge.common.util.DummySavedData.DUMMY); -+ return null; - } - - return (T)saveddata; +@@ -63,7 +_,7 @@ } @Nullable @@ -31,7 +18,7 @@ File file1 = this.getDataFile(p_78159_); CompoundTag compoundtag1; -@@ -98,8 +_,12 @@ +@@ -98,9 +_,16 @@ } } @@ -44,5 +31,9 @@ + compoundtag1 = compoundtag; + } } ++ ++ // Neo: delete any temporary files so that we don't inflate disk space unnecessarily. ++ net.neoforged.neoforge.common.IOUtilities.cleanupTempFiles(this.dataFolder.toPath(), p_78159_); return compoundtag1; + } diff --git a/patches/net/minecraft/world/level/storage/PrimaryLevelData.java.patch b/patches/net/minecraft/world/level/storage/PrimaryLevelData.java.patch index e864d040..b9f9edb3 100644 --- a/patches/net/minecraft/world/level/storage/PrimaryLevelData.java.patch +++ b/patches/net/minecraft/world/level/storage/PrimaryLevelData.java.patch @@ -8,30 +8,44 @@ private PrimaryLevelData( @Nullable CompoundTag p_277888_, -@@ -200,7 +_,7 @@ +@@ -169,7 +_,7 @@ + Dynamic p_78531_, LevelSettings p_78535_, PrimaryLevelData.SpecialWorldProperty p_250651_, WorldOptions p_251864_, Lifecycle p_78538_ + ) { + long i = p_78531_.get("Time").asLong(0L); +- return new PrimaryLevelData( ++ PrimaryLevelData result = new PrimaryLevelData( + p_78531_.get("Player").flatMap(CompoundTag.CODEC::parse).result().orElse(null), + p_78531_.get("WasModded").asBoolean(false), + new BlockPos(p_78531_.get("SpawnX").asInt(0), p_78531_.get("SpawnY").asInt(0), p_78531_.get("SpawnZ").asInt(0)), +@@ -200,7 +_,11 @@ p_251864_, p_250651_, p_78538_ - ); + ).withConfirmedWarning(p_78538_ != Lifecycle.stable() && p_78531_.get("confirmedExperimentalSettings").asBoolean(false)); ++ // Neo: ++ result.setDayTimeFraction(p_78531_.get("neoDayTimeFraction").asFloat(0f)); ++ result.setDayTimePerTick(p_78531_.get("neoDayTimePerTick").asFloat(-1f)); ++ return result; } @Override -@@ -273,6 +_,8 @@ +@@ -273,6 +_,11 @@ if (this.wanderingTraderId != null) { p_78547_.putUUID("WanderingTraderId", this.wanderingTraderId); } + p_78547_.putString("forgeLifecycle", net.neoforged.neoforge.common.CommonHooks.encodeLifecycle(this.settings.getLifecycle())); + p_78547_.putBoolean("confirmedExperimentalSettings", this.confirmedExperimentalWarning); ++ // Neo: ++ p_78547_.putFloat("neoDayTimeFraction", dayTimeFraction); ++ p_78547_.putFloat("neoDayTimePerTick", dayTimePerTick); } private static ListTag stringCollectionToTag(Set p_277880_) { -@@ -570,6 +_,15 @@ - @Override - public LevelSettings getLevelSettings() { +@@ -572,10 +_,44 @@ return this.settings.copy(); -+ } -+ + } + + public boolean hasConfirmedExperimentalWarning() { + return this.confirmedExperimentalWarning; + } @@ -39,6 +53,37 @@ + public PrimaryLevelData withConfirmedWarning(boolean confirmedWarning) { // Builder-like to not patch ctor + this.confirmedExperimentalWarning = confirmedWarning; + return this; - } - ++ } ++ @Deprecated + public static enum SpecialWorldProperty { + NONE, + FLAT, + DEBUG; ++ } ++ ++ // Neo: Variable day time code ++ ++ private float dayTimeFraction = 0.0f; ++ private float dayTimePerTick = -1.0f; ++ ++ @Override ++ public float getDayTimeFraction() { ++ return dayTimeFraction; ++ } ++ ++ @Override ++ public float getDayTimePerTick() { ++ return dayTimePerTick; ++ } ++ ++ @Override ++ public void setDayTimeFraction(float dayTimeFraction) { ++ this.dayTimeFraction = dayTimeFraction; ++ } ++ ++ @Override ++ public void setDayTimePerTick(float dayTimePerTick) { ++ this.dayTimePerTick = dayTimePerTick; + } + } diff --git a/patches/net/minecraft/world/level/storage/ServerLevelData.java.patch b/patches/net/minecraft/world/level/storage/ServerLevelData.java.patch new file mode 100644 index 00000000..d56c58c4 --- /dev/null +++ b/patches/net/minecraft/world/level/storage/ServerLevelData.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/world/level/storage/ServerLevelData.java ++++ b/net/minecraft/world/level/storage/ServerLevelData.java +@@ -87,4 +_,10 @@ + void setGameTime(long p_78617_); + + void setDayTime(long p_78624_); ++ ++ //Neo ++ float getDayTimeFraction(); ++ float getDayTimePerTick(); ++ void setDayTimeFraction(float dayTimeFraction); ++ void setDayTimePerTick(float dayTimePerTick); + } diff --git a/patches/net/minecraft/world/level/storage/loot/LootContext.java.patch b/patches/net/minecraft/world/level/storage/loot/LootContext.java.patch index 5d655f3e..533f10a1 100644 --- a/patches/net/minecraft/world/level/storage/loot/LootContext.java.patch +++ b/patches/net/minecraft/world/level/storage/loot/LootContext.java.patch @@ -4,8 +4,8 @@ return new LootContext.VisitedEntry<>(LootDataType.MODIFIER, p_279163_); } -+ // ============================== FORGE START ============================== -+ ++ // Neo: Keep track of the original loot table ID through modifications ++ @org.jetbrains.annotations.Nullable + private ResourceLocation queriedLootTableId; + + private LootContext(LootParams p_287722_, RandomSource p_287702_, HolderGetter.Provider p_287619_, ResourceLocation queriedLootTableId) { @@ -13,19 +13,19 @@ + this.queriedLootTableId = queriedLootTableId; + } + -+ public void setQueriedLootTableId(ResourceLocation queriedLootTableId) { ++ public void setQueriedLootTableId(@org.jetbrains.annotations.Nullable ResourceLocation queriedLootTableId) { + if (this.queriedLootTableId == null && queriedLootTableId != null) this.queriedLootTableId = queriedLootTableId; + } + + public ResourceLocation getQueriedLootTableId() { + return this.queriedLootTableId == null ? net.neoforged.neoforge.common.loot.LootTableIdCondition.UNKNOWN_LOOT_TABLE : this.queriedLootTableId; + } -+ // =============================== FORGE END =============================== + public static class Builder { private final LootParams params; @Nullable private RandomSource random; ++ @Nullable + private ResourceLocation queriedLootTableId; // Forge: correctly pass around loot table ID with copy constructor public Builder(LootParams p_287628_) { diff --git a/patches/net/minecraft/world/level/storage/loot/LootPool.java.patch b/patches/net/minecraft/world/level/storage/loot/LootPool.java.patch index e041866b..35a753c2 100644 --- a/patches/net/minecraft/world/level/storage/loot/LootPool.java.patch +++ b/patches/net/minecraft/world/level/storage/loot/LootPool.java.patch @@ -28,36 +28,64 @@ } private void addRandomItem(Consumer p_79059_, LootContext p_79060_) { -@@ -121,6 +_,29 @@ - this.rolls.validate(p_79052_.forChild(".rolls")); +@@ -122,6 +_,57 @@ this.bonusRolls.validate(p_79052_.forChild(".bonusRolls")); } -+ //======================== FORGE START ============================================= + ++ // Neo: Implement LootPool freezing to prevent manipulation outside of Neo APIs + private boolean isFrozen = false; -+ public void freeze() { this.isFrozen = true; } -+ public boolean isFrozen(){ return this.isFrozen; } ++ ++ public void freeze() { ++ this.isFrozen = true; ++ } ++ ++ public boolean isFrozen() { ++ return this.isFrozen; ++ } ++ + private void checkFrozen() { + if (this.isFrozen()) + throw new RuntimeException("Attempted to modify LootPool after being frozen!"); + } ++ ++ // Neo: Apply names for LootPools to allow easier targeting specific pools + @org.jetbrains.annotations.Nullable + private String name; ++ + @org.jetbrains.annotations.Nullable -+ public String getName() { return this.name; } ++ public String getName() { ++ return this.name; ++ } ++ + void setName(final String name) { + if (this.name != null) { + throw new UnsupportedOperationException("Cannot change the name of a pool when it has a name set!"); + } + this.name = name; + } -+ public NumberProvider getRolls() { return this.rolls; } -+ public NumberProvider getBonusRolls() { return this.bonusRolls; } -+ public void setRolls (NumberProvider v){ checkFrozen(); this.rolls = v; } -+ public void setBonusRolls(NumberProvider v){ checkFrozen(); this.bonusRolls = v; } -+ //======================== FORGE END =============================================== - ++ ++ // Neo: Add getters and settings for changing the rolls for this pool ++ public NumberProvider getRolls() { ++ return this.rolls; ++ } ++ ++ public NumberProvider getBonusRolls() { ++ return this.bonusRolls; ++ } ++ ++ public void setRolls (NumberProvider v) { ++ checkFrozen(); ++ this.rolls = v; ++ } ++ ++ public void setBonusRolls (NumberProvider v) { ++ checkFrozen(); ++ this.bonusRolls = v; ++ } ++ public static LootPool.Builder lootPool() { return new LootPool.Builder(); + } @@ -132,6 +_,8 @@ private final ImmutableList.Builder functions = ImmutableList.builder(); private NumberProvider rolls = ConstantValue.exactly(1.0F); diff --git a/patches/net/minecraft/world/level/storage/loot/LootTable.java.patch b/patches/net/minecraft/world/level/storage/loot/LootTable.java.patch index afa27a23..8e1d44d1 100644 --- a/patches/net/minecraft/world/level/storage/loot/LootTable.java.patch +++ b/patches/net/minecraft/world/level/storage/loot/LootTable.java.patch @@ -65,35 +65,48 @@ return objectarraylist; } -@@ -214,6 +_,50 @@ +@@ -213,6 +_,62 @@ + public static LootTable.Builder lootTable() { return new LootTable.Builder(); - } ++ } + -+ //======================== FORGE START ============================================= ++ // Neo: Implement LootTable freezing to prevent manipulation outside of Neo APIs + private boolean isFrozen = false; ++ + public void freeze() { + this.isFrozen = true; + this.pools.forEach(LootPool::freeze); + } -+ public boolean isFrozen(){ return this.isFrozen; } ++ ++ public boolean isFrozen() { ++ return this.isFrozen; ++ } ++ + private void checkFrozen() { + if (this.isFrozen()) + throw new RuntimeException("Attempted to modify LootTable after being finalized!"); + } + ++ // Neo: Linking the LootTable to its ID for easier retrieval + private ResourceLocation lootTableId; ++ + public void setLootTableId(final ResourceLocation id) { + if (this.lootTableId != null) throw new IllegalStateException("Attempted to rename loot table from '" + this.lootTableId + "' to '" + id + "': this is not supported"); + this.lootTableId = java.util.Objects.requireNonNull(id); + } -+ public ResourceLocation getLootTableId() { return this.lootTableId; } + ++ public ResourceLocation getLootTableId() { ++ return this.lootTableId; ++ } ++ ++ // Neo: Retrieve LootPools by name + @org.jetbrains.annotations.Nullable + public LootPool getPool(String name) { + return pools.stream().filter(e -> name.equals(e.getName())).findFirst().orElse(null); + } + ++ // Neo: Remove LootPools by name + @org.jetbrains.annotations.Nullable + public LootPool removePool(String name) { + checkFrozen(); @@ -106,13 +119,12 @@ + return null; + } + ++ // Neo: Allow adding new pools to LootTable + public void addPool(LootPool pool) { + checkFrozen(); + if (pools.stream().anyMatch(e -> e == pool || e.getName() != null && e.getName().equals(pool.getName()))) + throw new RuntimeException("Attempted to add a duplicate pool to loot table: " + pool.getName()); + this.pools.add(pool); -+ } -+ //======================== FORGE END =============================================== + } public static class Builder implements FunctionUserBuilder { - private final ImmutableList.Builder pools = ImmutableList.builder(); diff --git a/patches/net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction.java.patch b/patches/net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction.java.patch new file mode 100644 index 00000000..57bef157 --- /dev/null +++ b/patches/net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction.java ++++ b/net/minecraft/world/level/storage/loot/functions/EnchantRandomlyFunction.java +@@ -59,7 +_,7 @@ + Stream> stream = this.options + .map(HolderSet::stream) + .orElseGet(() -> p_80430_.getLevel().registryAccess().registryOrThrow(Registries.ENCHANTMENT).holders().map(Function.identity())) +- .filter(p_344686_ -> !flag1 || p_344686_.value().canEnchant(p_80429_)); ++ .filter(p_344686_ -> !flag1 || p_80429_.supportsEnchantment(p_344686_)); // Neo: Respect IItemExtension#supportsEnchantment + List> list = stream.toList(); + Optional> optional = Util.getRandomSafe(list, randomsource); + if (optional.isEmpty()) { diff --git a/patches/net/minecraft/world/level/storage/loot/parameters/LootContextParamSets.java.patch b/patches/net/minecraft/world/level/storage/loot/parameters/LootContextParamSets.java.patch index c7a740c1..17ecf039 100644 --- a/patches/net/minecraft/world/level/storage/loot/parameters/LootContextParamSets.java.patch +++ b/patches/net/minecraft/world/level/storage/loot/parameters/LootContextParamSets.java.patch @@ -14,7 +14,7 @@ ); public static final LootContextParamSet FISHING = register( - "fishing", p_81446_ -> p_81446_.required(LootContextParams.ORIGIN).required(LootContextParams.TOOL).optional(LootContextParams.THIS_ENTITY) -+ "fishing", p_81446_ -> p_81446_.required(LootContextParams.ORIGIN).required(LootContextParams.TOOL).optional(LootContextParams.THIS_ENTITY).required(LootContextParams.ATTACKING_ENTITY) //Forge: Add the fisher as a killer. ++ "fishing", p_81446_ -> p_81446_.required(LootContextParams.ORIGIN).required(LootContextParams.TOOL).optional(LootContextParams.THIS_ENTITY).optional(LootContextParams.ATTACKING_ENTITY) //Forge: Add the fisher as a killer. ); public static final LootContextParamSet ENTITY = register( "entity", diff --git a/rejects/net/minecraft/commands/arguments/EntityArgument.java.patch.rej b/rejects/net/minecraft/commands/arguments/EntityArgument.java.patch.rej new file mode 100644 index 00000000..ec80a71d --- /dev/null +++ b/rejects/net/minecraft/commands/arguments/EntityArgument.java.patch.rej @@ -0,0 +1,25 @@ +++++ REJECTED HUNK: 1 +@@ -94,6 +94,10 @@ + } + } + ++ public EntitySelector parse(StringReader stringreader, boolean overridePermissions) throws CommandSyntaxException { ++ throw new RuntimeException("Not Implemented"); ++ } ++ + public EntitySelector parse(StringReader p_91451_) throws CommandSyntaxException { + int i = 0; + EntitySelectorParser entityselectorparser = new EntitySelectorParser(p_91451_); +++++ END HUNK + +++++ REJECTED HUNK: 2 +@@ -119,7 +123,7 @@ + if (p_91482_.getSource() instanceof SharedSuggestionProvider sharedsuggestionprovider) { + StringReader stringreader = new StringReader(p_91483_.getInput()); + stringreader.setCursor(p_91483_.getStart()); +- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, sharedsuggestionprovider.hasPermission(2)); ++ EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, net.neoforged.neoforge.common.CommonHooks.canUseEntitySelectors(sharedsuggestionprovider)); + + try { + entityselectorparser.parse(); +++++ END HUNK diff --git a/rejects/net/minecraft/commands/arguments/MessageArgument.java.patch.rej b/rejects/net/minecraft/commands/arguments/MessageArgument.java.patch.rej new file mode 100644 index 00000000..28569931 --- /dev/null +++ b/rejects/net/minecraft/commands/arguments/MessageArgument.java.patch.rej @@ -0,0 +1,11 @@ +++++ REJECTED HUNK: 1 +@@ -84,7 +84,7 @@ + + public static record Message(String text, MessageArgument.Part[] parts) { + Component resolveComponent(CommandSourceStack p_232197_) throws CommandSyntaxException { +- return this.toComponent(p_232197_, p_232197_.hasPermission(2)); ++ return this.toComponent(p_232197_, net.neoforged.neoforge.common.CommonHooks.canUseEntitySelectors(p_232197_)); + } + + public Component toComponent(CommandSourceStack p_96850_, boolean p_96851_) throws CommandSyntaxException { +++++ END HUNK diff --git a/rejects/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch.rej b/rejects/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch.rej new file mode 100644 index 00000000..4dcc3a3c --- /dev/null +++ b/rejects/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch.rej @@ -0,0 +1,41 @@ +++++ REJECTED HUNK: 1 +@@ -199,6 +199,14 @@ + }; + } + ++ protected void parseSelector(boolean overridePermissions) throws CommandSyntaxException { ++ throw new RuntimeException("Not Implemented"); ++ } ++ ++ public EntitySelector parse(boolean overridePermissions) throws CommandSyntaxException { ++ throw new RuntimeException("Not Implemented"); ++ } ++ + protected void parseSelector() throws CommandSyntaxException { + this.usesSelectors = true; + this.suggestions = this::suggestSelector; +++++ END HUNK + +++++ REJECTED HUNK: 2 +@@ -476,6 +484,9 @@ + } + + this.reader.skip(); ++ EntitySelector forgeSelector = net.neoforged.neoforge.common.command.EntitySelectorManager.parseSelector(this); ++ if (forgeSelector != null) ++ return forgeSelector; + this.parseSelector(); + } else { + this.parseNameOrUUID(); +++++ END HUNK + +++++ REJECTED HUNK: 3 +@@ -492,6 +503,7 @@ + p_121248_.suggest("@s", Component.translatable("argument.entity.selector.self")); + p_121248_.suggest("@e", Component.translatable("argument.entity.selector.allEntities")); + p_121248_.suggest("@n", Component.translatable("argument.entity.selector.nearestEntity")); ++ net.neoforged.neoforge.common.command.EntitySelectorManager.fillSelectorSuggestions(p_121248_); + } + + private CompletableFuture suggestNameOrSelector(SuggestionsBuilder p_121287_, Consumer p_121288_) { +++++ END HUNK diff --git a/rejects/net/minecraft/world/level/block/SculkSensorBlock.java.patch.rej b/rejects/net/minecraft/world/level/block/SculkSensorBlock.java.patch.rej new file mode 100644 index 00000000..fb18419b --- /dev/null +++ b/rejects/net/minecraft/world/level/block/SculkSensorBlock.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED HUNK: 1 +@@ -292,8 +292,13 @@ + @Override + protected void spawnAfterBreak(BlockState p_222142_, ServerLevel p_222143_, BlockPos p_222144_, ItemStack p_222145_, boolean p_222146_) { + super.spawnAfterBreak(p_222142_, p_222143_, p_222144_, p_222145_, p_222146_); +- if (p_222146_) { +- this.tryDropExperience(p_222143_, p_222144_, p_222145_, ConstantInt.of(5)); +- } ++ } ++ ++ // Neo: Patch-in override for getExpDrop. Original vanilla logic passes ConstantInt.of(5) to tryDropExperience. ++ @Override ++ public int getExpDrop(BlockState state, net.minecraft.world.level.LevelAccessor level, BlockPos pos, ++ @org.jetbrains.annotations.Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, ++ @org.jetbrains.annotations.Nullable net.minecraft.world.entity.Entity breaker, ItemStack tool) { ++ return 5; + } + } +++++ END HUNK diff --git a/rejects/net/minecraft/world/level/block/entity/BlockEntity.java.patch.rej b/rejects/net/minecraft/world/level/block/entity/BlockEntity.java.patch.rej new file mode 100644 index 00000000..7a73c595 --- /dev/null +++ b/rejects/net/minecraft/world/level/block/entity/BlockEntity.java.patch.rej @@ -0,0 +1,92 @@ +++++ REJECTED HUNK: 3 +@@ -61,6 +63,8 @@ + } + + protected void loadAdditional(CompoundTag p_338466_, HolderLookup.Provider p_338445_) { ++ if (p_338466_.contains("NeoForgeData", net.minecraft.nbt.Tag.TAG_COMPOUND)) this.customPersistentData = p_338466_.getCompound("NeoForgeData"); ++ if (p_338466_.contains(ATTACHMENTS_NBT_KEY, net.minecraft.nbt.Tag.TAG_COMPOUND)) deserializeAttachments(p_338445_, p_338466_.getCompound(ATTACHMENTS_NBT_KEY)); + } + + public final void loadWithComponents(CompoundTag p_338356_, HolderLookup.Provider p_338558_) { +++++ END HUNK + +++++ REJECTED HUNK: 4 +@@ -76,6 +80,9 @@ + } + + protected void saveAdditional(CompoundTag p_187471_, HolderLookup.Provider p_323635_) { ++ if (this.customPersistentData != null) p_187471_.put("NeoForgeData", this.customPersistentData.copy()); ++ var attachmentsTag = serializeAttachments(p_323635_); ++ if (attachmentsTag != null) p_187471_.put(ATTACHMENTS_NBT_KEY, attachmentsTag); + } + + public final CompoundTag saveWithFullMetadata(HolderLookup.Provider p_323767_) { +++++ END HUNK + +++++ REJECTED HUNK: 5 +@@ -205,10 +212,14 @@ + + public void setRemoved() { + this.remove = true; ++ this.invalidateCapabilities(); ++ requestModelDataUpdate(); + } + + public void clearRemoved() { + this.remove = false; ++ // Neo: invalidate capabilities on block entity placement ++ invalidateCapabilities(); + } + + public boolean triggerEvent(int p_58889_, int p_58890_) { +++++ END HUNK + +++++ REJECTED HUNK: 6 +@@ -231,6 +242,27 @@ + return this.type; + } + ++ @Override ++ public CompoundTag getPersistentData() { ++ if (this.customPersistentData == null) ++ this.customPersistentData = new CompoundTag(); ++ return this.customPersistentData; ++ } ++ ++ @Override ++ @Nullable ++ public final T setData(net.neoforged.neoforge.attachment.AttachmentType type, T data) { ++ setChanged(); ++ return super.setData(type, data); ++ } ++ ++ @Override ++ @Nullable ++ public final T removeData(net.neoforged.neoforge.attachment.AttachmentType type) { ++ setChanged(); ++ return super.removeData(type); ++ } ++ + @Deprecated + public void setBlockState(BlockState p_155251_) { + this.blockState = p_155251_; +++++ END HUNK + +++++ REJECTED HUNK: 7 +@@ -309,5 +341,15 @@ + T get(DataComponentType p_338658_); + + T getOrDefault(DataComponentType p_338573_, T p_338734_); ++ ++ // Neo: Utility for modded component types, to remove the need to invoke '.value()' ++ @Nullable ++ default T get(java.util.function.Supplier> componentType) { ++ return get(componentType.get()); ++ } ++ ++ default T getOrDefault(java.util.function.Supplier> componentType, T value) { ++ return getOrDefault(componentType.get(), value); ++ } + } + } +++++ END HUNK diff --git a/rejects/net/minecraft/world/level/chunk/LevelChunk.java.patch.rej b/rejects/net/minecraft/world/level/chunk/LevelChunk.java.patch.rej new file mode 100644 index 00000000..34958294 --- /dev/null +++ b/rejects/net/minecraft/world/level/chunk/LevelChunk.java.patch.rej @@ -0,0 +1,160 @@ +++++ REJECTED HUNK: 4 +@@ -322,6 +323,10 @@ + @Nullable + public BlockEntity getBlockEntity(BlockPos p_62868_, LevelChunk.EntityCreationType p_62869_) { + BlockEntity blockentity = this.blockEntities.get(p_62868_); ++ if (blockentity != null && blockentity.isRemoved()) { ++ blockEntities.remove(p_62868_); ++ blockentity = null; ++ } + if (blockentity == null) { + CompoundTag compoundtag = this.pendingBlockEntities.remove(p_62868_); + if (compoundtag != null) { +++++ END HUNK + +++++ REJECTED HUNK: 5 +@@ -339,9 +344,6 @@ + this.addAndRegisterBlockEntity(blockentity); + } + } +- } else if (blockentity.isRemoved()) { +- this.blockEntities.remove(p_62868_); +- return null; + } + + return blockentity; +++++ END HUNK + +++++ REJECTED HUNK: 6 +@@ -355,6 +357,7 @@ + } + + this.updateBlockEntityTicker(p_156391_); ++ this.level.addFreshBlockEntities(java.util.List.of(p_156391_)); + } + } + +++++ END HUNK + +++++ REJECTED HUNK: 7 +@@ -398,6 +401,7 @@ + BlockEntity blockentity = this.blockEntities.put(blockpos.immutable(), p_156374_); + if (blockentity != null && blockentity != p_156374_) { + blockentity.setRemoved(); ++ auxLightManager.removeLightAt(blockpos); + } + } + } +++++ END HUNK + +++++ REJECTED HUNK: 8 +@@ -407,9 +411,14 @@ + public CompoundTag getBlockEntityNbtForSaving(BlockPos p_62932_, HolderLookup.Provider p_323699_) { + BlockEntity blockentity = this.getBlockEntity(p_62932_); + if (blockentity != null && !blockentity.isRemoved()) { ++ try { + CompoundTag compoundtag1 = blockentity.saveWithFullMetadata(this.level.registryAccess()); + compoundtag1.putBoolean("keepPacked", false); + return compoundtag1; ++ } catch (Exception e) { ++ LOGGER.error("A BlockEntity type {} has thrown an exception trying to write state. It will not persist, Report this to the mod author", blockentity.getClass().getName(), e); ++ return null; ++ } + } else { + CompoundTag compoundtag = this.pendingBlockEntities.get(p_62932_); + if (compoundtag != null) { +++++ END HUNK + +++++ REJECTED HUNK: 9 +@@ -431,6 +440,7 @@ + } + + blockentity.setRemoved(); ++ auxLightManager.removeLightAt(p_62919_); + } + } + +++++ END HUNK + +++++ REJECTED HUNK: 10 +@@ -491,7 +501,7 @@ + p_187974_.accept((p_338077_, p_338078_, p_338079_) -> { + BlockEntity blockentity = this.getBlockEntity(p_338077_, LevelChunk.EntityCreationType.IMMEDIATE); + if (blockentity != null && p_338079_ != null && blockentity.getType() == p_338078_) { +- blockentity.loadWithComponents(p_338079_, this.level.registryAccess()); ++ blockentity.handleUpdateTag(p_338079_, this.level.registryAccess()); + } + }); + } +++++ END HUNK + +++++ REJECTED HUNK: 11 +@@ -599,6 +609,7 @@ + } + + public void clearAllBlockEntities() { ++ this.blockEntities.values().forEach(BlockEntity::onChunkUnloaded); + this.blockEntities.values().forEach(BlockEntity::setRemoved); + this.blockEntities.clear(); + this.tickersInLevel.values().forEach(p_187966_ -> p_187966_.rebind(NULL_TICKER)); +++++ END HUNK + +++++ REJECTED HUNK: 12 +@@ -606,6 +617,7 @@ + } + + public void registerAllBlockEntitiesAfterLevelLoad() { ++ this.level.addFreshBlockEntities(this.blockEntities.values()); + this.blockEntities.values().forEach(p_187988_ -> { + if (this.level instanceof ServerLevel serverlevel) { + this.addGameEventListener(p_187988_, serverlevel); +++++ END HUNK + +++++ REJECTED HUNK: 13 +@@ -657,6 +669,15 @@ + return new LevelChunk.BoundTickingBlockEntity<>(p_156376_, p_156377_); + } + ++ // FORGE START ++ private final net.neoforged.neoforge.common.world.LevelChunkAuxiliaryLightManager auxLightManager = new net.neoforged.neoforge.common.world.LevelChunkAuxiliaryLightManager(this); ++ ++ @Override ++ public net.neoforged.neoforge.common.world.LevelChunkAuxiliaryLightManager getAuxLightManager(ChunkPos pos) { ++ return auxLightManager; ++ } ++ // FORGE END ++ + class BoundTickingBlockEntity implements TickingBlockEntity { + private final T blockEntity; + private final BlockEntityTicker ticker; +++++ END HUNK + +++++ REJECTED HUNK: 14 +@@ -674,6 +695,7 @@ + if (LevelChunk.this.isTicking(blockpos)) { + try { + ProfilerFiller profilerfiller = LevelChunk.this.level.getProfiler(); ++ net.neoforged.neoforge.server.timings.TimeTracker.BLOCK_ENTITY_UPDATE.trackStart(blockEntity); + profilerfiller.push(this::getType); + BlockState blockstate = LevelChunk.this.getBlockState(blockpos); + if (this.blockEntity.getType().isValid(blockstate)) { +++++ END HUNK + +++++ REJECTED HUNK: 15 +@@ -695,7 +717,15 @@ + CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking block entity"); + CrashReportCategory crashreportcategory = crashreport.addCategory("Block entity being ticked"); + this.blockEntity.fillCrashReportCategory(crashreportcategory); ++ ++ if (net.neoforged.neoforge.common.NeoForgeConfig.SERVER.removeErroringBlockEntities.get()) { ++ LOGGER.error("{}", crashreport.getFriendlyReport(net.minecraft.ReportType.CRASH)); ++ blockEntity.setRemoved(); ++ LevelChunk.this.removeBlockEntity(blockEntity.getBlockPos()); ++ } else + throw new ReportedException(crashreport); ++ } finally { ++ net.neoforged.neoforge.server.timings.TimeTracker.BLOCK_ENTITY_UPDATE.trackEnd(blockEntity); + } + } + } +++++ END HUNK