Skip to content

Commit 7c37b72

Browse files
committed
Resolve merge conflicts
2 parents 29f6c72 + 159fa7f commit 7c37b72

File tree

29 files changed

+187
-103
lines changed

29 files changed

+187
-103
lines changed

.github/workflows/build-prs.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 1000
26-
fetch-tags: true
27-
28-
# GradleUtils will append the branch name to the version,
29-
# but for that we need a properly checked out branch
30-
- name: Create branch for commit
31-
run:
32-
git switch -C pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.ref }}
23+
uses: neoforged/actions/checkout@main
3324

3425
- name: Setup JDK 21
3526
uses: neoforged/actions/setup-java@main
@@ -56,4 +47,4 @@ jobs:
5647
uses: neoforged/action-jar-compatibility/upload@v1
5748

5849
- name: Publish artifacts
59-
uses: neoforged/action-pr-publishing/upload@v1
50+
uses: neoforged/action-pr-publishing/upload@v1

.github/workflows/check-local-changes.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 1000
19-
fetch-tags: true
20-
21-
# GradleUtils will append the branch name to the version,
22-
# but for that we need a properly checked out branch
23-
- name: Create branch for commit
24-
run:
25-
git switch -C pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.ref }}
16+
uses: neoforged/actions/checkout@main
2617

2718
- name: Setup JDK 21
2819
uses: neoforged/actions/setup-java@main

.github/workflows/test-prs.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 1000
23-
fetch-tags: true
24-
25-
# GradleUtils will append the branch name to the version,
26-
# but for that we need a properly checked out branch
27-
- name: Create branch for commit
28-
run:
29-
git switch -C pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.ref }}
20+
uses: neoforged/actions/checkout@main
3021

3122
- name: Setup JDK 21
3223
uses: neoforged/actions/setup-java@main

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jetbrains_annotations_version=24.0.1
3030
slf4j_api_version=2.0.7
3131
apache_maven_artifact_version=3.8.5
3232
jarjar_version=0.4.1
33-
fancy_mod_loader_version=4.0.34
33+
fancy_mod_loader_version=4.0.35
3434
mojang_logging_version=1.1.1
3535
log4j_version=2.22.1
3636
guava_version=31.1.2-jre

patches/net/minecraft/client/gui/Gui.java.patch

+9
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@
101101
RenderSystem.disableDepthTest();
102102
}
103103

104+
@@ -220,6 +_,8 @@
105+
ItemStack itemstack = this.minecraft.player.getInventory().getArmor(3);
106+
if (itemstack.is(Blocks.CARVED_PUMPKIN.asItem())) {
107+
this.renderTextureOverlay(p_316735_, PUMPKIN_BLUR_LOCATION, 1.0F);
108+
+ } else {
109+
+ net.neoforged.neoforge.client.extensions.common.IClientItemExtensions.of(itemstack).renderHelmetOverlay(itemstack, this.minecraft.player, p_316735_, p_348538_);
110+
}
111+
}
112+
}
104113
@@ -262,8 +_,12 @@
105114
}
106115

patches/net/minecraft/client/gui/screens/options/controls/KeyBindsList.java.patch

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
--- a/net/minecraft/client/gui/screens/options/controls/KeyBindsList.java
22
+++ b/net/minecraft/client/gui/screens/options/controls/KeyBindsList.java
3+
@@ -45,7 +_,7 @@
4+
this.addEntry(new KeyBindsList.CategoryEntry(Component.translatable(s1)));
5+
}
6+
7+
- Component component = Component.translatable(keymapping.getName());
8+
+ Component component = keymapping.getDisplayName();
9+
int i = p_346132_.font.width(component);
10+
if (i > this.maxNameWidth) {
11+
this.maxNameWidth = i;
312
@@ -158,6 +_,7 @@
413
)
514
.build();
@@ -8,7 +17,7 @@
817
KeyBindsList.this.minecraft.options.setKey(p_345998_, p_345998_.getDefaultKey());
918
KeyBindsList.this.resetMappingAndUpdateButtons();
1019
}).bounds(0, 0, 50, 20).createNarration(p_344899_ -> Component.translatable("narrator.controls.reset", p_345196_)).build();
11-
@@ -210,7 +_,7 @@
20+
@@ -210,13 +_,13 @@
1221
MutableComponent mutablecomponent = Component.empty();
1322
if (!this.key.isUnbound()) {
1423
for (KeyMapping keymapping : KeyBindsList.this.minecraft.options.keyMappings) {
@@ -17,3 +26,10 @@
1726
if (this.hasCollision) {
1827
mutablecomponent.append(", ");
1928
}
29+
30+
this.hasCollision = true;
31+
- mutablecomponent.append(Component.translatable(keymapping.getName()));
32+
+ mutablecomponent.append(keymapping.getDisplayName());
33+
}
34+
}
35+
}

