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 net.minecraft.core.BlockPos;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
@ -29,7 +28,7 @@ public class NeedlegrassBlock extends EndPlantBlock {
@SuppressWarnings("deprecation")
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
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.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.*;
@ -330,7 +329,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
@Override
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) {

View file

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

View file

@ -80,7 +80,6 @@ public class BetterEndSkyRenderer implements DimensionRenderingRegistry.SkyRende
FogRenderer.levelFogColor();
RenderSystem.depthMask(false);
RenderSystem.enableTexture();
RenderSystem.enableBlend();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
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) {
matrices.pushPose();
matrices.mulPose(new Quaternionf().setAngleAxis(time3, axis1.x, axis1.y, axis1.z));
@ -196,7 +193,6 @@ public class BetterEndSkyRenderer implements DimensionRenderingRegistry.SkyRende
matrices.popPose();
}
RenderSystem.enableTexture();
RenderSystem.depthMask(true);
RenderSystem.defaultBlendFunc();
RenderSystem.disableBlend();

View file

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

View file

@ -41,7 +41,9 @@ import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import com.google.common.base.Stopwatch;
import org.joml.Vector3d;
import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
public class CommandRegistry {
public static void register() {
@ -62,45 +64,18 @@ public class CommandRegistry {
)
.then(Commands.literal("tpnext")
.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 {
final CommandSourceStack source = ctx.getSource();
final ServerPlayer player = source.getPlayerOrException();
Vec3 pos = source.getPosition();
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);
Optional<BlockPos> found = poi.findPoiAround(level, mPos, false, level.getWorldBorder());
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_VERTICAL = 64;
private static final DynamicCommandExceptionType ERROR_BIOME_NOT_FOUND = new DynamicCommandExceptionType(
(object) -> {
return Component.literal("The next biome (" + object + ") was not found.");
});
(object) -> Component.literal("The next biome (" + object + ") was not found."));
private static int teleportToNextBiome(CommandContext<CommandSourceStack> ctx) throws CommandSyntaxException {
final CommandSourceStack source = ctx.getSource();
@ -137,7 +110,11 @@ public class CommandRegistry {
.setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GREEN)), false);
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()
.findClosestBiome3d(
b -> b.unwrapKey().orElseThrow().location().equals(biome.getID()),
@ -158,7 +135,7 @@ public class CommandRegistry {
double yPos = source.getPosition().y();
boolean didWrap = false;
do {
target = new BlockPos(biomePosition.getX(), yPos, biomePosition.getZ());
target = new BlockPos(biomePosition.getX(), (int) yPos, biomePosition.getZ());
state = player.level.getBlockState(target);
yPos--;
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.util.BlocksHelper;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.registries.BuiltInRegistries;
@ -43,7 +42,6 @@ public class ColoredMaterial {
EndBlocks.registerBlock(blockName, block);
if (craftEight) {
BCLRecipeBuilder.crafting(BetterEnd.makeID(blockName), block)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(8)
.setShape("###", "#D#", "###")
.addMaterial('#', source)
@ -51,7 +49,6 @@ public class ColoredMaterial {
.build();
} else {
BCLRecipeBuilder.crafting(BetterEnd.makeID(blockName), block)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("#D")
.addMaterial('#', source)
.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.basis.LitBaseBlock;
import org.betterx.betterend.blocks.basis.LitPillarBlock;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.recipe.CraftingRecipes;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.worlds.together.tag.v3.TagManager;
@ -48,56 +47,48 @@ public class CrystalSubblocksMaterial {
// Recipes //
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks"), bricks)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("##", "##")
.addMaterial('#', source)
.setGroup("end_bricks")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_polished"), polished)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("##", "##")
.addMaterial('#', bricks)
.setGroup("end_tile")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tiles"), tiles)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("##", "##")
.addMaterial('#', polished)
.setGroup("end_small_tile")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pillar"), pillar)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("#", "#")
.addMaterial('#', slab)
.setGroup("end_pillar")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("# ", "## ", "###")
.addMaterial('#', source)
.setGroup("end_stone_stairs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###")
.addMaterial('#', source)
.setGroup("end_stone_slabs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_stairs"), brick_stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("# ", "## ", "###")
.addMaterial('#', bricks)
.setGroup("end_stone_stairs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_slab"), brick_slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###")
.addMaterial('#', bricks)
@ -105,14 +96,12 @@ public class CrystalSubblocksMaterial {
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_wall"), wall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###", "###")
.addMaterial('#', source)
.setGroup("end_wall")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_wall"), brick_wall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###", "###")
.addMaterial('#', bricks)

View file

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

View file

@ -12,7 +12,6 @@ import org.betterx.betterend.blocks.BulbVineLanternBlock;
import org.betterx.betterend.blocks.BulbVineLanternColoredBlock;
import org.betterx.betterend.blocks.ChandelierBlock;
import org.betterx.betterend.blocks.basis.EndAnvilBlock;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.item.EndArmorItem;
import org.betterx.betterend.item.tool.EndHammerItem;
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.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.*;
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.Blocks;
import net.minecraft.world.level.block.SoundType;
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.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
@ -190,11 +186,14 @@ public class MetalMaterial {
tile = EndBlocks.registerBlock(name + "_tile", new BaseBlock(settings));
stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(tile));
slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(tile));
door = EndBlocks.registerBlock(name + "_door", new BaseDoorBlock(block));
trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BaseTrapdoorBlock(block));
door = EndBlocks.registerBlock(name + "_door", new BaseDoorBlock(block, BlockSetType.IRON));
trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BaseTrapdoorBlock(block, BlockSetType.IRON));
bars = EndBlocks.registerBlock(name + "_bars", new BaseMetalBarsBlock(block));
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));
bulb_lantern = EndBlocks.registerBlock(name + "_bulb_lantern", new BulbVineLanternBlock(lanternProperties));
@ -221,16 +220,19 @@ public class MetalMaterial {
);
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(
name + "_chestplate",
new EndArmorItem(armor, EquipmentSlot.CHEST, itemSettings)
new EndArmorItem(armor, ArmorItem.Type.CHESTPLATE, itemSettings)
);
leggings = EndItems.registerEndItem(
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(
name + "_anvil",
@ -239,17 +241,12 @@ public class MetalMaterial {
if (hasOre) {
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_ingot_furnace_ore"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(ore)
.setGroup("end_ingot")
.setPrimaryInputAndUnlock(ore)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_ingot_furnace_raw"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(rawOre)
.setGroup("end_ingot")
.setPrimaryInputAndUnlock(rawOre)
.buildWithBlasting();
BCLRecipeBuilder.alloying(BetterEnd.makeID(name + "_ingot_alloy"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(alloyingOre, alloyingOre)
.setOutputCount(3)
.setExperience(2.1F)
@ -258,96 +255,82 @@ public class MetalMaterial {
// Basic recipes
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_ingot_from_nuggets"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###")
.addMaterial('#', nugget)
.setGroup("end_metal_ingots_nug")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_nuggets_from_ingot"), nugget)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(9)
.setList("#")
.shapeless()
.addMaterial('#', ingot)
.setGroup("end_metal_nuggets_ing")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_block"), block)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###")
.addMaterial('#', ingot)
.setGroup("end_metal_blocks")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_ingot_from_block"), ingot)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(9)
.setList("#")
.shapeless()
.addMaterial('#', block)
.setGroup("end_metal_ingots")
.build();
// Block recipes
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tile"), tile)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("##", "##")
.addMaterial('#', block)
.setGroup("end_metal_tiles")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bars"), bars)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(16)
.setShape("###", "###")
.addMaterial('#', ingot)
.setGroup("end_metal_bars")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pressure_plate"), pressurePlate)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##")
.addMaterial('#', ingot)
.setGroup("end_metal_plates")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_door"), door)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(3)
.setShape("##", "##", "##")
.addMaterial('#', ingot)
.setGroup("end_metal_doors")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_trapdoor"), trapdoor)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##")
.addMaterial('#', ingot)
.setGroup("end_metal_trapdoors")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("# ", "## ", "###")
.addMaterial('#', block, tile)
.setGroup("end_metal_stairs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###")
.addMaterial('#', block, tile)
.setGroup("end_metal_slabs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chain"), chain)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("N", "#", "N")
.addMaterial('#', ingot)
.addMaterial('N', nugget)
.setGroup("end_metal_chain")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_anvil"), anvilBlock)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", " I ", "III")
.addMaterial('#', block, tile)
.addMaterial('I', ingot)
.setGroup("end_metal_anvil")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bulb_lantern"), bulb_lantern)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("C", "I", "#")
.addMaterial('C', chain)
.addMaterial('I', ingot)
@ -355,7 +338,6 @@ public class MetalMaterial {
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chandelier"), chandelier)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("I#I", " # ")
.addMaterial('#', ingot)
.addMaterial('I', EndItems.LUMECORN_ROD)
@ -363,85 +345,70 @@ public class MetalMaterial {
.build();
// Tools & armor into nuggets
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_axe_nugget"), nugget).setInput(axe)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_axe_nugget"), nugget)
.setPrimaryInputAndUnlock(axe)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hoe_nugget"), nugget).setInput(hoe)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hoe_nugget"), nugget)
.setPrimaryInputAndUnlock(hoe)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_pickaxe_nugget"), nugget).setInput(pickaxe)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_pickaxe_nugget"), nugget)
.setPrimaryInputAndUnlock(pickaxe)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_sword_nugget"), nugget).setInput(sword)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_sword_nugget"), nugget)
.setPrimaryInputAndUnlock(sword)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hammer_nugget"), nugget).setInput(hammer)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_hammer_nugget"), nugget)
.setPrimaryInputAndUnlock(hammer)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_helmet_nugget"), nugget).setInput(helmet)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_helmet_nugget"), nugget)
.setPrimaryInputAndUnlock(helmet)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_chestplate_nugget"), nugget).setInput(chestplate)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_chestplate_nugget"), nugget)
.setPrimaryInputAndUnlock(chestplate)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_leggings_nugget"), nugget).setInput(leggings)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_leggings_nugget"), nugget)
.setPrimaryInputAndUnlock(leggings)
.buildWithBlasting();
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_boots_nugget"), nugget).setInput(boots)
.checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget")
BCLRecipeBuilder.smelting(BetterEnd.makeID(name + "_boots_nugget"), nugget)
.setPrimaryInputAndUnlock(boots)
.buildWithBlasting();
// Tool parts from ingots
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_shovel_head"), shovelHead)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot)
.setPrimaryInput(ingot)
.setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level)
.setDamage(level)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_pickaxe_head"), pickaxeHead)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot)
.setPrimaryInput(ingot)
.setInputCount(3)
.setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level)
.setDamage(level)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_axe_head"), axeHead)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot)
.setPrimaryInput(ingot)
.setInputCount(3)
.setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level)
.setDamage(level)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_hoe_head"), hoeHead)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot)
.setPrimaryInput(ingot)
.setInputCount(2)
.setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level)
.setDamage(level)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_sword_blade"), swordBlade)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot)
.setPrimaryInput(ingot)
.setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level)
.setDamage(level)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID(name + "_forged_plate"), forgedPlate)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot)
.setPrimaryInput(ingot)
.setAnvilLevel(anvilAndToolLevel)
.setToolLevel(level)
.setDamage(level)
@ -449,62 +416,51 @@ public class MetalMaterial {
// Tools from parts
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_hammer"), hammer)
.checkConfig(Configs.RECIPE_CONFIG)
.setBase(block)
.setPrimaryInputAndUnlock(block)
.setAddition(Items.STICK)
.build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_axe"), axe)
.checkConfig(Configs.RECIPE_CONFIG)
.setBase(axeHead)
.setPrimaryInputAndUnlock(axeHead)
.setAddition(Items.STICK)
.build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_pickaxe"), pickaxe)
.checkConfig(Configs.RECIPE_CONFIG)
.setBase(pickaxeHead)
.setPrimaryInputAndUnlock(pickaxeHead)
.setAddition(Items.STICK)
.build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_hoe"), hoe)
.checkConfig(Configs.RECIPE_CONFIG)
.setBase(hoeHead)
.setPrimaryInputAndUnlock(hoeHead)
.setAddition(Items.STICK)
.build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_sword_handle"), swordHandle)
.checkConfig(Configs.RECIPE_CONFIG)
.setBase(ingot)
.setPrimaryInputAndUnlock(ingot)
.setAddition(Items.STICK)
.build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_sword"), sword)
.checkConfig(Configs.RECIPE_CONFIG)
.setBase(swordBlade)
.setPrimaryInputAndUnlock(swordBlade)
.setAddition(swordHandle)
.build();
BCLRecipeBuilder.smithing(BetterEnd.makeID(name + "_shovel"), shovel)
.checkConfig(Configs.RECIPE_CONFIG)
.setBase(shovelHead)
.setPrimaryInputAndUnlock(shovelHead)
.setAddition(Items.STICK)
.build();
// Armor crafting
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_helmet"), helmet)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #")
.addMaterial('#', forgedPlate)
.setGroup("end_metal_helmets")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_chestplate"), chestplate)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("# #", "###", "###")
.addMaterial('#', forgedPlate)
.setGroup("end_metal_chestplates")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_leggings"), leggings)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #", "# #")
.addMaterial('#', forgedPlate)
.setGroup("end_metal_leggings")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_boots"), boots)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("# #", "# #")
.addMaterial('#', forgedPlate)
.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.FlowerPotBlock;
import org.betterx.betterend.blocks.basis.StoneLanternBlock;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.recipe.CraftingRecipes;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
@ -18,6 +17,7 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.level.block.Block;
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.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
@ -59,8 +59,11 @@ public class StoneMaterial {
stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(stone));
slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(stone));
wall = EndBlocks.registerBlock(name + "_wall", new BaseWallBlock(stone));
button = EndBlocks.registerBlock(name + "_button", new BaseStoneButtonBlock(stone));
pressurePlate = EndBlocks.registerBlock(name + "_plate", new StonePressurePlateBlock(stone));
button = EndBlocks.registerBlock(name + "_button", new BaseStoneButtonBlock(stone, BlockSetType.STONE));
pressurePlate = EndBlocks.registerBlock(
name + "_plate",
new StonePressurePlateBlock(stone, BlockSetType.STONE)
);
pedestal = EndBlocks.registerBlock(name + "_pedestal", new EndPedestal(stone));
lantern = EndBlocks.registerBlock(name + "_lantern", new StoneLanternBlock(stone));
@ -73,56 +76,48 @@ public class StoneMaterial {
// Recipes //
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks"), bricks)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("##", "##")
.addMaterial('#', stone)
.setGroup("end_bricks")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_polished"), polished)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("##", "##")
.addMaterial('#', bricks)
.setGroup("end_tile")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_tiles"), tiles)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("##", "##")
.addMaterial('#', polished)
.setGroup("end_small_tile")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pillar"), pillar)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("#", "#")
.addMaterial('#', slab)
.setGroup("end_pillar")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_stairs"), stairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("# ", "## ", "###")
.addMaterial('#', stone)
.setGroup("end_stone_stairs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_slab"), slab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###")
.addMaterial('#', stone)
.setGroup("end_stone_slabs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_stairs"), brickStairs)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("# ", "## ", "###")
.addMaterial('#', bricks)
.setGroup("end_stone_stairs")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_slab"), brickSlab)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###")
.addMaterial('#', bricks)
@ -130,14 +125,12 @@ public class StoneMaterial {
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_wall"), wall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###", "###")
.addMaterial('#', stone)
.setGroup("end_wall")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_bricks_wall"), brickWall)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6)
.setShape("###", "###")
.addMaterial('#', bricks)
@ -145,32 +138,27 @@ public class StoneMaterial {
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_button"), button)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("#")
.shapeless()
.addMaterial('#', stone)
.setGroup("end_stone_buttons")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_pressure_plate"), pressurePlate)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("##")
.addMaterial('#', stone)
.setGroup("end_stone_plates")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_lantern"), lantern)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("S", "#", "S")
.addMaterial('#', EndItems.CRYSTAL_SHARDS)
.addMaterial('S', slab, brickSlab)
.setGroup("end_stone_lanterns")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_furnace"), furnace)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #", "###")
.addMaterial('#', stone)
.setGroup("end_stone_ITEM_FURNACES")
.build();
BCLRecipeBuilder.crafting(BetterEnd.makeID(name + "_flower_pot"), flowerPot)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(3)
.setShape("# #", " # ")
.addMaterial('#', bricks)
@ -206,8 +194,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_bricks_stonecutting"),
mat.bricks
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -216,8 +203,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_wall_stonecutting"),
mat.wall
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -226,8 +212,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_slab_stonecutting"),
mat.slab
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -236,8 +221,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_stairs_stonecutting"),
mat.stairs
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -246,8 +230,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_tiles_stonecutting"),
mat.tiles
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -257,8 +240,7 @@ public class StoneMaterial {
mat.brickSlab
)
.setOutputCount(2)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -267,8 +249,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_stair_stonecutting"),
mat.brickStairs
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -277,8 +258,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_wall_stonecutting"),
mat.brickWall
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -287,8 +267,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_pillar_stonecutting"),
mat.pillar
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -297,8 +276,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_polished_stonecutting"),
mat.polished
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.stone)
.setPrimaryInputAndUnlock(mat.stone)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -308,8 +286,7 @@ public class StoneMaterial {
mat.brickSlab
)
.setOutputCount(2)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.bricks)
.setPrimaryInputAndUnlock(mat.bricks)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -318,8 +295,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_stair_from_" + mat.baseName + "_brick_stonecutting"),
mat.brickStairs
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.bricks)
.setPrimaryInputAndUnlock(mat.bricks)
.setGroup(mat.baseName + "_stonecutting")
.build();
@ -328,8 +304,7 @@ public class StoneMaterial {
BetterEnd.makeID(mat.baseName + "_brick_wall_from_" + mat.baseName + "_brick_stonecutting"),
mat.brickWall
)
.checkConfig(org.betterx.bclib.config.Configs.RECIPE_CONFIG)
.setInput(mat.bricks)
.setPrimaryInputAndUnlock(mat.bricks)
.setGroup(mat.baseName + "_stonecutting")
.build();
}

