Skip to content

Commit

Permalink
switch to single item component in laser recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
rlnt committed Oct 31, 2024
1 parent 55114b4 commit fa389f0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file.
## Unreleased

- switched to the official maven artifacts
- switched to strict single item stack component in laser recipes
- updated coffee ingredient recipe keys
- updated minimum Actually Additions version to 1.3.7

## [0.2.0] - 2024-10-24

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/almostreliable/kubeaa/KubePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.almostreliable.kubeaa.binding.EffectInstanceBinding;
import com.almostreliable.kubeaa.component.CrusherResultComponent;
import com.almostreliable.kubeaa.component.EffectInstanceComponent;
import com.almostreliable.kubeaa.component.SingleItemStackComponent;
import com.almostreliable.kubeaa.event.EmpowerEvent;
import com.almostreliable.kubeaa.recipe.*;
import com.almostreliable.kubeaa.schema.*;
Expand Down Expand Up @@ -39,6 +40,7 @@ public void registerBindings(BindingRegistry registry) {
public void registerRecipeComponents(RecipeComponentFactoryRegistry registry) {
registry.register(CrusherResultComponent.CRUSHING_RESULT);
registry.register(EffectInstanceComponent.EFFECT_INSTANCE);
registry.register(SingleItemStackComponent.STRICT_SINGLE_ITEM);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.almostreliable.kubeaa.component;

import com.mojang.serialization.Codec;
import dev.latvian.mods.kubejs.recipe.component.ItemStackComponent;
import net.minecraft.world.item.ItemStack;

public final class SingleItemStackComponent extends ItemStackComponent {

public static final SingleItemStackComponent STRICT_SINGLE_ITEM = new SingleItemStackComponent();

private SingleItemStackComponent() {
super("strict_single_item", ItemStack.STRICT_SINGLE_ITEM_CODEC);
}

@Override
public Codec<ItemStack> codec() {
return ItemStack.STRICT_SINGLE_ITEM_CODEC;
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.almostreliable.kubeaa.schema;

import com.almostreliable.kubeaa.component.SingleItemStackComponent;
import de.ellpeck.actuallyadditions.data.LaserRecipeGenerator;
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
import dev.latvian.mods.kubejs.recipe.RecipeKey;
import dev.latvian.mods.kubejs.recipe.component.ComponentRole;
import dev.latvian.mods.kubejs.recipe.component.IngredientComponent;
import dev.latvian.mods.kubejs.recipe.component.ItemStackComponent;
import dev.latvian.mods.kubejs.recipe.component.NumberComponent;
import dev.latvian.mods.kubejs.recipe.schema.RecipeSchema;
import net.minecraft.world.item.ItemStack;
Expand All @@ -16,7 +16,7 @@
*/
public interface LaserRecipeSchema {

RecipeKey<ItemStack> RESULT = ItemStackComponent.STRICT_ITEM_STACK
RecipeKey<ItemStack> RESULT = SingleItemStackComponent.STRICT_SINGLE_ITEM
.key("result", ComponentRole.OUTPUT)
.noFunctions();
RecipeKey<Ingredient> INGREDIENT = IngredientComponent.NON_EMPTY_INGREDIENT
Expand Down

0 comments on commit fa389f0

Please sign in to comment.