Refactors, lang builder, behaviors fix, requirements, recipes, CountableIngredient, jei textures
This commit is contained in:
@@ -14,10 +14,10 @@ parchment_version = 2024.11.17
|
|||||||
mod_id=mechanicals
|
mod_id=mechanicals
|
||||||
mod_name=Mechanicals Lib
|
mod_name=Mechanicals Lib
|
||||||
mod_license=LGPL3
|
mod_license=LGPL3
|
||||||
mod_version=0.2.11
|
mod_version=0.4.26
|
||||||
mod_group_id=com.oierbravo
|
mod_group_id=com.oierbravo
|
||||||
mod_author=oierbravo
|
mod_author=oierbravo
|
||||||
mod_description=Utility Library for Create Addons.
|
mod_description=Utility Library for modding, mainly but not limited Create Addons.
|
||||||
|
|
||||||
# dependency versions
|
# dependency versions
|
||||||
create_version = 6.0.4-53
|
create_version = 6.0.4-53
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.oierbravo.mechanicals;
|
|||||||
|
|
||||||
import com.mojang.logging.LogUtils;
|
import com.mojang.logging.LogUtils;
|
||||||
import com.oierbravo.mechanicals.register.MechanicalCreativeModeTabs;
|
import com.oierbravo.mechanicals.register.MechanicalCreativeModeTabs;
|
||||||
|
import com.oierbravo.mechanicals.register.MechanicalIngredientTypes;
|
||||||
import com.oierbravo.mechanicals.register.MechanicalRecipeRequirementTypes;
|
import com.oierbravo.mechanicals.register.MechanicalRecipeRequirementTypes;
|
||||||
import com.oierbravo.mechanicals.register.MechanicalRegistries;
|
import com.oierbravo.mechanicals.register.MechanicalRegistries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -23,7 +24,8 @@ public class Mechanicals {
|
|||||||
MechanicalCreativeModeTabs.register(modEventBus);
|
MechanicalCreativeModeTabs.register(modEventBus);
|
||||||
|
|
||||||
modEventBus.addListener(this::newRegistries);
|
modEventBus.addListener(this::newRegistries);
|
||||||
MechanicalRecipeRequirementTypes.init(modEventBus);
|
MechanicalRecipeRequirementTypes.register(modEventBus);
|
||||||
|
MechanicalIngredientTypes.register(modEventBus);
|
||||||
modEventBus.addListener(this::doClientStuff);
|
modEventBus.addListener(this::doClientStuff);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.oierbravo.mechanicals.compat.jei;
|
||||||
|
|
||||||
|
import com.oierbravo.mechanicals.foundation.recipe.IRecipeWithRequirements;
|
||||||
|
import com.oierbravo.mechanicals.utility.LibLang;
|
||||||
|
import net.createmod.catnip.data.Pair;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Font;
|
||||||
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RecipeRequirementRenderer {
|
||||||
|
public static void drawRequirements(IRecipeWithRequirements recipe, GuiGraphics guiGraphics, int x, int y) {
|
||||||
|
Minecraft minecraft = Minecraft.getInstance();
|
||||||
|
Font fontRenderer = minecraft.font;
|
||||||
|
int index = 0;
|
||||||
|
int distance = 9;
|
||||||
|
int offsetX = 5;
|
||||||
|
int offsetY = 14;
|
||||||
|
|
||||||
|
guiGraphics.drawString(fontRenderer, LibLang.translate("ui.recipe.requirements.title").component().withStyle(), x, y, 0xFFFFFFFF, true);
|
||||||
|
|
||||||
|
List<Pair<Component, Component>> jeiRequirementTooltips = recipe.getJeiRequirementsTooltips();
|
||||||
|
|
||||||
|
if(jeiRequirementTooltips.isEmpty()){
|
||||||
|
guiGraphics.drawString(fontRenderer, LibLang.translate("ui.recipe_requirement.none.tooltip").component().withStyle(),x + offsetX, y + offsetY, 0xFF808080, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Pair<Component, Component> pair : jeiRequirementTooltips) {
|
||||||
|
int oneLinerLenght = pair.getSecond().getString().length() + pair.getSecond().getString().length();
|
||||||
|
if (oneLinerLenght < 19) {
|
||||||
|
guiGraphics.drawString(fontRenderer, pair.getFirst().plainCopy().append(" ").append(pair.getSecond()), x + offsetX, y + offsetY + distance * index, 0xFF808080, false);
|
||||||
|
index++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
guiGraphics.drawString(fontRenderer, pair.getFirst(), x + offsetX, y + offsetY + distance * index, 0xFF808080, false);
|
||||||
|
index++;
|
||||||
|
guiGraphics.drawString(fontRenderer, pair.getSecond(), x + offsetX * 2, y + offsetY + distance * index, 0xFF808080, false);
|
||||||
|
index++;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.oierbravo.mechanicals.compat.kubejs.bindings.RecipeRequirementBuilder
|
|||||||
import dev.latvian.mods.kubejs.plugin.KubeJSPlugin;
|
import dev.latvian.mods.kubejs.plugin.KubeJSPlugin;
|
||||||
import dev.latvian.mods.kubejs.recipe.schema.RecipeComponentFactoryRegistry;
|
import dev.latvian.mods.kubejs.recipe.schema.RecipeComponentFactoryRegistry;
|
||||||
import dev.latvian.mods.kubejs.script.BindingRegistry;
|
import dev.latvian.mods.kubejs.script.BindingRegistry;
|
||||||
|
import net.neoforged.fml.ModList;
|
||||||
|
|
||||||
public class MechanicalsJsPlugin implements KubeJSPlugin {
|
public class MechanicalsJsPlugin implements KubeJSPlugin {
|
||||||
|
|
||||||
@@ -17,12 +18,14 @@ public class MechanicalsJsPlugin implements KubeJSPlugin {
|
|||||||
registry.register(RecipeRequirementsComponent.RECIPE_REQUIREMENT);
|
registry.register(RecipeRequirementsComponent.RECIPE_REQUIREMENT);
|
||||||
registry.register(ResourceLocationComponent.RESOURCE_LOCATION);
|
registry.register(ResourceLocationComponent.RESOURCE_LOCATION);
|
||||||
registry.register(CreateFluidIngredientComponent.FLUID_INGREDIENT);
|
registry.register(CreateFluidIngredientComponent.FLUID_INGREDIENT);
|
||||||
|
registry.register(CountableIngredientComponent.COUNTABLE_INGREDIENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerBindings(BindingRegistry registry) {
|
public void registerBindings(BindingRegistry registry) {
|
||||||
if (registry.type().isServer()) {
|
if (registry.type().isServer()) {
|
||||||
registry.add("Output", ProcessingOutputBuilder.class);
|
if(ModList.get().isLoaded("create"))
|
||||||
|
registry.add("Output", ProcessingOutputBuilder.class);
|
||||||
registry.add("BlockPredicate", BlockPredicateBuilder.class);
|
registry.add("BlockPredicate", BlockPredicateBuilder.class);
|
||||||
registry.add("RecipeRequirement", RecipeRequirementBuilder.class);
|
registry.add("RecipeRequirement", RecipeRequirementBuilder.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.oierbravo.mechanicals.compat.kubejs.components;
|
||||||
|
|
||||||
|
import com.mojang.serialization.Codec;
|
||||||
|
import com.oierbravo.mechanicals.foundation.ingredient.CountableIngredient;
|
||||||
|
import dev.latvian.mods.kubejs.recipe.KubeRecipe;
|
||||||
|
import dev.latvian.mods.kubejs.recipe.component.RecipeComponent;
|
||||||
|
import dev.latvian.mods.rhino.Context;
|
||||||
|
import dev.latvian.mods.rhino.type.TypeInfo;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
|
||||||
|
public record CountableIngredientComponent() implements RecipeComponent<CountableIngredient> {
|
||||||
|
public static final RecipeComponent<CountableIngredient> COUNTABLE_INGREDIENT = new CountableIngredientComponent();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Codec<CountableIngredient> codec() {
|
||||||
|
return CountableIngredient.CODEC;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TypeInfo typeInfo() {
|
||||||
|
return TypeInfo.of(CountableIngredient.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CountableIngredient wrap(Context cx, KubeRecipe recipe, Object from) {
|
||||||
|
if(from instanceof Ingredient ingredient)
|
||||||
|
return CountableIngredient.of(ingredient,1);
|
||||||
|
if(from instanceof ItemStack itemStack)
|
||||||
|
return CountableIngredient.of(itemStack);
|
||||||
|
return RecipeComponent.super.wrap(cx, recipe, from);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -97,9 +97,12 @@ public class CycleBehavior extends BlockEntityBehaviour {
|
|||||||
apply();
|
apply();
|
||||||
if (!level.isClientSide)
|
if (!level.isClientSide)
|
||||||
blockEntity.sendData();
|
blockEntity.sendData();
|
||||||
|
else
|
||||||
|
specifics.playActuateSound();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!level.isClientSide && runningTicks > cycleTime) {
|
if (!level.isClientSide && runningTicks >= cycleTime) {
|
||||||
specifics.onCycleCompleted();
|
specifics.onCycleCompleted();
|
||||||
currentCycle++;
|
currentCycle++;
|
||||||
if(currentCycle == numCycles){
|
if(currentCycle == numCycles){
|
||||||
@@ -116,7 +119,7 @@ public class CycleBehavior extends BlockEntityBehaviour {
|
|||||||
runningTicks += getRunningTickSpeed();
|
runningTicks += getRunningTickSpeed();
|
||||||
|
|
||||||
if (level.isClientSide){
|
if (level.isClientSide){
|
||||||
specifics.playSound();
|
specifics.playRunningSound();
|
||||||
specifics.showParticles();
|
specifics.showParticles();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +183,8 @@ public class CycleBehavior extends BlockEntityBehaviour {
|
|||||||
default void onCycleCompleted(){};
|
default void onCycleCompleted(){};
|
||||||
default void onOperationCompletd(){};
|
default void onOperationCompletd(){};
|
||||||
|
|
||||||
default void playSound(){};
|
default void playActuateSound(){};
|
||||||
|
default void playRunningSound(){};
|
||||||
default void showParticles(){};
|
default void showParticles(){};
|
||||||
default void playCompletionSound(){};
|
default void playCompletionSound(){};
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class DynamicCycleBehavior extends BlockEntityBehaviour {
|
|||||||
blockEntity.sendData();
|
blockEntity.sendData();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!level.isClientSide && runningTicks > cycleTime) {
|
if (!level.isClientSide && runningTicks >= cycleTime) {
|
||||||
finished = true;
|
finished = true;
|
||||||
running = false;
|
running = false;
|
||||||
specifics.onOperationCompleted();
|
specifics.onOperationCompleted();
|
||||||
@@ -98,7 +98,7 @@ public class DynamicCycleBehavior extends BlockEntityBehaviour {
|
|||||||
prevRunningTicks = runningTicks;
|
prevRunningTicks = runningTicks;
|
||||||
runningTicks += getRunningTickSpeed();
|
runningTicks += getRunningTickSpeed();
|
||||||
if (level.isClientSide){
|
if (level.isClientSide){
|
||||||
specifics.playSound();
|
specifics.playRunningSound();
|
||||||
specifics.showParticles();
|
specifics.showParticles();
|
||||||
}
|
}
|
||||||
if (prevRunningTicks < cycleTime && runningTicks >= cycleTime) {
|
if (prevRunningTicks < cycleTime && runningTicks >= cycleTime) {
|
||||||
@@ -172,7 +172,7 @@ public class DynamicCycleBehavior extends BlockEntityBehaviour {
|
|||||||
public interface DynamicCycleBehaviorSpecifics {
|
public interface DynamicCycleBehaviorSpecifics {
|
||||||
default void onOperationCompleted(){};
|
default void onOperationCompleted(){};
|
||||||
|
|
||||||
default void playSound(){};
|
default void playRunningSound(){};
|
||||||
default void showParticles(){};
|
default void showParticles(){};
|
||||||
default void playCompletionSound(){};
|
default void playCompletionSound(){};
|
||||||
float getKineticSpeed();
|
float getKineticSpeed();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class RecipeRequirementsBehaviour<R extends IRecipeWithRequirements> exte
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!specifics.hasEnoughOutputSpace()){
|
if(!specifics.hasEnoughOutputSpace(pRecipe)){
|
||||||
missingRequirements.add("output");
|
missingRequirements.add("output");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ public class RecipeRequirementsBehaviour<R extends IRecipeWithRequirements> exte
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface RecipeRequirementsSpecifics<R extends IRecipeWithRequirements> {
|
public interface RecipeRequirementsSpecifics<R extends IRecipeWithRequirements> {
|
||||||
boolean hasEnoughOutputSpace();
|
boolean hasEnoughOutputSpace(R recipe);
|
||||||
boolean matchesIngredients(R recipe);
|
boolean matchesIngredients(R recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.oierbravo.mechanicals.foundation.data;
|
package com.oierbravo.mechanicals.foundation.data;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.kinetics.crusher.CrushingRecipe;
|
||||||
|
import com.simibubi.create.content.kinetics.deployer.ItemApplicationRecipe;
|
||||||
|
import com.simibubi.create.content.kinetics.deployer.ManualApplicationRecipe;
|
||||||
import com.simibubi.create.content.kinetics.millstone.MillingRecipe;
|
import com.simibubi.create.content.kinetics.millstone.MillingRecipe;
|
||||||
import com.simibubi.create.content.kinetics.mixer.MixingRecipe;
|
import com.simibubi.create.content.kinetics.mixer.MixingRecipe;
|
||||||
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder;
|
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder;
|
||||||
@@ -18,12 +21,17 @@ public abstract class AbstractCreateRecipeGen extends RecipeProvider {
|
|||||||
super(output, registries);
|
super(output, registries);
|
||||||
this.resourceLocationSupplier = resourceLocationSupplier;
|
this.resourceLocationSupplier = resourceLocationSupplier;
|
||||||
}
|
}
|
||||||
|
protected ProcessingRecipeBuilder<CrushingRecipe> createCrushing(String name){
|
||||||
|
return new ProcessingRecipeBuilder<>(CrushingRecipe::new, resourceLocationSupplier.get().withPath(name));
|
||||||
|
}
|
||||||
protected ProcessingRecipeBuilder<MillingRecipe> createMilling(String name){
|
protected ProcessingRecipeBuilder<MillingRecipe> createMilling(String name){
|
||||||
return new ProcessingRecipeBuilder<>(MillingRecipe::new, resourceLocationSupplier.get().withPath(name));
|
return new ProcessingRecipeBuilder<>(MillingRecipe::new, resourceLocationSupplier.get().withPath(name));
|
||||||
}
|
}
|
||||||
protected ProcessingRecipeBuilder<MixingRecipe> createMixing(String name){
|
protected ProcessingRecipeBuilder<MixingRecipe> createMixing(String name){
|
||||||
return new ProcessingRecipeBuilder<>(MixingRecipe::new, resourceLocationSupplier.get().withPath(name));
|
return new ProcessingRecipeBuilder<>(MixingRecipe::new, resourceLocationSupplier.get().withPath(name));
|
||||||
}
|
}
|
||||||
|
protected ProcessingRecipeBuilder<ItemApplicationRecipe> createItemApplication(String name){
|
||||||
|
return new ProcessingRecipeBuilder<>(ManualApplicationRecipe::new, resourceLocationSupplier.get().withPath(name));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public abstract class AbstractMechanicalRecipeGenerator<MRB extends AbstractMech
|
|||||||
|
|
||||||
|
|
||||||
protected MRB create(String id){
|
protected MRB create(String id){
|
||||||
return builderSupplier.get().create(ResourceLocation.fromNamespaceAndPath(namespace, recipeTypeId + "/" + id));
|
return builderSupplier.get().create().withId(ResourceLocation.fromNamespaceAndPath(namespace, recipeTypeId + "/" + id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ import net.neoforged.api.distmarker.Dist;
|
|||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
public enum MechanicalGUITextures implements ScreenElement {
|
public enum MechanicalGUITextures implements ScreenElement {
|
||||||
JEI_SHORT_ARROW("jei/widgets", 20, 9);
|
JEI_SHORT_ARROW("jei/widgets", 20, 9),
|
||||||
|
JEI_DOWN_RIGHT_ARROW("jei/widgets",0 , 9,17,12);
|
||||||
|
|
||||||
public static final int FONT_COLOR = 5726074;
|
public static final int FONT_COLOR = 5726074;
|
||||||
public final ResourceLocation location;
|
public final ResourceLocation location;
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
package com.oierbravo.mechanicals.foundation.ingredient;
|
||||||
|
|
||||||
|
import com.mojang.serialization.Codec;
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import com.oierbravo.mechanicals.register.MechanicalIngredientTypes;
|
||||||
|
import net.minecraft.network.RegistryFriendlyByteBuf;
|
||||||
|
import net.minecraft.network.codec.ByteBufCodecs;
|
||||||
|
import net.minecraft.network.codec.StreamCodec;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.neoforged.neoforge.common.crafting.ICustomIngredient;
|
||||||
|
import net.neoforged.neoforge.common.crafting.IngredientType;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/*from SewingKit Mod
|
||||||
|
|
||||||
|
Copyright (c) 2024, David Quintana <gigaherz@gmail.com>
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the author nor the
|
||||||
|
names of the contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||||
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
public record CountableIngredient(Ingredient ingredient, int count) implements Predicate<ItemStack>/*, ICustomIngredient*/ {
|
||||||
|
public static final CountableIngredient EMPTY = new CountableIngredient(Ingredient.EMPTY,0);
|
||||||
|
|
||||||
|
|
||||||
|
public static final Codec<CountableIngredient> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
||||||
|
Ingredient.CODEC.fieldOf("ingredient").forGetter(CountableIngredient::ingredient),
|
||||||
|
Codec.INT.fieldOf("count").forGetter(CountableIngredient::count)
|
||||||
|
).apply(instance, CountableIngredient::new));
|
||||||
|
/*public static Codec<CountableIngredient> CODEC = RecordCodecBuilder
|
||||||
|
.mapCodec((builder)
|
||||||
|
-> builder
|
||||||
|
.group(
|
||||||
|
Ingredient.CODEC.fieldOf("ingredient").forGetter(CountableIngredient::ingredient),
|
||||||
|
Codec.INT.fieldOf("count").forGetter(CountableIngredient::count))
|
||||||
|
.apply(builder, CountableIngredient::new));
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static final StreamCodec<RegistryFriendlyByteBuf, CountableIngredient> STREAM_CODEC = StreamCodec.composite(
|
||||||
|
Ingredient.CONTENTS_STREAM_CODEC, CountableIngredient::ingredient,
|
||||||
|
ByteBufCodecs.INT, CountableIngredient::count,
|
||||||
|
CountableIngredient::new
|
||||||
|
);
|
||||||
|
|
||||||
|
public static CountableIngredient of(Ingredient ingredient, int count)
|
||||||
|
{
|
||||||
|
return new CountableIngredient(ingredient, count);
|
||||||
|
}
|
||||||
|
public static CountableIngredient of(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return new CountableIngredient(Ingredient.of(itemStack), itemStack.getCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean test(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return ingredient.test(itemStack) && itemStack.getCount() >= count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack asItemStack(){
|
||||||
|
return new ItemStack(Arrays.stream(ingredient.getItems()).findFirst().get().getItem(), count);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*@Override
|
||||||
|
public Stream<ItemStack> getItems() {
|
||||||
|
return Arrays.stream(ingredient.getItems());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSimple() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IngredientType<?> getType() {
|
||||||
|
return MechanicalIngredientTypes.COUNTABLE_INGREDIENT.get();
|
||||||
|
}*/
|
||||||
|
}
|
||||||
@@ -21,13 +21,9 @@ public abstract class AbstractMechanicalRecipe<T extends RecipeInput, P extends
|
|||||||
protected ArrayList<ICondition> conditions;
|
protected ArrayList<ICondition> conditions;
|
||||||
|
|
||||||
public AbstractMechanicalRecipe(P params){
|
public AbstractMechanicalRecipe(P params){
|
||||||
id = params.id;
|
|
||||||
recipeRequirements = params.recipeRequirements;
|
recipeRequirements = params.recipeRequirements;
|
||||||
conditions = params.conditions;
|
conditions = params.conditions;
|
||||||
}
|
}
|
||||||
public ResourceLocation getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public List<ICondition> getConditions(){
|
public List<ICondition> getConditions(){
|
||||||
return conditions;
|
return conditions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,12 +20,13 @@ import java.util.function.Consumer;
|
|||||||
public abstract class AbstractMechanicalRecipeBuilder<R extends AbstractMechanicalRecipe<?,P>, P extends AbstractMechanicalRecipeParams, BRB extends AbstractMechanicalRecipeBuilder<R,P,?>> {
|
public abstract class AbstractMechanicalRecipeBuilder<R extends AbstractMechanicalRecipe<?,P>, P extends AbstractMechanicalRecipeParams, BRB extends AbstractMechanicalRecipeBuilder<R,P,?>> {
|
||||||
protected final Map<String, Criterion<?>> criteria = new LinkedHashMap<>();
|
protected final Map<String, Criterion<?>> criteria = new LinkedHashMap<>();
|
||||||
protected P params;
|
protected P params;
|
||||||
|
protected ResourceLocation id;
|
||||||
|
|
||||||
public AbstractMechanicalRecipeBuilder(){
|
public AbstractMechanicalRecipeBuilder(){
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract R build();
|
public abstract R build();
|
||||||
public abstract BRB create(ResourceLocation id);
|
public abstract BRB create();
|
||||||
|
|
||||||
public BRB withRequirement(IRecipeRequirement requirement){
|
public BRB withRequirement(IRecipeRequirement requirement){
|
||||||
params.recipeRequirements.add(requirement);
|
params.recipeRequirements.add(requirement);
|
||||||
@@ -51,7 +52,10 @@ public abstract class AbstractMechanicalRecipeBuilder<R extends AbstractMechanic
|
|||||||
params.conditions.addAll(conditions);
|
params.conditions.addAll(conditions);
|
||||||
return (BRB) this;
|
return (BRB) this;
|
||||||
}
|
}
|
||||||
|
public BRB withId(ResourceLocation id){
|
||||||
|
this.id = id;
|
||||||
|
return (BRB) this;
|
||||||
|
}
|
||||||
public void save(RecipeOutput recipeOutput, ResourceLocation resourceLocation) {
|
public void save(RecipeOutput recipeOutput, ResourceLocation resourceLocation) {
|
||||||
Advancement.Builder advancement = recipeOutput.advancement()
|
Advancement.Builder advancement = recipeOutput.advancement()
|
||||||
.addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(resourceLocation))
|
.addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(resourceLocation))
|
||||||
@@ -59,7 +63,7 @@ public abstract class AbstractMechanicalRecipeBuilder<R extends AbstractMechanic
|
|||||||
.requirements(AdvancementRequirements.Strategy.OR);
|
.requirements(AdvancementRequirements.Strategy.OR);
|
||||||
this.criteria.forEach(advancement::addCriterion);
|
this.criteria.forEach(advancement::addCriterion);
|
||||||
|
|
||||||
recipeOutput.accept(resourceLocation, build(), advancement.build(params.id.withPrefix("recipes/")));
|
recipeOutput.accept(resourceLocation, build(), advancement.build(resourceLocation.withPrefix("recipes/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveCompat(RecipeOutput recipeOutput, ResourceLocation resourceLocation) {
|
public void saveCompat(RecipeOutput recipeOutput, ResourceLocation resourceLocation) {
|
||||||
@@ -72,16 +76,16 @@ public abstract class AbstractMechanicalRecipeBuilder<R extends AbstractMechanic
|
|||||||
ResourceLocation compatResourceLocation = ResourceLocation.fromNamespaceAndPath(resourceLocation.getNamespace(), compatId);
|
ResourceLocation compatResourceLocation = ResourceLocation.fromNamespaceAndPath(resourceLocation.getNamespace(), compatId);
|
||||||
recipeOutput.accept(
|
recipeOutput.accept(
|
||||||
compatResourceLocation,
|
compatResourceLocation,
|
||||||
build(), advancement.build(params.id.withPrefix("recipes/")));
|
build(), advancement.build(resourceLocation.withPrefix("recipes/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void save(RecipeOutput recipeOutput) {
|
public void save(RecipeOutput recipeOutput) {
|
||||||
save(recipeOutput, params.id);
|
save(recipeOutput, this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveCompat(RecipeOutput recipeOutput) {
|
public void saveCompat(RecipeOutput recipeOutput) {
|
||||||
saveCompat(recipeOutput, params.id);
|
saveCompat(recipeOutput, this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BRB with(Consumer<BRB> consummer){
|
public BRB with(Consumer<BRB> consummer){
|
||||||
|
|||||||
@@ -6,12 +6,10 @@ import net.neoforged.neoforge.common.conditions.ICondition;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public abstract class AbstractMechanicalRecipeParams {
|
public abstract class AbstractMechanicalRecipeParams {
|
||||||
public ResourceLocation id;
|
|
||||||
public ArrayList<IRecipeRequirement> recipeRequirements;
|
public ArrayList<IRecipeRequirement> recipeRequirements;
|
||||||
public ArrayList<ICondition> conditions;
|
public ArrayList<ICondition> conditions;
|
||||||
|
|
||||||
protected AbstractMechanicalRecipeParams(ResourceLocation id) {
|
protected AbstractMechanicalRecipeParams() {
|
||||||
this.id = id;
|
|
||||||
this.recipeRequirements = new ArrayList<>();
|
this.recipeRequirements = new ArrayList<>();
|
||||||
this.conditions = new ArrayList<>();
|
this.conditions = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.oierbravo.mechanicals.foundation.recipe;
|
|||||||
import com.mojang.serialization.Codec;
|
import com.mojang.serialization.Codec;
|
||||||
import com.oierbravo.mechanicals.register.MechanicalRegistries;
|
import com.oierbravo.mechanicals.register.MechanicalRegistries;
|
||||||
import com.oierbravo.mechanicals.utility.LibLang;
|
import com.oierbravo.mechanicals.utility.LibLang;
|
||||||
|
import com.oierbravo.mechanicals.utility.MechanicalLangIdGenerator;
|
||||||
import net.createmod.catnip.data.Pair;
|
import net.createmod.catnip.data.Pair;
|
||||||
import net.minecraft.network.RegistryFriendlyByteBuf;
|
import net.minecraft.network.RegistryFriendlyByteBuf;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
@@ -31,12 +32,18 @@ public interface IRecipeRequirement {
|
|||||||
RecipeRequirementType<?> getType();
|
RecipeRequirementType<?> getType();
|
||||||
|
|
||||||
default Pair<Component,Component> toTooltipComponent(){
|
default Pair<Component,Component> toTooltipComponent(){
|
||||||
return Pair.of(LibLang.translate("ui.recipe_requirement." + getIdString() + ".tooltip.title").component(),
|
return Pair.of(LibLang.translate(MechanicalLangIdGenerator.recipeRequirement(getIdString(), "title")).component(),
|
||||||
LibLang.translate("ui.recipe_requirement." + getIdString() + ".tooltip.value", toString()).component()
|
LibLang.translate(MechanicalLangIdGenerator.recipeRequirement(getIdString(), "value"), toString()).component()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
default Component toItemTooltipComponent(){
|
||||||
|
return LibLang.translate(MechanicalLangIdGenerator.recipeRequirement(getIdString(), "title")).component()
|
||||||
|
.append(
|
||||||
|
LibLang.translate(MechanicalLangIdGenerator.recipeRequirement(getIdString(), "value"), toString()).component()
|
||||||
|
);
|
||||||
|
};
|
||||||
default Component toMissingComponent(){
|
default Component toMissingComponent(){
|
||||||
return LibLang.translate("ui.recipe_requirement." + getIdString() + ".missing").component();
|
return LibLang.translate(MechanicalLangIdGenerator.recipeRequirement(getIdString(), "missing")).component();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ public interface IRecipeWithRequirements {
|
|||||||
|
|
||||||
ArrayList<IRecipeRequirement> getRecipeRequirements();
|
ArrayList<IRecipeRequirement> getRecipeRequirements();
|
||||||
|
|
||||||
|
default List<IRecipeRequirement> getJeiRecipeRequirements(){
|
||||||
|
return getRecipeRequirements();
|
||||||
|
}
|
||||||
|
|
||||||
default Optional<IRecipeRequirement> getRequirement(RecipeRequirementType<?> type) {
|
default Optional<IRecipeRequirement> getRequirement(RecipeRequirementType<?> type) {
|
||||||
return getRecipeRequirements().stream().filter(iRecipeRequirement -> iRecipeRequirement.getType() == type).findFirst();
|
return getRecipeRequirements().stream().filter(iRecipeRequirement -> iRecipeRequirement.getType() == type).findFirst();
|
||||||
}
|
}
|
||||||
@@ -41,4 +45,10 @@ public interface IRecipeWithRequirements {
|
|||||||
return getRecipeRequirements().stream().map(IRecipeRequirement::toTooltipComponent).toList();
|
return getRecipeRequirements().stream().map(IRecipeRequirement::toTooltipComponent).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<Pair<Component,Component>> getJeiRequirementsTooltips(){
|
||||||
|
if(getJeiRecipeRequirements().isEmpty())
|
||||||
|
return List.of();
|
||||||
|
return getJeiRecipeRequirements().stream().map(IRecipeRequirement::toTooltipComponent).toList();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ public record BiomeTagRequirement(TagKey<Biome> tag) implements IRecipeRequireme
|
|||||||
public static MapCodec<BiomeTagRequirement> CODEC = RecordCodecBuilder
|
public static MapCodec<BiomeTagRequirement> CODEC = RecordCodecBuilder
|
||||||
.mapCodec((builder)
|
.mapCodec((builder)
|
||||||
-> builder
|
-> builder
|
||||||
//.group(TagKey.codec(Registries.BIOME).optionalFieldOf("value", null)
|
|
||||||
.group(ResourceLocation.CODEC.optionalFieldOf("value", null)
|
.group(ResourceLocation.CODEC.optionalFieldOf("value", null)
|
||||||
.forGetter(BiomeTagRequirement::getResourceLocation)).apply(builder,BiomeTagRequirement::new));
|
.forGetter(BiomeTagRequirement::getResourceLocation)).apply(builder,BiomeTagRequirement::new));
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.oierbravo.mechanicals.register;
|
|||||||
|
|
||||||
import com.oierbravo.mechanicals.Mechanicals;
|
import com.oierbravo.mechanicals.Mechanicals;
|
||||||
import com.oierbravo.mechanicals.utility.LibLang;
|
import com.oierbravo.mechanicals.utility.LibLang;
|
||||||
|
import com.oierbravo.mechanicals.utility.MechanicalLangIdGenerator;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.neoforged.bus.api.IEventBus;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ public class MechanicalCreativeModeTabs {
|
|||||||
|
|
||||||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> MAIN_TAB = TAB_REGISTER.register("main",
|
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> MAIN_TAB = TAB_REGISTER.register("main",
|
||||||
() -> CreativeModeTab.builder()
|
() -> CreativeModeTab.builder()
|
||||||
.title(LibLang.translate("itemGroup:main").component())
|
.title(LibLang.translate(MechanicalLangIdGenerator.creativeTabId("main")).component())
|
||||||
.icon(() -> Items.EGG.asItem().getDefaultInstance())
|
.icon(() -> Items.EGG.asItem().getDefaultInstance())
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.oierbravo.mechanicals.register;
|
||||||
|
|
||||||
|
import com.oierbravo.mechanicals.foundation.ingredient.CountableIngredient;
|
||||||
|
import net.neoforged.bus.api.IEventBus;
|
||||||
|
import net.neoforged.neoforge.common.crafting.IngredientType;
|
||||||
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
|
import net.neoforged.neoforge.registries.NeoForgeRegistries;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
import static com.oierbravo.mechanicals.Mechanicals.MODID;
|
||||||
|
|
||||||
|
public class MechanicalIngredientTypes {
|
||||||
|
private static final DeferredRegister<IngredientType<?>> INGREDIENT_TYPES = DeferredRegister.create(NeoForgeRegistries.INGREDIENT_TYPES, MODID);
|
||||||
|
|
||||||
|
/*public static final Supplier<IngredientType<CountableIngredient>> COUNTABLE_INGREDIENT =
|
||||||
|
INGREDIENT_TYPES.register("countable_ingredient",
|
||||||
|
() -> new IngredientType<>(CountableIngredient.CODEC, CountableIngredient.STREAM_CODEC));
|
||||||
|
*/
|
||||||
|
public static void register(IEventBus modEventBus) {
|
||||||
|
INGREDIENT_TYPES.register(modEventBus);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -34,7 +34,7 @@ public class MechanicalRecipeRequirementTypes {
|
|||||||
public static final Supplier<RecipeRequirementType<BiomeTagRequirement>> BIOME_TAG =
|
public static final Supplier<RecipeRequirementType<BiomeTagRequirement>> BIOME_TAG =
|
||||||
register(BiomeTagRequirement.ID, BiomeTagRequirement.CODEC, BiomeTagRequirement.STREAM_CODEC);
|
register(BiomeTagRequirement.ID, BiomeTagRequirement.CODEC, BiomeTagRequirement.STREAM_CODEC);
|
||||||
|
|
||||||
public static void init(IEventBus modEventBus) {
|
public static void register(IEventBus modEventBus) {
|
||||||
RECIPE_REQUIREMENT_TYPES.register(modEventBus);
|
RECIPE_REQUIREMENT_TYPES.register(modEventBus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.oierbravo.mechanicals.utility;
|
||||||
|
|
||||||
|
public class MechanicalLangIdGenerator {
|
||||||
|
|
||||||
|
public static String creativeTabId(String variant){
|
||||||
|
return "itemGroup:" + variant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String jadeId(String namespace) {
|
||||||
|
return "config.jade.plugin_" + namespace + ".data";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String recipeRequirement(String id, String variant) {
|
||||||
|
return "ui.recipe_requirement." + id + ".tooltip." + variant;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,29 +1,90 @@
|
|||||||
package com.oierbravo.mechanicals.utility;
|
package com.oierbravo.mechanicals.utility;
|
||||||
|
|
||||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
|
||||||
|
|
||||||
public class RegistrateLangBuilder {
|
import com.tterrag.registrate.AbstractRegistrate;
|
||||||
|
|
||||||
|
public class RegistrateLangBuilder<R extends AbstractRegistrate<?>> {
|
||||||
private final String namespace;
|
private final String namespace;
|
||||||
private final CreateRegistrate registrate;
|
private final R registrate;
|
||||||
|
|
||||||
public RegistrateLangBuilder(String namespace, CreateRegistrate registrate) {
|
public RegistrateLangBuilder(String namespace, R registrate) {
|
||||||
this.namespace = namespace;
|
this.namespace = namespace;
|
||||||
this.registrate = registrate;
|
this.registrate = registrate;
|
||||||
}
|
}
|
||||||
public RegistrateLangBuilder add(String literal, String defaultTranslation){
|
public RegistrateLangBuilder<R> add(String literal, String defaultTranslation){
|
||||||
registrate.addRawLang(namespace + "." + literal,defaultTranslation);
|
registrate.addRawLang(namespace + "." + literal,defaultTranslation);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public RegistrateLangBuilder addRaw(String literal, String defaultTranslation){
|
public RegistrateLangBuilder<R> addCreativeTab(String defaultTranslation){
|
||||||
|
return add(MechanicalLangIdGenerator.creativeTabId( "main"), defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addJade(String defaultTranslation){
|
||||||
|
registrate.addRawLang(MechanicalLangIdGenerator.jadeId(namespace),defaultTranslation);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addRaw(String literal, String defaultTranslation){
|
||||||
registrate.addRawLang(literal,defaultTranslation);
|
registrate.addRawLang(literal,defaultTranslation);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public RegistrateLangBuilder addBlockTooltip(String id, String defaultTranslation){
|
|
||||||
registrate.addRawLang("block." + namespace + "." + id + ".tooltip",defaultTranslation);
|
protected RegistrateLangBuilder<R> addRecipeRequirement(String variant, String id, String defaultTranslation){
|
||||||
|
registrate.addRawLang("mechanicals." + MechanicalLangIdGenerator.recipeRequirement(id, variant),defaultTranslation);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public RegistrateLangBuilder addBlockTooltipSummary(String id, String defaultTranslation){
|
public RegistrateLangBuilder<R> addRecipeRequirementTitle(String id, String defaultTranslation){
|
||||||
registrate.addRawLang("block." + namespace + "." + id + ".tooltip.summary",defaultTranslation);
|
return addRecipeRequirement("title", id, defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addRecipeRequirementValue(String id, String defaultTranslation){
|
||||||
|
return addRecipeRequirement("value", id, defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addRecipeRequirementMissing(String id, String defaultTranslation){
|
||||||
|
return addRecipeRequirement("missing", id, defaultTranslation);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected RegistrateLangBuilder<R> addTooltip(String id, String type, String variant, String defaultTranslation){
|
||||||
|
registrate.addRawLang(type + "." + namespace + "." + id + ".tooltip." + variant,defaultTranslation);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
/* Item tooltips */
|
||||||
|
public RegistrateLangBuilder<R> addItemTooltip(String id, String variant, String defaultTranslation){
|
||||||
|
return addTooltip(id, "item", variant, defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addItemTooltipSummary(String id, String defaultTranslation){
|
||||||
|
return addItemTooltip(id, "summary", defaultTranslation);
|
||||||
|
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addItemTooltipCondition(String id, int index, String defaultTranslation){
|
||||||
|
return addItemTooltip(id, "condition" + index, defaultTranslation);
|
||||||
|
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addItemTooltipBehaviour(String id, int index, String defaultTranslation){
|
||||||
|
return addItemTooltip(id, "behaviour" + index, defaultTranslation);
|
||||||
|
|
||||||
|
}
|
||||||
|
/* Block tooltips */
|
||||||
|
protected RegistrateLangBuilder<R> addBlockTooltip(String id, String variant, String defaultTranslation){
|
||||||
|
return addTooltip(id, "block", variant, defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addBlockTooltipSummary(String id, String defaultTranslation){
|
||||||
|
return addBlockTooltip(id, "summary", defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addBlockTooltipCondition(String id, int index, String defaultTranslation){
|
||||||
|
return addBlockTooltip(id, "condition" + index, defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addBlockTooltipBehaviour(String id, int index, String defaultTranslation){
|
||||||
|
return addBlockTooltip(id, "behaviour" + index, defaultTranslation);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ponder */
|
||||||
|
protected RegistrateLangBuilder<R> addPonder(String id, String variant, String defaultTranslation){
|
||||||
|
registrate.addRawLang(namespace + ".ponder." + id + "." + variant,defaultTranslation);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addPonderHeader(String id, String defaultTranslation){
|
||||||
|
return addPonder(id, "header", defaultTranslation);
|
||||||
|
}
|
||||||
|
public RegistrateLangBuilder<R> addPonderText(int index, String id, String defaultTranslation){
|
||||||
|
return addPonder(id, "text_" + index, defaultTranslation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user