View file

@ -142,7 +142,7 @@ public class CubozoaEntity extends AbstractSchoolingFish {
@Override
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()) {
((ServerPlayer) player).connection.send(new ClientboundGameEventPacket(
ClientboundGameEventPacket.PUFFER_FISH_STING,

View file

@ -150,7 +150,7 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
public void start() {
Vec3 vec3d = this.getRandomLocation();
if (vec3d != null) {
BlockPos pos = new BlockPos(vec3d);
BlockPos pos = new BlockPos((int) vec3d.x, (int) vec3d.y, (int) vec3d.z);
try {
Path path = DragonflyEntity.this.navigation.createPath(pos, 1);
if (path != null) {
@ -202,7 +202,11 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
}
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;
}
}

View file

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

View file

@ -64,11 +64,16 @@ public class EndSlimeEntity extends Slime {
this.goalSelector.addGoal(5, new MoveGoal());
this.targetSelector.addGoal(
1,
new NearestAttackableTargetGoal<Player>(this, Player.class, 10, true, false, (livingEntity) -> {
return Math.abs(livingEntity.getY() - this.getY()) <= 4.0D;
})
new NearestAttackableTargetGoal<>(
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() {
@ -270,7 +275,11 @@ public class EndSlimeEntity extends Slime {
if (speed > 0.1) {
float dx = Mth.sin(-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);
return down < 5;
}

View file

@ -220,7 +220,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
if (vec3d != null) {
try {
SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath(
new BlockPos(vec3d),
new BlockPos((int) vec3d.x, (int) vec3d.y, (int) vec3d.z),
1
), 1.0D);
} 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.recipes.BCLRecipeBuilder;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.events.PlayerAdvancementsCallback;
import org.betterx.betterend.integration.byg.BYGIntegration;
import org.betterx.betterend.item.GuideBookItem;
@ -35,7 +34,6 @@ public class Integrations {
});
BCLRecipeBuilder.crafting(BetterEnd.makeID("guide_book"), GuideBookItem.GUIDE_BOOK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("D", "B", "C")
.addMaterial('D', EndItems.ENDER_DUST)
.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.material.Material;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import org.joml.Vector3f;
import java.util.List;
import java.util.function.Function;
public class NightshadeRedwoodTreeFeature extends DefaultFeature {
private static final List<Vector3f> BRANCH;
@ -47,23 +47,17 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
BlockState leaves = Integrations.BYG.getDefaultState("nightshade_leaves");
BlockState leaves_flower = Integrations.BYG.getDefaultState("flowering_nightshade_leaves");
Function<BlockPos, BlockState> splinePlacer = (bpos) -> {
return log;
};
Function<BlockState, Boolean> replace = (state) -> {
return state.is(CommonBlockTags.END_STONES) || state.getMaterial()
Function<BlockPos, BlockState> splinePlacer = (bpos) -> log;
Function<BlockState, Boolean> replace = (state) -> state.is(CommonBlockTags.END_STONES) || state.getMaterial()
.equals(Material.PLANT) || state.getMaterial()
.isReplaceable();
};
Function<PosInfo, BlockState> post = (info) -> {
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
return wood;
}
return info.getState();
};
Function<BlockState, Boolean> ignore = (state) -> {
return state.equals(log) || state.equals(wood);
};
Function<BlockState, Boolean> ignore = (state) -> state.equals(log) || state.equals(wood);
int height = MHelper.randRange(40, 60, random);
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);
Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F);
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);
}
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)) {
BlocksHelper.setWithoutUpdate(world, p, leaves);
}
@ -162,8 +156,8 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
if (distance > MHelper.randRange(2, 4, random)) {
return Blocks.AIR.defaultBlockState();
}
for (Direction d : BlocksHelper.DIRECTIONS) {
int airCount = 0;
for (Direction d : BlocksHelper.DIRECTIONS) {
if (info.getState(d).isAir()) {
airCount++;
}
@ -179,12 +173,10 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
};
SDF canopy = new SDFCappedCone().setRadius1(12F).setRadius2(1f).setHeight(height * 0.3F).setBlock(leaves);
canopy = new SDFDisplacement().setFunction((vec) -> {
return MHelper.randRange(-3F, 3F, random);
}).setSource(canopy);
canopy = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-3F, 3F, random)).setSource(canopy);
canopy.addPostProcess(leavesPost1)
.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;
}

View file

@ -78,15 +78,29 @@ public class OldBulbisTreeFeature extends DefaultFeature {
SplineHelper.offset(spline, new Vector3f(size * random.nextFloat() * 0.3F, 0, 0));
SplineHelper.rotateSpline(spline, angle);
SplineHelper.offsetParts(spline, random, 1F, 0, 1F);// 1.3F 0.8F
SDF branch = SplineHelper.buildSDF(spline, 2.3F * addRad, 1.3F * addRad, (bpos) -> {
return stem;
});
SDF branch = SplineHelper.buildSDF(spline, 2.3F * addRad, 1.3F * addRad, (bpos) -> stem);
Vector3f vec = spline.get(spline.size() - 1);
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);
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);
}
@ -116,14 +130,18 @@ public class OldBulbisTreeFeature extends DefaultFeature {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
SDF sphereInner = new SDFSphere().setRadius(radius * 0.53F).setBlock(Blocks.AIR);
sphereInner = new SDFDisplacement().setFunction((vec) -> {
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1);
}).setSource(sphereInner);
sphereInner = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.1,
vec.y() * 0.1,
vec.z() * 0.1
)).setSource(sphereInner);
SDF sphereGlow = new SDFSphere().setRadius(radius * 0.6F).setBlock(glow);
sphereGlow = new SDFDisplacement().setFunction((vec) -> {
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1) * 2F;
}).setSource(sphereGlow);
sphereGlow = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.1,
vec.y() * 0.1,
vec.z() * 0.1
) * 2F).setSource(sphereGlow);
sphereGlow = new SDFSubtraction().setSourceA(sphereGlow).setSourceB(sphereInner);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sphereGlow);
@ -150,7 +168,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
List<Vector3f> side = SplineHelper.copySpline(SIDE);
SplineHelper.rotateSpline(side, angle);
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);
}
}
@ -175,7 +193,8 @@ public class OldBulbisTreeFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale);
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);
}
}

