Skip to content

Port to 26.1.x#950

Open
MasatoNakajima20 wants to merge 3 commits into
Tschipp:1.21.11from
MasatoNakajima20:26.1.x
Open

Port to 26.1.x#950
MasatoNakajima20 wants to merge 3 commits into
Tschipp:1.21.11from
MasatoNakajima20:26.1.x

Conversation

@MasatoNakajima20

Copy link
Copy Markdown

No description provided.

- Fixed crash on startup (Components not bound yet) caused by InventoryMixin
  creating an ItemStack as a static field before data components were
  initialized. Replaced with lazy creation via method call.
@vico93

vico93 commented May 8, 2026

Copy link
Copy Markdown

Thank you so much for this @MasatoNakajima20!

BTW, judging from your selection of mods you are updating, by chance are you accepting suggestions for other mods to port? I'm really missing Earth2Java since 1.20.x and wonder if you would like to port that as well.

@cputnam-a11y cputnam-a11y left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I am not Tschipp, but I figured I would review. please feel free to object / disregard / dismiss if you disagree on any of these points.

Comment on lines 28 to +61
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import tschipp.carryon.common.carry.CarryOnData;
import tschipp.carryon.common.carry.CarryOnDataManager;

@Mixin(Inventory.class)
public class InventoryMixin
{
@Unique
private static final ItemStack DUMMY_STACK = new ItemStack(Blocks.COBBLESTONE, 1);
private static ItemStack getDummyStack() {
return new ItemStack(Blocks.COBBLESTONE, 1);
}

@Shadow
public Player player;

@Shadow
public int selected;

@Shadow
public NonNullList<ItemStack> items;

@WrapOperation(method = "getFreeSlot()I", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/core/NonNullList;get(I)Ljava/lang/Object;"))
private Object getFreeSlotEmptyCheck(NonNullList<Object> instance, int slot, Operation<Object> original)
{
if(slot == selected && CarryOnDataManager.getCarryData(player).isCarrying())
{
return DUMMY_STACK;
return getDummyStack();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return getDummyStack();
import net.minecraft.world.item.ItemStackTemplate;
import net.minecraft.world.level.block.Blocks;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import tschipp.carryon.common.carry.CarryOnData;
import tschipp.carryon.common.carry.CarryOnDataManager;
@Mixin(Inventory.class)
public class InventoryMixin
{
@Unique
private static ItemStack DUMMY_STACK = new ItemStackTemplate(Blocks.COBBLESTONE.asItem());
@Shadow
public Player player;
@@ -56,7 +58,7 @@
{
if(slot == selected && CarryOnDataManager.getCarryData(player).isCarrying())
{
return DUMMY_STACK.create();

Comment on lines -82 to -83
var layer = renderState.newLayer();
layer.setRenderType(RenderTypes.glint());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just no longer needed? It seems like it would be a change in behavior.

Comment thread settings.gradle
Comment on lines -6 to -18
exclusiveContent {
forRepository {
maven {
name = 'Fabric'
url = uri('https://maven.fabricmc.net')
}
}
filter {
includeGroup('net.fabricmc')
includeGroup('net.fabricmc.unpick')
includeGroup('fabric-loom')
includeGroup('net.fabricmc.unpick')
}

@cputnam-a11y cputnam-a11y May 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? removing exclusive content will make the build slower (by a small amount, don't know that it matters that much). Usually I see

exclusiveContent {
    forRepository {
        maven {
                name = 'Fabric'
                url = uri('https://maven.fabricmc.net')
            }
        }
        filter {
           includeGroupAndSubgroups('net.fabricmc')
        }
    }
}

@cputnam-a11y

Copy link
Copy Markdown

And yeah, thanks so much for the p.r. Looking forwards to playing on 26.1

@MasatoNakajima20

Copy link
Copy Markdown
Author

Thank you so much for this @MasatoNakajima20!

BTW, judging from your selection of mods you are updating, by chance are you accepting suggestions for other mods to port? I'm really missing Earth2Java since 1.20.x and wonder if you would like to port that as well.

Hi @vico93

You're very much welcome. Im not a modder or anything of the sort, It so happen that Im using the 2 mods for our server which were dying to update to 26.1.x. Since there are no movements for months, I just decided to look it up and take it on myself..

I finally made it work on a local save and server so I just went my way and tried to share it with the community.

TLDR
Im not actively modding, just forced by wants..

@MasatoNakajima20

Copy link
Copy Markdown
Author

Hi, I am not Tschipp, but I figured I would review. please feel free to object / disregard / dismiss if you disagree on any of these points.

Hi @cputnam-a11y

I won't object, disregard or dimiss these comments. As per my reply to Vico93, im not a modder, it so happens that I have a programming background and some knowledge with Java. I dont know anything with minecraft language or its structure, I just play. This was a big task for me, rummaging through doccumentations that I dont fully 100% understand, looking for the file that contians the line of code I need to change, I just wanted to make the mod work for 26.1.x disregarding efficiency, esp with 26.2 just looming around the corner. (Who doesn't want their world to have new features, right?)

I got it working on my local and on a deficated server so might as well share..

I'd be happy if you can help correct any mistakes that I made during my attempt to port. I'll be removing this repo anyway once the author started updating the main stream.

@cputnam-a11y

Copy link
Copy Markdown

Hi, I am not Tschipp, but I figured I would review. please feel free to object / disregard / dismiss if you disagree on any of these points.

Hi @cputnam-a11y

I won't object, disregard or dimiss these comments. As per my reply to Vico93, im not a modder, it so happens that I have a programming background and some knowledge with Java. I dont know anything with minecraft language or its structure, I just play. This was a big task for me, rummaging through doccumentations that I dont fully 100% understand, looking for the file that contians the line of code I need to change, I just wanted to make the mod work for 26.1.x disregarding efficiency, esp with 26.2 just looming around the corner. (Who doesn't want their world to have new features, right?)

I got it working on my local and on a deficated server so might as well share..

I'd be happy if you can help correct any mistakes that I made during my attempt to port. I'll be removing this repo anyway once the author started updating the main stream.

no worries, I'll just leave them here in case tschipp decides to use this as a base. enjoy your server :)

@MasatoNakajima20

Copy link
Copy Markdown
Author

Hi, I am not Tschipp, but I figured I would review. please feel free to object / disregard / dismiss if you disagree on any of these points.

Hi @cputnam-a11y
I won't object, disregard or dimiss these comments. As per my reply to Vico93, im not a modder, it so happens that I have a programming background and some knowledge with Java. I dont know anything with minecraft language or its structure, I just play. This was a big task for me, rummaging through doccumentations that I dont fully 100% understand, looking for the file that contians the line of code I need to change, I just wanted to make the mod work for 26.1.x disregarding efficiency, esp with 26.2 just looming around the corner. (Who doesn't want their world to have new features, right?)
I got it working on my local and on a deficated server so might as well share..
I'd be happy if you can help correct any mistakes that I made during my attempt to port. I'll be removing this repo anyway once the author started updating the main stream.

no worries, I'll just leave them here in case tschipp decides to use this as a base. enjoy your server :)

We sure are enjoying the Little Babies. Yes, Tschipp already has the groundwork in front of him. :D

@KenFaze

KenFaze commented May 22, 2026

Copy link
Copy Markdown

um can i get the mod fille so i can download it right away?

@cputnam-a11y

Copy link
Copy Markdown

um can i get the mod fille so i can download it right away?

I would suggest not requesting unvalidated jar files, with the current wave of Minecraft malware spreading.

@m4rkooss

m4rkooss commented Jun 1, 2026

Copy link
Copy Markdown

Hi @MasatoNakajima20 ,
I’m having issues building the project.

Could you please tell me which setup was used to build it successfully?
(Gradle version, Java version, and Fabric Loom version if possible)

I tried using Java 21 and Gradle 4.9, but it didn’t work because I kept running into errors during the build process, so I’m not sure what the correct environment should be.

Thanks!

@cputnam-a11y

Copy link
Copy Markdown

Hi @MasatoNakajima20 , I’m having issues building the project.

Could you please tell me which setup was used to build it successfully? (Gradle version, Java version, and Fabric Loom version if possible)

I tried using Java 21 and Gradle 4.9, but it didn’t work because I kept running into errors during the build process, so I’m not sure what the correct environment should be.

Thanks!

The base project requires at least gradle 8.14, but the wrapper will take care of that. The base project requires java 21, but it was bumped to java 25 as part of this pr, so you will need java 25

@cputnam-a11y

Copy link
Copy Markdown

This pr also bumps the wrapper version to 9.4

@m4rkooss

m4rkooss commented Jun 1, 2026

Copy link
Copy Markdown

@cputnam-a11y
thanks for the clarification.

I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).

Error:
JvmVendorSpec does not have member field IBM_SEMERU

Why does this happen ?

@MasatoNakajima20

Copy link
Copy Markdown
Author

@cputnam-a11y thanks for the clarification.

I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).

Error: JvmVendorSpec does not have member field IBM_SEMERU

Why does this happen ?

Sorry for the lack of response..
I compiled it under

Jave 25
Loom 1.16-Snap
Gradle 9.4

image

@m4rkooss

m4rkooss commented Jun 2, 2026

Copy link
Copy Markdown

Hey,
sorry for bothering you again.
Could you tell me your exact workflow for building the mod? From start to finish.

For example:
Do you just clone/download the repo and run a build command?
Do you delete any folders or caches beforehand?

I'm wondering if I might have missed something simple during the setup process.

Thanks!

@MasatoNakajima20

MasatoNakajima20 commented Jun 2, 2026

Copy link
Copy Markdown
Author

Hey, sorry for bothering you again. Could you tell me your exact workflow for building the mod? From start to finish.

For example: Do you just clone/download the repo and run a build command? Do you delete any folders or caches beforehand?

I'm wondering if I might have missed something simple during the setup process.

Thanks!

Hi,

Clone/Fork repo
Build

Nothing added/deleted

@m4rkooss

m4rkooss commented Jun 2, 2026

Copy link
Copy Markdown

Oh, that's crazy. I honestly don't know why it's not working on my end then.

Would it be possible for you to send me the built JAR file, or maybe upload it somewhere? That way I can at least use it while I keep trying to figure out the build issue.

@cputnam-a11y

Copy link
Copy Markdown

@cputnam-a11y thanks for the clarification.

I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).

Error: JvmVendorSpec does not have member field IBM_SEMERU

Why does this happen ?

That would be an outdated version of the toolchain resolver. Not sure why you would have that, but it should be in setting.gradle, near the top

@cputnam-a11y

Copy link
Copy Markdown

Oh, that's crazy. I honestly don't know why it's not working on my end then.

Would it be possible for you to send me the built JAR file, or maybe upload it somewhere? That way I can at least use it while I keep trying to figure out the build issue.

For security reasons, I would suggest not, but y'all can hash that out without me.

@m4rkooss

m4rkooss commented Jun 3, 2026

Copy link
Copy Markdown

@cputnam-a11y thanks for the clarification.
I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).
Error: JvmVendorSpec does not have member field IBM_SEMERU
Why does this happen ?

That would be an outdated version of the toolchain resolver. Not sure why you would have that, but it should be in setting.gradle, near the top

And how can I fix that then ?

@MasatoNakajima20

MasatoNakajima20 commented Jun 3, 2026

Copy link
Copy Markdown
Author

@cputnam-a11y thanks for the clarification.
I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).
Error: JvmVendorSpec does not have member field IBM_SEMERU
Why does this happen ?

