Skip to content

1.21.1 -> 26.1 Update#1093

Open
liopyu wants to merge 113 commits intoKubeJS-Mods:mainfrom
liopyu:2601
Open

1.21.1 -> 26.1 Update#1093
liopyu wants to merge 113 commits intoKubeJS-Mods:mainfrom
liopyu:2601

Conversation

@liopyu
Copy link
Copy Markdown

@liopyu liopyu commented Jan 27, 2026

KubeJS 26.1 Primer

1. Overview

This branch is a large-scale migration to NeoForge 26.1+.

Core migration themes:

  • Render/event API migration for the 26.1 client pipeline
  • Item/DataComponent migration onto ModifyDefaultComponentsEvent
  • Tool/material rework toward ToolMaterial + component-driven behavior
  • Transfer API migration to ResourceHandler
  • Recipe reload / encoding fixes for 26.1 registries, tags, and components
  • Tag system migration away from old TagManager hooks
  • Broad ResourceLocation -> Identifier source migration
  • Temporary compatibility guards where 26.1 work is still incomplete

2. Categorized Change Breakdown

A. Rendering & Client Pipeline

Nature

API migration, refactor, compatibility fixes

Key Changes

  • Client render/event migration to 26.1
    • Item tint registration moved to RegisterColorHandlersEvent.ItemTintSources
    • ItemTintFunctionWrapper now implements ItemTintSource
  • Render type handling changed
    • ItemBlockRenderTypes.setRenderLayer() is no longer used for generated blocks/fluids
    • Block and fluid render types are now written through "render_type" in generated model JSON
  • Fixed / updated:
    • KubeJSErrorScreen
    • Key mapping registration
    • Item/block/fluid tint registration rework

B. Tool System Migration

Nature

Major rework

Key Changes

  • Tool material logic is now centered on ToolMaterial plus item components such as:
    • DataComponents.TOOL
    • DataComponents.WEAPON
    • DataComponents.ENCHANTABLE
    • DataComponents.REPAIRABLE
  • Added / used:
    • MutableToolMaterial
    • ItemToolMaterials
    • ItemToolMaterialRegistryKubeEvent
    • KubeJSRegistries.ARMOR_MATERIAL
  • ItemModificationKubeEvent#setTier() now rebuilds tool-related components instead of relying on old-style direct tier mutation
  • Painting variant handling now reads from:
    • DataComponents.PAINTING_VARIANT
  • Armor material builder/registry support is present through:
    • KubeJSRegistries.ARMOR_MATERIAL
  • Legacy compatibility code still present:
  • MutableToolTier
  • toolTier fields on handheld builders
  • DiggerItemBuilder
  • the startup event ID string "toolTierRegistry"
  • an access transformer exposing TieredItem#tier

C. Item System & Data Components Migration

Major Changes

  • Item default component mutation now goes through:
    • ModifyDefaultComponentsEvent
  • Item mutations operate on:
    • DataComponentMap.Builder
  • Component removal semantics now use:
    • set(component, null)
    • rather than a dedicated remove call
  • Item and block modification lifecycles are now split:
    • Item changes are posted during ModifyDefaultComponentsEvent
    • Block changes still run later during post-init / load-complete flow
  • This branch includes fixes for startup crashes caused by:
    • invalid component mutation
    • mutating components too late
    • mutating bound/default components directly
  • RecordDefaults now uses:
    • DataComponentExactPredicate.EMPTY
  • Fluid ingredient handling no longer relies on the older DataComponentPredicate.EMPTY behavior

D. Transfer API & Fluid Migration

Changes

  • Fluid handlers moved to:
    • ResourceHandler<FluidResource>
  • Item inventory wrappers moved to:
    • ResourceHandler<ItemResource>
  • FluidUtil is now imported from:
    • net.neoforged.neoforge.transfer.fluid.FluidUtil
  • Added:
    • ResourceHandlerInventoryWrapper
  • FluidTankAttachment.Wrapped now implements:
    • ResourceHandler<FluidResource>

Additional Fluid/Ingredient Notes

  • DataComponentFluidIngredient is used for component-aware fluid matching
  • Empty FluidIngredient / SizedFluidIngredient inputs are explicitly treated as unsupported

E. Recipe System & Reload Pipeline

Key Fixes

  • Recipe JSON mutation now uses:
    • ModifyRecipeJsonsEvent
  • AfterRecipesLoadedKubeEvent now rebuilds recipe maps with:
    • RecipeMap.create()
  • Recipe reload now applies both:
    • postponed tags
    • pending new data components
    • before KubeJS recipe processing continues
  • Recipe event ops now derive conditional/registry encoding from real registry access
  • The server script manager is now bound to ReloadableServerResources