View file

@ -46,7 +46,7 @@ public class EMIInfusionRecipe implements EmiRecipe {
public EMIInfusionRecipe(InfusionRecipe recipe) {
this.id = recipe.getId();
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) {

View file

@ -4,6 +4,7 @@ import org.betterx.bclib.recipes.AlloyingRecipe;
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
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) {
super(
EntryIngredients.ofIngredients(recipe.getIngredients()),
Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))
Collections.singletonList(EntryIngredients.of(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())))
);
this.recipe = recipe;
this.xp = xp;

View file

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

View file

@ -2,6 +2,7 @@ package org.betterx.betterend.integration.rei;
import org.betterx.betterend.recipe.builders.InfusionRecipe;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.Recipe;
@ -22,7 +23,7 @@ public class REIInfusionDisplay extends BasicDisplay implements SimpleGridMenuDi
public REIInfusionDisplay(InfusionRecipe recipe) {
super(
EntryIngredients.ofIngredients(recipe.getIngredients()),
Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))
Collections.singletonList(EntryIngredients.of(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())))
);
this.recipe = recipe;
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.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.*;
@ -33,7 +32,7 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Bett
) {
super(
material,
EquipmentSlot.CHEST,
Type.CHESTPLATE,
fireproof ? EndItems
.makeEndItemSettings()
.durability(durability)
@ -43,7 +42,7 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Bett
this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png");
this.repairItem = repairItem;
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;
addAttributeModifier(
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.Style;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
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 BOOTS_DESC;
public CrystaliteArmor(EquipmentSlot equipmentSlot, Properties settings) {
super(EndArmorMaterial.CRYSTALITE, equipmentSlot, settings);
public CrystaliteArmor(Type type, Properties settings) {
super(EndArmorMaterial.CRYSTALITE, type, settings);
}
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.world.effect.MobEffectInstance;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
@ -22,7 +21,7 @@ import org.jetbrains.annotations.Nullable;
public class CrystaliteBoots extends CrystaliteArmor implements MobEffectApplier {
public CrystaliteBoots() {
super(EquipmentSlot.FEET, EndItems.makeEndItemSettings().rarity(Rarity.RARE));
super(Type.BOOTS, EndItems.makeEndItemSettings().rarity(Rarity.RARE));
}
@Override

View file

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

View file

@ -7,7 +7,6 @@ import org.betterx.betterend.registry.EndItems;
import net.minecraft.client.renderer.item.ItemProperties;
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.Attributes;
import net.minecraft.world.item.ElytraItem;
@ -25,10 +24,10 @@ public class CrystaliteElytra extends CrystaliteArmor implements MultiModelItem,
private final float toughness;
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.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;
addAttributeModifier(
Attributes.ARMOR,

View file

@ -12,7 +12,7 @@ import java.util.UUID;
public class CrystaliteHelmet extends CrystaliteArmor {
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()];
addAttributeModifier(
EndAttributes.BLINDNESS_RESISTANCE,

View file

@ -12,7 +12,7 @@ import java.util.UUID;
public class CrystaliteLeggings extends CrystaliteArmor {
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()];
addAttributeModifier(
Attributes.MAX_HEALTH,

View file

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

View file

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

View file

@ -8,6 +8,7 @@ import org.betterx.betterend.world.generator.TerrainGenerator;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
@ -36,9 +37,18 @@ import java.util.function.Supplier;
@Mixin(ServerLevel.class)
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(
WritableLevelData writableLevelData,
ResourceKey<Level> resourceKey,
RegistryAccess registryAccess,
Holder<DimensionType> holder,
Supplier<ProfilerFiller> supplier,
boolean bl,
@ -46,15 +56,9 @@ public abstract class ServerLevelMixin extends Level {
long l,
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"))
ResourceKey<DimensionType> be_dragonFight(ResourceKey<DimensionType> resourceKey) {
if (!GeneratorOptions.hasDragonFights()) {

View file

@ -42,7 +42,7 @@ public class ParticleTenaneaPetal extends TextureSheetParticle {
CustomColorProvider block = (CustomColorProvider) EndBlocks.TENANEA_FLOWERS;
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.gCol = ((color >> 8) & 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.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.item.material.EndToolMaterial;
import org.betterx.betterend.registry.EndItems;
@ -12,15 +11,13 @@ import net.minecraft.world.item.Tiers;
public class AnvilRecipes {
public static void register() {
BCLRecipeBuilder.anvil(BetterEnd.makeID("ender_pearl_to_dust"), EndItems.ENDER_DUST)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(Items.ENDER_PEARL)
.setPrimaryInputAndUnlock(Items.ENDER_PEARL)
.setAnvilLevel(Tiers.IRON.getLevel())
.setToolLevel(4)
.setDamage(5)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("ender_shard_to_dust"), EndItems.ENDER_DUST)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.ENDER_SHARD)
.setPrimaryInputAndUnlock(EndItems.ENDER_SHARD)
.setAnvilLevel(Tiers.IRON.getLevel())
.setToolLevel(0)
@ -29,50 +26,43 @@ public class AnvilRecipes {
int anvilLevel = EndToolMaterial.AETERNIUM.getLevel();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_axe_head"), EndItems.AETERNIUM_AXE_HEAD)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT)
.setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel)
.setDamage(6)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_pickaxe_head"), EndItems.AETERNIUM_PICKAXE_HEAD)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT)
.setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel)
.setDamage(6)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_shovel_head"), EndItems.AETERNIUM_SHOVEL_HEAD)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT)
.setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel)
.setDamage(6)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_hoe_head"), EndItems.AETERNIUM_HOE_HEAD)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT)
.setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel)
.setDamage(6)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_hammer_head"), EndItems.AETERNIUM_HAMMER_HEAD)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT)
.setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel)
.setToolLevel(EndToolMaterial.THALLASIUM.getLevel())
.setDamage(6)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_sword_blade"), EndItems.AETERNIUM_SWORD_BLADE)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT)
.setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel)
.setDamage(6)
.build();
BCLRecipeBuilder.anvil(BetterEnd.makeID("aeternium_forged_plate"), EndItems.AETERNIUM_FORGED_PLATE)
.checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT)
.setPrimaryInputAndUnlock(EndItems.AETERNIUM_INGOT)
.setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel)
.setDamage(6)

View file

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

View file

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

View file

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

View file

@ -9,6 +9,7 @@ import org.betterx.betterend.rituals.InfusionRitual;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.core.NonNullList;
import net.minecraft.core.RegistryAccess;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.TagParser;
import net.minecraft.network.FriendlyByteBuf;
@ -72,7 +73,7 @@ public class InfusionRecipe implements Recipe<InfusionRitual>, UnknownReceipBook
}
@Override
public ItemStack assemble(InfusionRitual ritual) {
public ItemStack assemble(InfusionRitual ritual, RegistryAccess acc) {
return output.copy();
}
@ -90,7 +91,7 @@ public class InfusionRecipe implements Recipe<InfusionRitual>, UnknownReceipBook
}
@Override
public ItemStack getResultItem() {
public ItemStack getResultItem(RegistryAccess acc) {
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.MobEffects;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.food.Foods;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.TieredItem;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.item.*;
import java.util.List;
import org.jetbrains.annotations.ApiStatus;
@ -101,7 +97,7 @@ public class EndItems {
"aeternium_helmet",
new BaseArmorItem(
EndArmorMaterial.AETERNIUM,
EquipmentSlot.HEAD,
ArmorItem.Type.HELMET,
makeEndItemSettings().fireResistant()
)
);
@ -109,7 +105,7 @@ public class EndItems {
"aeternium_chestplate",
new BaseArmorItem(
EndArmorMaterial.AETERNIUM,
EquipmentSlot.CHEST,
ArmorItem.Type.CHESTPLATE,
makeEndItemSettings().fireResistant()
)
);
@ -117,7 +113,7 @@ public class EndItems {
"aeternium_leggings",
new BaseArmorItem(
EndArmorMaterial.AETERNIUM,
EquipmentSlot.LEGS,
ArmorItem.Type.LEGGINGS,
makeEndItemSettings().fireResistant()
)
);
@ -125,7 +121,7 @@ public class EndItems {
"aeternium_boots",
new BaseArmorItem(
EndArmorMaterial.AETERNIUM,
EquipmentSlot.FEET,
ArmorItem.Type.BOOTS,
makeEndItemSettings().fireResistant()
)
);

View file

@ -8,6 +8,7 @@ import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.MenuType;
@ -23,10 +24,10 @@ public class EndMenuTypes {
ResourceLocation id,
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);
}
public final static void ensureStaticallyLoaded() {
public static void ensureStaticallyLoaded() {
}
}

View file

@ -115,7 +115,7 @@ public class InfusionRitual implements Container {
progress++;
if (progress == time) {
clearContent();
input.setItem(0, activeRecipe.assemble(this));
input.setItem(0, activeRecipe.assemble(this, world.registryAccess()));
if (world instanceof ServerLevel sl) {
sl.getPlayers(p -> p.position()
.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));
}
reset();
} else if (world instanceof ServerLevel) {
ServerLevel serverLevel = (ServerLevel) world;
} else if (world instanceof ServerLevel serverLevel) {
BlockPos target = worldPos.above();
double tx = target.getX() + 0.5;
double ty = target.getY() + 0.5;

View file

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

View file

@ -101,9 +101,9 @@ public class CrashedShipFeature extends NBTFeature<NBTFeatureConfig> {
rotation,
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);
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);
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.util.BlocksHelper;
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
import org.betterx.worlds.together.world.event.WorldBootstrap;
import com.mojang.serialization.Codec;
import net.minecraft.core.*;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.registries.Registries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtIo;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
import net.minecraft.core.Vec3i;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.RandomSource;
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.level.WorldGenLevel;
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.Rotation;
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.StructureTemplate;
import java.io.IOException;
import java.io.InputStream;
public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC> {
public NBTFeature(Codec<FC> codec) {
super(codec);
@ -112,7 +106,7 @@ public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC
rotation,
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);
StructurePlaceSettings placementData = new StructurePlaceSettings()
@ -120,7 +114,7 @@ public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC
.setMirror(mirror)
.setBoundingBox(bounds);
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);
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));
}
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 {
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);
sdf = new SDFTranslate().setTranslate(0, halfHeight - 13, 0).setSource(obj1);
sdf = new SDFDisplacement().setFunction((vec) -> {
return (float) noise.eval(vec.x() * 0.3F, vec.y() * 0.3F, vec.z() * 0.3F) * 0.5F;
}).setSource(sdf);
sdf = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.3F,
vec.y() * 0.3F,
vec.z() * 0.3F
) * 0.5F).setSource(sdf);
obj2 = new SDFSphere().setRadius(radius1);
SDF cave = new SDFScale3D().setScale(1.5F, 1, 1.5F).setSource(obj2);
cave = new SDFDisplacement().setFunction((vec) -> {
return (float) noise.eval(vec.x() * 0.1F, vec.y() * 0.1F, vec.z() * 0.1F) * 2F;
}).setSource(cave);
cave = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.1F,
vec.y() * 0.1F,
vec.z() * 0.1F
) * 2F).setSource(cave);
cave = new SDFTranslate().setTranslate(0, -halfHeight - 10, 0).setSource(cave);
sdf = new SDFSmoothUnion().setRadius(5).setSourceA(cave).setSourceB(sdf);
@ -147,21 +151,24 @@ public class GeyserFeature extends DefaultFeature {
obj1.setBlock(EndBlocks.BRIMSTONE);
obj2.setBlock(EndBlocks.BRIMSTONE);
new SDFDisplacement().setFunction((vec) -> {
return -2F;
}).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE);
new SDFDisplacement().setFunction((vec) -> -2F)
.setSource(sdf)
.setReplaceFunction(REPLACE1)
.fillRecursiveIgnore(world, pos, IGNORE);
obj1.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
obj2.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
new SDFDisplacement().setFunction((vec) -> {
return -4F;
}).setSource(cave).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE);
new SDFDisplacement().setFunction((vec) -> -4F)
.setSource(cave)
.setReplaceFunction(REPLACE1)
.fillRecursiveIgnore(world, pos, IGNORE);
obj1.setBlock(Blocks.END_STONE);
obj2.setBlock(Blocks.END_STONE);
new SDFDisplacement().setFunction((vec) -> {
return -6F;
}).setSource(cave).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE);
new SDFDisplacement().setFunction((vec) -> -6F)
.setSource(cave)
.setReplaceFunction(REPLACE1)
.fillRecursiveIgnore(world, pos, IGNORE);
BlocksHelper.setWithoutUpdate(world, pos, WATER);
MutableBlockPos mut = new MutableBlockPos().set(pos);
@ -266,17 +273,15 @@ public class GeyserFeature extends DefaultFeature {
));
double distance = radius1 * 1.7;
BlockPos start = pos.offset(-distance, -halfHeight - 15 - distance, -distance);
BlockPos end = pos.offset(distance, -halfHeight - 5 + distance, distance);
BlockPos start = pos.offset((int) -distance, (int) (-halfHeight - 15 - distance), (int) -distance);
BlockPos end = pos.offset((int) distance, (int) (-halfHeight - 5 + distance), (int) distance);
BlockFixer.fixBlocks(world, start, end);
return true;
}
static {
REPLACE1 = (state) -> {
return state.isAir() || (state.is(CommonBlockTags.GEN_END_STONES));
};
REPLACE1 = (state) -> state.isAir() || (state.is(CommonBlockTags.GEN_END_STONES));
REPLACE2 = (state) -> {
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();
};
IGNORE = (state) -> {
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state
IGNORE = (state) -> state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state
.is(EndBlocks.BRIMSTONE);
};
}
}