patches/net/minecraft/client/renderer/chunk/SectionRenderDispatcher.java.patch

+8-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@
3636
}
3737

3838
@Override
39-
@@ -552,7 +_,7 @@
39+
@@ -547,12 +_,14 @@
40+
RenderChunkRegion renderchunkregion = this.region;
41+
this.region = null;
42+
if (renderchunkregion == null) {
43+
+ // Neo: Fix MC-279596 (global block entities not being updated for empty sections)
44+
+ RenderSection.this.updateGlobalBlockEntities(Set.of());
45+
RenderSection.this.setCompiled(SectionRenderDispatcher.CompiledSection.EMPTY);
46+
return CompletableFuture.completedFuture(SectionRenderDispatcher.SectionTaskResult.SUCCESSFUL);
4047
} else {
4148
SectionPos sectionpos = SectionPos.of(RenderSection.this.origin);
4249
SectionCompiler.Results sectioncompiler$results = SectionRenderDispatcher.this.sectionCompiler

patches/net/minecraft/world/effect/MobEffect.java.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
return this.requiredFeatures;
3333
}
3434

35-
- static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) {
35+
- public static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) {
3636
+ /**
3737
+ * Neo: Allowing mods to define client behavior for their MobEffects
3838
+ * @deprecated Use {@link net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent} instead
@@ -41,7 +41,7 @@
4141
+ public void initializeClient(java.util.function.Consumer<net.neoforged.neoforge.client.extensions.common.IClientMobEffectExtensions> consumer) {
4242
+ }
4343
+
44-
+ static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation, @Nullable it.unimi.dsi.fastutil.ints.Int2DoubleFunction curve) {
44+
+ public static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation, @Nullable it.unimi.dsi.fastutil.ints.Int2DoubleFunction curve) {
4545
+
4646
+ public AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) {
4747
+ this(id, amount, operation, null);

patches/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
--- a/net/minecraft/world/entity/monster/AbstractSkeleton.java
22
+++ b/net/minecraft/world/entity/monster/AbstractSkeleton.java
3-
@@ -157,7 +_,7 @@
3+
@@ -157,8 +_,8 @@
44
if (this.level() != null && !this.level().isClientSide) {
55
this.goalSelector.removeGoal(this.meleeGoal);
66
this.goalSelector.removeGoal(this.bowGoal);
77
- ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
8+
- if (itemstack.is(Items.BOW)) {
89
+ ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, item -> item instanceof net.minecraft.world.item.BowItem));
9-
if (itemstack.is(Items.BOW)) {
10+
+ if (itemstack.getItem() instanceof net.minecraft.world.item.BowItem) {
1011
int i = this.getHardAttackInterval();
1112
if (this.level().getDifficulty() != Difficulty.HARD) {
13+
i = this.getAttackInterval();
1214
@@ -182,9 +_,11 @@
1315

1416
@Override

src/generated/resources/assets/c/lang/en_us.json

+1
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@
365365
"tag.item.c.tools.shear": "Shears",
366366
"tag.item.c.tools.shield": "Shields",
367367
"tag.item.c.tools.spear": "Spears",
368+
"tag.item.c.tools.wrench": "Wrenches",
368369
"tag.item.c.villager_job_sites": "Villager Job Sites",
369370
"tag.item.neoforge.enchanting_fuels": "Enchanting Fuels",
370371
"tag.worldgen.biome.c.hidden_from_locator_selection": "Hidden From Locator's Selection",

src/generated/resources/data/c/tags/item/tools.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"#c:tools/shield",
1515
"#c:tools/spear",
1616
"#c:tools/mace",
17+
"#c:tools/wrench",
1718
"#c:tools/mining_tool",
1819
"#c:tools/melee_weapon",
1920
"#c:tools/ranged_weapon",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"values": []
3+
}

src/main/java/net/neoforged/neoforge/capabilities/CapabilityHooks.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ public static void registerVanillaProviders(RegisterCapabilitiesEvent event) {
9797
BlockEntityType.DISPENSER,
9898
BlockEntityType.DROPPER,
9999
BlockEntityType.JUKEBOX,
100-
BlockEntityType.CRAFTER);
100+
BlockEntityType.CRAFTER,
101+
BlockEntityType.DECORATED_POT);
101102
for (var type : nonSidedVanillaContainers) {
102103
event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, type, (container, side) -> new InvWrapper(container));
103104
}

src/main/java/net/neoforged/neoforge/client/extensions/IKeyMappingExtension.java

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.mojang.blaze3d.platform.InputConstants;
99
import net.minecraft.client.KeyMapping;
10+
import net.minecraft.network.chat.Component;
1011
import net.neoforged.neoforge.client.settings.IKeyConflictContext;
1112
import net.neoforged.neoforge.client.settings.KeyModifier;
1213

@@ -56,4 +57,12 @@ default boolean hasKeyModifierConflict(KeyMapping other) {
5657
}
5758
return false;
5859
}
60+
61+
/**
62+
* {@return the display name of this key mapping}
63+
* Defaults to a {@linkplain Component#translatable(String) translatable component} of the {@link KeyMapping#getName() name}.
64+
*/
65+
default Component getDisplayName() {
66+
return Component.translatable(self().getName());
67+
}
5968
}

