diff --git a/build_forge.gradle b/build_forge.gradle index f9a47c03c9..a19aad372f 100644 --- a/build_forge.gradle +++ b/build_forge.gradle @@ -1028,7 +1028,7 @@ publishing { } // Make sure we run bin compat checking during local testing. -if (!System.env.MAVEN_USER || !System.env.MAVEN_PASSWORD) - publish.dependsOn(':forge:checkJarCompatibility') +//if (!System.env.MAVEN_USER || !System.env.MAVEN_PASSWORD) +// publish.dependsOn(':forge:checkJarCompatibility') apply from: rootProject.file('build_forge_eclipse.gradle') \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 877d766b4d..ffa1c1ef74 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@ MinecraftForge ============= [![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.20.2&query=$.promos["1.20.2-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)][Download] -[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.20.2-&query=$.promos["1.20.2-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo= +[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.20.3-&query=$.promos["1.20.3-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo= )][Download] [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)][Discord] [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)][Patreon] Forge is a free, open-source modding API all of your favourite mods use! diff --git a/gradle.properties b/gradle.properties index c3e75e0e86..618f226812 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false JAVA_VERSION=17 -MC_VERSION=1.20.2 +MC_VERSION=1.20.3 MC_NEXT_VERSION=1.21 -MCP_VERSION=20230921.100330 +MCP_VERSION=20231205.124940 MAPPING_CHANNEL=official -MAPPING_VERSION=1.20.2 +MAPPING_VERSION=1.20.3 diff --git a/patches/minecraft/com/mojang/blaze3d/vertex/BufferBuilder.java.patch b/patches/minecraft/com/mojang/blaze3d/vertex/BufferBuilder.java.patch index 1509c543ac..c7fda2cc7f 100644 --- a/patches/minecraft/com/mojang/blaze3d/vertex/BufferBuilder.java.patch +++ b/patches/minecraft/com/mojang/blaze3d/vertex/BufferBuilder.java.patch @@ -1,6 +1,6 @@ --- a/com/mojang/blaze3d/vertex/BufferBuilder.java +++ b/com/mojang/blaze3d/vertex/BufferBuilder.java -@@ -459,4 +_,14 @@ +@@ -477,4 +_,14 @@ this.sorting = p_277855_; } } diff --git a/patches/minecraft/net/minecraft/CrashReport.java.patch b/patches/minecraft/net/minecraft/CrashReport.java.patch index aa5b48961a..33d672bdb6 100644 --- a/patches/minecraft/net/minecraft/CrashReport.java.patch +++ b/patches/minecraft/net/minecraft/CrashReport.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/CrashReport.java +++ b/net/minecraft/CrashReport.java -@@ -57,14 +_,9 @@ +@@ -59,14 +_,9 @@ if (this.uncategorizedStackTrace != null && this.uncategorizedStackTrace.length > 0) { p_127520_.append("-- Head --\n"); p_127520_.append("Thread: ").append(Thread.currentThread().getName()).append("\n"); @@ -18,7 +18,7 @@ } for(CrashReportCategory crashreportcategory : this.details) { -@@ -72,6 +_,7 @@ +@@ -74,6 +_,7 @@ p_127520_.append("\n\n"); } @@ -26,7 +26,7 @@ this.systemReport.appendToCrashReportString(p_127520_); } -@@ -91,18 +_,7 @@ +@@ -93,18 +_,7 @@ throwable.setStackTrace(this.exception.getStackTrace()); } diff --git a/patches/minecraft/net/minecraft/SharedConstants.java.patch b/patches/minecraft/net/minecraft/SharedConstants.java.patch index d78e9207fa..437da75173 100644 --- a/patches/minecraft/net/minecraft/SharedConstants.java.patch +++ b/patches/minecraft/net/minecraft/SharedConstants.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/SharedConstants.java +++ b/net/minecraft/SharedConstants.java -@@ -212,6 +_,7 @@ +@@ -215,6 +_,7 @@ } static { diff --git a/patches/minecraft/net/minecraft/Util.java.patch b/patches/minecraft/net/minecraft/Util.java.patch index 75a4baabaf..7337f3fb16 100644 --- a/patches/minecraft/net/minecraft/Util.java.patch +++ b/patches/minecraft/net/minecraft/Util.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/Util.java +++ b/net/minecraft/Util.java -@@ -172,6 +_,11 @@ +@@ -180,6 +_,11 @@ return 255; } @@ -12,7 +12,7 @@ public static ExecutorService backgroundExecutor() { return BACKGROUND_EXECUTOR; } -@@ -240,7 +_,7 @@ +@@ -254,7 +_,7 @@ try { type = DataFixers.getDataFixer().getSchema(DataFixUtils.makeKey(SharedConstants.getCurrentVersion().getDataVersion().getVersion())).getChoiceType(p_137552_, p_137553_); } catch (IllegalArgumentException illegalargumentexception) { diff --git a/patches/minecraft/net/minecraft/advancements/Advancement.java.patch b/patches/minecraft/net/minecraft/advancements/Advancement.java.patch index 2edaf1bc74..561428a8bd 100644 --- a/patches/minecraft/net/minecraft/advancements/Advancement.java.patch +++ b/patches/minecraft/net/minecraft/advancements/Advancement.java.patch @@ -1,21 +1,6 @@ --- a/net/minecraft/advancements/Advancement.java +++ b/net/minecraft/advancements/Advancement.java -@@ -62,7 +_,14 @@ - return jsonobject; - } - -+ /** @deprecated Forge: use {@linkplain #fromJson(JsonObject, DeserializationContext, net.minecraftforge.common.crafting.conditions.ICondition.IContext) overload with context}. */ -+ @Deprecated - public static Advancement fromJson(JsonObject p_300691_, DeserializationContext p_300053_) { -+ return fromJson(p_300691_, p_300053_, net.minecraftforge.common.crafting.conditions.ICondition.IContext.EMPTY); -+ } -+ -+ public static Advancement fromJson(JsonObject p_300691_, DeserializationContext p_300053_, net.minecraftforge.common.crafting.conditions.ICondition.IContext context) { -+ if ((p_300691_ = net.minecraftforge.common.ForgeHooks.readConditionalAdvancement(context, p_300691_)) == null) return null; - Optional optional = p_300691_.has("parent") ? Optional.of(new ResourceLocation(GsonHelper.getAsString(p_300691_, "parent"))) : Optional.empty(); - Optional optional1 = p_300691_.has("display") ? Optional.of(DisplayInfo.fromJson(GsonHelper.getAsJsonObject(p_300691_, "display"))) : Optional.empty(); - AdvancementRewards advancementrewards = p_300691_.has("rewards") ? AdvancementRewards.deserialize(GsonHelper.getAsJsonObject(p_300691_, "rewards")) : AdvancementRewards.EMPTY; -@@ -182,7 +_,11 @@ +@@ -171,7 +_,11 @@ } public AdvancementHolder save(Consumer p_138390_, String p_138391_) { diff --git a/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch b/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch index 98c186d76a..571ebedca2 100644 --- a/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch +++ b/patches/minecraft/net/minecraft/advancements/AdvancementRewards.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/advancements/AdvancementRewards.java +++ b/net/minecraft/advancements/AdvancementRewards.java -@@ -43,7 +_,7 @@ +@@ -27,7 +_,7 @@ public void grant(ServerPlayer p_9990_) { p_9990_.giveExperiencePoints(this.experience); diff --git a/patches/minecraft/net/minecraft/advancements/CriteriaTriggers.java.patch b/patches/minecraft/net/minecraft/advancements/CriteriaTriggers.java.patch deleted file mode 100644 index fe36b86807..0000000000 --- a/patches/minecraft/net/minecraft/advancements/CriteriaTriggers.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/advancements/CriteriaTriggers.java -+++ b/net/minecraft/advancements/CriteriaTriggers.java -@@ -46,7 +_,7 @@ - import net.minecraft.resources.ResourceLocation; - - public class CriteriaTriggers { -- private static final BiMap> CRITERIA = HashBiMap.create(); -+ private static final BiMap> CRITERIA = com.google.common.collect.Maps.synchronizedBiMap(HashBiMap.create()); - public static final ImpossibleTrigger IMPOSSIBLE = register("impossible", new ImpossibleTrigger()); - public static final KilledTrigger PLAYER_KILLED_ENTITY = register("player_killed_entity", new KilledTrigger()); - public static final KilledTrigger ENTITY_KILLED_PLAYER = register("entity_killed_player", new KilledTrigger()); diff --git a/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch b/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch index bd50773003..1e0867f5de 100644 --- a/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch +++ b/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/advancements/critereon/ItemPredicate.java +++ b/net/minecraft/advancements/critereon/ItemPredicate.java -@@ -50,7 +_,7 @@ +@@ -45,7 +_,7 @@ return false; } else { if (!this.enchantments.isEmpty()) { diff --git a/patches/minecraft/net/minecraft/client/Camera.java.patch b/patches/minecraft/net/minecraft/client/Camera.java.patch index 58c330568f..90b7599b05 100644 --- a/patches/minecraft/net/minecraft/client/Camera.java.patch +++ b/patches/minecraft/net/minecraft/client/Camera.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/client/Camera.java +++ b/net/minecraft/client/Camera.java -@@ -206,6 +_,18 @@ - this.initialized = false; +@@ -212,6 +_,18 @@ + return this.partialTickTime; } + public void setAnglesInternal(float yaw, float pitch) { diff --git a/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch b/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch index 4bbfdcbef5..ddd2ef2bd9 100644 --- a/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch +++ b/patches/minecraft/net/minecraft/client/KeyboardHandler.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/KeyboardHandler.java +++ b/net/minecraft/client/KeyboardHandler.java -@@ -380,11 +_,15 @@ +@@ -397,11 +_,15 @@ Screen.wrapScreenError(() -> { if (p_90897_ != 1 && p_90897_ != 2) { if (p_90897_ == 0) { @@ -18,11 +18,10 @@ } }, "keyPressed event handler", screen.getClass().getCanonicalName()); -@@ -443,22 +_,26 @@ - this.minecraft.debugFpsMeterKeyPress(p_90895_ - 48); +@@ -478,21 +_,26 @@ } + } -- + net.minecraftforge.client.ForgeHooksClient.onKeyInput(p_90895_, p_90896_, p_90897_, p_90898_); } } diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index d0683f5773..3c63b2a618 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/Minecraft.java +++ b/net/minecraft/client/Minecraft.java -@@ -252,7 +_,7 @@ +@@ -254,7 +_,7 @@ import org.slf4j.Logger; @OnlyIn(Dist.CLIENT) @@ -9,15 +9,15 @@ static Minecraft instance; private static final Logger LOGGER = LogUtils.getLogger(); public static final boolean ON_OSX = Util.getPlatform() == Util.OS.OSX; -@@ -422,7 +_,6 @@ - }, Util.ioPool()); - this.userApiService = this.createUserApiService(this.authenticationService, p_91084_); +@@ -438,7 +_,6 @@ + } + }, Util.nonCriticalIoPool()); LOGGER.info("Setting user: {}", (Object)this.user.getName()); - LOGGER.debug("(Session ID is {})", (Object)this.user.getSessionId()); this.demo = p_91084_.game.demo; this.allowsMultiplayer = !p_91084_.game.disableMultiplayer; this.allowsChat = !p_91084_.game.disableChat; -@@ -458,15 +_,15 @@ +@@ -474,15 +_,15 @@ } this.window.setFramerateLimit(this.options.framerateLimit().get()); @@ -35,7 +35,7 @@ this.resourcePackRepository.reload(); this.options.loadSelectedResourcePacks(this.resourcePackRepository); this.languageManager = new LanguageManager(this.options.languageCode); -@@ -512,10 +_,13 @@ +@@ -538,10 +_,13 @@ this.gameRenderer = new GameRenderer(this, this.entityRenderDispatcher.getItemInHandRenderer(), this.resourceManager, this.renderBuffers); this.resourceManager.registerReloadListener(this.gameRenderer.createReloadListener()); this.levelRenderer = new LevelRenderer(this, this.entityRenderDispatcher, this.blockEntityRenderDispatcher, this.renderBuffers); @@ -50,7 +50,7 @@ this.resourceManager.registerReloadListener(this.particleEngine); this.paintingTextures = new PaintingTextureManager(this.textureManager); this.resourceManager.registerReloadListener(this.paintingTextures); -@@ -526,7 +_,10 @@ +@@ -552,7 +_,10 @@ this.gpuWarnlistManager = new GpuWarnlistManager(); this.resourceManager.registerReloadListener(this.gpuWarnlistManager); this.resourceManager.registerReloadListener(this.regionalCompliancies); @@ -62,7 +62,7 @@ this.debugRenderer = new DebugRenderer(this); RealmsClient realmsclient = RealmsClient.create(this); this.realmsDataFetcher = new RealmsDataFetcher(realmsclient); -@@ -546,6 +_,7 @@ +@@ -572,6 +_,7 @@ TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false); } @@ -70,7 +70,7 @@ this.window.updateVsync(this.options.enableVsync().get()); this.window.updateRawMouseInput(this.options.rawMouseInput().get()); this.window.setDefaultErrorCallback(); -@@ -565,7 +_,7 @@ +@@ -592,7 +_,7 @@ ReloadInstance reloadinstance = this.resourceManager.createReload(Util.backgroundExecutor(), this, RESOURCE_RELOAD_INITIAL_TASK, list); GameLoadTimesEvent.INSTANCE.beginStep(TelemetryProperty.LOAD_TIME_LOADING_OVERLAY_MS); Minecraft.GameLoadCookie minecraft$gameloadcookie = new Minecraft.GameLoadCookie(realmsclient, p_91084_.quickPlay); @@ -79,7 +79,7 @@ Util.ifElse(p_296164_, (p_296162_) -> { this.rollbackResourcePacks(p_296162_, minecraft$gameloadcookie); }, () -> { -@@ -575,8 +_,10 @@ +@@ -602,8 +_,10 @@ this.reloadStateTracker.finishReload(); this.onResourceLoadFinished(minecraft$gameloadcookie); @@ -91,7 +91,7 @@ this.quickPlayLog = QuickPlayLog.of(p_91084_.quickPlay.path()); } -@@ -674,7 +_,7 @@ +@@ -701,7 +_,7 @@ private String createTitle() { StringBuilder stringbuilder = new StringBuilder("Minecraft"); if (checkModStatus().shouldReportAsModified()) { @@ -100,16 +100,16 @@ } stringbuilder.append(" "); -@@ -699,6 +_,8 @@ +@@ -725,6 +_,8 @@ + } private UserApiService createUserApiService(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) { - try { -+ if ("0".equals(p_193587_.user.user.getAccessToken())) // Forge: We use "0" in dev. Short circuit to stop exception spam. -+ return UserApiService.OFFLINE; - return p_193586_.createUserApiService(p_193587_.user.user.getAccessToken()); - } catch (AuthenticationException authenticationexception) { - LOGGER.error("Failed to verify authentication", (Throwable)authenticationexception); -@@ -711,7 +_,7 @@ ++ if ("0".equals(p_193587_.user.user.getAccessToken())) // Forge: We use "0" in dev. Short circuit to stop exception spam. ++ return UserApiService.OFFLINE; + return p_193586_.createUserApiService(p_193587_.user.user.getAccessToken()); + } + +@@ -733,7 +_,7 @@ } private void rollbackResourcePacks(Throwable p_91240_, @Nullable Minecraft.GameLoadCookie p_299515_) { @@ -118,7 +118,7 @@ this.clearResourcePacksOnError(p_91240_, (Component)null, p_299515_); } else { Util.throwAsRuntime(p_91240_); -@@ -803,7 +_,10 @@ +@@ -819,7 +_,10 @@ } public void createSearchTrees() { @@ -130,7 +130,7 @@ return new FullTextSearchTree<>((p_210797_) -> { return p_210797_.getTooltipLines((Player)null, TooltipFlag.Default.NORMAL.asCreative()).stream().map((p_231455_) -> { return ChatFormatting.stripFormatting(p_231455_.getString()).trim(); -@@ -814,7 +_,8 @@ +@@ -830,7 +_,8 @@ return Stream.of(BuiltInRegistries.ITEM.getKey(p_91317_.getItem())); }, p_231451_); }); @@ -140,7 +140,7 @@ return new IdSearchTree<>((p_231353_) -> { return p_231353_.getTags().map(TagKey::location); }, p_231430_); -@@ -834,9 +_,12 @@ +@@ -850,9 +_,12 @@ }); }, p_301514_); }); @@ -156,7 +156,7 @@ }); } -@@ -1019,10 +_,6 @@ +@@ -1054,10 +_,6 @@ LOGGER.error("setScreen called from non-game thread"); } @@ -164,30 +164,30 @@ - this.screen.removed(); - } - - if (p_91153_ == null && this.level == null) { - p_91153_ = new TitleScreen(); - } else if (p_91153_ == null && this.player.isDeadOrDying()) { -@@ -1033,6 +_,19 @@ + if (p_91153_ == null && this.clientLevelTeardownInProgress) { + throw new IllegalStateException("Trying to return to in-game GUI during disconnection"); + } else { +@@ -1071,6 +_,19 @@ + } } - } -+ net.minecraftforge.client.ForgeHooksClient.clearGuiLayers(this); -+ Screen old = this.screen; -+ if (p_91153_ != null) { -+ var event = net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenOpening(old, p_91153_); -+ if (event == null) return; -+ p_91153_ = event; -+ } ++ net.minecraftforge.client.ForgeHooksClient.clearGuiLayers(this); ++ Screen old = this.screen; ++ if (p_91153_ != null) { ++ var event = net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenOpening(old, p_91153_); ++ if (event == null) return; ++ p_91153_ = event; ++ } + -+ if (old != null && p_91153_ != old) { -+ net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenClose(old); -+ old.removed(); -+ } ++ if (old != null && p_91153_ != old) { ++ net.minecraftforge.client.event.ForgeEventFactoryClient.onScreenClose(old); ++ old.removed(); ++ } + - this.screen = p_91153_; - if (this.screen != null) { - this.screen.added(); -@@ -1179,9 +_,12 @@ + this.screen = p_91153_; + if (this.screen != null) { + this.screen.added(); +@@ -1218,9 +_,12 @@ RenderSystem.enableCull(); this.profiler.pop(); if (!this.noRender) { @@ -200,7 +200,7 @@ } if (this.fpsPieResults != null) { -@@ -1223,6 +_,7 @@ +@@ -1262,6 +_,7 @@ } this.pause = flag1; @@ -208,7 +208,7 @@ } long l = Util.getNanos(); -@@ -1302,10 +_,12 @@ +@@ -1341,10 +_,12 @@ this.window.setGuiScale((double)i); if (this.screen != null) { this.screen.resize(this, this.window.getGuiScaledWidth(), this.window.getGuiScaledHeight()); @@ -221,7 +221,7 @@ this.gameRenderer.resize(this.window.getWidth(), this.window.getHeight()); this.mouseHandler.setIgnoreFirstMove(); } -@@ -1579,6 +_,7 @@ +@@ -1618,6 +_,7 @@ } public void stop() { @@ -229,7 +229,7 @@ this.running = false; } -@@ -1608,10 +_,18 @@ +@@ -1647,10 +_,18 @@ if (p_91387_ && this.hitResult != null && this.hitResult.getType() == HitResult.Type.BLOCK) { BlockHitResult blockhitresult = (BlockHitResult)this.hitResult; BlockPos blockpos = blockhitresult.getBlockPos(); @@ -251,7 +251,7 @@ this.player.swing(InteractionHand.MAIN_HAND); } } -@@ -1640,6 +_,8 @@ +@@ -1679,6 +_,8 @@ return false; } else { boolean flag = false; @@ -260,7 +260,7 @@ switch (this.hitResult.getType()) { case ENTITY: this.gameMode.attack(this.player, ((EntityHitResult)this.hitResult).getEntity()); -@@ -1647,7 +_,7 @@ +@@ -1686,7 +_,7 @@ case BLOCK: BlockHitResult blockhitresult = (BlockHitResult)this.hitResult; BlockPos blockpos = blockhitresult.getBlockPos(); @@ -269,7 +269,7 @@ this.gameMode.startDestroyBlock(blockpos, blockhitresult.getDirection()); if (this.level.getBlockState(blockpos).isAir()) { flag = true; -@@ -1660,8 +_,10 @@ +@@ -1699,8 +_,10 @@ } this.player.resetAttackStrengthTicker(); @@ -280,7 +280,7 @@ this.player.swing(InteractionHand.MAIN_HAND); return flag; } -@@ -1677,6 +_,11 @@ +@@ -1716,6 +_,11 @@ } for(InteractionHand interactionhand : InteractionHand.values()) { @@ -292,7 +292,7 @@ ItemStack itemstack = this.player.getItemInHand(interactionhand); if (!itemstack.isItemEnabled(this.level.enabledFeatures())) { return; -@@ -1697,7 +_,7 @@ +@@ -1736,7 +_,7 @@ } if (interactionresult.consumesAction()) { @@ -301,7 +301,7 @@ this.player.swing(interactionhand); } -@@ -1709,7 +_,7 @@ +@@ -1748,7 +_,7 @@ int i = itemstack.getCount(); InteractionResult interactionresult1 = this.gameMode.useItemOn(this.player, interactionhand, blockhitresult); if (interactionresult1.consumesAction()) { @@ -310,7 +310,7 @@ this.player.swing(interactionhand); if (!itemstack.isEmpty() && (itemstack.getCount() != i || this.gameMode.hasInfiniteItems())) { this.gameRenderer.itemInHandRenderer.itemUsed(interactionhand); -@@ -1725,6 +_,9 @@ +@@ -1764,6 +_,9 @@ } } @@ -320,7 +320,7 @@ if (!itemstack.isEmpty()) { InteractionResult interactionresult2 = this.gameMode.useItem(this.player, interactionhand); if (interactionresult2.consumesAction()) { -@@ -1751,6 +_,8 @@ +@@ -1795,6 +_,8 @@ --this.rightClickDelay; } @@ -329,7 +329,7 @@ this.profiler.push("gui"); this.chatListener.tick(); this.gui.tick(this.pause); -@@ -1839,6 +_,7 @@ +@@ -1887,6 +_,7 @@ this.tutorial.tick(); @@ -337,7 +337,7 @@ try { this.level.tick(() -> { return true; -@@ -1854,6 +_,7 @@ +@@ -1902,6 +_,7 @@ throw new ReportedException(crashreport); } @@ -345,7 +345,7 @@ } this.profiler.popPush("animateTick"); -@@ -1873,6 +_,8 @@ +@@ -1921,6 +_,8 @@ this.profiler.popPush("keyboard"); this.keyboardHandler.tick(); this.profiler.pop(); @@ -354,36 +354,39 @@ } private boolean isMultiplayerServer() { -@@ -2069,6 +_,7 @@ +@@ -2112,6 +_,7 @@ } public void setLevel(ClientLevel p_91157_) { -+ if (this.level != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(this.level)); ++ if (this.level != null) net.minecraftforge.event.ForgeEventFactory.onLevelUnload(this.level); ProgressScreen progressscreen = new ProgressScreen(true); progressscreen.progressStartNoAbort(Component.translatable("connect.joining")); this.updateScreenAndTick(progressscreen); -@@ -2102,10 +_,12 @@ +@@ -2146,6 +_,7 @@ IntegratedServer integratedserver = this.singleplayerServer; this.singleplayerServer = null; this.gameRenderer.resetData(); + net.minecraftforge.client.ForgeHooksClient.firePlayerLogout(this.gameMode, this.player); this.gameMode = null; this.narrator.clear(); - this.updateScreenAndTick(p_91321_); - if (this.level != null) { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(this.level)); - if (integratedserver != null) { - this.profiler.push("waitForServer"); + this.clientLevelTeardownInProgress = true; +@@ -2153,6 +_,7 @@ + try { + this.updateScreenAndTick(p_91321_); + if (this.level != null) { ++ net.minecraftforge.event.ForgeEventFactory.onLevelUnload(this.level); + if (integratedserver != null) { + this.profiler.push("waitForServer"); -@@ -2119,6 +_,7 @@ - this.downloadedPackSource.clearServerPack(); - this.gui.onDisconnected(); - this.isLocalServer = false; -+ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(this.level); - } +@@ -2165,6 +_,7 @@ - this.level = null; -@@ -2243,6 +_,7 @@ + this.gui.onDisconnected(); + this.isLocalServer = false; ++ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(this.level); + } + + this.level = null; +@@ -2313,6 +_,7 @@ private void pickBlock() { if (this.hitResult != null && this.hitResult.getType() != HitResult.Type.MISS) { @@ -391,7 +394,7 @@ boolean flag = this.player.getAbilities().instabuild; BlockEntity blockentity = null; HitResult.Type hitresult$type = this.hitResult.getType(); -@@ -2255,10 +_,7 @@ +@@ -2325,10 +_,7 @@ } Block block = blockstate.getBlock(); @@ -403,7 +406,7 @@ if (flag && Screen.hasControlDown() && blockstate.hasBlockEntity()) { blockentity = this.level.getBlockEntity(blockpos); -@@ -2269,7 +_,7 @@ +@@ -2339,7 +_,7 @@ } Entity entity = ((EntityHitResult)this.hitResult).getEntity(); @@ -412,7 +415,7 @@ if (itemstack == null) { return; } -@@ -2808,6 +_,19 @@ +@@ -2904,6 +_,19 @@ public void updateMaxMipLevel(int p_91313_) { this.modelManager.updateMaxMipLevel(p_91313_); diff --git a/patches/minecraft/net/minecraft/client/Options.java.patch b/patches/minecraft/net/minecraft/client/Options.java.patch index 98794e69c6..6e80571053 100644 --- a/patches/minecraft/net/minecraft/client/Options.java.patch +++ b/patches/minecraft/net/minecraft/client/Options.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/Options.java +++ b/net/minecraft/client/Options.java -@@ -507,7 +_,8 @@ +@@ -509,7 +_,8 @@ }, new OptionInstance.LazyEnum<>(() -> { return Stream.concat(Stream.of(""), Minecraft.getInstance().getSoundManager().getAvailableSoundDevices().stream()).toList(); }, (p_232011_) -> { @@ -10,7 +10,7 @@ }, Codec.STRING), "", (p_299350_) -> { SoundManager soundmanager = Minecraft.getInstance().getSoundManager(); soundmanager.reload(); -@@ -835,6 +_,7 @@ +@@ -841,6 +_,7 @@ } public Options(Minecraft p_92138_, File p_92139_) { @@ -18,7 +18,7 @@ this.minecraft = p_92138_; this.optionsFile = new File(p_92139_, "options.txt"); boolean flag = p_92138_.is64Bit(); -@@ -957,11 +_,20 @@ +@@ -964,11 +_,20 @@ p_168428_.process("telemetryOptInExtra", this.telemetryOptInExtra); this.onboardAccessibility = p_168428_.process("onboardAccessibility", this.onboardAccessibility); @@ -41,7 +41,7 @@ } } -@@ -980,6 +_,9 @@ +@@ -987,6 +_,9 @@ } public void load() { @@ -51,7 +51,7 @@ try { if (!this.optionsFile.exists()) { return; -@@ -1008,7 +_,8 @@ +@@ -1015,7 +_,8 @@ } } @@ -61,7 +61,7 @@ @Nullable private String getValueOrNull(String p_168459_) { return compoundtag1.contains(p_168459_) ? compoundtag1.getString(p_168459_) : null; -@@ -1181,6 +_,7 @@ +@@ -1188,6 +_,7 @@ } public void broadcastOptions() { @@ -69,7 +69,7 @@ if (this.minecraft.player != null) { this.minecraft.player.connection.send(new ServerboundClientInformationPacket(this.buildPlayerInformation())); } -@@ -1239,6 +_,23 @@ +@@ -1246,6 +_,23 @@ } p_92146_.setSelected(set); diff --git a/patches/minecraft/net/minecraft/client/gui/Gui.java.patch b/patches/minecraft/net/minecraft/client/gui/Gui.java.patch index 4913538082..15c17005c6 100644 --- a/patches/minecraft/net/minecraft/client/gui/Gui.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/Gui.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/Gui.java +++ b/net/minecraft/client/gui/Gui.java -@@ -130,7 +_,7 @@ +@@ -131,7 +_,7 @@ public float vignetteBrightness = 1.0F; protected int toolHighlightTimer; protected ItemStack lastToolHighlight = ItemStack.EMPTY; @@ -9,7 +9,7 @@ protected final SubtitleOverlay subtitleOverlay; protected final SpectatorGui spectatorGui; protected final PlayerTabOverlay tabList; -@@ -453,6 +_,8 @@ +@@ -454,6 +_,8 @@ for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) { MobEffect mobeffect = mobeffectinstance.getEffect(); @@ -18,7 +18,7 @@ if (mobeffectinstance.showIcon()) { int i = this.screenWidth; int j = 1; -@@ -481,6 +_,7 @@ +@@ -482,6 +_,7 @@ } } @@ -26,7 +26,7 @@ TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.get(mobeffect); int i1 = j; float f1 = f; -@@ -601,16 +_,21 @@ +@@ -602,16 +_,21 @@ } public void renderSelectedItemName(GuiGraphics p_283501_) { @@ -51,7 +51,7 @@ if (!this.minecraft.gameMode.canHurtPlayer()) { k += 14; } -@@ -622,7 +_,13 @@ +@@ -623,7 +_,13 @@ if (l > 0) { p_283501_.fill(j - 2, k - 2, j + i + 2, k + 9 + 2, this.minecraft.options.getBackgroundColor(0)); @@ -66,7 +66,7 @@ } } -@@ -1069,7 +_,7 @@ +@@ -1080,7 +_,7 @@ ItemStack itemstack = this.minecraft.player.getInventory().getSelected(); if (itemstack.isEmpty()) { this.toolHighlightTimer = 0; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiGraphics.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiGraphics.java.patch index 2b00717d05..1d0e86149a 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiGraphics.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiGraphics.java.patch @@ -33,7 +33,7 @@ int i = p_282636_.drawInBatch(p_281596_, (float)p_281586_, (float)p_282816_, p_281743_, p_282394_, this.pose.last().pose(), this.bufferSource, Font.DisplayMode.NORMAL, 0, 15728880); this.flushIfUnmanaged(); return i; -@@ -511,6 +_,7 @@ +@@ -515,6 +_,7 @@ crashreportcategory.setDetail("Item Type", () -> { return String.valueOf((Object)p_281675_.getItem()); }); @@ -41,7 +41,7 @@ crashreportcategory.setDetail("Item Damage", () -> { return String.valueOf(p_281675_.getDamageValue()); }); -@@ -558,18 +_,26 @@ +@@ -562,18 +_,26 @@ } this.pose.popPose(); @@ -72,7 +72,7 @@ this.renderTooltipInternal(p_283128_, list, p_283678_, p_281696_, DefaultTooltipPositioner.INSTANCE); } -@@ -578,7 +_,15 @@ +@@ -582,7 +_,15 @@ } public void renderComponentTooltip(Font p_282739_, List p_281832_, int p_282191_, int p_282446_) { @@ -89,7 +89,7 @@ } public void renderTooltip(Font p_282192_, List p_282297_, int p_281680_, int p_283325_) { -@@ -591,11 +_,13 @@ +@@ -595,11 +_,13 @@ private void renderTooltipInternal(Font p_282675_, List p_282615_, int p_283230_, int p_283417_, ClientTooltipPositioner p_282442_) { if (!p_282615_.isEmpty()) { @@ -104,7 +104,7 @@ if (k > i) { i = k; } -@@ -605,20 +_,21 @@ +@@ -609,20 +_,21 @@ int i2 = i; int j2 = j; @@ -129,7 +129,7 @@ k1 += clienttooltipcomponent1.getHeight() + (l1 == 0 ? 2 : 0); } -@@ -626,7 +_,7 @@ +@@ -630,7 +_,7 @@ for(int k2 = 0; k2 < p_282615_.size(); ++k2) { ClientTooltipComponent clienttooltipcomponent2 = p_282615_.get(k2); diff --git a/patches/minecraft/net/minecraft/client/gui/components/AbstractSelectionList.java.patch b/patches/minecraft/net/minecraft/client/gui/components/AbstractSelectionList.java.patch deleted file mode 100644 index 0c36775fb4..0000000000 --- a/patches/minecraft/net/minecraft/client/gui/components/AbstractSelectionList.java.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/net/minecraft/client/gui/components/AbstractSelectionList.java -+++ b/net/minecraft/client/gui/components/AbstractSelectionList.java -@@ -504,6 +_,13 @@ - return new ScreenRectangle(this.x0, this.y0, this.x1 - this.x0, this.y1 - this.y0); - } - -+ public int getWidth() { return this.width; } -+ public int getHeight() { return this.height; } -+ public int getTop() { return this.y0; } -+ public int getBottom() { return this.y1; } -+ public int getLeft() { return this.x0; } -+ public int getRight() { return this.x1; } -+ - @OnlyIn(Dist.CLIENT) - protected abstract static class Entry> implements GuiEventListener { - /** @deprecated */ diff --git a/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch b/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch index e14bada3e0..339b3b65ff 100644 --- a/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/components/AbstractWidget.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/components/AbstractWidget.java +++ b/net/minecraft/client/gui/components/AbstractWidget.java -@@ -259,6 +_,19 @@ +@@ -233,6 +_,19 @@ this.focused = p_93693_; } diff --git a/patches/minecraft/net/minecraft/client/gui/components/Button.java.patch b/patches/minecraft/net/minecraft/client/gui/components/Button.java.patch index b2d90216b3..6e84d256f6 100644 --- a/patches/minecraft/net/minecraft/client/gui/components/Button.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/components/Button.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/components/Button.java +++ b/net/minecraft/client/gui/components/Button.java -@@ -29,6 +_,11 @@ +@@ -30,6 +_,11 @@ this.createNarration = p_259552_; } @@ -12,7 +12,7 @@ public void onPress() { this.onPress.onPress(this); } -@@ -92,9 +_,11 @@ +@@ -93,9 +_,11 @@ } public Button build() { diff --git a/patches/minecraft/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch b/patches/minecraft/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch index aaf9c616ba..c871f3abb5 100644 --- a/patches/minecraft/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/components/DebugScreenOverlay.java +++ b/net/minecraft/client/gui/components/DebugScreenOverlay.java -@@ -93,9 +_,9 @@ +@@ -95,9 +_,9 @@ @Nullable private CompletableFuture serverChunk; private boolean renderDebug; @@ -13,7 +13,7 @@ private final SampleLogger frameTimeLogger = new SampleLogger(); private final SampleLogger tickTimeLogger = new SampleLogger(); private final SampleLogger pingLogger = new SampleLogger(); -@@ -120,14 +_,18 @@ +@@ -124,14 +_,18 @@ this.clientChunk = null; } @@ -37,7 +37,7 @@ if (this.renderFpsCharts) { int i = p_281427_.guiWidth(); int j = i / 2; -@@ -137,7 +_,9 @@ +@@ -141,7 +_,9 @@ this.tpsChart.drawChart(p_281427_, i - k, k); } } @@ -47,7 +47,7 @@ if (this.renderNetworkCharts) { int l = p_281427_.guiWidth(); int i1 = l / 2; -@@ -148,17 +_,32 @@ +@@ -152,17 +_,32 @@ int j1 = this.pingChart.getWidth(i1); this.pingChart.drawChart(p_281427_, l - j1, j1); } @@ -82,7 +82,7 @@ this.renderLines(p_281525_, list, true); } -@@ -430,6 +_,7 @@ +@@ -451,6 +_,7 @@ list.add(""); list.add(ChatFormatting.UNDERLINE + "Targeted Entity"); list.add(String.valueOf((Object)BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()))); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/ConnectScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/ConnectScreen.java.patch index 5aaaf87247..37213e095f 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/ConnectScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/ConnectScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/ConnectScreen.java +++ b/net/minecraft/client/gui/screens/ConnectScreen.java -@@ -84,6 +_,8 @@ +@@ -85,6 +_,8 @@ } if (optional.isEmpty()) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch index fcd32a6019..27d68c4a7c 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/MenuScreens.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/MenuScreens.java +++ b/net/minecraft/client/gui/screens/MenuScreens.java -@@ -40,6 +_,10 @@ +@@ -41,6 +_,10 @@ private static final Map, MenuScreens.ScreenConstructor> SCREENS = Maps.newHashMap(); public static void create(@Nullable MenuType p_96202_, Minecraft p_96203_, int p_96204_, Component p_96205_) { @@ -11,7 +11,7 @@ if (p_96202_ == null) { LOGGER.warn("Trying to open invalid screen with name: {}", (Object)p_96205_.getString()); } else { -@@ -47,9 +_,10 @@ +@@ -48,9 +_,10 @@ if (screenconstructor == null) { LOGGER.warn("Failed to create screen for menu type: {}", (Object)BuiltInRegistries.MENU.getKey(p_96202_)); } else { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/PauseScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/PauseScreen.java.patch index 45bf65d5aa..8a8ffdc0ce 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/PauseScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/PauseScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/PauseScreen.java +++ b/net/minecraft/client/gui/screens/PauseScreen.java -@@ -88,6 +_,7 @@ +@@ -87,6 +_,7 @@ } else { gridlayout$rowhelper.addChild(this.openScreenButton(PLAYER_REPORTING, SocialInteractionsScreen::new)); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch index 3e3b45a640..cad639e7f4 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/TitleScreen.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/TitleScreen.java +++ b/net/minecraft/client/gui/screens/TitleScreen.java -@@ -64,6 +_,7 @@ +@@ -63,6 +_,7 @@ @Nullable private TitleScreen.WarningLabel warningLabel; private final LogoRenderer logoRenderer; @@ -8,7 +8,7 @@ public TitleScreen() { this(false); -@@ -114,11 +_,15 @@ +@@ -113,11 +_,15 @@ int j = this.width - i - 2; int k = 24; int l = this.height / 4 + 48; @@ -24,7 +24,7 @@ SpriteIconButton spriteiconbutton = this.addRenderableWidget(CommonButtons.language(20, (p_280830_) -> { this.minecraft.setScreen(new LanguageSelectScreen(this, this.minecraft.options, this.minecraft.getLanguageManager())); -@@ -164,7 +_,7 @@ +@@ -163,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_210872_) -> { this.realmsButtonClicked(); @@ -33,15 +33,15 @@ } @Nullable -@@ -248,6 +_,7 @@ +@@ -243,6 +_,7 @@ this.warningLabel.render(p_282860_, i); } + net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_282860_, this.font, this.width, this.height, i); - if (this.splash != null) { + if (this.splash != null && !this.minecraft.options.hideSplashTexts().get()) { this.splash.render(p_282860_, this.width, this.font, i); } -@@ -263,7 +_,14 @@ +@@ -258,7 +_,14 @@ s = s + I18n.get("menu.modded"); } @@ -57,7 +57,7 @@ for(GuiEventListener guieventlistener : this.children()) { if (guieventlistener instanceof AbstractWidget) { -@@ -276,6 +_,7 @@ +@@ -271,6 +_,7 @@ RenderSystem.enableDepthTest(); this.realmsNotificationsScreen.render(p_282860_, p_281753_, p_283539_, p_282628_); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch index a67d239fb2..02cf704711 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/advancements/AdvancementTab.java +++ b/net/minecraft/client/gui/screens/advancements/AdvancementTab.java -@@ -38,6 +_,7 @@ +@@ -37,6 +_,7 @@ private int maxY = Integer.MIN_VALUE; private float fade; private boolean centered; @@ -8,7 +8,7 @@ public AdvancementTab(Minecraft p_97145_, AdvancementsScreen p_97146_, AdvancementTabType p_97147_, int p_97148_, AdvancementNode p_297568_, DisplayInfo p_97150_) { this.minecraft = p_97145_; -@@ -52,6 +_,15 @@ +@@ -51,6 +_,15 @@ this.addWidget(this.root, p_297568_.holder()); } @@ -24,7 +24,7 @@ public AdvancementTabType getType() { return this.type; } -@@ -146,8 +_,8 @@ +@@ -145,8 +_,8 @@ return null; } else { for(AdvancementTabType advancementtabtype : AdvancementTabType.values()) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch index c098a01d35..914880e925 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java +++ b/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java -@@ -31,7 +_,7 @@ - this.addWidget(this.keyBindsList); +@@ -30,7 +_,7 @@ + this.keyBindsList = this.addRenderableWidget(new KeyBindsList(this, this.minecraft)); this.resetButton = this.addRenderableWidget(Button.builder(Component.translatable("controls.resetAll"), (p_269619_) -> { for(KeyMapping keymapping : this.options.keyMappings) { - keymapping.setKey(keymapping.getDefaultKey()); @@ -9,7 +9,7 @@ } this.keyBindsList.resetMappingAndUpdateButtons(); -@@ -55,11 +_,13 @@ +@@ -54,11 +_,13 @@ public boolean keyPressed(int p_193987_, int p_193988_, int p_193989_) { if (this.selectedKey != null) { if (p_193987_ == 256) { @@ -24,7 +24,7 @@ this.selectedKey = null; this.lastKeySelection = Util.getMillis(); this.keyBindsList.resetMappingAndUpdateButtons(); -@@ -67,6 +_,19 @@ +@@ -66,6 +_,19 @@ } else { return super.keyPressed(p_193987_, p_193988_, p_193989_); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch index 695b875edf..d7bace152a 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch @@ -52,7 +52,7 @@ p_282567_.pose().popPose(); } -@@ -274,7 +_,8 @@ +@@ -280,7 +_,8 @@ if (super.mouseClicked(p_97748_, p_97749_, p_97750_)) { return true; } else { @@ -62,7 +62,7 @@ Slot slot = this.findSlot(p_97748_, p_97749_); long i = Util.getMillis(); this.doubleclick = this.lastClickSlot == slot && i - this.lastClickTime < 250L && this.lastClickButton == p_97750_; -@@ -285,6 +_,7 @@ +@@ -291,6 +_,7 @@ int j = this.leftPos; int k = this.topPos; boolean flag1 = this.hasClickedOutside(p_97748_, p_97749_, j, k, p_97750_); @@ -70,7 +70,7 @@ int l = -1; if (slot != null) { l = slot.index; -@@ -310,7 +_,7 @@ +@@ -316,7 +_,7 @@ } } else if (!this.isQuickCrafting) { if (this.menu.getCarried().isEmpty()) { @@ -79,7 +79,7 @@ this.slotClicked(slot, l, p_97750_, ClickType.CLONE); } else { boolean flag2 = l != -999 && (InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 340) || InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 344)); -@@ -334,7 +_,7 @@ +@@ -340,7 +_,7 @@ this.quickCraftingType = 0; } else if (p_97750_ == 1) { this.quickCraftingType = 1; @@ -88,7 +88,7 @@ this.quickCraftingType = 2; } } -@@ -403,10 +_,13 @@ +@@ -409,10 +_,13 @@ } public boolean mouseReleased(double p_97812_, double p_97813_, int p_97814_) { @@ -102,7 +102,7 @@ int k = -1; if (slot != null) { k = slot.index; -@@ -420,7 +_,7 @@ +@@ -426,7 +_,7 @@ if (hasShiftDown()) { if (!this.lastQuickMoved.isEmpty()) { for(Slot slot2 : this.menu.slots) { @@ -111,7 +111,7 @@ this.slotClicked(slot2, slot2.index, p_97814_, ClickType.QUICK_MOVE); } } -@@ -483,7 +_,7 @@ +@@ -489,7 +_,7 @@ this.slotClicked((Slot)null, -999, AbstractContainerMenu.getQuickcraftMask(2, this.quickCraftingType), ClickType.QUICK_CRAFT); } else if (!this.menu.getCarried().isEmpty()) { @@ -120,7 +120,7 @@ this.slotClicked(slot, k, p_97814_, ClickType.CLONE); } else { boolean flag1 = k != -999 && (InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 340) || InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), 344)); -@@ -530,34 +_,39 @@ +@@ -540,34 +_,39 @@ } public boolean keyPressed(int p_97765_, int p_97766_, int p_97767_) { @@ -167,7 +167,7 @@ this.slotClicked(this.hoveredSlot, this.hoveredSlot.index, i, ClickType.SWAP); return true; } -@@ -592,6 +_,18 @@ +@@ -602,6 +_,18 @@ public T getMenu() { return this.menu; diff --git a/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch index 00b0ecdc8d..17625f1336 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch @@ -42,4 +42,4 @@ + } Component component = this.getEffectName(mobeffectinstance); p_281462_.drawString(this.font, component, p_283484_ + 10 + 18, i + 6, 16777215); - Component component1 = MobEffectUtil.formatDuration(mobeffectinstance, 1.0F); + Component component1 = MobEffectUtil.formatDuration(mobeffectinstance, 1.0F, this.minecraft.level.tickRateManager().tickrate()); diff --git a/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch index f9b8a1d8c2..44323c868f 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java +++ b/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java -@@ -346,6 +_,8 @@ +@@ -342,6 +_,8 @@ this.screen.setToolTip(list1); } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch index 9d393293d4..9fc9cfe631 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch @@ -1,16 +1,11 @@ --- a/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java +++ b/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java -@@ -138,10 +_,10 @@ +@@ -136,7 +_,7 @@ TransferableSelectionList.PackEntry transferableselectionlist$packentry = p_100014_.getSelected(); String s = transferableselectionlist$packentry == null ? "" : transferableselectionlist$packentry.getPackId(); p_100014_.setSelected((TransferableSelectionList.PackEntry)null); -- p_100015_.forEach((p_280875_) -> { -- TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.minecraft, p_100014_, p_280875_); -+ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_264692_) -> { -+ TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.minecraft, p_100014_, p_264692_); +- p_100015_.forEach((p_308207_) -> { ++ p_100015_.filter(PackSelectionModel.Entry::notHidden).forEach((p_308207_) -> { + TransferableSelectionList.PackEntry transferableselectionlist$packentry1 = new TransferableSelectionList.PackEntry(this.minecraft, p_100014_, p_308207_); p_100014_.children().add(transferableselectionlist$packentry1); -- if (p_280875_.getId().equals(s)) { -+ if (p_264692_.getId().equals(s)) { - p_100014_.setSelected(transferableselectionlist$packentry1); - } - + if (p_308207_.getId().equals(s)) { diff --git a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch index 677da90195..069d942dc2 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch @@ -1,49 +1,47 @@ --- a/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java +++ b/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java -@@ -181,13 +_,23 @@ +@@ -280,12 +_,19 @@ } - private void doLoadLevel(Screen p_233146_, String p_233147_, boolean p_233148_, boolean p_233149_) { -+ // FORGE: Patch in overload to reduce further patching -+ this.doLoadLevel(p_233146_, p_233147_, p_233148_, p_233149_, false); + private void loadLevel(LevelStorageSource.LevelStorageAccess p_309733_, Dynamic p_312455_, boolean p_310657_, boolean p_309504_, Runnable p_309915_) { ++ loadLevel(p_309733_, p_312455_, p_310657_, p_309504_, p_309915_, false); + } + -+ // FORGE: Patch in confirmExperimentalWarning which confirms the experimental warning when true -+ private void doLoadLevel(Screen p_233146_, String p_233147_, boolean p_233148_, boolean p_233149_, boolean confirmExperimentalWarning) { - LevelStorageSource.LevelStorageAccess levelstoragesource$levelstorageaccess = this.createWorldAccess(p_233147_); - if (levelstoragesource$levelstorageaccess != null) { - PackRepository packrepository = ServerPacksSource.createPackRepository(levelstoragesource$levelstorageaccess); ++ private void loadLevel(LevelStorageSource.LevelStorageAccess p_309733_, Dynamic p_312455_, boolean p_310657_, boolean p_309504_, Runnable p_309915_, boolean confirmExperimentalWarning) { + this.minecraft.forceSetScreen(new GenericDirtMessageScreen(Component.translatable("selectWorld.resource_load"))); + PackRepository packrepository = ServerPacksSource.createPackRepository(p_309733_); - WorldStem worldstem; - try { -+ levelstoragesource$levelstorageaccess.readAdditionalLevelSaveData(); // Read extra (e.g. modded) data from the world before creating it - worldstem = this.loadWorldStem(levelstoragesource$levelstorageaccess, p_233148_, packrepository); -+ if (confirmExperimentalWarning && worldstem.worldData() instanceof PrimaryLevelData pld) { -+ pld.withConfirmedWarning(true); -+ } - } catch (Exception exception) { - LOGGER.warn("Failed to load level data or datapacks, can't proceed with server load", (Throwable)exception); - if (!p_233148_) { -@@ -207,7 +_,9 @@ - WorldData worlddata = worldstem.worldData(); - boolean flag = worlddata.worldGenOptions().isOldCustomizedWorld(); - boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable(); -- if (!p_233149_ || !flag && !flag1) { -+ // Forge: Skip confirmation if it has been done already for this world -+ boolean skipConfirmation = worlddata instanceof PrimaryLevelData pld && pld.hasConfirmedExperimentalWarning(); -+ if (skipConfirmation || !p_233149_ || !flag && !flag1) { - this.minecraft.getDownloadedPackSource().loadBundledResourcePack(levelstoragesource$levelstorageaccess).thenApply((p_233177_) -> { - return true; - }).exceptionallyComposeAsync((p_233183_) -> { -@@ -229,9 +_,11 @@ - return null; - }); - } else { -+ if (flag) // Forge: For legacy world options, let vanilla handle it. - this.askForBackup(p_233146_, p_233147_, flag, () -> { - this.doLoadLevel(p_233146_, p_233147_, p_233148_, false); - }); -+ else net.minecraftforge.client.ForgeHooksClient.createWorldConfirmationScreen(() -> this.doLoadLevel(p_233146_, p_233147_, p_233148_, false, true)); - worldstem.close(); - safeCloseAccess(levelstoragesource$levelstorageaccess, p_233147_); - } ++ net.minecraftforge.common.ForgeHooks.readAdditionalLevelSaveData(p_312455_, p_309733_.getLevelDirectory()); ++ + WorldStem worldstem; + try { + worldstem = this.loadWorldStem(p_312455_, p_310657_, packrepository); ++ if (confirmExperimentalWarning && worldstem.worldData() instanceof PrimaryLevelData pld) pld.withConfirmedWarning(true); + } catch (Exception exception) { + LOGGER.warn("Failed to load level data or datapacks, can't proceed with server load", (Throwable)exception); + if (!p_310657_) { +@@ -305,7 +_,8 @@ + + WorldData worlddata = worldstem.worldData(); + boolean flag = worlddata.worldGenOptions().isOldCustomizedWorld(); +- boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable(); ++ boolean skipConfirmation = worlddata instanceof PrimaryLevelData pld && pld.hasConfirmedExperimentalWarning(); ++ boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable() && !skipConfirmation; + if (!p_309504_ || !flag && !flag1) { + DownloadedPackSource downloadedpacksource = this.minecraft.getDownloadedPackSource(); + this.loadBundledResourcePack(downloadedpacksource, p_309733_).thenApply((p_233177_) -> { +@@ -328,12 +_,14 @@ + return null; + }); + } else { ++ if (flag) // Forge: For legacy world options, let vanilla handle it. + this.askForBackup(p_309733_, flag, () -> { + this.loadLevel(p_309733_, p_312455_, p_310657_, false, p_309915_); + }, () -> { + p_309733_.safeClose(); + p_309915_.run(); + }); ++ else net.minecraftforge.client.ForgeHooksClient.createWorldConfirmationScreen(() -> this.loadLevel(p_309733_, p_312455_, p_310657_, false, p_309915_, true)); + worldstem.close(); + } + } diff --git a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch index 42c59b6749..c3b27b7eb5 100644 --- a/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java +++ b/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java -@@ -74,6 +_,7 @@ +@@ -76,6 +_,7 @@ + static final ResourceLocation JOIN_SPRITE = new ResourceLocation("world_list/join"); static final Logger LOGGER = LogUtils.getLogger(); - static final DateFormat DATE_FORMAT = new SimpleDateFormat(); private static final ResourceLocation ICON_MISSING = new ResourceLocation("textures/misc/unknown_server.png"); + private static final ResourceLocation FORGE_EXPERIMENTAL_WARNING_ICON = new ResourceLocation("forge","textures/gui/experimental_warning.png"); static final Component FROM_NEWER_TOOLTIP_1 = Component.translatable("selectWorld.tooltip.fromNewerVersion1").withStyle(ChatFormatting.RED); static final Component FROM_NEWER_TOOLTIP_2 = Component.translatable("selectWorld.tooltip.fromNewerVersion2").withStyle(ChatFormatting.RED); static final Component SNAPSHOT_TOOLTIP_1 = Component.translatable("selectWorld.tooltip.snapshot1").withStyle(ChatFormatting.GOLD); -@@ -362,6 +_,7 @@ +@@ -372,6 +_,7 @@ RenderSystem.enableBlend(); p_281612_.blit(this.icon.textureLocation(), p_282820_, p_283181_, 0.0F, 0.0F, 32, 32, 32, 32); RenderSystem.disableBlend(); @@ -16,10 +16,10 @@ if (this.minecraft.options.touchscreen().get() || p_283396_) { p_281612_.fill(p_282820_, p_283181_, p_282820_ + 32, p_283181_ + 32, -1601138544); int j = p_283204_ - p_282820_; -@@ -608,6 +_,19 @@ +@@ -579,6 +_,19 @@ - public boolean isSelectable() { - return !this.summary.isDisabled(); + public String getLevelName() { + return this.summary.getLevelName(); + } + + // FORGE: Patch in experimental warning icon for worlds in the world selection screen diff --git a/patches/minecraft/net/minecraft/client/main/Main.java.patch b/patches/minecraft/net/minecraft/client/main/Main.java.patch index f69bbb9d8c..da7d302ba9 100644 --- a/patches/minecraft/net/minecraft/client/main/Main.java.patch +++ b/patches/minecraft/net/minecraft/client/main/Main.java.patch @@ -1,12 +1,12 @@ --- a/net/minecraft/client/main/Main.java +++ b/net/minecraft/client/main/Main.java -@@ -150,8 +_,8 @@ - } - +@@ -152,8 +_,8 @@ CrashReport.preload(); -- Bootstrap.bootStrap(); - GameLoadTimesEvent.INSTANCE.setBootstrapTime(Bootstrap.bootstrapDuration.get()); -+ net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(()->Bootstrap.bootStrap(), net.minecraftforge.fml.loading.FMLLoader.progressWindowTick); - Bootstrap.validate(); - Util.startTimerHackThread(); - String s12 = optionspec25.value(optionset); + + try { +- Bootstrap.bootStrap(); + GameLoadTimesEvent.INSTANCE.setBootstrapTime(Bootstrap.bootstrapDuration.get()); ++ net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(()->Bootstrap.bootStrap(), net.minecraftforge.fml.loading.FMLLoader.progressWindowTick); + Bootstrap.validate(); + } catch (Throwable throwable2) { + CrashReport crashreport = CrashReport.forThrowable(throwable2, "Bootstrap"); diff --git a/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch b/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch index 9546a115fd..9aea27ffa1 100644 --- a/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch +++ b/patches/minecraft/net/minecraft/client/model/HumanoidModel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/model/HumanoidModel.java +++ b/net/minecraft/client/model/HumanoidModel.java -@@ -270,6 +_,8 @@ +@@ -272,6 +_,8 @@ case TOOT_HORN: this.rightArm.xRot = Mth.clamp(this.head.xRot, -1.2F, 1.2F) - 1.4835298F; this.rightArm.yRot = this.head.yRot - ((float)Math.PI / 6F); @@ -9,7 +9,7 @@ } } -@@ -314,6 +_,8 @@ +@@ -315,6 +_,8 @@ case TOOT_HORN: this.leftArm.xRot = Mth.clamp(this.head.xRot, -1.2F, 1.2F) - 1.4835298F; this.leftArm.yRot = this.head.yRot + ((float)Math.PI / 6F); @@ -18,7 +18,7 @@ } } -@@ -406,7 +_,7 @@ +@@ -412,7 +_,7 @@ } @OnlyIn(Dist.CLIENT) @@ -27,7 +27,7 @@ EMPTY(false), ITEM(false), BLOCK(false), -@@ -422,10 +_,29 @@ +@@ -428,10 +_,29 @@ private ArmPose(boolean p_102896_) { this.twoHanded = p_102896_; diff --git a/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch b/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch index 51deab4fe9..7bc6d9693f 100644 --- a/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch +++ b/patches/minecraft/net/minecraft/client/model/geom/LayerDefinitions.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/model/geom/LayerDefinitions.java +++ b/net/minecraft/client/model/geom/LayerDefinitions.java -@@ -319,6 +_,7 @@ +@@ -325,6 +_,7 @@ WoodType.values().forEach((p_247864_) -> { builder.put(ModelLayers.createHangingSignModelName(p_247864_), layerdefinition24); }); diff --git a/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch b/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch index ca4e224b71..a9c32eed1e 100644 --- a/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch +++ b/patches/minecraft/net/minecraft/client/model/geom/ModelLayers.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/model/geom/ModelLayers.java +++ b/net/minecraft/client/model/geom/ModelLayers.java -@@ -220,11 +_,13 @@ +@@ -224,11 +_,13 @@ } public static ModelLayerLocation createSignModelName(WoodType p_171292_) { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch index 9170740808..fc930b1905 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java +++ b/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java -@@ -89,6 +_,7 @@ +@@ -93,6 +_,7 @@ } public void handleCustomPayload(ClientboundCustomPayloadPacket p_298103_) { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch index 01a35e8986..7f51541f14 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java +++ b/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java -@@ -71,6 +_,7 @@ +@@ -72,6 +_,7 @@ this.connection.setListener(new ClientPacketListener(this.minecraft, this.connection, new CommonListenerCookie(this.localGameProfile, this.telemetryManager, this.receivedRegistries, this.enabledFeatures, this.serverBrand, this.serverData, this.postDisconnectScreen))); this.connection.resumeInboundAfterProtocolChange(); this.connection.send(new ServerboundFinishConfigurationPacket()); diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java.patch index 513e217b1b..f067beb58d 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java +++ b/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java -@@ -156,6 +_,7 @@ +@@ -157,6 +_,7 @@ public void onDisconnect(Component p_104543_) { if (this.serverData != null && this.serverData.isRealm()) { this.minecraft.setScreen(new DisconnectedRealmsScreen(this.parent, CommonComponents.CONNECT_FAILED, p_104543_)); @@ -8,7 +8,7 @@ } else { this.minecraft.setScreen(new DisconnectedScreen(this.parent, CommonComponents.CONNECT_FAILED, p_104543_)); } -@@ -178,6 +_,7 @@ +@@ -179,6 +_,7 @@ } public void handleCustomQuery(ClientboundCustomQueryPacket p_104545_) { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch index 34a30d1a1d..291e99d127 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientLevel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ClientLevel.java +++ b/net/minecraft/client/multiplayer/ClientLevel.java -@@ -116,12 +_,15 @@ +@@ -118,12 +_,15 @@ p_194170_.put(BiomeColors.WATER_COLOR_RESOLVER, new BlockTintCache((p_194168_) -> { return this.calculateBlockTint(p_194168_, BiomeColors.WATER_COLOR_RESOLVER); })); @@ -16,7 +16,7 @@ public void handleBlockChangedAck(int p_233652_) { this.blockStatePredictionHandler.endPredictionsUpTo(p_233652_, this); -@@ -175,6 +_,8 @@ +@@ -178,6 +_,8 @@ this.serverSimulationDistance = p_205510_; this.updateSkyBrightness(); this.prepareWeather(); @@ -25,7 +25,7 @@ } public void queueLightUpdate(Runnable p_194172_) { -@@ -265,6 +_,7 @@ +@@ -271,6 +_,7 @@ this.getProfiler().push(() -> { return BuiltInRegistries.ENTITY_TYPE.getKey(p_104640_.getType()).toString(); }); @@ -33,7 +33,7 @@ p_104640_.tick(); this.getProfiler().pop(); -@@ -320,8 +_,10 @@ +@@ -326,8 +_,10 @@ } public void addEntity(Entity p_104741_) { @@ -44,7 +44,7 @@ } public void removeEntity(int p_171643_, Entity.RemovalReason p_171644_) { -@@ -448,6 +_,12 @@ +@@ -457,6 +_,12 @@ } public void playSeededSound(@Nullable Player p_263381_, double p_263372_, double p_263404_, double p_263365_, Holder p_263335_, SoundSource p_263417_, float p_263416_, float p_263349_, long p_263408_) { @@ -57,7 +57,7 @@ if (p_263381_ == this.minecraft.player) { this.playSound(p_263372_, p_263404_, p_263365_, p_263335_.value(), p_263417_, p_263416_, p_263349_, false, p_263408_); } -@@ -455,6 +_,12 @@ +@@ -464,6 +_,12 @@ } public void playSeededSound(@Nullable Player p_263514_, Entity p_263536_, Holder p_263518_, SoundSource p_263487_, float p_263538_, float p_263524_, long p_263509_) { @@ -70,7 +70,7 @@ if (p_263514_ == this.minecraft.player) { this.minecraft.getSoundManager().play(new EntityBoundSoundInstance(p_263518_.value(), p_263487_, p_263538_, p_263524_, p_263536_, p_263509_)); } -@@ -892,6 +_,7 @@ +@@ -909,6 +_,7 @@ } public void setDifficulty(Difficulty p_104852_) { @@ -78,7 +78,7 @@ this.difficulty = p_104852_; } -@@ -929,14 +_,46 @@ +@@ -946,14 +_,46 @@ ClientLevel.this.players.add((AbstractClientPlayer)p_171712_); } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch index f5394e8409..6926099f0d 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ClientPacketListener.java +++ b/net/minecraft/client/multiplayer/ClientPacketListener.java -@@ -385,6 +_,7 @@ +@@ -398,6 +_,7 @@ this.minecraft.debugRenderer.clear(); this.minecraft.player.resetPos(); @@ -8,7 +8,7 @@ this.minecraft.player.setId(p_105030_.playerId()); this.level.addEntity(this.minecraft.player); this.minecraft.player.input = new KeyboardInput(this.minecraft.options); -@@ -1016,7 +_,9 @@ +@@ -1043,7 +_,9 @@ localplayer1.getAttributes().assignValues(localplayer.getAttributes()); } @@ -18,7 +18,7 @@ this.level.addEntity(localplayer1); localplayer1.setYRot(-180.0F); localplayer1.input = new KeyboardInput(this.minecraft.options); -@@ -1125,10 +_,7 @@ +@@ -1152,10 +_,7 @@ PacketUtils.ensureRunningOnSameThread(p_104976_, this, this.minecraft); BlockPos blockpos = p_104976_.getPos(); this.minecraft.level.getBlockEntity(blockpos, p_104976_.getType()).ifPresent((p_205557_) -> { @@ -30,7 +30,7 @@ if (p_205557_ instanceof CommandBlockEntity && this.minecraft.screen instanceof CommandBlockEditScreen) { ((CommandBlockEditScreen)this.minecraft.screen).updateGui(); -@@ -1276,7 +_,9 @@ +@@ -1312,7 +_,9 @@ public void handleCommands(ClientboundCommandsPacket p_104990_) { PacketUtils.ensureRunningOnSameThread(p_104990_, this, this.minecraft); @@ -41,7 +41,7 @@ } public void handleStopSoundEvent(ClientboundStopSoundPacket p_105116_) { -@@ -1295,6 +_,7 @@ +@@ -1331,6 +_,7 @@ ClientRecipeBook clientrecipebook = this.minecraft.player.getRecipeBook(); clientrecipebook.setupCollections(this.recipeManager.getRecipes(), this.minecraft.level.registryAccess()); this.minecraft.populateSearchTree(SearchRegistry.RECIPE_COLLECTIONS, clientrecipebook.getCollections()); @@ -49,7 +49,7 @@ } public void handleLookAt(ClientboundPlayerLookAtPacket p_105054_) { -@@ -1393,7 +_,8 @@ +@@ -1429,7 +_,8 @@ Blocks.rebuildCache(); } @@ -59,7 +59,7 @@ } public void handlePlayerCombatEnd(ClientboundPlayerCombatEndPacket p_171771_) { -@@ -2086,6 +_,8 @@ +@@ -2145,6 +_,8 @@ } public void sendChat(String p_249888_) { @@ -68,7 +68,7 @@ Instant instant = Instant.now(); long i = Crypt.SaltSupplier.getLong(); LastSeenMessagesTracker.Update lastseenmessagestracker$update = this.lastSeenMessages.generateAndApplyUpdate(); -@@ -2094,6 +_,7 @@ +@@ -2153,6 +_,7 @@ } public void sendCommand(String p_250092_) { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/MultiPlayerGameMode.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/MultiPlayerGameMode.java.patch index 77847c043e..2d7269ec0b 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/MultiPlayerGameMode.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/MultiPlayerGameMode.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/MultiPlayerGameMode.java +++ b/net/minecraft/client/multiplayer/MultiPlayerGameMode.java -@@ -104,6 +_,7 @@ +@@ -105,6 +_,7 @@ } public boolean destroyBlock(BlockPos p_105268_) { @@ -8,7 +8,7 @@ if (this.minecraft.player.blockActionRestricted(this.minecraft.level, p_105268_, this.localPlayerMode)) { return false; } else { -@@ -118,9 +_,8 @@ +@@ -119,9 +_,8 @@ } else if (blockstate.isAir()) { return false; } else { @@ -19,7 +19,7 @@ if (flag) { block.destroy(level, p_105268_, blockstate); } -@@ -141,6 +_,7 @@ +@@ -142,6 +_,7 @@ BlockState blockstate = this.minecraft.level.getBlockState(p_105270_); this.minecraft.getTutorial().onDestroyBlock(this.minecraft.level, p_105270_, blockstate, 1.0F); this.startPrediction(this.minecraft.level, (p_233757_) -> { @@ -27,7 +27,7 @@ this.destroyBlock(p_105270_); return new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, p_105270_, p_105271_, p_233757_); }); -@@ -149,15 +_,19 @@ +@@ -150,15 +_,19 @@ if (this.isDestroying) { this.connection.send(new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, this.destroyBlockPos, p_105271_)); } @@ -47,7 +47,7 @@ if (flag && blockstate1.getDestroyProgress(this.minecraft.player, this.minecraft.player.level(), p_105270_) >= 1.0F) { this.destroyBlock(p_105270_); } else { -@@ -169,7 +_,7 @@ +@@ -170,7 +_,7 @@ this.minecraft.level.destroyBlockProgress(this.minecraft.player.getId(), this.destroyBlockPos, this.getDestroyStage()); } @@ -56,7 +56,7 @@ }); } -@@ -200,6 +_,7 @@ +@@ -201,6 +_,7 @@ BlockState blockstate1 = this.minecraft.level.getBlockState(p_105284_); this.minecraft.getTutorial().onDestroyBlock(this.minecraft.level, p_105284_, blockstate1, 1.0F); this.startPrediction(this.minecraft.level, (p_233753_) -> { @@ -64,7 +64,7 @@ this.destroyBlock(p_105284_); return new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, p_105284_, p_105285_, p_233753_); }); -@@ -212,12 +_,13 @@ +@@ -213,12 +_,13 @@ } else { this.destroyProgress += blockstate.getDestroyProgress(this.minecraft.player, this.minecraft.player.level(), p_105284_); if (this.destroyTicks % 4.0F == 0.0F) { @@ -79,16 +79,16 @@ if (this.destroyProgress >= 1.0F) { this.isDestroying = false; this.startPrediction(this.minecraft.level, (p_233739_) -> { -@@ -247,7 +_,7 @@ +@@ -248,7 +_,7 @@ } public float getPickRange() { -- return this.localPlayerMode.isCreative() ? 5.0F : 4.5F; +- return Player.getPickRange(this.localPlayerMode.isCreative()); + return (float) this.minecraft.player.getBlockReach(); } public void tick() { -@@ -262,7 +_,7 @@ +@@ -263,7 +_,7 @@ private boolean sameDestroyTarget(BlockPos p_105282_) { ItemStack itemstack = this.minecraft.player.getMainHandItem(); @@ -97,7 +97,7 @@ } private void ensureHasSentCarriedItem() { -@@ -291,25 +_,38 @@ +@@ -292,25 +_,38 @@ private InteractionResult performUseItemOn(LocalPlayer p_233747_, InteractionHand p_233748_, BlockHitResult p_233749_) { BlockPos blockpos = p_233749_.getBlockPos(); ItemStack itemstack = p_233747_.getItemInHand(p_233748_); @@ -140,7 +140,7 @@ InteractionResult interactionresult1; if (this.localPlayerMode.isCreative()) { int i = itemstack.getCount(); -@@ -340,10 +_,17 @@ +@@ -341,10 +_,17 @@ mutableobject.setValue(InteractionResult.PASS); return serverbounduseitempacket; } else { @@ -158,7 +158,7 @@ } mutableobject.setValue(interactionresultholder.getResult()); -@@ -382,6 +_,9 @@ +@@ -383,6 +_,9 @@ this.ensureHasSentCarriedItem(); Vec3 vec3 = p_105233_.getLocation().subtract(p_105232_.getX(), p_105232_.getY(), p_105232_.getZ()); this.connection.send(ServerboundInteractPacket.createInteractionPacket(p_105232_, p_105231_.isShiftKeyDown(), p_105234_, vec3)); diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch index f944a3ecd5..49b9dde926 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ServerStatusPinger.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ServerStatusPinger.java +++ b/net/minecraft/client/multiplayer/ServerStatusPinger.java -@@ -105,6 +_,7 @@ +@@ -103,6 +_,7 @@ } }); diff --git a/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch b/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch index 85611273d1..a732089a88 100644 --- a/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/ParticleEngine.java.patch @@ -14,8 +14,8 @@ private final Queue particlesToAdd = Queues.newArrayDeque(); private final Map spriteSets = Maps.newHashMap(); private final TextureAtlas textureAtlas; -@@ -194,10 +_,14 @@ - this.register(ParticleTypes.EGG_CRACK, SuspendedTownParticle.EggCrackProvider::new); +@@ -200,10 +_,14 @@ + this.register(ParticleTypes.TRIAL_SPAWNER_DETECTION, TrialSpawnerDetectionParticle.Provider::new); } + /** @deprecated Register via {@link net.minecraftforge.client.event.RegisterParticleProvidersEvent} */ @@ -30,7 +30,7 @@ public void register(ParticleType p_273423_, ParticleProvider.Sprite p_273134_) { this.register(p_273423_, (p_272320_) -> { return (p_272323_, p_272324_, p_272325_, p_272326_, p_272327_, p_272328_, p_272329_, p_272330_) -> { -@@ -211,10 +_,12 @@ +@@ -217,10 +_,12 @@ }); } @@ -44,7 +44,7 @@ } public CompletableFuture reload(PreparableReloadListener.PreparationBarrier p_107305_, ResourceManager p_107306_, ProfilerFiller p_107307_, ProfilerFiller p_107308_, Executor p_107309_, Executor p_107310_) { -@@ -313,7 +_,7 @@ +@@ -319,7 +_,7 @@ @Nullable private Particle makeParticle(T p_107396_, double p_107397_, double p_107398_, double p_107399_, double p_107400_, double p_107401_, double p_107402_) { @@ -53,7 +53,7 @@ return particleprovider == null ? null : particleprovider.createParticle(p_107396_, this.level, p_107397_, p_107398_, p_107399_, p_107400_, p_107401_, p_107402_); } -@@ -394,15 +_,24 @@ +@@ -400,15 +_,24 @@ } } @@ -79,7 +79,7 @@ Iterable iterable = this.particles.get(particlerendertype); if (iterable != null) { RenderSystem.setShader(GameRenderer::getParticleShader); -@@ -411,6 +_,7 @@ +@@ -417,6 +_,7 @@ particlerendertype.begin(bufferbuilder, this.textureManager); for(Particle particle : iterable) { @@ -87,7 +87,7 @@ try { particle.render(bufferbuilder, p_107340_, p_107341_); } catch (Throwable throwable) { -@@ -440,7 +_,7 @@ +@@ -446,7 +_,7 @@ } public void destroy(BlockPos p_107356_, BlockState p_107357_) { @@ -96,7 +96,7 @@ VoxelShape voxelshape = p_107357_.getShape(this.level, p_107356_); double d0 = 0.25D; voxelshape.forAllBoxes((p_172273_, p_172274_, p_172275_, p_172276_, p_172277_, p_172278_) -> { -@@ -460,7 +_,7 @@ +@@ -466,7 +_,7 @@ double d7 = d4 * d1 + p_172273_; double d8 = d5 * d2 + p_172274_; double d9 = d6 * d3 + p_172275_; @@ -105,7 +105,7 @@ } } } -@@ -504,12 +_,18 @@ +@@ -510,12 +_,18 @@ d0 = (double)i + aabb.maxX + (double)0.1F; } diff --git a/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch index 5f91987b1a..35eeb374cd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/GameRenderer.java.patch @@ -13,60 +13,14 @@ } @@ -610,6 +_,7 @@ - list1.add(Pair.of(new ShaderInstance(p_250719_, "rendertype_gui_ghost_recipe_overlay", DefaultVertexFormat.POSITION_COLOR), (p_286147_) -> { - rendertypeGuiGhostRecipeOverlayShader = p_286147_; + list1.add(Pair.of(new ShaderInstance(p_250719_, "rendertype_breeze_wind", DefaultVertexFormat.NEW_ENTITY), (p_308287_) -> { + rendertypeBreezeWindShader = p_308287_; })); + net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.RegisterShadersEvent(p_250719_, list1)); } catch (IOException ioexception) { list1.forEach((p_172729_) -> { p_172729_.getFirst().close(); -@@ -686,12 +_,13 @@ - this.minecraft.getProfiler().push("pick"); - this.minecraft.crosshairPickEntity = null; - double d0 = (double)this.minecraft.gameMode.getPickRange(); -- this.minecraft.hitResult = entity.pick(d0, p_109088_, false); -+ double entityReach = this.minecraft.player.getEntityReach(); // Note - MC-76493 - We must validate players cannot click-through objects. -+ this.minecraft.hitResult = entity.pick(Math.max(d0, entityReach), p_109088_, false); // Run pick() with the max of the two, so we can prevent click-through. - Vec3 vec3 = entity.getEyePosition(p_109088_); - boolean flag = false; - int i = 3; - double d1 = d0; -- if (this.minecraft.gameMode.hasFarPickRange()) { -+ if (false && this.minecraft.gameMode.hasFarPickRange()) { - d1 = 6.0D; - d0 = d1; - } else { -@@ -701,10 +_,19 @@ - - d0 = d0; - } -+ d0 = d1 = Math.max(d0, entityReach); // Pick entities with the max of both for the same reason. - - d1 *= d1; -- if (this.minecraft.hitResult != null) { -+ // If we picked a block, we need to ignore entities past that block. Added != MISS check to not truncate on failed picks. -+ // Also fixes MC-250858 -+ if (this.minecraft.hitResult != null && this.minecraft.hitResult.getType() != HitResult.Type.MISS) { - d1 = this.minecraft.hitResult.getLocation().distanceToSqr(vec3); -+ double blockReach = this.minecraft.player.getBlockReach(); -+ // Discard the result as a miss if it is outside the block reach. -+ if (d1 > blockReach * blockReach) { -+ Vec3 pos = this.minecraft.hitResult.getLocation(); -+ this.minecraft.hitResult = BlockHitResult.miss(pos, Direction.getNearest(vec3.x, vec3.y, vec3.z), BlockPos.containing(pos)); -+ } - } - - Vec3 vec31 = entity.getViewVector(1.0F); -@@ -718,7 +_,7 @@ - Entity entity1 = entityhitresult.getEntity(); - Vec3 vec33 = entityhitresult.getLocation(); - double d2 = vec3.distanceToSqr(vec33); -- if (flag && d2 > 9.0D) { -+ if (d2 > d1 || d2 > entityReach * entityReach) { // Discard if the result is behind a block, or past the entity reach max. The var "flag" no longer has a use. - this.minecraft.hitResult = BlockHitResult.miss(vec33, Direction.getNearest(vec31.x, vec31.y, vec31.z), BlockPos.containing(vec33)); - } else if (d2 < d1 || this.minecraft.hitResult == null) { - this.minecraft.hitResult = entityhitresult; -@@ -772,7 +_,7 @@ +@@ -757,7 +_,7 @@ d0 *= Mth.lerp(this.minecraft.options.fovEffectScale().get(), 1.0D, (double)0.85714287F); } @@ -75,7 +29,7 @@ } } -@@ -908,12 +_,12 @@ +@@ -894,12 +_,12 @@ Window window = this.minecraft.getWindow(); RenderSystem.clear(256, Minecraft.ON_OSX); @@ -90,7 +44,7 @@ RenderSystem.applyModelViewMatrix(); Lighting.setupFor3DItems(); GuiGraphics guigraphics = new GuiGraphics(this.minecraft, this.renderBuffers.bufferSource()); -@@ -949,7 +_,7 @@ +@@ -935,7 +_,7 @@ } } else if (flag && this.minecraft.screen != null) { try { @@ -99,10 +53,10 @@ } catch (Throwable throwable1) { CrashReport crashreport1 = CrashReport.forThrowable(throwable1, "Rendering screen"); CrashReportCategory crashreportcategory1 = crashreport1.addCategory("Screen render details"); -@@ -1103,12 +_,19 @@ +@@ -1090,12 +_,19 @@ + Matrix4f matrix4f = posestack.last().pose(); this.resetProjectionMatrix(matrix4f); - camera.setup(this.minecraft.level, (Entity)(this.minecraft.getCameraEntity() == null ? this.minecraft.player : this.minecraft.getCameraEntity()), !this.minecraft.options.getCameraType().isFirstPerson(), this.minecraft.options.getCameraType().isMirrored(), p_109090_); + + net.minecraftforge.client.event.ViewportEvent.ComputeCameraAngles cameraSetup = net.minecraftforge.client.ForgeHooksClient.onCameraSetup(this, camera, p_109090_); + camera.setAnglesInternal(cameraSetup.getYaw(), cameraSetup.getPitch()); diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch index e3a46be9ff..c6bb7403e1 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch @@ -5,18 +5,18 @@ @OnlyIn(Dist.CLIENT) public class ItemBlockRenderTypes { + @Deprecated - private static final Map TYPE_BY_BLOCK = Util.make(Maps.newHashMap(), (p_296246_) -> { + private static final Map TYPE_BY_BLOCK = Util.make(Maps.newHashMap(), (p_308288_) -> { RenderType rendertype = RenderType.tripwire(); - p_296246_.put(Blocks.TRIPWIRE, rendertype); -@@ -309,6 +_,7 @@ - p_296246_.put(Blocks.BUBBLE_COLUMN, rendertype3); - p_296246_.put(Blocks.TINTED_GLASS, rendertype3); + p_308288_.put(Blocks.TRIPWIRE, rendertype); +@@ -334,6 +_,7 @@ + p_308288_.put(Blocks.BUBBLE_COLUMN, rendertype3); + p_308288_.put(Blocks.TINTED_GLASS, rendertype3); }); + @Deprecated private static final Map TYPE_BY_FLUID = Util.make(Maps.newHashMap(), (p_109290_) -> { RenderType rendertype = RenderType.translucent(); p_109290_.put(Fluids.FLOWING_WATER, rendertype); -@@ -316,6 +_,8 @@ +@@ -341,6 +_,8 @@ }); private static boolean renderCutout; @@ -25,7 +25,7 @@ public static RenderType getChunkRenderType(BlockState p_109283_) { Block block = p_109283_.getBlock(); if (block instanceof LeavesBlock) { -@@ -326,6 +_,8 @@ +@@ -351,6 +_,8 @@ } } @@ -34,7 +34,7 @@ public static RenderType getMovingBlockRenderType(BlockState p_109294_) { Block block = p_109294_.getBlock(); if (block instanceof LeavesBlock) { -@@ -340,6 +_,8 @@ +@@ -365,6 +_,8 @@ } } @@ -43,7 +43,7 @@ public static RenderType getRenderType(BlockState p_109285_, boolean p_109286_) { RenderType rendertype = getChunkRenderType(p_109285_); if (rendertype == RenderType.translucent()) { -@@ -353,6 +_,8 @@ +@@ -378,6 +_,8 @@ } } @@ -52,7 +52,7 @@ public static RenderType getRenderType(ItemStack p_109280_, boolean p_109281_) { Item item = p_109280_.getItem(); if (item instanceof BlockItem) { -@@ -364,8 +_,73 @@ +@@ -389,8 +_,73 @@ } public static RenderType getRenderLayer(FluidState p_109288_) { diff --git a/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch index d6c0169a60..baa5026a3e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/LevelRenderer.java +++ b/net/minecraft/client/renderer/LevelRenderer.java -@@ -245,6 +_,8 @@ +@@ -248,6 +_,8 @@ } private void renderSnowAndRain(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) { @@ -9,7 +9,7 @@ float f = this.minecraft.level.getRainLevel(p_109705_); if (!(f <= 0.0F)) { p_109704_.turnOnLightLayer(); -@@ -364,6 +_,8 @@ +@@ -370,6 +_,8 @@ } public void tickRain(Camera p_109694_) { @@ -18,21 +18,21 @@ float f = this.minecraft.level.getRainLevel(1.0F) / (Minecraft.useFancyGraphics() ? 1.0F : 2.0F); if (!(f <= 0.0F)) { RandomSource randomsource = RandomSource.create((long)this.ticks * 312987231L); -@@ -888,11 +_,13 @@ +@@ -894,11 +_,13 @@ RenderSystem.clear(16640, Minecraft.ON_OSX); - float f = p_109605_.getRenderDistance(); + float f1 = p_109605_.getRenderDistance(); boolean flag1 = this.minecraft.level.effects().isFoggyAt(Mth.floor(d0), Mth.floor(d1)) || this.minecraft.gui.getBossOverlay().shouldCreateWorldFog(); + FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag1, p_109601_); profilerfiller.popPush("sky"); RenderSystem.setShader(GameRenderer::getPositionShader); - this.renderSky(p_109600_, p_254120_, p_109601_, p_109604_, flag1, () -> { - FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag1, p_109601_); + this.renderSky(p_109600_, p_254120_, f, p_109604_, flag1, () -> { + FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f1, flag1, f); }); + net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_SKY.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum); profilerfiller.popPush("fog"); - FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f, 32.0F), flag1, p_109601_); + FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f1, 32.0F), flag1, f); profilerfiller.popPush("terrain_setup"); -@@ -901,7 +_,9 @@ +@@ -907,7 +_,9 @@ this.compileSections(p_109604_); profilerfiller.popPush("terrain"); this.renderSectionLayer(RenderType.solid(), p_109600_, d0, d1, d2, p_254120_); @@ -42,7 +42,7 @@ this.renderSectionLayer(RenderType.cutout(), p_109600_, d0, d1, d2, p_254120_); if (this.level.effects().constantAmbientLight()) { Lighting.setupNetherLevel(p_109600_.last().pose()); -@@ -933,7 +_,7 @@ +@@ -939,7 +_,7 @@ for(Entity entity : this.level.entitiesForRendering()) { if (this.entityRenderDispatcher.shouldRender(entity, frustum, d0, d1, d2) || entity.hasIndirectPassenger(this.minecraft.player)) { BlockPos blockpos = entity.blockPosition(); @@ -51,7 +51,7 @@ ++this.renderedEntities; if (entity.tickCount == 0) { entity.xOld = entity.getX(); -@@ -949,6 +_,9 @@ +@@ -955,6 +_,9 @@ int i = entity.getTeamColor(); outlinebuffersource.setColor(FastColor.ARGB32.red(i), FastColor.ARGB32.green(i), FastColor.ARGB32.blue(i), 255); } else { @@ -61,7 +61,7 @@ multibuffersource = multibuffersource$buffersource; } -@@ -963,12 +_,14 @@ +@@ -970,12 +_,14 @@ multibuffersource$buffersource.endBatch(RenderType.entityCutout(TextureAtlas.LOCATION_BLOCKS)); multibuffersource$buffersource.endBatch(RenderType.entityCutoutNoCull(TextureAtlas.LOCATION_BLOCKS)); multibuffersource$buffersource.endBatch(RenderType.entitySmoothCutout(TextureAtlas.LOCATION_BLOCKS)); @@ -76,7 +76,7 @@ BlockPos blockpos4 = blockentity1.getBlockPos(); MultiBufferSource multibuffersource1 = multibuffersource$buffersource; p_109600_.pushPose(); -@@ -985,6 +_,9 @@ +@@ -992,6 +_,9 @@ }; } } @@ -84,9 +84,9 @@ + flag2 = true; + } - this.blockEntityRenderDispatcher.render(blockentity1, p_109601_, p_109600_, multibuffersource1); + this.blockEntityRenderDispatcher.render(blockentity1, f, p_109600_, multibuffersource1); p_109600_.popPose(); -@@ -994,9 +_,13 @@ +@@ -1001,9 +_,13 @@ synchronized(this.globalBlockEntities) { for(BlockEntity blockentity : this.globalBlockEntities) { @@ -97,10 +97,10 @@ + if (this.shouldShowEntityOutlines() && blockentity.hasCustomOutlineRendering(this.minecraft.player)) { // FORGE: allow custom outline rendering + flag2 = true; + } - this.blockEntityRenderDispatcher.render(blockentity, p_109601_, p_109600_, multibuffersource$buffersource); + this.blockEntityRenderDispatcher.render(blockentity, f, p_109600_, multibuffersource$buffersource); p_109600_.popPose(); } -@@ -1019,6 +_,7 @@ +@@ -1026,6 +_,7 @@ this.minecraft.getMainRenderTarget().bindWrite(false); } @@ -108,7 +108,7 @@ profilerfiller.popPush("destroyProgress"); for(Long2ObjectMap.Entry> entry : this.destructionProgress.long2ObjectEntrySet()) { -@@ -1034,7 +_,8 @@ +@@ -1041,7 +_,8 @@ p_109600_.translate((double)blockpos2.getX() - d0, (double)blockpos2.getY() - d1, (double)blockpos2.getZ() - d2); PoseStack.Pose posestack$pose1 = p_109600_.last(); VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(this.renderBuffers.crumblingBufferSource().getBuffer(ModelBakery.DESTROY_TYPES.get(k)), posestack$pose1.pose(), posestack$pose1.normal(), 1.0F); @@ -118,7 +118,7 @@ p_109600_.popPose(); } } -@@ -1046,10 +_,13 @@ +@@ -1053,10 +_,13 @@ profilerfiller.popPush("outline"); BlockPos blockpos1 = ((BlockHitResult)hitresult).getBlockPos(); BlockState blockstate = this.level.getBlockState(blockpos1); @@ -132,43 +132,43 @@ } this.minecraft.debugRenderer.render(p_109600_, multibuffersource$buffersource, d0, d1, d2); -@@ -1081,7 +_,8 @@ +@@ -1088,7 +_,8 @@ this.particlesTarget.copyDepthFrom(this.minecraft.getMainRenderTarget()); RenderStateShard.PARTICLES_TARGET.setupRenderState(); profilerfiller.popPush("particles"); -- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_); +- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, f); + this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_, frustum); + net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum); RenderStateShard.PARTICLES_TARGET.clearRenderState(); } else { profilerfiller.popPush("translucent"); -@@ -1095,7 +_,8 @@ +@@ -1102,7 +_,8 @@ profilerfiller.popPush("string"); this.renderSectionLayer(RenderType.tripwire(), p_109600_, d0, d1, d2, p_254120_); profilerfiller.popPush("particles"); -- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_); +- this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, f); + this.minecraft.particleEngine.render(p_109600_, multibuffersource$buffersource, p_109606_, p_109604_, p_109601_, frustum); + net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum); } posestack.pushPose(); -@@ -1119,6 +_,7 @@ +@@ -1126,6 +_,7 @@ RenderStateShard.WEATHER_TARGET.setupRenderState(); profilerfiller.popPush("weather"); - this.renderSnowAndRain(p_109606_, p_109601_, d0, d1, d2); + this.renderSnowAndRain(p_109606_, f, d0, d1, d2); + net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_WEATHER.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum); this.renderWorldBorder(p_109604_); RenderStateShard.WEATHER_TARGET.clearRenderState(); - this.transparencyChain.process(p_109601_); -@@ -1127,6 +_,7 @@ + this.transparencyChain.process(f); +@@ -1134,6 +_,7 @@ RenderSystem.depthMask(false); profilerfiller.popPush("weather"); - this.renderSnowAndRain(p_109606_, p_109601_, d0, d1, d2); + this.renderSnowAndRain(p_109606_, f, d0, d1, d2); + net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_WEATHER.dispatch(this, p_109600_, p_254120_, this.ticks, p_109604_, frustum); this.renderWorldBorder(p_109604_); RenderSystem.depthMask(true); } -@@ -1269,6 +_,7 @@ +@@ -1276,6 +_,7 @@ shaderinstance.clear(); VertexBuffer.unbind(); this.minecraft.getProfiler().pop(); @@ -176,7 +176,7 @@ p_298012_.clearRenderState(); } -@@ -1485,6 +_,8 @@ +@@ -1495,6 +_,8 @@ } public void renderSky(PoseStack p_202424_, Matrix4f p_254034_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) { @@ -185,7 +185,7 @@ p_202429_.run(); if (!p_202428_) { FogType fogtype = p_202427_.getFluidInCamera(); -@@ -1606,6 +_,8 @@ +@@ -1616,6 +_,8 @@ } public void renderClouds(PoseStack p_254145_, Matrix4f p_254537_, float p_254364_, double p_253843_, double p_253663_, double p_253795_) { @@ -194,7 +194,7 @@ float f = this.level.effects().getCloudHeight(); if (!Float.isNaN(f)) { RenderSystem.disableCull(); -@@ -1792,7 +_,7 @@ +@@ -1802,7 +_,7 @@ boolean flag = false; if (this.minecraft.options.prioritizeChunkUpdates().get() == PrioritizeChunkUpdates.NEARBY) { BlockPos blockpos1 = sectionrenderdispatcher$rendersection.getOrigin().offset(8, 8, 8); @@ -203,7 +203,7 @@ } else if (this.minecraft.options.prioritizeChunkUpdates().get() == PrioritizeChunkUpdates.PLAYER_AFFECTED) { flag = sectionrenderdispatcher$rendersection.isDirtyFromPlayer(); } -@@ -2139,7 +_,23 @@ +@@ -2149,7 +_,23 @@ this.viewArea.setDirty(p_109502_, p_109503_, p_109504_, p_109505_); } @@ -227,7 +227,7 @@ SoundInstance soundinstance = this.playingRecords.get(p_109516_); if (soundinstance != null) { this.minecraft.getSoundManager().stop(soundinstance); -@@ -2147,7 +_,7 @@ +@@ -2157,7 +_,7 @@ } if (p_109515_ != null) { @@ -236,7 +236,7 @@ if (recorditem != null) { this.minecraft.gui.setNowPlaying(recorditem.getDisplayName()); } -@@ -2284,7 +_,7 @@ +@@ -2294,7 +_,7 @@ case 1010: Item item = Item.byId(p_234307_); if (item instanceof RecordItem recorditem) { @@ -245,7 +245,7 @@ } break; case 1011: -@@ -2437,7 +_,7 @@ +@@ -2436,7 +_,7 @@ case 2001: BlockState blockstate1 = Block.stateById(p_234307_); if (!blockstate1.isAir()) { @@ -254,7 +254,7 @@ this.level.playLocalSound(p_234306_, soundtype.getBreakSound(), SoundSource.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F, false); } -@@ -2672,7 +_,7 @@ +@@ -2692,7 +_,7 @@ } else { int i = p_109538_.getBrightness(LightLayer.SKY, p_109540_); int j = p_109538_.getBrightness(LightLayer.BLOCK, p_109540_); diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch index 09c1d12cad..fec77ef1ea 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/RenderType.java +++ b/net/minecraft/client/renderer/RenderType.java -@@ -322,7 +_,7 @@ +@@ -323,7 +_,7 @@ } public static RenderType text(ResourceLocation p_110498_) { @@ -9,7 +9,7 @@ } public static RenderType textBackground() { -@@ -330,19 +_,19 @@ +@@ -331,19 +_,19 @@ } public static RenderType textIntensity(ResourceLocation p_173238_) { @@ -33,7 +33,7 @@ } public static RenderType textBackgroundSeeThrough() { -@@ -350,7 +_,7 @@ +@@ -351,7 +_,7 @@ } public static RenderType textIntensitySeeThrough(ResourceLocation p_173241_) { @@ -42,7 +42,7 @@ } public static RenderType lightning() { -@@ -677,4 +_,17 @@ +@@ -678,4 +_,17 @@ return this.name; } } diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch index 97360744b0..f75b82166f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch @@ -1,24 +1,6 @@ --- a/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java +++ b/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java -@@ -78,12 +_,16 @@ - private Vec3 camera = Vec3.ZERO; - - public SectionRenderDispatcher(ClientLevel p_299878_, LevelRenderer p_299032_, Executor p_298480_, boolean p_298587_, SectionBufferBuilderPack p_299187_) { -+ this(p_299878_, p_299032_, p_298480_, p_298587_, p_299187_, -1); -+ } -+ -+ public SectionRenderDispatcher(ClientLevel p_299878_, LevelRenderer p_299032_, Executor p_298480_, boolean p_298587_, SectionBufferBuilderPack p_299187_, int countRenderBuilders) { - this.level = p_299878_; - this.renderer = p_299032_; - int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / (RenderType.chunkBufferLayers().stream().mapToInt(RenderType::bufferSize).sum() * 4) - 1); - int j = Runtime.getRuntime().availableProcessors(); - int k = p_298587_ ? j : Math.min(j, 4); -- int l = Math.max(1, Math.min(k, i)); -+ int l = countRenderBuilders < 0 ? Math.max(1, Math.min(k, i)) : countRenderBuilders; - this.fixedBuffers = p_299187_; - List list = Lists.newArrayListWithExpectedSize(l); - -@@ -413,7 +_,7 @@ +@@ -394,7 +_,7 @@ if (!sectionrenderdispatcher$compiledsection.hasBlocks.contains(p_301074_)) { return false; } else { @@ -27,7 +9,7 @@ p_298196_.schedule(this.lastResortTransparencyTask); return true; } -@@ -445,7 +_,7 @@ +@@ -426,7 +_,7 @@ this.initialCompilationCancelCount.incrementAndGet(); } @@ -36,7 +18,7 @@ return this.lastRebuildTask; } -@@ -483,10 +_,20 @@ +@@ -464,10 +_,20 @@ protected final double distAtCreation; protected final AtomicBoolean isCancelled = new AtomicBoolean(false); protected final boolean isHighPriority; @@ -57,7 +39,7 @@ } public abstract CompletableFuture doTask(SectionBufferBuilderPack p_300298_); -@@ -498,6 +_,10 @@ +@@ -479,6 +_,10 @@ public int compareTo(SectionRenderDispatcher.RenderSection.CompileTask p_298947_) { return Doubles.compare(this.distAtCreation, p_298947_.distAtCreation); } @@ -68,7 +50,7 @@ } @OnlyIn(Dist.CLIENT) -@@ -505,8 +_,13 @@ +@@ -486,8 +_,13 @@ @Nullable protected RenderChunkRegion region; @@ -83,7 +65,7 @@ this.region = p_300496_; } -@@ -602,7 +_,10 @@ +@@ -583,7 +_,10 @@ } if (blockstate.getRenderShape() != RenderShape.INVISIBLE) { @@ -95,7 +77,7 @@ BufferBuilder bufferbuilder2 = p_300020_.builder(rendertype2); if (set.add(rendertype2)) { RenderSection.this.beginLayer(bufferbuilder2); -@@ -610,8 +_,9 @@ +@@ -591,8 +_,9 @@ posestack.pushPose(); posestack.translate((float)(blockpos2.getX() & 15), (float)(blockpos2.getY() & 15), (float)(blockpos2.getZ() & 15)); @@ -106,7 +88,7 @@ } } -@@ -640,10 +_,10 @@ +@@ -621,10 +_,10 @@ private void handleBlockEntity(SectionRenderDispatcher.RenderSection.RebuildTask.CompileResults p_297364_, E p_299361_) { BlockEntityRenderer blockentityrenderer = Minecraft.getInstance().getBlockEntityRenderDispatcher().getRenderer(p_299361_); if (blockentityrenderer != null) { @@ -118,7 +100,7 @@ } } -@@ -671,8 +_,13 @@ +@@ -652,8 +_,13 @@ class ResortTransparencyTask extends SectionRenderDispatcher.RenderSection.CompileTask { private final SectionRenderDispatcher.CompiledSection compiledSection; diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch index 7218e28945..82e883abea 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java +++ b/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java -@@ -173,12 +_,12 @@ +@@ -172,12 +_,12 @@ private static void renderHitbox(PoseStack p_114442_, VertexConsumer p_114443_, Entity p_114444_, float p_114445_) { AABB aabb = p_114444_.getBoundingBox().move(-p_114444_.getX(), -p_114444_.getY(), -p_114444_.getZ()); LevelRenderer.renderLineBox(p_114442_, p_114443_, aabb, 1.0F, 1.0F, 1.0F, 1.0F); @@ -15,7 +15,7 @@ p_114442_.pushPose(); double d3 = d0 + Mth.lerp((double)p_114445_, enderdragonpart.xOld, enderdragonpart.getX()); double d4 = d1 + Mth.lerp((double)p_114445_, enderdragonpart.yOld, enderdragonpart.getY()); -@@ -360,9 +_,14 @@ +@@ -359,9 +_,14 @@ return this.itemInHandRenderer; } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch index 119a42d0a1..dbdd3f38f2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/entity/player/PlayerRenderer.java +++ b/net/minecraft/client/renderer/entity/player/PlayerRenderer.java -@@ -60,7 +_,9 @@ +@@ -61,7 +_,9 @@ public void render(AbstractClientPlayer p_117788_, float p_117789_, float p_117790_, PoseStack p_117791_, MultiBufferSource p_117792_, int p_117793_) { this.setModelProperties(p_117788_); @@ -10,7 +10,7 @@ } public Vec3 getRenderOffset(AbstractClientPlayer p_117785_, float p_117786_) { -@@ -133,10 +_,13 @@ +@@ -134,10 +_,13 @@ if (useanim == UseAnim.BRUSH) { return HumanoidModel.ArmPose.BRUSH; } @@ -25,7 +25,7 @@ return HumanoidModel.ArmPose.ITEM; } } -@@ -168,10 +_,12 @@ +@@ -170,10 +_,12 @@ } public void renderRightHand(PoseStack p_117771_, MultiBufferSource p_117772_, int p_117773_, AbstractClientPlayer p_117774_) { @@ -38,7 +38,7 @@ this.renderHand(p_117814_, p_117815_, p_117816_, p_117817_, (this.model).leftArm, (this.model).leftSleeve); } -@@ -211,7 +_,7 @@ +@@ -213,7 +_,7 @@ } } else if (f > 0.0F) { super.setupRotations(p_117802_, p_117803_, p_117804_, p_117805_, p_117806_); diff --git a/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch b/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch index fba04c16a8..65753562dc 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/resources/model/MultiPartBakedModel.java +++ b/net/minecraft/client/resources/model/MultiPartBakedModel.java -@@ -21,7 +_,7 @@ +@@ -20,7 +_,7 @@ import org.apache.commons.lang3.tuple.Pair; @OnlyIn(Dist.CLIENT) @@ -9,10 +9,10 @@ private final List, BakedModel>> selectors; protected final boolean hasAmbientOcclusion; protected final boolean isGui3d; -@@ -30,10 +_,12 @@ +@@ -29,10 +_,12 @@ protected final ItemTransforms transforms; protected final ItemOverrides overrides; - private final Map selectorCache = new Object2ObjectOpenCustomHashMap<>(Util.identityStrategy()); + private final Map selectorCache = new Reference2ObjectOpenHashMap<>(); + private final BakedModel defaultModel; public MultiPartBakedModel(List, BakedModel>> p_119462_) { @@ -22,7 +22,7 @@ this.hasAmbientOcclusion = bakedmodel.useAmbientOcclusion(); this.isGui3d = bakedmodel.isGui3d(); this.usesBlockLight = bakedmodel.usesBlockLight(); -@@ -42,10 +_,7 @@ +@@ -41,10 +_,7 @@ this.overrides = bakedmodel.getOverrides(); } @@ -34,7 +34,7 @@ BitSet bitset = this.selectorCache.get(p_235050_); if (bitset == null) { bitset = new BitSet(); -@@ -59,17 +_,27 @@ +@@ -58,17 +_,27 @@ this.selectorCache.put(p_235050_, bitset); } @@ -65,7 +65,7 @@ } } -@@ -77,6 +_,14 @@ +@@ -76,6 +_,14 @@ return this.hasAmbientOcclusion; } @@ -80,7 +80,7 @@ public boolean isGui3d() { return this.isGui3d; } -@@ -89,12 +_,32 @@ +@@ -88,12 +_,32 @@ return false; } diff --git a/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch index 4f136df1c0..5c243c9a4f 100644 --- a/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/client/server/IntegratedServer.java.patch @@ -13,8 +13,8 @@ + return net.minecraftforge.server.ServerLifecycleHooks.handleServerStarting(this); } - public void tickServer(BooleanSupplier p_120049_) { -@@ -196,6 +_,7 @@ + public boolean isPaused() { +@@ -200,6 +_,7 @@ } public void halt(boolean p_120053_) { diff --git a/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch b/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch index 9030a6f336..bd1ad62976 100644 --- a/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch +++ b/patches/minecraft/net/minecraft/client/sounds/SoundEngine.java.patch @@ -16,7 +16,7 @@ } private synchronized void loadLibrary() { -@@ -324,7 +_,8 @@ +@@ -331,7 +_,8 @@ public void play(SoundInstance p_120313_) { if (this.loaded) { @@ -26,12 +26,12 @@ WeighedSoundEvents weighedsoundevents = p_120313_.resolve(this.soundManager); ResourceLocation resourcelocation = p_120313_.getLocation(); if (weighedsoundevents == null) { -@@ -393,18 +_,21 @@ +@@ -397,18 +_,21 @@ p_194488_.setSelfPosition(vec3); p_194488_.setRelative(flag); }); + final SoundInstance soundinstance = p_120313_; - if (!flag3) { + if (!flag2) { this.soundBuffers.getCompleteBuffer(sound.getPath()).thenAccept((p_194501_) -> { channelaccess$channelhandle.execute((p_194495_) -> { p_194495_.attachStaticBuffer(p_194501_); @@ -40,7 +40,7 @@ }); }); } else { -- this.soundBuffers.getStream(sound.getPath(), flag2).thenAccept((p_194504_) -> { +- this.soundBuffers.getStream(sound.getPath(), flag1).thenAccept((p_194504_) -> { + soundinstance.getStream(this.soundBuffers, sound, flag2).thenAccept((p_194504_) -> { channelaccess$channelhandle.execute((p_194498_) -> { p_194498_.attachBufferStream(p_194504_); diff --git a/patches/minecraft/net/minecraft/commands/CommandSourceStack.java.patch b/patches/minecraft/net/minecraft/commands/CommandSourceStack.java.patch index 09595d0b0a..6fe46e4262 100644 --- a/patches/minecraft/net/minecraft/commands/CommandSourceStack.java.patch +++ b/patches/minecraft/net/minecraft/commands/CommandSourceStack.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/commands/CommandSourceStack.java +++ b/net/minecraft/commands/CommandSourceStack.java -@@ -40,7 +_,7 @@ +@@ -43,7 +_,7 @@ import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; --public class CommandSourceStack implements SharedSuggestionProvider { -+public class CommandSourceStack implements SharedSuggestionProvider, net.minecraftforge.common.extensions.IForgeCommandSourceStack { +-public class CommandSourceStack implements ExecutionCommandSource, SharedSuggestionProvider { ++public class CommandSourceStack implements ExecutionCommandSource, SharedSuggestionProvider, net.minecraftforge.common.extensions.IForgeCommandSourceStack { public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(Component.translatable("permissions.requires.player")); public static final SimpleCommandExceptionType ERROR_NOT_ENTITY = new SimpleCommandExceptionType(Component.translatable("permissions.requires.entity")); public final CommandSource source; diff --git a/patches/minecraft/net/minecraft/commands/Commands.java.patch b/patches/minecraft/net/minecraft/commands/Commands.java.patch index 62a1e029d4..3e64d0d1d9 100644 --- a/patches/minecraft/net/minecraft/commands/Commands.java.patch +++ b/patches/minecraft/net/minecraft/commands/Commands.java.patch @@ -1,45 +1,42 @@ --- a/net/minecraft/commands/Commands.java +++ b/net/minecraft/commands/Commands.java -@@ -196,7 +_,7 @@ +@@ -210,7 +_,7 @@ JfrCommand.register(this.dispatcher); } - if (SharedConstants.IS_RUNNING_IN_IDE) { + if (net.minecraftforge.gametest.ForgeGameTestHooks.isGametestEnabled()) { TestCommand.register(this.dispatcher); - SpawnArmorTrimsCommand.register(this.dispatcher); - if (p_230943_.includeDedicated) { -@@ -224,9 +_,11 @@ + ResetChunksCommand.register(this.dispatcher); + RaidCommand.register(this.dispatcher); +@@ -244,6 +_,7 @@ if (p_230943_.includeIntegrated) { PublishCommand.register(this.dispatcher); } + net.minecraftforge.event.ForgeEventFactory.onCommandRegister(this.dispatcher, p_230943_, p_230944_); - this.dispatcher.setConsumer((p_230954_, p_230955_, p_230956_) -> { - p_230954_.getSource().onCommandComplete(p_230954_, p_230955_, p_230956_); -+ p_230954_.getSource().onCommandComplete(p_230954_, p_230955_, p_230956_); - }); + this.dispatcher.setConsumer(ExecutionCommandSource.resultConsumer()); } - -@@ -249,7 +_,16 @@ +@@ -264,9 +_,17 @@ + commandsourcestack.getServer().getProfiler().push(() -> { + return "/" + p_242841_; + }); +- ContextChain contextchain = finishParsing(p_242844_, p_242841_, commandsourcestack); try { - try { -- return this.dispatcher.execute(p_242844_); -+ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(p_242844_); -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { -+ if (event.getException() instanceof Exception exception) { -+ throw exception; -+ } else if (event.getException() != null) { -+ com.google.common.base.Throwables.throwIfUnchecked(event.getException()); -+ } -+ return 1; -+ } -+ return this.dispatcher.execute(event.getParseResults()); - } catch (CommandRuntimeException commandruntimeexception) { - commandsourcestack.sendFailure(commandruntimeexception.getComponent()); - return 0; -@@ -305,7 +_,8 @@ ++ var event = new net.minecraftforge.event.CommandEvent(p_242844_); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { ++ if (event.getException() instanceof Exception exception) ++ throw exception; ++ else if (event.getException() != null) ++ com.google.common.base.Throwables.throwIfUnchecked(event.getException()); ++ return; ++ } ++ ContextChain contextchain = finishParsing(event.getParseResults(), p_242841_, commandsourcestack); + if (contextchain != null) { + executeCommandInContext(commandsourcestack, (p_308343_) -> { + ExecutionContext.queueInitialCommandExecution(p_308343_, p_242841_, contextchain, commandsourcestack, CommandResultCallback.EMPTY); +@@ -353,7 +_,8 @@ Map, CommandNode> map = Maps.newHashMap(); RootCommandNode rootcommandnode = new RootCommandNode<>(); map.put(this.dispatcher.getRoot(), rootcommandnode); diff --git a/patches/minecraft/net/minecraft/commands/arguments/MessageArgument.java.patch b/patches/minecraft/net/minecraft/commands/arguments/MessageArgument.java.patch index 9c839eeb5e..52a5c9398c 100644 --- a/patches/minecraft/net/minecraft/commands/arguments/MessageArgument.java.patch +++ b/patches/minecraft/net/minecraft/commands/arguments/MessageArgument.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/commands/arguments/MessageArgument.java +++ b/net/minecraft/commands/arguments/MessageArgument.java -@@ -97,7 +_,7 @@ +@@ -95,7 +_,7 @@ } Component resolveComponent(CommandSourceStack p_232197_) throws CommandSyntaxException { diff --git a/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch b/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch index 59c0ea0c47..1abe1043a2 100644 --- a/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch +++ b/patches/minecraft/net/minecraft/commands/synchronization/ArgumentTypeInfos.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/commands/synchronization/ArgumentTypeInfos.java +++ b/net/minecraft/commands/synchronization/ArgumentTypeInfos.java -@@ -65,6 +_,20 @@ +@@ -66,6 +_,20 @@ public class ArgumentTypeInfos { private static final Map, ArgumentTypeInfo> BY_CLASS = Maps.newHashMap(); @@ -21,7 +21,7 @@ private static , T extends ArgumentTypeInfo.Template> ArgumentTypeInfo register(Registry> p_235387_, String p_235388_, Class p_235389_, ArgumentTypeInfo p_235390_) { BY_CLASS.put(p_235389_, p_235390_); return Registry.register(p_235387_, p_235388_, p_235390_); -@@ -119,12 +_,14 @@ +@@ -121,12 +_,14 @@ register(p_235385_, "template_mirror", TemplateMirrorArgument.class, SingletonArgumentInfo.contextFree(TemplateMirrorArgument::templateMirror)); register(p_235385_, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.contextFree(TemplateRotationArgument::templateRotation)); register(p_235385_, "heightmap", HeightmapTypeArgument.class, SingletonArgumentInfo.contextFree(HeightmapTypeArgument::heightmap)); diff --git a/patches/minecraft/net/minecraft/core/MappedRegistry.java.patch b/patches/minecraft/net/minecraft/core/MappedRegistry.java.patch index f543ab6066..08b1e7cb15 100644 --- a/patches/minecraft/net/minecraft/core/MappedRegistry.java.patch +++ b/patches/minecraft/net/minecraft/core/MappedRegistry.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/core/MappedRegistry.java +++ b/net/minecraft/core/MappedRegistry.java -@@ -121,7 +_,16 @@ +@@ -117,7 +_,16 @@ } } @@ -17,7 +17,7 @@ this.validateWrite(p_256594_); Validate.notNull(p_256594_); Validate.notNull(p_256374_); -@@ -145,6 +_,8 @@ +@@ -141,6 +_,8 @@ reference = this.byKey.computeIfAbsent(p_256594_, (p_258168_) -> { return Holder.Reference.createStandAlone(this.holderOwner(), p_258168_); }); @@ -26,7 +26,7 @@ } this.byKey.put(p_256594_, reference); -@@ -300,14 +_,17 @@ +@@ -296,14 +_,17 @@ return this.byKey.containsKey(p_175392_); } @@ -47,7 +47,7 @@ List list = this.byKey.entrySet().stream().filter((p_211055_) -> { return !p_211055_.getValue().isBound(); }).map((p_211794_) -> { -@@ -321,7 +_,8 @@ +@@ -317,7 +_,8 @@ throw new IllegalStateException("Some intrusive holders were not registered: " + this.unregisteredIntrusiveHolders.values()); } diff --git a/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch b/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch index b04e287671..f3a396e2ad 100644 --- a/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch +++ b/patches/minecraft/net/minecraft/core/RegistrySetBuilder.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/core/RegistrySetBuilder.java +++ b/net/minecraft/core/RegistrySetBuilder.java -@@ -37,6 +_,10 @@ +@@ -68,6 +_,10 @@ return this.add(p_256261_, Lifecycle.stable(), p_256010_); } @@ -11,7 +11,7 @@ private RegistrySetBuilder.BuildState createState(RegistryAccess p_256400_) { RegistrySetBuilder.BuildState registrysetbuilder$buildstate = RegistrySetBuilder.BuildState.create(p_256400_, this.entries.stream().map(RegistrySetBuilder.RegistryStub::key)); this.entries.forEach((p_255629_) -> { -@@ -87,7 +_,7 @@ +@@ -168,7 +_,7 @@ RegistrySetBuilder.UniversalLookup registrysetbuilder$universallookup = new RegistrySetBuilder.UniversalLookup(registrysetbuilder$compositeowner); ImmutableMap.Builder> builder = ImmutableMap.builder(); p_255995_.registries().forEach((p_258197_) -> { @@ -20,7 +20,7 @@ }); p_256495_.forEach((p_256603_) -> { builder.put(p_256603_.location(), registrysetbuilder$universallookup); -@@ -108,6 +_,11 @@ +@@ -189,6 +_,11 @@ public HolderGetter lookup(ResourceKey> p_255961_) { return (HolderGetter) BuildState.this.registries.getOrDefault(p_255961_.location(), BuildState.this.lookup); diff --git a/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch b/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch index 84eef80dfb..4795aa6a37 100644 --- a/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch +++ b/patches/minecraft/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java.patch @@ -1,29 +1,30 @@ --- a/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java +++ b/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java -@@ -34,20 +_,21 @@ +@@ -35,21 +_,22 @@ double d2 = vec3.y() + (double)((float)direction.getStepY() * 1.125F); double d3 = vec3.z() + (double)direction.getStepZ() * d0; BlockPos blockpos = p_123375_.pos().relative(direction); -+ Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(level, d0, d1, d2) : new Boat(level, d0, d1, d2)); ++ Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(serverlevel, d0, d1, d2) : new Boat(serverlevel, d0, d1, d2)); + boat.setVariant(this.type); + boat.setYRot(direction.toYRot()); double d4; -- if (level.getFluidState(blockpos).is(FluidTags.WATER)) { -+ if (boat.canBoatInFluid(level.getFluidState(blockpos))) { +- if (serverlevel.getFluidState(blockpos).is(FluidTags.WATER)) { ++ if (boat.canBoatInFluid(serverlevel.getFluidState(blockpos))) { d4 = 1.0D; } else { -- if (!level.getBlockState(blockpos).isAir() || !level.getFluidState(blockpos.below()).is(FluidTags.WATER)) { -+ if (!level.getBlockState(blockpos).isAir() || !boat.canBoatInFluid(level.getFluidState(blockpos.below()))) { +- if (!serverlevel.getBlockState(blockpos).isAir() || !serverlevel.getFluidState(blockpos.below()).is(FluidTags.WATER)) { ++ if (!serverlevel.getBlockState(blockpos).isAir() || !boat.canBoatInFluid(serverlevel.getFluidState(blockpos.below()))) { return this.defaultDispenseItemBehavior.dispense(p_123375_, p_123376_); } d4 = 0.0D; } -- Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(level, d1, d2 + d4, d3) : new Boat(level, d1, d2 + d4, d3)); +- Boat boat = (Boat)(this.isChestBoat ? new ChestBoat(serverlevel, d1, d2 + d4, d3) : new Boat(serverlevel, d1, d2 + d4, d3)); + EntityType.createDefaultStackConfig(serverlevel, p_123376_, (Player)null).accept(boat); - boat.setVariant(this.type); - boat.setYRot(direction.toYRot()); + boat.setPos(d1, d2 + d4, d3); - level.addFreshEntity(boat); + serverlevel.addFreshEntity(boat); p_123376_.shrink(1); return p_123376_; diff --git a/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch b/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch index e39f0025e9..83f990be13 100644 --- a/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch +++ b/patches/minecraft/net/minecraft/core/registries/BuiltInRegistries.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/core/registries/BuiltInRegistries.java +++ b/net/minecraft/core/registries/BuiltInRegistries.java -@@ -114,41 +_,89 @@ +@@ -122,41 +_,89 @@ public static final DefaultedRegistry GAME_EVENT = registerDefaultedWithIntrusiveHolders(Registries.GAME_EVENT, "step", (p_260052_) -> { return GameEvent.STEP; }); @@ -102,7 +102,7 @@ return ChunkStatus.EMPTY; }); public static final Registry> RULE_TEST = registerSimple(Registries.RULE_TEST, (p_259641_) -> { -@@ -160,42 +_,90 @@ +@@ -168,42 +_,90 @@ public static final Registry> POS_RULE_TEST = registerSimple(Registries.POS_RULE_TEST, (p_259262_) -> { return PosRuleTestType.ALWAYS_TRUE_TEST; }); @@ -205,7 +205,7 @@ return Activity.IDLE; }); public static final Registry LOOT_POOL_ENTRY_TYPE = registerSimple(Registries.LOOT_POOL_ENTRY_TYPE, (p_260042_) -> { -@@ -228,10 +_,18 @@ +@@ -236,10 +_,18 @@ public static final Registry> BLOCK_PREDICATE_TYPE = registerSimple(Registries.BLOCK_PREDICATE_TYPE, (p_260006_) -> { return BlockPredicateType.NOT; }); @@ -226,7 +226,7 @@ return Feature.ORE; }); public static final Registry> STRUCTURE_PLACEMENT = registerSimple(Registries.STRUCTURE_PLACEMENT, (p_259179_) -> { -@@ -246,10 +_,18 @@ +@@ -254,10 +_,18 @@ public static final Registry> PLACEMENT_MODIFIER_TYPE = registerSimple(Registries.PLACEMENT_MODIFIER_TYPE, (p_260335_) -> { return PlacementModifierType.COUNT; }); @@ -247,7 +247,7 @@ return FoliagePlacerType.BLOB_FOLIAGE_PLACER; }); public static final Registry> TRUNK_PLACER_TYPE = registerSimple(Registries.TRUNK_PLACER_TYPE, (p_259690_) -> { -@@ -258,7 +_,11 @@ +@@ -266,7 +_,11 @@ public static final Registry> ROOT_PLACER_TYPE = registerSimple(Registries.ROOT_PLACER_TYPE, (p_259493_) -> { return RootPlacerType.MANGROVE_ROOT_PLACER; }); @@ -260,7 +260,7 @@ return TreeDecoratorType.LEAVE_VINE; }); public static final Registry> FEATURE_SIZE_TYPE = registerSimple(Registries.FEATURE_SIZE_TYPE, (p_259370_) -> { -@@ -293,10 +_,18 @@ +@@ -305,10 +_,18 @@ return internalRegister(p_297531_, new MappedRegistry<>(p_297531_, Lifecycle.stable(), true), p_298446_, Lifecycle.stable()); } @@ -279,7 +279,7 @@ private static DefaultedRegistry registerDefaultedWithIntrusiveHolders(ResourceKey> p_259296_, String p_259101_, BuiltInRegistries.RegistryBootstrap p_259485_) { return registerDefaultedWithIntrusiveHolders(p_259296_, p_259101_, Lifecycle.stable(), p_259485_); } -@@ -305,10 +_,19 @@ +@@ -317,10 +_,19 @@ return internalRegister(p_259121_, new MappedRegistry<>(p_259121_, p_259977_, false), p_259874_, p_259977_); } @@ -299,7 +299,7 @@ private static DefaultedRegistry registerDefaultedWithIntrusiveHolders(ResourceKey> p_260010_, String p_260220_, Lifecycle p_260139_, BuiltInRegistries.RegistryBootstrap p_260185_) { return internalRegister(p_260010_, new DefaultedMappedRegistry<>(p_260220_, p_260010_, p_260139_, true), p_260185_, p_260139_); } -@@ -354,7 +_,7 @@ +@@ -369,7 +_,7 @@ if (p_259410_ instanceof DefaultedRegistry) { ResourceLocation resourcelocation = ((DefaultedRegistry)p_259410_).getDefaultKey(); diff --git a/patches/minecraft/net/minecraft/data/Main.java.patch b/patches/minecraft/net/minecraft/data/Main.java.patch index f7e6879d43..30512eecb5 100644 --- a/patches/minecraft/net/minecraft/data/Main.java.patch +++ b/patches/minecraft/net/minecraft/data/Main.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/Main.java +++ b/net/minecraft/data/Main.java -@@ -68,8 +_,15 @@ +@@ -79,8 +_,15 @@ OptionSpec optionspec6 = optionparser.accepts("all", "Include all generators"); OptionSpec optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated"); OptionSpec optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg(); @@ -17,7 +17,7 @@ Path path = Paths.get(optionspec7.value(optionset)); boolean flag = optionset.has(optionspec6); boolean flag1 = flag || optionset.has(optionspec2); -@@ -77,10 +_,14 @@ +@@ -88,10 +_,14 @@ boolean flag3 = flag || optionset.has(optionspec3); boolean flag4 = flag || optionset.has(optionspec4); boolean flag5 = flag || optionset.has(optionspec5); diff --git a/patches/minecraft/net/minecraft/data/advancements/AdvancementProvider.java.patch b/patches/minecraft/net/minecraft/data/advancements/AdvancementProvider.java.patch index eb48fe7555..bee6d0c608 100644 --- a/patches/minecraft/net/minecraft/data/advancements/AdvancementProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/advancements/AdvancementProvider.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/advancements/AdvancementProvider.java +++ b/net/minecraft/data/advancements/AdvancementProvider.java -@@ -14,6 +_,11 @@ +@@ -15,6 +_,11 @@ import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; diff --git a/patches/minecraft/net/minecraft/data/loot/LootTableProvider.java.patch b/patches/minecraft/net/minecraft/data/loot/LootTableProvider.java.patch index 65cd425d93..8f2c4d01e7 100644 --- a/patches/minecraft/net/minecraft/data/loot/LootTableProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/loot/LootTableProvider.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/data/loot/LootTableProvider.java +++ b/net/minecraft/data/loot/LootTableProvider.java -@@ -43,7 +_,7 @@ +@@ -44,7 +_,7 @@ public CompletableFuture run(CachedOutput p_254060_) { final Map map = Maps.newHashMap(); Map map1 = new Object2ObjectOpenHashMap<>(); @@ -9,22 +9,22 @@ p_288263_.provider().get().generate((p_288259_, p_288260_) -> { ResourceLocation resourcelocation1 = map1.put(RandomSequence.seedForKey(p_288259_), p_288259_); if (resourcelocation1 != null) { -@@ -63,13 +_,8 @@ +@@ -65,13 +_,8 @@ } }); - for(ResourceLocation resourcelocation : Sets.difference(this.requiredTables, map.keySet())) { -- validationcontext.reportProblem("Missing built-in table: " + resourcelocation); +- problemreporter$collector.report("Missing built-in table: " + resourcelocation); - } + validate(map, validationcontext); - map.forEach((p_278897_, p_278898_) -> { - p_278898_.validate(validationcontext.setParams(p_278898_.getParamSet()).enterElement("{" + p_278897_ + "}", new LootDataId<>(LootDataType.TABLE, p_278897_))); - }); - Multimap multimap = validationcontext.getProblems(); + Multimap multimap = problemreporter$collector.get(); if (!multimap.isEmpty()) { multimap.forEach((p_124446_, p_124447_) -> { -@@ -86,6 +_,20 @@ +@@ -88,6 +_,20 @@ return new CompletableFuture[p_253403_]; })); } diff --git a/patches/minecraft/net/minecraft/data/recipes/CraftingRecipeBuilder.java.patch b/patches/minecraft/net/minecraft/data/recipes/CraftingRecipeBuilder.java.patch deleted file mode 100644 index a931eee169..0000000000 --- a/patches/minecraft/net/minecraft/data/recipes/CraftingRecipeBuilder.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/data/recipes/CraftingRecipeBuilder.java -+++ b/net/minecraft/data/recipes/CraftingRecipeBuilder.java -@@ -31,8 +_,15 @@ - this.category = p_250313_; - } - -+ private net.minecraftforge.common.crafting.conditions.ICondition condition; -+ public R withCondition(net.minecraftforge.common.crafting.conditions.ICondition condition) { -+ this.condition = condition; -+ return (R)this; -+ } -+ - public void serializeRecipeData(JsonObject p_250456_) { - p_250456_.addProperty("category", this.category.getSerializedName()); -+ net.minecraftforge.common.ForgeHooks.writeCondition(this.condition, p_250456_); - } - } - } diff --git a/patches/minecraft/net/minecraft/data/recipes/FinishedRecipe.java.patch b/patches/minecraft/net/minecraft/data/recipes/FinishedRecipe.java.patch deleted file mode 100644 index b697fc4933..0000000000 --- a/patches/minecraft/net/minecraft/data/recipes/FinishedRecipe.java.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/data/recipes/FinishedRecipe.java -+++ b/net/minecraft/data/recipes/FinishedRecipe.java -@@ -23,4 +_,12 @@ - - @Nullable - AdvancementHolder advancement(); -+ -+ @Nullable -+ default AdvancementData advancementData() { -+ var adv = this.advancement(); -+ return adv == null ? null : new AdvancementData(adv.id(), adv.value().serializeToJson()); -+ } -+ -+ record AdvancementData(ResourceLocation id, JsonObject data) {} - } diff --git a/patches/minecraft/net/minecraft/data/recipes/RecipeOutput.java.patch b/patches/minecraft/net/minecraft/data/recipes/RecipeOutput.java.patch new file mode 100644 index 0000000000..6e4313a92f --- /dev/null +++ b/patches/minecraft/net/minecraft/data/recipes/RecipeOutput.java.patch @@ -0,0 +1,20 @@ +--- a/net/minecraft/data/recipes/RecipeOutput.java ++++ b/net/minecraft/data/recipes/RecipeOutput.java +@@ -7,7 +_,16 @@ + import net.minecraft.world.item.crafting.Recipe; + + public interface RecipeOutput { +- void accept(ResourceLocation p_310578_, Recipe p_312265_, @Nullable AdvancementHolder p_310407_); ++ default void accept(ResourceLocation id, Recipe recipe, @Nullable AdvancementHolder advancement) { ++ if (advancement == null) ++ accept(id, recipe, null, null); ++ else { ++ var json = net.minecraft.Util.getOrThrow(Advancement.CODEC.encodeStart(com.mojang.serialization.JsonOps.INSTANCE, advancement.value()), IllegalStateException::new); ++ accept(id, recipe, advancement.id(), json); ++ } ++ } ++ ++ void accept(ResourceLocation id, Recipe recipe, @Nullable ResourceLocation advancementId, @Nullable com.google.gson.JsonElement advancement); + + Advancement.Builder advancement(); + } diff --git a/patches/minecraft/net/minecraft/data/recipes/RecipeProvider.java.patch b/patches/minecraft/net/minecraft/data/recipes/RecipeProvider.java.patch index 60f6ab2f05..cbc898cf46 100644 --- a/patches/minecraft/net/minecraft/data/recipes/RecipeProvider.java.patch +++ b/patches/minecraft/net/minecraft/data/recipes/RecipeProvider.java.patch @@ -1,16 +1,19 @@ --- a/net/minecraft/data/recipes/RecipeProvider.java +++ b/net/minecraft/data/recipes/RecipeProvider.java -@@ -90,10 +_,11 @@ - throw new IllegalStateException("Duplicate recipe " + p_300066_.id()); +@@ -87,13 +_,15 @@ + final Set set = Sets.newHashSet(); + final List> list = new ArrayList<>(); + this.buildRecipes(new RecipeOutput() { +- public void accept(ResourceLocation p_312383_, Recipe p_312007_, @Nullable AdvancementHolder p_311384_) { ++ public void accept(ResourceLocation p_312383_, Recipe p_312007_, @Nullable ResourceLocation advancementId, @Nullable com.google.gson.JsonElement advancement) { + if (!set.add(p_312383_)) { + throw new IllegalStateException("Duplicate recipe " + p_312383_); } else { - list.add(DataProvider.saveStable(p_254020_, p_300066_.serializeRecipe(), RecipeProvider.this.recipePathProvider.json(p_300066_.id()))); -- AdvancementHolder advancementholder = p_300066_.advancement(); -- if (advancementholder != null) { -- JsonObject jsonobject = advancementholder.value().serializeToJson(); -- list.add(DataProvider.saveStable(p_254020_, jsonobject, RecipeProvider.this.advancementPathProvider.json(advancementholder.id()))); -+ var advancementdata = p_300066_.advancementData(); -+ if (advancementdata != null) { -+ var saveAdvancementFuture = saveAdvancement(p_254020_, advancementdata.id(), advancementdata.data(), p_300066_); + list.add(DataProvider.saveStable(p_254020_, Recipe.CODEC, p_312007_, RecipeProvider.this.recipePathProvider.json(p_312383_))); +- if (p_311384_ != null) { +- list.add(DataProvider.saveStable(p_254020_, Advancement.CODEC, p_311384_.value(), RecipeProvider.this.advancementPathProvider.json(p_311384_.id()))); ++ if (advancement != null) { ++ var saveAdvancementFuture = saveAdvancement(p_254020_, advancementId, advancement); + if (saveAdvancementFuture != null) + list.add(saveAdvancementFuture); } @@ -28,8 +31,8 @@ + * @return A completable future that saves the advancement to disk, or null to cancel saving the advancement. + */ + @Nullable -+ protected CompletableFuture saveAdvancement(CachedOutput output, ResourceLocation advancementId, JsonObject advancementJson, FinishedRecipe finishedRecipe) { -+ return DataProvider.saveStable(output, advancementJson, this.advancementPathProvider.json(advancementId)); ++ protected CompletableFuture saveAdvancement(CachedOutput output, ResourceLocation advancementId, com.google.gson.JsonElement advancement) { ++ return DataProvider.saveStable(output, advancement, this.advancementPathProvider.json(advancementId)); } protected CompletableFuture buildAdvancement(CachedOutput p_253674_, AdvancementHolder p_297687_) { diff --git a/patches/minecraft/net/minecraft/data/recipes/ShapedRecipeBuilder.java.patch b/patches/minecraft/net/minecraft/data/recipes/ShapedRecipeBuilder.java.patch deleted file mode 100644 index 0a908e840d..0000000000 --- a/patches/minecraft/net/minecraft/data/recipes/ShapedRecipeBuilder.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/data/recipes/ShapedRecipeBuilder.java -+++ b/net/minecraft/data/recipes/ShapedRecipeBuilder.java -@@ -101,7 +_,14 @@ - this.ensureValid(p_126142_); - Advancement.Builder advancement$builder = p_298334_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126142_)).rewards(AdvancementRewards.Builder.recipe(p_126142_)).requirements(AdvancementRequirements.Strategy.OR); - this.criteria.forEach(advancement$builder::addCriterion); -- p_298334_.accept(new ShapedRecipeBuilder.Result(p_126142_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.rows, this.key, advancement$builder.build(p_126142_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.showNotification)); -+ p_298334_.accept(new ShapedRecipeBuilder.Result(p_126142_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.rows, this.key, advancement$builder.build(p_126142_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.showNotification).withCondition(this.condition)); -+ } -+ -+ @Nullable -+ private net.minecraftforge.common.crafting.conditions.ICondition condition; -+ public ShapedRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) { -+ this.condition = condition; -+ return this; - } - - private void ensureValid(ResourceLocation p_126144_) { diff --git a/patches/minecraft/net/minecraft/data/recipes/ShapelessRecipeBuilder.java.patch b/patches/minecraft/net/minecraft/data/recipes/ShapelessRecipeBuilder.java.patch deleted file mode 100644 index d3779d933d..0000000000 --- a/patches/minecraft/net/minecraft/data/recipes/ShapelessRecipeBuilder.java.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/net/minecraft/data/recipes/ShapelessRecipeBuilder.java -+++ b/net/minecraft/data/recipes/ShapelessRecipeBuilder.java -@@ -91,7 +_,14 @@ - this.ensureValid(p_126206_); - Advancement.Builder advancement$builder = p_300117_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126206_)).rewards(AdvancementRewards.Builder.recipe(p_126206_)).requirements(AdvancementRequirements.Strategy.OR); - this.criteria.forEach(advancement$builder::addCriterion); -- p_300117_.accept(new ShapelessRecipeBuilder.Result(p_126206_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.ingredients, advancement$builder.build(p_126206_.withPrefix("recipes/" + this.category.getFolderName() + "/")))); -+ p_300117_.accept(new ShapelessRecipeBuilder.Result(p_126206_, this.result, this.count, this.group == null ? "" : this.group, determineBookCategory(this.category), this.ingredients, advancement$builder.build(p_126206_.withPrefix("recipes/" + this.category.getFolderName() + "/"))).withCondition(this.condition)); -+ } -+ -+ @Nullable -+ private net.minecraftforge.common.crafting.conditions.ICondition condition; -+ public ShapelessRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) { -+ this.condition = condition; -+ return this; - } - - private void ensureValid(ResourceLocation p_126208_) { diff --git a/patches/minecraft/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java.patch b/patches/minecraft/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java.patch deleted file mode 100644 index 97ac313e99..0000000000 --- a/patches/minecraft/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java -+++ b/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java -@@ -80,7 +_,14 @@ - this.ensureValid(p_126264_); - Advancement.Builder advancement$builder = p_299448_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126264_)).rewards(AdvancementRewards.Builder.recipe(p_126264_)).requirements(AdvancementRequirements.Strategy.OR); - this.criteria.forEach(advancement$builder::addCriterion); -- p_299448_.accept(new SimpleCookingRecipeBuilder.Result(p_126264_, this.group == null ? "" : this.group, this.bookCategory, this.ingredient, this.result, this.experience, this.cookingTime, advancement$builder.build(p_126264_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.serializer)); -+ p_299448_.accept(new SimpleCookingRecipeBuilder.Result(p_126264_, this.group == null ? "" : this.group, this.bookCategory, this.ingredient, this.result, this.experience, this.cookingTime, advancement$builder.build(p_126264_.withPrefix("recipes/" + this.category.getFolderName() + "/")), this.serializer, this.condition)); -+ } -+ -+ @Nullable -+ private net.minecraftforge.common.crafting.conditions.ICondition condition; -+ public SimpleCookingRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) { -+ this.condition = condition; -+ return this; - } - - private static CookingBookCategory determineSmeltingRecipeCategory(ItemLike p_251938_) { -@@ -113,8 +_,13 @@ - } - } - -- static record Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer type) implements FinishedRecipe { -+ static record Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer type, net.minecraftforge.common.crafting.conditions.ICondition condition) implements FinishedRecipe { -+ public Result(ResourceLocation id, String group, CookingBookCategory category, Ingredient ingredient, Item result, float experience, int cookingTime, AdvancementHolder advancement, RecipeSerializer type) { -+ this(id, group, category, ingredient, result, experience, cookingTime, advancement, type, null); -+ } -+ - public void serializeRecipeData(JsonObject p_126297_) { -+ net.minecraftforge.common.ForgeHooks.writeCondition(this.condition, p_126297_); - if (!this.group.isEmpty()) { - p_126297_.addProperty("group", this.group); - } diff --git a/patches/minecraft/net/minecraft/data/recipes/SingleItemRecipeBuilder.java.patch b/patches/minecraft/net/minecraft/data/recipes/SingleItemRecipeBuilder.java.patch deleted file mode 100644 index 238ab41fc2..0000000000 --- a/patches/minecraft/net/minecraft/data/recipes/SingleItemRecipeBuilder.java.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/net/minecraft/data/recipes/SingleItemRecipeBuilder.java -+++ b/net/minecraft/data/recipes/SingleItemRecipeBuilder.java -@@ -61,7 +_,14 @@ - this.ensureValid(p_126328_); - Advancement.Builder advancement$builder = p_298439_.advancement().addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(p_126328_)).rewards(AdvancementRewards.Builder.recipe(p_126328_)).requirements(AdvancementRequirements.Strategy.OR); - this.criteria.forEach(advancement$builder::addCriterion); -- p_298439_.accept(new SingleItemRecipeBuilder.Result(p_126328_, this.type, this.group == null ? "" : this.group, this.ingredient, this.result, this.count, advancement$builder.build(p_126328_.withPrefix("recipes/" + this.category.getFolderName() + "/")))); -+ p_298439_.accept(new SingleItemRecipeBuilder.Result(p_126328_, this.type, this.group == null ? "" : this.group, this.ingredient, this.result, this.count, advancement$builder.build(p_126328_.withPrefix("recipes/" + this.category.getFolderName() + "/")), condition)); -+ } -+ -+ @Nullable -+ private net.minecraftforge.common.crafting.conditions.ICondition condition; -+ public SingleItemRecipeBuilder condition(net.minecraftforge.common.crafting.conditions.ICondition condition) { -+ this.condition = condition; -+ return this; - } - - private void ensureValid(ResourceLocation p_126330_) { -@@ -70,8 +_,13 @@ - } - } - -- public static record Result(ResourceLocation id, RecipeSerializer type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement) implements FinishedRecipe { -+ public static record Result(ResourceLocation id, RecipeSerializer type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement, net.minecraftforge.common.crafting.conditions.ICondition condition) implements FinishedRecipe { -+ Result(ResourceLocation id, RecipeSerializer type, String group, Ingredient ingredient, Item result, int count, AdvancementHolder advancement) { -+ this(id, type, group, ingredient, result, count, advancement, null); -+ } -+ - public void serializeRecipeData(JsonObject p_126349_) { -+ net.minecraftforge.common.ForgeHooks.writeCondition(this.condition, p_126349_); - if (!this.group.isEmpty()) { - p_126349_.addProperty("group", this.group); - } diff --git a/patches/minecraft/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch b/patches/minecraft/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch index 82a26a0768..0a656435d0 100644 --- a/patches/minecraft/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch +++ b/patches/minecraft/net/minecraft/data/registries/RegistriesDatapackGenerator.java.patch @@ -1,20 +1,11 @@ --- a/net/minecraft/data/registries/RegistriesDatapackGenerator.java +++ b/net/minecraft/data/registries/RegistriesDatapackGenerator.java -@@ -18,20 +_,36 @@ - import net.minecraft.resources.ResourceKey; - import org.slf4j.Logger; - -+/** -+ * @deprecated Forge: Use {@link net.minecraftforge.common.data.DatapackBuiltinEntriesProvider} instead -+ */ -+@Deprecated - public class RegistriesDatapackGenerator implements DataProvider { +@@ -22,16 +_,27 @@ private static final Logger LOGGER = LogUtils.getLogger(); private final PackOutput output; private final CompletableFuture registries; + private final java.util.function.Predicate namespacePredicate; -+ @Deprecated public RegistriesDatapackGenerator(PackOutput p_256643_, CompletableFuture p_255780_) { + this(p_256643_, p_255780_, null); + } diff --git a/patches/minecraft/net/minecraft/gametest/framework/GameTestHelper.java.patch b/patches/minecraft/net/minecraft/gametest/framework/GameTestHelper.java.patch index 3669144c1c..044136080c 100644 --- a/patches/minecraft/net/minecraft/gametest/framework/GameTestHelper.java.patch +++ b/patches/minecraft/net/minecraft/gametest/framework/GameTestHelper.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/gametest/framework/GameTestHelper.java +++ b/net/minecraft/gametest/framework/GameTestHelper.java -@@ -54,7 +_,7 @@ +@@ -60,7 +_,7 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; diff --git a/patches/minecraft/net/minecraft/gametest/framework/GameTestRegistry.java.patch b/patches/minecraft/net/minecraft/gametest/framework/GameTestRegistry.java.patch index be8998da35..a9ede7329d 100644 --- a/patches/minecraft/net/minecraft/gametest/framework/GameTestRegistry.java.patch +++ b/patches/minecraft/net/minecraft/gametest/framework/GameTestRegistry.java.patch @@ -1,13 +1,13 @@ --- a/net/minecraft/gametest/framework/GameTestRegistry.java +++ b/net/minecraft/gametest/framework/GameTestRegistry.java -@@ -25,22 +_,31 @@ +@@ -26,22 +_,31 @@ private static final Map> AFTER_BATCH_FUNCTIONS = Maps.newHashMap(); private static final Collection LAST_FAILED_TESTS = Sets.newHashSet(); + /** @deprecated Forge: Use {@link net.minecraftforge.event.RegisterGameTestsEvent RegisterGameTestsEvent} to register game tests */ + @Deprecated public static void register(Class p_177502_) { - Arrays.stream(p_177502_.getDeclaredMethods()).forEach(GameTestRegistry::register); + Arrays.stream(p_177502_.getDeclaredMethods()).sorted(Comparator.comparing(Method::getName)).forEach(GameTestRegistry::register); } + /** @deprecated Forge: Use {@link net.minecraftforge.event.RegisterGameTestsEvent RegisterGameTestsEvent} to register game tests */ @@ -36,7 +36,7 @@ } registerBatchFunction(p_177504_, BeforeBatch.class, BeforeBatch::batch, BEFORE_BATCH_FUNCTIONS); -@@ -104,7 +_,9 @@ +@@ -105,7 +_,9 @@ private static Collection useTestGeneratorMethod(Method p_177514_) { try { @@ -47,7 +47,7 @@ return (Collection)p_177514_.invoke(object); } catch (ReflectiveOperationException reflectiveoperationexception) { throw new RuntimeException(reflectiveoperationexception); -@@ -115,9 +_,9 @@ +@@ -116,9 +_,9 @@ GameTest gametest = p_177516_.getAnnotation(GameTest.class); String s = p_177516_.getDeclaringClass().getSimpleName(); String s1 = s.toLowerCase(); @@ -60,7 +60,7 @@ Rotation rotation = StructureUtils.getRotationForRotationSteps(gametest.rotationSteps()); return new TestFunction(s4, s2, s3, rotation, gametest.timeoutTicks(), gametest.setupTicks(), gametest.required(), gametest.requiredSuccesses(), gametest.attempts(), (Consumer)turnMethodIntoConsumer(p_177516_)); } -@@ -125,7 +_,9 @@ +@@ -126,7 +_,9 @@ private static Consumer turnMethodIntoConsumer(Method p_177520_) { return (p_177512_) -> { try { diff --git a/patches/minecraft/net/minecraft/gametest/framework/GameTestServer.java.patch b/patches/minecraft/net/minecraft/gametest/framework/GameTestServer.java.patch index 6f2954dad9..f2b030d740 100644 --- a/patches/minecraft/net/minecraft/gametest/framework/GameTestServer.java.patch +++ b/patches/minecraft/net/minecraft/gametest/framework/GameTestServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/gametest/framework/GameTestServer.java +++ b/net/minecraft/gametest/framework/GameTestServer.java -@@ -105,13 +_,14 @@ +@@ -106,13 +_,14 @@ public boolean initServer() { this.setPlayerList(new PlayerList(this, this.registries(), this.playerDataStorage, 1) { }); diff --git a/patches/minecraft/net/minecraft/gametest/framework/StructureUtils.java.patch b/patches/minecraft/net/minecraft/gametest/framework/StructureUtils.java.patch deleted file mode 100644 index 2539ae0a98..0000000000 --- a/patches/minecraft/net/minecraft/gametest/framework/StructureUtils.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/gametest/framework/StructureUtils.java -+++ b/net/minecraft/gametest/framework/StructureUtils.java -@@ -218,7 +_,7 @@ - if (optional.isPresent()) { - return optional.get(); - } else { -- String s = p_127881_ + ".snbt"; -+ String s = new ResourceLocation(p_127881_).getPath() + ".snbt"; - Path path = Paths.get(testStructuresDir, s); - CompoundTag compoundtag = tryLoadStructure(path); - if (compoundtag == null) { diff --git a/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch b/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch index 4ff53ed0ec..4f72286bd9 100644 --- a/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch +++ b/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch @@ -8,10 +8,10 @@ + return (new net.minecraftforge.common.util.INBTBuilder(){}).nbt(); + } + - public static final Codec CODEC = Codec.PASSTHROUGH.comapFlatMap((p_274781_) -> { - Tag tag = p_274781_.convert(NbtOps.INSTANCE).getValue(); - return tag instanceof CompoundTag ? DataResult.success((CompoundTag)tag) : DataResult.error(() -> { -@@ -204,6 +_,7 @@ + public static final Codec CODEC = Codec.PASSTHROUGH.comapFlatMap((p_308555_) -> { + Tag tag = p_308555_.convert(NbtOps.INSTANCE).getValue(); + if (tag instanceof CompoundTag compoundtag) { +@@ -208,6 +_,7 @@ @Nullable public Tag put(String p_128366_, Tag p_128367_) { diff --git a/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch b/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch index 8c308d134f..d68a83cb9c 100644 --- a/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/nbt/NbtIo.java +++ b/net/minecraft/nbt/NbtIo.java -@@ -154,10 +_,12 @@ +@@ -168,10 +_,12 @@ private static Tag readUnnamedTag(DataInput p_128931_, NbtAccounter p_128933_) throws IOException { byte b0 = p_128931_.readByte(); diff --git a/patches/minecraft/net/minecraft/nbt/StringTag.java.patch b/patches/minecraft/net/minecraft/nbt/StringTag.java.patch index 177f389cee..128cbc1b56 100644 --- a/patches/minecraft/net/minecraft/nbt/StringTag.java.patch +++ b/patches/minecraft/net/minecraft/nbt/StringTag.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/nbt/StringTag.java +++ b/net/minecraft/nbt/StringTag.java -@@ -21,7 +_,7 @@ +@@ -19,7 +_,7 @@ private static String readAccounted(DataInput p_301750_, NbtAccounter p_301732_) throws IOException { p_301732_.accountBytes(36L); String s = p_301750_.readUTF(); diff --git a/patches/minecraft/net/minecraft/network/ConnectionProtocol.java.patch b/patches/minecraft/net/minecraft/network/ConnectionProtocol.java.patch index ada915a94b..1f65c8b3db 100644 --- a/patches/minecraft/net/minecraft/network/ConnectionProtocol.java.patch +++ b/patches/minecraft/net/minecraft/network/ConnectionProtocol.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/network/ConnectionProtocol.java +++ b/net/minecraft/network/ConnectionProtocol.java -@@ -211,11 +_,231 @@ +@@ -216,11 +_,237 @@ import org.slf4j.Logger; public enum ConnectionProtocol { - HANDSHAKING("handshake", protocol().addFlow(PacketFlow.CLIENTBOUND, new ConnectionProtocol.PacketSet()).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))), -- PLAY("play", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).withBundlePacket(ClientboundBundlePacket.class, ClientboundBundlePacket::new).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockChangedAckPacket.class, ClientboundBlockChangedAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChunkBatchFinishedPacket.class, ClientboundChunkBatchFinishedPacket::new).addPacket(ClientboundChunkBatchStartPacket.class, ClientboundChunkBatchStartPacket::new).addPacket(ClientboundChunksBiomesPacket.class, ClientboundChunksBiomesPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomChatCompletionsPacket.class, ClientboundCustomChatCompletionsPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDamageEventPacket.class, ClientboundDamageEventPacket::new).addPacket(ClientboundDeleteChatPacket.class, ClientboundDeleteChatPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundDisguisedChatPacket.class, ClientboundDisguisedChatPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundHurtAnimationPacket.class, ClientboundHurtAnimationPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkWithLightPacket.class, ClientboundLevelChunkWithLightPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerChatPacket.class, ClientboundPlayerChatPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoRemovePacket.class, ClientboundPlayerInfoRemovePacket::new).addPacket(ClientboundPlayerInfoUpdatePacket.class, ClientboundPlayerInfoUpdatePacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundServerDataPacket.class, ClientboundServerDataPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSimulationDistancePacket.class, ClientboundSetSimulationDistancePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStartConfigurationPacket.class, ClientboundStartConfigurationPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundSystemChatPacket.class, ClientboundSystemChatPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatAckPacket.class, ServerboundChatAckPacket::new).addPacket(ServerboundChatCommandPacket.class, ServerboundChatCommandPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundChatSessionUpdatePacket.class, ServerboundChatSessionUpdatePacket::new).addPacket(ServerboundChunkBatchReceivedPacket.class, ServerboundChunkBatchReceivedPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundConfigurationAcknowledgedPacket.class, ServerboundConfigurationAcknowledgedPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), +- PLAY("play", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).withBundlePacket(ClientboundBundlePacket.class, ClientboundBundlePacket::new).addPacket(ClientboundAddEntityPacket.class, ClientboundAddEntityPacket::new).addPacket(ClientboundAddExperienceOrbPacket.class, ClientboundAddExperienceOrbPacket::new).addPacket(ClientboundAnimatePacket.class, ClientboundAnimatePacket::new).addPacket(ClientboundAwardStatsPacket.class, ClientboundAwardStatsPacket::new).addPacket(ClientboundBlockChangedAckPacket.class, ClientboundBlockChangedAckPacket::new).addPacket(ClientboundBlockDestructionPacket.class, ClientboundBlockDestructionPacket::new).addPacket(ClientboundBlockEntityDataPacket.class, ClientboundBlockEntityDataPacket::new).addPacket(ClientboundBlockEventPacket.class, ClientboundBlockEventPacket::new).addPacket(ClientboundBlockUpdatePacket.class, ClientboundBlockUpdatePacket::new).addPacket(ClientboundBossEventPacket.class, ClientboundBossEventPacket::new).addPacket(ClientboundChangeDifficultyPacket.class, ClientboundChangeDifficultyPacket::new).addPacket(ClientboundChunkBatchFinishedPacket.class, ClientboundChunkBatchFinishedPacket::new).addPacket(ClientboundChunkBatchStartPacket.class, ClientboundChunkBatchStartPacket::new).addPacket(ClientboundChunksBiomesPacket.class, ClientboundChunksBiomesPacket::new).addPacket(ClientboundClearTitlesPacket.class, ClientboundClearTitlesPacket::new).addPacket(ClientboundCommandSuggestionsPacket.class, ClientboundCommandSuggestionsPacket::new).addPacket(ClientboundCommandsPacket.class, ClientboundCommandsPacket::new).addPacket(ClientboundContainerClosePacket.class, ClientboundContainerClosePacket::new).addPacket(ClientboundContainerSetContentPacket.class, ClientboundContainerSetContentPacket::new).addPacket(ClientboundContainerSetDataPacket.class, ClientboundContainerSetDataPacket::new).addPacket(ClientboundContainerSetSlotPacket.class, ClientboundContainerSetSlotPacket::new).addPacket(ClientboundCooldownPacket.class, ClientboundCooldownPacket::new).addPacket(ClientboundCustomChatCompletionsPacket.class, ClientboundCustomChatCompletionsPacket::new).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDamageEventPacket.class, ClientboundDamageEventPacket::new).addPacket(ClientboundDeleteChatPacket.class, ClientboundDeleteChatPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundDisguisedChatPacket.class, ClientboundDisguisedChatPacket::new).addPacket(ClientboundEntityEventPacket.class, ClientboundEntityEventPacket::new).addPacket(ClientboundExplodePacket.class, ClientboundExplodePacket::new).addPacket(ClientboundForgetLevelChunkPacket.class, ClientboundForgetLevelChunkPacket::new).addPacket(ClientboundGameEventPacket.class, ClientboundGameEventPacket::new).addPacket(ClientboundHorseScreenOpenPacket.class, ClientboundHorseScreenOpenPacket::new).addPacket(ClientboundHurtAnimationPacket.class, ClientboundHurtAnimationPacket::new).addPacket(ClientboundInitializeBorderPacket.class, ClientboundInitializeBorderPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundLevelChunkWithLightPacket.class, ClientboundLevelChunkWithLightPacket::new).addPacket(ClientboundLevelEventPacket.class, ClientboundLevelEventPacket::new).addPacket(ClientboundLevelParticlesPacket.class, ClientboundLevelParticlesPacket::new).addPacket(ClientboundLightUpdatePacket.class, ClientboundLightUpdatePacket::new).addPacket(ClientboundLoginPacket.class, ClientboundLoginPacket::new).addPacket(ClientboundMapItemDataPacket.class, ClientboundMapItemDataPacket::new).addPacket(ClientboundMerchantOffersPacket.class, ClientboundMerchantOffersPacket::new).addPacket(ClientboundMoveEntityPacket.Pos.class, ClientboundMoveEntityPacket.Pos::read).addPacket(ClientboundMoveEntityPacket.PosRot.class, ClientboundMoveEntityPacket.PosRot::read).addPacket(ClientboundMoveEntityPacket.Rot.class, ClientboundMoveEntityPacket.Rot::read).addPacket(ClientboundMoveVehiclePacket.class, ClientboundMoveVehiclePacket::new).addPacket(ClientboundOpenBookPacket.class, ClientboundOpenBookPacket::new).addPacket(ClientboundOpenScreenPacket.class, ClientboundOpenScreenPacket::new).addPacket(ClientboundOpenSignEditorPacket.class, ClientboundOpenSignEditorPacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new).addPacket(ClientboundPlaceGhostRecipePacket.class, ClientboundPlaceGhostRecipePacket::new).addPacket(ClientboundPlayerAbilitiesPacket.class, ClientboundPlayerAbilitiesPacket::new).addPacket(ClientboundPlayerChatPacket.class, ClientboundPlayerChatPacket::new).addPacket(ClientboundPlayerCombatEndPacket.class, ClientboundPlayerCombatEndPacket::new).addPacket(ClientboundPlayerCombatEnterPacket.class, ClientboundPlayerCombatEnterPacket::new).addPacket(ClientboundPlayerCombatKillPacket.class, ClientboundPlayerCombatKillPacket::new).addPacket(ClientboundPlayerInfoRemovePacket.class, ClientboundPlayerInfoRemovePacket::new).addPacket(ClientboundPlayerInfoUpdatePacket.class, ClientboundPlayerInfoUpdatePacket::new).addPacket(ClientboundPlayerLookAtPacket.class, ClientboundPlayerLookAtPacket::new).addPacket(ClientboundPlayerPositionPacket.class, ClientboundPlayerPositionPacket::new).addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new).addPacket(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new).addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new).addPacket(ClientboundResetScorePacket.class, ClientboundResetScorePacket::new).addPacket(ClientboundResourcePackPopPacket.class, ClientboundResourcePackPopPacket::new).addPacket(ClientboundResourcePackPushPacket.class, ClientboundResourcePackPushPacket::new).addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new).addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new).addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new).addPacket(ClientboundSelectAdvancementsTabPacket.class, ClientboundSelectAdvancementsTabPacket::new).addPacket(ClientboundServerDataPacket.class, ClientboundServerDataPacket::new).addPacket(ClientboundSetActionBarTextPacket.class, ClientboundSetActionBarTextPacket::new).addPacket(ClientboundSetBorderCenterPacket.class, ClientboundSetBorderCenterPacket::new).addPacket(ClientboundSetBorderLerpSizePacket.class, ClientboundSetBorderLerpSizePacket::new).addPacket(ClientboundSetBorderSizePacket.class, ClientboundSetBorderSizePacket::new).addPacket(ClientboundSetBorderWarningDelayPacket.class, ClientboundSetBorderWarningDelayPacket::new).addPacket(ClientboundSetBorderWarningDistancePacket.class, ClientboundSetBorderWarningDistancePacket::new).addPacket(ClientboundSetCameraPacket.class, ClientboundSetCameraPacket::new).addPacket(ClientboundSetCarriedItemPacket.class, ClientboundSetCarriedItemPacket::new).addPacket(ClientboundSetChunkCacheCenterPacket.class, ClientboundSetChunkCacheCenterPacket::new).addPacket(ClientboundSetChunkCacheRadiusPacket.class, ClientboundSetChunkCacheRadiusPacket::new).addPacket(ClientboundSetDefaultSpawnPositionPacket.class, ClientboundSetDefaultSpawnPositionPacket::new).addPacket(ClientboundSetDisplayObjectivePacket.class, ClientboundSetDisplayObjectivePacket::new).addPacket(ClientboundSetEntityDataPacket.class, ClientboundSetEntityDataPacket::new).addPacket(ClientboundSetEntityLinkPacket.class, ClientboundSetEntityLinkPacket::new).addPacket(ClientboundSetEntityMotionPacket.class, ClientboundSetEntityMotionPacket::new).addPacket(ClientboundSetEquipmentPacket.class, ClientboundSetEquipmentPacket::new).addPacket(ClientboundSetExperiencePacket.class, ClientboundSetExperiencePacket::new).addPacket(ClientboundSetHealthPacket.class, ClientboundSetHealthPacket::new).addPacket(ClientboundSetObjectivePacket.class, ClientboundSetObjectivePacket::new).addPacket(ClientboundSetPassengersPacket.class, ClientboundSetPassengersPacket::new).addPacket(ClientboundSetPlayerTeamPacket.class, ClientboundSetPlayerTeamPacket::new).addPacket(ClientboundSetScorePacket.class, ClientboundSetScorePacket::new).addPacket(ClientboundSetSimulationDistancePacket.class, ClientboundSetSimulationDistancePacket::new).addPacket(ClientboundSetSubtitleTextPacket.class, ClientboundSetSubtitleTextPacket::new).addPacket(ClientboundSetTimePacket.class, ClientboundSetTimePacket::new).addPacket(ClientboundSetTitleTextPacket.class, ClientboundSetTitleTextPacket::new).addPacket(ClientboundSetTitlesAnimationPacket.class, ClientboundSetTitlesAnimationPacket::new).addPacket(ClientboundSoundEntityPacket.class, ClientboundSoundEntityPacket::new).addPacket(ClientboundSoundPacket.class, ClientboundSoundPacket::new).addPacket(ClientboundStartConfigurationPacket.class, ClientboundStartConfigurationPacket::new).addPacket(ClientboundStopSoundPacket.class, ClientboundStopSoundPacket::new).addPacket(ClientboundSystemChatPacket.class, ClientboundSystemChatPacket::new).addPacket(ClientboundTabListPacket.class, ClientboundTabListPacket::new).addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new).addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new).addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new).addPacket(ClientboundTickingStatePacket.class, ClientboundTickingStatePacket::new).addPacket(ClientboundTickingStepPacket.class, ClientboundTickingStepPacket::new).addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new).addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new).addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new).addPacket(ClientboundUpdateRecipesPacket.class, ClientboundUpdateRecipesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new).addPacket(ServerboundBlockEntityTagQuery.class, ServerboundBlockEntityTagQuery::new).addPacket(ServerboundChangeDifficultyPacket.class, ServerboundChangeDifficultyPacket::new).addPacket(ServerboundChatAckPacket.class, ServerboundChatAckPacket::new).addPacket(ServerboundChatCommandPacket.class, ServerboundChatCommandPacket::new).addPacket(ServerboundChatPacket.class, ServerboundChatPacket::new).addPacket(ServerboundChatSessionUpdatePacket.class, ServerboundChatSessionUpdatePacket::new).addPacket(ServerboundChunkBatchReceivedPacket.class, ServerboundChunkBatchReceivedPacket::new).addPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new).addPacket(ServerboundConfigurationAcknowledgedPacket.class, ServerboundConfigurationAcknowledgedPacket::new).addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new).addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new).addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new).addPacket(ServerboundContainerSlotStateChangedPacket.class, ServerboundContainerSlotStateChangedPacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new).addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new).addPacket(ServerboundInteractPacket.class, ServerboundInteractPacket::new).addPacket(ServerboundJigsawGeneratePacket.class, ServerboundJigsawGeneratePacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundLockDifficultyPacket.class, ServerboundLockDifficultyPacket::new).addPacket(ServerboundMovePlayerPacket.Pos.class, ServerboundMovePlayerPacket.Pos::read).addPacket(ServerboundMovePlayerPacket.PosRot.class, ServerboundMovePlayerPacket.PosRot::read).addPacket(ServerboundMovePlayerPacket.Rot.class, ServerboundMovePlayerPacket.Rot::read).addPacket(ServerboundMovePlayerPacket.StatusOnly.class, ServerboundMovePlayerPacket.StatusOnly::read).addPacket(ServerboundMoveVehiclePacket.class, ServerboundMoveVehiclePacket::new).addPacket(ServerboundPaddleBoatPacket.class, ServerboundPaddleBoatPacket::new).addPacket(ServerboundPickItemPacket.class, ServerboundPickItemPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new).addPacket(ServerboundPlaceRecipePacket.class, ServerboundPlaceRecipePacket::new).addPacket(ServerboundPlayerAbilitiesPacket.class, ServerboundPlayerAbilitiesPacket::new).addPacket(ServerboundPlayerActionPacket.class, ServerboundPlayerActionPacket::new).addPacket(ServerboundPlayerCommandPacket.class, ServerboundPlayerCommandPacket::new).addPacket(ServerboundPlayerInputPacket.class, ServerboundPlayerInputPacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundRecipeBookChangeSettingsPacket.class, ServerboundRecipeBookChangeSettingsPacket::new).addPacket(ServerboundRecipeBookSeenRecipePacket.class, ServerboundRecipeBookSeenRecipePacket::new).addPacket(ServerboundRenameItemPacket.class, ServerboundRenameItemPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new).addPacket(ServerboundSeenAdvancementsPacket.class, ServerboundSeenAdvancementsPacket::new).addPacket(ServerboundSelectTradePacket.class, ServerboundSelectTradePacket::new).addPacket(ServerboundSetBeaconPacket.class, ServerboundSetBeaconPacket::new).addPacket(ServerboundSetCarriedItemPacket.class, ServerboundSetCarriedItemPacket::new).addPacket(ServerboundSetCommandBlockPacket.class, ServerboundSetCommandBlockPacket::new).addPacket(ServerboundSetCommandMinecartPacket.class, ServerboundSetCommandMinecartPacket::new).addPacket(ServerboundSetCreativeModeSlotPacket.class, ServerboundSetCreativeModeSlotPacket::new).addPacket(ServerboundSetJigsawBlockPacket.class, ServerboundSetJigsawBlockPacket::new).addPacket(ServerboundSetStructureBlockPacket.class, ServerboundSetStructureBlockPacket::new).addPacket(ServerboundSignUpdatePacket.class, ServerboundSignUpdatePacket::new).addPacket(ServerboundSwingPacket.class, ServerboundSwingPacket::new).addPacket(ServerboundTeleportToEntityPacket.class, ServerboundTeleportToEntityPacket::new).addPacket(ServerboundUseItemOnPacket.class, ServerboundUseItemOnPacket::new).addPacket(ServerboundUseItemPacket.class, ServerboundUseItemPacket::new))), - STATUS("status", protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundStatusRequestPacket.class, ServerboundStatusRequestPacket::new).addPacket(ServerboundPingRequestPacket.class, ServerboundPingRequestPacket::new)).addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundStatusResponsePacket.class, ClientboundStatusResponsePacket::new).addPacket(ClientboundPongResponsePacket.class, ClientboundPongResponsePacket::new))), - LOGIN("login", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundLoginDisconnectPacket.class, ClientboundLoginDisconnectPacket::new).addPacket(ClientboundHelloPacket.class, ClientboundHelloPacket::new).addPacket(ClientboundGameProfilePacket.class, ClientboundGameProfilePacket::new).addPacket(ClientboundLoginCompressionPacket.class, ClientboundLoginCompressionPacket::new).addPacket(ClientboundCustomQueryPacket.class, ClientboundCustomQueryPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundHelloPacket.class, ServerboundHelloPacket::new).addPacket(ServerboundKeyPacket.class, ServerboundKeyPacket::new).addPacket(ServerboundCustomQueryAnswerPacket.class, ServerboundCustomQueryAnswerPacket::read).addPacket(ServerboundLoginAcknowledgedPacket.class, ServerboundLoginAcknowledgedPacket::new))), -- CONFIGURATION("configuration", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundRegistryDataPacket.class, ClientboundRegistryDataPacket::new).addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new).addPacket(ClientboundUpdateEnabledFeaturesPacket.class, ClientboundUpdateEnabledFeaturesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new))); +- CONFIGURATION("configuration", protocol().addFlow(PacketFlow.CLIENTBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new).addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new).addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new).addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new).addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new).addPacket(ClientboundRegistryDataPacket.class, ClientboundRegistryDataPacket::new).addPacket(ClientboundResourcePackPopPacket.class, ClientboundResourcePackPopPacket::new).addPacket(ClientboundResourcePackPushPacket.class, ClientboundResourcePackPushPacket::new).addPacket(ClientboundUpdateEnabledFeaturesPacket.class, ClientboundUpdateEnabledFeaturesPacket::new).addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new)).addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new).addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new).addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new).addPacket(ServerboundKeepAlivePacket.class, ServerboundKeepAlivePacket::new).addPacket(ServerboundPongPacket.class, ServerboundPongPacket::new).addPacket(ServerboundResourcePackPacket.class, ServerboundResourcePackPacket::new))); + HANDSHAKING("handshake", protocol() + .addFlow(PacketFlow.CLIENTBOUND, new ConnectionProtocol.PacketSet<>()) + .addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()) @@ -83,7 +83,9 @@ + .addPacket(ClientboundRecipePacket.class, ClientboundRecipePacket::new) + .addPacket(ClientboundRemoveEntitiesPacket.class, ClientboundRemoveEntitiesPacket::new) + .addPacket(ClientboundRemoveMobEffectPacket.class, ClientboundRemoveMobEffectPacket::new) -+ .addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new) ++ .addPacket(ClientboundResetScorePacket.class, ClientboundResetScorePacket::new) ++ .addPacket(ClientboundResourcePackPopPacket.class, ClientboundResourcePackPopPacket::new) ++ .addPacket(ClientboundResourcePackPushPacket.class, ClientboundResourcePackPushPacket::new) + .addPacket(ClientboundRespawnPacket.class, ClientboundRespawnPacket::new) + .addPacket(ClientboundRotateHeadPacket.class, ClientboundRotateHeadPacket::new) + .addPacket(ClientboundSectionBlocksUpdatePacket.class, ClientboundSectionBlocksUpdatePacket::new) @@ -125,6 +127,8 @@ + .addPacket(ClientboundTagQueryPacket.class, ClientboundTagQueryPacket::new) + .addPacket(ClientboundTakeItemEntityPacket.class, ClientboundTakeItemEntityPacket::new) + .addPacket(ClientboundTeleportEntityPacket.class, ClientboundTeleportEntityPacket::new) ++ .addPacket(ClientboundTickingStatePacket.class, ClientboundTickingStatePacket::new) ++ .addPacket(ClientboundTickingStepPacket.class, ClientboundTickingStepPacket::new) + .addPacket(ClientboundUpdateAdvancementsPacket.class, ClientboundUpdateAdvancementsPacket::new) + .addPacket(ClientboundUpdateAttributesPacket.class, ClientboundUpdateAttributesPacket::new) + .addPacket(ClientboundUpdateMobEffectPacket.class, ClientboundUpdateMobEffectPacket::new) @@ -147,6 +151,7 @@ + .addPacket(ServerboundContainerButtonClickPacket.class, ServerboundContainerButtonClickPacket::new) + .addPacket(ServerboundContainerClickPacket.class, ServerboundContainerClickPacket::new) + .addPacket(ServerboundContainerClosePacket.class, ServerboundContainerClosePacket::new) ++ .addPacket(ServerboundContainerSlotStateChangedPacket.class, ServerboundContainerSlotStateChangedPacket::new) + .addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new) + .addPacket(ServerboundEditBookPacket.class, ServerboundEditBookPacket::new) + .addPacket(ServerboundEntityTagQuery.class, ServerboundEntityTagQuery::new) @@ -221,7 +226,8 @@ + .addPacket(ClientboundKeepAlivePacket.class, ClientboundKeepAlivePacket::new) + .addPacket(ClientboundPingPacket.class, ClientboundPingPacket::new) + .addPacket(ClientboundRegistryDataPacket.class, ClientboundRegistryDataPacket::new) -+ .addPacket(ClientboundResourcePackPacket.class, ClientboundResourcePackPacket::new) ++ .addPacket(ClientboundResourcePackPopPacket.class, ClientboundResourcePackPopPacket::new) ++ .addPacket(ClientboundResourcePackPushPacket.class, ClientboundResourcePackPushPacket::new) + .addPacket(ClientboundUpdateEnabledFeaturesPacket.class, ClientboundUpdateEnabledFeaturesPacket::new) + .addPacket(ClientboundUpdateTagsPacket.class, ClientboundUpdateTagsPacket::new) + ) diff --git a/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch b/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch index 43668fb983..b0c56449c9 100644 --- a/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch +++ b/patches/minecraft/net/minecraft/network/FriendlyByteBuf.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/FriendlyByteBuf.java +++ b/net/minecraft/network/FriendlyByteBuf.java -@@ -78,7 +_,7 @@ +@@ -80,7 +_,7 @@ import org.joml.Quaternionf; import org.joml.Vector3f; @@ -9,7 +9,7 @@ public static final int DEFAULT_NBT_QUOTA = 2097152; private final ByteBuf source; public static final short MAX_STRING_LENGTH = Short.MAX_VALUE; -@@ -577,6 +_,15 @@ +@@ -578,6 +_,15 @@ } public FriendlyByteBuf writeItem(ItemStack p_130056_) { @@ -25,7 +25,7 @@ if (p_130056_.isEmpty()) { this.writeBoolean(false); } else { -@@ -585,8 +_,8 @@ +@@ -586,8 +_,8 @@ this.writeId(BuiltInRegistries.ITEM, item); this.writeByte(p_130056_.getCount()); CompoundTag compoundtag = null; @@ -36,7 +36,7 @@ } this.writeNbt(compoundtag); -@@ -602,7 +_,7 @@ +@@ -603,7 +_,7 @@ Item item = this.readById(BuiltInRegistries.ITEM); int i = this.readByte(); ItemStack itemstack = new ItemStack(item, i); diff --git a/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch b/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch index 87e97fb2bf..96b46f3668 100644 --- a/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch +++ b/patches/minecraft/net/minecraft/network/chat/contents/TranslatableContents.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/chat/contents/TranslatableContents.java +++ b/net/minecraft/network/chat/contents/TranslatableContents.java -@@ -91,6 +_,11 @@ +@@ -153,6 +_,11 @@ } } diff --git a/patches/minecraft/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java.patch b/patches/minecraft/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java.patch index c796febac2..f3ed2bf5e0 100644 --- a/patches/minecraft/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java.patch +++ b/patches/minecraft/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java +++ b/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.java -@@ -26,7 +_,7 @@ +@@ -27,7 +_,7 @@ import net.minecraft.network.protocol.common.custom.WorldGenAttemptDebugPayload; import net.minecraft.resources.ResourceLocation; -public record ClientboundCustomPayloadPacket(CustomPacketPayload payload) implements Packet { +public record ClientboundCustomPayloadPacket(CustomPacketPayload payload) implements Packet, net.minecraftforge.network.ICustomPacket { private static final int MAX_PAYLOAD_SIZE = 1048576; - private static final Map> KNOWN_TYPES = ImmutableMap.>builder().put(BrandPayload.ID, BrandPayload::new).put(BeeDebugPayload.ID, BeeDebugPayload::new).put(BrainDebugPayload.ID, BrainDebugPayload::new).put(GameEventDebugPayload.ID, GameEventDebugPayload::new).put(GameEventListenerDebugPayload.ID, GameEventListenerDebugPayload::new).put(GameTestAddMarkerDebugPayload.ID, GameTestAddMarkerDebugPayload::new).put(GameTestClearMarkersDebugPayload.ID, GameTestClearMarkersDebugPayload::new).put(GoalDebugPayload.ID, GoalDebugPayload::new).put(HiveDebugPayload.ID, HiveDebugPayload::new).put(NeighborUpdatesDebugPayload.ID, NeighborUpdatesDebugPayload::new).put(PathfindingDebugPayload.ID, PathfindingDebugPayload::new).put(PoiAddedDebugPayload.ID, PoiAddedDebugPayload::new).put(PoiRemovedDebugPayload.ID, PoiRemovedDebugPayload::new).put(PoiTicketCountDebugPayload.ID, PoiTicketCountDebugPayload::new).put(RaidsDebugPayload.ID, RaidsDebugPayload::new).put(StructuresDebugPayload.ID, StructuresDebugPayload::new).put(VillageSectionsDebugPayload.ID, VillageSectionsDebugPayload::new).put(WorldGenAttemptDebugPayload.ID, WorldGenAttemptDebugPayload::new).build(); + private static final Map> KNOWN_TYPES = ImmutableMap.>builder().put(BrandPayload.ID, BrandPayload::new).put(BeeDebugPayload.ID, BeeDebugPayload::new).put(BrainDebugPayload.ID, BrainDebugPayload::new).put(BreezeDebugPayload.ID, BreezeDebugPayload::new).put(GameEventDebugPayload.ID, GameEventDebugPayload::new).put(GameEventListenerDebugPayload.ID, GameEventListenerDebugPayload::new).put(GameTestAddMarkerDebugPayload.ID, GameTestAddMarkerDebugPayload::new).put(GameTestClearMarkersDebugPayload.ID, GameTestClearMarkersDebugPayload::new).put(GoalDebugPayload.ID, GoalDebugPayload::new).put(HiveDebugPayload.ID, HiveDebugPayload::new).put(NeighborUpdatesDebugPayload.ID, NeighborUpdatesDebugPayload::new).put(PathfindingDebugPayload.ID, PathfindingDebugPayload::new).put(PoiAddedDebugPayload.ID, PoiAddedDebugPayload::new).put(PoiRemovedDebugPayload.ID, PoiRemovedDebugPayload::new).put(PoiTicketCountDebugPayload.ID, PoiTicketCountDebugPayload::new).put(RaidsDebugPayload.ID, RaidsDebugPayload::new).put(StructuresDebugPayload.ID, StructuresDebugPayload::new).put(VillageSectionsDebugPayload.ID, VillageSectionsDebugPayload::new).put(WorldGenAttemptDebugPayload.ID, WorldGenAttemptDebugPayload::new).build(); -@@ -42,8 +_,7 @@ +@@ -43,8 +_,7 @@ private static DiscardedPayload readUnknownPayload(ResourceLocation p_299265_, FriendlyByteBuf p_297545_) { int i = p_297545_.readableBytes(); if (i >= 0 && i <= 1048576) { @@ -19,7 +19,7 @@ } else { throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes"); } -@@ -57,4 +_,8 @@ +@@ -58,4 +_,8 @@ public void handle(ClientCommonPacketListener p_299773_) { p_299773_.handleCustomPayload(this); } diff --git a/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch b/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch index 4bce063d55..9f8646cb76 100644 --- a/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch +++ b/patches/minecraft/net/minecraft/network/protocol/status/ServerStatus.java.patch @@ -2,13 +2,13 @@ +++ b/net/minecraft/network/protocol/status/ServerStatus.java @@ -15,9 +_,9 @@ import net.minecraft.network.chat.Component; - import net.minecraft.util.ExtraCodecs; + import net.minecraft.network.chat.ComponentSerialization; -public record ServerStatus(Component description, Optional players, Optional version, Optional favicon, boolean enforcesSecureChat) { +public record ServerStatus(Component description, Optional players, Optional version, Optional favicon, boolean enforcesSecureChat, Optional forgeData) { - public static final Codec CODEC = RecordCodecBuilder.create((p_273270_) -> { -- return p_273270_.group(ExtraCodecs.COMPONENT.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat)).apply(p_273270_, ServerStatus::new); -+ return p_273270_.group(ExtraCodecs.COMPONENT.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat), net.minecraftforge.network.ServerStatusPing.CODEC.optionalFieldOf("forgeData").forGetter(ServerStatus::forgeData)).apply(p_273270_, ServerStatus::new); + public static final Codec CODEC = RecordCodecBuilder.create((p_308583_) -> { +- return p_308583_.group(ComponentSerialization.CODEC.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat)).apply(p_308583_, ServerStatus::new); ++ return p_308583_.group(ComponentSerialization.CODEC.optionalFieldOf("description", CommonComponents.EMPTY).forGetter(ServerStatus::description), ServerStatus.Players.CODEC.optionalFieldOf("players").forGetter(ServerStatus::players), ServerStatus.Version.CODEC.optionalFieldOf("version").forGetter(ServerStatus::version), ServerStatus.Favicon.CODEC.optionalFieldOf("favicon").forGetter(ServerStatus::favicon), Codec.BOOL.optionalFieldOf("enforcesSecureChat", Boolean.valueOf(false)).forGetter(ServerStatus::enforcesSecureChat), net.minecraftforge.network.ServerStatusPing.CODEC.optionalFieldOf("forgeData").forGetter(ServerStatus::forgeData)).apply(p_308583_, ServerStatus::new); }); public static record Favicon(byte[] iconBytes) { diff --git a/patches/minecraft/net/minecraft/resources/DelegatingOps.java.patch b/patches/minecraft/net/minecraft/resources/DelegatingOps.java.patch index 8818b2dae0..01053cdbb7 100644 --- a/patches/minecraft/net/minecraft/resources/DelegatingOps.java.patch +++ b/patches/minecraft/net/minecraft/resources/DelegatingOps.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/resources/DelegatingOps.java +++ b/net/minecraft/resources/DelegatingOps.java -@@ -160,4 +_,33 @@ +@@ -160,4 +_,37 @@ public RecordBuilder mapBuilder() { return new RecordBuilder.MapBuilder<>(this); } @@ -14,6 +14,10 @@ + return new Builder(root); + } + ++ public static Builder> builder(DynamicOps ops) { ++ return builder(() -> new DelegatingOps<>(ops) {}); ++ } ++ + public static class Builder> { + private final java.util.function.Supplier func; + private final java.util.Map ctx = new java.util.HashMap<>(); diff --git a/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch b/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch index b99e5c0aee..f7b58e554a 100644 --- a/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch +++ b/patches/minecraft/net/minecraft/resources/RegistryDataLoader.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/resources/RegistryDataLoader.java +++ b/net/minecraft/resources/RegistryDataLoader.java -@@ -123,13 +_,16 @@ +@@ -124,13 +_,16 @@ } private static String registryDirPath(ResourceLocation p_252033_) { @@ -19,7 +19,7 @@ for(Map.Entry entry : filetoidconverter.listMatchingResources(p_256349_).entrySet()) { ResourceLocation resourcelocation = entry.getKey(); -@@ -138,7 +_,12 @@ +@@ -139,7 +_,12 @@ try (Reader reader = resource.openAsReader()) { JsonElement jsonelement = JsonParser.parseReader(reader); diff --git a/patches/minecraft/net/minecraft/resources/ResourceKey.java.patch b/patches/minecraft/net/minecraft/resources/ResourceKey.java.patch index 3adcc4f06f..d1a4d83ea6 100644 --- a/patches/minecraft/net/minecraft/resources/ResourceKey.java.patch +++ b/patches/minecraft/net/minecraft/resources/ResourceKey.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/resources/ResourceKey.java @@ -7,7 +_,7 @@ import net.minecraft.core.Registry; - import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.core.registries.Registries; -public class ResourceKey { +public class ResourceKey implements Comparable> { diff --git a/patches/minecraft/net/minecraft/server/Main.java.patch b/patches/minecraft/net/minecraft/server/Main.java.patch index 07c8cfeed1..8322050199 100644 --- a/patches/minecraft/net/minecraft/server/Main.java.patch +++ b/patches/minecraft/net/minecraft/server/Main.java.patch @@ -30,7 +30,7 @@ Path path = optionset.valueOf(optionspec13); if (path != null) { -@@ -102,25 +_,24 @@ +@@ -102,23 +_,21 @@ Bootstrap.validate(); Util.startTimerHackThread(); Path path1 = Paths.get("server.properties"); @@ -58,20 +58,27 @@ + } LevelStorageSource levelstoragesource = LevelStorageSource.createDefault(file1.toPath()); LevelStorageSource.LevelStorageAccess levelstoragesource$levelstorageaccess = levelstoragesource.validateAndCreateAccess(s); -+ levelstoragesource$levelstorageaccess.readAdditionalLevelSaveData(); - LevelSummary levelsummary = levelstoragesource$levelstorageaccess.getSummary(); - if (levelsummary != null) { - if (levelsummary.requiresManualConversion()) { -@@ -166,6 +_,8 @@ - worlddimensions = dedicatedserverproperties.createDimensions(p_248079_.datapackWorldgen()); + Dynamic dynamic; +@@ -165,6 +_,8 @@ + + PackRepository packrepository = ServerPacksSource.createPackRepository(levelstoragesource$levelstorageaccess); + ++ if (dynamic != null) ++ net.minecraftforge.common.ForgeHooks.readAdditionalLevelSaveData(dynamic, levelstoragesource$levelstorageaccess.getLevelDirectory()); + WorldStem worldstem; + try { + WorldLoader.InitConfig worldloader$initconfig = loadOrCreateConfig(dedicatedserversettings.getProperties(), dynamic1, flag, packrepository); +@@ -190,6 +_,9 @@ + worlddimensions = dedicatedserverproperties.createDimensions(p_308589_.datapackWorldgen()); } + //Forge: Do a write-read-cycle to inject modded dimensions on first start of a dedicated server into its generated world dimensions list. ++ net.minecraft.resources.RegistryOps dynamicops = net.minecraft.resources.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, p_308589_.datapackWorldgen()); + worlddimensions = WorldDimensions.CODEC.encoder().encodeStart(dynamicops, worlddimensions).flatMap((writtenPayloadWithModdedDimensions) -> WorldDimensions.CODEC.decoder().parse(dynamicops, writtenPayloadWithModdedDimensions)).resultOrPartial(LOGGER::error).orElse(worlddimensions); WorldDimensions.Complete worlddimensions$complete = worlddimensions.bake(registry); - Lifecycle lifecycle = worlddimensions$complete.lifecycle().add(p_248079_.datapackWorldgen().allRegistriesLifecycle()); + Lifecycle lifecycle = worlddimensions$complete.lifecycle().add(p_308589_.datapackWorldgen().allRegistriesLifecycle()); return new WorldLoader.DataLoadOutput<>(new PrimaryLevelData(levelsettings, worldoptions, worlddimensions$complete.specialWorldProperty(), lifecycle), worlddimensions$complete.dimensionsRegistryAccess()); -@@ -186,21 +_,32 @@ +@@ -210,21 +_,32 @@ WorldData worlddata = worldstem.worldData(); levelstoragesource$levelstorageaccess.saveDataTag(registryaccess$frozen, worlddata); diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index d4ca6d921d..5785af2e37 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -245,7 +_,7 @@ +@@ -252,7 +_,7 @@ public static S spin(Function p_129873_) { AtomicReference atomicreference = new AtomicReference<>(); @@ -9,7 +9,7 @@ atomicreference.get().runServer(); }, "Server thread"); thread.setUncaughtExceptionHandler((p_177909_, p_177910_) -> { -@@ -338,6 +_,7 @@ +@@ -346,6 +_,7 @@ this.readScoreboard(dimensiondatastorage); this.commandStorage = new CommandStorage(dimensiondatastorage); WorldBorder worldborder = serverlevel.getWorldBorder(); @@ -17,7 +17,7 @@ if (!serverleveldata.isInitialized()) { try { setInitialSpawn(serverlevel, serverleveldata, worldoptions.generateBonusChest(), flag); -@@ -374,6 +_,7 @@ +@@ -382,6 +_,7 @@ ServerLevel serverlevel1 = new ServerLevel(this, this.executor, this.storageSource, derivedleveldata, resourcekey1, entry.getValue(), p_129816_, flag, j, ImmutableList.of(), false, randomsequences); worldborder.addListener(new BorderChangeListener.DelegateBorderChangeListener(serverlevel1.getWorldBorder())); this.levels.put(resourcekey1, serverlevel1); @@ -25,7 +25,7 @@ } } -@@ -385,6 +_,7 @@ +@@ -393,6 +_,7 @@ p_177898_.setSpawn(BlockPos.ZERO.above(80), 0.0F); } else { ServerChunkCache serverchunkcache = p_177897_.getChunkSource(); @@ -33,7 +33,7 @@ ChunkPos chunkpos = new ChunkPos(serverchunkcache.randomState().sampler().findSpawnPosition()); int i = serverchunkcache.getGenerator().getSpawnHeight(p_177897_); if (i < p_177897_.getMinBuildHeight()) { -@@ -467,6 +_,7 @@ +@@ -475,6 +_,7 @@ ChunkPos chunkpos = new ChunkPos(i); serverlevel1.getChunkSource().updateChunkForced(chunkpos, true); } @@ -41,7 +41,7 @@ } } -@@ -577,6 +_,7 @@ +@@ -585,6 +_,7 @@ for(ServerLevel serverlevel2 : this.getAllLevels()) { if (serverlevel2 != null) { try { @@ -49,28 +49,28 @@ serverlevel2.close(); } catch (IOException ioexception1) { LOGGER.error("Exception closing the level", (Throwable)ioexception1); -@@ -625,9 +_,11 @@ +@@ -633,9 +_,11 @@ throw new IllegalStateException("Failed to initialize server"); } + net.minecraftforge.server.ServerLifecycleHooks.handleServerStarted(this); - this.nextTickTime = Util.getMillis(); + this.nextTickTimeNanos = Util.getNanos(); this.statusIcon = this.loadStatusIcon().orElse((ServerStatus.Favicon)null); this.status = this.buildServerStatus(); + resetStatusCache(status); while(this.running) { - long i = Util.getMillis() - this.nextTickTime; -@@ -656,6 +_,8 @@ + long i; +@@ -679,6 +_,8 @@ this.isReady = true; - JvmProfiler.INSTANCE.onServerTick(this.averageTickTime); + JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis); } + net.minecraftforge.server.ServerLifecycleHooks.handleServerStopping(this); + net.minecraftforge.server.ServerLifecycleHooks.expectServerStopped(); // Forge: Has to come before MinecraftServer#onServerCrash to avoid race conditions } catch (Throwable throwable1) { LOGGER.error("Encountered an unexpected exception", throwable1); CrashReport crashreport = constructOrExtractCrashReport(throwable1); -@@ -667,6 +_,7 @@ +@@ -690,6 +_,7 @@ LOGGER.error("We were unable to save this crash report to disk."); } @@ -78,7 +78,7 @@ this.onServerCrash(crashreport); } finally { try { -@@ -679,6 +_,7 @@ +@@ -702,6 +_,7 @@ this.services.profileCache().clearExecutor(); } @@ -86,23 +86,24 @@ this.onServerExit(); } -@@ -793,11 +_,13 @@ +@@ -820,12 +_,14 @@ public void tickServer(BooleanSupplier p_129871_) { long i = Util.getNanos(); + net.minecraftforge.event.ForgeEventFactory.onPreServerTick(p_129871_, this); ++this.tickCount; + this.tickRateManager.tick(); this.tickChildren(p_129871_); - if (i - this.lastServerStatus >= 5000000000L) { + if (i - this.lastServerStatus >= STATUS_EXPIRE_TIME_NANOS) { this.lastServerStatus = i; this.status = this.buildServerStatus(); + resetStatusCache(status); } - if (this.tickCount % 6000 == 0) { -@@ -814,6 +_,17 @@ - long k = Util.getNanos(); - this.logTickTime(k - i); + --this.ticksUntilAutosave; +@@ -848,6 +_,17 @@ + long l = Util.getNanos(); + this.logTickTime(l - i); this.profiler.pop(); + net.minecraftforge.event.ForgeEventFactory.onPostServerTick(p_129871_, this); + } @@ -117,8 +118,8 @@ + return cachedServerStatus; } - protected void logTickTime(long p_298126_) { -@@ -821,7 +_,7 @@ + private int computeNextAutosaveInterval() { +@@ -876,7 +_,7 @@ private ServerStatus buildServerStatus() { ServerStatus.Players serverstatus$players = this.buildPlayerStatus(); @@ -127,7 +128,7 @@ } private ServerStatus.Players buildPlayerStatus() { -@@ -852,7 +_,8 @@ +@@ -907,7 +_,8 @@ this.getFunctions().tick(); this.profiler.popPush("levels"); @@ -137,7 +138,7 @@ this.profiler.push(() -> { return serverlevel + " " + serverlevel.dimension().location(); }); -@@ -863,6 +_,7 @@ +@@ -918,6 +_,7 @@ } this.profiler.push("tick"); @@ -145,7 +146,7 @@ try { serverlevel.tick(p_129954_); -@@ -871,16 +_,18 @@ +@@ -926,16 +_,18 @@ serverlevel.fillReportDetails(crashreport); throw new ReportedException(crashreport); } @@ -160,12 +161,12 @@ this.getConnection().tick(); this.profiler.popPush("players"); this.playerList.tick(); -- if (SharedConstants.IS_RUNNING_IN_IDE) { +- if (SharedConstants.IS_RUNNING_IN_IDE && this.tickRateManager.runsNormally()) { + if (net.minecraftforge.gametest.ForgeGameTestHooks.isGametestEnabled()) { GameTestTicker.SINGLETON.tick(); } -@@ -969,7 +_,7 @@ +@@ -1024,7 +_,7 @@ @DontObfuscate public String getServerModName() { @@ -174,7 +175,7 @@ } public SystemReport fillSystemReport(SystemReport p_177936_) { -@@ -1318,6 +_,7 @@ +@@ -1373,6 +_,7 @@ this.getPlayerList().reloadResources(); this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); @@ -182,7 +183,7 @@ }, this); if (this.isSameThread()) { this.managedBlock(completablefuture::isDone); -@@ -1327,10 +_,13 @@ +@@ -1382,10 +_,13 @@ } public static WorldDataConfiguration configurePackRepository(PackRepository p_248681_, DataPackConfig p_248920_, boolean p_249869_, FeatureFlagSet p_251243_) { @@ -198,7 +199,7 @@ } else { Set set = Sets.newLinkedHashSet(); -@@ -1484,6 +_,31 @@ +@@ -1551,6 +_,31 @@ public abstract boolean isSingleplayerOwner(GameProfile p_129840_); @@ -230,7 +231,7 @@ public void dumpServerProperties(Path p_177911_) throws IOException { } -@@ -1647,6 +_,10 @@ +@@ -1714,6 +_,10 @@ public WorldData getWorldData() { return this.worldData; diff --git a/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch b/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch index 217cd897b8..97a356d84d 100644 --- a/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch +++ b/patches/minecraft/net/minecraft/server/PlayerAdvancements.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/server/PlayerAdvancements.java +++ b/net/minecraft/server/PlayerAdvancements.java -@@ -178,6 +_,7 @@ +@@ -177,6 +_,7 @@ this.unregisterListeners(p_298135_); this.progressChanged.add(p_298135_); flag = true; + net.minecraftforge.event.ForgeEventFactory.onAdvancementGrant(this.player, p_298135_, advancementprogress, p_135990_); if (!flag1 && advancementprogress.isDone()) { p_298135_.value().rewards().grant(this.player); - p_298135_.value().display().ifPresent((p_296444_) -> { -@@ -186,6 +_,7 @@ + p_298135_.value().display().ifPresent((p_308592_) -> { +@@ -185,6 +_,7 @@ } }); @@ -16,7 +16,7 @@ } } -@@ -204,6 +_,7 @@ +@@ -203,6 +_,7 @@ this.registerListeners(p_297905_); this.progressChanged.add(p_297905_); flag = true; diff --git a/patches/minecraft/net/minecraft/server/ServerAdvancementManager.java.patch b/patches/minecraft/net/minecraft/server/ServerAdvancementManager.java.patch index 1ea7d7e2b1..2eb595c21f 100644 --- a/patches/minecraft/net/minecraft/server/ServerAdvancementManager.java.patch +++ b/patches/minecraft/net/minecraft/server/ServerAdvancementManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/ServerAdvancementManager.java +++ b/net/minecraft/server/ServerAdvancementManager.java -@@ -29,10 +_,18 @@ +@@ -32,17 +_,30 @@ private Map advancements = Map.of(); private AdvancementTree tree = new AdvancementTree(); private final LootDataManager lootData; @@ -19,16 +19,16 @@ } protected void apply(Map p_136034_, ResourceManager p_136035_, ProfilerFiller p_136036_) { -@@ -40,7 +_,11 @@ - p_136034_.forEach((p_296449_, p_296450_) -> { + ImmutableMap.Builder builder = ImmutableMap.builder(); + p_136034_.forEach((p_308595_, p_308596_) -> { try { - JsonObject jsonobject = GsonHelper.convertToJsonObject(p_296450_, "advancement"); -- Advancement advancement = Advancement.fromJson(jsonobject, new DeserializationContext(p_296449_, this.lootData)); -+ Advancement advancement = Advancement.fromJson(jsonobject, new DeserializationContext(p_296449_, this.lootData), this.context); -+ if (advancement == null) { -+ LOGGER.debug("Skipping loading advancement {} as its conditions were not met", p_296449_); +- Advancement advancement = Util.getOrThrow(Advancement.CODEC.parse(JsonOps.INSTANCE, p_308596_), JsonParseException::new); ++ var json = net.minecraftforge.common.ForgeHooks.readConditionalAdvancement(null, (com.google.gson.JsonObject)p_308596_); ++ if (json == null) { ++ LOGGER.debug("Skipping loading advancement {} as its conditions were not met", p_308595_); + return; + } - builder.put(p_296449_, new AdvancementHolder(p_296449_, advancement)); ++ Advancement advancement = Util.getOrThrow(Advancement.CODEC.parse(JsonOps.INSTANCE, json), JsonParseException::new); + this.validate(p_308595_, advancement); + builder.put(p_308595_, new AdvancementHolder(p_308595_, advancement)); } catch (Exception exception) { - LOGGER.error("Parsing error loading custom advancement {}: {}", p_296449_, exception.getMessage()); diff --git a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch index b4e8d80ac1..35f96ebc85 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -27,7 +27,7 @@ long j = Util.getNanos() - i; String s = String.format(Locale.ROOT, "%.3fs", (double)j / 1.0E9D); LOGGER.info("Done ({})! For help, type \"help\"", (Object)s); -+ this.nextTickTime = Util.getMillis(); //Forge: Update server time to prevent watchdog/spaming during long load. ++ this.nextTickTimeNanos = Util.getNanos(); //Forge: Update server time to prevent watchdog/spaming during long load. if (dedicatedserverproperties.announcePlayerAchievements != null) { this.getGameRules().getRule(GameRules.RULE_ANNOUNCE_ADVANCEMENTS).set(dedicatedserverproperties.announcePlayerAchievements, this); } diff --git a/patches/minecraft/net/minecraft/server/dedicated/ServerWatchdog.java.patch b/patches/minecraft/net/minecraft/server/dedicated/ServerWatchdog.java.patch index 848ca93c8b..52dd1021be 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/ServerWatchdog.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/ServerWatchdog.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/dedicated/ServerWatchdog.java +++ b/net/minecraft/server/dedicated/ServerWatchdog.java -@@ -40,7 +_,7 @@ +@@ -41,7 +_,7 @@ ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean(); ThreadInfo[] athreadinfo = threadmxbean.dumpAllThreads(true, true); StringBuilder stringbuilder = new StringBuilder(); diff --git a/patches/minecraft/net/minecraft/server/level/ServerChunkCache.java.patch b/patches/minecraft/net/minecraft/server/level/ServerChunkCache.java.patch index 4212c7c616..7f08234f00 100644 --- a/patches/minecraft/net/minecraft/server/level/ServerChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ServerChunkCache.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java -@@ -162,6 +_,7 @@ +@@ -160,6 +_,7 @@ if (chunkholder == null) { return null; } else { @@ -8,16 +8,16 @@ Either either = chunkholder.getFutureIfPresent(ChunkStatus.FULL).getNow((Either)null); if (either == null) { return null; -@@ -351,7 +_,7 @@ - for(ServerChunkCache.ChunkAndHolder serverchunkcache$chunkandholder : list) { - LevelChunk levelchunk1 = serverchunkcache$chunkandholder.chunk; - ChunkPos chunkpos = levelchunk1.getPos(); -- if (this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) { -+ if ((this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) || this.distanceManager.shouldForceTicks(chunkpos.toLong())) { - levelchunk1.incrementInhabitedTime(j); - if (flag2 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkpos)) { - NaturalSpawner.spawnForChunk(this.level, levelchunk1, naturalspawner$spawnstate, this.spawnFriendlies, this.spawnEnemies, flag1); -@@ -432,11 +_,17 @@ +@@ -347,7 +_,7 @@ + for(ServerChunkCache.ChunkAndHolder serverchunkcache$chunkandholder : list) { + LevelChunk levelchunk1 = serverchunkcache$chunkandholder.chunk; + ChunkPos chunkpos = levelchunk1.getPos(); +- if (this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) { ++ if ((this.level.isNaturalSpawningAllowed(chunkpos) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkpos)) || this.distanceManager.shouldForceTicks(chunkpos.toLong())) { + levelchunk1.incrementInhabitedTime(j); + if (flag1 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkpos)) { + NaturalSpawner.spawnForChunk(this.level, levelchunk1, naturalspawner$spawnstate, this.spawnFriendlies, this.spawnEnemies, flag); +@@ -428,11 +_,17 @@ } public void addRegionTicket(TicketType p_8388_, ChunkPos p_8389_, int p_8390_, T p_8391_) { diff --git a/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch b/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch index 8ce6828c80..504d993dd6 100644 --- a/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ServerLevel.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -188,11 +_,12 @@ +@@ -190,11 +_,12 @@ private final List customSpawners; @Nullable private EndDragonFight dragonFight; @@ -14,7 +14,7 @@ public ServerLevel(MinecraftServer p_214999_, Executor p_215000_, LevelStorageSource.LevelStorageAccess p_215001_, ServerLevelData p_215002_, ResourceKey p_215003_, LevelStem p_215004_, ChunkProgressListener p_215005_, boolean p_215006_, long p_215007_, List p_215008_, boolean p_215009_, @Nullable RandomSequences p_288977_) { super(p_215002_, p_215003_, p_214999_.registryAccess(), p_215004_.type(), p_214999_::getProfiler, false, p_215006_, p_215007_, p_214999_.getMaxChainedNeighborUpdates()); -@@ -232,6 +_,7 @@ +@@ -234,6 +_,7 @@ this.randomSequences = Objects.requireNonNullElseGet(p_288977_, () -> { return this.getDataStorage().computeIfAbsent(RandomSequences.factory(i), "random_sequences"); }); @@ -22,7 +22,7 @@ } /** @deprecated */ -@@ -267,8 +_,8 @@ +@@ -274,8 +_,8 @@ int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); if (this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) { if (this.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { @@ -33,27 +33,24 @@ } this.wakeUpAllPlayers(); -@@ -297,7 +_,7 @@ - this.runBlockEvents(); +@@ -313,7 +_,7 @@ + this.handlingTick = false; profilerfiller.pop(); -- boolean flag = !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); -+ boolean flag = !this.players.isEmpty() || net.minecraftforge.common.world.ForgeChunkManager.hasForcedChunks(this); //Forge: Replace vanilla's has forced chunk check with forge's that checks both the vanilla and forge added ones - if (flag) { +- boolean flag1 = !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); ++ boolean flag1 = !this.players.isEmpty() || net.minecraftforge.common.world.ForgeChunkManager.hasForcedChunks(this); //Forge: Replace vanilla's has forced chunk check with forge's that checks both the vanilla and forge added ones + if (flag1) { this.resetEmptyTime(); } -@@ -329,7 +_,9 @@ +@@ -344,6 +_,7 @@ + p_308944_.stopRiding(); } ++ if (p_308944_.isRemoved() || p_308944_ instanceof net.minecraftforge.entity.PartEntity) return; profilerfiller.push("tick"); -- this.guardEntityTick(this::tickNonPassenger, p_184065_); -+ if (!p_184065_.isRemoved() && !(p_184065_ instanceof net.minecraftforge.entity.PartEntity)) { -+ this.guardEntityTick(this::tickNonPassenger, p_184065_); -+ } + this.guardEntityTick(this::tickNonPassenger, p_308944_); profilerfiller.pop(); - } - } -@@ -461,6 +_,7 @@ +@@ -478,6 +_,7 @@ BlockPos blockpos = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, p_300602_); BlockPos blockpos1 = blockpos.below(); Biome biome = this.getBiome(blockpos).value(); @@ -61,7 +58,7 @@ if (biome.shouldFreeze(this, blockpos1)) { this.setBlockAndUpdate(blockpos1, Blocks.ICE.defaultBlockState()); } -@@ -633,15 +_,19 @@ +@@ -650,15 +_,19 @@ this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.THUNDER_LEVEL_CHANGE, this.thunderLevel), this.dimension()); } @@ -85,7 +82,7 @@ } } -@@ -700,6 +_,7 @@ +@@ -718,6 +_,7 @@ return BuiltInRegistries.ENTITY_TYPE.getKey(p_8664_.getType()).toString(); }); profilerfiller.incrementCounter("tickPassenger"); @@ -93,7 +90,7 @@ p_8664_.rideTick(); profilerfiller.pop(); -@@ -736,6 +_,7 @@ +@@ -754,6 +_,7 @@ this.entityManager.autoSave(); } @@ -101,7 +98,7 @@ } } -@@ -828,6 +_,7 @@ +@@ -846,6 +_,7 @@ } private void addPlayer(ServerPlayer p_8854_) { @@ -109,7 +106,7 @@ Entity entity = this.getEntities().get(p_8854_.getUUID()); if (entity != null) { LOGGER.warn("Force-added player with duplicate UUID {}", (Object)p_8854_.getUUID()); -@@ -835,7 +_,8 @@ +@@ -853,7 +_,8 @@ this.removePlayerImmediately((ServerPlayer)entity, Entity.RemovalReason.DISCARDED); } @@ -119,7 +116,7 @@ } private boolean addEntity(Entity p_8873_) { -@@ -843,7 +_,12 @@ +@@ -861,7 +_,12 @@ LOGGER.warn("Tried to add entity {} but it was marked as removed already", (Object)EntityType.getKey(p_8873_.getType())); return false; } else { @@ -133,7 +130,7 @@ } } -@@ -880,10 +_,22 @@ +@@ -898,10 +_,22 @@ } public void playSeededSound(@Nullable Player p_263330_, double p_263393_, double p_263369_, double p_263354_, Holder p_263412_, SoundSource p_263338_, float p_263352_, float p_263390_, long p_263403_) { @@ -156,7 +153,7 @@ this.server.getPlayerList().broadcast(p_263545_, p_263544_.getX(), p_263544_.getY(), p_263544_.getZ(), (double)p_263491_.value().getRange(p_263530_), this.dimension(), new ClientboundSoundEntityPacket(p_263491_, p_263542_, p_263544_, p_263530_, p_263520_, p_263490_)); } -@@ -905,6 +_,7 @@ +@@ -923,6 +_,7 @@ } public void gameEvent(GameEvent p_215041_, Vec3 p_215042_, GameEvent.Context p_215043_) { @@ -164,7 +161,7 @@ this.gameEventDispatcher.post(p_215041_, p_215042_, p_215043_); } -@@ -941,10 +_,15 @@ +@@ -959,10 +_,15 @@ } public void updateNeighborsAt(BlockPos p_215045_, Block p_215046_) { @@ -180,7 +177,7 @@ this.neighborUpdater.updateNeighborsAtExceptFromFacing(p_215052_, p_215053_, p_215054_); } -@@ -1380,6 +_,11 @@ +@@ -1402,6 +_,11 @@ }); } @@ -192,7 +189,7 @@ public LevelEntityGetter getEntities() { return this.entityManager.getEntityGetter(); } -@@ -1475,8 +_,8 @@ +@@ -1505,8 +_,8 @@ ServerLevel.this.navigatingMobs.add(mob); } @@ -203,7 +200,7 @@ ServerLevel.this.dragonParts.put(enderdragonpart.getId(), enderdragonpart); } } -@@ -1500,17 +_,25 @@ +@@ -1530,17 +_,25 @@ ServerLevel.this.navigatingMobs.remove(mob); } diff --git a/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch b/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch index 5863adc10f..29814f76e0 100644 --- a/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -147,7 +_,7 @@ +@@ -153,7 +_,7 @@ import net.minecraft.world.scores.criteria.ObjectiveCriteria; import org.slf4j.Logger; @@ -9,7 +9,7 @@ private static final Logger LOGGER = LogUtils.getLogger(); private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; -@@ -569,6 +_,7 @@ +@@ -576,6 +_,7 @@ public void die(DamageSource p_9035_) { this.gameEvent(GameEvent.ENTITY_DIE); @@ -17,7 +17,7 @@ boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES); if (flag) { Component component = this.getCombatTracker().getDeathMessage(); -@@ -715,11 +_,12 @@ +@@ -720,11 +_,12 @@ } @Nullable @@ -32,7 +32,7 @@ this.unRide(); this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); if (!this.wonGame) { -@@ -736,13 +_,14 @@ +@@ -741,13 +_,14 @@ PlayerList playerlist = this.server.getPlayerList(); playerlist.sendPlayerPermissionLevel(this); serverlevel.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); @@ -50,7 +50,7 @@ this.createEndPlatform(p_9180_, BlockPos.containing(portalinfo.pos)); } -@@ -754,6 +_,9 @@ +@@ -759,6 +_,9 @@ p_9180_.addDuringPortalTeleport(this); serverlevel.getProfiler().pop(); this.triggerDimensionChangeTriggers(serverlevel); @@ -60,7 +60,7 @@ this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); playerlist.sendLevelInfo(this, p_9180_); playerlist.sendAllPlayerInfo(this); -@@ -762,10 +_,12 @@ +@@ -767,10 +_,12 @@ this.connection.send(new ClientboundUpdateMobEffectPacket(this.getId(), mobeffectinstance)); } @@ -73,7 +73,7 @@ } return this; -@@ -829,6 +_,9 @@ +@@ -834,6 +_,9 @@ } public Either startSleepInBed(BlockPos p_9115_) { @@ -83,7 +83,7 @@ Direction direction = this.level().getBlockState(p_9115_).getValue(HorizontalDirectionalBlock.FACING); if (!this.isSleeping() && this.isAlive()) { if (!this.level().dimensionType().natural()) { -@@ -839,7 +_,7 @@ +@@ -844,7 +_,7 @@ return Either.left(Player.BedSleepingProblem.OBSTRUCTED); } else { this.setRespawnPosition(this.level().dimension(), p_9115_, this.getYRot(), false, true); @@ -92,7 +92,7 @@ return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW); } else { if (!this.isCreative()) { -@@ -877,6 +_,7 @@ +@@ -882,6 +_,7 @@ } private boolean bedInRange(BlockPos p_9117_, Direction p_9118_) { @@ -100,7 +100,7 @@ return this.isReachableBedBlock(p_9117_) || this.isReachableBedBlock(p_9117_.relative(p_9118_.getOpposite())); } -@@ -958,6 +_,7 @@ +@@ -970,6 +_,7 @@ this.connection.send(new ClientboundOpenScreenPacket(abstractcontainermenu.containerId, abstractcontainermenu.getType(), p_9033_.getDisplayName())); this.initMenu(abstractcontainermenu); this.containerMenu = abstractcontainermenu; @@ -108,7 +108,7 @@ return OptionalInt.of(this.containerCounter); } } -@@ -976,6 +_,7 @@ +@@ -988,6 +_,7 @@ this.connection.send(new ClientboundHorseScreenOpenPacket(this.containerCounter, p_9060_.getContainerSize(), p_9059_.getId())); this.containerMenu = new HorseInventoryMenu(this.containerCounter, this.getInventory(), p_9060_, p_9059_); this.initMenu(this.containerMenu); @@ -116,7 +116,7 @@ } public void openItemGui(ItemStack p_9082_, InteractionHand p_9083_) { -@@ -1001,6 +_,7 @@ +@@ -1013,6 +_,7 @@ public void doCloseContainer() { this.containerMenu.removed(this); this.inventoryMenu.transferState(this.containerMenu); @@ -124,7 +124,7 @@ this.containerMenu = this.inventoryMenu; } -@@ -1134,6 +_,15 @@ +@@ -1233,6 +_,15 @@ this.setShoulderEntityLeft(p_9016_.getShoulderEntityLeft()); this.setShoulderEntityRight(p_9016_.getShoulderEntityRight()); this.setLastDeathLocation(p_9016_.getLastDeathLocation()); @@ -140,7 +140,7 @@ } protected void onEffectAdded(MobEffectInstance p_143393_, @Nullable Entity p_143394_) { -@@ -1214,6 +_,7 @@ +@@ -1313,6 +_,7 @@ } public boolean setGameMode(GameType p_143404_) { @@ -148,7 +148,7 @@ if (!this.gameMode.changeGameModeForPlayer(p_143404_)) { return false; } else { -@@ -1348,6 +_,8 @@ +@@ -1447,6 +_,8 @@ public void setCamera(@Nullable Entity p_9214_) { Entity entity = this.getCamera(); this.camera = (Entity)(p_9214_ == null ? this : p_9214_); @@ -157,7 +157,7 @@ if (entity != this.camera) { Level level = this.camera.level(); if (level instanceof ServerLevel) { -@@ -1387,7 +_,11 @@ +@@ -1486,7 +_,11 @@ @Nullable public Component getTabListDisplayName() { @@ -170,7 +170,7 @@ } public void swing(InteractionHand p_9031_) { -@@ -1413,20 +_,23 @@ +@@ -1512,20 +_,23 @@ if (p_9000_ == this.level()) { this.connection.teleport(p_9001_, p_9002_, p_9003_, p_9004_, p_9005_); } else { @@ -195,7 +195,7 @@ } } -@@ -1449,6 +_,8 @@ +@@ -1548,6 +_,8 @@ } public void setRespawnPosition(ResourceKey p_9159_, @Nullable BlockPos p_9160_, float p_9161_, boolean p_9162_, boolean p_9163_) { @@ -204,7 +204,7 @@ if (p_9160_ != null) { boolean flag = p_9160_.equals(this.respawnPosition) && p_9159_.equals(this.respawnDimension); if (p_9163_ && !flag) { -@@ -1493,6 +_,9 @@ +@@ -1592,6 +_,9 @@ if (itementity == null) { return null; } else { @@ -214,7 +214,7 @@ this.level().addFreshEntity(itementity); ItemStack itemstack = itementity.getItem(); if (p_9087_) { -@@ -1507,6 +_,75 @@ +@@ -1606,6 +_,75 @@ } } @@ -290,7 +290,7 @@ public TextFilter getTextFilter() { return this.textFilter; } -@@ -1566,11 +_,14 @@ +@@ -1665,11 +_,14 @@ public boolean drop(boolean p_182295_) { Inventory inventory = this.getInventory(); diff --git a/patches/minecraft/net/minecraft/server/level/ServerPlayerGameMode.java.patch b/patches/minecraft/net/minecraft/server/level/ServerPlayerGameMode.java.patch index a0f0af3903..98ffdba459 100644 --- a/patches/minecraft/net/minecraft/server/level/ServerPlayerGameMode.java.patch +++ b/patches/minecraft/net/minecraft/server/level/ServerPlayerGameMode.java.patch @@ -24,47 +24,48 @@ @@ -221,7 +_,8 @@ public boolean destroyBlock(BlockPos p_9281_) { - BlockState blockstate = this.level.getBlockState(p_9281_); -- if (!this.player.getMainHandItem().getItem().canAttackBlock(blockstate, this.level, p_9281_, this.player)) { + BlockState blockstate1 = this.level.getBlockState(p_9281_); +- if (!this.player.getMainHandItem().getItem().canAttackBlock(blockstate1, this.level, p_9281_, this.player)) { + int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(level, gameModeForPlayer, player, p_9281_); + if (exp == -1) { return false; } else { BlockEntity blockentity = this.level.getBlockEntity(p_9281_); -@@ -229,30 +_,42 @@ +@@ -229,30 +_,43 @@ if (block instanceof GameMasterBlock && !this.player.canUseGameMasterBlocks()) { - this.level.sendBlockUpdated(p_9281_, blockstate, blockstate, 3); + this.level.sendBlockUpdated(p_9281_, blockstate1, blockstate1, 3); return false; + } else if (player.getMainHandItem().onBlockStartBreak(p_9281_, player)) { + return false; } else if (this.player.blockActionRestricted(this.level, p_9281_, this.gameModeForPlayer)) { return false; } else { -- block.playerWillDestroy(this.level, p_9281_, blockstate, this.player); -- boolean flag = this.level.removeBlock(p_9281_, false); -- if (flag) { +- BlockState blockstate = block.playerWillDestroy(this.level, p_9281_, blockstate1, this.player); +- boolean flag1 = this.level.removeBlock(p_9281_, false); +- if (flag1) { - block.destroy(this.level, p_9281_, blockstate); - } - ++ BlockState blockstate = blockstate1; if (this.isCreative()) { + removeBlock(p_9281_, false); return true; } else { ItemStack itemstack = this.player.getMainHandItem(); ItemStack itemstack1 = itemstack.copy(); -- boolean flag1 = this.player.hasCorrectToolForDrops(blockstate); -+ boolean flag1 = blockstate.canHarvestBlock(this.level, p_9281_, this.player); // previously player.hasCorrectToolForDrops(blockstate) +- boolean flag = this.player.hasCorrectToolForDrops(blockstate); ++ boolean flag = blockstate.canHarvestBlock(this.level, p_9281_, this.player); // previously player.hasCorrectToolForDrops(blockstate) itemstack.mineBlock(this.level, blockstate, p_9281_, this.player); + if (itemstack.isEmpty() && !itemstack1.isEmpty()) + net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.player, itemstack1, InteractionHand.MAIN_HAND); -+ boolean flag = removeBlock(p_9281_, flag1); ++ boolean flag1 = removeBlock(p_9281_, flag); + - if (flag && flag1) { + if (flag1 && flag) { block.playerDestroy(this.level, this.player, p_9281_, blockstate, blockentity, itemstack1); } + if (flag && exp > 0) -+ blockstate.getBlock().popExperience(level, p_9281_, exp); ++ blockstate1.getBlock().popExperience(level, p_9281_, exp); + return true; } diff --git a/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 8b60027ed8..42e590858c 100644 --- a/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/patches/minecraft/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -179,6 +_,12 @@ +@@ -181,6 +_,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl implements ServerGamePacketListener, ServerPlayerConnection, TickablePacketListener { static final Logger LOGGER = LogUtils.getLogger(); @@ -13,7 +13,7 @@ public static final double MAX_INTERACTION_DISTANCE = Mth.square(6.0D); private static final int NO_BLOCK_UPDATES_TO_ACK = -1; private static final int TRACKED_MESSAGE_DISCONNECT_THRESHOLD = 4096; -@@ -413,9 +_,11 @@ +@@ -414,9 +_,11 @@ } entity.absMoveTo(d3, d4, d5, f, f1); @@ -25,7 +25,7 @@ this.send(new ClientboundMoveVehiclePacket(entity)); return; } -@@ -960,8 +_,10 @@ +@@ -981,8 +_,10 @@ case SWAP_ITEM_WITH_OFFHAND: if (!this.player.isSpectator()) { ItemStack itemstack = this.player.getItemInHand(InteractionHand.OFF_HAND); @@ -38,7 +38,7 @@ this.player.stopUsingItem(); } -@@ -1012,7 +_,7 @@ +@@ -1033,7 +_,7 @@ Vec3 vec3 = blockhitresult.getLocation(); BlockPos blockpos = blockhitresult.getBlockPos(); Vec3 vec31 = Vec3.atCenterOf(blockpos); @@ -47,7 +47,7 @@ Vec3 vec32 = vec3.subtract(vec31); double d0 = 1.0000001D; if (Math.abs(vec32.x()) < 1.0000001D && Math.abs(vec32.y()) < 1.0000001D && Math.abs(vec32.z()) < 1.0000001D) { -@@ -1020,7 +_,7 @@ +@@ -1041,7 +_,7 @@ this.player.resetLastActionTime(); int i = this.player.level().getMaxBuildHeight(); if (blockpos.getY() < i) { @@ -56,19 +56,18 @@ InteractionResult interactionresult = this.player.gameMode.useItemOn(this.player, serverlevel, itemstack, interactionhand, blockhitresult); if (direction == Direction.UP && !interactionresult.consumesAction() && blockpos.getY() >= i - 1 && wasBlockPlacementAttempt(this.player, itemstack)) { Component component = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); -@@ -1135,9 +_,10 @@ +@@ -1156,8 +_,9 @@ } CompletableFuture completablefuture = this.filterTextPacket(playerchatmessage.signedContent()); - Component component = this.server.getChatDecorator().decorate(this.player, playerchatmessage.decoratedContent()); + Component component = net.minecraftforge.common.ForgeHooks.onServerChatSubmittedEvent(this.player, playerchatmessage.decoratedContent()); - this.chatMessageChain.append((p_296593_) -> { - return completablefuture.thenAcceptAsync((p_296589_) -> { + this.chatMessageChain.append(completablefuture, (p_296589_) -> { + if (component == null) return; - PlayerChatMessage playerchatmessage1 = playerchatmessage.withUnsignedContent(component).filter(p_296589_.mask()); - this.broadcastChatMessage(playerchatmessage1); - }, p_296593_); -@@ -1398,7 +_,7 @@ + PlayerChatMessage playerchatmessage1 = playerchatmessage.withUnsignedContent(component).filter(p_296589_.mask()); + this.broadcastChatMessage(playerchatmessage1); + }); +@@ -1400,7 +_,7 @@ } AABB aabb = entity.getBoundingBox(); @@ -77,7 +76,7 @@ p_9866_.dispatch(new ServerboundInteractPacket.Handler() { private void performInteraction(InteractionHand p_143679_, ServerGamePacketListenerImpl.EntityInteraction p_143680_) { ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(p_143679_); -@@ -1421,6 +_,8 @@ +@@ -1423,6 +_,8 @@ public void onInteraction(InteractionHand p_143682_, Vec3 p_143683_) { this.performInteraction(p_143682_, (p_143686_, p_143687_, p_143688_) -> { diff --git a/patches/minecraft/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch b/patches/minecraft/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch index d8848f419e..13c21b72b6 100644 --- a/patches/minecraft/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch +++ b/patches/minecraft/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -180,7 +_,7 @@ +@@ -175,7 +_,7 @@ throw new IllegalStateException("Protocol error", cryptexception); } @@ -9,7 +9,7 @@ public void run() { String s1 = Objects.requireNonNull(ServerLoginPacketListenerImpl.this.requestedUsername, "Player name not initialized"); -@@ -220,6 +_,7 @@ +@@ -215,6 +_,7 @@ } public void handleCustomQueryPacket(ServerboundCustomQueryAnswerPacket p_297965_) { @@ -17,7 +17,7 @@ this.disconnect(DISCONNECT_UNEXPECTED_QUERY); } -@@ -230,6 +_,11 @@ +@@ -225,6 +_,11 @@ this.connection.setListener(serverconfigurationpacketlistenerimpl); serverconfigurationpacketlistenerimpl.startConfiguration(); this.state = ServerLoginPacketListenerImpl.State.ACCEPTED; @@ -28,4 +28,4 @@ + return this.authenticatedProfile; } - protected static GameProfile createOfflineProfile(String p_297551_) { + public void fillListenerSpecificCrashDetails(CrashReportCategory p_310682_) { diff --git a/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch b/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch index f17532bc36..94d1b23124 100644 --- a/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch +++ b/patches/minecraft/net/minecraft/server/players/PlayerList.java.patch @@ -72,7 +72,7 @@ this.ops.remove(p_11281_); ServerPlayer serverplayer = this.getPlayer(p_11281_.getId()); if (serverplayer != null) { -@@ -773,13 +_,6 @@ +@@ -778,13 +_,6 @@ if (serverstatscounter == null) { File file1 = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile(); File file2 = new File(file1, uuid + ".json"); @@ -86,7 +86,7 @@ serverstatscounter = new ServerStatsCounter(this.server, file2); this.stats.put(uuid, serverstatscounter); -@@ -826,7 +_,7 @@ +@@ -831,7 +_,7 @@ } public List getPlayers() { @@ -95,7 +95,7 @@ } @Nullable -@@ -843,6 +_,7 @@ +@@ -848,6 +_,7 @@ playeradvancements.reload(this.server.getAdvancements()); } diff --git a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch index aa22dcf613..def6acc95b 100644 --- a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -122,7 +_,7 @@ +@@ -123,7 +_,7 @@ import org.joml.Vector3f; import org.slf4j.Logger; --public abstract class Entity implements Nameable, EntityAccess, CommandSource { -+public abstract class Entity extends net.minecraftforge.common.capabilities.CapabilityProvider implements Nameable, EntityAccess, CommandSource, net.minecraftforge.common.extensions.IForgeEntity { +-public abstract class Entity implements Nameable, EntityAccess, CommandSource, ScoreHolder { ++public abstract class Entity extends net.minecraftforge.common.capabilities.CapabilityProvider implements Nameable, EntityAccess, CommandSource, ScoreHolder, net.minecraftforge.common.extensions.IForgeEntity { private static final Logger LOGGER = LogUtils.getLogger(); public static final String ID_TAG = "id"; public static final String PASSENGERS_TAG = "Passengers"; -@@ -143,6 +_,7 @@ +@@ -144,6 +_,7 @@ private static final double LAVA_SLOW_FLOW_SCALE = 0.0023333333333333335D; public static final String UUID_TAG = "UUID"; private static double viewScale = 1.0D; @@ -17,7 +17,7 @@ private final EntityType type; private int id = ENTITY_COUNTER.incrementAndGet(); public boolean blocksBuilding; -@@ -189,8 +_,10 @@ +@@ -190,8 +_,10 @@ public int tickCount; private int remainingFireTicks = -this.getFireImmuneTicks(); protected boolean wasTouchingWater; @@ -28,7 +28,7 @@ private final Set> fluidOnEyes = new HashSet<>(); public int invulnerableTime; protected boolean firstTick = true; -@@ -239,6 +_,7 @@ +@@ -240,6 +_,7 @@ private BlockState feetBlockState = null; public Entity(EntityType p_19870_, Level p_19871_) { @@ -36,7 +36,7 @@ this.type = p_19870_; this.level = p_19871_; this.dimensions = p_19870_.getDimensions(); -@@ -257,6 +_,8 @@ +@@ -258,6 +_,8 @@ this.defineSynchedData(); this.setPos(0.0D, 0.0D, 0.0D); this.eyeHeight = this.getEyeHeight(Pose.STANDING, this.dimensions); @@ -45,7 +45,7 @@ } public boolean isColliding(BlockPos p_20040_, BlockState p_20041_) { -@@ -346,6 +_,7 @@ +@@ -347,6 +_,7 @@ public void remove(Entity.RemovalReason p_146834_) { this.setRemoved(p_146834_); @@ -53,7 +53,7 @@ } public void onClientRemoval() { -@@ -463,7 +_,7 @@ +@@ -464,7 +_,7 @@ if (this.isInLava()) { this.lavaHurt(); @@ -62,7 +62,7 @@ } this.checkBelowWorld(); -@@ -674,7 +_,7 @@ +@@ -675,7 +_,7 @@ double d1 = vec3.x; double d2 = vec3.y; double d3 = vec3.z; @@ -71,7 +71,7 @@ BlockPos blockpos1 = this.getOnPos(); BlockState blockstate1 = this.level().getBlockState(blockpos1); boolean flag1 = this.isStateClimbable(blockstate1); -@@ -718,16 +_,16 @@ +@@ -719,16 +_,16 @@ this.setRemainingFireTicks(-this.getFireImmuneTicks()); } @@ -91,7 +91,7 @@ } } } -@@ -815,7 +_,7 @@ +@@ -816,7 +_,7 @@ return blockpos; } else { BlockState blockstate = this.level().getBlockState(blockpos); @@ -100,7 +100,7 @@ } } else { int i = Mth.floor(this.position.x); -@@ -886,10 +_,11 @@ +@@ -887,10 +_,11 @@ boolean flag1 = p_20273_.y != vec3.y; boolean flag2 = p_20273_.z != vec3.z; boolean flag3 = this.onGround() || flag1 && p_20273_.y < 0.0D; @@ -116,7 +116,7 @@ Vec3 vec33 = collideBoundingBox(this, new Vec3(p_20273_.x, 0.0D, p_20273_.z), aabb.move(vec32), this.level(), list).add(vec32); if (vec33.horizontalDistanceSqr() > vec31.horizontalDistanceSqr()) { vec31 = vec33; -@@ -1039,19 +_,20 @@ +@@ -1040,19 +_,20 @@ return !blockstate.is(BlockTags.INSIDE_STEP_SOUND_BLOCKS) && !blockstate.is(BlockTags.COMBINATION_STEP_SOUND_BLOCKS) ? p_278049_ : blockpos; } @@ -143,7 +143,7 @@ this.playSound(soundtype.getStepSound(), soundtype.getVolume() * 0.15F, soundtype.getPitch()); } -@@ -1186,31 +_,38 @@ +@@ -1187,31 +_,38 @@ public void updateSwimming() { if (this.isSwimming()) { @@ -189,7 +189,7 @@ if (!this.wasTouchingWater && !this.firstTick) { this.doWaterSplashEffect(); } -@@ -1227,6 +_,7 @@ +@@ -1228,6 +_,7 @@ private void updateFluidOnEyes() { this.wasEyeInWater = this.isEyeInFluid(FluidTags.WATER); this.fluidOnEyes.clear(); @@ -197,7 +197,7 @@ double d0 = this.getEyeY() - (double)0.11111111F; Entity entity = this.getVehicle(); if (entity instanceof Boat boat) { -@@ -1239,7 +_,7 @@ +@@ -1240,7 +_,7 @@ FluidState fluidstate = this.level().getFluidState(blockpos); double d1 = (double)((float)blockpos.getY() + fluidstate.getHeight(this.level(), blockpos)); if (d1 > d0) { @@ -206,7 +206,7 @@ } } -@@ -1283,12 +_,13 @@ +@@ -1284,12 +_,13 @@ } public boolean canSpawnSprintParticle() { @@ -221,7 +221,7 @@ if (blockstate.getRenderShape() != RenderShape.INVISIBLE) { Vec3 vec3 = this.getDeltaMovement(); BlockPos blockpos1 = this.blockPosition(); -@@ -1302,17 +_,20 @@ +@@ -1303,17 +_,20 @@ d1 = Mth.clamp(d1, (double)blockpos.getZ(), (double)blockpos.getZ() + 1.0D); } @@ -244,7 +244,7 @@ } public void moveRelative(float p_19921_, Vec3 p_19922_) { -@@ -1630,6 +_,8 @@ +@@ -1631,6 +_,8 @@ p_20241_.putBoolean("HasVisualFire", this.hasVisualFire); } @@ -253,7 +253,7 @@ if (!this.tags.isEmpty()) { ListTag listtag = new ListTag(); -@@ -1640,6 +_,10 @@ +@@ -1641,6 +_,10 @@ p_20241_.put("Tags", listtag); } @@ -264,7 +264,7 @@ this.addAdditionalSaveData(p_20241_); if (this.isVehicle()) { ListTag listtag1 = new ListTag(); -@@ -1715,6 +_,9 @@ +@@ -1716,6 +_,9 @@ this.setGlowingTag(p_20259_.getBoolean("Glowing")); this.setTicksFrozen(p_20259_.getInt("TicksFrozen")); this.hasVisualFire = p_20259_.getBoolean("HasVisualFire"); @@ -274,7 +274,7 @@ if (p_20259_.contains("Tags", 9)) { this.tags.clear(); ListTag listtag3 = p_20259_.getList("Tags", 8); -@@ -1803,6 +_,8 @@ +@@ -1804,6 +_,8 @@ } else { ItemEntity itementity = new ItemEntity(this.level(), this.getX(), this.getY() + (double)p_19986_, this.getZ(), p_19985_); itementity.setDefaultPickUpDelay(); @@ -283,7 +283,7 @@ this.level().addFreshEntity(itementity); return itementity; } -@@ -1839,6 +_,7 @@ +@@ -1840,6 +_,7 @@ public void rideTick() { this.setDeltaMovement(Vec3.ZERO); @@ -291,7 +291,7 @@ this.tick(); if (this.isPassenger()) { this.getVehicle().positionRider(this); -@@ -1895,6 +_,7 @@ +@@ -1896,6 +_,7 @@ } } @@ -299,7 +299,7 @@ if (p_19967_ || this.canRide(p_19966_) && p_19966_.canAddPassenger(this)) { if (this.isPassenger()) { this.stopRiding(); -@@ -1929,6 +_,7 @@ +@@ -1930,6 +_,7 @@ public void removeVehicle() { if (this.vehicle != null) { Entity entity = this.vehicle; @@ -307,7 +307,7 @@ this.vehicle = null; entity.removePassenger(this); } -@@ -1981,6 +_,8 @@ +@@ -1982,6 +_,8 @@ return this.passengers.isEmpty(); } @@ -316,7 +316,7 @@ protected boolean couldAcceptPassenger() { return true; } -@@ -2186,7 +_,7 @@ +@@ -2187,7 +_,7 @@ } public boolean isVisuallyCrawling() { @@ -325,7 +325,7 @@ } public void setSwimming(boolean p_20283_) { -@@ -2296,7 +_,7 @@ +@@ -2297,7 +_,7 @@ this.setSecondsOnFire(8); } @@ -334,7 +334,7 @@ } public void onAboveBubbleCol(boolean p_20313_) { -@@ -2392,7 +_,7 @@ +@@ -2393,7 +_,7 @@ } protected Component getTypeName() { @@ -343,7 +343,7 @@ } public boolean is(Entity p_20356_) { -@@ -2448,14 +_,20 @@ +@@ -2449,14 +_,20 @@ @Nullable public Entity changeDimension(ServerLevel p_20118_) { @@ -365,7 +365,7 @@ this.level().getProfiler().popPush("reloading"); Entity entity = this.getType().create(p_20118_); if (entity != null) { -@@ -2463,17 +_,19 @@ +@@ -2464,17 +_,19 @@ entity.moveTo(portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z, portalinfo.yRot, entity.getXRot()); entity.setDeltaMovement(portalinfo.speed); p_20118_.addDuringTeleport(entity); @@ -387,7 +387,7 @@ } } else { return null; -@@ -2595,6 +_,7 @@ +@@ -2596,6 +_,7 @@ return this.stringUUID; } @@ -395,7 +395,7 @@ public boolean isPushedByFluid() { return true; } -@@ -3010,9 +_,22 @@ +@@ -3015,9 +_,22 @@ this.yRotO = this.getYRot(); } @@ -419,7 +419,7 @@ } else { AABB aabb = this.getBoundingBox().deflate(0.001D); int i = Mth.floor(aabb.minX); -@@ -3027,25 +_,28 @@ +@@ -3032,25 +_,28 @@ Vec3 vec3 = Vec3.ZERO; int k1 = 0; BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); @@ -455,7 +455,7 @@ } } } -@@ -3053,27 +_,28 @@ +@@ -3058,27 +_,28 @@ } } @@ -494,7 +494,7 @@ } } -@@ -3086,7 +_,10 @@ +@@ -3091,7 +_,10 @@ return !this.level().hasChunksAt(i, k, j, l); } @@ -505,7 +505,7 @@ return this.fluidHeight.getDouble(p_204037_); } -@@ -3106,7 +_,9 @@ +@@ -3111,7 +_,9 @@ return this.getBbHeight() + 0.5F; } @@ -515,7 +515,7 @@ return new ClientboundAddEntityPacket(this); } -@@ -3222,6 +_,7 @@ +@@ -3227,6 +_,7 @@ this.levelCallback.onMove(); } @@ -523,7 +523,7 @@ } -@@ -3294,6 +_,7 @@ +@@ -3299,6 +_,7 @@ return false; } @@ -531,7 +531,7 @@ public float maxUpStep() { return this.maxUpStep; } -@@ -3349,6 +_,109 @@ +@@ -3354,6 +_,109 @@ public boolean mayInteract(Level p_146843_, BlockPos p_146844_) { return true; } diff --git a/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch b/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch index 83129609ec..81d4b779f4 100644 --- a/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/EntityType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/EntityType.java +++ b/net/minecraft/world/entity/EntityType.java -@@ -308,6 +_,11 @@ +@@ -312,6 +_,11 @@ private final EntityDimensions dimensions; private final FeatureFlagSet requiredFeatures; @@ -12,7 +12,7 @@ private static EntityType register(String p_20635_, EntityType.Builder p_20636_) { return Registry.register(BuiltInRegistries.ENTITY_TYPE, p_20635_, p_20636_.build(p_20635_)); } -@@ -321,17 +_,24 @@ +@@ -325,17 +_,24 @@ } public EntityType(EntityType.EntityFactory p_273268_, MobCategory p_272918_, boolean p_273417_, boolean p_273389_, boolean p_273556_, boolean p_272654_, ImmutableSet p_273631_, EntityDimensions p_272946_, int p_272895_, int p_273451_, FeatureFlagSet p_273518_) { @@ -48,7 +48,7 @@ } @Nullable -@@ -601,14 +_,23 @@ +@@ -605,14 +_,23 @@ } public int clientTrackingRange() { @@ -72,7 +72,7 @@ return this != PLAYER && this != LLAMA_SPIT && this != WITHER && this != BAT && this != ITEM_FRAME && this != GLOW_ITEM_FRAME && this != LEASH_KNOT && this != PAINTING && this != END_CRYSTAL && this != EVOKER_FANGS; } -@@ -635,6 +_,12 @@ +@@ -639,6 +_,12 @@ return this.builtInRegistryHolder; } @@ -85,7 +85,7 @@ public static class Builder { private final EntityType.EntityFactory factory; private final MobCategory category; -@@ -648,6 +_,11 @@ +@@ -652,6 +_,11 @@ private EntityDimensions dimensions = EntityDimensions.scalable(0.6F, 1.8F); private FeatureFlagSet requiredFeatures = FeatureFlags.VANILLA_SET; @@ -97,7 +97,7 @@ private Builder(EntityType.EntityFactory p_20696_, MobCategory p_20697_) { this.factory = p_20696_; this.category = p_20697_; -@@ -709,12 +_,36 @@ +@@ -713,12 +_,36 @@ return this; } diff --git a/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch b/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch index 5c6a4677a8..0fae343e1b 100644 --- a/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ExperienceOrb.java.patch @@ -30,8 +30,8 @@ Map.Entry entry = EnchantmentHelper.getRandomItemWith(Enchantments.MENDING, p_147093_, ItemStack::isDamaged); if (entry != null) { ItemStack itemstack = entry.getValue(); -- int i = Math.min(this.xpToDurability(this.value), itemstack.getDamageValue()); -+ int i = Math.min((int) (this.value * itemstack.getXpRepairRatio()), itemstack.getDamageValue()); +- int i = Math.min(this.xpToDurability(p_147094_), itemstack.getDamageValue()); ++ int i = Math.min((int) (p_147094_ * itemstack.getXpRepairRatio()), itemstack.getDamageValue()); itemstack.setDamageValue(itemstack.getDamageValue() - i); int j = p_147094_ - this.durabilityToXp(i); return j > 0 ? this.repairPlayerItems(p_147093_, j) : 0; diff --git a/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch index e6699f7b6a..79fa1304c8 100644 --- a/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/LivingEntity.java.patch @@ -16,7 +16,7 @@ public static final int HAND_SLOTS = 2; public static final int ARMOR_SLOTS = 4; public static final int EQUIPMENT_SLOT_OFFSET = 98; -@@ -239,7 +_,8 @@ +@@ -238,7 +_,8 @@ this.yHeadRot = this.getYRot(); this.setMaxUpStep(0.6F); NbtOps nbtops = NbtOps.INSTANCE; @@ -26,7 +26,7 @@ } public Brain getBrain() { -@@ -273,7 +_,7 @@ +@@ -272,7 +_,7 @@ } public static AttributeSupplier.Builder createLivingAttributes() { @@ -35,7 +35,7 @@ } protected void checkFallDamage(double p_20990_, boolean p_20991_, BlockState p_20992_, BlockPos p_20993_) { -@@ -302,7 +_,8 @@ +@@ -301,7 +_,8 @@ float f = (float)Mth.ceil(this.fallDistance - 3.0F); double d4 = Math.min((double)(0.2F + f / 15.0F), 2.5D); int i = (int)(150.0D * d4); @@ -45,15 +45,15 @@ } super.checkFallDamage(p_20990_, p_20991_, p_20992_, p_20993_); -@@ -312,6 +_,7 @@ +@@ -311,6 +_,7 @@ } + @Deprecated //FORGE: Use canDrownInFluidType instead - public boolean canBreatheUnderwater() { - return this.getMobType() == MobType.UNDEAD; + public final boolean canBreatheUnderwater() { + return this.getType().is(EntityTypeTags.CAN_BREATHE_UNDER_WATER); } -@@ -352,6 +_,9 @@ +@@ -351,6 +_,9 @@ } } @@ -63,7 +63,7 @@ if (this.isEyeInFluid(FluidTags.WATER) && !this.level().getBlockState(BlockPos.containing(this.getX(), this.getEyeY(), this.getZ())).is(Blocks.BUBBLE_COLUMN)) { boolean flag1 = !this.canBreatheUnderwater() && !MobEffectUtil.hasWaterBreathing(this) && (!flag || !((Player)this).getAbilities().invulnerable); if (flag1) { -@@ -387,7 +_,7 @@ +@@ -386,7 +_,7 @@ } } @@ -72,7 +72,7 @@ this.extinguishFire(); } -@@ -734,7 +_,8 @@ +@@ -733,7 +_,8 @@ } if (p_21096_.contains("Brain", 10)) { @@ -82,7 +82,7 @@ } } -@@ -749,7 +_,7 @@ +@@ -748,7 +_,7 @@ if (!mobeffectinstance.tick(this, () -> { this.onEffectUpdated(mobeffectinstance, true, (Entity)null); })) { @@ -91,7 +91,7 @@ iterator.remove(); this.onEffectRemoved(mobeffectinstance); } -@@ -799,8 +_,10 @@ +@@ -798,8 +_,10 @@ this.setInvisible(false); } else { Collection collection = this.activeEffects.values(); @@ -104,7 +104,7 @@ this.setInvisible(this.hasEffect(MobEffects.INVISIBILITY)); } -@@ -837,6 +_,7 @@ +@@ -836,6 +_,7 @@ } } @@ -112,7 +112,7 @@ return d0; } -@@ -879,7 +_,9 @@ +@@ -878,7 +_,9 @@ boolean flag; for(flag = false; iterator.hasNext(); flag = true) { @@ -123,7 +123,7 @@ iterator.remove(); } -@@ -914,6 +_,7 @@ +@@ -913,6 +_,7 @@ } else { MobEffectInstance mobeffectinstance = this.activeEffects.get(p_147208_.getEffect()); boolean flag = false; @@ -131,7 +131,7 @@ if (mobeffectinstance == null) { this.activeEffects.put(p_147208_.getEffect(), p_147208_); this.onEffectAdded(p_147208_, p_147209_); -@@ -929,6 +_,9 @@ +@@ -928,6 +_,9 @@ } public boolean canBeAffected(MobEffectInstance p_21197_) { @@ -141,7 +141,7 @@ if (this.getMobType() == MobType.UNDEAD) { MobEffect mobeffect = p_21197_.getEffect(); if (mobeffect == MobEffects.REGENERATION || mobeffect == MobEffects.POISON) { -@@ -961,6 +_,7 @@ +@@ -960,6 +_,7 @@ } public boolean removeEffect(MobEffect p_21196_) { @@ -149,7 +149,7 @@ MobEffectInstance mobeffectinstance = this.removeEffectNoUpdate(p_21196_); if (mobeffectinstance != null) { this.onEffectRemoved(mobeffectinstance); -@@ -1042,6 +_,8 @@ +@@ -1041,6 +_,8 @@ } public void heal(float p_21116_) { @@ -158,7 +158,7 @@ float f = this.getHealth(); if (f > 0.0F) { this.setHealth(f + p_21116_); -@@ -1062,6 +_,7 @@ +@@ -1061,6 +_,7 @@ } public boolean hurt(DamageSource p_21016_, float p_21017_) { @@ -166,7 +166,7 @@ if (this.isInvulnerableTo(p_21016_)) { return false; } else if (this.level().isClientSide) { -@@ -1080,9 +_,11 @@ +@@ -1079,9 +_,11 @@ boolean flag = false; float f1 = 0.0F; if (p_21017_ > 0.0F && this.isDamageSourceBlocked(p_21016_)) { @@ -181,7 +181,7 @@ if (!p_21016_.is(DamageTypeTags.IS_PROJECTILE)) { Entity entity = p_21016_.getDirectEntity(); if (entity instanceof LivingEntity) { -@@ -1091,7 +_,8 @@ +@@ -1090,7 +_,8 @@ } } @@ -191,7 +191,7 @@ } if (p_21016_.is(DamageTypeTags.IS_FREEZING) && this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES)) { -@@ -1134,11 +_,10 @@ +@@ -1133,11 +_,10 @@ Player player1 = (Player)entity1; this.lastHurtByPlayerTime = 100; this.lastHurtByPlayer = player1; @@ -206,7 +206,7 @@ if (livingentity2 instanceof Player) { Player player = (Player)livingentity2; this.lastHurtByPlayer = player; -@@ -1197,7 +_,7 @@ +@@ -1196,7 +_,7 @@ if (this instanceof ServerPlayer) { CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer)this, p_21016_, f, p_21017_, flag); if (f1 > 0.0F && f1 < 3.4028235E37F) { @@ -215,7 +215,7 @@ } } -@@ -1225,7 +_,7 @@ +@@ -1224,7 +_,7 @@ for(InteractionHand interactionhand : InteractionHand.values()) { ItemStack itemstack1 = this.getItemInHand(interactionhand); @@ -224,7 +224,7 @@ itemstack = itemstack1.copy(); itemstack1.shrink(1); break; -@@ -1235,7 +_,7 @@ +@@ -1234,7 +_,7 @@ if (itemstack != null) { if (this instanceof ServerPlayer) { ServerPlayer serverplayer = (ServerPlayer)this; @@ -233,7 +233,7 @@ CriteriaTriggers.USED_TOTEM.trigger(serverplayer, itemstack); this.gameEvent(GameEvent.ITEM_INTERACT_FINISH); } -@@ -1305,6 +_,7 @@ +@@ -1302,6 +_,7 @@ } public void die(DamageSource p_21014_) { @@ -241,7 +241,7 @@ if (!this.isRemoved() && !this.dead) { Entity entity = p_21014_.getEntity(); LivingEntity livingentity = this.getKillCredit(); -@@ -1342,10 +_,10 @@ +@@ -1339,10 +_,10 @@ if (!this.level().isClientSide) { boolean flag = false; if (p_21269_ instanceof WitherBoss) { @@ -254,7 +254,7 @@ this.level().setBlock(blockpos, blockstate, 3); flag = true; } -@@ -1362,12 +_,9 @@ +@@ -1359,12 +_,9 @@ protected void dropAllDeathLoot(DamageSource p_21192_) { Entity entity = p_21192_.getEntity(); @@ -270,7 +270,7 @@ boolean flag = this.lastHurtByPlayerTime > 0; if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { -@@ -1377,6 +_,10 @@ +@@ -1374,6 +_,10 @@ this.dropEquipment(); this.dropExperience(); @@ -281,7 +281,7 @@ } protected void dropEquipment() { -@@ -1384,7 +_,8 @@ +@@ -1381,7 +_,8 @@ protected void dropExperience() { if (this.level() instanceof ServerLevel && !this.wasExperienceConsumed() && (this.isAlwaysExperienceDropper() || this.lastHurtByPlayerTime > 0 && this.shouldDropExperience() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT))) { @@ -291,7 +291,7 @@ } } -@@ -1413,6 +_,11 @@ +@@ -1410,6 +_,11 @@ } public void knockback(double p_147241_, double p_147242_, double p_147243_) { @@ -303,7 +303,7 @@ p_147241_ *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE); if (!(p_147241_ <= 0.0D)) { this.hasImpulse = true; -@@ -1484,15 +_,9 @@ +@@ -1481,15 +_,9 @@ } else { BlockPos blockpos = this.blockPosition(); BlockState blockstate = this.getFeetBlockState(); @@ -322,7 +322,7 @@ } } -@@ -1512,6 +_,11 @@ +@@ -1509,6 +_,11 @@ } public boolean causeFallDamage(float p_147187_, float p_147188_, DamageSource p_147189_) { @@ -334,7 +334,7 @@ boolean flag = super.causeFallDamage(p_147187_, p_147188_, p_147189_); int i = this.calculateFallDamage(p_147187_, p_147188_); if (i > 0) { -@@ -1539,9 +_,10 @@ +@@ -1536,9 +_,10 @@ int i = Mth.floor(this.getX()); int j = Mth.floor(this.getY() - (double)0.2F); int k = Mth.floor(this.getZ()); @@ -347,7 +347,7 @@ this.playSound(soundtype.getFallSound(), soundtype.getVolume() * 0.5F, soundtype.getPitch() * 0.75F); } -@@ -1588,9 +_,9 @@ +@@ -1585,9 +_,9 @@ float f2 = f1 - p_21194_; if (f2 > 0.0F && f2 < 3.4028235E37F) { if (this instanceof ServerPlayer) { @@ -359,7 +359,7 @@ } } } -@@ -1612,6 +_,8 @@ +@@ -1609,6 +_,8 @@ protected void actuallyHurt(DamageSource p_21240_, float p_21241_) { if (!this.isInvulnerableTo(p_21240_)) { @@ -368,7 +368,7 @@ p_21241_ = this.getDamageAfterArmorAbsorb(p_21240_, p_21241_); p_21241_ = this.getDamageAfterMagicAbsorb(p_21240_, p_21241_); float f1 = Math.max(p_21241_ - this.getAbsorptionAmount(), 0.0F); -@@ -1625,6 +_,7 @@ +@@ -1622,6 +_,7 @@ } } @@ -376,7 +376,7 @@ if (f1 != 0.0F) { this.getCombatTracker().recordDamage(p_21240_, f1); this.setHealth(this.getHealth() - f1); -@@ -1684,6 +_,8 @@ +@@ -1681,6 +_,8 @@ } public void swing(InteractionHand p_21012_, boolean p_21013_) { @@ -385,7 +385,7 @@ if (!this.swinging || this.swingTime >= this.getCurrentSwingDuration() / 2 || this.swingTime < 0) { this.swingTime = -1; this.swinging = true; -@@ -1794,8 +_,10 @@ +@@ -1791,8 +_,10 @@ private void swapHandItems() { ItemStack itemstack = this.getItemBySlot(EquipmentSlot.OFFHAND); @@ -398,7 +398,7 @@ } protected void onBelowWorld() { -@@ -1985,14 +_,17 @@ +@@ -1982,14 +_,17 @@ } this.hasImpulse = true; @@ -418,7 +418,7 @@ } protected float getWaterSlowDown() { -@@ -2006,13 +_,19 @@ +@@ -2003,13 +_,19 @@ public void travel(Vec3 p_21280_) { if (this.isControlledByLocalInstance()) { double d0 = 0.08D; @@ -440,7 +440,7 @@ double d9 = this.getY(); float f4 = this.isSprinting() ? 0.9F : this.getWaterSlowDown(); float f5 = 0.02F; -@@ -2034,6 +_,7 @@ +@@ -2031,6 +_,7 @@ f4 = 0.96F; } @@ -448,7 +448,7 @@ this.moveRelative(f5, p_21280_); this.move(MoverType.SELF, this.getDeltaMovement()); Vec3 vec36 = this.getDeltaMovement(); -@@ -2047,6 +_,7 @@ +@@ -2044,6 +_,7 @@ if (this.horizontalCollision && this.isFree(vec32.x, vec32.y + (double)0.6F - this.getY() + d9, vec32.z)) { this.setDeltaMovement(vec32.x, (double)0.3F, vec32.z); } @@ -456,7 +456,7 @@ } else if (this.isInLava() && this.isAffectedByFluids() && !this.canStandOnFluid(fluidstate)) { double d8 = this.getY(); this.moveRelative(0.02F, p_21280_); -@@ -2109,7 +_,7 @@ +@@ -2106,7 +_,7 @@ } } else { BlockPos blockpos = this.getBlockPosBelowThatAffectsMyMovement(); @@ -465,7 +465,7 @@ float f3 = this.onGround() ? f2 * 0.91F : 0.91F; Vec3 vec35 = this.handleRelativeFrictionAndCalculateMovement(p_21280_, f2); double d2 = vec35.y; -@@ -2205,7 +_,7 @@ +@@ -2202,7 +_,7 @@ double d0 = Mth.clamp(p_21298_.x, (double)-0.15F, (double)0.15F); double d1 = Mth.clamp(p_21298_.z, (double)-0.15F, (double)0.15F); double d2 = Math.max(p_21298_.y, (double)-0.15F); @@ -474,7 +474,7 @@ d2 = 0.0D; } -@@ -2237,6 +_,7 @@ +@@ -2234,6 +_,7 @@ } public void tick() { @@ -482,7 +482,7 @@ super.tick(); this.updatingUsingItem(); this.updateSwimAmount(); -@@ -2389,6 +_,7 @@ +@@ -2386,6 +_,7 @@ ItemStack itemstack1 = this.getItemBySlot(equipmentslot); if (this.equipmentHasChanged(itemstack, itemstack1)) { @@ -490,7 +490,7 @@ if (map == null) { map = Maps.newEnumMap(EquipmentSlot.class); } -@@ -2527,6 +_,10 @@ +@@ -2529,6 +_,10 @@ this.level().getProfiler().push("jump"); if (this.jumping && this.isAffectedByFluids()) { double d3; @@ -501,7 +501,7 @@ if (this.isInLava()) { d3 = this.getFluidHeight(FluidTags.LAVA); } else { -@@ -2537,15 +_,17 @@ +@@ -2539,15 +_,17 @@ double d4 = this.getFluidJumpThreshold(); if (!flag || this.onGround() && !(d3 > d4)) { if (!this.isInLava() || this.onGround() && !(d3 > d4)) { @@ -521,7 +521,7 @@ } } else { this.noJumpDelay = 0; -@@ -2614,6 +_,8 @@ +@@ -2616,6 +_,8 @@ boolean flag = this.getSharedFlag(7); if (flag && !this.onGround() && !this.isPassenger() && !this.hasEffect(MobEffects.LEVITATION)) { ItemStack itemstack = this.getItemBySlot(EquipmentSlot.CHEST); @@ -530,7 +530,7 @@ if (itemstack.is(Items.ELYTRA) && ElytraItem.isFlyEnabled(itemstack)) { flag = true; int i = this.fallFlyTicks + 1; -@@ -2863,8 +_,11 @@ +@@ -2865,8 +_,11 @@ private void updatingUsingItem() { if (this.isUsingItem()) { @@ -544,7 +544,7 @@ this.updateUsingItem(this.useItem); } else { this.stopUsingItem(); -@@ -2874,12 +_,15 @@ +@@ -2876,12 +_,15 @@ } protected void updateUsingItem(ItemStack p_147201_) { @@ -561,7 +561,7 @@ this.completeUsingItem(); } -@@ -2887,7 +_,7 @@ +@@ -2889,7 +_,7 @@ private boolean shouldTriggerItemUseEffects() { int i = this.getUseItemRemainingTicks(); @@ -570,7 +570,7 @@ boolean flag = foodproperties != null && foodproperties.isFastFood(); flag |= i <= this.useItem.getUseDuration() - 7; return flag && i % 4 == 0; -@@ -2917,8 +_,10 @@ +@@ -2919,8 +_,10 @@ public void startUsingItem(InteractionHand p_21159_) { ItemStack itemstack = this.getItemInHand(p_21159_); if (!itemstack.isEmpty() && !this.isUsingItem()) { @@ -582,7 +582,7 @@ if (!this.level().isClientSide) { this.setLivingEntityFlag(1, true); this.setLivingEntityFlag(2, p_21159_ == InteractionHand.OFF_HAND); -@@ -2979,6 +_,9 @@ +@@ -2981,6 +_,9 @@ vec31 = vec31.xRot(-this.getXRot() * ((float)Math.PI / 180F)); vec31 = vec31.yRot(-this.getYRot() * ((float)Math.PI / 180F)); vec31 = vec31.add(this.getX(), this.getEyeY(), this.getZ()); @@ -592,7 +592,7 @@ this.level().addParticle(new ItemParticleOption(ParticleTypes.ITEM, p_21061_), vec31.x, vec31.y, vec31.z, vec3.x, vec3.y + 0.05D, vec3.z); } -@@ -2992,7 +_,8 @@ +@@ -2994,7 +_,8 @@ } else { if (!this.useItem.isEmpty() && this.isUsingItem()) { this.triggerItemUseEffects(this.useItem, 16); @@ -602,7 +602,7 @@ if (itemstack != this.useItem) { this.setItemInHand(interactionhand, itemstack); } -@@ -3018,7 +_,11 @@ +@@ -3020,7 +_,11 @@ public void releaseUsingItem() { if (!this.useItem.isEmpty()) { @@ -614,7 +614,7 @@ if (this.useItem.useOnRelease()) { this.updatingUsingItem(); } -@@ -3028,6 +_,7 @@ +@@ -3030,6 +_,7 @@ } public void stopUsingItem() { @@ -622,7 +622,7 @@ if (!this.level().isClientSide) { boolean flag = this.isUsingItem(); this.setLivingEntityFlag(1, false); -@@ -3043,7 +_,7 @@ +@@ -3045,7 +_,7 @@ public boolean isBlocking() { if (this.isUsingItem() && !this.useItem.isEmpty()) { Item item = this.useItem.getItem(); @@ -631,7 +631,7 @@ return false; } else { return item.getUseDuration(this.useItem) - this.useItemRemaining >= 5; -@@ -3174,8 +_,8 @@ +@@ -3177,8 +_,8 @@ } BlockState blockstate = this.level().getBlockState(p_21141_); @@ -642,12 +642,12 @@ } this.setPose(Pose.SLEEPING); -@@ -3191,16 +_,16 @@ +@@ -3194,16 +_,16 @@ private boolean checkBedExists() { - return this.getSleepingPos().map((p_296657_) -> { -- return this.level().getBlockState(p_296657_).getBlock() instanceof BedBlock; -+ return net.minecraftforge.event.ForgeEventFactory.fireSleepingLocationCheck(this, p_296657_); + return this.getSleepingPos().map((p_309015_) -> { +- return this.level().getBlockState(p_309015_).getBlock() instanceof BedBlock; ++ return net.minecraftforge.event.ForgeEventFactory.fireSleepingLocationCheck(this, p_309015_); }).orElse(false); } @@ -662,7 +662,7 @@ Vec3 vec31 = BedBlock.findStandUpPosition(this.getType(), this.level(), p_261435_, direction, this.getYRot()).orElseGet(() -> { BlockPos blockpos = p_261435_.above(); return new Vec3((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.1D, (double)blockpos.getZ() + 0.5D); -@@ -3222,7 +_,9 @@ +@@ -3225,7 +_,9 @@ @Nullable public Direction getBedOrientation() { BlockPos blockpos = this.getSleepingPos().orElse((BlockPos)null); @@ -673,7 +673,7 @@ } public boolean isInWall() { -@@ -3238,7 +_,7 @@ +@@ -3241,7 +_,7 @@ } public ItemStack getProjectile(ItemStack p_21272_) { @@ -682,7 +682,7 @@ } public ItemStack eat(Level p_21067_, ItemStack p_21068_) { -@@ -3258,7 +_,7 @@ +@@ -3261,7 +_,7 @@ private void addEatEffect(ItemStack p_21064_, Level p_21065_, LivingEntity p_21066_) { Item item = p_21064_.getItem(); if (item.isEdible()) { @@ -691,7 +691,7 @@ if (!p_21065_.isClientSide && pair.getFirst() != null && p_21065_.random.nextFloat() < pair.getSecond()) { p_21066_.addEffect(new MobEffectInstance(pair.getFirst())); } -@@ -3294,6 +_,64 @@ +@@ -3297,6 +_,64 @@ this.broadcastBreakEvent(p_21191_ == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); } @@ -756,7 +756,7 @@ public AABB getBoundingBoxForCulling() { if (this.getItemBySlot(EquipmentSlot.HEAD).is(Items.DRAGON_HEAD)) { float f = 0.5F; -@@ -3304,6 +_,8 @@ +@@ -3307,6 +_,8 @@ } public static EquipmentSlot getEquipmentSlotForItem(ItemStack p_147234_) { diff --git a/patches/minecraft/net/minecraft/world/entity/Mob.java.patch b/patches/minecraft/net/minecraft/world/entity/Mob.java.patch index 57082a37e6..c5ceb7c780 100644 --- a/patches/minecraft/net/minecraft/world/entity/Mob.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/Mob.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -117,6 +_,9 @@ +@@ -118,6 +_,9 @@ private CompoundTag leashInfoTag; private BlockPos restrictCenter = BlockPos.ZERO; private float restrictRadius = -1.0F; @@ -10,7 +10,7 @@ protected Mob(EntityType p_21368_, Level p_21369_) { super(p_21368_, p_21369_); -@@ -231,7 +_,10 @@ +@@ -232,7 +_,10 @@ } public void setTarget(@Nullable LivingEntity p_21544_) { @@ -22,7 +22,7 @@ } public boolean canAttackType(EntityType p_21399_) { -@@ -429,6 +_,9 @@ +@@ -430,6 +_,9 @@ p_21484_.putBoolean("NoAI", this.isNoAi()); } @@ -32,7 +32,7 @@ } public void readAdditionalSaveData(CompoundTag p_21450_) { -@@ -481,6 +_,14 @@ +@@ -482,6 +_,14 @@ } this.setNoAi(p_21450_.getBoolean("NoAI")); @@ -47,7 +47,7 @@ } protected void dropFromLootTable(DamageSource p_21389_, boolean p_21390_) { -@@ -520,9 +_,9 @@ +@@ -521,9 +_,9 @@ public void aiStep() { super.aiStep(); this.level().getProfiler().push("looting"); @@ -58,7 +58,7 @@ for(ItemEntity itementity : this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double)vec3i.getX(), (double)vec3i.getY(), (double)vec3i.getZ()))) { if (!itementity.isRemoved() && !itementity.getItem().isEmpty() && !itementity.hasPickUpDelay() && this.wantsToPickUp(itementity.getItem())) { this.pickUpItem(itementity); -@@ -698,6 +_,14 @@ +@@ -699,6 +_,14 @@ this.discard(); } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { Entity entity = this.level().getNearestPlayer(this, -1.0D); @@ -73,7 +73,7 @@ if (entity != null) { double d0 = entity.distanceToSqr(this); int i = this.getType().getCategory().getDespawnDistance(); -@@ -1031,6 +_,16 @@ +@@ -1032,6 +_,16 @@ } @@ -90,7 +90,7 @@ @Nullable public SpawnGroupData finalizeSpawn(ServerLevelAccessor p_21434_, DifficultyInstance p_21435_, MobSpawnType p_21436_, @Nullable SpawnGroupData p_21437_, @Nullable CompoundTag p_21438_) { RandomSource randomsource = p_21434_.getRandom(); -@@ -1041,6 +_,7 @@ +@@ -1042,6 +_,7 @@ this.setLeftHanded(false); } @@ -98,7 +98,7 @@ return p_21437_; } -@@ -1425,15 +_,25 @@ +@@ -1426,15 +_,25 @@ return false; } @@ -122,10 +122,10 @@ + this.jumpInLiquidInternal(() -> super.jumpInFluid(type)); + } + + @VisibleForTesting public void removeFreeWill() { this.removeAllGoals((p_262562_) -> { - return true; -@@ -1460,5 +_,40 @@ +@@ -1462,5 +_,40 @@ public ItemStack getPickResult() { SpawnEggItem spawneggitem = SpawnEggItem.byId(this.getType()); return spawneggitem == null ? null : new ItemStack(spawneggitem); diff --git a/patches/minecraft/net/minecraft/world/entity/SpawnPlacements.java.patch b/patches/minecraft/net/minecraft/world/entity/SpawnPlacements.java.patch index 522d993eae..8918b50e48 100644 --- a/patches/minecraft/net/minecraft/world/entity/SpawnPlacements.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/SpawnPlacements.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/SpawnPlacements.java +++ b/net/minecraft/world/entity/SpawnPlacements.java -@@ -42,6 +_,7 @@ +@@ -44,6 +_,7 @@ public class SpawnPlacements { private static final Map, SpawnPlacements.Data> DATA_BY_TYPE = Maps.newHashMap(); @@ -8,7 +8,7 @@ public static void register(EntityType p_21755_, SpawnPlacements.Type p_21756_, Heightmap.Types p_21757_, SpawnPlacements.SpawnPredicate p_21758_) { SpawnPlacements.Data spawnplacements$data = DATA_BY_TYPE.put(p_21755_, new SpawnPlacements.Data(p_21757_, p_21756_, p_21758_)); if (spawnplacements$data != null) { -@@ -61,7 +_,8 @@ +@@ -63,7 +_,8 @@ public static boolean checkSpawnRules(EntityType p_217075_, ServerLevelAccessor p_217076_, MobSpawnType p_217077_, BlockPos p_217078_, RandomSource p_217079_) { SpawnPlacements.Data spawnplacements$data = DATA_BY_TYPE.get(p_217075_); @@ -18,7 +18,7 @@ } static { -@@ -156,10 +_,35 @@ +@@ -158,10 +_,35 @@ boolean test(EntityType p_217081_, ServerLevelAccessor p_217082_, MobSpawnType p_217083_, BlockPos p_217084_, RandomSource p_217085_); } diff --git a/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch b/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch index 85fc38809c..55819677e0 100644 --- a/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java +++ b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java -@@ -83,11 +_,12 @@ - private static final Map, AttributeSupplier> SUPPLIERS = ImmutableMap., AttributeSupplier>builder().put(EntityType.ALLAY, Allay.createAttributes().build()).put(EntityType.ARMOR_STAND, LivingEntity.createLivingAttributes().build()).put(EntityType.AXOLOTL, Axolotl.createAttributes().build()).put(EntityType.BAT, Bat.createAttributes().build()).put(EntityType.BEE, Bee.createAttributes().build()).put(EntityType.BLAZE, Blaze.createAttributes().build()).put(EntityType.CAT, Cat.createAttributes().build()).put(EntityType.CAMEL, Camel.createAttributes().build()).put(EntityType.CAVE_SPIDER, CaveSpider.createCaveSpider().build()).put(EntityType.CHICKEN, Chicken.createAttributes().build()).put(EntityType.COD, AbstractFish.createAttributes().build()).put(EntityType.COW, Cow.createAttributes().build()).put(EntityType.CREEPER, Creeper.createAttributes().build()).put(EntityType.DOLPHIN, Dolphin.createAttributes().build()).put(EntityType.DONKEY, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.DROWNED, Zombie.createAttributes().build()).put(EntityType.ELDER_GUARDIAN, ElderGuardian.createAttributes().build()).put(EntityType.ENDERMAN, EnderMan.createAttributes().build()).put(EntityType.ENDERMITE, Endermite.createAttributes().build()).put(EntityType.ENDER_DRAGON, EnderDragon.createAttributes().build()).put(EntityType.EVOKER, Evoker.createAttributes().build()).put(EntityType.FOX, Fox.createAttributes().build()).put(EntityType.FROG, Frog.createAttributes().build()).put(EntityType.GHAST, Ghast.createAttributes().build()).put(EntityType.GIANT, Giant.createAttributes().build()).put(EntityType.GLOW_SQUID, GlowSquid.createAttributes().build()).put(EntityType.GOAT, Goat.createAttributes().build()).put(EntityType.GUARDIAN, Guardian.createAttributes().build()).put(EntityType.HOGLIN, Hoglin.createAttributes().build()).put(EntityType.HORSE, AbstractHorse.createBaseHorseAttributes().build()).put(EntityType.HUSK, Zombie.createAttributes().build()).put(EntityType.ILLUSIONER, Illusioner.createAttributes().build()).put(EntityType.IRON_GOLEM, IronGolem.createAttributes().build()).put(EntityType.LLAMA, Llama.createAttributes().build()).put(EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build()).put(EntityType.MOOSHROOM, Cow.createAttributes().build()).put(EntityType.MULE, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.OCELOT, Ocelot.createAttributes().build()).put(EntityType.PANDA, Panda.createAttributes().build()).put(EntityType.PARROT, Parrot.createAttributes().build()).put(EntityType.PHANTOM, Monster.createMonsterAttributes().build()).put(EntityType.PIG, Pig.createAttributes().build()).put(EntityType.PIGLIN, Piglin.createAttributes().build()).put(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()).put(EntityType.PILLAGER, Pillager.createAttributes().build()).put(EntityType.PLAYER, Player.createAttributes().build()).put(EntityType.POLAR_BEAR, PolarBear.createAttributes().build()).put(EntityType.PUFFERFISH, AbstractFish.createAttributes().build()).put(EntityType.RABBIT, Rabbit.createAttributes().build()).put(EntityType.RAVAGER, Ravager.createAttributes().build()).put(EntityType.SALMON, AbstractFish.createAttributes().build()).put(EntityType.SHEEP, Sheep.createAttributes().build()).put(EntityType.SHULKER, Shulker.createAttributes().build()).put(EntityType.SILVERFISH, Silverfish.createAttributes().build()).put(EntityType.SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()).put(EntityType.SLIME, Monster.createMonsterAttributes().build()).put(EntityType.SNIFFER, Sniffer.createAttributes().build()).put(EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()).put(EntityType.SPIDER, Spider.createAttributes().build()).put(EntityType.SQUID, Squid.createAttributes().build()).put(EntityType.STRAY, AbstractSkeleton.createAttributes().build()).put(EntityType.STRIDER, Strider.createAttributes().build()).put(EntityType.TADPOLE, Tadpole.createAttributes().build()).put(EntityType.TRADER_LLAMA, Llama.createAttributes().build()).put(EntityType.TROPICAL_FISH, AbstractFish.createAttributes().build()).put(EntityType.TURTLE, Turtle.createAttributes().build()).put(EntityType.VEX, Vex.createAttributes().build()).put(EntityType.VILLAGER, Villager.createAttributes().build()).put(EntityType.VINDICATOR, Vindicator.createAttributes().build()).put(EntityType.WARDEN, Warden.createAttributes().build()).put(EntityType.WANDERING_TRADER, Mob.createMobAttributes().build()).put(EntityType.WITCH, Witch.createAttributes().build()).put(EntityType.WITHER, WitherBoss.createAttributes().build()).put(EntityType.WITHER_SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.WOLF, Wolf.createAttributes().build()).put(EntityType.ZOGLIN, Zoglin.createAttributes().build()).put(EntityType.ZOMBIE, Zombie.createAttributes().build()).put(EntityType.ZOMBIE_HORSE, ZombieHorse.createAttributes().build()).put(EntityType.ZOMBIE_VILLAGER, Zombie.createAttributes().build()).put(EntityType.ZOMBIFIED_PIGLIN, ZombifiedPiglin.createAttributes().build()).build(); +@@ -84,11 +_,12 @@ + private static final Map, AttributeSupplier> SUPPLIERS = ImmutableMap., AttributeSupplier>builder().put(EntityType.ALLAY, Allay.createAttributes().build()).put(EntityType.ARMOR_STAND, LivingEntity.createLivingAttributes().build()).put(EntityType.AXOLOTL, Axolotl.createAttributes().build()).put(EntityType.BAT, Bat.createAttributes().build()).put(EntityType.BEE, Bee.createAttributes().build()).put(EntityType.BLAZE, Blaze.createAttributes().build()).put(EntityType.CAT, Cat.createAttributes().build()).put(EntityType.CAMEL, Camel.createAttributes().build()).put(EntityType.CAVE_SPIDER, CaveSpider.createCaveSpider().build()).put(EntityType.CHICKEN, Chicken.createAttributes().build()).put(EntityType.COD, AbstractFish.createAttributes().build()).put(EntityType.COW, Cow.createAttributes().build()).put(EntityType.CREEPER, Creeper.createAttributes().build()).put(EntityType.DOLPHIN, Dolphin.createAttributes().build()).put(EntityType.DONKEY, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.DROWNED, Zombie.createAttributes().build()).put(EntityType.ELDER_GUARDIAN, ElderGuardian.createAttributes().build()).put(EntityType.ENDERMAN, EnderMan.createAttributes().build()).put(EntityType.ENDERMITE, Endermite.createAttributes().build()).put(EntityType.ENDER_DRAGON, EnderDragon.createAttributes().build()).put(EntityType.EVOKER, Evoker.createAttributes().build()).put(EntityType.BREEZE, Breeze.createAttributes().build()).put(EntityType.FOX, Fox.createAttributes().build()).put(EntityType.FROG, Frog.createAttributes().build()).put(EntityType.GHAST, Ghast.createAttributes().build()).put(EntityType.GIANT, Giant.createAttributes().build()).put(EntityType.GLOW_SQUID, GlowSquid.createAttributes().build()).put(EntityType.GOAT, Goat.createAttributes().build()).put(EntityType.GUARDIAN, Guardian.createAttributes().build()).put(EntityType.HOGLIN, Hoglin.createAttributes().build()).put(EntityType.HORSE, AbstractHorse.createBaseHorseAttributes().build()).put(EntityType.HUSK, Zombie.createAttributes().build()).put(EntityType.ILLUSIONER, Illusioner.createAttributes().build()).put(EntityType.IRON_GOLEM, IronGolem.createAttributes().build()).put(EntityType.LLAMA, Llama.createAttributes().build()).put(EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build()).put(EntityType.MOOSHROOM, Cow.createAttributes().build()).put(EntityType.MULE, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.OCELOT, Ocelot.createAttributes().build()).put(EntityType.PANDA, Panda.createAttributes().build()).put(EntityType.PARROT, Parrot.createAttributes().build()).put(EntityType.PHANTOM, Monster.createMonsterAttributes().build()).put(EntityType.PIG, Pig.createAttributes().build()).put(EntityType.PIGLIN, Piglin.createAttributes().build()).put(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()).put(EntityType.PILLAGER, Pillager.createAttributes().build()).put(EntityType.PLAYER, Player.createAttributes().build()).put(EntityType.POLAR_BEAR, PolarBear.createAttributes().build()).put(EntityType.PUFFERFISH, AbstractFish.createAttributes().build()).put(EntityType.RABBIT, Rabbit.createAttributes().build()).put(EntityType.RAVAGER, Ravager.createAttributes().build()).put(EntityType.SALMON, AbstractFish.createAttributes().build()).put(EntityType.SHEEP, Sheep.createAttributes().build()).put(EntityType.SHULKER, Shulker.createAttributes().build()).put(EntityType.SILVERFISH, Silverfish.createAttributes().build()).put(EntityType.SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()).put(EntityType.SLIME, Monster.createMonsterAttributes().build()).put(EntityType.SNIFFER, Sniffer.createAttributes().build()).put(EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()).put(EntityType.SPIDER, Spider.createAttributes().build()).put(EntityType.SQUID, Squid.createAttributes().build()).put(EntityType.STRAY, AbstractSkeleton.createAttributes().build()).put(EntityType.STRIDER, Strider.createAttributes().build()).put(EntityType.TADPOLE, Tadpole.createAttributes().build()).put(EntityType.TRADER_LLAMA, Llama.createAttributes().build()).put(EntityType.TROPICAL_FISH, AbstractFish.createAttributes().build()).put(EntityType.TURTLE, Turtle.createAttributes().build()).put(EntityType.VEX, Vex.createAttributes().build()).put(EntityType.VILLAGER, Villager.createAttributes().build()).put(EntityType.VINDICATOR, Vindicator.createAttributes().build()).put(EntityType.WARDEN, Warden.createAttributes().build()).put(EntityType.WANDERING_TRADER, Mob.createMobAttributes().build()).put(EntityType.WITCH, Witch.createAttributes().build()).put(EntityType.WITHER, WitherBoss.createAttributes().build()).put(EntityType.WITHER_SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.WOLF, Wolf.createAttributes().build()).put(EntityType.ZOGLIN, Zoglin.createAttributes().build()).put(EntityType.ZOMBIE, Zombie.createAttributes().build()).put(EntityType.ZOMBIE_HORSE, ZombieHorse.createAttributes().build()).put(EntityType.ZOMBIE_VILLAGER, Zombie.createAttributes().build()).put(EntityType.ZOMBIFIED_PIGLIN, ZombifiedPiglin.createAttributes().build()).build(); public static AttributeSupplier getSupplier(EntityType p_22298_) { - return SUPPLIERS.get(p_22298_); diff --git a/patches/minecraft/net/minecraft/world/entity/animal/Animal.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/Animal.java.patch index 8300932dc2..57fe4cf62d 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/Animal.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/Animal.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/Animal.java +++ b/net/minecraft/world/entity/animal/Animal.java -@@ -202,6 +_,17 @@ +@@ -203,6 +_,17 @@ public void spawnChildFromBreeding(ServerLevel p_27564_, Animal p_27565_) { AgeableMob ageablemob = this.getBreedOffspring(p_27564_, p_27565_); diff --git a/patches/minecraft/net/minecraft/world/entity/animal/Parrot.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/Parrot.java.patch index b66a54c1fe..5f6343c3c7 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/Parrot.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/Parrot.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/Parrot.java +++ b/net/minecraft/world/entity/animal/Parrot.java -@@ -246,7 +_,7 @@ +@@ -247,7 +_,7 @@ } if (!this.level().isClientSide) { diff --git a/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch b/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch index 08cee1f715..7544d25bda 100644 --- a/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/animal/horse/AbstractHorse.java.patch @@ -32,7 +32,7 @@ } if (this.isVehicle() && this.canGallop) { -@@ -787,6 +_,7 @@ +@@ -784,6 +_,7 @@ this.setDeltaMovement(vec3.x, d1, vec3.z); this.setIsJumping(true); this.hasImpulse = true; @@ -40,7 +40,7 @@ if (p_275435_.z > 0.0D) { float f = Mth.sin(this.getYRot() * ((float)Math.PI / 180F)); float f1 = Mth.cos(this.getYRot() * ((float)Math.PI / 180F)); -@@ -1109,6 +_,25 @@ +@@ -1106,6 +_,25 @@ this.randomizeAttributes(p_30555_.getRandom()); return super.finalizeSpawn(p_30555_, p_30556_, p_30557_, p_30558_, p_30559_); diff --git a/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch b/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch index de6bcb6d64..1bcca3241c 100644 --- a/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/item/ItemEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/item/ItemEntity.java +++ b/net/minecraft/world/entity/item/ItemEntity.java -@@ -42,6 +_,10 @@ +@@ -44,6 +_,10 @@ @Nullable private UUID target; public final float bobOffs; @@ -11,7 +11,7 @@ public ItemEntity(EntityType p_31991_, Level p_31992_) { super(p_31991_, p_31992_); -@@ -58,6 +_,7 @@ +@@ -60,6 +_,7 @@ this.setPos(p_149664_, p_149665_, p_149666_); this.setDeltaMovement(p_149668_, p_149669_, p_149670_); this.setItem(p_149667_); @@ -19,7 +19,7 @@ } private ItemEntity(ItemEntity p_31994_) { -@@ -66,6 +_,7 @@ +@@ -68,6 +_,7 @@ this.copyPosition(p_31994_); this.age = p_31994_.age; this.bobOffs = p_31994_.bobOffs; @@ -27,7 +27,7 @@ } public boolean dampensVibrations() { -@@ -94,6 +_,7 @@ +@@ -109,6 +_,7 @@ } public void tick() { @@ -35,7 +35,7 @@ if (this.getItem().isEmpty()) { this.discard(); } else { -@@ -107,6 +_,9 @@ +@@ -122,6 +_,9 @@ this.zo = this.getZ(); Vec3 vec3 = this.getDeltaMovement(); float f = this.getEyeHeight() - 0.11111111F; @@ -45,7 +45,7 @@ if (this.isInWater() && this.getFluidHeight(FluidTags.WATER) > (double)f) { this.setUnderwaterMovement(); } else if (this.isInLava() && this.getFluidHeight(FluidTags.LAVA) > (double)f) { -@@ -128,7 +_,8 @@ +@@ -143,7 +_,8 @@ this.move(MoverType.SELF, this.getDeltaMovement()); float f1 = 0.98F; if (this.onGround()) { @@ -55,7 +55,7 @@ } this.setDeltaMovement(this.getDeltaMovement().multiply((double)f1, 0.98D, (double)f1)); -@@ -158,7 +_,16 @@ +@@ -173,7 +_,16 @@ } } @@ -73,7 +73,7 @@ this.discard(); } -@@ -220,6 +_,8 @@ +@@ -235,6 +_,8 @@ return false; } else if (p_32028_.hasTag() ^ p_32027_.hasTag()) { return false; @@ -82,7 +82,7 @@ } else { return !p_32028_.hasTag() || p_32028_.getTag().equals(p_32027_.getTag()); } -@@ -265,7 +_,7 @@ +@@ -280,7 +_,7 @@ this.health = (int)((float)this.health - p_32014_); this.gameEvent(GameEvent.ENTITY_DAMAGE, p_32013_.getEntity()); if (this.health <= 0) { @@ -91,7 +91,7 @@ this.discard(); } -@@ -277,6 +_,7 @@ +@@ -292,6 +_,7 @@ p_32050_.putShort("Health", (short)this.health); p_32050_.putShort("Age", (short)this.age); p_32050_.putShort("PickupDelay", (short)this.pickupDelay); @@ -99,7 +99,7 @@ if (this.thrower != null) { p_32050_.putUUID("Thrower", this.thrower); } -@@ -297,6 +_,9 @@ +@@ -312,6 +_,9 @@ if (p_32034_.contains("PickupDelay")) { this.pickupDelay = p_32034_.getShort("PickupDelay"); } @@ -109,7 +109,7 @@ if (p_32034_.hasUUID("Owner")) { this.target = p_32034_.getUUID("Owner"); -@@ -316,10 +_,17 @@ +@@ -332,10 +_,17 @@ public void playerTouch(Player p_32040_) { if (!this.level().isClientSide) { @@ -128,7 +128,7 @@ p_32040_.take(this, i); if (itemstack.isEmpty()) { this.discard(); -@@ -343,8 +_,8 @@ +@@ -359,8 +_,8 @@ } @Nullable @@ -139,7 +139,7 @@ if (!this.level().isClientSide && entity instanceof ItemEntity) { ((ItemEntity)entity).mergeWithNeighbours(); } -@@ -410,7 +_,7 @@ +@@ -427,7 +_,7 @@ public void makeFakeItem() { this.setNeverPickUp(); diff --git a/patches/minecraft/net/minecraft/world/entity/monster/Evoker.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/Evoker.java.patch index 26221a1b89..d191b575e5 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/Evoker.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/Evoker.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/Evoker.java +++ b/net/minecraft/world/entity/monster/Evoker.java -@@ -279,7 +_,7 @@ +@@ -285,7 +_,7 @@ return false; } else if (Evoker.this.tickCount < this.nextAttackTickCount) { return false; diff --git a/patches/minecraft/net/minecraft/world/entity/monster/Slime.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/Slime.java.patch index 70199973c8..cda58f6ffa 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/Slime.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/Slime.java.patch @@ -9,7 +9,7 @@ for(int j = 0; j < i * 8; ++j) { float f = this.random.nextFloat() * ((float)Math.PI * 2F); float f1 = this.random.nextFloat() * 0.5F + 0.5F; -@@ -329,6 +_,12 @@ +@@ -337,6 +_,12 @@ public EntityDimensions getDimensions(Pose p_33597_) { return super.getDimensions(p_33597_).scale(0.255F * (float)this.getSize()); } diff --git a/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch index 5b9e5724e6..0a8c2f6dc5 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/piglin/StopHoldingItemIfNoLongerAdmiring.java.patch @@ -3,9 +3,9 @@ @@ -10,7 +_,7 @@ return BehaviorBuilder.create((p_259197_) -> { return p_259197_.group(p_259197_.absent(MemoryModuleType.ADMIRING_ITEM)).apply(p_259197_, (p_259512_) -> { - return (p_296847_, p_296848_, p_296849_) -> { -- if (!p_296848_.getOffhandItem().isEmpty() && !p_296848_.getOffhandItem().is(Items.SHIELD)) { -+ if (!p_296848_.getOffhandItem().isEmpty() && !p_296848_.getOffhandItem().canPerformAction(net.minecraftforge.common.ToolActions.SHIELD_BLOCK)) { - PiglinAi.stopHoldingOffHandItem(p_296848_, true); + return (p_309208_, p_309209_, p_309210_) -> { +- if (!p_309209_.getOffhandItem().isEmpty() && !p_309209_.getOffhandItem().is(Items.SHIELD)) { ++ if (!p_309209_.getOffhandItem().isEmpty() && !p_309209_.getOffhandItem().canPerformAction(net.minecraftforge.common.ToolActions.SHIELD_BLOCK)) { + PiglinAi.stopHoldingOffHandItem(p_309209_, true); return true; } else { diff --git a/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch b/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch index cd04282c62..6b2bc77e68 100644 --- a/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -114,7 +_,8 @@ +@@ -110,7 +_,8 @@ import net.minecraft.world.scores.Team; import org.slf4j.Logger; @@ -10,7 +10,7 @@ private static final Logger LOGGER = LogUtils.getLogger(); public static final int MAX_NAME_LENGTH = 16; public static final HumanoidArm DEFAULT_MAIN_HAND = HumanoidArm.RIGHT; -@@ -169,6 +_,9 @@ +@@ -164,6 +_,9 @@ @Nullable public FishingHook fishing; protected float hurtDir; @@ -20,7 +20,7 @@ public Player(Level p_250508_, BlockPos p_250289_, float p_251702_, GameProfile p_252153_) { super(EntityType.PLAYER, p_250508_); -@@ -194,7 +_,7 @@ +@@ -189,7 +_,7 @@ } public static AttributeSupplier.Builder createAttributes() { @@ -29,7 +29,7 @@ } protected void defineSynchedData() { -@@ -208,6 +_,7 @@ +@@ -203,6 +_,7 @@ } public void tick() { @@ -37,7 +37,7 @@ this.noPhysics = this.isSpectator(); if (this.isSpectator()) { this.setOnGround(false); -@@ -223,7 +_,7 @@ +@@ -218,7 +_,7 @@ this.sleepCounter = 100; } @@ -46,15 +46,15 @@ this.stopSleepInBed(false, true); } } else if (this.sleepCounter > 0) { -@@ -278,6 +_,7 @@ +@@ -273,6 +_,7 @@ this.turtleHelmetTick(); this.cooldowns.tick(); this.updatePlayerPose(); + net.minecraftforge.event.ForgeEventFactory.onPlayerPostTick(this); } - public boolean isSecondaryUseActive() { -@@ -353,6 +_,10 @@ + protected float getMaxHeadRotationRelativeToBody() { +@@ -352,6 +_,10 @@ } protected void updatePlayerPose() { @@ -65,7 +65,7 @@ if (this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.SWIMMING)) { Pose pose; if (this.isFallFlying()) { -@@ -577,6 +_,7 @@ +@@ -572,6 +_,7 @@ } public void die(DamageSource p_36152_) { @@ -73,7 +73,7 @@ super.die(p_36152_); this.reapplyPosition(); if (!this.isSpectator()) { -@@ -626,7 +_,7 @@ +@@ -621,7 +_,7 @@ @Nullable public ItemEntity drop(ItemStack p_36177_, boolean p_36178_) { @@ -82,7 +82,7 @@ } @Nullable -@@ -664,7 +_,12 @@ +@@ -659,7 +_,12 @@ } } @@ -95,7 +95,7 @@ float f = this.inventory.getDestroySpeed(p_36282_); if (f > 1.0F) { int i = EnchantmentHelper.getBlockEfficiency(this); -@@ -706,11 +_,12 @@ +@@ -701,11 +_,12 @@ f /= 5.0F; } @@ -109,7 +109,7 @@ } public void readAdditionalSaveData(CompoundTag p_36215_) { -@@ -796,6 +_,7 @@ +@@ -791,6 +_,7 @@ } public boolean hurt(DamageSource p_36154_, float p_36155_) { @@ -117,7 +117,7 @@ if (this.isInvulnerableTo(p_36154_)) { return false; } else if (this.abilities.invulnerable && !p_36154_.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { -@@ -830,7 +_,7 @@ +@@ -825,7 +_,7 @@ protected void blockUsingShield(LivingEntity p_36295_) { super.blockUsingShield(p_36295_); @@ -126,7 +126,7 @@ this.disableShield(true); } -@@ -859,7 +_,7 @@ +@@ -854,7 +_,7 @@ } protected void hurtCurrentlyUsedShield(float p_36383_) { @@ -135,7 +135,7 @@ if (!this.level().isClientSide) { this.awardStat(Stats.ITEM_USED.get(this.useItem.getItem())); } -@@ -869,6 +_,8 @@ +@@ -864,6 +_,8 @@ InteractionHand interactionhand = this.getUsedItemHand(); this.useItem.hurtAndBreak(i, this, (p_219739_) -> { p_219739_.broadcastBreakEvent(interactionhand); @@ -144,7 +144,7 @@ }); if (this.useItem.isEmpty()) { if (interactionhand == InteractionHand.MAIN_HAND) { -@@ -887,10 +_,13 @@ +@@ -882,10 +_,13 @@ protected void actuallyHurt(DamageSource p_36312_, float p_36313_) { if (!this.isInvulnerableTo(p_36312_)) { @@ -158,7 +158,7 @@ float f = p_36313_ - f1; if (f > 0.0F && f < 3.4028235E37F) { this.awardStat(Stats.DAMAGE_ABSORBED, Math.round(f * 10.0F)); -@@ -953,6 +_,8 @@ +@@ -948,6 +_,8 @@ return InteractionResult.PASS; } else { @@ -167,7 +167,7 @@ ItemStack itemstack = this.getItemInHand(p_36159_); ItemStack itemstack1 = itemstack.copy(); InteractionResult interactionresult = p_36158_.interact(this, p_36159_); -@@ -961,6 +_,9 @@ +@@ -956,6 +_,9 @@ itemstack.setCount(itemstack1.getCount()); } @@ -177,7 +177,7 @@ return interactionresult; } else { if (!itemstack.isEmpty() && p_36158_ instanceof LivingEntity) { -@@ -972,6 +_,7 @@ +@@ -967,6 +_,7 @@ if (interactionresult1.consumesAction()) { this.level().gameEvent(GameEvent.ENTITY_INTERACT, p_36158_.position(), GameEvent.Context.of(this)); if (itemstack.isEmpty() && !this.abilities.instabuild) { @@ -185,7 +185,7 @@ this.setItemInHand(p_36159_, ItemStack.EMPTY); } -@@ -1001,6 +_,7 @@ +@@ -996,6 +_,7 @@ return !this.abilities.flying; } @@ -193,7 +193,7 @@ protected Vec3 maybeBackOffFromEdge(Vec3 p_36201_, MoverType p_36202_) { if (!this.abilities.flying && p_36201_.y <= 0.0D && (p_36202_ == MoverType.SELF || p_36202_ == MoverType.PLAYER) && this.isStayingOnGroundSurface() && this.isAboveGround()) { double d0 = p_36201_.x; -@@ -1051,11 +_,13 @@ +@@ -1046,11 +_,13 @@ return p_36201_; } @@ -207,7 +207,7 @@ if (p_36347_.isAttackable()) { if (!p_36347_.skipAttackInteraction(this)) { float f = (float)this.getAttributeValue(Attributes.ATTACK_DAMAGE); -@@ -1069,11 +_,10 @@ +@@ -1064,11 +_,10 @@ float f2 = this.getAttackStrengthScale(0.5F); f *= 0.2F + f2 * f2 * 0.8F; f1 *= f2; @@ -220,7 +220,7 @@ i += EnchantmentHelper.getKnockbackBonus(this); if (this.isSprinting() && flag) { this.level().playSound((Player)null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); -@@ -1083,8 +_,10 @@ +@@ -1078,8 +_,10 @@ boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && p_36347_ instanceof LivingEntity; flag2 = flag2 && !this.isSprinting(); @@ -232,7 +232,7 @@ } f += f1; -@@ -1092,9 +_,7 @@ +@@ -1087,9 +_,7 @@ double d0 = (double)(this.walkDist - this.walkDistO); if (flag && !flag2 && !flag1 && this.onGround() && d0 < (double)this.getSpeed()) { ItemStack itemstack = this.getItemInHand(InteractionHand.MAIN_HAND); @@ -243,7 +243,7 @@ } float f4 = 0.0F; -@@ -1125,8 +_,9 @@ +@@ -1120,8 +_,9 @@ if (flag3) { float f3 = 1.0F + EnchantmentHelper.getSweepingDamageRatio(this) * f; @@ -255,7 +255,7 @@ livingentity.knockback((double)0.4F, (double)Mth.sin(this.getYRot() * ((float)Math.PI / 180F)), (double)(-Mth.cos(this.getYRot() * ((float)Math.PI / 180F)))); livingentity.hurt(this.damageSources().playerAttack(this), f3); } -@@ -1167,13 +_,15 @@ +@@ -1162,13 +_,15 @@ EnchantmentHelper.doPostDamageEffects(this, p_36347_); ItemStack itemstack1 = this.getMainHandItem(); Entity entity = p_36347_; @@ -273,7 +273,7 @@ this.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY); } } -@@ -1199,6 +_,7 @@ +@@ -1194,6 +_,7 @@ } } } @@ -281,7 +281,7 @@ } } -@@ -1215,7 +_,7 @@ +@@ -1210,7 +_,7 @@ } if (this.random.nextFloat() < f) { @@ -290,7 +290,7 @@ this.stopUsingItem(); this.level().broadcastEntityEvent(this, (byte)30); } -@@ -1279,6 +_,7 @@ +@@ -1274,6 +_,7 @@ } public void stopSleepInBed(boolean p_36226_, boolean p_36227_) { @@ -298,7 +298,7 @@ super.stopSleeping(); if (this.level() instanceof ServerLevel && p_36227_) { ((ServerLevel)this.level()).updateSleepingPlayerList(); -@@ -1304,7 +_,7 @@ +@@ -1299,7 +_,7 @@ } else if (block instanceof BedBlock && BedBlock.canSetSpawn(p_36131_)) { return BedBlock.findStandUpPosition(EntityType.PLAYER, p_36131_, p_36132_, blockstate.getValue(BedBlock.FACING), p_36133_); } else if (!p_36134_) { @@ -307,7 +307,7 @@ } else { boolean flag = block.isPossibleToRespawnInThis(blockstate); BlockState blockstate1 = p_36131_.getBlockState(p_36132_.above()); -@@ -1485,6 +_,7 @@ +@@ -1404,6 +_,7 @@ public boolean causeFallDamage(float p_150093_, float p_150094_, DamageSource p_150095_) { if (this.abilities.mayfly) { @@ -315,7 +315,7 @@ return false; } else { if (p_150093_ >= 2.0F) { -@@ -1498,7 +_,7 @@ +@@ -1417,7 +_,7 @@ public boolean tryToStartFallFlying() { if (!this.onGround() && !this.isFallFlying() && !this.isInWater() && !this.hasEffect(MobEffects.LEVITATION)) { ItemStack itemstack = this.getItemBySlot(EquipmentSlot.CHEST); @@ -324,7 +324,7 @@ this.startFallFlying(); return true; } -@@ -1526,13 +_,13 @@ +@@ -1445,13 +_,13 @@ protected void playStepSound(BlockPos p_282121_, BlockState p_282194_) { if (this.isInWater()) { this.waterSwimSound(); @@ -340,7 +340,7 @@ } else { super.playStepSound(blockpos, blockstate); } -@@ -1560,6 +_,10 @@ +@@ -1479,6 +_,10 @@ } public void giveExperiencePoints(int p_36291_) { @@ -351,7 +351,7 @@ this.increaseScore(p_36291_); this.experienceProgress += (float)p_36291_ / (float)this.getXpNeededForNextLevel(); this.totalExperience = Mth.clamp(this.totalExperience + p_36291_, 0, Integer.MAX_VALUE); -@@ -1588,7 +_,7 @@ +@@ -1507,7 +_,7 @@ } public void onEnchantmentPerformed(ItemStack p_36172_, int p_36173_) { @@ -360,7 +360,7 @@ if (this.experienceLevel < 0) { this.experienceLevel = 0; this.experienceProgress = 0.0F; -@@ -1599,6 +_,10 @@ +@@ -1518,6 +_,10 @@ } public void giveExperienceLevels(int p_36276_) { @@ -371,7 +371,7 @@ this.experienceLevel += p_36276_; if (this.experienceLevel < 0) { this.experienceLevel = 0; -@@ -1794,7 +_,11 @@ +@@ -1713,7 +_,11 @@ } public Component getDisplayName() { @@ -384,7 +384,7 @@ return this.decorateDisplayNameComponent(mutablecomponent); } -@@ -1927,24 +_,24 @@ +@@ -1846,24 +_,24 @@ Predicate predicate = ((ProjectileWeaponItem)p_36349_.getItem()).getSupportedHeldProjectiles(); ItemStack itemstack = ProjectileWeaponItem.getHeldProjectile(this, predicate); if (!itemstack.isEmpty()) { @@ -413,7 +413,7 @@ this.awardStat(Stats.ITEM_USED.get(p_36186_.getItem())); p_36185_.playSound((Player)null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, p_36185_.random.nextFloat() * 0.1F + 0.9F); if (this instanceof ServerPlayer) { -@@ -2052,5 +_,63 @@ +@@ -1981,5 +_,63 @@ public Component getMessage() { return this.message; } diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/AbstractArrow.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/AbstractArrow.java.patch index 6aeac6d13e..ff3a56c4e7 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/AbstractArrow.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/AbstractArrow.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -66,6 +_,8 @@ - @Nullable +@@ -68,6 +_,8 @@ private List piercedAndKilledEntities; + private ItemStack pickupItemStack; + private final IntOpenHashSet ignoredEntities = new IntOpenHashSet(); + - protected AbstractArrow(EntityType p_36721_, Level p_36722_) { - super(p_36721_, p_36722_); - } -@@ -150,7 +_,7 @@ + protected AbstractArrow(EntityType p_36717_, Level p_36719_, ItemStack p_312639_) { + super(p_36717_, p_36719_); + this.pickupItemStack = p_312639_.copy(); +@@ -157,7 +_,7 @@ --this.shakeTime; } @@ -18,7 +18,7 @@ this.clearFire(); } -@@ -186,9 +_,28 @@ +@@ -193,9 +_,28 @@ } } @@ -50,7 +50,7 @@ } if (entityhitresult == null || this.getPierceLevel() <= 0) { -@@ -198,6 +_,9 @@ +@@ -205,6 +_,9 @@ hitresult = null; } @@ -60,7 +60,7 @@ vec3 = this.getDeltaMovement(); double d5 = vec3.x; double d6 = vec3.y; -@@ -422,7 +_,7 @@ +@@ -439,7 +_,7 @@ } protected boolean canHitEntity(Entity p_36743_) { diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java.patch index 6808d3f68e..7a38600e8c 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java +++ b/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java -@@ -65,7 +_,7 @@ +@@ -76,7 +_,7 @@ } - HitResult hitresult = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity); + HitResult hitresult = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType()); - if (hitresult.getType() != HitResult.Type.MISS) { + if (hitresult.getType() != HitResult.Type.MISS && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, hitresult)) { this.onHit(hitresult); diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch index 0d5b618738..ba17b28441 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/Projectile.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/Projectile.java +++ b/net/minecraft/world/entity/projectile/Projectile.java -@@ -214,7 +_,7 @@ +@@ -229,7 +_,7 @@ if (entity instanceof Player) { return entity.mayInteract(p_150167_, p_150168_); } else { @@ -8,4 +8,4 @@ + return entity == null || net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(p_150167_, entity); } } - } + diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/ProjectileUtil.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/ProjectileUtil.java.patch index 2db7d52532..62aa22700e 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/ProjectileUtil.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/ProjectileUtil.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/ProjectileUtil.java +++ b/net/minecraft/world/entity/projectile/ProjectileUtil.java -@@ -68,7 +_,7 @@ +@@ -77,7 +_,7 @@ Vec3 vec31 = optional.get(); double d1 = p_37289_.distanceToSqr(vec31); if (d1 < d0 || d0 == 0.0D) { @@ -9,7 +9,7 @@ if (d0 == 0.0D) { entity = entity1; vec3 = vec31; -@@ -138,8 +_,13 @@ +@@ -147,8 +_,13 @@ } } diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch index 672ffa5082..336111901c 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/ThrownEnderpearl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java +++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java -@@ -45,6 +_,8 @@ +@@ -48,6 +_,8 @@ if (entity instanceof ServerPlayer) { ServerPlayer serverplayer = (ServerPlayer)entity; if (serverplayer.connection.isAcceptingMessages() && serverplayer.level() == this.level() && !serverplayer.isSleeping()) { @@ -9,19 +9,20 @@ if (this.random.nextFloat() < 0.05F && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) { Endermite endermite = EntityType.ENDERMITE.create(this.level()); if (endermite != null) { -@@ -59,8 +_,10 @@ +@@ -62,9 +_,11 @@ entity.teleportTo(this.getX(), this.getY(), this.getZ()); } + entity.teleportTo(event.getTargetX(), event.getTargetY(), event.getTargetZ()); entity.resetFallDistance(); - entity.hurt(this.damageSources().fall(), 5.0F); + this.level().playSound((Player)null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_TELEPORT, SoundSource.PLAYERS); + entity.hurt(this.damageSources().fall(), event.getAttackDamage()); + } //Forge: End } } else if (entity != null) { entity.teleportTo(this.getX(), this.getY(), this.getZ()); -@@ -83,12 +_,12 @@ +@@ -87,12 +_,12 @@ } @Nullable diff --git a/patches/minecraft/net/minecraft/world/entity/projectile/WitherSkull.java.patch b/patches/minecraft/net/minecraft/world/entity/projectile/WitherSkull.java.patch index bb2bac637f..8e9f3c05c1 100644 --- a/patches/minecraft/net/minecraft/world/entity/projectile/WitherSkull.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/projectile/WitherSkull.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/WitherSkull.java +++ b/net/minecraft/world/entity/projectile/WitherSkull.java -@@ -40,7 +_,7 @@ +@@ -41,7 +_,7 @@ } public float getBlockExplosionResistance(Explosion p_37619_, BlockGetter p_37620_, BlockPos p_37621_, BlockState p_37622_, FluidState p_37623_, float p_37624_) { diff --git a/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch b/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch index 59439271b5..0325d1b3ac 100644 --- a/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/net/minecraft/world/entity/vehicle/AbstractMinecart.java -@@ -48,7 +_,7 @@ +@@ -46,7 +_,7 @@ import net.minecraft.world.phys.Vec3; import org.joml.Vector3f; --public abstract class AbstractMinecart extends Entity { -+public abstract class AbstractMinecart extends Entity implements net.minecraftforge.common.extensions.IForgeAbstractMinecart { +-public abstract class AbstractMinecart extends VehicleEntity { ++public abstract class AbstractMinecart extends VehicleEntity implements net.minecraftforge.common.extensions.IForgeAbstractMinecart { private static final float LOWERED_PASSENGER_ATTACHMENT_Y = 0.0F; private static final float PASSENGER_ATTACHMENT_Y = 0.1875F; - private static final EntityDataAccessor DATA_ID_HURT = SynchedEntityData.defineId(AbstractMinecart.class, EntityDataSerializers.INT); -@@ -88,6 +_,8 @@ + private static final EntityDataAccessor DATA_ID_DISPLAY_BLOCK = SynchedEntityData.defineId(AbstractMinecart.class, EntityDataSerializers.INT); +@@ -83,6 +_,8 @@ p_38135_.put(RailShape.NORTH_WEST, Pair.of(vec3i2, vec3i)); p_38135_.put(RailShape.NORTH_EAST, Pair.of(vec3i2, vec3i1)); }); @@ -18,7 +18,7 @@ protected AbstractMinecart(EntityType p_38087_, Level p_38088_) { super(p_38087_, p_38088_); -@@ -102,6 +_,14 @@ +@@ -97,6 +_,14 @@ this.zo = p_38094_; } @@ -30,10 +30,10 @@ + COLLISIONS = handler; + } + - public static AbstractMinecart createMinecart(Level p_38120_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_) { - if (p_38124_ == AbstractMinecart.Type.CHEST) { - return new MinecartChest(p_38120_, p_38121_, p_38122_, p_38123_); -@@ -136,7 +_,7 @@ + public static AbstractMinecart createMinecart(ServerLevel p_310486_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_, ItemStack p_311363_, @Nullable Player p_310754_) { + Object object; + switch (p_38124_) { +@@ -143,7 +_,7 @@ } public boolean isPushable() { @@ -42,7 +42,7 @@ } protected Vec3 getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) { -@@ -300,9 +_,9 @@ +@@ -265,9 +_,9 @@ BlockPos blockpos = new BlockPos(k, i, j); BlockState blockstate = this.level().getBlockState(blockpos); this.onRails = BaseRailBlock.isRail(blockstate); @@ -54,7 +54,7 @@ this.activateMinecart(k, i, j, blockstate.getValue(PoweredRailBlock.POWERED)); } } else { -@@ -327,8 +_,11 @@ +@@ -292,8 +_,11 @@ } this.setRot(this.getYRot(), this.getXRot()); @@ -68,7 +68,7 @@ if (!list.isEmpty()) { for(Entity entity1 : list) { if (!(entity1 instanceof Player) && !(entity1 instanceof IronGolem) && !(entity1 instanceof AbstractMinecart) && !this.isVehicle() && !entity1.isPassenger()) { -@@ -339,7 +_,7 @@ +@@ -304,7 +_,7 @@ } } } else { @@ -77,7 +77,7 @@ if (!this.hasPassenger(entity) && entity.isPushable() && entity instanceof AbstractMinecart) { entity.push(this); } -@@ -364,16 +_,23 @@ +@@ -329,16 +_,23 @@ } protected void comeOffTrack() { @@ -103,7 +103,7 @@ } } -@@ -387,18 +_,19 @@ +@@ -352,18 +_,19 @@ d1 = (double)p_38156_.getY(); boolean flag = false; boolean flag1 = false; @@ -126,7 +126,7 @@ switch (railshape) { case ASCENDING_EAST: this.setDeltaMovement(vec31.add(-d3, 0.0D, 0.0D)); -@@ -444,7 +_,7 @@ +@@ -409,7 +_,7 @@ } } @@ -135,7 +135,7 @@ double d22 = this.getDeltaMovement().horizontalDistance(); if (d22 < 0.03D) { this.setDeltaMovement(Vec3.ZERO); -@@ -473,10 +_,7 @@ +@@ -438,10 +_,7 @@ d0 = d23 + d4 * d14; d2 = d10 + d5 * d14; this.setPos(d0, d1, d2); @@ -147,7 +147,7 @@ if (vec3i.getY() != 0 && Mth.floor(this.getX()) - p_38156_.getX() == vec3i.getX() && Mth.floor(this.getZ()) - p_38156_.getZ() == vec3i.getZ()) { this.setPos(this.getX(), this.getY() + (double)vec3i.getY(), this.getZ()); } else if (vec3i1.getY() != 0 && Mth.floor(this.getX()) - p_38156_.getX() == vec3i1.getX() && Mth.floor(this.getZ()) - p_38156_.getZ() == vec3i1.getZ()) { -@@ -504,7 +_,10 @@ +@@ -469,7 +_,10 @@ this.setDeltaMovement(d26 * (double)(j - p_38156_.getX()), vec35.y, d26 * (double)(i - p_38156_.getZ())); } @@ -159,7 +159,7 @@ Vec3 vec36 = this.getDeltaMovement(); double d27 = vec36.horizontalDistance(); if (d27 > 0.01D) { -@@ -568,7 +_,7 @@ +@@ -533,7 +_,7 @@ BlockState blockstate = this.level().getBlockState(new BlockPos(i, j, k)); if (BaseRailBlock.isRail(blockstate)) { @@ -168,7 +168,7 @@ p_38098_ = (double)j; if (railshape.isAscending()) { p_38098_ = (double)(j + 1); -@@ -607,7 +_,7 @@ +@@ -572,7 +_,7 @@ BlockState blockstate = this.level().getBlockState(new BlockPos(i, j, k)); if (BaseRailBlock.isRail(blockstate)) { @@ -177,7 +177,7 @@ Pair pair = exits(railshape); Vec3i vec3i = pair.getFirst(); Vec3i vec3i1 = pair.getSecond(); -@@ -669,6 +_,10 @@ +@@ -634,6 +_,10 @@ } public void push(Entity p_38165_) { @@ -188,7 +188,7 @@ if (!this.level().isClientSide) { if (!p_38165_.noPhysics && !this.noPhysics) { if (!this.hasPassenger(p_38165_)) { -@@ -702,11 +_,11 @@ +@@ -667,11 +_,11 @@ Vec3 vec32 = this.getDeltaMovement(); Vec3 vec33 = p_38165_.getDeltaMovement(); @@ -202,7 +202,7 @@ p_38165_.setDeltaMovement(vec33.multiply(0.2D, 1.0D, 0.2D)); p_38165_.push(vec32.x + d0, 0.0D, vec32.z + d1); this.setDeltaMovement(vec32.multiply(0.95D, 1.0D, 0.95D)); -@@ -823,6 +_,42 @@ +@@ -764,6 +_,42 @@ public void setCustomDisplay(boolean p_38139_) { this.getEntityData().set(DATA_ID_CUSTOM_DISPLAY, p_38139_); } diff --git a/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch b/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch index 94dfe0cb60..11b0a10397 100644 --- a/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/vehicle/Boat.java.patch @@ -4,12 +4,12 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.joml.Vector3f; --public class Boat extends Entity implements VariantHolder { -+public class Boat extends Entity implements net.minecraftforge.common.extensions.IForgeBoat { - private static final EntityDataAccessor DATA_ID_HURT = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.INT); - private static final EntityDataAccessor DATA_ID_HURTDIR = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.INT); - private static final EntityDataAccessor DATA_ID_DAMAGE = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.FLOAT); -@@ -483,7 +_,7 @@ +-public class Boat extends VehicleEntity implements VariantHolder { ++public class Boat extends VehicleEntity implements net.minecraftforge.common.extensions.IForgeBoat { + private static final EntityDataAccessor DATA_ID_TYPE = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.INT); + private static final EntityDataAccessor DATA_ID_PADDLE_LEFT = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.BOOLEAN); + private static final EntityDataAccessor DATA_ID_PADDLE_RIGHT = SynchedEntityData.defineId(Boat.class, EntityDataSerializers.BOOLEAN); +@@ -450,7 +_,7 @@ for(int i2 = i1; i2 < j1; ++i2) { blockpos$mutableblockpos.set(l1, k1, i2); FluidState fluidstate = this.level().getFluidState(blockpos$mutableblockpos); @@ -18,7 +18,7 @@ f = Math.max(f, fluidstate.getHeight(this.level(), blockpos$mutableblockpos)); } -@@ -524,7 +_,7 @@ +@@ -491,7 +_,7 @@ blockpos$mutableblockpos.set(l1, k2, i2); BlockState blockstate = this.level().getBlockState(blockpos$mutableblockpos); if (!(blockstate.getBlock() instanceof WaterlilyBlock) && Shapes.joinIsNotEmpty(blockstate.getCollisionShape(this.level(), blockpos$mutableblockpos).move((double)l1, (double)k2, (double)i2), voxelshape, BooleanOp.AND)) { @@ -27,7 +27,7 @@ ++k1; } } -@@ -553,7 +_,7 @@ +@@ -520,7 +_,7 @@ for(int i2 = i1; i2 < j1; ++i2) { blockpos$mutableblockpos.set(k1, l1, i2); FluidState fluidstate = this.level().getFluidState(blockpos$mutableblockpos); @@ -36,7 +36,7 @@ float f = (float)l1 + fluidstate.getHeight(this.level(), blockpos$mutableblockpos); this.waterLevel = Math.max((double)f, this.waterLevel); flag |= aabb.minY < (double)f; -@@ -583,7 +_,7 @@ +@@ -550,7 +_,7 @@ for(int i2 = i1; i2 < j1; ++i2) { blockpos$mutableblockpos.set(k1, l1, i2); FluidState fluidstate = this.level().getFluidState(blockpos$mutableblockpos); @@ -45,7 +45,7 @@ if (!fluidstate.isSource()) { return Boat.Status.UNDER_FLOWING_WATER; } -@@ -783,7 +_,7 @@ +@@ -752,7 +_,7 @@ } this.resetFallDistance(); @@ -54,7 +54,7 @@ this.fallDistance -= (float)p_38307_; } -@@ -839,7 +_,7 @@ +@@ -784,7 +_,7 @@ } protected boolean canAddPassenger(Entity p_38390_) { @@ -63,7 +63,7 @@ } protected int getMaxPassengers() { -@@ -872,6 +_,16 @@ +@@ -817,6 +_,16 @@ public boolean isUnderWater() { return this.status == Boat.Status.UNDER_WATER || this.status == Boat.Status.UNDER_FLOWING_WATER; diff --git a/patches/minecraft/net/minecraft/world/inventory/BrewingStandMenu.java.patch b/patches/minecraft/net/minecraft/world/inventory/BrewingStandMenu.java.patch index 36333f88ba..d9b267fabd 100644 --- a/patches/minecraft/net/minecraft/world/inventory/BrewingStandMenu.java.patch +++ b/patches/minecraft/net/minecraft/world/inventory/BrewingStandMenu.java.patch @@ -23,7 +23,7 @@ Potion potion = PotionUtils.getPotion(p_150500_); if (p_150499_ instanceof ServerPlayer) { + net.minecraftforge.event.ForgeEventFactory.onPlayerBrewedPotion(p_150499_, p_150500_); - CriteriaTriggers.BREWED_POTION.trigger((ServerPlayer)p_150499_, potion); + CriteriaTriggers.BREWED_POTION.trigger((ServerPlayer)p_150499_, potion.builtInRegistryHolder()); } @@ -177,7 +_,7 @@ diff --git a/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch b/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch index 0928db0eac..3405666edb 100644 --- a/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch +++ b/patches/minecraft/net/minecraft/world/inventory/MenuType.java.patch @@ -9,7 +9,7 @@ public static final MenuType GENERIC_9x1 = register("generic_9x1", ChestMenu::oneRow); public static final MenuType GENERIC_9x2 = register("generic_9x2", ChestMenu::twoRows); public static final MenuType GENERIC_9x3 = register("generic_9x3", ChestMenu::threeRows); -@@ -53,6 +_,14 @@ +@@ -54,6 +_,14 @@ public T create(int p_39986_, Inventory p_39987_) { return this.constructor.create(p_39986_, p_39987_); diff --git a/patches/minecraft/net/minecraft/world/item/AxeItem.java.patch b/patches/minecraft/net/minecraft/world/item/AxeItem.java.patch index 7e8e1661ba..d3a9bed7b2 100644 --- a/patches/minecraft/net/minecraft/world/item/AxeItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/AxeItem.java.patch @@ -1,21 +1,16 @@ --- a/net/minecraft/world/item/AxeItem.java +++ b/net/minecraft/world/item/AxeItem.java -@@ -32,11 +_,9 @@ +@@ -32,7 +_,8 @@ + Level level = p_40529_.getLevel(); BlockPos blockpos = p_40529_.getClickedPos(); Player player = p_40529_.getPlayer(); - BlockState blockstate = level.getBlockState(blockpos); -- Optional optional = this.getStripped(blockstate); -- Optional optional1 = WeatheringCopper.getPrevious(blockstate); -- Optional optional2 = Optional.ofNullable(HoneycombItem.WAX_OFF_BY_BLOCK.get().get(blockstate.getBlock())).map((p_150694_) -> { -- return p_150694_.withPropertiesOf(blockstate); -- }); -+ Optional optional = Optional.ofNullable(blockstate.getToolModifiedState(p_40529_, net.minecraftforge.common.ToolActions.AXE_STRIP, false)); -+ Optional optional1 = optional.isPresent() ? Optional.empty() : Optional.ofNullable(blockstate.getToolModifiedState(p_40529_, net.minecraftforge.common.ToolActions.AXE_SCRAPE, false)); -+ Optional optional2 = optional.isPresent() || optional1.isPresent() ? Optional.empty() : Optional.ofNullable(blockstate.getToolModifiedState(p_40529_, net.minecraftforge.common.ToolActions.AXE_WAX_OFF, false)); - ItemStack itemstack = p_40529_.getItemInHand(); - Optional optional3 = Optional.empty(); - if (optional.isPresent()) { -@@ -71,9 +_,20 @@ +- Optional optional = this.evaluateNewBlockState(level, blockpos, player, level.getBlockState(blockpos)); ++ var modded = level.getBlockState(blockpos).getToolModifiedState(p_40529_, net.minecraftforge.common.ToolActions.AXE_STRIP, false); ++ Optional optional = modded != null ? Optional.of(modded) : this.evaluateNewBlockState(level, blockpos, player, level.getBlockState(blockpos)); + if (optional.isEmpty()) { + return InteractionResult.PASS; + } else { +@@ -79,9 +_,20 @@ } } diff --git a/patches/minecraft/net/minecraft/world/item/ChorusFruitItem.java.patch b/patches/minecraft/net/minecraft/world/item/ChorusFruitItem.java.patch index c47b6ed754..7a8ce3401f 100644 --- a/patches/minecraft/net/minecraft/world/item/ChorusFruitItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/ChorusFruitItem.java.patch @@ -1,14 +1,13 @@ --- a/net/minecraft/world/item/ChorusFruitItem.java +++ b/net/minecraft/world/item/ChorusFruitItem.java -@@ -33,8 +_,10 @@ +@@ -29,7 +_,9 @@ } Vec3 vec3 = p_40714_.position(); -- if (p_40714_.randomTeleport(d3, d4, d5, true)) { - p_40713_.gameEvent(GameEvent.TELEPORT, vec3, GameEvent.Context.of(p_40714_)); -+ net.minecraftforge.event.entity.EntityTeleportEvent.ChorusFruit event = net.minecraftforge.event.ForgeEventFactory.onChorusFruitTeleport(p_40714_, d3, d4, d5); +- if (p_40714_.randomTeleport(d0, d1, d2, true)) { ++ var event = net.minecraftforge.event.ForgeEventFactory.onChorusFruitTeleport(p_40714_, d0, d1, d2); + if (event.isCanceled()) return itemstack; + if (p_40714_.randomTeleport(event.getTargetX(), event.getTargetY(), event.getTargetZ(), true)) { - SoundEvent soundevent = p_40714_ instanceof Fox ? SoundEvents.FOX_TELEPORT : SoundEvents.CHORUS_FRUIT_TELEPORT; - p_40713_.playSound((Player)null, d0, d1, d2, soundevent, SoundSource.PLAYERS, 1.0F, 1.0F); - p_40714_.playSound(soundevent, 1.0F, 1.0F); + p_40713_.gameEvent(GameEvent.TELEPORT, vec3, GameEvent.Context.of(p_40714_)); + SoundSource soundsource; + SoundEvent soundevent; diff --git a/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch b/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch index 0054e1461c..4b57e23182 100644 --- a/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch +++ b/patches/minecraft/net/minecraft/world/item/CreativeModeTabs.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/CreativeModeTabs.java +++ b/net/minecraft/world/item/CreativeModeTabs.java -@@ -1612,7 +_,7 @@ +@@ -1679,7 +_,7 @@ private static void generateEnchantmentBookTypesOnlyMaxLevel(CreativeModeTab.Output p_270868_, HolderLookup p_270903_, Set p_270380_, CreativeModeTab.TabVisibility p_270407_) { p_270903_.listElements().map(Holder::value).filter((p_270008_) -> { @@ -9,7 +9,7 @@ }).map((p_270038_) -> { return EnchantedBookItem.createForEnchantment(new EnchantmentInstance(p_270038_, p_270038_.getMaxLevel())); }).forEach((p_269989_) -> { -@@ -1622,7 +_,7 @@ +@@ -1689,7 +_,7 @@ private static void generateEnchantmentBookTypesAllLevels(CreativeModeTab.Output p_270961_, HolderLookup p_270628_, Set p_271024_, CreativeModeTab.TabVisibility p_270805_) { p_270628_.listElements().map(Holder::value).filter((p_269991_) -> { diff --git a/patches/minecraft/net/minecraft/world/item/Item.java.patch b/patches/minecraft/net/minecraft/world/item/Item.java.patch index 6025699d9f..6838929120 100644 --- a/patches/minecraft/net/minecraft/world/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/world/item/Item.java.patch @@ -85,7 +85,7 @@ public boolean hasCraftingRemainingItem() { return this.craftingRemainingItem != null; } -@@ -253,7 +_,7 @@ +@@ -257,7 +_,7 @@ public int getUseDuration(ItemStack p_41454_) { if (p_41454_.getItem().isEdible()) { @@ -94,7 +94,7 @@ } else { return 0; } -@@ -295,7 +_,7 @@ +@@ -299,7 +_,7 @@ } public boolean isEnchantable(ItemStack p_41456_) { @@ -103,7 +103,7 @@ } protected static BlockHitResult getPlayerPOVHitResult(Level p_41436_, Player p_41437_, ClipContext.Fluid p_41438_) { -@@ -308,11 +_,13 @@ +@@ -312,11 +_,13 @@ float f5 = Mth.sin(-f * ((float)Math.PI / 180F)); float f6 = f3 * f4; float f7 = f2 * f4; @@ -119,7 +119,7 @@ public int getEnchantmentValue() { return 0; } -@@ -321,12 +_,20 @@ +@@ -325,12 +_,20 @@ return false; } @@ -141,7 +141,7 @@ } public ItemStack getDefaultInstance() { -@@ -337,6 +_,8 @@ +@@ -341,6 +_,8 @@ return this.foodProperties != null; } @@ -150,7 +150,7 @@ @Nullable public FoodProperties getFoodProperties() { return this.foodProperties; -@@ -366,6 +_,32 @@ +@@ -370,6 +_,32 @@ return this.requiredFeatures; } @@ -183,7 +183,7 @@ public static class Properties { int maxStackSize = 64; int maxDamage; -@@ -376,6 +_,7 @@ +@@ -380,6 +_,7 @@ FoodProperties foodProperties; boolean isFireResistant; FeatureFlagSet requiredFeatures = FeatureFlags.VANILLA_SET; @@ -191,7 +191,7 @@ public Item.Properties food(FoodProperties p_41490_) { this.foodProperties = p_41490_; -@@ -413,6 +_,11 @@ +@@ -417,6 +_,11 @@ public Item.Properties fireResistant() { this.isFireResistant = true; diff --git a/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch index bf6472d050..85dc28c265 100644 --- a/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch @@ -1,24 +1,24 @@ --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java -@@ -76,12 +_,16 @@ +@@ -80,12 +_,16 @@ import net.minecraft.world.level.block.state.pattern.BlockInWorld; import org.slf4j.Logger; -public final class ItemStack { +public final class ItemStack extends net.minecraftforge.common.capabilities.CapabilityProvider implements net.minecraftforge.common.extensions.IForgeItemStack { - public static final Codec CODEC = RecordCodecBuilder.create((p_258963_) -> { - return p_258963_.group(BuiltInRegistries.ITEM.byNameCodec().fieldOf("id").forGetter(ItemStack::getItem), Codec.INT.fieldOf("Count").forGetter(ItemStack::getCount), CompoundTag.CODEC.optionalFieldOf("tag").forGetter((p_281115_) -> { + public static final Codec CODEC = RecordCodecBuilder.create((p_309238_) -> { + return p_309238_.group(BuiltInRegistries.ITEM.holderByNameCodec().fieldOf("id").forGetter(ItemStack::getItemHolder), Codec.INT.fieldOf("Count").forGetter(ItemStack::getCount), CompoundTag.CODEC.optionalFieldOf("tag").forGetter((p_281115_) -> { return Optional.ofNullable(p_281115_.getTag()); - })).apply(p_258963_, ItemStack::new); + })).apply(p_309238_, ItemStack::new); }); + @org.jetbrains.annotations.Nullable + private final net.minecraft.core.Holder.Reference delegate; + private CompoundTag capNBT; + - private static final Logger LOGGER = LogUtils.getLogger(); - public static final ItemStack EMPTY = new ItemStack((Void)null); - public static final DecimalFormat ATTRIBUTE_MODIFIER_FORMAT = Util.make(new DecimalFormat("#.##"), (p_41704_) -> { -@@ -137,28 +_,40 @@ + private static final Codec ITEM_NON_AIR_CODEC = ExtraCodecs.validate(BuiltInRegistries.ITEM.byNameCodec(), (p_309237_) -> { + return p_309237_ == Items.AIR ? DataResult.error(() -> { + return "Item must not be minecraft:air"; +@@ -160,28 +_,40 @@ this(p_220155_.value(), p_220156_); } @@ -54,7 +54,7 @@ + this.delegate = net.minecraftforge.registries.ForgeRegistries.ITEMS.getDelegateOrThrow(rawItem); this.count = p_41608_.getByte("Count"); if (p_41608_.contains("tag", 10)) { - this.tag = p_41608_.getCompound("tag"); + this.tag = p_41608_.getCompound("tag").copy(); this.getItem().verifyTagAfterLoad(this.tag); } + this.forgeInit(); @@ -64,7 +64,7 @@ this.setDamageValue(this.getDamageValue()); } -@@ -174,7 +_,7 @@ +@@ -197,7 +_,7 @@ } public boolean isEmpty() { @@ -73,7 +73,7 @@ } public boolean isItemEnabled(FeatureFlagSet p_250869_) { -@@ -199,7 +_,7 @@ +@@ -222,7 +_,7 @@ } public Item getItem() { @@ -82,7 +82,7 @@ } public Holder getItemHolder() { -@@ -231,6 +_,15 @@ +@@ -254,6 +_,15 @@ } public InteractionResult useOn(UseOnContext p_41662_) { @@ -98,7 +98,7 @@ Player player = p_41662_.getPlayer(); BlockPos blockpos = p_41662_.getClickedPos(); BlockInWorld blockinworld = new BlockInWorld(p_41662_.getLevel(), blockpos, false); -@@ -238,7 +_,7 @@ +@@ -261,7 +_,7 @@ return InteractionResult.PASS; } else { Item item = this.getItem(); @@ -107,7 +107,7 @@ if (player != null && interactionresult.shouldAwardStats()) { player.awardStat(Stats.ITEM_USED.get(item)); } -@@ -267,11 +_,15 @@ +@@ -290,11 +_,15 @@ p_41740_.put("tag", this.tag.copy()); } @@ -124,7 +124,7 @@ } public boolean isStackable() { -@@ -279,7 +_,7 @@ +@@ -302,7 +_,7 @@ } public boolean isDamageableItem() { @@ -133,7 +133,7 @@ CompoundTag compoundtag = this.getTag(); return compoundtag == null || !compoundtag.getBoolean("Unbreakable"); } else { -@@ -288,19 +_,19 @@ +@@ -311,19 +_,19 @@ } public boolean isDamaged() { @@ -157,7 +157,7 @@ } public boolean hurt(int p_220158_, RandomSource p_220159_, @Nullable ServerPlayer p_220160_) { -@@ -336,6 +_,7 @@ +@@ -359,6 +_,7 @@ public void hurtAndBreak(int p_41623_, T p_41624_, Consumer p_41625_) { if (!p_41624_.level().isClientSide && (!(p_41624_ instanceof Player) || !((Player)p_41624_).getAbilities().instabuild)) { if (this.isDamageableItem()) { @@ -165,7 +165,7 @@ if (this.hurt(p_41623_, p_41624_.getRandom(), p_41624_ instanceof ServerPlayer ? (ServerPlayer)p_41624_ : null)) { p_41625_.accept(p_41624_); Item item = this.getItem(); -@@ -388,7 +_,7 @@ +@@ -411,7 +_,7 @@ } public boolean isCorrectToolForDrops(BlockState p_41736_) { @@ -174,7 +174,7 @@ } public InteractionResult interactLivingEntity(Player p_41648_, LivingEntity p_41649_, InteractionHand p_41650_) { -@@ -399,7 +_,7 @@ +@@ -422,7 +_,7 @@ if (this.isEmpty()) { return EMPTY; } else { @@ -183,7 +183,7 @@ itemstack.setPopTime(this.getPopTime()); if (this.tag != null) { itemstack.tag = this.tag.copy(); -@@ -435,7 +_,7 @@ +@@ -458,7 +_,7 @@ if (!p_150943_.is(p_150944_.getItem())) { return false; } else { @@ -192,7 +192,7 @@ } } -@@ -527,7 +_,7 @@ +@@ -554,7 +_,7 @@ public void setTag(@Nullable CompoundTag p_41752_) { this.tag = p_41752_; @@ -201,7 +201,7 @@ this.setDamageValue(this.getDamageValue()); } -@@ -588,7 +_,7 @@ +@@ -615,7 +_,7 @@ public List getTooltipLines(@Nullable Player p_41652_, TooltipFlag p_41653_) { List list = Lists.newArrayList(); @@ -210,7 +210,7 @@ if (this.hasCustomHoverName()) { mutablecomponent.withStyle(ChatFormatting.ITALIC); } -@@ -735,6 +_,7 @@ +@@ -762,6 +_,7 @@ list.add(DISABLED_ITEM_TOOLTIP); } @@ -218,7 +218,7 @@ return list; } -@@ -743,7 +_,7 @@ +@@ -770,7 +_,7 @@ } private int getHideFlags() { @@ -227,7 +227,7 @@ } public void hideTooltipPart(ItemStack.TooltipPart p_41655_) { -@@ -863,9 +_,10 @@ +@@ -890,9 +_,10 @@ } } } else { @@ -239,7 +239,7 @@ return multimap; } -@@ -893,7 +_,7 @@ +@@ -920,7 +_,7 @@ MutableComponent mutablecomponent1 = ComponentUtils.wrapInSquareBrackets(mutablecomponent); if (!this.isEmpty()) { @@ -248,7 +248,7 @@ return p_220170_.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new HoverEvent.ItemStackInfo(this))); }); } -@@ -945,12 +_,31 @@ +@@ -972,12 +_,31 @@ this.getItem().onUseTick(p_41732_, p_41733_, this, p_41734_); } diff --git a/patches/minecraft/net/minecraft/world/item/Items.java.patch b/patches/minecraft/net/minecraft/world/item/Items.java.patch index e4015c3d33..7781551d97 100644 --- a/patches/minecraft/net/minecraft/world/item/Items.java.patch +++ b/patches/minecraft/net/minecraft/world/item/Items.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/Items.java +++ b/net/minecraft/world/item/Items.java -@@ -1279,11 +_,23 @@ +@@ -1337,11 +_,23 @@ } public static Item registerBlock(Block p_252092_, Block... p_248886_) { diff --git a/patches/minecraft/net/minecraft/world/item/MinecartItem.java.patch b/patches/minecraft/net/minecraft/world/item/MinecartItem.java.patch index 6ba0aa85d3..8dce7417a1 100644 --- a/patches/minecraft/net/minecraft/world/item/MinecartItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/MinecartItem.java.patch @@ -1,18 +1,18 @@ --- a/net/minecraft/world/item/MinecartItem.java +++ b/net/minecraft/world/item/MinecartItem.java -@@ -30,7 +_,7 @@ +@@ -32,7 +_,7 @@ double d2 = vec3.z() + (double)direction.getStepZ() * 1.125D; BlockPos blockpos = p_42949_.pos().relative(direction); - BlockState blockstate = level.getBlockState(blockpos); + BlockState blockstate = serverlevel.getBlockState(blockpos); - RailShape railshape = blockstate.getBlock() instanceof BaseRailBlock ? blockstate.getValue(((BaseRailBlock)blockstate.getBlock()).getShapeProperty()) : RailShape.NORTH_SOUTH; -+ RailShape railshape = blockstate.getBlock() instanceof BaseRailBlock ? ((BaseRailBlock)blockstate.getBlock()).getRailDirection(blockstate, level, blockpos, null) : RailShape.NORTH_SOUTH; ++ RailShape railshape = blockstate.getBlock() instanceof BaseRailBlock ? ((BaseRailBlock)blockstate.getBlock()).getRailDirection(blockstate, serverlevel, blockpos, null) : RailShape.NORTH_SOUTH; double d3; if (blockstate.is(BlockTags.RAILS)) { if (railshape.isAscending()) { -@@ -83,7 +_,7 @@ - } else { +@@ -82,7 +_,7 @@ ItemStack itemstack = p_42943_.getItemInHand(); - if (!level.isClientSide) { + if (level instanceof ServerLevel) { + ServerLevel serverlevel = (ServerLevel)level; - RailShape railshape = blockstate.getBlock() instanceof BaseRailBlock ? blockstate.getValue(((BaseRailBlock)blockstate.getBlock()).getShapeProperty()) : RailShape.NORTH_SOUTH; + RailShape railshape = blockstate.getBlock() instanceof BaseRailBlock ? ((BaseRailBlock)blockstate.getBlock()).getRailDirection(blockstate, level, blockpos, null) : RailShape.NORTH_SOUTH; double d0 = 0.0D; diff --git a/patches/minecraft/net/minecraft/world/item/SpawnEggItem.java.patch b/patches/minecraft/net/minecraft/world/item/SpawnEggItem.java.patch index 7454e61439..2d610c41e8 100644 --- a/patches/minecraft/net/minecraft/world/item/SpawnEggItem.java.patch +++ b/patches/minecraft/net/minecraft/world/item/SpawnEggItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/SpawnEggItem.java +++ b/net/minecraft/world/item/SpawnEggItem.java -@@ -40,11 +_,14 @@ +@@ -39,11 +_,14 @@ private final int highlightColor; private final EntityType defaultType; @@ -15,7 +15,7 @@ BY_ID.put(p_43207_, this); } -@@ -127,6 +_,8 @@ +@@ -123,6 +_,8 @@ return p_43212_ == 0 ? this.backgroundColor : this.highlightColor; } @@ -24,7 +24,7 @@ @Nullable public static SpawnEggItem byId(@Nullable EntityType p_43214_) { return BY_ID.get(p_43214_); -@@ -140,15 +_,15 @@ +@@ -136,15 +_,15 @@ if (p_43229_ != null && p_43229_.contains("EntityTag", 10)) { CompoundTag compoundtag = p_43229_.getCompound("EntityTag"); if (compoundtag.contains("id", 8)) { @@ -43,7 +43,7 @@ } public Optional spawnOffspringFromSpawnEgg(Player p_43216_, Mob p_43217_, EntityType p_43218_, ServerLevel p_43219_, Vec3 p_43220_, ItemStack p_43221_) { -@@ -183,5 +_,9 @@ +@@ -179,5 +_,9 @@ } } } diff --git a/patches/minecraft/net/minecraft/world/item/crafting/Ingredient.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/Ingredient.java.patch index 24283ff027..458ccb5155 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/Ingredient.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/Ingredient.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/Ingredient.java +++ b/net/minecraft/world/item/crafting/Ingredient.java -@@ -30,14 +_,24 @@ +@@ -27,14 +_,24 @@ import net.minecraft.world.level.ItemLike; public class Ingredient implements Predicate { @@ -27,7 +27,7 @@ protected Ingredient(Stream p_43907_) { this.values = p_43907_.toArray((p_43933_) -> { -@@ -50,7 +_,7 @@ +@@ -47,7 +_,7 @@ } public ItemStack[] getItems() { @@ -36,7 +36,7 @@ this.itemStacks = Arrays.stream(this.values).flatMap((p_43916_) -> { return p_43916_.getItems().stream(); }).distinct().toArray((p_43910_) -> { -@@ -78,7 +_,8 @@ +@@ -75,7 +_,8 @@ } public IntList getStackingIds() { @@ -46,7 +46,7 @@ ItemStack[] aitemstack = this.getItems(); this.stackingIds = new IntArrayList(aitemstack.length); -@@ -93,6 +_,7 @@ +@@ -90,6 +_,7 @@ } public final void toNetwork(FriendlyByteBuf p_43924_) { @@ -54,7 +54,7 @@ p_43924_.writeCollection(Arrays.asList(this.getItems()), FriendlyByteBuf::writeItem); } -@@ -113,6 +_,38 @@ +@@ -105,6 +_,38 @@ } } @@ -93,7 +93,7 @@ public static Ingredient fromValues(Stream p_43939_) { Ingredient ingredient = new Ingredient(p_43939_); return ingredient.isEmpty() ? EMPTY : ingredient; -@@ -141,7 +_,9 @@ +@@ -133,7 +_,9 @@ } public static Ingredient fromNetwork(FriendlyByteBuf p_43941_) { @@ -104,7 +104,7 @@ } private static Codec codec(boolean p_298496_) { -@@ -207,6 +_,9 @@ +@@ -199,6 +_,9 @@ list.add(new ItemStack(holder)); } @@ -114,3 +114,27 @@ return list; } } +@@ -221,5 +_,23 @@ + }); + + Collection getItems(); ++ } ++ ++ @Override ++ public String toString() { ++ var buf = new StringBuilder(); ++ buf.append("Ingredient["); ++ for (int x = 0; x < values.length; x++) { ++ if (x != 0) ++ buf.append(", "); ++ if (values[x] instanceof TagValue tag) ++ buf.append('#').append(tag.tag().location()); ++ else if (values[x] instanceof ItemValue item) ++ buf.append(item.item()); ++ else ++ buf.append(values[x]); ++ } ++ buf.append(']'); ++ return buf.toString(); + } + } diff --git a/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch index 16d760abb6..f388fcc47b 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/Recipe.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/Recipe.java +++ b/net/minecraft/world/item/crafting/Recipe.java -@@ -21,9 +_,9 @@ +@@ -25,9 +_,9 @@ NonNullList nonnulllist = NonNullList.withSize(p_44004_.getContainerSize(), ItemStack.EMPTY); for(int i = 0; i < nonnulllist.size(); ++i) { @@ -12,7 +12,7 @@ } } -@@ -57,7 +_,7 @@ +@@ -61,7 +_,7 @@ default boolean isIncomplete() { NonNullList nonnulllist = this.getIngredients(); return nonnulllist.isEmpty() || nonnulllist.stream().anyMatch((p_151268_) -> { diff --git a/patches/minecraft/net/minecraft/world/item/crafting/RecipeManager.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/RecipeManager.java.patch index 0480f06fa8..f1833115e1 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/RecipeManager.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/RecipeManager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/crafting/RecipeManager.java +++ b/net/minecraft/world/item/crafting/RecipeManager.java -@@ -40,9 +_,17 @@ +@@ -37,9 +_,17 @@ private Map, Map>> recipes = ImmutableMap.of(); private Map> byName = ImmutableMap.of(); private boolean hasErrors; @@ -18,7 +18,7 @@ } protected void apply(Map p_44037_, ResourceManager p_44038_, ProfilerFiller p_44039_) { -@@ -52,8 +_,13 @@ +@@ -49,8 +_,13 @@ for(Map.Entry entry : p_44037_.entrySet()) { ResourceLocation resourcelocation = entry.getKey(); diff --git a/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch index f2d6beae7a..5e84ed7fb6 100644 --- a/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch +++ b/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipe.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/item/crafting/ShapedRecipe.java +++ b/net/minecraft/world/item/crafting/ShapedRecipe.java -@@ -17,7 +_,20 @@ +@@ -10,7 +_,20 @@ + import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; - import org.apache.commons.lang3.NotImplementedException; -public class ShapedRecipe implements CraftingRecipe { +public class ShapedRecipe implements CraftingRecipe, net.minecraftforge.common.crafting.IShapedRecipe { @@ -19,11 +19,11 @@ + if (MAX_HEIGHT < height) MAX_HEIGHT = height; + } + - final int width; - final int height; - final NonNullList recipeItems; -@@ -115,10 +_,20 @@ - return this.width; + final ShapedRecipePattern pattern; + final ItemStack result; + final String group; +@@ -37,10 +_,20 @@ + return this.group; } + @Override @@ -31,8 +31,8 @@ + return getWidth(); + } + - public int getHeight() { - return this.height; + public CraftingBookCategory category() { + return this.category; } + @Override @@ -40,10 +40,10 @@ + return getHeight(); + } + - @VisibleForTesting - static String[] shrink(List p_299210_) { - int i = Integer.MAX_VALUE; -@@ -160,7 +_,7 @@ + public ItemStack getResultItem(RegistryAccess p_266881_) { + return this.result; + } +@@ -78,7 +_,7 @@ return nonnulllist.isEmpty() || nonnulllist.stream().filter((p_151277_) -> { return !p_151277_.isEmpty(); }).anyMatch((p_151273_) -> { @@ -52,27 +52,3 @@ }); } -@@ -182,9 +_,9 @@ - - public static class Serializer implements RecipeSerializer { - static final Codec> PATTERN_CODEC = Codec.STRING.listOf().flatXmap((p_297814_) -> { -- if (p_297814_.size() > 3) { -+ if (p_297814_.size() > MAX_HEIGHT) { - return DataResult.error(() -> { -- return "Invalid pattern: too many rows, 3 is maximum"; -+ return "Invalid pattern: too many rows, " + MAX_HEIGHT + " is maximum"; - }); - } else if (p_297814_.isEmpty()) { - return DataResult.error(() -> { -@@ -194,9 +_,9 @@ - int i = p_297814_.get(0).length(); - - for(String s : p_297814_) { -- if (s.length() > 3) { -+ if (s.length() > MAX_WIDTH) { - return DataResult.error(() -> { -- return "Invalid pattern: too many columns, 3 is maximum"; -+ return "Invalid pattern: too many columns, " + MAX_WIDTH + " is maximum"; - }); - } - diff --git a/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipePattern.java.patch b/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipePattern.java.patch new file mode 100644 index 0000000000..21f1056acf --- /dev/null +++ b/patches/minecraft/net/minecraft/world/item/crafting/ShapedRecipePattern.java.patch @@ -0,0 +1,26 @@ +--- a/net/minecraft/world/item/crafting/ShapedRecipePattern.java ++++ b/net/minecraft/world/item/crafting/ShapedRecipePattern.java +@@ -178,9 +_,9 @@ + + public static record Data(Map key, List pattern) { + private static final Codec> PATTERN_CODEC = Codec.STRING.listOf().comapFlatMap((p_311191_) -> { +- if (p_311191_.size() > 3) { ++ if (p_311191_.size() > ShapedRecipe.MAX_HEIGHT) { + return DataResult.error(() -> { +- return "Invalid pattern: too many rows, 3 is maximum"; ++ return "Invalid pattern: too many rows, " + ShapedRecipe.MAX_HEIGHT + " is maximum"; + }); + } else if (p_311191_.isEmpty()) { + return DataResult.error(() -> { +@@ -190,9 +_,9 @@ + int i = p_311191_.get(0).length(); + + for(String s : p_311191_) { +- if (s.length() > 3) { ++ if (s.length() > ShapedRecipe.MAX_WIDTH) { + return DataResult.error(() -> { +- return "Invalid pattern: too many columns, 3 is maximum"; ++ return "Invalid pattern: too many columns, " + ShapedRecipe.MAX_WIDTH + " is maximum"; + }); + } + diff --git a/patches/minecraft/net/minecraft/world/level/BaseSpawner.java.patch b/patches/minecraft/net/minecraft/world/level/BaseSpawner.java.patch index a3fbf9cea5..64559a3b77 100644 --- a/patches/minecraft/net/minecraft/world/level/BaseSpawner.java.patch +++ b/patches/minecraft/net/minecraft/world/level/BaseSpawner.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/BaseSpawner.java +++ b/net/minecraft/world/level/BaseSpawner.java -@@ -131,12 +_,14 @@ +@@ -133,12 +_,14 @@ entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), randomsource.nextFloat() * 360.0F, 0.0F); if (entity instanceof Mob) { Mob mob = (Mob)entity; @@ -18,7 +18,7 @@ } } -@@ -283,4 +_,12 @@ +@@ -285,4 +_,12 @@ public double getoSpin() { return this.oSpin; } diff --git a/patches/minecraft/net/minecraft/world/level/ClipContext.java.patch b/patches/minecraft/net/minecraft/world/level/ClipContext.java.patch deleted file mode 100644 index 4edea0c06a..0000000000 --- a/patches/minecraft/net/minecraft/world/level/ClipContext.java.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/net/minecraft/world/level/ClipContext.java -+++ b/net/minecraft/world/level/ClipContext.java -@@ -20,12 +_,12 @@ - private final ClipContext.Fluid fluid; - private final CollisionContext collisionContext; - -- public ClipContext(Vec3 p_45688_, Vec3 p_45689_, ClipContext.Block p_45690_, ClipContext.Fluid p_45691_, Entity p_45692_) { -+ public ClipContext(Vec3 p_45688_, Vec3 p_45689_, ClipContext.Block p_45690_, ClipContext.Fluid p_45691_, @org.jetbrains.annotations.Nullable Entity p_45692_) { - this.from = p_45688_; - this.to = p_45689_; - this.block = p_45690_; - this.fluid = p_45691_; -- this.collisionContext = CollisionContext.of(p_45692_); -+ this.collisionContext = p_45692_ == null ? CollisionContext.empty() : CollisionContext.of(p_45692_); - } - - public Vec3 getTo() { diff --git a/patches/minecraft/net/minecraft/world/level/Explosion.java.patch b/patches/minecraft/net/minecraft/world/level/Explosion.java.patch index 80035052ad..882c61e034 100644 --- a/patches/minecraft/net/minecraft/world/level/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/level/Explosion.java.patch @@ -1,22 +1,22 @@ --- a/net/minecraft/world/level/Explosion.java +++ b/net/minecraft/world/level/Explosion.java -@@ -56,6 +_,7 @@ - private final ExplosionDamageCalculator damageCalculator; +@@ -57,6 +_,7 @@ + private final SoundEvent explosionSound; private final ObjectArrayList toBlow = new ObjectArrayList<>(); private final Map hitPlayers = Maps.newHashMap(); + private final Vec3 position; - public Explosion(Level p_46024_, @Nullable Entity p_46025_, double p_46026_, double p_46027_, double p_46028_, float p_46029_, List p_46030_) { - this(p_46024_, p_46025_, p_46026_, p_46027_, p_46028_, p_46029_, false, Explosion.BlockInteraction.DESTROY_WITH_DECAY, p_46030_); -@@ -81,6 +_,7 @@ - this.blockInteraction = p_46060_; - this.damageSource = p_46053_ == null ? p_46051_.damageSources().explosion(this) : p_46053_; - this.damageCalculator = p_46054_ == null ? this.makeDamageCalculator(p_46052_) : p_46054_; + public static DamageSource getDefaultDamageSource(Level p_309890_, @Nullable Entity p_311046_) { + return p_309890_.damageSources().explosion(p_311046_, getIndirectSourceEntityInternal(p_311046_)); +@@ -90,6 +_,7 @@ + this.smallExplosionParticles = p_312175_; + this.largeExplosionParticles = p_310459_; + this.explosionSound = p_311795_; + this.position = new Vec3(this.x, this.y, this.z); } private ExplosionDamageCalculator makeDamageCalculator(@Nullable Entity p_46063_) { -@@ -176,6 +_,7 @@ +@@ -193,6 +_,7 @@ int j2 = Mth.floor(this.z - (double)f2 - 1.0D); int j1 = Mth.floor(this.z + (double)f2 + 1.0D); List list = this.level.getEntities(this.source, new AABB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); @@ -24,26 +24,7 @@ Vec3 vec3 = new Vec3(this.x, this.y, this.z); for(Entity entity : list) { -@@ -244,7 +_,7 @@ - if (!blockstate.isAir()) { - BlockPos blockpos1 = blockpos.immutable(); - this.level.getProfiler().push("explosion_blocks"); -- if (block.dropFromExplosion(this)) { -+ if (blockstate.canDropFromExplosion(this.level, blockpos, this)) { - Level $$9 = this.level; - if ($$9 instanceof ServerLevel) { - ServerLevel serverlevel = (ServerLevel)$$9; -@@ -261,8 +_,7 @@ - } - } - -- this.level.setBlock(blockpos, Blocks.AIR.defaultBlockState(), 3); -- block.wasExploded(this.level, blockpos, this); -+ blockstate.onBlockExploded(this.level, blockpos, this); - this.level.getProfiler().pop(); - } - } -@@ -353,6 +_,15 @@ +@@ -345,6 +_,15 @@ public List getToBlow() { return this.toBlow; @@ -58,4 +39,4 @@ + return this.source; } - public static enum BlockInteraction { + public Explosion.BlockInteraction getBlockInteraction() { diff --git a/patches/minecraft/net/minecraft/world/level/ExplosionDamageCalculator.java.patch b/patches/minecraft/net/minecraft/world/level/ExplosionDamageCalculator.java.patch index ed145a9357..b67eaa3768 100644 --- a/patches/minecraft/net/minecraft/world/level/ExplosionDamageCalculator.java.patch +++ b/patches/minecraft/net/minecraft/world/level/ExplosionDamageCalculator.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/ExplosionDamageCalculator.java +++ b/net/minecraft/world/level/ExplosionDamageCalculator.java -@@ -7,7 +_,7 @@ +@@ -9,7 +_,7 @@ public class ExplosionDamageCalculator { public Optional getBlockExplosionResistance(Explosion p_46099_, BlockGetter p_46100_, BlockPos p_46101_, BlockState p_46102_, FluidState p_46103_) { diff --git a/patches/minecraft/net/minecraft/world/level/Level.java.patch b/patches/minecraft/net/minecraft/world/level/Level.java.patch index 3c46cf6d7f..b89aab32ee 100644 --- a/patches/minecraft/net/minecraft/world/level/Level.java.patch +++ b/patches/minecraft/net/minecraft/world/level/Level.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -70,7 +_,7 @@ +@@ -73,7 +_,7 @@ import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.Scoreboard; @@ -9,7 +9,7 @@ public static final Codec> RESOURCE_KEY_CODEC = ResourceKey.codec(Registries.DIMENSION); public static final ResourceKey OVERWORLD = ResourceKey.create(Registries.DIMENSION, new ResourceLocation("overworld")); public static final ResourceKey NETHER = ResourceKey.create(Registries.DIMENSION, new ResourceLocation("the_nether")); -@@ -110,8 +_,14 @@ +@@ -113,8 +_,14 @@ private final RegistryAccess registryAccess; private final DamageSources damageSources; private long subTickCount; @@ -24,7 +24,7 @@ this.profiler = p_270692_; this.levelData = p_270739_; this.dimensionTypeRegistration = p_270240_; -@@ -198,11 +_,40 @@ +@@ -201,11 +_,40 @@ } else { LevelChunk levelchunk = this.getChunkAt(p_46605_); Block block = p_46606_.getBlock(); @@ -65,7 +65,7 @@ if (blockstate1 == p_46606_) { if (blockstate != blockstate1) { this.setBlocksDirty(p_46605_, blockstate, blockstate1); -@@ -227,9 +_,8 @@ +@@ -230,9 +_,8 @@ } this.onBlockStateChange(p_46605_, blockstate, blockstate1); @@ -76,7 +76,7 @@ } } } -@@ -279,6 +_,7 @@ +@@ -282,6 +_,7 @@ } public void updateNeighborsAt(BlockPos p_46673_, Block p_46674_) { @@ -84,7 +84,7 @@ } public void updateNeighborsAtExceptFromFacing(BlockPos p_46591_, Block p_46592_, Direction p_46593_) { -@@ -398,10 +_,26 @@ +@@ -408,10 +_,26 @@ (this.tickingBlockEntities ? this.pendingBlockEntityTickers : this.blockEntityTickers).add(p_151526_); } @@ -111,7 +111,7 @@ if (!this.pendingBlockEntityTickers.isEmpty()) { this.blockEntityTickers.addAll(this.pendingBlockEntityTickers); this.pendingBlockEntityTickers.clear(); -@@ -424,12 +_,19 @@ +@@ -435,12 +_,19 @@ public void guardEntityTick(Consumer p_46654_, T p_46655_) { try { @@ -131,24 +131,24 @@ } } -@@ -471,7 +_,7 @@ +@@ -486,7 +_,7 @@ explosion$blockinteraction1 = this.getDestroyType(GameRules.RULE_BLOCK_EXPLOSION_DROP_DECAY); break; case MOB: - explosion$blockinteraction1 = this.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? this.getDestroyType(GameRules.RULE_MOB_EXPLOSION_DROP_DECAY) : Explosion.BlockInteraction.KEEP; -+ explosion$blockinteraction1 = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this, p_256233_) ? this.getDestroyType(GameRules.RULE_MOB_EXPLOSION_DROP_DECAY) : Explosion.BlockInteraction.KEEP; ++ explosion$blockinteraction1 = net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this, p_312521_) ? this.getDestroyType(GameRules.RULE_MOB_EXPLOSION_DROP_DECAY) : Explosion.BlockInteraction.KEEP; break; case TNT: explosion$blockinteraction1 = this.getDestroyType(GameRules.RULE_TNT_EXPLOSION_DROP_DECAY); -@@ -482,6 +_,7 @@ +@@ -500,6 +_,7 @@ Explosion.BlockInteraction explosion$blockinteraction = explosion$blockinteraction1; - Explosion explosion = new Explosion(this, p_256233_, p_255861_, p_255867_, p_256447_, p_255732_, p_255717_, p_256013_, p_256228_, explosion$blockinteraction); + Explosion explosion = new Explosion(this, p_312521_, p_310678_, p_312887_, p_309783_, p_312776_, p_310505_, p_310209_, p_309445_, explosion$blockinteraction, p_311889_, p_311434_, p_312016_); + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; explosion.explode(); - explosion.finalizeExplosion(p_256377_); + explosion.finalizeExplosion(p_309655_); return explosion; -@@ -513,6 +_,7 @@ +@@ -531,6 +_,7 @@ if (!this.isOutsideBuildHeight(p_46748_)) { this.getChunkAt(p_46748_).removeBlockEntity(p_46748_); } @@ -156,7 +156,7 @@ } public boolean isLoaded(BlockPos p_46750_) { -@@ -583,6 +_,7 @@ +@@ -601,6 +_,7 @@ list.add(p_151522_); } @@ -164,7 +164,7 @@ if (p_151522_ instanceof EnderDragon) { for(EnderDragonPart enderdragonpart : ((EnderDragon)p_151522_).getSubEntities()) { if (p_151522_ != p_46536_ && p_46538_.test(enderdragonpart)) { -@@ -592,6 +_,11 @@ +@@ -610,6 +_,11 @@ } }); @@ -176,7 +176,7 @@ return list; } -@@ -615,6 +_,8 @@ +@@ -633,6 +_,8 @@ } } @@ -185,7 +185,7 @@ if (p_261454_ instanceof EnderDragon enderdragon) { for(EnderDragonPart enderdragonpart : enderdragon.getSubEntities()) { T t = p_261885_.tryCast(enderdragonpart); -@@ -629,6 +_,15 @@ +@@ -647,6 +_,15 @@ return AbortableIterationConsumer.Continuation.CONTINUE; }); @@ -201,7 +201,7 @@ } @Nullable -@@ -760,16 +_,15 @@ +@@ -780,16 +_,15 @@ public abstract Scoreboard getScoreboard(); public void updateNeighbourForOutputSignal(BlockPos p_46718_, Block p_46719_) { @@ -222,7 +222,7 @@ this.neighborChanged(blockstate, blockpos, p_46719_, p_46718_, false); } } -@@ -854,6 +_,18 @@ +@@ -874,6 +_,18 @@ public BiomeManager getBiomeManager() { return this.biomeManager; diff --git a/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch b/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch index a4cec93cb0..eab5cf9200 100644 --- a/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch +++ b/patches/minecraft/net/minecraft/world/level/biome/Biome.java.patch @@ -38,7 +38,7 @@ } public int getFogColor() { -@@ -373,4 +_,34 @@ +@@ -384,4 +_,34 @@ return this.name; } } diff --git a/patches/minecraft/net/minecraft/world/level/block/BambooSaplingBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/BambooSaplingBlock.java.patch index 9358bc5755..76b61675ca 100644 --- a/patches/minecraft/net/minecraft/world/level/block/BambooSaplingBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/BambooSaplingBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/BambooSaplingBlock.java +++ b/net/minecraft/world/level/block/BambooSaplingBlock.java -@@ -73,7 +_,7 @@ +@@ -79,7 +_,7 @@ } public float getDestroyProgress(BlockState p_48981_, Player p_48982_, BlockGetter p_48983_, BlockPos p_48984_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/BambooStalkBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/BambooStalkBlock.java.patch index a2ecb9c353..ff3e8d9a15 100644 --- a/patches/minecraft/net/minecraft/world/level/block/BambooStalkBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/BambooStalkBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/block/BambooStalkBlock.java +++ b/net/minecraft/world/level/block/BambooStalkBlock.java -@@ -26,7 +_,7 @@ +@@ -27,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class BambooStalkBlock extends Block implements BonemealableBlock { +public class BambooStalkBlock extends Block implements BonemealableBlock, net.minecraftforge.common.IPlantable { + public static final MapCodec CODEC = simpleCodec(BambooStalkBlock::new); protected static final float SMALL_LEAVES_AABB_OFFSET = 3.0F; protected static final float LARGE_LEAVES_AABB_OFFSET = 5.0F; - protected static final float COLLISION_AABB_OFFSET = 1.5F; -@@ -110,10 +_,11 @@ +@@ -116,10 +_,11 @@ public void randomTick(BlockState p_261931_, ServerLevel p_261751_, BlockPos p_261616_, RandomSource p_261766_) { if (p_261931_.getValue(STAGE) == 0) { @@ -23,7 +23,7 @@ } } -@@ -167,7 +_,7 @@ +@@ -173,7 +_,7 @@ } public float getDestroyProgress(BlockState p_261691_, Player p_262171_, BlockGetter p_261621_, BlockPos p_261500_) { @@ -32,7 +32,7 @@ } protected void growBamboo(BlockState p_261855_, Level p_262076_, BlockPos p_262109_, RandomSource p_261633_, int p_261759_) { -@@ -208,5 +_,12 @@ +@@ -214,5 +_,12 @@ } return i; diff --git a/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch index 120fc06ff6..57e659f018 100644 --- a/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/BaseFireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/BaseFireBlock.java +++ b/net/minecraft/world/level/block/BaseFireBlock.java -@@ -124,6 +_,7 @@ +@@ -127,6 +_,7 @@ if (!p_49282_.is(p_49279_.getBlock())) { if (inPortalDimension(p_49280_)) { Optional optional = PortalShape.findEmptyPortalShape(p_49280_, p_49281_, Direction.Axis.X); @@ -8,7 +8,7 @@ if (optional.isPresent()) { optional.get().createPortalBlocks(); return; -@@ -169,7 +_,7 @@ +@@ -172,7 +_,7 @@ boolean flag = false; for(Direction direction : Direction.values()) { diff --git a/patches/minecraft/net/minecraft/world/level/block/BaseRailBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/BaseRailBlock.java.patch index a98b42d7bf..de14a5939f 100644 --- a/patches/minecraft/net/minecraft/world/level/block/BaseRailBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/BaseRailBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/BaseRailBlock.java +++ b/net/minecraft/world/level/block/BaseRailBlock.java -@@ -19,7 +_,7 @@ +@@ -20,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -9,7 +9,7 @@ protected static final VoxelShape FLAT_AABB = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D); protected static final VoxelShape HALF_BLOCK_AABB = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D); public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; -@@ -44,6 +_,7 @@ +@@ -47,6 +_,7 @@ public VoxelShape getShape(BlockState p_49403_, BlockGetter p_49404_, BlockPos p_49405_, CollisionContext p_49406_) { RailShape railshape = p_49403_.is(this) ? p_49403_.getValue(this.getShapeProperty()) : null; @@ -17,7 +17,7 @@ return railshape != null && railshape.isAscending() ? HALF_BLOCK_AABB : FLAT_AABB; } -@@ -68,7 +_,7 @@ +@@ -71,7 +_,7 @@ public void neighborChanged(BlockState p_49377_, Level p_49378_, BlockPos p_49379_, Block p_49380_, BlockPos p_49381_, boolean p_49382_) { if (!p_49378_.isClientSide && p_49378_.getBlockState(p_49379_).is(this)) { @@ -26,7 +26,7 @@ if (shouldBeRemoved(p_49379_, p_49378_, railshape)) { dropResources(p_49377_, p_49378_, p_49379_); p_49378_.removeBlock(p_49379_, p_49382_); -@@ -113,7 +_,7 @@ +@@ -116,7 +_,7 @@ public void onRemove(BlockState p_49384_, Level p_49385_, BlockPos p_49386_, BlockState p_49387_, boolean p_49388_) { if (!p_49388_) { super.onRemove(p_49384_, p_49385_, p_49386_, p_49387_, p_49388_); @@ -35,7 +35,7 @@ p_49385_.updateNeighborsAt(p_49386_.above(), this); } -@@ -134,6 +_,11 @@ +@@ -137,6 +_,11 @@ return blockstate.setValue(this.getShapeProperty(), flag1 ? RailShape.EAST_WEST : RailShape.NORTH_SOUTH).setValue(WATERLOGGED, Boolean.valueOf(flag)); } @@ -47,7 +47,7 @@ public abstract Property getShapeProperty(); public BlockState updateShape(BlockState p_152151_, Direction p_152152_, BlockState p_152153_, LevelAccessor p_152154_, BlockPos p_152155_, BlockPos p_152156_) { -@@ -146,5 +_,15 @@ +@@ -149,5 +_,15 @@ public FluidState getFluidState(BlockState p_152158_) { return p_152158_.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(p_152158_); diff --git a/patches/minecraft/net/minecraft/world/level/block/BeehiveBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/BeehiveBlock.java.patch index 508c1802dc..857665e418 100644 --- a/patches/minecraft/net/minecraft/world/level/block/BeehiveBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/BeehiveBlock.java.patch @@ -1,17 +1,6 @@ --- a/net/minecraft/world/level/block/BeehiveBlock.java +++ b/net/minecraft/world/level/block/BeehiveBlock.java -@@ -72,6 +_,10 @@ - return p_49620_.getValue(HONEY_LEVEL); - } - -+ // Forge: Fixed MC-227255 Beehives and bee nests do not rotate/mirror correctly in structure blocks -+ @Override public BlockState rotate(BlockState blockState, net.minecraft.world.level.block.Rotation rotation) { return blockState.setValue(FACING, rotation.rotate(blockState.getValue(FACING))); } -+ @Override public BlockState mirror(BlockState blockState, net.minecraft.world.level.block.Mirror mirror) { return blockState.rotate(mirror.getRotation(blockState.getValue(FACING))); } -+ - public void playerDestroy(Level p_49584_, Player p_49585_, BlockPos p_49586_, BlockState p_49587_, @Nullable BlockEntity p_49588_, ItemStack p_49589_) { - super.playerDestroy(p_49584_, p_49585_, p_49586_, p_49587_, p_49588_, p_49589_); - if (!p_49584_.isClientSide && p_49588_ instanceof BeehiveBlockEntity beehiveblockentity) { -@@ -115,7 +_,7 @@ +@@ -121,7 +_,7 @@ boolean flag = false; if (i >= 5) { Item item = itemstack.getItem(); diff --git a/patches/minecraft/net/minecraft/world/level/block/Block.java.patch b/patches/minecraft/net/minecraft/world/level/block/Block.java.patch index 25fed2ab05..175c7d89e3 100644 --- a/patches/minecraft/net/minecraft/world/level/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/Block.java.patch @@ -1,11 +1,12 @@ --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java -@@ -61,10 +_,11 @@ +@@ -62,11 +_,12 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.slf4j.Logger; -public class Block extends BlockBehaviour implements ItemLike { +public class Block extends BlockBehaviour implements ItemLike, net.minecraftforge.common.extensions.IForgeBlock { + public static final MapCodec CODEC = simpleCodec(Block::new); 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<>(); @@ -14,7 +15,7 @@ private static final LoadingCache SHAPE_FULL_BLOCK_CACHE = CacheBuilder.newBuilder().maximumSize(512L).weakKeys().build(new CacheLoader() { public Boolean load(VoxelShape p_49972_) { return !Shapes.joinIsNotEmpty(Shapes.block(), p_49972_, BooleanOp.NOT_SAME); -@@ -176,7 +_,7 @@ +@@ -182,7 +_,7 @@ LOGGER.error("Block classes should end with Block and {} doesn't.", (Object)s); } } @@ -23,7 +24,7 @@ } public static boolean isExceptionForConnection(BlockState p_152464_) { -@@ -191,6 +_,8 @@ +@@ -197,6 +_,8 @@ BlockState blockstate = p_152446_.getBlockState(p_152449_); if (p_152445_.skipRendering(blockstate, p_152448_)) { return false; @@ -32,7 +33,7 @@ } else if (blockstate.canOcclude()) { Block.BlockStatePairKey block$blockstatepairkey = new Block.BlockStatePairKey(p_152445_, blockstate, p_152448_); Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = OCCLUSION_CACHE.get(); -@@ -276,11 +_,14 @@ +@@ -282,11 +_,14 @@ } public static void dropResources(BlockState p_49882_, Level p_49883_, BlockPos p_49884_, @Nullable BlockEntity p_49885_, @Nullable Entity p_49886_, ItemStack p_49887_) { @@ -48,7 +49,7 @@ } } -@@ -313,7 +_,7 @@ +@@ -319,7 +_,7 @@ } private static void popResource(Level p_152441_, Supplier p_152442_, ItemStack p_152443_) { @@ -57,7 +58,7 @@ ItemEntity itementity = p_152442_.get(); itementity.setDefaultPickUpDelay(); p_152441_.addFreshEntity(itementity); -@@ -321,12 +_,13 @@ +@@ -327,12 +_,13 @@ } public void popExperience(ServerLevel p_49806_, BlockPos p_49807_, int p_49808_) { @@ -72,7 +73,7 @@ public float getExplosionResistance() { return this.explosionResistance; } -@@ -345,7 +_,8 @@ +@@ -351,7 +_,8 @@ public void playerDestroy(Level p_49827_, Player p_49828_, BlockPos p_49829_, BlockState p_49830_, @Nullable BlockEntity p_49831_, ItemStack p_49832_) { p_49828_.awardStat(Stats.BLOCK_MINED.get(this)); p_49828_.causeFoodExhaustion(0.005F); @@ -82,7 +83,7 @@ } public void setPlacedBy(Level p_49847_, BlockPos p_49848_, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack p_49851_) { -@@ -373,8 +_,10 @@ +@@ -379,8 +_,10 @@ public void updateEntityAfterFallOn(BlockGetter p_49821_, Entity p_49822_) { p_49822_.setDeltaMovement(p_49822_.getDeltaMovement().multiply(1.0D, 0.0D, 1.0D)); @@ -90,10 +91,10 @@ } + @Deprecated //Forge: Use more sensitive version - public ItemStack getCloneItemStack(BlockGetter p_49823_, BlockPos p_49824_, BlockState p_49825_) { + public ItemStack getCloneItemStack(LevelReader p_312699_, BlockPos p_49824_, BlockState p_49825_) { return new ItemStack(this); } -@@ -407,6 +_,7 @@ +@@ -414,6 +_,7 @@ public void handlePrecipitation(BlockState p_152450_, Level p_152451_, BlockPos p_152452_, Biome.Precipitation p_152453_) { } @@ -101,7 +102,7 @@ public boolean dropFromExplosion(Explosion p_49826_) { return true; } -@@ -442,6 +_,7 @@ +@@ -449,6 +_,7 @@ return p_152456_.setValue(p_152457_, p_152455_.getValue(p_152457_)); } @@ -109,7 +110,7 @@ public SoundType getSoundType(BlockState p_49963_) { return this.soundType; } -@@ -451,7 +_,7 @@ +@@ -458,7 +_,7 @@ this.item = Item.byBlock(this); } @@ -118,7 +119,7 @@ } public boolean hasDynamicShape() { -@@ -472,6 +_,74 @@ +@@ -479,6 +_,74 @@ protected ImmutableMap getShapeForEachState(Function p_152459_) { return this.stateDefinition.getPossibleStates().stream().collect(ImmutableMap.toImmutableMap(Function.identity(), p_152459_)); } diff --git a/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch b/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch index b07e35dd25..cca5a0bbfe 100644 --- a/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/Blocks.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/Blocks.java +++ b/net/minecraft/world/level/block/Blocks.java -@@ -164,7 +_,7 @@ +@@ -170,7 +_,7 @@ public static final Block GREEN_BED = register("green_bed", bed(DyeColor.GREEN)); public static final Block RED_BED = register("red_bed", bed(DyeColor.RED)); public static final Block BLACK_BED = register("black_bed", bed(DyeColor.BLACK)); @@ -9,7 +9,7 @@ public static final Block DETECTOR_RAIL = register("detector_rail", new DetectorRailBlock(BlockBehaviour.Properties.of().noCollission().strength(0.7F).sound(SoundType.METAL))); public static final Block STICKY_PISTON = register("sticky_piston", pistonBase(true)); public static final Block COBWEB = register("cobweb", new WebBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOL).forceSolidOn().noCollission().requiresCorrectToolForDrops().strength(4.0F).pushReaction(PushReaction.DESTROY))); -@@ -1258,17 +_,5 @@ +@@ -1305,17 +_,5 @@ public static void rebuildCache() { Block.BLOCK_STATE_REGISTRY.forEach(BlockBehaviour.BlockStateBase::initCache); diff --git a/patches/minecraft/net/minecraft/world/level/block/BushBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/BushBlock.java.patch index 2b6774234c..3868e7ce87 100644 --- a/patches/minecraft/net/minecraft/world/level/block/BushBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/BushBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/block/BushBlock.java +++ b/net/minecraft/world/level/block/BushBlock.java -@@ -10,7 +_,7 @@ +@@ -11,7 +_,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.pathfinder.PathComputationType; --public class BushBlock extends Block { -+public class BushBlock extends Block implements net.minecraftforge.common.IPlantable { - public BushBlock(BlockBehaviour.Properties p_51021_) { +-public abstract class BushBlock extends Block { ++public abstract class BushBlock extends Block implements net.minecraftforge.common.IPlantable { + protected BushBlock(BlockBehaviour.Properties p_51021_) { super(p_51021_); } -@@ -25,6 +_,8 @@ +@@ -28,6 +_,8 @@ public boolean canSurvive(BlockState p_51028_, LevelReader p_51029_, BlockPos p_51030_) { BlockPos blockpos = p_51030_.below(); @@ -18,7 +18,7 @@ return this.mayPlaceOn(p_51029_.getBlockState(blockpos), p_51029_, blockpos); } -@@ -34,5 +_,12 @@ +@@ -37,5 +_,12 @@ public boolean isPathfindable(BlockState p_51023_, BlockGetter p_51024_, BlockPos p_51025_, PathComputationType p_51026_) { return p_51026_ == PathComputationType.AIR && !this.hasCollision ? true : super.isPathfindable(p_51023_, p_51024_, p_51025_, p_51026_); diff --git a/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch index f8f5c3cbb2..80ae296b8f 100644 --- a/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/CactusBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/block/CactusBlock.java +++ b/net/minecraft/world/level/block/CactusBlock.java -@@ -20,7 +_,7 @@ +@@ -21,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class CactusBlock extends Block { +public class CactusBlock extends Block implements net.minecraftforge.common.IPlantable { + public static final MapCodec CODEC = simpleCodec(CactusBlock::new); public static final IntegerProperty AGE = BlockStateProperties.AGE_15; public static final int MAX_AGE = 15; - protected static final int AABB_OFFSET = 1; -@@ -33,6 +_,7 @@ +@@ -39,6 +_,7 @@ } public void tick(BlockState p_220908_, ServerLevel p_220909_, BlockPos p_220910_, RandomSource p_220911_) { @@ -17,7 +17,7 @@ if (!p_220908_.canSurvive(p_220909_, p_220910_)) { p_220909_.destroyBlock(p_220910_, true); } -@@ -48,15 +_,17 @@ +@@ -54,15 +_,17 @@ if (i < 3) { int j = p_220913_.getValue(AGE); @@ -39,7 +39,7 @@ } } } -@@ -86,7 +_,7 @@ +@@ -92,7 +_,7 @@ } BlockState blockstate1 = p_51154_.getBlockState(p_51155_.below()); @@ -48,7 +48,7 @@ } public void entityInside(BlockState p_51148_, Level p_51149_, BlockPos p_51150_, Entity p_51151_) { -@@ -99,5 +_,15 @@ +@@ -105,5 +_,15 @@ public boolean isPathfindable(BlockState p_51143_, BlockGetter p_51144_, BlockPos p_51145_, PathComputationType p_51146_) { return false; diff --git a/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch index cd7a1a445d..67d134fda6 100644 --- a/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/CampfireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/CampfireBlock.java +++ b/net/minecraft/world/level/block/CampfireBlock.java -@@ -204,7 +_,7 @@ +@@ -218,7 +_,7 @@ return true; } diff --git a/patches/minecraft/net/minecraft/world/level/block/ChestBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/ChestBlock.java.patch index 16ebef89bc..9c04195b38 100644 --- a/patches/minecraft/net/minecraft/world/level/block/ChestBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/ChestBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/ChestBlock.java +++ b/net/minecraft/world/level/block/ChestBlock.java -@@ -335,7 +_,8 @@ +@@ -338,7 +_,8 @@ } public BlockState mirror(BlockState p_51549_, Mirror p_51550_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/ChorusFlowerBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/ChorusFlowerBlock.java.patch index e51e2732d9..0a2a6e3ca6 100644 --- a/patches/minecraft/net/minecraft/world/level/block/ChorusFlowerBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/ChorusFlowerBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/ChorusFlowerBlock.java +++ b/net/minecraft/world/level/block/ChorusFlowerBlock.java -@@ -50,7 +_,7 @@ +@@ -61,7 +_,7 @@ BlockPos blockpos = p_220982_.above(); if (p_220981_.isEmptyBlock(blockpos) && blockpos.getY() < p_220981_.getMaxBuildHeight()) { int i = p_220980_.getValue(AGE); @@ -9,7 +9,7 @@ boolean flag = false; boolean flag1 = false; BlockState blockstate = p_220981_.getBlockState(p_220982_.below()); -@@ -106,7 +_,7 @@ +@@ -117,7 +_,7 @@ } else { this.placeDeadFlower(p_220981_, p_220982_); } diff --git a/patches/minecraft/net/minecraft/world/level/block/CocoaBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/CocoaBlock.java.patch index 70919f6bd4..206561a79b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/CocoaBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/CocoaBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/CocoaBlock.java +++ b/net/minecraft/world/level/block/CocoaBlock.java -@@ -47,10 +_,11 @@ +@@ -53,10 +_,11 @@ } public void randomTick(BlockState p_221000_, ServerLevel p_221001_, BlockPos p_221002_, RandomSource p_221003_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/ComparatorBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/ComparatorBlock.java.patch index ca79c845d0..dfb08ad5d8 100644 --- a/patches/minecraft/net/minecraft/world/level/block/ComparatorBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/ComparatorBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/ComparatorBlock.java +++ b/net/minecraft/world/level/block/ComparatorBlock.java -@@ -170,4 +_,16 @@ +@@ -176,4 +_,16 @@ protected void createBlockStateDefinition(StateDefinition.Builder p_51887_) { p_51887_.add(FACING, MODE, POWERED); } diff --git a/patches/minecraft/net/minecraft/world/level/block/ConcretePowderBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/ConcretePowderBlock.java.patch index cb1933181c..239cf99fb0 100644 --- a/patches/minecraft/net/minecraft/world/level/block/ConcretePowderBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/ConcretePowderBlock.java.patch @@ -1,16 +1,16 @@ --- a/net/minecraft/world/level/block/ConcretePowderBlock.java +++ b/net/minecraft/world/level/block/ConcretePowderBlock.java -@@ -20,7 +_,7 @@ +@@ -32,7 +_,7 @@ } public void onLand(Level p_52068_, BlockPos p_52069_, BlockState p_52070_, BlockState p_52071_, FallingBlockEntity p_52072_) { - if (shouldSolidify(p_52068_, p_52069_, p_52071_)) { + if (shouldSolidify(p_52068_, p_52069_, p_52070_, p_52071_.getFluidState())) { // Forge: Use block of falling entity instead of block at replaced position, and check if shouldSolidify with the FluidState of the replaced block - p_52068_.setBlock(p_52069_, this.concrete, 3); + p_52068_.setBlock(p_52069_, this.concrete.defaultBlockState(), 3); } -@@ -33,20 +_,24 @@ - return shouldSolidify(blockgetter, blockpos, blockstate) ? this.concrete : super.getStateForPlacement(p_52063_); +@@ -45,20 +_,24 @@ + return shouldSolidify(blockgetter, blockpos, blockstate) ? this.concrete.defaultBlockState() : super.getStateForPlacement(p_52063_); } + private static boolean shouldSolidify(BlockGetter p_52081_, BlockPos p_52082_, BlockState p_52083_, net.minecraft.world.level.material.FluidState fluidState) { @@ -38,12 +38,12 @@ flag = true; break; } -@@ -61,7 +_,7 @@ +@@ -73,7 +_,7 @@ } public BlockState updateShape(BlockState p_52074_, Direction p_52075_, BlockState p_52076_, LevelAccessor p_52077_, BlockPos p_52078_, BlockPos p_52079_) { -- return touchesLiquid(p_52077_, p_52078_) ? this.concrete : super.updateShape(p_52074_, p_52075_, p_52076_, p_52077_, p_52078_, p_52079_); -+ return touchesLiquid(p_52077_, p_52078_, p_52074_) ? this.concrete : super.updateShape(p_52074_, p_52075_, p_52076_, p_52077_, p_52078_, p_52079_); +- return touchesLiquid(p_52077_, p_52078_) ? this.concrete.defaultBlockState() : super.updateShape(p_52074_, p_52075_, p_52076_, p_52077_, p_52078_, p_52079_); ++ return touchesLiquid(p_52077_, p_52078_, p_52074_) ? this.concrete.defaultBlockState() : super.updateShape(p_52074_, p_52075_, p_52076_, p_52077_, p_52078_, p_52079_); } public int getDustColor(BlockState p_52085_, BlockGetter p_52086_, BlockPos p_52087_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/CoralBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/CoralBlock.java.patch index d9717ed14b..84994d25cb 100644 --- a/patches/minecraft/net/minecraft/world/level/block/CoralBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/CoralBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/CoralBlock.java +++ b/net/minecraft/world/level/block/CoralBlock.java -@@ -37,9 +_,10 @@ +@@ -50,9 +_,10 @@ } protected boolean scanForWater(BlockGetter p_52135_, BlockPos p_52136_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/CropBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/CropBlock.java.patch index 74a95802c7..b70d3d3d8f 100644 --- a/patches/minecraft/net/minecraft/world/level/block/CropBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/CropBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/CropBlock.java +++ b/net/minecraft/world/level/block/CropBlock.java -@@ -64,12 +_,14 @@ +@@ -70,12 +_,14 @@ } public void randomTick(BlockState p_221050_, ServerLevel p_221051_, BlockPos p_221052_, RandomSource p_221053_) { @@ -16,7 +16,7 @@ } } } -@@ -98,9 +_,9 @@ +@@ -104,9 +_,9 @@ for(int j = -1; j <= 1; ++j) { float f1 = 0.0F; BlockState blockstate = p_52274_.getBlockState(blockpos.offset(i, 0, j)); @@ -28,7 +28,7 @@ f1 = 3.0F; } } -@@ -140,7 +_,7 @@ +@@ -146,7 +_,7 @@ } public void entityInside(BlockState p_52277_, Level p_52278_, BlockPos p_52279_, Entity p_52280_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/DeadBushBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DeadBushBlock.java.patch index d49074a423..3a62be0cca 100644 --- a/patches/minecraft/net/minecraft/world/level/block/DeadBushBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/DeadBushBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/level/block/DeadBushBlock.java +++ b/net/minecraft/world/level/block/DeadBushBlock.java -@@ -8,7 +_,7 @@ +@@ -9,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class DeadBushBlock extends BushBlock { +public class DeadBushBlock extends BushBlock implements net.minecraftforge.common.IForgeShearable { + public static final MapCodec CODEC = simpleCodec(DeadBushBlock::new); protected static final float AABB_OFFSET = 6.0F; protected static final VoxelShape SHAPE = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D); - diff --git a/patches/minecraft/net/minecraft/world/level/block/DetectorRailBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DetectorRailBlock.java.patch index 63778ff8c8..b1faddea3d 100644 --- a/patches/minecraft/net/minecraft/world/level/block/DetectorRailBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/DetectorRailBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/DetectorRailBlock.java +++ b/net/minecraft/world/level/block/DetectorRailBlock.java -@@ -31,6 +_,10 @@ +@@ -37,6 +_,10 @@ public DetectorRailBlock(BlockBehaviour.Properties p_52431_) { super(true, p_52431_); @@ -11,7 +11,7 @@ this.registerDefaultState(this.stateDefinition.any().setValue(POWERED, Boolean.valueOf(false)).setValue(SHAPE, RailShape.NORTH_SOUTH).setValue(WATERLOGGED, Boolean.valueOf(false))); } -@@ -135,7 +_,9 @@ +@@ -141,7 +_,9 @@ return list.get(0).getCommandBlock().getSuccessCount(); } @@ -22,7 +22,7 @@ if (!list1.isEmpty()) { return AbstractContainerMenu.getRedstoneSignalFromContainer((Container)list1.get(0)); } -@@ -270,6 +_,6 @@ +@@ -276,6 +_,6 @@ } protected void createBlockStateDefinition(StateDefinition.Builder p_52469_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/DiodeBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DiodeBlock.java.patch index 7ac229ec78..024abe6a42 100644 --- a/patches/minecraft/net/minecraft/world/level/block/DiodeBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/DiodeBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/DiodeBlock.java +++ b/net/minecraft/world/level/block/DiodeBlock.java -@@ -159,6 +_,8 @@ +@@ -162,6 +_,8 @@ protected void updateNeighborsInFront(Level p_52581_, BlockPos p_52582_, BlockState p_52583_) { Direction direction = p_52583_.getValue(FACING); BlockPos blockpos = p_52582_.relative(direction.getOpposite()); diff --git a/patches/minecraft/net/minecraft/world/level/block/DoublePlantBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DoublePlantBlock.java.patch index 42a47ef43a..124e43dc65 100644 --- a/patches/minecraft/net/minecraft/world/level/block/DoublePlantBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/DoublePlantBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/DoublePlantBlock.java +++ b/net/minecraft/world/level/block/DoublePlantBlock.java -@@ -54,6 +_,7 @@ +@@ -60,6 +_,7 @@ return super.canSurvive(p_52887_, p_52888_, p_52889_); } else { BlockState blockstate = p_52888_.getBlockState(p_52889_.below()); diff --git a/patches/minecraft/net/minecraft/world/level/block/DropExperienceBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DropExperienceBlock.java.patch index 86f74c0a05..354ac2e4e8 100644 --- a/patches/minecraft/net/minecraft/world/level/block/DropExperienceBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/DropExperienceBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/DropExperienceBlock.java +++ b/net/minecraft/world/level/block/DropExperienceBlock.java -@@ -22,9 +_,11 @@ +@@ -28,9 +_,11 @@ public void spawnAfterBreak(BlockState p_221086_, ServerLevel p_221087_, BlockPos p_221088_, ItemStack p_221089_, boolean p_221090_) { super.spawnAfterBreak(p_221086_, p_221087_, p_221088_, p_221089_, p_221090_); diff --git a/patches/minecraft/net/minecraft/world/level/block/DropperBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/DropperBlock.java.patch index 440b1d05b8..9a56f8e911 100644 --- a/patches/minecraft/net/minecraft/world/level/block/DropperBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/DropperBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/DropperBlock.java +++ b/net/minecraft/world/level/block/DropperBlock.java -@@ -45,7 +_,7 @@ +@@ -51,7 +_,7 @@ p_52944_.levelEvent(1001, p_52945_, 0); } else { ItemStack itemstack = dispenserblockentity.getItem(i); diff --git a/patches/minecraft/net/minecraft/world/level/block/EnchantmentTableBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/EnchantmentTableBlock.java.patch index 30dfa992f8..c9368d2cd5 100644 --- a/patches/minecraft/net/minecraft/world/level/block/EnchantmentTableBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/EnchantmentTableBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/EnchantmentTableBlock.java +++ b/net/minecraft/world/level/block/EnchantmentTableBlock.java -@@ -41,7 +_,7 @@ +@@ -47,7 +_,7 @@ } public static boolean isValidBookShelf(Level p_207910_, BlockPos p_207911_, BlockPos p_207912_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch index 39f133774d..665fd69d68 100644 --- a/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/FarmBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/FarmBlock.java +++ b/net/minecraft/world/level/block/FarmBlock.java -@@ -84,7 +_,7 @@ +@@ -90,7 +_,7 @@ } public void fallOn(Level p_153227_, BlockState p_153228_, BlockPos p_153229_, Entity p_153230_, float p_153231_) { @@ -9,7 +9,7 @@ turnToDirt(p_153230_, p_153228_, p_153227_, p_153229_); } -@@ -98,17 +_,20 @@ +@@ -104,17 +_,20 @@ } private static boolean shouldMaintainFarmland(BlockGetter p_279219_, BlockPos p_279209_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/FenceGateBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/FenceGateBlock.java.patch index 185bfe1a66..aef2e5680c 100644 --- a/patches/minecraft/net/minecraft/world/level/block/FenceGateBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/FenceGateBlock.java.patch @@ -1,26 +1,30 @@ --- a/net/minecraft/world/level/block/FenceGateBlock.java +++ b/net/minecraft/world/level/block/FenceGateBlock.java -@@ -41,11 +_,16 @@ - protected static final VoxelShape X_OCCLUSION_SHAPE = Shapes.or(Block.box(7.0D, 5.0D, 0.0D, 9.0D, 16.0D, 2.0D), Block.box(7.0D, 5.0D, 14.0D, 9.0D, 16.0D, 16.0D)); +@@ -52,14 +_,21 @@ protected static final VoxelShape Z_OCCLUSION_SHAPE_LOW = Shapes.or(Block.box(0.0D, 2.0D, 7.0D, 2.0D, 13.0D, 9.0D), Block.box(14.0D, 2.0D, 7.0D, 16.0D, 13.0D, 9.0D)); protected static final VoxelShape X_OCCLUSION_SHAPE_LOW = Shapes.or(Block.box(7.0D, 2.0D, 0.0D, 9.0D, 13.0D, 2.0D), Block.box(7.0D, 2.0D, 14.0D, 9.0D, 13.0D, 16.0D)); -- private final WoodType type; + private final WoodType type; + private final net.minecraft.sounds.SoundEvent openSound; + private final net.minecraft.sounds.SoundEvent closeSound; - public FenceGateBlock(BlockBehaviour.Properties p_273352_, WoodType p_273340_) { + public MapCodec codec() { + return CODEC; + } + + public FenceGateBlock(WoodType p_273340_, BlockBehaviour.Properties p_273352_) { - super(p_273352_.sound(p_273340_.soundType())); - this.type = p_273340_; -+ this(p_273352_.sound(p_273340_.soundType()), p_273340_.fenceGateOpen(), p_273340_.fenceGateClose()); ++ this(p_273352_.sound(p_273340_.soundType()), p_273340_.fenceGateOpen(), p_273340_.fenceGateClose(), p_273340_); + } -+ public FenceGateBlock(BlockBehaviour.Properties props, net.minecraft.sounds.SoundEvent openSound, net.minecraft.sounds.SoundEvent closeSound) { ++ public FenceGateBlock(BlockBehaviour.Properties props, net.minecraft.sounds.SoundEvent openSound, net.minecraft.sounds.SoundEvent closeSound, WoodType woodType) { + super(props); ++ this.type = woodType; + this.openSound = openSound; + this.closeSound = closeSound; this.registerDefaultState(this.stateDefinition.any().setValue(OPEN, Boolean.valueOf(false)).setValue(POWERED, Boolean.valueOf(false)).setValue(IN_WALL, Boolean.valueOf(false))); } -@@ -133,7 +_,7 @@ +@@ -147,7 +_,7 @@ } boolean flag = p_53365_.getValue(OPEN); @@ -29,7 +33,16 @@ p_53366_.gameEvent(p_53368_, flag ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, p_53367_); return InteractionResult.sidedSuccess(p_53366_.isClientSide); } -@@ -144,7 +_,7 @@ +@@ -156,7 +_,7 @@ + if (p_312135_.getBlockInteraction() == Explosion.BlockInteraction.TRIGGER_BLOCK && !p_310915_.isClientSide() && !p_311339_.getValue(POWERED)) { + boolean flag = p_311339_.getValue(OPEN); + p_310915_.setBlockAndUpdate(p_311232_, p_311339_.setValue(OPEN, Boolean.valueOf(!flag))); +- p_310915_.playSound((Player)null, p_311232_, flag ? this.type.fenceGateClose() : this.type.fenceGateOpen(), SoundSource.BLOCKS, 1.0F, p_310915_.getRandom().nextFloat() * 0.1F + 0.9F); ++ p_310915_.playSound((Player)null, p_311232_, flag ? this.closeSound : this.openSound, SoundSource.BLOCKS, 1.0F, p_310915_.getRandom().nextFloat() * 0.1F + 0.9F); + p_310915_.gameEvent(flag ? GameEvent.BLOCK_CLOSE : GameEvent.BLOCK_OPEN, p_311232_, GameEvent.Context.of(p_311339_)); + } + +@@ -169,7 +_,7 @@ if (p_53372_.getValue(POWERED) != flag) { p_53373_.setBlock(p_53374_, p_53372_.setValue(POWERED, Boolean.valueOf(flag)).setValue(OPEN, Boolean.valueOf(flag)), 2); if (p_53372_.getValue(OPEN) != flag) { diff --git a/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch index 289dd71c69..36f011a91e 100644 --- a/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/FireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/FireBlock.java +++ b/net/minecraft/world/level/block/FireBlock.java -@@ -104,13 +_,13 @@ +@@ -110,13 +_,13 @@ protected BlockState getStateForPlacement(BlockGetter p_53471_, BlockPos p_53472_) { BlockPos blockpos = p_53472_.below(); BlockState blockstate = p_53471_.getBlockState(blockpos); @@ -16,7 +16,7 @@ } } -@@ -129,14 +_,14 @@ +@@ -135,14 +_,14 @@ p_221161_.scheduleTick(p_221162_, this, getFireTickDelay(p_221161_.random)); if (p_221161_.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { if (!p_221160_.canSurvive(p_221161_, p_221162_)) { @@ -33,7 +33,7 @@ } else { int j = Math.min(15, i + p_221163_.nextInt(3) / 2); if (i != j) { -@@ -154,7 +_,7 @@ +@@ -160,7 +_,7 @@ return; } @@ -42,7 +42,7 @@ p_221161_.removeBlock(p_221162_, false); return; } -@@ -162,12 +_,12 @@ +@@ -168,12 +_,12 @@ boolean flag1 = p_221161_.getBiome(p_221162_).is(BiomeTags.INCREASED_FIRE_BURNOUT); int k = flag1 ? -50 : 0; @@ -61,7 +61,7 @@ BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); for(int l = -1; l <= 1; ++l) { -@@ -205,28 +_,27 @@ +@@ -211,28 +_,27 @@ return p_53429_.isRainingAt(p_53430_) || p_53429_.isRainingAt(p_53430_.west()) || p_53429_.isRainingAt(p_53430_.east()) || p_53429_.isRainingAt(p_53430_.north()) || p_53429_.isRainingAt(p_53430_.south()); } @@ -102,7 +102,7 @@ } } -@@ -239,7 +_,7 @@ +@@ -245,7 +_,7 @@ private boolean isValidFireLocation(BlockGetter p_53486_, BlockPos p_53487_) { for(Direction direction : Direction.values()) { @@ -111,7 +111,7 @@ return true; } } -@@ -255,13 +_,14 @@ +@@ -261,13 +_,14 @@ for(Direction direction : Direction.values()) { BlockState blockstate = p_221157_.getBlockState(p_221158_.relative(direction)); @@ -127,10 +127,10 @@ protected boolean canBurn(BlockState p_53489_) { return this.getIgniteOdds(p_53489_) > 0; } -@@ -280,8 +_,21 @@ +@@ -286,8 +_,21 @@ } - private void setFlammable(Block p_53445_, int p_53446_, int p_53447_) { + public void setFlammable(Block p_53445_, int p_53446_, int p_53447_) { + if (p_53445_ == Blocks.AIR) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); this.igniteOdds.put(p_53445_, p_53446_); this.burnOdds.put(p_53445_, p_53447_); diff --git a/patches/minecraft/net/minecraft/world/level/block/FlowerPotBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/FlowerPotBlock.java.patch index d81dfb2f89..3b46e57566 100644 --- a/patches/minecraft/net/minecraft/world/level/block/FlowerPotBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/FlowerPotBlock.java.patch @@ -1,13 +1,13 @@ --- a/net/minecraft/world/level/block/FlowerPotBlock.java +++ b/net/minecraft/world/level/block/FlowerPotBlock.java -@@ -28,10 +_,33 @@ - protected static final VoxelShape SHAPE = Block.box(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D); - private final Block content; +@@ -41,10 +_,33 @@ + return CODEC; + } + @Deprecated // Mods should use the constructor below public FlowerPotBlock(Block p_53528_, BlockBehaviour.Properties p_53529_) { - super(p_53529_); -- this.content = p_53528_; +- this.potted = p_53528_; - POTTED_BY_CONTENT.put(p_53528_, this); + this(Blocks.FLOWER_POT == null ? null : () -> (FlowerPotBlock) net.minecraftforge.registries.ForgeRegistries.BLOCKS.getDelegateOrThrow(Blocks.FLOWER_POT).get(), () -> net.minecraftforge.registries.ForgeRegistries.BLOCKS.getDelegateOrThrow(p_53528_).get(), p_53529_); + if (Blocks.FLOWER_POT != null) { @@ -25,7 +25,7 @@ + */ + public FlowerPotBlock(@org.jetbrains.annotations.Nullable java.util.function.Supplier emptyPot, java.util.function.Supplier p_53528_, BlockBehaviour.Properties properties) { + super(properties); -+ this.content = null; // Unused, redirected by coremod ++ this.potted = null; // Unused, redirected by coremod + this.flowerDelegate = p_53528_; + if (emptyPot == null) { + this.fullPots = Maps.newHashMap(); @@ -37,7 +37,7 @@ } public VoxelShape getShape(BlockState p_53556_, BlockGetter p_53557_, BlockPos p_53558_, CollisionContext p_53559_) { -@@ -45,7 +_,7 @@ +@@ -58,7 +_,7 @@ public InteractionResult use(BlockState p_53540_, Level p_53541_, BlockPos p_53542_, Player p_53543_, InteractionHand p_53544_, BlockHitResult p_53545_) { ItemStack itemstack = p_53543_.getItemInHand(p_53544_); Item item = itemstack.getItem(); @@ -46,7 +46,7 @@ boolean flag = blockstate.is(Blocks.AIR); boolean flag1 = this.isEmpty(); if (flag != flag1) { -@@ -63,7 +_,7 @@ +@@ -76,7 +_,7 @@ p_53543_.drop(itemstack1, false); } @@ -55,19 +55,18 @@ } p_53541_.gameEvent(p_53543_, GameEvent.BLOCK_CHANGE, p_53542_); -@@ -86,10 +_,31 @@ +@@ -99,10 +_,29 @@ } - public Block getContent() { -- return this.content; + public Block getPotted() { +- return this.potted; + return flowerDelegate.get(); } public boolean isPathfindable(BlockState p_53535_, BlockGetter p_53536_, BlockPos p_53537_, PathComputationType p_53538_) { return false; - } ++ } + -+ //Forge Start + private final Map> fullPots; + private final java.util.function.Supplier emptyPot; + private final java.util.function.Supplier flowerDelegate; @@ -85,6 +84,5 @@ + + public Map> getFullPotsView() { + return java.util.Collections.unmodifiableMap(fullPots); -+ } -+ //Forge End + } } diff --git a/patches/minecraft/net/minecraft/world/level/block/FungusBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/FungusBlock.java.patch index ba8aa5eb9c..e9036bc5c7 100644 --- a/patches/minecraft/net/minecraft/world/level/block/FungusBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/FungusBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/FungusBlock.java +++ b/net/minecraft/world/level/block/FungusBlock.java -@@ -52,7 +_,9 @@ +@@ -66,7 +_,9 @@ public void performBonemeal(ServerLevel p_221243_, RandomSource p_221244_, BlockPos p_221245_, BlockState p_221246_) { this.getFeature(p_221243_).ifPresent((p_256352_) -> { diff --git a/patches/minecraft/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch index 2758e6e18c..f410eacc1d 100644 --- a/patches/minecraft/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java +++ b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java -@@ -35,10 +_,11 @@ +@@ -38,10 +_,11 @@ } public void randomTick(BlockState p_221350_, ServerLevel p_221351_, BlockPos p_221352_, RandomSource p_221353_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch index ce0dcd2334..9f6fb33003 100644 --- a/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/LeavesBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/level/block/LeavesBlock.java +++ b/net/minecraft/world/level/block/LeavesBlock.java -@@ -23,7 +_,7 @@ +@@ -24,7 +_,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -public class LeavesBlock extends Block implements SimpleWaterloggedBlock { +public class LeavesBlock extends Block implements SimpleWaterloggedBlock, net.minecraftforge.common.IForgeShearable { + public static final MapCodec CODEC = simpleCodec(LeavesBlock::new); public static final int DECAY_DISTANCE = 7; public static final IntegerProperty DISTANCE = BlockStateProperties.DISTANCE; - public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; diff --git a/patches/minecraft/net/minecraft/world/level/block/LiquidBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/LiquidBlock.java.patch index 3da5f2047f..b309f6376b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/LiquidBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/LiquidBlock.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/level/block/LiquidBlock.java +++ b/net/minecraft/world/level/block/LiquidBlock.java -@@ -32,11 +_,13 @@ - - public class LiquidBlock extends Block implements BucketPickup { +@@ -56,7 +_,8 @@ + }), propertiesCodec()).apply(p_310157_, LiquidBlock::new); + }); public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL; - protected final FlowingFluid fluid; + @Deprecated // Use getFluid @@ -10,12 +10,15 @@ private final List stateCache; public static final VoxelShape STABLE_SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D); public static final ImmutableList POSSIBLE_FLOW_DIRECTIONS = ImmutableList.of(Direction.DOWN, Direction.SOUTH, Direction.NORTH, Direction.EAST, Direction.WEST); +@@ -65,6 +_,7 @@ + return CODEC; + } + @Deprecated // Forge: Use the constructor that takes a supplier public LiquidBlock(FlowingFluid p_54694_, BlockBehaviour.Properties p_54695_) { super(p_54695_); this.fluid = p_54694_; -@@ -49,6 +_,19 @@ +@@ -77,6 +_,19 @@ this.stateCache.add(p_54694_.getFlowing(8, true)); this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0))); @@ -35,7 +38,7 @@ } public VoxelShape getCollisionShape(BlockState p_54760_, BlockGetter p_54761_, BlockPos p_54762_, CollisionContext p_54763_) { -@@ -73,6 +_,7 @@ +@@ -101,6 +_,7 @@ public FluidState getFluidState(BlockState p_54765_) { int i = p_54765_.getValue(LEVEL); @@ -43,7 +46,7 @@ return this.stateCache.get(Math.min(i, 8)); } -@@ -93,7 +_,7 @@ +@@ -121,7 +_,7 @@ } public void onPlace(BlockState p_54754_, Level p_54755_, BlockPos p_54756_, BlockState p_54757_, boolean p_54758_) { @@ -52,7 +55,7 @@ p_54755_.scheduleTick(p_54756_, p_54754_.getFluidState().getType(), this.fluid.getTickDelay(p_54755_)); } -@@ -108,12 +_,13 @@ +@@ -136,12 +_,13 @@ } public void neighborChanged(BlockState p_54709_, Level p_54710_, BlockPos p_54711_, Block p_54712_, BlockPos p_54713_, boolean p_54714_) { @@ -67,7 +70,7 @@ private boolean shouldSpreadLiquid(Level p_54697_, BlockPos p_54698_, BlockState p_54699_) { if (this.fluid.is(FluidTags.LAVA)) { boolean flag = p_54697_.getBlockState(p_54698_.below()).is(Blocks.SOUL_SOIL); -@@ -152,6 +_,25 @@ +@@ -180,6 +_,25 @@ return new ItemStack(this.fluid.getBucket()); } else { return ItemStack.EMPTY; diff --git a/patches/minecraft/net/minecraft/world/level/block/MushroomBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/MushroomBlock.java.patch index 7112a1ae78..519df2145c 100644 --- a/patches/minecraft/net/minecraft/world/level/block/MushroomBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/MushroomBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/MushroomBlock.java +++ b/net/minecraft/world/level/block/MushroomBlock.java -@@ -72,7 +_,7 @@ +@@ -83,7 +_,7 @@ if (blockstate.is(BlockTags.MUSHROOM_GROW_BLOCK)) { return true; } else { @@ -9,7 +9,7 @@ } } -@@ -81,8 +_,10 @@ +@@ -92,8 +_,10 @@ if (optional.isEmpty()) { return false; } else { diff --git a/patches/minecraft/net/minecraft/world/level/block/NetherWartBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/NetherWartBlock.java.patch index f71a5213f2..3b8fc80e29 100644 --- a/patches/minecraft/net/minecraft/world/level/block/NetherWartBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/NetherWartBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/NetherWartBlock.java +++ b/net/minecraft/world/level/block/NetherWartBlock.java -@@ -38,9 +_,10 @@ +@@ -45,9 +_,10 @@ public void randomTick(BlockState p_221806_, ServerLevel p_221807_, BlockPos p_221808_, RandomSource p_221809_) { int i = p_221806_.getValue(AGE); diff --git a/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch index 3b9b09d2b5..3b04944441 100644 --- a/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/NoteBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/NoteBlock.java +++ b/net/minecraft/world/level/block/NoteBlock.java -@@ -89,7 +_,9 @@ +@@ -95,7 +_,9 @@ } else if (p_55035_.isClientSide) { return InteractionResult.SUCCESS; } else { @@ -11,7 +11,7 @@ p_55035_.setBlock(p_55036_, p_55034_, 3); this.playNote(p_55037_, p_55034_, p_55035_, p_55036_); p_55037_.awardStat(Stats.TUNE_NOTEBLOCK); -@@ -109,6 +_,9 @@ +@@ -115,6 +_,9 @@ } public boolean triggerEvent(BlockState p_55023_, Level p_55024_, BlockPos p_55025_, int p_55026_, int p_55027_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/PowderSnowBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/PowderSnowBlock.java.patch index fc9a085cd9..89e5762be9 100644 --- a/patches/minecraft/net/minecraft/world/level/block/PowderSnowBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/PowderSnowBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/PowderSnowBlock.java +++ b/net/minecraft/world/level/block/PowderSnowBlock.java -@@ -108,7 +_,7 @@ +@@ -114,7 +_,7 @@ if (p_154256_.getType().is(EntityTypeTags.POWDER_SNOW_WALKABLE_MOBS)) { return true; } else { diff --git a/patches/minecraft/net/minecraft/world/level/block/PoweredRailBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/PoweredRailBlock.java.patch index 8c5f6474a5..f3277b768b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/PoweredRailBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/PoweredRailBlock.java.patch @@ -1,11 +1,15 @@ --- a/net/minecraft/world/level/block/PoweredRailBlock.java +++ b/net/minecraft/world/level/block/PoweredRailBlock.java -@@ -14,9 +_,19 @@ - public class PoweredRailBlock extends BaseRailBlock { +@@ -16,13 +_,23 @@ + public static final MapCodec CODEC = simpleCodec(PoweredRailBlock::new); public static final EnumProperty SHAPE = BlockStateProperties.RAIL_SHAPE_STRAIGHT; public static final BooleanProperty POWERED = BlockStateProperties.POWERED; + private final boolean isActivator; // TRUE for an Activator Rail, FALSE for Powered Rail + public MapCodec codec() { + return CODEC; + } + public PoweredRailBlock(BlockBehaviour.Properties p_55218_) { + this(p_55218_, false); + } @@ -20,7 +24,7 @@ this.registerDefaultState(this.stateDefinition.any().setValue(SHAPE, RailShape.NORTH_SOUTH).setValue(POWERED, Boolean.valueOf(false)).setValue(WATERLOGGED, Boolean.valueOf(false))); } -@@ -28,7 +_,7 @@ +@@ -34,7 +_,7 @@ int j = p_55221_.getY(); int k = p_55221_.getZ(); boolean flag = true; @@ -29,7 +33,7 @@ switch (railshape) { case NORTH_SOUTH: if (p_55223_) { -@@ -99,14 +_,14 @@ +@@ -105,14 +_,14 @@ protected boolean isSameRailWithPower(Level p_55226_, BlockPos p_55227_, boolean p_55228_, int p_55229_, RailShape p_55230_) { BlockState blockstate = p_55226_.getBlockState(p_55227_); @@ -48,7 +52,7 @@ } else { return false; } -@@ -125,7 +_,7 @@ +@@ -131,7 +_,7 @@ if (flag1 != flag) { p_55233_.setBlock(p_55234_, p_55232_.setValue(POWERED, Boolean.valueOf(flag1)), 3); p_55233_.updateNeighborsAt(p_55234_.below(), this); @@ -57,7 +61,7 @@ p_55233_.updateNeighborsAt(p_55234_.above(), this); } } -@@ -156,6 +_,9 @@ +@@ -162,6 +_,9 @@ return p_55240_.setValue(SHAPE, RailShape.SOUTH_EAST); case NORTH_EAST: return p_55240_.setValue(SHAPE, RailShape.SOUTH_WEST); @@ -67,7 +71,7 @@ } case COUNTERCLOCKWISE_90: switch ((RailShape)p_55240_.getValue(SHAPE)) { -@@ -253,6 +_,10 @@ +@@ -259,6 +_,10 @@ } protected void createBlockStateDefinition(StateDefinition.Builder p_55243_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/PumpkinBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/PumpkinBlock.java.patch index 65897564a2..13689a8d69 100644 --- a/patches/minecraft/net/minecraft/world/level/block/PumpkinBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/PumpkinBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/PumpkinBlock.java +++ b/net/minecraft/world/level/block/PumpkinBlock.java -@@ -24,7 +_,7 @@ +@@ -31,7 +_,7 @@ public InteractionResult use(BlockState p_55289_, Level p_55290_, BlockPos p_55291_, Player p_55292_, InteractionHand p_55293_, BlockHitResult p_55294_) { ItemStack itemstack = p_55292_.getItemInHand(p_55293_); diff --git a/patches/minecraft/net/minecraft/world/level/block/RailBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/RailBlock.java.patch deleted file mode 100644 index 23751dbcac..0000000000 --- a/patches/minecraft/net/minecraft/world/level/block/RailBlock.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/world/level/block/RailBlock.java -+++ b/net/minecraft/world/level/block/RailBlock.java -@@ -49,6 +_,9 @@ - return p_55405_.setValue(SHAPE, RailShape.SOUTH_EAST); - case NORTH_EAST: - return p_55405_.setValue(SHAPE, RailShape.SOUTH_WEST); -+ case NORTH_SOUTH: //Forge fix: MC-196102 -+ case EAST_WEST: -+ return p_55405_; - } - case COUNTERCLOCKWISE_90: - switch ((RailShape)p_55405_.getValue(SHAPE)) { diff --git a/patches/minecraft/net/minecraft/world/level/block/RedStoneOreBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/RedStoneOreBlock.java.patch index 699b06ee61..5206dbb0e0 100644 --- a/patches/minecraft/net/minecraft/world/level/block/RedStoneOreBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/RedStoneOreBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/RedStoneOreBlock.java +++ b/net/minecraft/world/level/block/RedStoneOreBlock.java -@@ -74,11 +_,11 @@ +@@ -80,11 +_,11 @@ public void spawnAfterBreak(BlockState p_221907_, ServerLevel p_221908_, BlockPos p_221909_, ItemStack p_221910_, boolean p_221911_) { super.spawnAfterBreak(p_221907_, p_221908_, p_221909_, p_221910_, p_221911_); diff --git a/patches/minecraft/net/minecraft/world/level/block/RedStoneWireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/RedStoneWireBlock.java.patch index aa42fb45fa..21497371c2 100644 --- a/patches/minecraft/net/minecraft/world/level/block/RedStoneWireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/RedStoneWireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/RedStoneWireBlock.java +++ b/net/minecraft/world/level/block/RedStoneWireBlock.java -@@ -196,7 +_,7 @@ +@@ -202,7 +_,7 @@ BlockState blockstate = p_55523_.getBlockState(blockpos); if (p_55526_) { boolean flag = blockstate.getBlock() instanceof TrapDoorBlock || this.canSurviveOn(p_55523_, blockpos, blockstate); @@ -9,7 +9,7 @@ if (blockstate.isFaceSturdy(p_55523_, blockpos, p_55525_.getOpposite())) { return RedstoneSide.UP; } -@@ -205,7 +_,14 @@ +@@ -211,7 +_,14 @@ } } diff --git a/patches/minecraft/net/minecraft/world/level/block/SaplingBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SaplingBlock.java.patch index 3b9f6227f8..f9365cfb47 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SaplingBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SaplingBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SaplingBlock.java +++ b/net/minecraft/world/level/block/SaplingBlock.java -@@ -32,6 +_,7 @@ +@@ -43,6 +_,7 @@ } public void randomTick(BlockState p_222011_, ServerLevel p_222012_, BlockPos p_222013_, RandomSource p_222014_) { diff --git a/patches/minecraft/net/minecraft/world/level/block/SculkCatalystBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SculkCatalystBlock.java.patch index 9148c57d9e..3a333613d5 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SculkCatalystBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SculkCatalystBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SculkCatalystBlock.java +++ b/net/minecraft/world/level/block/SculkCatalystBlock.java -@@ -54,9 +_,11 @@ +@@ -60,9 +_,11 @@ public void spawnAfterBreak(BlockState p_222109_, ServerLevel p_222110_, BlockPos p_222111_, ItemStack p_222112_, boolean p_222113_) { super.spawnAfterBreak(p_222109_, p_222110_, p_222111_, p_222112_, p_222113_); diff --git a/patches/minecraft/net/minecraft/world/level/block/SculkSensorBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SculkSensorBlock.java.patch index 51e919c695..da64862a8b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SculkSensorBlock.java.patch +++ b/patches/minecraft/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 -@@ -252,9 +_,11 @@ +@@ -258,9 +_,11 @@ public 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/minecraft/net/minecraft/world/level/block/SculkShriekerBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SculkShriekerBlock.java.patch index 0a5347144a..c01afce043 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SculkShriekerBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SculkShriekerBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SculkShriekerBlock.java +++ b/net/minecraft/world/level/block/SculkShriekerBlock.java -@@ -121,10 +_,12 @@ +@@ -127,10 +_,12 @@ public void spawnAfterBreak(BlockState p_222192_, ServerLevel p_222193_, BlockPos p_222194_, ItemStack p_222195_, boolean p_222196_) { super.spawnAfterBreak(p_222192_, p_222193_, p_222194_, p_222195_, p_222196_); diff --git a/patches/minecraft/net/minecraft/world/level/block/SeagrassBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SeagrassBlock.java.patch index 3961b88d01..f6bae9c40b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SeagrassBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SeagrassBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/level/block/SeagrassBlock.java +++ b/net/minecraft/world/level/block/SeagrassBlock.java -@@ -21,7 +_,7 @@ +@@ -22,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class SeagrassBlock extends BushBlock implements BonemealableBlock, LiquidBlockContainer { +public class SeagrassBlock extends BushBlock implements BonemealableBlock, LiquidBlockContainer, net.minecraftforge.common.IForgeShearable { + public static final MapCodec CODEC = simpleCodec(SeagrassBlock::new); protected static final float AABB_OFFSET = 6.0F; protected static final VoxelShape SHAPE = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D); - diff --git a/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch b/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch index d4fae45a72..6885cb955b 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SoundType.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SoundType.java +++ b/net/minecraft/world/level/block/SoundType.java -@@ -117,6 +_,7 @@ +@@ -122,6 +_,7 @@ private final SoundEvent hitSound; private final SoundEvent fallSound; diff --git a/patches/minecraft/net/minecraft/world/level/block/SpawnerBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SpawnerBlock.java.patch index 1889161870..363c50bcd8 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SpawnerBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SpawnerBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SpawnerBlock.java +++ b/net/minecraft/world/level/block/SpawnerBlock.java -@@ -39,11 +_,12 @@ +@@ -40,11 +_,12 @@ public void spawnAfterBreak(BlockState p_222477_, ServerLevel p_222478_, BlockPos p_222479_, ItemStack p_222480_, boolean p_222481_) { super.spawnAfterBreak(p_222477_, p_222478_, p_222479_, p_222480_, p_222481_); diff --git a/patches/minecraft/net/minecraft/world/level/block/SpongeBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SpongeBlock.java.patch index 70bd17368a..bfe6b860c1 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SpongeBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SpongeBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SpongeBlock.java +++ b/net/minecraft/world/level/block/SpongeBlock.java -@@ -41,6 +_,7 @@ +@@ -47,6 +_,7 @@ } private boolean removeWaterBreadthFirstSearch(Level p_56808_, BlockPos p_56809_) { @@ -8,7 +8,7 @@ return BlockPos.breadthFirstTraversal(p_56809_, 6, 65, (p_277519_, p_277492_) -> { for(Direction direction : ALL_DIRECTIONS) { p_277492_.accept(p_277519_.relative(direction)); -@@ -52,7 +_,7 @@ +@@ -58,7 +_,7 @@ } else { BlockState blockstate = p_56808_.getBlockState(p_296944_); FluidState fluidstate = p_56808_.getFluidState(p_296944_); diff --git a/patches/minecraft/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch index 7499c06d08..0600f87a83 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java +++ b/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java -@@ -35,8 +_,10 @@ +@@ -38,8 +_,10 @@ public void randomTick(BlockState p_222508_, ServerLevel p_222509_, BlockPos p_222510_, RandomSource p_222511_) { if (!canBeGrass(p_222508_, p_222509_, p_222510_)) { diff --git a/patches/minecraft/net/minecraft/world/level/block/StairBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/StairBlock.java.patch deleted file mode 100644 index 438df5fcfe..0000000000 --- a/patches/minecraft/net/minecraft/world/level/block/StairBlock.java.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/net/minecraft/world/level/block/StairBlock.java -+++ b/net/minecraft/world/level/block/StairBlock.java -@@ -81,11 +_,21 @@ - return voxelshape; - } - -+ @Deprecated // Forge: Use the other constructor that takes a Supplier - public StairBlock(BlockState p_56862_, BlockBehaviour.Properties p_56863_) { - super(p_56863_); - this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(HALF, Half.BOTTOM).setValue(SHAPE, StairsShape.STRAIGHT).setValue(WATERLOGGED, Boolean.valueOf(false))); - this.base = p_56862_.getBlock(); - this.baseState = p_56862_; -+ this.stateSupplier = () -> p_56862_; -+ } -+ -+ public StairBlock(java.util.function.Supplier state, BlockBehaviour.Properties properties) { -+ super(properties); -+ this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(HALF, Half.BOTTOM).setValue(SHAPE, StairsShape.STRAIGHT).setValue(WATERLOGGED, Boolean.valueOf(false))); -+ this.base = Blocks.AIR; // These are unused, fields are redirected -+ this.baseState = Blocks.AIR.defaultBlockState(); -+ this.stateSupplier = state; - } - - public boolean useShapeForLightOcclusion(BlockState p_56967_) { -@@ -262,4 +_,14 @@ - public boolean isPathfindable(BlockState p_56891_, BlockGetter p_56892_, BlockPos p_56893_, PathComputationType p_56894_) { - return false; - } -+ -+ // Forge Start -+ private final java.util.function.Supplier stateSupplier; -+ private Block getModelBlock() { -+ return getModelState().getBlock(); -+ } -+ private BlockState getModelState() { -+ return stateSupplier.get(); -+ } -+ // Forge end - } diff --git a/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch index 259285b65f..9aca878ef9 100644 --- a/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/StemBlock.java +++ b/net/minecraft/world/level/block/StemBlock.java -@@ -44,22 +_,23 @@ +@@ -65,17 +_,18 @@ } public void randomTick(BlockState p_222538_, ServerLevel p_222539_, BlockPos p_222540_, RandomSource p_222541_) { @@ -18,20 +18,22 @@ Direction direction = Direction.Plane.HORIZONTAL.getRandomDirection(p_222541_); BlockPos blockpos = p_222540_.relative(direction); BlockState blockstate = p_222539_.getBlockState(blockpos.below()); -- if (p_222539_.getBlockState(blockpos).isAir() && (blockstate.is(Blocks.FARMLAND) || blockstate.is(BlockTags.DIRT))) { -+ if (p_222539_.isEmptyBlock(blockpos) && (blockstate.canSustainPlant(p_222539_, blockpos.below(), Direction.UP, this.fruit) || blockstate.is(Blocks.FARMLAND) || blockstate.is(BlockTags.DIRT))) { - p_222539_.setBlockAndUpdate(blockpos, this.fruit.defaultBlockState()); - p_222539_.setBlockAndUpdate(p_222540_, this.fruit.getAttachedStem().defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, direction)); ++ // Forge: TODO: Soil blockstate.canSustainPlant(p_222539_, blockpos.below(), Direction.UP, this.fruit) + if (p_222539_.getBlockState(blockpos).isAir() && (blockstate.is(Blocks.FARMLAND) || blockstate.is(BlockTags.DIRT))) { + Registry registry = p_222539_.registryAccess().registryOrThrow(Registries.BLOCK); + Optional optional = registry.getOptional(this.fruit); +@@ -86,6 +_,7 @@ + } } } + net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_222539_, p_222540_, p_222538_); } } -@@ -93,5 +_,11 @@ +@@ -115,5 +_,11 @@ - public StemGrownBlock getFruit() { - return this.fruit; + protected void createBlockStateDefinition(StateDefinition.Builder p_57040_) { + p_57040_.add(AGE); + } + + //FORGE START diff --git a/patches/minecraft/net/minecraft/world/level/block/StemGrownBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/StemGrownBlock.java.patch deleted file mode 100644 index 00c9593bc9..0000000000 --- a/patches/minecraft/net/minecraft/world/level/block/StemGrownBlock.java.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/net/minecraft/world/level/block/StemGrownBlock.java -+++ b/net/minecraft/world/level/block/StemGrownBlock.java -@@ -2,7 +_,7 @@ - - import net.minecraft.world.level.block.state.BlockBehaviour; - --public abstract class StemGrownBlock extends Block { -+public abstract class StemGrownBlock extends Block implements net.minecraftforge.common.IPlantable { - public StemGrownBlock(BlockBehaviour.Properties p_57058_) { - super(p_57058_); - } -@@ -10,4 +_,12 @@ - public abstract StemBlock getStem(); - - public abstract AttachedStemBlock getAttachedStem(); -+ -+ //FORGE START -+ @Override -+ public net.minecraft.world.level.block.state.BlockState getPlant(net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos) { -+ net.minecraft.world.level.block.state.BlockState state = world.getBlockState(pos); -+ if (state.getBlock() != this) return defaultBlockState(); -+ return state; -+ } - } diff --git a/patches/minecraft/net/minecraft/world/level/block/SugarCaneBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SugarCaneBlock.java.patch index 2715ce690c..87de9a994a 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SugarCaneBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SugarCaneBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/net/minecraft/world/level/block/SugarCaneBlock.java -@@ -18,7 +_,7 @@ +@@ -19,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class SugarCaneBlock extends Block { +public class SugarCaneBlock extends Block implements net.minecraftforge.common.IPlantable { + public static final MapCodec CODEC = simpleCodec(SugarCaneBlock::new); public static final IntegerProperty AGE = BlockStateProperties.AGE_15; protected static final float AABB_OFFSET = 6.0F; - protected static final VoxelShape SHAPE = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D); -@@ -47,12 +_,15 @@ +@@ -53,12 +_,15 @@ if (i < 3) { int j = p_222548_.getValue(AGE); @@ -25,7 +25,7 @@ } } -@@ -67,6 +_,8 @@ +@@ -73,6 +_,8 @@ } public boolean canSurvive(BlockState p_57175_, LevelReader p_57176_, BlockPos p_57177_) { @@ -34,7 +34,7 @@ BlockState blockstate = p_57176_.getBlockState(p_57177_.below()); if (blockstate.is(this)) { return true; -@@ -77,7 +_,7 @@ +@@ -83,7 +_,7 @@ for(Direction direction : Direction.Plane.HORIZONTAL) { BlockState blockstate1 = p_57176_.getBlockState(blockpos.relative(direction)); FluidState fluidstate = p_57176_.getFluidState(blockpos.relative(direction)); @@ -43,7 +43,7 @@ return true; } } -@@ -89,5 +_,15 @@ +@@ -95,5 +_,15 @@ protected void createBlockStateDefinition(StateDefinition.Builder p_57186_) { p_57186_.add(AGE); diff --git a/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch index 1321fe99bf..afd52342ed 100644 --- a/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SweetBerryBushBlock.java +++ b/net/minecraft/world/level/block/SweetBerryBushBlock.java -@@ -57,10 +_,11 @@ +@@ -63,10 +_,11 @@ public void randomTick(BlockState p_222563_, ServerLevel p_222564_, BlockPos p_222565_, RandomSource p_222566_) { int i = p_222563_.getValue(AGE); diff --git a/patches/minecraft/net/minecraft/world/level/block/TallGrassBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TallGrassBlock.java.patch index 26f3798641..1c5c616642 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TallGrassBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TallGrassBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/level/block/TallGrassBlock.java +++ b/net/minecraft/world/level/block/TallGrassBlock.java -@@ -11,7 +_,7 @@ +@@ -12,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class TallGrassBlock extends BushBlock implements BonemealableBlock { +public class TallGrassBlock extends BushBlock implements BonemealableBlock, net.minecraftforge.common.IForgeShearable { + public static final MapCodec CODEC = simpleCodec(TallGrassBlock::new); protected static final float AABB_OFFSET = 6.0F; protected static final VoxelShape SHAPE = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 13.0D, 14.0D); - diff --git a/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch index eda04c0630..a5e2ba556a 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TntBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/TntBlock.java +++ b/net/minecraft/world/level/block/TntBlock.java -@@ -33,10 +_,14 @@ +@@ -39,10 +_,14 @@ this.registerDefaultState(this.defaultBlockState().setValue(UNSTABLE, Boolean.valueOf(false))); } @@ -16,7 +16,7 @@ p_57467_.removeBlock(p_57468_, false); } -@@ -45,7 +_,7 @@ +@@ -51,7 +_,7 @@ public void neighborChanged(BlockState p_57457_, Level p_57458_, BlockPos p_57459_, Block p_57460_, BlockPos p_57461_, boolean p_57462_) { if (p_57458_.hasNeighborSignal(p_57459_)) { @@ -25,16 +25,16 @@ p_57458_.removeBlock(p_57459_, false); } -@@ -53,7 +_,7 @@ +@@ -59,7 +_,7 @@ - public void playerWillDestroy(Level p_57445_, BlockPos p_57446_, BlockState p_57447_, Player p_57448_) { + public BlockState playerWillDestroy(Level p_57445_, BlockPos p_57446_, BlockState p_57447_, Player p_57448_) { if (!p_57445_.isClientSide() && !p_57448_.isCreative() && p_57447_.getValue(UNSTABLE)) { - explode(p_57445_, p_57446_); + onCaughtFire(p_57447_, p_57445_, p_57446_, null, null); } - super.playerWillDestroy(p_57445_, p_57446_, p_57447_, p_57448_); -@@ -68,10 +_,12 @@ + return super.playerWillDestroy(p_57445_, p_57446_, p_57447_, p_57448_); +@@ -74,10 +_,12 @@ } } @@ -47,7 +47,7 @@ private static void explode(Level p_57437_, BlockPos p_57438_, @Nullable LivingEntity p_57439_) { if (!p_57437_.isClientSide) { PrimedTnt primedtnt = new PrimedTnt(p_57437_, (double)p_57438_.getX() + 0.5D, (double)p_57438_.getY(), (double)p_57438_.getZ() + 0.5D, p_57439_); -@@ -86,7 +_,7 @@ +@@ -92,7 +_,7 @@ if (!itemstack.is(Items.FLINT_AND_STEEL) && !itemstack.is(Items.FIRE_CHARGE)) { return super.use(p_57450_, p_57451_, p_57452_, p_57453_, p_57454_, p_57455_); } else { @@ -56,7 +56,7 @@ p_57451_.setBlock(p_57452_, Blocks.AIR.defaultBlockState(), 11); Item item = itemstack.getItem(); if (!p_57453_.isCreative()) { -@@ -109,7 +_,7 @@ +@@ -115,7 +_,7 @@ BlockPos blockpos = p_57431_.getBlockPos(); Entity entity = p_57432_.getOwner(); if (p_57432_.isOnFire() && p_57432_.mayInteract(p_57429_, blockpos)) { diff --git a/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch index f88ac0a8d1..8684651243 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TrapDoorBlock.java.patch @@ -1,10 +1,9 @@ --- a/net/minecraft/world/level/block/TrapDoorBlock.java +++ b/net/minecraft/world/level/block/TrapDoorBlock.java -@@ -148,4 +_,17 @@ - +@@ -175,6 +_,19 @@ return super.updateShape(p_57554_, p_57555_, p_57556_, p_57557_, p_57558_, p_57559_); } -+ + + //Forge Start + @Override + public boolean isLadder(BlockState state, net.minecraft.world.level.LevelReader world, BlockPos pos, net.minecraft.world.entity.LivingEntity entity) { @@ -17,4 +16,7 @@ + } + //Forge End + - } ++ + protected BlockSetType getType() { + return this.type; + } diff --git a/patches/minecraft/net/minecraft/world/level/block/TripWireBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TripWireBlock.java.patch index c41378adf8..eb81be237e 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TripWireBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TripWireBlock.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/world/level/block/TripWireBlock.java +++ b/net/minecraft/world/level/block/TripWireBlock.java -@@ -69,7 +_,7 @@ +@@ -81,7 +_,7 @@ } - public void playerWillDestroy(Level p_57615_, BlockPos p_57616_, BlockState p_57617_, Player p_57618_) { + public BlockState playerWillDestroy(Level p_57615_, BlockPos p_57616_, BlockState p_57617_, Player p_57618_) { - if (!p_57615_.isClientSide && !p_57618_.getMainHandItem().isEmpty() && p_57618_.getMainHandItem().is(Items.SHEARS)) { + if (!p_57615_.isClientSide && !p_57618_.getMainHandItem().isEmpty() && p_57618_.getMainHandItem().canPerformAction(net.minecraftforge.common.ToolActions.SHEARS_DISARM)) { p_57615_.setBlock(p_57616_, p_57617_.setValue(DISARMED, Boolean.valueOf(true)), 4); diff --git a/patches/minecraft/net/minecraft/world/level/block/TripWireHookBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TripWireHookBlock.java.patch index ba1f22ae23..fdcce5301e 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TripWireHookBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TripWireHookBlock.java.patch @@ -1,12 +1,12 @@ --- a/net/minecraft/world/level/block/TripWireHookBlock.java +++ b/net/minecraft/world/level/block/TripWireHookBlock.java -@@ -156,8 +_,8 @@ - BlockPos blockpos2 = p_57687_.relative(direction, k); - BlockState blockstate2 = ablockstate[k]; - if (blockstate2 != null) { -+ if (!p_57686_.getBlockState(blockpos2).isAir()) { // FORGE: fix MC-129055 - p_57686_.setBlock(blockpos2, blockstate2.setValue(ATTACHED, Boolean.valueOf(flag2)), 3); -- if (!p_57686_.getBlockState(blockpos2).isAir()) { +@@ -166,8 +_,8 @@ + BlockPos blockpos2 = p_57687_.relative(direction, k); + BlockState blockstate2 = ablockstate[k]; + if (blockstate2 != null) { ++ if (!p_57686_.getBlockState(blockpos2).isAir()) { // FORGE: fix MC-129055 + p_57686_.setBlock(blockpos2, blockstate2.trySetValue(ATTACHED, Boolean.valueOf(flag2)), 3); +- if (!p_57686_.getBlockState(blockpos2).isAir()) { + } } } - } diff --git a/patches/minecraft/net/minecraft/world/level/block/TurtleEggBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/TurtleEggBlock.java.patch index 0eb9858899..5b0d8e9c92 100644 --- a/patches/minecraft/net/minecraft/world/level/block/TurtleEggBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/TurtleEggBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/net/minecraft/world/level/block/TurtleEggBlock.java -@@ -160,7 +_,7 @@ +@@ -166,7 +_,7 @@ if (!(p_57769_ instanceof LivingEntity)) { return false; } else { diff --git a/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch index bd82d9ea49..bdaec23869 100644 --- a/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/VineBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/block/VineBlock.java +++ b/net/minecraft/world/level/block/VineBlock.java -@@ -23,7 +_,7 @@ +@@ -24,7 +_,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -public class VineBlock extends Block { +public class VineBlock extends Block implements net.minecraftforge.common.IForgeShearable { + public static final MapCodec CODEC = simpleCodec(VineBlock::new); public static final BooleanProperty UP = PipeBlock.UP; public static final BooleanProperty NORTH = PipeBlock.NORTH; - public static final BooleanProperty EAST = PipeBlock.EAST; -@@ -158,7 +_,7 @@ +@@ -164,7 +_,7 @@ public void randomTick(BlockState p_222655_, ServerLevel p_222656_, BlockPos p_222657_, RandomSource p_222658_) { if (p_222656_.getGameRules().getBoolean(GameRules.RULE_DO_VINES_SPREAD)) { diff --git a/patches/minecraft/net/minecraft/world/level/block/WebBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/WebBlock.java.patch index 516d627280..b4d931110d 100644 --- a/patches/minecraft/net/minecraft/world/level/block/WebBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/WebBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/level/block/WebBlock.java +++ b/net/minecraft/world/level/block/WebBlock.java -@@ -7,7 +_,7 @@ +@@ -8,7 +_,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; -public class WebBlock extends Block { +public class WebBlock extends Block implements net.minecraftforge.common.IForgeShearable { - public WebBlock(BlockBehaviour.Properties p_58178_) { - super(p_58178_); - } + public static final MapCodec CODEC = simpleCodec(WebBlock::new); + + public MapCodec codec() { diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch index d4e93d9297..50b916abd0 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch @@ -1,12 +1,14 @@ --- a/net/minecraft/world/level/block/entity/SignBlockEntity.java +++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java -@@ -278,4 +_,9 @@ - } +@@ -277,6 +_,11 @@ } -+ + + @Override + public net.minecraft.world.phys.AABB getRenderBoundingBox() { -+ return new net.minecraft.world.phys.AABB(this.getBlockPos(), this.getBlockPos().offset(1, 1, 1)); ++ return new net.minecraft.world.phys.AABB(this.getBlockPos()); + } - } ++ + public SoundEvent getSignInteractionFailedSoundEvent() { + return SoundEvents.WAXED_SIGN_INTERACT_FAIL; + } diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java.patch index 05851cdb9c..a6c1454c58 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java +++ b/net/minecraft/world/level/block/entity/SpawnerBlockEntity.java -@@ -27,6 +_,9 @@ +@@ -28,6 +_,9 @@ } } diff --git a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java.patch b/patches/minecraft/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java.patch deleted file mode 100644 index eda7835d96..0000000000 --- a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java -+++ b/net/minecraft/world/level/block/grower/AbstractMegaTreeGrower.java -@@ -36,6 +_,9 @@ - return false; - } else { - Holder> holder = p_222897_.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse((Holder.Reference>)null); -+ var event = net.minecraftforge.event.ForgeEventFactory.blockGrowFeature(p_222897_, p_222901_, p_222899_, holder); -+ holder = event.getFeature(); -+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return false; - if (holder == null) { - return false; - } else { diff --git a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractTreeGrower.java.patch b/patches/minecraft/net/minecraft/world/level/block/grower/AbstractTreeGrower.java.patch deleted file mode 100644 index 38e7eff9ba..0000000000 --- a/patches/minecraft/net/minecraft/world/level/block/grower/AbstractTreeGrower.java.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/net/minecraft/world/level/block/grower/AbstractTreeGrower.java -+++ b/net/minecraft/world/level/block/grower/AbstractTreeGrower.java -@@ -23,6 +_,9 @@ - return false; - } else { - Holder> holder = p_222905_.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse((Holder.Reference>)null); -+ var event = net.minecraftforge.event.ForgeEventFactory.blockGrowFeature(p_222905_, p_222909_, p_222907_, holder); -+ holder = event.getFeature(); -+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return false; - if (holder == null) { - return false; - } else { diff --git a/patches/minecraft/net/minecraft/world/level/block/grower/TreeGrower.java.patch b/patches/minecraft/net/minecraft/world/level/block/grower/TreeGrower.java.patch new file mode 100644 index 0000000000..d2c3a66027 --- /dev/null +++ b/patches/minecraft/net/minecraft/world/level/block/grower/TreeGrower.java.patch @@ -0,0 +1,12 @@ +--- a/net/minecraft/world/level/block/grower/TreeGrower.java ++++ b/net/minecraft/world/level/block/grower/TreeGrower.java +@@ -85,6 +_,9 @@ + ResourceKey> resourcekey = this.getConfiguredMegaFeature(p_309951_); + if (resourcekey != null) { + Holder> holder = p_309830_.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolder(resourcekey).orElse((Holder.Reference>)null); ++ var event = net.minecraftforge.event.ForgeEventFactory.blockGrowFeature(p_309830_, p_309951_, p_310327_, holder); ++ holder = event.getFeature(); ++ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return false; + if (holder != null) { + for(int i = 0; i >= -1; --i) { + for(int j = 0; j >= -1; --j) { diff --git a/patches/minecraft/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch index 2348af95d1..845e484649 100644 --- a/patches/minecraft/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java -@@ -169,6 +_,7 @@ +@@ -181,6 +_,7 @@ } if (p_60195_ == 0) { @@ -8,7 +8,7 @@ if (!this.moveBlocks(p_60193_, p_60194_, direction, true)) { return false; } -@@ -177,6 +_,7 @@ +@@ -189,6 +_,7 @@ p_60193_.playSound((Player)null, p_60194_, SoundEvents.PISTON_EXTEND, SoundSource.BLOCKS, 0.5F, p_60193_.random.nextFloat() * 0.25F + 0.6F); p_60193_.gameEvent(GameEvent.BLOCK_ACTIVATE, p_60194_, GameEvent.Context.of(blockstate)); } else if (p_60195_ == 1 || p_60195_ == 2) { @@ -16,7 +16,7 @@ BlockEntity blockentity1 = p_60193_.getBlockEntity(p_60194_.relative(direction)); if (blockentity1 instanceof PistonMovingBlockEntity) { ((PistonMovingBlockEntity)blockentity1).finalTick(); -@@ -217,6 +_,7 @@ +@@ -229,6 +_,7 @@ p_60193_.gameEvent(GameEvent.BLOCK_DEACTIVATE, p_60194_, GameEvent.Context.of(blockstate1)); } @@ -24,7 +24,7 @@ return true; } -@@ -353,6 +_,10 @@ +@@ -365,6 +_,10 @@ public BlockState rotate(BlockState p_60215_, Rotation p_60216_) { return p_60215_.setValue(FACING, p_60216_.rotate(p_60215_.getValue(FACING))); diff --git a/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch index e27a2e0b4f..75d730240f 100644 --- a/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/state/BlockBehaviour.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -102,6 +_,17 @@ +@@ -107,6 +_,17 @@ this.dynamicShape = p_60452_.dynamicShape; this.requiredFeatures = p_60452_.requiredFeatures; this.properties = p_60452_; @@ -17,8 +17,8 @@ + } } - /** @deprecated */ -@@ -150,7 +_,7 @@ + public BlockBehaviour.Properties properties() { +@@ -171,7 +_,7 @@ /** @deprecated */ @Deprecated public void onRemove(BlockState p_60515_, Level p_60516_, BlockPos p_60517_, BlockState p_60518_, boolean p_60519_) { @@ -27,7 +27,28 @@ p_60516_.removeBlockEntity(p_60517_); } -@@ -355,14 +_,15 @@ +@@ -183,7 +_,8 @@ + if (!p_310712_.isAir() && p_312709_.getBlockInteraction() != Explosion.BlockInteraction.TRIGGER_BLOCK) { + Block block = p_310712_.getBlock(); + boolean flag = p_312709_.getIndirectSourceEntity() instanceof Player; +- if (block.dropFromExplosion(p_312709_) && p_311693_ instanceof ServerLevel) { ++ if (p_310712_.canDropFromExplosion(p_311693_, p_311490_, p_312709_) && p_311693_ instanceof ServerLevel) { ++ + ServerLevel serverlevel = (ServerLevel)p_311693_; + BlockEntity blockentity = p_310712_.hasBlockEntity() ? p_311693_.getBlockEntity(p_311490_) : null; + LootParams.Builder lootparams$builder = (new LootParams.Builder(serverlevel)).withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(p_311490_)).withParameter(LootContextParams.TOOL, ItemStack.EMPTY).withOptionalParameter(LootContextParams.BLOCK_ENTITY, blockentity).withOptionalParameter(LootContextParams.THIS_ENTITY, p_312709_.getDirectSourceEntity()); +@@ -196,9 +_,7 @@ + p_311277_.accept(p_309419_, p_311490_); + }); + } +- +- p_311693_.setBlock(p_311490_, Blocks.AIR.defaultBlockState(), 3); +- block.wasExploded(p_311693_, p_311490_, p_312709_); ++ p_310712_.onBlockExploded(p_311693_, p_311490_, p_312709_); + } + } + +@@ -400,14 +_,15 @@ if (f == -1.0F) { return 0.0F; } else { @@ -45,7 +66,7 @@ } /** @deprecated */ -@@ -389,8 +_,7 @@ +@@ -434,8 +_,7 @@ public final ResourceLocation getLootTable() { if (this.drops == null) { @@ -55,7 +76,7 @@ } return this.drops; -@@ -413,6 +_,14 @@ +@@ -458,6 +_,14 @@ return this.properties.destroyTime; } @@ -70,7 +91,7 @@ public abstract static class BlockStateBase extends StateHolder { private final int lightEmission; private final boolean useShapeForLightOcclusion; -@@ -548,12 +_,14 @@ +@@ -593,12 +_,14 @@ return this.useShapeForLightOcclusion; } @@ -86,7 +107,7 @@ } public boolean ignitedByLava() { -@@ -567,9 +_,11 @@ +@@ -612,9 +_,11 @@ } public MapColor getMapColor(BlockGetter p_285002_, BlockPos p_285293_) { @@ -99,7 +120,7 @@ public BlockState rotate(Rotation p_60718_) { return this.getBlock().rotate(this.asState(), p_60718_); } -@@ -623,6 +_,8 @@ +@@ -668,6 +_,8 @@ } public PushReaction getPistonPushReaction() { @@ -108,7 +129,7 @@ return this.pushReaction; } -@@ -976,8 +_,9 @@ +@@ -1032,8 +_,9 @@ boolean spawnTerrainParticles = true; NoteBlockInstrument instrument = NoteBlockInstrument.HARP; boolean replaceable; @@ -119,7 +140,7 @@ }; BlockBehaviour.StatePredicate isRedstoneConductor = (p_284888_, p_284889_, p_284890_) -> { return p_284888_.isCollisionShapeFullBlock(p_284889_, p_284890_); -@@ -1115,9 +_,15 @@ +@@ -1187,9 +_,15 @@ return this; } diff --git a/patches/minecraft/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch b/patches/minecraft/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch index 5c0e2bf1f6..546612586e 100644 --- a/patches/minecraft/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch +++ b/patches/minecraft/net/minecraft/world/level/entity/PersistentEntitySectionManager.java.patch @@ -40,7 +40,7 @@ }); this.chunkLoadStatuses.put(chunkentities.getPos().toLong(), PersistentEntitySectionManager.ChunkLoadStatus.LOADED); } -@@ -349,11 +_,13 @@ +@@ -354,11 +_,13 @@ class Callback implements EntityInLevelCallback { private final T entity; @@ -54,7 +54,7 @@ this.currentSectionKey = p_157615_; this.currentSection = p_157616_; } -@@ -370,9 +_,11 @@ +@@ -375,9 +_,11 @@ PersistentEntitySectionManager.this.removeSectionIfEmpty(this.currentSectionKey, this.currentSection); EntitySection entitysection = PersistentEntitySectionManager.this.sectionStorage.getOrCreateSection(i); entitysection.add(this.entity); diff --git a/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch b/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch index 2a5b4102aa..f9c36bbfba 100644 --- a/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch +++ b/patches/minecraft/net/minecraft/world/level/pathfinder/BlockPathTypes.java.patch @@ -8,7 +8,7 @@ BLOCKED(-1.0F), OPEN(0.0F), WALKABLE(0.0F), -@@ -35,5 +_,17 @@ +@@ -36,5 +_,17 @@ public float getMalus() { return this.malus; diff --git a/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch b/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch index 9b55494bab..30b7ad06fc 100644 --- a/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch +++ b/patches/minecraft/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch @@ -18,7 +18,7 @@ } private Node getNodeAndUpdateCostToMax(int p_230620_, int p_230621_, int p_230622_, BlockPathTypes p_230623_, float p_230624_) { -@@ -453,6 +_,11 @@ +@@ -459,6 +_,11 @@ if (l != 0 || j1 != 0) { p_77609_.set(i + l, j + i1, k + j1); BlockState blockstate = p_77608_.getBlockState(p_77609_); @@ -30,7 +30,7 @@ if (blockstate.is(Blocks.CACTUS) || blockstate.is(Blocks.SWEET_BERRY_BUSH)) { return BlockPathTypes.DANGER_OTHER; } -@@ -478,6 +_,8 @@ +@@ -484,6 +_,8 @@ protected static BlockPathTypes getBlockPathTypeRaw(BlockGetter p_77644_, BlockPos p_77645_) { BlockState blockstate = p_77644_.getBlockState(p_77645_); @@ -39,7 +39,7 @@ Block block = blockstate.getBlock(); if (blockstate.isAir()) { return BlockPathTypes.OPEN; -@@ -491,6 +_,8 @@ +@@ -497,6 +_,8 @@ return BlockPathTypes.COCOA; } else if (!blockstate.is(Blocks.WITHER_ROSE) && !blockstate.is(Blocks.POINTED_DRIPSTONE)) { FluidState fluidstate = p_77644_.getFluidState(p_77645_); @@ -48,7 +48,7 @@ if (fluidstate.is(FluidTags.LAVA)) { return BlockPathTypes.LAVA; } else if (isBurningBlock(blockstate)) { -@@ -510,6 +_,8 @@ +@@ -516,6 +_,8 @@ if (!blockstate.isPathfindable(p_77644_, p_77645_, PathComputationType.LAND)) { return BlockPathTypes.BLOCKED; } else { diff --git a/patches/minecraft/net/minecraft/world/level/storage/DimensionDataStorage.java.patch b/patches/minecraft/net/minecraft/world/level/storage/DimensionDataStorage.java.patch index 0ebb4904d7..eb77f16f0c 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/DimensionDataStorage.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/DimensionDataStorage.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/level/storage/DimensionDataStorage.java +++ b/net/minecraft/world/level/storage/DimensionDataStorage.java -@@ -48,9 +_,13 @@ +@@ -49,9 +_,13 @@ @Nullable - public T get(SavedData.Factory p_297465_, String p_164860_) { + public T get(SavedData.Factory p_297465_, String p_164860_) { SavedData saveddata = this.cache.get(p_164860_); + if (saveddata == net.minecraftforge.common.util.DummySavedData.DUMMY) return null; if (saveddata == null && !this.cache.containsKey(p_164860_)) { diff --git a/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch b/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch index 9615d0ac97..76f0fdebf1 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch @@ -1,35 +1,14 @@ --- a/net/minecraft/world/level/storage/LevelStorageSource.java +++ b/net/minecraft/world/level/storage/LevelStorageSource.java -@@ -465,6 +_,19 @@ - return LevelStorageSource.this.readLevelData(this.levelDirectory, LevelStorageSource.getLevelData(p_248747_, p_251873_, p_249187_, p_249736_)); - } - -+ public void readAdditionalLevelSaveData() { -+ checkLock(); -+ LevelStorageSource.this.readLevelData(this.levelDirectory, (path, dataFixer) -> { -+ try { -+ CompoundTag compoundTag = NbtIo.readCompressed(path.toFile()); -+ net.minecraftforge.common.ForgeHooks.readAdditionalLevelSaveData(compoundTag, this.levelDirectory); -+ } catch (Exception e) { -+ LOGGER.error("Exception reading {}", path, e); -+ } -+ return ""; // Return non-null to prevent level.dat-old inject -+ }); -+ } -+ - @Nullable - public WorldDataConfiguration getDataConfiguration() { - this.checkLock(); -@@ -481,6 +_,8 @@ +@@ -483,6 +_,7 @@ + CompoundTag compoundtag = p_78292_.createTag(p_78291_, p_78293_); CompoundTag compoundtag1 = new CompoundTag(); compoundtag1.put("Data", compoundtag); - + net.minecraftforge.common.ForgeHooks.writeAdditionalLevelSaveData(p_78292_, compoundtag1); -+ - try { - File file2 = File.createTempFile("level", ".dat", file1); - NbtIo.writeCompressed(compoundtag1, file2); -@@ -495,6 +_,10 @@ + this.saveLevelData(compoundtag1); + } + +@@ -503,6 +_,10 @@ public Optional getIconFile() { return !this.lock.isValid() ? Optional.empty() : Optional.of(this.levelDirectory.iconFile()); diff --git a/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch b/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch index 425b7ad1d9..8d20ff3e42 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/LevelSummary.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/storage/LevelSummary.java +++ b/net/minecraft/world/level/storage/LevelSummary.java -@@ -193,6 +_,10 @@ +@@ -257,6 +_,10 @@ } } @@ -9,5 +9,5 @@ + } + public static class SymlinkLevelSummary extends LevelSummary { - public SymlinkLevelSummary(String p_289942_, Path p_289953_) { - super((LevelSettings)null, (LevelVersion)null, p_289942_, false, false, false, p_289953_); + private static final Component MORE_INFO_BUTTON = Component.translatable("symlink_warning.more_info"); + private static final Component INFO = Component.translatable("symlink_warning.title").withColor(-65536); diff --git a/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch b/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch index 34852c9847..e59c956c8c 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/PlayerDataStorage.java.patch @@ -1,22 +1,22 @@ --- a/net/minecraft/world/level/storage/PlayerDataStorage.java +++ b/net/minecraft/world/level/storage/PlayerDataStorage.java -@@ -31,6 +_,7 @@ - File file2 = new File(this.playerDir, p_78434_.getStringUUID() + ".dat"); - File file3 = new File(this.playerDir, p_78434_.getStringUUID() + ".dat_old"); - Util.safeReplaceFile(file2, file1, file3); +@@ -35,6 +_,7 @@ + Path path2 = path.resolve(p_78434_.getStringUUID() + ".dat"); + Path path3 = path.resolve(p_78434_.getStringUUID() + ".dat_old"); + Util.safeReplaceFile(path2, path1, path3); + net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(p_78434_, playerDir, p_78434_.getStringUUID()); } catch (Exception exception) { LOGGER.warn("Failed to save player data for {}", (Object)p_78434_.getName().getString()); } -@@ -54,6 +_,7 @@ - int i = NbtUtils.getDataVersion(compoundtag, -1); - p_78436_.load(DataFixTypes.PLAYER.updateToCurrentVersion(this.fixerUpper, compoundtag, i)); +@@ -59,6 +_,7 @@ + compoundtag = DataFixTypes.PLAYER.updateToCurrentVersion(this.fixerUpper, compoundtag, i); + p_78436_.load(compoundtag); } + net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_78436_, playerDir, p_78436_.getStringUUID()); return compoundtag; } -@@ -71,5 +_,9 @@ +@@ -76,5 +_,9 @@ } return astring; diff --git a/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch b/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch index 9369554df9..ccae437f95 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/PrimaryLevelData.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/world/level/storage/PrimaryLevelData.java +++ b/net/minecraft/world/level/storage/PrimaryLevelData.java -@@ -82,6 +_,7 @@ +@@ -77,6 +_,7 @@ private boolean wasModded; private final Set removedFeatureFlags; private final TimerQueue scheduledEvents; + private boolean confirmedExperimentalWarning = false; - private PrimaryLevelData(@Nullable DataFixer p_277859_, int p_277672_, @Nullable CompoundTag p_277888_, boolean p_278109_, int p_277714_, int p_278088_, int p_278037_, float p_277542_, long p_277414_, long p_277635_, int p_277595_, int p_277794_, int p_278007_, boolean p_277943_, int p_277674_, boolean p_277644_, boolean p_277749_, boolean p_278004_, WorldBorder.Settings p_277729_, int p_277856_, int p_278051_, @Nullable UUID p_277341_, Set p_277989_, Set p_277399_, TimerQueue p_277860_, @Nullable CompoundTag p_277936_, EndDragonFight.Data p_289764_, LevelSettings p_278064_, WorldOptions p_278072_, PrimaryLevelData.SpecialWorldProperty p_277548_, Lifecycle p_277915_) { - this.fixerUpper = p_277859_; -@@ -127,7 +_,7 @@ + private PrimaryLevelData(@Nullable CompoundTag p_277888_, boolean p_278109_, int p_277672_, int p_277714_, int p_278088_, float p_277542_, long p_277414_, long p_277635_, int p_278037_, int p_277595_, int p_277794_, boolean p_277943_, int p_278007_, boolean p_277644_, boolean p_277749_, boolean p_278004_, WorldBorder.Settings p_277729_, int p_277674_, int p_277856_, @Nullable UUID p_277341_, Set p_277989_, Set p_277399_, TimerQueue p_277860_, @Nullable CompoundTag p_277936_, EndDragonFight.Data p_289764_, LevelSettings p_278064_, WorldOptions p_278072_, PrimaryLevelData.SpecialWorldProperty p_277548_, Lifecycle p_277915_) { + this.wasModded = p_278109_; +@@ -120,7 +_,7 @@ return p_78529_.asString().result().stream(); }).collect(Collectors.toCollection(Sets::newLinkedHashSet)), p_78531_.get("removed_features").asStream().flatMap((p_277335_) -> { return p_277335_.asString().result().stream(); @@ -17,7 +17,7 @@ } public CompoundTag createTag(RegistryAccess p_78543_, @Nullable CompoundTag p_78544_) { -@@ -203,6 +_,8 @@ +@@ -195,6 +_,8 @@ p_78547_.putUUID("WanderingTraderId", this.wanderingTraderId); } @@ -26,7 +26,7 @@ } private static ListTag stringCollectionToTag(Set p_277880_) { -@@ -483,6 +_,15 @@ +@@ -461,6 +_,15 @@ public LevelSettings getLevelSettings() { return this.settings.copy(); diff --git a/src/main/generated/data/minecraft/loot_tables/blocks/grass.json b/src/main/generated/data/minecraft/loot_tables/blocks/short_grass.json similarity index 92% rename from src/main/generated/data/minecraft/loot_tables/blocks/grass.json rename to src/main/generated/data/minecraft/loot_tables/blocks/short_grass.json index 2038c1b10c..c75f40d2fe 100644 --- a/src/main/generated/data/minecraft/loot_tables/blocks/grass.json +++ b/src/main/generated/data/minecraft/loot_tables/blocks/short_grass.json @@ -15,7 +15,7 @@ "condition": "forge:can_tool_perform_action" } ], - "name": "minecraft:grass" + "name": "minecraft:short_grass" }, { "type": "minecraft:item", @@ -46,5 +46,5 @@ "rolls": 1.0 } ], - "random_sequence": "minecraft:blocks/grass" + "random_sequence": "minecraft:blocks/short_grass" } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/loot_tables/blocks/tall_grass.json b/src/main/generated/data/minecraft/loot_tables/blocks/tall_grass.json index 44b6453a77..4e8e3e559a 100644 --- a/src/main/generated/data/minecraft/loot_tables/blocks/tall_grass.json +++ b/src/main/generated/data/minecraft/loot_tables/blocks/tall_grass.json @@ -45,7 +45,7 @@ "function": "minecraft:set_count" } ], - "name": "minecraft:grass" + "name": "minecraft:short_grass" }, { "type": "minecraft:item", @@ -109,7 +109,7 @@ "function": "minecraft:set_count" } ], - "name": "minecraft:grass" + "name": "minecraft:short_grass" }, { "type": "minecraft:item", diff --git a/src/main/generated/data/minecraft/recipes/acacia_fence.json b/src/main/generated/data/minecraft/recipes/acacia_fence.json index df2c8adcc5..d545c439a6 100644 --- a/src/main/generated/data/minecraft/recipes/acacia_fence.json +++ b/src/main/generated/data/minecraft/recipes/acacia_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:acacia_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/acacia_fence_gate.json b/src/main/generated/data/minecraft/recipes/acacia_fence_gate.json index 04a1d52f8a..027948967b 100644 --- a/src/main/generated/data/minecraft/recipes/acacia_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/acacia_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:acacia_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/acacia_sign.json b/src/main/generated/data/minecraft/recipes/acacia_sign.json index 441aecfcec..ab7495d12d 100644 --- a/src/main/generated/data/minecraft/recipes/acacia_sign.json +++ b/src/main/generated/data/minecraft/recipes/acacia_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:acacia_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/activator_rail.json b/src/main/generated/data/minecraft/recipes/activator_rail.json index 047f596e57..9f682df753 100644 --- a/src/main/generated/data/minecraft/recipes/activator_rail.json +++ b/src/main/generated/data/minecraft/recipes/activator_rail.json @@ -20,6 +20,5 @@ "result": { "count": 6, "item": "minecraft:activator_rail" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/anvil.json b/src/main/generated/data/minecraft/recipes/anvil.json index fff2f530d2..33203f2d58 100644 --- a/src/main/generated/data/minecraft/recipes/anvil.json +++ b/src/main/generated/data/minecraft/recipes/anvil.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:anvil" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/armor_stand.json b/src/main/generated/data/minecraft/recipes/armor_stand.json index 1cc3a0fdf2..54da4b9a02 100644 --- a/src/main/generated/data/minecraft/recipes/armor_stand.json +++ b/src/main/generated/data/minecraft/recipes/armor_stand.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:armor_stand" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/arrow.json b/src/main/generated/data/minecraft/recipes/arrow.json index 6a2486299f..c4eba0d814 100644 --- a/src/main/generated/data/minecraft/recipes/arrow.json +++ b/src/main/generated/data/minecraft/recipes/arrow.json @@ -20,6 +20,5 @@ "result": { "count": 4, "item": "minecraft:arrow" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/bamboo_fence.json b/src/main/generated/data/minecraft/recipes/bamboo_fence.json index 08d3a67b96..94bfe53d33 100644 --- a/src/main/generated/data/minecraft/recipes/bamboo_fence.json +++ b/src/main/generated/data/minecraft/recipes/bamboo_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:bamboo_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/bamboo_fence_gate.json b/src/main/generated/data/minecraft/recipes/bamboo_fence_gate.json index 4682b1d2fc..23fdba6fe7 100644 --- a/src/main/generated/data/minecraft/recipes/bamboo_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/bamboo_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:bamboo_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/bamboo_sign.json b/src/main/generated/data/minecraft/recipes/bamboo_sign.json index a27437ce82..1c78cf6ddb 100644 --- a/src/main/generated/data/minecraft/recipes/bamboo_sign.json +++ b/src/main/generated/data/minecraft/recipes/bamboo_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:bamboo_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/birch_fence.json b/src/main/generated/data/minecraft/recipes/birch_fence.json index 3402af290f..170c1c2520 100644 --- a/src/main/generated/data/minecraft/recipes/birch_fence.json +++ b/src/main/generated/data/minecraft/recipes/birch_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:birch_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/birch_fence_gate.json b/src/main/generated/data/minecraft/recipes/birch_fence_gate.json index d002518eee..325773a2eb 100644 --- a/src/main/generated/data/minecraft/recipes/birch_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/birch_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:birch_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/birch_sign.json b/src/main/generated/data/minecraft/recipes/birch_sign.json index 80ed8e924d..7a98a35feb 100644 --- a/src/main/generated/data/minecraft/recipes/birch_sign.json +++ b/src/main/generated/data/minecraft/recipes/birch_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:birch_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/black_banner.json b/src/main/generated/data/minecraft/recipes/black_banner.json index 0dd478812f..8f0a69aab4 100644 --- a/src/main/generated/data/minecraft/recipes/black_banner.json +++ b/src/main/generated/data/minecraft/recipes/black_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:black_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/blast_furnace.json b/src/main/generated/data/minecraft/recipes/blast_furnace.json index 1d1b6f0018..1c34a6149c 100644 --- a/src/main/generated/data/minecraft/recipes/blast_furnace.json +++ b/src/main/generated/data/minecraft/recipes/blast_furnace.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:blast_furnace" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/blue_banner.json b/src/main/generated/data/minecraft/recipes/blue_banner.json index c83023af16..2270bf926c 100644 --- a/src/main/generated/data/minecraft/recipes/blue_banner.json +++ b/src/main/generated/data/minecraft/recipes/blue_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:blue_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/bow.json b/src/main/generated/data/minecraft/recipes/bow.json index f195d39c30..6148fed74c 100644 --- a/src/main/generated/data/minecraft/recipes/bow.json +++ b/src/main/generated/data/minecraft/recipes/bow.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:bow" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/brown_banner.json b/src/main/generated/data/minecraft/recipes/brown_banner.json index 8e2b1a08bf..71bb73f30a 100644 --- a/src/main/generated/data/minecraft/recipes/brown_banner.json +++ b/src/main/generated/data/minecraft/recipes/brown_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:brown_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/brush.json b/src/main/generated/data/minecraft/recipes/brush.json index 6d487be34e..3c5b69dabe 100644 --- a/src/main/generated/data/minecraft/recipes/brush.json +++ b/src/main/generated/data/minecraft/recipes/brush.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:brush" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/bucket.json b/src/main/generated/data/minecraft/recipes/bucket.json index f3b52de107..22912ba151 100644 --- a/src/main/generated/data/minecraft/recipes/bucket.json +++ b/src/main/generated/data/minecraft/recipes/bucket.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:bucket" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/calibrated_sculk_sensor.json b/src/main/generated/data/minecraft/recipes/calibrated_sculk_sensor.json index 8f66fb18de..e71178e156 100644 --- a/src/main/generated/data/minecraft/recipes/calibrated_sculk_sensor.json +++ b/src/main/generated/data/minecraft/recipes/calibrated_sculk_sensor.json @@ -15,6 +15,5 @@ ], "result": { "item": "minecraft:calibrated_sculk_sensor" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/campfire.json b/src/main/generated/data/minecraft/recipes/campfire.json index 8a8f354b39..d329eb4738 100644 --- a/src/main/generated/data/minecraft/recipes/campfire.json +++ b/src/main/generated/data/minecraft/recipes/campfire.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:campfire" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/candle.json b/src/main/generated/data/minecraft/recipes/candle.json index 442f62aa0a..add9d35c83 100644 --- a/src/main/generated/data/minecraft/recipes/candle.json +++ b/src/main/generated/data/minecraft/recipes/candle.json @@ -15,6 +15,5 @@ ], "result": { "item": "minecraft:candle" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/cauldron.json b/src/main/generated/data/minecraft/recipes/cauldron.json index 56630de569..982e8e6aa0 100644 --- a/src/main/generated/data/minecraft/recipes/cauldron.json +++ b/src/main/generated/data/minecraft/recipes/cauldron.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:cauldron" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/chain.json b/src/main/generated/data/minecraft/recipes/chain.json index 5167e6750d..0834b8f1ae 100644 --- a/src/main/generated/data/minecraft/recipes/chain.json +++ b/src/main/generated/data/minecraft/recipes/chain.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:chain" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/cherry_fence.json b/src/main/generated/data/minecraft/recipes/cherry_fence.json index 4b840f57b8..7dd13ae3ac 100644 --- a/src/main/generated/data/minecraft/recipes/cherry_fence.json +++ b/src/main/generated/data/minecraft/recipes/cherry_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:cherry_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/cherry_fence_gate.json b/src/main/generated/data/minecraft/recipes/cherry_fence_gate.json index 9adba86bbe..5d4ed45afc 100644 --- a/src/main/generated/data/minecraft/recipes/cherry_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/cherry_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:cherry_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/cherry_sign.json b/src/main/generated/data/minecraft/recipes/cherry_sign.json index 43d50d1b31..091031dca4 100644 --- a/src/main/generated/data/minecraft/recipes/cherry_sign.json +++ b/src/main/generated/data/minecraft/recipes/cherry_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:cherry_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/clock.json b/src/main/generated/data/minecraft/recipes/clock.json index b04610bc4b..31e02ad116 100644 --- a/src/main/generated/data/minecraft/recipes/clock.json +++ b/src/main/generated/data/minecraft/recipes/clock.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:clock" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/coast_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/coast_armor_trim_smithing_template.json index 0d2470475d..1389c117ea 100644 --- a/src/main/generated/data/minecraft/recipes/coast_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/coast_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:coast_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/compass.json b/src/main/generated/data/minecraft/recipes/compass.json index 50a67f851a..f1b6226133 100644 --- a/src/main/generated/data/minecraft/recipes/compass.json +++ b/src/main/generated/data/minecraft/recipes/compass.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:compass" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/crimson_fence.json b/src/main/generated/data/minecraft/recipes/crimson_fence.json index ee77990b05..fd4c99174e 100644 --- a/src/main/generated/data/minecraft/recipes/crimson_fence.json +++ b/src/main/generated/data/minecraft/recipes/crimson_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:crimson_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/crimson_fence_gate.json b/src/main/generated/data/minecraft/recipes/crimson_fence_gate.json index 2dc9986205..b8d6cb88dd 100644 --- a/src/main/generated/data/minecraft/recipes/crimson_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/crimson_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:crimson_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/crimson_sign.json b/src/main/generated/data/minecraft/recipes/crimson_sign.json index 4544489edc..2d26330c3d 100644 --- a/src/main/generated/data/minecraft/recipes/crimson_sign.json +++ b/src/main/generated/data/minecraft/recipes/crimson_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:crimson_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/crossbow.json b/src/main/generated/data/minecraft/recipes/crossbow.json index 948585b353..bfacf24beb 100644 --- a/src/main/generated/data/minecraft/recipes/crossbow.json +++ b/src/main/generated/data/minecraft/recipes/crossbow.json @@ -22,6 +22,5 @@ ], "result": { "item": "minecraft:crossbow" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/cyan_banner.json b/src/main/generated/data/minecraft/recipes/cyan_banner.json index 0687d85416..2eae740c43 100644 --- a/src/main/generated/data/minecraft/recipes/cyan_banner.json +++ b/src/main/generated/data/minecraft/recipes/cyan_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:cyan_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/dark_oak_fence.json b/src/main/generated/data/minecraft/recipes/dark_oak_fence.json index 1a3e782761..f25b7a205a 100644 --- a/src/main/generated/data/minecraft/recipes/dark_oak_fence.json +++ b/src/main/generated/data/minecraft/recipes/dark_oak_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:dark_oak_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/dark_oak_fence_gate.json b/src/main/generated/data/minecraft/recipes/dark_oak_fence_gate.json index 428528bc89..53d878a102 100644 --- a/src/main/generated/data/minecraft/recipes/dark_oak_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/dark_oak_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:dark_oak_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/dark_oak_sign.json b/src/main/generated/data/minecraft/recipes/dark_oak_sign.json index e8b8f1070e..286e275709 100644 --- a/src/main/generated/data/minecraft/recipes/dark_oak_sign.json +++ b/src/main/generated/data/minecraft/recipes/dark_oak_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:dark_oak_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/detector_rail.json b/src/main/generated/data/minecraft/recipes/detector_rail.json index c4353b44a4..ddafa7ab5b 100644 --- a/src/main/generated/data/minecraft/recipes/detector_rail.json +++ b/src/main/generated/data/minecraft/recipes/detector_rail.json @@ -20,6 +20,5 @@ "result": { "count": 6, "item": "minecraft:detector_rail" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_axe.json b/src/main/generated/data/minecraft/recipes/diamond_axe.json index 6f15668ebb..fa33917a09 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_axe.json +++ b/src/main/generated/data/minecraft/recipes/diamond_axe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:diamond_axe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_boots.json b/src/main/generated/data/minecraft/recipes/diamond_boots.json index 3d4aeaeb6b..0ab7eb99fe 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_boots.json +++ b/src/main/generated/data/minecraft/recipes/diamond_boots.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:diamond_boots" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_chestplate.json b/src/main/generated/data/minecraft/recipes/diamond_chestplate.json index a43265e678..1cd18f4c75 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_chestplate.json +++ b/src/main/generated/data/minecraft/recipes/diamond_chestplate.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:diamond_chestplate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_helmet.json b/src/main/generated/data/minecraft/recipes/diamond_helmet.json index 19fc2dca19..9671c540d3 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_helmet.json +++ b/src/main/generated/data/minecraft/recipes/diamond_helmet.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:diamond_helmet" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_hoe.json b/src/main/generated/data/minecraft/recipes/diamond_hoe.json index cc0c822b36..ccd0e48768 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_hoe.json +++ b/src/main/generated/data/minecraft/recipes/diamond_hoe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:diamond_hoe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_leggings.json b/src/main/generated/data/minecraft/recipes/diamond_leggings.json index 6727669eba..f9cbdcd738 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_leggings.json +++ b/src/main/generated/data/minecraft/recipes/diamond_leggings.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:diamond_leggings" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_pickaxe.json b/src/main/generated/data/minecraft/recipes/diamond_pickaxe.json index d2abe9e2d5..affd0a3083 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_pickaxe.json +++ b/src/main/generated/data/minecraft/recipes/diamond_pickaxe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:diamond_pickaxe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_shovel.json b/src/main/generated/data/minecraft/recipes/diamond_shovel.json index ddd044525a..cb8282be2c 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_shovel.json +++ b/src/main/generated/data/minecraft/recipes/diamond_shovel.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:diamond_shovel" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diamond_sword.json b/src/main/generated/data/minecraft/recipes/diamond_sword.json index f16f1a1f9c..de7b7d161b 100644 --- a/src/main/generated/data/minecraft/recipes/diamond_sword.json +++ b/src/main/generated/data/minecraft/recipes/diamond_sword.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:diamond_sword" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/diorite.json b/src/main/generated/data/minecraft/recipes/diorite.json index 6854e1edf4..6dfb532dcf 100644 --- a/src/main/generated/data/minecraft/recipes/diorite.json +++ b/src/main/generated/data/minecraft/recipes/diorite.json @@ -16,6 +16,5 @@ "result": { "count": 2, "item": "minecraft:diorite" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/dispenser.json b/src/main/generated/data/minecraft/recipes/dispenser.json index 7af9b96d82..20076eae31 100644 --- a/src/main/generated/data/minecraft/recipes/dispenser.json +++ b/src/main/generated/data/minecraft/recipes/dispenser.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:dispenser" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/dropper.json b/src/main/generated/data/minecraft/recipes/dropper.json index 3488194d4a..76c51a4fa6 100644 --- a/src/main/generated/data/minecraft/recipes/dropper.json +++ b/src/main/generated/data/minecraft/recipes/dropper.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:dropper" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/dune_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/dune_armor_trim_smithing_template.json index 9261e16a53..f115d552d8 100644 --- a/src/main/generated/data/minecraft/recipes/dune_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/dune_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:dune_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/enchanting_table.json b/src/main/generated/data/minecraft/recipes/enchanting_table.json index 6af8e6db21..a238995fb9 100644 --- a/src/main/generated/data/minecraft/recipes/enchanting_table.json +++ b/src/main/generated/data/minecraft/recipes/enchanting_table.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:enchanting_table" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/eye_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/eye_armor_trim_smithing_template.json index df987b0b54..8b4a3fd515 100644 --- a/src/main/generated/data/minecraft/recipes/eye_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/eye_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:eye_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/fishing_rod.json b/src/main/generated/data/minecraft/recipes/fishing_rod.json index f28e75d948..8d6a571149 100644 --- a/src/main/generated/data/minecraft/recipes/fishing_rod.json +++ b/src/main/generated/data/minecraft/recipes/fishing_rod.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:fishing_rod" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_apple.json b/src/main/generated/data/minecraft/recipes/golden_apple.json index 5957e338cb..674bf883d3 100644 --- a/src/main/generated/data/minecraft/recipes/golden_apple.json +++ b/src/main/generated/data/minecraft/recipes/golden_apple.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:golden_apple" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_axe.json b/src/main/generated/data/minecraft/recipes/golden_axe.json index 4f97c3be79..4811c860ad 100644 --- a/src/main/generated/data/minecraft/recipes/golden_axe.json +++ b/src/main/generated/data/minecraft/recipes/golden_axe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:golden_axe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_boots.json b/src/main/generated/data/minecraft/recipes/golden_boots.json index 0bd05a4f7f..d5e15bc24f 100644 --- a/src/main/generated/data/minecraft/recipes/golden_boots.json +++ b/src/main/generated/data/minecraft/recipes/golden_boots.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:golden_boots" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_chestplate.json b/src/main/generated/data/minecraft/recipes/golden_chestplate.json index 16885abe2d..a06e7c25eb 100644 --- a/src/main/generated/data/minecraft/recipes/golden_chestplate.json +++ b/src/main/generated/data/minecraft/recipes/golden_chestplate.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:golden_chestplate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_helmet.json b/src/main/generated/data/minecraft/recipes/golden_helmet.json index 44913d6671..2161b20de7 100644 --- a/src/main/generated/data/minecraft/recipes/golden_helmet.json +++ b/src/main/generated/data/minecraft/recipes/golden_helmet.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:golden_helmet" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_hoe.json b/src/main/generated/data/minecraft/recipes/golden_hoe.json index 676bf1910b..9626f019d7 100644 --- a/src/main/generated/data/minecraft/recipes/golden_hoe.json +++ b/src/main/generated/data/minecraft/recipes/golden_hoe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:golden_hoe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_leggings.json b/src/main/generated/data/minecraft/recipes/golden_leggings.json index f75a6bab98..a377fbc982 100644 --- a/src/main/generated/data/minecraft/recipes/golden_leggings.json +++ b/src/main/generated/data/minecraft/recipes/golden_leggings.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:golden_leggings" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_pickaxe.json b/src/main/generated/data/minecraft/recipes/golden_pickaxe.json index af52e0c18f..b953212ba9 100644 --- a/src/main/generated/data/minecraft/recipes/golden_pickaxe.json +++ b/src/main/generated/data/minecraft/recipes/golden_pickaxe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:golden_pickaxe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_shovel.json b/src/main/generated/data/minecraft/recipes/golden_shovel.json index 162de9a37f..5e4bbd536c 100644 --- a/src/main/generated/data/minecraft/recipes/golden_shovel.json +++ b/src/main/generated/data/minecraft/recipes/golden_shovel.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:golden_shovel" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/golden_sword.json b/src/main/generated/data/minecraft/recipes/golden_sword.json index cd305d848e..c237f1afa5 100644 --- a/src/main/generated/data/minecraft/recipes/golden_sword.json +++ b/src/main/generated/data/minecraft/recipes/golden_sword.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:golden_sword" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/gray_banner.json b/src/main/generated/data/minecraft/recipes/gray_banner.json index b5016f5c5a..3a0bb04ef4 100644 --- a/src/main/generated/data/minecraft/recipes/gray_banner.json +++ b/src/main/generated/data/minecraft/recipes/gray_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:gray_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/green_banner.json b/src/main/generated/data/minecraft/recipes/green_banner.json index 59aa0a1b6a..000083bcf5 100644 --- a/src/main/generated/data/minecraft/recipes/green_banner.json +++ b/src/main/generated/data/minecraft/recipes/green_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:green_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/grindstone.json b/src/main/generated/data/minecraft/recipes/grindstone.json index 7ea8bc81db..beb54f35ee 100644 --- a/src/main/generated/data/minecraft/recipes/grindstone.json +++ b/src/main/generated/data/minecraft/recipes/grindstone.json @@ -18,6 +18,5 @@ ], "result": { "item": "minecraft:grindstone" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/heavy_weighted_pressure_plate.json b/src/main/generated/data/minecraft/recipes/heavy_weighted_pressure_plate.json index c5198b136e..1ffbcccce9 100644 --- a/src/main/generated/data/minecraft/recipes/heavy_weighted_pressure_plate.json +++ b/src/main/generated/data/minecraft/recipes/heavy_weighted_pressure_plate.json @@ -11,6 +11,5 @@ ], "result": { "item": "minecraft:heavy_weighted_pressure_plate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/hopper.json b/src/main/generated/data/minecraft/recipes/hopper.json index 19013f6af1..31bff00da6 100644 --- a/src/main/generated/data/minecraft/recipes/hopper.json +++ b/src/main/generated/data/minecraft/recipes/hopper.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:hopper" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/host_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/host_armor_trim_smithing_template.json index 474a5e40db..12343eb0d6 100644 --- a/src/main/generated/data/minecraft/recipes/host_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/host_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:host_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_axe.json b/src/main/generated/data/minecraft/recipes/iron_axe.json index eb83d30cab..09ad3b86e2 100644 --- a/src/main/generated/data/minecraft/recipes/iron_axe.json +++ b/src/main/generated/data/minecraft/recipes/iron_axe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:iron_axe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_bars.json b/src/main/generated/data/minecraft/recipes/iron_bars.json index 9c65a668c2..37a55f1b4d 100644 --- a/src/main/generated/data/minecraft/recipes/iron_bars.json +++ b/src/main/generated/data/minecraft/recipes/iron_bars.json @@ -13,6 +13,5 @@ "result": { "count": 16, "item": "minecraft:iron_bars" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_boots.json b/src/main/generated/data/minecraft/recipes/iron_boots.json index d05b86ea28..a5b13c1270 100644 --- a/src/main/generated/data/minecraft/recipes/iron_boots.json +++ b/src/main/generated/data/minecraft/recipes/iron_boots.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:iron_boots" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_chestplate.json b/src/main/generated/data/minecraft/recipes/iron_chestplate.json index a0bb9c2c55..c22d896eca 100644 --- a/src/main/generated/data/minecraft/recipes/iron_chestplate.json +++ b/src/main/generated/data/minecraft/recipes/iron_chestplate.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:iron_chestplate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_door.json b/src/main/generated/data/minecraft/recipes/iron_door.json index a4618d9090..f138c8898a 100644 --- a/src/main/generated/data/minecraft/recipes/iron_door.json +++ b/src/main/generated/data/minecraft/recipes/iron_door.json @@ -14,6 +14,5 @@ "result": { "count": 3, "item": "minecraft:iron_door" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_helmet.json b/src/main/generated/data/minecraft/recipes/iron_helmet.json index dc93edca45..fc376406b6 100644 --- a/src/main/generated/data/minecraft/recipes/iron_helmet.json +++ b/src/main/generated/data/minecraft/recipes/iron_helmet.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:iron_helmet" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_hoe.json b/src/main/generated/data/minecraft/recipes/iron_hoe.json index 4a68084f8d..d9ddbbf1a5 100644 --- a/src/main/generated/data/minecraft/recipes/iron_hoe.json +++ b/src/main/generated/data/minecraft/recipes/iron_hoe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:iron_hoe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_leggings.json b/src/main/generated/data/minecraft/recipes/iron_leggings.json index 51248c47a5..9249dfa36e 100644 --- a/src/main/generated/data/minecraft/recipes/iron_leggings.json +++ b/src/main/generated/data/minecraft/recipes/iron_leggings.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:iron_leggings" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_pickaxe.json b/src/main/generated/data/minecraft/recipes/iron_pickaxe.json index ee0835a8ce..381e76055b 100644 --- a/src/main/generated/data/minecraft/recipes/iron_pickaxe.json +++ b/src/main/generated/data/minecraft/recipes/iron_pickaxe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:iron_pickaxe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_shovel.json b/src/main/generated/data/minecraft/recipes/iron_shovel.json index 2dae106b16..fa186c42f6 100644 --- a/src/main/generated/data/minecraft/recipes/iron_shovel.json +++ b/src/main/generated/data/minecraft/recipes/iron_shovel.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:iron_shovel" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_sword.json b/src/main/generated/data/minecraft/recipes/iron_sword.json index ebb3f99400..d1b1fa9ff4 100644 --- a/src/main/generated/data/minecraft/recipes/iron_sword.json +++ b/src/main/generated/data/minecraft/recipes/iron_sword.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:iron_sword" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/iron_trapdoor.json b/src/main/generated/data/minecraft/recipes/iron_trapdoor.json index 1a5e499467..71777b8ca6 100644 --- a/src/main/generated/data/minecraft/recipes/iron_trapdoor.json +++ b/src/main/generated/data/minecraft/recipes/iron_trapdoor.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:iron_trapdoor" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/item_frame.json b/src/main/generated/data/minecraft/recipes/item_frame.json index f00685acd1..7383dc21ac 100644 --- a/src/main/generated/data/minecraft/recipes/item_frame.json +++ b/src/main/generated/data/minecraft/recipes/item_frame.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:item_frame" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/jukebox.json b/src/main/generated/data/minecraft/recipes/jukebox.json index 3794ae611f..23851e3783 100644 --- a/src/main/generated/data/minecraft/recipes/jukebox.json +++ b/src/main/generated/data/minecraft/recipes/jukebox.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:jukebox" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/jungle_fence.json b/src/main/generated/data/minecraft/recipes/jungle_fence.json index 54cdb67d36..28ab3e0b5b 100644 --- a/src/main/generated/data/minecraft/recipes/jungle_fence.json +++ b/src/main/generated/data/minecraft/recipes/jungle_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:jungle_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/jungle_fence_gate.json b/src/main/generated/data/minecraft/recipes/jungle_fence_gate.json index 387da12bfb..eeb195ecbe 100644 --- a/src/main/generated/data/minecraft/recipes/jungle_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/jungle_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:jungle_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/jungle_sign.json b/src/main/generated/data/minecraft/recipes/jungle_sign.json index f8111eec26..5c14ff95ef 100644 --- a/src/main/generated/data/minecraft/recipes/jungle_sign.json +++ b/src/main/generated/data/minecraft/recipes/jungle_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:jungle_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/ladder.json b/src/main/generated/data/minecraft/recipes/ladder.json index f85008ae04..50326bf053 100644 --- a/src/main/generated/data/minecraft/recipes/ladder.json +++ b/src/main/generated/data/minecraft/recipes/ladder.json @@ -14,6 +14,5 @@ "result": { "count": 3, "item": "minecraft:ladder" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/lead.json b/src/main/generated/data/minecraft/recipes/lead.json index ddb73eba15..56fcc01256 100644 --- a/src/main/generated/data/minecraft/recipes/lead.json +++ b/src/main/generated/data/minecraft/recipes/lead.json @@ -17,6 +17,5 @@ "result": { "count": 2, "item": "minecraft:lead" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/lever.json b/src/main/generated/data/minecraft/recipes/lever.json index 8a47825096..23666a3173 100644 --- a/src/main/generated/data/minecraft/recipes/lever.json +++ b/src/main/generated/data/minecraft/recipes/lever.json @@ -15,6 +15,5 @@ ], "result": { "item": "minecraft:lever" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/light_blue_banner.json b/src/main/generated/data/minecraft/recipes/light_blue_banner.json index 39640d2055..2f7d401abc 100644 --- a/src/main/generated/data/minecraft/recipes/light_blue_banner.json +++ b/src/main/generated/data/minecraft/recipes/light_blue_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:light_blue_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/light_gray_banner.json b/src/main/generated/data/minecraft/recipes/light_gray_banner.json index 48d0c83553..0564f26f74 100644 --- a/src/main/generated/data/minecraft/recipes/light_gray_banner.json +++ b/src/main/generated/data/minecraft/recipes/light_gray_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:light_gray_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/light_weighted_pressure_plate.json b/src/main/generated/data/minecraft/recipes/light_weighted_pressure_plate.json index 18621db031..8c0044b28c 100644 --- a/src/main/generated/data/minecraft/recipes/light_weighted_pressure_plate.json +++ b/src/main/generated/data/minecraft/recipes/light_weighted_pressure_plate.json @@ -11,6 +11,5 @@ ], "result": { "item": "minecraft:light_weighted_pressure_plate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/lightning_rod.json b/src/main/generated/data/minecraft/recipes/lightning_rod.json index 6d7abe0386..8d1a5eca19 100644 --- a/src/main/generated/data/minecraft/recipes/lightning_rod.json +++ b/src/main/generated/data/minecraft/recipes/lightning_rod.json @@ -13,6 +13,5 @@ ], "result": { "item": "minecraft:lightning_rod" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/lime_banner.json b/src/main/generated/data/minecraft/recipes/lime_banner.json index 83f6abb142..603a2a1ae2 100644 --- a/src/main/generated/data/minecraft/recipes/lime_banner.json +++ b/src/main/generated/data/minecraft/recipes/lime_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:lime_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/lodestone.json b/src/main/generated/data/minecraft/recipes/lodestone.json index 1b0c60c877..8741c3f76e 100644 --- a/src/main/generated/data/minecraft/recipes/lodestone.json +++ b/src/main/generated/data/minecraft/recipes/lodestone.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:lodestone" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/loom.json b/src/main/generated/data/minecraft/recipes/loom.json index 6001218dda..2893af442a 100644 --- a/src/main/generated/data/minecraft/recipes/loom.json +++ b/src/main/generated/data/minecraft/recipes/loom.json @@ -15,6 +15,5 @@ ], "result": { "item": "minecraft:loom" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/magenta_banner.json b/src/main/generated/data/minecraft/recipes/magenta_banner.json index 6dab18756b..5b02fea383 100644 --- a/src/main/generated/data/minecraft/recipes/magenta_banner.json +++ b/src/main/generated/data/minecraft/recipes/magenta_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:magenta_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/mangrove_fence.json b/src/main/generated/data/minecraft/recipes/mangrove_fence.json index 5337645842..a799b071ac 100644 --- a/src/main/generated/data/minecraft/recipes/mangrove_fence.json +++ b/src/main/generated/data/minecraft/recipes/mangrove_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:mangrove_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/mangrove_fence_gate.json b/src/main/generated/data/minecraft/recipes/mangrove_fence_gate.json index e7d21f30f0..a3bcbde9ff 100644 --- a/src/main/generated/data/minecraft/recipes/mangrove_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/mangrove_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:mangrove_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/mangrove_sign.json b/src/main/generated/data/minecraft/recipes/mangrove_sign.json index 5dc6800e41..9fce4bbc44 100644 --- a/src/main/generated/data/minecraft/recipes/mangrove_sign.json +++ b/src/main/generated/data/minecraft/recipes/mangrove_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:mangrove_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/minecart.json b/src/main/generated/data/minecraft/recipes/minecart.json index b81dba5935..aa5a1ea93d 100644 --- a/src/main/generated/data/minecraft/recipes/minecart.json +++ b/src/main/generated/data/minecraft/recipes/minecart.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:minecart" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/netherite_upgrade_smithing_template.json b/src/main/generated/data/minecraft/recipes/netherite_upgrade_smithing_template.json index 66a87f6f57..af5054afbd 100644 --- a/src/main/generated/data/minecraft/recipes/netherite_upgrade_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/netherite_upgrade_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:netherite_upgrade_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/oak_fence.json b/src/main/generated/data/minecraft/recipes/oak_fence.json index fbc65e1edc..e3f9961507 100644 --- a/src/main/generated/data/minecraft/recipes/oak_fence.json +++ b/src/main/generated/data/minecraft/recipes/oak_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:oak_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/oak_fence_gate.json b/src/main/generated/data/minecraft/recipes/oak_fence_gate.json index 0f4676d264..956d67d1a1 100644 --- a/src/main/generated/data/minecraft/recipes/oak_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/oak_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:oak_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/oak_sign.json b/src/main/generated/data/minecraft/recipes/oak_sign.json index 3d22fa3278..13132c63a0 100644 --- a/src/main/generated/data/minecraft/recipes/oak_sign.json +++ b/src/main/generated/data/minecraft/recipes/oak_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:oak_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/observer.json b/src/main/generated/data/minecraft/recipes/observer.json index 47f5e56107..f9304ff07a 100644 --- a/src/main/generated/data/minecraft/recipes/observer.json +++ b/src/main/generated/data/minecraft/recipes/observer.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:observer" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/orange_banner.json b/src/main/generated/data/minecraft/recipes/orange_banner.json index ed058ae790..c260165899 100644 --- a/src/main/generated/data/minecraft/recipes/orange_banner.json +++ b/src/main/generated/data/minecraft/recipes/orange_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:orange_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/painting.json b/src/main/generated/data/minecraft/recipes/painting.json index 4951fe0055..dfe4ad0caa 100644 --- a/src/main/generated/data/minecraft/recipes/painting.json +++ b/src/main/generated/data/minecraft/recipes/painting.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:painting" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/pink_banner.json b/src/main/generated/data/minecraft/recipes/pink_banner.json index 8ada3fb1b3..1965e7dffc 100644 --- a/src/main/generated/data/minecraft/recipes/pink_banner.json +++ b/src/main/generated/data/minecraft/recipes/pink_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:pink_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/piston.json b/src/main/generated/data/minecraft/recipes/piston.json index a97171e715..74f40060e5 100644 --- a/src/main/generated/data/minecraft/recipes/piston.json +++ b/src/main/generated/data/minecraft/recipes/piston.json @@ -22,6 +22,5 @@ ], "result": { "item": "minecraft:piston" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/polished_deepslate.json b/src/main/generated/data/minecraft/recipes/polished_deepslate.json index a09c89e9cd..2163aba74f 100644 --- a/src/main/generated/data/minecraft/recipes/polished_deepslate.json +++ b/src/main/generated/data/minecraft/recipes/polished_deepslate.json @@ -13,6 +13,5 @@ "result": { "count": 4, "item": "minecraft:polished_deepslate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/powered_rail.json b/src/main/generated/data/minecraft/recipes/powered_rail.json index c5f1f7d97a..c8b5b6e014 100644 --- a/src/main/generated/data/minecraft/recipes/powered_rail.json +++ b/src/main/generated/data/minecraft/recipes/powered_rail.json @@ -20,6 +20,5 @@ "result": { "count": 6, "item": "minecraft:powered_rail" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/purple_banner.json b/src/main/generated/data/minecraft/recipes/purple_banner.json index 2d1567f405..9c9baa1d93 100644 --- a/src/main/generated/data/minecraft/recipes/purple_banner.json +++ b/src/main/generated/data/minecraft/recipes/purple_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:purple_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/rail.json b/src/main/generated/data/minecraft/recipes/rail.json index e5fa2d6183..a14f5d7786 100644 --- a/src/main/generated/data/minecraft/recipes/rail.json +++ b/src/main/generated/data/minecraft/recipes/rail.json @@ -17,6 +17,5 @@ "result": { "count": 16, "item": "minecraft:rail" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/raiser_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/raiser_armor_trim_smithing_template.json index 508906d1fa..579235dae5 100644 --- a/src/main/generated/data/minecraft/recipes/raiser_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/raiser_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:raiser_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/red_banner.json b/src/main/generated/data/minecraft/recipes/red_banner.json index 6d02348b61..ece467fb8a 100644 --- a/src/main/generated/data/minecraft/recipes/red_banner.json +++ b/src/main/generated/data/minecraft/recipes/red_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:red_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/redstone_torch.json b/src/main/generated/data/minecraft/recipes/redstone_torch.json index 9b1b240624..3fef11c1ec 100644 --- a/src/main/generated/data/minecraft/recipes/redstone_torch.json +++ b/src/main/generated/data/minecraft/recipes/redstone_torch.json @@ -15,6 +15,5 @@ ], "result": { "item": "minecraft:redstone_torch" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/rib_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/rib_armor_trim_smithing_template.json index 093880b30a..d15c589c64 100644 --- a/src/main/generated/data/minecraft/recipes/rib_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/rib_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:rib_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/scaffolding.json b/src/main/generated/data/minecraft/recipes/scaffolding.json index a32e956638..9340d3da6d 100644 --- a/src/main/generated/data/minecraft/recipes/scaffolding.json +++ b/src/main/generated/data/minecraft/recipes/scaffolding.json @@ -17,6 +17,5 @@ "result": { "count": 6, "item": "minecraft:scaffolding" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/sentry_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/sentry_armor_trim_smithing_template.json index 756547a796..bccef0e6f5 100644 --- a/src/main/generated/data/minecraft/recipes/sentry_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/sentry_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:sentry_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/shaper_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/shaper_armor_trim_smithing_template.json index a848dbc732..e08dc1ce55 100644 --- a/src/main/generated/data/minecraft/recipes/shaper_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/shaper_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:shaper_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/shears.json b/src/main/generated/data/minecraft/recipes/shears.json index 8369e522a0..920ff4fd1d 100644 --- a/src/main/generated/data/minecraft/recipes/shears.json +++ b/src/main/generated/data/minecraft/recipes/shears.json @@ -12,6 +12,5 @@ ], "result": { "item": "minecraft:shears" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/shield.json b/src/main/generated/data/minecraft/recipes/shield.json index c9124c13f5..d746ab4ede 100644 --- a/src/main/generated/data/minecraft/recipes/shield.json +++ b/src/main/generated/data/minecraft/recipes/shield.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:shield" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/shulker_box.json b/src/main/generated/data/minecraft/recipes/shulker_box.json index e3b5fdb941..15c67ec58d 100644 --- a/src/main/generated/data/minecraft/recipes/shulker_box.json +++ b/src/main/generated/data/minecraft/recipes/shulker_box.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:shulker_box" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/silence_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/silence_armor_trim_smithing_template.json index 250c9b7167..9fa1c8204d 100644 --- a/src/main/generated/data/minecraft/recipes/silence_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/silence_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:silence_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/smithing_table.json b/src/main/generated/data/minecraft/recipes/smithing_table.json index 041fe1f037..e1ba2b4749 100644 --- a/src/main/generated/data/minecraft/recipes/smithing_table.json +++ b/src/main/generated/data/minecraft/recipes/smithing_table.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:smithing_table" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/snout_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/snout_armor_trim_smithing_template.json index 9057548796..5bffa9a875 100644 --- a/src/main/generated/data/minecraft/recipes/snout_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/snout_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:snout_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/soul_campfire.json b/src/main/generated/data/minecraft/recipes/soul_campfire.json index 829d816e89..4e1d80e502 100644 --- a/src/main/generated/data/minecraft/recipes/soul_campfire.json +++ b/src/main/generated/data/minecraft/recipes/soul_campfire.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:soul_campfire" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/soul_torch.json b/src/main/generated/data/minecraft/recipes/soul_torch.json index 6dd07f15e1..55f4104c79 100644 --- a/src/main/generated/data/minecraft/recipes/soul_torch.json +++ b/src/main/generated/data/minecraft/recipes/soul_torch.json @@ -25,6 +25,5 @@ "result": { "count": 4, "item": "minecraft:soul_torch" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/spire_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/spire_armor_trim_smithing_template.json index a2522225b1..d77a357eb4 100644 --- a/src/main/generated/data/minecraft/recipes/spire_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/spire_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:spire_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/spruce_fence.json b/src/main/generated/data/minecraft/recipes/spruce_fence.json index 0a2e0c2417..b4eab9c13f 100644 --- a/src/main/generated/data/minecraft/recipes/spruce_fence.json +++ b/src/main/generated/data/minecraft/recipes/spruce_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:spruce_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/spruce_fence_gate.json b/src/main/generated/data/minecraft/recipes/spruce_fence_gate.json index 2bd86795f3..258057d801 100644 --- a/src/main/generated/data/minecraft/recipes/spruce_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/spruce_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:spruce_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/spruce_sign.json b/src/main/generated/data/minecraft/recipes/spruce_sign.json index 086645daed..fb28d8c03e 100644 --- a/src/main/generated/data/minecraft/recipes/spruce_sign.json +++ b/src/main/generated/data/minecraft/recipes/spruce_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:spruce_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/spyglass.json b/src/main/generated/data/minecraft/recipes/spyglass.json index 27970c6c86..f649bfc44a 100644 --- a/src/main/generated/data/minecraft/recipes/spyglass.json +++ b/src/main/generated/data/minecraft/recipes/spyglass.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:spyglass" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/stone_axe.json b/src/main/generated/data/minecraft/recipes/stone_axe.json index 94d324d09a..58ce1597f6 100644 --- a/src/main/generated/data/minecraft/recipes/stone_axe.json +++ b/src/main/generated/data/minecraft/recipes/stone_axe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:stone_axe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/stone_hoe.json b/src/main/generated/data/minecraft/recipes/stone_hoe.json index d1cb7e4a2e..2827ae1eab 100644 --- a/src/main/generated/data/minecraft/recipes/stone_hoe.json +++ b/src/main/generated/data/minecraft/recipes/stone_hoe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:stone_hoe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/stone_pickaxe.json b/src/main/generated/data/minecraft/recipes/stone_pickaxe.json index 21a0b74e10..8d02352c43 100644 --- a/src/main/generated/data/minecraft/recipes/stone_pickaxe.json +++ b/src/main/generated/data/minecraft/recipes/stone_pickaxe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:stone_pickaxe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/stone_shovel.json b/src/main/generated/data/minecraft/recipes/stone_shovel.json index 42599213e2..609f6e511a 100644 --- a/src/main/generated/data/minecraft/recipes/stone_shovel.json +++ b/src/main/generated/data/minecraft/recipes/stone_shovel.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:stone_shovel" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/stone_sword.json b/src/main/generated/data/minecraft/recipes/stone_sword.json index 1a916597dd..7afc9ceec6 100644 --- a/src/main/generated/data/minecraft/recipes/stone_sword.json +++ b/src/main/generated/data/minecraft/recipes/stone_sword.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:stone_sword" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/stonecutter.json b/src/main/generated/data/minecraft/recipes/stonecutter.json index d9b589b729..4fa791814f 100644 --- a/src/main/generated/data/minecraft/recipes/stonecutter.json +++ b/src/main/generated/data/minecraft/recipes/stonecutter.json @@ -15,6 +15,5 @@ ], "result": { "item": "minecraft:stonecutter" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/tide_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/tide_armor_trim_smithing_template.json index 0064053067..7663db553b 100644 --- a/src/main/generated/data/minecraft/recipes/tide_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/tide_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:tide_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/tinted_glass.json b/src/main/generated/data/minecraft/recipes/tinted_glass.json index 5b0e47efc7..2017014aff 100644 --- a/src/main/generated/data/minecraft/recipes/tinted_glass.json +++ b/src/main/generated/data/minecraft/recipes/tinted_glass.json @@ -17,6 +17,5 @@ "result": { "count": 2, "item": "minecraft:tinted_glass" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/torch.json b/src/main/generated/data/minecraft/recipes/torch.json index 5cdc3f1742..71147ae0aa 100644 --- a/src/main/generated/data/minecraft/recipes/torch.json +++ b/src/main/generated/data/minecraft/recipes/torch.json @@ -21,6 +21,5 @@ "result": { "count": 4, "item": "minecraft:torch" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/tripwire_hook.json b/src/main/generated/data/minecraft/recipes/tripwire_hook.json index b583e8d0b4..a02479f770 100644 --- a/src/main/generated/data/minecraft/recipes/tripwire_hook.json +++ b/src/main/generated/data/minecraft/recipes/tripwire_hook.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:tripwire_hook" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/vex_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/vex_armor_trim_smithing_template.json index cca8ed3eb8..981c13b403 100644 --- a/src/main/generated/data/minecraft/recipes/vex_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/vex_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:vex_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/ward_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/ward_armor_trim_smithing_template.json index 92a25f222d..b263c2f356 100644 --- a/src/main/generated/data/minecraft/recipes/ward_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/ward_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:ward_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/warped_fence.json b/src/main/generated/data/minecraft/recipes/warped_fence.json index f662e1b04a..052fa02e71 100644 --- a/src/main/generated/data/minecraft/recipes/warped_fence.json +++ b/src/main/generated/data/minecraft/recipes/warped_fence.json @@ -17,6 +17,5 @@ "result": { "count": 3, "item": "minecraft:warped_fence" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/warped_fence_gate.json b/src/main/generated/data/minecraft/recipes/warped_fence_gate.json index aacf1f757e..f176822579 100644 --- a/src/main/generated/data/minecraft/recipes/warped_fence_gate.json +++ b/src/main/generated/data/minecraft/recipes/warped_fence_gate.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:warped_fence_gate" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/warped_sign.json b/src/main/generated/data/minecraft/recipes/warped_sign.json index ff8ba7b5cf..cbaa3b7b87 100644 --- a/src/main/generated/data/minecraft/recipes/warped_sign.json +++ b/src/main/generated/data/minecraft/recipes/warped_sign.json @@ -18,6 +18,5 @@ "result": { "count": 3, "item": "minecraft:warped_sign" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/wayfinder_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/wayfinder_armor_trim_smithing_template.json index a24acf60e4..a35c9bbf95 100644 --- a/src/main/generated/data/minecraft/recipes/wayfinder_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/wayfinder_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:wayfinder_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/white_banner.json b/src/main/generated/data/minecraft/recipes/white_banner.json index e2ee693032..9957dc5b0a 100644 --- a/src/main/generated/data/minecraft/recipes/white_banner.json +++ b/src/main/generated/data/minecraft/recipes/white_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:white_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/wild_armor_trim_smithing_template.json b/src/main/generated/data/minecraft/recipes/wild_armor_trim_smithing_template.json index 8aab1eb479..ed91ecb02d 100644 --- a/src/main/generated/data/minecraft/recipes/wild_armor_trim_smithing_template.json +++ b/src/main/generated/data/minecraft/recipes/wild_armor_trim_smithing_template.json @@ -20,6 +20,5 @@ "result": { "count": 2, "item": "minecraft:wild_armor_trim_smithing_template" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/wooden_axe.json b/src/main/generated/data/minecraft/recipes/wooden_axe.json index c8613fbeb9..1f6cabc9b3 100644 --- a/src/main/generated/data/minecraft/recipes/wooden_axe.json +++ b/src/main/generated/data/minecraft/recipes/wooden_axe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:wooden_axe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/wooden_hoe.json b/src/main/generated/data/minecraft/recipes/wooden_hoe.json index a865012b83..0faec2df65 100644 --- a/src/main/generated/data/minecraft/recipes/wooden_hoe.json +++ b/src/main/generated/data/minecraft/recipes/wooden_hoe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:wooden_hoe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/wooden_pickaxe.json b/src/main/generated/data/minecraft/recipes/wooden_pickaxe.json index e05232a921..70c46788bc 100644 --- a/src/main/generated/data/minecraft/recipes/wooden_pickaxe.json +++ b/src/main/generated/data/minecraft/recipes/wooden_pickaxe.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:wooden_pickaxe" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/wooden_shovel.json b/src/main/generated/data/minecraft/recipes/wooden_shovel.json index 20d5c1436e..e5d95dbe8f 100644 --- a/src/main/generated/data/minecraft/recipes/wooden_shovel.json +++ b/src/main/generated/data/minecraft/recipes/wooden_shovel.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:wooden_shovel" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/wooden_sword.json b/src/main/generated/data/minecraft/recipes/wooden_sword.json index 2ddd06f904..f16e202780 100644 --- a/src/main/generated/data/minecraft/recipes/wooden_sword.json +++ b/src/main/generated/data/minecraft/recipes/wooden_sword.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:wooden_sword" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/recipes/yellow_banner.json b/src/main/generated/data/minecraft/recipes/yellow_banner.json index d519361dba..80eb283553 100644 --- a/src/main/generated/data/minecraft/recipes/yellow_banner.json +++ b/src/main/generated/data/minecraft/recipes/yellow_banner.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:yellow_banner" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/main/generated/pack.mcmeta b/src/main/generated/pack.mcmeta index fe3ab14755..7a29f312aa 100644 --- a/src/main/generated/pack.mcmeta +++ b/src/main/generated/pack.mcmeta @@ -3,6 +3,6 @@ "description": { "translate": "pack.forge.description" }, - "pack_format": 18 + "pack_format": 22 } } \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java index ad9729b6fe..071b671aaf 100644 --- a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java +++ b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java @@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientPacketListener; import net.minecraft.client.player.LocalPlayer; import net.minecraft.commands.CommandBuildContext; -import net.minecraft.commands.CommandRuntimeException; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.SharedSuggestionProvider; import net.minecraft.commands.synchronization.SuggestionProviders; @@ -156,16 +155,11 @@ public class ClientCommandHandler ClientCommandSourceStack source = getSource(); - try - { + try { commands.execute(reader, source); - } - catch (CommandRuntimeException execution)// Probably thrown by the command - { - Minecraft.getInstance().player.sendSystemMessage(Component.literal("").append(execution.getComponent()).withStyle(ChatFormatting.RED)); - } - catch (CommandSyntaxException syntax)// Usually thrown by the CommandDispatcher - { + //} catch (CommandRuntimeException execution) { // Probably thrown by the command + // Minecraft.getInstance().player.sendSystemMessage(Component.literal("").append(execution.getComponent()).withStyle(ChatFormatting.RED)); + } catch (CommandSyntaxException syntax) { if (syntax.getType() == CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownCommand() || syntax.getType() == CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownArgument()) { // in case of unknown command, let the server try and handle it diff --git a/src/main/java/net/minecraftforge/client/gui/LoadingErrorScreen.java b/src/main/java/net/minecraftforge/client/gui/LoadingErrorScreen.java index 4a67ebdce4..25af8904be 100644 --- a/src/main/java/net/minecraftforge/client/gui/LoadingErrorScreen.java +++ b/src/main/java/net/minecraftforge/client/gui/LoadingErrorScreen.java @@ -89,7 +89,7 @@ public class LoadingErrorScreen extends ErrorScreen { public static class LoadingEntryList extends ObjectSelectionList { LoadingEntryList(final LoadingErrorScreen parent, final List errors, final List warnings) { - super(Objects.requireNonNull(parent.minecraft), parent.width, parent.height, 35, parent.height - 50, + super(Objects.requireNonNull(parent.minecraft), parent.width, parent.height, 35, Math.max( errors.stream().mapToInt(error -> parent.font.split(Component.literal(error.getMessage() != null ? error.getMessage() : ""), parent.width - 20).size()).max().orElse(0), warnings.stream().mapToInt(warning -> parent.font.split(Component.literal(warning.formatToString() != null ? warning.formatToString() : ""), parent.width - 20).size()).max().orElse(0) diff --git a/src/main/java/net/minecraftforge/client/gui/ModListScreen.java b/src/main/java/net/minecraftforge/client/gui/ModListScreen.java index b9f6f210aa..e8b0986aab 100644 --- a/src/main/java/net/minecraftforge/client/gui/ModListScreen.java +++ b/src/main/java/net/minecraftforge/client/gui/ModListScreen.java @@ -270,7 +270,7 @@ public class ModListScreen extends Screen search = new EditBox(getFontRenderer(), PADDING + 1, y, listWidth - 2, 14, Component.translatable("fml.menu.mods.search")); this.modList = new ModListWidget(this, listWidth, fullButtonHeight, search.getY() - getFontRenderer().lineHeight - PADDING); - this.modList.setLeftPos(6); + this.modList.setX(6); this.modInfo = new InfoPanel(this.minecraft, modInfoWidth, this.height - PADDING - fullButtonHeight, PADDING); this.addRenderableWidget(modList); @@ -365,7 +365,7 @@ public class ModListScreen extends Screen this.modInfo.render(guiGraphics, mouseX, mouseY, partialTick); Component text = Component.translatable("fml.menu.mods.search"); - int x = modList.getLeft() + ((modList.getRight() - modList.getLeft()) / 2) - (getFontRenderer().width(text) / 2); + int x = modList.getX() + (modList.getWidth() / 2) - (getFontRenderer().width(text) / 2); this.search.render(guiGraphics, mouseX , mouseY, partialTick); super.render(guiGraphics, mouseX, mouseY, partialTick); guiGraphics.drawString(getFontRenderer(), text.getVisualOrderText(), x, search.getY() - getFontRenderer().lineHeight, 0xFFFFFF, false); diff --git a/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java b/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java index dd52cf4918..e049fe9726 100644 --- a/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java +++ b/src/main/java/net/minecraftforge/client/gui/overlay/ForgeGui.java @@ -16,6 +16,7 @@ import net.minecraft.client.multiplayer.ClientPacketListener; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.resources.language.I18n; +import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.util.StringUtil; @@ -351,7 +352,7 @@ public class ForgeGui extends Gui { if (time >= 120500L) listR.add(I18n.get("demo.demoExpired")); else - listR.add(I18n.get("demo.remainingTime", StringUtil.formatTickDuration((int) (120500L - time)))); + listR.add(I18n.get("demo.remainingTime", StringUtil.formatTickDuration((int)(120500L - this.minecraft.level.getGameTime()), this.minecraft.level.tickRateManager().tickrate()))); } var forgeOverlay = (OverlayAccess)debugOverlay; diff --git a/src/main/java/net/minecraftforge/client/gui/widget/ModListWidget.java b/src/main/java/net/minecraftforge/client/gui/widget/ModListWidget.java index 044d61bbe8..4b483f9e36 100644 --- a/src/main/java/net/minecraftforge/client/gui/widget/ModListWidget.java +++ b/src/main/java/net/minecraftforge/client/gui/widget/ModListWidget.java @@ -30,7 +30,7 @@ public class ModListWidget extends ObjectSelectionList public ModListWidget(ModListScreen parent, int listWidth, int top, int bottom) { - super(parent.getMinecraftInstance(), listWidth, parent.height, top, bottom, parent.getFontRenderer().lineHeight * 2 + 8); + super(parent.getMinecraftInstance(), listWidth, parent.height, top, parent.getFontRenderer().lineHeight * 2 + 8); this.parent = parent; this.listWidth = listWidth; this.refreshList(); @@ -53,11 +53,13 @@ public class ModListWidget extends ObjectSelectionList parent.buildModList(this::addEntry, mod->new ModEntry(mod, this.parent)); } + /* @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { this.parent.renderBackground(guiGraphics, mouseX, mouseY, partialTicks); super.render(guiGraphics, mouseX, mouseY, partialTicks); } + */ public class ModEntry extends ObjectSelectionList.Entry { private final IModInfo modInfo; @@ -87,7 +89,7 @@ public class ModListWidget extends ObjectSelectionList //TODO: Consider adding more icons for visualization RenderSystem.setShaderColor(1, 1, 1, 1); guiGraphics.pose().pushPose(); - guiGraphics.blit(VERSION_CHECK_ICONS, getLeft() + width - 12, top + entryHeight / 4, vercheck.status().getSheetOffset() * 8, (vercheck.status().isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16); + guiGraphics.blit(VERSION_CHECK_ICONS, getX() + width - 12, top + entryHeight / 4, vercheck.status().getSheetOffset() * 8, (vercheck.status().isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16); guiGraphics.pose().popPose(); } } diff --git a/src/main/java/net/minecraftforge/client/gui/widget/UnicodeGlyphButton.java b/src/main/java/net/minecraftforge/client/gui/widget/UnicodeGlyphButton.java deleted file mode 100644 index 4999ec1698..0000000000 --- a/src/main/java/net/minecraftforge/client/gui/widget/UnicodeGlyphButton.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.minecraftforge.client.gui.widget; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.network.chat.Component; - -/** - * This class provides a button that shows a string glyph at the beginning. The glyph can be scaled using the glyphScale parameter. - * - * @author bspkrs - */ -public class UnicodeGlyphButton extends ExtendedButton -{ - public String glyph; - public float glyphScale; - - public UnicodeGlyphButton(int xPos, int yPos, int width, int height, Component displayString, String glyph, float glyphScale, OnPress handler) - { - super(xPos, yPos, width, height, displayString, handler); - this.glyph = glyph; - this.glyphScale = glyphScale; - } - - @Override - public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) - { - if (this.visible) - { - Minecraft mc = Minecraft.getInstance(); - this.isHovered = mouseX >= this.getX() && mouseY >= this.getY() && mouseX < this.getX() + this.width && mouseY < this.getY() + this.height; - guiGraphics.blitSprite(SPRITES.get(this.active, this.isHoveredOrFocused()), this.getX(), this.getY(), this.getWidth(), this.getHeight()); - - Component buttonText = this.createNarrationMessage(); - int glyphWidth = (int) (mc.font.width(glyph) * glyphScale); - int strWidth = mc.font.width(buttonText); - int ellipsisWidth = mc.font.width("..."); - int totalWidth = strWidth + glyphWidth; - - if (totalWidth > width - 6 && totalWidth > ellipsisWidth) - buttonText = Component.literal(mc.font.substrByWidth(buttonText, width - 6 - ellipsisWidth).getString().trim() + "...") ; - - strWidth = mc.font.width(buttonText); - totalWidth = glyphWidth + strWidth; - - guiGraphics.pose().pushPose(); - guiGraphics.pose().scale(glyphScale, glyphScale, 1.0F); - guiGraphics.drawCenteredString(mc.font, Component.literal(glyph), - (int) (((this.getX() + (this.width / 2) - (strWidth / 2)) / glyphScale) - (glyphWidth / (2 * glyphScale)) + 2), - (int) (((this.getY() + ((this.height - 8) / glyphScale) / 2) - 1) / glyphScale), getFGColor()); - guiGraphics.pose().popPose(); - - guiGraphics.drawCenteredString(mc.font, buttonText, (int) (this.getX() + (this.width / 2) + (glyphWidth / glyphScale)), - this.getY() + (this.height - 8) / 2, getFGColor()); - - } - } -} diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index a3a99c33fc..7a24fe24f8 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -53,7 +53,7 @@ import net.minecraft.network.chat.ClickEvent; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.TextColor; -import net.minecraft.network.chat.contents.LiteralContents; +import net.minecraft.network.chat.contents.PlainTextContents.LiteralContents; import net.minecraft.server.level.ServerLevel; import net.minecraft.tags.BlockTags; import net.minecraft.tags.TagKey; @@ -103,6 +103,7 @@ import net.minecraft.world.Container; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.protocol.Packet; import net.minecraft.network.syncher.EntityDataSerializer; import net.minecraft.network.protocol.game.ClientGamePacketListener; @@ -122,6 +123,7 @@ import net.minecraft.world.level.biome.BiomeSpecialEffects; import net.minecraft.world.level.biome.BiomeGenerationSettings; import net.minecraft.world.level.biome.MobSpawnSettings; import net.minecraftforge.common.crafting.conditions.ICondition; +import net.minecraftforge.common.crafting.conditions.ICondition.IContext; import net.minecraftforge.common.crafting.ingredients.IIngredientSerializer; import net.minecraftforge.common.util.BlockSnapshot; import net.minecraftforge.common.util.BrainBuilder; @@ -977,7 +979,8 @@ public class ForgeHooks { } @ApiStatus.Internal - public static void readAdditionalLevelSaveData(CompoundTag rootTag, LevelStorageSource.LevelDirectory levelDirectory) { + public static void readAdditionalLevelSaveData(Dynamic data, LevelStorageSource.LevelDirectory levelDirectory) { + CompoundTag rootTag = (CompoundTag)data.convert(NbtOps.INSTANCE).getValue(); CompoundTag tag = rootTag.getCompound("fml"); if (tag.contains("LoadingModList")) { ListTag modList = tag.getList("LoadingModList", net.minecraft.nbt.Tag.TAG_COMPOUND); @@ -1276,7 +1279,10 @@ public class ForgeHooks { } @ApiStatus.Internal - public static boolean readAndTestCondition(ICondition.IContext context, JsonObject json) { + public static boolean readAndTestCondition(@Nullable ICondition.IContext context, JsonObject json) { + if (context == null) + context = IContext.EMPTY; + if (!json.has(ICondition.DEFAULT_FIELD)) return true; @@ -1294,7 +1300,9 @@ public class ForgeHooks { @Nullable @ApiStatus.Internal - public static JsonObject readConditionalAdvancement(ICondition.IContext context, JsonObject json) { + public static JsonObject readConditionalAdvancement(@Nullable ICondition.IContext context, JsonObject json) { + if (context == null) + context = IContext.EMPTY; var entries = GsonHelper.getAsJsonArray(json, "advancements", null); if (entries == null) return readAndTestCondition(context, json) ? json : null; @@ -1305,7 +1313,7 @@ public class ForgeHooks { throw new JsonSyntaxException("Invalid advancement entry at index " + idx + " Must be JsonObject"); if (readAndTestCondition(context, ele.getAsJsonObject())) - return GsonHelper.getAsJsonObject(ele.getAsJsonObject(), "advancement"); + return ele.getAsJsonObject(); idx++; } diff --git a/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java b/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java index c0f126d351..d187b1ef7a 100644 --- a/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java +++ b/src/main/java/net/minecraftforge/common/crafting/ConditionalAdvancement.java @@ -10,9 +10,11 @@ import java.util.List; import java.util.function.Consumer; import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import com.mojang.serialization.JsonOps; + +import net.minecraft.Util; import net.minecraft.advancements.Advancement; import net.minecraft.advancements.AdvancementHolder; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.crafting.conditions.ICondition; @@ -52,10 +54,6 @@ public class ConditionalAdvancement { return advancement(builder.build(DOESNT_MATTER).value()); } - public Builder advancement(FinishedRecipe fromRecipe) { - return advancement(fromRecipe.advancement()); - } - public Builder advancement(AdvancementHolder holder) { return advancement(holder.value()); } @@ -73,17 +71,13 @@ public class ConditionalAdvancement { return this; } - public IResult build() { - return new Result(List.copyOf(advancements)); - } - - public JsonObject write() { + public JsonObject build() { var json = new JsonObject(); var array = new JsonArray(); json.add("advancements", array); for (var pair : advancements) { - var holder = pair.adv().serializeToJson(); + JsonObject holder = (JsonObject)Util.getOrThrow(Advancement.CODEC.encodeStart(JsonOps.INSTANCE, pair.adv()), IllegalStateException::new); if (holder.has(ICondition.DEFAULT_FIELD)) throw new IllegalStateException("Recipe already serialized conditions!"); ForgeHooks.writeCondition(pair.condition(), holder); @@ -94,27 +88,5 @@ public class ConditionalAdvancement { } } - public interface IResult { - JsonObject serializeToJson(); - } - private record Pair(ICondition condition, Advancement adv) {} - private record Result(List advancements) implements IResult { - @Override - public JsonObject serializeToJson() { - var json = new JsonObject(); - var array = new JsonArray(); - json.add("advancements", array); - - for (var pair : advancements) { - var holder = pair.adv().serializeToJson(); - if (holder.has(ICondition.DEFAULT_FIELD)) - throw new IllegalStateException("Recipe already serialized conditions!"); - ForgeHooks.writeCondition(pair.condition(), holder); - - array.add(holder); - } - return json; - } - } } diff --git a/src/main/java/net/minecraftforge/common/crafting/ConditionalRecipe.java b/src/main/java/net/minecraftforge/common/crafting/ConditionalRecipe.java index f07eb75642..7f2ae81734 100644 --- a/src/main/java/net/minecraftforge/common/crafting/ConditionalRecipe.java +++ b/src/main/java/net/minecraftforge/common/crafting/ConditionalRecipe.java @@ -8,28 +8,36 @@ package net.minecraftforge.common.crafting; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; -import com.google.gson.JsonArray; +import java.util.stream.Stream; + +import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; import com.google.gson.JsonSyntaxException; -import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Codec; import com.mojang.serialization.DataResult; -import com.mojang.serialization.Dynamic; import com.mojang.serialization.DynamicOps; import com.mojang.serialization.JsonOps; +import com.mojang.serialization.MapDecoder; +import com.mojang.serialization.MapEncoder; +import com.mojang.serialization.MapLike; +import com.mojang.serialization.RecordBuilder; import net.minecraft.Util; import net.minecraft.advancements.Advancement; import net.minecraft.advancements.AdvancementHolder; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.core.RegistryAccess; import net.minecraft.data.recipes.RecipeBuilder; import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.world.Container; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.Level; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.GsonHelper; -import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.crafting.conditions.ConditionCodec; import net.minecraftforge.common.crafting.conditions.ICondition; import net.minecraftforge.registries.ForgeRegistries; @@ -52,11 +60,13 @@ public class ConditionalRecipe { } public static class Builder { - private List recipes = new ArrayList<>(); + private List recipes = new ArrayList<>(); + private List advancements = new ArrayList<>(); + private RecipeOutput bouncer = new RecipeOutput() { @Override - public void accept(FinishedRecipe value) { - recipe(value); + public void accept(ResourceLocation id, Recipe value, @Nullable AdvancementHolder advancement) { + recipe(id, value, advancement); } @SuppressWarnings("removal") @@ -64,6 +74,16 @@ public class ConditionalRecipe { public Advancement.Builder advancement() { return Advancement.Builder.recipeAdvancement().parent(RecipeBuilder.ROOT_RECIPE_ADVANCEMENT); } + + @Override + public void accept(ResourceLocation id, Recipe recipe, ResourceLocation advancementId, JsonElement advancement) { + AdvancementHolder holder = null; + if (advancement != null) { + Advancement adv = Util.getOrThrow(Advancement.CODEC.parse(JsonOps.INSTANCE, advancement), JsonParseException::new); + holder = new AdvancementHolder(advancementId, adv); + } + accept(id, recipe, holder); + } }; @Nullable @@ -93,10 +113,12 @@ public class ConditionalRecipe { return this; } - public Builder recipe(FinishedRecipe recipe) { + public Builder recipe(ResourceLocation id, Recipe recipe, @Nullable AdvancementHolder advancement) { if (condition == null) throw new IllegalStateException("Can not add a recipe with no conditions."); - recipes.add(new RecipePair(this.condition, recipe)); + recipes.add(new InnerRecipe(this.condition, recipe)); + if (advancement != null) + advancements.add(new InnerAdvancement(this.condition, advancement)); condition = null; return this; } @@ -117,94 +139,91 @@ public class ConditionalRecipe { if (recipes.isEmpty()) throw new IllegalStateException("Invalid ConditionalRecipe builder, No recipes"); - var adv = ConditionalAdvancement.builder(); - var hasAdvancement = false; - for (var pair : recipes) { - if (pair.recipe().advancement() != null) { - adv.condition(pair.condition()) - .advancement(pair.recipe().advancement()); - hasAdvancement = true; + JsonElement advancement = null; + if (!advancements.isEmpty()) { + var adv = ConditionalAdvancement.builder(); + for (var data : advancements) { + adv.condition(data.condition()) + .advancement(data.advancement()); } + if (advancementId == null) + advancementId = id.withPrefix("recipes/"); + advancement = adv.build(); + } else { + advancementId = null; } - if (advancementId == null) - advancementId = id.withPrefix("recipes/"); - - out.accept(new Finished(id, mainCondition, recipes, advancementId, hasAdvancement ? adv.write() : null)); + out.accept(id, new Wrapper(mainCondition, recipes), advancementId, advancement); } } - private record Finished( - ResourceLocation id, - @Nullable - ICondition mainCondition, - List recipes, - ResourceLocation advId, - JsonObject advData - ) implements FinishedRecipe { - @Override - public void serializeRecipeData(JsonObject json) { - JsonArray array = new JsonArray(); - var main = mainCondition; - if (main == null && recipes.size() == 1) - main = recipes.get(0).condition(); + private record InnerRecipe(ICondition condition, Recipe recipe) {} + private record InnerAdvancement(ICondition condition, AdvancementHolder advancement) {} - ForgeHooks.writeCondition(main, json); + private static class Wrapper implements Recipe { + @Override public boolean matches(Container inv, Level level) { return false; } + @Override public ItemStack assemble(Container inv, RegistryAccess reg) { return null; } + @Override public boolean canCraftInDimensions(int width, int height) { return false; } + @Override public ItemStack getResultItem(RegistryAccess reg) { return null; } + @Override public RecipeSerializer getSerializer() { return ConditionalRecipe.SERIALZIER; } + @Override public RecipeType getType() { throw new UnsupportedOperationException(); } - json.add("recipes", array); - for (var pair : recipes) { - var holder = pair.recipe().serializeRecipe(); - if (holder.has(ICondition.DEFAULT_FIELD)) - throw new IllegalStateException("Recipe already serialized conditions!"); - ForgeHooks.writeCondition(pair.condition(), holder); - array.add(holder); - } + @Nullable private final ICondition main; + private final List recipes; + private Wrapper(@Nullable ICondition main, List recipes) { + this.main = main; + this.recipes = recipes; } - @Override - public ResourceLocation id() { - return id; - } - - @Override - public RecipeSerializer type() { - return ConditionalRecipe.SERIALZIER; - } - - @Nullable - @Override - public AdvancementHolder advancement() { - return null; - } - - @Nullable - @Override - public AdvancementData advancementData() { - return advData == null ? null : new AdvancementData(advId, advData); - } } - - private record RecipePair(ICondition condition, FinishedRecipe recipe) {} - - private static Codec> CODEC = new Codec>() { + private static final Codec> CODEC = Codec.of(new MapEncoder.Implementation<>() { @Override - public DataResult encode(Recipe input, DynamicOps ops, T prefix) { - throw new UnsupportedOperationException("ConditionRecipe.CODEC does not support encoding"); + public RecordBuilder encode(Recipe input, DynamicOps ops, RecordBuilder prefix) { + if (!(input instanceof Wrapper)) + new IllegalStateException("ConditionalRecipe.CODEC can only be used during data gen, how did you get here?"); + Wrapper wrapper = (Wrapper)input; + + if (wrapper.main != null) + prefix.add(ICondition.DEFAULT_FIELD, ICondition.CODEC.encodeStart(ops, wrapper.main)); + else if (wrapper.recipes.size() == 1) + prefix.add(ICondition.DEFAULT_FIELD, ICondition.CODEC.encodeStart(ops, wrapper.recipes.get(0).condition())); + + var recipes = new ArrayList(); + for (var recipe : wrapper.recipes) { + var json = (JsonObject)json(Recipe.CODEC, recipe.recipe()); + if (wrapper.recipes.size() > 1) + json.add(ICondition.DEFAULT_FIELD, json(ICondition.CODEC, recipe.condition())); + recipes.add(JsonOps.INSTANCE.convertTo(ops, json)); + } + prefix.add("recipes", ops.createList(recipes.stream())); + return prefix; } @Override - public DataResult, T>> decode(DynamicOps ops, T input) { + public Stream keys(DynamicOps ops) { + return Stream.of(ops.createString(ICondition.DEFAULT_FIELD), ops.createString("recipes")); + } + + + private static JsonElement json(Codec codec, T object) { + return Util.getOrThrow(codec.encodeStart(JsonOps.INSTANCE, object), IllegalStateException::new); + } + }, new MapDecoder.Implementation>() { + @Override + public DataResult> decode(DynamicOps ops, MapLike input) { var context = ConditionCodec.getContext(ops); - var json = new Dynamic<>(ops, input).convert(JsonOps.INSTANCE).getValue(); + var json = ops.convertTo(JsonOps.INSTANCE, input.get("recipes")); try { - var recipes = GsonHelper.getAsJsonArray(GsonHelper.convertToJsonObject(json.getAsJsonObject(), "root"), "recipes"); + var recipes = GsonHelper.convertToJsonArray(json, "recipes"); int idx = 0; for (var entry : recipes) { var object = GsonHelper.convertToJsonObject(entry, "recipe[" + idx++ + "]"); - var conditionjson = GsonHelper.getAsJsonObject(object, ICondition.DEFAULT_FIELD); - var condition = Util.getOrThrow(ICondition.SAFE_CODEC.parse(JsonOps.INSTANCE, conditionjson), JsonSyntaxException::new); - if (!condition.test(context)) - continue; + if (object.has(ICondition.DEFAULT_FIELD)) { + var conditionjson = GsonHelper.getAsJsonObject(object, ICondition.DEFAULT_FIELD); + var condition = Util.getOrThrow(ICondition.SAFE_CODEC.parse(JsonOps.INSTANCE, conditionjson), JsonSyntaxException::new); + if (!condition.test(context)) + continue; + } var type = new ResourceLocation(GsonHelper.getAsString(object, "type")); var serializer = ForgeRegistries.RECIPE_SERIALIZERS.getValue(type); if (serializer == null) @@ -215,14 +234,19 @@ public class ConditionalRecipe { else if (!parsed.result().isPresent()) return DataResult.error(() -> "Recipe passed all conditions but did not parse a valid return"); else - return DataResult.success(Pair.of(parsed.result().get(), ops.empty())); + return DataResult.success(parsed.result().get()); } return DataResult.error(() -> "No recipe passed conditions, if this is the case, you should have an outer condition."); } catch (JsonSyntaxException e) { return DataResult.error(() -> e.getMessage()); } } - }.stable(); + + @Override + public Stream keys(DynamicOps ops) { + return Stream.of(ops.createString(ICondition.DEFAULT_FIELD), ops.createString("recipes")); + } + }).codec(); public static final RecipeSerializer> SERIALZIER = new RecipeSerializer>() { @Override diff --git a/src/main/java/net/minecraftforge/common/data/DatapackBuiltinEntriesProvider.java b/src/main/java/net/minecraftforge/common/data/DatapackBuiltinEntriesProvider.java deleted file mode 100644 index d20998ed73..0000000000 --- a/src/main/java/net/minecraftforge/common/data/DatapackBuiltinEntriesProvider.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.minecraftforge.common.data; - -import net.minecraft.core.HolderLookup; -import net.minecraft.core.RegistryAccess; -import net.minecraft.core.RegistrySetBuilder; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.data.PackOutput; -import net.minecraft.data.registries.RegistriesDatapackGenerator; -import net.minecraftforge.registries.DataPackRegistriesHooks; - -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -/** - * An extension of the {@link RegistriesDatapackGenerator} which properly handles - * referencing existing dynamic registry objects within another dynamic registry - * object. - */ -public class DatapackBuiltinEntriesProvider extends RegistriesDatapackGenerator -{ - - /** - * Constructs a new datapack provider which generates all registry objects - * from the provided mods using the holder. - * - * @param output the target directory of the data generator - * @param registries a future of a lookup for registries and their objects - * @param modIds a set of mod ids to generate the dynamic registry objects of - */ - public DatapackBuiltinEntriesProvider(PackOutput output, CompletableFuture registries, Set modIds) - { - super(output, registries, modIds); - } - - /** - * Constructs a new datapack provider which generates all registry objects - * from the provided mods using the holder. All entries that need to be - * bootstrapped are provided within the {@link RegistrySetBuilder}. - * - * @param output the target directory of the data generator - * @param registries a future of a lookup for registries and their objects - * @param datapackEntriesBuilder a builder containing the dynamic registry objects added by this provider - * @param modIds a set of mod ids to generate the dynamic registry objects of - */ - public DatapackBuiltinEntriesProvider(PackOutput output, CompletableFuture registries, RegistrySetBuilder datapackEntriesBuilder, Set modIds) - { - this(output, registries.thenApply(r -> constructRegistries(r, datapackEntriesBuilder)), modIds); - } - - /** - * A method used to construct empty bootstraps for all registries this provider - * did not touch such that existing dynamic registry objects do not get inlined. - * - * @param original a future of a lookup for registries and their objects - * @param datapackEntriesBuilder a builder containing the dynamic registry objects added by this provider - * @return a new lookup containing the existing and to be generated registries and their objects - */ - private static HolderLookup.Provider constructRegistries(HolderLookup.Provider original, RegistrySetBuilder datapackEntriesBuilder) - { - var builderKeys = new HashSet<>(datapackEntriesBuilder.getEntryKeys()); - DataPackRegistriesHooks.getDataPackRegistriesWithDimensions().filter(data -> !builderKeys.contains(data.key())).forEach(data -> datapackEntriesBuilder.add(data.key(), context -> {})); - return datapackEntriesBuilder.buildPatch(RegistryAccess.fromRegistryOfRegistries(BuiltInRegistries.REGISTRY), original); - } -} diff --git a/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java b/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java index 105f940a91..5dc564689c 100644 --- a/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java +++ b/src/main/java/net/minecraftforge/common/data/ForgeRecipeProvider.java @@ -5,15 +5,12 @@ package net.minecraftforge.common.data; -import com.google.gson.JsonObject; +import com.google.gson.JsonElement; import net.minecraft.advancements.AdvancementHolder; import net.minecraft.advancements.Advancement.Builder; import net.minecraft.data.CachedOutput; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.RecipeOutput; -import net.minecraft.data.recipes.ShapedRecipeBuilder; -import net.minecraft.data.recipes.ShapelessRecipeBuilder; import net.minecraft.data.recipes.packs.VanillaRecipeProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -24,6 +21,10 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Ingredient.ItemValue; import net.minecraft.world.item.crafting.Ingredient.TagValue; import net.minecraft.world.item.crafting.Ingredient.Value; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.ShapedRecipe; +import net.minecraft.world.item.crafting.ShapedRecipePattern; +import net.minecraft.world.item.crafting.ShapelessRecipe; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Blocks; import net.minecraftforge.common.Tags; @@ -95,34 +96,38 @@ public final class ForgeRecipeProvider extends VanillaRecipeProvider { super.buildRecipes(new RecipeOutput() { @Override - public void accept(FinishedRecipe vanilla) { - var modified = enhance(vanilla); + public void accept(ResourceLocation id, Recipe recipe, AdvancementHolder advancement) { + var modified = enhance(id, recipe); if (modified != null) - consumer.accept(modified); + consumer.accept(id, modified, advancement); } @Override public Builder advancement() { return consumer.advancement(); } + + @Override + public void accept(ResourceLocation id, Recipe recipe, ResourceLocation advancementId, JsonElement advancement) { + } }); } @Nullable - private FinishedRecipe enhance(FinishedRecipe vanilla) { - if (vanilla instanceof ShapelessRecipeBuilder.Result shapeless) - return enhance(shapeless); - if (vanilla instanceof ShapedRecipeBuilder.Result shaped) - return enhance(shaped); + private Recipe enhance(ResourceLocation id, Recipe vanilla) { + if (vanilla instanceof ShapelessRecipe shapeless) + return enhance(id, shapeless); + if (vanilla instanceof ShapedRecipe shaped) + return enhance(id, shaped); return null; } @Nullable - private FinishedRecipe enhance(ShapelessRecipeBuilder.Result vanilla) { - List ingredients = getField(ShapelessRecipeBuilder.Result.class, vanilla, 4); + private Recipe enhance(ResourceLocation id, ShapelessRecipe vanilla) { + List ingredients = getField(ShapelessRecipe.class, vanilla, 3); boolean modified = false; for (int x = 0; x < ingredients.size(); x++) { - Ingredient ing = enhance(vanilla.id(), ingredients.get(x)); + Ingredient ing = enhance(id, ingredients.get(x)); if (ing != null) { ingredients.set(x, ing); modified = true; @@ -133,7 +138,7 @@ public final class ForgeRecipeProvider extends VanillaRecipeProvider { @Nullable @Override - protected CompletableFuture saveAdvancement(CachedOutput output, ResourceLocation advancementId, JsonObject advancementJson, FinishedRecipe finishedRecipe) { + protected CompletableFuture saveAdvancement(CachedOutput output, ResourceLocation advancementId, JsonElement advancement) { // NOOP - We don't replace any of the advancement things yet... return null; } @@ -145,11 +150,13 @@ public final class ForgeRecipeProvider extends VanillaRecipeProvider { } @Nullable - private FinishedRecipe enhance(ShapedRecipeBuilder.Result vanilla) { - Map ingredients = getField(ShapedRecipeBuilder.Result.class, vanilla, 5); + private Recipe enhance(ResourceLocation id, ShapedRecipe vanilla) { + ShapedRecipePattern pattern = getField(ShapedRecipe.class, vanilla, 2); + var data = pattern.data().orElseThrow(() -> new IllegalStateException("Weird shaped recipe, data is missing? " + id + " " + vanilla)); + Map ingredients = data.key(); boolean modified = false; for (Character x : ingredients.keySet()) { - Ingredient ing = enhance(vanilla.id(), ingredients.get(x)); + Ingredient ing = enhance(id, ingredients.get(x)); if (ing != null) { ingredients.put(x, ing); modified = true; diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java index 8b29eebea6..aae32ae48f 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlock.java @@ -294,7 +294,7 @@ public interface IForgeBlock * @param target The full target the player is looking at * @return A ItemStack to add to the player's inventory, empty itemstack if nothing should be added. */ - default ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) + default ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { return self().getCloneItemStack(level, pos, state); } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockEntity.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockEntity.java index 165a14632d..48863ac3e7 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockEntity.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockEntity.java @@ -102,44 +102,31 @@ public interface IForgeBlockEntity extends ICapabilitySerializable * * @return an appropriately size {@link AABB} for the {@link BlockEntity} */ - default AABB getRenderBoundingBox() - { + default AABB getRenderBoundingBox() { AABB bb = INFINITE_EXTENT_AABB; BlockState state = self().getBlockState(); Block block = state.getBlock(); BlockPos pos = self().getBlockPos(); - if (block == Blocks.ENCHANTING_TABLE) - { - bb = new AABB(pos, pos.offset(1, 1, 1)); - } - else if (block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST) - { - bb = new AABB(pos.offset(-1, 0, -1), pos.offset(2, 2, 2)); - } - else if (block == Blocks.STRUCTURE_BLOCK) - { + if (block == Blocks.ENCHANTING_TABLE) { + bb = new AABB(pos); + } else if (block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST) { + bb = AABB.encapsulatingFullBlocks(pos.offset(-1, 0, -1), pos.offset(1, 0, 1)); + } else if (block == Blocks.STRUCTURE_BLOCK) { bb = INFINITE_EXTENT_AABB; - } - else if (block != null && block != Blocks.BEACON) - { + } else if (block != null && block != Blocks.BEACON) { AABB cbb = null; - try - { + try { VoxelShape collisionShape = state.getCollisionShape(self().getLevel(), pos); if (!collisionShape.isEmpty()) - { cbb = collisionShape.bounds().move(pos); - } - } - catch (Exception e) - { + } catch (Exception e) { // We have to capture any exceptions that may occur here because BUKKIT servers like to send // the tile entity data BEFORE the chunk data, you know, the OPPOSITE of what vanilla does! // So we can not GUARANTEE that the world state is the real state for the block... // So, once again in the long line of US having to accommodate BUKKIT breaking things, // here it is, assume that the TE is only 1 cubic block. Problem with this is that it may // cause the TileEntity renderer to error further down the line! But alas, nothing we can do. - cbb = new net.minecraft.world.phys.AABB(pos.offset(-1, 0, -1), pos.offset(1, 1, 1)); + cbb = AABB.encapsulatingFullBlocks(pos.offset(-1, 0, -1), pos.offset(1, 1, 1)); } if (cbb != null) bb = cbb; } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java index 03ee04cc6f..4097647c5c 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeBlockState.java @@ -220,7 +220,7 @@ public interface IForgeBlockState * @param target The full target the player is looking at * @return A ItemStack to add to the player's inventory, empty itemstack if nothing should be added. */ - default ItemStack getCloneItemStack(HitResult target, BlockGetter level, BlockPos pos, Player player) + default ItemStack getCloneItemStack(HitResult target, LevelReader level, BlockPos pos, Player player) { return self().getBlock().getCloneItemStack(self(), target, level, pos, player); } diff --git a/src/main/java/net/minecraftforge/common/extensions/IForgeLivingEntity.java b/src/main/java/net/minecraftforge/common/extensions/IForgeLivingEntity.java index 43308d42ba..7d582921fc 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IForgeLivingEntity.java +++ b/src/main/java/net/minecraftforge/common/extensions/IForgeLivingEntity.java @@ -53,7 +53,7 @@ public interface IForgeLivingEntity extends IForgeEntity { if (type == ForgeMod.WATER_TYPE.get()) return !self().canBreatheUnderwater(); return - type.canDrownIn(self()); + type.canDrownIn(self()); } /** diff --git a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java index e4934f7894..e4c0beb09a 100644 --- a/src/main/java/net/minecraftforge/event/ForgeEventFactory.java +++ b/src/main/java/net/minecraftforge/event/ForgeEventFactory.java @@ -18,6 +18,7 @@ import com.mojang.brigadier.CommandDispatcher; import net.minecraft.advancements.AdvancementHolder; import net.minecraft.advancements.AdvancementProgress; +import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.commands.CommandBuildContext; import net.minecraft.core.Holder; import net.minecraft.core.RegistryAccess; @@ -798,6 +799,14 @@ public class ForgeEventFactory { post(new ChunkEvent.Load(chunk, newChunk)); } + public static void onLevelUnload(Level level) { + post(new LevelEvent.Unload(level)); + } + + public static void onLevelLoad(Level level) { + post(new LevelEvent.Load(level)); + } + public static void onChunkDataSave(ChunkAccess chunk, LevelAccessor world, CompoundTag data) { post(new ChunkDataEvent.Save(chunk, world, data)); } diff --git a/src/main/java/net/minecraftforge/server/command/GenerateCommand.java b/src/main/java/net/minecraftforge/server/command/GenerateCommand.java index d6a7f4052f..ebb56b8133 100644 --- a/src/main/java/net/minecraftforge/server/command/GenerateCommand.java +++ b/src/main/java/net/minecraftforge/server/command/GenerateCommand.java @@ -9,7 +9,6 @@ import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.context.CommandContext; -import net.minecraft.commands.CommandRuntimeException; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.commands.arguments.coordinates.BlockPosArgument; @@ -18,10 +17,8 @@ import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraftforge.common.WorldWorkerManager; -class GenerateCommand -{ - static ArgumentBuilder register() - { +class GenerateCommand { + static ArgumentBuilder register() { return Commands.literal("generate") .requires(cs->cs.hasPermission(4)) //permission .then(Commands.argument("pos", BlockPosArgument.blockPos()) @@ -37,13 +34,11 @@ class GenerateCommand ); } - private static int getInt(CommandContext ctx, String name) - { + private static int getInt(CommandContext ctx, String name) { return IntegerArgumentType.getInteger(ctx, name); } - private static int execute(CommandSourceStack source, BlockPos pos, int count, ServerLevel dim, int interval) throws CommandRuntimeException - { + private static int execute(CommandSourceStack source, BlockPos pos, int count, ServerLevel dim, int interval) { BlockPos chunkpos = new BlockPos(pos.getX() >> 4, 0, pos.getZ() >> 4); ChunkGenWorker worker = new ChunkGenWorker(source, chunkpos, count, dim, interval); diff --git a/src/main/java/net/minecraftforge/server/command/TPSCommand.java b/src/main/java/net/minecraftforge/server/command/TPSCommand.java index ddcf3efc63..ed6cc372ec 100644 --- a/src/main/java/net/minecraftforge/server/command/TPSCommand.java +++ b/src/main/java/net/minecraftforge/server/command/TPSCommand.java @@ -34,7 +34,7 @@ class TPSCommand sendTime(ctx.getSource(), dim); @SuppressWarnings("resource") - double meanTickTime = mean(ctx.getSource().getServer().tickTimes) * 1.0E-6D; + double meanTickTime = mean(ctx.getSource().getServer().tickTimesNanos) * 1.0E-6D; double meanTPS = Math.min(1000.0/meanTickTime, 20); ctx.getSource().sendSuccess(() -> Component.translatable("commands.forge.tps.summary.all", TIME_FORMATTER.format(meanTickTime), TIME_FORMATTER.format(meanTPS)), false); diff --git a/src/main/java/net/minecraftforge/server/command/TrackCommand.java b/src/main/java/net/minecraftforge/server/command/TrackCommand.java index 9f52c2ee32..700b3e3a30 100644 --- a/src/main/java/net/minecraftforge/server/command/TrackCommand.java +++ b/src/main/java/net/minecraftforge/server/command/TrackCommand.java @@ -14,7 +14,6 @@ import java.util.Comparator; import java.util.List; import java.util.function.Function; -import net.minecraft.commands.CommandRuntimeException; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.world.entity.Entity; @@ -25,12 +24,10 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.server.timings.ForgeTimings; import net.minecraftforge.server.timings.TimeTracker; -class TrackCommand -{ +class TrackCommand { private static final DecimalFormat TIME_FORMAT = new DecimalFormat("#####0.00"); - static ArgumentBuilder register() - { + static ArgumentBuilder register() { return Commands.literal("track") .then(StartTrackingCommand.register()) .then(ResetTrackingCommand.register()) @@ -39,10 +36,8 @@ class TrackCommand .then(StartTrackingCommand.register()); } - private static class StartTrackingCommand - { - static ArgumentBuilder register() - { + private static class StartTrackingCommand { + static ArgumentBuilder register() { return Commands.literal("start") .requires(cs->cs.hasPermission(2)) //permission .then(Commands.literal("te") @@ -70,10 +65,8 @@ class TrackCommand } } - private static class ResetTrackingCommand - { - static ArgumentBuilder register() - { + private static class ResetTrackingCommand { + static ArgumentBuilder register() { return Commands.literal("reset") .requires(cs->cs.hasPermission(2)) //permission .then(Commands.literal("te") @@ -93,15 +86,13 @@ class TrackCommand } } - private static class TrackResults - { + private static class TrackResults { /** * Returns the time objects recorded by the time tracker sorted by average time * * @return A list of time objects */ - private static List> getSortedTimings(TimeTracker tracker) - { + private static List> getSortedTimings(TimeTracker tracker) { ArrayList> list = new ArrayList<>(); list.addAll(tracker.getTimingData()); @@ -111,61 +102,49 @@ class TrackCommand return list; } - private static int execute(CommandSourceStack source, TimeTracker tracker, Function, Component> toString) throws CommandRuntimeException - { + private static int execute(CommandSourceStack source, TimeTracker tracker, Function, Component> toString) { List> timingsList = getSortedTimings(tracker); if (timingsList.isEmpty()) - { source.sendSuccess(() -> Component.translatable("commands.forge.tracking.no_data"), true); - } - else - { + else { timingsList.stream() - .filter(timings -> timings.getObject().get() != null) - .limit(10) - .forEach(timings -> source.sendSuccess(() -> toString.apply(timings), true)); + .filter(timings -> timings.getObject().get() != null) + .limit(10) + .forEach(timings -> source.sendSuccess(() -> toString.apply(timings), true)); } return 0; } } - private static class TrackResultsEntity - { - static ArgumentBuilder register() - { - return Commands.literal("entity").executes(ctx -> TrackResults.execute(ctx.getSource(), TimeTracker.ENTITY_UPDATE, data -> - { - Entity entity = data.getObject().get(); - if (entity == null) - return Component.translatable("commands.forge.tracking.invalid"); + private static class TrackResultsEntity { + static ArgumentBuilder register() { + return Commands.literal("entity").executes(ctx -> TrackResults.execute(ctx.getSource(), TimeTracker.ENTITY_UPDATE, data -> { + Entity entity = data.getObject().get(); + if (entity == null) + return Component.translatable("commands.forge.tracking.invalid"); - BlockPos pos = entity.blockPosition(); - double averageTimings = data.getAverageTimings(); - String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "\u03bcs" : "ms"); + BlockPos pos = entity.blockPosition(); + double averageTimings = data.getAverageTimings(); + String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "\u03bcs" : "ms"); - return Component.translatable("commands.forge.tracking.timing_entry", ForgeRegistries.ENTITY_TYPES.getKey(entity.getType()), entity.level().dimension().location().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime); - }) - ); + return Component.translatable("commands.forge.tracking.timing_entry", ForgeRegistries.ENTITY_TYPES.getKey(entity.getType()), entity.level().dimension().location().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime); + })); } } - private static class TrackResultsBlockEntity - { - static ArgumentBuilder register() - { - return Commands.literal("te").executes(ctx -> TrackResults.execute(ctx.getSource(), TimeTracker.BLOCK_ENTITY_UPDATE, data -> - { - BlockEntity be = data.getObject().get(); - if (be == null) - return Component.translatable("commands.forge.tracking.invalid"); + private static class TrackResultsBlockEntity { + static ArgumentBuilder register() { + return Commands.literal("te").executes(ctx -> TrackResults.execute(ctx.getSource(), TimeTracker.BLOCK_ENTITY_UPDATE, data -> { + BlockEntity be = data.getObject().get(); + if (be == null) + return Component.translatable("commands.forge.tracking.invalid"); - BlockPos pos = be.getBlockPos(); + BlockPos pos = be.getBlockPos(); - double averageTimings = data.getAverageTimings(); - String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "\u03bcs" : "ms"); - return Component.translatable("commands.forge.tracking.timing_entry", ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(be.getType()), be.getLevel().dimension().location().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime); - }) - ); + double averageTimings = data.getAverageTimings(); + String tickTime = (averageTimings > 1000 ? TIME_FORMAT.format(averageTimings / 1000) : TIME_FORMAT.format(averageTimings)) + (averageTimings < 1000 ? "\u03bcs" : "ms"); + return Component.translatable("commands.forge.tracking.timing_entry", ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(be.getType()), be.getLevel().dimension().location().toString(), pos.getX(), pos.getY(), pos.getZ(), tickTime); + })); } } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 494f0a0f0e..74a06bf18f 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -53,6 +53,7 @@ protected net.minecraft.client.gui.Gui f_291829_ # CROSSHAIR_SPRITE protected net.minecraft.client.gui.Gui f_291833_ # AIR_SPRITE protected net.minecraft.client.gui.Gui f_291864_ # HOTBAR_OFFHAND_RIGHT_SPRITE protected net.minecraft.client.gui.Gui f_291879_ # ARMOR_EMPTY_SPRITE +protected net.minecraft.client.gui.Gui f_302813_ # SCORE_DISPLAY_ORDER protected net.minecraft.client.gui.Gui f_92970_ # titleFadeInTime protected net.minecraft.client.gui.Gui f_92971_ # titleStayTime protected net.minecraft.client.gui.Gui f_92972_ # titleFadeOutTime @@ -191,6 +192,7 @@ protected net.minecraft.core.IdMapper f_122653_ # nextId protected net.minecraft.core.IdMapper f_122654_ # tToId - internal map protected net.minecraft.core.IdMapper f_122655_ # idToT - internal index list protected net.minecraft.core.MappedRegistry f_244282_ # unregisteredIntrusiveHolders +public net.minecraft.core.RegistrySetBuilder$LazyHolder m_247654_(Ljava/lang/Object;)V # bindValue public net.minecraft.core.RegistrySynchronization$NetworkedRegistryData public net.minecraft.core.particles.ParticleType (ZLnet/minecraft/core/particles/ParticleOptions$Deserializer;)V # constructor public net.minecraft.core.particles.SimpleParticleType (Z)V # constructor @@ -210,7 +212,6 @@ protected net.minecraft.data.recipes.RecipeProvider m_245792_(Lnet/minecraft/dat protected net.minecraft.data.recipes.RecipeProvider m_245864_(Lnet/minecraft/data/recipes/RecipeCategory;Lnet/minecraft/world/level/ItemLike;Lnet/minecraft/world/item/crafting/Ingredient;)Lnet/minecraft/data/recipes/RecipeBuilder; # wallBuilder protected net.minecraft.data.recipes.RecipeProvider m_247174_(Lnet/minecraft/data/recipes/RecipeCategory;Lnet/minecraft/world/level/ItemLike;Lnet/minecraft/world/item/crafting/Ingredient;)Lnet/minecraft/data/recipes/RecipeBuilder; # polishedBuilder protected net.minecraft.data.recipes.RecipeProvider m_247347_(Lnet/minecraft/data/recipes/RecipeCategory;Lnet/minecraft/world/level/ItemLike;Lnet/minecraft/world/item/crafting/Ingredient;)Lnet/minecraft/data/recipes/RecipeBuilder; # pressurePlateBuilder -public net.minecraft.data.recipes.ShapedRecipeBuilder$Result public net.minecraft.data.recipes.packs.VanillaRecipeProvider f_243671_ # COAL_SMELTABLES public net.minecraft.data.recipes.packs.VanillaRecipeProvider f_243779_ # IRON_SMELTABLES public net.minecraft.data.recipes.packs.VanillaRecipeProvider f_243908_ # COPPER_SMELTABLES @@ -228,7 +229,8 @@ public net.minecraft.gametest.framework.GameTestServer (Ljava/lang/Thread; public net.minecraft.resources.ResourceLocation m_135835_(C)Z # validNamespaceChar public net.minecraft.resources.ResourceLocation m_135841_(Ljava/lang/String;)Z # isValidPath public net.minecraft.resources.ResourceLocation m_135843_(Ljava/lang/String;)Z # isValidNamespace -protected net.minecraft.server.MinecraftServer f_129726_ # nextTickTime +protected net.minecraft.server.MinecraftServer f_302313_ # nextTickTimeNanos +public net.minecraft.server.MinecraftServer f_303727_ # tickTimesNanos public net.minecraft.server.MinecraftServer$ReloadableResources public net.minecraft.server.dedicated.DedicatedServer f_139600_ # consoleInput public net.minecraft.server.level.ServerChunkCache f_8329_ # level @@ -263,7 +265,6 @@ public net.minecraft.world.entity.player.Player m_6915_()V # closeContainer protected net.minecraft.world.entity.projectile.Projectile (Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;)V # constructor private-f net.minecraft.world.entity.raid.Raid$RaiderType f_37813_ # VALUES public net.minecraft.world.entity.schedule.Activity (Ljava/lang/String;)V # constructor -protected net.minecraft.world.entity.vehicle.AbstractMinecart m_213728_()Lnet/minecraft/world/item/Item; # getDropItem - make AbstractMinecart implementable public net.minecraft.world.inventory.AnvilMenu f_39000_ # repairItemCountCost public net.minecraft.world.inventory.MenuType (Lnet/minecraft/world/inventory/MenuType$MenuSupplier;Lnet/minecraft/world/flag/FeatureFlagSet;)V # constructor public net.minecraft.world.inventory.MenuType$MenuSupplier @@ -336,48 +337,43 @@ protected net.minecraft.world.level.biome.MobSpawnSettings$Builder f_48362_ # sp protected net.minecraft.world.level.biome.MobSpawnSettings$Builder f_48363_ # mobSpawnCosts protected net.minecraft.world.level.biome.MobSpawnSettings$Builder f_48364_ # creatureGenerationProbability #group public net.minecraft.world.level.block.Block -public net.minecraft.world.level.block.AirBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.AttachedStemBlock (Lnet/minecraft/world/level/block/StemGrownBlock;Ljava/util/function/Supplier;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.AttachedStemBlock (Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.AzaleaBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BarrierBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BaseCoralFanBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BaseCoralPlantBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.BaseCoralPlantTypeBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BaseCoralWallFanBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BigDripleafBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BigDripleafStemBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.BlastFurnaceBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.BushBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.ButtonBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;IZ)V # constructor +public net.minecraft.world.level.block.ButtonBlock (Lnet/minecraft/world/level/block/state/properties/BlockSetType;ILnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CactusBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CakeBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CandleCakeBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CartographyTableBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CarvedPumpkinBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.ChestBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Ljava/util/function/Supplier;)V # constructor -public net.minecraft.world.level.block.ChorusFlowerBlock (Lnet/minecraft/world/level/block/ChorusPlantBlock;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.ChorusFlowerBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.ChorusPlantBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CoralFanBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CoralPlantBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CoralWallFanBlock (Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CraftingTableBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.CropBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.CrossCollisionBlock (FFFFFLnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.DeadBushBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.DecoratedPotBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.DirtPathBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.DispenserBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.DoorBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor +public net.minecraft.world.level.block.DoorBlock (Lnet/minecraft/world/level/block/state/properties/BlockSetType;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EnchantmentTableBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EndGatewayBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EndPortalBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EndRodBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EnderChestBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.EquipableCarvedPumpkinBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.FarmBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.FletchingTableBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.FungusBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/level/block/Block;)V # constructor +public net.minecraft.world.level.block.FungusBlock (Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/level/block/Block;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.FurnaceBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.GrindstoneBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.HalfTransparentBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor @@ -393,23 +389,20 @@ public net.minecraft.world.level.block.LeverBlock (Lnet/minecraft/world/le public net.minecraft.world.level.block.LiquidBlock (Lnet/minecraft/world/level/material/FlowingFluid;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.LoomBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.MangroveRootsBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.MelonBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.NetherWartBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.NyliumBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PinkPetalsBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.PipeBlock (FLnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PlayerHeadBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PlayerWallHeadBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PoweredRailBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.PressurePlateBlock (Lnet/minecraft/world/level/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor +public net.minecraft.world.level.block.PressurePlateBlock (Lnet/minecraft/world/level/block/state/properties/BlockSetType;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.PumpkinBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.RailBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.RedstoneTorchBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.RedstoneWallTorchBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.RepeaterBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.RodBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.RootsBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.SaplingBlock (Lnet/minecraft/world/level/block/grower/AbstractTreeGrower;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.SaplingBlock (Lnet/minecraft/world/level/block/grower/TreeGrower;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.ScaffoldingBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.SeaPickleBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.SeagrassBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor @@ -421,17 +414,22 @@ public net.minecraft.world.level.block.SnowyDirtBlock (Lnet/minecraft/worl public net.minecraft.world.level.block.SpawnerBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.SpongeBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.StairBlock (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.StemBlock (Lnet/minecraft/world/level/block/StemGrownBlock;Ljava/util/function/Supplier;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.StemBlock (Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.StructureBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.StructureVoidBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.SugarCaneBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.TallGrassBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.TorchBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V # constructor -public net.minecraft.world.level.block.TrapDoorBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor +public net.minecraft.world.level.block.TorchBlock (Lnet/minecraft/core/particles/SimpleParticleType;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.TransparentBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.TrapDoorBlock (Lnet/minecraft/world/level/block/state/properties/BlockSetType;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WallSkullBlock (Lnet/minecraft/world/level/block/SkullBlock$Type;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.WallTorchBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/core/particles/ParticleOptions;)V # constructor +public net.minecraft.world.level.block.WallTorchBlock (Lnet/minecraft/core/particles/SimpleParticleType;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WaterlilyBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor -public net.minecraft.world.level.block.WeightedPressurePlateBlock (ILnet/minecraft/world/level/block/state/BlockBehaviour$Properties;Lnet/minecraft/world/level/block/state/properties/BlockSetType;)V # constructor +public net.minecraft.world.level.block.WaterloggedTransparentBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.WeatheringCopperDoorBlock (Lnet/minecraft/world/level/block/state/properties/BlockSetType;Lnet/minecraft/world/level/block/WeatheringCopper$WeatherState;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.WeatheringCopperGrateBlock (Lnet/minecraft/world/level/block/WeatheringCopper$WeatherState;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.WeatheringCopperTrapDoorBlock (Lnet/minecraft/world/level/block/state/properties/BlockSetType;Lnet/minecraft/world/level/block/WeatheringCopper$WeatherState;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor +public net.minecraft.world.level.block.WeightedPressurePlateBlock (ILnet/minecraft/world/level/block/state/properties/BlockSetType;Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WetSpongeBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WitherSkullBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor public net.minecraft.world.level.block.WitherWallSkullBlock (Lnet/minecraft/world/level/block/state/BlockBehaviour$Properties;)V # constructor diff --git a/src/main/resources/coremods/field_to_method.js b/src/main/resources/coremods/field_to_method.js index 17cd528184..6d01086a60 100644 --- a/src/main/resources/coremods/field_to_method.js +++ b/src/main/resources/coremods/field_to_method.js @@ -5,7 +5,7 @@ function initializeCoreMod() { 'biome': { 'target': { 'type': 'CLASS', - 'name': 'net.minecraft.world.level.biome.Biome' + 'name': 'net.minecraft.world.level.biome.Biome' }, 'transformer': function(classNode) { ASMAPI.redirectFieldToMethod(classNode, ASMAPI.mapField('f_47437_'), 'getModifiedClimateSettings') @@ -53,24 +53,13 @@ function initializeCoreMod() { return classNode; } }, - 'stairsblock': { - 'target': { - 'type': 'CLASS', - 'name': 'net.minecraft.world.level.block.StairBlock' - }, - 'transformer': function(classNode) { - ASMAPI.redirectFieldToMethod(classNode, ASMAPI.mapField('f_56858_'), 'getModelBlock') - ASMAPI.redirectFieldToMethod(classNode, ASMAPI.mapField('f_56859_'), 'getModelState') - return classNode; - } - }, 'flowerpotblock': { 'target': { 'type': 'CLASS', 'name': 'net.minecraft.world.level.block.FlowerPotBlock' }, 'transformer': function(classNode) { - ASMAPI.redirectFieldToMethod(classNode, ASMAPI.mapField('f_53525_'), ASMAPI.mapMethod('m_53560_')) // flower + ASMAPI.redirectFieldToMethod(classNode, ASMAPI.mapField('f_302266_'), ASMAPI.mapMethod('m_304918_')) // potted return classNode; } }, diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_doesnt_load_empty.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_doesnt_load_empty.json index 714ca55a04..71df22f646 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_doesnt_load_empty.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_doesnt_load_empty.json @@ -36,8 +36,7 @@ "recipes": [ "minecraft:diamond_block" ] - }, - "sends_telemetry_event": false + } } ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_recipe_choice.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_recipe_choice.json index 28800a22e9..51ed7f4104 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_recipe_choice.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/conditional_recipe_choice.json @@ -36,8 +36,7 @@ "recipes": [ "minecraft:diamond_block" ] - }, - "sends_telemetry_event": false + } }, { "parent": "minecraft:recipes/root", @@ -75,8 +74,7 @@ "recipes": [ "minecraft:diamond_block" ] - }, - "sends_telemetry_event": false + } } ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/cooking_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/cooking_false_conditions.json new file mode 100644 index 0000000000..71df22f646 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/cooking_false_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_dirt": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:dirt" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:false", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_dirt" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/cooking_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/cooking_true_conditions.json new file mode 100644 index 0000000000..3ac4f67736 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/cooking_true_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_bee_nest": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:bee_nest" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:true", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_bee_nest" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/cooking_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/cooking_false_conditions.json deleted file mode 100644 index c4d41a0a22..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/cooking_false_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_dirt": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:dirt" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:cooking_false_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_dirt" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:cooking_false_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/cooking_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/cooking_true_conditions.json deleted file mode 100644 index ff89ae85e5..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/cooking_true_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_bee_nest": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:bee_nest" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:cooking_true_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_bee_nest" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:cooking_true_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shaped_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shaped_false_conditions.json deleted file mode 100644 index 75de699e90..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shaped_false_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_dirt": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:dirt" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:shaped_false_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_dirt" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:shaped_false_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shaped_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shaped_true_conditions.json deleted file mode 100644 index 9f03d0d081..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shaped_true_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_oak_log": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:oak_log" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:shaped_true_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_oak_log" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:shaped_true_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shapeless_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shapeless_false_conditions.json deleted file mode 100644 index 6660d7623d..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shapeless_false_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_redstone_ore": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:redstone_ore" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:shapeless_false_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_redstone_ore" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:shapeless_false_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shapeless_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shapeless_true_conditions.json deleted file mode 100644 index 59ecfd6935..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/shapeless_true_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_redstone_ore": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:redstone_ore" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:shapeless_true_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_redstone_ore" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:shapeless_true_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/singe_item_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/singe_item_true_conditions.json deleted file mode 100644 index 558a75f697..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/singe_item_true_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_redstone_ore": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:redstone_ore" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:singe_item_true_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_redstone_ore" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:singe_item_true_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/single_item_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/single_item_false_conditions.json deleted file mode 100644 index 7baba2ba90..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/single_item_false_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_dirt": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:dirt" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:single_item_false_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_dirt" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:single_item_false_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/test_encode_all_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/test_encode_all_conditions.json deleted file mode 100644 index 453eb36ee9..0000000000 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/misc/test_encode_all_conditions.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_dirt": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:dirt" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "conditional_recipe:test_encode_all_conditions" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_dirt" - ] - ], - "rewards": { - "recipes": [ - "conditional_recipe:test_encode_all_conditions" - ] - }, - "sends_telemetry_event": false -} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shaped_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shaped_false_conditions.json new file mode 100644 index 0000000000..71df22f646 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shaped_false_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_dirt": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:dirt" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:false", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_dirt" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shaped_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shaped_true_conditions.json new file mode 100644 index 0000000000..6f0c041227 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shaped_true_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_oak_log": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:oak_log" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:true", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_oak_log" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shapeless_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shapeless_false_conditions.json new file mode 100644 index 0000000000..3054fb16df --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shapeless_false_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_redstone_ore": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:redstone_ore" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:false", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_redstone_ore" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shapeless_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shapeless_true_conditions.json new file mode 100644 index 0000000000..e93ae3dbb2 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/shapeless_true_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_redstone_ore": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:redstone_ore" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:true", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_redstone_ore" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/singe_item_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/singe_item_true_conditions.json new file mode 100644 index 0000000000..e93ae3dbb2 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/singe_item_true_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_redstone_ore": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:redstone_ore" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:true", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_redstone_ore" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/single_item_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/single_item_false_conditions.json new file mode 100644 index 0000000000..71df22f646 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/single_item_false_conditions.json @@ -0,0 +1,42 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_dirt": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:dirt" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:false", + "value": {} + }, + "requirements": [ + [ + "has_the_recipe", + "has_dirt" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/test_encode_all_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/test_encode_all_conditions.json new file mode 100644 index 0000000000..d7e4486e38 --- /dev/null +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/advancements/recipes/test_encode_all_conditions.json @@ -0,0 +1,71 @@ +{ + "advancements": [ + { + "parent": "minecraft:recipes/root", + "criteria": { + "has_dirt": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:dirt" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:diamond_block" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "forge:condition": { + "type": "forge:and", + "values": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:not", + "value": { + "type": "forge:mod_loaded", + "modid": "minecraft" + } + }, + { + "type": "forge:item_exists", + "item": "minecraft:dirt" + }, + { + "type": "forge:true", + "value": {} + }, + { + "type": "forge:tag_empty", + "tag": "minecraft:dirt" + } + ] + }, + { + "type": "forge:false", + "value": {} + } + ] + }, + "requirements": [ + [ + "has_the_recipe", + "has_dirt" + ] + ], + "rewards": { + "recipes": [ + "minecraft:diamond_block" + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_doesnt_load_empty.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_doesnt_load_empty.json index d90ea07e5e..4bbe29ba27 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_doesnt_load_empty.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_doesnt_load_empty.json @@ -8,10 +8,6 @@ { "type": "minecraft:crafting_shapeless", "category": "misc", - "forge:condition": { - "type": "forge:false", - "value": {} - }, "ingredients": [ { "item": "minecraft:dirt" diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_recipe_choice.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_recipe_choice.json index c18f93b244..23a2e5fbf5 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_recipe_choice.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/conditional_recipe_choice.json @@ -20,8 +20,7 @@ "result": { "count": 64, "item": "minecraft:diamond_block" - }, - "show_notification": true + } }, { "type": "minecraft:crafting_shaped", @@ -42,8 +41,7 @@ "result": { "count": 64, "item": "minecraft:diamond_block" - }, - "show_notification": true + } } ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_false_conditions.json index 52dda96838..dbb8c2221d 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_false_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_false_conditions.json @@ -1,14 +1,19 @@ { - "type": "minecraft:smelting", - "category": "blocks", - "cookingtime": 200, - "experience": 0.1, + "type": "forge:conditional", "forge:condition": { "type": "forge:false", "value": {} }, - "ingredient": { - "item": "minecraft:dirt" - }, - "result": "minecraft:diamond_block" + "recipes": [ + { + "type": "minecraft:smelting", + "category": "blocks", + "cookingtime": 200, + "experience": 0.1, + "ingredient": { + "item": "minecraft:dirt" + }, + "result": "minecraft:diamond_block" + } + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_true_conditions.json index 9c9fb75101..e85d511a1e 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_true_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/cooking_true_conditions.json @@ -1,14 +1,19 @@ { - "type": "minecraft:smelting", - "category": "blocks", - "cookingtime": 200, - "experience": 0.1, + "type": "forge:conditional", "forge:condition": { "type": "forge:true", "value": {} }, - "ingredient": { - "item": "minecraft:bee_nest" - }, - "result": "minecraft:diamond_block" + "recipes": [ + { + "type": "minecraft:smelting", + "category": "blocks", + "cookingtime": 200, + "experience": 0.1, + "ingredient": { + "item": "minecraft:bee_nest" + }, + "result": "minecraft:diamond_block" + } + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_false_conditions.json index 74252a0943..8c957588a3 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_false_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_false_conditions.json @@ -1,23 +1,27 @@ { - "type": "minecraft:crafting_shaped", - "category": "misc", + "type": "forge:conditional", "forge:condition": { "type": "forge:false", "value": {} }, - "key": { - "X": { - "item": "minecraft:dirt" + "recipes": [ + { + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "X": { + "item": "minecraft:dirt" + } + }, + "pattern": [ + "XXX", + "XXX", + "XXX" + ], + "result": { + "count": 64, + "item": "minecraft:diamond_block" + } } - }, - "pattern": [ - "XXX", - "XXX", - "XXX" - ], - "result": { - "count": 64, - "item": "minecraft:diamond_block" - }, - "show_notification": true + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_true_conditions.json index 670efe05b1..3273547fd5 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_true_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shaped_true_conditions.json @@ -1,23 +1,27 @@ { - "type": "minecraft:crafting_shaped", - "category": "misc", + "type": "forge:conditional", "forge:condition": { "type": "forge:true", "value": {} }, - "key": { - "X": { - "item": "minecraft:oak_log" + "recipes": [ + { + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "X": { + "item": "minecraft:oak_log" + } + }, + "pattern": [ + "XXX", + "XXX", + "XXX" + ], + "result": { + "count": 64, + "item": "minecraft:diamond_block" + } } - }, - "pattern": [ - "XXX", - "XXX", - "XXX" - ], - "result": { - "count": 64, - "item": "minecraft:diamond_block" - }, - "show_notification": true + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_false_conditions.json index 3935b8f0cc..a10a3bf3c6 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_false_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_false_conditions.json @@ -1,22 +1,27 @@ { - "type": "minecraft:crafting_shapeless", - "category": "misc", + "type": "forge:conditional", "forge:condition": { "type": "forge:false", "value": {} }, - "ingredients": [ + "recipes": [ { - "item": "minecraft:redstone_ore" - }, - { - "item": "minecraft:redstone_ore" - }, - { - "item": "minecraft:redstone_ore" + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "minecraft:redstone_ore" + }, + { + "item": "minecraft:redstone_ore" + }, + { + "item": "minecraft:redstone_ore" + } + ], + "result": { + "item": "minecraft:diamond_block" + } } - ], - "result": { - "item": "minecraft:diamond_block" - } + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_true_conditions.json index ab9ff4f848..d65d5141a8 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_true_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/shapeless_true_conditions.json @@ -1,25 +1,30 @@ { - "type": "minecraft:crafting_shapeless", - "category": "misc", + "type": "forge:conditional", "forge:condition": { "type": "forge:true", "value": {} }, - "ingredients": [ + "recipes": [ { - "item": "minecraft:redstone_ore" - }, - { - "item": "minecraft:redstone_ore" - }, - { - "item": "minecraft:redstone_ore" - }, - { - "item": "minecraft:redstone_ore" + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "minecraft:redstone_ore" + }, + { + "item": "minecraft:redstone_ore" + }, + { + "item": "minecraft:redstone_ore" + }, + { + "item": "minecraft:redstone_ore" + } + ], + "result": { + "item": "minecraft:diamond_block" + } } - ], - "result": { - "item": "minecraft:diamond_block" - } + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/singe_item_true_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/singe_item_true_conditions.json index 1428baec93..b0fdb017c0 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/singe_item_true_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/singe_item_true_conditions.json @@ -1,12 +1,17 @@ { - "type": "minecraft:stonecutting", - "count": 1, + "type": "forge:conditional", "forge:condition": { "type": "forge:true", "value": {} }, - "ingredient": { - "item": "minecraft:redstone_ore" - }, - "result": "minecraft:diamond_block" + "recipes": [ + { + "type": "minecraft:stonecutting", + "count": 1, + "ingredient": { + "item": "minecraft:redstone_ore" + }, + "result": "minecraft:diamond_block" + } + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/single_item_false_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/single_item_false_conditions.json index 5137643c75..1f6fbda07c 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/single_item_false_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/single_item_false_conditions.json @@ -1,12 +1,17 @@ { - "type": "minecraft:stonecutting", - "count": 1, + "type": "forge:conditional", "forge:condition": { "type": "forge:false", "value": {} }, - "ingredient": { - "item": "minecraft:dirt" - }, - "result": "minecraft:diamond_block" + "recipes": [ + { + "type": "minecraft:stonecutting", + "count": 1, + "ingredient": { + "item": "minecraft:dirt" + }, + "result": "minecraft:diamond_block" + } + ] } \ No newline at end of file diff --git a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/test_encode_all_conditions.json b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/test_encode_all_conditions.json index 0b9a70dc8d..3a5bb29e37 100644 --- a/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/test_encode_all_conditions.json +++ b/src/test/generated/conditional_recipe/data/conditional_recipe/recipes/test_encode_all_conditions.json @@ -1,6 +1,5 @@ { - "type": "minecraft:crafting_shaped", - "category": "misc", + "type": "forge:conditional", "forge:condition": { "type": "forge:and", "values": [ @@ -34,19 +33,24 @@ } ] }, - "key": { - "X": { - "item": "minecraft:dirt" + "recipes": [ + { + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "X": { + "item": "minecraft:dirt" + } + }, + "pattern": [ + "XXX", + "XXX", + "XXX" + ], + "result": { + "count": 64, + "item": "minecraft:diamond_block" + } } - }, - "pattern": [ - "XXX", - "XXX", - "XXX" - ], - "result": { - "count": 64, - "item": "minecraft:diamond_block" - }, - "show_notification": true + ] } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/compound_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/compound_ingredient.json index 066b4c7066..0bf0f6ef8d 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/compound_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/compound_ingredient.json @@ -30,6 +30,5 @@ "recipes": [ "custom_ingredients:compound_ingredient" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/difference_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/difference_ingredient.json index 828e01ac5a..28a43bd0f7 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/difference_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/difference_ingredient.json @@ -30,6 +30,5 @@ "recipes": [ "custom_ingredients:difference_ingredient" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/intersection_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/intersection_ingredient.json index d9c072b190..64b2f7224c 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/intersection_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/intersection_ingredient.json @@ -30,6 +30,5 @@ "recipes": [ "custom_ingredients:intersection_ingredient" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_damage_only.json b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_damage_only.json index d05f48e4c7..843ddb3e64 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_damage_only.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_damage_only.json @@ -30,6 +30,5 @@ "recipes": [ "custom_ingredients:partial_nbt_damage_only" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_name_only.json b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_name_only.json index dd7e945ea9..93da29cc80 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_name_only.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/partial_nbt_name_only.json @@ -30,6 +30,5 @@ "recipes": [ "custom_ingredients:partial_nbt_name_only" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/strict_nbt_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/strict_nbt_ingredient.json index a11793597f..9aa9e8128d 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/strict_nbt_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/advancements/recipes/misc/strict_nbt_ingredient.json @@ -30,6 +30,5 @@ "recipes": [ "custom_ingredients:strict_nbt_ingredient" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/compound_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/compound_ingredient.json index 441f7c19aa..e5bfed2410 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/compound_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/compound_ingredient.json @@ -34,6 +34,5 @@ ], "result": { "item": "minecraft:dirt" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/difference_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/difference_ingredient.json index 896646d69f..78a627d515 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/difference_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/difference_ingredient.json @@ -19,6 +19,5 @@ ], "result": { "item": "minecraft:dirt" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/intersection_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/intersection_ingredient.json index 444742073e..c4de8d30f6 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/intersection_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/intersection_ingredient.json @@ -21,6 +21,5 @@ ], "result": { "item": "minecraft:dirt" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_damage_only.json b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_damage_only.json index f20ccc51e5..a23f6c2865 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_damage_only.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_damage_only.json @@ -18,6 +18,5 @@ ], "result": { "item": "minecraft:dirt" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_name_only.json b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_name_only.json index 505101648e..1d68d79888 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_name_only.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/partial_nbt_name_only.json @@ -17,6 +17,5 @@ ], "result": { "item": "minecraft:dirt" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/strict_nbt_ingredient.json b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/strict_nbt_ingredient.json index db8a4465d9..cfc104444b 100644 --- a/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/strict_nbt_ingredient.json +++ b/src/test/generated/custom_ingredients/data/custom_ingredients/recipes/strict_nbt_ingredient.json @@ -18,6 +18,5 @@ ], "result": { "item": "minecraft:dirt" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/test/generated/mdk_datagen/pack.mcmeta b/src/test/generated/mdk_datagen/pack.mcmeta index 2a62706c90..e1651af8da 100644 --- a/src/test/generated/mdk_datagen/pack.mcmeta +++ b/src/test/generated/mdk_datagen/pack.mcmeta @@ -1,8 +1,6 @@ { "pack": { - "description": { - "text": "${mod_id} resources" - }, - "pack_format": 18 + "description": "${mod_id} resources", + "pack_format": 22 } } \ No newline at end of file diff --git a/src/test/generated/test_helper_mod/pack.mcmeta b/src/test/generated/test_helper_mod/pack.mcmeta index ca02aa7f6f..f4cd0728f8 100644 --- a/src/test/generated/test_helper_mod/pack.mcmeta +++ b/src/test/generated/test_helper_mod/pack.mcmeta @@ -1,8 +1,6 @@ { "pack": { - "description": { - "text": "Forge tests resource pack" - }, - "pack_format": 18 + "description": "Forge tests resource pack", + "pack_format": 22 } } \ No newline at end of file diff --git a/src/test/java/net/minecraftforge/debug/gameplay/crafting/ConditionalRecipeTest.java b/src/test/java/net/minecraftforge/debug/gameplay/crafting/ConditionalRecipeTest.java index 1e1b0c045f..6e23af6e76 100644 --- a/src/test/java/net/minecraftforge/debug/gameplay/crafting/ConditionalRecipeTest.java +++ b/src/test/java/net/minecraftforge/debug/gameplay/crafting/ConditionalRecipeTest.java @@ -163,12 +163,7 @@ public class ConditionalRecipeTest extends BaseTestMod { @Override protected void buildRecipes(RecipeOutput out) { // TODO: Move this to a Condition test instead of using recipe encoders. - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 64) - .pattern("XXX") - .pattern("XXX") - .pattern("XXX") - .define('X', Blocks.DIRT) - .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ConditionalRecipe.builder() .condition( and ( or ( @@ -180,61 +175,102 @@ public class ConditionalRecipeTest extends BaseTestMod { FALSE() ) ) + .recipe( + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 64) + .pattern("XXX") + .pattern("XXX") + .pattern("XXX") + .define('X', Blocks.DIRT) + .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ::save + ) .save(out, rl("test_encode_all_conditions")); - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 64) - .pattern("XXX") - .pattern("XXX") - .pattern("XXX") - .define('X', Blocks.DIRT) - .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ConditionalRecipe.builder() .condition(FALSE()) + .recipe( + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 64) + .pattern("XXX") + .pattern("XXX") + .pattern("XXX") + .define('X', Blocks.DIRT) + .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ::save + ) .save(out, rl("shaped_false_conditions")); - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 64) - .pattern("XXX") - .pattern("XXX") - .pattern("XXX") - .define('X', Blocks.OAK_LOG) - .unlockedBy(getHasName(Blocks.OAK_LOG), has(Blocks.OAK_LOG)) + ConditionalRecipe.builder() .condition(TRUE()) + .recipe( + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 64) + .pattern("XXX") + .pattern("XXX") + .pattern("XXX") + .define('X', Blocks.OAK_LOG) + .unlockedBy(getHasName(Blocks.OAK_LOG), has(Blocks.OAK_LOG)) + ::save + ) .save(out, rl("shaped_true_conditions")); - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) - .requires(Blocks.REDSTONE_ORE) - .requires(Blocks.REDSTONE_ORE) - .requires(Blocks.REDSTONE_ORE) - .unlockedBy(getHasName(Blocks.REDSTONE_ORE), has(Blocks.REDSTONE_ORE)) + ConditionalRecipe.builder() .condition(FALSE()) + .recipe( + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) + .requires(Blocks.REDSTONE_ORE) + .requires(Blocks.REDSTONE_ORE) + .requires(Blocks.REDSTONE_ORE) + .unlockedBy(getHasName(Blocks.REDSTONE_ORE), has(Blocks.REDSTONE_ORE)) + ::save + ) .save(out, rl("shapeless_false_conditions")); - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) - .requires(Blocks.REDSTONE_ORE) - .requires(Blocks.REDSTONE_ORE) - .requires(Blocks.REDSTONE_ORE) - .requires(Blocks.REDSTONE_ORE) - .unlockedBy(getHasName(Blocks.REDSTONE_ORE), has(Blocks.REDSTONE_ORE)) + ConditionalRecipe.builder() .condition(TRUE()) + .recipe( + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) + .requires(Blocks.REDSTONE_ORE) + .requires(Blocks.REDSTONE_ORE) + .requires(Blocks.REDSTONE_ORE) + .requires(Blocks.REDSTONE_ORE) + .unlockedBy(getHasName(Blocks.REDSTONE_ORE), has(Blocks.REDSTONE_ORE)) + ::save + ) .save(out, rl("shapeless_true_conditions")); - SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.DIRT), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 0.1F, 200) - .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ConditionalRecipe.builder() .condition(FALSE()) + .recipe( + SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.DIRT), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 0.1F, 200) + .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ::save + ) .save(out, rl("cooking_false_conditions")); - SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.BEE_NEST), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 0.1F, 200) - .unlockedBy(getHasName(Blocks.BEE_NEST), has(Blocks.BEE_NEST)) + ConditionalRecipe.builder() .condition(TRUE()) + .recipe( + SimpleCookingRecipeBuilder.smelting(Ingredient.of(Blocks.BEE_NEST), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK, 0.1F, 200) + .unlockedBy(getHasName(Blocks.BEE_NEST), has(Blocks.BEE_NEST)) + ::save + ) .save(out, rl("cooking_true_conditions")); - SingleItemRecipeBuilder.stonecutting(Ingredient.of(Blocks.DIRT), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) - .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ConditionalRecipe.builder() .condition(FALSE()) + .recipe( + SingleItemRecipeBuilder.stonecutting(Ingredient.of(Blocks.DIRT), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) + .unlockedBy(getHasName(Blocks.DIRT), has(Blocks.DIRT)) + ::save + ) .save(out, rl("single_item_false_conditions")); - SingleItemRecipeBuilder.stonecutting(Ingredient.of(Blocks.REDSTONE_ORE), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) - .unlockedBy(getHasName(Blocks.REDSTONE_ORE), has(Blocks.REDSTONE_ORE)) + ConditionalRecipe.builder() .condition(TRUE()) + .recipe( + SingleItemRecipeBuilder.stonecutting(Ingredient.of(Blocks.REDSTONE_ORE), RecipeCategory.MISC, Blocks.DIAMOND_BLOCK) + .unlockedBy(getHasName(Blocks.REDSTONE_ORE), has(Blocks.REDSTONE_ORE)) + ::save + ) .save(out, rl("singe_item_true_conditions")); // TODO SmithingTransformRecipeBuilder