View file

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

View file

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

View file

@ -44,9 +44,7 @@ public class JellyshroomFeature extends DefaultFeature {
float radius = height * MHelper.randRange(0.15F, 0.25F, random);
List<Vector3f> spline = SplineHelper.makeSpline(0, -1, 0, 0, height, 0, 3);
SplineHelper.offsetParts(spline, random, 0.5F, 0, 0.5F);
SDF sdf = SplineHelper.buildSDF(spline, radius, 0.8F, (bpos) -> {
return bark;
});
SDF sdf = SplineHelper.buildSDF(spline, radius, 0.8F, (bpos) -> bark);
radius = height * MHelper.randRange(0.7F, 0.9F, random);
if (radius < 1.5F) {
@ -87,7 +85,8 @@ public class JellyshroomFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale);
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);
}
}

View file

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

View file

@ -64,9 +64,12 @@ public class PythadendronTreeFeature extends DefaultFeature {
pos
);
SDF function = SplineHelper.buildSDF(spline, 1.7F, 1.1F, (bpos) -> {
return EndBlocks.PYTHADENDRON.getBark().defaultBlockState();
});
SDF function = SplineHelper.buildSDF(
spline,
1.7F,
1.1F,
(bpos) -> EndBlocks.PYTHADENDRON.getBark().defaultBlockState()
);
function.setReplaceFunction(REPLACE);
function.addPostProcess(POST);
function.fillRecursive(world, pos);
@ -124,10 +127,10 @@ public class PythadendronTreeFeature extends DefaultFeature {
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
if (depth < 3) {
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) {
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()
.setValue(LeavesBlock.DISTANCE, 6));
sphere = new SDFScale3D().setScale(1, 0.6F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> {
return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3;
}).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> {
return random.nextFloat() * 3F - 1.5F;
}).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.2,
vec.y() * 0.2,
vec.z() * 0.2
) * 3).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> random.nextFloat() * 3F - 1.5F).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
MutableBlockPos mut = new MutableBlockPos();
@ -211,9 +214,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
return state.getMaterial().isReplaceable();
};
IGNORE = (state) -> {
return EndBlocks.PYTHADENDRON.isTreeLog(state);
};
IGNORE = EndBlocks.PYTHADENDRON::isTreeLog;
POST = (info) -> {
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);
float leavesRadius = (size * 0.3F + MHelper.randRange(0.8F, 1.5F, random)) * 1.4F;
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;

