Fixed most compiletime errors

This commit is contained in:
Frank 2023-04-29 11:48:56 +02:00
parent e232184b68
commit a974fab707
58 changed files with 449 additions and 679 deletions

View file

@ -6,7 +6,6 @@ import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -29,7 +28,7 @@ public class NeedlegrassBlock extends EndPlantBlock {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
entity.hurt(DamageSource.CACTUS, 0.1F); entity.hurt(world.damageSources().cactus(), 0.1F);
} }
} }

View file

@ -18,7 +18,6 @@ import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis; import net.minecraft.core.Direction.Axis;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.*; import net.minecraft.world.level.*;
@ -330,7 +329,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
@Override @Override
public void entityInside(BlockState blockState, Level level, BlockPos blockPos, Entity entity) { public void entityInside(BlockState blockState, Level level, BlockPos blockPos, Entity entity) {
entity.hurt(DamageSource.CACTUS, 1.0F); entity.hurt(level.damageSources().cactus(), 1.0F);
} }
private int getLength(BlockState state, ServerLevel world, BlockPos pos, int max) { private int getLength(BlockState state, ServerLevel world, BlockPos pos, int max) {

View file

@ -9,6 +9,7 @@ import org.betterx.betterend.registry.EndBlockEntities;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.NonNullList; import net.minecraft.core.NonNullList;
import net.minecraft.core.RegistryAccess;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -52,9 +53,6 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
EndStoneSmelterMenu.INGREDIENT_SLOT_A, EndStoneSmelterMenu.INGREDIENT_SLOT_A,
EndStoneSmelterMenu.INGREDIENT_SLOT_B EndStoneSmelterMenu.INGREDIENT_SLOT_B
}; };
private static final int[] JUST_A = new int[]{
EndStoneSmelterMenu.INGREDIENT_SLOT_A,
};
private static final int[] BOTTOM_SLOTS = new int[]{EndStoneSmelterMenu.FUEL_SLOT, EndStoneSmelterMenu.RESULT_SLOT}; private static final int[] BOTTOM_SLOTS = new int[]{EndStoneSmelterMenu.FUEL_SLOT, EndStoneSmelterMenu.RESULT_SLOT};
private static final int[] SIDE_SLOTS = new int[]{ private static final int[] SIDE_SLOTS = new int[]{
EndStoneSmelterMenu.FUEL_SLOT EndStoneSmelterMenu.FUEL_SLOT
@ -76,33 +74,21 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
this.recipesUsed = new Object2IntOpenHashMap<>(); this.recipesUsed = new Object2IntOpenHashMap<>();
this.propertyDelegate = new ContainerData() { this.propertyDelegate = new ContainerData() {
public int get(int index) { public int get(int index) {
switch (index) { return switch (index) {
case 0: case 0 -> EndStoneSmelterBlockEntity.this.burnTime;
return EndStoneSmelterBlockEntity.this.burnTime; case 1 -> EndStoneSmelterBlockEntity.this.fuelTime;
case 1: case 2 -> EndStoneSmelterBlockEntity.this.smeltTime;
return EndStoneSmelterBlockEntity.this.fuelTime; case 3 -> EndStoneSmelterBlockEntity.this.smeltTimeTotal;
case 2: default -> 0;
return EndStoneSmelterBlockEntity.this.smeltTime; };
case 3:
return EndStoneSmelterBlockEntity.this.smeltTimeTotal;
default:
return 0;
}
} }
public void set(int index, int value) { public void set(int index, int value) {
switch (index) { switch (index) {
case 0: case 0 -> EndStoneSmelterBlockEntity.this.burnTime = value;
EndStoneSmelterBlockEntity.this.burnTime = value; case 1 -> EndStoneSmelterBlockEntity.this.fuelTime = value;
break; case 2 -> EndStoneSmelterBlockEntity.this.smeltTime = value;
case 1: case 3 -> EndStoneSmelterBlockEntity.this.smeltTimeTotal = value;
EndStoneSmelterBlockEntity.this.fuelTime = value;
break;
case 2:
EndStoneSmelterBlockEntity.this.smeltTime = value;
break;
case 3:
EndStoneSmelterBlockEntity.this.smeltTimeTotal = value;
} }
} }
@ -187,8 +173,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
for (Entry<ResourceLocation> entry : recipesUsed.object2IntEntrySet()) { for (Entry<ResourceLocation> entry : recipesUsed.object2IntEntrySet()) {
level.getRecipeManager().byKey(entry.getKey()).ifPresent((recipe) -> { level.getRecipeManager().byKey(entry.getKey()).ifPresent((recipe) -> {
list.add(recipe); list.add(recipe);
if (recipe instanceof AlloyingRecipe) { if (recipe instanceof AlloyingRecipe alloying) {
AlloyingRecipe alloying = (AlloyingRecipe) recipe;
dropExperience(player.level, player.position(), entry.getIntValue(), alloying.getExperience()); dropExperience(player.level, player.position(), entry.getIntValue(), alloying.getExperience());
} else { } else {
BlastingRecipe blasting = (BlastingRecipe) recipe; BlastingRecipe blasting = (BlastingRecipe) recipe;
@ -273,7 +258,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
.getRecipeFor(RecipeType.BLASTING, blockEntity, tickLevel) .getRecipeFor(RecipeType.BLASTING, blockEntity, tickLevel)
.orElse(null); .orElse(null);
} }
boolean accepted = blockEntity.canAcceptRecipeOutput(recipe); boolean accepted = blockEntity.canAcceptRecipeOutput(recipe, tickLevel.registryAccess());
if (!burning && accepted) { if (!burning && accepted) {
blockEntity.burnTime = EndStoneSmelterBlockEntity.getFuelTime(fuel); blockEntity.burnTime = EndStoneSmelterBlockEntity.getFuelTime(fuel);
blockEntity.fuelTime = blockEntity.burnTime; blockEntity.fuelTime = blockEntity.burnTime;
@ -299,7 +284,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
if (blockEntity.smeltTime == blockEntity.smeltTimeTotal) { if (blockEntity.smeltTime == blockEntity.smeltTimeTotal) {
blockEntity.smeltTime = 0; blockEntity.smeltTime = 0;
blockEntity.smeltTimeTotal = blockEntity.getSmeltTime(); blockEntity.smeltTimeTotal = blockEntity.getSmeltTime();
blockEntity.craftRecipe(recipe); blockEntity.craftRecipe(recipe, tickLevel.registryAccess());
blockEntity.setChanged(); blockEntity.setChanged();
} }
} else { } else {
@ -314,7 +299,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
} }
} }
protected boolean canAcceptRecipeOutput(Recipe<?> recipe) { protected boolean canAcceptRecipeOutput(Recipe<?> recipe, RegistryAccess acc) {
if (recipe == null) return false; if (recipe == null) return false;
boolean validInput; boolean validInput;
if (recipe instanceof AlloyingRecipe) { if (recipe instanceof AlloyingRecipe) {
@ -325,7 +310,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|| !inventory.get(EndStoneSmelterMenu.INGREDIENT_SLOT_B).isEmpty(); || !inventory.get(EndStoneSmelterMenu.INGREDIENT_SLOT_B).isEmpty();
} }
if (validInput) { if (validInput) {
ItemStack result = recipe.getResultItem(); ItemStack result = recipe.getResultItem(acc);
if (result.isEmpty()) { if (result.isEmpty()) {
return false; return false;
} }
@ -346,10 +331,10 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
return false; return false;
} }
private void craftRecipe(Recipe<?> recipe) { private void craftRecipe(Recipe<?> recipe, RegistryAccess acc) {
if (recipe == null || !canAcceptRecipeOutput(recipe)) return; if (recipe == null || !canAcceptRecipeOutput(recipe, acc)) return;
ItemStack result = recipe.getResultItem(); ItemStack result = recipe.getResultItem(acc);
ItemStack output = inventory.get(EndStoneSmelterMenu.RESULT_SLOT); ItemStack output = inventory.get(EndStoneSmelterMenu.RESULT_SLOT);
if (output.isEmpty()) { if (output.isEmpty()) {
inventory.set(EndStoneSmelterMenu.RESULT_SLOT, result.copy()); inventory.set(EndStoneSmelterMenu.RESULT_SLOT, result.copy());

View file

@ -2,6 +2,7 @@ package org.betterx.betterend.client.gui;
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity; import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.recipebook.BlastingRecipeBookComponent; import net.minecraft.client.gui.screens.recipebook.BlastingRecipeBookComponent;
import net.minecraft.core.NonNullList; import net.minecraft.core.NonNullList;
import net.minecraft.world.inventory.Slot; import net.minecraft.world.inventory.Slot;
@ -38,7 +39,7 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent
@Override @Override
public void setupGhostRecipe(Recipe<?> recipe, List<Slot> slots) { public void setupGhostRecipe(Recipe<?> recipe, List<Slot> slots) {
this.ghostRecipe.clear(); this.ghostRecipe.clear();
ItemStack result = recipe.getResultItem(); ItemStack result = recipe.getResultItem(Minecraft.getInstance().level.registryAccess());
this.ghostRecipe.setRecipe(recipe); this.ghostRecipe.setRecipe(recipe);
this.ghostRecipe.addIngredient(Ingredient.of(result), (slots.get(3)).x, (slots.get(3)).y); this.ghostRecipe.addIngredient(Ingredient.of(result), (slots.get(3)).x, (slots.get(3)).y);
NonNullList<Ingredient> inputs = recipe.getIngredients(); NonNullList<Ingredient> inputs = recipe.getIngredients();

View file

@ -80,7 +80,6 @@ public class BetterEndSkyRenderer implements DimensionRenderingRegistry.SkyRende
FogRenderer.levelFogColor(); FogRenderer.levelFogColor();
RenderSystem.depthMask(false); RenderSystem.depthMask(false);
RenderSystem.enableTexture();
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
@ -173,8 +172,6 @@ public class BetterEndSkyRenderer implements DimensionRenderingRegistry.SkyRende
); );
} }
RenderSystem.disableTexture();
if (blindA > 0) { if (blindA > 0) {
matrices.pushPose(); matrices.pushPose();
matrices.mulPose(new Quaternionf().setAngleAxis(time3, axis1.x, axis1.y, axis1.z)); matrices.mulPose(new Quaternionf().setAngleAxis(time3, axis1.x, axis1.y, axis1.z));
@ -196,7 +193,6 @@ public class BetterEndSkyRenderer implements DimensionRenderingRegistry.SkyRende
matrices.popPose(); matrices.popPose();
} }
RenderSystem.enableTexture();
RenderSystem.depthMask(true); RenderSystem.depthMask(true);
RenderSystem.defaultBlendFunc(); RenderSystem.defaultBlendFunc();
RenderSystem.disableBlend(); RenderSystem.disableBlend();

View file

@ -10,12 +10,12 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis; import com.mojang.math.Axis;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.client.resources.model.BakedModel; import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
@ -90,7 +90,7 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
minecraft.getItemRenderer() minecraft.getItemRenderer()
.render( .render(
activeItem, activeItem,
ItemTransforms.TransformType.GROUND, ItemDisplayContext.GROUND,
false, false,
matrices, matrices,
vertexConsumers, vertexConsumers,

View file

@ -41,7 +41,9 @@ import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
import org.joml.Vector3d; import org.joml.Vector3d;
import java.util.*; import java.util.Collections;
import java.util.List;
import java.util.Optional;
public class CommandRegistry { public class CommandRegistry {
public static void register() { public static void register() {
@ -62,45 +64,18 @@ public class CommandRegistry {
) )
.then(Commands.literal("tpnext") .then(Commands.literal("tpnext")
.requires(source -> source.hasPermission(Commands.LEVEL_OWNERS)) .requires(source -> source.hasPermission(Commands.LEVEL_OWNERS))
.executes(ctx -> teleportToNextBiome(ctx)) .executes(CommandRegistry::teleportToNextBiome)
) )
); );
} }
private static final Map<Holder<Biome>, BlockState> biomeMap = new HashMap<>();
private static final int biomeMapIdx = 0;
private static final BlockState[] states = {
Blocks.RED_STAINED_GLASS.defaultBlockState(),
Blocks.BLUE_STAINED_GLASS.defaultBlockState(),
Blocks.YELLOW_STAINED_GLASS.defaultBlockState(),
Blocks.LIME_STAINED_GLASS.defaultBlockState(),
Blocks.PINK_STAINED_GLASS.defaultBlockState(),
Blocks.GREEN_STAINED_GLASS.defaultBlockState(),
Blocks.WHITE_STAINED_GLASS.defaultBlockState(),
Blocks.BLACK_STAINED_GLASS.defaultBlockState(),
Blocks.ORANGE_STAINED_GLASS.defaultBlockState(),
Blocks.LIGHT_BLUE_STAINED_GLASS.defaultBlockState()
};
private static final BlockState[] states2 = {
Blocks.RED_CONCRETE.defaultBlockState(),
Blocks.BLUE_CONCRETE.defaultBlockState(),
Blocks.YELLOW_CONCRETE.defaultBlockState(),
Blocks.LIME_CONCRETE.defaultBlockState(),
Blocks.PINK_CONCRETE.defaultBlockState(),
Blocks.GREEN_CONCRETE.defaultBlockState(),
Blocks.WHITE_CONCRETE.defaultBlockState(),
Blocks.BLACK_CONCRETE.defaultBlockState(),
Blocks.ORANGE_CONCRETE.defaultBlockState(),
Blocks.LIGHT_BLUE_CONCRETE.defaultBlockState()
};
private static int find_poi(CommandContext<CommandSourceStack> ctx, BCLPoiType poi) throws CommandSyntaxException { private static int find_poi(CommandContext<CommandSourceStack> ctx, BCLPoiType poi) throws CommandSyntaxException {
final CommandSourceStack source = ctx.getSource(); final CommandSourceStack source = ctx.getSource();
final ServerPlayer player = source.getPlayerOrException(); final ServerPlayer player = source.getPlayerOrException();
Vec3 pos = source.getPosition(); Vec3 pos = source.getPosition();
final ServerLevel level = source.getLevel(); final ServerLevel level = source.getLevel();
MutableBlockPos mPos = new BlockPos(pos).mutable(); MutableBlockPos mPos = new BlockPos((int) pos.x, (int) pos.y, (int) pos.z).mutable();
System.out.println("Searching POI: " + poi.key); System.out.println("Searching POI: " + poi.key);
Optional<BlockPos> found = poi.findPoiAround(level, mPos, false, level.getWorldBorder()); Optional<BlockPos> found = poi.findPoiAround(level, mPos, false, level.getWorldBorder());
System.out.println("Found at: " + found.orElse(null)); System.out.println("Found at: " + found.orElse(null));
@ -119,9 +94,7 @@ public class CommandRegistry {
private static final int SAMPLE_RESOLUTION_HORIZONTAL = 32; private static final int SAMPLE_RESOLUTION_HORIZONTAL = 32;
private static final int SAMPLE_RESOLUTION_VERTICAL = 64; private static final int SAMPLE_RESOLUTION_VERTICAL = 64;
private static final DynamicCommandExceptionType ERROR_BIOME_NOT_FOUND = new DynamicCommandExceptionType( private static final DynamicCommandExceptionType ERROR_BIOME_NOT_FOUND = new DynamicCommandExceptionType(
(object) -> { (object) -> Component.literal("The next biome (" + object + ") was not found."));
return Component.literal("The next biome (" + object + ") was not found.");
});
private static int teleportToNextBiome(CommandContext<CommandSourceStack> ctx) throws CommandSyntaxException { private static int teleportToNextBiome(CommandContext<CommandSourceStack> ctx) throws CommandSyntaxException {
final CommandSourceStack source = ctx.getSource(); final CommandSourceStack source = ctx.getSource();
@ -137,7 +110,11 @@ public class CommandRegistry {
.setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GREEN)), false); .setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GREEN)), false);
biomeIndex = (biomeIndex + 1) % biomes.size(); biomeIndex = (biomeIndex + 1) % biomes.size();
final BlockPos currentPosition = new BlockPos(source.getPosition()); final BlockPos currentPosition = new BlockPos(
(int) source.getPosition().x,
(int) source.getPosition().y,
(int) source.getPosition().z
);
final BlockPos biomePosition = source.getLevel() final BlockPos biomePosition = source.getLevel()
.findClosestBiome3d( .findClosestBiome3d(
b -> b.unwrapKey().orElseThrow().location().equals(biome.getID()), b -> b.unwrapKey().orElseThrow().location().equals(biome.getID()),
@ -158,7 +135,7 @@ public class CommandRegistry {
double yPos = source.getPosition().y(); double yPos = source.getPosition().y();
boolean didWrap = false; boolean didWrap = false;
do { do {
target = new BlockPos(biomePosition.getX(), yPos, biomePosition.getZ()); target = new BlockPos(biomePosition.getX(), (int) yPos, biomePosition.getZ());
state = player.level.getBlockState(target); state = player.level.getBlockState(target);
yPos--; yPos--;
if (yPos <= player.level.getMinBuildHeight() + 1) { if (yPos <= player.level.getMinBuildHeight() + 1) {

View file

@ -3,7 +3,6 @@ package org.betterx.betterend.complexmaterials;
import org.betterx.bclib.recipes.BCLRecipeBuilder; import org.betterx.bclib.recipes.BCLRecipeBuilder;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.BuiltInRegistries;
@ -43,7 +42,6 @@ public class ColoredMaterial {
EndBlocks.registerBlock(blockName, block); EndBlocks.registerBlock(blockName, block);
if (craftEight) { if (craftEight) {
BCLRecipeBuilder.crafting(BetterEnd.makeID(blockName), block) BCLRecipeBuilder.crafting(BetterEnd.makeID(blockName), block)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(8) .setOutputCount(8)
.setShape("###", "#D#", "###") .setShape("###", "#D#", "###")
.addMaterial('#', source) .addMaterial('#', source)
@ -51,7 +49,6 @@ public class ColoredMaterial {
.build(); .build();
} else { } else {
BCLRecipeBuilder.crafting(BetterEnd.makeID(blockName), block) BCLRecipeBuilder.crafting(BetterEnd.makeID(blockName), block)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("#D") .setList("#D")
.addMaterial('#', source) .addMaterial('#', source)
.addMaterial('D', dyes.get(color)) .addMaterial('D', dyes.get(color))

View file

@ -8,7 +8,6 @@ import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.EndPedestal; import org.betterx.betterend.blocks.EndPedestal;
import org.betterx.betterend.blocks.basis.LitBaseBlock; import org.betterx.betterend.blocks.basis.LitBaseBlock;
import org.betterx.betterend.blocks.basis.LitPillarBlock; import org.betterx.betterend.blocks.basis.LitPillarBlock;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.recipe.CraftingRecipes; import org.betterx.betterend.recipe.CraftingRecipes;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.worlds.together.tag.v3.TagManager; import org.betterx.worlds.together.tag.v3.TagManager;
@ -48,56 +47,48 @@ public class CrystalSubblocksMaterial {
// Recipes // // Recipes //
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks"), bricks) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks"), bricks)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', source) .addMaterial('#', source)
.setGroup("end_bricks") .setGroup("end_bricks")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_polished"), polished) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_polished"), polished)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', bricks) .addMaterial('#', bricks)
.setGroup("end_tile") .setGroup("end_tile")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tiles"), tiles) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tiles"), tiles)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', polished) .addMaterial('#', polished)
.setGroup("end_small_tile") .setGroup("end_small_tile")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pillar"), pillar) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pillar"), pillar)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("#", "#") .setShape("#", "#")
.addMaterial('#', slab) .addMaterial('#', slab)
.setGroup("end_pillar") .setGroup("end_pillar")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.addMaterial('#', source) .addMaterial('#', source)
.setGroup("end_stone_stairs") .setGroup("end_stone_stairs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###") .setShape("###")
.addMaterial('#', source) .addMaterial('#', source)
.setGroup("end_stone_slabs") .setGroup("end_stone_slabs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_stairs"), brick_stairs) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_stairs"), brick_stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.addMaterial('#', bricks) .addMaterial('#', bricks)
.setGroup("end_stone_stairs") .setGroup("end_stone_stairs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_slab"), brick_slab) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_slab"), brick_slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###") .setShape("###")
.addMaterial('#', bricks) .addMaterial('#', bricks)
@ -105,14 +96,12 @@ public class CrystalSubblocksMaterial {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_wall"), wall) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_wall"), wall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###", "###") .setShape("###", "###")
.addMaterial('#', source) .addMaterial('#', source)
.setGroup("end_wall") .setGroup("end_wall")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_wall"), brick_wall) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_wall"), brick_wall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###", "###") .setShape("###", "###")
.addMaterial('#', bricks) .addMaterial('#', bricks)

View file

@ -2,7 +2,6 @@ package org.betterx.betterend.complexmaterials;
import org.betterx.bclib.complexmaterials.WoodenComplexMaterial; import org.betterx.bclib.complexmaterials.WoodenComplexMaterial;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
@ -21,8 +20,7 @@ public class EndWoodenComplexMaterial extends WoodenComplexMaterial {
public EndWoodenComplexMaterial init() { public EndWoodenComplexMaterial init() {
return (EndWoodenComplexMaterial) super.init( return (EndWoodenComplexMaterial) super.init(
EndBlocks.getBlockRegistry(), EndBlocks.getBlockRegistry(),
EndItems.getItemRegistry(), EndItems.getItemRegistry()
Configs.RECIPE_CONFIG
); );
} }

View file

@ -12,7 +12,6 @@ import org.betterx.betterend.blocks.BulbVineLanternBlock;
import org.betterx.betterend.blocks.BulbVineLanternColoredBlock; import org.betterx.betterend.blocks.BulbVineLanternColoredBlock;
import org.betterx.betterend.blocks.ChandelierBlock; import org.betterx.betterend.blocks.ChandelierBlock;
import org.betterx.betterend.blocks.basis.EndAnvilBlock; import org.betterx.betterend.blocks.basis.EndAnvilBlock;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.item.EndArmorItem; import org.betterx.betterend.item.EndArmorItem;
import org.betterx.betterend.item.tool.EndHammerItem; import org.betterx.betterend.item.tool.EndHammerItem;
import org.betterx.betterend.item.tool.EndPickaxe; import org.betterx.betterend.item.tool.EndPickaxe;
@ -23,16 +22,13 @@ import org.betterx.worlds.together.tag.v3.TagManager;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags; import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey; import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.*;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Item.Properties; import net.minecraft.world.item.Item.Properties;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.Tier;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.properties.BlockSetType;
import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
@ -190,11 +186,14 @@ public class MetalMaterial {
tile = EndBlocks.registerBlock(name + "_tile", new BaseBlock(settings)); tile = EndBlocks.registerBlock(name + "_tile", new BaseBlock(settings));
stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(tile)); stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(tile));
slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(tile)); slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(tile));
door = EndBlocks.registerBlock(name + "_door", new BaseDoorBlock(block)); door = EndBlocks.registerBlock(name + "_door", new BaseDoorBlock(block, BlockSetType.IRON));
trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BaseTrapdoorBlock(block)); trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BaseTrapdoorBlock(block, BlockSetType.IRON));
bars = EndBlocks.registerBlock(name + "_bars", new BaseMetalBarsBlock(block)); bars = EndBlocks.registerBlock(name + "_bars", new BaseMetalBarsBlock(block));
chain = EndBlocks.registerBlock(name + "_chain", new BaseChainBlock(block.defaultMaterialColor())); chain = EndBlocks.registerBlock(name + "_chain", new BaseChainBlock(block.defaultMaterialColor()));
pressurePlate = EndBlocks.registerBlock(name + "_plate", new WoodenPressurePlateBlock(block)); pressurePlate = EndBlocks.registerBlock(
name + "_plate",
new WoodenPressurePlateBlock(block, BlockSetType.IRON)
);
chandelier = EndBlocks.registerBlock(name + "_chandelier", new ChandelierBlock(block)); chandelier = EndBlocks.registerBlock(name + "_chandelier", new ChandelierBlock(block));
bulb_lantern = EndBlocks.registerBlock(name + "_bulb_lantern", new BulbVineLanternBlock(lanternProperties)); bulb_lantern = EndBlocks.registerBlock(name + "_bulb_lantern", new BulbVineLanternBlock(lanternProperties));
@ -221,16 +220,19 @@ public class MetalMaterial {
); );
forgedPlate = EndItems.registerEndItem(name + "_forged_plate"); forgedPlate = EndItems.registerEndItem(name + "_forged_plate");
helmet = EndItems.registerEndItem(name + "_helmet", new EndArmorItem(armor, EquipmentSlot.HEAD, itemSettings)); helmet = EndItems.registerEndItem(
name + "_helmet",
new EndArmorItem(armor, ArmorItem.Type.HELMET, itemSettings)
);
chestplate = EndItems.registerEndItem( chestplate = EndItems.registerEndItem(
name + "_chestplate", name + "_chestplate",
new EndArmorItem(armor, EquipmentSlot.CHEST, itemSettings) new EndArmorItem(armor, ArmorItem.Type.CHESTPLATE, itemSettings)
); );
leggings = EndItems.registerEndItem( leggings = EndItems.registerEndItem(
name + "_leggings", name + "_leggings",
new EndArmorItem(armor, EquipmentSlot.LEGS, itemSettings) new EndArmorItem(armor, ArmorItem.Type.LEGGINGS, itemSettings)
); );
boots = EndItems.registerEndItem(name + "_boots", new EndArmorItem(armor, EquipmentSlot.FEET, itemSettings)); boots = EndItems.registerEndItem(name + "_boots", new EndArmorItem(armor, ArmorItem.Type.BOOTS, itemSettings));
anvilBlock = EndBlocks.registerBlock( anvilBlock = EndBlocks.registerBlock(
name + "_anvil", name + "_anvil",
@ -239,17 +241,12 @@ public class MetalMaterial {
if (hasOre) { if (hasOre) {
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_ingot_furnace_ore"), ingot) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_ingot_furnace_ore"), ingot)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(ore)
.setInput(ore)
.setGroup("end_ingot")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_ingot_furnace_raw"), ingot) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_ingot_furnace_raw"), ingot)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(rawOre)
.setInput(rawOre)
.setGroup("end_ingot")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.alloying(BetterEnd.makeID(name + "_ingot_alloy"), ingot) BCLRecipeBuilder.alloying(BetterEnd.makeID(name + "_ingot_alloy"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(alloyingOre, alloyingOre) .setInput(alloyingOre, alloyingOre)
.setOutputCount(3) .setOutputCount(3)
.setExperience(2.1F) .setExperience(2.1F)
@ -258,96 +255,82 @@ public class MetalMaterial {
// Basic recipes // Basic recipes
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_ingot_from_nuggets"), ingot) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_ingot_from_nuggets"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###") .setShape("###", "###", "###")
.addMaterial('#', nugget) .addMaterial('#', nugget)
.setGroup("end_metal_ingots_nug") .setGroup("end_metal_ingots_nug")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_nuggets_from_ingot"), nugget) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_nuggets_from_ingot"), nugget)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .shapeless()
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_nuggets_ing") .setGroup("end_metal_nuggets_ing")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_block"), block) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_block"), block)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###") .setShape("###", "###", "###")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_blocks") .setGroup("end_metal_blocks")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_ingot_from_block"), ingot) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_ingot_from_block"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .shapeless()
.addMaterial('#', block) .addMaterial('#', block)
.setGroup("end_metal_ingots") .setGroup("end_metal_ingots")
.build(); .build();
// Block recipes // Block recipes
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tile"), tile) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tile"), tile)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', block) .addMaterial('#', block)
.setGroup("end_metal_tiles") .setGroup("end_metal_tiles")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bars"), bars) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bars"), bars)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(16) .setOutputCount(16)
.setShape("###", "###") .setShape("###", "###")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_bars") .setGroup("end_metal_bars")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pressure_plate"), pressurePlate) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pressure_plate"), pressurePlate)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##") .setShape("##")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_plates") .setGroup("end_metal_plates")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_door"), door) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_door"), door)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(3) .setOutputCount(3)
.setShape("##", "##", "##") .setShape("##", "##", "##")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_doors") .setGroup("end_metal_doors")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_trapdoor"), trapdoor) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_trapdoor"), trapdoor)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_trapdoors") .setGroup("end_metal_trapdoors")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.addMaterial('#', block, tile) .addMaterial('#', block, tile)
.setGroup("end_metal_stairs") .setGroup("end_metal_stairs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###") .setShape("###")
.addMaterial('#', block, tile) .addMaterial('#', block, tile)
.setGroup("end_metal_slabs") .setGroup("end_metal_slabs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chain"), chain) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chain"), chain)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("N", "#", "N") .setShape("N", "#", "N")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.addMaterial('N', nugget) .addMaterial('N', nugget)
.setGroup("end_metal_chain") .setGroup("end_metal_chain")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_anvil"), anvilBlock) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_anvil"), anvilBlock)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", " I ", "III") .setShape("###", " I ", "III")
.addMaterial('#', block, tile) .addMaterial('#', block, tile)
.addMaterial('I', ingot) .addMaterial('I', ingot)
.setGroup("end_metal_anvil") .setGroup("end_metal_anvil")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bulb_lantern"), bulb_lantern) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bulb_lantern"), bulb_lantern)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("C", "I", "#") .setShape("C", "I", "#")
.addMaterial('C', chain) .addMaterial('C', chain)
.addMaterial('I', ingot) .addMaterial('I', ingot)
@ -355,7 +338,6 @@ public class MetalMaterial {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chandelier"), chandelier) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chandelier"), chandelier)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("I#I", " # ") .setShape("I#I", " # ")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.addMaterial('I', EndItems.LUMECORN_ROD) .addMaterial('I', EndItems.LUMECORN_ROD)
@ -363,85 +345,70 @@ public class MetalMaterial {
.build(); .build();
// Tools & armor into nuggets // Tools & armor into nuggets
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_axe_nugget"), nugget).setInput(axe) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_axe_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(axe)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hoe_nugget"), nugget).setInput(hoe) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hoe_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(hoe)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_pickaxe_nugget"), nugget).setInput(pickaxe) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_pickaxe_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(pickaxe)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_sword_nugget"), nugget).setInput(sword) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_sword_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(sword)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hammer_nugget"), nugget).setInput(hammer) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hammer_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(hammer)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_helmet_nugget"), nugget).setInput(helmet) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_helmet_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(helmet)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_chestplate_nugget"), nugget).setInput(chestplate) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_chestplate_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(chestplate)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_leggings_nugget"), nugget).setInput(leggings) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_leggings_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(leggings)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_boots_nugget"), nugget).setInput(boots) BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_boots_nugget"), nugget)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(boots)
.setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
// Tool parts from ingots // Tool parts from ingots
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_shovel_head"), shovelHead) BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_shovel_head"), shovelHead)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInput(ingot)
.setInput(ingot)
.setAnvilLevel(anvilAndToolLevel) .setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_pickaxe_head"), pickaxeHead) BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_pickaxe_head"), pickaxeHead)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInput(ingot)
.setInput(ingot)
.setInputCount(3) .setInputCount(3)
.setAnvilLevel(anvilAndToolLevel) .setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_axe_head"), axeHead) BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_axe_head"), axeHead)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInput(ingot)
.setInput(ingot)
.setInputCount(3) .setInputCount(3)
.setAnvilLevel(anvilAndToolLevel) .setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_hoe_head"), hoeHead) BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_hoe_head"), hoeHead)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInput(ingot)
.setInput(ingot)
.setInputCount(2) .setInputCount(2)
.setAnvilLevel(anvilAndToolLevel) .setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_sword_blade"), swordBlade) BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_sword_blade"), swordBlade)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInput(ingot)
.setInput(ingot)
.setAnvilLevel(anvilAndToolLevel) .setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_forged_plate"), forgedPlate) BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_forged_plate"), forgedPlate)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInput(ingot)
.setInput(ingot)
.setAnvilLevel(anvilAndToolLevel) .setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
@ -449,62 +416,51 @@ public class MetalMaterial {
// Tools from parts // Tools from parts
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_hammer"), hammer) BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_hammer"), hammer)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(block)
.setBase(block)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_axe"), axe) BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_axe"), axe)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(axeHead)
.setBase(axeHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_pickaxe"), pickaxe) BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_pickaxe"), pickaxe)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(pickaxeHead)
.setBase(pickaxeHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_hoe"), hoe) BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_hoe"), hoe)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(hoeHead)
.setBase(hoeHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_sword_handle"), swordHandle) BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_sword_handle"), swordHandle)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(ingot)
.setBase(ingot)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_sword"), sword) BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_sword"), sword)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(swordBlade)
.setBase(swordBlade)
.setAddition(swordHandle) .setAddition(swordHandle)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_shovel"), shovel) BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_shovel"), shovel)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(shovelHead)
.setBase(shovelHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
// Armor crafting // Armor crafting
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_helmet"), helmet) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_helmet"), helmet)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #") .setShape("###", "# #")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_helmets") .setGroup("end_metal_helmets")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chestplate"), chestplate) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chestplate"), chestplate)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("# #", "###", "###") .setShape("# #", "###", "###")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_chestplates") .setGroup("end_metal_chestplates")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_leggings"), leggings) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_leggings"), leggings)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #", "# #") .setShape("###", "# #", "# #")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_leggings") .setGroup("end_metal_leggings")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_boots"), boots) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_boots"), boots)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("# #", "# #") .setShape("# #", "# #")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_boots") .setGroup("end_metal_boots")

