Skip to content

Add Meteor 26.x parser profile support#1

Merged
GhostTypes merged 8 commits into
masterfrom
meteor-26
May 2, 2026
Merged

Add Meteor 26.x parser profile support#1
GhostTypes merged 8 commits into
masterfrom
meteor-26

Conversation

@GhostTypes
Copy link
Copy Markdown
Contributor

Summary

Adds dual mapping profile plumbing and brings the default parser profile up to Meteor 26.x / Mojmap compatibility. Legacy Yarn/class_* support is retained behind the legacy profile source set.

Validation

  • ./gradlew.bat --no-daemon test
  • ./gradlew.bat --no-daemon compileJava -PparserProfile=legacy
  • ./gradlew.bat --no-daemon run --args="--input fixtures/addons/jars --output output/poc-scan --summary output/poc-scan/summary.json --profile 26x"

Notes

Legacy runtime fixture tests require legacy fixture jars. The current fixture set is 26x/Mojmap.

Serialization cleanup for ISerializable/settings overrides is intentionally deferred to follow-up commits.

gemini-code-assist[bot]

This comment was marked as outdated.

GhostTypes added 6 commits May 2, 2026 14:19
- StubGenerator: feed hand-written shim source dirs as exclusions, render
  nested-class references as Outer.Inner when outer is a manual shim.
- Move legacy EntityTypeListSetting to profile-legacy and add 26x version
  using net.minecraft.world.entity.EntityType.
- Add hand shim for WindowTabScreen and class_3417 in profile-26x, expand
  McpSchema with InitializeResult and ListToolsResult.
- Move all class_*-using Setting subclasses, Settings, SettingGroup,
  System, Names, SettingColor, and the class_2382 shim from src/main/java
  to src/profile-legacy/java.
- Add Mojmap twins under src/profile-26x/java using CompoundTag, Block,
  Item, BlockPos, Holder, ResourceKey, SoundEvent, EntityType, Vec3i,
  Enchantment.
- Setting (26x) now declares save/load against CompoundTag.
- Add WindowScreen and Enchantment shims under profile-26x.
- Remove meteor-villager-roller (1.21.11/Yarn) from the fixture set.

src/main/java is now Yarn-free; 26x compiles clean against pure Mojmap
fixtures.
Drop addons that still ship 1.21.x/Yarn jars (Baritone-Controller, mc-games,
meteor-satellite-addon, Meteorist, MeteorPlus, nerv-printer-addon,
Trouser-Streak). Add 26.x-confirmed entries (MeteorAdditions, PowHax,
Seija-Printer) explicitly. CI now downloads only Mojmap fixtures.
@GhostTypes
Copy link
Copy Markdown
Contributor Author

/gemini review

@GhostTypes GhostTypes self-assigned this May 2, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a multi-profile architecture to support different Minecraft versions and mapping sets, specifically adding a new 26x (Mojmap) profile alongside the existing legacy (Yarn) profile. The changes include build script updates to handle profile-specific source sets, a large collection of new stub classes for the 26x profile, and refactoring of the StubGenerator and ValueNormalizer to be profile-aware. Feedback focuses on critical issues in the stub implementations, including registry key collisions in SimpleRegistry, class name collisions for anonymous placeholders in Modules, and several potential NullPointerException risks in setting parsers and builders. Additionally, a non-functional builder method in the legacy profile was identified.

private final Map<ResourceLocation, T> values = new LinkedHashMap<>();

public void add(T value) {
if (value != null) values.put(ResourceLocation.parse(value.getClass().getSimpleName().toLowerCase()), value);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Registry key generation using value.getClass().getSimpleName() is flawed for stubs. For classes like Item or EntityType that use static instances of the same type, all entries will share the same key (e.g., "item" or "entitytype"), causing collisions and overwriting previous entries in the registry. This effectively breaks registry-based lookups for most Minecraft objects in the 26x profile.

Suggested change
if (value != null) values.put(ResourceLocation.parse(value.getClass().getSimpleName().toLowerCase()), value);
if (value != null) values.put(ResourceLocation.parse("stub_" + Integer.toHexString(System.identityHashCode(value))), value);

Comment on lines +67 to +70
Module placeholder = new Module(placeholderCategory, name, "") {};
moduleInstances.put(placeholder.getClass(), placeholder);
getGroup(placeholderCategory).add(placeholder);
return placeholder;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Using an anonymous class for placeholders causes a collision in moduleInstances because all instances share the same class type (e.g., Modules$1). Subsequent calls to get(name) for different names will overwrite the previous placeholder in the map, meaning only the last created placeholder will be present in the registry. This breaks lookups and iteration for multiple unique placeholders.


@Override
protected Double parseImpl(String str) {
try {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Double.parseDouble(str) will throw a NullPointerException if str is null. A null check should be added to ensure safe parsing during setting initialization or updates.

      return str == null ? null : Double.parseDouble(str);


@Override
protected Integer parseImpl(String str) {
try {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Integer.parseInt(str) will throw a NullPointerException if str is null. A null check should be added to ensure safe parsing.

      return str == null ? null : Integer.parseInt(str);

}

@SuppressWarnings("unchecked")
public Builder defaultValue(EntityType<?>... values) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The defaultValue builder method will throw a NullPointerException if the values varargs array is null. A null check should be added before iteration.

      if (values != null) for (EntityType<?> value : values) set.add(value);

Comment on lines +60 to +62
public Builder defaultValue(net.minecraft.world.level.block.Block... blocks) {
return this;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This builder method is empty and does not set the default value, which will result in an empty list regardless of the arguments passed. It should initialize this.defaultValue with the provided blocks.

Suggested change
public Builder defaultValue(net.minecraft.world.level.block.Block... blocks) {
return this;
}
public Builder defaultValue(net.minecraft.world.level.block.Block... blocks) {
this.defaultValue = new java.util.ArrayList<>(java.util.Arrays.asList(blocks));
return this;
}

- SimpleRegistry.add: key by identity hash instead of class simple name so
  multiple instances of the same class (e.g. Blocks.AIR vs Blocks.DIRT)
  don't overwrite each other.
- Modules.get(String): cache placeholders in a name-keyed map instead of
  putting them in moduleInstances by anonymous class type, which collapses
  every placeholder onto Modules$1 and overwrites prior entries.
@GhostTypes GhostTypes merged commit 3912bf6 into master May 2, 2026
1 check passed
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.

1 participant