Structural Improvements

  • ConditionalOps is constructed from actual registry access
  • Access to ReloadableServerResources#newComponents is wired through mixins/interfaces
  • Tag-based ingredient encoding failures were fixed by applying postponed tags before recipe processing
  • Component availability during recipe parsing was fixed by applying pending components early
  • Custom ingredient emptiness checks were tightened so NeoForge custom ingredients do not crash KubeJS logic

API / Encoding Updates

  • SizedIngredient handling now uses:
    • SizedIngredient.NESTED_CODEC
  • Recipe ingredient lookup now prefers:
    • placementInfo().ingredients()
  • Crafting remainder access now uses:
    • getCraftingRemainder()
  • Ingredient item iteration now uses:
    • items() streams
  • Empty Ingredient / FluidIngredient inputs are no longer treated as valid

Smithing

  • Smithing handling is aligned to the newer split between:
    • minecraft:smithing_transform
    • minecraft:smithing_trim
  • Smithing-related schema/data support is present for both recipe types

F. Tag System Migration

Changes

  • Old TagManager-style mixin logic was replaced with RegistryAccess / HolderLookup / TagLoader based hooks
  • Tag access now uses:
    • lookupOrThrow(registry).get(tag)
  • Tag reload integration now works through:
    • TagLoader
    • Registry.PendingTags<?>
    • ReloadableServerResources#postponedTags
  • Registry tag binding now casts to:
    • MappedRegistry
    • because tag binding is no longer exposed from the generic registry interface
  • Loaded tags are cached back into KubeJS registries during the new tag load flow
  • TagReloadContextKJS is not used here; the active ServerScriptManager and registry are stored directly on the loader/mixin path instead

G. Entity, Messaging & Interaction Changes

Changes

  • Added Access Transformer support for:
    • Entity#setRot(float, float)
  • Player/entity messaging is now using:
    • sendSystemMessage()
    • sendOverlayMessage()
  • The pick-block path now reconstructs BlockHitResult manually using a fresh ray trace in IBlockStateExtensionMixin
  • Loot export logic uses:
    • LootTableLoadEvent
  • Item use completion hooks currently inject into:
    • ItemStack#finishUsingItem
  • Explosion#getAffectedPlayers is gone and no longer used
  • Animal#mobInteract replacement work for LivingEntity#eat() is not present here

H. GUI & Container Updates

Changes

  • Chest/container click handling migrated from:
    • ClickType
    • to ContainerInput
  • Respawn helpers were updated to the new:
    • ServerPlayer.RespawnConfig
    • setRespawnPosition(respawnConfig, boolean)
    • signature shape
  • Client selected-slot sync uses:
    • ClientboundSetHeldSlotPacket

I. Misc Infrastructure & Compatibility State

Confirmed Project / Build Changes

  • ResourceLocation -> Identifier
  • Project versioning is now on:
    • 2601.7.2
  • Run configs set:
    • terminal.ansi=true
  • Repository declarations were centralized under:
    • settings.gradle
    • using dependencyResolutionManagement
  • JEI-hosting repositories were added there as part of the repo centralization

Current Compatibility Guards / Temporary Disablement

  • validateAccessTransformers is currently forced to:
    • false
  • architectury, JEI, REI, and EMI compile dependencies are still commented out in build.gradle
  • Client web/image routes in KubeJSClientWeb.register() are still commented out

Rendering & Client

RegisterShadersEvent -> RegisterRenderPipelinesEvent
RegisterColorHandlersEvent.Item -> RegisterColorHandlersEvent.ItemTintSources
ItemBlockRenderTypes.setRenderLayer() -> render_type JSON in generated models
GuiGraphics.blit() -> GuiGraphics.blit(RenderPipeline / RenderPipelines, ...)

Entity / Messaging

displayClientMessage -> sendSystemMessage
displayClientMessage -> sendOverlayMessage
Pick-block hit context -> manual ray trace + reconstructed BlockHitResult
Loot export hook -> LootTableLoadEvent

Recipe / Ingredient

SizedIngredient.FLAT_CODEC -> SizedIngredient.NESTED_CODEC
Recipe ingredient access -> placementInfo().ingredients()
ItemStack crafting remainder helpers -> getCraftingRemainder()
Ingredient#getItems() -> items() stream
AfterRecipesLoaded rebuild -> RecipeMap.create()
Recipe JSON mutation hook -> ModifyRecipeJsonsEvent
(Ingredient and FluidIngredient are no longer treated as valid when empty)