View file

@ -6,7 +6,6 @@ import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.EndPedestal; import org.betterx.betterend.blocks.EndPedestal;
import org.betterx.betterend.blocks.FlowerPotBlock; import org.betterx.betterend.blocks.FlowerPotBlock;
import org.betterx.betterend.blocks.basis.StoneLanternBlock; import org.betterx.betterend.blocks.basis.StoneLanternBlock;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.recipe.CraftingRecipes; import org.betterx.betterend.recipe.CraftingRecipes;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
@ -18,6 +17,7 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags; import net.minecraft.tags.ItemTags;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.properties.BlockSetType;
import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
@ -59,8 +59,11 @@ public class StoneMaterial {
stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(stone)); stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(stone));
slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(stone)); slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(stone));
wall = EndBlocks.registerBlock(name + "_wall", new BaseWallBlock(stone)); wall = EndBlocks.registerBlock(name + "_wall", new BaseWallBlock(stone));
button = EndBlocks.registerBlock(name + "_button", new BaseStoneButtonBlock(stone)); button = EndBlocks.registerBlock(name + "_button", new BaseStoneButtonBlock(stone, BlockSetType.STONE));
pressurePlate = EndBlocks.registerBlock(name + "_plate", new StonePressurePlateBlock(stone)); pressurePlate = EndBlocks.registerBlock(
name + "_plate",
new StonePressurePlateBlock(stone, BlockSetType.STONE)
);
pedestal = EndBlocks.registerBlock(name + "_pedestal", new EndPedestal(stone)); pedestal = EndBlocks.registerBlock(name + "_pedestal", new EndPedestal(stone));
lantern = EndBlocks.registerBlock(name + "_lantern", new StoneLanternBlock(stone)); lantern = EndBlocks.registerBlock(name + "_lantern", new StoneLanternBlock(stone));
@ -73,56 +76,48 @@ public class StoneMaterial {
// Recipes // // Recipes //
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks"), bricks) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks"), bricks)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', stone) .addMaterial('#', stone)
.setGroup("end_bricks") .setGroup("end_bricks")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_polished"), polished) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_polished"), polished)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', bricks) .addMaterial('#', bricks)
.setGroup("end_tile") .setGroup("end_tile")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tiles"), tiles) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tiles"), tiles)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', polished) .addMaterial('#', polished)
.setGroup("end_small_tile") .setGroup("end_small_tile")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pillar"), pillar) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pillar"), pillar)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("#", "#") .setShape("#", "#")
.addMaterial('#', slab) .addMaterial('#', slab)
.setGroup("end_pillar") .setGroup("end_pillar")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.addMaterial('#', stone) .addMaterial('#', stone)
.setGroup("end_stone_stairs") .setGroup("end_stone_stairs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###") .setShape("###")
.addMaterial('#', stone) .addMaterial('#', stone)
.setGroup("end_stone_slabs") .setGroup("end_stone_slabs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_stairs"), brickStairs) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_stairs"), brickStairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.addMaterial('#', bricks) .addMaterial('#', bricks)
.setGroup("end_stone_stairs") .setGroup("end_stone_stairs")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_slab"), brickSlab) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_slab"), brickSlab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###") .setShape("###")
.addMaterial('#', bricks) .addMaterial('#', bricks)
@ -130,14 +125,12 @@ public class StoneMaterial {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_wall"), wall) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_wall"), wall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###", "###") .setShape("###", "###")
.addMaterial('#', stone) .addMaterial('#', stone)
.setGroup("end_wall") .setGroup("end_wall")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_wall"), brickWall) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_wall"), brickWall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###", "###") .setShape("###", "###")
.addMaterial('#', bricks) .addMaterial('#', bricks)
@ -145,32 +138,27 @@ public class StoneMaterial {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_button"), button) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_button"), button)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', stone) .addMaterial('#', stone)
.setGroup("end_stone_buttons") .setGroup("end_stone_buttons")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pressure_plate"), pressurePlate) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pressure_plate"), pressurePlate)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##") .setShape("##")
.addMaterial('#', stone) .addMaterial('#', stone)
.setGroup("end_stone_plates") .setGroup("end_stone_plates")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_lantern"), lantern) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_lantern"), lantern)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("S", "#", "S") .setShape("S", "#", "S")
.addMaterial('#', EndItems.CRYSTAL_SHARDS) .addMaterial('#', EndItems.CRYSTAL_SHARDS)
.addMaterial('S', slab, brickSlab) .addMaterial('S', slab, brickSlab)
.setGroup("end_stone_lanterns") .setGroup("end_stone_lanterns")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_furnace"), furnace) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_furnace"), furnace)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #", "###") .setShape("###", "# #", "###")
.addMaterial('#', stone) .addMaterial('#', stone)
.setGroup("end_stone_ITEM_FURNACES") .setGroup("end_stone_ITEM_FURNACES")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_flower_pot"), flowerPot) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_flower_pot"), flowerPot)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(3) .setOutputCount(3)
.setShape("# #", " # ") .setShape("# #", " # ")
.addMaterial('#', bricks) .addMaterial('#', bricks)
@ -206,8 +194,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_bricks_stonecutting"), BetterEnd.makeID(mat.baseName + "_bricks_stonecutting"),
mat.bricks mat.bricks
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -216,8 +203,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_wall_stonecutting"), BetterEnd.makeID(mat.baseName + "_wall_stonecutting"),
mat.wall mat.wall
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -226,8 +212,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_slab_stonecutting"), BetterEnd.makeID(mat.baseName + "_slab_stonecutting"),
mat.slab mat.slab
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -236,8 +221,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_stairs_stonecutting"), BetterEnd.makeID(mat.baseName + "_stairs_stonecutting"),
mat.stairs mat.stairs
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -246,8 +230,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_tiles_stonecutting"), BetterEnd.makeID(mat.baseName + "_tiles_stonecutting"),
mat.tiles mat.tiles
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -257,8 +240,7 @@ public class StoneMaterial {
mat.brickSlab mat.brickSlab
) )
.setOutputCount(2) .setOutputCount(2)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -267,8 +249,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_stair_stonecutting"), BetterEnd.makeID(mat.baseName + "_brick_stair_stonecutting"),
mat.brickStairs mat.brickStairs
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -277,8 +258,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_wall_stonecutting"), BetterEnd.makeID(mat.baseName + "_brick_wall_stonecutting"),
mat.brickWall mat.brickWall
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -287,8 +267,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_pillar_stonecutting"), BetterEnd.makeID(mat.baseName + "_pillar_stonecutting"),
mat.pillar mat.pillar
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -297,8 +276,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_polished_stonecutting"), BetterEnd.makeID(mat.baseName + "_polished_stonecutting"),
mat.polished mat.polished
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.stone)
.setInput(mat.stone)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -308,8 +286,7 @@ public class StoneMaterial {
mat.brickSlab mat.brickSlab
) )
.setOutputCount(2) .setOutputCount(2)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.bricks)
.setInput(mat.bricks)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -318,8 +295,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_stair_from_" + mat.baseName + "_brick_stonecutting"), BetterEnd.makeID(mat.baseName + "_brick_stair_from_" + mat.baseName + "_brick_stonecutting"),
mat.brickStairs mat.brickStairs
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.bricks)
.setInput(mat.bricks)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
@ -328,8 +304,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_wall_from_" + mat.baseName + "_brick_stonecutting"), BetterEnd.makeID(mat.baseName + "_brick_wall_from_" + mat.baseName + "_brick_stonecutting"),
mat.brickWall mat.brickWall
) )
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(mat.bricks)
.setInput(mat.bricks)
.setGroup(mat.baseName + "_stonecutting") .setGroup(mat.baseName + "_stonecutting")
.build(); .build();
} }