That would be an outdated version of the toolchain resolver. Not sure why you would have that, but it should be in setting.gradle, near the top

And how can I fix that then ?

There is nowhere in the build files that calls the IBM Toolchain for this Project. Have you Cloned the whole project on am empty Folder?

I'm also using Microsoft JDK Hotspot if that helps.

Maybe you may want to try and clean your gradle

.\gradlew --stop
.\gradlew clean build

Then I assume you're building via the wrapper

.\gradlew build --console=plain

@cputnam-a11y

Copy link
Copy Markdown

@cputnam-a11y thanks for the clarification.
I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).
Error: JvmVendorSpec does not have member field IBM_SEMERU
Why does this happen ?

That would be an outdated version of the toolchain resolver. Not sure why you would have that, but it should be in setting.gradle, near the top

And how can I fix that then ?

There is nowhere in the build files that calls the IBM Toolchain for this Project. Have you Cloned the whole project on am empty Folder?

I'm also using Microsoft JDK Hotspot if that helps.

Maybe you may want to try and clean your gradle

.\gradlew --stop .\gradlew clean build

Then I assume you're building via the wrapper

.\gradlew build --console=plain

Hi, the issue is in settings.gradle. I'm not sure why it doesn't appear for you, but it does exist, and should be fixed at some point