Registry & Tags

TagManager-era hooks -> RegistryAccess / HolderLookup / TagLoader mixins
lookup(registry, tag) -> lookupOrThrow(registry).get(tag)
entry.registry().bindTags() -> ((MappedRegistry) registry).bindTags()
ResourceLocation -> Identifier
KubeResourceLocation -> KubeIdentifier

Tool / Components

ItemToolTiers -> ItemToolMaterials
ItemToolTierRegistryKubeEvent -> ItemToolMaterialRegistryKubeEvent
Tier mutation -> ToolMaterial + DataComponents updates
Item mutation timing -> ModifyDefaultComponentsEvent
Direct component mutation -> DataComponentMap.Builder
remove(component) -> set(component, null)
Painting variant data -> DataComponents.PAINTING_VARIANT

- disabled some dependencies in build.gradle until they update
- updated 37 or so classes fixing basic syntax errors
- fixed Ingredient access transformers
- Re enabled lats web dependencies
@liopyu liopyu changed the title Updated gradle settings to 26.1 Neoforge/Minecraft compilation 1.21.1 -> 26.1 Update Jan 28, 2026
- More base syntax fixes
@liopyu liopyu marked this pull request as draft January 28, 2026 18:19
@liopyu liopyu changed the base branch from main to 2601 January 28, 2026 18:20
@liopyu liopyu changed the base branch from 2601 to main January 28, 2026 18:21
liopyu added 22 commits January 29, 2026 13:44
…omponent based** tool system

Renames:

* ItemToolTiers → ItemToolMaterials
* ItemToolTierRegistryKubeEvent → ItemToolMaterialRegistryKubeEvent
* KubeResourceLocation → KubeIdentifier

New:

* MutableToolMaterial
* ItemToolMaterials
* KubeJSRegistries
* Tool behavior is now defined via `ToolMaterial` and item components
* Painting item names now resolve via `DataComponents.PAINTING_VARIANT` instead of NBT
* Internal getOrCreate() method on BuilderBase
* BuilderTypeRegistry.of is now more allowing of Registry ResourceKeys to allow our new Server registry key of KubeJSRegistries.ARMOR_MATERIAL

Removals:

* Removed tier and all Tier based APIs
* Removed TieredItem handling
* Removed DiggerItemKJS
* Removed DiggerItemMixin
* Removed NBT-based tool and painting variant parsing
- More various internal fixes
- Mass replacement of Ingredient.EMPTY with Ingredient.of()
- Added public transformer for ServerPlayer#server
- A lot of Optional<>/Holder adaptions
…lItemModelPropertyEvent

- Added KubeJSConditionalCallbackProperty as standin for ClampedItemPropertyFunction which no longer exists
- Fixed explode method call to the now 'void' return
- No more serverPlayer.hasPermission() moved to Commands.LEVEL_GAMEMASTERS.check(serverPlayer.permissions())
- Fixed RenderType assignment in KubeJSClientEventHandler
- ItemTintFunctionWrapper now implements ItemTintSource
Valid model JSON format for adding 2 layers:
```json
{
  "model": {
    "tints": [
      { "type": "kubejs:tint", "index": 0 },
      { "type": "kubejs:tint", "index": 1 }
    ]
  }
}
```
Note: "kubejs:tint" is our registered ItemTintSources
- RegisterColorHandlersEvent.Item -> RegisterColorHandlersEvent.ItemTintSources
- ItemTintFunctionWrapper now passes a CODEC instead of unpackaged values
- Fixed "kubedex" KeyMapping registration
- RegisterShadersEvent -> RegisterRenderPipelinesEvent
- Added Category registry in KubeJSClientEventHandler
- Moved DebugScreen event handler to mixin target (DebugText was removed from overlay event)
- Fixed RenderLevelStageEvent highlight render events
- Fixed KubeJSErrorScreen
- Fixed particle registry type
- Began porting HighlightRenderer to the 1.26.1 render pipeline (post-processing + framegraph)
  - Rendering logic not yet tested
  - Updated highlight.json to the new post-processing format
- Preserved NotificationToast#drawRectangle(GuiGraphics graphics, int x0, int y0, int x1, int y1, int r, int g, int b) with custom fill command.
- Fixed various Block events
- Fixed InventoryAttachment related classes
- Fixed GameRulesMixin & GameRulesKJS preserving Key
- Fixed FluidIngredientKJS and added SizedFluidIngredient override
- Fixed 15 other classes
… equivalents