View file

@ -142,7 +142,7 @@ public class CubozoaEntity extends AbstractSchoolingFish {
@Override @Override
public void playerTouch(Player player) { public void playerTouch(Player player) {
if (player instanceof ServerPlayer && player.hurt(DamageSource.mobAttack(this), 0.5F)) { if (player instanceof ServerPlayer && player.hurt(player.damageSources().mobAttack(this), 0.5F)) {
if (!this.isSilent()) { if (!this.isSilent()) {
((ServerPlayer) player).connection.send(new ClientboundGameEventPacket( ((ServerPlayer) player).connection.send(new ClientboundGameEventPacket(
ClientboundGameEventPacket.PUFFER_FISH_STING, ClientboundGameEventPacket.PUFFER_FISH_STING,

View file

@ -150,7 +150,7 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
public void start() { public void start() {
Vec3 vec3d = this.getRandomLocation(); Vec3 vec3d = this.getRandomLocation();
if (vec3d != null) { if (vec3d != null) {
BlockPos pos = new BlockPos(vec3d); BlockPos pos = new BlockPos((int) vec3d.x, (int) vec3d.y, (int) vec3d.z);
try { try {
Path path = DragonflyEntity.this.navigation.createPath(pos, 1); Path path = DragonflyEntity.this.navigation.createPath(pos, 1);
if (path != null) { if (path != null) {
@ -202,7 +202,11 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
} }
private boolean isInVoid(Vec3 pos) { private boolean isInVoid(Vec3 pos) {
int h = BlocksHelper.downRay(DragonflyEntity.this.level, new BlockPos(pos), 128); int h = BlocksHelper.downRay(
DragonflyEntity.this.level,
new BlockPos((int) pos.x, (int) pos.y, (int) pos.z),
128
);
return h > 100; return h > 100;
} }
} }

View file

@ -11,10 +11,10 @@ import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.tags.DamageTypeTags;
import net.minecraft.world.DifficultyInstance; import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.EntityDamageSource;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.entity.MobSpawnType;
@ -163,10 +163,9 @@ public class EndFishEntity extends AbstractSchoolingFish {
@Override @Override
protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) { protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) {
Item item = source.isFire() ? EndItems.END_FISH_COOKED : EndItems.END_FISH_RAW; Item item = source.is(DamageTypeTags.IS_FIRE) ? EndItems.END_FISH_COOKED : EndItems.END_FISH_RAW;
if (causedByPlayer && source instanceof EntityDamageSource) { if (causedByPlayer) {
EntityDamageSource damageSource = (EntityDamageSource) source; ItemStack handItem = ((Player) source.getEntity()).getItemInHand(InteractionHand.MAIN_HAND);
ItemStack handItem = ((Player) damageSource.getEntity()).getItemInHand(InteractionHand.MAIN_HAND);
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.FIRE_ASPECT, handItem) > 0) { if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.FIRE_ASPECT, handItem) > 0) {
item = EndItems.END_FISH_COOKED; item = EndItems.END_FISH_COOKED;
} }

View file

@ -64,11 +64,16 @@ public class EndSlimeEntity extends Slime {
this.goalSelector.addGoal(5, new MoveGoal()); this.goalSelector.addGoal(5, new MoveGoal());
this.targetSelector.addGoal( this.targetSelector.addGoal(
1, 1,
new NearestAttackableTargetGoal<Player>(this, Player.class, 10, true, false, (livingEntity) -> { new NearestAttackableTargetGoal<>(
return Math.abs(livingEntity.getY() - this.getY()) <= 4.0D; this,
}) Player.class,
10,
true,
false,
(livingEntity) -> Math.abs(livingEntity.getY() - this.getY()) <= 4.0D
)
); );
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<IronGolem>(this, IronGolem.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
} }
public static AttributeSupplier.Builder createMobAttributes() { public static AttributeSupplier.Builder createMobAttributes() {
@ -270,7 +275,11 @@ public class EndSlimeEntity extends Slime {
if (speed > 0.1) { if (speed > 0.1) {
float dx = Mth.sin(-yaw * 0.017453292F); float dx = Mth.sin(-yaw * 0.017453292F);
float dz = Mth.cos(-yaw * 0.017453292F); float dz = Mth.cos(-yaw * 0.017453292F);
BlockPos pos = EndSlimeEntity.this.blockPosition().offset(dx * speed * 4, 0, dz * speed * 4); BlockPos pos = EndSlimeEntity.this.blockPosition().offset(
(int) (dx * speed * 4),
0,
(int) (dz * speed * 4)
);
int down = BlocksHelper.downRay(EndSlimeEntity.this.level, pos, 16); int down = BlocksHelper.downRay(EndSlimeEntity.this.level, pos, 16);
return down < 5; return down < 5;
} }

View file

@ -220,7 +220,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
if (vec3d != null) { if (vec3d != null) {
try { try {
SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath( SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath(
new BlockPos(vec3d), new BlockPos((int) vec3d.x, (int) vec3d.y, (int) vec3d.z),
1 1
), 1.0D); ), 1.0D);
} catch (Exception e) { } catch (Exception e) {

View file

@ -4,7 +4,6 @@ import org.betterx.bclib.api.v2.ModIntegrationAPI;
import org.betterx.bclib.integration.ModIntegration; import org.betterx.bclib.integration.ModIntegration;
import org.betterx.bclib.recipes.BCLRecipeBuilder; import org.betterx.bclib.recipes.BCLRecipeBuilder;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.events.PlayerAdvancementsCallback; import org.betterx.betterend.events.PlayerAdvancementsCallback;
import org.betterx.betterend.integration.byg.BYGIntegration; import org.betterx.betterend.integration.byg.BYGIntegration;
import org.betterx.betterend.item.GuideBookItem; import org.betterx.betterend.item.GuideBookItem;
@ -35,7 +34,6 @@ public class Integrations {
}); });
BCLRecipeBuilder.crafting(BetterEnd.makeID("guide_book"), GuideBookItem.GUIDE_BOOK) BCLRecipeBuilder.crafting(BetterEnd.makeID("guide_book"), GuideBookItem.GUIDE_BOOK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("D", "B", "C") .setShape("D", "B", "C")
.addMaterial('D', EndItems.ENDER_DUST) .addMaterial('D', EndItems.ENDER_DUST)
.addMaterial('B', Items.BOOK) .addMaterial('B', Items.BOOK)

View file

@ -26,11 +26,11 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import com.google.common.base.Function;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.joml.Vector3f; import org.joml.Vector3f;
import java.util.List; import java.util.List;
import java.util.function.Function;
public class NightshadeRedwoodTreeFeature extends DefaultFeature { public class NightshadeRedwoodTreeFeature extends DefaultFeature {
private static final List<Vector3f> BRANCH; private static final List<Vector3f> BRANCH;
@ -47,23 +47,17 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
BlockState leaves = Integrations.BYG.getDefaultState("nightshade_leaves"); BlockState leaves = Integrations.BYG.getDefaultState("nightshade_leaves");
BlockState leaves_flower = Integrations.BYG.getDefaultState("flowering_nightshade_leaves"); BlockState leaves_flower = Integrations.BYG.getDefaultState("flowering_nightshade_leaves");
Function<BlockPos, BlockState> splinePlacer = (bpos) -> { Function<BlockPos, BlockState> splinePlacer = (bpos) -> log;
return log; Function<BlockState, Boolean> replace = (state) -> state.is(CommonBlockTags.END_STONES) || state.getMaterial()
}; .equals(Material.PLANT) || state.getMaterial()
Function<BlockState, Boolean> replace = (state) -> { .isReplaceable();
return state.is(CommonBlockTags.END_STONES) || state.getMaterial()
.equals(Material.PLANT) || state.getMaterial()
.isReplaceable();
};
Function<PosInfo, BlockState> post = (info) -> { Function<PosInfo, BlockState> post = (info) -> {
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) { if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
return wood; return wood;
} }
return info.getState(); return info.getState();
}; };
Function<BlockState, Boolean> ignore = (state) -> { Function<BlockState, Boolean> ignore = (state) -> state.equals(log) || state.equals(wood);
return state.equals(log) || state.equals(wood);
};
int height = MHelper.randRange(40, 60, random); int height = MHelper.randRange(40, 60, random);
List<Vector3f> trunk = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, height / 4); List<Vector3f> trunk = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, height / 4);
@ -102,12 +96,12 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
sdf.setReplaceFunction(replace).addPostProcess(post).fillRecursive(world, pos); sdf.setReplaceFunction(replace).addPostProcess(post).fillRecursive(world, pos);
Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F); Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F);
for (int y = 0; y < 8; y++) { for (int y = 0; y < 8; y++) {
BlockPos p = pos.offset(last.x() + 0.5, last.y() + y, last.z() + 0.5); BlockPos p = pos.offset((int) (last.x() + 0.5), (int) (last.y() + y), (int) (last.z() + 0.5));
BlocksHelper.setWithoutUpdate(world, p, y == 4 ? wood : log); BlocksHelper.setWithoutUpdate(world, p, y == 4 ? wood : log);
} }
for (int y = 0; y < 16; y++) { for (int y = 0; y < 16; y++) {
BlockPos p = pos.offset(last.x() + 0.5, last.y() + y, last.z() + 0.5); BlockPos p = pos.offset((int) (last.x() + 0.5), (int) (last.y() + y), (int) (last.z() + 0.5));
if (world.isEmptyBlock(p)) { if (world.isEmptyBlock(p)) {
BlocksHelper.setWithoutUpdate(world, p, leaves); BlocksHelper.setWithoutUpdate(world, p, leaves);
} }
@ -162,8 +156,8 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
if (distance > MHelper.randRange(2, 4, random)) { if (distance > MHelper.randRange(2, 4, random)) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
} }
int airCount = 0;
for (Direction d : BlocksHelper.DIRECTIONS) { for (Direction d : BlocksHelper.DIRECTIONS) {
int airCount = 0;
if (info.getState(d).isAir()) { if (info.getState(d).isAir()) {
airCount++; airCount++;
} }
@ -179,12 +173,10 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
}; };
SDF canopy = new SDFCappedCone().setRadius1(12F).setRadius2(1f).setHeight(height * 0.3F).setBlock(leaves); SDF canopy = new SDFCappedCone().setRadius1(12F).setRadius2(1f).setHeight(height * 0.3F).setBlock(leaves);
canopy = new SDFDisplacement().setFunction((vec) -> { canopy = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-3F, 3F, random)).setSource(canopy);
return MHelper.randRange(-3F, 3F, random);
}).setSource(canopy);
canopy.addPostProcess(leavesPost1) canopy.addPostProcess(leavesPost1)
.addPostProcess(leavesPost2) .addPostProcess(leavesPost2)
.fillRecursiveIgnore(world, pos.offset(0, height * 0.75, 0), ignore); .fillRecursiveIgnore(world, pos.offset(0, (int) (height * 0.75), 0), ignore);
return true; return true;
} }

View file

@ -78,15 +78,29 @@ public class OldBulbisTreeFeature extends DefaultFeature {
SplineHelper.offset(spline, new Vector3f(size * random.nextFloat() * 0.3F, 0, 0)); SplineHelper.offset(spline, new Vector3f(size * random.nextFloat() * 0.3F, 0, 0));
SplineHelper.rotateSpline(spline, angle); SplineHelper.rotateSpline(spline, angle);
SplineHelper.offsetParts(spline, random, 1F, 0, 1F);// 1.3F 0.8F SplineHelper.offsetParts(spline, random, 1F, 0, 1F);// 1.3F 0.8F
SDF branch = SplineHelper.buildSDF(spline, 2.3F * addRad, 1.3F * addRad, (bpos) -> { SDF branch = SplineHelper.buildSDF(spline, 2.3F * addRad, 1.3F * addRad, (bpos) -> stem);
return stem;
});
Vector3f vec = spline.get(spline.size() - 1); Vector3f vec = spline.get(spline.size() - 1);
float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.35F; float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.35F;
bigSphere(world, pos.offset(vec.x(), vec.y(), vec.z()), radius, cap, glow, wood, replacement, random); bigSphere(
world,
pos.offset((int) vec.x(), (int) vec.y(), (int) vec.z()),
radius,
cap,
glow,
wood,
replacement,
random
);
vec = SplineHelper.getPos(spline, 0.3F); vec = SplineHelper.getPos(spline, 0.3F);
makeRoots(world, pos.offset(vec.x(), vec.y(), vec.z()), size * 0.4F + 5, random, wood, replacement); makeRoots(
world,
pos.offset((int) vec.x(), (int) vec.y(), (int) vec.z()),
size * 0.4F + 5,
random,
wood,
replacement
);
sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch); sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch);
} }
@ -116,14 +130,18 @@ public class OldBulbisTreeFeature extends DefaultFeature {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap); SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
SDF sphereInner = new SDFSphere().setRadius(radius * 0.53F).setBlock(Blocks.AIR); SDF sphereInner = new SDFSphere().setRadius(radius * 0.53F).setBlock(Blocks.AIR);
sphereInner = new SDFDisplacement().setFunction((vec) -> { sphereInner = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1); vec.x() * 0.1,
}).setSource(sphereInner); vec.y() * 0.1,
vec.z() * 0.1
)).setSource(sphereInner);
SDF sphereGlow = new SDFSphere().setRadius(radius * 0.6F).setBlock(glow); SDF sphereGlow = new SDFSphere().setRadius(radius * 0.6F).setBlock(glow);
sphereGlow = new SDFDisplacement().setFunction((vec) -> { sphereGlow = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1) * 2F; vec.x() * 0.1,
}).setSource(sphereGlow); vec.y() * 0.1,
vec.z() * 0.1
) * 2F).setSource(sphereGlow);
sphereGlow = new SDFSubtraction().setSourceA(sphereGlow).setSourceB(sphereInner); sphereGlow = new SDFSubtraction().setSourceA(sphereGlow).setSourceB(sphereInner);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sphereGlow); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sphereGlow);
@ -150,7 +168,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
List<Vector3f> side = SplineHelper.copySpline(SIDE); List<Vector3f> side = SplineHelper.copySpline(SIDE);
SplineHelper.rotateSpline(side, angle); SplineHelper.rotateSpline(side, angle);
SplineHelper.scale(side, scale * radius); SplineHelper.scale(side, scale * radius);
BlockPos p = pos.offset(point.x() + 0.5F, point.y() + 0.5F, point.z() + 0.5F); BlockPos p = pos.offset((int) (point.x() + 0.5F), (int) (point.y() + 0.5F), (int) (point.z() + 0.5F));
SplineHelper.fillSplineForce(side, world, wood, p, replacement); SplineHelper.fillSplineForce(side, world, wood, p, replacement);
} }
} }
@ -175,7 +193,8 @@ public class OldBulbisTreeFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { if (world.getBlockState(pos.offset((int) last.x(), (int) last.y(), (int) last.z()))
.is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSpline(branch, world, wood, pos, replacement); SplineHelper.fillSpline(branch, world, wood, pos, replacement);
} }
} }

View file

