REI integration

This commit is contained in:
Aleksey 2020-10-02 15:12:53 +03:00
parent 74c6c14b2a
commit e0cf41db63
24 changed files with 272 additions and 38 deletions

View file

@ -11,16 +11,13 @@ version = project.mod_version
group = project.maven_group group = project.maven_group
dependencies { dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. modRuntime "me.shedaniel:RoughlyEnoughItems:5.6.0"
// You may need to force-disable transitiveness on them. modCompileOnly "me.shedaniel:RoughlyEnoughItems-api:5.6.0"
} }
processResources { processResources {

View file

@ -34,7 +34,7 @@ public class BetterEnd implements ModInitializer {
AlloyingRecipes.register(); AlloyingRecipes.register();
} }
public static Identifier getResId(String path) { public static Identifier getIdentifier(String path) {
return new Identifier(MOD_ID, path); return new Identifier(MOD_ID, path);
} }

View file

@ -168,9 +168,9 @@ public class EChestBlockEntityRenderer extends BlockEntityRenderer<EChestBlockEn
if (block instanceof BlockChest) { if (block instanceof BlockChest) {
String name = Registry.BLOCK.getId(block).getPath(); String name = Registry.BLOCK.getId(block).getPath();
LAYERS.put(Block.getRawIdFromState(block.getDefaultState()), new RenderLayer[] { LAYERS.put(Block.getRawIdFromState(block.getDefaultState()), new RenderLayer[] {
RenderLayer.getEntitySolid(BetterEnd.getResId("textures/entity/chest/" + name + ".png")), RenderLayer.getEntitySolid(BetterEnd.getIdentifier("textures/entity/chest/" + name + ".png")),
RenderLayer.getEntitySolid(BetterEnd.getResId("textures/entity/chest/" + name + "_left.png")), RenderLayer.getEntitySolid(BetterEnd.getIdentifier("textures/entity/chest/" + name + "_left.png")),
RenderLayer.getEntitySolid(BetterEnd.getResId("textures/entity/chest/" + name + "_right.png")) RenderLayer.getEntitySolid(BetterEnd.getIdentifier("textures/entity/chest/" + name + "_right.png"))
}); });
} }
} }

View file

@ -111,7 +111,7 @@ public class ESignBlockEntityRenderer extends BlockEntityRenderer<ESignBlockEnti
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockSign) { if (block instanceof BlockSign) {
String name = Registry.BLOCK.getId(block).getPath(); String name = Registry.BLOCK.getId(block).getPath();
RenderLayer layer = RenderLayer.getEntitySolid(BetterEnd.getResId("textures/entity/sign/" + name + ".png")); RenderLayer layer = RenderLayer.getEntitySolid(BetterEnd.getIdentifier("textures/entity/sign/" + name + ".png"));
LAYERS.put(Block.getRawIdFromState(block.getDefaultState()), layer); LAYERS.put(Block.getRawIdFromState(block.getDefaultState()), layer);
} }
} }

View file

