diff --git a/gradle.properties b/gradle.properties
index 270ebe4a68a..9849450ca69 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -9,10 +9,10 @@ org.gradle.debug=false
java_version=21
-minecraft_version=1.21.1
-neoform_version=20240808.144430
+minecraft_version=1.21.2-pre1
+neoform_version=20241008.174159
# on snapshot versions, used to prefix the version
-neoforge_snapshot_next_stable=22.0
+neoforge_snapshot_next_stable=21.2
mergetool_version=2.0.0
accesstransformers_version=10.0.1
diff --git a/patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch b/patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch
deleted file mode 100644
index da006f8e164..00000000000
--- a/patches/com/mojang/blaze3d/pipeline/RenderTarget.java.patch
+++ /dev/null
@@ -1,57 +0,0 @@
---- a/com/mojang/blaze3d/pipeline/RenderTarget.java
-+++ b/com/mojang/blaze3d/pipeline/RenderTarget.java
-@@ -104,7 +_,10 @@
- GlStateManager._texParameter(3553, 34892, 0);
- GlStateManager._texParameter(3553, 10242, 33071);
- GlStateManager._texParameter(3553, 10243, 33071);
-+ if (!stencilEnabled)
- GlStateManager._texImage2D(3553, 0, 6402, this.width, this.height, 0, 6402, 5126, null);
-+ else
-+ GlStateManager._texImage2D(3553, 0, org.lwjgl.opengl.GL30.GL_DEPTH32F_STENCIL8, this.width, this.height, 0, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL, org.lwjgl.opengl.GL30.GL_FLOAT_32_UNSIGNED_INT_24_8_REV, null);
- }
-
- this.setFilterMode(9728, true);
-@@ -115,7 +_,14 @@
- GlStateManager._glBindFramebuffer(36160, this.frameBufferId);
- GlStateManager._glFramebufferTexture2D(36160, 36064, 3553, this.colorTextureId, 0);
- if (this.useDepth) {
-+ if(!stencilEnabled)
- GlStateManager._glFramebufferTexture2D(36160, 36096, 3553, this.depthBufferId, 0);
-+ else if(net.neoforged.neoforge.common.NeoForgeConfig.CLIENT.useCombinedDepthStencilAttachment.get()) {
-+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL_ATTACHMENT, 3553, this.depthBufferId, 0);
-+ } else {
-+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_ATTACHMENT, 3553, this.depthBufferId, 0);
-+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_STENCIL_ATTACHMENT, 3553, this.depthBufferId, 0);
-+ }
- }
-
- this.checkStatus();
-@@ -257,5 +_,28 @@
-
- public int getDepthTextureId() {
- return this.depthBufferId;
-+ }
-+
-+ // Neo: Injected stencil control
-+ private boolean stencilEnabled = false;
-+
-+ /**
-+ * Attempts to enable 8 bits of stencil buffer on this FrameBuffer.
-+ * Modders must call this directly to set things up.
-+ * This is to prevent the default cause where graphics cards do not support stencil bits.
-+ * Make sure to call this on the main render thread!
-+ */
-+ public void enableStencil() {
-+ if(stencilEnabled) return;
-+ stencilEnabled = true;
-+ this.resize(viewWidth, viewHeight, net.minecraft.client.Minecraft.ON_OSX);
-+ }
-+
-+ /**
-+ * Returns whether this FBO has been successfully initialized with stencil bits.
-+ * If not, and a modder wishes it to be, they must call enableStencil.
-+ */
-+ public boolean isStencilEnabled() {
-+ return this.stencilEnabled;
- }
- }
diff --git a/patches/com/mojang/blaze3d/platform/GlStateManager.java.patch b/patches/com/mojang/blaze3d/platform/GlStateManager.java.patch
index 4eb7c902e94..88bb5116478 100644
--- a/patches/com/mojang/blaze3d/platform/GlStateManager.java.patch
+++ b/patches/com/mojang/blaze3d/platform/GlStateManager.java.patch
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/platform/GlStateManager.java
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
-@@ -945,4 +_,53 @@
+@@ -1009,4 +_,53 @@
return INSTANCE.height;
}
}
diff --git a/patches/com/mojang/blaze3d/platform/Window.java.patch b/patches/com/mojang/blaze3d/platform/Window.java.patch
index edf8e769204..f211b35fadf 100644
--- a/patches/com/mojang/blaze3d/platform/Window.java.patch
+++ b/patches/com/mojang/blaze3d/platform/Window.java.patch
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/platform/Window.java
+++ b/com/mojang/blaze3d/platform/Window.java
-@@ -86,7 +_,8 @@
+@@ -90,7 +_,8 @@
GLFW.glfwWindowHint(139267, 2);
GLFW.glfwWindowHint(139272, 204801);
GLFW.glfwWindowHint(139270, 1);
@@ -10,7 +10,7 @@
if (monitor != null) {
VideoMode videomode = monitor.getPreferredVidMode(this.fullscreen ? this.preferredFullscreenVideoMode : Optional.empty());
this.windowedX = this.x = monitor.getX() + videomode.getWidth() / 2 - this.width / 2;
-@@ -98,6 +_,7 @@
+@@ -102,6 +_,7 @@
this.windowedX = this.x = aint1[0];
this.windowedY = this.y = aint[0];
}
@@ -18,7 +18,7 @@
GLFW.glfwMakeContextCurrent(this.window);
GL.createCapabilities();
-@@ -256,6 +_,7 @@
+@@ -269,6 +_,7 @@
GLFW.glfwGetFramebufferSize(this.window, aint, aint1);
this.framebufferWidth = aint[0] > 0 ? aint[0] : 1;
this.framebufferHeight = aint1[0] > 0 ? aint1[0] : 1;
diff --git a/patches/com/mojang/blaze3d/systems/RenderSystem.java.patch b/patches/com/mojang/blaze3d/systems/RenderSystem.java.patch
index 3a0ac77ee0b..756e40c7c9a 100644
--- a/patches/com/mojang/blaze3d/systems/RenderSystem.java.patch
+++ b/patches/com/mojang/blaze3d/systems/RenderSystem.java.patch
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/systems/RenderSystem.java
+++ b/com/mojang/blaze3d/systems/RenderSystem.java
-@@ -932,4 +_,14 @@
+@@ -822,4 +_,14 @@
void accept(it.unimi.dsi.fastutil.ints.IntConsumer p_157488_, int p_157489_);
}
}
diff --git a/patches/com/mojang/blaze3d/vertex/PoseStack.java.patch b/patches/com/mojang/blaze3d/vertex/PoseStack.java.patch
index a21f52da74b..c3b47049f8b 100644
--- a/patches/com/mojang/blaze3d/vertex/PoseStack.java.patch
+++ b/patches/com/mojang/blaze3d/vertex/PoseStack.java.patch
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/PoseStack.java
+++ b/com/mojang/blaze3d/vertex/PoseStack.java
-@@ -13,7 +_,7 @@
+@@ -14,7 +_,7 @@
import org.joml.Vector3f;
@OnlyIn(Dist.CLIENT)
diff --git a/patches/com/mojang/blaze3d/vertex/VertexConsumer.java.patch b/patches/com/mojang/blaze3d/vertex/VertexConsumer.java.patch
index 7648e309066..30c19c43bf7 100644
--- a/patches/com/mojang/blaze3d/vertex/VertexConsumer.java.patch
+++ b/patches/com/mojang/blaze3d/vertex/VertexConsumer.java.patch
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/VertexConsumer.java
+++ b/com/mojang/blaze3d/vertex/VertexConsumer.java
-@@ -12,7 +_,7 @@
+@@ -13,7 +_,7 @@
import org.lwjgl.system.MemoryStack;
@OnlyIn(Dist.CLIENT)
@@ -10,19 +10,19 @@
VertexConsumer setColor(int p_350535_, int p_350875_, int p_350886_, int p_350775_);
@@ -131,11 +_,14 @@
- f5 = p_331397_[l] * p_85992_ * 255.0F;
+ f5 = p_331397_[i1] * p_85992_ * 255.0F;
}
-- int i1 = FastColor.ARGB32.color(k, (int)f3, (int)f4, (int)f5);
-- int j1 = p_331378_[l];
+- int j1 = ARGB.color(k, (int)f3, (int)f4, (int)f5);
+- int k1 = LightTexture.lightCoordsWithEmission(p_331378_[i1], l);
+ // Neo: also apply alpha that's coming from the baked quad
+ int vertexAlpha = p_331268_ ? (int)((p_331416_ * (float) (bytebuffer.get(15) & 255) / 255.0F) * 255) : k;
-+ int i1 = FastColor.ARGB32.color(vertexAlpha, (int)f3, (int)f4, (int)f5);
-+ int j1 = applyBakedLighting(p_331378_[l], bytebuffer);
++ int j1 = ARGB.color(vertexAlpha, (int)f3, (int)f4, (int)f5);
++ int k1 = applyBakedLighting(LightTexture.lightCoordsWithEmission(p_331378_[i1], l), bytebuffer);
float f10 = bytebuffer.getFloat(16);
float f9 = bytebuffer.getFloat(20);
Vector3f vector3f1 = matrix4f.transformPosition(f, f1, f2, new Vector3f());
+ applyBakedNormals(vector3f, bytebuffer, p_85988_.normal());
- this.addVertex(vector3f1.x(), vector3f1.y(), vector3f1.z(), i1, f10, f9, p_85993_, j1, vector3f.x(), vector3f.y(), vector3f.z());
+ this.addVertex(vector3f1.x(), vector3f1.y(), vector3f1.z(), j1, f10, f9, p_85993_, k1, vector3f.x(), vector3f.y(), vector3f.z());
}
}
diff --git a/patches/com/mojang/blaze3d/vertex/VertexFormat.java.patch b/patches/com/mojang/blaze3d/vertex/VertexFormat.java.patch
index a6debaffd6e..792970ee3ae 100644
--- a/patches/com/mojang/blaze3d/vertex/VertexFormat.java.patch
+++ b/patches/com/mojang/blaze3d/vertex/VertexFormat.java.patch
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/vertex/VertexFormat.java
+++ b/com/mojang/blaze3d/vertex/VertexFormat.java
-@@ -237,4 +_,28 @@
+@@ -220,4 +_,28 @@
};
}
}
diff --git a/patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch b/patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch
index 0757213ad68..b9cb377a059 100644
--- a/patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch
+++ b/patches/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java.patch
@@ -1,6 +1,6 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java
-@@ -127,7 +_,7 @@
+@@ -128,7 +_,7 @@
private void drawIcons(GuiGraphics p_282966_) {
int i = this.numberOfPendingInvites;
int j = 24;
diff --git a/patches/net/minecraft/SharedConstants.java.patch b/patches/net/minecraft/SharedConstants.java.patch
index c0e578e4f8c..d36ef831ded 100644
--- a/patches/net/minecraft/SharedConstants.java.patch
+++ b/patches/net/minecraft/SharedConstants.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/SharedConstants.java
+++ b/net/minecraft/SharedConstants.java
-@@ -118,7 +_,8 @@
+@@ -117,7 +_,8 @@
public static final boolean USE_WORKFLOWS_HOOKS = false;
public static final boolean USE_DEVONLY = false;
public static boolean CHECK_DATA_FIXER_SCHEMA = true;
@@ -10,7 +10,7 @@
public static final int WORLD_RESOLUTION = 16;
public static final int MAX_CHAT_LENGTH = 256;
public static final int MAX_USER_INPUT_COMMAND_LENGTH = 32500;
-@@ -171,6 +_,7 @@
+@@ -170,6 +_,7 @@
}
static {
diff --git a/patches/net/minecraft/Util.java.patch b/patches/net/minecraft/Util.java.patch
index e74d02220da..06262a76e07 100644
--- a/patches/net/minecraft/Util.java.patch
+++ b/patches/net/minecraft/Util.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/Util.java
+++ b/net/minecraft/Util.java
-@@ -267,8 +_,8 @@
+@@ -264,8 +_,8 @@
.getSchema(DataFixUtils.makeKey(SharedConstants.getCurrentVersion().getDataVersion().getVersion()))
.getChoiceType(p_137552_, p_137553_);
} catch (IllegalArgumentException illegalargumentexception) {
@@ -11,7 +11,7 @@
throw illegalargumentexception;
}
}
-@@ -526,20 +_,20 @@
+@@ -630,20 +_,20 @@
public static void logAndPauseIfInIde(String p_143786_) {
LOGGER.error(p_143786_);
diff --git a/patches/net/minecraft/advancements/AdvancementRewards.java.patch b/patches/net/minecraft/advancements/AdvancementRewards.java.patch
index 2b4fd0ad197..34bfaa4c010 100644
--- a/patches/net/minecraft/advancements/AdvancementRewards.java.patch
+++ b/patches/net/minecraft/advancements/AdvancementRewards.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/AdvancementRewards.java
+++ b/net/minecraft/advancements/AdvancementRewards.java
-@@ -40,6 +_,7 @@
+@@ -41,6 +_,7 @@
LootParams lootparams = new LootParams.Builder(p_9990_.serverLevel())
.withParameter(LootContextParams.THIS_ENTITY, p_9990_)
.withParameter(LootContextParams.ORIGIN, p_9990_.position())
diff --git a/patches/net/minecraft/client/Camera.java.patch b/patches/net/minecraft/client/Camera.java.patch
index 5af6f8da3ee..df738842745 100644
--- a/patches/net/minecraft/client/Camera.java.patch
+++ b/patches/net/minecraft/client/Camera.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Camera.java
+++ b/net/minecraft/client/Camera.java
-@@ -42,6 +_,7 @@
+@@ -44,6 +_,7 @@
private float eyeHeightOld;
private float partialTickTime;
public static final float FOG_DISTANCE_SCALE = 0.083333336F;
@@ -8,20 +8,20 @@
public void setup(BlockGetter p_90576_, Entity p_90577_, boolean p_90578_, boolean p_90579_, float p_90580_) {
this.initialized = true;
-@@ -49,7 +_,10 @@
- this.entity = p_90577_;
- this.detached = p_90578_;
- this.partialTickTime = p_90580_;
-- this.setRotation(p_90577_.getViewYRot(p_90580_), p_90577_.getViewXRot(p_90580_));
-+ var cameraSetup = net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.ViewportEvent.ComputeCameraAngles(
-+ this, p_90580_, p_90577_.getViewYRot(p_90580_), p_90577_.getViewXRot(p_90580_), 0)
-+ );
-+ this.setRotation(cameraSetup.getYaw(), cameraSetup.getPitch(), cameraSetup.getRoll());
- this.setPosition(
- Mth.lerp((double)p_90580_, p_90577_.xo, p_90577_.getX()),
- Mth.lerp((double)p_90580_, p_90577_.yo, p_90577_.getY()) + (double)Mth.lerp(p_90580_, this.eyeHeightOld, this.eyeHeight),
-@@ -57,11 +_,11 @@
- );
+@@ -62,7 +_,10 @@
+ this.setRotation(p_90577_.getViewYRot(p_90580_), p_90577_.getViewXRot(p_90580_));
+ this.setPosition(newminecartbehavior.getCartLerpPosition(p_90580_).add(vec3));
+ } else {
+- this.setRotation(p_90577_.getViewYRot(p_90580_), p_90577_.getViewXRot(p_90580_));
++ var cameraSetup = net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.ViewportEvent.ComputeCameraAngles(
++ this, p_90580_, p_90577_.getViewYRot(p_90580_), p_90577_.getViewXRot(p_90580_), 0)
++ );
++ this.setRotation(cameraSetup.getYaw(), cameraSetup.getPitch(), cameraSetup.getRoll());
+ this.setPosition(
+ Mth.lerp((double)p_90580_, p_90577_.xo, p_90577_.getX()),
+ Mth.lerp((double)p_90580_, p_90577_.yo, p_90577_.getY()) + (double)Mth.lerp(p_90580_, this.eyeHeightOld, this.eyeHeight),
+@@ -72,11 +_,11 @@
+
if (p_90578_) {
if (p_90579_) {
- this.setRotation(this.yRot + 180.0F, -this.xRot);
@@ -34,7 +34,7 @@
} else if (p_90577_ instanceof LivingEntity && ((LivingEntity)p_90577_).isSleeping()) {
Direction direction = ((LivingEntity)p_90577_).getBedOrientation();
this.setRotation(direction != null ? direction.toYRot() - 180.0F : 0.0F, 0.0F);
-@@ -102,10 +_,17 @@
+@@ -117,10 +_,17 @@
this.setPosition(new Vec3(this.position.x + (double)vector3f.x, this.position.y + (double)vector3f.y, this.position.z + (double)vector3f.z));
}
@@ -53,7 +53,7 @@
FORWARDS.rotate(this.rotation, this.forwards);
UP.rotate(this.rotation, this.up);
LEFT.rotate(this.rotation, this.left);
-@@ -221,6 +_,17 @@
+@@ -236,6 +_,17 @@
public float getPartialTickTime() {
return this.partialTickTime;
diff --git a/patches/net/minecraft/client/ClientRecipeBook.java.patch b/patches/net/minecraft/client/ClientRecipeBook.java.patch
index 774d2198dae..2771e9f8450 100644
--- a/patches/net/minecraft/client/ClientRecipeBook.java.patch
+++ b/patches/net/minecraft/client/ClientRecipeBook.java.patch
@@ -1,20 +1,10 @@
--- a/net/minecraft/client/ClientRecipeBook.java
+++ b/net/minecraft/client/ClientRecipeBook.java
-@@ -65,7 +_,7 @@
- Recipe> recipe = recipeholder.value();
- if (!recipe.isSpecial() && !recipe.isIncomplete()) {
- RecipeBookCategories recipebookcategories = getCategory(recipeholder);
-- String s = recipe.getGroup();
-+ String s = recipe.getGroup().isEmpty() ? recipeholder.id().toString() : recipe.getGroup(); // FORGE: Group value defaults to the recipe's ID if the recipe's explicit group is empty.
- if (s.isEmpty()) {
- map.computeIfAbsent(recipebookcategories, p_90645_ -> Lists.newArrayList()).add(ImmutableList.of(recipeholder));
- } else {
-@@ -125,6 +_,8 @@
- } else if (recipetype == RecipeType.SMITHING) {
- return RecipeBookCategories.SMITHING;
- } else {
-+ RecipeBookCategories categories = net.neoforged.neoforge.client.RecipeBookManager.findCategories((RecipeType) recipetype, p_301136_);
-+ if (categories != null) return categories;
- LOGGER.warn(
- "Unknown recipe category: {}/{}",
- LogUtils.defer(() -> BuiltInRegistries.RECIPE_TYPE.getKey(recipe.getType())),
+@@ -65,6 +_,7 @@
+ )
+ );
+
++ // TODO 1.21.2: make this accessible to mods.
+ for (SearchRecipeBookCategory searchrecipebookcategory : SearchRecipeBookCategory.values()) {
+ map1.put(
+ searchrecipebookcategory,
diff --git a/patches/net/minecraft/client/KeyboardHandler.java.patch b/patches/net/minecraft/client/KeyboardHandler.java.patch
index 2c5ce4a44e0..2470d92b3ab 100644
--- a/patches/net/minecraft/client/KeyboardHandler.java.patch
+++ b/patches/net/minecraft/client/KeyboardHandler.java.patch
@@ -1,53 +1,49 @@
--- a/net/minecraft/client/KeyboardHandler.java
+++ b/net/minecraft/client/KeyboardHandler.java
-@@ -407,9 +_,13 @@
- Screen.wrapScreenError(() -> {
- if (p_90897_ == 1 || p_90897_ == 2) {
+@@ -426,12 +_,20 @@
+ if (screen != null) {
+ try {
+ if (p_90897_ != 1 && p_90897_ != 2) {
+- if (p_90897_ == 0 && screen.keyReleased(p_90895_, p_90896_, p_90898_)) {
++ if (p_90897_ == 0 && (
++ net.neoforged.neoforge.client.ClientHooks.onScreenKeyReleasedPre(screen, p_90895_, p_90896_, p_90898_) ||
++ screen.keyReleased(p_90895_, p_90896_, p_90898_) ||
++ net.neoforged.neoforge.client.ClientHooks.onScreenKeyReleasedPost(screen, p_90895_, p_90896_, p_90898_))
++ ) {
+ return;
+ }
+ } else {
screen.afterKeyboardAction();
-- aboolean[0] = screen.keyPressed(p_90895_, p_90896_, p_90898_);
-+ aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenKeyPressedPre(screen, p_90895_, p_90896_, p_90898_);
-+ if (!aboolean[0]) aboolean[0] = screen.keyPressed(p_90895_, p_90896_, p_90898_);
-+ if (!aboolean[0]) aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenKeyPressedPost(screen, p_90895_, p_90896_, p_90898_);
- } else if (p_90897_ == 0) {
-- aboolean[0] = screen.keyReleased(p_90895_, p_90896_, p_90898_);
-+ aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenKeyReleasedPre(screen, p_90895_, p_90896_, p_90898_);
-+ if (!aboolean[0]) aboolean[0] = screen.keyReleased(p_90895_, p_90896_, p_90898_);
-+ if (!aboolean[0]) aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenKeyReleasedPost(screen, p_90895_, p_90896_, p_90898_);
+- if (screen.keyPressed(p_90895_, p_90896_, p_90898_)) {
++ if (
++ net.neoforged.neoforge.client.ClientHooks.onScreenKeyPressedPre(screen, p_90895_, p_90896_, p_90898_) ||
++ screen.keyPressed(p_90895_, p_90896_, p_90898_) ||
++ net.neoforged.neoforge.client.ClientHooks.onScreenKeyPressedPost(screen, p_90895_, p_90896_, p_90898_)
++ ) {
+ return;
+ }
}
- }, "keyPressed event handler", screen.getClass().getCanonicalName());
- if (aboolean[0]) {
-@@ -478,22 +_,27 @@
+@@ -516,10 +_,20 @@
+ if (screen != null && this.minecraft.getOverlay() == null) {
+ try {
+ if (Character.isBmpCodePoint(p_90891_)) {
+- screen.charTyped((char)p_90891_, p_90892_);
++ if (net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPre(screen, (char)p_90891_, p_90892_)) return;
++ if (screen.charTyped((char)p_90891_, p_90892_)) return;
++ net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPost(screen, (char)p_90891_, p_90892_);
+ } else if (Character.isValidCodePoint(p_90891_)) {
+- screen.charTyped(Character.highSurrogate(p_90891_), p_90892_);
+- screen.charTyped(Character.lowSurrogate(p_90891_), p_90892_);
++ if (!net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPre(screen, Character.highSurrogate(p_90891_), p_90892_)) {
++ if (!screen.charTyped(Character.highSurrogate(p_90891_), p_90892_)) {
++ net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPost(screen, Character.highSurrogate(p_90891_), p_90892_);
++ }
++ }
++ if (!net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPre(screen, Character.lowSurrogate(p_90891_), p_90892_)) {
++ if (!screen.charTyped(Character.lowSurrogate(p_90891_), p_90892_)) {
++ net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPost(screen, Character.lowSurrogate(p_90891_), p_90892_);
++ }
++ }
}
- }
- }
-+ net.neoforged.neoforge.client.ClientHooks.onKeyInput(p_90895_, p_90896_, p_90897_, p_90898_);
- }
- }
-
- private void charTyped(long p_90890_, int p_90891_, int p_90892_) {
- if (p_90890_ == this.minecraft.getWindow().getWindow()) {
-- GuiEventListener guieventlistener = this.minecraft.screen;
-+ Screen guieventlistener = this.minecraft.screen;
- if (guieventlistener != null && this.minecraft.getOverlay() == null) {
- if (Character.charCount(p_90891_) == 1) {
-- Screen.wrapScreenError(
-- () -> guieventlistener.charTyped((char)p_90891_, p_90892_), "charTyped event handler", guieventlistener.getClass().getCanonicalName()
-- );
-+ Screen.wrapScreenError(() -> {
-+ if (net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPre(guieventlistener, (char)p_90891_, p_90892_)) return;
-+ if (guieventlistener.charTyped((char)p_90891_, p_90892_)) return;
-+ net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPost(guieventlistener, (char)p_90891_, p_90892_);
-+ }, "charTyped event handler", guieventlistener.getClass().getCanonicalName());
- } else {
- for (char c0 : Character.toChars(p_90891_)) {
-- Screen.wrapScreenError(
-- () -> guieventlistener.charTyped(c0, p_90892_), "charTyped event handler", guieventlistener.getClass().getCanonicalName()
-- );
-+ Screen.wrapScreenError(() -> {
-+ if (net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPre(guieventlistener, c0, p_90892_)) return;
-+ if (guieventlistener.charTyped(c0, p_90892_)) return;
-+ net.neoforged.neoforge.client.ClientHooks.onScreenCharTypedPost(guieventlistener, c0, p_90892_);
-+ }, "charTyped event handler", guieventlistener.getClass().getCanonicalName());
- }
- }
- }
+ } catch (Throwable throwable) {
+ CrashReport crashreport = CrashReport.forThrowable(throwable, "charTyped event handler");
diff --git a/patches/net/minecraft/client/Minecraft.java.patch b/patches/net/minecraft/client/Minecraft.java.patch
index 13ff259e92b..47c57c0636f 100644
--- a/patches/net/minecraft/client/Minecraft.java.patch
+++ b/patches/net/minecraft/client/Minecraft.java.patch
@@ -9,7 +9,7 @@
static Minecraft instance;
private static final Logger LOGGER = LogUtils.getLogger();
public static final boolean ON_OSX = Util.getPlatform() == Util.OS.OSX;
-@@ -435,7 +_,6 @@
+@@ -438,7 +_,6 @@
}
}, Util.nonCriticalIoPool());
LOGGER.info("Setting user: {}", this.user.getName());
@@ -17,10 +17,10 @@
this.demo = p_91084_.game.demo;
this.allowsMultiplayer = !p_91084_.game.disableMultiplayer;
this.allowsChat = !p_91084_.game.disableChat;
-@@ -476,15 +_,15 @@
+@@ -489,15 +_,15 @@
+ LOGGER.error("Couldn't set icon", (Throwable)ioexception);
}
- this.window.setFramerateLimit(this.options.framerateLimit().get());
+ // FORGE: Move mouse and keyboard handler setup further below
this.mouseHandler = new MouseHandler(this);
- this.mouseHandler.setup(this.window.getWindow());
@@ -29,13 +29,13 @@
RenderSystem.initRenderer(this.options.glDebugVerbosity, false);
this.mainRenderTarget = new MainTarget(this.window.getWidth(), this.window.getHeight());
this.mainRenderTarget.setClearColor(0.0F, 0.0F, 0.0F, 0.0F);
- this.mainRenderTarget.clear(ON_OSX);
+ this.mainRenderTarget.clear();
this.resourceManager = new ReloadableResourceManager(PackType.CLIENT_RESOURCES);
+ net.neoforged.neoforge.client.loading.ClientModLoader.begin(this, this.resourcePackRepository, this.resourceManager);
this.resourcePackRepository.reload();
this.options.loadSelectedResourcePacks(this.resourcePackRepository);
this.languageManager = new LanguageManager(this.options.languageCode, p_344151_ -> {
-@@ -554,6 +_,7 @@
+@@ -583,6 +_,7 @@
);
this.resourceManager.registerReloadListener(this.entityRenderDispatcher);
this.particleEngine = new ParticleEngine(this.level, this.textureManager);
@@ -43,12 +43,13 @@
this.resourceManager.registerReloadListener(this.particleEngine);
this.paintingTextures = new PaintingTextureManager(this.textureManager);
this.resourceManager.registerReloadListener(this.paintingTextures);
-@@ -566,10 +_,14 @@
+@@ -592,11 +_,15 @@
+ this.resourceManager.registerReloadListener(this.guiSprites);
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);
+ net.neoforged.fml.ModLoader.postEvent(new net.neoforged.neoforge.client.event.RenderLevelStageEvent.RegisterStageEvent());
this.resourceManager.registerReloadListener(this.levelRenderer);
+ this.resourceManager.registerReloadListener(this.levelRenderer.getCloudRenderer());
this.gpuWarnlistManager = new GpuWarnlistManager();
this.resourceManager.registerReloadListener(this.gpuWarnlistManager);
this.resourceManager.registerReloadListener(this.regionalCompliancies);
@@ -58,7 +59,7 @@
this.gui = new Gui(this);
this.debugRenderer = new DebugRenderer(this);
RealmsClient realmsclient = RealmsClient.create(this);
-@@ -594,6 +_,7 @@
+@@ -621,6 +_,7 @@
this.options.fullscreen().set(this.window.isFullscreen());
}
@@ -66,7 +67,7 @@
this.window.updateVsync(this.options.enableVsync().get());
this.window.updateRawMouseInput(this.options.rawMouseInput().get());
this.window.setDefaultErrorCallback();
-@@ -614,16 +_,18 @@
+@@ -642,16 +_,18 @@
GameLoadTimesEvent.INSTANCE.beginStep(TelemetryProperty.LOAD_TIME_LOADING_OVERLAY_MS);
Minecraft.GameLoadCookie minecraft$gameloadcookie = new Minecraft.GameLoadCookie(realmsclient, p_91084_.quickPlay);
this.setOverlay(
@@ -88,8 +89,8 @@
+ ).get()
);
this.quickPlayLog = QuickPlayLog.of(p_91084_.quickPlay.path());
- }
-@@ -663,6 +_,8 @@
+ this.framerateLimitTracker = new FramerateLimitTracker(this.options, this);
+@@ -697,6 +_,8 @@
runnable = () -> this.setScreen(screen);
}
@@ -98,7 +99,7 @@
return runnable;
}
-@@ -711,7 +_,7 @@
+@@ -745,7 +_,7 @@
private String createTitle() {
StringBuilder stringbuilder = new StringBuilder("Minecraft");
if (checkModStatus().shouldReportAsModified()) {
@@ -107,7 +108,7 @@
}
stringbuilder.append(" ");
-@@ -743,7 +_,7 @@
+@@ -777,7 +_,7 @@
}
private void rollbackResourcePacks(Throwable p_91240_, @Nullable Minecraft.GameLoadCookie p_299846_) {
@@ -116,24 +117,16 @@
this.clearResourcePacksOnError(p_91240_, null, p_299846_);
} else {
Util.throwAsRuntime(p_91240_);
-@@ -871,13 +_,13 @@
-
- if (p_91333_.getSaveFile() != null) {
- Bootstrap.realStdoutPrintln("#@!@# Game crashed! Crash report saved to: #@!@# " + p_91333_.getSaveFile().toAbsolutePath());
-- System.exit(-1);
-+ net.neoforged.neoforge.server.ServerLifecycleHooks.handleExit(-1);
- } else if (p_91333_.saveToFile(path1, ReportType.CRASH)) {
- Bootstrap.realStdoutPrintln("#@!@# Game crashed! Crash report saved to: #@!@# " + path1.toAbsolutePath());
-- System.exit(-1);
-+ net.neoforged.neoforge.server.ServerLifecycleHooks.handleExit(-1);
- } else {
- Bootstrap.realStdoutPrintln("#@?@# Game crashed! Crash report could not be saved. #@?@#");
-- System.exit(-2);
-+ net.neoforged.neoforge.server.ServerLifecycleHooks.handleExit(-2);
+@@ -936,7 +_,7 @@
+ p_307414_.soundManager.emergencyShutdown();
}
+
+- System.exit(i);
++ net.neoforged.neoforge.server.ServerLifecycleHooks.handleExit(i);
}
-@@ -1006,9 +_,7 @@
+ public boolean isEnforceUnicode() {
+@@ -1063,9 +_,7 @@
LOGGER.error("setScreen called from non-game thread");
}
@@ -144,7 +137,7 @@
this.setLastInputType(InputType.NONE);
}
-@@ -1025,6 +_,19 @@
+@@ -1082,6 +_,19 @@
}
}
@@ -164,20 +157,20 @@
this.screen = p_91153_;
if (this.screen != null) {
this.screen.added();
-@@ -1170,9 +_,11 @@
+@@ -1235,9 +_,11 @@
this.mouseHandler.handleAccumulatedMovement();
- this.profiler.pop();
+ profilerfiller.pop();
if (!this.noRender) {
-+ net.neoforged.neoforge.client.ClientHooks.fireRenderFramePre(this.timer);
- this.profiler.popPush("gameRenderer");
- this.gameRenderer.render(this.timer, p_91384_);
- this.profiler.pop();
-+ net.neoforged.neoforge.client.ClientHooks.fireRenderFramePost(this.timer);
++ net.neoforged.neoforge.client.ClientHooks.fireRenderFramePre(this.deltaTracker);
+ profilerfiller.popPush("gameRenderer");
+ this.gameRenderer.render(this.deltaTracker, p_91384_);
+ profilerfiller.pop();
++ net.neoforged.neoforge.client.ClientHooks.fireRenderFramePost(this.deltaTracker);
}
- if (this.fpsPieResults != null) {
-@@ -1203,9 +_,13 @@
- this.profiler.pop();
+ profilerfiller.push("blit");
+@@ -1265,9 +_,13 @@
+ profilerfiller.pop();
this.window.setErrorSection("Post render");
this.frames++;
- this.pause = this.hasSingleplayerServer()
@@ -188,10 +181,10 @@
+ this.pause = pause;
+ net.neoforged.neoforge.client.ClientHooks.onClientPauseChangePost(pause);
+ }
- this.timer.updatePauseState(this.pause);
- this.timer.updateFrozenState(!this.isLevelRunningNormally());
- long k = Util.getNanos();
-@@ -1298,10 +_,12 @@
+ this.deltaTracker.updatePauseState(this.pause);
+ this.deltaTracker.updateFrozenState(!this.isLevelRunningNormally());
+ long l = Util.getNanos();
+@@ -1359,10 +_,12 @@
this.window.setGuiScale((double)i);
if (this.screen != null) {
this.screen.resize(this, this.window.getGuiScaledWidth(), this.window.getGuiScaledHeight());
@@ -199,12 +192,12 @@
}
RenderTarget rendertarget = this.getMainRenderTarget();
- rendertarget.resize(this.window.getWidth(), this.window.getHeight(), ON_OSX);
+ rendertarget.resize(this.window.getWidth(), this.window.getHeight());
+ if (this.gameRenderer != null)
this.gameRenderer.resize(this.window.getWidth(), this.window.getHeight());
this.mouseHandler.setIgnoreFirstMove();
}
-@@ -1569,6 +_,7 @@
+@@ -1503,6 +_,7 @@
}
public void stop() {
@@ -212,7 +205,7 @@
this.running = false;
}
-@@ -1598,9 +_,17 @@
+@@ -1532,9 +_,17 @@
BlockHitResult blockhitresult = (BlockHitResult)this.hitResult;
BlockPos blockpos = blockhitresult.getBlockPos();
if (!this.level.getBlockState(blockpos).isAir()) {
@@ -232,7 +225,7 @@
this.player.swing(InteractionHand.MAIN_HAND);
}
}
-@@ -1628,6 +_,8 @@
+@@ -1562,6 +_,8 @@
return false;
} else {
boolean flag = false;
@@ -241,7 +234,7 @@
switch (this.hitResult.getType()) {
case ENTITY:
this.gameMode.attack(this.player, ((EntityHitResult)this.hitResult).getEntity());
-@@ -1648,8 +_,10 @@
+@@ -1582,8 +_,10 @@
}
this.player.resetAttackStrengthTicker();
@@ -252,7 +245,7 @@
this.player.swing(InteractionHand.MAIN_HAND);
return flag;
}
-@@ -1665,6 +_,11 @@
+@@ -1599,6 +_,11 @@
}
for (InteractionHand interactionhand : InteractionHand.values()) {
@@ -264,35 +257,35 @@
ItemStack itemstack = this.player.getItemInHand(interactionhand);
if (!itemstack.isItemEnabled(this.level.enabledFeatures())) {
return;
-@@ -1685,7 +_,7 @@
+@@ -1619,7 +_,7 @@
}
- if (interactionresult.consumesAction()) {
-- if (interactionresult.shouldSwing()) {
-+ if (interactionresult.shouldSwing() && inputEvent.shouldSwingHand()) {
+ if (interactionresult instanceof InteractionResult.Success interactionresult$success2) {
+- if (interactionresult$success2.swingSource() == InteractionResult.SwingSource.CLIENT) {
++ if (interactionresult$success2.swingSource() == InteractionResult.SwingSource.CLIENT && inputEvent.shouldSwingHand()) {
this.player.swing(interactionhand);
}
-@@ -1697,7 +_,7 @@
+@@ -1631,7 +_,7 @@
int i = itemstack.getCount();
InteractionResult interactionresult1 = this.gameMode.useItemOn(this.player, interactionhand, blockhitresult);
- if (interactionresult1.consumesAction()) {
-- if (interactionresult1.shouldSwing()) {
-+ if (interactionresult1.shouldSwing() && inputEvent.shouldSwingHand()) {
+ if (interactionresult1 instanceof InteractionResult.Success interactionresult$success) {
+- if (interactionresult$success.swingSource() == InteractionResult.SwingSource.CLIENT) {
++ if (interactionresult$success.swingSource() == InteractionResult.SwingSource.CLIENT && inputEvent.shouldSwingHand()) {
this.player.swing(interactionhand);
if (!itemstack.isEmpty() && (itemstack.getCount() != i || this.gameMode.hasInfiniteItems())) {
this.gameRenderer.itemInHandRenderer.itemUsed(interactionhand);
-@@ -1713,6 +_,9 @@
+@@ -1647,6 +_,9 @@
}
}
+ if (itemstack.isEmpty() && (this.hitResult == null || this.hitResult.getType() == HitResult.Type.MISS))
+ net.neoforged.neoforge.common.CommonHooks.onEmptyClick(this.player, interactionhand);
+
- if (!itemstack.isEmpty()) {
- InteractionResult interactionresult2 = this.gameMode.useItem(this.player, interactionhand);
- if (interactionresult2.consumesAction()) {
-@@ -1735,6 +_,8 @@
+ if (!itemstack.isEmpty()
+ && this.gameMode.useItem(this.player, interactionhand) instanceof InteractionResult.Success interactionresult$success1) {
+ if (interactionresult$success1.swingSource() == InteractionResult.SwingSource.CLIENT) {
+@@ -1667,6 +_,8 @@
public void tick() {
this.clientTickCount++;
@@ -301,32 +294,32 @@
if (this.level != null && !this.pause) {
this.level.tickRateManager().tick();
}
-@@ -1826,6 +_,7 @@
+@@ -1765,6 +_,7 @@
this.tutorial.tick();
+ net.neoforged.neoforge.event.EventHooks.fireLevelTickPre(this.level, () -> true);
try {
this.level.tick(() -> true);
- } catch (Throwable throwable) {
-@@ -1839,6 +_,7 @@
+ } catch (Throwable throwable1) {
+@@ -1778,6 +_,7 @@
- throw new ReportedException(crashreport);
+ throw new ReportedException(crashreport1);
}
+ net.neoforged.neoforge.event.EventHooks.fireLevelTickPost(this.level, () -> true);
}
- this.profiler.popPush("animateTick");
-@@ -1858,6 +_,8 @@
- this.profiler.popPush("keyboard");
+ profilerfiller.popPush("animateTick");
+@@ -1802,6 +_,8 @@
+ profilerfiller.popPush("keyboard");
this.keyboardHandler.tick();
- this.profiler.pop();
+ profilerfiller.pop();
+
+ net.neoforged.neoforge.client.ClientHooks.fireClientTickPost();
}
private boolean isLevelRunningNormally() {
-@@ -2056,7 +_,8 @@
+@@ -2001,7 +_,8 @@
}
public void setLevel(ClientLevel p_91157_, ReceivingLevelScreen.Reason p_341652_) {
@@ -336,7 +329,7 @@
this.level = p_91157_;
this.updateLevelInEngines(p_91157_);
if (!this.isLocalServer) {
-@@ -2093,6 +_,7 @@
+@@ -2038,6 +_,7 @@
IntegratedServer integratedserver = this.singleplayerServer;
this.singleplayerServer = null;
this.gameRenderer.resetData();
@@ -344,15 +337,15 @@
this.gameMode = null;
this.narrator.clear();
this.clientLevelTeardownInProgress = true;
-@@ -2100,6 +_,7 @@
+@@ -2045,6 +_,7 @@
try {
this.updateScreenAndTick(p_320248_);
if (this.level != null) {
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.level.LevelEvent.Unload(this.level));
if (integratedserver != null) {
- this.profiler.push("waitForServer");
-
-@@ -2258,6 +_,7 @@
+ ProfilerFiller profilerfiller = Profiler.get();
+ profilerfiller.push("waitForServer");
+@@ -2205,6 +_,7 @@
private void pickBlock() {
if (this.hitResult != null && this.hitResult.getType() != HitResult.Type.MISS) {
@@ -360,7 +353,7 @@
boolean flag = this.player.getAbilities().instabuild;
BlockEntity blockentity = null;
HitResult.Type hitresult$type = this.hitResult.getType();
-@@ -2270,7 +_,7 @@
+@@ -2217,7 +_,7 @@
}
Block block = blockstate.getBlock();
@@ -369,7 +362,7 @@
if (itemstack.isEmpty()) {
return;
}
-@@ -2284,7 +_,7 @@
+@@ -2231,7 +_,7 @@
}
Entity entity = ((EntityHitResult)this.hitResult).getEntity();
@@ -378,7 +371,7 @@
if (itemstack == null) {
return;
}
-@@ -2794,6 +_,10 @@
+@@ -2757,6 +_,10 @@
public void updateMaxMipLevel(int p_91313_) {
this.modelManager.updateMaxMipLevel(p_91313_);
diff --git a/patches/net/minecraft/client/MouseHandler.java.patch b/patches/net/minecraft/client/MouseHandler.java.patch
index 01b53bd4351..48d9f7cb682 100644
--- a/patches/net/minecraft/client/MouseHandler.java.patch
+++ b/patches/net/minecraft/client/MouseHandler.java.patch
@@ -1,42 +1,42 @@
--- a/net/minecraft/client/MouseHandler.java
+++ b/net/minecraft/client/MouseHandler.java
-@@ -79,6 +_,7 @@
+@@ -85,6 +_,7 @@
this.activeButton = -1;
}
+ if (net.neoforged.neoforge.client.ClientHooks.onMouseButtonPre(p_91532_, p_91533_, p_91534_)) return;
- boolean[] aboolean = new boolean[]{false};
if (this.minecraft.getOverlay() == null) {
if (this.minecraft.screen == null) {
-@@ -91,13 +_,21 @@
- Screen screen = this.minecraft.screen;
- if (flag) {
+ if (!this.mouseGrabbed && flag) {
+@@ -98,7 +_,12 @@
screen.afterMouseAction();
-- Screen.wrapScreenError(
-- () -> aboolean[0] = screen.mouseClicked(d0, d1, i), "mouseClicked event handler", screen.getClass().getCanonicalName()
-- );
-+ Screen.wrapScreenError(() -> {
-+ aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenMouseClickedPre(screen, d0, d1, i);
-+ if (!aboolean[0]) {
-+ aboolean[0] = screen.mouseClicked(d0, d1, i);
-+ aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenMouseClickedPost(screen, d0, d1, i, aboolean[0]);
-+ }
-+ }, "mouseClicked event handler", screen.getClass().getCanonicalName());
+
+ try {
+- if (screen.mouseClicked(d0, d1, i)) {
++ boolean flag2;
++ if (
++ net.neoforged.neoforge.client.ClientHooks.onScreenMouseClickedPre(screen, d0, d1, i) ||
++ (flag2 = screen.mouseClicked(d0, d1, i)) |
++ net.neoforged.neoforge.client.ClientHooks.onScreenMouseClickedPost(screen, d0, d1, i, flag2)
++ ) {
+ return;
+ }
+ } catch (Throwable throwable1) {
+@@ -112,7 +_,12 @@
+ }
} else {
-- Screen.wrapScreenError(
-- () -> aboolean[0] = screen.mouseReleased(d0, d1, i), "mouseReleased event handler", screen.getClass().getCanonicalName()
-- );
-+ Screen.wrapScreenError(() -> {
-+ aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenMouseReleasedPre(screen, d0, d1, i);
-+ if (!aboolean[0]) {
-+ aboolean[0] = screen.mouseReleased(d0, d1, i);
-+ aboolean[0] = net.neoforged.neoforge.client.ClientHooks.onScreenMouseReleasedPost(screen, d0, d1, i, aboolean[0]);
-+ }
-+ }, "mouseReleased event handler", screen.getClass().getCanonicalName());
- }
- }
- }
-@@ -120,6 +_,7 @@
+ try {
+- if (screen.mouseReleased(d0, d1, i)) {
++ boolean flag2;
++ if (
++ net.neoforged.neoforge.client.ClientHooks.onScreenMouseReleasedPre(screen, d0, d1, i) ||
++ (flag2 = screen.mouseReleased(d0, d1, i)) |
++ net.neoforged.neoforge.client.ClientHooks.onScreenMouseReleasedPost(screen, d0, d1, i, flag2)
++ ) {
+ return;
+ }
+ } catch (Throwable throwable) {
+@@ -146,6 +_,7 @@
}
}
}
@@ -44,7 +44,7 @@
}
}
-@@ -133,7 +_,11 @@
+@@ -160,7 +_,11 @@
if (this.minecraft.screen != null) {
double d3 = this.xpos * (double)this.minecraft.getWindow().getGuiScaledWidth() / (double)this.minecraft.getWindow().getScreenWidth();
double d4 = this.ypos * (double)this.minecraft.getWindow().getGuiScaledHeight() / (double)this.minecraft.getWindow().getScreenHeight();
@@ -56,31 +56,29 @@
+ }
this.minecraft.screen.afterMouseAction();
} else if (this.minecraft.player != null) {
- if (this.accumulatedScrollX != 0.0 && Math.signum(d1) != Math.signum(this.accumulatedScrollX)) {
-@@ -155,6 +_,7 @@
- this.accumulatedScrollX -= (double)j;
- this.accumulatedScrollY -= (double)i;
- int k = i == 0 ? -j : i;
+ Vector2i vector2i = this.scrollWheelHandler.onMouseScroll(d1, d2);
+@@ -169,6 +_,7 @@
+ }
+
+ int i = vector2i.y == 0 ? -vector2i.x : vector2i.y;
+ if (net.neoforged.neoforge.client.ClientHooks.onMouseScroll(this, d1, d2)) return;
if (this.minecraft.player.isSpectator()) {
if (this.minecraft.gui.getSpectatorGui().isMenuActive()) {
- this.minecraft.gui.getSpectatorGui().onMouseScrolled(-k);
-@@ -244,9 +_,11 @@
- double d5 = this.accumulatedDY
- * (double)this.minecraft.getWindow().getGuiScaledHeight()
+ this.minecraft.gui.getSpectatorGui().onMouseScrolled(-i);
+@@ -280,7 +_,11 @@
/ (double)this.minecraft.getWindow().getScreenHeight();
-- Screen.wrapScreenError(
-- () -> screen.mouseDragged(d2, d3, this.activeButton, d4, d5), "mouseDragged event handler", screen.getClass().getCanonicalName()
-- );
-+ Screen.wrapScreenError(() -> {
-+ if (net.neoforged.neoforge.client.ClientHooks.onScreenMouseDragPre(screen, d2, d3, this.activeButton, d4, d5)) return;
-+ if (screen.mouseDragged(d2, d3, this.activeButton, d4, d5)) return;
-+ net.neoforged.neoforge.client.ClientHooks.onScreenMouseDragPost(screen, d2, d3, this.activeButton, d4, d5);
-+ }, "mouseDragged event handler", screen.getClass().getCanonicalName());
- }
- screen.afterMouseMove();
-@@ -262,12 +_,13 @@
+ try {
+- screen.mouseDragged(d2, d3, this.activeButton, d4, d5);
++ if (!net.neoforged.neoforge.client.ClientHooks.onScreenMouseDragPre(screen, d2, d3, this.activeButton, d4, d5)) {
++ if (!screen.mouseDragged(d2, d3, this.activeButton, d4, d5)) {
++ net.neoforged.neoforge.client.ClientHooks.onScreenMouseDragPost(screen, d2, d3, this.activeButton, d4, d5);
++ }
++ }
+ } catch (Throwable throwable) {
+ CrashReport crashreport1 = CrashReport.forThrowable(throwable, "mouseDragged event handler");
+ screen.fillCrashDetails(crashreport1);
+@@ -304,12 +_,13 @@
}
private void turnPlayer(double p_316356_) {
@@ -96,7 +94,7 @@
double d5 = this.smoothTurnX.getNewDeltaValue(this.accumulatedDX * d4, p_316356_ * d4);
double d6 = this.smoothTurnY.getNewDeltaValue(this.accumulatedDY * d4, p_316356_ * d4);
d0 = d5;
-@@ -313,6 +_,14 @@
+@@ -355,6 +_,14 @@
public double ypos() {
return this.ypos;
diff --git a/patches/net/minecraft/client/Options.java.patch b/patches/net/minecraft/client/Options.java.patch
index 63cda73a1e7..ba0680da723 100644
--- a/patches/net/minecraft/client/Options.java.patch
+++ b/patches/net/minecraft/client/Options.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Options.java
+++ b/net/minecraft/client/Options.java
-@@ -727,9 +_,10 @@
+@@ -746,9 +_,10 @@
}
},
new OptionInstance.LazyEnum<>(
@@ -12,7 +12,7 @@
&& !Minecraft.getInstance().getSoundManager().getAvailableSoundDevices().contains(p_232011_)
? Optional.empty()
: Optional.of(p_232011_),
-@@ -799,7 +_,7 @@
+@@ -822,7 +_,7 @@
this.incompatibleResourcePacks.clear();
for (Pack pack : p_275268_.getSelectedPacks()) {
@@ -21,7 +21,7 @@
this.resourcePacks.add(pack.getId());
if (!pack.getCompatibility().isCompatible()) {
this.incompatibleResourcePacks.add(pack.getId());
-@@ -1099,6 +_,7 @@
+@@ -1130,6 +_,7 @@
}
public Options(Minecraft p_92138_, File p_92139_) {
@@ -29,7 +29,7 @@
this.minecraft = p_92138_;
this.optionsFile = new File(p_92139_, "options.txt");
boolean flag = Runtime.getRuntime().maxMemory() >= 1000000000L;
-@@ -1236,11 +_,21 @@
+@@ -1264,11 +_,21 @@
this.onboardAccessibility = p_168428_.process("onboardAccessibility", this.onboardAccessibility);
p_168428_.process("menuBackgroundBlurriness", this.menuBackgroundBlurriness);
@@ -53,7 +53,7 @@
}
}
-@@ -1258,6 +_,9 @@
+@@ -1286,6 +_,9 @@
}
public void load() {
@@ -63,7 +63,7 @@
try {
if (!this.optionsFile.exists()) {
return;
-@@ -1285,7 +_,8 @@
+@@ -1313,7 +_,8 @@
}
}
@@ -73,7 +73,7 @@
new Options.FieldAccess() {
@Nullable
private String getValueOrNull(String p_168459_) {
-@@ -1460,6 +_,7 @@
+@@ -1484,6 +_,7 @@
}
public ClientInformation buildPlayerInformation() {
@@ -81,7 +81,7 @@
int i = 0;
for (PlayerModelPart playermodelpart : this.modelParts) {
-@@ -1535,6 +_,23 @@
+@@ -1555,6 +_,23 @@
}
p_92146_.setSelected(set);
diff --git a/patches/net/minecraft/client/color/item/ItemColors.java.patch b/patches/net/minecraft/client/color/item/ItemColors.java.patch
index 491886484de..afe4aac398f 100644
--- a/patches/net/minecraft/client/color/item/ItemColors.java.patch
+++ b/patches/net/minecraft/client/color/item/ItemColors.java.patch
@@ -10,8 +10,8 @@
public static ItemColors createDefault(BlockColors p_92684_) {
ItemColors itemcolors = new ItemColors();
-@@ -105,17 +_,20 @@
- : FastColor.ARGB32.opaque(p_329710_.getOrDefault(DataComponents.MAP_COLOR, MapItemColor.DEFAULT).rgb()),
+@@ -101,17 +_,20 @@
+ (p_359075_, p_359076_) -> p_359076_ == 0 ? -1 : ARGB.opaque(p_359075_.getOrDefault(DataComponents.MAP_COLOR, MapItemColor.DEFAULT).rgb()),
Items.FILLED_MAP
);
+ net.neoforged.neoforge.client.ClientHooks.onItemColorsInit(itemcolors, p_92684_);
diff --git a/patches/net/minecraft/client/gui/Font.java.patch b/patches/net/minecraft/client/gui/Font.java.patch
index 57718aa4e86..7aabb21f2e4 100644
--- a/patches/net/minecraft/client/gui/Font.java.patch
+++ b/patches/net/minecraft/client/gui/Font.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/Font.java
+++ b/net/minecraft/client/gui/Font.java
-@@ -31,7 +_,7 @@
+@@ -33,7 +_,7 @@
import org.joml.Vector3f;
@OnlyIn(Dist.CLIENT)
@@ -9,7 +9,7 @@
private static final float EFFECT_DEPTH = 0.01F;
private static final Vector3f SHADOW_OFFSET = new Vector3f(0.0F, 0.0F, 0.03F);
public static final int ALPHA_CUTOFF = 8;
-@@ -326,6 +_,8 @@
+@@ -307,6 +_,8 @@
public StringSplitter getSplitter() {
return this.splitter;
}
diff --git a/patches/net/minecraft/client/gui/Gui.java.patch b/patches/net/minecraft/client/gui/Gui.java.patch
index dc1055a5824..57ea34601f2 100644
--- a/patches/net/minecraft/client/gui/Gui.java.patch
+++ b/patches/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
-@@ -69,6 +_,9 @@
+@@ -71,6 +_,9 @@
import net.neoforged.api.distmarker.OnlyIn;
import org.joml.Matrix4fStack;
@@ -10,8 +10,8 @@
@OnlyIn(Dist.CLIENT)
public class Gui {
private static final ResourceLocation CROSSHAIR_SPRITE = ResourceLocation.withDefaultNamespace("hud/crosshair");
-@@ -158,9 +_,21 @@
- private long healthBlinkTime;
+@@ -175,9 +_,21 @@
+ private int lastBubblePopSoundPlayed;
private float autosaveIndicatorValue;
private float lastAutosaveIndicatorValue;
+ /** Neo: This is empty and unused, rendering goes through {@link #layerManager} instead. */
@@ -32,7 +32,7 @@
public Gui(Minecraft p_232355_) {
this.minecraft = p_232355_;
this.debugOverlay = new DebugScreenOverlay(p_232355_);
-@@ -170,27 +_,40 @@
+@@ -187,27 +_,40 @@
this.bossOverlay = new BossHealthOverlay(p_232355_);
this.subtitleOverlay = new SubtitleOverlay(p_232355_);
this.resetTitleTimes();
@@ -90,18 +90,18 @@
}
public void resetTitleTimes() {
-@@ -201,7 +_,9 @@
+@@ -217,7 +_,9 @@
+ }
public void render(GuiGraphics p_282884_, DeltaTracker p_348630_) {
- RenderSystem.enableDepthTest();
- this.layers.render(p_282884_, p_348630_);
+ leftHeight = 39;
+ rightHeight = 39;
+ this.layerManager.render(p_282884_, p_348630_);
- RenderSystem.disableDepthTest();
}
-@@ -262,8 +_,12 @@
+ private void renderCameraOverlays(GuiGraphics p_316735_, DeltaTracker p_348538_) {
+@@ -289,8 +_,12 @@
}
if (i > 8) {
@@ -115,7 +115,7 @@
int j;
if (this.animateOverlayMessageColor) {
j = Mth.hsvToArgb(f / 50.0F, 0.7F, 0.6F, i);
-@@ -323,9 +_,19 @@
+@@ -350,9 +_,19 @@
private void renderChat(GuiGraphics p_316307_, DeltaTracker p_348631_) {
if (!this.chat.isChatFocused()) {
Window window = this.minecraft.getWindow();
@@ -135,7 +135,7 @@
}
}
-@@ -441,6 +_,8 @@
+@@ -449,6 +_,8 @@
List list = Lists.newArrayListWithExpectedSize(collection.size());
for (MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
@@ -143,16 +143,16 @@
+ if (!renderer.isVisibleInGui(mobeffectinstance)) continue;
Holder holder = mobeffectinstance.getEffect();
if (mobeffectinstance.showIcon()) {
- int i = p_282812_.guiWidth();
-@@ -471,6 +_,7 @@
+ int k = p_282812_.guiWidth();
+@@ -480,6 +_,7 @@
}
}
-+ if (renderer.renderGuiIcon(mobeffectinstance, this, p_282812_, i, j, 0, f)) continue;
++ if (renderer.renderGuiIcon(mobeffectinstance, this, p_282812_, k, l, 0, f)) continue;
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.get(holder);
- int l1 = i;
- int i1 = j;
-@@ -488,29 +_,59 @@
+ int l1 = k;
+ int k1 = l;
+@@ -495,29 +_,59 @@
}
}
@@ -215,7 +215,7 @@
this.spectatorGui.renderTooltip(p_316628_);
}
}
-@@ -633,18 +_,23 @@
+@@ -632,18 +_,23 @@
}
private void renderSelectedItemName(GuiGraphics p_283501_) {
@@ -223,7 +223,7 @@
+ }
+
+ public void renderSelectedItemName(GuiGraphics p_283501_, int yShift) {
- this.minecraft.getProfiler().push("selectedItemName");
+ Profiler.get().push("selectedItemName");
if (this.toolHighlightTimer > 0 && !this.lastToolHighlight.isEmpty()) {
MutableComponent mutablecomponent = Component.empty()
.append(this.lastToolHighlight.getHoverName())
@@ -242,31 +242,31 @@
if (!this.minecraft.gameMode.canHurtPlayer()) {
k += 14;
}
-@@ -655,7 +_,13 @@
+@@ -654,7 +_,13 @@
}
if (l > 0) {
-- p_283501_.drawStringWithBackdrop(this.getFont(), mutablecomponent, j, k, i, FastColor.ARGB32.color(l, -1));
+- p_283501_.drawStringWithBackdrop(this.getFont(), mutablecomponent, j, k, i, ARGB.color(l, -1));
+ Font font = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(lastToolHighlight).getFont(lastToolHighlight, net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.FontContext.SELECTED_ITEM_NAME);
+ if (font == null) {
-+ p_283501_.drawStringWithBackdrop(this.getFont(), highlightTip, j, k, i, FastColor.ARGB32.color(l, -1));
++ p_283501_.drawStringWithBackdrop(this.getFont(), highlightTip, j, k, i, ARGB.color(l, -1));
+ } else {
+ j = (p_283501_.guiWidth() - font.width(highlightTip)) / 2;
-+ p_283501_.drawStringWithBackdrop(font, highlightTip, j, k, i, FastColor.ARGB32.color(l, -1));
++ p_283501_.drawStringWithBackdrop(font, highlightTip, j, k, i, ARGB.color(l, -1));
+ }
}
}
-@@ -663,7 +_,7 @@
+@@ -662,7 +_,7 @@
}
private void renderDemoOverlay(GuiGraphics p_281825_, DeltaTracker p_348679_) {
- if (this.minecraft.isDemo()) {
+ if (this.minecraft.isDemo() && !this.getDebugOverlay().showDebugScreen()) { // Neo: Hide demo timer when F3 debug overlay is open; fixes MC-271166
- this.minecraft.getProfiler().push("demo");
+ Profiler.get().push("demo");
Component component;
if (this.minecraft.level.getGameTime() >= 120500L) {
-@@ -778,7 +_,15 @@
+@@ -774,7 +_,15 @@
return (int)Math.ceil((double)p_93013_ / 10.0);
}
@@ -282,7 +282,7 @@
Player player = this.getCameraPlayer();
if (player != null) {
int i = Mth.ceil(player.getHealth());
-@@ -803,35 +_,62 @@
+@@ -798,31 +_,59 @@
this.random.setSeed((long)(this.tickCount * 312871));
int l = p_283143_.guiWidth() / 2 - 91;
int i1 = p_283143_.guiWidth() / 2 + 91;
@@ -299,12 +299,12 @@
k2 = this.tickCount % Mth.ceil(f + 5.0F);
}
-
-- this.minecraft.getProfiler().push("armor");
+- Profiler.get().push("armor");
- renderArmor(p_283143_, player, j1, l1, i2, l);
-- this.minecraft.getProfiler().popPush("health");
-+ this.minecraft.getProfiler().push("health");
+- Profiler.get().popPush("health");
++ Profiler.get().push("health");
this.renderHearts(p_283143_, player, l, j1, i2, k2, f, i, k, k1, flag);
-+ this.minecraft.getProfiler().pop();
++ Profiler.get().pop();
+ }
+ }
+
@@ -312,9 +312,9 @@
+ Player player = this.getCameraPlayer();
+ if (player != null) {
+ int l = p_283143_.guiWidth() / 2 - 91;
-+ this.minecraft.getProfiler().push("armor");
++ Profiler.get().push("armor");
+ renderArmor(p_283143_, player, p_283143_.guiHeight() - leftHeight + 10, 1, 0, l);
-+ this.minecraft.getProfiler().pop();
++ Profiler.get().pop();
+ if (player.getArmorValue() > 0) {
+ leftHeight += 10;
+ }
@@ -327,61 +327,57 @@
LivingEntity livingentity = this.getPlayerVehicleWithHealth();
int l2 = this.getVehicleMaxHearts(livingentity);
if (l2 == 0) {
-- this.minecraft.getProfiler().popPush("food");
-+ this.minecraft.getProfiler().push("food");
+- Profiler.get().popPush("food");
++ Profiler.get().push("food");
+ int i1 = p_283143_.guiWidth() / 2 + 91;
+ int j1 = p_283143_.guiHeight() - rightHeight;
this.renderFood(p_283143_, player, j1, i1);
- j2 -= 10;
+ rightHeight += 10;
-+ this.minecraft.getProfiler().pop();
++ Profiler.get().pop();
}
--
-- this.minecraft.getProfiler().popPush("air");
+ }
+ }
-+
+
+- Profiler.get().popPush("air");
+- this.renderAirBubbles(p_283143_, player, l2, j2, i1);
+ private void renderAirLevel(GuiGraphics p_283143_) {
+ Player player = this.getCameraPlayer();
+ if (player != null) {
+ int i1 = p_283143_.guiWidth() / 2 + 91;
-+
-+ this.minecraft.getProfiler().push("air");
- int i3 = player.getMaxAirSupply();
- int j3 = Math.min(player.getAirSupply(), i3);
- if (player.isEyeInFluid(FluidTags.WATER) || j3 < i3) {
-- int k3 = this.getVisibleVehicleHeartRows(l2) - 1;
-- j2 -= k3 * 10;
-+ int j2 = p_283143_.guiHeight() - rightHeight;
- int l3 = Mth.ceil((double)(j3 - 2) * 10.0 / (double)i3);
- int i4 = Mth.ceil((double)j3 * 10.0 / (double)i3) - l3;
- RenderSystem.enableBlend();
-@@ -845,6 +_,7 @@
++ int j2 = p_283143_.guiHeight() - rightHeight;
++ Profiler.get().push("air");
++ this.renderAirBubbles(p_283143_, player, 10, j2, i1);
+ Profiler.get().pop();
+ }
+ }
+@@ -936,6 +_,8 @@
+ p_381066_.blitSprite(RenderType::guiTextured, AIR_EMPTY_SPRITE, k1, p_381100_ + l1, 9, 9);
}
-
- RenderSystem.disableBlend();
-+ rightHeight += 10;
}
++
++ rightHeight += 10;
+ }
+ }
- this.minecraft.getProfiler().pop();
-@@ -984,7 +_,7 @@
+@@ -1003,7 +_,7 @@
if (i != 0) {
int j = (int)Math.ceil((double)livingentity.getHealth());
- this.minecraft.getProfiler().popPush("mountHealth");
+ Profiler.get().popPush("mountHealth");
- int k = p_283368_.guiHeight() - 39;
+ int k = p_283368_.guiHeight() - rightHeight;
int l = p_283368_.guiWidth() / 2 + 91;
int i1 = k;
- int j1 = 0;
-@@ -1007,6 +_,7 @@
+
+@@ -1024,6 +_,7 @@
}
i1 -= 10;
+ rightHeight += 10;
- j1 += 20;
}
-
-@@ -1163,7 +_,7 @@
+ }
+ }
+@@ -1190,7 +_,7 @@
this.toolHighlightTimer = 0;
} else if (this.lastToolHighlight.isEmpty()
|| !itemstack.is(this.lastToolHighlight.getItem())
@@ -390,7 +386,7 @@
this.toolHighlightTimer = (int)(40.0 * this.minecraft.options.notificationDisplayTime().get());
} else if (this.toolHighlightTimer > 0) {
this.toolHighlightTimer--;
-@@ -1292,8 +_,17 @@
+@@ -1319,8 +_,17 @@
}
}
@@ -409,7 +405,7 @@
CONTAINER(
ResourceLocation.withDefaultNamespace("hud/heart/container"),
ResourceLocation.withDefaultNamespace("hud/heart/container_blinking"),
-@@ -1409,8 +_,13 @@
+@@ -1436,8 +_,13 @@
} else {
gui$hearttype = NORMAL;
}
diff --git a/patches/net/minecraft/client/gui/GuiGraphics.java.patch b/patches/net/minecraft/client/gui/GuiGraphics.java.patch
index 9ce42c48e94..8c6f417852b 100644
--- a/patches/net/minecraft/client/gui/GuiGraphics.java.patch
+++ b/patches/net/minecraft/client/gui/GuiGraphics.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/GuiGraphics.java
+++ b/net/minecraft/client/gui/GuiGraphics.java
-@@ -56,7 +_,7 @@
+@@ -53,7 +_,7 @@
import org.joml.Vector2ic;
@OnlyIn(Dist.CLIENT)
@@ -9,7 +9,7 @@
public static final float MAX_GUI_Z = 10000.0F;
public static final float MIN_GUI_Z = -10000.0F;
private static final int EXTRA_SPACE_AFTER_FIRST_TOOLTIP_LINE = 2;
-@@ -268,6 +_,11 @@
+@@ -227,6 +_,11 @@
}
public int drawString(Font p_283343_, @Nullable String p_281896_, int p_283569_, int p_283418_, int p_281560_, boolean p_282130_) {
@@ -18,10 +18,10 @@
+
+ // Forge: Add float variant for x,y coordinates, with a string as input
+ public int drawString(Font p_283343_, @Nullable String p_281896_, float p_283569_, float p_283418_, int p_281560_, boolean p_282130_) {
- if (p_281896_ == null) {
- return 0;
- } else {
-@@ -294,6 +_,11 @@
+ return p_281896_ == null
+ ? 0
+ : p_283343_.drawInBatch(
+@@ -249,6 +_,11 @@
}
public int drawString(Font p_282636_, FormattedCharSequence p_281596_, int p_281586_, int p_282816_, int p_281743_, boolean p_282394_) {
@@ -30,13 +30,14 @@
+
+ // Forge: Add float variant for x,y coordinates, with a formatted char sequence as input
+ public int drawString(Font p_282636_, FormattedCharSequence p_281596_, float p_281586_, float p_282816_, int p_281743_, boolean p_282394_) {
- int i = p_282636_.drawInBatch(
+ return p_282636_.drawInBatch(
p_281596_,
(float)p_281586_,
-@@ -873,19 +_,26 @@
- }
-
+@@ -871,10 +_,15 @@
+ this.renderItemCount(p_282005_, p_283349_, p_282641_, p_282146_, p_282803_);
+ this.renderItemCooldown(p_283349_, p_282641_, p_282146_);
this.pose.popPose();
++ // TODO 1.21.2: This probably belongs in one of the sub-methods.
+ net.neoforged.neoforge.client.ItemDecoratorHandler.of(p_283349_).render(this, p_282005_, p_283349_, p_282641_, p_282146_);
}
}
@@ -45,56 +46,93 @@
public void renderTooltip(Font p_282308_, ItemStack p_282781_, int p_282687_, int p_282292_) {
+ this.tooltipStack = p_282781_;
- this.renderTooltip(p_282308_, Screen.getTooltipFromItem(this.minecraft, p_282781_), p_282781_.getTooltipImage(), p_282687_, p_282292_);
+ this.renderTooltip(
+ p_282308_,
+ Screen.getTooltipFromItem(this.minecraft, p_282781_),
+@@ -883,6 +_,17 @@
+ p_282292_,
+ p_282781_.get(DataComponents.TOOLTIP_STYLE)
+ );
+ this.tooltipStack = ItemStack.EMPTY;
+ }
+
+ public void renderTooltip(Font font, List textComponents, Optional tooltipComponent, ItemStack stack, int mouseX, int mouseY) {
++ renderTooltip(font, textComponents, tooltipComponent, stack, mouseX, mouseY, null);
++ }
++
++ public void renderTooltip(Font font, List textComponents, Optional tooltipComponent, ItemStack stack, int mouseX, int mouseY, @Nullable ResourceLocation backgroundTexture) {
+ this.tooltipStack = stack;
-+ this.renderTooltip(font, textComponents, tooltipComponent, mouseX, mouseY);
++ this.renderTooltip(font, textComponents, tooltipComponent, mouseX, mouseY, backgroundTexture);
+ this.tooltipStack = ItemStack.EMPTY;
}
public void renderTooltip(Font p_283128_, List p_282716_, Optional p_281682_, int p_283678_, int p_281696_) {
-- List list = p_282716_.stream()
+@@ -892,11 +_,7 @@
+ public void renderTooltip(
+ Font p_371715_, List p_371741_, Optional p_371604_, int p_371500_, int p_371755_, @Nullable ResourceLocation p_371766_
+ ) {
+- List list = p_371741_.stream()
- .map(Component::getVisualOrderText)
- .map(ClientTooltipComponent::create)
- .collect(Util.toMutableList());
-- p_281682_.ifPresent(p_337410_ -> list.add(list.isEmpty() ? 0 : 1, ClientTooltipComponent.create(p_337410_)));
-+ List list = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponents(this.tooltipStack, p_282716_, p_281682_, p_283678_, guiWidth(), guiHeight(), p_283128_);
- this.renderTooltipInternal(p_283128_, list, p_283678_, p_281696_, DefaultTooltipPositioner.INSTANCE);
+- p_371604_.ifPresent(p_337410_ -> list.add(list.isEmpty() ? 0 : 1, ClientTooltipComponent.create(p_337410_)));
++ List list = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponents(this.tooltipStack, p_371741_, p_371604_, p_371500_, guiWidth(), guiHeight(), p_371715_);
+ this.renderTooltipInternal(p_371715_, list, p_371500_, p_371755_, DefaultTooltipPositioner.INSTANCE, p_371766_);
}
-@@ -894,7 +_,22 @@
+@@ -909,13 +_,14 @@
}
public void renderComponentTooltip(Font p_282739_, List p_281832_, int p_282191_, int p_282446_) {
-- this.renderTooltip(p_282739_, Lists.transform(p_281832_, Component::getVisualOrderText), p_282191_, p_282446_);
-+ List components = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponents(this.tooltipStack, p_281832_, p_282191_, guiWidth(), guiHeight(), p_282739_);
-+ this.renderTooltipInternal(p_282739_, components, p_282191_, p_282446_, DefaultTooltipPositioner.INSTANCE);
+- this.renderComponentTooltip(p_282739_, p_281832_, p_282191_, p_282446_, null);
++ this.renderComponentTooltip(p_282739_, p_281832_, p_282191_, p_282446_, (ResourceLocation) null);
+ }
+
+ public void renderComponentTooltip(Font p_371677_, List p_371519_, int p_371314_, int p_371389_, @Nullable ResourceLocation p_371458_) {
++ List components = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponents(this.tooltipStack, p_371519_, p_371314_, guiWidth(), guiHeight(), p_371677_);
+ this.renderTooltipInternal(
+ p_371677_,
+- p_371519_.stream().map(Component::getVisualOrderText).map(ClientTooltipComponent::create).toList(),
++ components,
+ p_371314_,
+ p_371389_,
+ DefaultTooltipPositioner.INSTANCE,
+@@ -923,6 +_,28 @@
+ );
+ }
+
++ public void renderComponentTooltip(Font font, List extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, ItemStack stack) {
++ renderComponentTooltip(font, tooltips, mouseX, mouseY, stack, null);
+ }
+
-+ public void renderComponentTooltip(Font font, List extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, ItemStack stack) {
++ public void renderComponentTooltip(Font font, List extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, ItemStack stack, @Nullable ResourceLocation backgroundTexture) {
+ this.tooltipStack = stack;
+ List components = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponents(stack, tooltips, mouseX, guiWidth(), guiHeight(), font);
-+ this.renderTooltipInternal(font, components, mouseX, mouseY, DefaultTooltipPositioner.INSTANCE);
++ this.renderTooltipInternal(font, components, mouseX, mouseY, DefaultTooltipPositioner.INSTANCE, backgroundTexture);
+ this.tooltipStack = ItemStack.EMPTY;
+ }
+
+ public void renderComponentTooltipFromElements(Font font, List> elements, int mouseX, int mouseY, ItemStack stack) {
++ renderComponentTooltipFromElements(font, elements, mouseX, mouseY, stack, null);
++ }
++
++ public void renderComponentTooltipFromElements(Font font, List> elements, int mouseX, int mouseY, ItemStack stack, @Nullable ResourceLocation backgroundTexture) {
+ this.tooltipStack = stack;
+ List components = net.neoforged.neoforge.client.ClientHooks.gatherTooltipComponentsFromElements(stack, elements, mouseX, guiWidth(), guiHeight(), font);
-+ this.renderTooltipInternal(font, components, mouseX, mouseY, DefaultTooltipPositioner.INSTANCE);
++ this.renderTooltipInternal(font, components, mouseX, mouseY, DefaultTooltipPositioner.INSTANCE, backgroundTexture);
+ this.tooltipStack = ItemStack.EMPTY;
- }
-
++ }
++
public void renderTooltip(Font p_282192_, List extends FormattedCharSequence> p_282297_, int p_281680_, int p_283325_) {
-@@ -915,11 +_,13 @@
-
- private void renderTooltipInternal(Font p_282675_, List p_282615_, int p_283230_, int p_283417_, ClientTooltipPositioner p_282442_) {
+ this.renderTooltip(p_282192_, p_282297_, p_281680_, p_283325_, null);
+ }
+@@ -955,41 +_,45 @@
+ @Nullable ResourceLocation p_371327_
+ ) {
if (!p_282615_.isEmpty()) {
+ net.neoforged.neoforge.client.event.RenderTooltipEvent.Pre preEvent = net.neoforged.neoforge.client.ClientHooks.onRenderTooltipPre(this.tooltipStack, this, p_283230_, p_283417_, guiWidth(), guiHeight(), p_282615_, p_282675_, p_282442_);
+ if (preEvent.isCanceled()) return;
++
int i = 0;
int j = p_282615_.size() == 1 ? -2 : 0;
@@ -104,35 +142,40 @@
if (k > i) {
i = k;
}
-@@ -929,18 +_,19 @@
+
+- j += clienttooltipcomponent.getHeight(p_282675_);
++ j += clienttooltipcomponent.getHeight(preEvent.getFont());
+ }
int i2 = i;
int j2 = j;
-- Vector2ic vector2ic = p_282442_.positionTooltip(this.guiWidth(), this.guiHeight(), p_283230_, p_283417_, i2, j2);
+- Vector2ic vector2ic = p_282442_.positionTooltip(this.guiWidth(), this.guiHeight(), p_283230_, p_283417_, i, j);
+ Vector2ic vector2ic = p_282442_.positionTooltip(this.guiWidth(), this.guiHeight(), preEvent.getX(), preEvent.getY(), i2, j2);
int l = vector2ic.x();
int i1 = vector2ic.y();
this.pose.pushPose();
int j1 = 400;
-- this.drawManaged(() -> TooltipRenderUtil.renderTooltipBackground(this, l, i1, i2, j2, 400));
+ net.neoforged.neoforge.client.event.RenderTooltipEvent.Color colorEvent = net.neoforged.neoforge.client.ClientHooks.onRenderTooltipColor(this.tooltipStack, this, l, i1, preEvent.getFont(), p_282615_);
-+ this.drawManaged(() -> TooltipRenderUtil.renderTooltipBackground(this, l, i1, i2, j2, 400, colorEvent.getBackgroundStart(), colorEvent.getBackgroundEnd(), colorEvent.getBorderStart(), colorEvent.getBorderEnd()));
+ TooltipRenderUtil.renderTooltipBackground(this, l, i1, i, j, 400, p_371327_);
this.pose.translate(0.0F, 0.0F, 400.0F);
int k1 = i1;
for (int l1 = 0; l1 < p_282615_.size(); l1++) {
ClientTooltipComponent clienttooltipcomponent1 = p_282615_.get(l1);
- clienttooltipcomponent1.renderText(p_282675_, l, k1, this.pose.last().pose(), this.bufferSource);
+- k1 += clienttooltipcomponent1.getHeight(p_282675_) + (l1 == 0 ? 2 : 0);
+ clienttooltipcomponent1.renderText(preEvent.getFont(), l, k1, this.pose.last().pose(), this.bufferSource);
- k1 += clienttooltipcomponent1.getHeight() + (l1 == 0 ? 2 : 0);
++ k1 += clienttooltipcomponent1.getHeight(preEvent.getFont()) + (l1 == 0 ? 2 : 0);
}
-@@ -948,7 +_,7 @@
+ k1 = i1;
for (int k2 = 0; k2 < p_282615_.size(); k2++) {
ClientTooltipComponent clienttooltipcomponent2 = p_282615_.get(k2);
-- clienttooltipcomponent2.renderImage(p_282675_, l, k1, this);
-+ clienttooltipcomponent2.renderImage(preEvent.getFont(), l, k1, this);
- k1 += clienttooltipcomponent2.getHeight() + (k2 == 0 ? 2 : 0);
+- clienttooltipcomponent2.renderImage(p_282675_, l, k1, i2, j2, this);
+- k1 += clienttooltipcomponent2.getHeight(p_282675_) + (k2 == 0 ? 2 : 0);
++ clienttooltipcomponent2.renderImage(preEvent.getFont(), l, k1, i2, j2, this);
++ k1 += clienttooltipcomponent2.getHeight(preEvent.getFont()) + (k2 == 0 ? 2 : 0);
}
+ this.pose.popPose();
diff --git a/patches/net/minecraft/client/gui/MapRenderer.java.patch b/patches/net/minecraft/client/gui/MapRenderer.java.patch
deleted file mode 100644
index 756bcda9342..00000000000
--- a/patches/net/minecraft/client/gui/MapRenderer.java.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/net/minecraft/client/gui/MapRenderer.java
-+++ b/net/minecraft/client/gui/MapRenderer.java
-@@ -122,6 +_,10 @@
-
- for (MapDecoration mapdecoration : this.data.getDecorations()) {
- if (!p_93294_ || mapdecoration.renderOnFrame()) {
-+ if (net.neoforged.neoforge.client.gui.map.MapDecorationRendererManager.render(mapdecoration, p_93292_, p_93293_, data, MapRenderer.this.decorationTextures, p_93294_, p_93295_, k)) {
-+ k++;
-+ continue;
-+ }
- p_93292_.pushPose();
- p_93292_.translate(0.0F + (float)mapdecoration.x() / 2.0F + 64.0F, 0.0F + (float)mapdecoration.y() / 2.0F + 64.0F, -0.02F);
- p_93292_.mulPose(Axis.ZP.rotationDegrees((float)(mapdecoration.rot() * 360) / 16.0F));
diff --git a/patches/net/minecraft/client/gui/components/AbstractButton.java.patch b/patches/net/minecraft/client/gui/components/AbstractButton.java.patch
index 5d141a2e4f8..56d0a21b54b 100644
--- a/patches/net/minecraft/client/gui/components/AbstractButton.java.patch
+++ b/patches/net/minecraft/client/gui/components/AbstractButton.java.patch
@@ -1,9 +1,9 @@
--- a/net/minecraft/client/gui/components/AbstractButton.java
+++ b/net/minecraft/client/gui/components/AbstractButton.java
-@@ -34,7 +_,7 @@
- RenderSystem.enableDepthTest();
- p_281670_.blitSprite(SPRITES.get(this.active, this.isHoveredOrFocused()), this.getX(), this.getY(), this.getWidth(), this.getHeight());
- p_281670_.setColor(1.0F, 1.0F, 1.0F, 1.0F);
+@@ -39,7 +_,7 @@
+ this.getHeight(),
+ ARGB.white(this.alpha)
+ );
- int i = this.active ? 16777215 : 10526880;
+ int i = getFGColor();
this.renderString(p_281670_, minecraft.font, i | Mth.ceil(this.alpha * 255.0F) << 24);
diff --git a/patches/net/minecraft/client/gui/components/AbstractWidget.java.patch b/patches/net/minecraft/client/gui/components/AbstractWidget.java.patch
index 0f5ac718d80..256cef46f42 100644
--- a/patches/net/minecraft/client/gui/components/AbstractWidget.java.patch
+++ b/patches/net/minecraft/client/gui/components/AbstractWidget.java.patch
@@ -27,7 +27,7 @@
return true;
}
}
-@@ -253,6 +_,19 @@
+@@ -257,6 +_,19 @@
@Override
public void setFocused(boolean p_93693_) {
this.focused = p_93693_;
diff --git a/patches/net/minecraft/client/gui/components/BossHealthOverlay.java.patch b/patches/net/minecraft/client/gui/components/BossHealthOverlay.java.patch
index 4bc398fffe6..2e911a86dfc 100644
--- a/patches/net/minecraft/client/gui/components/BossHealthOverlay.java.patch
+++ b/patches/net/minecraft/client/gui/components/BossHealthOverlay.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/components/BossHealthOverlay.java
+++ b/net/minecraft/client/gui/components/BossHealthOverlay.java
-@@ -63,13 +_,16 @@
+@@ -66,13 +_,16 @@
for (LerpingBossEvent lerpingbossevent : this.events.values()) {
int k = i / 2 - 91;
diff --git a/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch b/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch
index d47bc314350..3b4f7e321db 100644
--- a/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch
+++ b/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch
@@ -1,25 +1,24 @@
--- a/net/minecraft/client/gui/components/DebugScreenOverlay.java
+++ b/net/minecraft/client/gui/components/DebugScreenOverlay.java
-@@ -135,8 +_,15 @@
+@@ -141,8 +_,14 @@
+ Entity entity = this.minecraft.getCameraEntity();
this.block = entity.pick(20.0, 0.0F, false);
this.liquid = entity.pick(20.0, 0.0F, true);
- p_281427_.drawManaged(() -> {
-- this.drawGameInformation(p_281427_);
-- this.drawSystemInformation(p_281427_);
-+ final List gameInformation = this.collectGameInformationText();
-+ final List systemInformation = this.collectSystemInformationText();
+- this.drawGameInformation(p_281427_);
+- this.drawSystemInformation(p_281427_);
+
-+ var event = new net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent.DebugText(minecraft.getWindow(), p_281427_, minecraft.getTimer(), gameInformation, systemInformation);
-+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(event);
++ final List gameInformation = this.collectGameInformationText();
++ final List systemInformation = this.collectSystemInformationText();
++ var event = new net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent.DebugText(minecraft.getWindow(), p_281427_, minecraft.getDeltaTracker(), gameInformation, systemInformation);
++ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(event);
++ this.renderLines(p_281427_, gameInformation, true);
++ this.renderLines(p_281427_, systemInformation, false);
+
-+ this.renderLines(p_281427_, gameInformation, true);
-+ this.renderLines(p_281427_, systemInformation, false);
-+
- if (this.renderFpsCharts) {
- int i = p_281427_.guiWidth();
- int j = i / 2;
-@@ -161,7 +_,11 @@
- this.minecraft.getProfiler().pop();
+ this.profilerPieChart.setBottomOffset(10);
+ if (this.renderFpsCharts) {
+ int i = p_281427_.guiWidth();
+@@ -175,7 +_,11 @@
+ profilerfiller.pop();
}
- protected void drawGameInformation(GuiGraphics p_281525_) {
@@ -31,7 +30,7 @@
List list = this.getGameInformation();
list.add("");
boolean flag = this.minecraft.getSingleplayerServer() != null;
-@@ -176,11 +_,25 @@
+@@ -190,11 +_,25 @@
+ (this.renderNetworkCharts ? " visible" : " hidden")
);
list.add("For help: press F3 + Q");
@@ -58,7 +57,7 @@
this.renderLines(p_281261_, list, false);
}
-@@ -509,6 +_,13 @@
+@@ -523,6 +_,13 @@
GlUtil.getRenderer(),
GlUtil.getOpenGLVersion()
);
@@ -72,7 +71,7 @@
if (this.minecraft.showOnlyReducedInfo()) {
return list;
} else {
-@@ -545,6 +_,7 @@
+@@ -559,6 +_,7 @@
list.add("");
list.add(ChatFormatting.UNDERLINE + "Targeted Entity");
list.add(String.valueOf(BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType())));
diff --git a/patches/net/minecraft/client/gui/components/toasts/ToastComponent.java.patch b/patches/net/minecraft/client/gui/components/toasts/ToastComponent.java.patch
deleted file mode 100644
index 7c7e69a6d3a..00000000000
--- a/patches/net/minecraft/client/gui/components/toasts/ToastComponent.java.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/net/minecraft/client/gui/components/toasts/ToastComponent.java
-+++ b/net/minecraft/client/gui/components/toasts/ToastComponent.java
-@@ -99,6 +_,7 @@
- }
-
- public void addToast(Toast p_94923_) {
-+ if (net.neoforged.neoforge.client.ClientHooks.onToastAdd(p_94923_)) return;
- this.queued.add(p_94923_);
- }
-
diff --git a/patches/net/minecraft/client/gui/components/toasts/ToastManager.java.patch b/patches/net/minecraft/client/gui/components/toasts/ToastManager.java.patch
new file mode 100644
index 00000000000..f5bd0bffbc4
--- /dev/null
+++ b/patches/net/minecraft/client/gui/components/toasts/ToastManager.java.patch
@@ -0,0 +1,10 @@
+--- a/net/minecraft/client/gui/components/toasts/ToastManager.java
++++ b/net/minecraft/client/gui/components/toasts/ToastManager.java
+@@ -107,6 +_,7 @@
+ }
+
+ public void addToast(Toast p_362712_) {
++ if (net.neoforged.neoforge.client.ClientHooks.onToastAdd(p_362712_)) return;
+ this.queued.add(p_362712_);
+ }
+
diff --git a/patches/net/minecraft/client/gui/screens/LoadingOverlay.java.patch b/patches/net/minecraft/client/gui/screens/LoadingOverlay.java.patch
index 3729b1ae51a..b607643c50f 100644
--- a/patches/net/minecraft/client/gui/screens/LoadingOverlay.java.patch
+++ b/patches/net/minecraft/client/gui/screens/LoadingOverlay.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/LoadingOverlay.java
+++ b/net/minecraft/client/gui/screens/LoadingOverlay.java
-@@ -133,6 +_,7 @@
+@@ -123,6 +_,7 @@
}
if (this.fadeOutStart == -1L && this.reload.isDone() && (!this.fadeIn || f1 >= 2.0F)) {
@@ -8,7 +8,7 @@
try {
this.reload.checkExceptions();
this.onFinish.accept(Optional.empty());
-@@ -140,7 +_,6 @@
+@@ -130,7 +_,6 @@
this.onFinish.accept(Optional.of(throwable));
}
diff --git a/patches/net/minecraft/client/gui/screens/PauseScreen.java.patch b/patches/net/minecraft/client/gui/screens/PauseScreen.java.patch
index 7016a2712f4..b8a1613d4e3 100644
--- a/patches/net/minecraft/client/gui/screens/PauseScreen.java.patch
+++ b/patches/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
-@@ -96,6 +_,7 @@
+@@ -97,6 +_,7 @@
} else {
gridlayout$rowhelper.addChild(this.openScreenButton(PLAYER_REPORTING, () -> new SocialInteractionsScreen(this)));
}
diff --git a/patches/net/minecraft/client/gui/screens/Screen.java.patch b/patches/net/minecraft/client/gui/screens/Screen.java.patch
index cc93b39e1cd..e7d7751d224 100644
--- a/patches/net/minecraft/client/gui/screens/Screen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/Screen.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/Screen.java
+++ b/net/minecraft/client/gui/screens/Screen.java
-@@ -116,6 +_,7 @@
+@@ -115,6 +_,7 @@
}
}
@@ -8,7 +8,7 @@
@Override
public void render(GuiGraphics p_281549_, int p_281550_, int p_282878_, float p_282465_) {
this.renderBackground(p_281549_, p_281550_, p_282878_, p_282465_);
-@@ -201,7 +_,7 @@
+@@ -200,7 +_,7 @@
}
public void onClose() {
@@ -17,7 +17,7 @@
}
protected T addRenderableWidget(T p_169406_) {
-@@ -242,7 +_,7 @@
+@@ -241,7 +_,7 @@
return p_282833_.getTooltipLines(
Item.TooltipContext.of(p_281881_.level),
p_281881_.player,
@@ -26,7 +26,7 @@
);
}
-@@ -312,8 +_,11 @@
+@@ -311,8 +_,11 @@
this.width = p_96608_;
this.height = p_96609_;
if (!this.initialized) {
@@ -38,7 +38,7 @@
} else {
this.repositionElements();
}
-@@ -326,8 +_,11 @@
+@@ -325,8 +_,11 @@
protected void rebuildWidgets() {
this.clearWidgets();
this.clearFocus();
@@ -50,15 +50,15 @@
}
@Override
-@@ -354,6 +_,7 @@
+@@ -353,6 +_,7 @@
- this.renderBlurredBackground(p_294317_);
+ this.renderBlurredBackground();
this.renderMenuBackground(p_283688_);
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.ScreenEvent.BackgroundRendered(this, p_283688_));
}
- protected void renderBlurredBackground(float p_330683_) {
-@@ -467,6 +_,10 @@
+ protected void renderBlurredBackground() {
+@@ -458,6 +_,10 @@
public void onFilesDrop(List p_96591_) {
}
@@ -69,7 +69,7 @@
private void scheduleNarration(long p_169381_, boolean p_169382_) {
this.nextNarrationTime = Util.getMillis() + p_169381_;
if (p_169382_) {
-@@ -643,5 +_,13 @@
+@@ -642,5 +_,13 @@
this.index = p_169425_;
this.priority = p_169426_;
}
diff --git a/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch b/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch
index b4069b56033..39e436c46d5 100644
--- a/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/TitleScreen.java.patch
@@ -7,16 +7,16 @@
- int l = this.height / 4 + 48;
+ int l = this.height / 4 + 32;
if (this.minecraft.isDemo()) {
- this.createDemoMenuOptions(l, 24);
+ l = this.createDemoMenuOptions(l, 24);
} else {
- this.createNormalMenuOptions(l, 24);
+ l = this.createNormalMenuOptions(l, 24);
+ this.addRenderableWidget(new net.neoforged.neoforge.client.gui.widget.ModsButton(Button.builder(Component.translatable("fml.menu.mods"), button -> this.minecraft.setScreen(new net.neoforged.neoforge.client.gui.ModListScreen(this)))
+ .pos(this.width / 2 - 100, l + 24 * 3).size(200, 20)));
+ l += 22; // Move down Options, Quit, Language, and Accessibility buttons to make room for mods button
}
- SpriteIconButton spriteiconbutton = this.addRenderableWidget(
-@@ -285,6 +_,7 @@
+ l = this.createTestWorldButton(l, 24);
+@@ -304,6 +_,7 @@
if ((i & -67108864) != 0) {
super.render(p_282860_, p_281753_, p_283539_, p_282628_);
this.logoRenderer.renderLogo(p_282860_, this.width, f);
@@ -24,7 +24,7 @@
if (this.splash != null && !this.minecraft.options.hideSplashTexts().get()) {
this.splash.render(p_282860_, this.width, this.font, i);
}
-@@ -300,7 +_,13 @@
+@@ -319,7 +_,13 @@
s = s + I18n.get("menu.modded");
}
@@ -37,5 +37,5 @@
+ p_282860_.drawString(this.font, brd, this.width - font.width(brd), this.height - (10 + (brdline + 1) * (this.font.lineHeight + 1)), 16777215 | i)
+ );
if (this.realmsNotificationsEnabled() && f >= 1.0F) {
- RenderSystem.enableDepthTest();
this.realmsNotificationsScreen.render(p_282860_, p_281753_, p_283539_, p_282628_);
+ }
diff --git a/patches/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch b/patches/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch
index 01da559bba8..f74b6000efc 100644
--- a/patches/net/minecraft/client/gui/screens/advancements/AdvancementTab.java.patch
+++ b/patches/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
-@@ -37,6 +_,7 @@
+@@ -38,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_300867_, DisplayInfo p_97150_
-@@ -53,6 +_,15 @@
+@@ -54,6 +_,15 @@
this.addWidget(this.root, p_300867_.holder());
}
@@ -24,7 +24,7 @@
public AdvancementTabType getType() {
return this.type;
}
-@@ -146,8 +_,8 @@
+@@ -147,8 +_,8 @@
return null;
} else {
for (AdvancementTabType advancementtabtype : AdvancementTabType.values()) {
diff --git a/patches/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java.patch b/patches/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java.patch
index 62e72245286..fbce35ac1f4 100644
--- a/patches/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java.patch
+++ b/patches/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java
-@@ -71,6 +_,7 @@
+@@ -72,6 +_,7 @@
private final AdvancementTabType.Sprites selectedSprites;
private final AdvancementTabType.Sprites unselectedSprites;
diff --git a/patches/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch b/patches/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch
index 3e9f5ae7949..30052bef01a 100644
--- a/patches/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java
-@@ -49,6 +_,7 @@
+@@ -51,6 +_,7 @@
@Nullable
private AdvancementTab selectedTab;
private boolean isScrolling;
@@ -8,7 +8,7 @@
public AdvancementsScreen(ClientAdvancements p_97340_) {
this(p_97340_, null);
-@@ -73,6 +_,16 @@
+@@ -75,6 +_,16 @@
this.advancements.setSelectedTab(this.selectedTab == null ? null : this.selectedTab.getRootNode().holder(), true);
}
@@ -25,7 +25,7 @@
this.layout.addToFooter(Button.builder(CommonComponents.GUI_DONE, p_331557_ -> this.onClose()).width(200).build());
this.layout.visitWidgets(p_332019_ -> {
AbstractWidget abstractwidget = this.addRenderableWidget(p_332019_);
-@@ -106,7 +_,7 @@
+@@ -108,7 +_,7 @@
int j = (this.height - 140) / 2;
for (AdvancementTab advancementtab : this.tabs.values()) {
@@ -34,7 +34,7 @@
this.advancements.setSelectedTab(advancementtab.getRootNode().holder(), true);
break;
}
-@@ -132,6 +_,11 @@
+@@ -134,6 +_,11 @@
super.render(p_282589_, p_282255_, p_283354_, p_283123_);
int i = (this.width - 252) / 2;
int j = (this.height - 140) / 2;
@@ -46,8 +46,8 @@
this.renderInside(p_282589_, p_282255_, p_283354_, i, j);
this.renderWindow(p_282589_, i, j);
this.renderTooltips(p_282589_, p_282255_, p_283354_, i, j);
-@@ -180,10 +_,12 @@
- p_283395_.blit(WINDOW_LOCATION, p_281890_, p_282532_, 0, 0, 252, 140);
+@@ -181,10 +_,12 @@
+ p_283395_.blit(RenderType::guiTextured, WINDOW_LOCATION, p_281890_, p_282532_, 0.0F, 0.0F, 252, 140, 256, 256);
if (this.tabs.size() > 1) {
for (AdvancementTab advancementtab : this.tabs.values()) {
+ if (advancementtab.getPage() == tabPage)
@@ -59,7 +59,7 @@
advancementtab1.drawIcon(p_283395_, p_281890_, p_282532_);
}
}
-@@ -203,7 +_,7 @@
+@@ -202,7 +_,7 @@
if (this.tabs.size() > 1) {
for (AdvancementTab advancementtab : this.tabs.values()) {
diff --git a/patches/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch
index d00c918adba..be4ec4baf12 100644
--- a/patches/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
-@@ -91,7 +_,12 @@
+@@ -107,7 +_,12 @@
public void render(GuiGraphics p_283479_, int p_283661_, int p_281248_, float p_281886_) {
int i = this.leftPos;
int j = this.topPos;
@@ -11,56 +11,26 @@
+ for (net.minecraft.client.gui.components.Renderable renderable : this.renderables) {
+ renderable.render(p_283479_, p_283661_, p_281248_, p_281886_);
+ }
- RenderSystem.disableDepthTest();
p_283479_.pose().pushPose();
p_283479_.pose().translate((float)i, (float)j, 0.0F);
-@@ -105,15 +_,12 @@
-
- if (this.isHovering(slot, (double)p_283661_, (double)p_281248_) && slot.isActive()) {
- this.hoveredSlot = slot;
-- int l = slot.x;
-- int i1 = slot.y;
-- if (this.hoveredSlot.isHighlightable()) {
-- renderSlotHighlight(p_283479_, l, i1, 0);
-- }
-+ this.renderSlotHighlight(p_283479_, slot, p_283661_, p_281248_, p_281886_);
- }
+ Slot slot = this.hoveredSlot;
+@@ -120,6 +_,7 @@
}
this.renderLabels(p_283479_, p_283661_, p_281248_);
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.ContainerScreenEvent.Render.Foreground(this, p_283479_, p_283661_, p_281248_));
ItemStack itemstack = this.draggingItem.isEmpty() ? this.menu.getCarried() : this.draggingItem;
if (!itemstack.isEmpty()) {
- int l1 = 8;
-@@ -156,13 +_,25 @@
- }
-
- public static void renderSlotHighlight(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_) {
-- p_283692_.fillGradient(RenderType.guiOverlay(), p_281453_, p_281915_, p_281453_ + 16, p_281915_ + 16, -2130706433, -2130706433, p_283504_);
-+ renderSlotHighlight(p_283692_, p_281453_, p_281915_, p_283504_, -2130706433);
-+ }
-+ public static void renderSlotHighlight(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_, int color) {
-+ p_283692_.fillGradient(RenderType.guiOverlay(), p_281453_, p_281915_, p_281453_ + 16, p_281915_ + 16, color, color, p_283504_);
-+ }
-+
-+ /**
-+ * Renders a highlight for the given slot to indicate the mouse is currently hovering over it.
-+ */
-+ protected void renderSlotHighlight(GuiGraphics guiGraphics, Slot slot, int mouseX, int mouseY, float partialTick) {
-+ if (slot.isHighlightable()) {
-+ renderSlotHighlight(guiGraphics, slot.x, slot.y, 0, getSlotColor(slot.index));
-+ }
- }
-
- protected void renderTooltip(GuiGraphics p_283594_, int p_282171_, int p_281909_) {
- if (this.menu.getCarried().isEmpty() && this.hoveredSlot != null && this.hoveredSlot.hasItem()) {
- ItemStack itemstack = this.hoveredSlot.getItem();
-- p_283594_.renderTooltip(this.font, this.getTooltipFromContainerItem(itemstack), itemstack.getTooltipImage(), p_282171_, p_281909_);
-+ p_283594_.renderTooltip(this.font, this.getTooltipFromContainerItem(itemstack), itemstack.getTooltipImage(), itemstack, p_282171_, p_281909_);
- }
- }
-
-@@ -174,7 +_,8 @@
+ int k = 8;
+@@ -202,6 +_,7 @@
+ this.font,
+ this.getTooltipFromContainerItem(itemstack),
+ itemstack.getTooltipImage(),
++ itemstack,
+ p_282171_,
+ p_281909_,
+ itemstack.get(DataComponents.TOOLTIP_STYLE)
+@@ -222,7 +_,8 @@
p_282567_.pose().pushPose();
p_282567_.pose().translate(0.0F, 0.0F, 232.0F);
p_282567_.renderItem(p_281330_, p_281772_, p_281689_);
@@ -70,7 +40,7 @@
p_282567_.pose().popPose();
}
-@@ -233,6 +_,14 @@
+@@ -281,6 +_,14 @@
p_281607_.fill(i, j, i + 16, j + 16, -2130706433);
}
@@ -85,7 +55,7 @@
int j1 = p_282613_.x + p_282613_.y * this.imageWidth;
if (p_282613_.isFake()) {
p_281607_.renderFakeItem(itemstack, i, j, j1);
-@@ -241,9 +_,6 @@
+@@ -289,9 +_,6 @@
}
p_281607_.renderItemDecorations(this.font, itemstack, i, j, s);
@@ -95,17 +65,17 @@
}
private void recalculateQuickCraftRemaining() {
-@@ -282,7 +_,8 @@
+@@ -329,7 +_,8 @@
if (super.mouseClicked(p_97748_, p_97749_, p_97750_)) {
return true;
} else {
- boolean flag = this.minecraft.options.keyPickItem.matchesMouse(p_97750_) && this.minecraft.gameMode.hasInfiniteItems();
+ InputConstants.Key mouseKey = InputConstants.Type.MOUSE.getOrCreate(p_97750_);
+ boolean flag = this.minecraft.options.keyPickItem.isActiveAndMatches(mouseKey);
- Slot slot = this.findSlot(p_97748_, p_97749_);
+ Slot slot = this.getHoveredSlot(p_97748_, p_97749_);
long i = Util.getMillis();
this.doubleclick = this.lastClickSlot == slot && i - this.lastClickTime < 250L && this.lastClickButton == p_97750_;
-@@ -293,6 +_,7 @@
+@@ -340,6 +_,7 @@
int j = this.leftPos;
int k = this.topPos;
boolean flag1 = this.hasClickedOutside(p_97748_, p_97749_, j, k, p_97750_);
@@ -113,7 +83,7 @@
int l = -1;
if (slot != null) {
l = slot.index;
-@@ -318,7 +_,7 @@
+@@ -365,7 +_,7 @@
}
} else if (!this.isQuickCrafting) {
if (this.menu.getCarried().isEmpty()) {
@@ -122,7 +92,7 @@
this.slotClicked(slot, l, p_97750_, ClickType.CLONE);
} else {
boolean flag2 = l != -999
-@@ -346,7 +_,7 @@
+@@ -393,7 +_,7 @@
this.quickCraftingType = 0;
} else if (p_97750_ == 1) {
this.quickCraftingType = 1;
@@ -131,12 +101,12 @@
this.quickCraftingType = 2;
}
}
-@@ -425,10 +_,13 @@
+@@ -472,10 +_,13 @@
@Override
public boolean mouseReleased(double p_97812_, double p_97813_, int p_97814_) {
+ super.mouseReleased(p_97812_, p_97813_, p_97814_); //Forge, Call parent to release buttons
- Slot slot = this.findSlot(p_97812_, p_97813_);
+ Slot slot = this.getHoveredSlot(p_97812_, p_97813_);
int i = this.leftPos;
int j = this.topPos;
boolean flag = this.hasClickedOutside(p_97812_, p_97813_, i, j, p_97814_);
@@ -145,7 +115,7 @@
int k = -1;
if (slot != null) {
k = slot.index;
-@@ -445,7 +_,7 @@
+@@ -492,7 +_,7 @@
if (slot2 != null
&& slot2.mayPickup(this.minecraft.player)
&& slot2.hasItem()
@@ -154,7 +124,7 @@
&& AbstractContainerMenu.canItemQuickReplace(slot2, this.lastQuickMoved, true)) {
this.slotClicked(slot2, slot2.index, p_97814_, ClickType.QUICK_MOVE);
}
-@@ -509,7 +_,7 @@
+@@ -556,7 +_,7 @@
this.slotClicked(null, -999, AbstractContainerMenu.getQuickcraftMask(2, this.quickCraftingType), ClickType.QUICK_CRAFT);
} else if (!this.menu.getCarried().isEmpty()) {
@@ -163,7 +133,7 @@
this.slotClicked(slot, k, p_97814_, ClickType.CLONE);
} else {
boolean flag1 = k != -999
-@@ -568,34 +_,39 @@
+@@ -636,34 +_,39 @@
@Override
public boolean keyPressed(int p_97765_, int p_97766_, int p_97767_) {
@@ -210,7 +180,7 @@
this.slotClicked(this.hoveredSlot, this.hoveredSlot.index, i, ClickType.SWAP);
return true;
}
-@@ -633,6 +_,18 @@
+@@ -701,6 +_,18 @@
@Override
public T getMenu() {
return this.menu;
diff --git a/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch
index 525825a4425..37ccae8839c 100644
--- a/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java.patch
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java
-@@ -112,6 +_,8 @@
- private boolean hasClickedOutside;
+@@ -115,6 +_,8 @@
private final Set> visibleTags = new HashSet<>();
private final boolean displayOperatorCreativeTab;
+ private final EffectsInInventory effects;
+ private final List pages = new java.util.ArrayList<>();
+ private net.neoforged.neoforge.client.gui.CreativeTabsScreenPage currentPage = new net.neoforged.neoforge.client.gui.CreativeTabsScreenPage(new java.util.ArrayList<>());
public CreativeModeInventoryScreen(LocalPlayer p_346290_, FeatureFlagSet p_260074_, boolean p_259569_) {
super(new CreativeModeInventoryScreen.ItemPickerMenu(p_346290_), p_346290_.getInventory(), CommonComponents.EMPTY);
-@@ -147,9 +_,11 @@
+@@ -151,9 +_,11 @@
return false;
} else {
if (p_345591_ != null) {
@@ -24,7 +24,7 @@
}
return true;
-@@ -159,7 +_,7 @@
+@@ -163,7 +_,7 @@
private void refreshCurrentTabContents(Collection p_261591_) {
int i = this.menu.getRowIndexForScroll(this.scrollOffs);
this.menu.items.clear();
@@ -33,7 +33,7 @@
this.refreshSearchResults();
} else {
this.menu.items.addAll(p_261591_);
-@@ -326,6 +_,34 @@
+@@ -337,6 +_,34 @@
protected void init() {
if (this.minecraft.gameMode.hasInfiniteItems()) {
super.init();
@@ -68,7 +68,7 @@
this.searchBox = new EditBox(this.font, this.leftPos + 82, this.topPos + 6, 80, 9, Component.translatable("itemGroup.search"));
this.searchBox.setMaxLength(50);
this.searchBox.setBordered(false);
-@@ -372,7 +_,7 @@
+@@ -383,7 +_,7 @@
public boolean charTyped(char p_98521_, int p_98522_) {
if (this.ignoreTextInput) {
return false;
@@ -77,7 +77,7 @@
return false;
} else {
String s = this.searchBox.getValue();
-@@ -391,7 +_,7 @@
+@@ -402,7 +_,7 @@
@Override
public boolean keyPressed(int p_98547_, int p_98548_, int p_98549_) {
this.ignoreTextInput = false;
@@ -86,7 +86,7 @@
if (this.minecraft.options.keyChat.matches(p_98547_, p_98548_)) {
this.ignoreTextInput = true;
this.selectTab(CreativeModeTabs.searchTab());
-@@ -427,6 +_,7 @@
+@@ -438,6 +_,7 @@
}
private void refreshSearchResults() {
@@ -94,7 +94,7 @@
this.menu.items.clear();
this.visibleTags.clear();
String s = this.searchBox.getValue();
-@@ -439,10 +_,10 @@
+@@ -450,10 +_,10 @@
SearchTree searchtree;
if (s.startsWith("#")) {
s = s.substring(1);
@@ -107,7 +107,7 @@
}
this.menu.items.addAll(searchtree.search(s.toLowerCase(Locale.ROOT)));
-@@ -470,7 +_,8 @@
+@@ -481,7 +_,8 @@
@Override
protected void renderLabels(GuiGraphics p_283168_, int p_281774_, int p_281466_) {
if (selectedTab.showTitle()) {
@@ -117,7 +117,7 @@
}
}
-@@ -480,7 +_,7 @@
+@@ -491,7 +_,7 @@
double d0 = p_98531_ - (double)this.leftPos;
double d1 = p_98532_ - (double)this.topPos;
@@ -126,7 +126,7 @@
if (this.checkTabClicked(creativemodetab, d0, d1)) {
return true;
}
-@@ -502,7 +_,7 @@
+@@ -513,7 +_,7 @@
double d1 = p_98623_ - (double)this.topPos;
this.scrolling = false;
@@ -135,7 +135,7 @@
if (this.checkTabClicked(creativemodetab, d0, d1)) {
this.selectTab(creativemodetab);
return true;
-@@ -520,6 +_,7 @@
+@@ -531,6 +_,7 @@
private void selectTab(CreativeModeTab p_98561_) {
CreativeModeTab creativemodetab = selectedTab;
selectedTab = p_98561_;
@@ -143,7 +143,7 @@
this.quickCraftSlots.clear();
this.menu.items.clear();
this.clearDraggingState();
-@@ -596,13 +_,15 @@
+@@ -607,13 +_,15 @@
this.originalSlots = null;
}
@@ -160,9 +160,9 @@
this.refreshSearchResults();
} else {
-@@ -665,18 +_,27 @@
- public void render(GuiGraphics p_283000_, int p_281317_, int p_282770_, float p_281295_) {
+@@ -679,18 +_,27 @@
super.render(p_283000_, p_281317_, p_282770_, p_281295_);
+ this.effects.render(p_283000_, p_281317_, p_282770_, p_281295_);
- for (CreativeModeTab creativemodetab : CreativeModeTabs.tabs()) {
- if (this.checkTabHovering(p_283000_, creativemodetab, p_281317_, p_282770_)) {
@@ -194,7 +194,7 @@
this.renderTooltip(p_283000_, p_281317_, p_282770_);
}
-@@ -684,10 +_,10 @@
+@@ -703,10 +_,10 @@
public List getTooltipFromContainerItem(ItemStack p_281769_) {
boolean flag = this.hoveredSlot != null && this.hoveredSlot instanceof CreativeModeInventoryScreen.CustomCreativeSlot;
boolean flag1 = selectedTab.getType() == CreativeModeTab.Type.CATEGORY;
@@ -207,7 +207,7 @@
if (flag1 && flag) {
return list;
} else {
-@@ -703,7 +_,7 @@
+@@ -722,7 +_,7 @@
int i = 1;
for (CreativeModeTab creativemodetab : CreativeModeTabs.tabs()) {
@@ -216,7 +216,7 @@
list1.add(i++, creativemodetab.getDisplayName().copy().withStyle(ChatFormatting.BLUE));
}
}
-@@ -714,7 +_,7 @@
+@@ -733,7 +_,7 @@
@Override
protected void renderBg(GuiGraphics p_282663_, float p_282504_, int p_282089_, int p_282249_) {
@@ -225,20 +225,20 @@
if (creativemodetab != selectedTab) {
this.renderTabButton(p_282663_, creativemodetab);
}
-@@ -726,10 +_,11 @@
+@@ -747,10 +_,11 @@
int k = this.topPos + 18;
int i = k + 112;
if (selectedTab.canScroll()) {
- ResourceLocation resourcelocation = this.canScroll() ? SCROLLER_SPRITE : SCROLLER_DISABLED_SPRITE;
+ ResourceLocation resourcelocation = selectedTab.getScrollerSprite(); // this.canScroll() ? SCROLLER_SPRITE : SCROLLER_DISABLED_SPRITE;
- p_282663_.blitSprite(resourcelocation, j, k + (int)((float)(i - k - 17) * this.scrollOffs), 12, 15);
+ p_282663_.blitSprite(RenderType::guiTextured, resourcelocation, j, k + (int)((float)(i - k - 17) * this.scrollOffs), 12, 15);
}
+ if (currentPage.getVisibleTabs().contains(selectedTab)) //Forge: only display tab selection when the selected tab is on the current page
this.renderTabButton(p_282663_, selectedTab);
if (selectedTab.getType() == CreativeModeTab.Type.INVENTORY) {
InventoryScreen.renderEntityInInventoryFollowsMouse(
-@@ -748,7 +_,7 @@
+@@ -769,7 +_,7 @@
}
private int getTabX(CreativeModeTab p_260136_) {
@@ -247,7 +247,7 @@
int j = 27;
int k = 27 * i;
if (p_260136_.isAlignedRight()) {
-@@ -760,7 +_,7 @@
+@@ -781,7 +_,7 @@
private int getTabY(CreativeModeTab p_260181_) {
int i = 0;
@@ -256,7 +256,7 @@
i -= 32;
} else {
i += this.imageHeight;
-@@ -788,8 +_,8 @@
+@@ -809,8 +_,8 @@
protected void renderTabButton(GuiGraphics p_283590_, CreativeModeTab p_283489_) {
boolean flag = p_283489_ == selectedTab;
@@ -267,15 +267,15 @@
int j = this.leftPos + this.getTabX(p_283489_);
int k = this.topPos - (flag1 ? 28 : -(this.imageHeight - 4));
ResourceLocation[] aresourcelocation;
-@@ -799,6 +_,7 @@
+@@ -820,6 +_,7 @@
aresourcelocation = flag ? SELECTED_BOTTOM_TABS : UNSELECTED_BOTTOM_TABS;
}
+ //PATCH 1.20.2: Deal with custom tab backgrounds, and deal with transparency.
- p_283590_.blitSprite(aresourcelocation[Mth.clamp(i, 0, aresourcelocation.length)], j, k, 26, 32);
+ p_283590_.blitSprite(RenderType::guiTextured, aresourcelocation[Mth.clamp(i, 0, aresourcelocation.length)], j, k, 26, 32);
p_283590_.pose().pushPose();
p_283590_.pose().translate(0.0F, 0.0F, 100.0F);
-@@ -840,6 +_,14 @@
+@@ -861,6 +_,14 @@
}
}
@@ -290,7 +290,7 @@
@OnlyIn(Dist.CLIENT)
static class CustomCreativeSlot extends Slot {
public CustomCreativeSlot(Container p_98633_, int p_98634_, int p_98635_, int p_98636_) {
-@@ -1024,6 +_,22 @@
+@@ -1042,6 +_,22 @@
@Override
public boolean mayPickup(Player p_98665_) {
return this.target.mayPickup(p_98665_);
diff --git a/patches/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/EffectsInInventory.java.patch
similarity index 64%
rename from patches/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch
rename to patches/net/minecraft/client/gui/screens/inventory/EffectsInInventory.java.patch
index e194f8c32fb..c3288a43167 100644
--- a/patches/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/inventory/EffectsInInventory.java.patch
@@ -1,10 +1,10 @@
---- a/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
-+++ b/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
-@@ -47,12 +_,17 @@
+--- a/net/minecraft/client/gui/screens/inventory/EffectsInInventory.java
++++ b/net/minecraft/client/gui/screens/inventory/EffectsInInventory.java
+@@ -48,12 +_,16 @@
Collection collection = this.minecraft.player.getActiveEffects();
if (!collection.isEmpty() && j >= 32) {
boolean flag = j >= 120;
-+ var event = net.neoforged.neoforge.client.ClientHooks.onScreenPotionSize(this, j, !flag, i);
++ var event = net.neoforged.neoforge.client.ClientHooks.onScreenPotionSize(screen, j, !flag, i);
+ if (event.isCanceled()) return;
+ flag = !event.isCompact();
+ i = event.getHorizontalOffset();
@@ -14,41 +14,40 @@
}
- Iterable iterable = Ordering.natural().sortedCopy(collection);
-+
+ Iterable iterable = collection.stream().filter(net.neoforged.neoforge.client.ClientHooks::shouldRenderEffect).sorted().collect(java.util.stream.Collectors.toList());
- this.renderBackgrounds(p_281945_, i, k, iterable, flag);
- this.renderIcons(p_281945_, i, k, iterable, flag);
+ this.renderBackgrounds(p_376884_, i, k, iterable, flag);
+ this.renderIcons(p_376884_, i, k, iterable, flag);
if (flag) {
-@@ -74,6 +_,8 @@
+@@ -75,6 +_,8 @@
this.getEffectName(mobeffectinstance),
MobEffectUtil.formatDuration(mobeffectinstance, 1.0F, this.minecraft.level.tickRateManager().tickrate())
);
+ // Neo: Allow mods to adjust the tooltip shown when hovering a mob effect.
-+ list = net.neoforged.neoforge.client.ClientHooks.getEffectTooltip(this, mobeffectinstance, list);
- p_281945_.renderTooltip(this.font, list, Optional.empty(), p_282601_, p_282335_);
++ list = net.neoforged.neoforge.client.ClientHooks.getEffectTooltip(screen, mobeffectinstance, list);
+ p_376884_.renderTooltip(this.screen.getFont(), list, Optional.empty(), p_376869_, p_376740_);
}
}
-@@ -99,6 +_,11 @@
- int i = this.topPos;
+@@ -100,6 +_,11 @@
+ int i = this.screen.topPos;
- for (MobEffectInstance mobeffectinstance : p_282642_) {
+ for (MobEffectInstance mobeffectinstance : p_376215_) {
+ var renderer = net.neoforged.neoforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
-+ if (renderer.renderInventoryIcon(mobeffectinstance, this, p_282745_, p_282521_ + (p_281536_ ? 6 : 7), i, 0)) {
-+ i += p_282291_;
++ if (renderer.renderInventoryIcon(mobeffectinstance, screen, p_376734_, p_376350_ + (p_376312_ ? 6 : 7), i, 0)) {
++ i += p_376678_;
+ continue;
+ }
Holder holder = mobeffectinstance.getEffect();
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.get(holder);
- p_282745_.blit(p_282521_ + (p_281536_ ? 6 : 7), i + 7, 0, 18, 18, textureatlassprite);
-@@ -110,6 +_,11 @@
- int i = this.topPos;
+ p_376734_.blitSprite(RenderType::guiTextured, textureatlassprite, p_376350_ + (p_376312_ ? 6 : 7), i + 7, 18, 18);
+@@ -111,6 +_,11 @@
+ int i = this.screen.topPos;
- for (MobEffectInstance mobeffectinstance : p_281986_) {
+ for (MobEffectInstance mobeffectinstance : p_376910_) {
+ var renderer = net.neoforged.neoforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
-+ if (renderer.renderInventoryText(mobeffectinstance, this, p_281462_, p_283484_, i, 0)) {
-+ i += p_282057_;
++ if (renderer.renderInventoryText(mobeffectinstance, screen, p_376227_, p_376372_, i, 0)) {
++ i += p_376395_;
+ continue;
+ }
Component component = this.getEffectName(mobeffectinstance);
- p_281462_.drawString(this.font, component, p_283484_ + 10 + 18, i + 6, 16777215);
+ p_376227_.drawString(this.screen.getFont(), component, p_376372_ + 10 + 18, i + 6, 16777215);
Component component1 = MobEffectUtil.formatDuration(mobeffectinstance, 1.0F, this.minecraft.level.tickRateManager().tickrate());
diff --git a/patches/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch
index 9e0e4bfecaa..66f9e706cc5 100644
--- a/patches/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java.patch
@@ -1,18 +1,18 @@
--- a/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java
-@@ -115,7 +_,7 @@
+@@ -113,7 +_,7 @@
int l1 = 86 - this.font.width(s);
FormattedText formattedtext = EnchantmentNames.getInstance().getRandomName(this.font, l1);
int i2 = 6839882;
- if ((k < l + 1 || this.minecraft.player.experienceLevel < k1) && !this.minecraft.player.getAbilities().instabuild) {
+ if (((k < l + 1 || this.minecraft.player.experienceLevel < k1) && !this.minecraft.player.getAbilities().instabuild) || this.menu.enchantClue[l] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels
- RenderSystem.enableBlend();
- p_282430_.blitSprite(ENCHANTMENT_SLOT_DISABLED_SPRITE, i1, j + 14 + 19 * l, 108, 19);
- p_282430_.blitSprite(DISABLED_LEVEL_SPRITES[l], i1 + 1, j + 15 + 19 * l, 16, 16);
-@@ -181,13 +_,16 @@
+ p_282430_.blitSprite(RenderType::guiTextured, ENCHANTMENT_SLOT_DISABLED_SPRITE, i1, j + 14 + 19 * l, 108, 19);
+ p_282430_.blitSprite(RenderType::guiTextured, DISABLED_LEVEL_SPRITES[l], i1 + 1, j + 15 + 19 * l, 16, 16);
+ p_282430_.drawWordWrap(this.font, formattedtext, j1, j + 16 + 19 * l, l1, (i2 & 16711422) >> 1);
+@@ -179,13 +_,16 @@
.registryAccess()
- .registryOrThrow(Registries.ENCHANTMENT)
- .getHolder(this.menu.enchantClue[j]);
+ .lookupOrThrow(Registries.ENCHANTMENT)
+ .get(this.menu.enchantClue[j]);
- if (!optional.isEmpty()) {
+ if (true) {
int l = this.menu.levelClue[j];
diff --git a/patches/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch
index 74155da1f74..0b4bbf6b6e9 100644
--- a/patches/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java
-@@ -15,7 +_,7 @@
+@@ -16,7 +_,7 @@
private static final Vector3f TEXT_SCALE = new Vector3f(1.0F, 1.0F, 1.0F);
private static final int TEXTURE_WIDTH = 16;
private static final int TEXTURE_HEIGHT = 16;
diff --git a/patches/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch b/patches/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch
index bca6c08814f..75ffaa276e3 100644
--- a/patches/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/inventory/MerchantScreen.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/inventory/MerchantScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/MerchantScreen.java
-@@ -236,7 +_,12 @@
+@@ -233,7 +_,12 @@
p_281357_.renderItemDecorations(this.font, p_283466_, p_282403_, p_283601_);
} else {
p_281357_.renderItemDecorations(this.font, p_282046_, p_282403_, p_283601_, p_282046_.getCount() == 1 ? "1" : null);
@@ -9,8 +9,8 @@
+ p_281357_.pose().pushPose();
+ p_281357_.pose().translate(0.0F, 0.0F, 200.0F);
+ String count = p_283466_.getCount() == 1 ? "1" : String.valueOf(p_283466_.getCount());
-+ font.drawInBatch(count, (float) (p_282403_ + 14) + 19 - 2 - font.width(count), (float)p_283601_ + 6 + 3, 0xFFFFFF, true, p_281357_.pose().last().pose(), p_281357_.bufferSource(), net.minecraft.client.gui.Font.DisplayMode.NORMAL, 0, 15728880, false);
++ p_281357_.drawString(font, count, (float) (p_282403_ + 14) + 19 - 2 - font.width(count), (float)p_283601_ + 6 + 3, 0xFFFFFF, true);
+ p_281357_.pose().popPose();
p_281357_.pose().pushPose();
p_281357_.pose().translate(0.0F, 0.0F, 300.0F);
- p_281357_.blitSprite(DISCOUNT_STRIKETHRUOGH_SPRITE, p_282403_ + 7, p_283601_ + 12, 0, 9, 2);
+ p_281357_.blitSprite(RenderType::guiTextured, DISCOUNT_STRIKETHRUOGH_SPRITE, p_282403_ + 7, p_283601_ + 12, 9, 2);
diff --git a/patches/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java.patch b/patches/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java.patch
index 65910b0a9d9..fd3626d82cc 100644
--- a/patches/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java.patch
+++ b/patches/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java.patch
@@ -1,11 +1,15 @@
--- a/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java
+++ b/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java
-@@ -22,6 +_,8 @@
- } else if (p_169951_ instanceof ClientActivePlayersTooltip.ActivePlayersTooltip clientactiveplayerstooltip$activeplayerstooltip) {
- return new ClientActivePlayersTooltip(clientactiveplayerstooltip$activeplayerstooltip);
- } else {
-+ ClientTooltipComponent result = net.neoforged.neoforge.client.gui.ClientTooltipComponentManager.createClientTooltipComponent(p_169951_);
-+ if (result != null) return result;
- throw new IllegalArgumentException("Unknown TooltipComponent");
- }
+@@ -25,7 +_,11 @@
+ case ClientActivePlayersTooltip.ActivePlayersTooltip clientactiveplayerstooltip$activeplayerstooltip -> new ClientActivePlayersTooltip(
+ clientactiveplayerstooltip$activeplayerstooltip
+ );
+- default -> throw new IllegalArgumentException("Unknown TooltipComponent");
++ default -> {
++ ClientTooltipComponent result = net.neoforged.neoforge.client.gui.ClientTooltipComponentManager.createClientTooltipComponent(p_169951_);
++ if (result != null) yield result;
++ throw new IllegalArgumentException("Unknown TooltipComponent");
++ }
+ });
}
+
diff --git a/patches/net/minecraft/client/gui/screens/inventory/tooltip/TooltipRenderUtil.java.patch b/patches/net/minecraft/client/gui/screens/inventory/tooltip/TooltipRenderUtil.java.patch
deleted file mode 100644
index 2a218d1faca..00000000000
--- a/patches/net/minecraft/client/gui/screens/inventory/tooltip/TooltipRenderUtil.java.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- a/net/minecraft/client/gui/screens/inventory/tooltip/TooltipRenderUtil.java
-+++ b/net/minecraft/client/gui/screens/inventory/tooltip/TooltipRenderUtil.java
-@@ -17,16 +_,22 @@
- private static final int BORDER_COLOR_BOTTOM = 1344798847;
-
- public static void renderTooltipBackground(GuiGraphics p_282666_, int p_281901_, int p_281846_, int p_281559_, int p_283336_, int p_283422_) {
-+ renderTooltipBackground(p_282666_, p_281901_, p_281846_, p_281559_, p_283336_, p_283422_, BACKGROUND_COLOR, BACKGROUND_COLOR, BORDER_COLOR_TOP, BORDER_COLOR_BOTTOM);
-+ }
-+
-+ // Forge: Allow specifying colors for the inner border gradient and a gradient instead of a single color for the background and outer border
-+ public static void renderTooltipBackground(GuiGraphics p_282666_, int p_281901_, int p_281846_, int p_281559_, int p_283336_, int p_283422_, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
-+ {
- int i = p_281901_ - 3;
- int j = p_281846_ - 3;
- int k = p_281559_ + 3 + 3;
- int l = p_283336_ + 3 + 3;
-- renderHorizontalLine(p_282666_, i, j - 1, k, p_283422_, -267386864);
-- renderHorizontalLine(p_282666_, i, j + l, k, p_283422_, -267386864);
-- renderRectangle(p_282666_, i, j, k, l, p_283422_, -267386864);
-- renderVerticalLine(p_282666_, i - 1, j, l, p_283422_, -267386864);
-- renderVerticalLine(p_282666_, i + k, j, l, p_283422_, -267386864);
-- renderFrameGradient(p_282666_, i, j + 1, k, l, p_283422_, 1347420415, 1344798847);
-+ renderHorizontalLine(p_282666_, i, j - 1, k, p_283422_, backgroundTop);
-+ renderHorizontalLine(p_282666_, i, j + l, k, p_283422_, backgroundBottom);
-+ renderRectangle(p_282666_, i, j, k, l, p_283422_, backgroundTop, backgroundBottom);
-+ renderVerticalLineGradient(p_282666_, i - 1, j, l, p_283422_, backgroundTop, backgroundBottom);
-+ renderVerticalLineGradient(p_282666_, i + k, j, l, p_283422_, backgroundTop, backgroundBottom);
-+ renderFrameGradient(p_282666_, i, j + 1, k, l, p_283422_, borderTop, borderBottom);
- }
-
- private static void renderFrameGradient(
-@@ -52,7 +_,16 @@
- p_282981_.fill(p_282028_, p_282141_, p_282028_ + p_281771_, p_282141_ + 1, p_282734_, p_281979_);
- }
-
-+ /**
-+ * @deprecated Forge: Use gradient overload instead
-+ */
-+ @Deprecated
- private static void renderRectangle(GuiGraphics p_281392_, int p_282294_, int p_283353_, int p_282640_, int p_281964_, int p_283211_, int p_282349_) {
-- p_281392_.fill(p_282294_, p_283353_, p_282294_ + p_282640_, p_283353_ + p_281964_, p_283211_, p_282349_);
-+ renderRectangle(p_281392_, p_282294_, p_283353_, p_282640_, p_281964_, p_283211_, p_282349_, p_282349_);
-+ }
-+
-+ // Forge: Allow specifying a gradient instead of a single color for the background
-+ private static void renderRectangle(GuiGraphics p_281392_, int p_282294_, int p_283353_, int p_282640_, int p_281964_, int p_283211_, int p_282349_, int colorTo) {
-+ p_281392_.fillGradient(p_282294_, p_283353_, p_282294_ + p_282640_, p_283353_ + p_281964_, p_283211_, p_282349_, colorTo);
- }
- }
diff --git a/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsList.java.patch b/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsList.java.patch
index d0f6315ff6b..789a7732ae6 100644
--- a/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsList.java.patch
+++ b/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsList.java.patch
@@ -3,9 +3,9 @@
@@ -158,6 +_,7 @@
)
.build();
- this.resetButton = Button.builder(RESET_BUTTON_TITLE, p_346334_ -> {
+ this.resetButton = Button.builder(RESET_BUTTON_TITLE, p_359096_ -> {
+ this.key.setToDefault();
- KeyBindsList.this.minecraft.options.setKey(p_345998_, p_345998_.getDefaultKey());
+ p_345998_.setKey(p_345998_.getDefaultKey());
KeyBindsList.this.resetMappingAndUpdateButtons();
}).bounds(0, 0, 50, 20).createNarration(p_344899_ -> Component.translatable("narrator.controls.reset", p_345196_)).build();
@@ -210,7 +_,7 @@
diff --git a/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch b/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch
index 99b5c71de5a..2698680313a 100644
--- a/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/options/controls/KeyBindsScreen.java.patch
@@ -46,13 +46,13 @@
+ if (this.selectedKey != null) {
+ if (p_94715_ == 256) {
+ this.selectedKey.setKeyModifierAndCode(net.neoforged.neoforge.client.settings.KeyModifier.NONE, InputConstants.UNKNOWN);
- this.options.setKey(this.selectedKey, InputConstants.UNKNOWN);
+ this.selectedKey.setKey(InputConstants.UNKNOWN);
+ lastPressedKey = InputConstants.UNKNOWN;
+ lastPressedModifier = InputConstants.UNKNOWN;
+ isLastKeyHeldDown = false;
+ isLastModifierHeldDown = false;
} else {
-- this.options.setKey(this.selectedKey, InputConstants.getKey(p_345810_, p_345447_));
+- this.selectedKey.setKey(InputConstants.getKey(p_345810_, p_345447_));
- }
+ var key = InputConstants.getKey(p_94715_, p_94716_);
+ if (lastPressedKey.equals(key)) {
@@ -67,13 +67,13 @@
+ net.neoforged.neoforge.client.settings.KeyModifier.getKeyModifier(lastPressedModifier),
+ lastPressedKey
+ );
-+ this.options.setKey(this.selectedKey, lastPressedKey);
++ this.selectedKey.setKey(lastPressedKey);
+ } else {
+ this.selectedKey.setKeyModifierAndCode(
+ net.neoforged.neoforge.client.settings.KeyModifier.NONE,
+ lastPressedModifier
+ );
-+ this.options.setKey(this.selectedKey, lastPressedModifier);
++ this.selectedKey.setKey(lastPressedModifier);
+ }
+ lastPressedKey = InputConstants.UNKNOWN;
+ lastPressedModifier = InputConstants.UNKNOWN;
diff --git a/patches/net/minecraft/client/gui/screens/recipebook/GhostSlots.java.patch b/patches/net/minecraft/client/gui/screens/recipebook/GhostSlots.java.patch
new file mode 100644
index 00000000000..126f6d61564
--- /dev/null
+++ b/patches/net/minecraft/client/gui/screens/recipebook/GhostSlots.java.patch
@@ -0,0 +1,11 @@
+--- a/net/minecraft/client/gui/screens/recipebook/GhostSlots.java
++++ b/net/minecraft/client/gui/screens/recipebook/GhostSlots.java
+@@ -69,7 +_,7 @@
+ if (ghostslots$ghostslot != null) {
+ ItemStack itemstack = ghostslots$ghostslot.getItem(this.slotSelectTime.currentIndex());
+ p_363721_.renderComponentTooltip(
+- p_365392_.font, Screen.getTooltipFromItem(p_365392_, itemstack), p_363797_, p_363310_, itemstack.get(DataComponents.TOOLTIP_STYLE)
++ p_365392_.font, Screen.getTooltipFromItem(p_365392_, itemstack), p_363797_, p_363310_, itemstack, itemstack.get(DataComponents.TOOLTIP_STYLE)
+ );
+ }
+ }
diff --git a/patches/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch b/patches/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch
index 0eb3a5d0c17..ce4510d2a82 100644
--- a/patches/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch
+++ b/patches/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java.patch
@@ -1,20 +1,10 @@
--- a/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java
+++ b/net/minecraft/client/gui/screens/recipebook/RecipeBookComponent.java
-@@ -115,7 +_,7 @@
- this.initFilterButtonTextures();
- this.tabButtons.clear();
-
-- for (RecipeBookCategories recipebookcategories : RecipeBookCategories.getCategories(this.menu.getRecipeBookType())) {
-+ for(RecipeBookCategories recipebookcategories : this.menu.getRecipeBookCategories()) {
- this.tabButtons.add(new RecipeBookTabButton(recipebookcategories));
- }
-
-@@ -297,7 +_,7 @@
- }
-
- if (itemstack != null && this.minecraft.screen != null) {
-- p_282776_.renderComponentTooltip(this.minecraft.font, Screen.getTooltipFromItem(this.minecraft, itemstack), p_282948_, p_283050_);
-+ p_282776_.renderComponentTooltip(this.minecraft.font, Screen.getTooltipFromItem(this.minecraft, itemstack), p_282948_, p_283050_, itemstack);
- }
- }
-
+@@ -260,6 +_,7 @@
+
+ for (RecipeBookTabButton recipebooktabbutton : this.tabButtons) {
+ ExtendedRecipeBookCategory extendedrecipebookcategory = recipebooktabbutton.getCategory();
++ // TODO 1.21.2: make this accessible to mods.
+ if (extendedrecipebookcategory instanceof SearchRecipeBookCategory) {
+ recipebooktabbutton.visible = true;
+ recipebooktabbutton.setPosition(i, j + 27 * l++);
diff --git a/patches/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch b/patches/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch
index 1c369de99ad..55fa739634b 100644
--- a/patches/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch
+++ b/patches/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java.patch
@@ -1,25 +1,25 @@
--- a/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
+++ b/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
-@@ -118,6 +_,7 @@
- public static void openFresh(Minecraft p_232897_, @Nullable Screen p_232898_) {
- queueLoadScreen(p_232897_, PREPARING_WORLD_DATA);
- PackRepository packrepository = new PackRepository(new ServerPacksSource(p_232897_.directoryValidator()));
+@@ -169,6 +_,7 @@
+ ) {
+ queueLoadScreen(p_372818_, PREPARING_WORLD_DATA);
+ PackRepository packrepository = new PackRepository(new ServerPacksSource(p_372818_.directoryValidator()));
+ net.neoforged.neoforge.resource.ResourcePackLoader.populatePackRepository(packrepository, net.minecraft.server.packs.PackType.SERVER_DATA, false);
WorldLoader.InitConfig worldloader$initconfig = createDefaultLoadConfig(packrepository, WorldDataConfiguration.DEFAULT);
CompletableFuture completablefuture = WorldLoader.load(
worldloader$initconfig,
-@@ -243,6 +_,10 @@
- WorldCreationContext worldcreationcontext = this.uiState.getSettings();
- LevelSettings levelsettings = this.createLevelSettings(flag);
- WorldData worlddata = new PrimaryLevelData(levelsettings, worldcreationcontext.options(), p_250577_, p_249994_);
-+ if(worlddata.worldGenSettingsLifecycle() != Lifecycle.stable()) {
+@@ -307,6 +_,10 @@
+ SystemToast.onPackCopyFailure(this.minecraft, s);
+ return false;
+ } else {
++ if (p_374211_.worldGenSettingsLifecycle() != Lifecycle.stable()) {
+ // Neo: set experimental settings confirmation flag so user is not shown warning on next open
-+ ((PrimaryLevelData)worlddata).withConfirmedWarning(true);
++ ((PrimaryLevelData)p_374211_).withConfirmedWarning(true);
+ }
this.minecraft
.createWorldOpenFlows()
- .createLevelFromExistingSettings(optional.get(), worldcreationcontext.dataPackResources(), p_249152_, worlddata);
-@@ -428,7 +_,7 @@
+ .createLevelFromExistingSettings(optional.get(), worldcreationcontext.dataPackResources(), p_249152_, p_374211_);
+@@ -491,7 +_,7 @@
if (p_269627_) {
p_270552_.accept(this.uiState.getSettings().dataConfiguration());
} else {
@@ -28,7 +28,7 @@
}
},
Component.translatable("dataPack.validation.failed"),
-@@ -547,6 +_,7 @@
+@@ -605,6 +_,7 @@
if (path != null) {
if (this.tempDataPackRepository == null) {
this.tempDataPackRepository = ServerPacksSource.createPackRepository(path, this.packValidator);
diff --git a/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch b/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch
index d7e34577d48..deb2ee6006c 100644
--- a/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch
+++ b/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java.patch
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldCreationContext.java
-@@ -74,6 +_,10 @@
+@@ -95,6 +_,10 @@
);
}
+ public WorldCreationContext withDataConfiguration(WorldDataConfiguration dataConfiguration) {
-+ return new WorldCreationContext(this.options, this.datapackDimensions, this.selectedDimensions, this.worldgenRegistries, this.dataPackResources, dataConfiguration);
++ return new WorldCreationContext(this.options, this.datapackDimensions, this.selectedDimensions, this.worldgenRegistries, this.dataPackResources, dataConfiguration, this.initialWorldCreationOptions);
+ }
+
public RegistryAccess.Frozen worldgenLoadContext() {
diff --git a/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationUiState.java.patch b/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationUiState.java.patch
index b1747f20d9a..c362174fd41 100644
--- a/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationUiState.java.patch
+++ b/patches/net/minecraft/client/gui/screens/worldselection/WorldCreationUiState.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldCreationUiState.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldCreationUiState.java
-@@ -225,7 +_,7 @@
+@@ -236,7 +_,7 @@
@Nullable
public PresetEditor getPresetEditor() {
Holder holder = this.getWorldType().preset();
diff --git a/patches/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch b/patches/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch
index 9dc24fd5725..37bde45b2d3 100644
--- a/patches/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch
+++ b/patches/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldOpenFlows.java
-@@ -65,7 +_,7 @@
+@@ -66,7 +_,7 @@
import org.slf4j.Logger;
@OnlyIn(Dist.CLIENT)
@@ -9,7 +9,7 @@
private static final Logger LOGGER = LogUtils.getLogger();
private static final UUID WORLD_PACK_ID = UUID.fromString("640a6a92-b6cb-48a0-b391-831586500359");
private final Minecraft minecraft;
-@@ -210,7 +_,10 @@
+@@ -215,7 +_,10 @@
component1 = Component.translatable("selectWorld.backupWarning.customized");
} else {
component = Component.translatable("selectWorld.backupQuestion.experimental");
@@ -21,7 +21,7 @@
}
this.minecraft.setScreen(new BackupConfirmScreen(p_307323_, (p_307085_, p_307086_) -> {
-@@ -377,10 +_,19 @@
+@@ -381,10 +_,19 @@
WorldData worlddata = p_330774_.worldData();
boolean flag = worlddata.worldGenOptions().isOldCustomizedWorld();
boolean flag1 = worlddata.worldGenSettingsLifecycle() != Lifecycle.stable();
diff --git a/patches/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch b/patches/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch
index 93857dce7be..bd2c7fd8b22 100644
--- a/patches/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch
+++ b/patches/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java.patch
@@ -8,15 +8,15 @@
static final Logger LOGGER = LogUtils.getLogger();
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);
-@@ -405,6 +_,7 @@
- RenderSystem.enableBlend();
- p_281612_.blit(this.icon.textureLocation(), p_282820_, p_283181_, 0.0F, 0.0F, 32, 32, 32, 32);
- RenderSystem.disableBlend();
+@@ -403,6 +_,7 @@
+ p_281612_.drawString(this.minecraft.font, s1, p_282820_ + 32 + 3, p_283181_ + 9 + 3, -8355712, false);
+ p_281612_.drawString(this.minecraft.font, component, p_282820_ + 32 + 3, p_283181_ + 9 + 9 + 3, -8355712, false);
+ p_281612_.blit(RenderType::guiTextured, this.icon.textureLocation(), p_282820_, p_283181_, 0.0F, 0.0F, 32, 32, 32, 32);
+ renderExperimentalWarning(p_281612_, p_283204_, p_283025_, p_283181_, p_282820_);
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_;
-@@ -511,6 +_,7 @@
+@@ -509,6 +_,7 @@
this.doDeleteWorld();
}
@@ -24,7 +24,7 @@
this.minecraft.setScreen(this.screen);
},
Component.translatable("selectWorld.deleteQuestion"),
-@@ -647,6 +_,19 @@
+@@ -645,6 +_,19 @@
public String getLevelName() {
return this.summary.getLevelName();
@@ -34,7 +34,7 @@
+ private void renderExperimentalWarning(GuiGraphics guiGraphics, int mouseX, int mouseY, int top, int left) {
+ if (this.summary.getSettings() != null && this.summary.getSettings().getLifecycle().equals(com.mojang.serialization.Lifecycle.experimental())) {
+ int leftStart = left + WorldSelectionList.this.getRowWidth();
-+ guiGraphics.blit(WorldSelectionList.FORGE_EXPERIMENTAL_WARNING_ICON, leftStart - 36, top, 0.0F, 0.0F, 32, 32, 32, 32);
++ guiGraphics.blit(RenderType::guiTextured, WorldSelectionList.FORGE_EXPERIMENTAL_WARNING_ICON, leftStart - 36, top, 0.0F, 0.0F, 32, 32, 32, 32);
+ if (WorldSelectionList.this.getEntryAtPosition(mouseX, mouseY) == this && mouseX > leftStart - 36 && mouseX < leftStart) {
+ var font = Minecraft.getInstance().font;
+ List tooltip = font.split(Component.translatable("neoforge.experimentalsettings.tooltip"), 200);
diff --git a/patches/net/minecraft/client/main/Main.java.patch b/patches/net/minecraft/client/main/Main.java.patch
index 4f5d0f090ea..c66fe4ba491 100644
--- a/patches/net/minecraft/client/main/Main.java.patch
+++ b/patches/net/minecraft/client/main/Main.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/main/Main.java
+++ b/net/minecraft/client/main/Main.java
-@@ -111,7 +_,7 @@
+@@ -120,7 +_,7 @@
CrashReport.preload();
logger = LogUtils.getLogger();
s1 = "Bootstrap";
diff --git a/patches/net/minecraft/client/model/HumanoidModel.java.patch b/patches/net/minecraft/client/model/HumanoidModel.java.patch
index b067ead7deb..5d2e521e415 100644
--- a/patches/net/minecraft/client/model/HumanoidModel.java.patch
+++ b/patches/net/minecraft/client/model/HumanoidModel.java.patch
@@ -1,24 +1,24 @@
--- a/net/minecraft/client/model/HumanoidModel.java
+++ b/net/minecraft/client/model/HumanoidModel.java
-@@ -306,6 +_,8 @@
+@@ -257,6 +_,8 @@
case BRUSH:
this.rightArm.xRot = this.rightArm.xRot * 0.5F - (float) (Math.PI / 5);
this.rightArm.yRot = 0.0F;
+ default:
-+ this.rightArmPose.applyTransform(this, p_102876_, net.minecraft.world.entity.HumanoidArm.RIGHT);
++ p_362238_.applyTransform(this, p_364666_, net.minecraft.world.entity.HumanoidArm.RIGHT);
}
}
-@@ -348,6 +_,8 @@
+@@ -299,6 +_,8 @@
case BRUSH:
this.leftArm.xRot = this.leftArm.xRot * 0.5F - (float) (Math.PI / 5);
this.leftArm.yRot = 0.0F;
+ default:
-+ this.leftArmPose.applyTransform(this, p_102879_, net.minecraft.world.entity.HumanoidArm.LEFT);
++ p_361463_.applyTransform(this, p_361741_, net.minecraft.world.entity.HumanoidArm.LEFT);
}
}
-@@ -446,7 +_,7 @@
+@@ -376,7 +_,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -27,7 +27,7 @@
EMPTY(false),
ITEM(false),
BLOCK(false),
-@@ -459,13 +_,31 @@
+@@ -389,13 +_,31 @@
BRUSH(false);
private final boolean twoHanded;
@@ -50,7 +50,7 @@
return this.twoHanded;
+ }
+
-+ public void applyTransform(HumanoidModel model, T entity, net.minecraft.world.entity.HumanoidArm arm) {
++ public void applyTransform(HumanoidModel model, T entity, net.minecraft.world.entity.HumanoidArm arm) {
+ if (this.forgeArmPose != null) this.forgeArmPose.applyTransform(model, entity, arm);
+ }
+
diff --git a/patches/net/minecraft/client/model/HierarchicalModel.java.patch b/patches/net/minecraft/client/model/Model.java.patch
similarity index 52%
rename from patches/net/minecraft/client/model/HierarchicalModel.java.patch
rename to patches/net/minecraft/client/model/Model.java.patch
index b9e5a58ff6d..8dfabd26218 100644
--- a/patches/net/minecraft/client/model/HierarchicalModel.java.patch
+++ b/patches/net/minecraft/client/model/Model.java.patch
@@ -1,48 +1,51 @@
---- a/net/minecraft/client/model/HierarchicalModel.java
-+++ b/net/minecraft/client/model/HierarchicalModel.java
-@@ -27,6 +_,10 @@
- super(p_170623_);
+--- a/net/minecraft/client/model/Model.java
++++ b/net/minecraft/client/model/Model.java
+@@ -28,6 +_,10 @@
+ this.allParts = p_368583_.getAllParts().toList();
}
+ protected static net.neoforged.neoforge.client.entity.animation.json.AnimationHolder getAnimation(ResourceLocation key) {
+ return net.neoforged.neoforge.client.entity.animation.json.AnimationLoader.INSTANCE.getAnimationHolder(key);
+ }
+
- @Override
- public void renderToBuffer(PoseStack p_170625_, VertexConsumer p_170626_, int p_170627_, int p_170628_, int p_350603_) {
- this.root().render(p_170625_, p_170626_, p_170627_, p_170628_, p_350603_);
-@@ -44,18 +_,34 @@
- this.animate(p_233382_, p_233383_, p_233384_, 1.0F);
+ public final RenderType renderType(ResourceLocation p_103120_) {
+ return this.renderType.apply(p_103120_);
+ }
+@@ -64,12 +_,20 @@
+ this.animate(p_364820_, p_361968_, p_362503_, 1.0F);
}
+ protected void animate(AnimationState animationState, net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation, float ageInTicks) {
+ this.animate(animationState, animation.get(), ageInTicks);
+ }
+
- protected void animateWalk(AnimationDefinition p_268159_, float p_268057_, float p_268347_, float p_268138_, float p_268165_) {
- long i = (long)(p_268057_ * 50.0F * p_268138_);
- float f = Math.min(p_268347_ * p_268165_, 1.0F);
- KeyframeAnimations.animate(this, p_268159_, i, f, ANIMATION_VECTOR_CACHE);
+ protected void animateWalk(AnimationDefinition p_362453_, float p_365353_, float p_364840_, float p_362983_, float p_361956_) {
+ long i = (long)(p_365353_ * 50.0F * p_362983_);
+ float f = Math.min(p_364840_ * p_361956_, 1.0F);
+ KeyframeAnimations.animate(this, p_362453_, i, f, ANIMATION_VECTOR_CACHE);
}
+ protected void animateWalk(net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation, float limbSwing, float limbSwingAmount, float maxAnimationSpeed, float animationScaleFactor) {
+ this.animateWalk(animation.get(), limbSwing, limbSwingAmount, maxAnimationSpeed, animationScaleFactor);
+ }
+
- protected void animate(AnimationState p_233386_, AnimationDefinition p_233387_, float p_233388_, float p_233389_) {
- p_233386_.updateTime(p_233388_, p_233389_);
- p_233386_.ifStarted(p_233392_ -> KeyframeAnimations.animate(this, p_233387_, p_233392_.getAccumulatedTime(), 1.0F, ANIMATION_VECTOR_CACHE));
+ protected void animate(AnimationState p_364413_, AnimationDefinition p_361459_, float p_361947_, float p_362164_) {
+ p_364413_.ifStarted(
+ p_361743_ -> KeyframeAnimations.animate(
+@@ -78,8 +_,16 @@
+ );
}
+ protected void animate(AnimationState animationState, net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation, float ageInTicks, float speed) {
+ this.animate(animationState, animation.get(), ageInTicks, speed);
+ }
+
- protected void applyStatic(AnimationDefinition p_288996_) {
- KeyframeAnimations.animate(this, p_288996_, 0L, 1.0F, ANIMATION_VECTOR_CACHE);
+ protected void applyStatic(AnimationDefinition p_362055_) {
+ KeyframeAnimations.animate(this, p_362055_, 0L, 1.0F, ANIMATION_VECTOR_CACHE);
+ }
+
+ protected void applyStatic(net.neoforged.neoforge.client.entity.animation.json.AnimationHolder animation) {
+ this.applyStatic(animation.get());
}
- }
+
+ @OnlyIn(Dist.CLIENT)
diff --git a/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch b/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch
index 2bb68d95841..de5171aeea9 100644
--- a/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch
+++ b/patches/net/minecraft/client/model/geom/LayerDefinitions.java.patch
@@ -1,18 +1,9 @@
--- a/net/minecraft/client/model/geom/LayerDefinitions.java
+++ b/net/minecraft/client/model/geom/LayerDefinitions.java
-@@ -316,7 +_,7 @@
- LayerDefinition layerdefinition22 = ChestRaftModel.createBodyModel();
-
- for (Boat.Type boat$type : Boat.Type.values()) {
-- if (boat$type == Boat.Type.BAMBOO) {
-+ if (boat$type.isRaft()) {
- builder.put(ModelLayers.createBoatModelName(boat$type), layerdefinition21);
- builder.put(ModelLayers.createChestBoatModelName(boat$type), layerdefinition22);
- } else {
-@@ -329,6 +_,7 @@
- WoodType.values().forEach(p_171114_ -> builder.put(ModelLayers.createSignModelName(p_171114_), layerdefinition23));
- LayerDefinition layerdefinition24 = HangingSignRenderer.createHangingSignLayer();
- WoodType.values().forEach(p_247864_ -> builder.put(ModelLayers.createHangingSignModelName(p_247864_), layerdefinition24));
+@@ -454,6 +_,7 @@
+ builder.put(ModelLayers.createWallSignModelName(p_359128_), layerdefinition54);
+ builder.put(ModelLayers.createHangingSignModelName(p_359128_), layerdefinition55);
+ });
+ net.neoforged.neoforge.client.ClientHooks.loadLayerDefinitions(builder);
ImmutableMap immutablemap = builder.build();
List list = ModelLayers.getKnownLocations().filter(p_171117_ -> !immutablemap.containsKey(p_171117_)).collect(Collectors.toList());
diff --git a/patches/net/minecraft/client/model/geom/ModelLayers.java.patch b/patches/net/minecraft/client/model/geom/ModelLayers.java.patch
index cbb66bf895c..9b9691073ae 100644
--- a/patches/net/minecraft/client/model/geom/ModelLayers.java.patch
+++ b/patches/net/minecraft/client/model/geom/ModelLayers.java.patch
@@ -1,36 +1,18 @@
--- a/net/minecraft/client/model/geom/ModelLayers.java
+++ b/net/minecraft/client/model/geom/ModelLayers.java
-@@ -213,27 +_,33 @@
+@@ -301,15 +_,18 @@
}
- public static ModelLayerLocation createRaftModelName(Boat.Type p_252002_) {
-- return createLocation("raft/" + p_252002_.getName(), "main");
-+ ResourceLocation location = ResourceLocation.parse(p_252002_.getName());
-+ return new ModelLayerLocation(location.withPrefix("raft/"), "main");
- }
-
- public static ModelLayerLocation createChestRaftModelName(Boat.Type p_248520_) {
-- return createLocation("chest_raft/" + p_248520_.getName(), "main");
-+ ResourceLocation location = ResourceLocation.parse(p_248520_.getName());
-+ return new ModelLayerLocation(location.withPrefix("chest_raft/"), "main");
- }
-
- public static ModelLayerLocation createBoatModelName(Boat.Type p_171290_) {
-- return createLocation("boat/" + p_171290_.getName(), "main");
-+ ResourceLocation location = ResourceLocation.parse(p_171290_.getName());
-+ return new ModelLayerLocation(location.withPrefix("boat/"), "main");
- }
-
- public static ModelLayerLocation createChestBoatModelName(Boat.Type p_233551_) {
-- return createLocation("chest_boat/" + p_233551_.getName(), "main");
-+ ResourceLocation location = ResourceLocation.parse(p_233551_.getName());
-+ return new ModelLayerLocation(location.withPrefix("chest_boat/"), "main");
+ public static ModelLayerLocation createStandingSignModelName(WoodType p_171292_) {
+- return createLocation("sign/standing/" + p_171292_.name(), "main");
++ ResourceLocation location = ResourceLocation.parse(p_171292_.name());
++ return new ModelLayerLocation(location.withPrefix("sign/standing/"), "main");
}
- public static ModelLayerLocation createSignModelName(WoodType p_171292_) {
-- return createLocation("sign/" + p_171292_.name(), "main");
-+ ResourceLocation location = ResourceLocation.parse(p_171292_.name());
-+ return new ModelLayerLocation(location.withPrefix("sign/"), "main");
+ public static ModelLayerLocation createWallSignModelName(WoodType p_360963_) {
+- return createLocation("sign/wall/" + p_360963_.name(), "main");
++ ResourceLocation location = ResourceLocation.parse(p_360963_.name());
++ return new ModelLayerLocation(location.withPrefix("sign/wall/"), "main");
}
public static ModelLayerLocation createHangingSignModelName(WoodType p_252225_) {
diff --git a/patches/net/minecraft/client/multiplayer/ClientChunkCache.java.patch b/patches/net/minecraft/client/multiplayer/ClientChunkCache.java.patch
index 8729039cea9..768dd4d9eb5 100644
--- a/patches/net/minecraft/client/multiplayer/ClientChunkCache.java.patch
+++ b/patches/net/minecraft/client/multiplayer/ClientChunkCache.java.patch
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/multiplayer/ClientChunkCache.java
+++ b/net/minecraft/client/multiplayer/ClientChunkCache.java
-@@ -63,6 +_,7 @@
+@@ -65,6 +_,7 @@
int i = this.storage.getIndex(p_295783_.x, p_295783_.z);
LevelChunk levelchunk = this.storage.getChunk(i);
if (isValidChunk(levelchunk, p_295783_.x, p_295783_.z)) {
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.level.ChunkEvent.Unload(levelchunk));
- this.storage.replace(i, levelchunk, null);
+ this.storage.drop(i, levelchunk);
}
}
-@@ -123,6 +_,7 @@
+@@ -125,6 +_,7 @@
}
this.level.onChunkLoaded(chunkpos);
diff --git a/patches/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch b/patches/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch
index 8bc8fe4f9ce..139a7c08923 100644
--- a/patches/net/minecraft/client/multiplayer/ClientCommonPacketListenerImpl.java.patch
+++ b/patches/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
-@@ -88,6 +_,10 @@
+@@ -84,6 +_,10 @@
protected final Map serverCookies;
protected Map customReportDetails;
protected ServerLinks serverLinks;
@@ -11,8 +11,8 @@
protected ClientCommonPacketListenerImpl(Minecraft p_295454_, Connection p_294773_, CommonListenerCookie p_294647_) {
this.minecraft = p_295454_;
-@@ -100,6 +_,8 @@
- this.strictErrorHandling = p_294647_.strictErrorHandling();
+@@ -95,6 +_,8 @@
+ this.serverCookies = p_294647_.serverCookies();
this.customReportDetails = p_294647_.customReportDetails();
this.serverLinks = p_294647_.serverLinks();
+ // Neo: Set the connection type based on the cookie from the previous phase.
@@ -20,7 +20,7 @@
}
@Override
-@@ -149,6 +_,33 @@
+@@ -143,6 +_,33 @@
@Override
public void handleCustomPayload(ClientboundCustomPayloadPacket p_295727_) {
@@ -54,7 +54,7 @@
CustomPacketPayload custompacketpayload = p_295727_.payload();
if (!(custompacketpayload instanceof DiscardedPayload)) {
PacketUtils.ensureRunningOnSameThread(p_295727_, this, this.minecraft);
-@@ -285,6 +_,8 @@
+@@ -279,6 +_,8 @@
}
public void send(Packet> p_295097_) {
@@ -63,7 +63,7 @@
this.connection.send(p_295097_);
}
-@@ -292,6 +_,9 @@
+@@ -286,6 +_,9 @@
public void onDisconnect(DisconnectionDetails p_350760_) {
this.telemetryManager.onDisconnect();
this.minecraft.disconnect(this.createDisconnectScreen(p_350760_), this.isTransferring);
@@ -73,7 +73,7 @@
LOGGER.warn("Client disconnected with reason: {}", p_350760_.reason().getString());
}
-@@ -415,5 +_,10 @@
+@@ -410,5 +_,10 @@
@OnlyIn(Dist.CLIENT)
static record PendingRequest(UUID id, URL url, String hash) {
}
diff --git a/patches/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch b/patches/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch
index 5f8469c35da..d26216aa13c 100644
--- a/patches/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch
+++ b/patches/net/minecraft/client/multiplayer/ClientConfigurationPacketListenerImpl.java.patch
@@ -31,9 +31,9 @@
new ClientPacketListener(
this.minecraft,
this.connection,
-@@ -137,12 +_,19 @@
+@@ -136,12 +_,19 @@
+ this.serverCookies,
this.chatState,
- this.strictErrorHandling,
this.customReportDetails,
- this.serverLinks
+ this.serverLinks,
@@ -53,7 +53,7 @@
}
@Override
-@@ -154,5 +_,51 @@
+@@ -153,5 +_,51 @@
public void onDisconnect(DisconnectionDetails p_351005_) {
super.onDisconnect(p_351005_);
this.minecraft.clearDownloadedResourcePacks();
diff --git a/patches/net/minecraft/client/multiplayer/ClientLevel.java.patch b/patches/net/minecraft/client/multiplayer/ClientLevel.java.patch
index e3eabb22b74..a1d3332be35 100644
--- a/patches/net/minecraft/client/multiplayer/ClientLevel.java.patch
+++ b/patches/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
-@@ -121,6 +_,7 @@
+@@ -126,6 +_,7 @@
p_194170_.put(
BiomeColors.WATER_COLOR_RESOLVER, new BlockTintCache(p_194168_ -> this.calculateBlockTint(p_194168_, BiomeColors.WATER_COLOR_RESOLVER))
);
@@ -8,16 +8,16 @@
}
);
private final ClientChunkCache chunkSource;
-@@ -128,6 +_,8 @@
- private int serverSimulationDistance;
- private final BlockStatePredictionHandler blockStatePredictionHandler = new BlockStatePredictionHandler();
+@@ -135,6 +_,8 @@
+ private final int seaLevel;
+ private boolean tickDayTime;
private static final Set- MARKER_PARTICLE_ITEMS = Set.of(Items.BARRIER, Items.LIGHT);
+ private final it.unimi.dsi.fastutil.ints.Int2ObjectMap> partEntities = new it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<>();
+ private final net.neoforged.neoforge.client.model.data.ModelDataManager modelDataManager = new net.neoforged.neoforge.client.model.data.ModelDataManager(this);
public void handleBlockChangedAck(int p_233652_) {
this.blockStatePredictionHandler.endPredictionsUpTo(p_233652_, this);
-@@ -157,10 +_,15 @@
+@@ -164,10 +_,15 @@
@Override
public boolean setBlock(BlockPos p_233643_, BlockState p_233644_, int p_233645_, int p_233646_) {
if (this.blockStatePredictionHandler.isPredicting()) {
@@ -33,37 +33,37 @@
}
return flag;
-@@ -192,6 +_,7 @@
- this.serverSimulationDistance = p_205510_;
+@@ -201,6 +_,7 @@
+ this.serverSimulationDistance = p_363776_;
this.updateSkyBrightness();
this.prepareWeather();
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.level.LevelEvent.Load(this));
}
public void queueLightUpdate(Runnable p_194172_) {
-@@ -238,7 +_,7 @@
+@@ -244,7 +_,7 @@
private void tickTime() {
- this.setGameTime(this.levelData.getGameTime() + 1L);
- if (this.levelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
-- this.setDayTime(this.levelData.getDayTime() + 1L);
-+ this.setDayTime(this.levelData.getDayTime() + advanceDaytime());
+ this.clientLevelData.setGameTime(this.clientLevelData.getGameTime() + 1L);
+ if (this.tickDayTime) {
+- this.clientLevelData.setDayTime(this.clientLevelData.getDayTime() + 1L);
++ this.clientLevelData.setDayTime(this.clientLevelData.getDayTime() + advanceDaytime());
}
}
-@@ -282,7 +_,11 @@
+@@ -283,7 +_,11 @@
p_104640_.setOldPosAndRot();
p_104640_.tickCount++;
- this.getProfiler().push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(p_104640_.getType()).toString());
+ Profiler.get().push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(p_104640_.getType()).toString());
- p_104640_.tick();
+ // Neo: Permit cancellation of Entity#tick via EntityTickEvent.Pre
+ if (!net.neoforged.neoforge.event.EventHooks.fireEntityTickPre(p_104640_).isCanceled()) {
+ p_104640_.tick();
+ net.neoforged.neoforge.event.EventHooks.fireEntityTickPost(p_104640_);
+ }
- this.getProfiler().pop();
+ Profiler.get().pop();
for (Entity entity : p_104640_.getPassengers()) {
-@@ -330,8 +_,10 @@
+@@ -335,8 +_,10 @@
}
public void addEntity(Entity p_104741_) {
@@ -74,7 +74,7 @@
}
public void removeEntity(int p_171643_, Entity.RemovalReason p_171644_) {
-@@ -502,6 +_,13 @@
+@@ -507,6 +_,13 @@
float p_263349_,
long p_263408_
) {
@@ -88,7 +88,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_);
}
-@@ -511,6 +_,12 @@
+@@ -516,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_
) {
@@ -101,7 +101,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_));
}
-@@ -1033,6 +_,7 @@
+@@ -1045,6 +_,7 @@
}
public void setDifficulty(Difficulty p_104852_) {
@@ -109,7 +109,7 @@
this.difficulty = p_104852_;
}
-@@ -1069,14 +_,75 @@
+@@ -1081,14 +_,75 @@
if (p_171712_ instanceof AbstractClientPlayer) {
ClientLevel.this.players.add((AbstractClientPlayer)p_171712_);
}
diff --git a/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch b/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch
index c244326521d..a1ad4df3f62 100644
--- a/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch
+++ b/patches/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
-@@ -344,6 +_,7 @@
+@@ -367,6 +_,7 @@
private final ChunkBatchSizeCalculator chunkBatchSizeCalculator = new ChunkBatchSizeCalculator();
private final PingDebugMonitor pingDebugMonitor;
private final DebugSampleSubscriber debugSampleSubscriber;
@@ -8,17 +8,17 @@
@Nullable
private LevelLoadStatusManager levelLoadStatusManager;
private boolean serverEnforcesSecureChat;
-@@ -366,7 +_,8 @@
+@@ -388,7 +_,8 @@
p_253924_.gui.getChat().restoreState(p_295121_.chatState());
}
- this.potionBrewing = PotionBrewing.bootstrap(this.enabledFeatures);
+ this.connectionType = p_295121_.connectionType();
+ this.potionBrewing = PotionBrewing.bootstrap(this.enabledFeatures, this.registryAccess);
+ this.fuelValues = FuelValues.vanillaBurnTimes(p_295121_.receivedRegistries(), this.enabledFeatures);
}
- public ClientSuggestionProvider getSuggestionsProvider() {
-@@ -427,12 +_,13 @@
+@@ -451,12 +_,13 @@
this.minecraft.debugRenderer.clear();
this.minecraft.player.resetPos();
@@ -33,9 +33,9 @@
this.minecraft.player.setReducedDebugInfo(p_105030_.reducedDebugInfo());
this.minecraft.player.setShowDeathScreen(p_105030_.showDeathScreen());
this.minecraft.player.setDoLimitedCrafting(p_105030_.doLimitedCrafting());
-@@ -828,7 +_,8 @@
+@@ -900,7 +_,8 @@
+ this.serverCookies,
chatcomponent$state,
- this.strictErrorHandling,
this.customReportDetails,
- this.serverLinks
+ this.serverLinks,
@@ -43,7 +43,7 @@
)
)
);
-@@ -1142,7 +_,7 @@
+@@ -1217,7 +_,7 @@
localplayer1 = this.minecraft.gameMode.createPlayer(this.level, localplayer.getStats(), localplayer.getRecipeBook());
}
@@ -52,15 +52,15 @@
localplayer1.setId(localplayer.getId());
this.minecraft.player = localplayer1;
if (flag) {
-@@ -1164,6 +_,7 @@
+@@ -1245,6 +_,7 @@
+ localplayer1.getAttributes().assignBaseValues(localplayer.getAttributes());
}
- localplayer1.resetPos();
+ net.neoforged.neoforge.client.ClientHooks.firePlayerRespawn(this.minecraft.gameMode, localplayer, localplayer1, localplayer1.connection.connection);
this.level.addEntity(localplayer1);
- localplayer1.setYRot(-180.0F);
localplayer1.input = new KeyboardInput(this.minecraft.options);
-@@ -1306,10 +_,7 @@
+ this.minecraft.gameMode.adjustPlayer(localplayer1);
+@@ -1391,10 +_,7 @@
PacketUtils.ensureRunningOnSameThread(p_104976_, this, this.minecraft);
BlockPos blockpos = p_104976_.getPos();
this.minecraft.level.getBlockEntity(blockpos, p_104976_.getType()).ifPresent(p_337415_ -> {
@@ -72,7 +72,7 @@
if (p_337415_ instanceof CommandBlockEntity && this.minecraft.screen instanceof CommandBlockEditScreen) {
((CommandBlockEditScreen)this.minecraft.screen).updateGui();
-@@ -1420,9 +_,15 @@
+@@ -1505,9 +_,15 @@
}
}
@@ -89,7 +89,7 @@
}
@Override
-@@ -1471,7 +_,9 @@
+@@ -1555,7 +_,9 @@
@Override
public void handleCommands(ClientboundCommandsPacket p_104990_) {
PacketUtils.ensureRunningOnSameThread(p_104990_, this, this.minecraft);
@@ -100,28 +100,33 @@
}
@Override
-@@ -1493,6 +_,7 @@
- ClientRecipeBook clientrecipebook = this.minecraft.player.getRecipeBook();
- clientrecipebook.setupCollections(this.recipeManager.getOrderedRecipes(), this.minecraft.level.registryAccess());
- this.searchTrees.updateRecipes(clientrecipebook, this.registryAccess);
-+ net.neoforged.neoforge.client.ClientHooks.onRecipesUpdated(this.recipeManager);
+@@ -1574,6 +_,11 @@
+ public void handleUpdateRecipes(ClientboundUpdateRecipesPacket p_105132_) {
+ PacketUtils.ensureRunningOnSameThread(p_105132_, this, this.minecraft);
+ this.recipes = new ClientRecipeContainer(p_105132_.itemSets(), p_105132_.stonecutterRecipes());
++
++ // Neo: abuse recipe sync to overwrite fuel values with datamap values after their sync (tag update doesn't fire on initial sync and the constructor is too early)
++ if (this.connectionType.isNeoForge()) {
++ this.fuelValues = net.neoforged.neoforge.common.DataMapHooks.populateFuelValues(this.registryAccess, this.enabledFeatures);
++ }
}
@Override
-@@ -1595,8 +_,10 @@
- TagCollector tagcollector = new TagCollector();
- p_294888_.getTags().forEach(tagcollector::append);
- tagcollector.updateTags(this.registryAccess, this.connection.isMemoryConnection());
-- List list = List.copyOf(CreativeModeTabs.searchTab().getDisplayItems());
-- this.searchTrees.updateCreativeTags(list);
+@@ -1698,8 +_,11 @@
+ });
+ list.forEach(Registry.PendingTags::apply);
+ this.fuelValues = FuelValues.vanillaBurnTimes(this.registryAccess, this.enabledFeatures);
+- List list1 = List.copyOf(CreativeModeTabs.searchTab().getDisplayItems());
+- this.searchTrees.updateCreativeTags(list1);
++ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.TagsUpdatedEvent(this.registryAccess, true, flag));
+ CreativeModeTabs.allTabs().stream().filter(net.minecraft.world.item.CreativeModeTab::hasSearchBar).forEach(tab -> {
-+ List list = List.copyOf(tab.getDisplayItems());
-+ this.searchTrees.updateCreativeTags(list, net.neoforged.neoforge.client.CreativeModeTabSearchRegistry.getTagSearchKey(tab));
++ List stacks = List.copyOf(tab.getDisplayItems());
++ this.searchTrees.updateCreativeTags(stacks, net.neoforged.neoforge.client.CreativeModeTabSearchRegistry.getTagSearchKey(tab));
+ });
}
@Override
-@@ -2407,6 +_,8 @@
+@@ -2526,6 +_,8 @@
}
public void sendChat(String p_249888_) {
@@ -130,7 +135,7 @@
Instant instant = Instant.now();
long i = Crypt.SaltSupplier.getLong();
LastSeenMessagesTracker.Update lastseenmessagestracker$update = this.lastSeenMessages.generateAndApplyUpdate();
-@@ -2416,6 +_,7 @@
+@@ -2535,6 +_,7 @@
}
public void sendCommand(String p_250092_) {
@@ -138,7 +143,7 @@
SignableCommand signablecommand = SignableCommand.of(this.parseCommand(p_250092_));
if (signablecommand.arguments().isEmpty()) {
this.send(new ServerboundChatCommandPacket(p_250092_));
-@@ -2490,6 +_,10 @@
+@@ -2622,6 +_,10 @@
public Scoreboard scoreboard() {
return this.scoreboard;
diff --git a/patches/net/minecraft/client/multiplayer/CommonListenerCookie.java.patch b/patches/net/minecraft/client/multiplayer/CommonListenerCookie.java.patch
index 40db5789aed..da0f788ed2f 100644
--- a/patches/net/minecraft/client/multiplayer/CommonListenerCookie.java.patch
+++ b/patches/net/minecraft/client/multiplayer/CommonListenerCookie.java.patch
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/multiplayer/CommonListenerCookie.java
+++ b/net/minecraft/client/multiplayer/CommonListenerCookie.java
-@@ -26,6 +_,28 @@
+@@ -25,6 +_,27 @@
+ Map serverCookies,
@Nullable ChatComponent.State chatState,
- @Deprecated(forRemoval = true) boolean strictErrorHandling,
Map customReportDetails,
- ServerLinks serverLinks
+ ServerLinks serverLinks,
+ net.neoforged.neoforge.network.connection.ConnectionType connectionType
) {
+ /**
-+ * @deprecated Use {@link #CommonListenerCookie(GameProfile, WorldSessionTelemetryManager, RegistryAccess.Frozen, FeatureFlagSet, String, ServerData, Screen, Map, ChatComponent.State, boolean, Map, ServerLinks, net.neoforged.neoforge.network.connection.ConnectionType)}
++ * @deprecated Use {@link #CommonListenerCookie(GameProfile, WorldSessionTelemetryManager, RegistryAccess.Frozen, FeatureFlagSet, String, ServerData, Screen, Map, ChatComponent.State, Map, ServerLinks, net.neoforged.neoforge.network.connection.ConnectionType)}
+ * instead,to indicate whether the connection is modded.
+ */
+ @Deprecated
@@ -23,10 +23,9 @@
+ @Nullable Screen postDisconnectScreen,
+ Map serverCookies,
+ @Nullable ChatComponent.State chatState,
-+ @Deprecated(forRemoval = true) boolean strictErrorHandling,
+ Map customReportDetails,
+ ServerLinks serverLinks
+ ) {
-+ this(localGameProfile, telemetryManager, receivedRegistries, enabledFeatures, serverBrand, serverData, postDisconnectScreen, serverCookies, chatState, strictErrorHandling, customReportDetails, serverLinks, net.neoforged.neoforge.network.connection.ConnectionType.OTHER);
++ this(localGameProfile, telemetryManager, receivedRegistries, enabledFeatures, serverBrand, serverData, postDisconnectScreen, serverCookies, chatState, customReportDetails, serverLinks, net.neoforged.neoforge.network.connection.ConnectionType.OTHER);
+ }
}
diff --git a/patches/net/minecraft/client/multiplayer/MultiPlayerGameMode.java.patch b/patches/net/minecraft/client/multiplayer/MultiPlayerGameMode.java.patch
index 40bda7642f1..4a88a77d668 100644
--- a/patches/net/minecraft/client/multiplayer/MultiPlayerGameMode.java.patch
+++ b/patches/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
-@@ -119,11 +_,12 @@
+@@ -120,11 +_,12 @@
} else if (blockstate.isAir()) {
return false;
} else {
@@ -15,7 +15,7 @@
}
return flag;
-@@ -142,6 +_,7 @@
+@@ -143,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_ -> {
@@ -23,7 +23,7 @@
this.destroyBlock(p_105270_);
return new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, p_105270_, p_105271_, p_233757_);
});
-@@ -151,15 +_,19 @@
+@@ -152,15 +_,19 @@
this.connection
.send(new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, this.destroyBlockPos, p_105271_));
}
@@ -43,7 +43,7 @@
if (flag && blockstate1.getDestroyProgress(this.minecraft.player, this.minecraft.player.level(), p_105270_) >= 1.0F) {
this.destroyBlock(p_105270_);
} else {
-@@ -171,7 +_,7 @@
+@@ -172,7 +_,7 @@
this.minecraft.level.destroyBlockProgress(this.minecraft.player.getId(), this.destroyBlockPos, this.getDestroyStage());
}
@@ -52,7 +52,7 @@
});
}
-@@ -202,6 +_,7 @@
+@@ -203,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_ -> {
@@ -60,7 +60,7 @@
this.destroyBlock(p_105284_);
return new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, p_105284_, p_105285_, p_233753_);
});
-@@ -214,7 +_,7 @@
+@@ -215,7 +_,7 @@
} else {
this.destroyProgress = this.destroyProgress + blockstate.getDestroyProgress(this.minecraft.player, this.minecraft.player.level(), p_105284_);
if (this.destroyTicks % 4.0F == 0.0F) {
@@ -69,7 +69,7 @@
this.minecraft
.getSoundManager()
.play(
-@@ -231,6 +_,7 @@
+@@ -232,6 +_,7 @@
this.destroyTicks++;
this.minecraft.getTutorial().onDestroyBlock(this.minecraft.level, p_105284_, blockstate, Mth.clamp(this.destroyProgress, 0.0F, 1.0F));
@@ -77,7 +77,7 @@
if (this.destroyProgress >= 1.0F) {
this.isDestroying = false;
this.startPrediction(this.minecraft.level, p_233739_ -> {
-@@ -269,7 +_,7 @@
+@@ -270,7 +_,7 @@
private boolean sameDestroyTarget(BlockPos p_105282_) {
ItemStack itemstack = this.minecraft.player.getMainHandItem();
@@ -86,7 +86,7 @@
}
private void ensureHasSentCarriedItem() {
-@@ -297,12 +_,23 @@
+@@ -298,12 +_,23 @@
private InteractionResult performUseItemOn(LocalPlayer p_233747_, InteractionHand p_233748_, BlockHitResult p_233749_) {
BlockPos blockpos = p_233749_.getBlockPos();
ItemStack itemstack = p_233747_.getItemInHand(p_233748_);
@@ -95,7 +95,7 @@
+ return event.getCancellationResult();
+ }
if (this.localPlayerMode == GameType.SPECTATOR) {
- return InteractionResult.SUCCESS;
+ return InteractionResult.CONSUME;
} else {
- boolean flag = !p_233747_.getMainHandItem().isEmpty() || !p_233747_.getOffhandItem().isEmpty();
+ UseOnContext useoncontext = new UseOnContext(p_233747_, p_233748_, p_233749_);
@@ -112,20 +112,20 @@
BlockState blockstate = this.minecraft.level.getBlockState(blockpos);
if (!this.connection.isFeatureEnabled(blockstate.getBlock().requiredFeatures())) {
return InteractionResult.FAIL;
-@@ -323,8 +_,10 @@
+@@ -324,8 +_,10 @@
}
}
-- if (!itemstack.isEmpty() && !p_233747_.getCooldowns().isOnCooldown(itemstack.getItem())) {
+- if (!itemstack.isEmpty() && !p_233747_.getCooldowns().isOnCooldown(itemstack)) {
- UseOnContext useoncontext = new UseOnContext(p_233747_, p_233748_, p_233749_);
+ if (event.getUseItem().isFalse()) {
+ return InteractionResult.PASS;
+ }
-+ if (event.getUseItem().isTrue() || (!itemstack.isEmpty() && !p_233747_.getCooldowns().isOnCooldown(itemstack.getItem()))) {
- InteractionResult interactionresult1;
++ if (event.getUseItem().isTrue() || (!itemstack.isEmpty() && !p_233747_.getCooldowns().isOnCooldown(itemstack))) {
+ InteractionResult interactionresult2;
if (this.localPlayerMode.isCreative()) {
int i = itemstack.getCount();
-@@ -358,10 +_,17 @@
+@@ -359,6 +_,11 @@
mutableobject.setValue(InteractionResult.PASS);
return serverbounduseitempacket;
} else {
@@ -134,22 +134,25 @@
+ mutableobject.setValue(cancelResult);
+ return serverbounduseitempacket;
+ }
- InteractionResultHolder interactionresultholder = itemstack.use(this.minecraft.level, p_233722_, p_233723_);
- ItemStack itemstack1 = interactionresultholder.getObject();
+ InteractionResult interactionresult = itemstack.use(this.minecraft.level, p_233722_, p_233723_);
+ ItemStack itemstack1;
+ if (interactionresult instanceof InteractionResult.Success interactionresult$success) {
+@@ -371,6 +_,8 @@
+
if (itemstack1 != itemstack) {
p_233722_.setItemInHand(p_233723_, itemstack1);
+ if (itemstack1.isEmpty())
+ net.neoforged.neoforge.event.EventHooks.onPlayerDestroyItem(p_233722_, itemstack, p_233723_);
}
- mutableobject.setValue(interactionresultholder.getResult());
-@@ -400,6 +_,9 @@
+ mutableobject.setValue(interactionresult);
+@@ -409,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));
+ if (this.localPlayerMode == GameType.SPECTATOR) return InteractionResult.PASS; // don't fire for spectators to match non-specific EntityInteract
+ InteractionResult cancelResult = net.neoforged.neoforge.common.CommonHooks.onInteractEntityAt(p_105231_, p_105232_, p_105233_, p_105234_);
+ if(cancelResult != null) return cancelResult;
- return this.localPlayerMode == GameType.SPECTATOR ? InteractionResult.PASS : p_105232_.interactAt(p_105231_, vec3, p_105234_);
+ return (InteractionResult)(this.localPlayerMode == GameType.SPECTATOR ? InteractionResult.PASS : p_105232_.interactAt(p_105231_, vec3, p_105234_));
}
diff --git a/patches/net/minecraft/client/multiplayer/PlayerInfo.java.patch b/patches/net/minecraft/client/multiplayer/PlayerInfo.java.patch
index 1609a2b5e2d..27972460ce2 100644
--- a/patches/net/minecraft/client/multiplayer/PlayerInfo.java.patch
+++ b/patches/net/minecraft/client/multiplayer/PlayerInfo.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/PlayerInfo.java
+++ b/net/minecraft/client/multiplayer/PlayerInfo.java
-@@ -85,6 +_,7 @@
+@@ -86,6 +_,7 @@
}
protected void setGameMode(GameType p_105318_) {
diff --git a/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch b/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch
index 70a7eabfac1..1010c8ad045 100644
--- a/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch
+++ b/patches/net/minecraft/client/multiplayer/SessionSearchTrees.java.patch
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/multiplayer/SessionSearchTrees.java
+++ b/net/minecraft/client/multiplayer/SessionSearchTrees.java
-@@ -60,7 +_,7 @@
- List list = p_346233_.getCollections();
- Registry
- registry = p_345600_.registryOrThrow(Registries.ITEM);
- Item.TooltipContext item$tooltipcontext = Item.TooltipContext.of(p_345600_);
+@@ -65,7 +_,7 @@
+ Registry
- registry = registryaccess.lookupOrThrow(Registries.ITEM);
+ Item.TooltipContext item$tooltipcontext = Item.TooltipContext.of(registryaccess);
+ ContextMap contextmap = SlotDisplayContext.fromLevel(p_379752_);
- TooltipFlag tooltipflag = TooltipFlag.Default.NORMAL;
+ TooltipFlag tooltipflag = net.neoforged.neoforge.client.ClientTooltipFlag.of(TooltipFlag.Default.NORMAL);
CompletableFuture> completablefuture = this.recipeSearch;
this.recipeSearch = CompletableFuture.supplyAsync(
() -> new FullTextSearchTree<>(
-@@ -86,44 +_,60 @@
+@@ -92,44 +_,60 @@
}
public void updateCreativeTags(List p_346121_) {
diff --git a/patches/net/minecraft/client/multiplayer/TagCollector.java.patch b/patches/net/minecraft/client/multiplayer/TagCollector.java.patch
deleted file mode 100644
index db75c16b166..00000000000
--- a/patches/net/minecraft/client/multiplayer/TagCollector.java.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- a/net/minecraft/client/multiplayer/TagCollector.java
-+++ b/net/minecraft/client/multiplayer/TagCollector.java
-@@ -44,5 +_,6 @@
- this.applyTags(p_326147_, p_326446_ -> true);
- refreshBuiltInTagDependentData();
- }
-+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.event.TagsUpdatedEvent(p_326147_, true, p_326486_));
- }
- }
diff --git a/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch b/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch
index dc96475e87c..3d9b32361f3 100644
--- a/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch
+++ b/patches/net/minecraft/client/particle/BreakingItemParticle.java.patch
@@ -1,12 +1,11 @@
--- a/net/minecraft/client/particle/BreakingItemParticle.java
+++ b/net/minecraft/client/particle/BreakingItemParticle.java
-@@ -33,7 +_,8 @@
+@@ -33,7 +_,7 @@
protected BreakingItemParticle(ClientLevel p_105665_, double p_105666_, double p_105667_, double p_105668_, ItemStack p_105669_) {
super(p_105665_, p_105666_, p_105667_, p_105668_, 0.0, 0.0, 0.0);
- this.setSprite(Minecraft.getInstance().getItemRenderer().getModel(p_105669_, p_105665_, null, 0).getParticleIcon());
-+ var model = Minecraft.getInstance().getItemRenderer().getModel(p_105669_, p_105665_, null, 0);
-+ this.setSprite(model.getOverrides().resolve(model, p_105669_, p_105665_, null, 0).getParticleIcon(net.neoforged.neoforge.client.model.data.ModelData.EMPTY));
++ this.setSprite(Minecraft.getInstance().getItemRenderer().getModel(p_105669_, p_105665_, null, 0).getParticleIcon(net.neoforged.neoforge.client.model.data.ModelData.EMPTY));
this.gravity = 1.0F;
this.quadSize /= 2.0F;
this.uo = this.random.nextFloat() * 3.0F;
diff --git a/patches/net/minecraft/client/particle/ItemPickupParticle.java.patch b/patches/net/minecraft/client/particle/ItemPickupParticle.java.patch
index b0309a1a4e6..fbf0a1e746b 100644
--- a/patches/net/minecraft/client/particle/ItemPickupParticle.java.patch
+++ b/patches/net/minecraft/client/particle/ItemPickupParticle.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/particle/ItemPickupParticle.java
+++ b/net/minecraft/client/particle/ItemPickupParticle.java
-@@ -103,4 +_,11 @@
+@@ -102,4 +_,11 @@
this.targetYOld = this.targetY;
this.targetZOld = this.targetZ;
}
diff --git a/patches/net/minecraft/client/particle/ParticleEngine.java.patch b/patches/net/minecraft/client/particle/ParticleEngine.java.patch
index ffbb1d2839f..de43669f575 100644
--- a/patches/net/minecraft/client/particle/ParticleEngine.java.patch
+++ b/patches/net/minecraft/client/particle/ParticleEngine.java.patch
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/particle/ParticleEngine.java
+++ b/net/minecraft/client/particle/ParticleEngine.java
-@@ -81,11 +_,11 @@
- ParticleRenderType.CUSTOM
+@@ -77,11 +_,11 @@
+ ParticleRenderType.TERRAIN_SHEET, ParticleRenderType.PARTICLE_SHEET_OPAQUE, ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT, ParticleRenderType.CUSTOM
);
protected ClientLevel level;
- private final Map> particles = Maps.newIdentityHashMap();
@@ -14,8 +14,8 @@
private final Queue particlesToAdd = Queues.newArrayDeque();
private final Map spriteSets = Maps.newHashMap();
private final TextureAtlas textureAtlas;
-@@ -216,10 +_,14 @@
- this.register(ParticleTypes.OMINOUS_SPAWNING, FlyStraightTowardsParticle.OminousSpawnProvider::new);
+@@ -214,10 +_,14 @@
+ this.register(ParticleTypes.BLOCK_CRUMBLE, new TerrainParticle.CrumblingProvider());
}
+ /** @deprecated Register via {@link net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent} */
@@ -30,7 +30,7 @@
public void register(ParticleType p_273423_, ParticleProvider.Sprite p_273134_) {
this.register(
p_273423_,
-@@ -236,10 +_,12 @@
+@@ -234,10 +_,12 @@
);
}
@@ -44,7 +44,7 @@
}
@Override
-@@ -365,7 +_,7 @@
+@@ -357,7 +_,7 @@
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_);
-@@ -441,11 +_,20 @@
+@@ -433,17 +_,27 @@
}
}
@@ -74,8 +74,7 @@
+ if (particlerendertype == ParticleRenderType.NO_RENDER || !renderTypePredicate.test(particlerendertype)) continue;
Queue queue = this.particles.get(particlerendertype);
if (queue != null && !queue.isEmpty()) {
- RenderSystem.setShader(GameRenderer::getParticleShader);
-@@ -453,6 +_,7 @@
+ Tesselator tesselator = Tesselator.getInstance();
BufferBuilder bufferbuilder = particlerendertype.begin(tesselator, this.textureManager);
if (bufferbuilder != null) {
for (Particle particle : queue) {
@@ -83,7 +82,7 @@
try {
particle.render(bufferbuilder, p_107340_, p_107341_);
} catch (Throwable throwable) {
-@@ -484,7 +_,7 @@
+@@ -475,7 +_,7 @@
}
public void destroy(BlockPos p_107356_, BlockState p_107357_) {
@@ -92,7 +91,7 @@
VoxelShape voxelshape = p_107357_.getShape(this.level, p_107356_);
double d0 = 0.25;
voxelshape.forAllBoxes(
-@@ -516,7 +_,7 @@
+@@ -507,7 +_,7 @@
d6 - 0.5,
p_107357_,
p_107356_
@@ -101,7 +100,7 @@
);
}
}
-@@ -561,12 +_,28 @@
+@@ -552,12 +_,28 @@
d0 = (double)i + aabb.maxX + 0.1F;
}
diff --git a/patches/net/minecraft/client/particle/ParticleRenderType.java.patch b/patches/net/minecraft/client/particle/ParticleRenderType.java.patch
index 4a648c99e5c..47a53ce490f 100644
--- a/patches/net/minecraft/client/particle/ParticleRenderType.java.patch
+++ b/patches/net/minecraft/client/particle/ParticleRenderType.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/particle/ParticleRenderType.java
+++ b/net/minecraft/client/particle/ParticleRenderType.java
-@@ -43,6 +_,11 @@
+@@ -44,6 +_,11 @@
public String toString() {
return "PARTICLE_SHEET_OPAQUE";
}
@@ -12,9 +12,9 @@
};
ParticleRenderType PARTICLE_SHEET_TRANSLUCENT = new ParticleRenderType() {
@Override
-@@ -72,6 +_,11 @@
+@@ -60,6 +_,11 @@
public String toString() {
- return "PARTICLE_SHEET_LIT";
+ return "PARTICLE_SHEET_TRANSLUCENT";
}
+
+ @Override
@@ -24,7 +24,7 @@
};
ParticleRenderType CUSTOM = new ParticleRenderType() {
@Override
-@@ -101,4 +_,9 @@
+@@ -89,4 +_,9 @@
@Nullable
BufferBuilder begin(Tesselator p_350949_, TextureManager p_107437_);
diff --git a/patches/net/minecraft/client/player/AbstractClientPlayer.java.patch b/patches/net/minecraft/client/player/AbstractClientPlayer.java.patch
index 48705c0461a..6e8a8c55402 100644
--- a/patches/net/minecraft/client/player/AbstractClientPlayer.java.patch
+++ b/patches/net/minecraft/client/player/AbstractClientPlayer.java.patch
@@ -1,10 +1,10 @@
--- a/net/minecraft/client/player/AbstractClientPlayer.java
+++ b/net/minecraft/client/player/AbstractClientPlayer.java
-@@ -96,6 +_,6 @@
+@@ -91,6 +_,6 @@
}
}
-- return Mth.lerp(Minecraft.getInstance().options.fovEffectScale().get().floatValue(), 1.0F, f);
-+ return net.neoforged.neoforge.client.ClientHooks.getFieldOfViewModifier(this, f);
+- return Mth.lerp(p_366686_, 1.0F, f);
++ return net.neoforged.neoforge.client.ClientHooks.getFieldOfViewModifier(this, f, p_366686_);
}
}
diff --git a/patches/net/minecraft/client/player/LocalPlayer.java.patch b/patches/net/minecraft/client/player/LocalPlayer.java.patch
index 632b558ef9d..d772181669f 100644
--- a/patches/net/minecraft/client/player/LocalPlayer.java.patch
+++ b/patches/net/minecraft/client/player/LocalPlayer.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/player/LocalPlayer.java
+++ b/net/minecraft/client/player/LocalPlayer.java
-@@ -297,6 +_,7 @@
+@@ -302,6 +_,7 @@
ServerboundPlayerActionPacket.Action serverboundplayeractionpacket$action = p_108701_
? ServerboundPlayerActionPacket.Action.DROP_ALL_ITEMS
: ServerboundPlayerActionPacket.Action.DROP_ITEM;
@@ -8,7 +8,7 @@
ItemStack itemstack = this.getInventory().removeFromSelected(p_108701_);
this.connection.send(new ServerboundPlayerActionPacket(serverboundplayeractionpacket$action, BlockPos.ZERO, Direction.DOWN));
return !itemstack.isEmpty();
-@@ -489,7 +_,14 @@
+@@ -482,7 +_,14 @@
@Override
public void playSound(SoundEvent p_108651_, float p_108652_, float p_108653_) {
@@ -24,7 +24,7 @@
}
@Override
-@@ -682,6 +_,7 @@
+@@ -676,6 +_,7 @@
&& (this.isShiftKeyDown() || !this.isSleeping() && !this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.STANDING));
float f = (float)this.getAttributeValue(Attributes.SNEAKING_SPEED);
this.input.tick(this.isMovingSlowly(), f);
@@ -32,7 +32,7 @@
this.minecraft.getTutorial().onInput(this.input);
if (this.isUsingItem() && !this.isPassenger()) {
this.input.leftImpulse *= 0.2F;
-@@ -710,7 +_,7 @@
+@@ -704,7 +_,7 @@
boolean flag4 = this.canStartSprinting();
boolean flag5 = this.isPassenger() ? this.getVehicle().onGround() : this.onGround();
boolean flag6 = !flag1 && !flag2;
@@ -41,7 +41,7 @@
if (this.sprintTriggerTime <= 0 && !this.minecraft.options.keySprint.isDown()) {
this.sprintTriggerTime = 7;
} else {
-@@ -718,15 +_,15 @@
+@@ -712,15 +_,15 @@
}
}
@@ -55,12 +55,12 @@
- boolean flag8 = flag7 || this.horizontalCollision && !this.minorHorizontalCollision || this.isInWater() && !this.isUnderWater();
+ boolean flag8 = flag7 || this.horizontalCollision && !this.minorHorizontalCollision || this.isInWater() && !this.isUnderWater() || (this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)) && !this.canStartSwimming());
if (this.isSwimming()) {
-- if (!this.onGround() && !this.input.shiftKeyDown && flag7 || !this.isInWater()) {
-+ if (!this.onGround() && !this.input.shiftKeyDown && flag7 || !(this.isInWater() || this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)))) {
+- if (!this.onGround() && !this.input.keyPresses.shift() && flag7 || !this.isInWater()) {
++ if (!this.onGround() && !this.input.keyPresses.shift() && flag7 || !(this.isInWater() || this.isInFluidType((fluidType, height) -> this.canSwimInFluidType(fluidType)))) {
this.setSprinting(false);
}
} else if (flag8) {
-@@ -735,7 +_,7 @@
+@@ -729,7 +_,7 @@
}
boolean flag9 = false;
@@ -69,34 +69,18 @@
if (this.minecraft.gameMode.isAlwaysFlying()) {
if (!abilities.flying) {
abilities.flying = true;
-@@ -760,14 +_,15 @@
-
- if (this.input.jumping && !flag9 && !flag && !abilities.flying && !this.isPassenger() && !this.onClimbable()) {
- ItemStack itemstack = this.getItemBySlot(EquipmentSlot.CHEST);
-- if (itemstack.is(Items.ELYTRA) && ElytraItem.isFlyEnabled(itemstack) && this.tryToStartFallFlying()) {
-+ if (itemstack.canElytraFly(this) && this.tryToStartFallFlying()) {
- this.connection.send(new ServerboundPlayerCommandPacket(this, ServerboundPlayerCommandPacket.Action.START_FALL_FLYING));
- }
- }
-
- this.wasFallFlying = this.isFallFlying();
-- if (this.isInWater() && this.input.shiftKeyDown && this.isAffectedByFluids()) {
-- this.goDownInWater();
-+ net.neoforged.neoforge.fluids.FluidType fluidType = this.getMaxHeightFluidType();
-+ if ((this.isInWater() || (!fluidType.isAir() && this.canSwimInFluidType(fluidType))) && this.input.shiftKeyDown && this.isAffectedByFluids()) {
-+ this.sinkInFluid(this.isInWater() ? net.neoforged.neoforge.common.NeoForgeMod.WATER_TYPE.value() : fluidType);
- }
-
- if (this.isEyeInFluid(FluidTags.WATER)) {
-@@ -875,6 +_,7 @@
+@@ -866,6 +_,10 @@
@Override
public void rideTick() {
super.rideTick();
-+ if (this.wantsToStopRiding() && this.isPassenger()) this.input.shiftKeyDown = false;
++ if (this.wantsToStopRiding() && this.isPassenger()) {
++ Input input = this.input.keyPresses;
++ this.input.keyPresses = new Input(input.forward(), input.backward(), input.left(), input.right(), input.jump(), false, input.sprint());
++ }
this.handsBusy = false;
- if (this.getControlledVehicle() instanceof Boat boat) {
- boat.setInput(this.input.left, this.input.right, this.input.up, this.input.down);
-@@ -1061,7 +_,7 @@
+ if (this.getControlledVehicle() instanceof AbstractBoat abstractboat) {
+ abstractboat.setInput(
+@@ -1063,7 +_,7 @@
}
private boolean hasEnoughFoodToStartSprinting() {
diff --git a/patches/net/minecraft/client/renderer/DimensionSpecialEffects.java.patch b/patches/net/minecraft/client/renderer/DimensionSpecialEffects.java.patch
index 641642c10fa..285c14a5b27 100644
--- a/patches/net/minecraft/client/renderer/DimensionSpecialEffects.java.patch
+++ b/patches/net/minecraft/client/renderer/DimensionSpecialEffects.java.patch
@@ -9,7 +9,7 @@
private static final Object2ObjectMap EFFECTS = Util.make(new Object2ObjectArrayMap<>(), p_108881_ -> {
DimensionSpecialEffects.OverworldEffects dimensionspecialeffects$overworldeffects = new DimensionSpecialEffects.OverworldEffects();
p_108881_.defaultReturnValue(dimensionspecialeffects$overworldeffects);
-@@ -37,7 +_,7 @@
+@@ -36,7 +_,7 @@
}
public static DimensionSpecialEffects forType(DimensionType p_108877_) {
@@ -17,4 +17,4 @@
+ return net.neoforged.neoforge.client.DimensionSpecialEffectsManager.getForType(p_108877_.effectsLocation());
}
- @Nullable
+ public boolean isSunriseOrSunset(float p_365312_) {
diff --git a/patches/net/minecraft/client/renderer/EffectInstance.java.patch b/patches/net/minecraft/client/renderer/EffectInstance.java.patch
deleted file mode 100644
index 8ceff68f594..00000000000
--- a/patches/net/minecraft/client/renderer/EffectInstance.java.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/net/minecraft/client/renderer/EffectInstance.java
-+++ b/net/minecraft/client/renderer/EffectInstance.java
-@@ -58,7 +_,8 @@
- private final EffectProgram fragmentProgram;
-
- public EffectInstance(ResourceProvider p_331011_, String p_108942_) throws IOException {
-- ResourceLocation resourcelocation = ResourceLocation.withDefaultNamespace("shaders/program/" + p_108942_ + ".json");
-+ ResourceLocation rl = ResourceLocation.tryParse(p_108942_);
-+ ResourceLocation resourcelocation = ResourceLocation.fromNamespaceAndPath(rl.getNamespace(), "shaders/program/" + rl.getPath() + ".json");
- this.name = p_108942_;
- Resource resource = p_331011_.getResourceOrThrow(resourcelocation);
-
-@@ -150,7 +_,8 @@
- } else {
- EffectProgram effectprogram;
- if (program == null) {
-- ResourceLocation resourcelocation = ResourceLocation.withDefaultNamespace("shaders/program/" + p_172569_ + p_172568_.getExtension());
-+ ResourceLocation rl = ResourceLocation.tryParse(p_172569_);
-+ ResourceLocation resourcelocation = ResourceLocation.fromNamespaceAndPath(rl.getNamespace(), "shaders/program/" + rl.getPath() + p_172568_.getExtension());
- Resource resource = p_330579_.getResourceOrThrow(resourcelocation);
-
- try (InputStream inputstream = resource.open()) {
diff --git a/patches/net/minecraft/client/renderer/FogRenderer.java.patch b/patches/net/minecraft/client/renderer/FogRenderer.java.patch
index 25aa2799882..f2443a835ca 100644
--- a/patches/net/minecraft/client/renderer/FogRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/FogRenderer.java.patch
@@ -1,23 +1,23 @@
--- a/net/minecraft/client/renderer/FogRenderer.java
+++ b/net/minecraft/client/renderer/FogRenderer.java
-@@ -197,6 +_,12 @@
- fogBlue = fogBlue * (1.0F - f7) + fogBlue * f9 * f7;
+@@ -196,7 +_,7 @@
+ f2 = f2 * (1.0F - f10) + f2 * f12 * f10;
}
-+ Vector3f fogColor = net.neoforged.neoforge.client.ClientHooks.getFogColor(p_109019_, p_109020_, p_109021_, p_109022_, p_109023_, fogRed, fogGreen, fogBlue);
-+
-+ fogRed = fogColor.x();
-+ fogGreen = fogColor.y();
-+ fogBlue = fogColor.z();
-+
- RenderSystem.clearColor(fogRed, fogGreen, fogBlue, 0.0F);
+- return new Vector4f(f, f1, f2, 1.0F);
++ return net.neoforged.neoforge.client.ClientHooks.getFogColor(p_363451_, p_364931_, p_363033_, p_363851_, p_363957_, f, f1, f2);
}
-@@ -273,6 +_,7 @@
- RenderSystem.setShaderFogStart(fogrenderer$fogdata.start);
- RenderSystem.setShaderFogEnd(fogrenderer$fogdata.end);
- RenderSystem.setShaderFogShape(fogrenderer$fogdata.shape);
-+ net.neoforged.neoforge.client.ClientHooks.onFogRender(p_234174_, fogtype, p_234173_, p_234177_, p_234175_, fogrenderer$fogdata.start, fogrenderer$fogdata.end, fogrenderer$fogdata.shape);
+ public static boolean toggleFog() {
+@@ -274,9 +_,9 @@
+ fogrenderer$fogdata.shape = FogShape.CYLINDER;
+ }
+
+- return new FogParameters(
++ return net.neoforged.neoforge.client.ClientHooks.onFogRender(p_234174_, fogtype, p_234173_, p_234177_, p_234175_, new FogParameters(
+ fogrenderer$fogdata.start, fogrenderer$fogdata.end, fogrenderer$fogdata.shape, p_365467_.x, p_365467_.y, p_365467_.z, p_365467_.w
+- );
++ ));
+ }
}
- public static void levelFogColor() {
diff --git a/patches/net/minecraft/client/renderer/GameRenderer.java.patch b/patches/net/minecraft/client/renderer/GameRenderer.java.patch
index 7d1c353a229..d8c3a70c539 100644
--- a/patches/net/minecraft/client/renderer/GameRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/GameRenderer.java.patch
@@ -1,32 +1,24 @@
--- a/net/minecraft/client/renderer/GameRenderer.java
+++ b/net/minecraft/client/renderer/GameRenderer.java
-@@ -311,6 +_,8 @@
- this.loadEffect(ResourceLocation.withDefaultNamespace("shaders/post/spider.json"));
+@@ -158,6 +_,8 @@
+ this.setPostEffect(ResourceLocation.withDefaultNamespace("spider"));
} else if (p_109107_ instanceof EnderMan) {
- this.loadEffect(ResourceLocation.withDefaultNamespace("shaders/post/invert.json"));
+ this.setPostEffect(ResourceLocation.withDefaultNamespace("invert"));
+ } else {
+ net.neoforged.neoforge.client.ClientHooks.loadEntityShader(p_109107_, this);
}
}
-@@ -714,6 +_,7 @@
- )
- );
- this.loadBlurEffect(p_250719_);
-+ net.neoforged.fml.ModLoader.postEvent(new net.neoforged.neoforge.client.event.RegisterShadersEvent(p_250719_, list1));
- } catch (IOException ioexception) {
- list1.forEach(p_172729_ -> p_172729_.getFirst().close());
- throw new RuntimeException("could not reload shaders", ioexception);
-@@ -872,7 +_,7 @@
- d0 *= Mth.lerp(this.minecraft.options.fovEffectScale().get(), 1.0, 0.85714287F);
+@@ -312,7 +_,7 @@
+ f *= Mth.lerp(f2, 1.0F, 0.85714287F);
}
-- return d0;
-+ return net.neoforged.neoforge.client.ClientHooks.getFieldOfView(this, p_109142_, p_109143_, d0, p_109144_);
+- return f;
++ return net.neoforged.neoforge.client.ClientHooks.getFieldOfView(this, p_109142_, p_109143_, f, p_109144_);
}
}
-@@ -888,6 +_,10 @@
+@@ -328,6 +_,10 @@
return;
}
@@ -37,7 +29,7 @@
f2 /= (float)livingentity.hurtDuration;
f2 = Mth.sin(f2 * f2 * f2 * f2 * (float) Math.PI);
float f3 = livingentity.getHurtDir();
-@@ -1036,12 +_,12 @@
+@@ -474,13 +_,13 @@
(float)((double)window.getHeight() / window.getGuiScale()),
0.0F,
1000.0F,
@@ -45,40 +37,41 @@
+ net.neoforged.neoforge.client.ClientHooks.getGuiFarPlane()
);
RenderSystem.setProjectionMatrix(matrix4f, VertexSorting.ORTHOGRAPHIC_Z);
+ float f = 1000.0F;
Matrix4fStack matrix4fstack = RenderSystem.getModelViewStack();
matrix4fstack.pushMatrix();
-- matrix4fstack.translation(0.0F, 0.0F, -11000.0F);
+- matrix4fstack.translation(0.0F, 0.0F, -10000.0F);
+ matrix4fstack.translation(0.0F, 0.0F, 10000F - net.neoforged.neoforge.client.ClientHooks.getGuiFarPlane());
- RenderSystem.applyModelViewMatrix();
Lighting.setupFor3DItems();
GuiGraphics guigraphics = new GuiGraphics(this.minecraft, this.renderBuffers.bufferSource());
-@@ -1070,7 +_,8 @@
+ guigraphics.pose().translate(0.0F, 0.0F, -1000.0F);
+@@ -498,7 +_,8 @@
if (this.minecraft.getOverlay() != null) {
try {
-- this.minecraft.getOverlay().render(guigraphics, i, j, p_348648_.getRealtimeDeltaTicks());
+- this.minecraft.getOverlay().render(guigraphics, i, j, p_348648_.getGameTimeDeltaTicks());
+ // Neo: Fix https://bugs.mojang.com/browse/MC-273464
+ this.minecraft.getOverlay().render(guigraphics, i, j, p_348648_.getGameTimeDeltaPartialTick(false));
} catch (Throwable throwable2) {
CrashReport crashreport = CrashReport.forThrowable(throwable2, "Rendering overlay");
CrashReportCategory crashreportcategory = crashreport.addCategory("Overlay render details");
-@@ -1079,7 +_,9 @@
+@@ -507,7 +_,9 @@
}
} else if (flag && this.minecraft.screen != null) {
try {
-- this.minecraft.screen.renderWithTooltip(guigraphics, i, j, p_348648_.getRealtimeDeltaTicks());
+- this.minecraft.screen.renderWithTooltip(guigraphics, i, j, p_348648_.getGameTimeDeltaTicks());
+ // Neo: Wrap Screen#render to allow for GUI Layers and ScreenEvent.Render.[Pre/Post]
+ // Also fixes https://bugs.mojang.com/browse/MC-273464
+ net.neoforged.neoforge.client.ClientHooks.drawScreen(this.minecraft.screen, guigraphics, i, j, p_348648_.getGameTimeDeltaPartialTick(false));
} catch (Throwable throwable1) {
CrashReport crashreport1 = CrashReport.forThrowable(throwable1, "Rendering screen");
CrashReportCategory crashreportcategory1 = crashreport1.addCategory("Screen render details");
-@@ -1259,6 +_,8 @@
- .levelRenderer
- .prepareCullFrustum(camera.getPosition(), matrix4f1, this.getProjectionMatrix(Math.max(d0, (double)this.minecraft.options.fov().get().intValue())));
- this.minecraft.levelRenderer.renderLevel(p_348589_, flag, camera, this, this.lightTexture, matrix4f1, matrix4f);
-+ this.minecraft.getProfiler().popPush("neoforge_render_last");
+@@ -689,6 +_,8 @@
+ this.minecraft.levelRenderer.prepareCullFrustum(camera.getPosition(), matrix4f2, matrix4f1);
+ this.minecraft.getMainRenderTarget().bindWrite(true);
+ this.minecraft.levelRenderer.renderLevel(this.resourcePool, p_348589_, flag, camera, this, this.lightTexture, matrix4f2, matrix4f);
++ profilerfiller.popPush("neoforge_render_last");
+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_LEVEL, this.minecraft.levelRenderer, null, matrix4f1, matrix4f, this.minecraft.levelRenderer.getTicks(), camera, this.minecraft.levelRenderer.getFrustum());
- this.minecraft.getProfiler().popPush("hand");
+ profilerfiller.popPush("hand");
if (this.renderHand) {
- RenderSystem.clear(256, Minecraft.ON_OSX);
+ RenderSystem.clear(256);
diff --git a/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch b/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch
index d66d2a4c3a6..1bf5aead8bb 100644
--- a/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch
+++ b/patches/net/minecraft/client/renderer/ItemBlockRenderTypes.java.patch
@@ -1,22 +1,22 @@
--- a/net/minecraft/client/renderer/ItemBlockRenderTypes.java
+++ b/net/minecraft/client/renderer/ItemBlockRenderTypes.java
-@@ -20,6 +_,7 @@
+@@ -18,6 +_,7 @@
@OnlyIn(Dist.CLIENT)
public class ItemBlockRenderTypes {
+ @Deprecated
- private static final Map TYPE_BY_BLOCK = Util.make(Maps.newHashMap(), p_353020_ -> {
+ private static final Map TYPE_BY_BLOCK = Util.make(Maps.newHashMap(), p_378824_ -> {
RenderType rendertype = RenderType.tripwire();
- p_353020_.put(Blocks.TRIPWIRE, rendertype);
-@@ -335,6 +_,7 @@
- p_353020_.put(Blocks.BUBBLE_COLUMN, rendertype3);
- p_353020_.put(Blocks.TINTED_GLASS, rendertype3);
+ p_378824_.put(Blocks.TRIPWIRE, rendertype);
+@@ -340,6 +_,7 @@
+ p_378824_.put(Blocks.BUBBLE_COLUMN, rendertype3);
+ p_378824_.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);
-@@ -342,6 +_,8 @@
+@@ -347,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) {
-@@ -352,6 +_,8 @@
+@@ -357,6 +_,8 @@
}
}
@@ -34,25 +34,23 @@
public static RenderType getMovingBlockRenderType(BlockState p_109294_) {
Block block = p_109294_.getBlock();
if (block instanceof LeavesBlock) {
-@@ -366,6 +_,8 @@
+@@ -371,11 +_,15 @@
}
}
-+ /** @deprecated Forge: Use {@link net.neoforged.neoforge.client.RenderTypeHelper#getEntityRenderType(RenderType, boolean)} while iterating through {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)}. */
++ /** @deprecated Forge: Use {@link net.neoforged.neoforge.client.RenderTypeHelper#getEntityRenderType(RenderType)} while iterating through {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)}. */
+ @Deprecated // Note: this method does NOT support model-based render types
- public static RenderType getRenderType(BlockState p_109285_, boolean p_109286_) {
- RenderType rendertype = getChunkRenderType(p_109285_);
- if (rendertype == RenderType.translucent()) {
-@@ -379,6 +_,8 @@
- }
+ public static RenderType getRenderType(BlockState p_366653_) {
+ RenderType rendertype = getChunkRenderType(p_366653_);
+ return rendertype == RenderType.translucent() ? Sheets.translucentItemSheet() : Sheets.cutoutBlockSheet();
}
-+ /** @deprecated Forge: Use {@link net.minecraft.client.resources.model.BakedModel#getRenderPasses(ItemStack, boolean)} and {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(ItemStack, boolean)}. */
++ /** @deprecated Forge: Use {@link net.minecraft.client.resources.model.BakedModel#getRenderPasses(ItemStack)} and {@link net.minecraft.client.resources.model.BakedModel#getRenderTypes(ItemStack)}. */
+ @Deprecated // Note: this method does NOT support model-based render types
- public static RenderType getRenderType(ItemStack p_109280_, boolean p_109281_) {
- Item item = p_109280_.getItem();
- if (item instanceof BlockItem) {
-@@ -396,5 +_,78 @@
+ public static RenderType getRenderType(ItemStack p_366701_) {
+ if (p_366701_.getItem() instanceof BlockItem blockitem) {
+ Block block = blockitem.getBlock();
+@@ -392,5 +_,78 @@
public static void setFancy(boolean p_109292_) {
renderCutout = p_109292_;
diff --git a/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch b/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch
index 8497dbd1cc4..50e02aa55ff 100644
--- a/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/ItemInHandRenderer.java.patch
@@ -1,6 +1,20 @@
--- a/net/minecraft/client/renderer/ItemInHandRenderer.java
+++ b/net/minecraft/client/renderer/ItemInHandRenderer.java
-@@ -226,7 +_,7 @@
+@@ -168,11 +_,11 @@
+ ResourceLocation resourcelocation = this.minecraft.player.getSkin().texture();
+ if (p_109365_ == HumanoidArm.RIGHT) {
+ playerrenderer.renderRightHand(
+- p_109362_, p_109363_, p_109364_, resourcelocation, this.minecraft.player.isModelPartShown(PlayerModelPart.RIGHT_SLEEVE)
++ p_109362_, p_109363_, p_109364_, resourcelocation, this.minecraft.player.isModelPartShown(PlayerModelPart.RIGHT_SLEEVE), this.minecraft.player
+ );
+ } else {
+ playerrenderer.renderLeftHand(
+- p_109362_, p_109363_, p_109364_, resourcelocation, this.minecraft.player.isModelPartShown(PlayerModelPart.LEFT_SLEEVE)
++ p_109362_, p_109363_, p_109364_, resourcelocation, this.minecraft.player.isModelPartShown(PlayerModelPart.LEFT_SLEEVE), this.minecraft.player
+ );
+ }
+
+@@ -234,7 +_,7 @@
p_109367_.translate(-0.5F, -0.5F, 0.0F);
p_109367_.scale(0.0078125F, 0.0078125F, 0.0078125F);
MapId mapid = p_109370_.get(DataComponents.MAP_ID);
@@ -9,7 +23,20 @@
VertexConsumer vertexconsumer = p_109368_.getBuffer(mapitemsaveddata == null ? MAP_BACKGROUND : MAP_BACKGROUND_CHECKERBOARD);
Matrix4f matrix4f = p_109367_.last().pose();
vertexconsumer.addVertex(matrix4f, -7.0F, 135.0F, 0.0F).setColor(-1).setUv(0.0F, 1.0F).setLight(p_109369_);
-@@ -334,12 +_,14 @@
+@@ -271,10 +_,10 @@
+ ResourceLocation resourcelocation = abstractclientplayer.getSkin().texture();
+ if (flag) {
+ playerrenderer.renderRightHand(
+- p_109347_, p_109348_, p_109349_, resourcelocation, abstractclientplayer.isModelPartShown(PlayerModelPart.RIGHT_SLEEVE)
++ p_109347_, p_109348_, p_109349_, resourcelocation, abstractclientplayer.isModelPartShown(PlayerModelPart.RIGHT_SLEEVE), abstractclientplayer
+ );
+ } else {
+- playerrenderer.renderLeftHand(p_109347_, p_109348_, p_109349_, resourcelocation, abstractclientplayer.isModelPartShown(PlayerModelPart.LEFT_SLEEVE));
++ playerrenderer.renderLeftHand(p_109347_, p_109348_, p_109349_, resourcelocation, abstractclientplayer.isModelPartShown(PlayerModelPart.LEFT_SLEEVE), abstractclientplayer);
+ }
+ }
+
+@@ -347,12 +_,14 @@
if (iteminhandrenderer$handrenderselection.renderMainHand) {
float f4 = interactionhand == InteractionHand.MAIN_HAND ? f : 0.0F;
float f5 = 1.0F - Mth.lerp(p_109315_, this.oMainHandHeight, this.mainHandHeight);
@@ -24,11 +51,11 @@
this.renderArmWithItem(p_109318_, p_109315_, f1, InteractionHand.OFF_HAND, f6, this.offHandItem, f7, p_109316_, p_109317_, p_109319_);
}
-@@ -399,13 +_,13 @@
+@@ -412,13 +_,13 @@
if (flag && !p_109372_.isInvisible()) {
this.renderPlayerArm(p_109379_, p_109380_, p_109381_, p_109378_, p_109376_, humanoidarm);
}
-- } else if (p_109377_.is(Items.FILLED_MAP)) {
+- } else if (p_109377_.has(DataComponents.MAP_ID)) {
+ } else if (p_109377_.getItem() instanceof MapItem) {
if (flag && this.offHandItem.isEmpty()) {
this.renderTwoHandedMap(p_109379_, p_109380_, p_109381_, p_109374_, p_109378_, p_109376_);
@@ -40,7 +67,7 @@
boolean flag1 = CrossbowItem.isCharged(p_109377_);
boolean flag2 = humanoidarm == HumanoidArm.RIGHT;
int i = flag2 ? 1 : -1;
-@@ -455,6 +_,7 @@
+@@ -468,6 +_,7 @@
);
} else {
boolean flag3 = humanoidarm == HumanoidArm.RIGHT;
@@ -48,7 +75,7 @@
if (p_109372_.isUsingItem() && p_109372_.getUseItemRemainingTicks() > 0 && p_109372_.getUsedItemHand() == p_109375_) {
int k = flag3 ? 1 : -1;
switch (p_109377_.getUseAnimation()) {
-@@ -569,8 +_,16 @@
+@@ -582,8 +_,16 @@
this.offHandHeight = Mth.clamp(this.offHandHeight - 0.4F, 0.0F, 1.0F);
} else {
float f = localplayer.getAttackStrengthScale(1.0F);
diff --git a/patches/net/minecraft/client/renderer/LevelEventHandler.java.patch b/patches/net/minecraft/client/renderer/LevelEventHandler.java.patch
new file mode 100644
index 00000000000..9babaa65c3b
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/LevelEventHandler.java.patch
@@ -0,0 +1,13 @@
+--- a/net/minecraft/client/renderer/LevelEventHandler.java
++++ b/net/minecraft/client/renderer/LevelEventHandler.java
+@@ -435,8 +_,8 @@
+ break;
+ case 2001:
+ BlockState blockstate1 = Block.stateById(p_360434_);
+- if (!blockstate1.isAir()) {
+- SoundType soundtype = blockstate1.getSoundType();
++ if (!blockstate1.isAir() && !net.neoforged.neoforge.client.extensions.common.IClientBlockExtensions.of(blockstate1).playBreakSound(blockstate1, this.level, p_362181_)) {
++ SoundType soundtype = blockstate1.getSoundType(this.level, p_362181_, null);
+ this.level
+ .playLocalSound(
+ p_362181_, soundtype.getBreakSound(), SoundSource.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F, false
diff --git a/patches/net/minecraft/client/renderer/LevelRenderer.java.patch b/patches/net/minecraft/client/renderer/LevelRenderer.java.patch
index 82e084e8b4b..bb8448e40dc 100644
--- a/patches/net/minecraft/client/renderer/LevelRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/LevelRenderer.java.patch
@@ -1,229 +1,238 @@
--- a/net/minecraft/client/renderer/LevelRenderer.java
+++ b/net/minecraft/client/renderer/LevelRenderer.java
-@@ -233,6 +_,10 @@
- private int rainSoundTime;
- private final float[] rainSizeX = new float[1024];
- private final float[] rainSizeZ = new float[1024];
+@@ -485,7 +_,7 @@
+ RenderSystem.clear(16640);
+ });
+ if (!flag1) {
+- this.addSkyPass(framegraphbuilder, p_109604_, f, fogparameters1);
++ this.addSkyPass(framegraphbuilder, p_109604_, f, fogparameters1, p_254120_, p_323920_);
+ }
+
+ this.addMainPass(framegraphbuilder, frustum, p_109604_, p_254120_, p_323920_, fogparameters, p_109603_, flag2, p_348530_, profilerfiller);
+@@ -494,7 +_,7 @@
+ postchain1.addToFrame(framegraphbuilder, i, j, this.targets);
+ }
+
+- this.addParticlesPass(framegraphbuilder, p_109604_, p_109606_, f, fogparameters);
++ this.addParticlesPass(framegraphbuilder, p_109604_, p_109606_, f, fogparameters, frustum, p_254120_, p_323920_);
+ CloudStatus cloudstatus = this.minecraft.options.getCloudsType();
+ if (cloudstatus != CloudStatus.OFF) {
+ float f2 = this.level.effects().getCloudHeight();
+@@ -505,7 +_,7 @@
+ }
+ }
+
+- this.addWeatherPass(framegraphbuilder, p_109606_, p_109604_.getPosition(), f, fogparameters);
++ this.addWeatherPass(framegraphbuilder, p_109606_, p_109604_.getPosition(), f, fogparameters, p_254120_, p_323920_, p_109604_);
+ if (postchain != null) {
+ postchain.addToFrame(framegraphbuilder, i, j, this.targets);
+ }
+@@ -576,7 +_,9 @@
+ double d2 = vec3.z();
+ p_362234_.push("terrain");
+ this.renderSectionLayer(RenderType.solid(), d0, d1, d2, p_362420_, p_361272_);
++ this.minecraft.getModelManager().getAtlas(net.minecraft.client.renderer.texture.TextureAtlas.LOCATION_BLOCKS).setBlurMipmap(false, this.minecraft.options.mipmapLevels().get() > 0); // Neo: fix flickering leaves when mods mess up the blurMipmap settings
+ this.renderSectionLayer(RenderType.cutoutMipped(), d0, d1, d2, p_362420_, p_361272_);
++ this.minecraft.getModelManager().getAtlas(net.minecraft.client.renderer.texture.TextureAtlas.LOCATION_BLOCKS).restoreLastBlurMipmap();
+ this.renderSectionLayer(RenderType.cutout(), d0, d1, d2, p_362420_, p_361272_);
+ if (this.level.effects().constantAmbientLight()) {
+ Lighting.setupNetherLevel();
+@@ -608,6 +_,7 @@
+ p_362234_.popPush("entities");
+ this.renderEntities(posestack, multibuffersource$buffersource, p_363453_, p_360931_, this.visibleEntities);
+ multibuffersource$buffersource.endLastBatch();
++ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_ENTITIES, this, posestack, p_362420_, p_361272_, this.ticks, p_363453_, p_366590_);
+ this.checkPoseStack(posestack);
+ p_362234_.popPush("blockentities");
+ this.renderBlockEntities(posestack, multibuffersource$buffersource, multibuffersource$buffersource1, p_363453_, f);
+@@ -624,6 +_,7 @@
+ multibuffersource$buffersource.endBatch(Sheets.hangingSignSheet());
+ multibuffersource$buffersource.endBatch(Sheets.chestSheet());
+ this.renderBuffers.outlineBufferSource().endOutlineBatch();
++ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_BLOCK_ENTITIES, this, posestack, p_362420_, p_361272_, this.ticks, p_363453_, p_366590_);
+ if (p_363964_) {
+ this.renderBlockOutline(p_363453_, multibuffersource$buffersource, posestack, false);
+ }
+@@ -644,6 +_,11 @@
+ multibuffersource$buffersource1.endBatch();
+ this.checkPoseStack(posestack);
+ multibuffersource$buffersource.endBatch(RenderType.waterMask());
++ // Neo: in Fast/Fancy, render solid particles before translucent geometry so they don't disappear underwater (MC-161917)
++ if (this.targets.particles == null) {
++ p_362234_.popPush("solid_particles");
++ this.minecraft.particleEngine.render(this.minecraft.gameRenderer.lightTexture(), p_363453_, f, p_366590_, type -> !type.isTranslucent());
++ }
+ multibuffersource$buffersource.endBatch();
+ if (resourcehandle1 != null) {
+ resourcehandle1.get().setClearColor(0.0F, 0.0F, 0.0F, 0.0F);
+@@ -664,7 +_,15 @@
+ });
+ }
+
+ /**
-+ * Neo: Indicates whether outline effect post-processing was requested for the current frame outside of vanilla codepaths
++ * @deprecated Neo: use {@link #addParticlesPass(FrameGraphBuilder, Camera, LightTexture, float, FogParameters, Frustum, Matrix4f, Matrix4f)} instead
+ */
-+ private boolean outlineEffectRequested = false;
++ @Deprecated
+ private void addParticlesPass(FrameGraphBuilder p_363357_, Camera p_365299_, LightTexture p_364308_, float p_364282_, FogParameters p_362149_) {
++ addParticlesPass(p_363357_, p_365299_, p_364308_, p_364282_, p_362149_, this.capturedFrustum != null ? this.capturedFrustum : this.cullingFrustum, RenderSystem.getModelViewMatrix(), RenderSystem.getProjectionMatrix());
++ }
++
++ private void addParticlesPass(FrameGraphBuilder p_363357_, Camera p_365299_, LightTexture p_364308_, float p_364282_, FogParameters p_362149_, Frustum frustum, Matrix4f modelViewMatrix, Matrix4f projectionMatrix) {
+ FramePass framepass = p_363357_.addPass("particles");
+ if (this.targets.particles != null) {
+ this.targets.particles = framepass.readsAndWrites(this.targets.particles);
+@@ -684,7 +_,8 @@
+ }
- public LevelRenderer(Minecraft p_234245_, EntityRenderDispatcher p_234246_, BlockEntityRenderDispatcher p_234247_, RenderBuffers p_234248_) {
- this.minecraft = p_234245_;
-@@ -256,6 +_,8 @@
+ RenderStateShard.PARTICLES_TARGET.setupRenderState();
+- this.minecraft.particleEngine.render(p_364308_, p_365299_, p_364282_);
++ this.minecraft.particleEngine.render(p_364308_, p_365299_, p_364282_, frustum, resourcehandle1 == null ? type -> type.isTranslucent() : type -> true); // Neo: only render translucent particles here in Fast/Fancy
++ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES, this, null, modelViewMatrix, projectionMatrix, this.ticks, p_365299_, getFrustum());
+ RenderStateShard.PARTICLES_TARGET.clearRenderState();
+ });
}
+@@ -713,11 +_,20 @@
+ resourcehandle.get().clear();
+ }
- private void renderSnowAndRain(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) {
-+ if (level.effects().renderSnowAndRain(level, ticks, p_109705_, p_109704_, p_109706_, p_109707_, p_109708_))
-+ return;
- float f = this.minecraft.level.getRainLevel(p_109705_);
- if (!(f <= 0.0F)) {
- p_109704_.turnOnLightLayer();
-@@ -418,6 +_,8 @@
++ if (!level.effects().renderClouds(level, ticks, p_365209_, p_362985_.x, p_362985_.y, p_362985_.z, p_362864_, p_360602_))
+ this.cloudRenderer.render(p_362342_, p_364196_, p_362337_, p_362864_, p_360602_, p_362985_, p_365209_);
+ });
}
- public void tickRain(Camera p_109694_) {
-+ if (level.effects().tickRain(level, ticks, p_109694_))
-+ return;
- 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);
-@@ -942,9 +_,11 @@
- RenderSystem.clear(16640, Minecraft.ON_OSX);
- 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, f1, flag1, f);
- profilerfiller.popPush("sky");
- RenderSystem.setShader(GameRenderer::getPositionShader);
- this.renderSky(p_254120_, p_323920_, f, p_109604_, flag1, () -> FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f1, flag1, f));
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_SKY, this, null, p_254120_, p_323920_, this.ticks, p_109604_, frustum);
- profilerfiller.popPush("fog");
- FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f1, 32.0F), flag1, f);
- profilerfiller.popPush("terrain_setup");
-@@ -953,7 +_,9 @@
- this.compileSections(p_109604_);
- profilerfiller.popPush("terrain");
- this.renderSectionLayer(RenderType.solid(), d0, d1, d2, p_254120_, p_323920_);
-+ this.minecraft.getModelManager().getAtlas(TextureAtlas.LOCATION_BLOCKS).setBlurMipmap(false, this.minecraft.options.mipmapLevels().get() > 0); // Neo: fix flickering leaves when mods mess up the blurMipmap settings
- this.renderSectionLayer(RenderType.cutoutMipped(), d0, d1, d2, p_254120_, p_323920_);
-+ this.minecraft.getModelManager().getAtlas(TextureAtlas.LOCATION_BLOCKS).restoreLastBlurMipmap();
- this.renderSectionLayer(RenderType.cutout(), d0, d1, d2, p_254120_, p_323920_);
- if (this.level.effects().constantAmbientLight()) {
- Lighting.setupNetherLevel();
-@@ -996,7 +_,7 @@
- || p_109604_.isDetached()
- || p_109604_.getEntity() instanceof LivingEntity && ((LivingEntity)p_109604_.getEntity()).isSleeping()
++ /**
++ * @deprecated Neo: use {@link #addWeatherPass(FrameGraphBuilder, LightTexture, Vec3, float, FogParameters, Matrix4f, Matrix4f, Camera)} instead
++ */
++ @Deprecated
+ private void addWeatherPass(FrameGraphBuilder p_364025_, LightTexture p_361536_, Vec3 p_360771_, float p_362434_, FogParameters p_360974_) {
++ addWeatherPass(p_364025_, p_361536_, p_360771_, p_362434_, p_360974_, RenderSystem.getModelViewMatrix(), RenderSystem.getProjectionMatrix(), this.minecraft.gameRenderer.getMainCamera());
++ }
++
++ private void addWeatherPass(FrameGraphBuilder p_364025_, LightTexture p_361536_, Vec3 p_360771_, float p_362434_, FogParameters p_360974_, Matrix4f modelViewMatrix, Matrix4f projectionMatrix, Camera camera) {
+ int i = this.minecraft.options.getEffectiveRenderDistance() * 16;
+ float f = this.minecraft.gameRenderer.getDepthFar();
+ FramePass framepass = p_364025_.addPass("weather");
+@@ -731,6 +_,7 @@
+ RenderSystem.setShaderFog(p_360974_);
+ RenderStateShard.WEATHER_TARGET.setupRenderState();
+ this.weatherEffectRenderer.render(this.minecraft.level, p_361536_, this.ticks, p_362434_, p_360771_);
++ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_WEATHER, this, null, modelViewMatrix, projectionMatrix, this.ticks, camera, getFrustum());
+ this.worldBorderRenderer.render(this.level.getWorldBorder(), p_360771_, (double)i, (double)f);
+ RenderStateShard.WEATHER_TARGET.clearRenderState();
+ });
+@@ -775,11 +_,14 @@
+ || p_363510_.isDetached()
+ || p_363510_.getEntity() instanceof LivingEntity && ((LivingEntity)p_363510_.getEntity()).isSleeping()
)
-- && (!(entity instanceof LocalPlayer) || p_109604_.getEntity() == entity)) {
-+ && (!(entity instanceof LocalPlayer) || p_109604_.getEntity() == entity || (entity == minecraft.player && !minecraft.player.isSpectator()))) { // Neo: render local player entity when it is not the camera entity
- this.renderedEntities++;
- if (entity.tickCount == 0) {
- entity.xOld = entity.getX();
-@@ -1012,6 +_,9 @@
- int i = entity.getTeamColor();
- outlinebuffersource.setColor(FastColor.ARGB32.red(i), FastColor.ARGB32.green(i), FastColor.ARGB32.blue(i), 255);
- } else {
-+ if (this.shouldShowEntityOutlines() && entity.hasCustomOutlineRendering(this.minecraft.player)) { // FORGE: allow custom outline rendering
-+ flag2 = true;
-+ }
- multibuffersource = multibuffersource$buffersource;
+- && (!(entity instanceof LocalPlayer) || p_363510_.getEntity() == entity)) {
++ && (!(entity instanceof LocalPlayer) || p_363510_.getEntity() == entity || (entity == minecraft.player && !minecraft.player.isSpectator()))) { // Neo: render local player entity when it is not the camera entity
+ p_363380_.add(entity);
+ if (flag1 && this.minecraft.shouldEntityAppearGlowing(entity)) {
+ flag = true;
}
++ else if (flag1 && entity.hasCustomOutlineRendering(this.minecraft.player)) { // FORGE: allow custom outline rendering
++ flag = true;
++ }
+ }
+ }
+ }
+@@ -825,10 +_,12 @@
+ double d1 = vec3.y();
+ double d2 = vec3.z();
-@@ -1027,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));
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_ENTITIES, this, posestack, p_254120_, p_323920_, this.ticks, p_109604_, frustum);
- profilerfiller.popPush("blockentities");
-
++ Frustum frustum = getFrustum();
for (SectionRenderDispatcher.RenderSection sectionrenderdispatcher$rendersection : this.visibleSections) {
List list = sectionrenderdispatcher$rendersection.getCompiled().getRenderableBlockEntities();
if (!list.isEmpty()) {
- for (BlockEntity blockentity1 : list) {
-+ if (!net.neoforged.neoforge.client.ClientHooks.isBlockEntityRendererVisible(blockEntityRenderDispatcher, blockentity1, frustum)) continue;
- BlockPos blockpos4 = blockentity1.getBlockPos();
- MultiBufferSource multibuffersource1 = multibuffersource$buffersource;
- posestack.pushPose();
-@@ -1051,6 +_,9 @@
- };
- }
- }
-+ if (this.shouldShowEntityOutlines() && blockentity1.hasCustomOutlineRendering(this.minecraft.player)) { // Neo: allow custom outline rendering
-+ flag2 = true;
-+ }
-
- this.blockEntityRenderDispatcher.render(blockentity1, f, posestack, multibuffersource1);
- posestack.popPose();
-@@ -1060,9 +_,13 @@
+ for (BlockEntity blockentity : list) {
++ if (!net.neoforged.neoforge.client.ClientHooks.isBlockEntityRendererVisible(blockEntityRenderDispatcher, blockentity, frustum)) continue;
+ BlockPos blockpos = blockentity.getBlockPos();
+ MultiBufferSource multibuffersource = p_363819_;
+ p_362832_.pushPose();
+@@ -856,6 +_,7 @@
synchronized (this.globalBlockEntities) {
- for (BlockEntity blockentity : this.globalBlockEntities) {
-+ if (!net.neoforged.neoforge.client.ClientHooks.isBlockEntityRendererVisible(blockEntityRenderDispatcher, blockentity, frustum)) continue;
- BlockPos blockpos3 = blockentity.getBlockPos();
- posestack.pushPose();
- posestack.translate((double)blockpos3.getX() - d0, (double)blockpos3.getY() - d1, (double)blockpos3.getZ() - d2);
-+ if (this.shouldShowEntityOutlines() && blockentity.hasCustomOutlineRendering(this.minecraft.player)) { // Neo: allow custom outline rendering
-+ flag2 = true;
-+ }
- this.blockEntityRenderDispatcher.render(blockentity, f, posestack, multibuffersource$buffersource);
- posestack.popPose();
- }
-@@ -1080,11 +_,17 @@
- multibuffersource$buffersource.endBatch(Sheets.hangingSignSheet());
- multibuffersource$buffersource.endBatch(Sheets.chestSheet());
- this.renderBuffers.outlineBufferSource().endOutlineBatch();
-+ // Neo: handle outline effect requests outside glowing entities
-+ if (this.outlineEffectRequested) {
-+ flag2 |= this.shouldShowEntityOutlines();
-+ this.outlineEffectRequested = false;
-+ }
- if (flag2) {
- this.entityEffect.process(p_348530_.getGameTimeDeltaTicks());
- this.minecraft.getMainRenderTarget().bindWrite(false);
- }
-
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_BLOCK_ENTITIES, this, posestack, p_254120_, p_323920_, this.ticks, p_109604_, frustum);
- profilerfiller.popPush("destroyProgress");
-
- for (Entry> entry : this.destructionProgress.long2ObjectEntrySet()) {
-@@ -1102,9 +_,10 @@
- VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(
- this.renderBuffers.crumblingBufferSource().getBuffer(ModelBakery.DESTROY_TYPES.get(k)), posestack$pose1, 1.0F
+ for (BlockEntity blockentity1 : this.globalBlockEntities) {
++ if (!net.neoforged.neoforge.client.ClientHooks.isBlockEntityRendererVisible(blockEntityRenderDispatcher, blockentity1, frustum)) continue;
+ BlockPos blockpos1 = blockentity1.getBlockPos();
+ p_362832_.pushPose();
+ p_362832_.translate((double)blockpos1.getX() - d0, (double)blockpos1.getY() - d1, (double)blockpos1.getZ() - d2);
+@@ -883,9 +_,10 @@
+ VertexConsumer vertexconsumer = new SheetedDecalTextureGenerator(
+ p_365216_.getBuffer(ModelBakery.DESTROY_TYPES.get(i)), posestack$pose, 1.0F
);
-+ net.neoforged.neoforge.client.model.data.ModelData modelData = level.getModelData(blockpos2);
++ net.neoforged.neoforge.client.model.data.ModelData modelData = level.getModelData(blockpos);
this.minecraft
.getBlockRenderer()
-- .renderBreakingTexture(this.level.getBlockState(blockpos2), blockpos2, this.level, posestack, vertexconsumer1);
-+ .renderBreakingTexture(this.level.getBlockState(blockpos2), blockpos2, this.level, posestack, vertexconsumer1, modelData);
- posestack.popPose();
+- .renderBreakingTexture(this.level.getBlockState(blockpos), blockpos, this.level, p_363901_, vertexconsumer);
++ .renderBreakingTexture(this.level.getBlockState(blockpos), blockpos, this.level, p_363901_, vertexconsumer, modelData);
+ p_363901_.popPose();
}
}
-@@ -1116,10 +_,13 @@
- profilerfiller.popPush("outline");
- BlockPos blockpos1 = ((BlockHitResult)hitresult).getBlockPos();
- BlockState blockstate = this.level.getBlockState(blockpos1);
-+ if (!net.neoforged.neoforge.client.ClientHooks.onDrawHighlight(this, p_109604_, hitresult, p_348530_, posestack, multibuffersource$buffersource))
- if (!blockstate.isAir() && this.level.getWorldBorder().isWithinBounds(blockpos1)) {
- VertexConsumer vertexconsumer2 = multibuffersource$buffersource.getBuffer(RenderType.lines());
- this.renderHitOutline(posestack, vertexconsumer2, p_109604_.getEntity(), d0, d1, d2, blockpos1, blockstate);
- }
-+ } else if (hitresult != null && hitresult.getType() == HitResult.Type.ENTITY) {
-+ net.neoforged.neoforge.client.ClientHooks.onDrawHighlight(this, p_109604_, hitresult, p_348530_, posestack, multibuffersource$buffersource);
- }
-
- this.minecraft.debugRenderer.render(posestack, multibuffersource$buffersource, d0, d1, d2);
-@@ -1147,9 +_,13 @@
- this.particlesTarget.copyDepthFrom(this.minecraft.getMainRenderTarget());
- RenderStateShard.PARTICLES_TARGET.setupRenderState();
- profilerfiller.popPush("particles");
-- this.minecraft.particleEngine.render(p_109606_, p_109604_, f);
-+ this.minecraft.particleEngine.render(p_109606_, p_109604_, f, frustum, type -> true);
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES, this, posestack, p_254120_, p_323920_, this.ticks, p_109604_, frustum);
- RenderStateShard.PARTICLES_TARGET.clearRenderState();
- } else {
-+ // Neo: render solid particles before translucent geometry to match order of chunk render types, fixes solid particles disappearing underwater in Fast/Fancy (MC-161917)
-+ profilerfiller.popPush("solid_particles");
-+ this.minecraft.particleEngine.render(p_109606_, p_109604_, f, frustum, type -> !type.isTranslucent());
- profilerfiller.popPush("translucent");
- if (this.translucentTarget != null) {
- this.translucentTarget.clear(Minecraft.ON_OSX);
-@@ -1161,7 +_,8 @@
- profilerfiller.popPush("string");
- this.renderSectionLayer(RenderType.tripwire(), d0, d1, d2, p_254120_, p_323920_);
- profilerfiller.popPush("particles");
-- this.minecraft.particleEngine.render(p_109606_, p_109604_, f);
-+ this.minecraft.particleEngine.render(p_109606_, p_109604_, f, frustum, type -> type.isTranslucent()); // Neo: only render translucent particles at this stage
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES, this, posestack, p_254120_, p_323920_, this.ticks, p_109604_, frustum);
+@@ -897,6 +_,7 @@
+ if (blockhitresult.getType() != HitResult.Type.MISS) {
+ BlockPos blockpos = blockhitresult.getBlockPos();
+ BlockState blockstate = this.level.getBlockState(blockpos);
++ if (!net.neoforged.neoforge.client.ClientHooks.onDrawHighlight(this, p_363911_, blockhitresult, this.minecraft.getDeltaTracker(), p_361893_, p_362782_, p_361698_))
+ if (!blockstate.isAir() && this.level.getWorldBorder().isWithinBounds(blockpos)) {
+ boolean flag = ItemBlockRenderTypes.getChunkRenderType(blockstate).sortOnUpload();
+ if (flag != p_361698_) {
+@@ -1026,6 +_,7 @@
+ compiledshaderprogram.clear();
+ VertexBuffer.unbind();
+ zone.close();
++ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(p_294513_, this, p_294782_, p_324517_, this.ticks, this.minecraft.gameRenderer.getMainCamera(), this.getFrustum());
+ p_294513_.clearRenderState();
}
-
- if (this.minecraft.options.getCloudsType() != CloudStatus.OFF) {
-@@ -1177,6 +_,7 @@
- RenderStateShard.WEATHER_TARGET.setupRenderState();
- profilerfiller.popPush("weather");
- this.renderSnowAndRain(p_109606_, f, d0, d1, d2);
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_WEATHER, this, posestack, p_254120_, p_323920_, this.ticks, p_109604_, frustum);
- this.renderWorldBorder(p_109604_);
- RenderStateShard.WEATHER_TARGET.clearRenderState();
- this.transparencyChain.process(p_348530_.getGameTimeDeltaTicks());
-@@ -1185,6 +_,7 @@
- RenderSystem.depthMask(false);
- profilerfiller.popPush("weather");
- this.renderSnowAndRain(p_109606_, f, d0, d1, d2);
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_WEATHER, this, posestack, p_254120_, p_323920_, this.ticks, p_109604_, frustum);
- this.renderWorldBorder(p_109604_);
- RenderSystem.depthMask(true);
- }
-@@ -1293,6 +_,7 @@
- shaderinstance.clear();
- VertexBuffer.unbind();
- this.minecraft.getProfiler().pop();
-+ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(p_294513_, this, p_294782_, p_324517_, this.ticks, this.minecraft.gameRenderer.getMainCamera(), this.getFrustum());
- p_294513_.clearRenderState();
- }
-
-@@ -1543,6 +_,8 @@
}
-
- public void renderSky(Matrix4f p_254034_, Matrix4f p_324386_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) {
-+ if (level.effects().renderSky(level, ticks, p_202426_, p_254034_, p_202427_, p_324386_, p_202428_, p_202429_))
-+ return;
- p_202429_.run();
- if (!p_202428_) {
- FogType fogtype = p_202427_.getFluidInCamera();
-@@ -1666,6 +_,8 @@
+@@ -1066,7 +_,15 @@
+ }
}
- public void renderClouds(PoseStack p_254145_, Matrix4f p_254537_, Matrix4f p_324366_, float p_254364_, double p_253843_, double p_253663_, double p_253795_) {
-+ if (level.effects().renderClouds(level, ticks, p_254364_, p_254145_, p_253843_, p_253663_, p_253795_, p_254537_, p_324366_))
-+ return;
- float f = this.level.effects().getCloudHeight();
- if (!Float.isNaN(f)) {
- float f1 = 12.0F;
-@@ -2488,6 +_,31 @@
- this.viewArea.setDirty(p_109502_, p_109503_, p_109504_, p_109505_);
- }
++ /**
++ * @deprecated Neo: use {@link #addSkyPass(FrameGraphBuilder, Camera, float, FogParameters, Matrix4f, Matrix4f)} instead
++ */
++ @Deprecated
+ private void addSkyPass(FrameGraphBuilder p_362870_, Camera p_362177_, float p_363799_, FogParameters p_364999_) {
++ addSkyPass(p_362870_, p_362177_, p_363799_, p_364999_, RenderSystem.getModelViewMatrix(), RenderSystem.getProjectionMatrix());
++ }
++
++ private void addSkyPass(FrameGraphBuilder p_362870_, Camera p_362177_, float p_363799_, FogParameters p_364999_, Matrix4f modelViewMatrix, Matrix4f projectionMatrix) {
+ FogType fogtype = p_362177_.getFluidInCamera();
+ if (fogtype != FogType.POWDER_SNOW && fogtype != FogType.LAVA && !this.doesMobEffectBlockSky(p_362177_)) {
+ DimensionSpecialEffects dimensionspecialeffects = this.level.effects();
+@@ -1075,6 +_,7 @@
+ FramePass framepass = p_362870_.addPass("sky");
+ this.targets.main = framepass.readsAndWrites(this.targets.main);
+ framepass.executes(() -> {
++ if (!level.effects().renderSky(level, ticks, p_363799_, modelViewMatrix, p_362177_, projectionMatrix, () -> RenderSystem.setShaderFog(p_364999_))) {
+ RenderSystem.setShaderFog(p_364999_);
+ RenderStateShard.MAIN_TARGET.setupRenderState();
+ PoseStack posestack = new PoseStack();
+@@ -1102,6 +_,8 @@
+ this.skyRenderer.renderDarkDisc(posestack);
+ }
+ }
++ }
++ net.neoforged.neoforge.client.ClientHooks.dispatchRenderStage(net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage.AFTER_SKY, this, null, modelViewMatrix, projectionMatrix, this.ticks, p_362177_, getFrustum());
+ });
+ }
+ }
+@@ -1413,7 +_,7 @@
+ } else {
+ int i = p_109538_.getBrightness(LightLayer.SKY, p_109540_);
+ int j = p_109538_.getBrightness(LightLayer.BLOCK, p_109540_);
+- int k = p_109539_.getLightEmission();
++ int k = p_109539_.getLightEmission(p_109538_, p_109540_);
+ if (j < k) {
+ j = k;
+ }
+@@ -1475,5 +_,22 @@
+ public CloudRenderer getCloudRenderer() {
+ return this.cloudRenderer;
++ }
++
+ public Frustum getFrustum() {
+ return this.capturedFrustum != null ? this.capturedFrustum : this.cullingFrustum;
+ }
@@ -239,36 +248,5 @@
+ synchronized (this.globalBlockEntities) {
+ this.globalBlockEntities.forEach(blockEntityConsumer);
+ }
-+ }
-+
-+ /**
-+ * Neo: Request outline effect post-processing to be enabled for the current frame. Must be called before block
-+ * entities are done rendering, ideally early during the frame
-+ */
-+ public void requestOutlineEffect() {
-+ this.outlineEffectRequested = true;
-+ }
-+
- public void playJukeboxSong(Holder p_350918_, BlockPos p_350830_) {
- if (this.level != null) {
- this.stopJukeboxSong(p_350830_);
-@@ -3008,8 +_,8 @@
- break;
- case 2001:
- BlockState blockstate1 = Block.stateById(p_234307_);
-- if (!blockstate1.isAir()) {
-- SoundType soundtype = blockstate1.getSoundType();
-+ if (!blockstate1.isAir() && !net.neoforged.neoforge.client.extensions.common.IClientBlockExtensions.of(blockstate1).playBreakSound(blockstate1, this.level, p_234306_)) {
-+ SoundType soundtype = blockstate1.getSoundType(this.level, p_234306_, null);
- this.level
- .playLocalSound(
- p_234306_, soundtype.getBreakSound(), SoundSource.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F, false
-@@ -3495,7 +_,7 @@
- } else {
- int i = p_109538_.getBrightness(LightLayer.SKY, p_109540_);
- int j = p_109538_.getBrightness(LightLayer.BLOCK, p_109540_);
-- int k = p_109539_.getLightEmission();
-+ int k = p_109539_.getLightEmission(p_109538_, p_109540_);
- if (j < k) {
- j = k;
- }
+ }
+ }
diff --git a/patches/net/minecraft/client/renderer/LightTexture.java.patch b/patches/net/minecraft/client/renderer/LightTexture.java.patch
index 72db3bdff61..da6b2dc0764 100644
--- a/patches/net/minecraft/client/renderer/LightTexture.java.patch
+++ b/patches/net/minecraft/client/renderer/LightTexture.java.patch
@@ -1,19 +1,10 @@
--- a/net/minecraft/client/renderer/LightTexture.java
+++ b/net/minecraft/client/renderer/LightTexture.java
-@@ -129,6 +_,8 @@
- }
- }
-
-+ clientlevel.effects().adjustLightmapColors(clientlevel, p_109882_, f, f7, f8, j, i, vector3f1);
-+
- if (f5 > 0.0F) {
- float f13 = Math.max(vector3f1.x(), Math.max(vector3f1.y(), vector3f1.z()));
- if (f13 < 1.0F) {
-@@ -186,7 +_,7 @@
+@@ -141,7 +_,7 @@
}
public static int block(int p_109884_) {
-- return p_109884_ >> 4 & 65535;
+- return p_109884_ >>> 4 & 15;
+ return (p_109884_ & 0xFFFF) >> 4; // Forge: Fix fullbright quads showing dark artifacts. Reported as MC-169806
}
diff --git a/patches/net/minecraft/client/renderer/MapRenderer.java.patch b/patches/net/minecraft/client/renderer/MapRenderer.java.patch
new file mode 100644
index 00000000000..dba5bf0f2fb
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/MapRenderer.java.patch
@@ -0,0 +1,21 @@
+--- a/net/minecraft/client/renderer/MapRenderer.java
++++ b/net/minecraft/client/renderer/MapRenderer.java
+@@ -42,6 +_,10 @@
+
+ for (MapRenderState.MapDecorationRenderState maprenderstate$mapdecorationrenderstate : p_360365_.decorations) {
+ if (!p_362262_ || maprenderstate$mapdecorationrenderstate.renderOnFrame) {
++ if (net.neoforged.neoforge.client.gui.map.MapDecorationRendererManager.render(maprenderstate$mapdecorationrenderstate, p_362483_, p_363581_, p_360365_, MapRenderer.this.decorationTextures, p_362262_, p_364872_, i)) {
++ i++;
++ continue;
++ }
+ p_362483_.pushPose();
+ p_362483_.translate(
+ (float)maprenderstate$mapdecorationrenderstate.x / 2.0F + 64.0F, (float)maprenderstate$mapdecorationrenderstate.y / 2.0F + 64.0F, -0.02F
+@@ -115,6 +_,7 @@
+
+ private MapRenderState.MapDecorationRenderState extractDecorationRenderState(MapDecoration p_364175_) {
+ MapRenderState.MapDecorationRenderState maprenderstate$mapdecorationrenderstate = new MapRenderState.MapDecorationRenderState();
++ maprenderstate$mapdecorationrenderstate.type = p_364175_.type();
+ maprenderstate$mapdecorationrenderstate.atlasSprite = this.decorationTextures.get(p_364175_);
+ maprenderstate$mapdecorationrenderstate.x = p_364175_.x();
+ maprenderstate$mapdecorationrenderstate.y = p_364175_.y();
diff --git a/patches/net/minecraft/client/renderer/PanoramaRenderer.java.patch b/patches/net/minecraft/client/renderer/PanoramaRenderer.java.patch
deleted file mode 100644
index 4111b68d7da..00000000000
--- a/patches/net/minecraft/client/renderer/PanoramaRenderer.java.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/net/minecraft/client/renderer/PanoramaRenderer.java
-+++ b/net/minecraft/client/renderer/PanoramaRenderer.java
-@@ -30,6 +_,8 @@
- p_334063_.blit(PANORAMA_OVERLAY, 0, 0, p_333839_, p_333923_, 0.0F, 0.0F, 16, 128, 16, 128);
- p_334063_.setColor(1.0F, 1.0F, 1.0F, 1.0F);
- RenderSystem.disableBlend();
-+ // Neo: disable depth test again to prevent issues with extended far plane values for screen layers and HUD layers
-+ RenderSystem.disableDepthTest();
- }
-
- private static float wrap(float p_249058_, float p_249548_) {
diff --git a/patches/net/minecraft/client/renderer/PostChain.java.patch b/patches/net/minecraft/client/renderer/PostChain.java.patch
deleted file mode 100644
index 7dbfffbbf77..00000000000
--- a/patches/net/minecraft/client/renderer/PostChain.java.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/net/minecraft/client/renderer/PostChain.java
-+++ b/net/minecraft/client/renderer/PostChain.java
-@@ -156,7 +_,8 @@
- throw new ChainedJsonException("Render target '" + s4 + "' can't be used as depth buffer");
- }
-
-- ResourceLocation resourcelocation = ResourceLocation.withDefaultNamespace("textures/effect/" + s4 + ".png");
-+ ResourceLocation rl = ResourceLocation.tryParse(s4);
-+ ResourceLocation resourcelocation = ResourceLocation.fromNamespaceAndPath(rl.getNamespace(), "textures/effect/" + rl.getPath() + ".png");
- this.resourceProvider
- .getResource(resourcelocation)
- .orElseThrow(() -> new ChainedJsonException("Render target or texture '" + s4 + "' does not exist"));
-@@ -257,6 +_,7 @@
- public void addTempTarget(String p_110039_, int p_110040_, int p_110041_) {
- RenderTarget rendertarget = new TextureTarget(p_110040_, p_110041_, true, Minecraft.ON_OSX);
- rendertarget.setClearColor(0.0F, 0.0F, 0.0F, 0.0F);
-+ if (screenTarget.isStencilEnabled()) { rendertarget.enableStencil(); }
- this.customRenderTargets.put(p_110039_, rendertarget);
- if (p_110040_ == this.screenWidth && p_110041_ == this.screenHeight) {
- this.fullSizedTargets.add(rendertarget);
diff --git a/patches/net/minecraft/client/renderer/RenderBuffers.java.patch b/patches/net/minecraft/client/renderer/RenderBuffers.java.patch
index 97da5ee8f4b..ad6b76cc6ea 100644
--- a/patches/net/minecraft/client/renderer/RenderBuffers.java.patch
+++ b/patches/net/minecraft/client/renderer/RenderBuffers.java.patch
@@ -1,10 +1,10 @@
--- a/net/minecraft/client/renderer/RenderBuffers.java
+++ b/net/minecraft/client/renderer/RenderBuffers.java
-@@ -37,6 +_,7 @@
- put((Object2ObjectLinkedOpenHashMap)p_349871_, RenderType.waterMask());
- ModelBakery.DESTROY_TYPES.forEach(p_173062_ -> put(p_349871_, p_173062_));
+@@ -35,6 +_,7 @@
+ put((Object2ObjectLinkedOpenHashMap)p_366352_, RenderType.entityGlint());
+ put((Object2ObjectLinkedOpenHashMap)p_366352_, RenderType.waterMask());
});
+ net.neoforged.fml.ModLoader.postEvent(new net.neoforged.neoforge.client.event.RegisterRenderBuffersEvent(sequencedmap));
- this.crumblingBufferSource = MultiBufferSource.immediate(new ByteBufferBuilder(1536));
this.bufferSource = MultiBufferSource.immediateWithBuffers(sequencedmap, new ByteBufferBuilder(786432));
this.outlineBufferSource = new OutlineBufferSource(this.bufferSource);
+ SequencedMap sequencedmap1 = Util.make(
diff --git a/patches/net/minecraft/client/renderer/RenderType.java.patch b/patches/net/minecraft/client/renderer/RenderType.java.patch
index 568f0746496..3e99b7801ad 100644
--- a/patches/net/minecraft/client/renderer/RenderType.java.patch
+++ b/patches/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
-@@ -968,7 +_,7 @@
+@@ -1080,7 +_,7 @@
}
public static RenderType text(ResourceLocation p_110498_) {
@@ -9,7 +9,7 @@
}
public static RenderType textBackground() {
-@@ -976,19 +_,19 @@
+@@ -1088,19 +_,19 @@
}
public static RenderType textIntensity(ResourceLocation p_173238_) {
@@ -33,7 +33,7 @@
}
public static RenderType textBackgroundSeeThrough() {
-@@ -996,7 +_,7 @@
+@@ -1108,7 +_,7 @@
}
public static RenderType textIntensitySeeThrough(ResourceLocation p_173241_) {
@@ -42,7 +42,7 @@
}
public static RenderType lightning() {
-@@ -1453,5 +_,17 @@
+@@ -1604,5 +_,17 @@
public String toString() {
return this.name;
}
diff --git a/patches/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch b/patches/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch
index ca33ed78402..901854e375d 100644
--- a/patches/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/ScreenEffectRenderer.java.patch
@@ -55,7 +55,7 @@
+ }
+
+ public static void renderFluid(Minecraft p_110726_, PoseStack p_110727_, ResourceLocation texture) {
- RenderSystem.setShader(GameRenderer::getPositionTexShader);
+ RenderSystem.setShader(CoreShaders.POSITION_TEX);
- RenderSystem.setShaderTexture(0, UNDERWATER_LOCATION);
+ RenderSystem.setShaderTexture(0, texture);
BlockPos blockpos = BlockPos.containing(p_110726_.player.getX(), p_110726_.player.getEyeY(), p_110726_.player.getZ());
diff --git a/patches/net/minecraft/client/renderer/ShaderInstance.java.patch b/patches/net/minecraft/client/renderer/ShaderInstance.java.patch
deleted file mode 100644
index 2192fa0913f..00000000000
--- a/patches/net/minecraft/client/renderer/ShaderInstance.java.patch
+++ /dev/null
@@ -1,57 +0,0 @@
---- a/net/minecraft/client/renderer/ShaderInstance.java
-+++ b/net/minecraft/client/renderer/ShaderInstance.java
-@@ -94,10 +_,14 @@
- @Nullable
- public final Uniform CHUNK_OFFSET;
-
-+ @Deprecated // FORGE: Use the ResourceLocation variant below
- public ShaderInstance(ResourceProvider p_173336_, String p_173337_, VertexFormat p_173338_) throws IOException {
-- this.name = p_173337_;
-+ this(p_173336_, ResourceLocation.parse(p_173337_), p_173338_);
-+ }
-+ public ShaderInstance(ResourceProvider p_173336_, ResourceLocation shaderLocation, VertexFormat p_173338_) throws IOException {
-+ this.name = shaderLocation.getNamespace().equals("minecraft") ? shaderLocation.getPath() : shaderLocation.toString();
- this.vertexFormat = p_173338_;
-- ResourceLocation resourcelocation = ResourceLocation.withDefaultNamespace("shaders/core/" + p_173337_ + ".json");
-+ ResourceLocation resourcelocation = ResourceLocation.fromNamespaceAndPath(shaderLocation.getNamespace(), "shaders/core/" + shaderLocation.getPath() + ".json");
-
- try (Reader reader = p_173336_.openAsReader(resourcelocation)) {
- JsonObject jsonobject = GsonHelper.parse(reader);
-@@ -177,8 +_,10 @@
- Program program1 = p_173342_.getPrograms().get(p_173343_);
- Program program;
- if (program1 == null) {
-- String s = "shaders/core/" + p_173343_ + p_173342_.getExtension();
-- Resource resource = p_173341_.getResourceOrThrow(ResourceLocation.withDefaultNamespace(s));
-+ ResourceLocation loc = ResourceLocation.parse(p_173343_);
-+ String s = "shaders/core/" + loc.getPath() + p_173342_.getExtension();
-+ ResourceLocation resourcelocation = ResourceLocation.fromNamespaceAndPath(loc.getNamespace(), s);
-+ Resource resource = p_173341_.getResourceOrThrow(resourcelocation);
-
- try (InputStream inputstream = resource.open()) {
- final String s1 = FileUtil.getFullResourcePath(s);
-@@ -187,11 +_,11 @@
-
- @Override
- public String applyImport(boolean p_173374_, String p_173375_) {
-- p_173375_ = FileUtil.normalizeResourcePath((p_173374_ ? s1 : "shaders/include/") + p_173375_);
-- if (!this.importedPaths.add(p_173375_)) {
-+ // FORGE: use the mod's namespace to look up resources if specified
-+ ResourceLocation resourcelocation = net.neoforged.neoforge.client.ClientHooks.getShaderImportLocation(s1, p_173374_, p_173375_);
-+ if (!this.importedPaths.add(resourcelocation.toString())) {
- return null;
- } else {
-- ResourceLocation resourcelocation = ResourceLocation.parse(p_173375_);
-
- try {
- String s2;
-@@ -201,7 +_,8 @@
-
- return s2;
- } catch (IOException ioexception) {
-- ShaderInstance.LOGGER.error("Could not open GLSL import {}: {}", p_173375_, ioexception.getMessage());
-+ // FORGE: specify the namespace of the failed import in case of duplicates from multiple mods
-+ ShaderInstance.LOGGER.error("Could not open GLSL import {}: {}", resourcelocation, ioexception.getMessage());
- return "#error " + ioexception.getMessage();
- }
- }
diff --git a/patches/net/minecraft/client/renderer/ShaderManager.java.patch b/patches/net/minecraft/client/renderer/ShaderManager.java.patch
new file mode 100644
index 00000000000..4e634d23e7a
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/ShaderManager.java.patch
@@ -0,0 +1,11 @@
+--- a/net/minecraft/client/renderer/ShaderManager.java
++++ b/net/minecraft/client/renderer/ShaderManager.java
+@@ -169,7 +_,7 @@
+ ShaderManager.CompilationCache shadermanager$compilationcache = new ShaderManager.CompilationCache(p_366597_);
+ Map map = new HashMap<>();
+
+- for (ShaderProgram shaderprogram : CoreShaders.getProgramsToPreload()) {
++ for (ShaderProgram shaderprogram : net.neoforged.neoforge.client.CoreShaderManager.getProgramsToPreload()) {
+ try {
+ shadermanager$compilationcache.programs.put(shaderprogram, Optional.of(shadermanager$compilationcache.compileProgram(shaderprogram)));
+ } catch (ShaderManager.CompilationException shadermanager$compilationexception) {
diff --git a/patches/net/minecraft/client/renderer/Sheets.java.patch b/patches/net/minecraft/client/renderer/Sheets.java.patch
index b2ff568d8ac..cb01eb86db6 100644
--- a/patches/net/minecraft/client/renderer/Sheets.java.patch
+++ b/patches/net/minecraft/client/renderer/Sheets.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/Sheets.java
+++ b/net/minecraft/client/renderer/Sheets.java
-@@ -146,11 +_,13 @@
+@@ -141,11 +_,13 @@
}
private static Material createSignMaterial(WoodType p_173386_) {
@@ -16,7 +16,7 @@
}
public static Material getSignMaterial(WoodType p_173382_) {
-@@ -209,6 +_,23 @@
+@@ -204,6 +_,23 @@
case SINGLE:
default:
return p_110773_;
diff --git a/patches/net/minecraft/client/renderer/WeatherEffectRenderer.java.patch b/patches/net/minecraft/client/renderer/WeatherEffectRenderer.java.patch
new file mode 100644
index 00000000000..180f282591c
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/WeatherEffectRenderer.java.patch
@@ -0,0 +1,20 @@
+--- a/net/minecraft/client/renderer/WeatherEffectRenderer.java
++++ b/net/minecraft/client/renderer/WeatherEffectRenderer.java
+@@ -61,6 +_,8 @@
+ }
+
+ public void render(Level p_364994_, LightTexture p_363130_, int p_363664_, float p_361655_, Vec3 p_363375_) {
++ if (((ClientLevel) p_364994_).effects().renderSnowAndRain((ClientLevel) p_364994_, p_363664_, p_361655_, p_363130_, p_363375_.x, p_363375_.y, p_363375_.z))
++ return;
+ float f = p_364994_.getRainLevel(p_361655_);
+ if (!(f <= 0.0F)) {
+ int i = Minecraft.useFancyGraphics() ? 10 : 5;
+@@ -201,6 +_,8 @@
+ }
+
+ public void tickRainParticles(ClientLevel p_361823_, Camera p_364990_, int p_361788_, ParticleStatus p_363302_) {
++ if (p_361823_.effects().tickRain(p_361823_, p_361788_, p_364990_))
++ return;
+ float f = p_361823_.getRainLevel(1.0F) / (Minecraft.useFancyGraphics() ? 1.0F : 2.0F);
+ if (!(f <= 0.0F)) {
+ RandomSource randomsource = RandomSource.create((long)p_361788_ * 312987231L);
diff --git a/patches/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch b/patches/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch
index b393006515d..5ee7f47292b 100644
--- a/patches/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch
+++ b/patches/net/minecraft/client/renderer/block/BlockRenderDispatcher.java.patch
@@ -91,8 +91,8 @@
this.modelRenderer
.renderModel(
p_110914_.last(),
-- p_110915_.getBuffer(ItemBlockRenderTypes.getRenderType(p_110913_, false)),
-+ p_110915_.getBuffer(renderType != null ? renderType : net.neoforged.neoforge.client.RenderTypeHelper.getEntityRenderType(rt, false)),
+- p_110915_.getBuffer(ItemBlockRenderTypes.getRenderType(p_110913_)),
++ p_110915_.getBuffer(renderType != null ? renderType : net.neoforged.neoforge.client.RenderTypeHelper.getEntityRenderType(rt)),
p_110913_,
bakedmodel,
f,
diff --git a/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch b/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch
index 5eab04bb475..f2ca146f9c6 100644
--- a/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/block/LiquidBlockRenderer.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/block/LiquidBlockRenderer.java
+++ b/net/minecraft/client/renderer/block/LiquidBlockRenderer.java
-@@ -38,6 +_,7 @@
+@@ -37,6 +_,7 @@
this.waterIcons[0] = Minecraft.getInstance().getModelManager().getBlockModelShaper().getBlockModel(Blocks.WATER.defaultBlockState()).getParticleIcon();
this.waterIcons[1] = ModelBakery.WATER_FLOW.sprite();
this.waterOverlay = ModelBakery.WATER_OVERLAY.sprite();
@@ -20,7 +20,7 @@
float f = (float)(i >> 16 & 0xFF) / 255.0F;
float f1 = (float)(i >> 8 & 0xFF) / 255.0F;
float f2 = (float)(i & 0xFF) / 255.0F;
-@@ -181,15 +_,15 @@
+@@ -180,15 +_,15 @@
float f57 = f4 * f;
float f29 = f4 * f1;
float f30 = f4 * f2;
@@ -44,7 +44,7 @@
}
}
-@@ -202,10 +_,10 @@
+@@ -201,10 +_,10 @@
float f46 = f3 * f;
float f48 = f3 * f1;
float f50 = f3 * f2;
@@ -59,8 +59,8 @@
}
int j = this.getLightColor(p_234370_, p_234371_);
-@@ -260,10 +_,9 @@
- && !isFaceOccludedByNeighbor(p_234370_, p_234371_, direction, Math.max(f44, f45), p_234370_.getBlockState(p_234371_.relative(direction)))) {
+@@ -258,10 +_,9 @@
+ if (flag7 && !isFaceOccludedByNeighbor(direction, Math.max(f44, f45), p_234370_.getBlockState(p_234371_.relative(direction)))) {
BlockPos blockpos = p_234371_.relative(direction);
TextureAtlasSprite textureatlassprite2 = atextureatlassprite[1];
- if (!flag) {
@@ -73,7 +73,7 @@
}
}
-@@ -276,15 +_,15 @@
+@@ -274,15 +_,15 @@
float f33 = f4 * f32 * f;
float f34 = f4 * f32 * f1;
float f35 = f4 * f32 * f2;
@@ -98,7 +98,7 @@
}
}
}
-@@ -325,6 +_,26 @@
+@@ -323,6 +_,26 @@
private float getHeight(BlockAndTintGetter p_203157_, Fluid p_203158_, BlockPos p_203159_) {
BlockState blockstate = p_203157_.getBlockState(p_203159_);
return this.getHeight(p_203157_, p_203158_, p_203159_, blockstate, blockstate.getFluidState());
diff --git a/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch b/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch
index 94bd0b01f0c..49d5af1f7a8 100644
--- a/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/block/ModelBlockRenderer.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/block/ModelBlockRenderer.java
+++ b/net/minecraft/client/renderer/block/ModelBlockRenderer.java
-@@ -40,6 +_,7 @@
+@@ -39,6 +_,7 @@
this.blockColors = p_110999_;
}
@@ -8,34 +8,34 @@
public void tesselateBlock(
BlockAndTintGetter p_234380_,
BakedModel p_234381_,
-@@ -52,15 +_,35 @@
+@@ -51,14 +_,35 @@
long p_234388_,
int p_234389_
) {
- boolean flag = Minecraft.useAmbientOcclusion() && p_234382_.getLightEmission() == 0 && p_234381_.useAmbientOcclusion();
+ tesselateBlock(p_234380_, p_234381_, p_234382_, p_234383_, p_234384_, p_234385_, p_234386_, p_234387_, p_234388_, p_234389_, net.neoforged.neoforge.client.model.data.ModelData.EMPTY, null);
+ }
++
+ public void tesselateBlock(
-+ BlockAndTintGetter p_234380_,
-+ BakedModel p_234381_,
-+ BlockState p_234382_,
-+ BlockPos p_234383_,
-+ PoseStack p_234384_,
-+ VertexConsumer p_234385_,
-+ boolean p_234386_,
-+ RandomSource p_234387_,
-+ long p_234388_,
-+ int p_234389_,
-+ net.neoforged.neoforge.client.model.data.ModelData modelData,
-+ net.minecraft.client.renderer.RenderType renderType
++ BlockAndTintGetter p_234380_,
++ BakedModel p_234381_,
++ BlockState p_234382_,
++ BlockPos p_234383_,
++ PoseStack p_234384_,
++ VertexConsumer p_234385_,
++ boolean p_234386_,
++ RandomSource p_234387_,
++ long p_234388_,
++ int p_234389_,
++ net.neoforged.neoforge.client.model.data.ModelData modelData,
++ net.minecraft.client.renderer.RenderType renderType
+ ) {
+ boolean flag = Minecraft.useAmbientOcclusion() && switch(p_234381_.useAmbientOcclusion(p_234382_, modelData, renderType)) {
+ case TRUE -> true;
+ case DEFAULT -> p_234382_.getLightEmission(p_234380_, p_234383_) == 0;
+ case FALSE -> false;
+ };
- Vec3 vec3 = p_234382_.getOffset(p_234380_, p_234383_);
- p_234384_.translate(vec3.x, vec3.y, vec3.z);
+ p_234384_.translate(p_234382_.getOffset(p_234383_));
try {
if (flag) {
@@ -47,7 +47,7 @@
}
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Tesselating block model");
-@@ -71,6 +_,7 @@
+@@ -69,6 +_,7 @@
}
}
@@ -55,12 +55,13 @@
public void tesselateWithAO(
BlockAndTintGetter p_234391_,
BakedModel p_234392_,
-@@ -83,6 +_,22 @@
+@@ -81,6 +_,23 @@
long p_234399_,
int p_234400_
) {
+ tesselateWithAO(p_234391_, p_234392_, p_234393_, p_234394_, p_234395_, p_234396_, p_234397_, p_234398_, p_234399_, p_234400_, net.neoforged.neoforge.client.model.data.ModelData.EMPTY, null);
+ }
++
+ public void tesselateWithAO(
+ BlockAndTintGetter p_234391_,
+ BakedModel p_234392_,
@@ -78,7 +79,7 @@
float[] afloat = new float[DIRECTIONS.length * 2];
BitSet bitset = new BitSet(3);
ModelBlockRenderer.AmbientOcclusionFace modelblockrenderer$ambientocclusionface = new ModelBlockRenderer.AmbientOcclusionFace();
-@@ -90,7 +_,7 @@
+@@ -88,10 +_,10 @@
for (Direction direction : DIRECTIONS) {
p_234398_.setSeed(p_234399_);
@@ -86,8 +87,12 @@
+ List list = p_234392_.getQuads(p_234393_, direction, p_234398_, modelData, renderType);
if (!list.isEmpty()) {
blockpos$mutableblockpos.setWithOffset(p_234394_, direction);
- if (!p_234397_ || Block.shouldRenderFace(p_234393_, p_234391_, p_234394_, direction, blockpos$mutableblockpos)) {
-@@ -102,7 +_,7 @@
+- if (!p_234397_ || Block.shouldRenderFace(p_234393_, p_234391_.getBlockState(blockpos$mutableblockpos), direction)) {
++ if (!p_234397_ || Block.shouldRenderFace(p_234391_, p_234394_, p_234393_, p_234391_.getBlockState(blockpos$mutableblockpos), direction)) {
+ this.renderModelFaceAO(
+ p_234391_, p_234393_, p_234394_, p_234395_, p_234396_, list, afloat, bitset, modelblockrenderer$ambientocclusionface, p_234400_
+ );
+@@ -100,7 +_,7 @@
}
p_234398_.setSeed(p_234399_);
@@ -96,7 +101,7 @@
if (!list1.isEmpty()) {
this.renderModelFaceAO(
p_234391_, p_234393_, p_234394_, p_234395_, p_234396_, list1, afloat, bitset, modelblockrenderer$ambientocclusionface, p_234400_
-@@ -110,6 +_,7 @@
+@@ -108,6 +_,7 @@
}
}
@@ -104,12 +109,13 @@
public void tesselateWithoutAO(
BlockAndTintGetter p_234402_,
BakedModel p_234403_,
-@@ -122,12 +_,28 @@
+@@ -120,15 +_,32 @@
long p_234410_,
int p_234411_
) {
+ tesselateWithoutAO(p_234402_, p_234403_, p_234404_, p_234405_, p_234406_, p_234407_, p_234408_, p_234409_, p_234410_, p_234411_, net.neoforged.neoforge.client.model.data.ModelData.EMPTY, null);
+ }
++
+ public void tesselateWithoutAO(
+ BlockAndTintGetter p_234402_,
+ BakedModel p_234403_,
@@ -133,8 +139,12 @@
+ List list = p_234403_.getQuads(p_234404_, direction, p_234409_, modelData, renderType);
if (!list.isEmpty()) {
blockpos$mutableblockpos.setWithOffset(p_234405_, direction);
- if (!p_234408_ || Block.shouldRenderFace(p_234404_, p_234402_, p_234405_, direction, blockpos$mutableblockpos)) {
-@@ -138,7 +_,7 @@
+- if (!p_234408_ || Block.shouldRenderFace(p_234404_, p_234402_.getBlockState(blockpos$mutableblockpos), direction)) {
++ if (!p_234408_ || Block.shouldRenderFace(p_234402_, p_234405_, p_234404_, p_234402_.getBlockState(blockpos$mutableblockpos), direction)) {
+ int i = LevelRenderer.getLightColor(p_234402_, p_234404_, blockpos$mutableblockpos);
+ this.renderModelFaceFlat(p_234402_, p_234404_, p_234405_, i, p_234411_, false, p_234406_, p_234407_, list, bitset);
+ }
+@@ -136,7 +_,7 @@
}
p_234409_.setSeed(p_234410_);
@@ -143,7 +153,7 @@
if (!list1.isEmpty()) {
this.renderModelFaceFlat(p_234402_, p_234404_, p_234405_, -1, p_234411_, true, p_234406_, p_234407_, list1, bitset);
}
-@@ -158,6 +_,7 @@
+@@ -156,6 +_,7 @@
) {
for (BakedQuad bakedquad : p_111018_) {
this.calculateShape(p_111013_, p_111014_, p_111015_, bakedquad.getVertices(), bakedquad.getDirection(), p_111019_, p_111020_);
@@ -151,7 +161,7 @@
p_111021_.calculate(p_111013_, p_111014_, p_111015_, bakedquad.getDirection(), p_111019_, p_111020_, bakedquad.isShade());
this.putQuadData(
p_111013_,
-@@ -323,6 +_,7 @@
+@@ -321,6 +_,7 @@
}
}
@@ -159,7 +169,7 @@
public void renderModel(
PoseStack.Pose p_111068_,
VertexConsumer p_111069_,
-@@ -334,16 +_,32 @@
+@@ -332,16 +_,32 @@
int p_111075_,
int p_111076_
) {
@@ -194,30 +204,27 @@
}
private static void renderQuadList(
-@@ -724,22 +_,22 @@
+@@ -722,19 +_,19 @@
int l = modelblockrenderer$cache.getLightColor(blockstate3, p_111168_, blockpos$mutableblockpos);
float f3 = modelblockrenderer$cache.getShadeBrightness(blockstate3, p_111168_, blockpos$mutableblockpos);
BlockState blockstate4 = p_111168_.getBlockState(
-- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[0]).move(p_111171_)
+- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[0]).move(p_366875_)
+ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[0]) // Neo: remove move() to avoid oversampling (MC-43968)
);
- boolean flag = !blockstate4.isViewBlocking(p_111168_, blockpos$mutableblockpos)
- || blockstate4.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0;
+ boolean flag = !blockstate4.isViewBlocking(p_111168_, blockpos$mutableblockpos) || blockstate4.getLightBlock() == 0;
BlockState blockstate5 = p_111168_.getBlockState(
-- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[1]).move(p_111171_)
+- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[1]).move(p_366875_)
+ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[1]) // Neo: remove move() to avoid oversampling (MC-43968)
);
- boolean flag1 = !blockstate5.isViewBlocking(p_111168_, blockpos$mutableblockpos)
- || blockstate5.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0;
+ boolean flag1 = !blockstate5.isViewBlocking(p_111168_, blockpos$mutableblockpos) || blockstate5.getLightBlock() == 0;
BlockState blockstate6 = p_111168_.getBlockState(
-- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[2]).move(p_111171_)
+- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[2]).move(p_366875_)
+ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[2]) // Neo: remove move() to avoid oversampling (MC-43968)
);
- boolean flag2 = !blockstate6.isViewBlocking(p_111168_, blockpos$mutableblockpos)
- || blockstate6.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0;
+ boolean flag2 = !blockstate6.isViewBlocking(p_111168_, blockpos$mutableblockpos) || blockstate6.getLightBlock() == 0;
BlockState blockstate7 = p_111168_.getBlockState(
-- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[3]).move(p_111171_)
+- blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[3]).move(p_366875_)
+ blockpos$mutableblockpos.setWithOffset(blockpos, modelblockrenderer$adjacencyinfo.corners[3]) // Neo: remove move() to avoid oversampling (MC-43968)
);
- boolean flag3 = !blockstate7.isViewBlocking(p_111168_, blockpos$mutableblockpos)
- || blockstate7.getLightBlock(p_111168_, blockpos$mutableblockpos) == 0;
+ boolean flag3 = !blockstate7.isViewBlocking(p_111168_, blockpos$mutableblockpos) || blockstate7.getLightBlock() == 0;
+ float f4;
diff --git a/patches/net/minecraft/client/renderer/block/model/BakedOverrides.java.patch b/patches/net/minecraft/client/renderer/block/model/BakedOverrides.java.patch
new file mode 100644
index 00000000000..60cb1a713da
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/block/model/BakedOverrides.java.patch
@@ -0,0 +1,38 @@
+--- a/net/minecraft/client/renderer/block/model/BakedOverrides.java
++++ b/net/minecraft/client/renderer/block/model/BakedOverrides.java
+@@ -29,7 +_,15 @@
+ this.properties = new ResourceLocation[0];
+ }
+
++ /**
++ * @deprecated Neo: Use {@link #BakedOverrides(ModelBaker, List, java.util.function.Function)}
++ */
++ @Deprecated
+ public BakedOverrides(ModelBaker p_371950_, List p_371198_) {
++ this(p_371950_, p_371198_, p_371950_.getModelTextureGetter());
++ }
++
++ public BakedOverrides(ModelBaker p_371950_, List p_371198_, java.util.function.Function spriteGetter) {
+ this.properties = p_371198_.stream()
+ .flatMap(p_371945_ -> p_371945_.predicates().stream())
+ .map(ItemOverride.Predicate::property)
+@@ -45,7 +_,7 @@
+
+ for (int j = p_371198_.size() - 1; j >= 0; j--) {
+ ItemOverride itemoverride = p_371198_.get(j);
+- BakedModel bakedmodel = p_371950_.bake(itemoverride.model(), BlockModelRotation.X0_Y0);
++ BakedModel bakedmodel = p_371950_.bake(itemoverride.model(), BlockModelRotation.X0_Y0, spriteGetter);
+ BakedOverrides.PropertyMatcher[] abakedoverrides$propertymatcher = itemoverride.predicates().stream().map(p_371644_ -> {
+ int k = object2intmap.getInt(p_371644_.property());
+ return new BakedOverrides.PropertyMatcher(k, p_371644_.value());
+@@ -80,6 +_,10 @@
+ }
+
+ return null;
++ }
++
++ public com.google.common.collect.ImmutableList getOverrides() {
++ return com.google.common.collect.ImmutableList.copyOf(overrides);
+ }
+
+ @OnlyIn(Dist.CLIENT)
diff --git a/patches/net/minecraft/client/renderer/block/model/BakedQuad.java.patch b/patches/net/minecraft/client/renderer/block/model/BakedQuad.java.patch
index fb47f0c8ce7..4c6541f5420 100644
--- a/patches/net/minecraft/client/renderer/block/model/BakedQuad.java.patch
+++ b/patches/net/minecraft/client/renderer/block/model/BakedQuad.java.patch
@@ -1,29 +1,30 @@
--- a/net/minecraft/client/renderer/block/model/BakedQuad.java
+++ b/net/minecraft/client/renderer/block/model/BakedQuad.java
-@@ -12,13 +_,19 @@
- protected final Direction direction;
+@@ -13,14 +_,20 @@
protected final TextureAtlasSprite sprite;
private final boolean shade;
+ private final int lightEmission;
+ private final boolean hasAmbientOcclusion;
- public BakedQuad(int[] p_111298_, int p_111299_, Direction p_111300_, TextureAtlasSprite p_111301_, boolean p_111302_) {
-+ this(p_111298_, p_111299_, p_111300_, p_111301_, p_111302_, true);
+ public BakedQuad(int[] p_111298_, int p_111299_, Direction p_111300_, TextureAtlasSprite p_111301_, boolean p_111302_, int p_361140_) {
++ this(p_111298_, p_111299_, p_111300_, p_111301_, p_111302_, p_361140_, true);
+ }
+
-+ public BakedQuad(int[] p_111298_, int p_111299_, Direction p_111300_, TextureAtlasSprite p_111301_, boolean p_111302_, boolean hasAmbientOcclusion) {
++ public BakedQuad(int[] p_111298_, int p_111299_, Direction p_111300_, TextureAtlasSprite p_111301_, boolean p_111302_, int p_361140_, boolean hasAmbientOcclusion) {
this.vertices = p_111298_;
this.tintIndex = p_111299_;
this.direction = p_111300_;
this.sprite = p_111301_;
this.shade = p_111302_;
+ this.lightEmission = p_361140_;
+ this.hasAmbientOcclusion = hasAmbientOcclusion;
}
public TextureAtlasSprite getSprite() {
-@@ -43,5 +_,13 @@
+@@ -49,5 +_,13 @@
- public boolean isShade() {
- return this.shade;
+ public int getLightEmission() {
+ return this.lightEmission;
+ }
+
+ /**
diff --git a/patches/net/minecraft/client/renderer/block/model/BlockElement.java.patch b/patches/net/minecraft/client/renderer/block/model/BlockElement.java.patch
index eb9ddf91354..c19fb03a3eb 100644
--- a/patches/net/minecraft/client/renderer/block/model/BlockElement.java.patch
+++ b/patches/net/minecraft/client/renderer/block/model/BlockElement.java.patch
@@ -1,41 +1,44 @@
--- a/net/minecraft/client/renderer/block/model/BlockElement.java
+++ b/net/minecraft/client/renderer/block/model/BlockElement.java
-@@ -29,16 +_,23 @@
- public final Map faces;
+@@ -30,6 +_,7 @@
public final BlockElementRotation rotation;
public final boolean shade;
+ public final int lightEmission;
+ private net.neoforged.neoforge.client.model.ExtraFaceData faceData;
- public BlockElement(
- Vector3f p_253626_, Vector3f p_254426_, Map p_254454_, @Nullable BlockElementRotation p_254229_, boolean p_253661_
+ public BlockElement(Vector3f p_253626_, Vector3f p_254426_, Map p_254454_) {
+ this(p_253626_, p_254426_, p_254454_, null, true, 0);
+@@ -43,6 +_,10 @@
+ boolean p_361372_,
+ int p_361908_
) {
-+ this(p_253626_, p_254426_, p_254454_, p_254229_, p_253661_, net.neoforged.neoforge.client.model.ExtraFaceData.DEFAULT);
++ this(p_361324_, p_363867_, p_362722_, p_360926_, p_361372_, p_361908_, net.neoforged.neoforge.client.model.ExtraFaceData.DEFAULT);
+ }
+
-+ public BlockElement(Vector3f p_253626_, Vector3f p_254426_, Map p_254454_, @Nullable BlockElementRotation p_254229_, boolean p_253661_, net.neoforged.neoforge.client.model.ExtraFaceData faceData) {
- this.from = p_253626_;
- this.to = p_254426_;
- this.faces = p_254454_;
- this.rotation = p_254229_;
- this.shade = p_253661_;
++ public BlockElement(Vector3f p_361324_, Vector3f p_363867_, Map p_362722_, @Nullable BlockElementRotation p_360926_, boolean p_361372_, int p_361908_, net.neoforged.neoforge.client.model.ExtraFaceData faceData) {
+ this.from = p_361324_;
+ this.to = p_363867_;
+ this.faces = p_362722_;
+@@ -50,6 +_,8 @@
+ this.shade = p_361372_;
+ this.lightEmission = p_361908_;
this.fillUvs();
+ this.setFaceData(faceData);
+ this.faces.values().forEach(face -> face.parent().setValue(this));
}
private void fillUvs() {
-@@ -80,7 +_,9 @@
- throw new JsonParseException("Expected shade to be a Boolean");
- } else {
- boolean flag = GsonHelper.getAsBoolean(jsonobject, "shade", true);
-- return new BlockElement(vector3f, vector3f1, map, blockelementrotation, flag);
-+ if (jsonobject.has("forge_data")) throw new JsonParseException("forge_data should be replaced by neoforge_data"); // TODO 1.22: Remove
+@@ -104,7 +_,8 @@
+ }
+ }
+
+- return new BlockElement(vector3f, vector3f1, map, blockelementrotation, flag, i);
+ var faceData = net.neoforged.neoforge.client.model.ExtraFaceData.read(jsonobject.get("neoforge_data"), net.neoforged.neoforge.client.model.ExtraFaceData.DEFAULT);
-+ return new BlockElement(vector3f, vector3f1, map, blockelementrotation, flag, faceData);
++ return new BlockElement(vector3f, vector3f1, map, blockelementrotation, flag, i, faceData);
}
}
-@@ -191,5 +_,13 @@
+@@ -215,5 +_,13 @@
return new Vector3f(afloat[0], afloat[1], afloat[2]);
}
}
diff --git a/patches/net/minecraft/client/renderer/block/model/BlockModel.java.patch b/patches/net/minecraft/client/renderer/block/model/BlockModel.java.patch
index b587befb12d..3275202161a 100644
--- a/patches/net/minecraft/client/renderer/block/model/BlockModel.java.patch
+++ b/patches/net/minecraft/client/renderer/block/model/BlockModel.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/block/model/BlockModel.java
+++ b/net/minecraft/client/renderer/block/model/BlockModel.java
-@@ -77,9 +_,10 @@
+@@ -72,9 +_,10 @@
public BlockModel parent;
@Nullable
protected ResourceLocation parentLocation;
@@ -11,8 +11,8 @@
+ return GsonHelper.fromJson(net.neoforged.neoforge.client.model.ExtendedBlockModelDeserializer.INSTANCE, p_111462_, BlockModel.class);
}
- public static BlockModel fromString(String p_111464_) {
-@@ -104,10 +_,15 @@
+ public BlockModel(
+@@ -95,10 +_,15 @@
this.overrides = p_273099_;
}
@@ -28,42 +28,37 @@
public boolean hasAmbientOcclusion() {
if (this.hasAmbientOcclusion != null) {
return this.hasAmbientOcclusion;
-@@ -136,6 +_,10 @@
- return this.overrides.isEmpty() ? ItemOverrides.EMPTY : new ItemOverrides(p_250138_, p_251800_, this.overrides);
- }
+@@ -132,10 +_,18 @@
-+ public ItemOverrides getOverrides(ModelBaker p_250138_, BlockModel p_251800_, Function spriteGetter) {
-+ return this.overrides.isEmpty() ? ItemOverrides.EMPTY : new ItemOverrides(p_250138_, p_251800_, this.overrides, spriteGetter);
-+ }
-+
- @Override
- public Collection getDependencies() {
- Set set = Sets.newHashSet();
-@@ -184,6 +_,10 @@
- blockmodel.parent = (BlockModel)unbakedmodel;
+ this.parent = blockmodel;
}
-
++
+ if (customData.hasCustomGeometry()) {
-+ customData.getCustomGeometry().resolveParents(p_249059_, customData);
++ customData.getCustomGeometry().resolveDependencies(p_361203_, customData);
+ }
-+
- this.overrides.forEach(p_247932_ -> {
- UnbakedModel unbakedmodel1 = p_249059_.apply(p_247932_.getModel());
- if (!Objects.equals(unbakedmodel1, this)) {
-@@ -198,6 +_,12 @@
}
- public BakedModel bake(
-+ ModelBaker p_249720_, BlockModel p_111451_, Function p_111452_, ModelState p_111453_, boolean p_111455_
-+ ) {
-+ return net.neoforged.neoforge.client.model.geometry.UnbakedGeometryHelper.bake(this, p_249720_, p_111451_, p_111452_, p_111453_, p_111455_);
-+ }
+ @Override
+ public BakedModel bake(ModelBaker p_252120_, Function p_250023_, ModelState p_251130_) {
++ var customGeometry = this.customData.getCustomGeometry();
++ if (customGeometry != null) {
++ return customGeometry.bake(this.customData, p_252120_, p_250023_, p_251130_, this.overrides);
++ }
+ return this.bake(p_250023_, p_251130_, true);
+ }
+
+@@ -146,6 +_,10 @@
+ } else {
+ SimpleBakedModel.Builder simplebakedmodel$builder = new SimpleBakedModel.Builder(this, p_111455_).particle(textureatlassprite);
+
++ if (!this.customData.getRootTransform().isIdentity()) {
++ p_111453_ = net.neoforged.neoforge.client.model.geometry.UnbakedGeometryHelper.composeRootTransformIntoModelState(p_111453_, this.customData.getRootTransform());
++ }
+
-+ public BakedModel bakeVanilla(
- ModelBaker p_249720_, BlockModel p_111451_, Function p_111452_, ModelState p_111453_, boolean p_111455_
- ) {
- TextureAtlasSprite textureatlassprite = p_111452_.apply(this.getMaterial("particle"));
-@@ -288,7 +_,18 @@
+ for (BlockElement blockelement : this.getElements()) {
+ for (Direction direction : blockelement.faces.keySet()) {
+ BlockElementFace blockelementface = blockelement.faces.get(direction);
+@@ -229,7 +_,18 @@
ItemTransform itemtransform5 = this.getTransform(ItemDisplayContext.GUI);
ItemTransform itemtransform6 = this.getTransform(ItemDisplayContext.GROUND);
ItemTransform itemtransform7 = this.getTransform(ItemDisplayContext.FIXED);
@@ -83,12 +78,14 @@
}
private ItemTransform getTransform(ItemDisplayContext p_270662_) {
-@@ -407,6 +_,8 @@
+@@ -347,6 +_,10 @@
+
public boolean lightLikeBlock() {
return this == SIDE;
- }
++ }
+
-+ public String getSerializedName() { return name; }
++ public String getSerializedName() {
++ return name;
+ }
}
-
- @OnlyIn(Dist.CLIENT)
+ }
diff --git a/patches/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches/net/minecraft/client/renderer/block/model/FaceBakery.java.patch
index e24c70720e1..71b9c9943e1 100644
--- a/patches/net/minecraft/client/renderer/block/model/FaceBakery.java.patch
+++ b/patches/net/minecraft/client/renderer/block/model/FaceBakery.java.patch
@@ -1,13 +1,13 @@
--- a/net/minecraft/client/renderer/block/model/FaceBakery.java
+++ b/net/minecraft/client/renderer/block/model/FaceBakery.java
-@@ -57,7 +_,14 @@
+@@ -58,7 +_,14 @@
this.recalculateWinding(aint, direction);
}
-- return new BakedQuad(aint, p_111603_.tintIndex(), direction, p_111604_, p_111608_);
+- return new BakedQuad(aint, p_111603_.tintIndex(), direction, p_111604_, p_111608_, p_364857_);
+ net.neoforged.neoforge.client.ClientHooks.fillNormal(aint, direction);
+ var data = p_111603_.faceData();
-+ var quad = new BakedQuad(aint, p_111603_.tintIndex(), direction, p_111604_, p_111608_, data.ambientOcclusion());
++ var quad = new BakedQuad(aint, p_111603_.tintIndex(), direction, p_111604_, p_111608_, p_364857_, data.ambientOcclusion());
+ if (!net.neoforged.neoforge.client.model.ExtraFaceData.DEFAULT.equals(data)) {
+ net.neoforged.neoforge.client.model.QuadTransformers.applyingLightmap(data.blockLight(), data.skyLight()).processInPlace(quad);
+ net.neoforged.neoforge.client.model.QuadTransformers.applyingColor(data.color()).processInPlace(quad);
diff --git a/patches/net/minecraft/client/renderer/block/model/ItemOverrides.java.patch b/patches/net/minecraft/client/renderer/block/model/ItemOverrides.java.patch
deleted file mode 100644
index 13a802c1110..00000000000
--- a/patches/net/minecraft/client/renderer/block/model/ItemOverrides.java.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- a/net/minecraft/client/renderer/block/model/ItemOverrides.java
-+++ b/net/minecraft/client/renderer/block/model/ItemOverrides.java
-@@ -31,7 +_,15 @@
- this.properties = new ResourceLocation[0];
- }
-
-+ /**
-+ * @deprecated Forge: Use {@link #ItemOverrides(ModelBaker, UnbakedModel, List, java.util.function.Function)}
-+ */
-+ @Deprecated
- public ItemOverrides(ModelBaker p_251211_, BlockModel p_111741_, List p_111743_) {
-+ this(p_251211_, p_111741_, p_111743_, p_251211_.getModelTextureGetter());
-+ }
-+
-+ public ItemOverrides(ModelBaker p_251211_, UnbakedModel p_111741_, List p_111743_, java.util.function.Function spriteGetter) {
- this.properties = p_111743_.stream()
- .flatMap(ItemOverride::getPredicates)
- .map(ItemOverride.Predicate::getProperty)
-@@ -47,7 +_,7 @@
-
- for (int j = p_111743_.size() - 1; j >= 0; j--) {
- ItemOverride itemoverride = p_111743_.get(j);
-- BakedModel bakedmodel = this.bakeModel(p_251211_, p_111741_, itemoverride);
-+ BakedModel bakedmodel = this.bakeModel(p_251211_, p_111741_, itemoverride, spriteGetter);
- ItemOverrides.PropertyMatcher[] aitemoverrides$propertymatcher = itemoverride.getPredicates().map(p_173477_ -> {
- int k = object2intmap.getInt(p_173477_.getProperty());
- return new ItemOverrides.PropertyMatcher(k, p_173477_.getValue());
-@@ -59,9 +_,9 @@
- }
-
- @Nullable
-- private BakedModel bakeModel(ModelBaker p_249483_, BlockModel p_251965_, ItemOverride p_250816_) {
-+ private BakedModel bakeModel(ModelBaker p_249483_, UnbakedModel p_251965_, ItemOverride p_250816_, java.util.function.Function spriteGetter) {
- UnbakedModel unbakedmodel = p_249483_.getModel(p_250816_.getModel());
-- return Objects.equals(unbakedmodel, p_251965_) ? null : p_249483_.bake(p_250816_.getModel(), BlockModelRotation.X0_Y0);
-+ return Objects.equals(unbakedmodel, p_251965_) ? null : p_249483_.bake(p_250816_.getModel(), BlockModelRotation.X0_Y0, spriteGetter);
- }
-
- @Nullable
-@@ -93,6 +_,10 @@
- }
-
- return p_173465_;
-+ }
-+
-+ public com.google.common.collect.ImmutableList getOverrides() {
-+ return com.google.common.collect.ImmutableList.copyOf(overrides);
- }
-
- @OnlyIn(Dist.CLIENT)
diff --git a/patches/net/minecraft/client/renderer/block/model/MultiVariant.java.patch b/patches/net/minecraft/client/renderer/block/model/MultiVariant.java.patch
index 438e6177819..bd74eaf20dd 100644
--- a/patches/net/minecraft/client/renderer/block/model/MultiVariant.java.patch
+++ b/patches/net/minecraft/client/renderer/block/model/MultiVariant.java.patch
@@ -1,11 +1,17 @@
--- a/net/minecraft/client/renderer/block/model/MultiVariant.java
+++ b/net/minecraft/client/renderer/block/model/MultiVariant.java
-@@ -68,7 +_,7 @@
- WeightedBakedModel.Builder weightedbakedmodel$builder = new WeightedBakedModel.Builder();
+@@ -45,12 +_,12 @@
+ public BakedModel bake(ModelBaker p_249016_, Function p_111851_, ModelState p_111852_) {
+ if (this.variants.size() == 1) {
+ Variant variant1 = this.variants.getFirst();
+- return p_249016_.bake(variant1.getModelLocation(), variant1);
++ return p_249016_.bake(variant1.getModelLocation(), variant1, p_111851_);
+ } else {
+ SimpleWeightedRandomList.Builder builder = SimpleWeightedRandomList.builder();
- for (Variant variant : this.getVariants()) {
+ for (Variant variant : this.variants) {
- BakedModel bakedmodel = p_249016_.bake(variant.getModelLocation(), variant);
+ BakedModel bakedmodel = p_249016_.bake(variant.getModelLocation(), variant, p_111851_);
- weightedbakedmodel$builder.add(bakedmodel, variant.getWeight());
+ builder.add(bakedmodel, variant.getWeight());
}
diff --git a/patches/net/minecraft/client/renderer/blockentity/BannerRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/BannerRenderer.java.patch
index c526f187600..81cc3164d7c 100644
--- a/patches/net/minecraft/client/renderer/blockentity/BannerRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/blockentity/BannerRenderer.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/blockentity/BannerRenderer.java
+++ b/net/minecraft/client/renderer/blockentity/BannerRenderer.java
-@@ -139,4 +_,11 @@
+@@ -141,4 +_,11 @@
int i = p_332728_.getTextureDiffuseColor();
p_332732_.render(p_332737_, p_332704_.buffer(p_332758_, RenderType::entityNoOutline), p_332821_, p_332828_, i);
}
diff --git a/patches/net/minecraft/client/renderer/blockentity/ChestRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/ChestRenderer.java.patch
index a79e2703192..dc78f074c09 100644
--- a/patches/net/minecraft/client/renderer/blockentity/ChestRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/blockentity/ChestRenderer.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/blockentity/ChestRenderer.java
+++ b/net/minecraft/client/renderer/blockentity/ChestRenderer.java
-@@ -128,7 +_,7 @@
+@@ -66,7 +_,7 @@
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
int i = neighborcombineresult.apply(new BrightnessCombiner<>()).applyAsInt(p_112367_);
@@ -9,10 +9,10 @@
VertexConsumer vertexconsumer = material.buffer(p_112366_, RenderType::entityCutout);
if (flag1) {
if (chesttype == ChestType.LEFT) {
-@@ -159,5 +_,15 @@
- p_112372_.render(p_112370_, p_112371_, p_112376_, p_112377_);
- p_112373_.render(p_112370_, p_112371_, p_112376_, p_112377_);
- p_112374_.render(p_112370_, p_112371_, p_112376_, p_112377_);
+@@ -85,5 +_,15 @@
+ private void render(PoseStack p_112370_, VertexConsumer p_112371_, ChestModel p_364178_, float p_112375_, int p_112376_, int p_112377_) {
+ p_364178_.setupAnim(p_112375_);
+ p_364178_.renderToBuffer(p_112370_, p_112371_, p_112376_, p_112377_);
+ }
+
+ protected Material getMaterial(T blockEntity, ChestType chestType) {
diff --git a/patches/net/minecraft/client/renderer/blockentity/EnchantTableRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/EnchantTableRenderer.java.patch
index 35f7d56236e..90b0eb6aadc 100644
--- a/patches/net/minecraft/client/renderer/blockentity/EnchantTableRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/blockentity/EnchantTableRenderer.java.patch
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/renderer/blockentity/EnchantTableRenderer.java
+++ b/net/minecraft/client/renderer/blockentity/EnchantTableRenderer.java
@@ -53,4 +_,10 @@
- this.bookModel.render(p_112420_, vertexconsumer, p_112422_, p_112423_, -1);
+ this.bookModel.renderToBuffer(p_112420_, vertexconsumer, p_112422_, p_112423_);
p_112420_.popPose();
}
+
diff --git a/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch
index 4bd585503fa..b1bd51f9524 100644
--- a/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java.patch
@@ -1,13 +1,15 @@
--- a/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java
+++ b/net/minecraft/client/renderer/blockentity/ShulkerBoxRenderer.java
-@@ -56,4 +_,10 @@
- this.model.renderToBuffer(p_112480_, vertexconsumer, p_112482_, p_112483_);
+@@ -55,6 +_,12 @@
p_112480_.popPose();
}
-+
+
+ @Override
+ public net.minecraft.world.phys.AABB getRenderBoundingBox(ShulkerBoxBlockEntity blockEntity) {
+ net.minecraft.core.BlockPos pos = blockEntity.getBlockPos();
+ return new net.minecraft.world.phys.AABB(pos.getX() - 0.5, pos.getY() - 0.5, pos.getZ() - 0.5, pos.getX() + 1.5, pos.getY() + 1.5, pos.getZ() + 1.5);
+ }
- }
++
+ @OnlyIn(Dist.CLIENT)
+ static class ShulkerBoxModel extends Model {
+ private final ModelPart lid;
diff --git a/patches/net/minecraft/client/renderer/blockentity/SignRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/SignRenderer.java.patch
index e4756dda941..23ffcf89c24 100644
--- a/patches/net/minecraft/client/renderer/blockentity/SignRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/blockentity/SignRenderer.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/blockentity/SignRenderer.java
+++ b/net/minecraft/client/renderer/blockentity/SignRenderer.java
-@@ -250,6 +_,15 @@
+@@ -251,6 +_,15 @@
return LayerDefinition.create(meshdefinition, 64, 32);
}
@@ -14,5 +14,5 @@
+ }
+
@OnlyIn(Dist.CLIENT)
- public static final class SignModel extends Model {
- public final ModelPart root;
+ static record Models(Model standing, Model wall) {
+ }
diff --git a/patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch b/patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch
index 351d861b081..7a43c83c08f 100644
--- a/patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java.patch
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java
+++ b/net/minecraft/client/renderer/blockentity/SpawnerRenderer.java
@@ -57,4 +_,10 @@
- p_312703_.render(p_312223_, 0.0, 0.0, 0.0, 0.0F, p_311943_, p_312805_, p_312394_, p_311996_);
+ p_312703_.render(p_312223_, 0.0, 0.0, 0.0, p_311943_, p_312805_, p_312394_, p_311996_);
p_312805_.popPose();
}
+
diff --git a/patches/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch b/patches/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch
index 33e437bf173..83ea06baae4 100644
--- a/patches/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch
+++ b/patches/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch
@@ -1,47 +1,42 @@
--- a/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java
+++ b/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java
-@@ -441,14 +_,15 @@
+@@ -393,9 +_,10 @@
public SectionRenderDispatcher.RenderSection.CompileTask createCompileTask(RenderRegionCache p_295324_) {
- boolean flag = this.cancelTasks();
-- RenderChunkRegion renderchunkregion = p_295324_.createRegion(SectionRenderDispatcher.this.level, SectionPos.of(this.origin));
+ this.cancelTasks();
+- RenderChunkRegion renderchunkregion = p_295324_.createRegion(SectionRenderDispatcher.this.level, SectionPos.of(this.sectionNode));
+ var additionalRenderers = net.neoforged.neoforge.client.ClientHooks.gatherAdditionalRenderers(this.origin, SectionRenderDispatcher.this.level);
-+ RenderChunkRegion renderchunkregion = p_295324_.createRegion(SectionRenderDispatcher.this.level, SectionPos.of(this.origin), additionalRenderers.isEmpty());
- boolean flag1 = this.compiled.get() == SectionRenderDispatcher.CompiledSection.UNCOMPILED;
- if (flag1 && flag) {
- this.initialCompilationCancelCount.incrementAndGet();
- }
-
- this.lastRebuildTask = new SectionRenderDispatcher.RenderSection.RebuildTask(
-- this.getDistToPlayerSqr(), renderchunkregion, !flag1 || this.initialCompilationCancelCount.get() > 2
-+ this.getDistToPlayerSqr(), renderchunkregion, !flag1 || this.initialCompilationCancelCount.get() > 2, additionalRenderers
- );
++ RenderChunkRegion renderchunkregion = p_295324_.createRegion(SectionRenderDispatcher.this.level, SectionPos.of(this.sectionNode), additionalRenderers.isEmpty());
+ boolean flag = this.compiled.get() != SectionRenderDispatcher.CompiledSection.UNCOMPILED;
+- this.lastRebuildTask = new SectionRenderDispatcher.RenderSection.RebuildTask(renderchunkregion, flag);
++ this.lastRebuildTask = new SectionRenderDispatcher.RenderSection.RebuildTask(renderchunkregion, flag, additionalRenderers);
return this.lastRebuildTask;
}
-@@ -523,10 +_,17 @@
+
+@@ -464,10 +_,17 @@
class RebuildTask extends SectionRenderDispatcher.RenderSection.CompileTask {
@Nullable
- protected RenderChunkRegion region;
+ protected volatile RenderChunkRegion region;
+ private final List additionalRenderers;
+ @Deprecated
- public RebuildTask(double p_294400_, @Nullable RenderChunkRegion p_294382_, boolean p_295207_) {
-+ this(p_294400_, p_294382_, p_295207_, List.of());
+ public RebuildTask(@Nullable RenderChunkRegion p_294382_, boolean p_295207_) {
++ this(p_294382_, p_295207_, List.of());
+ }
+
-+ public RebuildTask(double p_294400_, @Nullable RenderChunkRegion p_294382_, boolean p_295207_, List additionalRenderers) {
- super(p_294400_, p_295207_);
++ public RebuildTask(@Nullable RenderChunkRegion p_294382_, boolean p_295207_, List additionalRenderers) {
+ super(p_295207_);
this.region = p_294382_;
+ this.additionalRenderers = additionalRenderers;
}
@Override
-@@ -552,7 +_,7 @@
- } else {
- SectionPos sectionpos = SectionPos.of(RenderSection.this.origin);
- SectionCompiler.Results sectioncompiler$results = SectionRenderDispatcher.this.sectionCompiler
-- .compile(sectionpos, renderchunkregion, RenderSection.this.createVertexSorting(), p_296138_);
-+ .compile(sectionpos, renderchunkregion, RenderSection.this.createVertexSorting(), p_296138_, this.additionalRenderers);
- RenderSection.this.updateGlobalBlockEntities(sectioncompiler$results.globalBlockEntities);
- if (this.isCancelled.get()) {
- sectioncompiler$results.release();
+@@ -498,7 +_,7 @@
+ SectionCompiler.Results sectioncompiler$results;
+ try (Zone zone = Profiler.get().zone("Compile Section")) {
+ sectioncompiler$results = SectionRenderDispatcher.this.sectionCompiler
+- .compile(sectionpos, renderchunkregion, RenderSection.this.createVertexSorting(), p_296138_);
++ .compile(sectionpos, renderchunkregion, RenderSection.this.createVertexSorting(), p_296138_, this.additionalRenderers);
+ }
+
+ SectionRenderDispatcher.TranslucencyPointOfView sectionrenderdispatcher$translucencypointofview = SectionRenderDispatcher.TranslucencyPointOfView.of(
diff --git a/patches/net/minecraft/client/renderer/culling/Frustum.java.patch b/patches/net/minecraft/client/renderer/culling/Frustum.java.patch
index 92a6b521cbf..9dc2e4adad6 100644
--- a/patches/net/minecraft/client/renderer/culling/Frustum.java.patch
+++ b/patches/net/minecraft/client/renderer/culling/Frustum.java.patch
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/renderer/culling/Frustum.java
+++ b/net/minecraft/client/renderer/culling/Frustum.java
-@@ -70,6 +_,8 @@
+@@ -71,6 +_,8 @@
}
public boolean isVisible(AABB p_113030_) {
+ // FORGE: exit early for infinite bounds, these would otherwise fail in the intersection test at certain camera angles (GH-9321)
+ if (p_113030_.isInfinite()) return true;
- return this.cubeInFrustum(p_113030_.minX, p_113030_.minY, p_113030_.minZ, p_113030_.maxX, p_113030_.maxY, p_113030_.maxZ);
+ int i = this.cubeInFrustum(p_113030_.minX, p_113030_.minY, p_113030_.minZ, p_113030_.maxX, p_113030_.maxY, p_113030_.maxZ);
+ return i == -2 || i == -1;
}
-
diff --git a/patches/net/minecraft/client/renderer/entity/BoatRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/BoatRenderer.java.patch
deleted file mode 100644
index efa87185ccb..00000000000
--- a/patches/net/minecraft/client/renderer/entity/BoatRenderer.java.patch
+++ /dev/null
@@ -1,45 +0,0 @@
---- a/net/minecraft/client/renderer/entity/BoatRenderer.java
-+++ b/net/minecraft/client/renderer/entity/BoatRenderer.java
-@@ -45,7 +_,7 @@
- private ListModel createBoatModel(EntityRendererProvider.Context p_248834_, Boat.Type p_249317_, boolean p_250093_) {
- ModelLayerLocation modellayerlocation = p_250093_ ? ModelLayers.createChestBoatModelName(p_249317_) : ModelLayers.createBoatModelName(p_249317_);
- ModelPart modelpart = p_248834_.bakeLayer(modellayerlocation);
-- if (p_249317_ == Boat.Type.BAMBOO) {
-+ if (p_249317_.isRaft()) {
- return (ListModel)(p_250093_ ? new ChestRaftModel(modelpart) : new RaftModel(modelpart));
- } else {
- return (ListModel)(p_250093_ ? new ChestBoatModel(modelpart) : new BoatModel(modelpart));
-@@ -54,8 +_,8 @@
-
- private static ResourceLocation getTextureLocation(Boat.Type p_234566_, boolean p_234567_) {
- return p_234567_
-- ? ResourceLocation.withDefaultNamespace("textures/entity/chest_boat/" + p_234566_.getName() + ".png")
-- : ResourceLocation.withDefaultNamespace("textures/entity/boat/" + p_234566_.getName() + ".png");
-+ ? ResourceLocation.parse(p_234566_.getName()).withPrefix("textures/entity/chest_boat/").withSuffix(".png")
-+ : ResourceLocation.parse(p_234566_.getName()).withPrefix("textures/entity/boat/").withSuffix(".png");
- }
-
- public void render(Boat p_113929_, float p_113930_, float p_113931_, PoseStack p_113932_, MultiBufferSource p_113933_, int p_113934_) {
-@@ -77,7 +_,7 @@
- p_113932_.mulPose(new Quaternionf().setAngleAxis(p_113929_.getBubbleAngle(p_113931_) * (float) (Math.PI / 180.0), 1.0F, 0.0F, 1.0F));
- }
-
-- Pair> pair = this.boatResources.get(p_113929_.getVariant());
-+ Pair> pair = getModelWithLocation(p_113929_);
- ResourceLocation resourcelocation = pair.getFirst();
- ListModel listmodel = pair.getSecond();
- p_113932_.scale(-1.0F, -1.0F, 1.0F);
-@@ -96,7 +_,12 @@
- super.render(p_113929_, p_113930_, p_113931_, p_113932_, p_113933_, p_113934_);
- }
-
-+ @Deprecated // forge: override getModelWithLocation to change the texture / model
- public ResourceLocation getTextureLocation(Boat p_113927_) {
-- return this.boatResources.get(p_113927_.getVariant()).getFirst();
-+ return getModelWithLocation(p_113927_).getFirst();
-+ }
-+
-+ public Pair> getModelWithLocation(Boat boat) {
-+ return this.boatResources.get(boat.getVariant());
- }
- }
diff --git a/patches/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch b/patches/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch
index d1dd832f9de..49c59060366 100644
--- a/patches/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java.patch
@@ -1,9 +1,9 @@
--- a/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java
+++ b/net/minecraft/client/renderer/entity/EntityRenderDispatcher.java
-@@ -222,12 +_,12 @@
+@@ -243,12 +_,12 @@
) {
AABB aabb = p_114444_.getBoundingBox().move(-p_114444_.getX(), -p_114444_.getY(), -p_114444_.getZ());
- LevelRenderer.renderLineBox(p_114442_, p_114443_, aabb, p_353064_, p_353059_, p_353042_, 1.0F);
+ ShapeRenderer.renderLineBox(p_114442_, p_114443_, aabb, p_353064_, p_353059_, p_353042_, 1.0F);
- if (p_114444_ instanceof EnderDragon) {
+ if (p_114444_.isMultipartEntity()) {
double d0 = -Mth.lerp((double)p_114445_, p_114444_.xOld, p_114444_.getX());
@@ -15,18 +15,18 @@
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());
-@@ -467,6 +_,10 @@
+@@ -474,6 +_,10 @@
return this.itemInHandRenderer;
}
-+ public Map> getSkinMap() {
++ public Map> getSkinMap() {
+ return java.util.Collections.unmodifiableMap(playerRenderers);
+ }
+
@Override
public void onResourceManagerReload(ResourceManager p_174004_) {
EntityRendererProvider.Context entityrendererprovider$context = new EntityRendererProvider.Context(
-@@ -474,5 +_,6 @@
+@@ -481,5 +_,6 @@
);
this.renderers = EntityRenderers.createEntityRenderers(entityrendererprovider$context);
this.playerRenderers = EntityRenderers.createPlayerRenderers(entityrendererprovider$context);
diff --git a/patches/net/minecraft/client/renderer/entity/EntityRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/EntityRenderer.java.patch
index 86142b36746..2e7b86b284d 100644
--- a/patches/net/minecraft/client/renderer/entity/EntityRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/EntityRenderer.java.patch
@@ -1,25 +1,33 @@
--- a/net/minecraft/client/renderer/entity/EntityRenderer.java
+++ b/net/minecraft/client/renderer/entity/EntityRenderer.java
-@@ -94,8 +_,11 @@
- }
+@@ -105,6 +_,8 @@
}
-- if (this.shouldShowName(p_114485_)) {
-- this.renderNameTag(p_114485_, p_114485_.getDisplayName(), p_114488_, p_114489_, p_114490_, p_114487_);
-+ // Neo: Post the RenderNameTagEvent and conditionally wrap #renderNameTag based on the result.
-+ var event = new net.neoforged.neoforge.client.event.RenderNameTagEvent(p_114485_, p_114485_.getDisplayName(), this, p_114488_, p_114489_, p_114490_, p_114487_);
-+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(event);
-+ if (event.canRender().isTrue() || event.canRender().isDefault() && this.shouldShowName(p_114485_)) {
-+ this.renderNameTag(p_114485_, event.getContent(), p_114488_, p_114489_, p_114490_, p_114487_);
+ if (p_364816_.nameTag != null) {
++ var event = new net.neoforged.neoforge.client.event.RenderNameTagEvent.DoRender(p_364816_, p_364816_.nameTag, this, p_114488_, p_114489_, p_114490_, p_364816_.partialTick);
++ if (!net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(event).isCanceled())
+ this.renderNameTag(p_364816_, p_364816_.nameTag, p_114488_, p_114489_, p_114490_);
}
}
+@@ -270,7 +_,12 @@
+ }
-@@ -181,7 +_,7 @@
+ p_361028_.distanceToCameraSq = this.entityRenderDispatcher.distanceToSqr(p_362104_);
+- boolean flag = p_361028_.distanceToCameraSq < 4096.0 && this.shouldShowName(p_362104_, p_361028_.distanceToCameraSq);
++ boolean flag = p_361028_.distanceToCameraSq < 4096.0;
++ if (flag) {
++ var event = new net.neoforged.neoforge.client.event.RenderNameTagEvent.CanRender(p_362104_, p_361028_, p_362104_.getDisplayName(), this, p_362204_);
++ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(event);
++ flag = event.canRender().isTrue() || (event.canRender().isDefault() && this.shouldShowName(p_362104_, p_361028_.distanceToCameraSq));
++ }
+ if (flag) {
+ p_361028_.nameTag = this.getNameTag(p_362104_);
+ p_361028_.nameTagAttachment = p_362104_.getAttachments().getNullable(EntityAttachment.NAME_TAG, 0, p_362104_.getYRot(p_362204_));
+@@ -302,5 +_,7 @@
+ }
- protected void renderNameTag(T p_114498_, Component p_114499_, PoseStack p_114500_, MultiBufferSource p_114501_, int p_114502_, float p_316698_) {
- double d0 = this.entityRenderDispatcher.distanceToSqr(p_114498_);
-- if (!(d0 > 4096.0)) {
-+ if (net.neoforged.neoforge.client.ClientHooks.isNameplateInRenderDistance(p_114498_, d0)) {
- Vec3 vec3 = p_114498_.getAttachments().getNullable(EntityAttachment.NAME_TAG, 0, p_114498_.getViewYRot(p_316698_));
- if (vec3 != null) {
- boolean flag = !p_114498_.isDiscrete();
+ p_361028_.displayFireAnimation = p_362104_.displayFireAnimation();
++
++ p_361028_.partialTick = p_362204_;
+ }
+ }
diff --git a/patches/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch
index 836cad28aba..0e7a50f641c 100644
--- a/patches/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/FallingBlockRenderer.java.patch
@@ -1,27 +1,27 @@
--- a/net/minecraft/client/renderer/entity/FallingBlockRenderer.java
+++ b/net/minecraft/client/renderer/entity/FallingBlockRenderer.java
-@@ -34,6 +_,8 @@
- p_114637_.pushPose();
- BlockPos blockpos = BlockPos.containing(p_114634_.getX(), p_114634_.getBoundingBox().maxY, p_114634_.getZ());
- p_114637_.translate(-0.5, 0.0, -0.5);
-+ var model = this.dispatcher.getBlockModel(blockstate);
-+ for (var renderType : model.getRenderTypes(blockstate, RandomSource.create(blockstate.getSeed(p_114634_.getStartPos())), net.neoforged.neoforge.client.model.data.ModelData.EMPTY))
- this.dispatcher
- .getModelRenderer()
- .tesselateBlock(
-@@ -42,11 +_,13 @@
- blockstate,
- blockpos,
- p_114637_,
-- p_114638_.getBuffer(ItemBlockRenderTypes.getMovingBlockRenderType(blockstate)),
-+ p_114638_.getBuffer(net.neoforged.neoforge.client.RenderTypeHelper.getMovingBlockRenderType(renderType)),
- false,
- RandomSource.create(),
- blockstate.getSeed(p_114634_.getStartPos()),
-- OverlayTexture.NO_OVERLAY
-+ OverlayTexture.NO_OVERLAY,
-+ net.neoforged.neoforge.client.model.data.ModelData.EMPTY,
-+ renderType
- );
- p_114637_.popPose();
- super.render(p_114634_, p_114635_, p_114636_, p_114637_, p_114638_, p_114639_);
+@@ -36,6 +_,8 @@
+ if (blockstate.getRenderShape() == RenderShape.MODEL) {
+ p_114637_.pushPose();
+ p_114637_.translate(-0.5, 0.0, -0.5);
++ var model = this.dispatcher.getBlockModel(blockstate);
++ for (var renderType : model.getRenderTypes(blockstate, RandomSource.create(blockstate.getSeed(p_361300_.startBlockPos)), net.neoforged.neoforge.client.model.data.ModelData.EMPTY))
+ this.dispatcher
+ .getModelRenderer()
+ .tesselateBlock(
+@@ -44,11 +_,13 @@
+ blockstate,
+ p_361300_.blockPos,
+ p_114637_,
+- p_114638_.getBuffer(ItemBlockRenderTypes.getMovingBlockRenderType(blockstate)),
++ p_114638_.getBuffer(net.neoforged.neoforge.client.RenderTypeHelper.getMovingBlockRenderType(renderType)),
+ false,
+ RandomSource.create(),
+ blockstate.getSeed(p_361300_.startBlockPos),
+- OverlayTexture.NO_OVERLAY
++ OverlayTexture.NO_OVERLAY,
++ net.neoforged.neoforge.client.model.data.ModelData.EMPTY,
++ renderType
+ );
+ p_114637_.popPose();
+ super.render(p_361300_, p_114637_, p_114638_, p_114639_);
diff --git a/patches/net/minecraft/client/renderer/entity/FishingHookRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/FishingHookRenderer.java.patch
index 77ce7e708d5..6747d9fda77 100644
--- a/patches/net/minecraft/client/renderer/entity/FishingHookRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/FishingHookRenderer.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/entity/FishingHookRenderer.java
+++ b/net/minecraft/client/renderer/entity/FishingHookRenderer.java
-@@ -64,7 +_,7 @@
+@@ -63,7 +_,7 @@
private Vec3 getPlayerHandPos(Player p_340935_, float p_340872_, float p_341261_) {
int i = p_340935_.getMainArm() == HumanoidArm.RIGHT ? 1 : -1;
ItemStack itemstack = p_340935_.getMainHandItem();
diff --git a/patches/net/minecraft/client/renderer/entity/HumanoidMobRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/HumanoidMobRenderer.java.patch
new file mode 100644
index 00000000000..fa5624769b8
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/entity/HumanoidMobRenderer.java.patch
@@ -0,0 +1,11 @@
+--- a/net/minecraft/client/renderer/entity/HumanoidMobRenderer.java
++++ b/net/minecraft/client/renderer/entity/HumanoidMobRenderer.java
+@@ -40,7 +_,7 @@
+ p_362998_.isCrouching = p_365104_.isCrouching();
+ p_362998_.isFallFlying = p_365104_.isFallFlying();
+ p_362998_.isVisuallySwimming = p_365104_.isVisuallySwimming();
+- p_362998_.isPassenger = p_365104_.isPassenger();
++ p_362998_.isPassenger = p_365104_.isPassenger() && (p_365104_.getVehicle() != null && p_365104_.getVehicle().shouldRiderSit());
+ p_362998_.speedValue = 1.0F;
+ if (p_362998_.isFallFlying) {
+ p_362998_.speedValue = (float)p_365104_.getDeltaMovement().lengthSqr();
diff --git a/patches/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch
index 7412c8c3ed1..52951841f35 100644
--- a/patches/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/ItemEntityRenderer.java.patch
@@ -1,16 +1,16 @@
--- a/net/minecraft/client/renderer/entity/ItemEntityRenderer.java
+++ b/net/minecraft/client/renderer/entity/ItemEntityRenderer.java
-@@ -45,7 +_,8 @@
- BakedModel bakedmodel = this.itemRenderer.getModel(itemstack, p_115036_.level(), null, p_115036_.getId());
- boolean flag = bakedmodel.isGui3d();
- float f = 0.25F;
-- float f1 = Mth.sin(((float)p_115036_.getAge() + p_115038_) / 10.0F + p_115036_.bobOffs) * 0.1F + 0.1F;
-+ boolean shouldBob = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).shouldBobAsEntity(itemstack);
-+ float f1 = shouldBob ? Mth.sin(((float)p_115036_.getAge() + p_115038_) / 10.0F + p_115036_.bobOffs) * 0.1F + 0.1F : 0;
- float f2 = bakedmodel.getTransforms().getTransform(ItemDisplayContext.GROUND).scale.y();
- p_115039_.translate(0.0F, f1 + 0.25F * f2, 0.0F);
- float f3 = p_115036_.getSpin(p_115038_);
-@@ -100,9 +_,10 @@
+@@ -54,7 +_,8 @@
+ this.random.setSeed((long)getSeedForItemStack(itemstack));
+ boolean flag = bakedmodel.isGui3d();
+ float f = 0.25F;
+- float f1 = Mth.sin(p_362172_.ageInTicks / 10.0F + p_362172_.bobOffset) * 0.1F + 0.1F;
++ boolean shouldBob = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).shouldBobAsEntity(itemstack);
++ float f1 = shouldBob ? Mth.sin(p_362172_.ageInTicks / 10.0F + p_362172_.bobOffset) * 0.1F + 0.1F : 0;
+ float f2 = bakedmodel.getTransforms().getTransform(ItemDisplayContext.GROUND).scale.y();
+ p_115030_.translate(0.0F, f1 + 0.25F * f2, 0.0F);
+ float f3 = ItemEntity.getSpin(p_362172_.ageInTicks, p_362172_.bobOffset);
+@@ -110,9 +_,10 @@
p_323733_.translate(f3, f4, f5);
}
diff --git a/patches/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch
index d2db3be4a80..7fe0bf497de 100644
--- a/patches/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/ItemFrameRenderer.java.patch
@@ -1,50 +1,27 @@
--- a/net/minecraft/client/renderer/entity/ItemFrameRenderer.java
+++ b/net/minecraft/client/renderer/entity/ItemFrameRenderer.java
-@@ -84,25 +_,25 @@
- }
-
- if (!itemstack.isEmpty()) {
-- MapId mapid = p_115076_.getFramedMapId(itemstack);
-+ MapItemSavedData mapitemsaveddata = MapItem.getSavedData(itemstack, p_115076_.level());
- if (flag) {
- p_115079_.translate(0.0F, 0.0F, 0.5F);
- } else {
- p_115079_.translate(0.0F, 0.0F, 0.4375F);
- }
+@@ -100,6 +_,7 @@
-- int j = mapid != null ? p_115076_.getRotation() % 4 * 2 : p_115076_.getRotation();
-+ int j = mapitemsaveddata != null ? p_115076_.getRotation() % 4 * 2 : p_115076_.getRotation();
+ int j = mapid != null ? p_364723_.rotation % 4 * 2 : p_364723_.rotation;
p_115079_.mulPose(Axis.ZP.rotationDegrees((float)j * 360.0F / 8.0F));
-- if (mapid != null) {
-+ if (!net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderItemInFrameEvent(p_115076_, this, p_115079_, p_115080_, p_115081_)).isCanceled()) {
-+ if (mapitemsaveddata != null) {
++ if (!net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderItemInFrameEvent(p_364723_, this, p_115079_, p_115080_, p_115081_)).isCanceled()) {
+ if (mapid != null) {
p_115079_.mulPose(Axis.ZP.rotationDegrees(180.0F));
- float f = 0.0078125F;
- p_115079_.scale(0.0078125F, 0.0078125F, 0.0078125F);
- p_115079_.translate(-64.0F, -64.0F, 0.0F);
-- MapItemSavedData mapitemsaveddata = MapItem.getSavedData(mapid, p_115076_.level());
- p_115079_.translate(0.0F, 0.0F, -1.0F);
- if (mapitemsaveddata != null) {
- int i = this.getLightVal(p_115076_, 15728850, p_115081_);
-- Minecraft.getInstance().gameRenderer.getMapRenderer().render(p_115079_, p_115080_, mapid, mapitemsaveddata, true, i);
-+ Minecraft.getInstance().gameRenderer.getMapRenderer().render(p_115079_, p_115080_, p_115076_.getFramedMapId(itemstack), mapitemsaveddata, true, i);
- }
- } else {
- int k = this.getLightVal(p_115076_, 15728880, p_115081_);
-@@ -110,6 +_,7 @@
- this.itemRenderer
- .renderStatic(itemstack, ItemDisplayContext.FIXED, k, OverlayTexture.NO_OVERLAY, p_115079_, p_115080_, p_115076_.level(), p_115076_.getId());
+ float f2 = 0.0078125F;
+@@ -113,6 +_,7 @@
+ p_115079_.scale(0.5F, 0.5F, 0.5F);
+ this.itemRenderer.render(itemstack, ItemDisplayContext.FIXED, false, p_115079_, p_115080_, k, OverlayTexture.NO_OVERLAY, p_364723_.itemModel);
}
+ }
}
p_115079_.popPose();
-@@ -121,7 +_,7 @@
-
- private ModelResourceLocation getFrameModelResourceLoc(T p_174213_, ItemStack p_174214_) {
- boolean flag = p_174213_.getType() == EntityType.GLOW_ITEM_FRAME;
-- if (p_174214_.is(Items.FILLED_MAP)) {
-+ if (p_174214_.getItem() instanceof MapItem) {
- return flag ? GLOW_MAP_FRAME_LOCATION : MAP_FRAME_LOCATION;
- } else {
- return flag ? GLOW_FRAME_LOCATION : FRAME_LOCATION;
+@@ -161,7 +_,7 @@
+ if (!p_362907_.itemStack.isEmpty()) {
+ MapId mapid = p_363125_.getFramedMapId(itemstack);
+ if (mapid != null) {
+- MapItemSavedData mapitemsaveddata = p_363125_.level().getMapData(mapid);
++ MapItemSavedData mapitemsaveddata = net.minecraft.world.item.MapItem.getSavedData(itemstack, p_363125_.level());
+ if (mapitemsaveddata != null) {
+ this.mapRenderer.extractRenderState(mapid, mapitemsaveddata, p_362907_.mapRenderState);
+ p_362907_.mapId = mapid;
diff --git a/patches/net/minecraft/client/renderer/entity/ItemRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/ItemRenderer.java.patch
index 67b1f7c54f7..bbf69b99b56 100644
--- a/patches/net/minecraft/client/renderer/entity/ItemRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/ItemRenderer.java.patch
@@ -1,63 +1,52 @@
--- a/net/minecraft/client/renderer/entity/ItemRenderer.java
+++ b/net/minecraft/client/renderer/entity/ItemRenderer.java
-@@ -70,7 +_,7 @@
- public ItemRenderer(Minecraft p_266926_, TextureManager p_266774_, ModelManager p_266850_, ItemColors p_267016_, BlockEntityWithoutLevelRenderer p_267049_) {
- this.minecraft = p_266926_;
- this.textureManager = p_266774_;
-- this.itemModelShaper = new ItemModelShaper(p_266850_);
-+ this.itemModelShaper = new net.neoforged.neoforge.client.model.RegistryAwareItemModelShaper(p_266850_);
- this.blockEntityRenderer = p_267049_;
-
- for (Item item : BuiltInRegistries.ITEM) {
-@@ -120,7 +_,7 @@
- }
+@@ -156,7 +_,7 @@
+ float p_371782_
+ ) {
+ p_371635_.pushPose();
+- p_371384_.getTransforms().getTransform(p_371250_).apply(p_371248_, p_371635_);
++ p_371384_ = net.neoforged.neoforge.client.ClientHooks.handleCameraTransforms(p_371635_, p_371384_, p_371250_, p_371248_);
+ p_371635_.translate(-0.5F, -0.5F, p_371782_);
+ this.renderItem(p_371318_, p_371250_, p_371635_, p_371946_, p_371752_, p_371508_, p_371384_, p_371718_);
+ p_371635_.popPose();
+@@ -173,7 +_,8 @@
+ boolean p_364829_
+ ) {
+ if (!p_363970_.isCustomRenderer() && (!p_361397_.is(Items.TRIDENT) || p_364829_)) {
+- RenderType rendertype = ItemBlockRenderTypes.getRenderType(p_361397_);
++ for (var model : p_363970_.getRenderPasses(p_361397_)) {
++ for (var rendertype : model.getRenderTypes(p_361397_)) {
+ VertexConsumer vertexconsumer;
+ if (hasAnimatedTexture(p_361397_) && p_361397_.hasFoil()) {
+ PoseStack.Pose posestack$pose = p_360423_.last().copy();
+@@ -189,8 +_,10 @@
}
-- p_115151_.getTransforms().getTransform(p_270188_).apply(p_115146_, p_115147_);
-+ p_115151_ = net.neoforged.neoforge.client.ClientHooks.handleCameraTransforms(p_115147_, p_115151_, p_270188_, p_115146_);
- p_115147_.translate(-0.5F, -0.5F, -0.5F);
- if (!p_115151_.isCustomRenderer() && (!p_115144_.is(Items.TRIDENT) || flag)) {
- boolean flag1;
-@@ -131,7 +_,8 @@
- flag1 = true;
- }
-
-- RenderType rendertype = ItemBlockRenderTypes.getRenderType(p_115144_, flag1);
-+ for (var model : p_115151_.getRenderPasses(p_115144_, flag1)) {
-+ for (var rendertype : model.getRenderTypes(p_115144_, flag1)) {
- VertexConsumer vertexconsumer;
- if (hasAnimatedTexture(p_115144_) && p_115144_.hasFoil()) {
- PoseStack.Pose posestack$pose = p_115147_.last().copy();
-@@ -148,9 +_,11 @@
- vertexconsumer = getFoilBuffer(p_115148_, rendertype, true, p_115144_.hasFoil());
- }
-
-- this.renderModelLists(p_115151_, p_115144_, p_115149_, p_115150_, p_115147_, vertexconsumer);
-+ this.renderModelLists(model, p_115144_, p_115149_, p_115150_, p_115147_, vertexconsumer);
-+ }
-+ }
- } else {
-- this.blockEntityRenderer.renderByItem(p_115144_, p_270188_, p_115147_, p_115148_, p_115149_, p_115150_);
-+ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(p_115144_).getCustomRenderer().renderByItem(p_115144_, p_270188_, p_115147_, p_115148_, p_115149_, p_115150_);
- }
+ this.renderModelLists(p_363970_, p_361397_, p_361265_, p_364771_, p_360423_, vertexconsumer);
++ }
++ }
+ } else {
+- this.blockEntityRenderer.renderByItem(p_361397_, p_361627_, p_360423_, p_360415_, p_361265_, p_364771_);
++ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(p_361397_).getCustomRenderer().renderByItem(p_361397_, p_361627_, p_360423_, p_360415_, p_361265_, p_364771_);
+ }
+ }
- p_115147_.popPose();
-@@ -203,7 +_,7 @@
- float f1 = (float)FastColor.ARGB32.red(i) / 255.0F;
- float f2 = (float)FastColor.ARGB32.green(i) / 255.0F;
- float f3 = (float)FastColor.ARGB32.blue(i) / 255.0F;
+@@ -238,7 +_,7 @@
+ float f1 = (float)ARGB.red(i) / 255.0F;
+ float f2 = (float)ARGB.green(i) / 255.0F;
+ float f3 = (float)ARGB.blue(i) / 255.0F;
- p_115164_.putBulkData(posestack$pose, bakedquad, f1, f2, f3, f, p_115167_, p_115168_);
+ p_115164_.putBulkData(posestack$pose, bakedquad, f1, f2, f3, f, p_115167_, p_115168_, true); // Neo: pass readExistingColor=true
}
}
-@@ -256,5 +_,9 @@
- @Override
- public void onResourceManagerReload(ResourceManager p_115105_) {
- this.itemModelShaper.rebuildCache();
+@@ -294,5 +_,9 @@
+ ClientLevel clientlevel = p_372942_ instanceof ClientLevel ? (ClientLevel)p_372942_ : null;
+ BakedModel bakedmodel = p_373094_.overrides().findOverride(p_372923_, clientlevel, p_373099_, p_372933_);
+ return bakedmodel == null ? p_373094_ : bakedmodel;
+ }
+
+ public BlockEntityWithoutLevelRenderer getBlockEntityRenderer() {
-+ return blockEntityRenderer;
++ return blockEntityRenderer;
}
}
diff --git a/patches/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch
index 77ec1121791..cfb25cd68e9 100644
--- a/patches/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/LivingEntityRenderer.java.patch
@@ -1,38 +1,36 @@
--- a/net/minecraft/client/renderer/entity/LivingEntityRenderer.java
+++ b/net/minecraft/client/renderer/entity/LivingEntityRenderer.java
-@@ -50,14 +_,16 @@
+@@ -69,6 +_,7 @@
}
- public void render(T p_115308_, float p_115309_, float p_115310_, PoseStack p_115311_, MultiBufferSource p_115312_, int p_115313_) {
-+ if (net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderLivingEvent.Pre(p_115308_, this, p_115310_, p_115311_, p_115312_, p_115313_)).isCanceled()) return;
+ public void render(S p_361886_, PoseStack p_115311_, MultiBufferSource p_115312_, int p_115313_) {
++ if (net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderLivingEvent.Pre(p_361886_, this, p_361886_.partialTick, p_115311_, p_115312_, p_115313_)).isCanceled()) return;
p_115311_.pushPose();
- this.model.attackTime = this.getAttackAnim(p_115308_, p_115310_);
-- this.model.riding = p_115308_.isPassenger();
-+ boolean shouldSit = p_115308_.isPassenger() && (p_115308_.getVehicle() != null && p_115308_.getVehicle().shouldRiderSit());
-+ this.model.riding = shouldSit;
- this.model.young = p_115308_.isBaby();
- float f = Mth.rotLerp(p_115310_, p_115308_.yBodyRotO, p_115308_.yBodyRot);
- float f1 = Mth.rotLerp(p_115310_, p_115308_.yHeadRotO, p_115308_.yHeadRot);
- float f2 = f1 - f;
-- if (p_115308_.isPassenger() && p_115308_.getVehicle() instanceof LivingEntity livingentity) {
-+ if (shouldSit && p_115308_.getVehicle() instanceof LivingEntity livingentity) {
- f = Mth.rotLerp(p_115310_, livingentity.yBodyRotO, livingentity.yBodyRot);
- f2 = f1 - f;
- float f7 = Mth.wrapDegrees(f2);
-@@ -101,7 +_,7 @@
- p_115311_.translate(0.0F, -1.501F, 0.0F);
- float f4 = 0.0F;
- float f5 = 0.0F;
-- if (!p_115308_.isPassenger() && p_115308_.isAlive()) {
-+ if (!shouldSit && p_115308_.isAlive()) {
- f4 = p_115308_.walkAnimation.speed(p_115310_);
- f5 = p_115308_.walkAnimation.position(p_115310_);
- if (p_115308_.isBaby()) {
-@@ -134,6 +_,7 @@
+ if (p_361886_.hasPose(Pose.SLEEPING)) {
+ Direction direction = p_361886_.bedOrientation;
+@@ -104,6 +_,7 @@
p_115311_.popPose();
- super.render(p_115308_, p_115309_, p_115310_, p_115311_, p_115312_, p_115313_);
-+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderLivingEvent.Post(p_115308_, this, p_115310_, p_115311_, p_115312_, p_115313_));
+ super.render(p_361886_, p_115311_, p_115312_, p_115313_);
++ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderLivingEvent.Post(p_361886_, this, p_361886_.partialTick, p_115311_, p_115312_, p_115313_));
}
- @Nullable
+ protected boolean shouldRenderLayers(S p_364697_) {
+@@ -201,7 +_,7 @@
+ protected boolean shouldShowName(T p_363517_, double p_365448_) {
+ if (p_363517_.isDiscrete()) {
+ float f = 32.0F;
+- if (p_365448_ >= 1024.0) {
++ if (!net.neoforged.neoforge.client.ClientHooks.isNameplateInRenderDistance(p_363517_, p_365448_)) {
+ return false;
+ }
+ }
+@@ -278,7 +_,7 @@
+
+ p_360515_.isFullyFrozen = p_362733_.isFullyFrozen();
+ p_360515_.isBaby = p_362733_.isBaby();
+- p_360515_.isInWater = p_362733_.isInWater();
++ p_360515_.isInWater = p_362733_.isInWater() || p_362733_.isInFluidType((fluidType, height) -> p_362733_.canSwimInFluidType(fluidType));
+ p_360515_.isAutoSpinAttack = p_362733_.isAutoSpinAttack();
+ p_360515_.hasRedOverlay = p_362733_.hurtTime > 0 || p_362733_.deathTime > 0;
+ ItemStack itemstack1 = p_362733_.getItemBySlot(EquipmentSlot.HEAD);
diff --git a/patches/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch b/patches/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch
deleted file mode 100644
index d64f1997dee..00000000000
--- a/patches/net/minecraft/client/renderer/entity/layers/ElytraLayer.java.patch
+++ /dev/null
@@ -1,55 +0,0 @@
---- a/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
-+++ b/net/minecraft/client/renderer/entity/layers/ElytraLayer.java
-@@ -45,7 +_,7 @@
- float p_116960_
- ) {
- ItemStack itemstack = p_116954_.getItemBySlot(EquipmentSlot.CHEST);
-- if (itemstack.is(Items.ELYTRA)) {
-+ if (shouldRender(itemstack, p_116954_)) {
- ResourceLocation resourcelocation;
- if (p_116954_ instanceof AbstractClientPlayer abstractclientplayer) {
- PlayerSkin playerskin = abstractclientplayer.getSkin();
-@@ -54,10 +_,10 @@
- } else if (playerskin.capeTexture() != null && abstractclientplayer.isModelPartShown(PlayerModelPart.CAPE)) {
- resourcelocation = playerskin.capeTexture();
- } else {
-- resourcelocation = WINGS_LOCATION;
-+ resourcelocation = getElytraTexture(itemstack, p_116954_);
- }
- } else {
-- resourcelocation = WINGS_LOCATION;
-+ resourcelocation = getElytraTexture(itemstack, p_116954_);
- }
-
- p_116951_.pushPose();
-@@ -68,5 +_,30 @@
- this.elytraModel.renderToBuffer(p_116951_, vertexconsumer, p_116953_, OverlayTexture.NO_OVERLAY);
- p_116951_.popPose();
- }
-+ }
-+
-+ /**
-+ * Determines if the ElytraLayer should render.
-+ * ItemStack and Entity are provided for modder convenience,
-+ * For example, using the same ElytraLayer for multiple custom Elytra.
-+ *
-+ * @param stack The Elytra ItemStack
-+ * @param entity The entity being rendered.
-+ * @return If the ElytraLayer should render.
-+ */
-+ public boolean shouldRender(ItemStack stack, T entity) {
-+ return stack.getItem() == Items.ELYTRA;
-+ }
-+
-+ /**
-+ * Gets the texture to use with this ElytraLayer.
-+ * This assumes the vanilla Elytra model.
-+ *
-+ * @param stack The Elytra ItemStack.
-+ * @param entity The entity being rendered.
-+ * @return The texture.
-+ */
-+ public ResourceLocation getElytraTexture(ItemStack stack, T entity) {
-+ return WINGS_LOCATION;
- }
- }
diff --git a/patches/net/minecraft/client/renderer/entity/layers/EquipmentLayerRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/layers/EquipmentLayerRenderer.java.patch
new file mode 100644
index 00000000000..d9bc50306b1
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/entity/layers/EquipmentLayerRenderer.java.patch
@@ -0,0 +1,45 @@
+--- a/net/minecraft/client/renderer/entity/layers/EquipmentLayerRenderer.java
++++ b/net/minecraft/client/renderer/entity/layers/EquipmentLayerRenderer.java
+@@ -65,21 +_,26 @@
+ int p_371309_,
+ @Nullable ResourceLocation p_371587_
+ ) {
++ p_371731_ = getArmorModelHook(p_371670_, p_371854_, p_371731_);
+ List list = this.equipmentModels.get(p_371639_).getLayers(p_371854_);
+ if (!list.isEmpty()) {
+- int i = p_371670_.is(ItemTags.DYEABLE) ? DyedItemColor.getOrDefault(p_371670_, 0) : 0;
++ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions extensions = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(p_371670_);
++ int i = extensions.getDefaultDyeColor(p_371670_);
+ boolean flag = p_371670_.hasFoil();
+
++ int idx = 0;
+ for (EquipmentModel.Layer equipmentmodel$layer : list) {
+- int j = getColorForLayer(equipmentmodel$layer, i);
++ int j = extensions.getArmorLayerTintColor(p_371670_, equipmentmodel$layer, idx, i);
+ if (j != 0) {
+ ResourceLocation resourcelocation = equipmentmodel$layer.usePlayerTexture() && p_371587_ != null
+ ? p_371587_
+ : this.layerTextureLookup.apply(new EquipmentLayerRenderer.LayerTextureKey(p_371854_, equipmentmodel$layer));
++ resourcelocation = net.neoforged.neoforge.client.ClientHooks.getArmorTexture(p_371670_, p_371854_, equipmentmodel$layer, resourcelocation);
+ VertexConsumer vertexconsumer = ItemRenderer.getArmorFoilBuffer(p_371286_, RenderType.armorCutoutNoCull(resourcelocation), flag);
+ p_371731_.renderToBuffer(p_371767_, vertexconsumer, p_371309_, OverlayTexture.NO_OVERLAY, j);
+ flag = false;
+ }
++ idx++;
+ }
+
+ ArmorTrim armortrim = p_371670_.get(DataComponents.TRIM);
+@@ -99,6 +_,13 @@
+ } else {
+ return -1;
+ }
++ }
++
++ /**
++ * Hook to allow item-sensitive armor model. for HumanoidArmorLayer.
++ */
++ protected net.minecraft.client.model.Model getArmorModelHook(ItemStack itemStack, EquipmentModel.LayerType layerType, Model model) {
++ return net.neoforged.neoforge.client.ClientHooks.getArmorModel(itemStack, layerType, model);
+ }
+
+ @OnlyIn(Dist.CLIENT)
diff --git a/patches/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch b/patches/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch
deleted file mode 100644
index b6db566e316..00000000000
--- a/patches/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java.patch
+++ /dev/null
@@ -1,105 +0,0 @@
---- a/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java
-+++ b/net/minecraft/client/renderer/entity/layers/HumanoidArmorLayer.java
-@@ -54,34 +_,47 @@
- float p_117104_,
- float p_117105_
- ) {
-- this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.CHEST, p_117098_, this.getArmorModel(EquipmentSlot.CHEST));
-- this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.LEGS, p_117098_, this.getArmorModel(EquipmentSlot.LEGS));
-- this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.FEET, p_117098_, this.getArmorModel(EquipmentSlot.FEET));
-- this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.HEAD, p_117098_, this.getArmorModel(EquipmentSlot.HEAD));
-+ this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.CHEST, p_117098_, this.getArmorModel(EquipmentSlot.CHEST), p_117100_, p_117101_, p_117102_, p_117103_, p_117104_, p_117105_);
-+ this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.LEGS, p_117098_, this.getArmorModel(EquipmentSlot.LEGS), p_117100_, p_117101_, p_117102_, p_117103_, p_117104_, p_117105_);
-+ this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.FEET, p_117098_, this.getArmorModel(EquipmentSlot.FEET), p_117100_, p_117101_, p_117102_, p_117103_, p_117104_, p_117105_);
-+ this.renderArmorPiece(p_117096_, p_117097_, p_117099_, EquipmentSlot.HEAD, p_117098_, this.getArmorModel(EquipmentSlot.HEAD), p_117100_, p_117101_, p_117102_, p_117103_, p_117104_, p_117105_);
- }
-
-+ /** @deprecated Neo: use {@link #renderArmorPiece(PoseStack, MultiBufferSource, LivingEntity, EquipmentSlot, int, HumanoidModel, float, float, float, float, float, float)} instead. */
-+ @Deprecated
- private void renderArmorPiece(PoseStack p_117119_, MultiBufferSource p_117120_, T p_117121_, EquipmentSlot p_117122_, int p_117123_, A p_117124_) {
-+ this.renderArmorPiece(p_117119_, p_117120_, p_117121_, p_117122_, p_117123_, p_117124_, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
-+ }
-+
-+ private void renderArmorPiece(PoseStack p_117119_, MultiBufferSource p_117120_, T p_117121_, EquipmentSlot p_117122_, int p_117123_, A p_117124_, float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks, float netHeadYaw, float headPitch) {
- ItemStack itemstack = p_117121_.getItemBySlot(p_117122_);
- if (itemstack.getItem() instanceof ArmorItem armoritem) {
- if (armoritem.getEquipmentSlot() == p_117122_) {
- this.getParentModel().copyPropertiesTo(p_117124_);
- this.setPartVisibility(p_117124_, p_117122_);
-+ net.minecraft.client.model.Model model = getArmorModelHook(p_117121_, itemstack, p_117122_, p_117124_);
- boolean flag = this.usesInnerModel(p_117122_);
- ArmorMaterial armormaterial = armoritem.getMaterial().value();
-- int i = itemstack.is(ItemTags.DYEABLE) ? FastColor.ARGB32.opaque(DyedItemColor.getOrDefault(itemstack, -6265536)) : -1;
-
-- for (ArmorMaterial.Layer armormaterial$layer : armormaterial.layers()) {
-- int j = armormaterial$layer.dyeable() ? i : -1;
-- this.renderModel(p_117119_, p_117120_, p_117123_, p_117124_, j, armormaterial$layer.texture(flag));
-+ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions extensions = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack);
-+ extensions.setupModelAnimations(p_117121_, itemstack, p_117122_, model, limbSwing, limbSwingAmount, partialTick, ageInTicks, netHeadYaw, headPitch);
-+ int fallbackColor = extensions.getDefaultDyeColor(itemstack);
-+ for (int layerIdx = 0; layerIdx < armormaterial.layers().size(); layerIdx++) {
-+ ArmorMaterial.Layer armormaterial$layer = armormaterial.layers().get(layerIdx);
-+ int j = extensions.getArmorLayerTintColor(itemstack, p_117121_, armormaterial$layer, layerIdx, fallbackColor);
-+ if (j != 0) {
-+ var texture = net.neoforged.neoforge.client.ClientHooks.getArmorTexture(p_117121_, itemstack, armormaterial$layer, flag, p_117122_);
-+ this.renderModel(p_117119_, p_117120_, p_117123_, model, j, texture);
-+ }
- }
-
- ArmorTrim armortrim = itemstack.get(DataComponents.TRIM);
- if (armortrim != null) {
-- this.renderTrim(armoritem.getMaterial(), p_117119_, p_117120_, p_117123_, armortrim, p_117124_, flag);
-+ this.renderTrim(armoritem.getMaterial(), p_117119_, p_117120_, p_117123_, armortrim, model, flag);
- }
-
- if (itemstack.hasFoil()) {
-- this.renderGlint(p_117119_, p_117120_, p_117123_, p_117124_);
-+ this.renderGlint(p_117119_, p_117120_, p_117123_, model);
- }
- }
- }
-@@ -111,6 +_,9 @@
- }
-
- private void renderModel(PoseStack p_289664_, MultiBufferSource p_289689_, int p_289681_, A p_289658_, int p_350798_, ResourceLocation p_324344_) {
-+ renderModel(p_289664_, p_289689_, p_289681_, (net.minecraft.client.model.Model) p_289658_, p_350798_, p_324344_);
-+ }
-+ private void renderModel(PoseStack p_289664_, MultiBufferSource p_289689_, int p_289681_, net.minecraft.client.model.Model p_289658_, int p_350798_, ResourceLocation p_324344_) {
- VertexConsumer vertexconsumer = p_289689_.getBuffer(RenderType.armorCutoutNoCull(p_324344_));
- p_289658_.renderToBuffer(p_289664_, vertexconsumer, p_289681_, OverlayTexture.NO_OVERLAY, p_350798_);
- }
-@@ -118,6 +_,11 @@
- private void renderTrim(
- Holder p_323506_, PoseStack p_289687_, MultiBufferSource p_289643_, int p_289683_, ArmorTrim p_289692_, A p_289663_, boolean p_289651_
- ) {
-+ renderTrim(p_323506_, p_289687_, p_289643_, p_289683_, p_289692_, (net.minecraft.client.model.Model) p_289663_, p_289651_);
-+ }
-+ private void renderTrim(
-+ Holder p_323506_, PoseStack p_289687_, MultiBufferSource p_289643_, int p_289683_, ArmorTrim p_289692_, net.minecraft.client.model.Model p_289663_, boolean p_289651_
-+ ) {
- TextureAtlasSprite textureatlassprite = this.armorTrimAtlas
- .getSprite(p_289651_ ? p_289692_.innerTexture(p_323506_) : p_289692_.outerTexture(p_323506_));
- VertexConsumer vertexconsumer = textureatlassprite.wrap(p_289643_.getBuffer(Sheets.armorTrimsSheet(p_289692_.pattern().value().decal())));
-@@ -125,6 +_,9 @@
- }
-
- private void renderGlint(PoseStack p_289673_, MultiBufferSource p_289654_, int p_289649_, A p_289659_) {
-+ renderGlint(p_289673_, p_289654_, p_289649_, (net.minecraft.client.model.Model) p_289659_);
-+ }
-+ private void renderGlint(PoseStack p_289673_, MultiBufferSource p_289654_, int p_289649_, net.minecraft.client.model.Model p_289659_) {
- p_289659_.renderToBuffer(p_289673_, p_289654_.getBuffer(RenderType.armorEntityGlint()), p_289649_, OverlayTexture.NO_OVERLAY);
- }
-
-@@ -134,5 +_,12 @@
-
- private boolean usesInnerModel(EquipmentSlot p_117129_) {
- return p_117129_ == EquipmentSlot.LEGS;
-+ }
-+
-+ /**
-+ * Hook to allow item-sensitive armor model. for HumanoidArmorLayer.
-+ */
-+ protected net.minecraft.client.model.Model getArmorModelHook(T entity, ItemStack itemStack, EquipmentSlot slot, A model) {
-+ return net.neoforged.neoforge.client.ClientHooks.getArmorModel(entity, itemStack, slot, model);
- }
- }
diff --git a/patches/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch b/patches/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch
index 7f8084039ed..d2fb4f49011 100644
--- a/patches/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch
+++ b/patches/net/minecraft/client/renderer/entity/player/PlayerRenderer.java.patch
@@ -1,47 +1,66 @@
--- a/net/minecraft/client/renderer/entity/player/PlayerRenderer.java
+++ b/net/minecraft/client/renderer/entity/player/PlayerRenderer.java
-@@ -68,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_);
-+ if (net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderPlayerEvent.Pre(p_117788_, this, p_117790_, p_117791_, p_117792_, p_117793_)).isCanceled()) return;
- super.render(p_117788_, p_117789_, p_117790_, p_117791_, p_117792_, p_117793_);
-+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderPlayerEvent.Post(p_117788_, this, p_117790_, p_117791_, p_117792_, p_117793_));
- }
-
- public Vec3 getRenderOffset(AbstractClientPlayer p_117785_, float p_117786_) {
-@@ -140,9 +_,11 @@
- if (useanim == UseAnim.BRUSH) {
- return HumanoidModel.ArmPose.BRUSH;
- }
-- } else if (!p_117795_.swinging && itemstack.is(Items.CROSSBOW) && CrossbowItem.isCharged(itemstack)) {
-+ } else if (!p_117795_.swinging && itemstack.getItem() instanceof CrossbowItem && CrossbowItem.isCharged(itemstack)) {
+@@ -127,6 +_,9 @@
+ } else if (!p_363098_.swinging && p_364742_.holdsChargedCrossbow) {
return HumanoidModel.ArmPose.CROSSBOW_HOLD;
}
-+ HumanoidModel.ArmPose forgeArmPose = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).getArmPose(p_117795_, p_117796_, itemstack);
-+ if (forgeArmPose != null) return forgeArmPose;
++ if (p_364742_.customArmPose != null) {
++ return p_364742_.customArmPose;
++ }
return HumanoidModel.ArmPose.ITEM;
}
-@@ -185,10 +_,12 @@
+@@ -141,6 +_,13 @@
+ p_117799_.scale(0.9375F, 0.9375F, 0.9375F);
}
- public void renderRightHand(PoseStack p_117771_, MultiBufferSource p_117772_, int p_117773_, AbstractClientPlayer p_117774_) {
-+ if(!net.neoforged.neoforge.client.ClientHooks.renderSpecificFirstPersonArm(p_117771_, p_117772_, p_117773_, p_117774_, HumanoidArm.RIGHT))
- this.renderHand(p_117771_, p_117772_, p_117773_, p_117774_, this.model.rightArm, this.model.rightSleeve);
++ @Override
++ public void render(PlayerRenderState p_361886_, PoseStack p_115311_, MultiBufferSource p_115312_, int p_115313_) {
++ if (net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderPlayerEvent.Pre(p_361886_, this, p_361886_.partialTick, p_115311_, p_115312_, p_115313_)).isCanceled()) return;
++ super.render(p_361886_, p_115311_, p_115312_, p_115313_);
++ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.RenderPlayerEvent.Post(p_361886_, this, p_361886_.partialTick, p_115311_, p_115312_, p_115313_));
++ }
++
+ protected void renderNameTag(PlayerRenderState p_363185_, Component p_117809_, PoseStack p_117810_, MultiBufferSource p_117811_, int p_117812_) {
+ p_117810_.pushPose();
+ if (p_363185_.scoreText != null) {
+@@ -217,7 +_,8 @@
+ ItemStack itemstack = p_364516_.getItemInHand(p_364304_);
+ p_360817_.isEmpty = itemstack.isEmpty();
+ p_360817_.useAnimation = !itemstack.isEmpty() ? itemstack.getUseAnimation() : null;
+- p_360817_.holdsChargedCrossbow = itemstack.is(Items.CROSSBOW) && CrossbowItem.isCharged(itemstack);
++ p_360817_.holdsChargedCrossbow = itemstack.getItem() instanceof CrossbowItem && CrossbowItem.isCharged(itemstack);
++ p_360817_.customArmPose = net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).getArmPose(p_364516_, p_364304_, itemstack);
}
- public void renderLeftHand(PoseStack p_117814_, MultiBufferSource p_117815_, int p_117816_, AbstractClientPlayer p_117817_) {
-+ if(!net.neoforged.neoforge.client.ClientHooks.renderSpecificFirstPersonArm(p_117814_, p_117815_, p_117816_, p_117817_, HumanoidArm.LEFT))
- this.renderHand(p_117814_, p_117815_, p_117816_, p_117817_, this.model.leftArm, this.model.leftSleeve);
+ private static void extractCapeState(AbstractClientPlayer p_364691_, PlayerRenderState p_360814_, float p_364460_) {
+@@ -247,11 +_,29 @@
+ : null;
+ }
+
++ /**
++ * @deprecated Neo: use {@link #renderRightHand(PoseStack, MultiBufferSource, int, ResourceLocation, boolean, AbstractClientPlayer)} instead
++ */
++ @Deprecated
+ public void renderRightHand(PoseStack p_117771_, MultiBufferSource p_117772_, int p_117773_, ResourceLocation p_363694_, boolean p_366898_) {
++ this.renderRightHand(p_117771_, p_117772_, p_117773_, p_363694_, p_366898_, net.minecraft.client.Minecraft.getInstance().player);
++ }
++
++ public void renderRightHand(PoseStack p_117771_, MultiBufferSource p_117772_, int p_117773_, ResourceLocation p_363694_, boolean p_366898_, AbstractClientPlayer player) {
++ if(!net.neoforged.neoforge.client.ClientHooks.renderSpecificFirstPersonArm(p_117771_, p_117772_, p_117773_, player, HumanoidArm.RIGHT))
+ this.renderHand(p_117771_, p_117772_, p_117773_, p_363694_, this.model.rightArm, p_366898_);
+ }
+
++ /**
++ * @deprecated Neo: use {@link #renderLeftHand(PoseStack, MultiBufferSource, int, ResourceLocation, boolean, AbstractClientPlayer)} instead
++ */
++ @Deprecated
+ public void renderLeftHand(PoseStack p_117814_, MultiBufferSource p_117815_, int p_117816_, ResourceLocation p_361745_, boolean p_366730_) {
++ this.renderLeftHand(p_117814_, p_117815_, p_117816_, p_361745_, p_366730_, net.minecraft.client.Minecraft.getInstance().player);
++ }
++
++ public void renderLeftHand(PoseStack p_117814_, MultiBufferSource p_117815_, int p_117816_, ResourceLocation p_361745_, boolean p_366730_, AbstractClientPlayer player) {
++ if(!net.neoforged.neoforge.client.ClientHooks.renderSpecificFirstPersonArm(p_117814_, p_117815_, p_117816_, player, HumanoidArm.LEFT))
+ this.renderHand(p_117814_, p_117815_, p_117816_, p_361745_, this.model.leftArm, p_366730_);
}
-@@ -230,7 +_,7 @@
- }
- } else if (f > 0.0F) {
- super.setupRotations(p_117802_, p_117803_, p_117804_, p_117805_, p_117806_, p_320048_);
-- float f4 = p_117802_.isInWater() ? -90.0F - f1 : -90.0F;
-+ float f4 = p_117802_.isInWater() || p_117802_.isInFluidType((fluidType, height) -> p_117802_.canSwimInFluidType(fluidType)) ? -90.0F - p_117802_.getXRot() : -90.0F;
- float f5 = Mth.lerp(f, 0.0F, f4);
- p_117803_.mulPose(Axis.XP.rotationDegrees(f5));
- if (p_117802_.isVisuallySwimming()) {
diff --git a/patches/net/minecraft/client/renderer/entity/state/EntityRenderState.java.patch b/patches/net/minecraft/client/renderer/entity/state/EntityRenderState.java.patch
new file mode 100644
index 00000000000..a9fd80707ca
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/entity/state/EntityRenderState.java.patch
@@ -0,0 +1,10 @@
+--- a/net/minecraft/client/renderer/entity/state/EntityRenderState.java
++++ b/net/minecraft/client/renderer/entity/state/EntityRenderState.java
+@@ -27,6 +_,7 @@
+ public Vec3 nameTagAttachment;
+ @Nullable
+ public EntityRenderState.LeashState leashState;
++ public float partialTick;
+
+ @OnlyIn(Dist.CLIENT)
+ public static class LeashState {
diff --git a/patches/net/minecraft/client/renderer/entity/state/PlayerRenderState.java.patch b/patches/net/minecraft/client/renderer/entity/state/PlayerRenderState.java.patch
new file mode 100644
index 00000000000..870f5bd850c
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/entity/state/PlayerRenderState.java.patch
@@ -0,0 +1,10 @@
+--- a/net/minecraft/client/renderer/entity/state/PlayerRenderState.java
++++ b/net/minecraft/client/renderer/entity/state/PlayerRenderState.java
+@@ -52,5 +_,7 @@
+ @Nullable
+ public ItemUseAnimation useAnimation;
+ public boolean holdsChargedCrossbow;
++ @Nullable
++ public net.minecraft.client.model.HumanoidModel.ArmPose customArmPose;
+ }
+ }
diff --git a/patches/net/minecraft/client/renderer/state/MapRenderState.java.patch b/patches/net/minecraft/client/renderer/state/MapRenderState.java.patch
new file mode 100644
index 00000000000..2ac034ae3dd
--- /dev/null
+++ b/patches/net/minecraft/client/renderer/state/MapRenderState.java.patch
@@ -0,0 +1,10 @@
+--- a/net/minecraft/client/renderer/state/MapRenderState.java
++++ b/net/minecraft/client/renderer/state/MapRenderState.java
+@@ -17,6 +_,7 @@
+
+ @OnlyIn(Dist.CLIENT)
+ public static class MapDecorationRenderState {
++ public net.minecraft.core.Holder type;
+ @Nullable
+ public TextureAtlasSprite atlasSprite;
+ public byte x;
diff --git a/patches/net/minecraft/client/renderer/texture/AbstractTexture.java.patch b/patches/net/minecraft/client/renderer/texture/AbstractTexture.java.patch
index 8990e16bacf..ce14e13dcf3 100644
--- a/patches/net/minecraft/client/renderer/texture/AbstractTexture.java.patch
+++ b/patches/net/minecraft/client/renderer/texture/AbstractTexture.java.patch
@@ -1,9 +1,25 @@
--- a/net/minecraft/client/renderer/texture/AbstractTexture.java
+++ b/net/minecraft/client/renderer/texture/AbstractTexture.java
-@@ -36,6 +_,20 @@
- GlStateManager._texParameter(3553, 10240, j);
- }
+@@ -15,9 +_,13 @@
+ public static final int NOT_ASSIGNED = -1;
+ protected int id = -1;
+ protected boolean defaultBlur;
++ protected boolean blur;
++ protected boolean mipmap;
+ public void setFilter(boolean p_117961_, boolean p_117962_) {
+ RenderSystem.assertOnRenderThreadOrInit();
++ this.blur = p_117961_;
++ this.mipmap = p_117962_;
+ int i;
+ int j;
+ if (p_117961_) {
+@@ -31,6 +_,20 @@
+ this.bind();
+ GlStateManager._texParameter(3553, 10241, i);
+ GlStateManager._texParameter(3553, 10240, j);
++ }
++
+ // FORGE: This seems to have been stripped out, but we need it
+ private boolean lastBlur;
+ private boolean lastMipmap;
@@ -16,8 +32,6 @@
+
+ public void restoreLastBlurMipmap() {
+ setFilter(this.lastBlur, this.lastMipmap);
-+ }
-+
+ }
+
public int getId() {
- RenderSystem.assertOnRenderThreadOrInit();
- if (this.id == -1) {
diff --git a/patches/net/minecraft/client/renderer/texture/MipmapGenerator.java.patch b/patches/net/minecraft/client/renderer/texture/MipmapGenerator.java.patch
index 5835dfec53a..c6a51c60f1e 100644
--- a/patches/net/minecraft/client/renderer/texture/MipmapGenerator.java.patch
+++ b/patches/net/minecraft/client/renderer/texture/MipmapGenerator.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/texture/MipmapGenerator.java
+++ b/net/minecraft/client/renderer/texture/MipmapGenerator.java
-@@ -25,12 +_,15 @@
+@@ -26,12 +_,15 @@
anativeimage[0] = p_251300_[0];
boolean flag = hasTransparentPixel(anativeimage[0]);
@@ -17,7 +17,7 @@
int j = nativeimage1.getWidth();
int k = nativeimage1.getHeight();
-@@ -48,6 +_,7 @@
+@@ -49,6 +_,7 @@
)
);
}
diff --git a/patches/net/minecraft/client/renderer/texture/TextureAtlas.java.patch b/patches/net/minecraft/client/renderer/texture/TextureAtlas.java.patch
index 6fe9f37fe1e..ffc654c26a5 100644
--- a/patches/net/minecraft/client/renderer/texture/TextureAtlas.java.patch
+++ b/patches/net/minecraft/client/renderer/texture/TextureAtlas.java.patch
@@ -9,7 +9,7 @@
}
@Override
-@@ -172,5 +_,9 @@
+@@ -168,5 +_,9 @@
public void updateFilter(SpriteLoader.Preparations p_251993_) {
this.setFilter(false, p_251993_.mipLevel() > 0);
diff --git a/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch
index 3c47d4cccc5..3dbb3049e41 100644
--- a/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch
+++ b/patches/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch
@@ -12,6 +12,6 @@
+ y += this.contents.animatedTexture.getFrameY(frameIndex) * this.contents.height;
+ }
+
-+ return this.contents.getOriginalImage().getPixelRGBA(x, y);
++ return this.contents.getOriginalImage().getPixel(x, y);
+ }
}
diff --git a/patches/net/minecraft/client/resources/language/ClientLanguage.java.patch b/patches/net/minecraft/client/resources/language/ClientLanguage.java.patch
index 86f9a1dabeb..22eb7edb6f0 100644
--- a/patches/net/minecraft/client/resources/language/ClientLanguage.java.patch
+++ b/patches/net/minecraft/client/resources/language/ClientLanguage.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/resources/language/ClientLanguage.java
+++ b/net/minecraft/client/resources/language/ClientLanguage.java
-@@ -22,36 +_,50 @@
+@@ -22,23 +_,32 @@
public class ClientLanguage extends Language {
private static final Logger LOGGER = LogUtils.getLogger();
private final Map storage;
@@ -19,8 +19,8 @@
}
public static ClientLanguage loadFrom(ResourceManager p_265765_, List p_265743_, boolean p_265470_) {
- Map map = Maps.newHashMap();
-+ Map componentMap = Maps.newHashMap();
+ Map map = new HashMap<>();
++ Map componentMap = new HashMap<>();
for (String s : p_265743_) {
String s1 = String.format(Locale.ROOT, "lang/%s.json", s);
@@ -34,11 +34,12 @@
} catch (Exception exception) {
LOGGER.warn("Skipped language file: {}:{} ({})", s2, s1, exception.toString());
}
- }
+@@ -46,13 +_,18 @@
}
-- return new ClientLanguage(ImmutableMap.copyOf(map), p_265470_);
-+ return new ClientLanguage(ImmutableMap.copyOf(map), p_265470_, ImmutableMap.copyOf(componentMap));
+ DeprecatedTranslationsInfo.loadFromDefaultResource().applyToMap(map);
+- return new ClientLanguage(Map.copyOf(map), p_265470_);
++ return new ClientLanguage(Map.copyOf(map), p_265470_, Map.copyOf(componentMap));
}
+ @Deprecated
@@ -54,7 +55,7 @@
} catch (IOException ioexception) {
LOGGER.warn("Failed to load translations for {} from pack {}", p_235036_, resource.sourcePackId(), ioexception);
}
-@@ -76,5 +_,15 @@
+@@ -77,5 +_,15 @@
@Override
public FormattedCharSequence getVisualOrder(FormattedText p_118925_) {
return FormattedBidiReorder.reorder(p_118925_, this.defaultRightToLeft);
diff --git a/patches/net/minecraft/client/resources/model/BakedModel.java.patch b/patches/net/minecraft/client/resources/model/BakedModel.java.patch
index 6f162f22748..15490942f9a 100644
--- a/patches/net/minecraft/client/resources/model/BakedModel.java.patch
+++ b/patches/net/minecraft/client/resources/model/BakedModel.java.patch
@@ -24,5 +24,5 @@
+ @Deprecated
+ default ItemTransforms getTransforms() { return ItemTransforms.NO_TRANSFORMS; }
- ItemOverrides getOverrides();
- }
+ default BakedOverrides overrides() {
+ return BakedOverrides.EMPTY;
diff --git a/patches/net/minecraft/client/resources/model/DelegateBakedModel.java.patch b/patches/net/minecraft/client/resources/model/DelegateBakedModel.java.patch
new file mode 100644
index 00000000000..5c8eacbbe90
--- /dev/null
+++ b/patches/net/minecraft/client/resources/model/DelegateBakedModel.java.patch
@@ -0,0 +1,75 @@
+--- a/net/minecraft/client/resources/model/DelegateBakedModel.java
++++ b/net/minecraft/client/resources/model/DelegateBakedModel.java
+@@ -20,16 +_,27 @@
+ }
+
+ @Override
++ @Deprecated
+ public List getQuads(@Nullable BlockState p_371320_, @Nullable Direction p_371369_, RandomSource p_371947_) {
+ return this.parent.getQuads(p_371320_, p_371369_, p_371947_);
+ }
+
+ @Override
++ public List getQuads(@Nullable BlockState p_371320_, @Nullable Direction p_371369_, RandomSource p_371947_, net.neoforged.neoforge.client.model.data.ModelData modelData, @org.jetbrains.annotations.Nullable net.minecraft.client.renderer.RenderType renderType) {
++ return this.parent.getQuads(p_371320_, p_371369_, p_371947_, modelData, renderType);
++ }
++
++ @Override
+ public boolean useAmbientOcclusion() {
+ return this.parent.useAmbientOcclusion();
+ }
+
+ @Override
++ public net.neoforged.neoforge.common.util.TriState useAmbientOcclusion(BlockState state, net.neoforged.neoforge.client.model.data.ModelData modelData, net.minecraft.client.renderer.RenderType renderType) {
++ return this.parent.useAmbientOcclusion(state, modelData, renderType);
++ }
++
++ @Override
+ public boolean isGui3d() {
+ return this.parent.isGui3d();
+ }
+@@ -45,12 +_,44 @@
+ }
+
+ @Override
++ @Deprecated
+ public TextureAtlasSprite getParticleIcon() {
+ return this.parent.getParticleIcon();
+ }
+
+ @Override
++ public TextureAtlasSprite getParticleIcon(net.neoforged.neoforge.client.model.data.ModelData modelData) {
++ return this.parent.getParticleIcon(modelData);
++ }
++
++ @Override
++ @Deprecated
+ public ItemTransforms getTransforms() {
+ return this.parent.getTransforms();
++ }
++
++ @Override
++ public BakedModel applyTransform(net.minecraft.world.item.ItemDisplayContext transformType, com.mojang.blaze3d.vertex.PoseStack poseStack, boolean applyLeftHandTransform) {
++ return this.parent.applyTransform(transformType, poseStack, applyLeftHandTransform);
++ }
++
++ @Override
++ public net.neoforged.neoforge.client.model.data.ModelData getModelData(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, BlockState state, net.neoforged.neoforge.client.model.data.ModelData modelData) {
++ return this.parent.getModelData(level, pos, state, modelData);
++ }
++
++ @Override
++ public net.neoforged.neoforge.client.ChunkRenderTypeSet getRenderTypes(BlockState state, RandomSource rand, net.neoforged.neoforge.client.model.data.ModelData data) {
++ return this.parent.getRenderTypes(state, rand, data);
++ }
++
++ @Override
++ public List getRenderTypes(net.minecraft.world.item.ItemStack itemStack) {
++ return this.parent.getRenderTypes(itemStack);
++ }
++
++ @Override
++ public List getRenderPasses(net.minecraft.world.item.ItemStack itemStack) {
++ return this.parent.getRenderPasses(itemStack);
+ }
+ }
diff --git a/patches/net/minecraft/client/resources/model/ItemModel.java.patch b/patches/net/minecraft/client/resources/model/ItemModel.java.patch
new file mode 100644
index 00000000000..10d96b4e0a8
--- /dev/null
+++ b/patches/net/minecraft/client/resources/model/ItemModel.java.patch
@@ -0,0 +1,16 @@
+--- a/net/minecraft/client/resources/model/ItemModel.java
++++ b/net/minecraft/client/resources/model/ItemModel.java
+@@ -29,11 +_,11 @@
+
+ @Override
+ public BakedModel bake(ModelBaker p_371426_, Function p_371750_, ModelState p_371674_) {
+- BakedModel bakedmodel = p_371426_.bake(this.id, p_371674_);
++ BakedModel bakedmodel = p_371426_.bake(this.id, p_371674_, p_371750_);
+ if (this.overrides.isEmpty()) {
+ return bakedmodel;
+ } else {
+- BakedOverrides bakedoverrides = new BakedOverrides(p_371426_, this.overrides);
++ BakedOverrides bakedoverrides = new BakedOverrides(p_371426_, this.overrides, p_371750_);
+ return new ItemModel.BakedModelWithOverrides(bakedmodel, bakedoverrides);
+ }
+ }
diff --git a/patches/net/minecraft/client/resources/model/ModelBaker.java.patch b/patches/net/minecraft/client/resources/model/ModelBaker.java.patch
index 7535b116b13..36016793f04 100644
--- a/patches/net/minecraft/client/resources/model/ModelBaker.java.patch
+++ b/patches/net/minecraft/client/resources/model/ModelBaker.java.patch
@@ -1,17 +1,14 @@
--- a/net/minecraft/client/resources/model/ModelBaker.java
+++ b/net/minecraft/client/resources/model/ModelBaker.java
-@@ -6,9 +_,13 @@
+@@ -5,6 +_,10 @@
import net.neoforged.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public interface ModelBaker {
+public interface ModelBaker extends net.neoforged.neoforge.client.extensions.IModelBakerExtension {
- UnbakedModel getModel(ResourceLocation p_252194_);
-
+ /**
+ * @deprecated Forge: Use {@link #bake(ResourceLocation, ModelState, java.util.function.Function)} instead.
+ */
+ @Deprecated
- @Nullable
BakedModel bake(ResourceLocation p_250776_, ModelState p_251280_);
}
diff --git a/patches/net/minecraft/client/resources/model/ModelBakery.java.patch b/patches/net/minecraft/client/resources/model/ModelBakery.java.patch
index cf11be47908..ed116d3ffec 100644
--- a/patches/net/minecraft/client/resources/model/ModelBakery.java.patch
+++ b/patches/net/minecraft/client/resources/model/ModelBakery.java.patch
@@ -1,25 +1,12 @@
--- a/net/minecraft/client/resources/model/ModelBakery.java
+++ b/net/minecraft/client/resources/model/ModelBakery.java
-@@ -117,6 +_,12 @@
- p_252014_.popPush("special");
- this.loadSpecialItemModelAndDependencies(ItemRenderer.TRIDENT_IN_HAND_MODEL);
- this.loadSpecialItemModelAndDependencies(ItemRenderer.SPYGLASS_IN_HAND_MODEL);
-+ Set additionalModels = new HashSet<>();
-+ net.neoforged.neoforge.client.ClientHooks.onRegisterAdditionalModels(additionalModels);
-+ for (ModelResourceLocation rl : additionalModels) {
-+ UnbakedModel unbakedmodel = this.getModel(rl.id());
-+ this.registerModelAndLoadDependencies(rl, unbakedmodel);
-+ }
- this.topLevelModels.values().forEach(p_247954_ -> p_247954_.resolveParents(this::getModel));
- p_252014_.pop();
- }
-@@ -246,14 +_,30 @@
+@@ -94,25 +_,46 @@
}
@Override
-+ @Nullable
++ @org.jetbrains.annotations.Nullable
+ public UnbakedModel getTopLevelModel(ModelResourceLocation location) {
-+ return topLevelModels.get(location);
++ return topModels.get(location);
+ }
+
+ @Override
@@ -45,22 +32,17 @@
ModelBakery.this.bakedCache.put(modelbakery$bakedcachekey, bakedmodel1);
return bakedmodel1;
}
-@@ -261,13 +_,19 @@
+ }
- @Nullable
BakedModel bakeUncached(UnbakedModel p_352386_, ModelState p_352194_) {
+ return bakeUncached(p_352386_, p_352194_, this.modelTextureGetter);
+ }
+
+ @Override
-+ @Nullable
+ public BakedModel bakeUncached(UnbakedModel p_352386_, ModelState p_352194_, Function sprites) {
- if (p_352386_ instanceof BlockModel blockmodel && blockmodel.getRootModel() == ModelBakery.GENERATION_MARKER) {
- return ModelBakery.ITEM_MODEL_GENERATOR
-- .generateBlockModel(this.modelTextureGetter, blockmodel)
-- .bake(this, blockmodel, this.modelTextureGetter, p_352194_, false);
-+ .generateBlockModel(sprites, blockmodel)
-+ .bake(this, blockmodel, sprites, p_352194_, false);
+ if (p_352386_ instanceof BlockModel blockmodel && blockmodel.getRootModel() == SpecialModels.GENERATED_MARKER) {
+- return ModelBakery.ITEM_MODEL_GENERATOR.generateBlockModel(this.modelTextureGetter, blockmodel).bake(this.modelTextureGetter, p_352194_, false);
++ return ModelBakery.ITEM_MODEL_GENERATOR.generateBlockModel(sprites, blockmodel).bake(sprites, p_352194_, false);
}
- return p_352386_.bake(this, this.modelTextureGetter, p_352194_);
diff --git a/patches/net/minecraft/client/resources/model/ModelDiscovery.java.patch b/patches/net/minecraft/client/resources/model/ModelDiscovery.java.patch
new file mode 100644
index 00000000000..49db62b4d05
--- /dev/null
+++ b/patches/net/minecraft/client/resources/model/ModelDiscovery.java.patch
@@ -0,0 +1,10 @@
+--- a/net/minecraft/client/resources/model/ModelDiscovery.java
++++ b/net/minecraft/client/resources/model/ModelDiscovery.java
+@@ -49,6 +_,7 @@
+ });
+ set.add(ItemRenderer.TRIDENT_MODEL);
+ set.add(ItemRenderer.SPYGLASS_MODEL);
++ net.neoforged.neoforge.client.ClientHooks.onRegisterAdditionalModels(set);
+ return set;
+ }
+
diff --git a/patches/net/minecraft/client/resources/model/ModelManager.java.patch b/patches/net/minecraft/client/resources/model/ModelManager.java.patch
index dd6edb6544f..2795dad254f 100644
--- a/patches/net/minecraft/client/resources/model/ModelManager.java.patch
+++ b/patches/net/minecraft/client/resources/model/ModelManager.java.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/resources/model/ModelManager.java
+++ b/net/minecraft/client/resources/model/ModelManager.java
-@@ -63,13 +_,14 @@
+@@ -71,13 +_,14 @@
TextureAtlas.LOCATION_BLOCKS,
ResourceLocation.withDefaultNamespace("blocks")
);
@@ -16,15 +16,15 @@
public ModelManager(TextureManager p_119406_, BlockColors p_119407_, int p_119408_) {
this.blockColors = p_119407_;
-@@ -100,6 +_,7 @@
- Executor p_249221_
+@@ -102,6 +_,7 @@
+ public final CompletableFuture reload(
+ PreparableReloadListener.PreparationBarrier p_249079_, ResourceManager p_251134_, Executor p_250550_, Executor p_249221_
) {
- p_250336_.startTick();
+ net.neoforged.neoforge.client.model.geometry.GeometryLoaderManager.init();
- CompletableFuture