@ -46,7 +46,7 @@ public class EMIInfusionRecipe implements EmiRecipe {
public EMIInfusionRecipe(InfusionRecipe recipe) { public EMIInfusionRecipe(InfusionRecipe recipe) {
this.id = recipe.getId(); this.id = recipe.getId();
this.input = recipe.getIngredients().stream().map(i -> EmiIngredient.of(i)).toList(); this.input = recipe.getIngredients().stream().map(i -> EmiIngredient.of(i)).toList();
this.output = List.of(EmiStack.of(recipe.getResultItem())); this.output = List.of(EmiStack.of(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())));
} }
static void addAllRecipes(EmiRegistry emiRegistry, RecipeManager manager) { static void addAllRecipes(EmiRegistry emiRegistry, RecipeManager manager) {

View file

@ -4,6 +4,7 @@ import org.betterx.bclib.recipes.AlloyingRecipe;
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity; import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
@ -38,7 +39,7 @@ public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDi
protected REIAlloyingDisplay(Recipe<?> recipe, float xp, double smeltTime) { protected REIAlloyingDisplay(Recipe<?> recipe, float xp, double smeltTime) {
super( super(
EntryIngredients.ofIngredients(recipe.getIngredients()), EntryIngredients.ofIngredients(recipe.getIngredients()),
Collections.singletonList(EntryIngredients.of(recipe.getResultItem())) Collections.singletonList(EntryIngredients.of(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())))
); );
this.recipe = recipe; this.recipe = recipe;
this.xp = xp; this.xp = xp;

View file

@ -2,6 +2,7 @@ package org.betterx.betterend.integration.rei;
import org.betterx.bclib.recipes.AnvilRecipe; import org.betterx.bclib.recipes.AnvilRecipe;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.Recipe;
@ -22,7 +23,7 @@ public class REIAnvilDisplay extends BasicDisplay implements SimpleGridMenuDispl
public REIAnvilDisplay(AnvilRecipe recipe) { public REIAnvilDisplay(AnvilRecipe recipe) {
super( super(
EntryIngredients.ofIngredients(recipe.getIngredients()), EntryIngredients.ofIngredients(recipe.getIngredients()),
Collections.singletonList(EntryIngredients.of(recipe.getResultItem())) Collections.singletonList(EntryIngredients.of(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())))
); );
this.recipe = recipe; this.recipe = recipe;

View file

@ -2,6 +2,7 @@ package org.betterx.betterend.integration.rei;
import org.betterx.betterend.recipe.builders.InfusionRecipe; import org.betterx.betterend.recipe.builders.InfusionRecipe;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.Recipe;
@ -22,7 +23,7 @@ public class REIInfusionDisplay extends BasicDisplay implements SimpleGridMenuDi
public REIInfusionDisplay(InfusionRecipe recipe) { public REIInfusionDisplay(InfusionRecipe recipe) {
super( super(
EntryIngredients.ofIngredients(recipe.getIngredients()), EntryIngredients.ofIngredients(recipe.getIngredients()),
Collections.singletonList(EntryIngredients.of(recipe.getResultItem())) Collections.singletonList(EntryIngredients.of(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())))
); );
this.recipe = recipe; this.recipe = recipe;
this.time = recipe.getInfusionTime(); this.time = recipe.getInfusionTime();

View file

@ -8,7 +8,6 @@ import org.betterx.betterend.registry.EndItems;
import net.minecraft.client.renderer.item.ItemProperties; import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.*; import net.minecraft.world.item.*;
@ -33,7 +32,7 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Bett
) { ) {
super( super(
material, material,
EquipmentSlot.CHEST, Type.CHESTPLATE,
fireproof ? EndItems fireproof ? EndItems
.makeEndItemSettings() .makeEndItemSettings()
.durability(durability) .durability(durability)
@ -43,7 +42,7 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Bett
this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png"); this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png");
this.repairItem = repairItem; this.repairItem = repairItem;
this.movementFactor = movementFactor; this.movementFactor = movementFactor;
this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.15); this.defense = (int) ((double) material.getDefenseForType(Type.CHESTPLATE) / 1.15);
this.toughness = material.getToughness() / 1.15F; this.toughness = material.getToughness() / 1.15F;
addAttributeModifier( addAttributeModifier(
Attributes.ARMOR, Attributes.ARMOR,

View file

@ -9,7 +9,6 @@ import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.Style; import net.minecraft.network.chat.Style;
import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -18,8 +17,8 @@ public class CrystaliteArmor extends BaseArmorItem {
public final static MutableComponent CHEST_DESC; public final static MutableComponent CHEST_DESC;
public final static MutableComponent BOOTS_DESC; public final static MutableComponent BOOTS_DESC;
public CrystaliteArmor(EquipmentSlot equipmentSlot, Properties settings) { public CrystaliteArmor(Type type, Properties settings) {
super(EndArmorMaterial.CRYSTALITE, equipmentSlot, settings); super(EndArmorMaterial.CRYSTALITE, type, settings);
} }
public static boolean hasFullSet(LivingEntity owner) { public static boolean hasFullSet(LivingEntity owner) {

View file

@ -6,7 +6,6 @@ import org.betterx.betterend.registry.EndItems;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity; import net.minecraft.world.item.Rarity;
@ -22,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
public class CrystaliteBoots extends CrystaliteArmor implements MobEffectApplier { public class CrystaliteBoots extends CrystaliteArmor implements MobEffectApplier {
public CrystaliteBoots() { public CrystaliteBoots() {
super(EquipmentSlot.FEET, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); super(Type.BOOTS, EndItems.makeEndItemSettings().rarity(Rarity.RARE));
} }
@Override @Override

View file

@ -6,7 +6,6 @@ import org.betterx.betterend.registry.EndItems;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity; import net.minecraft.world.item.Rarity;
@ -22,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
public class CrystaliteChestplate extends CrystaliteArmor implements MobEffectApplier { public class CrystaliteChestplate extends CrystaliteArmor implements MobEffectApplier {
public CrystaliteChestplate() { public CrystaliteChestplate() {
super(EquipmentSlot.CHEST, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); super(Type.CHESTPLATE, EndItems.makeEndItemSettings().rarity(Rarity.RARE));
} }
@Override @Override

View file

@ -7,7 +7,6 @@ import org.betterx.betterend.registry.EndItems;
import net.minecraft.client.renderer.item.ItemProperties; import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.ElytraItem; import net.minecraft.world.item.ElytraItem;
@ -25,10 +24,10 @@ public class CrystaliteElytra extends CrystaliteArmor implements MultiModelItem,
private final float toughness; private final float toughness;
public CrystaliteElytra(int durability, double movementFactor) { public CrystaliteElytra(int durability, double movementFactor) {
super(EquipmentSlot.CHEST, EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC)); super(Type.CHESTPLATE, EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC));
this.wingTexture = BetterEnd.makeID("textures/entity/elytra_crystalite.png"); this.wingTexture = BetterEnd.makeID("textures/entity/elytra_crystalite.png");
this.movementFactor = movementFactor; this.movementFactor = movementFactor;
this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.25); this.defense = (int) ((double) material.getDefenseForType(Type.CHESTPLATE) / 1.25);
this.toughness = material.getToughness() / 1.25F; this.toughness = material.getToughness() / 1.25F;
addAttributeModifier( addAttributeModifier(
Attributes.ARMOR, Attributes.ARMOR,

View file

@ -12,7 +12,7 @@ import java.util.UUID;
public class CrystaliteHelmet extends CrystaliteArmor { public class CrystaliteHelmet extends CrystaliteArmor {
public CrystaliteHelmet() { public CrystaliteHelmet() {
super(EquipmentSlot.HEAD, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); super(Type.HELMET, EndItems.makeEndItemSettings().rarity(Rarity.RARE));
UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.HEAD.getIndex()]; UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.HEAD.getIndex()];
addAttributeModifier( addAttributeModifier(
EndAttributes.BLINDNESS_RESISTANCE, EndAttributes.BLINDNESS_RESISTANCE,

View file

@ -12,7 +12,7 @@ import java.util.UUID;
public class CrystaliteLeggings extends CrystaliteArmor { public class CrystaliteLeggings extends CrystaliteArmor {
public CrystaliteLeggings() { public CrystaliteLeggings() {
super(EquipmentSlot.LEGS, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); super(Type.LEGGINGS, EndItems.makeEndItemSettings().rarity(Rarity.RARE));
UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.LEGS.getIndex()]; UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.LEGS.getIndex()];
addAttributeModifier( addAttributeModifier(
Attributes.MAX_HEALTH, Attributes.MAX_HEALTH,

View file

@ -25,10 +25,10 @@ public class EndArmorItem extends ArmorItem implements ItemModelProvider {
protected final Multimap<Attribute, AttributeModifier> defaultModifiers; protected final Multimap<Attribute, AttributeModifier> defaultModifiers;
public EndArmorItem(ArmorMaterial material, EquipmentSlot equipmentSlot, Properties settings) { public EndArmorItem(ArmorMaterial material, Type type, Properties settings) {
super(material, equipmentSlot, settings); super(material, type, settings);
this.defaultModifiers = HashMultimap.create(); this.defaultModifiers = HashMultimap.create();
UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[equipmentSlot.getIndex()]; UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[type.getSlot().getIndex()];
addAttributeModifier( addAttributeModifier(
Attributes.ARMOR, Attributes.ARMOR,
new AttributeModifier(uuid, "Armor modifier", getDefense(), AttributeModifier.Operation.ADDITION) new AttributeModifier(uuid, "Armor modifier", getDefense(), AttributeModifier.Operation.ADDITION)
@ -52,7 +52,7 @@ public class EndArmorItem extends ArmorItem implements ItemModelProvider {
@Override @Override
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) { public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) {
return equipmentSlot == slot ? defaultModifiers : super.getDefaultAttributeModifiers(equipmentSlot); return equipmentSlot == type.getSlot() ? defaultModifiers : super.getDefaultAttributeModifiers(equipmentSlot);
} }
protected void addAttributeModifier(Attribute attribute, AttributeModifier modifier) { protected void addAttributeModifier(Attribute attribute, AttributeModifier modifier) {

View file

@ -6,7 +6,7 @@ import org.betterx.betterend.registry.EndItems;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.util.LazyLoadedValue; import net.minecraft.util.LazyLoadedValue;
import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Ingredient;
@ -56,13 +56,13 @@ public enum EndArmorMaterial implements ArmorMaterial {
} }
@Override @Override
public int getDurabilityForSlot(EquipmentSlot slot) { public int getDurabilityForType(ArmorItem.Type type) {
return BASE_DURABILITY[slot.getIndex()] * this.durabilityMultiplier; return BASE_DURABILITY[type.getSlot().getIndex()] * this.durabilityMultiplier;
} }
@Override @Override
public int getDefenseForSlot(EquipmentSlot slot) { public int getDefenseForType(ArmorItem.Type type) {
return this.protectionAmounts[slot.getIndex()]; return this.protectionAmounts[type.getSlot().getIndex()];
} }
@Override @Override

View file

@ -8,6 +8,7 @@ import org.betterx.betterend.world.generator.TerrainGenerator;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
@ -36,9 +37,18 @@ import java.util.function.Supplier;
@Mixin(ServerLevel.class) @Mixin(ServerLevel.class)
public abstract class ServerLevelMixin extends Level { public abstract class ServerLevelMixin extends Level {
private final static List<ResourceKey<DimensionType>> BE_TEST_DIMENSIONS = List.of(
BuiltinDimensionTypes.OVERWORLD,
BuiltinDimensionTypes.OVERWORLD_CAVES,
BuiltinDimensionTypes.NETHER
);
protected ServerLevelMixin( protected ServerLevelMixin(
WritableLevelData writableLevelData, WritableLevelData writableLevelData,
ResourceKey<Level> resourceKey, ResourceKey<Level> resourceKey,
RegistryAccess registryAccess,
Holder<DimensionType> holder, Holder<DimensionType> holder,
Supplier<ProfilerFiller> supplier, Supplier<ProfilerFiller> supplier,
boolean bl, boolean bl,
@ -46,15 +56,9 @@ public abstract class ServerLevelMixin extends Level {
long l, long l,
int i int i
) { ) {
super(writableLevelData, resourceKey, holder, supplier, bl, bl2, l, i); super(writableLevelData, resourceKey, registryAccess, holder, supplier, bl, bl2, l, i);
} }
private final static List<ResourceKey<DimensionType>> BE_TEST_DIMENSIONS = List.of(
BuiltinDimensionTypes.OVERWORLD,
BuiltinDimensionTypes.OVERWORLD_CAVES,
BuiltinDimensionTypes.NETHER
);
@ModifyArg(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/Holder;is(Lnet/minecraft/resources/ResourceKey;)Z")) @ModifyArg(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/Holder;is(Lnet/minecraft/resources/ResourceKey;)Z"))
ResourceKey<DimensionType> be_dragonFight(ResourceKey<DimensionType> resourceKey) { ResourceKey<DimensionType> be_dragonFight(ResourceKey<DimensionType> resourceKey) {
if (!GeneratorOptions.hasDragonFights()) { if (!GeneratorOptions.hasDragonFights()) {

View file

@ -42,7 +42,7 @@ public class ParticleTenaneaPetal extends TextureSheetParticle {
CustomColorProvider block = (CustomColorProvider) EndBlocks.TENANEA_FLOWERS; CustomColorProvider block = (CustomColorProvider) EndBlocks.TENANEA_FLOWERS;
provider = block.getProvider(); provider = block.getProvider();
} }
int color = provider.getColor(null, null, new BlockPos(x, y, z), 0); int color = provider.getColor(null, null, new BlockPos((int) x, (int) y, (int) z), 0);
this.rCol = ((color >> 16) & 255) / 255F; this.rCol = ((color >> 16) & 255) / 255F;
this.gCol = ((color >> 8) & 255) / 255F; this.gCol = ((color >> 8) & 255) / 255F;
this.bCol = ((color) & 255) / 255F; this.bCol = ((color) & 255) / 255F;

View file

@ -2,7 +2,6 @@ package org.betterx.betterend.recipe;
import org.betterx.bclib.recipes.BCLRecipeBuilder; import org.betterx.bclib.recipes.BCLRecipeBuilder;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.item.material.EndToolMaterial; import org.betterx.betterend.item.material.EndToolMaterial;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
@ -12,15 +11,13 @@ import net.minecraft.world.item.Tiers;
public class AnvilRecipes { public class AnvilRecipes {
public static void register() { public static void register() {
BCLRecipeBuilder.anvil(BetterEnd.makeID("ender_pearl_to_dust"), EndItems.ENDER_DUST) BCLRecipeBuilder.anvil(BetterEnd.makeID("ender_pearl_to_dust"), EndItems.ENDER_DUST)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(Items.ENDER_PEARL)
.setInput(Items.ENDER_PEARL)
.setAnvilLevel(Tiers.IRON.getLevel()) .setAnvilLevel(Tiers.IRON.getLevel())
.setToolLevel(4) .setToolLevel(4)
.setDamage(5) .setDamage(5)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("ender_shard_to_dust"), EndItems.ENDER_DUST) BCLRecipeBuilder.anvil(BetterEnd.makeID("ender_shard_to_dust"), EndItems.ENDER_DUST)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.ENDER_SHARD)
.setInput(EndItems.ENDER_SHARD)
.setAnvilLevel(Tiers.IRON.getLevel()) .setAnvilLevel(Tiers.IRON.getLevel())
.setToolLevel(0) .setToolLevel(0)
@ -29,50 +26,43 @@ public class AnvilRecipes {
int anvilLevel = EndToolMaterial.AETERNIUM.getLevel(); int anvilLevel = EndToolMaterial.AETERNIUM.getLevel();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_axe_head"), EndItems.AETERNIUM_AXE_HEAD) BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_axe_head"), EndItems.AETERNIUM_AXE_HEAD)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setInput(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_pickaxe_head"), EndItems.AETERNIUM_PICKAXE_HEAD) BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_pickaxe_head"), EndItems.AETERNIUM_PICKAXE_HEAD)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setInput(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_shovel_head"), EndItems.AETERNIUM_SHOVEL_HEAD) BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_shovel_head"), EndItems.AETERNIUM_SHOVEL_HEAD)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setInput(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_hoe_head"), EndItems.AETERNIUM_HOE_HEAD) BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_hoe_head"), EndItems.AETERNIUM_HOE_HEAD)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setInput(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_hammer_head"), EndItems.AETERNIUM_HAMMER_HEAD) BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_hammer_head"), EndItems.AETERNIUM_HAMMER_HEAD)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setInput(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(EndToolMaterial.THALLASIUM.getLevel()) .setToolLevel(EndToolMaterial.THALLASIUM.getLevel())
.setDamage(6) .setDamage(6)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_sword_blade"), EndItems.AETERNIUM_SWORD_BLADE) BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_sword_blade"), EndItems.AETERNIUM_SWORD_BLADE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setInput(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_forged_plate"), EndItems.AETERNIUM_FORGED_PLATE) BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_forged_plate"), EndItems.AETERNIUM_FORGED_PLATE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setInput(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)

View file

@ -2,7 +2,6 @@ package org.betterx.betterend.recipe;
import org.betterx.bclib.recipes.BCLRecipeBuilder; import org.betterx.bclib.recipes.BCLRecipeBuilder;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
import org.betterx.worlds.together.tag.v3.CommonItemTags; import org.betterx.worlds.together.tag.v3.CommonItemTags;
@ -19,19 +18,16 @@ public class CraftingRecipes {
public static void register() { public static void register() {
BCLRecipeBuilder.crafting(BetterEnd.makeID("ender_perl_to_block"), EndBlocks.ENDER_BLOCK) BCLRecipeBuilder.crafting(BetterEnd.makeID("ender_perl_to_block"), EndBlocks.ENDER_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("OO", "OO") .setShape("OO", "OO")
.addMaterial('O', Items.ENDER_PEARL) .addMaterial('O', Items.ENDER_PEARL)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("ender_block_to_perl"), Items.ENDER_PEARL) BCLRecipeBuilder.crafting(BetterEnd.makeID("ender_block_to_perl"), Items.ENDER_PEARL)
.checkConfig(Configs.RECIPE_CONFIG)
.addMaterial('#', EndBlocks.ENDER_BLOCK) .addMaterial('#', EndBlocks.ENDER_BLOCK)
.setOutputCount(4) .setOutputCount(4)
.setList("#") .shapeless()
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("end_stone_smelter"), EndBlocks.END_STONE_SMELTER) BCLRecipeBuilder.crafting(BetterEnd.makeID("end_stone_smelter"), EndBlocks.END_STONE_SMELTER)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("T#T", "V V", "T#T") .setShape("T#T", "V V", "T#T")
.addMaterial('#', Blocks.END_STONE_BRICKS) .addMaterial('#', Blocks.END_STONE_BRICKS)
.addMaterial('T', EndBlocks.THALLASIUM.ingot) .addMaterial('T', EndBlocks.THALLASIUM.ingot)
@ -60,7 +56,6 @@ public class CraftingRecipes {
registerPedestal("purpur_pedestal", EndBlocks.PURPUR_PEDESTAL, Blocks.PURPUR_SLAB, Blocks.PURPUR_PILLAR); registerPedestal("purpur_pedestal", EndBlocks.PURPUR_PEDESTAL, Blocks.PURPUR_SLAB, Blocks.PURPUR_PILLAR);
BCLRecipeBuilder.crafting(BetterEnd.makeID("infusion_pedestal"), EndBlocks.INFUSION_PEDESTAL) BCLRecipeBuilder.crafting(BetterEnd.makeID("infusion_pedestal"), EndBlocks.INFUSION_PEDESTAL)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape(" Y ", "O#O", " # ") .setShape(" Y ", "O#O", " # ")
.addMaterial('O', Items.ENDER_PEARL) .addMaterial('O', Items.ENDER_PEARL)
.addMaterial('Y', Items.ENDER_EYE) .addMaterial('Y', Items.ENDER_EYE)
@ -69,76 +64,63 @@ public class CraftingRecipes {
String material = "aeternium"; String material = "aeternium";
BCLRecipeBuilder.crafting(BetterEnd.makeID(material + "_block"), EndBlocks.AETERNIUM_BLOCK) BCLRecipeBuilder.crafting(BetterEnd.makeID(material + "_block"), EndBlocks.AETERNIUM_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("III", "III", "III") .setShape("III", "III", "III")
.addMaterial('I', EndItems.AETERNIUM_INGOT) .addMaterial('I', EndItems.AETERNIUM_INGOT)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(material + "_block_to_ingot"), EndItems.AETERNIUM_INGOT) BCLRecipeBuilder.crafting(BetterEnd.makeID(material + "_block_to_ingot"), EndItems.AETERNIUM_INGOT)
.checkConfig(Configs.RECIPE_CONFIG)
.addMaterial('#', EndBlocks.AETERNIUM_BLOCK) .addMaterial('#', EndBlocks.AETERNIUM_BLOCK)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .shapeless()
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("blue_vine_seed_dye"), Items.BLUE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("blue_vine_seed_dye"), Items.BLUE_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.BLUE_VINE_SEED) .addMaterial('#', EndBlocks.BLUE_VINE_SEED)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("creeping_moss_dye"), Items.CYAN_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("creeping_moss_dye"), Items.CYAN_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.CREEPING_MOSS) .addMaterial('#', EndBlocks.CREEPING_MOSS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("umbrella_moss_dye"), Items.YELLOW_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("umbrella_moss_dye"), Items.YELLOW_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.UMBRELLA_MOSS) .addMaterial('#', EndBlocks.UMBRELLA_MOSS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("umbrella_moss_tall_dye"), Items.YELLOW_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("umbrella_moss_tall_dye"), Items.YELLOW_DYE)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(2) .setOutputCount(2)
.setList("#") .shapeless()
.addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL) .addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_plant_dye"), Items.BLACK_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_plant_dye"), Items.BLACK_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.SHADOW_PLANT) .addMaterial('#', EndBlocks.SHADOW_PLANT)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("paper"), Items.PAPER) BCLRecipeBuilder.crafting(BetterEnd.makeID("paper"), Items.PAPER)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###") .setShape("###")
.addMaterial('#', EndItems.END_LILY_LEAF_DRIED) .addMaterial('#', EndItems.END_LILY_LEAF_DRIED)
.setOutputCount(3) .setOutputCount(3)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("aurora_block"), EndBlocks.AURORA_CRYSTAL) BCLRecipeBuilder.crafting(BetterEnd.makeID("aurora_block"), EndBlocks.AURORA_CRYSTAL)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndItems.CRYSTAL_SHARDS) .addMaterial('#', EndItems.CRYSTAL_SHARDS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("lotus_block"), EndBlocks.END_LOTUS.getLog()) BCLRecipeBuilder.crafting(BetterEnd.makeID("lotus_block"), EndBlocks.END_LOTUS.getLog())
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndBlocks.END_LOTUS_STEM) .addMaterial('#', EndBlocks.END_LOTUS_STEM)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("needlegrass_stick"), Items.STICK) BCLRecipeBuilder.crafting(BetterEnd.makeID("needlegrass_stick"), Items.STICK)
.setList("#") .shapeless()
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(2) .setOutputCount(2)
.addMaterial('#', EndBlocks.NEEDLEGRASS) .addMaterial('#', EndBlocks.NEEDLEGRASS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_berry_seeds"), EndBlocks.SHADOW_BERRY) BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_berry_seeds"), EndBlocks.SHADOW_BERRY)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.setOutputCount(4) .setOutputCount(4)
.addMaterial('#', EndItems.SHADOW_BERRY_RAW) .addMaterial('#', EndItems.SHADOW_BERRY_RAW)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("purple_polypore_dye"), Items.PURPLE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("purple_polypore_dye"), Items.PURPLE_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.PURPLE_POLYPORE) .addMaterial('#', EndBlocks.PURPLE_POLYPORE)
.build(); .build();
@ -151,57 +133,47 @@ public class CraftingRecipes {
registerLantern("blackstone_lantern", EndBlocks.BLACKSTONE_LANTERN, Blocks.BLACKSTONE_SLAB); registerLantern("blackstone_lantern", EndBlocks.BLACKSTONE_LANTERN, Blocks.BLACKSTONE_SLAB);
BCLRecipeBuilder.crafting(BetterEnd.makeID("amber_gem"), EndItems.AMBER_GEM) BCLRecipeBuilder.crafting(BetterEnd.makeID("amber_gem"), EndItems.AMBER_GEM)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndItems.RAW_AMBER) .addMaterial('#', EndItems.RAW_AMBER)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("amber_block"), EndBlocks.AMBER_BLOCK) BCLRecipeBuilder.crafting(BetterEnd.makeID("amber_block"), EndBlocks.AMBER_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndItems.AMBER_GEM) .addMaterial('#', EndItems.AMBER_GEM)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("amber_gem_block"), EndItems.AMBER_GEM) BCLRecipeBuilder.crafting(BetterEnd.makeID("amber_gem_block"), EndItems.AMBER_GEM)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setList("#") .shapeless()
.addMaterial('#', EndBlocks.AMBER_BLOCK) .addMaterial('#', EndBlocks.AMBER_BLOCK)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("iron_bulb_lantern"), EndBlocks.IRON_BULB_LANTERN) BCLRecipeBuilder.crafting(BetterEnd.makeID("iron_bulb_lantern"), EndBlocks.IRON_BULB_LANTERN)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("C", "I", "#") .setShape("C", "I", "#")
.addMaterial('C', Items.CHAIN) .addMaterial('C', Items.CHAIN)
.addMaterial('I', Items.IRON_INGOT) .addMaterial('I', Items.IRON_INGOT)
.addMaterial('#', EndItems.GLOWING_BULB) .addMaterial('#', EndItems.GLOWING_BULB)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("twisted_moss_dye"), Items.PINK_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("twisted_moss_dye"), Items.PINK_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.TWISTED_MOSS) .addMaterial('#', EndBlocks.TWISTED_MOSS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("byshy_grass_dye"), Items.MAGENTA_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("byshy_grass_dye"), Items.MAGENTA_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.BUSHY_GRASS) .addMaterial('#', EndBlocks.BUSHY_GRASS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("tail_moss_dye"), Items.GRAY_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("tail_moss_dye"), Items.GRAY_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.TAIL_MOSS) .addMaterial('#', EndBlocks.TAIL_MOSS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("petal_block"), EndBlocks.HYDRALUX_PETAL_BLOCK) BCLRecipeBuilder.crafting(BetterEnd.makeID("petal_block"), EndBlocks.HYDRALUX_PETAL_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndItems.HYDRALUX_PETAL) .addMaterial('#', EndItems.HYDRALUX_PETAL)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("petal_white_dye"), Items.WHITE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("petal_white_dye"), Items.WHITE_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndItems.HYDRALUX_PETAL) .addMaterial('#', EndItems.HYDRALUX_PETAL)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("sweet_berry_jelly_potion"), EndItems.SWEET_BERRY_JELLY) BCLRecipeBuilder.crafting(BetterEnd.makeID("sweet_berry_jelly_potion"), EndItems.SWEET_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE) .addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR) .addMaterial('S', Items.SUGAR)
@ -210,8 +182,7 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_berry_jelly_potion"), EndItems.SHADOW_BERRY_JELLY) BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_berry_jelly_potion"), EndItems.SHADOW_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE) .addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR) .addMaterial('S', Items.SUGAR)
@ -220,8 +191,7 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("blossom_berry_jelly_potion"), EndItems.BLOSSOM_BERRY_JELLY) BCLRecipeBuilder.crafting(BetterEnd.makeID("blossom_berry_jelly_potion"), EndItems.BLOSSOM_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE) .addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR) .addMaterial('S', Items.SUGAR)
@ -230,8 +200,7 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("sweet_berry_jelly"), EndItems.SWEET_BERRY_JELLY) BCLRecipeBuilder.crafting(BetterEnd.makeID("sweet_berry_jelly"), EndItems.SWEET_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE) .addMaterial('J', EndItems.GELATINE)
.addMaterial('W', CommonItemTags.WATER_BOTTLES) .addMaterial('W', CommonItemTags.WATER_BOTTLES)
.addMaterial('S', Items.SUGAR) .addMaterial('S', Items.SUGAR)
@ -240,8 +209,7 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_berry_jelly"), EndItems.SHADOW_BERRY_JELLY) BCLRecipeBuilder.crafting(BetterEnd.makeID("shadow_berry_jelly"), EndItems.SHADOW_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE) .addMaterial('J', EndItems.GELATINE)
.addMaterial('W', CommonItemTags.WATER_BOTTLES) .addMaterial('W', CommonItemTags.WATER_BOTTLES)
.addMaterial('S', Items.SUGAR) .addMaterial('S', Items.SUGAR)
@ -250,8 +218,7 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("blossom_berry_jelly"), EndItems.BLOSSOM_BERRY_JELLY) BCLRecipeBuilder.crafting(BetterEnd.makeID("blossom_berry_jelly"), EndItems.BLOSSOM_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE) .addMaterial('J', EndItems.GELATINE)
.addMaterial('W', CommonItemTags.WATER_BOTTLES) .addMaterial('W', CommonItemTags.WATER_BOTTLES)
.addMaterial('S', Items.SUGAR) .addMaterial('S', Items.SUGAR)
@ -260,57 +227,47 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("sulphur_gunpowder"), Items.GUNPOWDER) BCLRecipeBuilder.crafting(BetterEnd.makeID("sulphur_gunpowder"), Items.GUNPOWDER)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("SCB")
.addMaterial('S', EndItems.CRYSTALLINE_SULPHUR) .addMaterial('S', EndItems.CRYSTALLINE_SULPHUR)
.addMaterial('C', Items.COAL, Items.CHARCOAL) .addMaterial('C', Items.COAL, Items.CHARCOAL)
.addMaterial('B', Items.BONE_MEAL) .addMaterial('B', Items.BONE_MEAL)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("dense_emerald_ice"), EndBlocks.DENSE_EMERALD_ICE) BCLRecipeBuilder.crafting(BetterEnd.makeID("dense_emerald_ice"), EndBlocks.DENSE_EMERALD_ICE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndBlocks.EMERALD_ICE) .addMaterial('#', EndBlocks.EMERALD_ICE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("ancient_emerald_ice"), EndBlocks.ANCIENT_EMERALD_ICE) BCLRecipeBuilder.crafting(BetterEnd.makeID("ancient_emerald_ice"), EndBlocks.ANCIENT_EMERALD_ICE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###") .setShape("###", "###", "###")
.addMaterial('#', EndBlocks.DENSE_EMERALD_ICE) .addMaterial('#', EndBlocks.DENSE_EMERALD_ICE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_cyan_dye"), Items.CYAN_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_cyan_dye"), Items.CYAN_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.CHARNIA_CYAN) .addMaterial('#', EndBlocks.CHARNIA_CYAN)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_green_dye"), Items.GREEN_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_green_dye"), Items.GREEN_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.CHARNIA_GREEN) .addMaterial('#', EndBlocks.CHARNIA_GREEN)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_light_blue_dye"), Items.LIGHT_BLUE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_light_blue_dye"), Items.LIGHT_BLUE_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.CHARNIA_LIGHT_BLUE) .addMaterial('#', EndBlocks.CHARNIA_LIGHT_BLUE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_orange_dye"), Items.ORANGE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_orange_dye"), Items.ORANGE_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.CHARNIA_ORANGE) .addMaterial('#', EndBlocks.CHARNIA_ORANGE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_purple_dye"), Items.PURPLE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_purple_dye"), Items.PURPLE_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.CHARNIA_PURPLE) .addMaterial('#', EndBlocks.CHARNIA_PURPLE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_red_dye"), Items.RED_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("charnia_red_dye"), Items.RED_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.CHARNIA_RED) .addMaterial('#', EndBlocks.CHARNIA_RED)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("respawn_obelisk"), EndBlocks.RESPAWN_OBELISK) BCLRecipeBuilder.crafting(BetterEnd.makeID("respawn_obelisk"), EndBlocks.RESPAWN_OBELISK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("CSC", "CSC", "AAA") .setShape("CSC", "CSC", "AAA")
.addMaterial('C', EndBlocks.AURORA_CRYSTAL) .addMaterial('C', EndBlocks.AURORA_CRYSTAL)
.addMaterial('S', EndItems.ETERNAL_CRYSTAL) .addMaterial('S', EndItems.ETERNAL_CRYSTAL)
@ -318,44 +275,37 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("twisted_umbrella_moss_dye"), Items.PURPLE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("twisted_umbrella_moss_dye"), Items.PURPLE_DYE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("#")
.addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS) .addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("twisted_umbrella_moss_dye_tall"), Items.PURPLE_DYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("twisted_umbrella_moss_dye_tall"), Items.PURPLE_DYE)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(2) .setOutputCount(2)
.setList("#") .shapeless()
.addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS_TALL) .addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS_TALL)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("leather_to_stripes"), EndItems.LEATHER_STRIPE) BCLRecipeBuilder.crafting(BetterEnd.makeID("leather_to_stripes"), EndItems.LEATHER_STRIPE)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("L")
.addMaterial('L', Items.LEATHER) .addMaterial('L', Items.LEATHER)
.setOutputCount(3) .setOutputCount(3)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("stripes_to_leather"), Items.LEATHER) BCLRecipeBuilder.crafting(BetterEnd.makeID("stripes_to_leather"), Items.LEATHER)
.checkConfig(Configs.RECIPE_CONFIG) .setShape("SSS")
.setList("SSS")
.addMaterial('S', EndItems.LEATHER_STRIPE) .addMaterial('S', EndItems.LEATHER_STRIPE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("leather_wrapped_stick"), EndItems.LEATHER_WRAPPED_STICK) BCLRecipeBuilder.crafting(BetterEnd.makeID("leather_wrapped_stick"), EndItems.LEATHER_WRAPPED_STICK)
.checkConfig(Configs.RECIPE_CONFIG) .shapeless()
.setList("SL")
.addMaterial('S', Items.STICK) .addMaterial('S', Items.STICK)
.addMaterial('L', EndItems.LEATHER_STRIPE) .addMaterial('L', EndItems.LEATHER_STRIPE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("fiber_string"), Items.STRING) BCLRecipeBuilder.crafting(BetterEnd.makeID("fiber_string"), Items.STRING)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("#", "#", "#") .setShape("#", "#", "#")
.addMaterial('#', EndItems.SILK_FIBER) .addMaterial('#', EndItems.SILK_FIBER)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("ender_eye_amber"), Items.ENDER_EYE) BCLRecipeBuilder.crafting(BetterEnd.makeID("ender_eye_amber"), Items.ENDER_EYE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("SAS", "APA", "SAS") .setShape("SAS", "APA", "SAS")
.addMaterial('S', EndItems.CRYSTAL_SHARDS) .addMaterial('S', EndItems.CRYSTAL_SHARDS)
.addMaterial('A', EndItems.AMBER_GEM) .addMaterial('A', EndItems.AMBER_GEM)
@ -363,14 +313,12 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("iron_chandelier"), EndBlocks.IRON_CHANDELIER) BCLRecipeBuilder.crafting(BetterEnd.makeID("iron_chandelier"), EndBlocks.IRON_CHANDELIER)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("I#I", " # ") .setShape("I#I", " # ")
.addMaterial('#', Items.IRON_INGOT) .addMaterial('#', Items.IRON_INGOT)
.addMaterial('I', EndItems.LUMECORN_ROD) .addMaterial('I', EndItems.LUMECORN_ROD)
.setGroup("end_metal_chandelier") .setGroup("end_metal_chandelier")
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("gold_chandelier"), EndBlocks.GOLD_CHANDELIER) BCLRecipeBuilder.crafting(BetterEnd.makeID("gold_chandelier"), EndBlocks.GOLD_CHANDELIER)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("I#I", " # ") .setShape("I#I", " # ")
.addMaterial('#', Items.GOLD_INGOT) .addMaterial('#', Items.GOLD_INGOT)
.addMaterial('I', EndItems.LUMECORN_ROD) .addMaterial('I', EndItems.LUMECORN_ROD)
@ -378,7 +326,6 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("missing_tile"), EndBlocks.MISSING_TILE) BCLRecipeBuilder.crafting(BetterEnd.makeID("missing_tile"), EndBlocks.MISSING_TILE)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("#P", "P#") .setShape("#P", "P#")
.addMaterial( .addMaterial(
@ -395,29 +342,24 @@ public class CraftingRecipes {
registerHammer("diamond", Items.DIAMOND, EndItems.DIAMOND_HAMMER); registerHammer("diamond", Items.DIAMOND, EndItems.DIAMOND_HAMMER);
BCLRecipeBuilder.crafting(BetterEnd.makeID("charcoal_block"), EndBlocks.CHARCOAL_BLOCK) BCLRecipeBuilder.crafting(BetterEnd.makeID("charcoal_block"), EndBlocks.CHARCOAL_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###") .setShape("###", "###", "###")
.addMaterial('#', Items.CHARCOAL) .addMaterial('#', Items.CHARCOAL)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("charcoal_from_block"), Items.CHARCOAL) BCLRecipeBuilder.crafting(BetterEnd.makeID("charcoal_from_block"), Items.CHARCOAL)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .shapeless()
.addMaterial('#', EndBlocks.CHARCOAL_BLOCK) .addMaterial('#', EndBlocks.CHARCOAL_BLOCK)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("end_stone_furnace"), EndBlocks.END_STONE_FURNACE) BCLRecipeBuilder.crafting(BetterEnd.makeID("end_stone_furnace"), EndBlocks.END_STONE_FURNACE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #", "###") .setShape("###", "# #", "###")
.addMaterial('#', Blocks.END_STONE) .addMaterial('#', Blocks.END_STONE)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("filalux_lantern"), EndBlocks.FILALUX_LANTERN) BCLRecipeBuilder.crafting(BetterEnd.makeID("filalux_lantern"), EndBlocks.FILALUX_LANTERN)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###") .setShape("###", "###", "###")
.addMaterial('#', EndBlocks.FILALUX) .addMaterial('#', EndBlocks.FILALUX)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("silk_moth_hive"), EndBlocks.SILK_MOTH_HIVE) BCLRecipeBuilder.crafting(BetterEnd.makeID("silk_moth_hive"), EndBlocks.SILK_MOTH_HIVE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("#L#", "LML", "#L#") .setShape("#L#", "LML", "#L#")
.addMaterial('#', EndBlocks.TENANEA.getBlock("planks")) .addMaterial('#', EndBlocks.TENANEA.getBlock("planks"))
.addMaterial('L', EndBlocks.TENANEA_LEAVES) .addMaterial('L', EndBlocks.TENANEA_LEAVES)
@ -425,7 +367,6 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("cave_pumpkin_pie"), EndItems.CAVE_PUMPKIN_PIE) BCLRecipeBuilder.crafting(BetterEnd.makeID("cave_pumpkin_pie"), EndItems.CAVE_PUMPKIN_PIE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("SBS", "BPB", "SBS") .setShape("SBS", "BPB", "SBS")
.addMaterial('P', EndBlocks.CAVE_PUMPKIN) .addMaterial('P', EndBlocks.CAVE_PUMPKIN)
.addMaterial('B', EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_RAW) .addMaterial('B', EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_RAW)
@ -433,37 +374,31 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("cave_pumpkin_seeds"), EndBlocks.CAVE_PUMPKIN_SEED) BCLRecipeBuilder.crafting(BetterEnd.makeID("cave_pumpkin_seeds"), EndBlocks.CAVE_PUMPKIN_SEED)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setList("#") .shapeless()
.addMaterial('#', EndBlocks.CAVE_PUMPKIN) .addMaterial('#', EndBlocks.CAVE_PUMPKIN)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("neon_cactus_block"), EndBlocks.NEON_CACTUS_BLOCK) BCLRecipeBuilder.crafting(BetterEnd.makeID("neon_cactus_block"), EndBlocks.NEON_CACTUS_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndBlocks.NEON_CACTUS) .addMaterial('#', EndBlocks.NEON_CACTUS)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("neon_cactus_block_slab"), EndBlocks.NEON_CACTUS_BLOCK_SLAB) BCLRecipeBuilder.crafting(BetterEnd.makeID("neon_cactus_block_slab"), EndBlocks.NEON_CACTUS_BLOCK_SLAB)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###") .setShape("###")
.setOutputCount(6) .setOutputCount(6)
.addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK) .addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("neon_cactus_block_stairs"), EndBlocks.NEON_CACTUS_BLOCK_STAIRS) BCLRecipeBuilder.crafting(BetterEnd.makeID("neon_cactus_block_stairs"), EndBlocks.NEON_CACTUS_BLOCK_STAIRS)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.setOutputCount(4) .setOutputCount(4)
.addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK) .addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("sugar_from_root"), Items.SUGAR) BCLRecipeBuilder.crafting(BetterEnd.makeID("sugar_from_root"), Items.SUGAR)
.checkConfig(Configs.RECIPE_CONFIG) .setShape("###")
.setList("###")
.addMaterial('#', EndItems.AMBER_ROOT_RAW) .addMaterial('#', EndItems.AMBER_ROOT_RAW)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("endstone_flower_pot"), EndBlocks.ENDSTONE_FLOWER_POT) BCLRecipeBuilder.crafting(BetterEnd.makeID("endstone_flower_pot"), EndBlocks.ENDSTONE_FLOWER_POT)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(3) .setOutputCount(3)
.setShape("# #", " # ") .setShape("# #", " # ")
.addMaterial('#', Blocks.END_STONE_BRICKS) .addMaterial('#', Blocks.END_STONE_BRICKS)
@ -471,33 +406,28 @@ public class CraftingRecipes {
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("dragon_bone_block"), EndBlocks.DRAGON_BONE_BLOCK) BCLRecipeBuilder.crafting(BetterEnd.makeID("dragon_bone_block"), EndBlocks.DRAGON_BONE_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(8) .setOutputCount(8)
.setShape("###", "#D#", "###") .setShape("###", "#D#", "###")
.addMaterial('#', Blocks.BONE_BLOCK) .addMaterial('#', Blocks.BONE_BLOCK)
.addMaterial('D', Items.DRAGON_BREATH) .addMaterial('D', Items.DRAGON_BREATH)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("dragon_bone_slab"), EndBlocks.DRAGON_BONE_SLAB) BCLRecipeBuilder.crafting(BetterEnd.makeID("dragon_bone_slab"), EndBlocks.DRAGON_BONE_SLAB)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###") .setShape("###")
.setOutputCount(6) .setOutputCount(6)
.addMaterial('#', EndBlocks.DRAGON_BONE_BLOCK) .addMaterial('#', EndBlocks.DRAGON_BONE_BLOCK)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("dragon_bone_stairs"), EndBlocks.DRAGON_BONE_STAIRS) BCLRecipeBuilder.crafting(BetterEnd.makeID("dragon_bone_stairs"), EndBlocks.DRAGON_BONE_STAIRS)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.setOutputCount(4) .setOutputCount(4)
.addMaterial('#', EndBlocks.DRAGON_BONE_BLOCK) .addMaterial('#', EndBlocks.DRAGON_BONE_BLOCK)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("smaragdant_crystal"), EndBlocks.SMARAGDANT_CRYSTAL) BCLRecipeBuilder.crafting(BetterEnd.makeID("smaragdant_crystal"), EndBlocks.SMARAGDANT_CRYSTAL)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', EndBlocks.SMARAGDANT_CRYSTAL_SHARD) .addMaterial('#', EndBlocks.SMARAGDANT_CRYSTAL_SHARD)
.build(); .build();
BCLRecipeBuilder.crafting(BetterEnd.makeID("tined_glass_from_smaragdant"), Blocks.TINTED_GLASS) BCLRecipeBuilder.crafting(BetterEnd.makeID("tined_glass_from_smaragdant"), Blocks.TINTED_GLASS)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape(" # ", "#G#", " # ") .setShape(" # ", "#G#", " # ")
.addMaterial('#', EndBlocks.SMARAGDANT_CRYSTAL_SHARD) .addMaterial('#', EndBlocks.SMARAGDANT_CRYSTAL_SHARD)
.addMaterial('G', Blocks.GLASS) .addMaterial('G', Blocks.GLASS)
@ -506,7 +436,6 @@ public class CraftingRecipes {
private static void registerLantern(String name, Block lantern, Block slab) { private static void registerLantern(String name, Block lantern, Block slab) {
BCLRecipeBuilder.crafting(BetterEnd.makeID(name), lantern) BCLRecipeBuilder.crafting(BetterEnd.makeID(name), lantern)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("S", "#", "S") .setShape("S", "#", "S")
.addMaterial('#', EndItems.CRYSTAL_SHARDS) .addMaterial('#', EndItems.CRYSTAL_SHARDS)
.addMaterial('S', slab) .addMaterial('S', slab)
@ -516,7 +445,6 @@ public class CraftingRecipes {
public static void registerPedestal(String name, Block pedestal, Block slab, Block pillar) { public static void registerPedestal(String name, Block pedestal, Block slab, Block pillar) {
BCLRecipeBuilder.crafting(BetterEnd.makeID(name), pedestal) BCLRecipeBuilder.crafting(BetterEnd.makeID(name), pedestal)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("S", "#", "S") .setShape("S", "#", "S")
.addMaterial('S', slab) .addMaterial('S', slab)
.addMaterial('#', pillar) .addMaterial('#', pillar)
@ -526,7 +454,6 @@ public class CraftingRecipes {
private static void registerHammer(String name, Item material, Item result) { private static void registerHammer(String name, Item material, Item result) {
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_hammer"), result) BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_hammer"), result)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("I I", "I#I", " # ") .setShape("I I", "I#I", " # ")
.addMaterial('I', material) .addMaterial('I', material)
.addMaterial('#', Items.STICK) .addMaterial('#', Items.STICK)

View file

@ -2,7 +2,6 @@ package org.betterx.betterend.recipe;
import org.betterx.bclib.recipes.BCLRecipeBuilder; import org.betterx.bclib.recipes.BCLRecipeBuilder;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
@ -12,43 +11,35 @@ import net.minecraft.world.level.block.Blocks;
public class FurnaceRecipes { public class FurnaceRecipes {
public static void register() { public static void register() {
BCLRecipeBuilder.smelting(BetterEnd.makeID("end_lily_leaf_dried"), EndItems.END_LILY_LEAF_DRIED) BCLRecipeBuilder.smelting(BetterEnd.makeID("end_lily_leaf_dried"), EndItems.END_LILY_LEAF_DRIED)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.END_LILY_LEAF)
.setInput(EndItems.END_LILY_LEAF)
.build(); .build();
BCLRecipeBuilder.smelting(BetterEnd.makeID("end_glass"), Blocks.GLASS) BCLRecipeBuilder.smelting(BetterEnd.makeID("end_glass"), Blocks.GLASS)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.ENDSTONE_DUST)
.setInput(EndBlocks.ENDSTONE_DUST)
.build(); .build();
BCLRecipeBuilder.smelting(BetterEnd.makeID("end_berry"), EndItems.SHADOW_BERRY_COOKED) BCLRecipeBuilder.smelting(BetterEnd.makeID("end_berry"), EndItems.SHADOW_BERRY_COOKED)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.SHADOW_BERRY_RAW)
.setInput(EndItems.SHADOW_BERRY_RAW)
.buildFoodlike(); .buildFoodlike();
BCLRecipeBuilder.smelting(BetterEnd.makeID("end_fish"), EndItems.END_FISH_COOKED) BCLRecipeBuilder.smelting(BetterEnd.makeID("end_fish"), EndItems.END_FISH_COOKED)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.END_FISH_RAW)
.setInput(EndItems.END_FISH_RAW)
.buildFoodlike(); .buildFoodlike();
BCLRecipeBuilder.smelting(BetterEnd.makeID("slime_ball"), Items.SLIME_BALL) BCLRecipeBuilder.smelting(BetterEnd.makeID("slime_ball"), Items.SLIME_BALL)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.JELLYSHROOM_CAP_PURPLE)
.setInput(EndBlocks.JELLYSHROOM_CAP_PURPLE)
.build(); .build();
BCLRecipeBuilder.smelting(BetterEnd.makeID("menger_sponge"), EndBlocks.MENGER_SPONGE) BCLRecipeBuilder.smelting(BetterEnd.makeID("menger_sponge"), EndBlocks.MENGER_SPONGE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.MENGER_SPONGE_WET)
.setInput(EndBlocks.MENGER_SPONGE_WET)
.build(); .build();
BCLRecipeBuilder.smelting(BetterEnd.makeID("chorus_mushroom"), EndItems.CHORUS_MUSHROOM_COOKED) BCLRecipeBuilder.smelting(BetterEnd.makeID("chorus_mushroom"), EndItems.CHORUS_MUSHROOM_COOKED)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.CHORUS_MUSHROOM_RAW)
.setInput(EndItems.CHORUS_MUSHROOM_RAW)
.buildFoodlike(); .buildFoodlike();
BCLRecipeBuilder.smelting(BetterEnd.makeID("bolux_mushroom"), EndItems.BOLUX_MUSHROOM_COOKED) BCLRecipeBuilder.smelting(BetterEnd.makeID("bolux_mushroom"), EndItems.BOLUX_MUSHROOM_COOKED)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.BOLUX_MUSHROOM)
.setInput(EndBlocks.BOLUX_MUSHROOM)
.buildFoodlike(); .buildFoodlike();
} }
} }