@ -21,7 +21,7 @@ import ru.betterend.BetterEnd;
public class EndStoneSmelterScreen extends HandledScreen<EndStoneSmelterScreenHandler> implements RecipeBookProvider { public class EndStoneSmelterScreen extends HandledScreen<EndStoneSmelterScreenHandler> implements RecipeBookProvider {
private final static Identifier RECIPE_BUTTON_TEXTURE = new Identifier("textures/gui/recipe_button.png"); private final static Identifier RECIPE_BUTTON_TEXTURE = new Identifier("textures/gui/recipe_button.png");
private final static Identifier BACKGROUND_TEXTURE = BetterEnd.getResId("textures/gui/smelter_gui.png"); private final static Identifier BACKGROUND_TEXTURE = BetterEnd.getIdentifier("textures/gui/smelter_gui.png");
public final EndStoneSmelterRecipeBookScreen recipeBook; public final EndStoneSmelterRecipeBookScreen recipeBook;
private boolean narrow; private boolean narrow;

View file

@ -28,7 +28,7 @@ import ru.betterend.recipe.AlloyingRecipe;
public class EndStoneSmelterScreenHandler extends AbstractRecipeScreenHandler<Inventory> { public class EndStoneSmelterScreenHandler extends AbstractRecipeScreenHandler<Inventory> {
public final static ScreenHandlerType<EndStoneSmelterScreenHandler> HANDLER_TYPE = ScreenHandlerRegistry.registerSimple( public final static ScreenHandlerType<EndStoneSmelterScreenHandler> HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(
BetterEnd.getResId(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new); BetterEnd.getIdentifier(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new);
private final Inventory inventory; private final Inventory inventory;
private final PropertyDelegate propertyDelegate; private final PropertyDelegate propertyDelegate;

View file

@ -0,0 +1,87 @@
package ru.betterend.compat;
import java.text.DecimalFormat;
import java.util.Collections;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import com.google.common.collect.Lists;
import it.unimi.dsi.fastutil.ints.IntList;
import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.api.TransferRecipeCategory;
import me.shedaniel.rei.api.widgets.Widgets;
import me.shedaniel.rei.gui.entries.RecipeEntry;
import me.shedaniel.rei.gui.entries.SimpleRecipeEntry;
import me.shedaniel.rei.gui.widget.Widget;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import ru.betterend.registry.BlockRegistry;
import ru.betterend.util.LangUtil;
public class REIAlloyingCategory implements TransferRecipeCategory<REIAlloyingDisplay> {
@Override
public @NotNull Identifier getIdentifier() {
return REICompat.ALLOYING;
}
@Override
public @NotNull String getCategoryName() {
return LangUtil.translate(BlockRegistry.END_STONE_SMELTER.getTranslationKey());
}
@Override
public @NotNull EntryStack getLogo() {
return REICompat.END_STONE_SMELTER;
}
@Override
public @NotNull List<Widget> setupDisplay(REIAlloyingDisplay display, Rectangle bounds) {
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10);
double smeltTime = display.getSmeltTime();
DecimalFormat df = new DecimalFormat("###.##");
List<Widget> widgets = Lists.newArrayList();
widgets.add(Widgets.createRecipeBase(bounds));
widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9)));
widgets.add(Widgets.createBurningFire(new Point(startPoint.x - 9, startPoint.y + 20)).animationDurationMS(10000));
widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + 5),
new TranslatableText("category.rei.cooking.time&xp", df.format(display.getXp()), df.format(smeltTime / 20D))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
widgets.add(Widgets.createArrow(new Point(startPoint.x + 24, startPoint.y + 8)).animationDurationTicks(smeltTime));
widgets.add(Widgets.createSlot(new Point(startPoint.x - 20, startPoint.y + 1)).entries(display.getInputEntries().get(0)).markInput());
widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entries(display.getInputEntries().get(1)).markInput());
widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)).entries(display.getResultingEntries().get(0)).disableBackground().markOutput());
return widgets;
}
@Override
public void renderRedSlots(MatrixStack matrices, List<Widget> widgets, Rectangle bounds, REIAlloyingDisplay display,
IntList redSlots) {
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
matrices.push();
matrices.translate(0, 0, 400);
if (redSlots.contains(0)) {
DrawableHelper.fill(matrices, startPoint.x - 20, startPoint.y + 1, startPoint.x - 20 + 16, startPoint.y + 1 + 16, 1090453504);
DrawableHelper.fill(matrices, startPoint.x + 1, startPoint.y + 1, startPoint.x + 1 + 16, startPoint.y + 1 + 16, 1090453504);
}
matrices.pop();
}
@Override
public @NotNull RecipeEntry getSimpleRenderer(REIAlloyingDisplay recipe) {
return SimpleRecipeEntry.from(Collections.singletonList(recipe.getInputEntries().get(0)), recipe.getResultingEntries());
}
@Override
public int getDisplayHeight() {
return 49;
}
}

View file

