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
Copy link
Copy Markdown

vico93 commented May 8, 2026

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.

Copy link
Copy Markdown

@cputnam-a11y cputnam-a11y left a comment

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')
}
Copy link
Copy Markdown

@cputnam-a11y cputnam-a11y May 8, 2026

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
Copy link
Copy Markdown

KenFaze commented May 22, 2026

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
Copy link
Copy Markdown

m4rkooss commented Jun 1, 2026

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
Copy link
Copy Markdown

m4rkooss commented Jun 1, 2026

@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
Copy link
Copy Markdown

m4rkooss commented Jun 2, 2026

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
Copy link
Copy Markdown
Author

MasatoNakajima20 commented Jun 2, 2026

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
Copy link
Copy Markdown

m4rkooss commented Jun 2, 2026

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.

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.

5 participants