View file

@ -2,7 +2,6 @@ package org.betterx.betterend.recipe;
import org.betterx.bclib.recipes.BCLRecipeBuilder; import org.betterx.bclib.recipes.BCLRecipeBuilder;
import org.betterx.betterend.BetterEnd; import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
@ -12,83 +11,68 @@ public class SmithingRecipes {
public static void register() { public static void register() {
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_sword_handle"), EndItems.AETERNIUM_SWORD_HANDLE) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_sword_handle"), EndItems.AETERNIUM_SWORD_HANDLE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.TERMINITE.ingot)
.setBase(EndBlocks.TERMINITE.ingot)
.setAddition(EndItems.LEATHER_WRAPPED_STICK) .setAddition(EndItems.LEATHER_WRAPPED_STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_sword"), EndItems.AETERNIUM_SWORD) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_sword"), EndItems.AETERNIUM_SWORD)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_SWORD_BLADE)
.setBase(EndItems.AETERNIUM_SWORD_BLADE)
.setAddition(EndItems.AETERNIUM_SWORD_HANDLE) .setAddition(EndItems.AETERNIUM_SWORD_HANDLE)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_pickaxe"), EndItems.AETERNIUM_PICKAXE) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_pickaxe"), EndItems.AETERNIUM_PICKAXE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_PICKAXE_HEAD)
.setBase(EndItems.AETERNIUM_PICKAXE_HEAD)
.setAddition(EndItems.LEATHER_WRAPPED_STICK) .setAddition(EndItems.LEATHER_WRAPPED_STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_axe"), EndItems.AETERNIUM_AXE) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_axe"), EndItems.AETERNIUM_AXE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_AXE_HEAD)
.setBase(EndItems.AETERNIUM_AXE_HEAD)
.setAddition(EndItems.LEATHER_WRAPPED_STICK) .setAddition(EndItems.LEATHER_WRAPPED_STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_shovel"), EndItems.AETERNIUM_SHOVEL) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_shovel"), EndItems.AETERNIUM_SHOVEL)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_SHOVEL_HEAD)
.setBase(EndItems.AETERNIUM_SHOVEL_HEAD)
.setAddition(EndItems.LEATHER_WRAPPED_STICK) .setAddition(EndItems.LEATHER_WRAPPED_STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_hoe"), EndItems.AETERNIUM_HOE) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_hoe"), EndItems.AETERNIUM_HOE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_HOE_HEAD)
.setBase(EndItems.AETERNIUM_HOE_HEAD)
.setAddition(EndItems.LEATHER_WRAPPED_STICK) .setAddition(EndItems.LEATHER_WRAPPED_STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_hammer"), EndItems.AETERNIUM_HAMMER) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_hammer"), EndItems.AETERNIUM_HAMMER)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.AETERNIUM_HAMMER_HEAD)
.setBase(EndItems.AETERNIUM_HAMMER_HEAD)
.setAddition(EndItems.LEATHER_WRAPPED_STICK) .setAddition(EndItems.LEATHER_WRAPPED_STICK)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("netherite_hammer"), EndItems.NETHERITE_HAMMER) BCLRecipeBuilder.smithing(BetterEnd.makeID("netherite_hammer"), EndItems.NETHERITE_HAMMER)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndItems.DIAMOND_HAMMER)
.setBase(EndItems.DIAMOND_HAMMER)
.setAddition(Items.NETHERITE_INGOT) .setAddition(Items.NETHERITE_INGOT)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_helmet"), EndItems.AETERNIUM_HELMET) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_helmet"), EndItems.AETERNIUM_HELMET)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.TERMINITE.helmet)
.setBase(EndBlocks.TERMINITE.helmet)
.setAddition(EndItems.AETERNIUM_FORGED_PLATE) .setAddition(EndItems.AETERNIUM_FORGED_PLATE)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_chestplate"), EndItems.AETERNIUM_CHESTPLATE) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_chestplate"), EndItems.AETERNIUM_CHESTPLATE)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.TERMINITE.chestplate)
.setBase(EndBlocks.TERMINITE.chestplate)
.setAddition(EndItems.AETERNIUM_FORGED_PLATE) .setAddition(EndItems.AETERNIUM_FORGED_PLATE)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_leggings"), EndItems.AETERNIUM_LEGGINGS) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_leggings"), EndItems.AETERNIUM_LEGGINGS)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.TERMINITE.leggings)
.setBase(EndBlocks.TERMINITE.leggings)
.setAddition(EndItems.AETERNIUM_FORGED_PLATE) .setAddition(EndItems.AETERNIUM_FORGED_PLATE)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_boots"), EndItems.AETERNIUM_BOOTS) BCLRecipeBuilder.smithing(BetterEnd.makeID("aeternium_boots"), EndItems.AETERNIUM_BOOTS)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.TERMINITE.boots)
.setBase(EndBlocks.TERMINITE.boots)
.setAddition(EndItems.AETERNIUM_FORGED_PLATE) .setAddition(EndItems.AETERNIUM_FORGED_PLATE)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("thallasium_anvil_updrade"), EndBlocks.TERMINITE.anvilBlock.asItem()) BCLRecipeBuilder.smithing(BetterEnd.makeID("thallasium_anvil_updrade"), EndBlocks.TERMINITE.anvilBlock.asItem())
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.THALLASIUM.anvilBlock.asItem())
.setBase(EndBlocks.THALLASIUM.anvilBlock.asItem())
.setAddition(EndBlocks.TERMINITE.block) .setAddition(EndBlocks.TERMINITE.block)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("terminite_anvil_updrade"), EndBlocks.AETERNIUM_ANVIL.asItem()) BCLRecipeBuilder.smithing(BetterEnd.makeID("terminite_anvil_updrade"), EndBlocks.AETERNIUM_ANVIL.asItem())
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(EndBlocks.TERMINITE.anvilBlock.asItem())
.setBase(EndBlocks.TERMINITE.anvilBlock.asItem())
.setAddition(EndItems.AETERNIUM_INGOT) .setAddition(EndItems.AETERNIUM_INGOT)
.build(); .build();
BCLRecipeBuilder.smithing(BetterEnd.makeID("armored_elytra"), EndItems.ARMORED_ELYTRA) BCLRecipeBuilder.smithing(BetterEnd.makeID("armored_elytra"), EndItems.ARMORED_ELYTRA)
.checkConfig(Configs.RECIPE_CONFIG) .setPrimaryInputAndUnlock(Items.ELYTRA)
.setBase(Items.ELYTRA)
.setAddition(EndItems.AETERNIUM_INGOT) .setAddition(EndItems.AETERNIUM_INGOT)
.build(); .build();
} }