- Fixed component function classes
- Fixed some base mixin compile erroring
- Fixed KubeJSCommands to use new way of getting tags through registry access
- Removed getAffectedPlayers from block explosion since Explosion no longer provides it
- Updated tag access to use lookupOrThrow(registry).get(tag)
- Reworked tag reload hooks to conform with new PendingTags & TagLoader implementations
- Preserved tag loading context through new `TagReloadContextKJS` thread
…omponentMap model

- Migrated item modification logic to use NeoForge’s ModifyDefaultComponentsEvent
- Reworked item component mutation to operate on DataComponentMap.Builder instead of mutating bound components directly
- Preserved existing KubeJS scripting APIs (override, nullable removal semantics, tier helpers, burn time overrides, etc)
- Revised component removal semantics (set(type, null) instead of a dedicated remove call)
- Fixed component related startup crashes caused by invalid or late-bound component mutations
- Ensured item modifications occur at the correct lifecycle stage (before components are bound)
- Updated item mixins to match current method signatures (use, appendHoverText, releaseUsing, etc.)
- Cleaned up and stabilized component, tool, and attribute handling under the new data-driven item system
- Split startup modification dispatch into separate item and block paths
- Routed item changes exclusively through `ModifyDefaultComponentsEvent` while keeping block changes on FMLLoadCompleteEvent
…(AbstractContainerMenu.clicked signature change)

- Updated selected hotbar sync to use the new carried-slot update packet replacing ClientboundSetCarriedItemPacket
- Updated spawn-setting helper to use the new setRespawnPosition(RespawnConfig, boolean) signature
- Refactored FluidWrapper to 26.1 FluidIngredient API (no empty()/tag()/single(), new of(HolderSet) usage)
- Removed reliance on DataComponentPredicate.EMPTY; now treats component predicates as always-valid and applies DataComponentFluidIngredient directly when present
- ImageGenerator and its registry registration
- KubeJSEMIPlugin / KubeJSJEIPlugin / KubeJSREIPlugin and related REI events until JEI/EMI/REI update

## Transfer API Migration
- Replaced `IFluidHandler` with `ResourceHandler<FluidResource>` and updated `FluidUtil` usages
- Replaced `IItemHandler`/`IItemHandlerModifiable` mixin with `ResourceHandler<ItemResource>` mixin

## Recipe
- Replaced `Recipe#getResultItem` with direct `result.create()` on shaped/shapeless recipes
- Replaced `Recipe#ingredients()` with direct field access on shaped/shapeless recipes
- Replaced `ItemStack#hasCraftingRemainingItem`/`getCraftingRemainingItem` with `getCraftingRemainder()`

## Misc API Changes
- Replaced `ComponentSerialization.FLAT_CODEC` with `CODEC`
- Replaced `Ingredient#getItems()` with `items()` stream
- Replaced `ChargedProjectiles.of` and `BundleContents` constructors with new item transfer equivalents
- Fixed `ResourceKey.create()` to pass required registry and location arguments
- Replaced `ItemStack.STRICT_CODEC` with `ItemStack.CODEC.flatXmap(ItemStack::validateStrict, ItemStack::validateStrict)` in `ShapedKubeJSRecipe` and `ItemStackComponent`
- Replaced `SizedIngredient.FLAT_CODEC` with `NESTED_CODEC` and removed `kjs$toFlatJson` method from `SizedIngredientKJS`

## Registry Tag Binding
- Replaced `entry.registry().bindTags()` with cast to `MappedRegistry` since `bindTags` was removed from the `Registry` interface but still exists in `MappedRegistry`

## Render & GUI
- Updated `GuiGraphics#blit` calls to new signature requiring `RenderPipeline` and texture dimensions

## Item API
- Updated `SmithingTemplateItemBuilder#createObject` to match new `SmithingTemplateItem` constructor (removed title `Component` param, added `Item.Properties` param)
- Updated `MinecraftClientKJS` texture atlas methods to use `getAtlasManager().getAtlasOrThrow().getSprite()`

## Misc
- Commented out EMIAddInformationKubeEvent/JEIRemoveRecipesKubeEvent/REIRemoveRecipeKubeEvent until they update
- We are now past compile errors at this point. We do not get past mixin target errors on runClient at this point
- Added Access Transformer for `Entity#setRot()`