@ -0,0 +1,104 @@
package ru.betterend.compat;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.jetbrains.annotations.NotNull;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.api.TransferRecipeDisplay;
import me.shedaniel.rei.server.ContainerInfo;
import net.minecraft.item.Item;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import ru.betterend.recipe.AlloyingRecipe;
public class REIAlloyingDisplay implements TransferRecipeDisplay {
private static List<EntryStack> fuel;
private AlloyingRecipe recipe;
private List<List<EntryStack>> input;
private List<EntryStack> output;
private float xp;
private double smeltTime;
public REIAlloyingDisplay(AlloyingRecipe recipe) {
this.recipe = recipe;
this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
this.xp = recipe.getExperience();
this.smeltTime = recipe.getSmeltTime();
}
public static List<EntryStack> getFuel() {
return fuel;
}
@Override
public @NotNull Optional<Identifier> getRecipeLocation() {
return Optional.ofNullable(recipe).map(AlloyingRecipe::getId);
}
@Override
public @NotNull List<List<EntryStack>> getInputEntries() {
return this.input;
}
@Override
public @NotNull List<List<EntryStack>> getResultingEntries() {
return Collections.singletonList(output);
}
@Override
public @NotNull Identifier getRecipeCategory() {
return REICompat.ALLOYING;
}
@Override
public @NotNull List<List<EntryStack>> getRequiredEntries() {
return this.input;
}
public float getXp() {
return this.xp;
}
public double getSmeltTime() {
return this.smeltTime;
}
public Optional<AlloyingRecipe> getOptionalRecipe() {
return Optional.ofNullable(recipe);
}
@Override
public int getWidth() {
return 2;
}
@Override
public int getHeight() {
return 1;
}
@Override
public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<ScreenHandler> containerInfo,
ScreenHandler container) {
return input;
}
static {
fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream()
.map(Item::getStackForRender).map(EntryStack::create)
.map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableText("category.rei.smelting.fuel")
.formatted(Formatting.YELLOW)))).collect(Collectors.toList());
}
}

View file

@ -0,0 +1,42 @@
package ru.betterend.compat;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.api.RecipeHelper;
import me.shedaniel.rei.api.plugins.REIPluginV0;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.util.Identifier;
import ru.betterend.BetterEnd;
import ru.betterend.recipe.AlloyingRecipe;
import ru.betterend.registry.BlockRegistry;
@Environment(EnvType.CLIENT)
public class REICompat implements REIPluginV0 {
public final static Identifier PLUGIN_ID = BetterEnd.getIdentifier("rei_plugin");
public final static Identifier ALLOYING = BetterEnd.getIdentifier("alloying");
public final static EntryStack END_STONE_SMELTER = EntryStack.create(BlockRegistry.END_STONE_SMELTER);
@Override
public Identifier getPluginIdentifier() {
return PLUGIN_ID;
}
@Override
public void registerRecipeDisplays(RecipeHelper recipeHelper) {
recipeHelper.registerRecipes(ALLOYING, AlloyingRecipe.class, REIAlloyingDisplay::new);
}
@Override
public void registerOthers(RecipeHelper recipeHelper) {
recipeHelper.registerWorkingStations(ALLOYING, END_STONE_SMELTER);
}
@Override
public void registerPluginCategories(RecipeHelper recipeHelper) {
recipeHelper.registerCategory(new REIAlloyingCategory());
}
}

View file