View file

@ -9,6 +9,7 @@ import org.betterx.betterend.rituals.InfusionRitual;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.core.NonNullList; import net.minecraft.core.NonNullList;
import net.minecraft.core.RegistryAccess;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.TagParser; import net.minecraft.nbt.TagParser;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
@ -72,7 +73,7 @@ public class InfusionRecipe implements Recipe<InfusionRitual>, UnknownReceipBook
} }
@Override @Override
public ItemStack assemble(InfusionRitual ritual) { public ItemStack assemble(InfusionRitual ritual, RegistryAccess acc) {
return output.copy(); return output.copy();
} }
@ -90,7 +91,7 @@ public class InfusionRecipe implements Recipe<InfusionRitual>, UnknownReceipBook
} }
@Override @Override
public ItemStack getResultItem() { public ItemStack getResultItem(RegistryAccess acc) {
return this.output; return this.output;
} }

View file

@ -22,14 +22,10 @@ import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects; import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.Mob;
import net.minecraft.world.food.FoodProperties; import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.food.Foods; import net.minecraft.world.food.Foods;
import net.minecraft.world.item.Item; import net.minecraft.world.item.*;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.TieredItem;
import net.minecraft.world.item.Tiers;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
@ -101,7 +97,7 @@ public class EndItems {
"aeternium_helmet", "aeternium_helmet",
new BaseArmorItem( new BaseArmorItem(
EndArmorMaterial.AETERNIUM, EndArmorMaterial.AETERNIUM,
EquipmentSlot.HEAD, ArmorItem.Type.HELMET,
makeEndItemSettings().fireResistant() makeEndItemSettings().fireResistant()
) )
); );
@ -109,7 +105,7 @@ public class EndItems {
"aeternium_chestplate", "aeternium_chestplate",
new BaseArmorItem( new BaseArmorItem(
EndArmorMaterial.AETERNIUM, EndArmorMaterial.AETERNIUM,
EquipmentSlot.CHEST, ArmorItem.Type.CHESTPLATE,
makeEndItemSettings().fireResistant() makeEndItemSettings().fireResistant()
) )
); );
@ -117,7 +113,7 @@ public class EndItems {
"aeternium_leggings", "aeternium_leggings",
new BaseArmorItem( new BaseArmorItem(
EndArmorMaterial.AETERNIUM, EndArmorMaterial.AETERNIUM,
EquipmentSlot.LEGS, ArmorItem.Type.LEGGINGS,
makeEndItemSettings().fireResistant() makeEndItemSettings().fireResistant()
) )
); );
@ -125,7 +121,7 @@ public class EndItems {
"aeternium_boots", "aeternium_boots",
new BaseArmorItem( new BaseArmorItem(
EndArmorMaterial.AETERNIUM, EndArmorMaterial.AETERNIUM,
EquipmentSlot.FEET, ArmorItem.Type.BOOTS,
makeEndItemSettings().fireResistant() makeEndItemSettings().fireResistant()
) )
); );

View file

@ -8,6 +8,7 @@ import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.MenuType; import net.minecraft.world.inventory.MenuType;
@ -23,10 +24,10 @@ public class EndMenuTypes {
ResourceLocation id, ResourceLocation id,
BiFunction<Integer, Inventory, T> factory BiFunction<Integer, Inventory, T> factory
) { ) {
MenuType<T> type = new MenuType<>((syncId, inventory) -> factory.apply(syncId, inventory)); MenuType<T> type = new MenuType<>(factory::apply, FeatureFlags.DEFAULT_FLAGS);
return Registry.register(BuiltInRegistries.MENU, id, type); return Registry.register(BuiltInRegistries.MENU, id, type);
} }
public final static void ensureStaticallyLoaded() { public static void ensureStaticallyLoaded() {
} }
} }

View file