## Food Eaten Event
- Replaced removed `LivingEntity#eat()` usage
- Injected into `Animal#mobInteract
- Triggers `kjs$foodEaten` when animals are fed
- Hooked into `ItemStack#finishUsingItem to track Player eating when food items are consumed

## Mixin Fixes
- Fixed classes that were turned into interfaces including: NumericTagMixin, CollectionTagMixin, ClickEventMixin
- Fixed some targeting/shadow issues
- Moved LootDataTypeMixin logic to LootTableLoadEvent in `KubeJSServerEventHandler`

## Level
- moved `getTime` shadow accessor to LevelAccessor

## Other
- Various other mixin target/shadow target fixes
- Fixed Shaped/Shapeless custom recipe serializers
- Updated AfterRecipesLoadedKubeEvent to use RecipeMap.create() instead of HashMap
- Added makeConditionalOps() accessor via `ContextAwareReloadListenerKJS`
- Added ExtraCodecsMixin to override stack size limit

## Render
- Various compile fixes to HighlightRenderer/KubeJSClientEventHandler

## Entity
- `displayClientMessage` -> `sendSystemMessage`/`sendOverlayMessage`
- FallingBlockEntityMixin: fallSpeed is no longer inside local (no longer exists in tick) so we calculate it ourselves to retain it in the `BlockStoppedFallingKubeEvent`
- Maintained block hit result in `BlockPickedKubeEvent` by doing our own `BlockHitResult`

## Block
- Moved setNameKey() override from BlockMixin to BlockBehaviorMixin

## Items
- getTags() shadow removed from ItemStackKJS — replaced with typeHolder().tags()
- DataComponentsMixin: replaced lambda$static$1 @ModifyConstant with @ModifyArg moved to ExtraCodecsMixin targeting intRange() call with original == 99 guard
- ItemStackHandlerMixin: removed @ModifyConstant for intValue = 99 — constant no longer present in ItemStacksResourceHandler/ItemAccessItemHandler, replaced with @Inject at RETURN of `getCapacity`
- ItemStackMixin#kjs$maxSlotSize moved to `ExtraCodecsMixin`
- Made dummy empty ingredient to use everywhere in SlotFilter class (subject to move from SlotFilter.EMPTY_INGREDIENT to one of the helper classes)

## Tags
- Fixed StringTagMixin

## Level
- Moved getEntity(uuid) shadow from ServerLevelMixin to LevelMixin
- Fixed WorldLoaderMixin inject targeting

## Misc
- Commented out betteradvancedtooltips integration for now until updated (TextIcons/KubeJSErrorScreen/KubeJSCommands)
- Updated rei/emi/jei/arch dep to 1.21.11
- Commented out JEI/REI/EMI/Architectury integration classes until they update
- Added ModMaven maven to settings.gradle
- Added terminal.ansi systemProperty to configureEach runs task in build.gradle
- Commented out shader registries for now

## HighlightRenderer
- Commented out shader registries and loadPostChains implementation in kjs$loadPostChains as well as kjs$resizePostChains implementation
- Re added sentinel check for empty fluid ingredient check
- Fixed KubeJSPlugins#loadMod method not detecting our plugins correctly
- Fixed BuiltinKubeJSClientPlugin crash

## Items
- Moved EMPTY_INGREDIENT to UtilsJS (Dummy empty Ingredient can no longer be empty)
- Changed all instances of `Ingredient.of()` to new UtilsJS.EMPTY_INGREDIENT
- Fixed /kjs hand command
- Fixed ItemStackKey/ItemStackSet/ItemStackComponent

## Schemas
- Updated smithing_transform.json recipe schema

## Builders
- Fixed block/item registry builders to set missing id through properties.setId()
- Fixed KubeJSErrorScreen not showing error text
- Fixed EditorExt crash when clicking error

## Recipes
- Fixed RecipesKubeEvent optional crash when recipe stages is not implemented yet
- Fixed tag-based ingredients failing to encode by applying postponed tags before recipe processing
- Fixed item components not being available during recipe parsing by applying pending data components early
- Fixed recipe encoding using wrong registry lookup by building `ConditionalOps` from actual registry access instead of patched lookup provider
- Fixed crash with NeoForge custom ingredients (`CompoundIngredient`/ `DifferenceIngredient`) by guarding against `getValues()` calls on custom ingredient types in `IngredientComponent.isEmpty()`
- Created accessor for `getContext()` from `ContextAwareReloadListener`
- Created accessor for `newComponents` from `ReloadableServerResources`
- Removed `ItemBlockRenderTypes.setRenderLayer()` calls from `KubeJSClientEventHandler.setupClient0()` — the class was removed entirely
- Render types for fluid blocks, fluids, and custom blocks are now emitted as `"render_type"` in generated block model JSON via `ModelGenerator.custom()`