@cputnam-a11y

Copy link
Copy Markdown

@cputnam-a11y thanks for the clarification.
I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).
Error: JvmVendorSpec does not have member field IBM_SEMERU
Why does this happen ?

That would be an outdated version of the toolchain resolver. Not sure why you would have that, but it should be in setting.gradle, near the top

And how can I fix that then ?

gradle/gradle#35596 (comment)

@MasatoNakajima20

MasatoNakajima20 commented Jun 4, 2026

Copy link
Copy Markdown
Author

@cputnam-a11y thanks for the clarification.
I’m still running into an issue when trying to build the project with the current setup (Java 25 + Gradle wrapper 9.4).
Error: JvmVendorSpec does not have member field IBM_SEMERU
Why does this happen ?

That would be an outdated version of the toolchain resolver. Not sure why you would have that, but it should be in setting.gradle, near the top

And how can I fix that then ?

There is nowhere in the build files that calls the IBM Toolchain for this Project. Have you Cloned the whole project on am empty Folder?
I'm also using Microsoft JDK Hotspot if that helps.
Maybe you may want to try and clean your gradle
.\gradlew --stop .\gradlew clean build
Then I assume you're building via the wrapper
.\gradlew build --console=plain

Hi, the issue is in settings.gradle. I'm not sure why it doesn't appear for you, but it does exist, and should be fixed at some point