@ -115,7 +115,7 @@ public class InfusionRitual implements Container {
progress++; progress++;
if (progress == time) { if (progress == time) {
clearContent(); clearContent();
input.setItem(0, activeRecipe.assemble(this)); input.setItem(0, activeRecipe.assemble(this, world.registryAccess()));
if (world instanceof ServerLevel sl) { if (world instanceof ServerLevel sl) {
sl.getPlayers(p -> p.position() sl.getPlayers(p -> p.position()
.subtract(new Vec3(worldPos.getX(), worldPos.getY(), worldPos.getZ())) .subtract(new Vec3(worldPos.getX(), worldPos.getY(), worldPos.getZ()))
@ -123,8 +123,7 @@ public class InfusionRitual implements Container {
.forEach(p -> BECriteria.INFUSION_FINISHED.trigger(p)); .forEach(p -> BECriteria.INFUSION_FINISHED.trigger(p));
} }
reset(); reset();
} else if (world instanceof ServerLevel) { } else if (world instanceof ServerLevel serverLevel) {
ServerLevel serverLevel = (ServerLevel) world;
BlockPos target = worldPos.above(); BlockPos target = worldPos.above();
double tx = target.getX() + 0.5; double tx = target.getX() + 0.5;
double ty = target.getY() + 0.5; double ty = target.getY() + 0.5;

View file

@ -19,18 +19,18 @@ public class CreativeTabs {
TAB_BLOCKS = FabricItemGroup TAB_BLOCKS = FabricItemGroup
.builder(BetterEnd.makeID("end_blocks")) .builder(BetterEnd.makeID("end_blocks"))
.icon(() -> new ItemStack(EndBlocks.END_MYCELIUM)) .icon(() -> new ItemStack(EndBlocks.END_MYCELIUM))
.displayItems((featureFlagSet, output, bl) -> output.acceptAll(EndBlocks.getModBlockItems() .displayItems((featureFlagSet, output) -> output.acceptAll(EndBlocks.getModBlockItems()
.stream() .stream()
.map(ItemStack::new) .map(ItemStack::new)
.collect(Collectors.toList()))) .collect(Collectors.toList())))
.build(); .build();
TAB_ITEMS = FabricItemGroup TAB_ITEMS = FabricItemGroup
.builder(BetterEnd.makeID("end_items")) .builder(BetterEnd.makeID("end_items"))
.icon(() -> new ItemStack(EndItems.ETERNAL_CRYSTAL)) .icon(() -> new ItemStack(EndItems.ETERNAL_CRYSTAL))
.displayItems((featureFlagSet, output, bl) -> output.acceptAll(EndItems.getModItems() .displayItems((featureFlagSet, output) -> output.acceptAll(EndItems.getModItems()
.stream() .stream()
.map(ItemStack::new) .map(ItemStack::new)
.collect(Collectors.toList()))) .collect(Collectors.toList())))
.build(); .build();
} }
} }

View file

@ -101,9 +101,9 @@ public class CrashedShipFeature extends NBTFeature<NBTFeatureConfig> {
rotation, rotation,
BlockPos.ZERO BlockPos.ZERO
); );
center = center.offset(0, getYOffset(structure, world, center, random) + 0.5, 0); center = center.offset(0, (int) (getYOffset(structure, world, center, random) + 0.5), 0);
StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror); StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror);
center = center.offset(-offset.getX() * 0.5, 0, -offset.getZ() * 0.5); center = center.offset((int) (-offset.getX() * 0.5), 0, (int) (-offset.getZ() * 0.5));
BoundingBox structB = structure.getBoundingBox(placementData, center); BoundingBox structB = structure.getBoundingBox(placementData, center);
bounds = StructureHelper.intersectBoxes(bounds, structB); bounds = StructureHelper.intersectBoxes(bounds, structB);

View file

@ -5,21 +5,18 @@ import org.betterx.bclib.api.v2.levelgen.features.features.DefaultFeature;
import org.betterx.bclib.api.v2.levelgen.structures.templatesystem.DestructionStructureProcessor; import org.betterx.bclib.api.v2.levelgen.structures.templatesystem.DestructionStructureProcessor;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.worlds.together.tag.v3.CommonBlockTags; import org.betterx.worlds.together.tag.v3.CommonBlockTags;
import org.betterx.worlds.together.world.event.WorldBootstrap;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import net.minecraft.core.*; import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.registries.Registries; import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag; import net.minecraft.core.Holder;
import net.minecraft.nbt.NbtIo; import net.minecraft.core.Vec3i;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.util.StringRepresentable; import net.minecraft.util.StringRepresentable;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Mirror; import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
@ -29,9 +26,6 @@ import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings; import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import java.io.IOException;
import java.io.InputStream;
public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC> { public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC> {
public NBTFeature(Codec<FC> codec) { public NBTFeature(Codec<FC> codec) {
super(codec); super(codec);
@ -112,7 +106,7 @@ public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC
rotation, rotation,
BlockPos.ZERO BlockPos.ZERO
); );
center = center.offset(0, getYOffset(structure, world, center, random) + 0.5, 0); center = center.offset(0, (int) (getYOffset(structure, world, center, random) + 0.5), 0);
BoundingBox bounds = makeBox(center); BoundingBox bounds = makeBox(center);
StructurePlaceSettings placementData = new StructurePlaceSettings() StructurePlaceSettings placementData = new StructurePlaceSettings()
@ -120,7 +114,7 @@ public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC
.setMirror(mirror) .setMirror(mirror)
.setBoundingBox(bounds); .setBoundingBox(bounds);
addStructureData(placementData); addStructureData(placementData);
center = center.offset(-offset.getX() * 0.5, 0, -offset.getZ() * 0.5); center = center.offset((int) (-offset.getX() * 0.5), 0, (int) (-offset.getZ() * 0.5));
structure.placeInWorld(world, center, center, placementData, random, 4); structure.placeInWorld(world, center, center, placementData, random, 4);
TerrainMerge merge = getTerrainMerge(world, center, random); TerrainMerge merge = getTerrainMerge(world, center, random);
@ -199,32 +193,6 @@ public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC
return BoundingBox.fromCorners(new Vec3i(sx, 0, sz), new Vec3i(ex, 255, ez)); return BoundingBox.fromCorners(new Vec3i(sx, 0, sz), new Vec3i(ex, 255, ez));
} }
protected static StructureTemplate readStructure(ResourceLocation resource) {
String ns = resource.getNamespace();
String nm = resource.getPath();
try {
InputStream inputstream = MinecraftServer.class.getResourceAsStream("/data/" + ns + "/structures/" + nm + ".nbt");
return readStructureFromStream(inputstream);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
private static StructureTemplate readStructureFromStream(InputStream stream) throws IOException {
final HolderLookup<Block> blockLookup = WorldBootstrap.getLastRegistryAccess()
.lookup(Registries.BLOCK)
.orElseThrow();
CompoundTag nbttagcompound = NbtIo.readCompressed(stream);
StructureTemplate template = new StructureTemplate();
template.load(blockLookup, nbttagcompound);
return template;
}
public enum TerrainMerge implements StringRepresentable { public enum TerrainMerge implements StringRepresentable {
NONE, SURFACE, OBJECT; NONE, SURFACE, OBJECT;

View file

@ -127,15 +127,19 @@ public class GeyserFeature extends DefaultFeature {
obj1 = new SDFCappedCone().setHeight(halfHeight + 5).setRadius1(radius1 * 0.5F).setRadius2(radius2); obj1 = new SDFCappedCone().setHeight(halfHeight + 5).setRadius1(radius1 * 0.5F).setRadius2(radius2);
sdf = new SDFTranslate().setTranslate(0, halfHeight - 13, 0).setSource(obj1); sdf = new SDFTranslate().setTranslate(0, halfHeight - 13, 0).setSource(obj1);
sdf = new SDFDisplacement().setFunction((vec) -> { sdf = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
return (float) noise.eval(vec.x() * 0.3F, vec.y() * 0.3F, vec.z() * 0.3F) * 0.5F; vec.x() * 0.3F,
}).setSource(sdf); vec.y() * 0.3F,
vec.z() * 0.3F
) * 0.5F).setSource(sdf);
obj2 = new SDFSphere().setRadius(radius1); obj2 = new SDFSphere().setRadius(radius1);
SDF cave = new SDFScale3D().setScale(1.5F, 1, 1.5F).setSource(obj2); SDF cave = new SDFScale3D().setScale(1.5F, 1, 1.5F).setSource(obj2);
cave = new SDFDisplacement().setFunction((vec) -> { cave = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
return (float) noise.eval(vec.x() * 0.1F, vec.y() * 0.1F, vec.z() * 0.1F) * 2F; vec.x() * 0.1F,
}).setSource(cave); vec.y() * 0.1F,
vec.z() * 0.1F
) * 2F).setSource(cave);
cave = new SDFTranslate().setTranslate(0, -halfHeight - 10, 0).setSource(cave); cave = new SDFTranslate().setTranslate(0, -halfHeight - 10, 0).setSource(cave);
sdf = new SDFSmoothUnion().setRadius(5).setSourceA(cave).setSourceB(sdf); sdf = new SDFSmoothUnion().setRadius(5).setSourceA(cave).setSourceB(sdf);
@ -147,21 +151,24 @@ public class GeyserFeature extends DefaultFeature {
obj1.setBlock(EndBlocks.BRIMSTONE); obj1.setBlock(EndBlocks.BRIMSTONE);
obj2.setBlock(EndBlocks.BRIMSTONE); obj2.setBlock(EndBlocks.BRIMSTONE);
new SDFDisplacement().setFunction((vec) -> { new SDFDisplacement().setFunction((vec) -> -2F)
return -2F; .setSource(sdf)
}).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE); .setReplaceFunction(REPLACE1)
.fillRecursiveIgnore(world, pos, IGNORE);
obj1.setBlock(EndBlocks.SULPHURIC_ROCK.stone); obj1.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
obj2.setBlock(EndBlocks.SULPHURIC_ROCK.stone); obj2.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
new SDFDisplacement().setFunction((vec) -> { new SDFDisplacement().setFunction((vec) -> -4F)
return -4F; .setSource(cave)
}).setSource(cave).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE); .setReplaceFunction(REPLACE1)
.fillRecursiveIgnore(world, pos, IGNORE);
obj1.setBlock(Blocks.END_STONE); obj1.setBlock(Blocks.END_STONE);
obj2.setBlock(Blocks.END_STONE); obj2.setBlock(Blocks.END_STONE);
new SDFDisplacement().setFunction((vec) -> { new SDFDisplacement().setFunction((vec) -> -6F)
return -6F; .setSource(cave)
}).setSource(cave).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE); .setReplaceFunction(REPLACE1)
.fillRecursiveIgnore(world, pos, IGNORE);
BlocksHelper.setWithoutUpdate(world, pos, WATER); BlocksHelper.setWithoutUpdate(world, pos, WATER);
MutableBlockPos mut = new MutableBlockPos().set(pos); MutableBlockPos mut = new MutableBlockPos().set(pos);
@ -266,17 +273,15 @@ public class GeyserFeature extends DefaultFeature {
)); ));
double distance = radius1 * 1.7; double distance = radius1 * 1.7;
BlockPos start = pos.offset(-distance, -halfHeight - 15 - distance, -distance); BlockPos start = pos.offset((int) -distance, (int) (-halfHeight - 15 - distance), (int) -distance);
BlockPos end = pos.offset(distance, -halfHeight - 5 + distance, distance); BlockPos end = pos.offset((int) distance, (int) (-halfHeight - 5 + distance), (int) distance);
BlockFixer.fixBlocks(world, start, end); BlockFixer.fixBlocks(world, start, end);
return true; return true;
} }
static { static {
REPLACE1 = (state) -> { REPLACE1 = (state) -> state.isAir() || (state.is(CommonBlockTags.GEN_END_STONES));
return state.isAir() || (state.is(CommonBlockTags.GEN_END_STONES));
};
REPLACE2 = (state) -> { REPLACE2 = (state) -> {
if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) { if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) {
@ -288,9 +293,7 @@ public class GeyserFeature extends DefaultFeature {
return state.getMaterial().isReplaceable(); return state.getMaterial().isReplaceable();
}; };
IGNORE = (state) -> { IGNORE = (state) -> state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state .is(EndBlocks.BRIMSTONE);
.is(EndBlocks.BRIMSTONE);
};
} }
} }

View file