@ -33,10 +33,10 @@ import ru.betterend.util.MHelper;
@Mixin(WorldRenderer.class) @Mixin(WorldRenderer.class)
public class WorldRendererMixin { public class WorldRendererMixin {
private static final Identifier NEBULA_1 = BetterEnd.getResId("textures/sky/nebula_2.png"); private static final Identifier NEBULA_1 = BetterEnd.getIdentifier("textures/sky/nebula_2.png");
private static final Identifier NEBULA_2 = BetterEnd.getResId("textures/sky/nebula_3.png"); private static final Identifier NEBULA_2 = BetterEnd.getIdentifier("textures/sky/nebula_3.png");
private static final Identifier HORIZON = BetterEnd.getResId("textures/sky/nebula_1.png"); private static final Identifier HORIZON = BetterEnd.getIdentifier("textures/sky/nebula_1.png");
private static final Identifier FOG = BetterEnd.getResId("textures/sky/fog.png"); private static final Identifier FOG = BetterEnd.getIdentifier("textures/sky/fog.png");
private static VertexBuffer stars1; private static VertexBuffer stars1;
private static VertexBuffer stars2; private static VertexBuffer stars2;

View file

@ -118,7 +118,7 @@ public class AlloyingRecipe implements Recipe<Inventory> {
private final static Builder INSTANCE = new Builder(); private final static Builder INSTANCE = new Builder();
public static Builder create(String id) { public static Builder create(String id) {
INSTANCE.id = BetterEnd.getResId(id); INSTANCE.id = BetterEnd.getIdentifier(id);
INSTANCE.group = String.format("%s_%s", GROUP, id); INSTANCE.group = String.format("%s_%s", GROUP, id);
INSTANCE.primaryInput = null; INSTANCE.primaryInput = null;
INSTANCE.secondaryInput = null; INSTANCE.secondaryInput = null;

View file

@ -65,7 +65,7 @@ public class EndRecipeManager {
} }
public static <T extends Recipe<?>> RecipeType<T> registerType(String type) { public static <T extends Recipe<?>> RecipeType<T> registerType(String type) {
Identifier recipeTypeId = BetterEnd.getResId(type); Identifier recipeTypeId = BetterEnd.getIdentifier(type);
return Registry.register(Registry.RECIPE_TYPE, recipeTypeId, new RecipeType<T>() { return Registry.register(Registry.RECIPE_TYPE, recipeTypeId, new RecipeType<T>() {
public String toString() { public String toString() {
return type; return type;

View file

@ -97,7 +97,7 @@ public class RecipeBuilder {
int height = shape.length; int height = shape.length;
int width = shape[0].length(); int width = shape[0].length();
ItemStack result = new ItemStack(output, count); ItemStack result = new ItemStack(output, count);
Identifier id = BetterEnd.getResId(name); Identifier id = BetterEnd.getIdentifier(name);
DefaultedList<Ingredient> materials = this.getMaterials(width, height); DefaultedList<Ingredient> materials = this.getMaterials(width, height);
CraftingRecipe recipe = shaped ? new ShapedRecipe(id, group, width, height, materials, result) : new ShapelessRecipe(id, group, result, materials); CraftingRecipe recipe = shaped ? new ShapedRecipe(id, group, width, height, materials, result) : new ShapelessRecipe(id, group, result, materials);

View file

@ -30,7 +30,7 @@ public class BlockEntityRegistry {
BlockEntityType.Builder.create(ESignBlockEntity::new, getSigns())); BlockEntityType.Builder.create(ESignBlockEntity::new, getSigns()));
public static <T extends BlockEntity> BlockEntityType<T> registerBlockEntity(String id, BlockEntityType.Builder<T> builder) { public static <T extends BlockEntity> BlockEntityType<T> registerBlockEntity(String id, BlockEntityType.Builder<T> builder) {
return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.getResId(id), builder.build(null)); return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.getIdentifier(id), builder.build(null));
} }
public static void register() {} public static void register() {}

View file

@ -55,12 +55,12 @@ public class BlockRegistry {
public static void register() {} public static void register() {}
public static Block registerBlock(String name, Block block) { public static Block registerBlock(String name, Block block) {
Registry.register(Registry.BLOCK, BetterEnd.getResId(name), block); Registry.register(Registry.BLOCK, BetterEnd.getIdentifier(name), block);
ItemRegistry.registerItem(name, new BlockItem(block, new Item.Settings().group(CreativeTab.END_TAB))); ItemRegistry.registerItem(name, new BlockItem(block, new Item.Settings().group(CreativeTab.END_TAB)));
return block; return block;
} }
public static Block registerBlockNI(String name, Block block) { public static Block registerBlockNI(String name, Block block) {
return Registry.register(Registry.BLOCK, BetterEnd.getResId(name), block); return Registry.register(Registry.BLOCK, BetterEnd.getIdentifier(name), block);
} }
} }

View file

@ -11,7 +11,7 @@ public class BlockTagRegistry {
public static final Tag.Identified<Block> END_GROUND = makeTag("end_ground"); public static final Tag.Identified<Block> END_GROUND = makeTag("end_ground");
private static Tag.Identified<Block> makeTag(String name) { private static Tag.Identified<Block> makeTag(String name) {
return (Identified<Block>) TagRegistry.block(BetterEnd.getResId(name)); return (Identified<Block>) TagRegistry.block(BetterEnd.getIdentifier(name));
} }
public static void register() { public static void register() {

View file

@ -55,7 +55,7 @@ public class ItemRegistry {
protected static Item registerItem(String name, Item item) { protected static Item registerItem(String name, Item item) {
if (item != Items.AIR) { if (item != Items.AIR) {
Registry.register(Registry.ITEM, BetterEnd.getResId(name), item); Registry.register(Registry.ITEM, BetterEnd.getIdentifier(name), item);
if (item instanceof BlockItem) if (item instanceof BlockItem)
MOD_BLOCKS.add(item); MOD_BLOCKS.add(item);
else else
@ -66,7 +66,7 @@ public class ItemRegistry {
protected static ToolItem registerTool(String name, ToolItem item) { protected static ToolItem registerTool(String name, ToolItem item) {
if (item != Items.AIR) { if (item != Items.AIR) {
Registry.register(Registry.ITEM, BetterEnd.getResId(name), item); Registry.register(Registry.ITEM, BetterEnd.getIdentifier(name), item);
MOD_ITEMS.add(item); MOD_ITEMS.add(item);
} }
return item; return item;

View file

@ -15,6 +15,6 @@ public class ParticleRegistry {
} }
private static DefaultParticleType register(String name) { private static DefaultParticleType register(String name) {
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.getResId(name), FabricParticleTypes.simple()); return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.getIdentifier(name), FabricParticleTypes.simple());
} }
} }

View file

@ -9,7 +9,7 @@ import ru.betterend.registry.BlockRegistry;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.ItemRegistry;
public class CreativeTab { public class CreativeTab {
public static final ItemGroup END_TAB = FabricItemGroupBuilder.create(BetterEnd.getResId("items")) public static final ItemGroup END_TAB = FabricItemGroupBuilder.create(BetterEnd.getIdentifier("items"))
.icon(() -> new ItemStack(BlockRegistry.END_MYCELIUM)).appendItems(stacks -> { .icon(() -> new ItemStack(BlockRegistry.END_MYCELIUM)).appendItems(stacks -> {
for (Item i : ItemRegistry.getModBlocks()) { for (Item i : ItemRegistry.getModBlocks()) {
stacks.add(new ItemStack(i)); stacks.add(new ItemStack(i));

View file

@ -2,11 +2,8 @@ package ru.betterend.util;
import net.minecraft.client.resource.language.I18n; import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
import ru.betterend.BetterEnd;
public class LangUtil { public class LangUtil {
private final static String MODID = BetterEnd.MOD_ID;
public final static String CONFIG_ELEMENT = "configuration"; public final static String CONFIG_ELEMENT = "configuration";
private String element; private String element;
@ -27,8 +24,12 @@ public class LangUtil {
return getText(element, key); return getText(element, key);
} }
public static String translate(String key) {
return I18n.translate(key);
}
public static String getString(String element, String key) { public static String getString(String element, String key) {
return I18n.translate(String.format("%s.%s.%s", MODID, element, key)); return translate(String.format("%s.%s", element, key));
} }
public static TranslatableText getText(String element, String key) { public static TranslatableText getText(String element, String key) {

View file

@ -57,7 +57,7 @@ public class BiomeDefinition {
private ConfiguredSurfaceBuilder<?> surface; private ConfiguredSurfaceBuilder<?> surface;
public BiomeDefinition(String name) { public BiomeDefinition(String name) {
this.id = BetterEnd.getResId(name); this.id = BetterEnd.getIdentifier(name);
} }
public BiomeDefinition setSurface(Block surfaceBlock) { public BiomeDefinition setSurface(Block surfaceBlock) {

View file

@ -26,21 +26,21 @@ public class EndFeature {
private EndFeature() {} private EndFeature() {}
public EndFeature(String name, Feature<DefaultFeatureConfig> feature, GenerationStep.Feature featureStep, ConfiguredFeature<?, ?> configuredFeature) { public EndFeature(String name, Feature<DefaultFeatureConfig> feature, GenerationStep.Feature featureStep, ConfiguredFeature<?, ?> configuredFeature) {
Identifier id = BetterEnd.getResId(name); Identifier id = BetterEnd.getIdentifier(name);
this.featureStep = featureStep; this.featureStep = featureStep;
this.feature = Registry.register(Registry.FEATURE, id, feature); this.feature = Registry.register(Registry.FEATURE, id, feature);
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, configuredFeature); this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, configuredFeature);
} }
public EndFeature(String name, Feature<DefaultFeatureConfig> feature) { public EndFeature(String name, Feature<DefaultFeatureConfig> feature) {
Identifier id = BetterEnd.getResId(name); Identifier id = BetterEnd.getIdentifier(name);
this.featureStep = GenerationStep.Feature.VEGETAL_DECORATION; this.featureStep = GenerationStep.Feature.VEGETAL_DECORATION;
this.feature = Registry.register(Registry.FEATURE, id, feature); this.feature = Registry.register(Registry.FEATURE, id, feature);
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(Decorator.CHANCE.configure(new ChanceDecoratorConfig(100)))); this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(Decorator.CHANCE.configure(new ChanceDecoratorConfig(100))));
} }
public EndFeature(String name, Feature<DefaultFeatureConfig> feature, int density) { public EndFeature(String name, Feature<DefaultFeatureConfig> feature, int density) {
Identifier id = BetterEnd.getResId(name); Identifier id = BetterEnd.getIdentifier(name);
this.featureStep = GenerationStep.Feature.VEGETAL_DECORATION; this.featureStep = GenerationStep.Feature.VEGETAL_DECORATION;
this.feature = Registry.register(Registry.FEATURE, id, feature); this.feature = Registry.register(Registry.FEATURE, id, feature);
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(density)); this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(density));
@ -67,7 +67,7 @@ public class EndFeature {
.repeat(veins); .repeat(veins);
newFeature.feature = Feature.ORE; newFeature.feature = Feature.ORE;
newFeature.featureStep = GenerationStep.Feature.UNDERGROUND_ORES; newFeature.featureStep = GenerationStep.Feature.UNDERGROUND_ORES;
newFeature.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, BetterEnd.getResId(name), oreFeature); newFeature.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, BetterEnd.getIdentifier(name), oreFeature);
return newFeature; return newFeature;
} }

View file

@ -75,6 +75,6 @@ public class BetterEndBiomeSource extends BiomeSource {
} }
public static void register() { public static void register() {
Registry.register(Registry.BIOME_SOURCE, BetterEnd.getResId("better_end_biome_source"), CODEC); Registry.register(Registry.BIOME_SOURCE, BetterEnd.getIdentifier("better_end_biome_source"), CODEC);
} }
} }

View file

@ -24,7 +24,10 @@
], ],
"client": [ "client": [
"ru.betterend.client.BetterEndClient" "ru.betterend.client.BetterEndClient"
] ],
"rei_plugins": [
"ru.betterend.compat.REICompat"
]
}, },
"mixins": [ "mixins": [
"betterend.mixins.common.json", "betterend.mixins.common.json",