View file

@ -74,15 +74,13 @@ public class UmbrellaTreeFeature extends DefaultFeature {
if (SplineHelper.canGenerate(spline, pos, world, REPLACE)) {
float rScale = (scale - 1) * 0.4F + 1;
SDF branch = SplineHelper.buildSDF(spline, 1.2F * rScale, 0.8F * rScale, (bpos) -> {
return wood;
});
SDF branch = SplineHelper.buildSDF(spline, 1.2F * rScale, 0.8F * rScale, (bpos) -> wood);
Vector3f vec = spline.get(spline.size() - 1);
float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.4F;
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 py = MHelper.floor(vec.y()) + 0.5F;
@ -95,8 +93,6 @@ public class UmbrellaTreeFeature extends DefaultFeature {
pos.getZ() + (double) (pz * 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);
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);
float startAngle = random.nextFloat() * MHelper.PI2;
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;
double px = c.px + Math.sin(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.scale(branch, scale);
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);
}
}
}
private SDF makeMembrane(
WorldGenLevel world,
float radius,
RandomSource random,
BlockState membrane,
@ -189,7 +185,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
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);
for (int i = 0; i < 8; i++) {
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 py;
final double pz;

View file

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

View file

@ -24,7 +24,7 @@ public class IslandLayer {
private final SDFRadialNoiseMap noise;
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 OpenSimplexNoise density;
private final int seed;
@ -67,17 +67,15 @@ public class IslandLayer {
positions.clear();
for (int pox = -1; pox < 2; pox++) {
int px = pox + ix;
long px2 = px;
for (int poz = -1; poz < 2; poz++) {
int pz = poz + iz;
long pz2 = pz;
if (px2 * px2 + pz2 * pz2 > options.centerDist) {
if ((long) px * (long) px + (long) pz * (long) pz > options.centerDist) {
RANDOM.setSeed(getSeed(px, pz));
double posX = (px + RANDOM.nextFloat()) * options.distance;
double posY = MHelper.randRange(options.minY, options.maxY, RANDOM) * maxHeight;
double posZ = (pz + RANDOM.nextFloat()) * options.distance;
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));
}
}
}