@ -58,15 +58,18 @@ public class DragonTreeFeature extends DefaultFeature {
Vector3f last = SplineHelper.getPos(spline, 3.5F); Vector3f last = SplineHelper.getPos(spline, 3.5F);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
float radius = size * MHelper.randRange(0.5F, 0.7F, random); float radius = size * MHelper.randRange(0.5F, 0.7F, random);
makeCap(world, pos.offset(last.x(), last.y(), last.z()), radius, random, noise); makeCap(world, pos.offset((int) last.x(), (int) last.y(), (int) last.z()), radius, random, noise);
last = spline.get(0); last = spline.get(0);
makeRoots(world, pos.offset(last.x(), last.y(), last.z()), radius, random); makeRoots(world, pos.offset((int) last.x(), (int) last.y(), (int) last.z()), radius, random);
radius = MHelper.randRange(1.2F, 2.3F, random); radius = MHelper.randRange(1.2F, 2.3F, random);
SDF function = SplineHelper.buildSDF(spline, radius, 1.2F, (bpos) -> { SDF function = SplineHelper.buildSDF(
return EndBlocks.DRAGON_TREE.getBark().defaultBlockState(); spline,
}); radius,
1.2F,
(bpos) -> EndBlocks.DRAGON_TREE.getBark().defaultBlockState()
);
function.setReplaceFunction(REPLACE); function.setReplaceFunction(REPLACE);
function.addPostProcess(POST); function.addPostProcess(POST);
@ -110,7 +113,8 @@ public class DragonTreeFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { if (world.getBlockState(pos.offset((int) last.x(), (int) last.y(), (int) last.z()))
.is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSpline( SplineHelper.fillSpline(
branch, branch,
world, world,
@ -136,12 +140,12 @@ public class DragonTreeFeature extends DefaultFeature {
sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub);
sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere); sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 1.5F; vec.x() * 0.2,
}).setSource(sphere); vec.y() * 0.2,
sphere = new SDFDisplacement().setFunction((vec) -> { vec.z() * 0.2
return random.nextFloat() * 3F - 1.5F; ) * 1.5F).setSource(sphere);
}).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> random.nextFloat() * 3F - 1.5F).setSource(sphere);
MutableBlockPos mut = new MutableBlockPos(); MutableBlockPos mut = new MutableBlockPos();
sphere.addPostProcess((info) -> { sphere.addPostProcess((info) -> {
if (random.nextInt(5) == 0) { if (random.nextInt(5) == 0) {
@ -183,9 +187,9 @@ public class DragonTreeFeature extends DefaultFeature {
int count = (int) (radius * 2.5F); int count = (int) (radius * 2.5F);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
BlockPos p = pos.offset( BlockPos p = pos.offset(
random.nextGaussian() * 1, (int) (random.nextGaussian() * 1),
random.nextGaussian() * 1, (int) (random.nextGaussian() * 1),
random.nextGaussian() * 1 (int) (random.nextGaussian() * 1)
); );
boolean place = true; boolean place = true;
for (Direction d : Direction.values()) { for (Direction d : Direction.values()) {
@ -218,9 +222,7 @@ public class DragonTreeFeature extends DefaultFeature {
return state.getMaterial().isReplaceable(); return state.getMaterial().isReplaceable();
}; };
IGNORE = (state) -> { IGNORE = EndBlocks.DRAGON_TREE::isTreeLog;
return EndBlocks.DRAGON_TREE.isTreeLog(state);
};
POST = (info) -> { POST = (info) -> {
if (EndBlocks.DRAGON_TREE.isTreeLog(info.getStateUp()) && EndBlocks.DRAGON_TREE.isTreeLog(info.getStateDown())) { if (EndBlocks.DRAGON_TREE.isTreeLog(info.getStateUp()) && EndBlocks.DRAGON_TREE.isTreeLog(info.getStateDown())) {

View file

@ -58,7 +58,9 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
); );
Vector3f capPos = spline.get(spline.size() - 1); Vector3f capPos = spline.get(spline.size() - 1);
makeHead(world, pos.offset(capPos.x() + 0.5F, capPos.y() + 1.5F, capPos.z() + 0.5F), Mth.floor(size / 1.6F)); makeHead(world, pos.offset((int) (capPos.x() + 0.5F), (int) (capPos.y() + 1.5F),
(int) (capPos.z() + 0.5F)
), Mth.floor(size / 1.6F));
function.setReplaceFunction(REPLACE); function.setReplaceFunction(REPLACE);
function.addPostProcess(POST); function.addPostProcess(POST);

View file

@ -45,24 +45,25 @@ public class HelixTreeFeature extends DefaultFeature {
float dx; float dx;
float dz; float dz;
List<Vector3f> spline = new ArrayList<Vector3f>(10); List<Vector3f> spline = new ArrayList<>(10);
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
float radius = (0.9F - i * 0.1F) * radiusRange; float radius = (0.9F - i * 0.1F) * radiusRange;
dx = (float) Math.sin(i + angle) * radius; dx = (float) Math.sin(i + angle) * radius;
dz = (float) Math.cos(i + angle) * radius; dz = (float) Math.cos(i + angle) * radius;
spline.add(new Vector3f(dx, i * 2, dz)); spline.add(new Vector3f(dx, i * 2, dz));
} }
SDF sdf = SplineHelper.buildSDF(spline, 1.7F, 0.5F, (p) -> { SDF sdf = SplineHelper.buildSDF(spline, 1.7F, 0.5F, (p) -> EndBlocks.HELIX_TREE.getBark().defaultBlockState());
return EndBlocks.HELIX_TREE.getBark().defaultBlockState();
});
SDF rotated = new SDFRotation().setRotation(Axis.YP, (float) Math.PI).setSource(sdf); SDF rotated = new SDFRotation().setRotation(Axis.YP, (float) Math.PI).setSource(sdf);
sdf = new SDFUnion().setSourceA(rotated).setSourceB(sdf); sdf = new SDFUnion().setSourceA(rotated).setSourceB(sdf);
Vector3f lastPoint = spline.get(spline.size() - 1); Vector3f lastPoint = spline.get(spline.size() - 1);
List<Vector3f> spline2 = SplineHelper.makeSpline(0, 0, 0, 0, 20, 0, 5); List<Vector3f> spline2 = SplineHelper.makeSpline(0, 0, 0, 0, 20, 0, 5);
SDF stem = SplineHelper.buildSDF(spline2, 1.0F, 0.5F, (p) -> { SDF stem = SplineHelper.buildSDF(
return EndBlocks.HELIX_TREE.getBark().defaultBlockState(); spline2,
}); 1.0F,
0.5F,
(p) -> EndBlocks.HELIX_TREE.getBark().defaultBlockState()
);
stem = new SDFTranslate().setTranslate(lastPoint.x(), lastPoint.y(), lastPoint.z()).setSource(stem); stem = new SDFTranslate().setTranslate(lastPoint.x(), lastPoint.y(), lastPoint.z()).setSource(stem);
sdf = new SDFSmoothUnion().setRadius(3).setSourceA(sdf).setSourceB(stem); sdf = new SDFSmoothUnion().setRadius(3).setSourceA(sdf).setSourceB(stem);
@ -70,16 +71,22 @@ public class HelixTreeFeature extends DefaultFeature {
dx = 30 * scale; dx = 30 * scale;
float dy1 = -20 * scale; float dy1 = -20 * scale;
float dy2 = 100 * scale; float dy2 = 100 * scale;
sdf.addPostProcess(POST).fillArea(world, pos, new AABB(pos.offset(-dx, dy1, -dx), pos.offset(dx, dy2, dx))); sdf.addPostProcess(POST)
.fillArea(
world,
pos,
new AABB(
pos.offset((int) -dx, (int) dy1, (int) -dx),
pos.offset((int) dx, (int) dy2, (int) dx)
)
);
SplineHelper.scale(spline, scale); SplineHelper.scale(spline, scale);
SplineHelper.fillSplineForce( SplineHelper.fillSplineForce(
spline, spline,
world, world,
EndBlocks.HELIX_TREE.getBark().defaultBlockState(), EndBlocks.HELIX_TREE.getBark().defaultBlockState(),
pos, pos,
(state) -> { (state) -> state.getMaterial().isReplaceable()
return state.getMaterial().isReplaceable();
}
); );
SplineHelper.rotateSpline(spline, (float) Math.PI); SplineHelper.rotateSpline(spline, (float) Math.PI);
SplineHelper.fillSplineForce( SplineHelper.fillSplineForce(
@ -87,20 +94,20 @@ public class HelixTreeFeature extends DefaultFeature {
world, world,
EndBlocks.HELIX_TREE.getBark().defaultBlockState(), EndBlocks.HELIX_TREE.getBark().defaultBlockState(),
pos, pos,
(state) -> { (state) -> state.getMaterial().isReplaceable()
return state.getMaterial().isReplaceable();
}
); );
SplineHelper.scale(spline2, scale); SplineHelper.scale(spline2, scale);
BlockPos leafStart = pos.offset(lastPoint.x() + 0.5, lastPoint.y() + 0.5, lastPoint.z() + 0.5); BlockPos leafStart = pos.offset(
(int) (lastPoint.x() + 0.5),
(int) (lastPoint.y() + 0.5),
(int) (lastPoint.z() + 0.5)
);
SplineHelper.fillSplineForce( SplineHelper.fillSplineForce(
spline2, spline2,
world, world,
EndBlocks.HELIX_TREE.getLog().defaultBlockState(), EndBlocks.HELIX_TREE.getLog().defaultBlockState(),
leafStart, leafStart,
(state) -> { (state) -> state.getMaterial().isReplaceable()
return state.getMaterial().isReplaceable();
}
); );
spline.clear(); spline.clear();
@ -149,7 +156,7 @@ public class HelixTreeFeature extends DefaultFeature {
} }
leaf = leaf.setValue(HelixTreeLeavesBlock.COLOR, 7); leaf = leaf.setValue(HelixTreeLeavesBlock.COLOR, 7);
leafStart = leafStart.offset(0, lastPoint.y(), 0); leafStart = leafStart.offset(0, (int) lastPoint.y(), 0);
if (world.getBlockState(leafStart).isAir()) { if (world.getBlockState(leafStart).isAir()) {
BlocksHelper.setWithoutUpdate(world, leafStart, leaf); BlocksHelper.setWithoutUpdate(world, leafStart, leaf);
leafStart = leafStart.above(); leafStart = leafStart.above();

View file

@ -44,9 +44,7 @@ public class JellyshroomFeature extends DefaultFeature {
float radius = height * MHelper.randRange(0.15F, 0.25F, random); float radius = height * MHelper.randRange(0.15F, 0.25F, random);
List<Vector3f> spline = SplineHelper.makeSpline(0, -1, 0, 0, height, 0, 3); List<Vector3f> spline = SplineHelper.makeSpline(0, -1, 0, 0, height, 0, 3);
SplineHelper.offsetParts(spline, random, 0.5F, 0, 0.5F); SplineHelper.offsetParts(spline, random, 0.5F, 0, 0.5F);
SDF sdf = SplineHelper.buildSDF(spline, radius, 0.8F, (bpos) -> { SDF sdf = SplineHelper.buildSDF(spline, radius, 0.8F, (bpos) -> bark);
return bark;
});
radius = height * MHelper.randRange(0.7F, 0.9F, random); radius = height * MHelper.randRange(0.7F, 0.9F, random);
if (radius < 1.5F) { if (radius < 1.5F) {
@ -87,7 +85,8 @@ public class JellyshroomFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { if (world.getBlockState(pos.offset((int) last.x(), (int) last.y(), (int) last.z()))
.is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSpline(branch, world, wood, pos, REPLACE); SplineHelper.fillSpline(branch, world, wood, pos, REPLACE);
} }
} }

View file

@ -56,12 +56,15 @@ public class LacugroveFeature extends DefaultFeature {
float radius = MHelper.randRange(6F, 8F, random); float radius = MHelper.randRange(6F, 8F, random);
radius *= (size - 15F) / 20F + 1F; radius *= (size - 15F) / 20F + 1F;
Vector3f center = spline.get(4); Vector3f center = spline.get(4);
leavesBall(world, pos.offset(center.x(), center.y(), center.z()), radius, random, noise); leavesBall(world, pos.offset((int) center.x(), (int) center.y(), (int) center.z()), radius, random, noise);
radius = MHelper.randRange(1.2F, 1.8F, random); radius = MHelper.randRange(1.2F, 1.8F, random);
SDF function = SplineHelper.buildSDF(spline, radius, 0.7F, (bpos) -> { SDF function = SplineHelper.buildSDF(
return EndBlocks.LACUGROVE.getBark().defaultBlockState(); spline,
}); radius,
0.7F,
(bpos) -> EndBlocks.LACUGROVE.getBark().defaultBlockState()
);
function.setReplaceFunction(REPLACE); function.setReplaceFunction(REPLACE);
function.addPostProcess(POST); function.addPostProcess(POST);
@ -125,12 +128,12 @@ public class LacugroveFeature extends DefaultFeature {
SDF sphere = new SDFSphere().setRadius(radius) SDF sphere = new SDFSphere().setRadius(radius)
.setBlock(EndBlocks.LACUGROVE_LEAVES.defaultBlockState() .setBlock(EndBlocks.LACUGROVE_LEAVES.defaultBlockState()
.setValue(LeavesBlock.DISTANCE, 6)); .setValue(LeavesBlock.DISTANCE, 6));
sphere = new SDFDisplacement().setFunction((vec) -> { sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3; vec.x() * 0.2,
}).setSource(sphere); vec.y() * 0.2,
sphere = new SDFDisplacement().setFunction((vec) -> { vec.z() * 0.2
return random.nextFloat() * 3F - 1.5F; ) * 3).setSource(sphere);
}).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> random.nextFloat() * 3F - 1.5F).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere) sphere = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere)); .setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere));
MutableBlockPos mut = new MutableBlockPos(); MutableBlockPos mut = new MutableBlockPos();
@ -174,9 +177,9 @@ public class LacugroveFeature extends DefaultFeature {
int count = (int) (radius * 2.5F); int count = (int) (radius * 2.5F);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
BlockPos p = pos.offset( BlockPos p = pos.offset(
random.nextGaussian() * 1, (int) (random.nextGaussian() * 1),
random.nextGaussian() * 1, (int) (random.nextGaussian() * 1),
random.nextGaussian() * 1 (int) (random.nextGaussian() * 1)
); );
boolean place = true; boolean place = true;
for (Direction d : Direction.values()) { for (Direction d : Direction.values()) {
@ -212,9 +215,7 @@ public class LacugroveFeature extends DefaultFeature {
return state.getMaterial().isReplaceable(); return state.getMaterial().isReplaceable();
}; };
IGNORE = (state) -> { IGNORE = EndBlocks.LACUGROVE::isTreeLog;
return EndBlocks.LACUGROVE.isTreeLog(state);
};
POST = (info) -> { POST = (info) -> {
if (EndBlocks.LACUGROVE.isTreeLog(info.getStateUp()) && EndBlocks.LACUGROVE.isTreeLog(info.getStateDown())) { if (EndBlocks.LACUGROVE.isTreeLog(info.getStateUp()) && EndBlocks.LACUGROVE.isTreeLog(info.getStateDown())) {

View file

@ -61,7 +61,14 @@ public class LucerniaFeature extends DefaultFeature {
Vector3f last = spline.get(spline.size() - 1); Vector3f last = spline.get(spline.size() - 1);
float leavesRadius = (size * 0.13F + MHelper.randRange(0.8F, 1.5F, random)) * 1.4F; float leavesRadius = (size * 0.13F + MHelper.randRange(0.8F, 1.5F, random)) * 1.4F;
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
leavesBall(world, pos.offset(last.x(), last.y(), last.z()), leavesRadius, random, noise, config != null); leavesBall(
world,
pos.offset((int) last.x(), (int) last.y(), (int) last.z()),
leavesRadius,
random,
noise,
config != null
);
} }
makeRoots(world, pos.offset(0, MHelper.randRange(3, 5, random), 0), size * 0.35F, random); makeRoots(world, pos.offset(0, MHelper.randRange(3, 5, random), 0), size * 0.35F, random);
@ -191,7 +198,8 @@ public class LucerniaFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { if (world.getBlockState(pos.offset((int) last.x(), (int) last.y(), (int) last.z()))
.is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSplineForce( SplineHelper.fillSplineForce(
branch, branch,
world, world,

View file

@ -64,9 +64,12 @@ public class PythadendronTreeFeature extends DefaultFeature {
pos pos
); );
SDF function = SplineHelper.buildSDF(spline, 1.7F, 1.1F, (bpos) -> { SDF function = SplineHelper.buildSDF(
return EndBlocks.PYTHADENDRON.getBark().defaultBlockState(); spline,
}); 1.7F,
1.1F,
(bpos) -> EndBlocks.PYTHADENDRON.getBark().defaultBlockState()
);
function.setReplaceFunction(REPLACE); function.setReplaceFunction(REPLACE);
function.addPostProcess(POST); function.addPostProcess(POST);
function.fillRecursive(world, pos); function.fillRecursive(world, pos);
@ -124,10 +127,10 @@ public class PythadendronTreeFeature extends DefaultFeature {
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
if (depth < 3) { if (depth < 3) {
if (s1) { if (s1) {
leavesBall(world, pos.offset(pos1.x(), pos1.y(), pos1.z()), random, noise); leavesBall(world, pos.offset((int) pos1.x(), (int) pos1.y(), (int) pos1.z()), random, noise);
} }
if (s2) { if (s2) {
leavesBall(world, pos.offset(pos2.x(), pos2.y(), pos2.z()), random, noise); leavesBall(world, pos.offset((int) pos2.x(), (int) pos2.y(), (int) pos2.z()), random, noise);
} }
} }
@ -151,12 +154,12 @@ public class PythadendronTreeFeature extends DefaultFeature {
.setBlock(EndBlocks.PYTHADENDRON_LEAVES.defaultBlockState() .setBlock(EndBlocks.PYTHADENDRON_LEAVES.defaultBlockState()
.setValue(LeavesBlock.DISTANCE, 6)); .setValue(LeavesBlock.DISTANCE, 6));
sphere = new SDFScale3D().setScale(1, 0.6F, 1).setSource(sphere); sphere = new SDFScale3D().setScale(1, 0.6F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3; vec.x() * 0.2,
}).setSource(sphere); vec.y() * 0.2,
sphere = new SDFDisplacement().setFunction((vec) -> { vec.z() * 0.2
return random.nextFloat() * 3F - 1.5F; ) * 3).setSource(sphere);
}).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> random.nextFloat() * 3F - 1.5F).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere) sphere = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
MutableBlockPos mut = new MutableBlockPos(); MutableBlockPos mut = new MutableBlockPos();
@ -211,9 +214,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
return state.getMaterial().isReplaceable(); return state.getMaterial().isReplaceable();
}; };
IGNORE = (state) -> { IGNORE = EndBlocks.PYTHADENDRON::isTreeLog;
return EndBlocks.PYTHADENDRON.isTreeLog(state);
};
POST = (info) -> { POST = (info) -> {
if (EndBlocks.PYTHADENDRON.isTreeLog(info.getStateUp()) && EndBlocks.PYTHADENDRON.isTreeLog(info.getStateDown())) { if (EndBlocks.PYTHADENDRON.isTreeLog(info.getStateUp()) && EndBlocks.PYTHADENDRON.isTreeLog(info.getStateDown())) {

View file

@ -58,7 +58,7 @@ public class TenaneaFeature extends DefaultFeature {
Vector3f last = spline.get(spline.size() - 1); Vector3f last = spline.get(spline.size() - 1);
float leavesRadius = (size * 0.3F + MHelper.randRange(0.8F, 1.5F, random)) * 1.4F; float leavesRadius = (size * 0.3F + MHelper.randRange(0.8F, 1.5F, random)) * 1.4F;
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
leavesBall(world, pos.offset(last.x(), last.y(), last.z()), leavesRadius, random, noise); leavesBall(world, pos.offset((int) last.x(), (int) last.y(), (int) last.z()), leavesRadius, random, noise);
} }
return true; return true;

View file

@ -74,15 +74,13 @@ public class UmbrellaTreeFeature extends DefaultFeature {
if (SplineHelper.canGenerate(spline, pos, world, REPLACE)) { if (SplineHelper.canGenerate(spline, pos, world, REPLACE)) {
float rScale = (scale - 1) * 0.4F + 1; float rScale = (scale - 1) * 0.4F + 1;
SDF branch = SplineHelper.buildSDF(spline, 1.2F * rScale, 0.8F * rScale, (bpos) -> { SDF branch = SplineHelper.buildSDF(spline, 1.2F * rScale, 0.8F * rScale, (bpos) -> wood);
return wood;
});
Vector3f vec = spline.get(spline.size() - 1); Vector3f vec = spline.get(spline.size() - 1);
float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.4F; float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.4F;
sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch); sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch);
SDF mem = makeMembrane(world, radius, random, membrane, center); SDF mem = makeMembrane(radius, random, membrane, center);
float px = MHelper.floor(vec.x()) + 0.5F; float px = MHelper.floor(vec.x()) + 0.5F;
float py = MHelper.floor(vec.y()) + 0.5F; float py = MHelper.floor(vec.y()) + 0.5F;
@ -95,8 +93,6 @@ public class UmbrellaTreeFeature extends DefaultFeature {
pos.getZ() + (double) (pz * scale), pos.getZ() + (double) (pz * scale),
radius * scale radius * scale
)); ));
vec = spline.get(0);
} }
} }
@ -131,7 +127,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
makeRoots(world, pos, (size * 0.5F + 3) * scale, random, wood); makeRoots(world, pos, (size * 0.5F + 3) * scale, random, wood);
for (Center c : centers) { for (Center c : centers) {
if (!world.getBlockState(new BlockPos(c.px, c.py, c.pz)).isAir()) { if (!world.getBlockState(new BlockPos((int) c.px, (int) c.py, (int) c.pz)).isAir()) {
count = MHelper.floor(MHelper.randRange(5F, 10F, random) * scale); count = MHelper.floor(MHelper.randRange(5F, 10F, random) * scale);
float startAngle = random.nextFloat() * MHelper.PI2; float startAngle = random.nextFloat() * MHelper.PI2;
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
@ -139,7 +135,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
float dist = MHelper.randRange(1.5F, 2.5F, random) * scale; float dist = MHelper.randRange(1.5F, 2.5F, random) * scale;
double px = c.px + Math.sin(angle) * dist; double px = c.px + Math.sin(angle) * dist;
double pz = c.pz + Math.cos(angle) * dist; double pz = c.pz + Math.cos(angle) * dist;
makeFruits(world, px, c.py - 1, pz, fruit, scale); makeFruits(world, px, c.py - 1, pz, fruit);
} }
} }
} }
@ -157,14 +153,14 @@ public class UmbrellaTreeFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { if (world.getBlockState(pos.offset((int) last.x(), (int) last.y(), (int) last.z()))
.is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE); SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE);
} }
} }
} }
private SDF makeMembrane( private SDF makeMembrane(
WorldGenLevel world,
float radius, float radius,
RandomSource random, RandomSource random,
BlockState membrane, BlockState membrane,
@ -189,7 +185,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
return sphere; return sphere;
} }
private void makeFruits(WorldGenLevel world, double px, double py, double pz, BlockState fruit, float scale) { private void makeFruits(WorldGenLevel world, double px, double py, double pz, BlockState fruit) {
MutableBlockPos mut = new MutableBlockPos().set(px, py, pz); MutableBlockPos mut = new MutableBlockPos().set(px, py, pz);
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
mut.move(Direction.DOWN); mut.move(Direction.DOWN);
@ -230,7 +226,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
}; };
} }
private class Center { private static class Center {
final double px; final double px;
final double py; final double py;
final double pz; final double pz;

View file

@ -29,7 +29,8 @@ public class EndLandBiomeDecider extends BiomeDecider {
@Override @Override
public BiomeDecider createInstance(BCLBiomeSource biomeSource) { public BiomeDecider createInstance(BCLBiomeSource biomeSource) {
return new EndLandBiomeDecider(biomeSource.getBiomeRegistry()); //TODO: 1.19.4: This ok?
return new EndLandBiomeDecider(/*biomeSource.getBiomeRegistry()*/);
} }
@Override @Override

View file

@ -24,7 +24,7 @@ public class IslandLayer {
private final SDFRadialNoiseMap noise; private final SDFRadialNoiseMap noise;
private final SDF island; private final SDF island;
private final List<BlockPos> positions = new ArrayList<BlockPos>(9); private final List<BlockPos> positions = new ArrayList<>(9);
private final Map<BlockPos, SDF> islands = Maps.newHashMap(); private final Map<BlockPos, SDF> islands = Maps.newHashMap();
private final OpenSimplexNoise density; private final OpenSimplexNoise density;
private final int seed; private final int seed;
@ -67,17 +67,15 @@ public class IslandLayer {
positions.clear(); positions.clear();
for (int pox = -1; pox < 2; pox++) { for (int pox = -1; pox < 2; pox++) {
int px = pox + ix; int px = pox + ix;
long px2 = px;
for (int poz = -1; poz < 2; poz++) { for (int poz = -1; poz < 2; poz++) {
int pz = poz + iz; int pz = poz + iz;
long pz2 = pz; if ((long) px * (long) px + (long) pz * (long) pz > options.centerDist) {
if (px2 * px2 + pz2 * pz2 > options.centerDist) {
RANDOM.setSeed(getSeed(px, pz)); RANDOM.setSeed(getSeed(px, pz));
double posX = (px + RANDOM.nextFloat()) * options.distance; double posX = (px + RANDOM.nextFloat()) * options.distance;
double posY = MHelper.randRange(options.minY, options.maxY, RANDOM) * maxHeight; double posY = MHelper.randRange(options.minY, options.maxY, RANDOM) * maxHeight;
double posZ = (pz + RANDOM.nextFloat()) * options.distance; double posZ = (pz + RANDOM.nextFloat()) * options.distance;
if (density.eval(posX * 0.01, posZ * 0.01) > options.coverage) { if (density.eval(posX * 0.01, posZ * 0.01) > options.coverage) {
positions.add(new BlockPos(posX, posY, posZ)); positions.add(new BlockPos((int) posX, (int) posY, (int) posZ));
} }
} }
} }