## Text Component Updates
- Replaced `SelectorPattern` usage in `TextWrapper` with `CompilableString<EntitySelector>` via `EntitySelector.COMPILABLE_CODEC`
- Updated `ScoreContents` construction to use `Either<CompilableString<EntitySelector>, String>`
- Updated `SelectorContents` construction to use `CompilableString<EntitySelector>`

## Lighting API Changes
- Removed `getShade(Direction, boolean)` override from `FakeClientWorld` — method no longer exists on `BlockAndTintGetter`
- `FakeClientWorld.cardinalLighting()` now returns `CardinalLighting.DEFAULT` instead of `null`

## Misc
- Updated to latest available Minecraft/Neoforge (26.1 snap 10)
liopyu and others added 6 commits March 23, 2026 14:01
* Added tintFunction() for callback based fluid tinting with full world context
* Added `bucketColor()` for custom bucket item tint separate from in-world fluid
* Separated textureTint from runtime tint in FluidTypeBuilder
* Added item definition generation for NeoForge 26.1 new model system
* Generated bucket item definitions with neoforge:fluid_contents_tint for fluid overlay layer
* Bucket asset generation is skipped when scripters customize parentModel, textures, or modelGenerator
* Added support for custom fluid textures via block/<id>_still and block/<id>_flow overrides
* Fixed FluidBlockBuilder using wrong texture path
* Fixed flowing texture check using wrong variable
* Registered both source and flowing fluids in RegisterFluidModelsEvent
liopyu and others added 7 commits April 8, 2026 12:47
@MaxNeedsSnacks MaxNeedsSnacks self-requested a review April 20, 2026 17:39
liopyu added 8 commits April 21, 2026 15:06
…correct format for "open_uri_format" in `DevProperties` dev.json
…ecipes easier

- Fixed recipe schema factory key detection always defaulting to KubeRecipe instead of ShapedKubeRecipe/ShapelessKubeRecipe when specified in the json
- neo version bump
…ell as better erroring

- Added Fluids binding
- Neoforge version bump
- Fixed small recipe manager bug
Copy link
Copy Markdown
Member

@MaxNeedsSnacks MaxNeedsSnacks left a comment

Choose a reason for hiding this comment

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

The last set of changes (namely the error screen and custom menu changes) are out of scope for a port like this, please revert them and make another PR just for them

Comment thread src/main/java/dev/latvian/mods/kubejs/core/CustomIngredientKJS.java
Comment on lines 35 to 71
@Override
default boolean matches(RecipeMatchContext cx, FluidIngredient in, boolean exact) {
if (in == FluidIngredient.empty()) {
return false;
}

try {
for (var stack : ((FluidIngredient) this).getStacks()) {
if (in.test(stack)) {
var fluids = ((FluidIngredient) this).fluids();
if (fluids.isEmpty()) {
return false;
}
int probeAmount = FluidType.BUCKET_VOLUME;
for (var holder : fluids) {
if (in.test(new FluidStack(holder, probeAmount))) {
return true;
}
}
} catch (Exception ex) {
throw new KubeRuntimeException("Failed to test fluid ingredient " + in, ex);
}
return false;
}

@Override
default boolean matches(RecipeMatchContext cx, SizedFluidIngredient in, boolean exact) {
try {
var fluids = ((FluidIngredient) this).fluids();
if (fluids.isEmpty()) {
return false;
}
int probeAmount = in.amount();
for (var holder : fluids) {
if (in.test(new FluidStack(holder, probeAmount))) {
return true;
}
}
} catch (Exception ex) {
throw new KubeRuntimeException("Failed to test sized fluid ingredient " + in, ex);
}
return false;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not that well-versed with ReplacementMatches anymore (we really need documentation, but resolving these just to test if they overlap at all feels... wrong)

We might want to look into reworking how replacement works after this PR

Comment thread src/main/java/dev/latvian/mods/kubejs/core/RecipeHolderKJS.java
Comment thread src/main/java/dev/latvian/mods/kubejs/core/RecipeHolderKJS.java
Comment on lines +145 to +148
default boolean kjs$hasPermission(int i) {
var permission = new Permission.HasCommandLevel(PermissionLevel.byId(i));
return kjs$self().permissions().hasPermission(permission);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TODO (post-port): more granular permission support?

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.

3 participants