src/main/java/net/neoforged/neoforge/client/extensions/common/IClientItemExtensions.java

+15-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
import com.mojang.blaze3d.vertex.PoseStack;
99
import java.util.function.Consumer;
10+
import net.minecraft.client.DeltaTracker;
1011
import net.minecraft.client.Minecraft;
1112
import net.minecraft.client.gui.Font;
13+
import net.minecraft.client.gui.GuiGraphics;
1214
import net.minecraft.client.model.HumanoidModel;
1315
import net.minecraft.client.model.Model;
1416
import net.minecraft.client.player.LocalPlayer;
@@ -143,18 +145,25 @@ default Model getGenericArmorModel(LivingEntity livingEntity, ItemStack itemStac
143145
*/
144146
default void setupModelAnimations(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, Model model, float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks, float netHeadYaw, float headPitch) {}
145147

148+
/**
149+
* @deprecated Switch to {@link IClientItemExtensions#renderHelmetOverlay(ItemStack, Player, GuiGraphics, DeltaTracker)}
150+
*/
151+
@Deprecated(forRemoval = true)
152+
default void renderHelmetOverlay(ItemStack stack, Player player, int width, int height, float partialTick) {}
153+
146154
/**
147155
* Called when the client starts rendering the HUD, and is wearing this item in the helmet slot.
148156
* <p>
149157
* This is where pumpkins would render their overlay.
150158
*
151-
* @param stack The item stack
152-
* @param player The player entity
153-
* @param width The viewport width
154-
* @param height Viewport height
155-
* @param partialTick Partial tick time, useful for interpolation
159+
* @param stack The item stack
160+
* @param player The player entity
161+
* @param guiGraphics The gui graphics
162+
* @param deltaTracker The delta tracker
156163
*/
157-
default void renderHelmetOverlay(ItemStack stack, Player player, int width, int height, float partialTick) {}
164+
default void renderHelmetOverlay(ItemStack stack, Player player, GuiGraphics guiGraphics, DeltaTracker deltaTracker) {
165+
renderHelmetOverlay(stack, player, guiGraphics.guiWidth(), guiGraphics.guiHeight(), deltaTracker.getGameTimeDeltaPartialTick(true));
166+
}
158167

159168
/**
160169
* Queries this item's renderer.

src/main/java/net/neoforged/neoforge/client/gui/ModListScreen.java

+32-25
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import net.minecraft.client.gui.GuiGraphics;
2626
import net.minecraft.client.gui.components.Button;
2727
import net.minecraft.client.gui.components.EditBox;
28+
import net.minecraft.client.gui.components.LogoRenderer;
2829
import net.minecraft.client.gui.components.ObjectSelectionList;
2930
import net.minecraft.client.gui.narration.NarrationElementOutput;
3031
import net.minecraft.client.gui.screens.Screen;
@@ -374,30 +375,36 @@ private void updateCache() {
374375
VersionChecker.CheckResult vercheck = VersionChecker.getResult(selectedMod);
375376

376377
@SuppressWarnings("resource")
377-
Pair<ResourceLocation, Size2i> logoData = selectedMod.getLogoFile().map(logoFile -> {
378-
TextureManager tm = this.minecraft.getTextureManager();
379-
final Pack.ResourcesSupplier resourcePack = ResourcePackLoader.getPackFor(selectedMod.getModId())
380-
.orElse(ResourcePackLoader.getPackFor("neoforge").orElseThrow(() -> new RuntimeException("Can't find neoforge, WHAT!")));
381-
try (PackResources packResources = resourcePack.openPrimary(new PackLocationInfo("mod/" + selectedMod.getModId(), Component.empty(), PackSource.BUILT_IN, Optional.empty()))) {
382-
NativeImage logo = null;
383-
IoSupplier<InputStream> logoResource = packResources.getRootResource(logoFile.split("[/\\\\]"));
384-
if (logoResource != null)
385-
logo = NativeImage.read(logoResource.get());
386-
if (logo != null) {
387-
388-
return Pair.of(tm.register("modlogo", new DynamicTexture(logo) {
389-
@Override
390-
public void upload() {
391-
this.bind();
392-
NativeImage td = this.getPixels();
393-
// Use custom "blur" value which controls texture filtering (nearest-neighbor vs linear)
394-
this.getPixels().upload(0, 0, 0, 0, 0, td.getWidth(), td.getHeight(), selectedMod.getLogoBlur(), false, false, false);
395-
}
396-
}), new Size2i(logo.getWidth(), logo.getHeight()));
397-
}
398-
} catch (IOException | IllegalArgumentException e) {}
399-
return Pair.<ResourceLocation, Size2i>of(null, new Size2i(0, 0));
400-
}).orElse(Pair.of(null, new Size2i(0, 0)));
378+
Pair<ResourceLocation, Size2i> logoData;
379+
380+
if (selectedMod.getModId().equals(ResourceLocation.DEFAULT_NAMESPACE)) {
381+
logoData = Pair.of(LogoRenderer.MINECRAFT_LOGO, new Size2i(LogoRenderer.LOGO_TEXTURE_WIDTH, LogoRenderer.LOGO_TEXTURE_HEIGHT));
382+
} else {
383+
logoData = selectedMod.getLogoFile().map(logoFile -> {
384+
TextureManager tm = this.minecraft.getTextureManager();
385+
final Pack.ResourcesSupplier resourcePack = ResourcePackLoader.getPackFor(selectedMod.getModId())
386+
.orElse(ResourcePackLoader.getPackFor("neoforge").orElseThrow(() -> new RuntimeException("Can't find neoforge, WHAT!")));
387+
try (PackResources packResources = resourcePack.openPrimary(new PackLocationInfo("mod/" + selectedMod.getModId(), Component.empty(), PackSource.BUILT_IN, Optional.empty()))) {
388+
NativeImage logo = null;
389+
IoSupplier<InputStream> logoResource = packResources.getRootResource(logoFile.split("[/\\\\]"));
390+
if (logoResource != null)
391+
logo = NativeImage.read(logoResource.get());
392+
if (logo != null) {
393+
394+
return Pair.of(tm.register("modlogo", new DynamicTexture(logo) {
395+
@Override
396+
public void upload() {
397+
this.bind();
398+
NativeImage td = this.getPixels();
399+
// Use custom "blur" value which controls texture filtering (nearest-neighbor vs linear)
400+
this.getPixels().upload(0, 0, 0, 0, 0, td.getWidth(), td.getHeight(), selectedMod.getLogoBlur(), false, false, false);
401+
}
402+
}), new Size2i(logo.getWidth(), logo.getHeight()));
403+
}
404+
} catch (IOException | IllegalArgumentException e) {}
405+
return Pair.<ResourceLocation, Size2i>of(null, new Size2i(0, 0));
406+
}).orElse(Pair.of(null, new Size2i(0, 0)));
407+
}
401408

402409
lines.add(selectedMod.getDisplayName());
403410
lines.add(FMLTranslations.parseMessage("fml.menu.mods.info.version", MavenVersionTranslator.artifactVersionToString(selectedMod.getVersion())));
@@ -416,7 +423,7 @@ public void upload() {
416423
lines.add(FMLTranslations.parseMessage("fml.menu.mods.info.updateavailable", vercheck.url() == null ? "" : vercheck.url()).replace("\r\n", "\n"));
417424
lines.add(FMLTranslations.parseMessage("fml.menu.mods.info.license", selectedMod.getOwningFile().getLicense()).replace("\r\n", "\n"));
418425
lines.add(null);
419-
lines.add(FMLTranslations.parseMessageWithFallback("fml.menu.mods.info.description." + selectedMod.getModId(), selectedMod::getDescription));
426+
lines.add(FMLTranslations.getPattern("fml.menu.mods.info.description." + selectedMod.getModId(), selectedMod::getDescription));
420427

421428
/* Removed because people bitched that this information was misleading.
422429
lines.add(null);

src/main/java/net/neoforged/neoforge/common/NeoForgeConfig.java

+8
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ public static class Server {
6464
*/
6565
public static class Common {
6666
public final ModConfigSpec.EnumValue<TagConventionLogWarning.LogWarningMode> logUntranslatedItemTagWarnings;
67+
6768
public final ModConfigSpec.EnumValue<TagConventionLogWarning.LogWarningMode> logLegacyTagWarnings;
6869

70+
public final BooleanValue attributeAdvancedTooltipDebugInfo;
71+
6972
Common(ModConfigSpec.Builder builder) {
7073
logUntranslatedItemTagWarnings = builder
7174
.comment("A config option mainly for developers. Logs out modded item tags that do not have translations when running on integrated server. Format desired is tag.item.<namespace>.<path> for the translation key. Defaults to SILENCED.")
@@ -76,6 +79,11 @@ public static class Common {
7679
.comment("A config option mainly for developers. Logs out modded tags that are using the 'forge' namespace when running on integrated server. Defaults to DEV_SHORT.")
7780
.translation("neoforge.configgui.logLegacyTagWarnings")
7881
.defineEnum("logLegacyTagWarnings", TagConventionLogWarning.LogWarningMode.DEV_SHORT);
82+
83+
attributeAdvancedTooltipDebugInfo = builder
84+
.comment("Set this to true to enable showing debug information about attributes on an item when advanced tooltips is on.")
85+
.translation("neoforge.configgui.attributeAdvancedTooltipDebugInfo")
86+
.define("attributeAdvancedTooltipDebugInfo", true);
7987
}
8088
}
8189

src/main/java/net/neoforged/neoforge/common/TagConventionLogWarning.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,11 @@ public enum LogWarningMode {
370370
createForgeMapEntry(Registries.ITEM, "armors/chestplates", ItemTags.CHEST_ARMOR),
371371
createForgeMapEntry(Registries.ITEM, "armors/leggings", ItemTags.LEG_ARMOR),
372372
createForgeMapEntry(Registries.ITEM, "armors/boots", ItemTags.FOOT_ARMOR),
373-
createForgeMapEntry(Registries.ITEM, "wrench", "tools/wrenches"),
374-
createForgeMapEntry(Registries.ITEM, "wrenches", "tools/wrenches"),
375-
createForgeMapEntry(Registries.ITEM, "tools/wrench", "tools/wrenches"),
376-
createForgeMapEntry(Registries.ITEM, "tools/wrenches", "tools/wrenches"),
373+
createForgeMapEntry(Registries.ITEM, "wrench", Tags.Items.TOOLS_WRENCH),
374+
createForgeMapEntry(Registries.ITEM, "wrenches", Tags.Items.TOOLS_WRENCH),
375+
createForgeMapEntry(Registries.ITEM, "tools/wrench", Tags.Items.TOOLS_WRENCH),
376+
createForgeMapEntry(Registries.ITEM, "tools/wrenches", Tags.Items.TOOLS_WRENCH),
377+
createMapEntry(Registries.ITEM, "c", "tools/wrenches", Tags.Items.TOOLS_WRENCH),
377378
createForgeMapEntry(Registries.ITEM, "food", Tags.Items.FOODS),
378379
createForgeMapEntry(Registries.ITEM, "foods", Tags.Items.FOODS),
379380
createForgeMapEntry(Registries.ITEM, "fruit", Tags.Items.FOODS_FRUIT),

0 commit comments

Comments
 (0)