At this Point, I don't know. I ran the build again and it works fine for me.
image
image

At this point, I'm leaning into the issue that this may be JVM dependent.. That gradle issue you posted is reproducible using adoptium jvm, and I'm not using adoptium.

@KaroUniform

Copy link
Copy Markdown

Thanks for doing this port! 🙏 Confirming it builds and runs for us on MC 26.1.2 / Java 25.

We've been using this 26.1.x branch as a compileOnly dependency for an optional Carry On integration in our mod (ReMorphed):

  • Builds green for both Fabric and NeoForge from a clean checkout on Temurin 25 (stock OpenJDK — no IBM Semeru required), Gradle 9.5.
  • In-game (Fabric): the built carryon-fabric-26.1.2-3.0.1.jar loads in a 26.1.2 dev client and works — carrying blocks, mobs and players all function. Our compat resolves against the named mappings without any issues.
  • We didn't test the NeoForge runtime in-game (an unrelated dependency of ours crashes the NeoForge dev client), but the NeoForge jar compiles and builds fine.

Test environment:

  • Minecraft 26.1.2
  • Java Temurin 25.0.3 (LTS)
  • Fabric Loader 0.18.x, Fabric API 0.148.0+26.1.2
  • NeoForge 26.1.2.x (build only)
  • Carry On artifacts: carryon-{fabric,neoforge,common}-26.1.2-3.0.1.jar

Thanks again @MasatoNakajima20 — hope this helps toward getting the port merged!

@MasatoNakajima20

Copy link
Copy Markdown
Author

Thanks for doing this port! 🙏 Confirming it builds and runs for us on MC 26.1.2 / Java 25.

We've been using this 26.1.x branch as a compileOnly dependency for an optional Carry On integration in our mod (ReMorphed):

  • Builds green for both Fabric and NeoForge from a clean checkout on Temurin 25 (stock OpenJDK — no IBM Semeru required), Gradle 9.5.
  • In-game (Fabric): the built carryon-fabric-26.1.2-3.0.1.jar loads in a 26.1.2 dev client and works — carrying blocks, mobs and players all function. Our compat resolves against the named mappings without any issues.
  • We didn't test the NeoForge runtime in-game (an unrelated dependency of ours crashes the NeoForge dev client), but the NeoForge jar compiles and builds fine.

Test environment:

  • Minecraft 26.1.2
  • Java Temurin 25.0.3 (LTS)
  • Fabric Loader 0.18.x, Fabric API 0.148.0+26.1.2
  • NeoForge 26.1.2.x (build only)
  • Carry On artifacts: carryon-{fabric,neoforge,common}-26.1.2-3.0.1.jar

Thanks again @MasatoNakajima20 — hope this helps toward getting the port merged!

@KaroUniform - Thank you for the verifying. Keep an eye once 26.2 comes out as I'm planning to Bump to that version as soon as the APIs and the build stabilizes.

@m4rkooss, @cputnam-a11y - This highly suggests the possibility that your JDK is the one causing the compile issue and not connected to the Gradle Issue mentioned.

@shinozukagreta

Copy link
Copy Markdown

Very well done. I was able to build very quickly and efficiently in Terminal on Mac for my 26.1.2 world on Fabric and it runs just fine.
移植作業お疲れさまでした。: )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants