diff --git a/gradle.properties b/gradle.properties index 7ef25890..9e33dcc0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,6 +13,6 @@ archives_base_name=better-end # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api patchouli_version = 55-FABRIC-SNAPSHOT fabric_version = 0.36.1+1.17 -bclib_version = 0.2.4 +bclib_version = 0.3.0 rei_version = 6.0.264-alpha canvas_version = 1.0.+ diff --git a/src/main/java/ru/betterend/BetterEnd.java b/src/main/java/ru/betterend/BetterEnd.java index 9e4d49b5..a3ecea0c 100644 --- a/src/main/java/ru/betterend/BetterEnd.java +++ b/src/main/java/ru/betterend/BetterEnd.java @@ -58,7 +58,9 @@ public class BetterEnd implements ModInitializer { BonemealPlants.init(); GeneratorOptions.init(); LootTableUtil.init(); - FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register); + FabricLoader.getInstance() + .getEntrypoints("betterend", BetterEndPlugin.class) + .forEach(BetterEndPlugin::register); Integrations.init(); Configs.saveConfigs(); } diff --git a/src/main/java/ru/betterend/blocks/AeterniumBlock.java b/src/main/java/ru/betterend/blocks/AeterniumBlock.java index edbfed1d..2541214c 100644 --- a/src/main/java/ru/betterend/blocks/AeterniumBlock.java +++ b/src/main/java/ru/betterend/blocks/AeterniumBlock.java @@ -14,7 +14,11 @@ import ru.bclib.blocks.BaseBlock; public class AeterniumBlock extends BaseBlock { public AeterniumBlock() { - super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY).hardness(65F).resistance(1200F).requiresCorrectToolForDrops().sound(SoundType.NETHERITE_BLOCK)); + super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY) + .hardness(65F) + .resistance(1200F) + .requiresCorrectToolForDrops() + .sound(SoundType.NETHERITE_BLOCK)); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java b/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java index 121652c6..04f3b5c3 100644 --- a/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java +++ b/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java @@ -6,9 +6,9 @@ import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.material.Material; import ru.bclib.blocks.BaseBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; -public class AmaranitaHymenophoreBlock extends BaseBlock implements IRenderTyped { +public class AmaranitaHymenophoreBlock extends BaseBlock implements RenderLayerProvider { public AmaranitaHymenophoreBlock() { super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD)); } diff --git a/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java b/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java index d9e3e1f5..ae6d112f 100644 --- a/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java +++ b/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java @@ -3,22 +3,16 @@ package ru.betterend.blocks; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; -import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.Enchantments; -import net.minecraft.world.level.GameRules; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; -import net.minecraft.world.phys.Vec3; import ru.bclib.blocks.BaseBlock; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; @@ -62,7 +56,17 @@ public class AncientEmeraldIceBlock extends BaseBlock { } private void makeParticles(ServerLevel world, BlockPos pos, Random random) { - world.sendParticles(EndParticles.SNOWFLAKE, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 20, 0.5, 0.5, 0.5, 0); + world.sendParticles( + EndParticles.SNOWFLAKE, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + 20, + 0.5, + 0.5, + 0.5, + 0 + ); } @Override diff --git a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java index 82bd0f28..8a2a0d4b 100644 --- a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java @@ -19,21 +19,29 @@ import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import ru.bclib.api.TagAPI; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IColorProvider; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.CustomColorProvider; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.ColorUtil; import ru.bclib.util.MHelper; import ru.betterend.registry.EndItems; import java.util.List; -public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyped, IColorProvider { +public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLayerProvider, CustomColorProvider { public static final Vec3i[] COLORS; private static final int MIN_DROP = 1; private static final int MAX_DROP = 4; public AuroraCrystalBlock() { - super(FabricBlockSettings.of(Material.GLASS).breakByTool(FabricToolTags.PICKAXES).breakByTool(TagAPI.HAMMERS).hardness(1F).resistance(1F).luminance(15).noOcclusion().isSuffocating((state, world, pos) -> false).sound(SoundType.GLASS)); + super(FabricBlockSettings.of(Material.GLASS) + .breakByTool(FabricToolTags.PICKAXES) + .breakByTool(TagAPI.HAMMERS) + .hardness(1F) + .resistance(1F) + .luminance(15) + .noOcclusion() + .isSuffocating((state, world, pos) -> false) + .sound(SoundType.GLASS)); } @Override @@ -101,6 +109,11 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp } static { - COLORS = new Vec3i[]{new Vec3i(247, 77, 161), new Vec3i(120, 184, 255), new Vec3i(120, 255, 168), new Vec3i(243, 58, 255)}; + COLORS = new Vec3i[] { + new Vec3i(247, 77, 161), + new Vec3i(120, 184, 255), + new Vec3i(120, 255, 168), + new Vec3i(243, 58, 255) + }; } } diff --git a/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java b/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java index bec0c00e..3d96ceee 100644 --- a/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java @@ -21,7 +21,10 @@ public class BlueVineLanternBlock extends BaseBlock { public static final BooleanProperty NATURAL = BlockProperties.NATURAL; public BlueVineLanternBlock() { - super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).luminance(15).sound(SoundType.WART_BLOCK)); + super(FabricBlockSettings.of(Material.WOOD) + .breakByTool(FabricToolTags.AXES) + .luminance(15) + .sound(SoundType.WART_BLOCK)); this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false)); } diff --git a/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java b/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java index 254a814b..19185aaa 100644 --- a/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java @@ -22,24 +22,51 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock { if (h < height + 1) { return; } - BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.BOTTOM)); + BlocksHelper.setWithoutUpdate( + world, + pos, + EndBlocks.BLUE_VINE.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.BOTTOM) + ); for (int i = 1; i < height; i++) { - BlocksHelper.setWithoutUpdate(world, pos.above(i), EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.MIDDLE)); + BlocksHelper.setWithoutUpdate( + world, + pos.above(i), + EndBlocks.BLUE_VINE.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.MIDDLE) + ); } - BlocksHelper.setWithoutUpdate(world, pos.above(height), EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP)); + BlocksHelper.setWithoutUpdate( + world, + pos.above(height), + EndBlocks.BLUE_VINE.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP) + ); placeLantern(world, pos.above(height + 1)); } private void placeLantern(WorldGenLevel world, BlockPos pos) { - BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)); + BlocksHelper.setWithoutUpdate( + world, + pos, + EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true) + ); for (Direction dir : BlocksHelper.HORIZONTAL) { BlockPos p = pos.relative(dir); if (world.isEmptyBlock(p)) { - BlocksHelper.setWithoutUpdate(world, p, EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)); + BlocksHelper.setWithoutUpdate( + world, + p, + EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir) + ); } } if (world.isEmptyBlock(pos.above())) { - BlocksHelper.setWithoutUpdate(world, pos.above(), EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP)); + BlocksHelper.setWithoutUpdate( + world, + pos.above(), + EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP) + ); } } diff --git a/src/main/java/ru/betterend/blocks/BrimstoneBlock.java b/src/main/java/ru/betterend/blocks/BrimstoneBlock.java index 83befb84..33b4d4a8 100644 --- a/src/main/java/ru/betterend/blocks/BrimstoneBlock.java +++ b/src/main/java/ru/betterend/blocks/BrimstoneBlock.java @@ -87,7 +87,10 @@ public class BrimstoneBlock extends BaseBlock { } } else if (sideState.getFluidState().getType() == Fluids.WATER) { - BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.AGE, 0); + BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState() + .setValue(SulphurCrystalBlock.FACING, dir) + .setValue(SulphurCrystalBlock.WATERLOGGED, true) + .setValue(SulphurCrystalBlock.AGE, 0); world.setBlockAndUpdate(side, crystal); } } diff --git a/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java b/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java index 3a0bd6a9..96f282f4 100644 --- a/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java +++ b/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java @@ -24,7 +24,11 @@ public class BubbleCoralBlock extends EndUnderwaterPlantBlock { private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16); public BubbleCoralBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.CORAL_BLOCK).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.CORAL_BLOCK) + .noCollission()); } @Override diff --git a/src/main/java/ru/betterend/blocks/BulbVineBlock.java b/src/main/java/ru/betterend/blocks/BulbVineBlock.java index 5cc9b9f2..eccdd7ea 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineBlock.java @@ -41,6 +41,7 @@ public class BulbVineBlock extends BaseVineBlock { @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { boolean canPlace = super.canSurvive(state, world, pos); - return (state.is(this) && state.getValue(SHAPE) == TripleShape.BOTTOM) ? canPlace : canPlace && world.getBlockState(pos.below()).is(this); + return (state.is(this) && state.getValue(SHAPE) == TripleShape.BOTTOM) ? canPlace : canPlace && world.getBlockState( + pos.below()).is(this); } } diff --git a/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java b/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java index bf7dbec4..77364036 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java @@ -17,22 +17,29 @@ import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelProvider; +import ru.bclib.interfaces.RenderLayerProvider; import ru.betterend.blocks.basis.EndLanternBlock; import ru.betterend.client.models.Patterns; import java.util.Map; import java.util.Optional; -public class BulbVineLanternBlock extends EndLanternBlock implements IRenderTyped, BlockModelProvider { +public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayerProvider, BlockModelProvider { private static final VoxelShape SHAPE_CEIL = Block.box(4, 4, 4, 12, 16, 12); private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12); public BulbVineLanternBlock() { - this(FabricBlockSettings.of(Material.METAL).hardness(1).resistance(1).breakByTool(FabricToolTags.PICKAXES).materialColor(MaterialColor.COLOR_LIGHT_GRAY).luminance(15).requiresCorrectToolForDrops().sound(SoundType.LANTERN)); + this(FabricBlockSettings.of(Material.METAL) + .hardness(1) + .resistance(1) + .breakByTool(FabricToolTags.PICKAXES) + .materialColor(MaterialColor.COLOR_LIGHT_GRAY) + .luminance(15) + .requiresCorrectToolForDrops() + .sound(SoundType.LANTERN)); } public BulbVineLanternBlock(Properties settings) { @@ -55,7 +62,10 @@ public class BulbVineLanternBlock extends EndLanternBlock implements IRenderType Map textures = Maps.newHashMap(); textures.put("%glow%", getGlowTexture()); textures.put("%metal%", getMetalTexture(resourceLocation)); - Optional pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, textures) : Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures); + Optional pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson( + Patterns.BLOCK_BULB_LANTERN_FLOOR, + textures + ) : Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures); return ModelsHelper.fromPattern(pattern); } diff --git a/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java b/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java index fcd8f9fb..41821469 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java @@ -3,11 +3,11 @@ package ru.betterend.blocks; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; -import ru.bclib.interfaces.IColorProvider; +import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.util.BlocksHelper; import ru.bclib.util.ColorUtil; -public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements IColorProvider { +public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements CustomColorProvider { public BulbVineLanternColoredBlock(FabricBlockSettings settings) { super(settings); } diff --git a/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java b/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java index 34a840aa..80f99c58 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java @@ -26,11 +26,23 @@ public class BulbVineSeedBlock extends EndPlantWithAgeBlock { public void growAdult(WorldGenLevel world, Random random, BlockPos pos) { int h = BlocksHelper.downRay(world, pos, random.nextInt(24)) - 1; if (h > 2) { - BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)); + BlocksHelper.setWithoutUpdate( + world, + pos, + EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP) + ); for (int i = 1; i < h; i++) { - BlocksHelper.setWithoutUpdate(world, pos.below(i), EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)); + BlocksHelper.setWithoutUpdate( + world, + pos.below(i), + EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE) + ); } - BlocksHelper.setWithoutUpdate(world, pos.below(h), EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM)); + BlocksHelper.setWithoutUpdate( + world, + pos.below(h), + EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM) + ); } } } diff --git a/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java b/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java index 467562b7..591ac597 100644 --- a/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java +++ b/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java @@ -16,13 +16,13 @@ import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.blocks.BlockProperties; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.betterend.registry.EndBlocks; import java.util.Collections; import java.util.List; -public class CavePumpkinBlock extends BaseBlockNotFull implements IRenderTyped { +public class CavePumpkinBlock extends BaseBlockNotFull implements RenderLayerProvider { public static final BooleanProperty SMALL = BlockProperties.SMALL; private static final VoxelShape SHAPE_SMALL; private static final VoxelShape SHAPE_BIG; @@ -49,7 +49,8 @@ public class CavePumpkinBlock extends BaseBlockNotFull implements IRenderTyped { @Override public List getDrops(BlockState state, LootContext.Builder builder) { - return state.getValue(SMALL) ? Collections.singletonList(new ItemStack(EndBlocks.CAVE_PUMPKIN_SEED)) : Collections.singletonList(new ItemStack(this)); + return state.getValue(SMALL) ? Collections.singletonList(new ItemStack(EndBlocks.CAVE_PUMPKIN_SEED)) : Collections + .singletonList(new ItemStack(this)); } static { diff --git a/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java b/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java index 4c3567c9..07fbdddd 100644 --- a/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java +++ b/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java @@ -31,12 +31,16 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock { public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { int age = state.getValue(AGE); BlockState down = world.getBlockState(pos.below()); - if (down.getMaterial().isReplaceable() || (down.is(EndBlocks.CAVE_PUMPKIN) && down.getValue(BlockProperties.SMALL))) { + if (down.getMaterial() + .isReplaceable() || (down.is(EndBlocks.CAVE_PUMPKIN) && down.getValue(BlockProperties.SMALL))) { if (age < 3) { world.setBlockAndUpdate(pos, state.setValue(AGE, age + 1)); } if (age == 2) { - world.setBlockAndUpdate(pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(BlockProperties.SMALL, true)); + world.setBlockAndUpdate( + pos.below(), + EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(BlockProperties.SMALL, true) + ); } else if (age == 3) { world.setBlockAndUpdate(pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState()); diff --git a/src/main/java/ru/betterend/blocks/ChandelierBlock.java b/src/main/java/ru/betterend/blocks/ChandelierBlock.java index 6ebb8132..969f110d 100644 --- a/src/main/java/ru/betterend/blocks/ChandelierBlock.java +++ b/src/main/java/ru/betterend/blocks/ChandelierBlock.java @@ -18,21 +18,25 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import ru.bclib.blocks.BaseAttachedBlock; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelProvider; +import ru.bclib.interfaces.RenderLayerProvider; import ru.betterend.client.models.Patterns; import java.util.EnumMap; import java.util.Map; import java.util.Optional; -public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, BlockModelProvider { +public class ChandelierBlock extends BaseAttachedBlock implements RenderLayerProvider, BlockModelProvider { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public ChandelierBlock(Block source) { - super(FabricBlockSettings.copyOf(source).luminance(15).noCollission().noOcclusion().requiresCorrectToolForDrops()); + super(FabricBlockSettings.copyOf(source) + .luminance(15) + .noCollission() + .noOcclusion() + .requiresCorrectToolForDrops()); } @Override diff --git a/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java b/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java index b589f450..d38b8902 100644 --- a/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java +++ b/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java @@ -10,12 +10,12 @@ import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import ru.bclib.blocks.BaseBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import java.util.Collections; import java.util.List; -public class DenseEmeraldIceBlock extends BaseBlock implements IRenderTyped { +public class DenseEmeraldIceBlock extends BaseBlock implements RenderLayerProvider { public DenseEmeraldIceBlock() { super(FabricBlockSettings.copyOf(Blocks.PACKED_ICE)); } diff --git a/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java b/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java index 8e67ec12..c511fc1d 100644 --- a/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; diff --git a/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java b/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java index 978a69cb..5569fdb8 100644 --- a/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java +++ b/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java @@ -21,15 +21,15 @@ import net.minecraft.world.level.material.Material; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import org.jetbrains.annotations.Nullable; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelProvider; +import ru.bclib.interfaces.RenderLayerProvider; import java.util.Collections; import java.util.List; import java.util.Random; -public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderTyped, BlockModelProvider { +public class EmeraldIceBlock extends HalfTransparentBlock implements RenderLayerProvider, BlockModelProvider { public EmeraldIceBlock() { super(FabricBlockSettings.copyOf(Blocks.ICE)); } diff --git a/src/main/java/ru/betterend/blocks/EndBlockProperties.java b/src/main/java/ru/betterend/blocks/EndBlockProperties.java index 584d00ea..9b716ab9 100644 --- a/src/main/java/ru/betterend/blocks/EndBlockProperties.java +++ b/src/main/java/ru/betterend/blocks/EndBlockProperties.java @@ -19,7 +19,8 @@ public class EndBlockProperties extends BlockProperties { public static final BooleanProperty HAS_ITEM = BooleanProperty.create("has_item"); public enum PedestalState implements StringRepresentable { - PEDESTAL_TOP("pedestal_top"), COLUMN_TOP("column_top"), BOTTOM("bottom"), PILLAR("pillar"), COLUMN("column"), DEFAULT("default"); + PEDESTAL_TOP("pedestal_top"), COLUMN_TOP("column_top"), BOTTOM("bottom"), PILLAR("pillar"), COLUMN("column"), DEFAULT( + "default"); private final String name; @@ -39,7 +40,10 @@ public class EndBlockProperties extends BlockProperties { } public enum HydraluxShape implements StringRepresentable { - FLOWER_BIG_BOTTOM("flower_big_bottom", true), FLOWER_BIG_TOP("flower_big_top", true), FLOWER_SMALL_BOTTOM("flower_small_bottom", true), FLOWER_SMALL_TOP("flower_small_top", true), VINE("vine", false), ROOTS("roots", false); + FLOWER_BIG_BOTTOM("flower_big_bottom", true), FLOWER_BIG_TOP("flower_big_top", true), FLOWER_SMALL_BOTTOM( + "flower_small_bottom", + true + ), FLOWER_SMALL_TOP("flower_small_top", true), VINE("vine", false), ROOTS("roots", false); private final String name; private final boolean glow; @@ -65,7 +69,13 @@ public class EndBlockProperties extends BlockProperties { } public enum LumecornShape implements StringRepresentable { - LIGHT_TOP("light_top", 15), LIGHT_TOP_MIDDLE("light_top_middle", 15), LIGHT_MIDDLE("light_middle", 15), LIGHT_BOTTOM("light_bottom", 15), MIDDLE("middle", 0), BOTTOM_BIG("bottom_big", 0), BOTTOM_SMALL("bottom_small", 0); + LIGHT_TOP("light_top", 15), LIGHT_TOP_MIDDLE("light_top_middle", 15), LIGHT_MIDDLE( + "light_middle", + 15 + ), LIGHT_BOTTOM("light_bottom", 15), MIDDLE("middle", 0), BOTTOM_BIG("bottom_big", 0), BOTTOM_SMALL( + "bottom_small", + 0 + ); private final String name; private final int light; diff --git a/src/main/java/ru/betterend/blocks/EndLilyBlock.java b/src/main/java/ru/betterend/blocks/EndLilyBlock.java index 80e9a521..7dc6792e 100644 --- a/src/main/java/ru/betterend/blocks/EndLilyBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLilyBlock.java @@ -42,7 +42,12 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock { private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14); public EndLilyBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS) + .lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0) + .noCollission()); } @Override @@ -69,7 +74,8 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock { @Override public FluidState getFluidState(BlockState state) { - return state.getValue(SHAPE) == TripleShape.TOP ? Fluids.EMPTY.defaultFluidState() : Fluids.WATER.getSource(false); + return state.getValue(SHAPE) == TripleShape.TOP ? Fluids.EMPTY.defaultFluidState() : Fluids.WATER.getSource( + false); } @Override @@ -90,7 +96,10 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock { @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (state.getValue(SHAPE) == TripleShape.TOP) { - return Lists.newArrayList(new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM)), new ItemStack(EndBlocks.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM))); + return Lists.newArrayList( + new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM)), + new ItemStack(EndBlocks.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM)) + ); } return Collections.emptyList(); } diff --git a/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java b/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java index 04f7cd38..79ee2dfe 100644 --- a/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java @@ -16,13 +16,25 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock { @Override public void grow(WorldGenLevel world, Random random, BlockPos pos) { if (canGrow(world, pos)) { - BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.BOTTOM)); + BlocksHelper.setWithoutUpdate( + world, + pos, + EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.BOTTOM) + ); BlockPos up = pos.above(); while (world.getFluidState(up).isSource()) { - BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.MIDDLE)); + BlocksHelper.setWithoutUpdate( + world, + up, + EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.MIDDLE) + ); up = up.above(); } - BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP)); + BlocksHelper.setWithoutUpdate( + world, + up, + EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP) + ); } } diff --git a/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java b/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java index 5df755e9..3c6f7405 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java @@ -24,11 +24,11 @@ import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import ru.betterend.registry.EndBlocks; -public class EndLotusLeafBlock extends BaseBlockNotFull implements IRenderTyped { +public class EndLotusLeafBlock extends BaseBlockNotFull implements RenderLayerProvider { public static final EnumProperty HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; private static final VoxelShape VSHAPE = Block.box(0, 0, 0, 16, 1, 16); diff --git a/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java b/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java index c471f826..b133a38a 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java @@ -19,7 +19,9 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { public void grow(WorldGenLevel world, Random random, BlockPos pos) { if (canGrow(world, pos)) { BlockState startLeaf = EndBlocks.END_LOTUS_STEM.defaultBlockState().setValue(EndLotusStemBlock.LEAF, true); - BlockState roots = EndBlocks.END_LOTUS_STEM.defaultBlockState().setValue(EndLotusStemBlock.SHAPE, TripleShape.BOTTOM).setValue(EndLotusStemBlock.WATERLOGGED, true); + BlockState roots = EndBlocks.END_LOTUS_STEM.defaultBlockState() + .setValue(EndLotusStemBlock.SHAPE, TripleShape.BOTTOM) + .setValue(EndLotusStemBlock.WATERLOGGED, true); BlockState stem = EndBlocks.END_LOTUS_STEM.defaultBlockState(); BlockState flower = EndBlocks.END_LOTUS_FLOWER.defaultBlockState(); @@ -37,7 +39,11 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { BlockPos leafCenter = bpos.immutable().relative(dir); if (hasLeaf(world, leafCenter)) { generateLeaf(world, leafCenter); - BlocksHelper.setWithoutUpdate(world, bpos, startLeaf.setValue(EndLotusStemBlock.SHAPE, shape).setValue(EndLotusStemBlock.FACING, dir)); + BlocksHelper.setWithoutUpdate( + world, + bpos, + startLeaf.setValue(EndLotusStemBlock.SHAPE, shape).setValue(EndLotusStemBlock.FACING, dir) + ); } else { BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, shape)); @@ -93,12 +99,22 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState(); BlocksHelper.setWithoutUpdate(world, pos, leaf.setValue(EndLotusLeafBlock.SHAPE, TripleShape.BOTTOM)); for (Direction move : BlocksHelper.HORIZONTAL) { - BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move).setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE)); + BlocksHelper.setWithoutUpdate( + world, + p.set(pos).move(move), + leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move) + .setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE) + ); } for (int i = 0; i < 4; i++) { Direction d1 = BlocksHelper.HORIZONTAL[i]; Direction d2 = BlocksHelper.HORIZONTAL[(i + 1) & 3]; - BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1).setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP)); + BlocksHelper.setWithoutUpdate( + world, + p.set(pos).move(d1).move(d2), + leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1) + .setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP) + ); } } diff --git a/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java b/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java index 2a7e1803..dad92625 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java @@ -26,12 +26,12 @@ import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import java.util.Map; -public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlock, IRenderTyped { +public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlock, RenderLayerProvider { public static final EnumProperty FACING = BlockStateProperties.FACING; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty LEAF = BooleanProperty.create("leaf"); @@ -40,7 +40,10 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo public EndLotusStemBlock() { super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS)); - this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false).setValue(SHAPE, TripleShape.MIDDLE).setValue(LEAF, false).setValue(FACING, Direction.UP)); + this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false) + .setValue(SHAPE, TripleShape.MIDDLE) + .setValue(LEAF, false) + .setValue(FACING, Direction.UP)); } @Override @@ -62,7 +65,9 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo public BlockState getStateForPlacement(BlockPlaceContext ctx) { LevelAccessor worldAccess = ctx.getLevel(); BlockPos blockPos = ctx.getClickedPos(); - return this.defaultBlockState().setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER).setValue(FACING, ctx.getClickedFace()); + return this.defaultBlockState() + .setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER) + .setValue(FACING, ctx.getClickedFace()); } @Override diff --git a/src/main/java/ru/betterend/blocks/EndPortalBlock.java b/src/main/java/ru/betterend/blocks/EndPortalBlock.java index 895b9c1c..5a4806c8 100644 --- a/src/main/java/ru/betterend/blocks/EndPortalBlock.java +++ b/src/main/java/ru/betterend/blocks/EndPortalBlock.java @@ -29,8 +29,8 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.dimension.DimensionType; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IColorProvider; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.CustomColorProvider; +import ru.bclib.interfaces.RenderLayerProvider; import ru.betterend.interfaces.TeleportingEntity; import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndPortals; @@ -40,11 +40,13 @@ import java.util.Objects; import java.util.Optional; import java.util.Random; -public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, IColorProvider { +public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProvider, CustomColorProvider { public static final IntegerProperty PORTAL = EndBlockProperties.PORTAL; public EndPortalBlock() { - super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL).resistance(Blocks.BEDROCK.getExplosionResistance()).luminance(15)); + super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL) + .resistance(Blocks.BEDROCK.getExplosionResistance()) + .luminance(15)); } @Override @@ -57,7 +59,16 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { if (random.nextInt(100) == 0) { - world.playLocalSound(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, SoundEvents.PORTAL_AMBIENT, SoundSource.BLOCKS, 0.5F, random.nextFloat() * 0.4F + 0.8F, false); + world.playLocalSound( + pos.getX() + 0.5D, + pos.getY() + 0.5D, + pos.getZ() + 0.5D, + SoundEvents.PORTAL_AMBIENT, + SoundSource.BLOCKS, + 0.5F, + random.nextFloat() * 0.4F + 0.8F, + false + ); } double x = pos.getX() + random.nextDouble(); @@ -95,7 +106,14 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I BlockPos exitPos = findExitPos(currentWorld, destination, pos, entity); if (exitPos == null) return; if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) { - ((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot()); + ((ServerPlayer) entity).teleportTo( + destination, + exitPos.getX() + 0.5, + exitPos.getY(), + exitPos.getZ() + 0.5, + entity.getYRot(), + entity.getXRot() + ); } else { ((TeleportingEntity) entity).be_setExitPos(exitPos); @@ -115,17 +133,28 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I private BlockPos findExitPos(ServerLevel currentWorld, ServerLevel targetWorld, BlockPos currentPos, Entity entity) { if (targetWorld == null) return null; - Registry registry = targetWorld.registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); + Registry registry = targetWorld.registryAccess() + .registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); ResourceLocation targetWorldId = targetWorld.dimension().location(); ResourceLocation currentWorldId = currentWorld.dimension().location(); double targetMultiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale(); double currentMultiplier = Objects.requireNonNull(registry.get(currentWorldId)).coordinateScale(); double multiplier = targetMultiplier > currentMultiplier ? 1.0 / targetMultiplier : currentMultiplier; - MutableBlockPos basePos = currentPos.mutable().set(currentPos.getX() * multiplier, currentPos.getY(), currentPos.getZ() * multiplier); + MutableBlockPos basePos = currentPos.mutable() + .set(currentPos.getX() * multiplier, + currentPos.getY(), + currentPos.getZ() * multiplier + ); MutableBlockPos checkPos = basePos.mutable(); BlockState currentState = currentWorld.getBlockState(currentPos); int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1; - checkPos = EternalRitual.findBlockPos(targetWorld, checkPos, radius, this, state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL))); + checkPos = EternalRitual.findBlockPos( + targetWorld, + checkPos, + radius, + this, + state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL)) + ); if (checkPos != null) { BlockState checkState = targetWorld.getBlockState(checkPos); Axis axis = checkState.getValue(AXIS); diff --git a/src/main/java/ru/betterend/blocks/EndStoneSmelter.java b/src/main/java/ru/betterend/blocks/EndStoneSmelter.java index 103240e3..366106d1 100644 --- a/src/main/java/ru/betterend/blocks/EndStoneSmelter.java +++ b/src/main/java/ru/betterend/blocks/EndStoneSmelter.java @@ -49,7 +49,12 @@ public class EndStoneSmelter extends BaseBlockWithEntity { public static final String ID = "end_stone_smelter"; public EndStoneSmelter() { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY).luminance(state -> state.getValue(LIT) ? 15 : 0).hardness(4F).resistance(100F).requiresCorrectToolForDrops().sound(SoundType.STONE)); + super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY) + .luminance(state -> state.getValue(LIT) ? 15 : 0) + .hardness(4F) + .resistance(100F) + .requiresCorrectToolForDrops() + .sound(SoundType.STONE)); registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(LIT, false)); } @@ -134,7 +139,16 @@ public class EndStoneSmelter extends BaseBlockWithEntity { double y = pos.getY(); double z = pos.getZ() + 0.5D; if (random.nextDouble() < 0.1D) { - world.playLocalSound(x, y, z, SoundEvents.BLASTFURNACE_FIRE_CRACKLE, SoundSource.BLOCKS, 1.0F, 1.0F, false); + world.playLocalSound( + x, + y, + z, + SoundEvents.BLASTFURNACE_FIRE_CRACKLE, + SoundSource.BLOCKS, + 1.0F, + 1.0F, + false + ); } Direction direction = state.getValue(FACING); @@ -151,6 +165,10 @@ public class EndStoneSmelter extends BaseBlockWithEntity { @Override @Nullable public BlockEntityTicker getTicker(Level level, BlockState blockState, BlockEntityType blockEntityType) { - return level.isClientSide() ? null : createTickerHelper(blockEntityType, EndBlockEntities.END_STONE_SMELTER, EndStoneSmelterBlockEntity::tick); + return level.isClientSide() ? null : createTickerHelper( + blockEntityType, + EndBlockEntities.END_STONE_SMELTER, + EndStoneSmelterBlockEntity::tick + ); } } diff --git a/src/main/java/ru/betterend/blocks/EnderBlock.java b/src/main/java/ru/betterend/blocks/EnderBlock.java index 1ef9b960..5e4566d8 100644 --- a/src/main/java/ru/betterend/blocks/EnderBlock.java +++ b/src/main/java/ru/betterend/blocks/EnderBlock.java @@ -14,7 +14,11 @@ import ru.bclib.blocks.BaseBlock; public class EnderBlock extends BaseBlock { public EnderBlock() { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK).hardness(5F).resistance(6F).requiresCorrectToolForDrops().sound(SoundType.STONE)); + super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK) + .hardness(5F) + .resistance(6F) + .requiresCorrectToolForDrops() + .sound(SoundType.STONE)); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java b/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java index 205b6177..3976ffe1 100644 --- a/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java +++ b/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java @@ -21,7 +21,9 @@ public class EndstoneDustBlock extends FallingBlock { private static final int COLOR = ColorUtil.color(226, 239, 168); public EndstoneDustBlock() { - super(FabricBlockSettings.copyOf(Blocks.SAND).breakByTool(FabricToolTags.SHOVELS).materialColor(Blocks.END_STONE.defaultMaterialColor())); + super(FabricBlockSettings.copyOf(Blocks.SAND) + .breakByTool(FabricToolTags.SHOVELS) + .materialColor(Blocks.END_STONE.defaultMaterialColor())); } @Override diff --git a/src/main/java/ru/betterend/blocks/FilaluxLanternBlock.java b/src/main/java/ru/betterend/blocks/FilaluxLanternBlock.java index 658195b7..f7a8fdf0 100644 --- a/src/main/java/ru/betterend/blocks/FilaluxLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/FilaluxLanternBlock.java @@ -8,6 +8,9 @@ import ru.bclib.blocks.BaseBlock; public class FilaluxLanternBlock extends BaseBlock { public FilaluxLanternBlock() { - super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).luminance(15).sound(SoundType.WOOD)); + super(FabricBlockSettings.of(Material.WOOD) + .breakByTool(FabricToolTags.AXES) + .luminance(15) + .sound(SoundType.WOOD)); } } diff --git a/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java b/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java index ff01c75f..b17deea8 100644 --- a/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java +++ b/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java @@ -14,15 +14,18 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import java.util.EnumMap; -public class FilaluxWingsBlock extends BaseAttachedBlock implements IRenderTyped { +public class FilaluxWingsBlock extends BaseAttachedBlock implements RenderLayerProvider { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public FilaluxWingsBlock() { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).sound(SoundType.WET_GRASS).noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .sound(SoundType.WET_GRASS) + .noCollission()); } @Override diff --git a/src/main/java/ru/betterend/blocks/FlamaeaBlock.java b/src/main/java/ru/betterend/blocks/FlamaeaBlock.java index aa1d8ec7..5c70ac07 100644 --- a/src/main/java/ru/betterend/blocks/FlamaeaBlock.java +++ b/src/main/java/ru/betterend/blocks/FlamaeaBlock.java @@ -1,10 +1,14 @@ package ru.betterend.blocks; import com.google.common.collect.Lists; +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.core.BlockPos; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.WaterLilyBlockItem; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; @@ -15,16 +19,19 @@ import net.minecraft.world.level.material.Material; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import ru.bclib.interfaces.ISpetialItem; +import ru.bclib.interfaces.CustomItemProvider; import ru.betterend.blocks.basis.EndPlantBlock; import java.util.List; -public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem { +public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider { private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16); public FlamaeaBlock() { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS)); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS)); } @Override @@ -47,18 +54,13 @@ public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem { return Lists.newArrayList(new ItemStack(this)); } - @Override - public int getStackSize() { - return 64; - } - - @Override - public boolean canPlaceOnWater() { - return true; - } - @Override public boolean addToPot() { return false; } + + @Override + public BlockItem getCustomItem(ResourceLocation resourceLocation, FabricItemSettings fabricItemSettings) { + return new WaterLilyBlockItem(this, fabricItemSettings); + } } diff --git a/src/main/java/ru/betterend/blocks/FlowerPotBlock.java b/src/main/java/ru/betterend/blocks/FlowerPotBlock.java index 9a8b2f24..69af5190 100644 --- a/src/main/java/ru/betterend/blocks/FlowerPotBlock.java +++ b/src/main/java/ru/betterend/blocks/FlowerPotBlock.java @@ -9,7 +9,6 @@ import com.mojang.math.Vector3f; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.BlockModel; @@ -45,8 +44,8 @@ import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.ModelsHelper.MultiPartBuilder; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IPostInit; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.PostInitable; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import ru.bclib.util.JsonFactory; import ru.betterend.BetterEnd; @@ -58,12 +57,11 @@ import ru.betterend.interfaces.PottableTerrain; import ru.betterend.registry.EndBlocks; import java.io.File; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IPostInit { +public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvider, PostInitable { private static final IntegerProperty PLANT_ID = EndBlockProperties.PLANT_ID; private static final IntegerProperty SOIL_ID = EndBlockProperties.SOIL_ID; private static final IntegerProperty POT_LIGHT = EndBlockProperties.POT_LIGHT; @@ -74,7 +72,10 @@ public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IP public FlowerPotBlock(Block source) { super(FabricBlockSettings.copyOf(source).luminance(state -> state.getValue(POT_LIGHT) * 5)); - this.registerDefaultState(this.defaultBlockState().setValue(PLANT_ID, 0).setValue(SOIL_ID, 0).setValue(POT_LIGHT, 0)); + this.registerDefaultState(this.defaultBlockState() + .setValue(PLANT_ID, 0) + .setValue(SOIL_ID, 0) + .setValue(POT_LIGHT, 0)); } @Override @@ -122,7 +123,10 @@ public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IP Map reservedPlantsIDs = Maps.newHashMap(); Map reservedSoilIDs = Maps.newHashMap(); - JsonObject obj = JsonFactory.getJsonObject(new File(FabricLoader.getInstance().getConfigDir().toFile(), BetterEnd.MOD_ID + "/blocks.json")); + JsonObject obj = JsonFactory.getJsonObject(new File( + FabricLoader.getInstance().getConfigDir().toFile(), + BetterEnd.MOD_ID + "/blocks.json" + )); if (obj.get("flower_pots") != null) { JsonElement plantsObj = obj.get("flower_pots").getAsJsonObject().get("plants"); JsonElement soilsObj = obj.get("flower_pots").getAsJsonObject().get("soils"); @@ -236,7 +240,16 @@ public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IP } int light = plants[i].defaultBlockState().getLightEmission() / 5; BlocksHelper.setWithUpdate(level, pos, state.setValue(PLANT_ID, i + 1).setValue(POT_LIGHT, light)); - level.playLocalSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, SoundEvents.HOE_TILL, SoundSource.BLOCKS, 1, 1, false); + level.playLocalSound( + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + SoundEvents.HOE_TILL, + SoundSource.BLOCKS, + 1, + 1, + false + ); return InteractionResult.SUCCESS; } } @@ -264,11 +277,17 @@ public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IP final int compareID = i + 1; ResourceLocation modelPath = Registry.BLOCK.getKey(plants[i]); - ResourceLocation objSource = new ResourceLocation(modelPath.getNamespace(), "models/block/" + modelPath.getPath() + "_potted.json"); + ResourceLocation objSource = new ResourceLocation( + modelPath.getNamespace(), + "models/block/" + modelPath.getPath() + "_potted.json" + ); if (Minecraft.getInstance().getResourceManager().hasResource(objSource)) { objSource = new ResourceLocation(modelPath.getNamespace(), "block/" + modelPath.getPath() + "_potted"); - model.part(objSource).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + model.part(objSource) + .setTransformation(offset) + .setCondition(state -> state.getValue(PLANT_ID) == compareID) + .add(); continue; } @@ -281,7 +300,10 @@ public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IP Optional pattern = Patterns.createJson(BasePatterns.BLOCK_CROSS, textures); UnbakedModel unbakedModel = ModelsHelper.fromPattern(pattern); modelCache.put(modelPath, unbakedModel); - model.part(modelPath).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + model.part(modelPath) + .setTransformation(offset) + .setCondition(state -> state.getValue(PLANT_ID) == compareID) + .add(); continue; } else if (plants[i] instanceof PottableLeavesBlock) { @@ -293,7 +315,10 @@ public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IP Optional pattern = Patterns.createJson(Patterns.BLOCK_POTTED_LEAVES, textures); UnbakedModel unbakedModel = ModelsHelper.fromPattern(pattern); modelCache.put(modelPath, unbakedModel); - model.part(modelPath).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + model.part(modelPath) + .setTransformation(offset) + .setCondition(state -> state.getValue(PLANT_ID) == compareID) + .add(); continue; } @@ -332,12 +357,18 @@ public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IP continue; } - model.part(new ResourceLocation(path)).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + model.part(new ResourceLocation(path)) + .setTransformation(offset) + .setCondition(state -> state.getValue(PLANT_ID) == compareID) + .add(); } else { - for (ResourceLocation location: modelCache.keySet()) { + for (ResourceLocation location : modelCache.keySet()) { if (location.getPath().equals(modelPath.getPath())) { - model.part(location).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + model.part(location) + .setTransformation(offset) + .setCondition(state -> state.getValue(PLANT_ID) == compareID) + .add(); break; } } diff --git a/src/main/java/ru/betterend/blocks/GlowingHymenophoreBlock.java b/src/main/java/ru/betterend/blocks/GlowingHymenophoreBlock.java index 699fc309..53729efd 100644 --- a/src/main/java/ru/betterend/blocks/GlowingHymenophoreBlock.java +++ b/src/main/java/ru/betterend/blocks/GlowingHymenophoreBlock.java @@ -8,6 +8,9 @@ import ru.bclib.blocks.BaseBlock; public class GlowingHymenophoreBlock extends BaseBlock { public GlowingHymenophoreBlock() { - super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).luminance(15).sound(SoundType.WART_BLOCK)); + super(FabricBlockSettings.of(Material.WOOD) + .breakByTool(FabricToolTags.AXES) + .luminance(15) + .sound(SoundType.WART_BLOCK)); } } diff --git a/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java b/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java index bbaed475..e3ab0f04 100644 --- a/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java +++ b/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java @@ -21,7 +21,12 @@ public class GlowingPillarLuminophorBlock extends BaseBlock { public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL; public GlowingPillarLuminophorBlock() { - super(FabricBlockSettings.of(Material.LEAVES).materialColor(MaterialColor.COLOR_ORANGE).breakByTool(FabricToolTags.SHEARS).strength(0.2F).luminance(15).sound(SoundType.GRASS)); + super(FabricBlockSettings.of(Material.LEAVES) + .materialColor(MaterialColor.COLOR_ORANGE) + .breakByTool(FabricToolTags.SHEARS) + .strength(0.2F) + .luminance(15) + .sound(SoundType.GRASS)); this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false)); } diff --git a/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java b/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java index 55f7fdec..ab2ba5ed 100644 --- a/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java @@ -23,7 +23,13 @@ import java.util.Random; public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock { public GlowingPillarSeedBlock() { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).lightLevel(state -> state.getValue(AGE) * 3 + 3).randomTicks().noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .lightLevel(state -> state.getValue(AGE) * 3 + 3) + .randomTicks() + .noCollission()); } @Override @@ -45,16 +51,28 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock { BlocksHelper.setWithUpdate(world, mut, roots.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)); } mut.move(Direction.UP); - BlocksHelper.setWithUpdate(world, mut, EndBlocks.GLOWING_PILLAR_LUMINOPHOR.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)); + BlocksHelper.setWithUpdate( + world, + mut, + EndBlocks.GLOWING_PILLAR_LUMINOPHOR.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true) + ); for (Direction dir : BlocksHelper.DIRECTIONS) { pos = mut.relative(dir); if (world.isEmptyBlock(pos)) { - BlocksHelper.setWithUpdate(world, pos, EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, dir)); + BlocksHelper.setWithUpdate( + world, + pos, + EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, dir) + ); } } mut.move(Direction.UP); if (world.isEmptyBlock(mut)) { - BlocksHelper.setWithUpdate(world, mut, EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, Direction.UP)); + BlocksHelper.setWithUpdate( + world, + mut, + EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, Direction.UP) + ); } } diff --git a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java index 91ab9c2f..6e044dfd 100644 --- a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java +++ b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java @@ -20,7 +20,7 @@ import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import ru.bclib.blocks.BaseBlock; -import ru.bclib.interfaces.IColorProvider; +import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.util.ColorUtil; import ru.bclib.util.MHelper; import ru.betterend.noise.OpenSimplexNoise; @@ -29,12 +29,17 @@ import ru.betterend.registry.EndBlocks; import java.util.Collections; import java.util.List; -public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider { +public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider { public static final IntegerProperty COLOR = EndBlockProperties.COLOR; private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); public HelixTreeLeavesBlock() { - super(FabricBlockSettings.of(Material.LEAVES).materialColor(MaterialColor.COLOR_ORANGE).breakByTool(FabricToolTags.SHEARS).sound(SoundType.WART_BLOCK).sound(SoundType.GRASS).strength(0.2F)); + super(FabricBlockSettings.of(Material.LEAVES) + .materialColor(MaterialColor.COLOR_ORANGE) + .breakByTool(FabricToolTags.SHEARS) + .sound(SoundType.WART_BLOCK) + .sound(SoundType.GRASS) + .strength(0.2F)); } @Override @@ -73,7 +78,10 @@ public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider { public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); if (tool != null) { - if (tool.is(FabricToolTags.SHEARS) || tool.isCorrectToolForDrops(state) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool.is(FabricToolTags.SHEARS) || tool.isCorrectToolForDrops(state) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Collections.singletonList(new ItemStack(this)); } int fortune = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_FORTUNE, tool); @@ -82,6 +90,7 @@ public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider { } return Lists.newArrayList(); } - return MHelper.RANDOM.nextInt(32) == 0 ? Lists.newArrayList(new ItemStack(EndBlocks.HELIX_TREE_SAPLING)) : Lists.newArrayList(); + return MHelper.RANDOM.nextInt(32) == 0 ? Lists.newArrayList(new ItemStack(EndBlocks.HELIX_TREE_SAPLING)) : Lists + .newArrayList(); } } diff --git a/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java b/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java index 3650496c..5ccb2dcc 100644 --- a/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; diff --git a/src/main/java/ru/betterend/blocks/HydraluxBlock.java b/src/main/java/ru/betterend/blocks/HydraluxBlock.java index c9179b5b..82ee1d1d 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxBlock.java @@ -33,7 +33,12 @@ public class HydraluxBlock extends UnderwaterPlantBlock { public static final EnumProperty SHAPE = EndBlockProperties.HYDRALUX_SHAPE; public HydraluxBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS) + .lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0) + .noCollission()); } @Override @@ -84,7 +89,10 @@ public class HydraluxBlock extends UnderwaterPlantBlock { return Lists.newArrayList(new ItemStack(EndItems.HYDRALUX_PETAL, MHelper.randRange(1, 4, MHelper.RANDOM))); } else if (shape == HydraluxShape.ROOTS) { - return Lists.newArrayList(new ItemStack(EndBlocks.HYDRALUX_SAPLING, MHelper.randRange(1, 2, MHelper.RANDOM))); + return Lists.newArrayList(new ItemStack( + EndBlocks.HYDRALUX_SAPLING, + MHelper.randRange(1, 2, MHelper.RANDOM) + )); } return Collections.emptyList(); } diff --git a/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java b/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java index c45b296a..40c12ed9 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java @@ -13,7 +13,13 @@ import ru.bclib.blocks.BaseBlock; public class HydraluxPetalBlock extends BaseBlock { public HydraluxPetalBlock() { - this(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.AXES).breakByHand(true).hardness(1).resistance(1).materialColor(MaterialColor.PODZOL).sound(SoundType.WART_BLOCK)); + this(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.AXES) + .breakByHand(true) + .hardness(1) + .resistance(1) + .materialColor(MaterialColor.PODZOL) + .sound(SoundType.WART_BLOCK)); } public HydraluxPetalBlock(Properties settings) { diff --git a/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java b/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java index 17c58284..7e7236a4 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java @@ -10,13 +10,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.ModelsHelper; -import ru.bclib.interfaces.IColorProvider; +import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.util.BlocksHelper; import ru.betterend.client.models.Patterns; import java.util.Optional; -public class HydraluxPetalColoredBlock extends HydraluxPetalBlock implements IColorProvider { +public class HydraluxPetalColoredBlock extends HydraluxPetalBlock implements CustomColorProvider { public HydraluxPetalColoredBlock(FabricBlockSettings settings) { super(settings); } diff --git a/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java b/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java index 05532be7..6e51b979 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java @@ -29,18 +29,40 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock { mut.setY(pos.getY()); BlockState state = EndBlocks.HYDRALUX.defaultBlockState(); - BlocksHelper.setWithoutUpdate(world, pos, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, HydraluxShape.ROOTS)); + BlocksHelper.setWithoutUpdate( + world, + pos, + state.setValue(EndBlockProperties.HYDRALUX_SHAPE, HydraluxShape.ROOTS) + ); for (int i = 1; i < h - 2; i++) { mut.setY(pos.getY() + i); - BlocksHelper.setWithoutUpdate(world, mut, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE)); + BlocksHelper.setWithoutUpdate( + world, + mut, + state.setValue(EndBlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE) + ); } mut.setY(mut.getY() + 1); boolean big = random.nextBoolean(); - BlocksHelper.setWithoutUpdate(world, mut, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM)); + BlocksHelper.setWithoutUpdate( + world, + mut, + state.setValue( + EndBlockProperties.HYDRALUX_SHAPE, + big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM + ) + ); mut.setY(mut.getY() + 1); - BlocksHelper.setWithoutUpdate(world, mut, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP)); + BlocksHelper.setWithoutUpdate( + world, + mut, + state.setValue( + EndBlockProperties.HYDRALUX_SHAPE, + big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP + ) + ); } @Override diff --git a/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java b/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java index 29dd87f5..30d9be03 100644 --- a/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java +++ b/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java @@ -50,7 +50,11 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15); public HydrothermalVentBlock() { - super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sound(SoundType.STONE).noCollission().requiresCorrectToolForDrops()); + super(FabricBlockSettings.of(Material.STONE) + .breakByTool(FabricToolTags.PICKAXES) + .sound(SoundType.STONE) + .noCollission() + .requiresCorrectToolForDrops()); this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false)); } @@ -95,7 +99,8 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo public BlockState getStateForPlacement(BlockPlaceContext ctx) { LevelAccessor worldAccess = ctx.getLevel(); BlockPos blockPos = ctx.getClickedPos(); - return this.defaultBlockState().setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER); + return this.defaultBlockState() + .setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER); } @Override @@ -119,7 +124,8 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo @Override public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { - if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above()).is(Blocks.WATER)) { + if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above()) + .is(Blocks.WATER)) { tick(state, (ServerLevel) world, pos, world.random); } } diff --git a/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java b/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java index fb0c574a..bd50261f 100644 --- a/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java +++ b/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java @@ -20,11 +20,11 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IColorProvider; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelProvider; +import ru.bclib.interfaces.CustomColorProvider; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.ColorUtil; import ru.bclib.util.MHelper; import ru.betterend.client.models.Patterns; @@ -33,7 +33,7 @@ import ru.betterend.noise.OpenSimplexNoise; import java.util.List; import java.util.Optional; -public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider, IColorProvider { +public class JellyshroomCapBlock extends SlimeBlock implements RenderLayerProvider, BlockModelProvider, CustomColorProvider { public static final IntegerProperty COLOR = EndBlockProperties.COLOR; private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); private final Vec3i colorStart; diff --git a/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java b/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java index 968acaa7..d173d767 100644 --- a/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; @@ -22,7 +21,8 @@ public class LacugroveSaplingBlock extends PottableFeatureSapling { @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { - return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below()).is(EndBlocks.ENDSTONE_DUST); + return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below()) + .is(EndBlocks.ENDSTONE_DUST); } @Override diff --git a/src/main/java/ru/betterend/blocks/LanceleafBlock.java b/src/main/java/ru/betterend/blocks/LanceleafBlock.java index f2dd344c..eeab0ae4 100644 --- a/src/main/java/ru/betterend/blocks/LanceleafBlock.java +++ b/src/main/java/ru/betterend/blocks/LanceleafBlock.java @@ -42,7 +42,8 @@ public class LanceleafBlock extends EndPlantBlock { return world.getBlockState(pos.below()).is(this); } else if (shape == PentaShape.BOTTOM) { - return world.getBlockState(pos.below()).is(EndBlocks.AMBER_MOSS) && world.getBlockState(pos.above()).is(this); + return world.getBlockState(pos.below()).is(EndBlocks.AMBER_MOSS) && world.getBlockState(pos.above()) + .is(this); } else { return world.getBlockState(pos.below()).is(this) && world.getBlockState(pos.above()).is(this); @@ -64,6 +65,7 @@ public class LanceleafBlock extends EndPlantBlock { if (state.getValue(SHAPE) == PentaShape.BOTTOM) { return Collections.singletonList(new ItemStack(EndBlocks.LANCELEAF_SEED)); } - return MHelper.RANDOM.nextBoolean() ? Collections.emptyList() : Collections.singletonList(new ItemStack(EndBlocks.LANCELEAF_SEED)); + return MHelper.RANDOM.nextBoolean() ? Collections.emptyList() : Collections.singletonList(new ItemStack( + EndBlocks.LANCELEAF_SEED)); } } diff --git a/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java b/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java index fdafa498..c75251ac 100644 --- a/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java @@ -27,12 +27,28 @@ public class LanceleafSeedBlock extends EndPlantWithAgeBlock { MutableBlockPos mut = new MutableBlockPos().set(pos); BlockState plant = EndBlocks.LANCELEAF.defaultBlockState().setValue(BlockProperties.ROTATION, rotation); BlocksHelper.setWithoutUpdate(world, mut, plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.BOTTOM)); - BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_BOTTOM)); + BlocksHelper.setWithoutUpdate( + world, + mut.move(Direction.UP), + plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_BOTTOM) + ); for (int i = 2; i < height - 2; i++) { - BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.MIDDLE)); + BlocksHelper.setWithoutUpdate( + world, + mut.move(Direction.UP), + plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.MIDDLE) + ); } - BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_TOP)); - BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.TOP)); + BlocksHelper.setWithoutUpdate( + world, + mut.move(Direction.UP), + plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_TOP) + ); + BlocksHelper.setWithoutUpdate( + world, + mut.move(Direction.UP), + plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.TOP) + ); } @Override diff --git a/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java b/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java index 5cdf3dbd..d9763815 100644 --- a/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java +++ b/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java @@ -28,7 +28,11 @@ public class LargeAmaranitaBlock extends EndPlantBlock { private static final VoxelShape SHAPE_TOP = Shapes.or(Block.box(1, 3, 1, 15, 16, 15), SHAPE_BOTTOM); public LargeAmaranitaBlock() { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0)); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0)); } @Override diff --git a/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java b/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java index 2bc76f6f..6e3bce0b 100644 --- a/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; diff --git a/src/main/java/ru/betterend/blocks/LumecornBlock.java b/src/main/java/ru/betterend/blocks/LumecornBlock.java index e2a494bc..1b2b54a6 100644 --- a/src/main/java/ru/betterend/blocks/LumecornBlock.java +++ b/src/main/java/ru/betterend/blocks/LumecornBlock.java @@ -22,7 +22,7 @@ import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.api.TagAPI; import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.MHelper; import ru.betterend.blocks.EndBlockProperties.LumecornShape; import ru.betterend.registry.EndBlocks; @@ -32,13 +32,16 @@ import java.util.Collections; import java.util.List; @SuppressWarnings("deprecation") -public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped { +public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvider { public static final EnumProperty SHAPE = EnumProperty.create("shape", LumecornShape.class); private static final VoxelShape SHAPE_BOTTOM = Block.box(6, 0, 6, 10, 16, 10); private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10); public LumecornBlock() { - super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).hardness(0.5F).luminance(state -> state.getValue(SHAPE).getLight())); + super(FabricBlockSettings.of(Material.WOOD) + .breakByTool(FabricToolTags.AXES) + .hardness(0.5F) + .luminance(state -> state.getValue(SHAPE).getLight())); } @Override @@ -84,9 +87,13 @@ public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped { public List getDrops(BlockState state, LootContext.Builder builder) { LumecornShape shape = state.getValue(SHAPE); if (shape == LumecornShape.BOTTOM_BIG || shape == LumecornShape.BOTTOM_SMALL || shape == LumecornShape.MIDDLE) { - return Collections.singletonList(new ItemStack(EndBlocks.LUMECORN_SEED, MHelper.randRange(1, 2, MHelper.RANDOM))); + return Collections.singletonList(new ItemStack( + EndBlocks.LUMECORN_SEED, + MHelper.randRange(1, 2, MHelper.RANDOM) + )); } - return MHelper.RANDOM.nextBoolean() ? Collections.singletonList(new ItemStack(EndItems.LUMECORN_ROD)) : Collections.emptyList(); + return MHelper.RANDOM.nextBoolean() ? Collections.singletonList(new ItemStack(EndItems.LUMECORN_ROD)) : Collections + .emptyList(); } @Override diff --git a/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java b/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java index 2b7ee706..fea2d1de 100644 --- a/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java +++ b/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java @@ -17,13 +17,13 @@ import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Material; import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.betterend.registry.EndBlocks; import java.util.Queue; @SuppressWarnings("deprecation") -public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped { +public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerProvider { public MengerSpongeBlock() { super(FabricBlockSettings.copyOf(Blocks.SPONGE).noOcclusion()); } @@ -59,7 +59,11 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped FluidState fluidState = world.getFluidState(blockPos2); Material material = blockState.getMaterial(); if (fluidState.is(FluidTags.WATER)) { - if (blockState.getBlock() instanceof BucketPickup && !((BucketPickup) blockState.getBlock()).pickupBlock(world, blockPos2, blockState).isEmpty()) { + if (blockState.getBlock() instanceof BucketPickup && !((BucketPickup) blockState.getBlock()).pickupBlock( + world, + blockPos2, + blockState + ).isEmpty()) { ++i; if (j < 6) { queue.add(new Tuple<>(blockPos2, j + 1)); diff --git a/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java b/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java index 475583d8..1e453d46 100644 --- a/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java +++ b/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java @@ -19,14 +19,14 @@ import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import ru.betterend.registry.EndBlocks; import java.util.Random; @SuppressWarnings("deprecation") -public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyped { +public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLayerProvider { public MengerSpongeWetBlock() { super(FabricBlockSettings.copyOf(Blocks.WET_SPONGE).noOcclusion()); } @@ -36,7 +36,14 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyp if (world.dimensionType().ultraWarm()) { world.setBlock(pos, EndBlocks.MENGER_SPONGE.defaultBlockState(), 3); world.levelEvent(2009, pos, 0); - world.playSound(null, pos, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 1.0F, (1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F); + world.playSound( + null, + pos, + SoundEvents.FIRE_EXTINGUISH, + SoundSource.BLOCKS, + 1.0F, + (1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F + ); } } @@ -90,7 +97,13 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyp world.levelEvent(2001, pos, getId(state)); } if (world.getGameRules().getBoolean(GameRules.RULE_DOBLOCKDROPS) && (player == null || !player.isCreative())) { - ItemEntity drop = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(this)); + ItemEntity drop = new ItemEntity( + world, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + new ItemStack(this) + ); world.addFreshEntity(drop); } } diff --git a/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java b/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java index 56500f9c..81877dc7 100644 --- a/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java +++ b/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java @@ -54,7 +54,15 @@ public class MossyDragonBoneBlock extends BaseRotatedPillarBlock { return false; } else { - int i = LayerLightEngine.getLightBlockInto(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getLightBlock(worldView, blockPos)); + int i = LayerLightEngine.getLightBlockInto( + worldView, + state, + pos, + blockState, + blockPos, + Direction.UP, + blockState.getLightBlock(worldView, blockPos) + ); return i < 5; } } diff --git a/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java b/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java index 0e227568..3320e2ef 100644 --- a/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java +++ b/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java @@ -21,7 +21,11 @@ public class MossyGlowshroomCapBlock extends BaseBlock { } public BlockState getStateForPlacement(BlockPlaceContext ctx) { - return this.defaultBlockState().setValue(TRANSITION, EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel().getBlockState(ctx.getClickedPos().below()))); + return this.defaultBlockState() + .setValue( + TRANSITION, + EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel().getBlockState(ctx.getClickedPos().below())) + ); } protected void createBlockStateDefinition(StateDefinition.Builder builder) { diff --git a/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java b/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java index 77f54185..fe062fdc 100644 --- a/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; @@ -22,7 +21,8 @@ public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling { @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { - return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below()).is(EndBlocks.END_MYCELIUM); + return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below()) + .is(EndBlocks.END_MYCELIUM); } @Override diff --git a/src/main/java/ru/betterend/blocks/MossyObsidian.java b/src/main/java/ru/betterend/blocks/MossyObsidian.java index 15417641..eb4a6888 100644 --- a/src/main/java/ru/betterend/blocks/MossyObsidian.java +++ b/src/main/java/ru/betterend/blocks/MossyObsidian.java @@ -51,7 +51,15 @@ public class MossyObsidian extends BaseBlock { return false; } else { - int i = LayerLightEngine.getLightBlockInto(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getLightBlock(worldView, blockPos)); + int i = LayerLightEngine.getLightBlockInto( + worldView, + state, + pos, + blockState, + blockPos, + Direction.UP, + blockState.getLightBlock(worldView, blockPos) + ); return i < 5; } } diff --git a/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java b/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java index 60fcf204..7258933d 100644 --- a/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java +++ b/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java @@ -33,7 +33,10 @@ public class NeedlegrassBlock extends EndPlantBlock { @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else { diff --git a/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java b/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java index 4b4df46d..6a2b4a4f 100644 --- a/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java @@ -39,7 +39,7 @@ import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.betterend.blocks.EndBlockProperties.CactusBottom; @@ -51,7 +51,7 @@ import java.util.List; import java.util.Random; @SuppressWarnings("deprecation") -public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, IRenderTyped, PottablePlant { +public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, RenderLayerProvider, PottablePlant { public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty CACTUS_BOTTOM = EndBlockProperties.CACTUS_BOTTOM; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; @@ -67,7 +67,9 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate public NeonCactusPlantBlock() { super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15).randomTicks()); - registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false).setValue(FACING, Direction.UP).setValue(SHAPE, TripleShape.TOP)); + registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false) + .setValue(FACING, Direction.UP) + .setValue(SHAPE, TripleShape.TOP)); } @Override @@ -81,7 +83,9 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate BlockPos pos = ctx.getClickedPos(); Direction dir = ctx.getClickedFace(); BlockState down = world.getBlockState(pos.relative(dir.getOpposite())); - BlockState state = this.defaultBlockState().setValue(WATERLOGGED, world.getFluidState(pos).getType() == Fluids.WATER).setValue(FACING, ctx.getClickedFace()); + BlockState state = this.defaultBlockState() + .setValue(WATERLOGGED, world.getFluidState(pos).getType() == Fluids.WATER) + .setValue(FACING, ctx.getClickedFace()); if (down.is(Blocks.END_STONE) || down.is(EndBlocks.ENDSTONE_DUST)) { state = state.setValue(CACTUS_BOTTOM, CactusBottom.SAND); } @@ -195,11 +199,17 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate Direction side = getSideDirection(world, pos, state, dir, random); BlockPos sidePos = pos.relative(side); if (world.isEmptyBlock(sidePos)) { - BlockState placement = state.setValue(SHAPE, TripleShape.TOP).setValue(CACTUS_BOTTOM, CactusBottom.EMPTY).setValue(WATERLOGGED, false).setValue(FACING, side); + BlockState placement = state.setValue(SHAPE, TripleShape.TOP) + .setValue(CACTUS_BOTTOM, CactusBottom.EMPTY) + .setValue(WATERLOGGED, false) + .setValue(FACING, side); BlocksHelper.setWithoutUpdate(world, sidePos, placement); } } - BlockState placement = state.setValue(SHAPE, TripleShape.TOP).setValue(CACTUS_BOTTOM, CactusBottom.EMPTY).setValue(WATERLOGGED, false).setValue(FACING, dir); + BlockState placement = state.setValue(SHAPE, TripleShape.TOP) + .setValue(CACTUS_BOTTOM, CactusBottom.EMPTY) + .setValue(WATERLOGGED, false) + .setValue(FACING, dir); BlocksHelper.setWithoutUpdate(world, pos.relative(dir), placement); mutateStem(placement, world, pos, MAX_LENGTH); } @@ -256,12 +266,18 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate Direction side = getSideDirection(world, pos, state, dir, random); BlockPos sidePos = pos.relative(side); if (world.isEmptyBlock(sidePos)) { - BlockState placement = state.setValue(SHAPE, TripleShape.TOP).setValue(CACTUS_BOTTOM, CactusBottom.EMPTY).setValue(WATERLOGGED, false).setValue(FACING, side); + BlockState placement = state.setValue(SHAPE, TripleShape.TOP) + .setValue(CACTUS_BOTTOM, CactusBottom.EMPTY) + .setValue(WATERLOGGED, false) + .setValue(FACING, side); BlocksHelper.setWithoutUpdate(world, sidePos, placement); ends.add(sidePos.mutable()); } } - BlockState placement = state.setValue(SHAPE, TripleShape.TOP).setValue(CACTUS_BOTTOM, CactusBottom.EMPTY).setValue(WATERLOGGED, false).setValue(FACING, dir); + BlockState placement = state.setValue(SHAPE, TripleShape.TOP) + .setValue(CACTUS_BOTTOM, CactusBottom.EMPTY) + .setValue(WATERLOGGED, false) + .setValue(FACING, dir); BlocksHelper.setWithoutUpdate(world, pos.relative(dir), placement); mutateStem(placement, world, pos, MAX_LENGTH); pos.move(dir); diff --git a/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java b/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java index 202ee564..21cb4564 100644 --- a/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java +++ b/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java @@ -23,7 +23,12 @@ public class PondAnemoneBlock extends EndUnderwaterPlantBlock { private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14); public PondAnemoneBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(13).sound(SoundType.CORAL_BLOCK).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .luminance(13) + .sound(SoundType.CORAL_BLOCK) + .noCollission()); } @Override diff --git a/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java b/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java index 3f1df4a8..8f01bf65 100644 --- a/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; diff --git a/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java b/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java index 57809ae3..217f84f0 100644 --- a/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java +++ b/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java @@ -35,8 +35,8 @@ import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IColorProvider; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.CustomColorProvider; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import ru.bclib.util.ColorUtil; import ru.betterend.particle.InfusionParticleType; @@ -45,7 +45,7 @@ import ru.betterend.registry.EndItems; import java.util.List; -public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IRenderTyped { +public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvider, RenderLayerProvider { private static final VoxelShape VOXEL_SHAPE_BOTTOM = Block.box(1, 0, 1, 15, 16, 15); private static final VoxelShape VOXEL_SHAPE_MIDDLE_TOP = Block.box(2, 0, 2, 14, 16, 14); @@ -145,7 +145,7 @@ public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IR @Override public BlockColor getProvider() { - return ((IColorProvider) EndBlocks.AURORA_CRYSTAL).getProvider(); + return ((CustomColorProvider) EndBlocks.AURORA_CRYSTAL).getProvider(); } @Override @@ -162,7 +162,10 @@ public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IR if (hand != InteractionHand.MAIN_HAND || !canActivate) { if (!world.isClientSide && !(itemStack.getItem() instanceof BlockItem) && !player.isCreative()) { ServerPlayer serverPlayerEntity = (ServerPlayer) player; - serverPlayerEntity.displayClientMessage(new TranslatableComponent("message.betterend.fail_spawn"), true); + serverPlayerEntity.displayClientMessage( + new TranslatableComponent("message.betterend.fail_spawn"), + true + ); } return InteractionResult.FAIL; } diff --git a/src/main/java/ru/betterend/blocks/RunedFlavolite.java b/src/main/java/ru/betterend/blocks/RunedFlavolite.java index f92cde75..3ebe6c4d 100644 --- a/src/main/java/ru/betterend/blocks/RunedFlavolite.java +++ b/src/main/java/ru/betterend/blocks/RunedFlavolite.java @@ -21,9 +21,14 @@ public class RunedFlavolite extends BaseBlock { public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE; public RunedFlavolite(boolean unbreakable) { - super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished).strength(unbreakable ? -1 : 1, unbreakable ? Blocks.BEDROCK.getExplosionResistance() : Blocks.OBSIDIAN.getExplosionResistance()).luminance(state -> { - return state.getValue(ACTIVATED) ? 8 : 0; - })); + super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished) + .strength( + unbreakable ? -1 : 1, + unbreakable ? Blocks.BEDROCK.getExplosionResistance() : Blocks.OBSIDIAN.getExplosionResistance() + ) + .luminance(state -> { + return state.getValue(ACTIVATED) ? 8 : 0; + })); this.registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false)); } diff --git a/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java b/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java index e75cd4c7..3cdaf282 100644 --- a/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java +++ b/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java @@ -20,7 +20,15 @@ public class ShadowGrassBlock extends EndTerrainBlock { public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { super.animateTick(state, world, pos, random); if (random.nextInt(32) == 0) { - world.addParticle(EndParticles.BLACK_SPORE, (double) pos.getX() + random.nextDouble(), (double) pos.getY() + 1.1D, (double) pos.getZ() + random.nextDouble(), 0.0D, 0.0D, 0.0D); + world.addParticle( + EndParticles.BLACK_SPORE, + (double) pos.getX() + random.nextDouble(), + (double) pos.getY() + 1.1D, + (double) pos.getZ() + random.nextDouble(), + 0.0D, + 0.0D, + 0.0D + ); } } } diff --git a/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java b/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java index aa58c8e4..a0d4d297 100644 --- a/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java +++ b/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java @@ -41,7 +41,13 @@ public class SilkMothHiveBlock extends BaseBlock { public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS; public SilkMothHiveBlock() { - super(FabricBlockSettings.of(Material.WOOD).breakByHand(true).hardness(0.5F).resistance(0.1F).sound(SoundType.WOOL).noOcclusion().randomTicks()); + super(FabricBlockSettings.of(Material.WOOD) + .breakByHand(true) + .hardness(0.5F) + .resistance(0.1F) + .sound(SoundType.WOOL) + .noOcclusion() + .randomTicks()); this.registerDefaultState(defaultBlockState().setValue(FULLNESS, 0)); } diff --git a/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java b/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java index 3e760b76..8fb70bc9 100644 --- a/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java +++ b/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java @@ -37,7 +37,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.blocks.BaseBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.betterend.entity.SilkMothEntity; @@ -48,7 +48,7 @@ import java.util.Collections; import java.util.List; import java.util.Random; -public class SilkMothNestBlock extends BaseBlock implements IRenderTyped { +public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider { public static final BooleanProperty ACTIVE = EndBlockProperties.ACTIVE; public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS; @@ -56,7 +56,12 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped { private static final VoxelShape BOTTOM = box(0, 0, 0, 16, 16, 16); public SilkMothNestBlock() { - super(FabricBlockSettings.of(Material.WOOL).hardness(0.5F).resistance(0.1F).sound(SoundType.WOOL).noOcclusion().randomTicks()); + super(FabricBlockSettings.of(Material.WOOL) + .hardness(0.5F) + .resistance(0.1F) + .sound(SoundType.WOOL) + .noOcclusion() + .randomTicks()); this.registerDefaultState(defaultBlockState().setValue(ACTIVE, true).setValue(FULLNESS, 0)); } @@ -84,7 +89,8 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped { @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!state.getValue(ACTIVE)) { - if (canSupportCenter(world, pos.above(), Direction.DOWN) || world.getBlockState(pos.above()).is(BlockTags.LEAVES)) { + if (canSupportCenter(world, pos.above(), Direction.DOWN) || world.getBlockState(pos.above()) + .is(BlockTags.LEAVES)) { return state; } else { diff --git a/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java b/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java index db8f7f4b..c0625123 100644 --- a/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java +++ b/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java @@ -30,7 +30,8 @@ public class SmallAmaranitaBlock extends EndPlantBlock { public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { BlockPos bigPos = growBig(world, pos); if (bigPos != null) { - if (EndFeatures.GIGANTIC_AMARANITA.getFeature().place(new FeaturePlaceContext<>(world, null, random, bigPos, null))) { + if (EndFeatures.GIGANTIC_AMARANITA.getFeature() + .place(new FeaturePlaceContext<>(world, null, random, bigPos, null))) { replaceMushroom(world, bigPos); replaceMushroom(world, bigPos.south()); replaceMushroom(world, bigPos.east()); @@ -60,7 +61,8 @@ public class SmallAmaranitaBlock extends EndPlantBlock { } private boolean checkFrame(ServerLevel world, BlockPos pos) { - return world.getBlockState(pos).is(this) && world.getBlockState(pos.south()).is(this) && world.getBlockState(pos.east()).is(this) && world.getBlockState(pos.south().east()).is(this); + return world.getBlockState(pos).is(this) && world.getBlockState(pos.south()).is(this) && world.getBlockState(pos + .east()).is(this) && world.getBlockState(pos.south().east()).is(this); } private void replaceMushroom(ServerLevel world, BlockPos pos) { diff --git a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java index a0293a97..7776769d 100644 --- a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java +++ b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java @@ -30,7 +30,7 @@ import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.api.TagAPI; import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.BlocksHelper; import ru.betterend.interfaces.PottablePlant; import ru.betterend.registry.EndFeatures; @@ -39,11 +39,15 @@ import java.util.EnumMap; import java.util.List; import java.util.Random; -public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderTyped, BonemealableBlock, PottablePlant { +public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public SmallJellyshroomBlock() { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.NETHER_WART).noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.NETHER_WART) + .noCollission()); } @Override @@ -55,7 +59,10 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else { diff --git a/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java b/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java index 9852eae0..8437e0cd 100644 --- a/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java @@ -8,6 +8,12 @@ import ru.betterend.blocks.basis.LitPillarBlock; public class SmaragdantCrystalBlock extends LitPillarBlock { public SmaragdantCrystalBlock() { - super(FabricBlockSettings.of(Material.GLASS).breakByTool(FabricToolTags.PICKAXES).luminance(15).hardness(1F).resistance(1F).noOcclusion().sound(SoundType.AMETHYST)); + super(FabricBlockSettings.of(Material.GLASS) + .breakByTool(FabricToolTags.PICKAXES) + .luminance(15) + .hardness(1F) + .resistance(1F) + .noOcclusion() + .sound(SoundType.AMETHYST)); } } diff --git a/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java b/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java index afad9916..8a078097 100644 --- a/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java +++ b/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java @@ -27,17 +27,23 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import java.util.EnumMap; @SuppressWarnings("deprecation") -public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements IRenderTyped, SimpleWaterloggedBlock, LiquidBlockContainer { +public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public SmaragdantCrystalShardBlock() { - super(FabricBlockSettings.of(Material.STONE).materialColor(MaterialColor.COLOR_GREEN).breakByTool(FabricToolTags.PICKAXES).luminance(15).sound(SoundType.AMETHYST_CLUSTER).requiresCorrectToolForDrops().noCollission()); + super(FabricBlockSettings.of(Material.STONE) + .materialColor(MaterialColor.COLOR_GREEN) + .breakByTool(FabricToolTags.PICKAXES) + .luminance(15) + .sound(SoundType.AMETHYST_CLUSTER) + .requiresCorrectToolForDrops() + .noCollission()); } @Override diff --git a/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java b/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java index 88d6dfcf..7f6a683d 100644 --- a/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java @@ -31,7 +31,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.MHelper; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; @@ -41,13 +41,18 @@ import java.util.EnumMap; import java.util.List; @SuppressWarnings("deprecation") -public class SulphurCrystalBlock extends BaseAttachedBlock implements IRenderTyped, SimpleWaterloggedBlock, LiquidBlockContainer { +public class SulphurCrystalBlock extends BaseAttachedBlock implements RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public static final IntegerProperty AGE = IntegerProperty.create("age", 0, 2); public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public SulphurCrystalBlock() { - super(FabricBlockSettings.of(Material.STONE).materialColor(MaterialColor.COLOR_YELLOW).breakByTool(FabricToolTags.PICKAXES).sound(SoundType.GLASS).requiresCorrectToolForDrops().noCollission()); + super(FabricBlockSettings.of(Material.STONE) + .materialColor(MaterialColor.COLOR_YELLOW) + .breakByTool(FabricToolTags.PICKAXES) + .sound(SoundType.GLASS) + .requiresCorrectToolForDrops() + .noCollission()); } @Override @@ -63,7 +68,10 @@ public class SulphurCrystalBlock extends BaseAttachedBlock implements IRenderTyp @Override public List getDrops(BlockState state, LootContext.Builder builder) { - return state.getValue(AGE) < 2 ? Collections.emptyList() : Lists.newArrayList(new ItemStack(EndItems.CRYSTALLINE_SULPHUR, MHelper.randRange(1, 3, MHelper.RANDOM))); + return state.getValue(AGE) < 2 ? Collections.emptyList() : Lists.newArrayList(new ItemStack( + EndItems.CRYSTALLINE_SULPHUR, + MHelper.randRange(1, 3, MHelper.RANDOM) + )); } @Override diff --git a/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java b/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java index de030d36..c5337047 100644 --- a/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java +++ b/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java @@ -11,14 +11,14 @@ import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; import ru.bclib.blocks.BaseVineBlock; -import ru.bclib.interfaces.IColorProvider; +import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.util.ColorUtil; import ru.bclib.util.MHelper; import ru.betterend.registry.EndParticles; import java.util.Random; -public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider { +public class TenaneaFlowersBlock extends BaseVineBlock implements CustomColorProvider { public static final Vec3i[] COLORS; public TenaneaFlowersBlock() { @@ -73,6 +73,11 @@ public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider } static { - COLORS = new Vec3i[]{new Vec3i(250, 111, 222), new Vec3i(167, 89, 255), new Vec3i(120, 207, 239), new Vec3i(255, 87, 182)}; + COLORS = new Vec3i[] { + new Vec3i(250, 111, 222), + new Vec3i(167, 89, 255), + new Vec3i(120, 207, 239), + new Vec3i(255, 87, 182) + }; } } diff --git a/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java b/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java index 2e960926..7610721f 100644 --- a/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; diff --git a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java index 1088eda7..8a5061d6 100644 --- a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java +++ b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java @@ -42,7 +42,8 @@ public class TwistedUmbrellaMossBlock extends EndPlantBlock { @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { int rot = world.random.nextInt(4); - BlockState bs = EndBlocks.TWISTED_UMBRELLA_MOSS_TALL.defaultBlockState().setValue(BaseDoublePlantBlock.ROTATION, rot); + BlockState bs = EndBlocks.TWISTED_UMBRELLA_MOSS_TALL.defaultBlockState() + .setValue(BaseDoublePlantBlock.ROTATION, rot); BlocksHelper.setWithoutUpdate(world, pos, bs); BlocksHelper.setWithoutUpdate(world, pos.above(), bs.setValue(BaseDoublePlantBlock.TOP, true)); } diff --git a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java index 659a8b04..c63d7d5b 100644 --- a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java +++ b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java @@ -17,7 +17,13 @@ public class TwistedUmbrellaMossTallBlock extends BaseDoublePlantBlock { @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { - ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(EndBlocks.TWISTED_UMBRELLA_MOSS)); + ItemEntity item = new ItemEntity( + world, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + new ItemStack(EndBlocks.TWISTED_UMBRELLA_MOSS) + ); world.addFreshEntity(item); } diff --git a/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java index 8cf39f9c..36dfa686 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java @@ -17,7 +17,13 @@ public class UmbrellaMossTallBlock extends BaseDoublePlantBlock { @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { - ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(EndBlocks.UMBRELLA_MOSS)); + ItemEntity item = new ItemEntity( + world, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + new ItemStack(EndBlocks.UMBRELLA_MOSS) + ); world.addFreshEntity(item); } diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java index 4b37671a..4c5f7dbe 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java @@ -27,7 +27,9 @@ public class UmbrellaTreeClusterBlock extends BaseBlock { public static final BooleanProperty NATURAL = BlockProperties.NATURAL; public UmbrellaTreeClusterBlock() { - super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK).materialColor(MaterialColor.COLOR_PURPLE).luminance(15)); + super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK) + .materialColor(MaterialColor.COLOR_PURPLE) + .luminance(15)); registerDefaultState(stateDefinition.any().setValue(NATURAL, false)); } @@ -45,8 +47,21 @@ public class UmbrellaTreeClusterBlock extends BaseBlock { } stack = new ItemStack(EndItems.UMBRELLA_CLUSTER_JUICE); player.addItem(stack); - world.playLocalSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, SoundEvents.BOTTLE_FILL, SoundSource.BLOCKS, 1, 1, false); - BlocksHelper.setWithUpdate(world, pos, EndBlocks.UMBRELLA_TREE_CLUSTER_EMPTY.defaultBlockState().setValue(NATURAL, state.getValue(NATURAL))); + world.playLocalSound( + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + SoundEvents.BOTTLE_FILL, + SoundSource.BLOCKS, + 1, + 1, + false + ); + BlocksHelper.setWithUpdate( + world, + pos, + EndBlocks.UMBRELLA_TREE_CLUSTER_EMPTY.defaultBlockState().setValue(NATURAL, state.getValue(NATURAL)) + ); return InteractionResult.SUCCESS; } return InteractionResult.FAIL; diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java index 68c676f3..1ad1c7aa 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java @@ -19,7 +19,9 @@ public class UmbrellaTreeClusterEmptyBlock extends BaseBlock { public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL; public UmbrellaTreeClusterEmptyBlock() { - super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK).materialColor(MaterialColor.COLOR_PURPLE).randomTicks()); + super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK) + .materialColor(MaterialColor.COLOR_PURPLE) + .randomTicks()); registerDefaultState(stateDefinition.any().setValue(NATURAL, false)); } @@ -31,7 +33,11 @@ public class UmbrellaTreeClusterEmptyBlock extends BaseBlock { @Override public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) { if (state.getValue(NATURAL) && random.nextInt(16) == 0) { - BlocksHelper.setWithUpdate(world, pos, EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState().setValue(UmbrellaTreeClusterBlock.NATURAL, true)); + BlocksHelper.setWithUpdate( + world, + pos, + EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState().setValue(UmbrellaTreeClusterBlock.NATURAL, true) + ); } } } diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java index b62e41fd..162b4900 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java @@ -18,9 +18,9 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.storage.loot.LootContext; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelProvider; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.MHelper; import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.registry.EndBlocks; @@ -28,7 +28,7 @@ import ru.betterend.registry.EndBlocks; import java.util.Collections; import java.util.List; -public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider { +public class UmbrellaTreeMembraneBlock extends SlimeBlock implements RenderLayerProvider, BlockModelProvider { public static final IntegerProperty COLOR = EndBlockProperties.COLOR; private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); @@ -60,7 +60,8 @@ public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderType return Lists.newArrayList(new ItemStack(this)); } else { - return MHelper.RANDOM.nextInt(4) == 0 ? Lists.newArrayList(new ItemStack(EndBlocks.UMBRELLA_TREE_SAPLING)) : Collections.emptyList(); + return MHelper.RANDOM.nextInt(4) == 0 ? Lists.newArrayList(new ItemStack(EndBlocks.UMBRELLA_TREE_SAPLING)) : Collections + .emptyList(); } } diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java index 782942a6..6213f6f3 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java @@ -5,7 +5,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; -import ru.bclib.blocks.FeatureSaplingBlock; import ru.bclib.client.render.BCLRenderLayer; import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; diff --git a/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java b/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java index 3bbab8d1..0a73fcd5 100644 --- a/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java +++ b/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java @@ -87,7 +87,16 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid world.addAlwaysVisibleParticle(ParticleTypes.BUBBLE_COLUMN_UP, px, py, pz, 0, 0.04, 0); } if (random.nextInt(200) == 0) { - world.playLocalSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.BUBBLE_COLUMN_UPWARDS_AMBIENT, SoundSource.BLOCKS, 0.2F + random.nextFloat() * 0.2F, 0.9F + random.nextFloat() * 0.15F, false); + world.playLocalSound( + pos.getX(), + pos.getY(), + pos.getZ(), + SoundEvents.BUBBLE_COLUMN_UPWARDS_AMBIENT, + SoundSource.BLOCKS, + 0.2F + random.nextFloat() * 0.2F, + 0.9F + random.nextFloat() * 0.15F, + false + ); } } @@ -100,8 +109,28 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid ServerLevel serverWorld = (ServerLevel) world; for (int i = 0; i < 2; ++i) { - serverWorld.sendParticles(ParticleTypes.SPLASH, (double) pos.getX() + world.random.nextDouble(), (double) (pos.getY() + 1), (double) pos.getZ() + world.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D); - serverWorld.sendParticles(ParticleTypes.BUBBLE, (double) pos.getX() + world.random.nextDouble(), (double) (pos.getY() + 1), (double) pos.getZ() + world.random.nextDouble(), 1, 0.0D, 0.01D, 0.0D, 0.2D); + serverWorld.sendParticles( + ParticleTypes.SPLASH, + (double) pos.getX() + world.random.nextDouble(), + (double) (pos.getY() + 1), + (double) pos.getZ() + world.random.nextDouble(), + 1, + 0.0D, + 0.0D, + 0.0D, + 1.0D + ); + serverWorld.sendParticles( + ParticleTypes.BUBBLE, + (double) pos.getX() + world.random.nextDouble(), + (double) (pos.getY() + 1), + (double) pos.getZ() + world.random.nextDouble(), + 1, + 0.0D, + 0.01D, + 0.0D, + 0.2D + ); } } } diff --git a/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java b/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java index a4577659..4542aa29 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java @@ -72,7 +72,8 @@ public class EndAnvilBlock extends BaseAnvilBlock { @Override public BlockState getStateForPlacement(@NotNull BlockPlaceContext blockPlaceContext) { - return Objects.requireNonNull(super.getStateForPlacement(blockPlaceContext)).setValue(durability, maxDurability); + return Objects.requireNonNull(super.getStateForPlacement(blockPlaceContext)) + .setValue(durability, maxDurability); } @Override diff --git a/src/main/java/ru/betterend/blocks/basis/FurBlock.java b/src/main/java/ru/betterend/blocks/basis/FurBlock.java index cc819cc0..b318d331 100644 --- a/src/main/java/ru/betterend/blocks/basis/FurBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/FurBlock.java @@ -21,25 +21,34 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.util.MHelper; import java.util.EnumMap; import java.util.List; -public class FurBlock extends BaseAttachedBlock implements IRenderTyped { +public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); private final ItemLike drop; private final int dropChance; public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) { - super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(light).sound(wet ? SoundType.WET_GRASS : SoundType.GRASS).noCollission()); + super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .luminance(light) + .sound(wet ? SoundType.WET_GRASS : SoundType.GRASS) + .noCollission()); this.drop = drop; this.dropChance = dropChance; } public FurBlock(ItemLike drop, int dropChance) { - super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).noCollission()); + super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .noCollission()); this.drop = drop; this.dropChance = dropChance; } @@ -52,7 +61,10 @@ public class FurBlock extends BaseAttachedBlock implements IRenderTyped { @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else if (dropChance < 1 || MHelper.RANDOM.nextInt(dropChance) == 0) { diff --git a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java index 744886cd..e7b131cd 100644 --- a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java @@ -95,7 +95,10 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { public PedestalBlock(Block parent) { super(FabricBlockSettings.copyOf(parent).luminance(getLuminance(parent.defaultBlockState()))); - this.registerDefaultState(stateDefinition.any().setValue(STATE, PedestalState.DEFAULT).setValue(HAS_ITEM, false).setValue(HAS_LIGHT, false)); + this.registerDefaultState(stateDefinition.any() + .setValue(STATE, PedestalState.DEFAULT) + .setValue(HAS_ITEM, false) + .setValue(HAS_LIGHT, false)); this.parent = parent; } @@ -432,7 +435,10 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { PedestalState state = blockState.getValue(STATE); - ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_" + state); + ResourceLocation modelId = new ResourceLocation( + stateId.getNamespace(), + "block/" + stateId.getPath() + "_" + state + ); registerBlockModel(stateId, modelId, blockState, modelCache); return ModelsHelper.createBlockSimple(modelId); } diff --git a/src/main/java/ru/betterend/blocks/basis/PottableCropBlock.java b/src/main/java/ru/betterend/blocks/basis/PottableCropBlock.java index 9c84d0e9..13978e19 100644 --- a/src/main/java/ru/betterend/blocks/basis/PottableCropBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/PottableCropBlock.java @@ -15,7 +15,7 @@ public class PottableCropBlock extends BaseCropBlock implements PottablePlant { @Override public boolean canPlantOn(Block block) { - for (Block ter: terrain) { + for (Block ter : terrain) { if (block == ter) { return true; } diff --git a/src/main/java/ru/betterend/blocks/basis/PottableFeatureSapling.java b/src/main/java/ru/betterend/blocks/basis/PottableFeatureSapling.java index 387f0a2f..20f5f24f 100644 --- a/src/main/java/ru/betterend/blocks/basis/PottableFeatureSapling.java +++ b/src/main/java/ru/betterend/blocks/basis/PottableFeatureSapling.java @@ -1,7 +1,5 @@ package ru.betterend.blocks.basis; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; import ru.betterend.interfaces.PottablePlant; diff --git a/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java b/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java index a8cd4351..7533c360 100644 --- a/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java @@ -15,13 +15,13 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.ModelsHelper; -import ru.bclib.interfaces.IColorProvider; +import ru.bclib.interfaces.CustomColorProvider; import ru.betterend.client.models.Patterns; import ru.betterend.registry.EndBlocks; import java.util.Optional; -public class StoneLanternBlock extends EndLanternBlock implements IColorProvider { +public class StoneLanternBlock extends EndLanternBlock implements CustomColorProvider { private static final VoxelShape SHAPE_CEIL = Block.box(3, 1, 3, 13, 16, 13); private static final VoxelShape SHAPE_FLOOR = Block.box(3, 0, 3, 13, 15, 13); @@ -31,12 +31,12 @@ public class StoneLanternBlock extends EndLanternBlock implements IColorProvider @Override public BlockColor getProvider() { - return ((IColorProvider) EndBlocks.AURORA_CRYSTAL).getProvider(); + return ((CustomColorProvider) EndBlocks.AURORA_CRYSTAL).getProvider(); } @Override public ItemColor getItemProvider() { - return ((IColorProvider) EndBlocks.AURORA_CRYSTAL).getItemProvider(); + return ((CustomColorProvider) EndBlocks.AURORA_CRYSTAL).getItemProvider(); } @Override @@ -48,7 +48,11 @@ public class StoneLanternBlock extends EndLanternBlock implements IColorProvider @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { String blockName = resourceLocation.getPath(); - Optional pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_FLOOR, blockName, blockName) : Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, blockName, blockName); + Optional pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson( + Patterns.BLOCK_STONE_LANTERN_FLOOR, + blockName, + blockName + ) : Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, blockName, blockName); return ModelsHelper.fromPattern(pattern); } } diff --git a/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java b/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java index b6b94f5a..5ed48952 100644 --- a/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java @@ -30,13 +30,25 @@ public class ColoredMaterial { String id = Registry.BLOCK.getKey(source).getPath(); colors.forEach((color, name) -> { String blockName = id + "_" + name; - Block block = constructor.apply(FabricBlockSettings.copyOf(source).materialColor(MaterialColor.COLOR_BLACK)); + Block block = constructor.apply(FabricBlockSettings.copyOf(source) + .materialColor(MaterialColor.COLOR_BLACK)); EndBlocks.registerBlock(blockName, block); if (craftEight) { - GridRecipe.make(BetterEnd.MOD_ID, blockName, block).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(8).setShape("###", "#D#", "###").addMaterial('#', source).addMaterial('D', dyes.get(color)).build(); + GridRecipe.make(BetterEnd.MOD_ID, blockName, block) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(8) + .setShape("###", "#D#", "###") + .addMaterial('#', source) + .addMaterial('D', dyes.get(color)) + .build(); } else { - GridRecipe.make(BetterEnd.MOD_ID, blockName, block).checkConfig(Configs.RECIPE_CONFIG).setList("#D").addMaterial('#', source).addMaterial('D', dyes.get(color)).build(); + GridRecipe.make(BetterEnd.MOD_ID, blockName, block) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#D") + .addMaterial('#', source) + .addMaterial('D', dyes.get(color)) + .build(); } this.colors.put(color, block); BlocksHelper.addBlockColor(block, color); diff --git a/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java b/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java index 90e87cdc..5f52f6d5 100644 --- a/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java @@ -45,18 +45,77 @@ public class CrystalSubblocksMaterial { brick_wall = EndBlocks.registerBlock(name + "_bricks_wall", new BaseWallBlock(bricks)); // Recipes // - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', source).setGroup("end_bricks").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar).checkConfig(Configs.RECIPE_CONFIG).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("##", "##") + .addMaterial('#', source) + .setGroup("end_bricks") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("##", "##") + .addMaterial('#', bricks) + .setGroup("end_tile") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("##", "##") + .addMaterial('#', polished) + .setGroup("end_small_tile") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("#", "#") + .addMaterial('#', slab) + .setGroup("end_pillar") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', source).setGroup("end_stone_stairs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', source).setGroup("end_stone_slabs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brick_stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brick_slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("# ", "## ", "###") + .addMaterial('#', source) + .setGroup("end_stone_stairs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###") + .addMaterial('#', source) + .setGroup("end_stone_slabs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brick_stairs) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("# ", "## ", "###") + .addMaterial('#', bricks) + .setGroup("end_stone_stairs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brick_slab) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###") + .addMaterial('#', bricks) + .setGroup("end_stone_slabs") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', source).setGroup("end_wall").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brick_wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###", "###") + .addMaterial('#', source) + .setGroup("end_wall") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brick_wall) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###", "###") + .addMaterial('#', bricks) + .setGroup("end_wall") + .build(); CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); diff --git a/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java b/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java index d892c7e6..ad316d94 100644 --- a/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java @@ -40,7 +40,6 @@ import ru.betterend.blocks.BulbVineLanternColoredBlock; import ru.betterend.blocks.ChandelierBlock; import ru.betterend.blocks.basis.EndAnvilBlock; import ru.betterend.config.Configs; -import ru.betterend.item.EndAnvilItem; import ru.betterend.item.EndArmorItem; import ru.betterend.item.tool.EndHammerItem; import ru.betterend.item.tool.EndPickaxe; @@ -94,23 +93,61 @@ public class MetalMaterial { public final Tag.Named alloyingOre; public static MetalMaterial makeNormal(String name, MaterialColor color, Tier material, ArmorMaterial armor) { - return new MetalMaterial(name, true, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor); + return new MetalMaterial( + name, + true, + FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), + EndItems.makeEndItemSettings(), + material, + armor + ); } public static MetalMaterial makeNormal(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) { - return new MetalMaterial(name, true, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor); + return new MetalMaterial( + name, + true, + FabricBlockSettings.copyOf(Blocks.IRON_BLOCK) + .materialColor(color) + .hardness(hardness) + .resistance(resistance), + EndItems.makeEndItemSettings(), + material, + armor + ); } public static MetalMaterial makeOreless(String name, MaterialColor color, Tier material, ArmorMaterial armor) { - return new MetalMaterial(name, false, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor); + return new MetalMaterial( + name, + false, + FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), + EndItems.makeEndItemSettings(), + material, + armor + ); } public static MetalMaterial makeOreless(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) { - return new MetalMaterial(name, false, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor); + return new MetalMaterial( + name, + false, + FabricBlockSettings.copyOf(Blocks.IRON_BLOCK) + .materialColor(color) + .hardness(hardness) + .resistance(resistance), + EndItems.makeEndItemSettings(), + material, + armor + ); } private MetalMaterial(String name, boolean hasOre, FabricBlockSettings settings, Properties itemSettings, Tier material, ArmorMaterial armor) { - BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings).hardness(1).resistance(1).luminance(15).sound(SoundType.LANTERN); + BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings) + .hardness(1) + .resistance(1) + .luminance(15) + .sound(SoundType.LANTERN); final int level = material.getLevel(); rawOre = hasOre ? EndItems.registerEndItem(name + "_raw", new ModelProviderItem(itemSettings)) : null; @@ -149,75 +186,304 @@ public class MetalMaterial { pickaxe = EndItems.registerEndTool(name + "_pickaxe", new EndPickaxe(material, 1, -2.8F, itemSettings)); axe = EndItems.registerEndTool(name + "_axe", new BaseAxeItem(material, 6.0F, -3.0F, itemSettings)); hoe = EndItems.registerEndTool(name + "_hoe", new BaseHoeItem(material, -3, 0.0F, itemSettings)); - hammer = EndItems.registerEndTool(name + "_hammer", new EndHammerItem(material, 5.0F, -3.2F, 0.3D, itemSettings)); + hammer = EndItems.registerEndTool( + name + "_hammer", + new EndHammerItem(material, 5.0F, -3.2F, 0.3D, itemSettings) + ); forgedPlate = EndItems.registerEndItem(name + "_forged_plate"); helmet = EndItems.registerEndItem(name + "_helmet", new EndArmorItem(armor, EquipmentSlot.HEAD, itemSettings)); - chestplate = EndItems.registerEndItem(name + "_chestplate", new EndArmorItem(armor, EquipmentSlot.CHEST, itemSettings)); - leggings = EndItems.registerEndItem(name + "_leggings", new EndArmorItem(armor, EquipmentSlot.LEGS, itemSettings)); + chestplate = EndItems.registerEndItem( + name + "_chestplate", + new EndArmorItem(armor, EquipmentSlot.CHEST, itemSettings) + ); + leggings = EndItems.registerEndItem( + name + "_leggings", + new EndArmorItem(armor, EquipmentSlot.LEGS, itemSettings) + ); boots = EndItems.registerEndItem(name + "_boots", new EndArmorItem(armor, EquipmentSlot.FEET, itemSettings)); - anvilBlock = EndBlocks.registerAnvil(name + "_anvil", new EndAnvilBlock(this, block.defaultMaterialColor(), level)); + anvilBlock = EndBlocks.registerAnvil( + name + "_anvil", + new EndAnvilBlock(this, block.defaultMaterialColor(), level) + ); if (hasOre) { - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_ore", ore, ingot).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_ingot").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_raw", rawOre, ingot).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_ingot").buildWithBlasting(); - AlloyingRecipe.Builder.create(name + "_ingot_alloy").setInput(alloyingOre, alloyingOre).setOutput(ingot, 3).setExpiriense(2.1F).build(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_ore", ore, ingot) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_ingot") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_raw", rawOre, ingot) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_ingot") + .buildWithBlasting(); + AlloyingRecipe.Builder.create(name + "_ingot_alloy") + .setInput(alloyingOre, alloyingOre) + .setOutput(ingot, 3) + .setExpiriense(2.1F) + .build(); } // Basic recipes - GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_nuggets", ingot).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', nugget).setGroup("end_metal_ingots_nug").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_nuggets_from_ingot", nugget).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', ingot).setGroup("end_metal_nuggets_ing").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_block", block).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', ingot).setGroup("end_metal_blocks").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_block", ingot).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', block).setGroup("end_metal_ingots").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_nuggets", ingot) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "###", "###") + .addMaterial('#', nugget) + .setGroup("end_metal_ingots_nug") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_nuggets_from_ingot", nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(9) + .setList("#") + .addMaterial('#', ingot) + .setGroup("end_metal_nuggets_ing") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_block", block) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "###", "###") + .addMaterial('#', ingot) + .setGroup("end_metal_blocks") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_block", ingot) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(9) + .setList("#") + .addMaterial('#', block) + .setGroup("end_metal_ingots") + .build(); // Block recipes - GridRecipe.make(BetterEnd.MOD_ID, name + "_tile", tile).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', block).setGroup("end_metal_tiles").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bars", bars).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(16).setShape("###", "###").addMaterial('#', ingot).setGroup("end_metal_bars").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', ingot).setGroup("end_metal_plates").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("##", "##", "##").addMaterial('#', ingot).setGroup("end_metal_doors").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', ingot).setGroup("end_metal_trapdoors").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', block, tile).setGroup("end_metal_stairs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', block, tile).setGroup("end_metal_slabs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_chain", chain).checkConfig(Configs.RECIPE_CONFIG).setShape("N", "#", "N").addMaterial('#', ingot).addMaterial('N', nugget).setGroup("end_metal_chain").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_anvil", anvilBlock).checkConfig(Configs.RECIPE_CONFIG).setShape("###", " I ", "III").addMaterial('#', block, tile).addMaterial('I', ingot).setGroup("end_metal_anvil").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bulb_lantern", bulb_lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("C", "I", "#").addMaterial('C', chain).addMaterial('I', ingot).addMaterial('#', EndItems.GLOWING_BULB).build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_tile", tile) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("##", "##") + .addMaterial('#', block) + .setGroup("end_metal_tiles") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bars", bars) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(16) + .setShape("###", "###") + .addMaterial('#', ingot) + .setGroup("end_metal_bars") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##") + .addMaterial('#', ingot) + .setGroup("end_metal_plates") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(3) + .setShape("##", "##", "##") + .addMaterial('#', ingot) + .setGroup("end_metal_doors") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', ingot) + .setGroup("end_metal_trapdoors") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("# ", "## ", "###") + .addMaterial('#', block, tile) + .setGroup("end_metal_stairs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###") + .addMaterial('#', block, tile) + .setGroup("end_metal_slabs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_chain", chain) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("N", "#", "N") + .addMaterial('#', ingot) + .addMaterial('N', nugget) + .setGroup("end_metal_chain") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_anvil", anvilBlock) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", " I ", "III") + .addMaterial('#', block, tile) + .addMaterial('I', ingot) + .setGroup("end_metal_anvil") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bulb_lantern", bulb_lantern) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("C", "I", "#") + .addMaterial('C', chain) + .addMaterial('I', ingot) + .addMaterial('#', EndItems.GLOWING_BULB) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_chandelier", chandelier).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', ingot).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_chandelier", chandelier) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("I#I", " # ") + .addMaterial('#', ingot) + .addMaterial('I', EndItems.LUMECORN_ROD) + .setGroup("end_metal_chandelier") + .build(); // Tools & armor into nuggets - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_axe_nugget", axe, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hoe_nugget", hoe, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_pickaxe_nugget", pickaxe, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_sword_nugget", sword, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hammer_nugget", hammer, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_helmet_nugget", helmet, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_chestplate_nugget", chestplate, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_leggings_nugget", leggings, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_boots_nugget", boots, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_axe_nugget", axe, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hoe_nugget", hoe, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_pickaxe_nugget", pickaxe, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_sword_nugget", sword, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hammer_nugget", hammer, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_helmet_nugget", helmet, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_chestplate_nugget", chestplate, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_leggings_nugget", leggings, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); + FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_boots_nugget", boots, nugget) + .checkConfig(Configs.RECIPE_CONFIG) + .setGroup("end_nugget") + .buildWithBlasting(); // Tool parts from ingots - AnvilRecipe.Builder.create(name + "_shovel_head").setInput(ingot).setOutput(shovelHead).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); - AnvilRecipe.Builder.create(name + "_pickaxe_head").setInput(ingot).setInputCount(3).setOutput(pickaxeHead).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); - AnvilRecipe.Builder.create(name + "_axe_head").setInput(ingot).setInputCount(3).setOutput(axeHead).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); - AnvilRecipe.Builder.create(name + "_hoe_head").setInput(ingot).setInputCount(2).setOutput(hoeHead).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); - AnvilRecipe.Builder.create(name + "_sword_blade").setInput(ingot).setOutput(swordBlade).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); - AnvilRecipe.Builder.create(name + "_forged_plate").setInput(ingot).setOutput(forgedPlate).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); + AnvilRecipe.Builder.create(name + "_shovel_head") + .setInput(ingot) + .setOutput(shovelHead) + .setAnvilLevel(level) + .setToolLevel(level) + .setDamage(level) + .build(); + AnvilRecipe.Builder.create(name + "_pickaxe_head") + .setInput(ingot) + .setInputCount(3) + .setOutput(pickaxeHead) + .setAnvilLevel(level) + .setToolLevel(level) + .setDamage(level) + .build(); + AnvilRecipe.Builder.create(name + "_axe_head") + .setInput(ingot) + .setInputCount(3) + .setOutput(axeHead) + .setAnvilLevel(level) + .setToolLevel(level) + .setDamage(level) + .build(); + AnvilRecipe.Builder.create(name + "_hoe_head") + .setInput(ingot) + .setInputCount(2) + .setOutput(hoeHead) + .setAnvilLevel(level) + .setToolLevel(level) + .setDamage(level) + .build(); + AnvilRecipe.Builder.create(name + "_sword_blade") + .setInput(ingot) + .setOutput(swordBlade) + .setAnvilLevel(level) + .setToolLevel(level) + .setDamage(level) + .build(); + AnvilRecipe.Builder.create(name + "_forged_plate") + .setInput(ingot) + .setOutput(forgedPlate) + .setAnvilLevel(level) + .setToolLevel(level) + .setDamage(level) + .build(); // Tools from parts - SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hammer").checkConfig(Configs.RECIPE_CONFIG).setResult(hammer).setBase(block).setAddition(Items.STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_axe").checkConfig(Configs.RECIPE_CONFIG).setResult(axe).setBase(axeHead).setAddition(Items.STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_pickaxe").checkConfig(Configs.RECIPE_CONFIG).setResult(pickaxe).setBase(pickaxeHead).setAddition(Items.STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hoe").checkConfig(Configs.RECIPE_CONFIG).setResult(hoe).setBase(hoeHead).setAddition(Items.STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword_handle").checkConfig(Configs.RECIPE_CONFIG).setResult(swordHandle).setBase(ingot).setAddition(Items.STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword").checkConfig(Configs.RECIPE_CONFIG).setResult(sword).setBase(swordBlade).setAddition(swordHandle).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_shovel").checkConfig(Configs.RECIPE_CONFIG).setResult(shovel).setBase(shovelHead).setAddition(Items.STICK).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hammer") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(hammer) + .setBase(block) + .setAddition(Items.STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_axe") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(axe) + .setBase(axeHead) + .setAddition(Items.STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_pickaxe") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(pickaxe) + .setBase(pickaxeHead) + .setAddition(Items.STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hoe") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(hoe) + .setBase(hoeHead) + .setAddition(Items.STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword_handle") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(swordHandle) + .setBase(ingot) + .setAddition(Items.STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(sword) + .setBase(swordBlade) + .setAddition(swordHandle) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_shovel") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(shovel) + .setBase(shovelHead) + .setAddition(Items.STICK) + .build(); // Armor crafting - GridRecipe.make(BetterEnd.MOD_ID, name + "_helmet", helmet).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_helmets").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_chestplate", chestplate).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "###", "###").addMaterial('#', forgedPlate).setGroup("end_metal_chestplates").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_leggings", leggings).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_leggings").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_boots", boots).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_boots").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_helmet", helmet) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "# #") + .addMaterial('#', forgedPlate) + .setGroup("end_metal_helmets") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_chestplate", chestplate) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("# #", "###", "###") + .addMaterial('#', forgedPlate) + .setGroup("end_metal_chestplates") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_leggings", leggings) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "# #", "# #") + .addMaterial('#', forgedPlate) + .setGroup("end_metal_leggings") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_boots", boots) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("# #", "# #") + .addMaterial('#', forgedPlate) + .setGroup("end_metal_boots") + .build(); TagHelper.addTag(BlockTags.ANVIL, anvilBlock); TagHelper.addTag(BlockTags.BEACON_BASE_BLOCKS, block); diff --git a/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java b/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java index aa1d06a8..a3feacf2 100644 --- a/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java @@ -70,24 +70,110 @@ public class StoneMaterial { flowerPot = EndBlocks.registerBlock(name + "_flower_pot", new FlowerPotBlock(bricks)); // Recipes // - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', stone).setGroup("end_bricks").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar).checkConfig(Configs.RECIPE_CONFIG).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("##", "##") + .addMaterial('#', stone) + .setGroup("end_bricks") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("##", "##") + .addMaterial('#', bricks) + .setGroup("end_tile") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("##", "##") + .addMaterial('#', polished) + .setGroup("end_small_tile") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("#", "#") + .addMaterial('#', slab) + .setGroup("end_pillar") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', stone).setGroup("end_stone_stairs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', stone).setGroup("end_stone_slabs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brickStairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brickSlab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("# ", "## ", "###") + .addMaterial('#', stone) + .setGroup("end_stone_stairs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###") + .addMaterial('#', stone) + .setGroup("end_stone_slabs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brickStairs) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("# ", "## ", "###") + .addMaterial('#', bricks) + .setGroup("end_stone_stairs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brickSlab) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###") + .addMaterial('#', bricks) + .setGroup("end_stone_slabs") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', stone).setGroup("end_wall").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brickWall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###", "###") + .addMaterial('#', stone) + .setGroup("end_wall") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brickWall) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###", "###") + .addMaterial('#', bricks) + .setGroup("end_wall") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_button", button).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', stone).setGroup("end_stone_buttons").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', stone).setGroup("end_stone_plates").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_lantern", lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('#', EndItems.CRYSTAL_SHARDS).addMaterial('S', slab, brickSlab).setGroup("end_stone_lanterns").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_furnace", furnace).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', stone).setGroup("end_stone_furnaces").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_flower_pot", flowerPot).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("# #", " # ").addMaterial('#', bricks).setGroup("end_pots").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_button", button) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', stone) + .setGroup("end_stone_buttons") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##") + .addMaterial('#', stone) + .setGroup("end_stone_plates") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_lantern", lantern) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("S", "#", "S") + .addMaterial('#', EndItems.CRYSTAL_SHARDS) + .addMaterial('S', slab, brickSlab) + .setGroup("end_stone_lanterns") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_furnace", furnace) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "# #", "###") + .addMaterial('#', stone) + .setGroup("end_stone_furnaces") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_flower_pot", flowerPot) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(3) + .setShape("# #", " # ") + .addMaterial('#', bricks) + .setGroup("end_pots") + .build(); CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); diff --git a/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java b/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java index b07f8bff..93894887 100644 --- a/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java @@ -97,25 +97,133 @@ public class WoodenMaterial { composter = EndBlocks.registerBlock(name + "_composter", new BaseComposterBlock(planks)); // Recipes // - GridRecipe.make(BetterEnd.MOD_ID, name + "_planks", planks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', log, bark, log_stripped, bark_stripped).setGroup("end_planks").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', planks).setGroup("end_planks_stairs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', planks).setGroup("end_planks_slabs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_fence", fence).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("#I#", "#I#").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_planks_fences").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_gate", gate).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", "I#I").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_planks_gates").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_button", button).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', planks).setGroup("end_planks_buttons").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', planks).setGroup("end_planks_plates").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setShape("###", "###").addMaterial('#', planks).setGroup("end_trapdoors").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("##", "##", "##").addMaterial('#', planks).setGroup("end_doors").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_crafting_table", craftingTable).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', planks).setGroup("end_tables").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_ladder", ladder).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("I I", "I#I", "I I").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_ladders").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_sign", sign).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("###", "###", " I ").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_signs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_chest", chest).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', planks).setGroup("end_chests").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_barrel", barrel).checkConfig(Configs.RECIPE_CONFIG).setShape("#S#", "# #", "#S#").addMaterial('#', planks).addMaterial('S', slab).setGroup("end_barrels").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bookshelf", shelf).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "PPP", "###").addMaterial('#', planks).addMaterial('P', Items.BOOK).setGroup("end_bookshelves").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bark", bark).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', log).setOutputCount(3).build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_log", log).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', bark).setOutputCount(3).build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_composter", composter).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "# #", "###").addMaterial('#', slab).build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_shulker", Items.SHULKER_BOX).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('S', Items.SHULKER_SHELL).addMaterial('#', chest).build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_planks", planks) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setList("#") + .addMaterial('#', log, bark, log_stripped, bark_stripped) + .setGroup("end_planks") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("# ", "## ", "###") + .addMaterial('#', planks) + .setGroup("end_planks_stairs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("###") + .addMaterial('#', planks) + .setGroup("end_planks_slabs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_fence", fence) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(3) + .setShape("#I#", "#I#") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup("end_planks_fences") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_gate", gate) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("I#I", "I#I") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup("end_planks_gates") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_button", button) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', planks) + .setGroup("end_planks_buttons") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##") + .addMaterial('#', planks) + .setGroup("end_planks_plates") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(2) + .setShape("###", "###") + .addMaterial('#', planks) + .setGroup("end_trapdoors") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(3) + .setShape("##", "##", "##") + .addMaterial('#', planks) + .setGroup("end_doors") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_crafting_table", craftingTable) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', planks) + .setGroup("end_tables") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_ladder", ladder) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(3) + .setShape("I I", "I#I", "I I") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup("end_ladders") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_sign", sign) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(3) + .setShape("###", "###", " I ") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup("end_signs") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_chest", chest) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "# #", "###") + .addMaterial('#', planks) + .setGroup("end_chests") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_barrel", barrel) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("#S#", "# #", "#S#") + .addMaterial('#', planks) + .addMaterial('S', slab) + .setGroup("end_barrels") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bookshelf", shelf) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "PPP", "###") + .addMaterial('#', planks) + .addMaterial('P', Items.BOOK) + .setGroup("end_bookshelves") + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bark", bark) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', log) + .setOutputCount(3) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_log", log) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', bark) + .setOutputCount(3) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_composter", composter) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("# #", "# #", "###") + .addMaterial('#', slab) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_shulker", Items.SHULKER_BOX) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("S", "#", "S") + .addMaterial('S', Items.SHULKER_SHELL) + .addMaterial('#', chest) + .build(); // Item Tags // TagHelper.addTag(ItemTags.PLANKS, planks); diff --git a/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java b/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java index a478dc00..4404d2d9 100644 --- a/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java +++ b/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java @@ -63,7 +63,10 @@ public class BlockEntityHydrothermalVent extends BlockEntity { if (blockState.isAir()) { double mult = active ? 3.0 : 5.0; float force = (float) ((1.0 - (POS.getY() / box.maxY)) / mult); - entities.stream().filter(entity -> (int) entity.getY() == POS.getY() && blockEntity.hasElytra(entity) && entity.isFallFlying()).forEach(entity -> entity.moveRelative(force, POSITIVE_Y)); + entities.stream() + .filter(entity -> (int) entity.getY() == POS.getY() && blockEntity.hasElytra(entity) && entity + .isFallFlying()) + .forEach(entity -> entity.moveRelative(force, POSITIVE_Y)); } POS.move(Direction.UP); } diff --git a/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java b/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java index 33920964..7adad5af 100644 --- a/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java @@ -47,9 +47,9 @@ import java.util.Map; public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity implements WorldlyContainer, RecipeHolder, StackedContentsCompatible { - private static final int[] TOP_SLOTS = new int[]{0, 1}; - private static final int[] BOTTOM_SLOTS = new int[]{2, 3}; - private static final int[] SIDE_SLOTS = new int[]{1, 2}; + private static final int[] TOP_SLOTS = new int[] {0, 1}; + private static final int[] BOTTOM_SLOTS = new int[] {2, 3}; + private static final int[] SIDE_SLOTS = new int[] {1, 2}; private static final Map AVAILABLE_FUELS = Maps.newHashMap(); private final Object2IntOpenHashMap recipesUsed; @@ -158,9 +158,15 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme protected int getSmeltTime() { if (level == null) return 200; - int smeltTime = level.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, this, level).map(AlloyingRecipe::getSmeltTime).orElse(0); + int smeltTime = level.getRecipeManager() + .getRecipeFor(AlloyingRecipe.TYPE, this, level) + .map(AlloyingRecipe::getSmeltTime) + .orElse(0); if (smeltTime == 0) { - smeltTime = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, this, level).map(BlastingRecipe::getCookingTime).orElse(200); + smeltTime = level.getRecipeManager() + .getRecipeFor(RecipeType.BLASTING, this, level) + .map(BlastingRecipe::getCookingTime) + .orElse(200); smeltTime /= 1.5; } return smeltTime; @@ -205,7 +211,11 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme if (level != null && level.getBlockEntity(worldPosition) != this) { return false; } - return player.distanceToSqr(worldPosition.getX() + 0.5D, worldPosition.getY() + 0.5D, worldPosition.getZ() + 0.5D) <= 64.0D; + return player.distanceToSqr( + worldPosition.getX() + 0.5D, + worldPosition.getY() + 0.5D, + worldPosition.getZ() + 0.5D + ) <= 64.0D; } @Override @@ -234,15 +244,20 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme boolean burning = initialBurning; if (!tickLevel.isClientSide) { ItemStack fuel = blockEntity.inventory.get(2); - if (!burning && (fuel.isEmpty() || blockEntity.inventory.get(0).isEmpty() && blockEntity.inventory.get(1).isEmpty())) { + if (!burning && (fuel.isEmpty() || blockEntity.inventory.get(0).isEmpty() && blockEntity.inventory.get(1) + .isEmpty())) { if (blockEntity.smeltTime > 0) { blockEntity.smeltTime = Mth.clamp(blockEntity.smeltTime - 2, 0, blockEntity.smeltTimeTotal); } } else { - Recipe recipe = tickLevel.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, blockEntity, tickLevel).orElse(null); + Recipe recipe = tickLevel.getRecipeManager() + .getRecipeFor(AlloyingRecipe.TYPE, blockEntity, tickLevel) + .orElse(null); if (recipe == null) { - recipe = tickLevel.getRecipeManager().getRecipeFor(RecipeType.BLASTING, blockEntity, tickLevel).orElse(null); + recipe = tickLevel.getRecipeManager() + .getRecipeFor(RecipeType.BLASTING, blockEntity, tickLevel) + .orElse(null); } boolean accepted = blockEntity.canAcceptRecipeOutput(recipe); if (!burning && accepted) { @@ -255,7 +270,10 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme fuel.shrink(1); if (fuel.isEmpty()) { Item remainFuel = item.getCraftingRemainingItem(); - blockEntity.inventory.set(2, remainFuel == null ? ItemStack.EMPTY : new ItemStack(remainFuel)); + blockEntity.inventory.set( + 2, + remainFuel == null ? ItemStack.EMPTY : new ItemStack(remainFuel) + ); } } blockEntity.setChanged(); diff --git a/src/main/java/ru/betterend/client/BetterEndClient.java b/src/main/java/ru/betterend/client/BetterEndClient.java index b53340fd..18135f92 100644 --- a/src/main/java/ru/betterend/client/BetterEndClient.java +++ b/src/main/java/ru/betterend/client/BetterEndClient.java @@ -1,10 +1,7 @@ package ru.betterend.client; import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.minecraft.ChatFormatting; -import net.minecraft.client.renderer.RenderType; -import net.minecraft.core.Registry; import net.minecraft.network.chat.Style; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; @@ -12,10 +9,8 @@ import net.minecraft.world.level.block.Block; import ru.bclib.BCLib; import ru.bclib.blocks.BaseChestBlock; import ru.bclib.blocks.BaseSignBlock; -import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.client.render.BaseChestBlockEntityRenderer; import ru.bclib.client.render.BaseSignBlockEntityRenderer; -import ru.bclib.interfaces.IRenderTyped; import ru.bclib.util.TranslationHelper; import ru.betterend.BetterEnd; import ru.betterend.events.ItemTooltipCallback; @@ -33,7 +28,7 @@ import java.util.List; public class BetterEndClient implements ClientModInitializer { @Override public void onInitializeClient() { - registerRenderLayers(); + //registerRenderLayers(); EndBlockEntityRenders.register(); EndScreens.register(); EndParticles.register(); @@ -57,28 +52,35 @@ public class BetterEndClient implements ClientModInitializer { hasSet = CrystaliteArmor.hasFullSet(player); } TranslatableComponent setDesc = new TranslatableComponent("tooltip.armor.crystalite_set"); - setDesc.setStyle(Style.EMPTY.applyFormats(hasSet ? ChatFormatting.BLUE : ChatFormatting.DARK_GRAY, ChatFormatting.ITALIC)); + setDesc.setStyle(Style.EMPTY.applyFormats( + hasSet ? ChatFormatting.BLUE : ChatFormatting.DARK_GRAY, + ChatFormatting.ITALIC + )); lines.add(TextComponent.EMPTY); lines.add(setDesc); } }); } - private void registerRenderLayers() { + /*private void registerRenderLayers() { RenderType cutout = RenderType.cutout(); RenderType translucent = RenderType.translucent(); Registry.BLOCK.forEach(block -> { - if (block instanceof IRenderTyped) { - BCLRenderLayer layer = ((IRenderTyped) block).getRenderLayer(); + if (block instanceof RenderLayerProvider) { + BCLRenderLayer layer = ((RenderLayerProvider) block).getRenderLayer(); if (layer == BCLRenderLayer.CUTOUT) BlockRenderLayerMap.INSTANCE.putBlock(block, cutout); else if (layer == BCLRenderLayer.TRANSLUCENT) BlockRenderLayerMap.INSTANCE.putBlock(block, translucent); } }); - } + }*/ private static void registerRenderers() { List modBlocks = EndBlocks.getModBlocks(); - modBlocks.stream().filter(BaseChestBlock.class::isInstance).forEach(BaseChestBlockEntityRenderer::registerRenderLayer); - modBlocks.stream().filter(BaseSignBlock.class::isInstance).forEach(BaseSignBlockEntityRenderer::registerRenderLayer); + modBlocks.stream() + .filter(BaseChestBlock.class::isInstance) + .forEach(BaseChestBlockEntityRenderer::registerRenderLayer); + modBlocks.stream() + .filter(BaseSignBlock.class::isInstance) + .forEach(BaseSignBlockEntityRenderer::registerRenderLayer); } } diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java index e25550e5..8eafb3d8 100644 --- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java +++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java @@ -79,7 +79,13 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent int slotY = this.fuelSlot.y + y; GuiComponent.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822018048); //TODO: test k=0 - this.minecraft.getItemRenderer().renderAndDecorateItem(minecraft.player, this.getFuel().getDefaultInstance(), slotX, slotY, 0); + this.minecraft.getItemRenderer() + .renderAndDecorateItem(minecraft.player, + this.getFuel().getDefaultInstance(), + slotX, + slotY, + 0 + ); RenderSystem.depthFunc(516); GuiComponent.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822083583); RenderSystem.depthFunc(515); diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java index 96b7fcbd..c4a60fa2 100644 --- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java +++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java @@ -35,12 +35,22 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen { - recipeBook.initVisuals(); - recipeBook.toggleVisibility(); - leftPos = recipeBook.updateScreenPosition(width, imageWidth); - ((ImageButton) buttonWidget).setPosition(leftPos + 20, height / 2 - 49); - })); + addRenderableWidget(new ImageButton( + leftPos + 20, + height / 2 - 49, + 20, + 18, + 0, + 0, + 19, + RECIPE_BUTTON_TEXTURE, + (buttonWidget) -> { + recipeBook.initVisuals(); + recipeBook.toggleVisibility(); + leftPos = recipeBook.updateScreenPosition(width, imageWidth); + ((ImageButton) buttonWidget).setPosition(leftPos + 20, height / 2 - 49); + } + )); titleLabelX = (imageWidth - font.width(title)) / 2; } @@ -90,7 +100,15 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen= (left + imageWidth) || mouseY >= (top + imageHeight); - return this.recipeBook.hasClickedOutside(mouseX, mouseY, leftPos, topPos, imageWidth, imageHeight, button) && isMouseOut; + return this.recipeBook.hasClickedOutside( + mouseX, + mouseY, + leftPos, + topPos, + imageWidth, + imageHeight, + button + ) && isMouseOut; } @Override diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java index c4c8510c..b8c13e93 100644 --- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java +++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java @@ -27,7 +27,10 @@ import ru.betterend.recipe.builders.AlloyingRecipe; public class EndStoneSmelterScreenHandler extends RecipeBookMenu { - public final static MenuType HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(BetterEnd.makeID(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new); + public final static MenuType HANDLER_TYPE = ScreenHandlerRegistry.registerSimple( + BetterEnd.makeID(EndStoneSmelter.ID), + EndStoneSmelterScreenHandler::new + ); private final Container inventory; private final ContainerData propertyDelegate; @@ -117,7 +120,9 @@ public class EndStoneSmelterScreenHandler extends RecipeBookMenu { } protected boolean isSmeltable(ItemStack itemStack) { - return world.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, new SimpleContainer(itemStack), world).isPresent(); + return world.getRecipeManager() + .getRecipeFor(AlloyingRecipe.TYPE, new SimpleContainer(itemStack), world) + .isPresent(); } public boolean isFuel(ItemStack itemStack) { diff --git a/src/main/java/ru/betterend/client/models/Patterns.java b/src/main/java/ru/betterend/client/models/Patterns.java index 9b4609d5..9c66adda 100644 --- a/src/main/java/ru/betterend/client/models/Patterns.java +++ b/src/main/java/ru/betterend/client/models/Patterns.java @@ -39,27 +39,35 @@ public class Patterns { public final static ResourceLocation BLOCK_DOOR_TOP = BetterEnd.makeID("patterns/block/door_top.json"); public final static ResourceLocation BLOCK_DOOR_TOP_HINGE = BetterEnd.makeID("patterns/block/door_top_hinge.json"); public final static ResourceLocation BLOCK_DOOR_BOTTOM = BetterEnd.makeID("patterns/block/door_bottom.json"); - public final static ResourceLocation BLOCK_DOOR_BOTTOM_HINGE = BetterEnd.makeID("patterns/block/door_bottom_hinge.json"); + public final static ResourceLocation BLOCK_DOOR_BOTTOM_HINGE = BetterEnd.makeID( + "patterns/block/door_bottom_hinge.json"); public final static ResourceLocation BLOCK_CROSS = BetterEnd.makeID("patterns/block/cross.json"); public final static ResourceLocation BLOCK_CROSS_SHADED = BetterEnd.makeID("patterns/block/cross_shaded.json"); public final static ResourceLocation BLOCK_GATE_CLOSED = BetterEnd.makeID("patterns/block/fence_gate_closed.json"); - public final static ResourceLocation BLOCK_GATE_CLOSED_WALL = BetterEnd.makeID("patterns/block/wall_gate_closed.json"); + public final static ResourceLocation BLOCK_GATE_CLOSED_WALL = BetterEnd.makeID( + "patterns/block/wall_gate_closed.json"); public final static ResourceLocation BLOCK_GATE_OPEN = BetterEnd.makeID("patterns/block/fence_gate_open.json"); public final static ResourceLocation BLOCK_GATE_OPEN_WALL = BetterEnd.makeID("patterns/block/wall_gate_open.json"); public final static ResourceLocation BLOCK_TRAPDOOR = BetterEnd.makeID("patterns/block/trapdoor.json"); public final static ResourceLocation BLOCK_LADDER = BetterEnd.makeID("patterns/block/ladder.json"); public final static ResourceLocation BLOCK_BARREL_OPEN = BetterEnd.makeID("patterns/block/barrel_open.json"); - public final static ResourceLocation BLOCK_PEDESTAL_DEFAULT = BetterEnd.makeID("patterns/block/pedestal_default.json"); + public final static ResourceLocation BLOCK_PEDESTAL_DEFAULT = BetterEnd.makeID( + "patterns/block/pedestal_default.json"); public final static ResourceLocation BLOKC_PEDESTAL_COLUMN = BetterEnd.makeID("patterns/block/pedestal_column.json"); - public final static ResourceLocation BLOCK_PEDESTAL_COLUMN_TOP = BetterEnd.makeID("patterns/block/pedestal_column_top.json"); + public final static ResourceLocation BLOCK_PEDESTAL_COLUMN_TOP = BetterEnd.makeID( + "patterns/block/pedestal_column_top.json"); public final static ResourceLocation BLOCK_PEDESTAL_TOP = BetterEnd.makeID("patterns/block/pedestal_top.json"); public final static ResourceLocation BLOCK_PEDESTAL_BOTTOM = BetterEnd.makeID("patterns/block/pedestal_bottom.json"); public final static ResourceLocation BLOCK_PEDESTAL_PILLAR = BetterEnd.makeID("patterns/block/pedestal_pillar.json"); public final static ResourceLocation BLOCK_BOOKSHELF = BetterEnd.makeID("patterns/block/bookshelf.json"); - public final static ResourceLocation BLOCK_STONE_LANTERN_CEIL = BetterEnd.makeID("patterns/block/stone_lantern_ceil.json"); - public final static ResourceLocation BLOCK_STONE_LANTERN_FLOOR = BetterEnd.makeID("patterns/block/stone_lantern_floor.json"); - public final static ResourceLocation BLOCK_BULB_LANTERN_FLOOR = BetterEnd.makeID("patterns/block/bulb_lantern_floor.json"); - public final static ResourceLocation BLOCK_BULB_LANTERN_CEIL = BetterEnd.makeID("patterns/block/bulb_lantern_ceil.json"); + public final static ResourceLocation BLOCK_STONE_LANTERN_CEIL = BetterEnd.makeID( + "patterns/block/stone_lantern_ceil.json"); + public final static ResourceLocation BLOCK_STONE_LANTERN_FLOOR = BetterEnd.makeID( + "patterns/block/stone_lantern_floor.json"); + public final static ResourceLocation BLOCK_BULB_LANTERN_FLOOR = BetterEnd.makeID( + "patterns/block/bulb_lantern_floor.json"); + public final static ResourceLocation BLOCK_BULB_LANTERN_CEIL = BetterEnd.makeID( + "patterns/block/bulb_lantern_ceil.json"); public final static ResourceLocation BLOCK_PETAL_COLORED = BetterEnd.makeID("models/block/block_petal_colored.json"); public final static ResourceLocation BLOCK_COMPOSTER = BetterEnd.makeID("patterns/block/composter.json"); public final static ResourceLocation BLOCK_COLORED = BetterEnd.makeID("patterns/block/block_colored.json"); @@ -67,7 +75,8 @@ public class Patterns { public final static ResourceLocation BLOCK_BARS_SIDE = BetterEnd.makeID("patterns/block/bars_side.json"); public final static ResourceLocation BLOCK_ANVIL = BetterEnd.makeID("patterns/block/anvil.json"); public final static ResourceLocation BLOCK_CHAIN = BetterEnd.makeID("patterns/block/chain.json"); - public final static ResourceLocation BLOCK_CHANDELIER_FLOOR = BetterEnd.makeID("patterns/block/chandelier_floor.json"); + public final static ResourceLocation BLOCK_CHANDELIER_FLOOR = BetterEnd.makeID( + "patterns/block/chandelier_floor.json"); public final static ResourceLocation BLOCK_CHANDELIER_WALL = BetterEnd.makeID("patterns/block/chandelier_wall.json"); public final static ResourceLocation BLOCK_CHANDELIER_CEIL = BetterEnd.makeID("patterns/block/chandelier_ceil.json"); public final static ResourceLocation BLOCK_FURNACE = BetterEnd.makeID("patterns/block/furnace.json"); @@ -128,7 +137,8 @@ public class Patterns { public static Optional createJson(ResourceLocation patternId, Map textures) { ResourceManager resourceManager = Minecraft.getInstance().getResourceManager(); try (InputStream input = resourceManager.getResource(patternId).getInputStream()) { - String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)).lines().collect(Collectors.joining()); + String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)).lines() + .collect(Collectors.joining()); for (Entry texture : textures.entrySet()) { json = json.replace(texture.getKey(), texture.getValue()); } diff --git a/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java b/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java index d208d398..c85799c2 100644 --- a/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java +++ b/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java @@ -37,7 +37,8 @@ public class ArmoredElytraLayer if (abstractClientPlayer.isElytraLoaded() && abstractClientPlayer.getElytraTextureLocation() != null) { wingsTexture = abstractClientPlayer.getElytraTextureLocation(); } - else if (abstractClientPlayer.isCapeLoaded() && abstractClientPlayer.getCloakTextureLocation() != null && abstractClientPlayer.isModelPartShown(PlayerModelPart.CAPE)) { + else if (abstractClientPlayer.isCapeLoaded() && abstractClientPlayer.getCloakTextureLocation() != null && abstractClientPlayer + .isModelPartShown(PlayerModelPart.CAPE)) { wingsTexture = abstractClientPlayer.getCloakTextureLocation(); } } @@ -46,7 +47,12 @@ public class ArmoredElytraLayer poseStack.translate(0.0D, 0.0D, 0.125D); getParentModel().copyPropertiesTo(elytraModel); elytraModel.setupAnim(livingEntity, f, g, j, k, l); - VertexConsumer vertexConsumer = ItemRenderer.getArmorFoilBuffer(multiBufferSource, RenderType.armorCutoutNoCull(wingsTexture), false, itemStack.hasFoil()); + VertexConsumer vertexConsumer = ItemRenderer.getArmorFoilBuffer( + multiBufferSource, + RenderType.armorCutoutNoCull(wingsTexture), + false, + itemStack.hasFoil() + ); elytraModel.renderToBuffer(poseStack, vertexConsumer, i, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); poseStack.popPose(); } diff --git a/src/main/java/ru/betterend/client/render/BeamRenderer.java b/src/main/java/ru/betterend/client/render/BeamRenderer.java index f8f54d9c..18a77275 100644 --- a/src/main/java/ru/betterend/client/render/BeamRenderer.java +++ b/src/main/java/ru/betterend/client/render/BeamRenderer.java @@ -31,11 +31,53 @@ public class BeamRenderer { matrices.pushPose(); matrices.mulPose(Vector3f.YP.rotation(-rotation)); - renderBeam(matrices, vertexConsumer, red, green, blue, alpha, minY, maxBY, beamIn, 0.0F, 0.0F, beamIn, 0.0F, xIn, xIn, 0.0F, 0.0F, 1.0F, minV, maxV); + renderBeam( + matrices, + vertexConsumer, + red, + green, + blue, + alpha, + minY, + maxBY, + beamIn, + 0.0F, + 0.0F, + beamIn, + 0.0F, + xIn, + xIn, + 0.0F, + 0.0F, + 1.0F, + minV, + maxV + ); float xOut = -beamOut; maxV = (float) maxY + minV; - renderBeam(matrices, vertexConsumer, red, green, blue, alpha, minY, maxBY, xOut, xOut, beamOut, xOut, xOut, beamOut, beamOut, beamOut, 0.0F, 1.0F, minV, maxV); + renderBeam( + matrices, + vertexConsumer, + red, + green, + blue, + alpha, + minY, + maxBY, + xOut, + xOut, + beamOut, + xOut, + xOut, + beamOut, + beamOut, + beamOut, + 0.0F, + 1.0F, + minV, + maxV + ); matrices.popPose(); } @@ -43,10 +85,82 @@ public class BeamRenderer { PoseStack.Pose entry = matrices.last(); Matrix4f matrix4f = entry.pose(); Matrix3f matrix3f = entry.normal(); - renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxY, minY, x1, d1, x2, d2, minU, maxU, minV, maxV); - renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxY, minY, x4, d4, x3, d3, minU, maxU, minV, maxV); - renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxY, minY, x2, d2, x4, d4, minU, maxU, minV, maxV); - renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxY, minY, x3, d3, x1, d1, minU, maxU, minV, maxV); + renderBeam( + matrix4f, + matrix3f, + vertexConsumer, + red, + green, + blue, + alpha, + maxY, + minY, + x1, + d1, + x2, + d2, + minU, + maxU, + minV, + maxV + ); + renderBeam( + matrix4f, + matrix3f, + vertexConsumer, + red, + green, + blue, + alpha, + maxY, + minY, + x4, + d4, + x3, + d3, + minU, + maxU, + minV, + maxV + ); + renderBeam( + matrix4f, + matrix3f, + vertexConsumer, + red, + green, + blue, + alpha, + maxY, + minY, + x2, + d2, + x4, + d4, + minU, + maxU, + minV, + maxV + ); + renderBeam( + matrix4f, + matrix3f, + vertexConsumer, + red, + green, + blue, + alpha, + maxY, + minY, + x3, + d3, + x1, + d1, + minU, + maxU, + minV, + maxV + ); } private static void renderBeam(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int minY, int maxY, float minX, float minD, float maxX, float maxD, float minU, float maxU, float minV, float maxV) { @@ -57,6 +171,12 @@ public class BeamRenderer { } private static void addVertex(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, float x, float y, float d, float u, float v) { - vertexConsumer.vertex(matrix4f, x, y, d).color(red, green, blue, alpha).uv(u, v).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(15728880).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex(); + vertexConsumer.vertex(matrix4f, x, y, d) + .color(red, green, blue, alpha) + .uv(u, v) + .overlayCoords(OverlayTexture.NO_OVERLAY) + .uv2(15728880) + .normal(matrix3f, 0.0F, 1.0F, 0.0F) + .endVertex(); } } diff --git a/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java b/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java index c3ab55ae..cb48989c 100644 --- a/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java +++ b/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java @@ -16,8 +16,10 @@ import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.resources.ResourceLocation; public class EndCrystalRenderer { - private static final ResourceLocation CRYSTAL_TEXTURE = new ResourceLocation("textures/entity/end_crystal/end_crystal.png"); - private static final ResourceLocation CRYSTAL_BEAM_TEXTURE = new ResourceLocation("textures/entity/end_crystal/end_crystal_beam.png"); + private static final ResourceLocation CRYSTAL_TEXTURE = new ResourceLocation( + "textures/entity/end_crystal/end_crystal.png"); + private static final ResourceLocation CRYSTAL_BEAM_TEXTURE = new ResourceLocation( + "textures/entity/end_crystal/end_crystal_beam.png"); private static final RenderType END_CRYSTAL; private static final ModelPart CORE; private static final ModelPart FRAME; @@ -49,9 +51,17 @@ public class EndCrystalRenderer { public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - modelPartData.addOrReplaceChild("FRAME", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "FRAME", + CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create().texOffs(32, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "CORE", + CubeListBuilder.create().texOffs(32, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), + PartPose.ZERO + ); return LayerDefinition.create(modelData, 64, 32); } diff --git a/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java b/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java index 8e8bd739..cddd38f2 100644 --- a/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java +++ b/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java @@ -31,13 +31,31 @@ public class EternalCrystalRenderer { matrices.pushPose(); matrices.scale(0.6F, 0.6F, 0.6F); matrices.mulPose(Vector3f.YP.rotation(rotation)); - CORE.render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, colors[0], colors[1], colors[2], colors[3]); + CORE.render( + matrices, + vertexConsumer, + light, + OverlayTexture.NO_OVERLAY, + colors[0], + colors[1], + colors[2], + colors[3] + ); for (int i = 0; i < 4; i++) { matrices.pushPose(); float offset = Mth.sin(rotation * 2 + i) * 0.15F; matrices.translate(0, offset, 0); - SHARDS[i].render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, colors[0], colors[1], colors[2], colors[3]); + SHARDS[i].render( + matrices, + vertexConsumer, + light, + OverlayTexture.NO_OVERLAY, + colors[0], + colors[1], + colors[2], + colors[3] + ); matrices.popPose(); } @@ -64,15 +82,35 @@ public class EternalCrystalRenderer { public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - modelPartData.addOrReplaceChild("SHARDS_0", CubeListBuilder.create().texOffs(2, 4).addBox(-5.0f, 1.0f, -3.0f, 2.0f, 8.0f, 2.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "SHARDS_0", + CubeListBuilder.create().texOffs(2, 4).addBox(-5.0f, 1.0f, -3.0f, 2.0f, 8.0f, 2.0f), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild("SHARDS_1", CubeListBuilder.create().texOffs(2, 4).addBox(3.0f, -1.0f, -1.0f, 2.0f, 8.0f, 2.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "SHARDS_1", + CubeListBuilder.create().texOffs(2, 4).addBox(3.0f, -1.0f, -1.0f, 2.0f, 8.0f, 2.0f), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild("SHARDS_2", CubeListBuilder.create().texOffs(2, 4).addBox(-1.0f, 0.0f, -5.0f, 2.0f, 4.0f, 2.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "SHARDS_2", + CubeListBuilder.create().texOffs(2, 4).addBox(-1.0f, 0.0f, -5.0f, 2.0f, 4.0f, 2.0f), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild("SHARDS_3", CubeListBuilder.create().texOffs(2, 4).addBox(0.0f, 3.0f, 4.0f, 2.0f, 6.0f, 2.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "SHARDS_3", + CubeListBuilder.create().texOffs(2, 4).addBox(0.0f, 3.0f, 4.0f, 2.0f, 6.0f, 2.0f), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create().texOffs(0, 0).addBox(-2.0f, -2.0f, -2.0f, 4.0f, 12.0f, 4.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "CORE", + CubeListBuilder.create().texOffs(0, 0).addBox(-2.0f, -2.0f, -2.0f, 4.0f, 12.0f, 4.0f), + PartPose.ZERO + ); return LayerDefinition.create(modelData, 16, 16); } diff --git a/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java b/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java index b342250a..4edb08c8 100644 --- a/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java +++ b/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java @@ -57,7 +57,18 @@ public class PedestalItemRenderer implements Bloc float[] colors = EternalCrystalRenderer.colors(age); int y = blockEntity.getBlockPos().getY(); - BeamRenderer.renderLightBeam(matrices, vertexConsumers, age, tickDelta, -y, 1024 - y, colors, 0.25F, 0.13F, 0.16F); + BeamRenderer.renderLightBeam( + matrices, + vertexConsumers, + age, + tickDelta, + -y, + 1024 - y, + colors, + 0.25F, + 0.13F, + 0.16F + ); float altitude = Mth.sin((blockEntity.getAge() + tickDelta) / 10.0F) * 0.1F + 0.1F; matrices.translate(0.0D, altitude, 0.0D); } @@ -70,7 +81,16 @@ public class PedestalItemRenderer implements Bloc else { float rotation = (age + tickDelta) / 25.0F + 6.0F; matrices.mulPose(Vector3f.YP.rotation(rotation)); - minecraft.getItemRenderer().render(activeItem, ItemTransforms.TransformType.GROUND, false, matrices, vertexConsumers, light, overlay, model); + minecraft.getItemRenderer() + .render(activeItem, + ItemTransforms.TransformType.GROUND, + false, + matrices, + vertexConsumers, + light, + overlay, + model + ); } matrices.popPose(); } diff --git a/src/main/java/ru/betterend/effects/EndStatusEffects.java b/src/main/java/ru/betterend/effects/EndStatusEffects.java index 66e3ca4a..a5bc7be8 100644 --- a/src/main/java/ru/betterend/effects/EndStatusEffects.java +++ b/src/main/java/ru/betterend/effects/EndStatusEffects.java @@ -8,9 +8,30 @@ import ru.betterend.BetterEnd; import ru.betterend.effects.status.EndVeilEffect; public class EndStatusEffects { - public final static MobEffectInstance CRYSTALITE_HEALTH_REGEN = new MobEffectInstance(MobEffects.REGENERATION, 40, 0, true, false, true); - public final static MobEffectInstance CRYSTALITE_DIG_SPEED = new MobEffectInstance(MobEffects.DIG_SPEED, 40, 0, true, false, true); - public final static MobEffectInstance CRYSTALITE_MOVE_SPEED = new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 40, 0, true, false, true); + public final static MobEffectInstance CRYSTALITE_HEALTH_REGEN = new MobEffectInstance( + MobEffects.REGENERATION, + 40, + 0, + true, + false, + true + ); + public final static MobEffectInstance CRYSTALITE_DIG_SPEED = new MobEffectInstance( + MobEffects.DIG_SPEED, + 40, + 0, + true, + false, + true + ); + public final static MobEffectInstance CRYSTALITE_MOVE_SPEED = new MobEffectInstance( + MobEffects.MOVEMENT_SPEED, + 40, + 0, + true, + false, + true + ); public final static MobEffect END_VEIL = registerEffect("end_veil", new EndVeilEffect()); diff --git a/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java b/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java index 57652b8a..852c5854 100644 --- a/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java +++ b/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java @@ -7,7 +7,7 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory; public class EndVeilEnchantment extends Enchantment { public EndVeilEnchantment() { - super(Enchantment.Rarity.VERY_RARE, EnchantmentCategory.ARMOR_HEAD, new EquipmentSlot[]{EquipmentSlot.HEAD}); + super(Enchantment.Rarity.VERY_RARE, EnchantmentCategory.ARMOR_HEAD, new EquipmentSlot[] {EquipmentSlot.HEAD}); } @Override diff --git a/src/main/java/ru/betterend/entity/CubozoaEntity.java b/src/main/java/ru/betterend/entity/CubozoaEntity.java index c3c1723d..b973567a 100644 --- a/src/main/java/ru/betterend/entity/CubozoaEntity.java +++ b/src/main/java/ru/betterend/entity/CubozoaEntity.java @@ -37,8 +37,14 @@ import java.util.Random; public class CubozoaEntity extends AbstractSchoolingFish { public static final int VARIANTS = 2; - private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(CubozoaEntity.class, EntityDataSerializers.BYTE); - private static final EntityDataAccessor SCALE = SynchedEntityData.defineId(CubozoaEntity.class, EntityDataSerializers.BYTE); + private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId( + CubozoaEntity.class, + EntityDataSerializers.BYTE + ); + private static final EntityDataAccessor SCALE = SynchedEntityData.defineId( + CubozoaEntity.class, + EntityDataSerializers.BYTE + ); public CubozoaEntity(EntityType entityType, Level world) { super(entityType, world); @@ -100,7 +106,10 @@ public class CubozoaEntity extends AbstractSchoolingFish { } public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0).add(Attributes.FOLLOW_RANGE, 16.0).add(Attributes.MOVEMENT_SPEED, 0.5); + return LivingEntity.createLivingAttributes() + .add(Attributes.MAX_HEALTH, 2.0) + .add(Attributes.FOLLOW_RANGE, 16.0) + .add(Attributes.MOVEMENT_SPEED, 0.5); } public int getVariant() { @@ -145,7 +154,10 @@ public class CubozoaEntity extends AbstractSchoolingFish { public void playerTouch(Player player) { if (player instanceof ServerPlayer && player.hurt(DamageSource.mobAttack(this), 0.5F)) { if (!this.isSilent()) { - ((ServerPlayer) player).connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.PUFFER_FISH_STING, 0.0F)); + ((ServerPlayer) player).connection.send(new ClientboundGameEventPacket( + ClientboundGameEventPacket.PUFFER_FISH_STING, + 0.0F + )); } if (random.nextBoolean()) { player.addEffect(new MobEffectInstance(MobEffects.POISON, 20, 0)); diff --git a/src/main/java/ru/betterend/entity/DragonflyEntity.java b/src/main/java/ru/betterend/entity/DragonflyEntity.java index 1cae90ad..5c4fe209 100644 --- a/src/main/java/ru/betterend/entity/DragonflyEntity.java +++ b/src/main/java/ru/betterend/entity/DragonflyEntity.java @@ -52,7 +52,11 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { } public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 8.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.FLYING_SPEED, 1.0D).add(Attributes.MOVEMENT_SPEED, 0.1D); + return LivingEntity.createLivingAttributes() + .add(Attributes.MAX_HEALTH, 8.0D) + .add(Attributes.FOLLOW_RANGE, 16.0D) + .add(Attributes.FLYING_SPEED, 1.0D) + .add(Attributes.MOVEMENT_SPEED, 0.1D); } @Override @@ -172,7 +176,16 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { if (airPos != null) { if (isInVoid(airPos)) { for (int i = 0; i < 8; i++) { - airPos = HoverRandomPos.getPos(DragonflyEntity.this, 16, 7, rotation.x, rotation.z, MHelper.PI2, 3, 1); + airPos = HoverRandomPos.getPos( + DragonflyEntity.this, + 16, + 7, + rotation.x, + rotation.z, + MHelper.PI2, + 3, + 1 + ); if (airPos != null && !isInVoid(airPos)) { return airPos; } @@ -184,7 +197,15 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { } return airPos; } - return AirAndWaterRandomPos.getPos(DragonflyEntity.this, 8, 4, -2, rotation.x, rotation.z, 1.5707963705062866D); + return AirAndWaterRandomPos.getPos( + DragonflyEntity.this, + 8, + 4, + -2, + rotation.x, + rotation.z, + 1.5707963705062866D + ); } private boolean isInVoid(Vec3 pos) { diff --git a/src/main/java/ru/betterend/entity/EndFishEntity.java b/src/main/java/ru/betterend/entity/EndFishEntity.java index 5246a55d..6430dc65 100644 --- a/src/main/java/ru/betterend/entity/EndFishEntity.java +++ b/src/main/java/ru/betterend/entity/EndFishEntity.java @@ -34,8 +34,14 @@ public class EndFishEntity extends AbstractSchoolingFish { public static final int VARIANTS_NORMAL = 5; public static final int VARIANTS_SULPHUR = 3; public static final int VARIANTS = VARIANTS_NORMAL + VARIANTS_SULPHUR; - private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(EndFishEntity.class, EntityDataSerializers.BYTE); - private static final EntityDataAccessor SCALE = SynchedEntityData.defineId(EndFishEntity.class, EntityDataSerializers.BYTE); + private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId( + EndFishEntity.class, + EntityDataSerializers.BYTE + ); + private static final EntityDataAccessor SCALE = SynchedEntityData.defineId( + EndFishEntity.class, + EntityDataSerializers.BYTE + ); public EndFishEntity(EntityType entityType, Level world) { super(entityType, world); @@ -128,7 +134,10 @@ public class EndFishEntity extends AbstractSchoolingFish { } public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0).add(Attributes.FOLLOW_RANGE, 16.0).add(Attributes.MOVEMENT_SPEED, 0.75); + return LivingEntity.createLivingAttributes() + .add(Attributes.MAX_HEALTH, 2.0) + .add(Attributes.FOLLOW_RANGE, 16.0) + .add(Attributes.MOVEMENT_SPEED, 0.75); } public int getVariant() { diff --git a/src/main/java/ru/betterend/entity/EndSlimeEntity.java b/src/main/java/ru/betterend/entity/EndSlimeEntity.java index 064e369f..f1655073 100644 --- a/src/main/java/ru/betterend/entity/EndSlimeEntity.java +++ b/src/main/java/ru/betterend/entity/EndSlimeEntity.java @@ -46,7 +46,10 @@ import java.util.List; import java.util.Random; public class EndSlimeEntity extends Slime { - private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(EndSlimeEntity.class, EntityDataSerializers.BYTE); + private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId( + EndSlimeEntity.class, + EntityDataSerializers.BYTE + ); private static final MutableBlockPos POS = new MutableBlockPos(); public EndSlimeEntity(EntityType entityType, Level world) { @@ -59,14 +62,21 @@ public class EndSlimeEntity extends Slime { this.goalSelector.addGoal(2, new FaceTowardTargetGoal()); this.goalSelector.addGoal(3, new RandomLookGoal()); this.goalSelector.addGoal(5, new MoveGoal()); - this.targetSelector.addGoal(1, new NearestAttackableTargetGoal(this, Player.class, 10, true, false, (livingEntity) -> { - return Math.abs(livingEntity.getY() - this.getY()) <= 4.0D; - })); + this.targetSelector.addGoal( + 1, + new NearestAttackableTargetGoal(this, Player.class, 10, true, false, (livingEntity) -> { + return Math.abs(livingEntity.getY() - this.getY()) <= 4.0D; + }) + ); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, IronGolem.class, true)); } public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 1.0D).add(Attributes.ATTACK_DAMAGE, 1.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.MOVEMENT_SPEED, 0.15D); + return LivingEntity.createLivingAttributes() + .add(Attributes.MAX_HEALTH, 1.0D) + .add(Attributes.ATTACK_DAMAGE, 1.0D) + .add(Attributes.FOLLOW_RANGE, 16.0D) + .add(Attributes.MOVEMENT_SPEED, 0.15D); } @Override @@ -136,7 +146,13 @@ public class EndSlimeEntity extends Slime { slimeEntity.setInvulnerable(this.isInvulnerable()); ((ISlime) slimeEntity).be_setSlimeSize(j, true); slimeEntity.refreshDimensions(); - slimeEntity.moveTo(this.getX() + (double) g, this.getY() + 0.5D, this.getZ() + (double) h, this.random.nextFloat() * 360.0F, 0.0F); + slimeEntity.moveTo( + this.getX() + (double) g, + this.getY() + 0.5D, + this.getZ() + (double) h, + this.random.nextFloat() * 360.0F, + 0.0F + ); this.level.addFreshEntity(slimeEntity); } } @@ -197,7 +213,12 @@ public class EndSlimeEntity extends Slime { } public static boolean canSpawn(EntityType type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { - return random.nextInt(16) == 0 || isPermanentBiome(world, pos) || (notManyEntities(world, pos, 32, 3) && isWaterNear(world, pos, 32, 8)); + return random.nextInt(16) == 0 || isPermanentBiome(world, pos) || (notManyEntities( + world, + pos, + 32, + 3 + ) && isWaterNear(world, pos, 32, 8)); } private static boolean isPermanentBiome(ServerLevelAccessor world, BlockPos pos) { @@ -285,7 +306,8 @@ public class EndSlimeEntity extends Slime { } public boolean canUse() { - return EndSlimeEntity.this.getTarget() == null && (EndSlimeEntity.this.onGround || EndSlimeEntity.this.isInWater() || EndSlimeEntity.this.isInLava() || EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION)) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; + return EndSlimeEntity.this.getTarget() == null && (EndSlimeEntity.this.onGround || EndSlimeEntity.this.isInWater() || EndSlimeEntity.this + .isInLava() || EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION)) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; } public void tick() { @@ -314,7 +336,8 @@ public class EndSlimeEntity extends Slime { return false; } else { - return livingEntity instanceof Player && ((Player) livingEntity).getAbilities().invulnerable ? false : EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; + return livingEntity instanceof Player && ((Player) livingEntity).getAbilities().invulnerable ? false : EndSlimeEntity.this + .getMoveControl() instanceof EndSlimeMoveControl; } } @@ -341,7 +364,10 @@ public class EndSlimeEntity extends Slime { public void tick() { EndSlimeEntity.this.lookAt(EndSlimeEntity.this.getTarget(), 10.0F, 10.0F); - ((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).look(EndSlimeEntity.this.getYRot(), EndSlimeEntity.this.isDealsDamage()); + ((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).look( + EndSlimeEntity.this.getYRot(), + EndSlimeEntity.this.isDealsDamage() + ); } } @@ -384,7 +410,11 @@ public class EndSlimeEntity extends Slime { EndSlimeEntity.this.getJumpControl().jump(); if (EndSlimeEntity.this.doPlayJumpSound()) { - EndSlimeEntity.this.playSound(EndSlimeEntity.this.getJumpSound(), EndSlimeEntity.this.getSoundVolume(), getJumpSoundPitch()); + EndSlimeEntity.this.playSound( + EndSlimeEntity.this.getJumpSound(), + EndSlimeEntity.this.getSoundVolume(), + getJumpSoundPitch() + ); } } else { diff --git a/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java b/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java index 9138d104..3dfc5431 100644 --- a/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java +++ b/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java @@ -44,15 +44,44 @@ public class ShadowWalkerEntity extends Monster { } public static AttributeSupplier.Builder createMobAttributes() { - return Monster.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0).add(Attributes.MOVEMENT_SPEED, 0.15).add(Attributes.ATTACK_DAMAGE, 4.5).add(Attributes.ARMOR, 2.0).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE); + return Monster.createMonsterAttributes() + .add(Attributes.FOLLOW_RANGE, 35.0) + .add(Attributes.MOVEMENT_SPEED, 0.15) + .add(Attributes.ATTACK_DAMAGE, 4.5) + .add(Attributes.ARMOR, 2.0) + .add(Attributes.SPAWN_REINFORCEMENTS_CHANCE); } @Override public void tick() { super.tick(); - level.addParticle(ParticleTypes.ASH, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0); - level.addParticle(ParticleTypes.SMOKE, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0); - level.addParticle(ParticleTypes.ENTITY_EFFECT, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0); + level.addParticle( + ParticleTypes.ASH, + getX() + random.nextGaussian() * 0.2, + getY() + random.nextGaussian() * 0.5 + 1, + getZ() + random.nextGaussian() * 0.2, + 0, + 0, + 0 + ); + level.addParticle( + ParticleTypes.SMOKE, + getX() + random.nextGaussian() * 0.2, + getY() + random.nextGaussian() * 0.5 + 1, + getZ() + random.nextGaussian() * 0.2, + 0, + 0, + 0 + ); + level.addParticle( + ParticleTypes.ENTITY_EFFECT, + getX() + random.nextGaussian() * 0.2, + getY() + random.nextGaussian() * 0.5 + 1, + getZ() + random.nextGaussian() * 0.2, + 0, + 0, + 0 + ); } @Override diff --git a/src/main/java/ru/betterend/entity/SilkMothEntity.java b/src/main/java/ru/betterend/entity/SilkMothEntity.java index 8e7902c8..e894533d 100644 --- a/src/main/java/ru/betterend/entity/SilkMothEntity.java +++ b/src/main/java/ru/betterend/entity/SilkMothEntity.java @@ -70,7 +70,11 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { } public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.FLYING_SPEED, 0.4D).add(Attributes.MOVEMENT_SPEED, 0.1D); + return LivingEntity.createLivingAttributes() + .add(Attributes.MAX_HEALTH, 2.0D) + .add(Attributes.FOLLOW_RANGE, 16.0D) + .add(Attributes.FLYING_SPEED, 0.4D) + .add(Attributes.MOVEMENT_SPEED, 0.1D); } public void setHive(Level world, BlockPos hive) { @@ -220,14 +224,21 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { public void start() { Vec3 vec3d = null; if (SilkMothEntity.this.hivePos != null && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level) { - if (SilkMothEntity.this.position().distanceToSqr(SilkMothEntity.this.hivePos.getX(), SilkMothEntity.this.hivePos.getY(), SilkMothEntity.this.hivePos.getZ()) > 16) { + if (SilkMothEntity.this.position() + .distanceToSqr(SilkMothEntity.this.hivePos.getX(), + SilkMothEntity.this.hivePos.getY(), + SilkMothEntity.this.hivePos.getZ() + ) > 16) { vec3d = SilkMothEntity.this.position().add(random.nextGaussian() * 2, 0, random.nextGaussian() * 2); } } vec3d = vec3d == null ? this.getRandomLocation() : vec3d; if (vec3d != null) { try { - SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath(new BlockPos(vec3d), 1), 1.0D); + SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath( + new BlockPos(vec3d), + 1 + ), 1.0D); } catch (Exception e) { } @@ -238,7 +249,15 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { private Vec3 getRandomLocation() { Vec3 vec3d3 = SilkMothEntity.this.getViewVector(0.0F); Vec3 vec3d4 = HoverRandomPos.getPos(SilkMothEntity.this, 8, 7, vec3d3.x, vec3d3.z, 1.5707964F, 3, 1); - return vec3d4 != null ? vec3d4 : AirAndWaterRandomPos.getPos(SilkMothEntity.this, 8, 4, -2, vec3d3.x, vec3d3.z, 1.5707963705062866D); + return vec3d4 != null ? vec3d4 : AirAndWaterRandomPos.getPos( + SilkMothEntity.this, + 8, + 4, + -2, + vec3d3.x, + vec3d3.z, + 1.5707963705062866D + ); } } @@ -249,12 +268,25 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { @Override public boolean canUse() { - return SilkMothEntity.this.hivePos != null && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level && SilkMothEntity.this.navigation.isDone() && SilkMothEntity.this.random.nextInt(16) == 0 && SilkMothEntity.this.position().distanceToSqr(SilkMothEntity.this.hivePos.getX(), SilkMothEntity.this.hivePos.getY(), SilkMothEntity.this.hivePos.getZ()) < 64; + return SilkMothEntity.this.hivePos != null && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level && SilkMothEntity.this.navigation + .isDone() && SilkMothEntity.this.random.nextInt(16) == 0 && SilkMothEntity.this.position() + .distanceToSqr( + SilkMothEntity.this.hivePos + .getX(), + SilkMothEntity.this.hivePos + .getY(), + SilkMothEntity.this.hivePos + .getZ() + ) < 64; } @Override public boolean canContinueToUse() { - return SilkMothEntity.this.navigation.isInProgress() && level.getBlockState(entrance).isAir() && (level.getBlockState(hivePos).is(EndBlocks.SILK_MOTH_NEST) || level.getBlockState(hivePos).is(EndBlocks.SILK_MOTH_HIVE)); + return SilkMothEntity.this.navigation.isInProgress() && level.getBlockState(entrance) + .isAir() && (level.getBlockState(hivePos) + .is(EndBlocks.SILK_MOTH_NEST) || level + .getBlockState(hivePos) + .is(EndBlocks.SILK_MOTH_HIVE)); } @Override @@ -291,9 +323,20 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { if (fullness > 3) { fullness = 3; } - BlocksHelper.setWithUpdate(SilkMothEntity.this.hiveWorld, SilkMothEntity.this.hivePos, state.setValue(EndBlockProperties.FULLNESS, fullness)); + BlocksHelper.setWithUpdate( + SilkMothEntity.this.hiveWorld, + SilkMothEntity.this.hivePos, + state.setValue(EndBlockProperties.FULLNESS, fullness) + ); } - SilkMothEntity.this.level.playSound(null, SilkMothEntity.this.entrance, SoundEvents.BEEHIVE_ENTER, SoundSource.BLOCKS, 1, 1); + SilkMothEntity.this.level.playSound( + null, + SilkMothEntity.this.entrance, + SoundEvents.BEEHIVE_ENTER, + SoundSource.BLOCKS, + 1, + 1 + ); SilkMothEntity.this.discard(); } else { diff --git a/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java b/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java index fd56cab7..af0f23c1 100644 --- a/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java @@ -26,14 +26,30 @@ public class CubozoaEntityModel extends BlockBenchModel { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 17).addBox(-2.0F, -12.5F, -2.0F, 4.0F, 4.0F, 4.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); + PartDefinition bodyPart = modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(0, 17).addBox(-2.0F, -12.5F, -2.0F, 4.0F, 4.0F, 4.0F), + PartPose.offset(0.0F, 24.0F, 0.0F) + ); - bodyPart.addOrReplaceChild("main_cube_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -7.0F, -5.0F, 10.0F, 7.0F, 10.0F), PartPose.offsetAndRotation(0.0F, -14.0F, 0.0F, 0.0F, 0.0F, -3.1416F)); + bodyPart.addOrReplaceChild( + "main_cube_r1", + CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -7.0F, -5.0F, 10.0F, 7.0F, 10.0F), + PartPose.offsetAndRotation(0.0F, -14.0F, 0.0F, 0.0F, 0.0F, -3.1416F) + ); for (int i = 1; i <= TENTACLE_COUNT; i++) { - PartDefinition tentaclePart = bodyPart.addOrReplaceChild("tentacle_center_" + i, CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, i * 1.5708F, 0.0F)); + PartDefinition tentaclePart = bodyPart.addOrReplaceChild( + "tentacle_center_" + i, + CubeListBuilder.create(), + PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, i * 1.5708F, 0.0F) + ); - tentaclePart.addOrReplaceChild("tentacle_" + i, CubeListBuilder.create().texOffs(16, 17).addBox(-4.0F, 0.0F, 0.0F, 8.0F, 7.0F, 0.0F), PartPose.offset(0.0F, -7.0F, 4.5F)); + tentaclePart.addOrReplaceChild( + "tentacle_" + i, + CubeListBuilder.create().texOffs(16, 17).addBox(-4.0F, 0.0F, 0.0F, 8.0F, 7.0F, 0.0F), + PartPose.offset(0.0F, -7.0F, 4.5F) + ); } return LayerDefinition.create(modelData, 48, 48); diff --git a/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java b/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java index d0cacdd6..fda98221 100644 --- a/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java @@ -28,25 +28,65 @@ public class DragonflyEntityModel extends BlockBenchModel { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F), PartPose.offset(2.0F, 21.5F, -4.0F)); + PartDefinition bodyPart = modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F), + PartPose.offset(2.0F, 21.5F, -4.0F) + ); - bodyPart.addOrReplaceChild(PartNames.HEAD, CubeListBuilder.create().texOffs(17, 0).addBox(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F), PartPose.offsetAndRotation(-2.0F, -2.0F, 0.0F, 0.3491F, 0.0F, 0.0F)); + bodyPart.addOrReplaceChild( + PartNames.HEAD, + CubeListBuilder.create().texOffs(17, 0).addBox(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F), + PartPose.offsetAndRotation(-2.0F, -2.0F, 0.0F, 0.3491F, 0.0F, 0.0F) + ); - PartDefinition tailPart = bodyPart.addOrReplaceChild(PartNames.TAIL, CubeListBuilder.create().texOffs(26, 0).addBox(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F), PartPose.offset(-2.0F, -2.0F, 9.0F)); + PartDefinition tailPart = bodyPart.addOrReplaceChild( + PartNames.TAIL, + CubeListBuilder.create().texOffs(26, 0).addBox(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F), + PartPose.offset(-2.0F, -2.0F, 9.0F) + ); - tailPart.addOrReplaceChild(PartNames.TAIL_FIN, CubeListBuilder.create().texOffs(36, 0).addBox(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F), PartPose.offset(0.0F, 0.0F, 7.0F)); + tailPart.addOrReplaceChild( + PartNames.TAIL_FIN, + CubeListBuilder.create().texOffs(36, 0).addBox(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F), + PartPose.offset(0.0F, 0.0F, 7.0F) + ); - bodyPart.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(0, 13).addBox(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), PartPose.offset(-2.0F, -4.0F, 4.0F)); + bodyPart.addOrReplaceChild( + PartNames.LEFT_WING, + CubeListBuilder.create().texOffs(0, 13).addBox(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), + PartPose.offset(-2.0F, -4.0F, 4.0F) + ); - bodyPart.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(0, 13).addBox(0.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), PartPose.offset(-2.0F, -4.0F, 4.0F)); + bodyPart.addOrReplaceChild( + PartNames.RIGHT_WING, + CubeListBuilder.create().mirror().texOffs(0, 13).addBox(0.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), + PartPose.offset(-2.0F, -4.0F, 4.0F) + ); - bodyPart.addOrReplaceChild(PartNames.LEFT_WING_BASE, CubeListBuilder.create().texOffs(4, 17).addBox(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), PartPose.offset(-2.0F, -4.0F, 8.0F)); + bodyPart.addOrReplaceChild( + PartNames.LEFT_WING_BASE, + CubeListBuilder.create().texOffs(4, 17).addBox(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), + PartPose.offset(-2.0F, -4.0F, 8.0F) + ); - bodyPart.addOrReplaceChild(PartNames.RIGHT_WING_BASE, CubeListBuilder.create().mirror().texOffs(4, 17).addBox(0.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), PartPose.offset(-2.0F, -4.0F, 8.0F)); + bodyPart.addOrReplaceChild( + PartNames.RIGHT_WING_BASE, + CubeListBuilder.create().mirror().texOffs(4, 17).addBox(0.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), + PartPose.offset(-2.0F, -4.0F, 8.0F) + ); - bodyPart.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, 1.0F, 0.0F, 0.0F, -0.5236F)); + bodyPart.addOrReplaceChild( + PartNames.LEFT_LEG, + CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), + PartPose.offsetAndRotation(-1.0F, 0.0F, 1.0F, 0.0F, 0.0F, -0.5236F) + ); - bodyPart.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), PartPose.offsetAndRotation(-3.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.5236F)); + bodyPart.addOrReplaceChild( + PartNames.RIGHT_LEG, + CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), + PartPose.offsetAndRotation(-3.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.5236F) + ); return LayerDefinition.create(modelData, 64, 64); } diff --git a/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java b/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java index bb2902e1..f0182223 100644 --- a/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java @@ -24,17 +24,41 @@ public class EndFishEntityModel extends BlockBenchModel { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -2.0F, -4.0F, 2.0F, 4.0F, 8.0F), PartPose.offset(0.0F, 20.0F, 0.0F)); + PartDefinition bodyPart = modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -2.0F, -4.0F, 2.0F, 4.0F, 8.0F), + PartPose.offset(0.0F, 20.0F, 0.0F) + ); - bodyPart.addOrReplaceChild(PartNames.TOP_FIN, CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, -8.0F, 0.0F, 0.0F, 8.0F, 6.0F), PartPose.offsetAndRotation(0.0F, -2.0F, -4.0F, -0.6981F, 0.0F, 0.0F)); + bodyPart.addOrReplaceChild( + PartNames.TOP_FIN, + CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, -8.0F, 0.0F, 0.0F, 8.0F, 6.0F), + PartPose.offsetAndRotation(0.0F, -2.0F, -4.0F, -0.6981F, 0.0F, 0.0F) + ); - bodyPart.addOrReplaceChild(PartNames.BOTTOM_FIN, CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 6.0F), PartPose.offsetAndRotation(0.0F, 2.0F, -4.0F, 0.6981F, 0.0F, 0.0F)); + bodyPart.addOrReplaceChild( + PartNames.BOTTOM_FIN, + CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 6.0F), + PartPose.offsetAndRotation(0.0F, 2.0F, -4.0F, 0.6981F, 0.0F, 0.0F) + ); - bodyPart.addOrReplaceChild(PartNames.TAIL_FIN, CubeListBuilder.create().texOffs(0, 15).addBox(0.0F, -5.0F, 0.0F, 0.0F, 5.0F, 5.0F), PartPose.offsetAndRotation(0.0F, 0.0F, 2.0F, -0.7854F, 0.0F, 0.0F)); + bodyPart.addOrReplaceChild( + PartNames.TAIL_FIN, + CubeListBuilder.create().texOffs(0, 15).addBox(0.0F, -5.0F, 0.0F, 0.0F, 5.0F, 5.0F), + PartPose.offsetAndRotation(0.0F, 0.0F, 2.0F, -0.7854F, 0.0F, 0.0F) + ); - bodyPart.addOrReplaceChild(PartNames.RIGHT_FIN, CubeListBuilder.create().texOffs(0, 25).addBox(-3.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, 0.7854F, 0.0F)); + bodyPart.addOrReplaceChild( + PartNames.RIGHT_FIN, + CubeListBuilder.create().texOffs(0, 25).addBox(-3.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), + PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, 0.7854F, 0.0F) + ); - bodyPart.addOrReplaceChild(PartNames.LEFT_FIN, CubeListBuilder.create().mirror().texOffs(0, 25).addBox(0.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, -0.7854F, 0.0F)); + bodyPart.addOrReplaceChild( + PartNames.LEFT_FIN, + CubeListBuilder.create().mirror().texOffs(0, 25).addBox(0.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), + PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, -0.7854F, 0.0F) + ); return LayerDefinition.create(modelData, 32, 32); } diff --git a/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java b/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java index 8ef508cc..82f89b25 100644 --- a/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java @@ -38,28 +38,60 @@ public class EndSlimeEntityModel extends ListModel PartDefinition modelPartData = modelData.getRoot(); if (onlyShell) { - modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, 16.0F, -4.0F, 8.0F, 8.0F, 8.0F), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, 16.0F, -4.0F, 8.0F, 8.0F, 8.0F), + PartPose.ZERO + ); } else { - modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 16).addBox(-3.0F, 17.0F, -3.0F, 6.0F, 6.0F, 6.0F), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(0, 16).addBox(-3.0F, 17.0F, -3.0F, 6.0F, 6.0F, 6.0F), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild(PartNames.RIGHT_EYE, CubeListBuilder.create().texOffs(32, 0).addBox(-3.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.RIGHT_EYE, + CubeListBuilder.create().texOffs(32, 0).addBox(-3.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild(PartNames.LEFT_EYE, CubeListBuilder.create().texOffs(32, 4).addBox(1.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.LEFT_EYE, + CubeListBuilder.create().texOffs(32, 4).addBox(1.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild(PartNames.MOUTH, CubeListBuilder.create().texOffs(32, 8).addBox(0.0F, 21.0F, -3.5F, 1.0F, 1.0F, 1.0F), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.MOUTH, + CubeListBuilder.create().texOffs(32, 8).addBox(0.0F, 21.0F, -3.5F, 1.0F, 1.0F, 1.0F), + PartPose.ZERO + ); - PartDefinition flowerPart = modelPartData.addOrReplaceChild("flower", CubeListBuilder.create(), PartPose.ZERO); + PartDefinition flowerPart = modelPartData.addOrReplaceChild( + "flower", + CubeListBuilder.create(), + PartPose.ZERO + ); PartDefinition cropPart = modelPartData.addOrReplaceChild("crop", CubeListBuilder.create(), PartPose.ZERO); for (int i = 0; i < 6; i++) { final PartDefinition parent = i < 4 ? flowerPart : cropPart; final float rot = MHelper.degreesToRadians(i < 4 ? (i * 45F) : ((i - 4) * 90F + 45F)); - PartDefinition petalRotPart = parent.addOrReplaceChild("petalRot_" + i, CubeListBuilder.create(), PartPose.offsetAndRotation(0, 0, 0, 0, rot, 0)); + PartDefinition petalRotPart = parent.addOrReplaceChild( + "petalRot_" + i, + CubeListBuilder.create(), + PartPose.offsetAndRotation(0, 0, 0, 0, rot, 0) + ); - petalRotPart.addOrReplaceChild("petal_" + i, CubeListBuilder.create().texOffs(40, 0).addBox(0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 0.0F), PartPose.offset(-4, 8, 0)); + petalRotPart.addOrReplaceChild( + "petal_" + i, + CubeListBuilder.create().texOffs(40, 0).addBox(0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 0.0F), + PartPose.offset(-4, 8, 0) + ); } } diff --git a/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java b/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java index 47423a00..75245f52 100644 --- a/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java @@ -34,35 +34,95 @@ public class SilkMothEntityModel extends BlockBenchModel { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - PartDefinition legsL = modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(0, 0), PartPose.offsetAndRotation(1.5f, 19.9f, -0.45f, 0.0f, 0.0f, 0.6981f)); + PartDefinition legsL = modelPartData.addOrReplaceChild( + PartNames.LEFT_LEG, + CubeListBuilder.create().texOffs(0, 0), + PartPose.offsetAndRotation(1.5f, 19.9f, -0.45f, 0.0f, 0.0f, 0.6981f) + ); - legsL.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 13).addBox(0.0216f, 0.0f, -0.5976f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f)); + legsL.addOrReplaceChild( + "cube_r1", + CubeListBuilder.create().texOffs(0, 13).addBox(0.0216f, 0.0f, -0.5976f, 3.0f, 0.0f, 1.0f), + PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f) + ); - legsL.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(0, 15).addBox(0.0f, 0.0f, -0.6f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f)); + legsL.addOrReplaceChild( + "cube_r2", + CubeListBuilder.create().texOffs(0, 15).addBox(0.0f, 0.0f, -0.6f, 3.0f, 0.0f, 1.0f), + PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f) + ); - legsL.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(0, 14).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f)); + legsL.addOrReplaceChild( + "cube_r3", + CubeListBuilder.create().texOffs(0, 14).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), + PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f) + ); - PartDefinition legsR = modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(0, 0), PartPose.offsetAndRotation(-1.5f, 19.9f, -0.55f, 0.0f, 3.1416f, -0.6545f)); + PartDefinition legsR = modelPartData.addOrReplaceChild( + PartNames.RIGHT_LEG, + CubeListBuilder.create().texOffs(0, 0), + PartPose.offsetAndRotation(-1.5f, 19.9f, -0.55f, 0.0f, 3.1416f, -0.6545f) + ); - legsR.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(0, 10).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f)); + legsR.addOrReplaceChild( + "cube_r4", + CubeListBuilder.create().texOffs(0, 10).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), + PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f) + ); - legsR.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(0, 11).addBox(0.0f, 0.0f, -0.4f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f)); + legsR.addOrReplaceChild( + "cube_r5", + CubeListBuilder.create().texOffs(0, 11).addBox(0.0f, 0.0f, -0.4f, 3.0f, 0.0f, 1.0f), + PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f) + ); - legsR.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(0, 12).addBox(0.0216f, 0.0f, -0.4024f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f)); + legsR.addOrReplaceChild( + "cube_r6", + CubeListBuilder.create().texOffs(0, 12).addBox(0.0216f, 0.0f, -0.4024f, 3.0f, 0.0f, 1.0f), + PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f) + ); - PartDefinition head_pivot = modelPartData.addOrReplaceChild(PartNames.HEAD, CubeListBuilder.create().texOffs(15, 10).addBox(-1.5f, -1.5f, -2.0f, 3.0f, 3.0f, 3.0f), PartPose.offset(0.0f, 18.0f, -3.0f)); + PartDefinition head_pivot = modelPartData.addOrReplaceChild( + PartNames.HEAD, + CubeListBuilder.create().texOffs(15, 10).addBox(-1.5f, -1.5f, -2.0f, 3.0f, 3.0f, 3.0f), + PartPose.offset(0.0f, 18.0f, -3.0f) + ); - head_pivot.addOrReplaceChild("tendril_r_r1", CubeListBuilder.create().mirror().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), PartPose.offsetAndRotation(1.0f, -1.15f, -1.0f, 0.0f, 0.0f, 0.3927f)); + head_pivot.addOrReplaceChild( + "tendril_r_r1", + CubeListBuilder.create().mirror().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), + PartPose.offsetAndRotation(1.0f, -1.15f, -1.0f, 0.0f, 0.0f, 0.3927f) + ); - head_pivot.addOrReplaceChild("tendril_r_r2", CubeListBuilder.create().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), PartPose.offsetAndRotation(-1.0f, -1.15f, -1.0f, 0.0f, 0.0f, -0.3927f)); + head_pivot.addOrReplaceChild( + "tendril_r_r2", + CubeListBuilder.create().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), + PartPose.offsetAndRotation(-1.0f, -1.15f, -1.0f, 0.0f, 0.0f, -0.3927f) + ); - PartDefinition bb_main = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(19, 19).addBox(-2.5f, -8.5f, -3.0f, 5.0f, 5.0f, 3.0f), PartPose.offset(0.0f, 24.0f, 0.0f)); + PartDefinition bb_main = modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(19, 19).addBox(-2.5f, -8.5f, -3.0f, 5.0f, 5.0f, 3.0f), + PartPose.offset(0.0f, 24.0f, 0.0f) + ); - bb_main.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(0, 5).addBox(-7.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), PartPose.offsetAndRotation(-1.5f, -6.5f, 0.5f, 0.0f, 0.0f, 0.3927f)); + bb_main.addOrReplaceChild( + PartNames.RIGHT_WING, + CubeListBuilder.create().mirror().texOffs(0, 5).addBox(-7.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), + PartPose.offsetAndRotation(-1.5f, -6.5f, 0.5f, 0.0f, 0.0f, 0.3927f) + ); - bb_main.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(0, 5).addBox(-2.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), PartPose.offsetAndRotation(1.5f, -6.5f, 0.5f, 0.0f, 0.0f, -0.3927f)); + bb_main.addOrReplaceChild( + PartNames.LEFT_WING, + CubeListBuilder.create().texOffs(0, 5).addBox(-2.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), + PartPose.offsetAndRotation(1.5f, -6.5f, 0.5f, 0.0f, 0.0f, -0.3927f) + ); - bb_main.addOrReplaceChild("abdomen_r1", CubeListBuilder.create().texOffs(0, 10).addBox(-3.0f, -4.0f, -1.0f, 4.0f, 4.0f, 7.0f), PartPose.offsetAndRotation(1.0f, -3.9f, 0.0f, -0.3927f, 0.0f, 0.0f)); + bb_main.addOrReplaceChild( + "abdomen_r1", + CubeListBuilder.create().texOffs(0, 10).addBox(-3.0f, -4.0f, -1.0f, 4.0f, 4.0f, 7.0f), + PartPose.offsetAndRotation(1.0f, -3.9f, 0.0f, -0.3927f, 0.0f, 0.0f) + ); return LayerDefinition.create(modelData, 64, 64); } diff --git a/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java b/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java index 33ccebc1..334e85a1 100644 --- a/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java +++ b/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java @@ -29,7 +29,16 @@ public class RendererEntityCubozoa extends MobRenderer model = livingEntity.getSlimeType() == 1 ? modelLake : modelOrdinal; this.getParentModel().copyPropertiesTo(model); model.prepareMobModel(livingEntity, f, g, h); model.setupAnim(livingEntity, f, g, j, k, l); - VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityTranslucent(this.getTextureLocation(livingEntity))); - model.renderToBuffer(matrixStack, vertexConsumer, i, LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F), 1.0F, 1.0F, 1.0F, 1.0F); + VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityTranslucent(this.getTextureLocation( + livingEntity))); + model.renderToBuffer( + matrixStack, + vertexConsumer, + i, + LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F), + 1.0F, + 1.0F, + 1.0F, + 1.0F + ); } } } diff --git a/src/main/java/ru/betterend/events/ItemTooltipCallback.java b/src/main/java/ru/betterend/events/ItemTooltipCallback.java index e6ea2ccd..b2d36fb7 100644 --- a/src/main/java/ru/betterend/events/ItemTooltipCallback.java +++ b/src/main/java/ru/betterend/events/ItemTooltipCallback.java @@ -16,11 +16,14 @@ public interface ItemTooltipCallback { /** * Fired after the game has appended all base tooltip lines to the list. */ - Event EVENT = EventFactory.createArrayBacked(ItemTooltipCallback.class, callbacks -> (player, stack, context, lines) -> { - for (ItemTooltipCallback callback : callbacks) { - callback.getTooltip(player, stack, context, lines); + Event EVENT = EventFactory.createArrayBacked( + ItemTooltipCallback.class, + callbacks -> (player, stack, context, lines) -> { + for (ItemTooltipCallback callback : callbacks) { + callback.getTooltip(player, stack, context, lines); + } } - }); + ); /** * Called when an item stack's tooltip is rendered. Text added to {@code lines} will be diff --git a/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java b/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java index b1ddcedd..573ac70b 100644 --- a/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java +++ b/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java @@ -7,11 +7,14 @@ import net.minecraft.server.level.ServerPlayer; public interface PlayerAdvancementsCallback { - Event PLAYER_ADVANCEMENT_COMPLETE = EventFactory.createArrayBacked(PlayerAdvancementsCallback.class, callbacks -> (player, advancement, criterionName) -> { - for (PlayerAdvancementsCallback event : callbacks) { - event.onAdvancementComplete(player, advancement, criterionName); + Event PLAYER_ADVANCEMENT_COMPLETE = EventFactory.createArrayBacked( + PlayerAdvancementsCallback.class, + callbacks -> (player, advancement, criterionName) -> { + for (PlayerAdvancementsCallback event : callbacks) { + event.onAdvancementComplete(player, advancement, criterionName); + } } - }); + ); void onAdvancementComplete(ServerPlayer player, Advancement advancement, String criterionName); } diff --git a/src/main/java/ru/betterend/integration/Integrations.java b/src/main/java/ru/betterend/integration/Integrations.java index 5317b1c4..a92aafcd 100644 --- a/src/main/java/ru/betterend/integration/Integrations.java +++ b/src/main/java/ru/betterend/integration/Integrations.java @@ -32,7 +32,13 @@ public class Integrations { } }); - GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK).checkConfig(Configs.RECIPE_CONFIG).setShape("D", "B", "C").addMaterial('D', EndItems.ENDER_DUST).addMaterial('B', Items.BOOK).addMaterial('C', EndItems.CRYSTAL_SHARDS).build(); + GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("D", "B", "C") + .addMaterial('D', EndItems.ENDER_DUST) + .addMaterial('B', Items.BOOK) + .addMaterial('C', EndItems.CRYSTAL_SHARDS) + .build(); } hasHydrogen = FabricLoader.getInstance().isModLoaded("hydrogen"); } diff --git a/src/main/java/ru/betterend/integration/NourishIntegration.java b/src/main/java/ru/betterend/integration/NourishIntegration.java index fc33a470..32696023 100644 --- a/src/main/java/ru/betterend/integration/NourishIntegration.java +++ b/src/main/java/ru/betterend/integration/NourishIntegration.java @@ -19,8 +19,33 @@ public class NourishIntegration extends ModIntegration { Tag.Named sweets = getItemTag("sweets"); TagHelper.addTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED); - TagHelper.addTag(fruit, EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED, EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY, EndItems.BLOSSOM_BERRY_JELLY, EndItems.AMBER_ROOT_RAW, EndItems.CHORUS_MUSHROOM_RAW, EndItems.CHORUS_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED); - TagHelper.addTag(protein, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED, EndItems.CHORUS_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED, EndItems.CAVE_PUMPKIN_PIE); - TagHelper.addTag(sweets, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY, EndItems.BLOSSOM_BERRY_JELLY, EndItems.CAVE_PUMPKIN_PIE); + TagHelper.addTag( + fruit, + EndItems.SHADOW_BERRY_RAW, + EndItems.SHADOW_BERRY_COOKED, + EndItems.BLOSSOM_BERRY, + EndItems.SHADOW_BERRY_JELLY, + EndItems.SWEET_BERRY_JELLY, + EndItems.BLOSSOM_BERRY_JELLY, + EndItems.AMBER_ROOT_RAW, + EndItems.CHORUS_MUSHROOM_RAW, + EndItems.CHORUS_MUSHROOM_COOKED, + EndItems.BOLUX_MUSHROOM_COOKED + ); + TagHelper.addTag( + protein, + EndItems.END_FISH_RAW, + EndItems.END_FISH_COOKED, + EndItems.CHORUS_MUSHROOM_COOKED, + EndItems.BOLUX_MUSHROOM_COOKED, + EndItems.CAVE_PUMPKIN_PIE + ); + TagHelper.addTag( + sweets, + EndItems.SHADOW_BERRY_JELLY, + EndItems.SWEET_BERRY_JELLY, + EndItems.BLOSSOM_BERRY_JELLY, + EndItems.CAVE_PUMPKIN_PIE + ); } } diff --git a/src/main/java/ru/betterend/integration/byg/BYGIntegration.java b/src/main/java/ru/betterend/integration/byg/BYGIntegration.java index e550639b..ce41d687 100644 --- a/src/main/java/ru/betterend/integration/byg/BYGIntegration.java +++ b/src/main/java/ru/betterend/integration/byg/BYGIntegration.java @@ -62,7 +62,11 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio EndBiomes.LAND_BIOMES.removeMutableBiome(biomeID); EndBiomes.VOID_BIOMES.addBiomeMutable(endBiome); } - ShufflingList subBiomes = this.getAndExecuteRuntime(biomeClass, obj, "getHills"); + ShufflingList subBiomes = this.getAndExecuteRuntime( + biomeClass, + obj, + "getHills" + ); if (subBiomes != null) { subBiomes.stream().collect(Collectors.toList()).forEach((id) -> { BCLBiome subBiome = BiomeAPI.getBiome(id); diff --git a/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java b/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java index 2b677885..249b3501 100644 --- a/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java +++ b/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java @@ -26,7 +26,23 @@ public class NightshadeRedwoods extends EndBiome { Biome biome = Integrations.BYG.getBiome("nightshade_forest"); BiomeSpecialEffects effects = biome.getSpecialEffects(); - BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47).setFogDensity(1.5F).setWaterAndFogColor(55, 70, 186).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(biome.getGenerationSettings().getSurfaceBuilder().get()).setGrassColor(48, 13, 89).setPlantsColor(200, 125, 9).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE).addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD).addFeature(BYGFeatures.NIGHTSHADE_MOSS); + BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47) + .setFogDensity(1.5F) + .setWaterAndFogColor(55, 70, 186) + .setFoliageColor(122, 17, 155) + .setParticles( + ParticleTypes.REVERSE_PORTAL, + 0.002F + ) + .setSurface(biome.getGenerationSettings() + .getSurfaceBuilder() + .get()) + .setGrassColor(48, 13, 89) + .setPlantsColor(200, 125, 9) + .addFeature(EndFeatures.END_LAKE_RARE) + .addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE) + .addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD) + .addFeature(BYGFeatures.NIGHTSHADE_MOSS); if (BCLib.isClient()) { SoundEvent loop = effects.getAmbientLoopSoundEvent().get(); diff --git a/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java b/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java index 03e5bfcd..d33d0bfb 100644 --- a/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java +++ b/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java @@ -44,7 +44,17 @@ public class OldBulbisGardens extends EndBiome { Block ivis = Integrations.BYG.getBlock("ivis_phylium"); Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock(); - BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207).setFogDensity(1.8F).setWaterAndFogColor(40, 0, 56).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(ivis, origin).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.OLD_BULBIS_TREE); + BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207) + .setFogDensity(1.8F) + .setWaterAndFogColor(40, 0, 56) + .setFoliageColor(122, 17, 155) + .setParticles( + ParticleTypes.REVERSE_PORTAL, + 0.002F + ) + .setSurface(ivis, origin) + .addFeature(EndFeatures.END_LAKE_RARE) + .addFeature(BYGFeatures.OLD_BULBIS_TREE); if (BCLib.isClient()) { SoundEvent loop = effects.getAmbientLoopSoundEvent().get(); @@ -71,7 +81,11 @@ public class OldBulbisGardens extends EndBiome { getter = vegetal.get(i); ConfiguredFeature feature = getter.get(); ResourceLocation id = BetterEnd.makeID("obg_feature_" + i); - feature = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1)); + feature = Registry.register( + BuiltinRegistries.CONFIGURED_FEATURE, + id, + feature.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1) + ); def.addFeature(Decoration.VEGETAL_DECORATION, feature); } // Grasses and other features @@ -82,7 +96,11 @@ public class OldBulbisGardens extends EndBiome { } } - def.addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(BYGFeatures.IVIS_MOSS_WOOD).addFeature(BYGFeatures.IVIS_MOSS).addFeature(BYGFeatures.IVIS_VINE).addFeature(BYGFeatures.IVIS_SPROUT); + def.addFeature(EndFeatures.PURPLE_POLYPORE) + .addFeature(BYGFeatures.IVIS_MOSS_WOOD) + .addFeature(BYGFeatures.IVIS_MOSS) + .addFeature(BYGFeatures.IVIS_VINE) + .addFeature(BYGFeatures.IVIS_SPROUT); return def; } diff --git a/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java b/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java index 105c8c22..20cd4e86 100644 --- a/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java +++ b/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java @@ -12,15 +12,47 @@ import ru.betterend.world.features.WallPlantFeature; import ru.betterend.world.features.WallPlantOnLogFeature; public class BYGFeatures { - public static final BCLFeature OLD_BULBIS_TREE = redisterVegetation("old_bulbis_tree", new OldBulbisTreeFeature(), 1); - public static final BCLFeature IVIS_SPROUT = redisterVegetation("ivis_sprout", new SinglePlantFeature(Integrations.BYG.getBlock("ivis_sprout"), 6, 2), 6); - public static final BCLFeature IVIS_VINE = redisterVegetation("ivis_vine", new VineFeature(BYGBlocks.IVIS_VINE, 24), 5); - public static final BCLFeature IVIS_MOSS = redisterVegetation("ivis_moss", new WallPlantFeature(BYGBlocks.IVIS_MOSS, 6), 1); - public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation("ivis_moss_wood", new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6), 15); - public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation("nightshade_moss", new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 2); - public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation("nightshade_moss_wood", new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 8); + public static final BCLFeature OLD_BULBIS_TREE = redisterVegetation( + "old_bulbis_tree", + new OldBulbisTreeFeature(), + 1 + ); + public static final BCLFeature IVIS_SPROUT = redisterVegetation( + "ivis_sprout", + new SinglePlantFeature(Integrations.BYG.getBlock("ivis_sprout"), 6, 2), + 6 + ); + public static final BCLFeature IVIS_VINE = redisterVegetation( + "ivis_vine", + new VineFeature(BYGBlocks.IVIS_VINE, 24), + 5 + ); + public static final BCLFeature IVIS_MOSS = redisterVegetation( + "ivis_moss", + new WallPlantFeature(BYGBlocks.IVIS_MOSS, 6), + 1 + ); + public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation( + "ivis_moss_wood", + new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6), + 15 + ); + public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation( + "nightshade_moss", + new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), + 2 + ); + public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation( + "nightshade_moss_wood", + new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), + 8 + ); - public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation("nightshade_redwood_tree", new NightshadeRedwoodTreeFeature(), 1); + public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation( + "nightshade_redwood_tree", + new NightshadeRedwoodTreeFeature(), + 1 + ); public static final BCLFeature BIG_ETHER_TREE = redisterVegetation("big_ether_tree", new BigEtherTreeFeature(), 1); public static void register() { diff --git a/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java index 5ef738cc..d93e5e6d 100644 --- a/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java @@ -32,7 +32,8 @@ public class BigEtherTreeFeature extends DefaultFeature { return log; }; Function replace = (state) -> { - return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable(); + return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() + .isReplaceable(); }; int height = MHelper.randRange(40, 60, random); @@ -62,7 +63,8 @@ public class BigEtherTreeFeature extends DefaultFeature { } sdf.setReplaceFunction((state) -> { - return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable(); + return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() + .isReplaceable(); }).addPostProcess((info) -> { if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) { return wood; diff --git a/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java index a05dd86e..ff8bdac7 100644 --- a/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java @@ -49,7 +49,8 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { return log; }; Function replace = (state) -> { - return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable(); + return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() + .isReplaceable(); }; Function post = (info) -> { if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) { @@ -90,7 +91,10 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { SDF sdf = SplineHelper.buildSDF(trunk, 2.3F, 0.8F, splinePlacer); SDF roots = new SDFSphere().setRadius(2F).setBlock(log); - roots = new SDFFlatWave().setIntensity(2F).setRaysCount(MHelper.randRange(5, 7, random)).setAngle(random.nextFloat() * MHelper.PI2).setSource(roots); + roots = new SDFFlatWave().setIntensity(2F) + .setRaysCount(MHelper.randRange(5, 7, random)) + .setAngle(random.nextFloat() * MHelper.PI2) + .setSource(roots); sdf = new SDFSmoothUnion().setRadius(2F).setSourceA(sdf).setSourceB(roots); sdf.setReplaceFunction(replace).addPostProcess(post).fillRecursive(world, pos); Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F); @@ -175,12 +179,20 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { canopy = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-3F, 3F, random); }).setSource(canopy); - canopy.addPostProcess(leavesPost1).addPostProcess(leavesPost2).fillRecursiveIgnore(world, pos.offset(0, height * 0.75, 0), ignore); + canopy.addPostProcess(leavesPost1) + .addPostProcess(leavesPost2) + .fillRecursiveIgnore(world, pos.offset(0, height * 0.75, 0), ignore); return true; } static { - BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.25F, 0.1F, 0), new Vector3f(0.40F, 0.2F, 0), new Vector3f(0.50F, 0.4F, 0), new Vector3f(0.55F, 0.6F, 0)); + BRANCH = Lists.newArrayList( + new Vector3f(0, 0, 0), + new Vector3f(0.25F, 0.1F, 0), + new Vector3f(0.40F, 0.2F, 0), + new Vector3f(0.50F, 0.4F, 0), + new Vector3f(0.55F, 0.6F, 0) + ); } } diff --git a/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java index 2c708bdb..b05f150c 100644 --- a/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java @@ -48,7 +48,8 @@ public class OldBulbisTreeFeature extends DefaultFeature { BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight"); Function replacement = (state) -> { - if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) { + if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND) || state.getMaterial() + .equals(Material.PLANT)) { return true; } return state.getMaterial().isReplaceable(); @@ -87,7 +88,8 @@ public class OldBulbisTreeFeature extends DefaultFeature { } sdf.setReplaceFunction(replacement).addPostProcess((info) -> { - if (info.getState().equals(stem) && (!info.getStateUp().equals(stem) || !info.getStateDown().equals(stem))) { + if (info.getState().equals(stem) && (!info.getStateUp().equals(stem) || !info.getStateDown() + .equals(stem))) { return wood; } return info.getState(); @@ -160,13 +162,38 @@ public class OldBulbisTreeFeature extends DefaultFeature { } static { - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); + SPLINE = Lists.newArrayList( + new Vector3f(0.00F, 0.00F, 0.00F), + new Vector3f(0.10F, 0.35F, 0.00F), + new Vector3f(0.20F, 0.50F, 0.00F), + new Vector3f(0.30F, 0.55F, 0.00F), + new Vector3f(0.42F, 0.70F, 0.00F), + new Vector3f(0.50F, 1.00F, 0.00F) + ); - ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + ROOT = Lists.newArrayList( + new Vector3f(0F, 1F, 0), + new Vector3f(0.1F, 0.70F, 0), + new Vector3f(0.3F, 0.30F, 0), + new Vector3f(0.7F, 0.05F, 0), + new Vector3f(0.8F, -0.20F, 0) + ); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); - LEAF = Lists.newArrayList(new Vector3f(0.00F, 0.0F, 0), new Vector3f(0.10F, 0.4F, 0), new Vector3f(0.40F, 0.8F, 0), new Vector3f(0.75F, 0.9F, 0), new Vector3f(1.00F, 0.8F, 0)); + LEAF = Lists.newArrayList( + new Vector3f(0.00F, 0.0F, 0), + new Vector3f(0.10F, 0.4F, 0), + new Vector3f(0.40F, 0.8F, 0), + new Vector3f(0.75F, 0.9F, 0), + new Vector3f(1.00F, 0.8F, 0) + ); - SIDE = Lists.newArrayList(new Vector3f(0, -0.3F, -0.5F), new Vector3f(0, -0.1F, -0.3F), new Vector3f(0, 0.0F, 0.0F), new Vector3f(0, -0.1F, 0.3F), new Vector3f(0, -0.3F, 0.5F)); + SIDE = Lists.newArrayList( + new Vector3f(0, -0.3F, -0.5F), + new Vector3f(0, -0.1F, -0.3F), + new Vector3f(0, 0.0F, 0.0F), + new Vector3f(0, -0.1F, 0.3F), + new Vector3f(0, -0.3F, 0.5F) + ); } } diff --git a/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java b/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java index 84cc097b..14d2a1e7 100644 --- a/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java @@ -50,18 +50,35 @@ public class REIAlloyingCategory implements TransferDisplayCategory widgets = Lists.newArrayList(); widgets.add(Widgets.createRecipeBase(bounds)); widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9))); - widgets.add(Widgets.createBurningFire(new Point(startPoint.x - 9, startPoint.y + 20)).animationDurationMS(10000)); - widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + 5), new TranslatableComponent("category.rei.cooking.time&xp", df.format(display.getXp()), df.format(smeltTime / 20D))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB)); - widgets.add(Widgets.createArrow(new Point(startPoint.x + 24, startPoint.y + 8)).animationDurationTicks(smeltTime)); + widgets.add(Widgets.createBurningFire(new Point(startPoint.x - 9, startPoint.y + 20)) + .animationDurationMS(10000)); + widgets.add(Widgets.createLabel( + new Point(bounds.x + bounds.width - 5, bounds.y + 5), + new TranslatableComponent("category.rei.cooking.time&xp", + df.format(display.getXp()), + df.format(smeltTime / 20D) + ) + ).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB)); + widgets.add(Widgets.createArrow(new Point(startPoint.x + 24, startPoint.y + 8)) + .animationDurationTicks(smeltTime)); List inputEntries = display.getInputEntries(); - widgets.add(Widgets.createSlot(new Point(startPoint.x - 20, startPoint.y + 1)).entries(inputEntries.get(0)).markInput()); + widgets.add(Widgets.createSlot(new Point(startPoint.x - 20, startPoint.y + 1)) + .entries(inputEntries.get(0)) + .markInput()); if (inputEntries.size() > 1) { - widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entries(inputEntries.get(1)).markInput()); + widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)) + .entries(inputEntries.get(1)) + .markInput()); } else { - widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entries(Lists.newArrayList()).markInput()); + widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)) + .entries(Lists.newArrayList()) + .markInput()); } - widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)).entries(display.getOutputEntries().get(0)).disableBackground().markOutput()); + widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)) + .entries(display.getOutputEntries().get(0)) + .disableBackground() + .markOutput()); return widgets; } @@ -71,8 +88,22 @@ public class REIAlloyingCategory implements TransferDisplayCategory recipe, float xp, double smeltTime) { - super(EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))); + super( + EntryIngredients.ofIngredients(recipe.getIngredients()), + Collections.singletonList(EntryIngredients.of(recipe.getResultItem())) + ); this.recipe = recipe; this.xp = xp; this.smeltTime = smeltTime; @@ -88,6 +91,16 @@ public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDi // } static { - fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream().map(Item::getDefaultInstance).map(EntryStacks::of).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.smelting.fuel").withStyle(ChatFormatting.YELLOW)))).collect(Collectors.toList()); + fuel = EndStoneSmelterBlockEntity.availableFuels() + .keySet() + .stream() + .map(Item::getDefaultInstance) + .map(EntryStacks::of) + .map(e -> e.setting( + EntryStack.Settings.TOOLTIP_APPEND_EXTRA, + stack -> Collections.singletonList(new TranslatableComponent( + "category.rei.smelting.fuel").withStyle(ChatFormatting.YELLOW)) + )) + .collect(Collectors.toList()); } } diff --git a/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java b/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java index c1809eb7..673ab572 100644 --- a/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java @@ -52,18 +52,30 @@ public class REIAlloyingFuelCategory implements DisplayCategory widgets = Lists.newArrayList(); widgets.add(Widgets.createRecipeBase(bounds)); - widgets.add(Widgets.createLabel(new Point(bounds.x + 26, bounds.getMaxY() - 15), new TranslatableComponent("category.rei.fuel.time", burnTime)).color(0xFF404040, 0xFFBBBBBB).noShadow().leftAligned()); - widgets.add(Widgets.createBurningFire(new Point(bounds.x + 6, startPoint.y + 1)).animationDurationTicks(recipeDisplay.getFuelTime())); - widgets.add(Widgets.createSlot(new Point(bounds.x + 6, startPoint.y + 18)).entries(recipeDisplay.getInputEntries().get(0)).markInput()); + widgets.add(Widgets.createLabel( + new Point(bounds.x + 26, bounds.getMaxY() - 15), + new TranslatableComponent("category.rei.fuel.time", burnTime) + ).color(0xFF404040, 0xFFBBBBBB).noShadow().leftAligned()); + widgets.add(Widgets.createBurningFire(new Point(bounds.x + 6, startPoint.y + 1)) + .animationDurationTicks(recipeDisplay.getFuelTime())); + widgets.add(Widgets.createSlot(new Point(bounds.x + 6, startPoint.y + 18)) + .entries(recipeDisplay.getInputEntries().get(0)) + .markInput()); return widgets; } @Override public DisplayRenderer getDisplayRenderer(REIAlloyingFuelDisplay recipe) { - Slot slot = Widgets.createSlot(new Point(0, 0)).entries(recipe.getInputEntries().get(0)).disableBackground().disableHighlight(); + Slot slot = Widgets.createSlot(new Point(0, 0)) + .entries(recipe.getInputEntries().get(0)) + .disableBackground() + .disableHighlight(); String burnItems = DECIMAL_FORMAT.format(recipe.getFuelTime() / 200d); return new DisplayRenderer() { - private TranslatableComponent text = new TranslatableComponent("category.rei.fuel.time_short.items", burnItems); + private TranslatableComponent text = new TranslatableComponent( + "category.rei.fuel.time_short.items", + burnItems + ); @Override public int getHeight() { @@ -82,7 +94,13 @@ public class REIAlloyingFuelCategory implements DisplayCategory { if (entryStack.getValue() instanceof ItemStack itemStack) { itemStack.setCount(recipe.getInputCount()); diff --git a/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java b/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java index dce30a94..06a456a0 100644 --- a/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java @@ -62,16 +62,46 @@ public class REIInfusionCategory implements TransferDisplayCategory ALLOYING_FUEL = CategoryIdentifier.of(BetterEnd.MOD_ID, "alloying_fuel"); - public final static CategoryIdentifier ALLOYING = CategoryIdentifier.of(BetterEnd.MOD_ID, AlloyingRecipe.GROUP); - public final static CategoryIdentifier SMITHING = CategoryIdentifier.of(BetterEnd.MOD_ID, AnvilRecipe.ID.getPath()); - public final static CategoryIdentifier INFUSION = CategoryIdentifier.of(BetterEnd.MOD_ID, InfusionRecipe.GROUP); + public final static CategoryIdentifier ALLOYING_FUEL = CategoryIdentifier.of( + BetterEnd.MOD_ID, + "alloying_fuel" + ); + public final static CategoryIdentifier ALLOYING = CategoryIdentifier.of( + BetterEnd.MOD_ID, + AlloyingRecipe.GROUP + ); + public final static CategoryIdentifier SMITHING = CategoryIdentifier.of( + BetterEnd.MOD_ID, + AnvilRecipe.ID.getPath() + ); + public final static CategoryIdentifier INFUSION = CategoryIdentifier.of( + BetterEnd.MOD_ID, + InfusionRecipe.GROUP + ); @Override public void registerDisplays(DisplayRegistry registry) { @@ -57,13 +67,24 @@ public class REIPlugin implements REIClientPlugin { public void registerCategories(CategoryRegistry registry) { EntryStack endStoneSmelter = EntryStacks.of(EndBlocks.END_STONE_SMELTER); EntryStack infusionRitual = EntryStacks.of(EndBlocks.INFUSION_PEDESTAL); - List> anvils = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream().filter(EndAnvilBlock.class::isInstance).collect(Collectors.toList()))); + List> anvils = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks() + .stream() + .filter(EndAnvilBlock.class::isInstance) + .collect(Collectors.toList()))); anvils.add(0, EntryStacks.of(Blocks.ANVIL)); - List> furnaces = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream().filter(BaseFurnaceBlock.class::isInstance).collect(Collectors.toList()))); + List> furnaces = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks() + .stream() + .filter(BaseFurnaceBlock.class::isInstance) + .collect(Collectors.toList()))); EntryStack[] anvilsArray = anvils.toArray(new EntryStack[0]); EntryStack[] furnacesArray = furnaces.toArray(new EntryStack[0]); - - registry.add(new REIAlloyingFuelCategory(), new REIAlloyingCategory(endStoneSmelter), new REIInfusionCategory(infusionRitual), new REIAnvilCategory(anvilsArray)); + + registry.add( + new REIAlloyingFuelCategory(), + new REIAlloyingCategory(endStoneSmelter), + new REIInfusionCategory(infusionRitual), + new REIAnvilCategory(anvilsArray) + ); registry.addWorkstations(ALLOYING_FUEL, endStoneSmelter); registry.addWorkstations(ALLOYING, endStoneSmelter); diff --git a/src/main/java/ru/betterend/item/ArmoredElytra.java b/src/main/java/ru/betterend/item/ArmoredElytra.java index 8a650154..8797b6fa 100644 --- a/src/main/java/ru/betterend/item/ArmoredElytra.java +++ b/src/main/java/ru/betterend/item/ArmoredElytra.java @@ -27,14 +27,37 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Fall private final int defense; public ArmoredElytra(String name, ArmorMaterial material, Item repairItem, int durability, double movementFactor, boolean fireproof) { - super(material, EquipmentSlot.CHEST, fireproof ? EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC).fireResistant() : EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC)); + super( + material, + EquipmentSlot.CHEST, + fireproof ? EndItems.makeEndItemSettings() + .durability(durability) + .rarity(Rarity.EPIC) + .fireResistant() : EndItems.makeEndItemSettings() + .durability(durability) + .rarity(Rarity.EPIC) + ); this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png"); this.repairItem = repairItem; this.movementFactor = movementFactor; this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75); this.toughness = material.getToughness() / 1.75F; - addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor modifier", defense, AttributeModifier.Operation.ADDITION)); - addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor toughness", toughness, AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + Attributes.ARMOR, + new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], + "Armor modifier", + defense, + AttributeModifier.Operation.ADDITION + ) + ); + addAttributeModifier( + Attributes.ARMOR_TOUGHNESS, + new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], + "Armor toughness", + toughness, + AttributeModifier.Operation.ADDITION + ) + ); } @Override @@ -66,6 +89,10 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Fall @Override @Environment(EnvType.CLIENT) public void registerModelPredicate() { - FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), (itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F); + FabricModelPredicateProviderRegistry.register( + this, + new ResourceLocation("broken"), + (itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F + ); } } diff --git a/src/main/java/ru/betterend/item/CrystaliteElytra.java b/src/main/java/ru/betterend/item/CrystaliteElytra.java index 869be56f..78a00940 100644 --- a/src/main/java/ru/betterend/item/CrystaliteElytra.java +++ b/src/main/java/ru/betterend/item/CrystaliteElytra.java @@ -28,8 +28,22 @@ public class CrystaliteElytra extends CrystaliteArmor implements MultiModelItem, this.movementFactor = movementFactor; this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75); this.toughness = material.getToughness() / 1.75F; - addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor modifier", defense, AttributeModifier.Operation.ADDITION)); - addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor toughness", toughness, AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + Attributes.ARMOR, + new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], + "Armor modifier", + defense, + AttributeModifier.Operation.ADDITION + ) + ); + addAttributeModifier( + Attributes.ARMOR_TOUGHNESS, + new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], + "Armor toughness", + toughness, + AttributeModifier.Operation.ADDITION + ) + ); } @Override @@ -60,6 +74,10 @@ public class CrystaliteElytra extends CrystaliteArmor implements MultiModelItem, @Override public void registerModelPredicate() { - FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), (itemStack, clientLevel, livingEntity, i) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F); + FabricModelPredicateProviderRegistry.register( + this, + new ResourceLocation("broken"), + (itemStack, clientLevel, livingEntity, i) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F + ); } } diff --git a/src/main/java/ru/betterend/item/CrystaliteHelmet.java b/src/main/java/ru/betterend/item/CrystaliteHelmet.java index c1341630..34ff61f6 100644 --- a/src/main/java/ru/betterend/item/CrystaliteHelmet.java +++ b/src/main/java/ru/betterend/item/CrystaliteHelmet.java @@ -13,6 +13,9 @@ public class CrystaliteHelmet extends CrystaliteArmor { public CrystaliteHelmet() { super(EquipmentSlot.HEAD, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.HEAD.getIndex()]; - addAttributeModifier(EndAttributes.BLINDNESS_RESISTANCE, new AttributeModifier(uuid, "Helmet blindness resistance", 1.0, AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + EndAttributes.BLINDNESS_RESISTANCE, + new AttributeModifier(uuid, "Helmet blindness resistance", 1.0, AttributeModifier.Operation.ADDITION) + ); } } diff --git a/src/main/java/ru/betterend/item/CrystaliteLeggings.java b/src/main/java/ru/betterend/item/CrystaliteLeggings.java index 26ca413b..d966f848 100644 --- a/src/main/java/ru/betterend/item/CrystaliteLeggings.java +++ b/src/main/java/ru/betterend/item/CrystaliteLeggings.java @@ -13,6 +13,9 @@ public class CrystaliteLeggings extends CrystaliteArmor { public CrystaliteLeggings() { super(EquipmentSlot.LEGS, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.LEGS.getIndex()]; - addAttributeModifier(Attributes.MAX_HEALTH, new AttributeModifier(uuid, "Armor health boost", 4.0, AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + Attributes.MAX_HEALTH, + new AttributeModifier(uuid, "Armor health boost", 4.0, AttributeModifier.Operation.ADDITION) + ); } } diff --git a/src/main/java/ru/betterend/item/EndAnvilItem.java b/src/main/java/ru/betterend/item/EndAnvilItem.java index 4e5161a9..adf00230 100644 --- a/src/main/java/ru/betterend/item/EndAnvilItem.java +++ b/src/main/java/ru/betterend/item/EndAnvilItem.java @@ -9,7 +9,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import ru.bclib.client.models.ItemModelProvider; +import ru.bclib.interfaces.ItemModelProvider; import ru.bclib.items.BaseAnvilItem; import ru.betterend.blocks.basis.EndAnvilBlock; import ru.betterend.registry.EndBlocks; diff --git a/src/main/java/ru/betterend/item/EndArmorItem.java b/src/main/java/ru/betterend/item/EndArmorItem.java index 437db9bb..ab8aa11b 100644 --- a/src/main/java/ru/betterend/item/EndArmorItem.java +++ b/src/main/java/ru/betterend/item/EndArmorItem.java @@ -8,13 +8,18 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorMaterial; -import ru.bclib.client.models.ItemModelProvider; +import ru.bclib.interfaces.ItemModelProvider; import java.util.UUID; public class EndArmorItem extends ArmorItem implements ItemModelProvider { - protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[]{UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")}; + protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[] { + UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), + UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), + UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), + UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150") + }; protected final Multimap defaultModifiers; @@ -22,10 +27,23 @@ public class EndArmorItem extends ArmorItem implements ItemModelProvider { super(material, equipmentSlot, settings); this.defaultModifiers = HashMultimap.create(); UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[equipmentSlot.getIndex()]; - addAttributeModifier(Attributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", getDefense(), AttributeModifier.Operation.ADDITION)); - addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(uuid, "Armor toughness", getToughness(), AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + Attributes.ARMOR, + new AttributeModifier(uuid, "Armor modifier", getDefense(), AttributeModifier.Operation.ADDITION) + ); + addAttributeModifier( + Attributes.ARMOR_TOUGHNESS, + new AttributeModifier(uuid, "Armor toughness", getToughness(), AttributeModifier.Operation.ADDITION) + ); if (knockbackResistance > 0.0F) { - addAttributeModifier(Attributes.KNOCKBACK_RESISTANCE, new AttributeModifier(uuid, "Armor knockback resistance", knockbackResistance, AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + Attributes.KNOCKBACK_RESISTANCE, + new AttributeModifier(uuid, + "Armor knockback resistance", + knockbackResistance, + AttributeModifier.Operation.ADDITION + ) + ); } } diff --git a/src/main/java/ru/betterend/item/EndBucketItem.java b/src/main/java/ru/betterend/item/EndBucketItem.java index 3886a75e..e328ed81 100644 --- a/src/main/java/ru/betterend/item/EndBucketItem.java +++ b/src/main/java/ru/betterend/item/EndBucketItem.java @@ -4,7 +4,7 @@ import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.MobBucketItem; import net.minecraft.world.level.material.Fluids; -import ru.bclib.client.models.ItemModelProvider; +import ru.bclib.interfaces.ItemModelProvider; import ru.betterend.registry.EndItems; public class EndBucketItem extends MobBucketItem implements ItemModelProvider { diff --git a/src/main/java/ru/betterend/item/GuideBookItem.java b/src/main/java/ru/betterend/item/GuideBookItem.java index ce192756..9769a664 100644 --- a/src/main/java/ru/betterend/item/GuideBookItem.java +++ b/src/main/java/ru/betterend/item/GuideBookItem.java @@ -41,6 +41,7 @@ public class GuideBookItem extends ModelProviderItem { @Override public void appendHoverText(ItemStack stack, Level world, List tooltip, TooltipFlag context) { - tooltip.add(LangUtil.getText("book.betterend", "subtitle").withStyle(ChatFormatting.DARK_PURPLE, ChatFormatting.ITALIC)); + tooltip.add(LangUtil.getText("book.betterend", "subtitle") + .withStyle(ChatFormatting.DARK_PURPLE, ChatFormatting.ITALIC)); } } diff --git a/src/main/java/ru/betterend/item/material/EndArmorMaterial.java b/src/main/java/ru/betterend/item/material/EndArmorMaterial.java index cb3b8615..09e2605d 100644 --- a/src/main/java/ru/betterend/item/material/EndArmorMaterial.java +++ b/src/main/java/ru/betterend/item/material/EndArmorMaterial.java @@ -14,17 +14,17 @@ import ru.betterend.registry.EndItems; import java.util.function.Supplier; public enum EndArmorMaterial implements ArmorMaterial { - THALLASIUM("thallasium", 17, new int[]{1, 4, 5, 2}, 12, SoundEvents.ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> { + THALLASIUM("thallasium", 17, new int[] {1, 4, 5, 2}, 12, SoundEvents.ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> { return Ingredient.of(EndBlocks.THALLASIUM.ingot); - }), TERMINITE("terminite", 26, new int[]{3, 6, 7, 3}, 14, SoundEvents.ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> { + }), TERMINITE("terminite", 26, new int[] {3, 6, 7, 3}, 14, SoundEvents.ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> { return Ingredient.of(EndBlocks.TERMINITE.ingot); - }), AETERNIUM("aeternium", 40, new int[]{4, 7, 9, 4}, 18, SoundEvents.ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> { + }), AETERNIUM("aeternium", 40, new int[] {4, 7, 9, 4}, 18, SoundEvents.ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> { return Ingredient.of(EndItems.AETERNIUM_INGOT); - }), CRYSTALITE("crystalite", 30, new int[]{3, 6, 8, 3}, 24, SoundEvents.ARMOR_EQUIP_DIAMOND, 1.2F, 0.1F, () -> { + }), CRYSTALITE("crystalite", 30, new int[] {3, 6, 8, 3}, 24, SoundEvents.ARMOR_EQUIP_DIAMOND, 1.2F, 0.1F, () -> { return Ingredient.of(EndBlocks.TERMINITE.ingot); }); - private static final int[] BASE_DURABILITY = new int[]{13, 15, 16, 11}; + private static final int[] BASE_DURABILITY = new int[] {13, 15, 16, 11}; private final String name; private final int durabilityMultiplier; private final int[] protectionAmounts; diff --git a/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java b/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java index 825d8dfa..2937ad9f 100644 --- a/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java +++ b/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java @@ -20,9 +20,17 @@ public class ArmoredElytraModel extends AgeableListModel public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - modelPartData.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(22, 0).addBox(-10.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.LEFT_WING, + CubeListBuilder.create().texOffs(22, 0).addBox(-10.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(22, 0).addBox(0.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.RIGHT_WING, + CubeListBuilder.create().mirror().texOffs(22, 0).addBox(0.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), + PartPose.ZERO + ); return LayerDefinition.create(modelData, 64, 32); } diff --git a/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java b/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java index 86069770..e38e846d 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java @@ -19,8 +19,10 @@ import shadow.fabric.api.client.rendering.v1.ArmorRenderingRegistry; @Environment(EnvType.CLIENT) public class CrystaliteArmorProvider implements ArmorRenderingRegistry.ModelProvider, ArmorRenderingRegistry.TextureProvider { //TODO: find new registry - private final static ResourceLocation FIRST_LAYER = new ResourceLocation("textures/models/armor/crystalite_layer_1.png"); - private final static ResourceLocation SECOND_LAYER = new ResourceLocation("textures/models/armor/crystalite_layer_2.png"); + private final static ResourceLocation FIRST_LAYER = new ResourceLocation( + "textures/models/armor/crystalite_layer_1.png"); + private final static ResourceLocation SECOND_LAYER = new ResourceLocation( + "textures/models/armor/crystalite_layer_2.png"); private final static CrystaliteHelmetModel HELMET_MODEL = CrystaliteHelmetModel.createModel(null); private final static CrystaliteChestplateModel CHEST_MODEL = CrystaliteChestplateModel.createRegularModel(null); private final static CrystaliteChestplateModel CHEST_MODEL_SLIM = CrystaliteChestplateModel.createThinModel(null); @@ -42,7 +44,8 @@ public class CrystaliteArmorProvider implements ArmorRenderingRegistry.ModelProv return HELMET_MODEL; } case CHEST: { - if (entity instanceof AbstractClientPlayer && ((AbstractClientPlayer) entity).getModelName().equals("slim")) { + if (entity instanceof AbstractClientPlayer && ((AbstractClientPlayer) entity).getModelName() + .equals("slim")) { CHEST_MODEL_SLIM.copyPropertiesTo(defaultModel); return CHEST_MODEL_SLIM; } @@ -63,7 +66,13 @@ public class CrystaliteArmorProvider implements ArmorRenderingRegistry.ModelProv } public Iterable getRenderedItems() { - return Lists.newArrayList(EndItems.CRYSTALITE_HELMET, EndItems.CRYSTALITE_CHESTPLATE, EndItems.CRYSTALITE_ELYTRA, EndItems.CRYSTALITE_LEGGINGS, EndItems.CRYSTALITE_BOOTS); + return Lists.newArrayList( + EndItems.CRYSTALITE_HELMET, + EndItems.CRYSTALITE_CHESTPLATE, + EndItems.CRYSTALITE_ELYTRA, + EndItems.CRYSTALITE_LEGGINGS, + EndItems.CRYSTALITE_BOOTS + ); } private boolean isStackValid(ItemStack stack) { diff --git a/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java b/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java index baeb7acf..4bb0b3c5 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java @@ -38,15 +38,24 @@ public class CrystaliteBootsModel extends HumanoidModel { modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); CubeDeformation deformation = new CubeDeformation(scale + 0.25f); - modelPartData.addOrReplaceChild("leftBoot", CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(1.9f, 12.0f, 0.0f)); + modelPartData.addOrReplaceChild( + "leftBoot", + CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(1.9f, 12.0f, 0.0f) + ); - modelPartData.addOrReplaceChild("rightBoot", CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-1.9f, 12.0f, 0.0f)); + modelPartData.addOrReplaceChild( + "rightBoot", + CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(-1.9f, 12.0f, 0.0f) + ); return LayerDefinition.create(modelData, 64, 48); } public static CrystaliteBootsModel createModel(EntityModelSet entityModelSet) { - return new CrystaliteBootsModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_BOOTS)); + return new CrystaliteBootsModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer( + EndEntitiesRenders.CRYSTALITE_BOOTS)); } public CrystaliteBootsModel(ModelPart modelPart) { diff --git a/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java b/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java index cc59cb92..8752cf20 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java @@ -49,19 +49,45 @@ public class CrystaliteChestplateModel extends HumanoidModel { modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); CubeDeformation deformation = new CubeDeformation(scale + 0.25F); - PartDefinition body = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), PartPose.ZERO); + PartDefinition body = modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), + PartPose.ZERO + ); if (thinArms) { deformation = new CubeDeformation(scale + 0.45F); - PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create().mirror().texOffs(40, 32).addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(5.0f, 2.0f, 0.0f)); + PartDefinition leftShoulder = modelPartData.addOrReplaceChild( + "leftShoulder", + CubeListBuilder.create() + .mirror() + .texOffs(40, 32) + .addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(5.0f, 2.0f, 0.0f) + ); - PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-5.0f, 2.0f, 10.0f)); + PartDefinition rightShoulder = modelPartData.addOrReplaceChild( + "rightShoulder", + CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(-5.0f, 2.0f, 10.0f) + ); } else { deformation = new CubeDeformation(scale + 0.45F); - PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create().mirror().texOffs(40, 32).addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(5.0f, 2.0f, 0.0f)); + PartDefinition leftShoulder = modelPartData.addOrReplaceChild( + "leftShoulder", + CubeListBuilder.create() + .mirror() + .texOffs(40, 32) + .addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(5.0f, 2.0f, 0.0f) + ); - PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-5.0f, 2.0f, 10.0f)); + PartDefinition rightShoulder = modelPartData.addOrReplaceChild( + "rightShoulder", + CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(-5.0f, 2.0f, 10.0f) + ); } return LayerDefinition.create(modelData, 64, 48); } @@ -69,11 +95,13 @@ public class CrystaliteChestplateModel extends HumanoidModel { final ModelPart localBody; public static CrystaliteChestplateModel createRegularModel(EntityModelSet entityModelSet) { - return new CrystaliteChestplateModel(entityModelSet == null ? getRegularTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_CHESTPLATE), false); + return new CrystaliteChestplateModel(entityModelSet == null ? getRegularTexturedModelData().bakeRoot() : entityModelSet + .bakeLayer(EndEntitiesRenders.CRYSTALITE_CHESTPLATE), false); } public static CrystaliteChestplateModel createThinModel(EntityModelSet entityModelSet) { - return new CrystaliteChestplateModel(entityModelSet == null ? getThinTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_CHESTPLATE_THIN), true); + return new CrystaliteChestplateModel(entityModelSet == null ? getThinTexturedModelData().bakeRoot() : entityModelSet + .bakeLayer(EndEntitiesRenders.CRYSTALITE_CHESTPLATE_THIN), true); } protected CrystaliteChestplateModel(ModelPart modelPart, boolean thinArms) { diff --git a/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java b/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java index 78da1ead..e70f6f4d 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java @@ -40,13 +40,18 @@ public class CrystaliteHelmetModel extends HumanoidModel { modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); CubeDeformation deformation_hat = new CubeDeformation(scale + 0.5f); - PartDefinition hat = modelPartData.addOrReplaceChild(PartNames.HAT, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -8.0f, -4.0f, 8.0f, 8.0f, 8.0f, deformation_hat), PartPose.ZERO); + PartDefinition hat = modelPartData.addOrReplaceChild( + PartNames.HAT, + CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -8.0f, -4.0f, 8.0f, 8.0f, 8.0f, deformation_hat), + PartPose.ZERO + ); return LayerDefinition.create(modelData, 64, 48); } public static CrystaliteHelmetModel createModel(EntityModelSet entityModelSet) { - return new CrystaliteHelmetModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_HELMET)); + return new CrystaliteHelmetModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer( + EndEntitiesRenders.CRYSTALITE_HELMET)); } diff --git a/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java b/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java index 42879aa7..233efabe 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java @@ -35,11 +35,23 @@ public class CrystaliteLeggingsModel extends HumanoidModel { // modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); CubeDeformation deformation = new CubeDeformation(scale); - modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), PartPose.ZERO); + modelPartData.addOrReplaceChild( + PartNames.BODY, + CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), + PartPose.ZERO + ); - modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(1.9f, 12.0f, 0.0f)); + modelPartData.addOrReplaceChild( + PartNames.LEFT_LEG, + CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(1.9f, 12.0f, 0.0f) + ); - modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-1.9f, 12.0f, 0.0f)); + modelPartData.addOrReplaceChild( + PartNames.RIGHT_LEG, + CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), + PartPose.offset(-1.9f, 12.0f, 0.0f) + ); return LayerDefinition.create(modelData, 64, 48); } @@ -49,7 +61,8 @@ public class CrystaliteLeggingsModel extends HumanoidModel { final ModelPart myRightLeg; public static CrystaliteLeggingsModel createModel(EntityModelSet entityModelSet) { - return new CrystaliteLeggingsModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_LEGGINGS)); + return new CrystaliteLeggingsModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer( + EndEntitiesRenders.CRYSTALITE_LEGGINGS)); } public CrystaliteLeggingsModel(ModelPart modelPart) { diff --git a/src/main/java/ru/betterend/item/tool/EndHammerItem.java b/src/main/java/ru/betterend/item/tool/EndHammerItem.java index 9aa9e42f..6501f211 100644 --- a/src/main/java/ru/betterend/item/tool/EndHammerItem.java +++ b/src/main/java/ru/betterend/item/tool/EndHammerItem.java @@ -28,8 +28,8 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Material; import ru.bclib.api.TagAPI; -import ru.bclib.client.models.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; +import ru.bclib.interfaces.ItemModelProvider; import java.util.UUID; @@ -43,15 +43,37 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I super(attackDamage, attackSpeed, material, BlockTags.MINEABLE_WITH_PICKAXE, settings); Builder builder = ImmutableMultimap.builder(); - builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Weapon modifier", attackDamage + material.getAttackDamageBonus(), AttributeModifier.Operation.ADDITION)); - builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Weapon modifier", attackSpeed, AttributeModifier.Operation.ADDITION)); - builder.put(Attributes.ATTACK_KNOCKBACK, new AttributeModifier(ATTACK_KNOCKBACK_MODIFIER_ID, "Weapon modifier", knockback, AttributeModifier.Operation.ADDITION)); + builder.put( + Attributes.ATTACK_DAMAGE, + new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, + "Weapon modifier", + attackDamage + material.getAttackDamageBonus(), + AttributeModifier.Operation.ADDITION + ) + ); + builder.put( + Attributes.ATTACK_SPEED, + new AttributeModifier(BASE_ATTACK_SPEED_UUID, + "Weapon modifier", + attackSpeed, + AttributeModifier.Operation.ADDITION + ) + ); + builder.put( + Attributes.ATTACK_KNOCKBACK, + new AttributeModifier(ATTACK_KNOCKBACK_MODIFIER_ID, + "Weapon modifier", + knockback, + AttributeModifier.Operation.ADDITION + ) + ); this.attributeModifiers = builder.build(); } @Override public boolean canAttackBlock(BlockState state, Level world, BlockPos pos, Player miner) { - return state.getMaterial().equals(Material.STONE) || state.getMaterial().equals(Material.GLASS) || state.is(Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state.is(Blocks.REDSTONE_BLOCK); + return state.getMaterial().equals(Material.STONE) || state.getMaterial().equals(Material.GLASS) || state.is( + Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state.is(Blocks.REDSTONE_BLOCK); } @Override @@ -77,7 +99,8 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I } if (isCorrectToolForDrops(state)) { float mult; - if (state.is(Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state.is(Blocks.REDSTONE_BLOCK)) { + if (state.is(Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state + .is(Blocks.REDSTONE_BLOCK)) { mult = this.getTier().getSpeed(); } else { @@ -109,17 +132,20 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I if (state.getMaterial().equals(Material.GLASS)) { return true; } - if (!state.is(Blocks.REDSTONE_BLOCK) && !state.is(Blocks.DIAMOND_BLOCK) && !state.is(Blocks.EMERALD_BLOCK) && !state.is(Blocks.LAPIS_BLOCK) && !state.getMaterial().equals(Material.STONE)) { + if (!state.is(Blocks.REDSTONE_BLOCK) && !state.is(Blocks.DIAMOND_BLOCK) && !state.is(Blocks.EMERALD_BLOCK) && !state + .is(Blocks.LAPIS_BLOCK) && !state.getMaterial().equals(Material.STONE)) { return false; } int level = this.getTier().getLevel(); if (state.is(Blocks.IRON_ORE) || state.is(Blocks.LAPIS_BLOCK) || state.is(Blocks.LAPIS_ORE)) { return level >= 1; } - if (state.is(Blocks.DIAMOND_BLOCK) && !state.is(Blocks.DIAMOND_ORE) || state.is(Blocks.EMERALD_ORE) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.GOLD_ORE) || state.is(Blocks.REDSTONE_ORE)) { + if (state.is(Blocks.DIAMOND_BLOCK) && !state.is(Blocks.DIAMOND_ORE) || state.is(Blocks.EMERALD_ORE) || state.is( + Blocks.EMERALD_BLOCK) || state.is(Blocks.GOLD_ORE) || state.is(Blocks.REDSTONE_ORE)) { return level >= 2; } - if (state.is(Blocks.OBSIDIAN) || state.is(Blocks.CRYING_OBSIDIAN) || state.is(Blocks.RESPAWN_ANCHOR) || state.is(Blocks.ANCIENT_DEBRIS)) { + if (state.is(Blocks.OBSIDIAN) || state.is(Blocks.CRYING_OBSIDIAN) || state.is(Blocks.RESPAWN_ANCHOR) || state.is( + Blocks.ANCIENT_DEBRIS)) { return level >= 3; } return true; diff --git a/src/main/java/ru/betterend/mixin/client/ItemStackMixin.java b/src/main/java/ru/betterend/mixin/client/ItemStackMixin.java index dd0ffad9..e9136846 100644 --- a/src/main/java/ru/betterend/mixin/client/ItemStackMixin.java +++ b/src/main/java/ru/betterend/mixin/client/ItemStackMixin.java @@ -16,6 +16,7 @@ import java.util.List; public class ItemStackMixin { @Inject(method = "getTooltipLines", at = @At("RETURN")) private void be_getTooltip(Player entity, TooltipFlag tooltipContext, CallbackInfoReturnable> info) { - ItemTooltipCallback.EVENT.invoker().getTooltip(entity, ItemStack.class.cast(this), tooltipContext, info.getReturnValue()); + ItemTooltipCallback.EVENT.invoker() + .getTooltip(entity, ItemStack.class.cast(this), tooltipContext, info.getReturnValue()); } } diff --git a/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java b/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java index e960b54d..454e17de 100644 --- a/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java +++ b/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java @@ -11,7 +11,6 @@ import com.mojang.blaze3d.vertex.VertexFormat; import com.mojang.math.Matrix4f; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; -import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.renderer.DimensionSpecialEffects; @@ -21,7 +20,6 @@ import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.client.renderer.RenderBuffers; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.resources.ResourceLocation; -import org.lwjgl.opengl.GL11; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -101,7 +99,10 @@ public class LevelRendererMixin { FogRenderer.levelFogColor(); RenderSystem.enableTexture(); RenderSystem.enableBlend(); - RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + RenderSystem.blendFunc( + GlStateManager.SourceFactor.SRC_ALPHA, + GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA + ); float blindA = 1F - BackgroundInfo.blindness; blind02 = blindA * 0.2F; @@ -111,26 +112,62 @@ public class LevelRendererMixin { matrices.pushPose(); matrices.mulPose(new Quaternion(0, time, 0, false)); RenderSystem.setShaderTexture(0, HORIZON); - be_renderBuffer(matrices, matrix4f, horizon, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, 0.7F * blindA); + be_renderBuffer( + matrices, + matrix4f, + horizon, + DefaultVertexFormat.POSITION_TEX, + 0.77F, + 0.31F, + 0.73F, + 0.7F * blindA + ); matrices.popPose(); matrices.pushPose(); matrices.mulPose(new Quaternion(0, -time, 0, false)); RenderSystem.setShaderTexture(0, NEBULA_1); - be_renderBuffer(matrices, matrix4f, nebulas1, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, blind02); + be_renderBuffer( + matrices, + matrix4f, + nebulas1, + DefaultVertexFormat.POSITION_TEX, + 0.77F, + 0.31F, + 0.73F, + blind02 + ); matrices.popPose(); matrices.pushPose(); matrices.mulPose(new Quaternion(0, time2, 0, false)); RenderSystem.setShaderTexture(0, NEBULA_2); - be_renderBuffer(matrices, matrix4f, nebulas2, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, blind02); + be_renderBuffer( + matrices, + matrix4f, + nebulas2, + DefaultVertexFormat.POSITION_TEX, + 0.77F, + 0.31F, + 0.73F, + blind02 + ); matrices.popPose(); RenderSystem.setShaderTexture(0, STARS); matrices.pushPose(); matrices.mulPose(axis3.rotation(time)); - be_renderBuffer(matrices, matrix4f, stars3, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, blind06); + be_renderBuffer( + matrices, + matrix4f, + stars3, + DefaultVertexFormat.POSITION_TEX, + 0.77F, + 0.31F, + 0.73F, + blind06 + ); matrices.popPose(); matrices.pushPose(); @@ -143,7 +180,16 @@ public class LevelRendererMixin { if (a > 0) { if (a > 1) a = 1; RenderSystem.setShaderTexture(0, FOG); - be_renderBuffer(matrices, matrix4f, fog, DefaultVertexFormat.POSITION_TEX, BackgroundInfo.fogColorRed, BackgroundInfo.fogColorGreen, BackgroundInfo.fogColorBlue, a); + be_renderBuffer( + matrices, + matrix4f, + fog, + DefaultVertexFormat.POSITION_TEX, + BackgroundInfo.fogColorRed, + BackgroundInfo.fogColorGreen, + BackgroundInfo.fogColorBlue, + a + ); } RenderSystem.disableTexture(); diff --git a/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java b/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java index 1280cee3..231ebcc1 100644 --- a/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java +++ b/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java @@ -33,7 +33,10 @@ public abstract class LocalPlayerMixin extends AbstractClientPlayer { public void be_aiStep(CallbackInfo info) { ItemStack itemStack = getItemBySlot(EquipmentSlot.CHEST); if (itemStack.getItem() instanceof FallFlyingItem && ElytraItem.isFlyEnabled(itemStack) && tryToStartFallFlying()) { - connection.send(new ServerboundPlayerCommandPacket(LocalPlayer.class.cast(this), ServerboundPlayerCommandPacket.Action.START_FALL_FLYING)); + connection.send(new ServerboundPlayerCommandPacket( + LocalPlayer.class.cast(this), + ServerboundPlayerCommandPacket.Action.START_FALL_FLYING + )); } } } diff --git a/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java b/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java index 00eb4fa3..d3bef0e1 100644 --- a/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java +++ b/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java @@ -36,11 +36,17 @@ public class MinecraftClientMixin { private void be_getEndMusic(CallbackInfoReturnable info) { if (!(this.screen instanceof WinScreen) && this.player != null) { if (this.player.level.dimension() == Level.END) { - if (this.gui.getBossOverlay().shouldPlayMusic() && MHelper.lengthSqr(this.player.getX(), this.player.getZ()) < 250000) { + if (this.gui.getBossOverlay().shouldPlayMusic() && MHelper.lengthSqr( + this.player.getX(), + this.player.getZ() + ) < 250000) { info.setReturnValue(Musics.END_BOSS); } else { - Music sound = this.level.getBiomeManager().getNoiseBiomeAtPosition(this.player.blockPosition()).getBackgroundMusic().orElse(Musics.END); + Music sound = this.level.getBiomeManager() + .getNoiseBiomeAtPosition(this.player.blockPosition()) + .getBackgroundMusic() + .orElse(Musics.END); info.setReturnValue(sound); } info.cancel(); diff --git a/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java b/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java index 19b6d60f..04c66042 100644 --- a/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java +++ b/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java @@ -12,7 +12,11 @@ public abstract class ModelLoaderMixin { @ModifyVariable(method = "loadModel", ordinal = 2, at = @At(value = "INVOKE")) public ResourceLocation be_switchModel(ResourceLocation id) { - if (GeneratorOptions.changeChorusPlant() && id.getNamespace().equals("minecraft") && id.getPath().startsWith("blockstates/") && id.getPath().contains("chorus") && !id.getPath().contains("custom_")) { + if (GeneratorOptions.changeChorusPlant() && id.getNamespace().equals("minecraft") && id.getPath() + .startsWith( + "blockstates/") && id + .getPath() + .contains("chorus") && !id.getPath().contains("custom_")) { id = new ResourceLocation(id.getPath().replace("chorus", "custom_chorus")); } return id; diff --git a/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java b/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java index 99221b68..5a53ce31 100644 --- a/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java +++ b/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java @@ -1,13 +1,11 @@ package ru.betterend.mixin.client; import net.minecraft.client.Minecraft; -import net.minecraft.client.player.LocalPlayer; import net.minecraft.client.resources.sounds.AbstractSoundInstance; import net.minecraft.client.resources.sounds.SoundInstance; import net.minecraft.client.sounds.MusicManager; import net.minecraft.sounds.Music; import net.minecraft.util.Mth; -import net.minecraft.world.level.Level; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -52,7 +50,8 @@ public abstract class MusicTrackerMixin { if (currentMusic instanceof AbstractSoundInstance) { ((AbstractSoundInstanceAccessor) currentMusic).setVolume(volume); } - minecraft.getSoundManager().updateSourceVolume(currentMusic.getSource(), currentMusic.getVolume() * volume); + minecraft.getSoundManager() + .updateSourceVolume(currentMusic.getSource(), currentMusic.getVolume() * volume); long t = System.currentTimeMillis(); if (volume == 1 && time == 0) { time = t; @@ -91,7 +90,9 @@ public abstract class MusicTrackerMixin { } private boolean be_shouldChangeSound(Music musicSound) { - return currentMusic != null && !musicSound.getEvent().getLocation().equals(this.currentMusic.getLocation()) && musicSound.replaceCurrentMusic(); + return currentMusic != null && !musicSound.getEvent() + .getLocation() + .equals(this.currentMusic.getLocation()) && musicSound.replaceCurrentMusic(); } private boolean be_checkNullSound(Music musicSound) { diff --git a/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java b/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java index fe443a28..f28d3648 100644 --- a/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java +++ b/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java @@ -72,7 +72,8 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc slotsChanged(inputSlots); access.execute((world, blockPos) -> { BlockState anvilState = world.getBlockState(blockPos); - if (!player.getAbilities().instabuild && anvilState.is(BlockTags.ANVIL) && player.getRandom().nextDouble() < 0.1) { + if (!player.getAbilities().instabuild && anvilState.is(BlockTags.ANVIL) && player.getRandom() + .nextDouble() < 0.1) { BlockState landingState = EndAnvilBlock.applyDamage(anvilState); if (landingState == null) { world.removeBlock(blockPos, false); @@ -97,7 +98,9 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc be_recipes = recipeManager.getRecipesFor(AnvilRecipe.TYPE, inputSlots, player.level); if (be_recipes.size() > 0) { int anvilLevel = this.anvilLevel.get(); - be_recipes = be_recipes.stream().filter(recipe -> anvilLevel >= recipe.getAnvilLevel()).collect(Collectors.toList()); + be_recipes = be_recipes.stream() + .filter(recipe -> anvilLevel >= recipe.getAnvilLevel()) + .collect(Collectors.toList()); if (be_recipes.size() > 0) { if (be_currentRecipe == null || !be_recipes.contains(be_currentRecipe)) { be_currentRecipe = be_recipes.get(0); diff --git a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java index 3d13e9c4..5c3aa190 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java @@ -61,10 +61,23 @@ public abstract class ChorusFlowerBlockMixin extends Block { if (i < 5) { this.placeGrownFlower(world, up, i + 1); if (GeneratorOptions.changeChorusPlant()) { - BlocksHelper.setWithoutUpdate(world, pos, plant.defaultBlockState().setValue(ChorusPlantBlock.UP, true).setValue(ChorusPlantBlock.DOWN, true).setValue(VanillaBlockProperties.ROOTS, true)); + BlocksHelper.setWithoutUpdate( + world, + pos, + plant.defaultBlockState() + .setValue(ChorusPlantBlock.UP, true) + .setValue(ChorusPlantBlock.DOWN, true) + .setValue(VanillaBlockProperties.ROOTS, true) + ); } else { - BlocksHelper.setWithoutUpdate(world, pos, plant.defaultBlockState().setValue(ChorusPlantBlock.UP, true).setValue(ChorusPlantBlock.DOWN, true)); + BlocksHelper.setWithoutUpdate( + world, + pos, + plant.defaultBlockState() + .setValue(ChorusPlantBlock.UP, true) + .setValue(ChorusPlantBlock.DOWN, true) + ); } info.cancel(); } diff --git a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java index 6424310d..407df282 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java @@ -52,7 +52,8 @@ public abstract class ChorusPlantBlockMixin extends Block { BlockState plant = info.getReturnValue(); if (ctx.canPlace() && plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) { if (GeneratorOptions.changeChorusPlant()) { - info.setReturnValue(plant.setValue(VanillaBlockProperties.ROOTS, true).setValue(BlockStateProperties.DOWN, true)); + info.setReturnValue(plant.setValue(VanillaBlockProperties.ROOTS, true) + .setValue(BlockStateProperties.DOWN, true)); } else { info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true)); @@ -67,7 +68,8 @@ public abstract class ChorusPlantBlockMixin extends Block { if (plant.is(Blocks.CHORUS_PLANT)) { if (blockGetter.getBlockState(blockPos.below()).is(TagAPI.END_GROUND)) { if (GeneratorOptions.changeChorusPlant()) { - info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true).setValue(VanillaBlockProperties.ROOTS, true)); + info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true) + .setValue(VanillaBlockProperties.ROOTS, true)); } else { info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true)); @@ -98,7 +100,8 @@ public abstract class ChorusPlantBlockMixin extends Block { if (plant.is(Blocks.CHORUS_PLANT)) { if (world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) { if (GeneratorOptions.changeChorusPlant()) { - plant = plant.setValue(BlockStateProperties.DOWN, true).setValue(VanillaBlockProperties.ROOTS, true); + plant = plant.setValue(BlockStateProperties.DOWN, true) + .setValue(VanillaBlockProperties.ROOTS, true); } else { plant = plant.setValue(BlockStateProperties.DOWN, true); diff --git a/src/main/java/ru/betterend/mixin/common/ChorusPlantFeatureMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusPlantFeatureMixin.java index 61974050..76fa11cc 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusPlantFeatureMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusPlantFeatureMixin.java @@ -28,15 +28,24 @@ public class ChorusPlantFeatureMixin { final Random random = featureConfig.random(); final BlockPos blockPos = featureConfig.origin(); final WorldGenLevel structureWorldAccess = featureConfig.level(); - if (structureWorldAccess.isEmptyBlock(blockPos) && structureWorldAccess.getBlockState(blockPos.below()).is(EndBlocks.CHORUS_NYLIUM)) { + if (structureWorldAccess.isEmptyBlock(blockPos) && structureWorldAccess.getBlockState(blockPos.below()) + .is(EndBlocks.CHORUS_NYLIUM)) { ChorusFlowerBlock.generatePlant(structureWorldAccess, blockPos, random, MHelper.randRange(8, 16, random)); BlockState bottom = structureWorldAccess.getBlockState(blockPos); if (bottom.is(Blocks.CHORUS_PLANT)) { if ((GeneratorOptions.changeChorusPlant())) { - BlocksHelper.setWithoutUpdate(structureWorldAccess, blockPos, bottom.setValue(VanillaBlockProperties.ROOTS, true).setValue(PipeBlock.DOWN, true)); + BlocksHelper.setWithoutUpdate( + structureWorldAccess, + blockPos, + bottom.setValue(VanillaBlockProperties.ROOTS, true).setValue(PipeBlock.DOWN, true) + ); } else { - BlocksHelper.setWithoutUpdate(structureWorldAccess, blockPos, bottom.setValue(PipeBlock.DOWN, true)); + BlocksHelper.setWithoutUpdate( + structureWorldAccess, + blockPos, + bottom.setValue(PipeBlock.DOWN, true) + ); } } info.setReturnValue(true); diff --git a/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java b/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java index 863b38fa..a4422806 100644 --- a/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java +++ b/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java @@ -17,7 +17,11 @@ import ru.betterend.world.generator.GeneratorOptions; public class DimensionTypeMixin { @Inject(method = "defaultEndGenerator", at = @At("HEAD"), cancellable = true) private static void be_replaceGenerator(Registry biomeRegistry, Registry chunkGeneratorSettingsRegistry, long seed, CallbackInfoReturnable info) { - info.setReturnValue(new NoiseBasedChunkGenerator(new BetterEndBiomeSource(biomeRegistry, seed), seed, () -> chunkGeneratorSettingsRegistry.getOrThrow(NoiseGeneratorSettings.END))); + info.setReturnValue(new NoiseBasedChunkGenerator( + new BetterEndBiomeSource(biomeRegistry, seed), + seed, + () -> chunkGeneratorSettingsRegistry.getOrThrow(NoiseGeneratorSettings.END) + )); } @Inject(method = "createDragonFight", at = @At("HEAD"), cancellable = true) diff --git a/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java b/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java index 4d85fc64..7a516653 100644 --- a/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java @@ -66,7 +66,11 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { int j; for (j = -1; j <= 1; ++j) { for (int k = -1; k <= 1; ++k) { - if ((j != 0 || k != 0) && world.isEmptyBlock(blockPos.offset(k, 0, j)) && world.isEmptyBlock(blockPos.offset(k, 1, j))) { + if ((j != 0 || k != 0) && world.isEmptyBlock(blockPos.offset( + k, + 0, + j + )) && world.isEmptyBlock(blockPos.offset(k, 1, j))) { if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(TagAPI.BOOKSHELVES)) { ++i; } @@ -111,7 +115,8 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { if (this.costs[j] > 0) { List list = this.getEnchantmentList(itemStack, j, this.costs[j]); if (list != null && !list.isEmpty()) { - EnchantmentInstance enchantmentLevelEntry = (EnchantmentInstance) list.get(this.random.nextInt(list.size())); + EnchantmentInstance enchantmentLevelEntry = (EnchantmentInstance) list.get(this.random.nextInt( + list.size())); enchantClue[j] = Registry.ENCHANTMENT.getId(enchantmentLevelEntry.enchantment); levelClue[j] = enchantmentLevelEntry.level; } diff --git a/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java b/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java index 529ca254..dddd68de 100644 --- a/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java @@ -72,7 +72,10 @@ public class EndDragonFightMixin { BlockPos center = GeneratorOptions.getPortalPos().above(5); for (Direction dir : BlocksHelper.HORIZONTAL) { BlockPos central = center.relative(dir, 4); - List crystalList = level.getEntitiesOfClass(EndCrystal.class, new AABB(central.below(255).south().west(), central.above(255).north().east())); + List crystalList = level.getEntitiesOfClass( + EndCrystal.class, + new AABB(central.below(255).south().west(), central.above(255).north().east()) + ); int count = crystalList.size(); for (int n = 0; n < count; n++) { diff --git a/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java b/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java index 911b2a99..600286b1 100644 --- a/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java @@ -54,14 +54,21 @@ public class EndPodiumFeatureMixin { private FeaturePlaceContext be_setPosOnGround(FeaturePlaceContext featurePlaceContext) { WorldGenLevel world = featurePlaceContext.level(); BlockPos pos = be_updatePos(featurePlaceContext.origin(), world); - return new FeaturePlaceContext(world, featurePlaceContext.chunkGenerator(), featurePlaceContext.random(), pos, featurePlaceContext.config()); + return new FeaturePlaceContext( + world, + featurePlaceContext.chunkGenerator(), + featurePlaceContext.random(), + pos, + featurePlaceContext.config() + ); } private BlockPos be_updatePos(BlockPos blockPos, WorldGenLevel world) { if (GeneratorOptions.useNewGenerator()) { BlockPos pos = GeneratorOptions.getPortalPos(); if (pos.equals(BlockPos.ZERO)) { - int y = world.getChunk(0, 0, ChunkStatus.FULL).getHeight(Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()); + int y = world.getChunk(0, 0, ChunkStatus.FULL) + .getHeight(Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()); if (y < 1) { y = 65; } diff --git a/src/main/java/ru/betterend/mixin/common/EnderManMixin.java b/src/main/java/ru/betterend/mixin/common/EnderManMixin.java index ddc807b6..130ace6b 100644 --- a/src/main/java/ru/betterend/mixin/common/EnderManMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EnderManMixin.java @@ -15,7 +15,10 @@ import ru.betterend.effects.EndStatusEffects; public abstract class EnderManMixin { @Inject(method = "isLookingAtMe", at = @At("HEAD"), cancellable = true) private void be_isLookingAtMe(Player player, CallbackInfoReturnable info) { - if (player.isCreative() || player.hasEffect(EndStatusEffects.END_VEIL) || EnchantmentHelper.getItemEnchantmentLevel(EndEnchantments.END_VEIL, player.getItemBySlot(EquipmentSlot.HEAD)) > 0) { + if (player.isCreative() || player.hasEffect(EndStatusEffects.END_VEIL) || EnchantmentHelper.getItemEnchantmentLevel( + EndEnchantments.END_VEIL, + player.getItemBySlot(EquipmentSlot.HEAD) + ) > 0) { info.setReturnValue(false); } } diff --git a/src/main/java/ru/betterend/mixin/common/EntityMixin.java b/src/main/java/ru/betterend/mixin/common/EntityMixin.java index 2cd3441a..20d4e1ee 100644 --- a/src/main/java/ru/betterend/mixin/common/EntityMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EntityMixin.java @@ -58,7 +58,13 @@ public abstract class EntityMixin implements TeleportingEntity { Entity entity = getType().create(destination); if (entity != null) { entity.restoreFrom(Entity.class.cast(this)); - entity.moveTo(teleportTarget.pos.x, teleportTarget.pos.y, teleportTarget.pos.z, teleportTarget.yRot, entity.getXRot()); + entity.moveTo( + teleportTarget.pos.x, + teleportTarget.pos.y, + teleportTarget.pos.z, + teleportTarget.yRot, + entity.getXRot() + ); entity.setDeltaMovement(teleportTarget.speed); //TODO: check if this works as intended in 1.17 @@ -79,7 +85,12 @@ public abstract class EntityMixin implements TeleportingEntity { @Inject(method = "findDimensionEntryPoint", at = @At("HEAD"), cancellable = true) protected void be_findDimensionEntryPoint(ServerLevel destination, CallbackInfoReturnable info) { if (be_canTeleport()) { - info.setReturnValue(new PortalInfo(new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), getDeltaMovement(), yRot, xRot)); + info.setReturnValue(new PortalInfo( + new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), + getDeltaMovement(), + yRot, + xRot + )); } } diff --git a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java index 6896ff44..147b6a18 100644 --- a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java +++ b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java @@ -121,7 +121,11 @@ public abstract class LivingEntityMixin extends Entity { if (isFlying && !onGround && !isPassenger() && !hasEffect(MobEffects.LEVITATION)) { if (ElytraItem.isFlyEnabled(itemStack)) { if ((fallFlyTicks + 1) % 20 == 0) { - itemStack.hurtAndBreak(1, LivingEntity.class.cast(this), livingEntity -> livingEntity.broadcastBreakEvent(EquipmentSlot.CHEST)); + itemStack.hurtAndBreak( + 1, + LivingEntity.class.cast(this), + livingEntity -> livingEntity.broadcastBreakEvent(EquipmentSlot.CHEST) + ); } isFlying = true; } @@ -167,7 +171,11 @@ public abstract class LivingEntityMixin extends Entity { } if (k > 0.0D) { - moveDelta = moveDelta.add((lookAngle.x / k * l - moveDelta.x) * 0.1D, 0.0D, (lookAngle.z / k * l - moveDelta.z) * 0.1D); + moveDelta = moveDelta.add( + (lookAngle.x / k * l - moveDelta.x) * 0.1D, + 0.0D, + (lookAngle.z / k * l - moveDelta.z) * 0.1D + ); } moveDelta = moveDelta.multiply(0.9900000095367432D, 0.9800000190734863D, 0.9900000095367432D); double movementFactor = ((FallFlyingItem) itemStack.getItem()).getMovementFactor(); @@ -196,7 +204,8 @@ public abstract class LivingEntityMixin extends Entity { private double be_getKnockback(Item tool) { if (tool == null) return 0.0D; - Collection modifiers = tool.getDefaultAttributeModifiers(EquipmentSlot.MAINHAND).get(Attributes.ATTACK_KNOCKBACK); + Collection modifiers = tool.getDefaultAttributeModifiers(EquipmentSlot.MAINHAND) + .get(Attributes.ATTACK_KNOCKBACK); if (modifiers.size() > 0) { return modifiers.iterator().next().getAmount(); } diff --git a/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java b/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java index 2d6b56f2..06260c1d 100644 --- a/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java +++ b/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java @@ -18,6 +18,10 @@ public abstract class PlayerAdvancementsMixin { @Inject(method = "award", at = @At(value = "INVOKE", target = "Lnet/minecraft/advancements/AdvancementRewards;grant(Lnet/minecraft/server/level/ServerPlayer;)V", shift = Shift.AFTER)) public void be_award(Advancement advancement, String criterionName, CallbackInfoReturnable info) { - PlayerAdvancementsCallback.PLAYER_ADVANCEMENT_COMPLETE.invoker().onAdvancementComplete(player, advancement, criterionName); + PlayerAdvancementsCallback.PLAYER_ADVANCEMENT_COMPLETE.invoker() + .onAdvancementComplete(player, + advancement, + criterionName + ); } } diff --git a/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java b/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java index 7990da91..127a750a 100644 --- a/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java +++ b/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java @@ -93,7 +93,10 @@ public class PlayerListMixin { CompoundTag compoundTag = this.load(serverPlayer); ResourceKey var23; if (compoundTag != null) { - DataResult> var10000 = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, compoundTag.get("Dimension"))); + DataResult> var10000 = DimensionType.parseLegacy(new Dynamic( + NbtOps.INSTANCE, + compoundTag.get("Dimension") + )); Logger var10001 = LOGGER; Objects.requireNonNull(var10001); var23 = (ResourceKey) var10000.resultOrPartial(var10001::error).orElse(Level.END); @@ -120,21 +123,57 @@ public class PlayerListMixin { string2 = connection.getRemoteAddress().toString(); } - LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", serverPlayer.getName().getString(), string2, serverPlayer.getId(), serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ()); + LOGGER.info( + "{}[{}] logged in with entity id {} at ({}, {}, {})", + serverPlayer.getName().getString(), + string2, + serverPlayer.getId(), + serverPlayer.getX(), + serverPlayer.getY(), + serverPlayer.getZ() + ); LevelData worldProperties = serverLevel3.getLevelData(); serverPlayer.loadGameTypes(compoundTag); //this.updatePlayerGameMode(serverPlayer, (ServerPlayer) null, serverLevel3); - ServerGamePacketListenerImpl serverPlayNetworkHandler = new ServerGamePacketListenerImpl(this.server, connection, serverPlayer); + ServerGamePacketListenerImpl serverPlayNetworkHandler = new ServerGamePacketListenerImpl( + this.server, + connection, + serverPlayer + ); GameRules gameRules = serverLevel3.getGameRules(); boolean bl = gameRules.getBoolean(GameRules.RULE_DO_IMMEDIATE_RESPAWN); boolean bl2 = gameRules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO); - serverPlayNetworkHandler.send(new ClientboundLoginPacket(serverPlayer.getId(), serverPlayer.gameMode.getGameModeForPlayer(), serverPlayer.gameMode.getPreviousGameModeForPlayer(), BiomeManager.obfuscateSeed(serverLevel3.getSeed()), worldProperties.isHardcore(), this.server.levelKeys(), this.registryHolder, serverLevel3.dimensionType(), serverLevel3.dimension(), this.getMaxPlayers(), this.viewDistance, bl2, !bl, serverLevel3.isDebug(), serverLevel3.isFlat())); - serverPlayNetworkHandler.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName()))); - serverPlayNetworkHandler.send(new ClientboundChangeDifficultyPacket(worldProperties.getDifficulty(), worldProperties.isDifficultyLocked())); + serverPlayNetworkHandler.send(new ClientboundLoginPacket( + serverPlayer.getId(), + serverPlayer.gameMode.getGameModeForPlayer(), + serverPlayer.gameMode.getPreviousGameModeForPlayer(), + BiomeManager.obfuscateSeed(serverLevel3.getSeed()), + worldProperties.isHardcore(), + this.server.levelKeys(), + this.registryHolder, + serverLevel3.dimensionType(), + serverLevel3.dimension(), + this.getMaxPlayers(), + this.viewDistance, + bl2, + !bl, + serverLevel3.isDebug(), + serverLevel3.isFlat() + )); + serverPlayNetworkHandler.send(new ClientboundCustomPayloadPacket( + ClientboundCustomPayloadPacket.BRAND, + (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName()) + )); + serverPlayNetworkHandler.send(new ClientboundChangeDifficultyPacket( + worldProperties.getDifficulty(), + worldProperties.isDifficultyLocked() + )); serverPlayNetworkHandler.send(new ClientboundPlayerAbilitiesPacket(serverPlayer.getAbilities())); serverPlayNetworkHandler.send(new ClientboundSetCarriedItemPacket(serverPlayer.getInventory().selected)); - serverPlayNetworkHandler.send(new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes())); - serverPlayNetworkHandler.send(new ClientboundUpdateTagsPacket(this.server.getTags().serializeToNetwork(this.registryHolder))); + serverPlayNetworkHandler.send(new ClientboundUpdateRecipesPacket(this.server.getRecipeManager() + .getRecipes())); + serverPlayNetworkHandler.send(new ClientboundUpdateTagsPacket(this.server.getTags() + .serializeToNetwork(this.registryHolder))); this.sendPlayerPermissionLevel(serverPlayer); serverPlayer.getStats().markAllDirty(); serverPlayer.getRecipeBook().sendInitialRecipeBook(serverPlayer); @@ -142,38 +181,68 @@ public class PlayerListMixin { this.server.invalidateStatus(); TranslatableComponent mutableText2; if (serverPlayer.getGameProfile().getName().equalsIgnoreCase(string)) { - mutableText2 = new TranslatableComponent("multiplayer.player.joined", new Object[]{serverPlayer.getDisplayName()}); + mutableText2 = new TranslatableComponent( + "multiplayer.player.joined", + new Object[] {serverPlayer.getDisplayName()} + ); } else { - mutableText2 = new TranslatableComponent("multiplayer.player.joined.renamed", new Object[]{serverPlayer.getDisplayName(), string}); + mutableText2 = new TranslatableComponent( + "multiplayer.player.joined.renamed", + new Object[] {serverPlayer.getDisplayName(), string} + ); } this.broadcastMessage(mutableText2.withStyle(ChatFormatting.YELLOW), ChatType.SYSTEM, Util.NIL_UUID); - serverPlayNetworkHandler.teleport(serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ(), serverPlayer.getYRot(), serverPlayer.getXRot()); + serverPlayNetworkHandler.teleport( + serverPlayer.getX(), + serverPlayer.getY(), + serverPlayer.getZ(), + serverPlayer.getYRot(), + serverPlayer.getXRot() + ); this.players.add(serverPlayer); this.playersByUUID.put(serverPlayer.getUUID(), serverPlayer); - this.broadcastAll(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[]{serverPlayer})); + this.broadcastAll(new ClientboundPlayerInfoPacket( + ClientboundPlayerInfoPacket.Action.ADD_PLAYER, + new ServerPlayer[] {serverPlayer} + )); for (ServerPlayer player : this.players) { - serverPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[]{(ServerPlayer) player})); + serverPlayer.connection.send(new ClientboundPlayerInfoPacket( + ClientboundPlayerInfoPacket.Action.ADD_PLAYER, + new ServerPlayer[] {(ServerPlayer) player} + )); } serverLevel3.addNewPlayer(serverPlayer); this.server.getCustomBossEvents().onPlayerConnect(serverPlayer); this.sendLevelInfo(serverPlayer, serverLevel3); if (!this.server.getResourcePack().isEmpty()) { - serverPlayer.sendTexturePack(this.server.getResourcePack(), this.server.getResourcePackHash(), this.server.isResourcePackRequired(), this.server.getResourcePackPrompt()); + serverPlayer.sendTexturePack( + this.server.getResourcePack(), + this.server.getResourcePackHash(), + this.server.isResourcePackRequired(), + this.server.getResourcePackPrompt() + ); } for (MobEffectInstance statusEffectInstance : serverPlayer.getActiveEffects()) { - serverPlayNetworkHandler.send(new ClientboundUpdateMobEffectPacket(serverPlayer.getId(), statusEffectInstance)); + serverPlayNetworkHandler.send(new ClientboundUpdateMobEffectPacket( + serverPlayer.getId(), + statusEffectInstance + )); } if (compoundTag != null && compoundTag.contains("RootVehicle", 10)) { CompoundTag compoundTag2 = compoundTag.getCompound("RootVehicle"); - Entity entity = EntityType.loadEntityRecursive(compoundTag2.getCompound("Entity"), serverLevel3, (vehicle) -> { - return !serverLevel3.addWithUUID(vehicle) ? null : vehicle; - }); + Entity entity = EntityType.loadEntityRecursive( + compoundTag2.getCompound("Entity"), + serverLevel3, + (vehicle) -> { + return !serverLevel3.addWithUUID(vehicle) ? null : vehicle; + } + ); if (entity != null) { UUID uUID2; if (compoundTag2.hasUUID("Attach")) { diff --git a/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java b/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java index 32a57518..51845f0e 100644 --- a/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java @@ -67,7 +67,12 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt @Inject(method = "findDimensionEntryPoint", at = @At("HEAD"), cancellable = true) protected void be_getTeleportTarget(ServerLevel destination, CallbackInfoReturnable info) { if (be_canTeleport()) { - info.setReturnValue(new PortalInfo(new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), getDeltaMovement(), getYRot(), getXRot())); + info.setReturnValue(new PortalInfo( + new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), + getDeltaMovement(), + getYRot(), + getXRot() + )); } } @@ -78,8 +83,20 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt ServerLevel serverWorld = getLevel(); LevelData worldProperties = destination.getLevelData(); ServerPlayer player = ServerPlayer.class.cast(this); - connection.send(new ClientboundRespawnPacket(destination.dimensionType(), destination.dimension(), BiomeManager.obfuscateSeed(destination.getSeed()), gameMode.getGameModeForPlayer(), gameMode.getPreviousGameModeForPlayer(), destination.isDebug(), destination.isFlat(), true)); - connection.send(new ClientboundChangeDifficultyPacket(worldProperties.getDifficulty(), worldProperties.isDifficultyLocked())); + connection.send(new ClientboundRespawnPacket( + destination.dimensionType(), + destination.dimension(), + BiomeManager.obfuscateSeed(destination.getSeed()), + gameMode.getGameModeForPlayer(), + gameMode.getPreviousGameModeForPlayer(), + destination.isDebug(), + destination.isFlat(), + true + )); + connection.send(new ClientboundChangeDifficultyPacket( + worldProperties.getDifficulty(), + worldProperties.isDifficultyLocked() + )); PlayerList playerManager = server.getPlayerList(); playerManager.sendPlayerPermissionLevel(player); serverWorld.removePlayerImmediately(player, RemovalReason.CHANGED_DIMENSION); diff --git a/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java b/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java index 956c402b..d1a779f4 100644 --- a/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java +++ b/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java @@ -52,7 +52,8 @@ public class SpikeFeatureMixin { String pillarID = String.format("%d_%d", x, z); CompoundTag pillar = WorldDataAPI.getCompoundTag(BetterEnd.MOD_ID, "pillars"); boolean haveValue = pillar.contains(pillarID); - minY = haveValue ? pillar.getInt(pillarID) : world.getChunk(x >> 4, z >> 4).getHeight(Types.WORLD_SURFACE, x & 15, z); + minY = haveValue ? pillar.getInt(pillarID) : world.getChunk(x >> 4, z >> 4) + .getHeight(Types.WORLD_SURFACE, x & 15, z); if (!haveValue) { pillar.putInt(pillarID, minY); WorldDataAPI.saveFile(BetterEnd.MOD_ID); @@ -68,7 +69,8 @@ public class SpikeFeatureMixin { if (GeneratorOptions.replacePillars() && be_radiusInRange(radius)) { radius--; StructureTemplate base = StructureHelper.readStructure(BetterEnd.makeID("pillars/pillar_base_" + radius)); - StructureTemplate top = StructureHelper.readStructure(BetterEnd.makeID("pillars/pillar_top_" + radius + (spike.isGuarded() ? "_cage" : ""))); + StructureTemplate top = StructureHelper.readStructure(BetterEnd.makeID("pillars/pillar_top_" + radius + (spike + .isGuarded() ? "_cage" : ""))); Vec3i side = base.getSize(); BlockPos pos1 = new BlockPos(x - (side.getX() >> 1), minY - 3, z - (side.getZ() >> 1)); minY = pos1.getY() + side.getY(); @@ -92,7 +94,8 @@ public class SpikeFeatureMixin { for (int py = minY; py < maxY; py++) { mut.setY(py); if (world.getBlockState(mut).getMaterial().isReplaceable()) { - if ((px == radius || px == -radius || pz == radius || pz == -radius) && random.nextInt(24) == 0) { + if ((px == radius || px == -radius || pz == radius || pz == -radius) && random.nextInt( + 24) == 0) { BlocksHelper.setWithoutUpdate(world, mut, Blocks.CRYING_OBSIDIAN); } else { @@ -145,8 +148,20 @@ public class SpikeFeatureMixin { if (bl || bl2 || bl3) { boolean bl4 = px == -2 || px == 2 || bl3; boolean bl5 = pz == -2 || pz == 2 || bl3; - BlockState blockState = (BlockState) ((BlockState) ((BlockState) ((BlockState) Blocks.IRON_BARS.defaultBlockState().setValue(IronBarsBlock.NORTH, bl4 && pz != -2)).setValue(IronBarsBlock.SOUTH, bl4 && pz != 2)).setValue(IronBarsBlock.WEST, bl5 && px != -2)).setValue(IronBarsBlock.EAST, bl5 && px != 2); - BlocksHelper.setWithoutUpdate(world, mut.set(spike.getCenterX() + px, maxY + py, spike.getCenterZ() + pz), blockState); + BlockState blockState = (BlockState) ((BlockState) ((BlockState) ((BlockState) Blocks.IRON_BARS + .defaultBlockState() + .setValue(IronBarsBlock.NORTH, bl4 && pz != -2)).setValue( + IronBarsBlock.SOUTH, + bl4 && pz != 2 + )).setValue(IronBarsBlock.WEST, bl5 && px != -2)).setValue( + IronBarsBlock.EAST, + bl5 && px != 2 + ); + BlocksHelper.setWithoutUpdate( + world, + mut.set(spike.getCenterX() + px, maxY + py, spike.getCenterZ() + pz), + blockState + ); } } } diff --git a/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java b/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java index dffde15a..5486f092 100644 --- a/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java +++ b/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java @@ -31,6 +31,8 @@ public class WeightedBiomePickerMixin implements IBiomeList { } private boolean be_isCorrectPicker(WeightedBiomePicker picker) { - return picker == InternalBiomeData.getEndBiomesMap().get(Biomes.SMALL_END_ISLANDS) || picker == InternalBiomeData.getEndBarrensMap().get(Biomes.END_BARRENS); + return picker == InternalBiomeData.getEndBiomesMap() + .get(Biomes.SMALL_END_ISLANDS) || picker == InternalBiomeData.getEndBarrensMap() + .get(Biomes.END_BARRENS); } } diff --git a/src/main/java/ru/betterend/noise/OpenSimplexNoise.java b/src/main/java/ru/betterend/noise/OpenSimplexNoise.java index 7621c7b4..ff24de98 100644 --- a/src/main/java/ru/betterend/noise/OpenSimplexNoise.java +++ b/src/main/java/ru/betterend/noise/OpenSimplexNoise.java @@ -2256,21 +2256,48 @@ public final class OpenSimplexNoise { double attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0 - dw_ext0 * dw_ext0; if (attn_ext0 > 0) { attn_ext0 *= attn_ext0; - value += attn_ext0 * attn_ext0 * extrapolate(xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0, dx_ext0, dy_ext0, dz_ext0, dw_ext0); + value += attn_ext0 * attn_ext0 * extrapolate( + xsv_ext0, + ysv_ext0, + zsv_ext0, + wsv_ext0, + dx_ext0, + dy_ext0, + dz_ext0, + dw_ext0 + ); } // Second extra vertex double attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1 - dw_ext1 * dw_ext1; if (attn_ext1 > 0) { attn_ext1 *= attn_ext1; - value += attn_ext1 * attn_ext1 * extrapolate(xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1, dx_ext1, dy_ext1, dz_ext1, dw_ext1); + value += attn_ext1 * attn_ext1 * extrapolate( + xsv_ext1, + ysv_ext1, + zsv_ext1, + wsv_ext1, + dx_ext1, + dy_ext1, + dz_ext1, + dw_ext1 + ); } // Third extra vertex double attn_ext2 = 2 - dx_ext2 * dx_ext2 - dy_ext2 * dy_ext2 - dz_ext2 * dz_ext2 - dw_ext2 * dw_ext2; if (attn_ext2 > 0) { attn_ext2 *= attn_ext2; - value += attn_ext2 * attn_ext2 * extrapolate(xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2, dx_ext2, dy_ext2, dz_ext2, dw_ext2); + value += attn_ext2 * attn_ext2 * extrapolate( + xsv_ext2, + ysv_ext2, + zsv_ext2, + wsv_ext2, + dx_ext2, + dy_ext2, + dz_ext2, + dw_ext2 + ); } return value / NORM_CONSTANT_4D; @@ -2298,17 +2325,347 @@ public final class OpenSimplexNoise { // Gradients for 2D. They approximate the directions to the // vertices of an octagon from the center. - private static byte[] gradients2D = new byte[]{5, 2, 2, 5, -5, 2, -2, 5, 5, -2, 2, -5, -5, -2, -2, -5,}; + private static byte[] gradients2D = new byte[] {5, 2, 2, 5, -5, 2, -2, 5, 5, -2, 2, -5, -5, -2, -2, -5,}; // Gradients for 3D. They approximate the directions to the // vertices of a rhombicuboctahedron from the center, skewed so // that the triangular and square facets can be inscribed inside // circles of the same radius. - private static byte[] gradients3D = new byte[]{-11, 4, 4, -4, 11, 4, -4, 4, 11, 11, 4, 4, 4, 11, 4, 4, 4, 11, -11, -4, 4, -4, -11, 4, -4, -4, 11, 11, -4, 4, 4, -11, 4, 4, -4, 11, -11, 4, -4, -4, 11, -4, -4, 4, -11, 11, 4, -4, 4, 11, -4, 4, 4, -11, -11, -4, -4, -4, -11, -4, -4, -4, -11, 11, -4, -4, 4, -11, -4, 4, -4, -11,}; + private static byte[] gradients3D = new byte[] { + -11, + 4, + 4, + -4, + 11, + 4, + -4, + 4, + 11, + 11, + 4, + 4, + 4, + 11, + 4, + 4, + 4, + 11, + -11, + -4, + 4, + -4, + -11, + 4, + -4, + -4, + 11, + 11, + -4, + 4, + 4, + -11, + 4, + 4, + -4, + 11, + -11, + 4, + -4, + -4, + 11, + -4, + -4, + 4, + -11, + 11, + 4, + -4, + 4, + 11, + -4, + 4, + 4, + -11, + -11, + -4, + -4, + -4, + -11, + -4, + -4, + -4, + -11, + 11, + -4, + -4, + 4, + -11, + -4, + 4, + -4, + -11, + }; // Gradients for 4D. They approximate the directions to the // vertices of a disprismatotesseractihexadecachoron from the center, // skewed so that the tetrahedral and cubic facets can be inscribed inside // spheres of the same radius. - private static byte[] gradients4D = new byte[]{3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3,}; + private static byte[] gradients4D = new byte[] { + 3, + 1, + 1, + 1, + 1, + 3, + 1, + 1, + 1, + 1, + 3, + 1, + 1, + 1, + 1, + 3, + -3, + 1, + 1, + 1, + -1, + 3, + 1, + 1, + -1, + 1, + 3, + 1, + -1, + 1, + 1, + 3, + 3, + -1, + 1, + 1, + 1, + -3, + 1, + 1, + 1, + -1, + 3, + 1, + 1, + -1, + 1, + 3, + -3, + -1, + 1, + 1, + -1, + -3, + 1, + 1, + -1, + -1, + 3, + 1, + -1, + -1, + 1, + 3, + 3, + 1, + -1, + 1, + 1, + 3, + -1, + 1, + 1, + 1, + -3, + 1, + 1, + 1, + -1, + 3, + -3, + 1, + -1, + 1, + -1, + 3, + -1, + 1, + -1, + 1, + -3, + 1, + -1, + 1, + -1, + 3, + 3, + -1, + -1, + 1, + 1, + -3, + -1, + 1, + 1, + -1, + -3, + 1, + 1, + -1, + -1, + 3, + -3, + -1, + -1, + 1, + -1, + -3, + -1, + 1, + -1, + -1, + -3, + 1, + -1, + -1, + -1, + 3, + 3, + 1, + 1, + -1, + 1, + 3, + 1, + -1, + 1, + 1, + 3, + -1, + 1, + 1, + 1, + -3, + -3, + 1, + 1, + -1, + -1, + 3, + 1, + -1, + -1, + 1, + 3, + -1, + -1, + 1, + 1, + -3, + 3, + -1, + 1, + -1, + 1, + -3, + 1, + -1, + 1, + -1, + 3, + -1, + 1, + -1, + 1, + -3, + -3, + -1, + 1, + -1, + -1, + -3, + 1, + -1, + -1, + -1, + 3, + -1, + -1, + -1, + 1, + -3, + 3, + 1, + -1, + -1, + 1, + 3, + -1, + -1, + 1, + 1, + -3, + -1, + 1, + 1, + -1, + -3, + -3, + 1, + -1, + -1, + -1, + 3, + -1, + -1, + -1, + 1, + -3, + -1, + -1, + 1, + -1, + -3, + 3, + -1, + -1, + -1, + 1, + -3, + -1, + -1, + 1, + -1, + -3, + -1, + 1, + -1, + -1, + -3, + -3, + -1, + -1, + -1, + -1, + -3, + -1, + -1, + -1, + -1, + -3, + -1, + -1, + -1, + -1, + -3, + }; } \ No newline at end of file diff --git a/src/main/java/ru/betterend/particle/InfusionParticleType.java b/src/main/java/ru/betterend/particle/InfusionParticleType.java index da771119..d7a6f5af 100644 --- a/src/main/java/ru/betterend/particle/InfusionParticleType.java +++ b/src/main/java/ru/betterend/particle/InfusionParticleType.java @@ -16,13 +16,19 @@ import ru.bclib.util.ColorUtil; import ru.betterend.registry.EndParticles; public class InfusionParticleType extends ParticleType implements ParticleOptions { - public static final Codec CODEC = ItemStack.CODEC.xmap(itemStack -> new InfusionParticleType(EndParticles.INFUSION, itemStack), infusionParticleType -> infusionParticleType.itemStack); + public static final Codec CODEC = ItemStack.CODEC.xmap(itemStack -> new InfusionParticleType( + EndParticles.INFUSION, + itemStack + ), infusionParticleType -> infusionParticleType.itemStack); public static final ParticleOptions.Deserializer PARAMETERS_FACTORY = new ParticleOptions.Deserializer() { public InfusionParticleType fromCommand(ParticleType particleType, StringReader stringReader) throws CommandSyntaxException { stringReader.expect(' '); ItemParser itemStringReader = new ItemParser(stringReader, false).parse(); - ItemStack itemStack = new ItemInput(itemStringReader.getItem(), itemStringReader.getNbt()).createItemStack(1, false); + ItemStack itemStack = new ItemInput( + itemStringReader.getItem(), + itemStringReader.getNbt() + ).createItemStack(1, false); return new InfusionParticleType(particleType, itemStack); } diff --git a/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java b/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java index 88b08700..b0ca71f3 100644 --- a/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java +++ b/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java @@ -12,7 +12,7 @@ import net.minecraft.client.particle.TextureSheetParticle; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.SimpleParticleType; import net.minecraft.util.Mth; -import ru.bclib.interfaces.IColorProvider; +import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.util.MHelper; import ru.betterend.registry.EndBlocks; @@ -32,7 +32,7 @@ public class ParticleTenaneaPetal extends TextureSheetParticle { pickSprite(sprites); if (provider == null) { - IColorProvider block = (IColorProvider) EndBlocks.TENANEA_FLOWERS; + CustomColorProvider block = (CustomColorProvider) EndBlocks.TENANEA_FLOWERS; provider = block.getProvider(); } int color = provider.getColor(null, null, new BlockPos(x, y, z), 0); diff --git a/src/main/java/ru/betterend/recipe/AlloyingRecipes.java b/src/main/java/ru/betterend/recipe/AlloyingRecipes.java index 7050c34e..ea228cf6 100644 --- a/src/main/java/ru/betterend/recipe/AlloyingRecipes.java +++ b/src/main/java/ru/betterend/recipe/AlloyingRecipes.java @@ -9,12 +9,44 @@ import ru.betterend.registry.EndTags; public class AlloyingRecipes { public static void register() { - AlloyingRecipe.Builder.create("additional_iron").setInput(EndTags.ALLOYING_IRON, EndTags.ALLOYING_IRON).setOutput(Items.IRON_INGOT, 3).setExpiriense(2.1F).build(); - AlloyingRecipe.Builder.create("additional_gold").setInput(EndTags.ALLOYING_GOLD, EndTags.ALLOYING_GOLD).setOutput(Items.GOLD_INGOT, 3).setExpiriense(3F).build(); - AlloyingRecipe.Builder.create("additional_copper").setInput(EndTags.ALLOYING_COPPER, EndTags.ALLOYING_COPPER).setOutput(Items.COPPER_INGOT, 3).setExpiriense(3F).build(); - AlloyingRecipe.Builder.create("additional_netherite").setInput(Blocks.ANCIENT_DEBRIS, Blocks.ANCIENT_DEBRIS).setOutput(Items.NETHERITE_SCRAP, 3).setExpiriense(6F).setSmeltTime(1000).build(); - AlloyingRecipe.Builder.create("terminite_ingot").setInput(Items.IRON_INGOT, EndItems.ENDER_DUST).setOutput(EndBlocks.TERMINITE.ingot, 1).setExpiriense(2.5F).setSmeltTime(450).build(); - AlloyingRecipe.Builder.create("aeternium_ingot").setInput(EndBlocks.TERMINITE.ingot, Items.NETHERITE_INGOT).setOutput(EndItems.AETERNIUM_INGOT, 1).setExpiriense(4.5F).setSmeltTime(850).build(); - AlloyingRecipe.Builder.create("terminite_ingot_thallasium").setInput(EndBlocks.THALLASIUM.ingot, EndItems.ENDER_DUST).setOutput(EndBlocks.TERMINITE.ingot, 1).setExpiriense(2.5F).setSmeltTime(450).build(); + AlloyingRecipe.Builder.create("additional_iron") + .setInput(EndTags.ALLOYING_IRON, EndTags.ALLOYING_IRON) + .setOutput(Items.IRON_INGOT, 3) + .setExpiriense(2.1F) + .build(); + AlloyingRecipe.Builder.create("additional_gold") + .setInput(EndTags.ALLOYING_GOLD, EndTags.ALLOYING_GOLD) + .setOutput(Items.GOLD_INGOT, 3) + .setExpiriense(3F) + .build(); + AlloyingRecipe.Builder.create("additional_copper") + .setInput(EndTags.ALLOYING_COPPER, EndTags.ALLOYING_COPPER) + .setOutput(Items.COPPER_INGOT, 3) + .setExpiriense(3F) + .build(); + AlloyingRecipe.Builder.create("additional_netherite") + .setInput(Blocks.ANCIENT_DEBRIS, Blocks.ANCIENT_DEBRIS) + .setOutput(Items.NETHERITE_SCRAP, 3) + .setExpiriense(6F) + .setSmeltTime(1000) + .build(); + AlloyingRecipe.Builder.create("terminite_ingot") + .setInput(Items.IRON_INGOT, EndItems.ENDER_DUST) + .setOutput(EndBlocks.TERMINITE.ingot, 1) + .setExpiriense(2.5F) + .setSmeltTime(450) + .build(); + AlloyingRecipe.Builder.create("aeternium_ingot") + .setInput(EndBlocks.TERMINITE.ingot, Items.NETHERITE_INGOT) + .setOutput(EndItems.AETERNIUM_INGOT, 1) + .setExpiriense(4.5F) + .setSmeltTime(850) + .build(); + AlloyingRecipe.Builder.create("terminite_ingot_thallasium") + .setInput(EndBlocks.THALLASIUM.ingot, EndItems.ENDER_DUST) + .setOutput(EndBlocks.TERMINITE.ingot, 1) + .setExpiriense(2.5F) + .setSmeltTime(450) + .build(); } } diff --git a/src/main/java/ru/betterend/recipe/AnvilRecipes.java b/src/main/java/ru/betterend/recipe/AnvilRecipes.java index 60bfc6d5..db079e31 100644 --- a/src/main/java/ru/betterend/recipe/AnvilRecipes.java +++ b/src/main/java/ru/betterend/recipe/AnvilRecipes.java @@ -7,16 +7,68 @@ import ru.betterend.registry.EndItems; public class AnvilRecipes { public static void register() { - AnvilRecipe.Builder.create("ender_pearl_to_dust").setInput(Items.ENDER_PEARL).setOutput(EndItems.ENDER_DUST).setToolLevel(4).setDamage(5).build(); - AnvilRecipe.Builder.create("ender_shard_to_dust").setInput(EndItems.ENDER_SHARD).setOutput(EndItems.ENDER_DUST).setToolLevel(0).setDamage(3).build(); + AnvilRecipe.Builder.create("ender_pearl_to_dust") + .setInput(Items.ENDER_PEARL) + .setOutput(EndItems.ENDER_DUST) + .setToolLevel(4) + .setDamage(5) + .build(); + AnvilRecipe.Builder.create("ender_shard_to_dust") + .setInput(EndItems.ENDER_SHARD) + .setOutput(EndItems.ENDER_DUST) + .setToolLevel(0) + .setDamage(3) + .build(); int anvilLevel = EndToolMaterial.AETERNIUM.getLevel(); - AnvilRecipe.Builder.create("aeternium_axe_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_AXE_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); - AnvilRecipe.Builder.create("aeternium_pickaxe_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_PICKAXE_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); - AnvilRecipe.Builder.create("aeternium_shovel_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_SHOVEL_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); - AnvilRecipe.Builder.create("aeternium_hoe_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_HOE_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); - AnvilRecipe.Builder.create("aeternium_hammer_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_HAMMER_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); - AnvilRecipe.Builder.create("aeternium_sword_blade").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_SWORD_BLADE).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); - AnvilRecipe.Builder.create("aeternium_forged_plate").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_FORGED_PLATE).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); + AnvilRecipe.Builder.create("aeternium_axe_head") + .setInput(EndItems.AETERNIUM_INGOT) + .setOutput(EndItems.AETERNIUM_AXE_HEAD) + .setAnvilLevel(anvilLevel) + .setToolLevel(anvilLevel) + .setDamage(6) + .build(); + AnvilRecipe.Builder.create("aeternium_pickaxe_head") + .setInput(EndItems.AETERNIUM_INGOT) + .setOutput(EndItems.AETERNIUM_PICKAXE_HEAD) + .setAnvilLevel(anvilLevel) + .setToolLevel(anvilLevel) + .setDamage(6) + .build(); + AnvilRecipe.Builder.create("aeternium_shovel_head") + .setInput(EndItems.AETERNIUM_INGOT) + .setOutput(EndItems.AETERNIUM_SHOVEL_HEAD) + .setAnvilLevel(anvilLevel) + .setToolLevel(anvilLevel) + .setDamage(6) + .build(); + AnvilRecipe.Builder.create("aeternium_hoe_head") + .setInput(EndItems.AETERNIUM_INGOT) + .setOutput(EndItems.AETERNIUM_HOE_HEAD) + .setAnvilLevel(anvilLevel) + .setToolLevel(anvilLevel) + .setDamage(6) + .build(); + AnvilRecipe.Builder.create("aeternium_hammer_head") + .setInput(EndItems.AETERNIUM_INGOT) + .setOutput(EndItems.AETERNIUM_HAMMER_HEAD) + .setAnvilLevel(anvilLevel) + .setToolLevel(anvilLevel) + .setDamage(6) + .build(); + AnvilRecipe.Builder.create("aeternium_sword_blade") + .setInput(EndItems.AETERNIUM_INGOT) + .setOutput(EndItems.AETERNIUM_SWORD_BLADE) + .setAnvilLevel(anvilLevel) + .setToolLevel(anvilLevel) + .setDamage(6) + .build(); + AnvilRecipe.Builder.create("aeternium_forged_plate") + .setInput(EndItems.AETERNIUM_INGOT) + .setOutput(EndItems.AETERNIUM_FORGED_PLATE) + .setAnvilLevel(anvilLevel) + .setToolLevel(anvilLevel) + .setDamage(6) + .build(); } } diff --git a/src/main/java/ru/betterend/recipe/CraftingRecipes.java b/src/main/java/ru/betterend/recipe/CraftingRecipes.java index d83ae9e9..64a6a0b6 100644 --- a/src/main/java/ru/betterend/recipe/CraftingRecipes.java +++ b/src/main/java/ru/betterend/recipe/CraftingRecipes.java @@ -17,36 +17,129 @@ import ru.betterend.registry.EndItems; public class CraftingRecipes { public static void register() { - GridRecipe.make(BetterEnd.MOD_ID, "ender_perl_to_block", EndBlocks.ENDER_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("OO", "OO").addMaterial('O', Items.ENDER_PEARL).build(); - GridRecipe.make(BetterEnd.MOD_ID, "ender_block_to_perl", Items.ENDER_PEARL).checkConfig(Configs.RECIPE_CONFIG).addMaterial('#', EndBlocks.ENDER_BLOCK).setOutputCount(4).setList("#").build(); + GridRecipe.make(BetterEnd.MOD_ID, "ender_perl_to_block", EndBlocks.ENDER_BLOCK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("OO", "OO") + .addMaterial('O', Items.ENDER_PEARL) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "ender_block_to_perl", Items.ENDER_PEARL) + .checkConfig(Configs.RECIPE_CONFIG) + .addMaterial('#', EndBlocks.ENDER_BLOCK) + .setOutputCount(4) + .setList("#") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "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).addMaterial('V', TagAPI.FURNACES).build(); + GridRecipe.make(BetterEnd.MOD_ID, "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) + .addMaterial('V', TagAPI.FURNACES) + .build(); - registerPedestal("andesite_pedestal", EndBlocks.ANDESITE_PEDESTAL, Blocks.POLISHED_ANDESITE_SLAB, Blocks.POLISHED_ANDESITE); - registerPedestal("diorite_pedestal", EndBlocks.DIORITE_PEDESTAL, Blocks.POLISHED_DIORITE_SLAB, Blocks.POLISHED_DIORITE); - registerPedestal("granite_pedestal", EndBlocks.GRANITE_PEDESTAL, Blocks.POLISHED_GRANITE_SLAB, Blocks.POLISHED_GRANITE); + registerPedestal( + "andesite_pedestal", + EndBlocks.ANDESITE_PEDESTAL, + Blocks.POLISHED_ANDESITE_SLAB, + Blocks.POLISHED_ANDESITE + ); + registerPedestal( + "diorite_pedestal", + EndBlocks.DIORITE_PEDESTAL, + Blocks.POLISHED_DIORITE_SLAB, + Blocks.POLISHED_DIORITE + ); + registerPedestal( + "granite_pedestal", + EndBlocks.GRANITE_PEDESTAL, + Blocks.POLISHED_GRANITE_SLAB, + Blocks.POLISHED_GRANITE + ); registerPedestal("quartz_pedestal", EndBlocks.QUARTZ_PEDESTAL, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_PILLAR); registerPedestal("purpur_pedestal", EndBlocks.PURPUR_PEDESTAL, Blocks.PURPUR_SLAB, Blocks.PURPUR_PILLAR); - GridRecipe.make(BetterEnd.MOD_ID, "infusion_pedestal", EndBlocks.INFUSION_PEDESTAL).checkConfig(Configs.RECIPE_CONFIG).setShape(" Y ", "O#O", " # ").addMaterial('O', Items.ENDER_PEARL).addMaterial('Y', Items.ENDER_EYE).addMaterial('#', Blocks.OBSIDIAN).build(); + GridRecipe.make(BetterEnd.MOD_ID, "infusion_pedestal", EndBlocks.INFUSION_PEDESTAL) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape(" Y ", "O#O", " # ") + .addMaterial('O', Items.ENDER_PEARL) + .addMaterial('Y', Items.ENDER_EYE) + .addMaterial('#', Blocks.OBSIDIAN) + .build(); String material = "aeternium"; - GridRecipe.make(BetterEnd.MOD_ID, material + "_block", EndBlocks.AETERNIUM_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("III", "III", "III").addMaterial('I', EndItems.AETERNIUM_INGOT).build(); - GridRecipe.make(BetterEnd.MOD_ID, material + "_block_to_ingot", EndItems.AETERNIUM_INGOT).checkConfig(Configs.RECIPE_CONFIG).addMaterial('#', EndBlocks.AETERNIUM_BLOCK).setOutputCount(9).setList("#").build(); + GridRecipe.make(BetterEnd.MOD_ID, material + "_block", EndBlocks.AETERNIUM_BLOCK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("III", "III", "III") + .addMaterial('I', EndItems.AETERNIUM_INGOT) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, material + "_block_to_ingot", EndItems.AETERNIUM_INGOT) + .checkConfig(Configs.RECIPE_CONFIG) + .addMaterial('#', EndBlocks.AETERNIUM_BLOCK) + .setOutputCount(9) + .setList("#") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "blue_vine_seed_dye", Items.BLUE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.BLUE_VINE_SEED).build(); - GridRecipe.make(BetterEnd.MOD_ID, "creeping_moss_dye", Items.CYAN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CREEPING_MOSS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_dye", Items.YELLOW_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_tall_dye", Items.YELLOW_DYE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL).build(); - GridRecipe.make(BetterEnd.MOD_ID, "shadow_plant_dye", Items.BLACK_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.SHADOW_PLANT).build(); + GridRecipe.make(BetterEnd.MOD_ID, "blue_vine_seed_dye", Items.BLUE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.BLUE_VINE_SEED) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "creeping_moss_dye", Items.CYAN_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.CREEPING_MOSS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_dye", Items.YELLOW_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.UMBRELLA_MOSS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_tall_dye", Items.YELLOW_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(2) + .setList("#") + .addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "shadow_plant_dye", Items.BLACK_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.SHADOW_PLANT) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "paper", Items.PAPER).checkConfig(Configs.RECIPE_CONFIG).setShape("###").addMaterial('#', EndItems.END_LILY_LEAF_DRIED).setOutputCount(3).build(); + GridRecipe.make(BetterEnd.MOD_ID, "paper", Items.PAPER) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###") + .addMaterial('#', EndItems.END_LILY_LEAF_DRIED) + .setOutputCount(3) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "aurora_block", EndBlocks.AURORA_CRYSTAL).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.CRYSTAL_SHARDS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "lotus_block", EndBlocks.END_LOTUS.log).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.END_LOTUS_STEM).build(); - GridRecipe.make(BetterEnd.MOD_ID, "needlegrass_stick", Items.STICK).setList("#").checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).addMaterial('#', EndBlocks.NEEDLEGRASS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_seeds", EndBlocks.SHADOW_BERRY).checkConfig(Configs.RECIPE_CONFIG).setList("#").setOutputCount(4).addMaterial('#', EndItems.SHADOW_BERRY_RAW).build(); - GridRecipe.make(BetterEnd.MOD_ID, "purple_polypore_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.PURPLE_POLYPORE).build(); + GridRecipe.make(BetterEnd.MOD_ID, "aurora_block", EndBlocks.AURORA_CRYSTAL) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', EndItems.CRYSTAL_SHARDS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "lotus_block", EndBlocks.END_LOTUS.log) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', EndBlocks.END_LOTUS_STEM) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "needlegrass_stick", Items.STICK) + .setList("#") + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(2) + .addMaterial('#', EndBlocks.NEEDLEGRASS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_seeds", EndBlocks.SHADOW_BERRY) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .setOutputCount(4) + .addMaterial('#', EndItems.SHADOW_BERRY_RAW) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "purple_polypore_dye", Items.PURPLE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.PURPLE_POLYPORE) + .build(); registerLantern("end_stone_lantern", EndBlocks.END_STONE_LANTERN, Blocks.END_STONE_BRICK_SLAB); registerLantern("andesite_lantern", EndBlocks.ANDESITE_LANTERN, Blocks.ANDESITE_SLAB); @@ -56,84 +149,315 @@ public class CraftingRecipes { registerLantern("purpur_lantern", EndBlocks.PURPUR_LANTERN, Blocks.PURPUR_SLAB); registerLantern("blackstone_lantern", EndBlocks.BLACKSTONE_LANTERN, Blocks.BLACKSTONE_SLAB); - GridRecipe.make(BetterEnd.MOD_ID, "amber_gem", EndItems.AMBER_GEM).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.RAW_AMBER).build(); - GridRecipe.make(BetterEnd.MOD_ID, "amber_block", EndBlocks.AMBER_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.AMBER_GEM).build(); - GridRecipe.make(BetterEnd.MOD_ID, "amber_gem_block", EndItems.AMBER_GEM).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', EndBlocks.AMBER_BLOCK).build(); - GridRecipe.make(BetterEnd.MOD_ID, "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(); - GridRecipe.make(BetterEnd.MOD_ID, "twisted_moss_dye", Items.PINK_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TWISTED_MOSS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "byshy_grass_dye", Items.MAGENTA_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.BUSHY_GRASS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "tail_moss_dye", Items.GRAY_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TAIL_MOSS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "petal_block", EndBlocks.HYDRALUX_PETAL_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.HYDRALUX_PETAL).build(); - GridRecipe.make(BetterEnd.MOD_ID, "petal_white_dye", Items.WHITE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndItems.HYDRALUX_PETAL).build(); + GridRecipe.make(BetterEnd.MOD_ID, "amber_gem", EndItems.AMBER_GEM) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', EndItems.RAW_AMBER) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "amber_block", EndBlocks.AMBER_BLOCK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', EndItems.AMBER_GEM) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "amber_gem_block", EndItems.AMBER_GEM) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setList("#") + .addMaterial('#', EndBlocks.AMBER_BLOCK) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "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(); + GridRecipe.make(BetterEnd.MOD_ID, "twisted_moss_dye", Items.PINK_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.TWISTED_MOSS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "byshy_grass_dye", Items.MAGENTA_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.BUSHY_GRASS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "tail_moss_dye", Items.GRAY_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.TAIL_MOSS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "petal_block", EndBlocks.HYDRALUX_PETAL_BLOCK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', EndItems.HYDRALUX_PETAL) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "petal_white_dye", Items.WHITE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndItems.HYDRALUX_PETAL) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "sweet_berry_jelly", EndItems.SWEET_BERRY_JELLY).checkConfig(Configs.RECIPE_CONFIG).setList("JWSB").addMaterial('J', EndItems.GELATINE).addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)).addMaterial('S', Items.SUGAR).addMaterial('B', Items.SWEET_BERRIES).build(); + GridRecipe.make(BetterEnd.MOD_ID, "sweet_berry_jelly", EndItems.SWEET_BERRY_JELLY) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("JWSB") + .addMaterial('J', EndItems.GELATINE) + .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) + .addMaterial('S', Items.SUGAR) + .addMaterial('B', Items.SWEET_BERRIES) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.SHADOW_BERRY_JELLY).checkConfig(Configs.RECIPE_CONFIG).setList("JWSB").addMaterial('J', EndItems.GELATINE).addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)).addMaterial('S', Items.SUGAR).addMaterial('B', EndItems.SHADOW_BERRY_COOKED).build(); + GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.SHADOW_BERRY_JELLY) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("JWSB") + .addMaterial('J', EndItems.GELATINE) + .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) + .addMaterial('S', Items.SUGAR) + .addMaterial('B', EndItems.SHADOW_BERRY_COOKED) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.BLOSSOM_BERRY_JELLY).checkConfig(Configs.RECIPE_CONFIG).setList("JWSB").addMaterial('J', EndItems.GELATINE).addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)).addMaterial('S', Items.SUGAR).addMaterial('B', EndItems.BLOSSOM_BERRY).build(); + GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.BLOSSOM_BERRY_JELLY) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("JWSB") + .addMaterial('J', EndItems.GELATINE) + .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) + .addMaterial('S', Items.SUGAR) + .addMaterial('B', EndItems.BLOSSOM_BERRY) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "sulphur_gunpowder", Items.GUNPOWDER).checkConfig(Configs.RECIPE_CONFIG).setList("SCB").addMaterial('S', EndItems.CRYSTALLINE_SULPHUR).addMaterial('C', Items.COAL, Items.CHARCOAL).addMaterial('B', Items.BONE_MEAL).build(); + GridRecipe.make(BetterEnd.MOD_ID, "sulphur_gunpowder", Items.GUNPOWDER) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("SCB") + .addMaterial('S', EndItems.CRYSTALLINE_SULPHUR) + .addMaterial('C', Items.COAL, Items.CHARCOAL) + .addMaterial('B', Items.BONE_MEAL) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "dense_emerald_ice", EndBlocks.DENSE_EMERALD_ICE).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.EMERALD_ICE).build(); - GridRecipe.make(BetterEnd.MOD_ID, "ancient_emerald_ice", EndBlocks.ANCIENT_EMERALD_ICE).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', EndBlocks.DENSE_EMERALD_ICE).build(); + GridRecipe.make(BetterEnd.MOD_ID, "dense_emerald_ice", EndBlocks.DENSE_EMERALD_ICE) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', EndBlocks.EMERALD_ICE) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "ancient_emerald_ice", EndBlocks.ANCIENT_EMERALD_ICE) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "###", "###") + .addMaterial('#', EndBlocks.DENSE_EMERALD_ICE) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "charnia_cyan_dye", Items.CYAN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_CYAN).build(); - GridRecipe.make(BetterEnd.MOD_ID, "charnia_green_dye", Items.GREEN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_GREEN).build(); - GridRecipe.make(BetterEnd.MOD_ID, "charnia_light_blue_dye", Items.LIGHT_BLUE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_LIGHT_BLUE).build(); - GridRecipe.make(BetterEnd.MOD_ID, "charnia_orange_dye", Items.ORANGE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_ORANGE).build(); - GridRecipe.make(BetterEnd.MOD_ID, "charnia_purple_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_PURPLE).build(); - GridRecipe.make(BetterEnd.MOD_ID, "charnia_red_dye", Items.RED_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_RED).build(); + GridRecipe.make(BetterEnd.MOD_ID, "charnia_cyan_dye", Items.CYAN_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.CHARNIA_CYAN) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "charnia_green_dye", Items.GREEN_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.CHARNIA_GREEN) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "charnia_light_blue_dye", Items.LIGHT_BLUE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.CHARNIA_LIGHT_BLUE) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "charnia_orange_dye", Items.ORANGE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.CHARNIA_ORANGE) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "charnia_purple_dye", Items.PURPLE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.CHARNIA_PURPLE) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "charnia_red_dye", Items.RED_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.CHARNIA_RED) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "respawn_obelisk", EndBlocks.RESPAWN_OBELISK).checkConfig(Configs.RECIPE_CONFIG).setShape("CSC", "CSC", "AAA").addMaterial('C', EndBlocks.AURORA_CRYSTAL).addMaterial('S', EndItems.ETERNAL_CRYSTAL).addMaterial('A', EndBlocks.AMBER_BLOCK).build(); + GridRecipe.make(BetterEnd.MOD_ID, "respawn_obelisk", EndBlocks.RESPAWN_OBELISK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("CSC", "CSC", "AAA") + .addMaterial('C', EndBlocks.AURORA_CRYSTAL) + .addMaterial('S', EndItems.ETERNAL_CRYSTAL) + .addMaterial('A', EndBlocks.AMBER_BLOCK) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye_tall", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS_TALL).build(); + GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye", Items.PURPLE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("#") + .addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye_tall", Items.PURPLE_DYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(2) + .setList("#") + .addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS_TALL) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "leather_to_stripes", EndItems.LEATHER_STRIPE).checkConfig(Configs.RECIPE_CONFIG).setList("L").addMaterial('L', Items.LEATHER).setOutputCount(3).build(); - GridRecipe.make(BetterEnd.MOD_ID, "stripes_to_leather", Items.LEATHER).checkConfig(Configs.RECIPE_CONFIG).setList("SSS").addMaterial('S', EndItems.LEATHER_STRIPE).build(); - GridRecipe.make(BetterEnd.MOD_ID, "leather_wrapped_stick", EndItems.LEATHER_WRAPPED_STICK).checkConfig(Configs.RECIPE_CONFIG).setList("SL").addMaterial('S', Items.STICK).addMaterial('L', EndItems.LEATHER_STRIPE).build(); + GridRecipe.make(BetterEnd.MOD_ID, "leather_to_stripes", EndItems.LEATHER_STRIPE) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("L") + .addMaterial('L', Items.LEATHER) + .setOutputCount(3) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "stripes_to_leather", Items.LEATHER) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("SSS") + .addMaterial('S', EndItems.LEATHER_STRIPE) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "leather_wrapped_stick", EndItems.LEATHER_WRAPPED_STICK) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("SL") + .addMaterial('S', Items.STICK) + .addMaterial('L', EndItems.LEATHER_STRIPE) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "fiber_string", Items.STRING).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("#", "#", "#").addMaterial('#', EndItems.SILK_FIBER).build(); + GridRecipe.make(BetterEnd.MOD_ID, "fiber_string", Items.STRING) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(6) + .setShape("#", "#", "#") + .addMaterial('#', EndItems.SILK_FIBER) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "ender_eye_amber", Items.ENDER_EYE).checkConfig(Configs.RECIPE_CONFIG).setShape("SAS", "APA", "SAS").addMaterial('S', EndItems.CRYSTAL_SHARDS).addMaterial('A', EndItems.AMBER_GEM).addMaterial('P', Items.ENDER_PEARL).build(); + GridRecipe.make(BetterEnd.MOD_ID, "ender_eye_amber", Items.ENDER_EYE) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("SAS", "APA", "SAS") + .addMaterial('S', EndItems.CRYSTAL_SHARDS) + .addMaterial('A', EndItems.AMBER_GEM) + .addMaterial('P', Items.ENDER_PEARL) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "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(); - GridRecipe.make(BetterEnd.MOD_ID, "gold_chandelier", EndBlocks.GOLD_CHANDELIER).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', Items.GOLD_INGOT).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build(); + GridRecipe.make(BetterEnd.MOD_ID, "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(); + GridRecipe.make(BetterEnd.MOD_ID, "gold_chandelier", EndBlocks.GOLD_CHANDELIER) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("I#I", " # ") + .addMaterial('#', Items.GOLD_INGOT) + .addMaterial('I', EndItems.LUMECORN_ROD) + .setGroup("end_metal_chandelier") + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "missing_tile", EndBlocks.MISSING_TILE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("#P", "P#").addMaterial('#', EndBlocks.VIOLECITE.stone, EndBlocks.VIOLECITE.bricks, EndBlocks.VIOLECITE.tiles).addMaterial('P', Blocks.PURPUR_BLOCK).build(); + GridRecipe.make(BetterEnd.MOD_ID, "missing_tile", EndBlocks.MISSING_TILE) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setShape("#P", "P#") + .addMaterial('#', EndBlocks.VIOLECITE.stone, EndBlocks.VIOLECITE.bricks, EndBlocks.VIOLECITE.tiles) + .addMaterial('P', Blocks.PURPUR_BLOCK) + .build(); registerHammer("iron", Items.IRON_INGOT, EndItems.IRON_HAMMER); registerHammer("golden", Items.GOLD_INGOT, EndItems.GOLDEN_HAMMER); registerHammer("diamond", Items.DIAMOND, EndItems.DIAMOND_HAMMER); - GridRecipe.make(BetterEnd.MOD_ID, "charcoal_block", EndBlocks.CHARCOAL_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', Items.CHARCOAL).build(); - GridRecipe.make(BetterEnd.MOD_ID, "charcoal_from_block", Items.CHARCOAL).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', EndBlocks.CHARCOAL_BLOCK).build(); - GridRecipe.make(BetterEnd.MOD_ID, "end_stone_furnace", EndBlocks.END_STONE_FURNACE).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', Blocks.END_STONE).build(); - GridRecipe.make(BetterEnd.MOD_ID, "filalux_lantern", EndBlocks.FILALUX_LANTERN).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', EndBlocks.FILALUX).build(); + GridRecipe.make(BetterEnd.MOD_ID, "charcoal_block", EndBlocks.CHARCOAL_BLOCK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "###", "###") + .addMaterial('#', Items.CHARCOAL) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "charcoal_from_block", Items.CHARCOAL) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(9) + .setList("#") + .addMaterial('#', EndBlocks.CHARCOAL_BLOCK) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "end_stone_furnace", EndBlocks.END_STONE_FURNACE) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "# #", "###") + .addMaterial('#', Blocks.END_STONE) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "filalux_lantern", EndBlocks.FILALUX_LANTERN) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###", "###", "###") + .addMaterial('#', EndBlocks.FILALUX) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "silk_moth_hive", EndBlocks.SILK_MOTH_HIVE).checkConfig(Configs.RECIPE_CONFIG).setShape("#L#", "LML", "#L#").addMaterial('#', EndBlocks.TENANEA.planks).addMaterial('L', EndBlocks.TENANEA_LEAVES).addMaterial('M', EndItems.SILK_MOTH_MATRIX).build(); + GridRecipe.make(BetterEnd.MOD_ID, "silk_moth_hive", EndBlocks.SILK_MOTH_HIVE) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("#L#", "LML", "#L#") + .addMaterial('#', EndBlocks.TENANEA.planks) + .addMaterial('L', EndBlocks.TENANEA_LEAVES) + .addMaterial('M', EndItems.SILK_MOTH_MATRIX) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "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).addMaterial('S', Items.SUGAR).build(); + GridRecipe.make(BetterEnd.MOD_ID, "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) + .addMaterial('S', Items.SUGAR) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_seeds", EndBlocks.CAVE_PUMPKIN_SEED).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', EndBlocks.CAVE_PUMPKIN).build(); + GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_seeds", EndBlocks.CAVE_PUMPKIN_SEED) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(4) + .setList("#") + .addMaterial('#', EndBlocks.CAVE_PUMPKIN) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block", EndBlocks.NEON_CACTUS_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.NEON_CACTUS).build(); - GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_slab", EndBlocks.NEON_CACTUS_BLOCK_SLAB).checkConfig(Configs.RECIPE_CONFIG).setShape("###").setOutputCount(6).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build(); - GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_stairs", EndBlocks.NEON_CACTUS_BLOCK_STAIRS).checkConfig(Configs.RECIPE_CONFIG).setShape("# ", "## ", "###").setOutputCount(4).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build(); + GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block", EndBlocks.NEON_CACTUS_BLOCK) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("##", "##") + .addMaterial('#', EndBlocks.NEON_CACTUS) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_slab", EndBlocks.NEON_CACTUS_BLOCK_SLAB) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("###") + .setOutputCount(6) + .addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_stairs", EndBlocks.NEON_CACTUS_BLOCK_STAIRS) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("# ", "## ", "###") + .setOutputCount(4) + .addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK) + .build(); - GridRecipe.make(BetterEnd.MOD_ID, "sugar_from_root", Items.SUGAR).checkConfig(Configs.RECIPE_CONFIG).setList("###").addMaterial('#', EndItems.AMBER_ROOT_RAW).build(); - GridRecipe.make(BetterEnd.MOD_ID, "endstone_flower_pot", EndBlocks.ENDSTONE_FLOWER_POT).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("# #", " # ").addMaterial('#', Blocks.END_STONE_BRICKS).setGroup("end_pots").build(); + GridRecipe.make(BetterEnd.MOD_ID, "sugar_from_root", Items.SUGAR) + .checkConfig(Configs.RECIPE_CONFIG) + .setList("###") + .addMaterial('#', EndItems.AMBER_ROOT_RAW) + .build(); + GridRecipe.make(BetterEnd.MOD_ID, "endstone_flower_pot", EndBlocks.ENDSTONE_FLOWER_POT) + .checkConfig(Configs.RECIPE_CONFIG) + .setOutputCount(3) + .setShape("# #", " # ") + .addMaterial('#', Blocks.END_STONE_BRICKS) + .setGroup("end_pots") + .build(); } private static void registerLantern(String name, Block lantern, Block slab) { - GridRecipe.make(BetterEnd.MOD_ID, name, lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('#', EndItems.CRYSTAL_SHARDS).addMaterial('S', slab).setGroup("end_stone_lanterns").build(); + GridRecipe.make(BetterEnd.MOD_ID, name, lantern) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("S", "#", "S") + .addMaterial('#', EndItems.CRYSTAL_SHARDS) + .addMaterial('S', slab) + .setGroup("end_stone_lanterns") + .build(); } public static void registerPedestal(String name, Block pedestal, Block slab, Block pillar) { - GridRecipe.make(BetterEnd.MOD_ID, name, pedestal).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('S', slab).addMaterial('#', pillar).setOutputCount(2).build(); + GridRecipe.make(BetterEnd.MOD_ID, name, pedestal) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("S", "#", "S") + .addMaterial('S', slab) + .addMaterial('#', pillar) + .setOutputCount(2) + .build(); } private static void registerHammer(String name, Item material, Item result) { - GridRecipe.make(BetterEnd.MOD_ID, name + "_hammer", result).checkConfig(Configs.RECIPE_CONFIG).setShape("I I", "I#I", " # ").addMaterial('I', material).addMaterial('#', Items.STICK).build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_hammer", result) + .checkConfig(Configs.RECIPE_CONFIG) + .setShape("I I", "I#I", " # ") + .addMaterial('I', material) + .addMaterial('#', Items.STICK) + .build(); } } diff --git a/src/main/java/ru/betterend/recipe/FurnaceRecipes.java b/src/main/java/ru/betterend/recipe/FurnaceRecipes.java index 635826d6..0b3446bd 100644 --- a/src/main/java/ru/betterend/recipe/FurnaceRecipes.java +++ b/src/main/java/ru/betterend/recipe/FurnaceRecipes.java @@ -10,13 +10,35 @@ import ru.betterend.registry.EndItems; public class FurnaceRecipes { public static void register() { - FurnaceRecipe.make(BetterEnd.MOD_ID, "end_lily_leaf_dried", EndItems.END_LILY_LEAF, EndItems.END_LILY_LEAF_DRIED).checkConfig(Configs.RECIPE_CONFIG).build(); - FurnaceRecipe.make(BetterEnd.MOD_ID, "end_glass", EndBlocks.ENDSTONE_DUST, Blocks.GLASS).checkConfig(Configs.RECIPE_CONFIG).build(); - FurnaceRecipe.make(BetterEnd.MOD_ID, "end_berry", EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED).checkConfig(Configs.RECIPE_CONFIG).buildFoodlike(); - FurnaceRecipe.make(BetterEnd.MOD_ID, "end_fish", EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED).checkConfig(Configs.RECIPE_CONFIG).buildFoodlike(); - FurnaceRecipe.make(BetterEnd.MOD_ID, "slime_ball", EndBlocks.JELLYSHROOM_CAP_PURPLE, Items.SLIME_BALL).checkConfig(Configs.RECIPE_CONFIG).build(); - FurnaceRecipe.make(BetterEnd.MOD_ID, "menger_sponge", EndBlocks.MENGER_SPONGE_WET, EndBlocks.MENGER_SPONGE).checkConfig(Configs.RECIPE_CONFIG).build(); - FurnaceRecipe.make(BetterEnd.MOD_ID, "chorus_mushroom", EndItems.CHORUS_MUSHROOM_RAW, EndItems.CHORUS_MUSHROOM_COOKED).checkConfig(Configs.RECIPE_CONFIG).buildFoodlike(); - FurnaceRecipe.make(BetterEnd.MOD_ID, "bolux_mushroom", EndBlocks.BOLUX_MUSHROOM, EndItems.BOLUX_MUSHROOM_COOKED).checkConfig(Configs.RECIPE_CONFIG).buildFoodlike(); + FurnaceRecipe.make( + BetterEnd.MOD_ID, + "end_lily_leaf_dried", + EndItems.END_LILY_LEAF, + EndItems.END_LILY_LEAF_DRIED + ).checkConfig(Configs.RECIPE_CONFIG).build(); + FurnaceRecipe.make(BetterEnd.MOD_ID, "end_glass", EndBlocks.ENDSTONE_DUST, Blocks.GLASS) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + FurnaceRecipe.make(BetterEnd.MOD_ID, "end_berry", EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED) + .checkConfig(Configs.RECIPE_CONFIG) + .buildFoodlike(); + FurnaceRecipe.make(BetterEnd.MOD_ID, "end_fish", EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED) + .checkConfig(Configs.RECIPE_CONFIG) + .buildFoodlike(); + FurnaceRecipe.make(BetterEnd.MOD_ID, "slime_ball", EndBlocks.JELLYSHROOM_CAP_PURPLE, Items.SLIME_BALL) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + FurnaceRecipe.make(BetterEnd.MOD_ID, "menger_sponge", EndBlocks.MENGER_SPONGE_WET, EndBlocks.MENGER_SPONGE) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + FurnaceRecipe.make( + BetterEnd.MOD_ID, + "chorus_mushroom", + EndItems.CHORUS_MUSHROOM_RAW, + EndItems.CHORUS_MUSHROOM_COOKED + ).checkConfig(Configs.RECIPE_CONFIG).buildFoodlike(); + FurnaceRecipe.make(BetterEnd.MOD_ID, "bolux_mushroom", EndBlocks.BOLUX_MUSHROOM, EndItems.BOLUX_MUSHROOM_COOKED) + .checkConfig(Configs.RECIPE_CONFIG) + .buildFoodlike(); } } diff --git a/src/main/java/ru/betterend/recipe/InfusionRecipes.java b/src/main/java/ru/betterend/recipe/InfusionRecipes.java index 631e806c..93ce4fce 100644 --- a/src/main/java/ru/betterend/recipe/InfusionRecipes.java +++ b/src/main/java/ru/betterend/recipe/InfusionRecipes.java @@ -13,56 +13,597 @@ import ru.betterend.registry.EndItems; public class InfusionRecipes { public static void register() { - InfusionRecipe.Builder.create("runed_flavolite").setInput(EndBlocks.FLAVOLITE.polished).setOutput(EndBlocks.FLAVOLITE_RUNED).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(100).build(); + InfusionRecipe.Builder.create("runed_flavolite") + .setInput(EndBlocks.FLAVOLITE.polished) + .setOutput(EndBlocks.FLAVOLITE_RUNED) + .addCatalyst(0, EndItems.CRYSTAL_SHARDS) + .addCatalyst(2, EndItems.CRYSTAL_SHARDS) + .addCatalyst(4, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.CRYSTAL_SHARDS) + .setTime(100) + .build(); - InfusionRecipe.Builder.create("eternal_crystal").setInput(Items.END_CRYSTAL).setOutput(EndItems.ETERNAL_CRYSTAL).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).addCatalyst(1, EndItems.ENDER_SHARD).addCatalyst(3, EndItems.ENDER_SHARD).addCatalyst(5, EndItems.ENDER_SHARD).addCatalyst(7, EndItems.ENDER_SHARD).setTime(250).build(); + InfusionRecipe.Builder.create("eternal_crystal") + .setInput(Items.END_CRYSTAL) + .setOutput(EndItems.ETERNAL_CRYSTAL) + .addCatalyst(0, EndItems.CRYSTAL_SHARDS) + .addCatalyst(2, EndItems.CRYSTAL_SHARDS) + .addCatalyst(4, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.CRYSTAL_SHARDS) + .addCatalyst(1, EndItems.ENDER_SHARD) + .addCatalyst(3, EndItems.ENDER_SHARD) + .addCatalyst(5, EndItems.ENDER_SHARD) + .addCatalyst(7, EndItems.ENDER_SHARD) + .setTime(250) + .build(); - InfusionRecipe.Builder.create("crystalite_helmet").setInput(EndBlocks.TERMINITE.helmet).setOutput(EndItems.CRYSTALITE_HELMET).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(150).build(); - InfusionRecipe.Builder.create("crystalite_chestplate").setInput(EndBlocks.TERMINITE.chestplate).setOutput(EndItems.CRYSTALITE_CHESTPLATE).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(1, EndItems.CRYSTAL_SHARDS).addCatalyst(3, EndItems.CRYSTAL_SHARDS).addCatalyst(5, EndItems.CRYSTAL_SHARDS).addCatalyst(7, EndItems.CRYSTAL_SHARDS).setTime(300).build(); - InfusionRecipe.Builder.create("crystalite_leggings").setInput(EndBlocks.TERMINITE.leggings).setOutput(EndItems.CRYSTALITE_LEGGINGS).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(225).build(); - InfusionRecipe.Builder.create("crystalite_boots").setInput(EndBlocks.TERMINITE.boots).setOutput(EndItems.CRYSTALITE_BOOTS).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(150).build(); + InfusionRecipe.Builder.create("crystalite_helmet") + .setInput(EndBlocks.TERMINITE.helmet) + .setOutput(EndItems.CRYSTALITE_HELMET) + .addCatalyst(0, EndItems.AMBER_GEM) + .addCatalyst(2, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.CRYSTAL_SHARDS) + .setTime(150) + .build(); + InfusionRecipe.Builder.create("crystalite_chestplate") + .setInput(EndBlocks.TERMINITE.chestplate) + .setOutput(EndItems.CRYSTALITE_CHESTPLATE) + .addCatalyst(0, EndItems.AMBER_GEM) + .addCatalyst(1, EndItems.CRYSTAL_SHARDS) + .addCatalyst(3, EndItems.CRYSTAL_SHARDS) + .addCatalyst(5, EndItems.CRYSTAL_SHARDS) + .addCatalyst(7, EndItems.CRYSTAL_SHARDS) + .setTime(300) + .build(); + InfusionRecipe.Builder.create("crystalite_leggings") + .setInput(EndBlocks.TERMINITE.leggings) + .setOutput(EndItems.CRYSTALITE_LEGGINGS) + .addCatalyst(0, EndItems.AMBER_GEM) + .addCatalyst(2, EndItems.CRYSTAL_SHARDS) + .addCatalyst(4, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.CRYSTAL_SHARDS) + .setTime(225) + .build(); + InfusionRecipe.Builder.create("crystalite_boots") + .setInput(EndBlocks.TERMINITE.boots) + .setOutput(EndItems.CRYSTALITE_BOOTS) + .addCatalyst(0, EndItems.AMBER_GEM) + .addCatalyst(2, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.CRYSTAL_SHARDS) + .setTime(150) + .build(); - InfusionRecipe.Builder.create("crystalite_elytra").setInput(Items.ELYTRA).setOutput(EndItems.CRYSTALITE_ELYTRA).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(1, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.ENCHANTED_MEMBRANE).addCatalyst(3, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.ENCHANTED_MEMBRANE).addCatalyst(5, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.ENCHANTED_MEMBRANE).addCatalyst(7, EndItems.CRYSTAL_SHARDS).setTime(500).build(); + InfusionRecipe.Builder.create("crystalite_elytra") + .setInput(Items.ELYTRA) + .setOutput(EndItems.CRYSTALITE_ELYTRA) + .addCatalyst(0, EndItems.AMBER_GEM) + .addCatalyst(1, EndItems.CRYSTAL_SHARDS) + .addCatalyst(2, EndItems.ENCHANTED_MEMBRANE) + .addCatalyst(3, EndItems.CRYSTAL_SHARDS) + .addCatalyst(4, EndItems.ENCHANTED_MEMBRANE) + .addCatalyst(5, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.ENCHANTED_MEMBRANE) + .addCatalyst(7, EndItems.CRYSTAL_SHARDS) + .setTime(500) + .build(); - InfusionRecipe.Builder.create("enchanted_petal").setInput(EndItems.HYDRALUX_PETAL).setOutput(EndItems.ENCHANTED_PETAL).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(75).build(); - InfusionRecipe.Builder.create("enchanted_membrane").setInput(Items.PHANTOM_MEMBRANE).setOutput(EndItems.ENCHANTED_MEMBRANE).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(75).build(); + InfusionRecipe.Builder.create("enchanted_petal") + .setInput(EndItems.HYDRALUX_PETAL) + .setOutput(EndItems.ENCHANTED_PETAL) + .addCatalyst(0, EndItems.CRYSTAL_SHARDS) + .addCatalyst(2, EndItems.CRYSTAL_SHARDS) + .addCatalyst(4, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.CRYSTAL_SHARDS) + .setTime(75) + .build(); + InfusionRecipe.Builder.create("enchanted_membrane") + .setInput(Items.PHANTOM_MEMBRANE) + .setOutput(EndItems.ENCHANTED_MEMBRANE) + .addCatalyst(0, EndItems.CRYSTAL_SHARDS) + .addCatalyst(2, EndItems.CRYSTAL_SHARDS) + .addCatalyst(4, EndItems.CRYSTAL_SHARDS) + .addCatalyst(6, EndItems.CRYSTAL_SHARDS) + .setTime(75) + .build(); - InfusionRecipe.Builder.create("protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.ALL_DAMAGE_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(4, Items.TURTLE_HELMET).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("fire_protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FIRE_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.BLAZE_ROD).addCatalyst(4, Items.BLAZE_ROD).addCatalyst(6, Items.BLAZE_ROD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("feather_falling_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FALL_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.FEATHER).addCatalyst(4, Items.FEATHER).addCatalyst(6, Items.FEATHER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("blast_protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BLAST_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.OBSIDIAN).addCatalyst(4, Blocks.OBSIDIAN).addCatalyst(6, Blocks.OBSIDIAN).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("projectile_protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.PROJECTILE_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.SCUTE).addCatalyst(4, Items.SHIELD).addCatalyst(6, Items.SCUTE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("respiration_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.RESPIRATION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.NAUTILUS_SHELL).addCatalyst(4, Items.NAUTILUS_SHELL).addCatalyst(6, Items.NAUTILUS_SHELL).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("aqua_affinity_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.AQUA_AFFINITY, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.PRISMARINE_CRYSTALS).addCatalyst(4, Items.PRISMARINE_CRYSTALS).addCatalyst(6, Items.PRISMARINE_CRYSTALS).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("thorns_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.THORNS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.CACTUS).addCatalyst(4, Blocks.CACTUS).addCatalyst(6, Blocks.CACTUS).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("depth_strider_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.DEPTH_STRIDER, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.LILY_PAD).addCatalyst(4, EndBlocks.END_LILY_SEED).addCatalyst(6, Blocks.LILY_PAD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("frost_walker_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FROST_WALKER, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(4, EndBlocks.ANCIENT_EMERALD_ICE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("soul_speed_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SOUL_SPEED, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.SOUL_SAND, Blocks.SOUL_SOIL).addCatalyst(4, Blocks.SOUL_SAND, Blocks.SOUL_SOIL).addCatalyst(6, Blocks.SOUL_SAND, Blocks.SOUL_SOIL).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("sharpness_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SHARPNESS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(4, Items.NETHERITE_SCRAP).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("smite_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SMITE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.SUNFLOWER).addCatalyst(4, Items.GOLD_INGOT).addCatalyst(6, Blocks.SUNFLOWER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("bane_of_arthropods_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BANE_OF_ARTHROPODS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.FERMENTED_SPIDER_EYE).addCatalyst(4, Items.IRON_INGOT).addCatalyst(6, Items.FERMENTED_SPIDER_EYE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("knockback_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.KNOCKBACK, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.REDSTONE).addCatalyst(4, Blocks.PISTON).addCatalyst(6, Items.REDSTONE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("fire_aspect_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FIRE_ASPECT, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.BLAZE_POWDER).addCatalyst(4, Items.MAGMA_CREAM).addCatalyst(6, Items.BLAZE_POWDER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("looting_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.MOB_LOOTING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EMERALD).addCatalyst(4, Items.GOLD_INGOT).addCatalyst(6, Items.EMERALD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("sweeping_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SWEEPING_EDGE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.GOLDEN_SWORD).addCatalyst(4, Items.IRON_SWORD).addCatalyst(6, Items.GOLDEN_SWORD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("efficiency_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BLOCK_EFFICIENCY, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, EndItems.AMBER_GEM).addCatalyst(4, EndItems.AMBER_GEM).addCatalyst(6, EndItems.AMBER_GEM).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("silk_touch_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SILK_TOUCH, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.COBWEB).addCatalyst(4, EndItems.ETERNAL_CRYSTAL).addCatalyst(6, Blocks.COBWEB).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); - InfusionRecipe.Builder.create("unbreaking_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.UNBREAKING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.DIAMOND).addCatalyst(4, Items.DIAMOND).addCatalyst(6, Items.DIAMOND).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("fortune_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BLOCK_FORTUNE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EMERALD).addCatalyst(4, Items.RABBIT_FOOT).addCatalyst(6, Items.EMERALD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("power_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.POWER_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, EndItems.AMBER_GEM).addCatalyst(4, Items.DIAMOND_SWORD).addCatalyst(6, EndItems.AMBER_GEM).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("punch_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.PUNCH_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.POPPED_CHORUS_FRUIT).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.POPPED_CHORUS_FRUIT).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("flame_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FLAMING_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.BLAZE_POWDER).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.BLAZE_POWDER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("infinity_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.INFINITY_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.SPECTRAL_ARROW).addCatalyst(4, EndItems.ETERNAL_CRYSTAL).addCatalyst(6, Items.SPECTRAL_ARROW).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); - InfusionRecipe.Builder.create("luck_of_sea_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FISHING_LUCK, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EMERALD).addCatalyst(4, Items.FISHING_ROD).addCatalyst(6, Items.EMERALD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("lure_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FISHING_SPEED, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.GOLD_NUGGET).addCatalyst(4, Items.FISHING_ROD).addCatalyst(6, Items.GOLD_NUGGET).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("loyalty_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.LOYALTY, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.ENDER_EYE).addCatalyst(4, Items.HEART_OF_THE_SEA).addCatalyst(6, Items.ENDER_EYE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); - InfusionRecipe.Builder.create("impaling_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.IMPALING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.PRISMARINE_SHARD).addCatalyst(4, Items.IRON_SWORD).addCatalyst(6, Items.PRISMARINE_SHARD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("riptide_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.RIPTIDE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.LEAD).addCatalyst(4, Items.HEART_OF_THE_SEA).addCatalyst(6, Items.LEAD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); - InfusionRecipe.Builder.create("channeling_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.CHANNELING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.CHAIN).addCatalyst(4, Items.HEART_OF_THE_SEA).addCatalyst(6, Items.CHAIN).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); - InfusionRecipe.Builder.create("multishot_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.MULTISHOT, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.ARROW).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.ARROW).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("quick_charge_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.QUICK_CHARGE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.QUARTZ).addCatalyst(4, Items.GLOWSTONE_DUST).addCatalyst(6, Items.QUARTZ).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("piercing_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.PIERCING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.GLOWSTONE_DUST).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.GLOWSTONE_DUST).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); - InfusionRecipe.Builder.create("mending_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.MENDING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EXPERIENCE_BOTTLE).addCatalyst(4, Blocks.ANVIL).addCatalyst(6, Items.EXPERIENCE_BOTTLE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); + InfusionRecipe.Builder.create("protection_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.ALL_DAMAGE_PROTECTION, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(4, Items.TURTLE_HELMET) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("fire_protection_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.FIRE_PROTECTION, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.BLAZE_ROD) + .addCatalyst(4, Items.BLAZE_ROD) + .addCatalyst(6, Items.BLAZE_ROD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("feather_falling_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.FALL_PROTECTION, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.FEATHER) + .addCatalyst(4, Items.FEATHER) + .addCatalyst(6, Items.FEATHER) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("blast_protection_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.BLAST_PROTECTION, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Blocks.OBSIDIAN) + .addCatalyst(4, Blocks.OBSIDIAN) + .addCatalyst(6, Blocks.OBSIDIAN) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("projectile_protection_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.PROJECTILE_PROTECTION, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.SCUTE) + .addCatalyst(4, Items.SHIELD) + .addCatalyst(6, Items.SCUTE) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("respiration_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.RESPIRATION, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.NAUTILUS_SHELL) + .addCatalyst(4, Items.NAUTILUS_SHELL) + .addCatalyst(6, Items.NAUTILUS_SHELL) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("aqua_affinity_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.AQUA_AFFINITY, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.PRISMARINE_CRYSTALS) + .addCatalyst(4, Items.PRISMARINE_CRYSTALS) + .addCatalyst(6, Items.PRISMARINE_CRYSTALS) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("thorns_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.THORNS, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Blocks.CACTUS) + .addCatalyst(4, Blocks.CACTUS) + .addCatalyst(6, Blocks.CACTUS) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("depth_strider_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.DEPTH_STRIDER, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Blocks.LILY_PAD) + .addCatalyst(4, EndBlocks.END_LILY_SEED) + .addCatalyst(6, Blocks.LILY_PAD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("frost_walker_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.FROST_WALKER, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(4, EndBlocks.ANCIENT_EMERALD_ICE) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("soul_speed_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.SOUL_SPEED, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Blocks.SOUL_SAND, Blocks.SOUL_SOIL) + .addCatalyst(4, Blocks.SOUL_SAND, Blocks.SOUL_SOIL) + .addCatalyst(6, Blocks.SOUL_SAND, Blocks.SOUL_SOIL) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("sharpness_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.SHARPNESS, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(4, Items.NETHERITE_SCRAP) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("smite_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.SMITE, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Blocks.SUNFLOWER) + .addCatalyst(4, Items.GOLD_INGOT) + .addCatalyst(6, Blocks.SUNFLOWER) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("bane_of_arthropods_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.BANE_OF_ARTHROPODS, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.FERMENTED_SPIDER_EYE) + .addCatalyst(4, Items.IRON_INGOT) + .addCatalyst(6, Items.FERMENTED_SPIDER_EYE) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("knockback_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.KNOCKBACK, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.REDSTONE) + .addCatalyst(4, Blocks.PISTON) + .addCatalyst(6, Items.REDSTONE) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("fire_aspect_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.FIRE_ASPECT, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.BLAZE_POWDER) + .addCatalyst(4, Items.MAGMA_CREAM) + .addCatalyst(6, Items.BLAZE_POWDER) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("looting_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.MOB_LOOTING, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.EMERALD) + .addCatalyst(4, Items.GOLD_INGOT) + .addCatalyst(6, Items.EMERALD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("sweeping_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.SWEEPING_EDGE, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.GOLDEN_SWORD) + .addCatalyst(4, Items.IRON_SWORD) + .addCatalyst(6, Items.GOLDEN_SWORD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("efficiency_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.BLOCK_EFFICIENCY, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, EndItems.AMBER_GEM) + .addCatalyst(4, EndItems.AMBER_GEM) + .addCatalyst(6, EndItems.AMBER_GEM) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("silk_touch_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.SILK_TOUCH, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Blocks.COBWEB) + .addCatalyst(4, EndItems.ETERNAL_CRYSTAL) + .addCatalyst(6, Blocks.COBWEB) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(375) + .build(); + InfusionRecipe.Builder.create("unbreaking_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.UNBREAKING, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.DIAMOND) + .addCatalyst(4, Items.DIAMOND) + .addCatalyst(6, Items.DIAMOND) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("fortune_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.BLOCK_FORTUNE, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.EMERALD) + .addCatalyst(4, Items.RABBIT_FOOT) + .addCatalyst(6, Items.EMERALD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("power_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.POWER_ARROWS, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, EndItems.AMBER_GEM) + .addCatalyst(4, Items.DIAMOND_SWORD) + .addCatalyst(6, EndItems.AMBER_GEM) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("punch_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.PUNCH_ARROWS, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.POPPED_CHORUS_FRUIT) + .addCatalyst(4, Items.SPECTRAL_ARROW) + .addCatalyst(6, Items.POPPED_CHORUS_FRUIT) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("flame_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.FLAMING_ARROWS, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.BLAZE_POWDER) + .addCatalyst(4, Items.SPECTRAL_ARROW) + .addCatalyst(6, Items.BLAZE_POWDER) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("infinity_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.INFINITY_ARROWS, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.SPECTRAL_ARROW) + .addCatalyst(4, EndItems.ETERNAL_CRYSTAL) + .addCatalyst(6, Items.SPECTRAL_ARROW) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(375) + .build(); + InfusionRecipe.Builder.create("luck_of_sea_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.FISHING_LUCK, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.EMERALD) + .addCatalyst(4, Items.FISHING_ROD) + .addCatalyst(6, Items.EMERALD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("lure_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.FISHING_SPEED, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.GOLD_NUGGET) + .addCatalyst(4, Items.FISHING_ROD) + .addCatalyst(6, Items.GOLD_NUGGET) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("loyalty_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.LOYALTY, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.ENDER_EYE) + .addCatalyst(4, Items.HEART_OF_THE_SEA) + .addCatalyst(6, Items.ENDER_EYE) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(375) + .build(); + InfusionRecipe.Builder.create("impaling_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.IMPALING, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.PRISMARINE_SHARD) + .addCatalyst(4, Items.IRON_SWORD) + .addCatalyst(6, Items.PRISMARINE_SHARD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("riptide_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.RIPTIDE, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.LEAD) + .addCatalyst(4, Items.HEART_OF_THE_SEA) + .addCatalyst(6, Items.LEAD) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(375) + .build(); + InfusionRecipe.Builder.create("channeling_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.CHANNELING, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.CHAIN) + .addCatalyst(4, Items.HEART_OF_THE_SEA) + .addCatalyst(6, Items.CHAIN) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(375) + .build(); + InfusionRecipe.Builder.create("multishot_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.MULTISHOT, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.ARROW) + .addCatalyst(4, Items.SPECTRAL_ARROW) + .addCatalyst(6, Items.ARROW) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("quick_charge_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.QUICK_CHARGE, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.QUARTZ) + .addCatalyst(4, Items.GLOWSTONE_DUST) + .addCatalyst(6, Items.QUARTZ) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("piercing_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.PIERCING, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.GLOWSTONE_DUST) + .addCatalyst(4, Items.SPECTRAL_ARROW) + .addCatalyst(6, Items.GLOWSTONE_DUST) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(300) + .build(); + InfusionRecipe.Builder.create("mending_book") + .setInput(Items.BOOK) + .setOutput(createEnchantedBook(Enchantments.MENDING, 1)) + .addCatalyst(0, EndItems.ENCHANTED_PETAL) + .addCatalyst(2, Items.EXPERIENCE_BOTTLE) + .addCatalyst(4, Blocks.ANVIL) + .addCatalyst(6, Items.EXPERIENCE_BOTTLE) + .addCatalyst(1, Items.LAPIS_LAZULI) + .addCatalyst(3, Items.LAPIS_LAZULI) + .addCatalyst(5, Items.LAPIS_LAZULI) + .addCatalyst(7, Items.LAPIS_LAZULI) + .setGroup("enchantment") + .setTime(375) + .build(); } private static ItemStack createEnchantedBook(Enchantment enchantment, int level) { diff --git a/src/main/java/ru/betterend/recipe/SmithingRecipes.java b/src/main/java/ru/betterend/recipe/SmithingRecipes.java index 88235e42..7f50dba1 100644 --- a/src/main/java/ru/betterend/recipe/SmithingRecipes.java +++ b/src/main/java/ru/betterend/recipe/SmithingRecipes.java @@ -10,25 +10,100 @@ import ru.betterend.registry.EndItems; public class SmithingRecipes { public static void register() { - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword_handle").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_SWORD_HANDLE).setBase(EndBlocks.TERMINITE.ingot).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword_handle") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_SWORD_HANDLE) + .setBase(EndBlocks.TERMINITE.ingot) + .setAddition(EndItems.LEATHER_WRAPPED_STICK) + .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_SWORD).setBase(EndItems.AETERNIUM_SWORD_BLADE).setAddition(EndItems.AETERNIUM_SWORD_HANDLE).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_pickaxe").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_PICKAXE).setBase(EndItems.AETERNIUM_PICKAXE_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_axe").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_AXE).setBase(EndItems.AETERNIUM_AXE_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_shovel").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_SHOVEL).setBase(EndItems.AETERNIUM_SHOVEL_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hoe").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_HOE).setBase(EndItems.AETERNIUM_HOE_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hammer").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_HAMMER).setBase(EndItems.AETERNIUM_HAMMER_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_SWORD) + .setBase(EndItems.AETERNIUM_SWORD_BLADE) + .setAddition(EndItems.AETERNIUM_SWORD_HANDLE) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_pickaxe") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_PICKAXE) + .setBase(EndItems.AETERNIUM_PICKAXE_HEAD) + .setAddition(EndItems.LEATHER_WRAPPED_STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_axe") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_AXE) + .setBase(EndItems.AETERNIUM_AXE_HEAD) + .setAddition(EndItems.LEATHER_WRAPPED_STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_shovel") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_SHOVEL) + .setBase(EndItems.AETERNIUM_SHOVEL_HEAD) + .setAddition(EndItems.LEATHER_WRAPPED_STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hoe") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_HOE) + .setBase(EndItems.AETERNIUM_HOE_HEAD) + .setAddition(EndItems.LEATHER_WRAPPED_STICK) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hammer") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_HAMMER) + .setBase(EndItems.AETERNIUM_HAMMER_HEAD) + .setAddition(EndItems.LEATHER_WRAPPED_STICK) + .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "netherite_hammer").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.NETHERITE_HAMMER).setBase(EndItems.DIAMOND_HAMMER).setAddition(Items.NETHERITE_INGOT).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "netherite_hammer") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.NETHERITE_HAMMER) + .setBase(EndItems.DIAMOND_HAMMER) + .setAddition(Items.NETHERITE_INGOT) + .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_helmet").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_HELMET).setBase(EndBlocks.TERMINITE.helmet).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_chestplate").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_CHESTPLATE).setBase(EndBlocks.TERMINITE.chestplate).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_leggings").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_LEGGINGS).setBase(EndBlocks.TERMINITE.leggings).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_boots").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_BOOTS).setBase(EndBlocks.TERMINITE.boots).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_helmet") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_HELMET) + .setBase(EndBlocks.TERMINITE.helmet) + .setAddition(EndItems.AETERNIUM_FORGED_PLATE) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_chestplate") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_CHESTPLATE) + .setBase(EndBlocks.TERMINITE.chestplate) + .setAddition(EndItems.AETERNIUM_FORGED_PLATE) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_leggings") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_LEGGINGS) + .setBase(EndBlocks.TERMINITE.leggings) + .setAddition(EndItems.AETERNIUM_FORGED_PLATE) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_boots") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.AETERNIUM_BOOTS) + .setBase(EndBlocks.TERMINITE.boots) + .setAddition(EndItems.AETERNIUM_FORGED_PLATE) + .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "thallasium_anvil_updrade").checkConfig(Configs.RECIPE_CONFIG).setResult(EndBlocks.TERMINITE.anvilBlock.asItem()).setBase(EndBlocks.THALLASIUM.anvilBlock.asItem()).setAddition(EndBlocks.TERMINITE.block).build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "terminite_anvil_updrade").checkConfig(Configs.RECIPE_CONFIG).setResult(EndBlocks.AETERNIUM_ANVIL.asItem()).setBase(EndBlocks.TERMINITE.anvilBlock.asItem()).setAddition(EndItems.AETERNIUM_INGOT).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "thallasium_anvil_updrade") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndBlocks.TERMINITE.anvilBlock.asItem()) + .setBase(EndBlocks.THALLASIUM.anvilBlock.asItem()) + .setAddition(EndBlocks.TERMINITE.block) + .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "terminite_anvil_updrade") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndBlocks.AETERNIUM_ANVIL.asItem()) + .setBase(EndBlocks.TERMINITE.anvilBlock.asItem()) + .setAddition(EndItems.AETERNIUM_INGOT) + .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "armored_elytra").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.ARMORED_ELYTRA).setBase(Items.ELYTRA).setAddition(EndItems.AETERNIUM_INGOT).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "armored_elytra") + .checkConfig(Configs.RECIPE_CONFIG) + .setResult(EndItems.ARMORED_ELYTRA) + .setBase(Items.ELYTRA) + .setAddition(EndItems.AETERNIUM_INGOT) + .build(); } } diff --git a/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java b/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java index 742755a7..85f67aca 100644 --- a/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java +++ b/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java @@ -29,7 +29,11 @@ import ru.betterend.util.RecipeHelper; public class AlloyingRecipe implements Recipe, BetterEndRecipe { public final static String GROUP = "alloying"; public final static RecipeType TYPE = BCLRecipeManager.registerType(BetterEnd.MOD_ID, GROUP); - public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer(BetterEnd.MOD_ID, GROUP, new Serializer()); + public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer( + BetterEnd.MOD_ID, + GROUP, + new Serializer() + ); protected final RecipeType type; protected final ResourceLocation id; @@ -70,7 +74,8 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { @Override public boolean matches(Container inv, Level world) { - return this.primaryInput.test(inv.getItem(0)) && this.secondaryInput.test(inv.getItem(1)) || this.primaryInput.test(inv.getItem(1)) && this.secondaryInput.test(inv.getItem(0)); + return this.primaryInput.test(inv.getItem(0)) && this.secondaryInput.test(inv.getItem(1)) || this.primaryInput.test( + inv.getItem(1)) && this.secondaryInput.test(inv.getItem(0)); } @Override @@ -209,11 +214,17 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { public void build() { if (exist) { if (primaryInput == null) { - BetterEnd.LOGGER.warning("Primary input for Alloying recipe can't be 'null', recipe {} will be ignored!", id); + BetterEnd.LOGGER.warning( + "Primary input for Alloying recipe can't be 'null', recipe {} will be ignored!", + id + ); return; } if (secondaryInput == null) { - BetterEnd.LOGGER.warning("Secondary input for Alloying can't be 'null', recipe {} will be ignored!", id); + BetterEnd.LOGGER.warning( + "Secondary input for Alloying can't be 'null', recipe {} will be ignored!", + id + ); return; } if (output == null) { @@ -228,7 +239,10 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { BetterEnd.LOGGER.debug("Can't add Alloying recipe {}! Ingeredient or output not exists.", id); return; } - BCLRecipeManager.addRecipe(TYPE, new AlloyingRecipe(id, group, primaryInput, secondaryInput, output, experience, smeltTime)); + BCLRecipeManager.addRecipe( + TYPE, + new AlloyingRecipe(id, group, primaryInput, secondaryInput, output, experience, smeltTime) + ); } } } diff --git a/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java b/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java index 07aad245..3eb3024b 100644 --- a/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java +++ b/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java @@ -36,7 +36,11 @@ import java.util.Objects; public class AnvilRecipe implements Recipe, BetterEndRecipe { public final static String GROUP = "smithing"; public final static RecipeType TYPE = BCLRecipeManager.registerType(BetterEnd.MOD_ID, GROUP); - public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer(BetterEnd.MOD_ID, GROUP, new Serializer()); + public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer( + BetterEnd.MOD_ID, + GROUP, + new Serializer() + ); public final static ResourceLocation ID = BetterEnd.makeID(GROUP); private final ResourceLocation id; @@ -119,7 +123,11 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { @Override public NonNullList getIngredients() { NonNullList defaultedList = NonNullList.create(); - defaultedList.add(Ingredient.of(TagAPI.HAMMERS.getValues().stream().filter(hammer -> ((TieredItem) hammer).getTier().getLevel() >= toolLevel).map(ItemStack::new))); + defaultedList.add(Ingredient.of(TagAPI.HAMMERS.getValues() + .stream() + .filter(hammer -> ((TieredItem) hammer).getTier() + .getLevel() >= toolLevel) + .map(ItemStack::new))); defaultedList.add(input); return defaultedList; @@ -151,7 +159,8 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AnvilRecipe that = (AnvilRecipe) o; - return damage == that.damage && toolLevel == that.toolLevel && id.equals(that.id) && input.equals(that.input) && output.equals(that.output); + return damage == that.damage && toolLevel == that.toolLevel && id.equals(that.id) && input.equals(that.input) && output + .equals(that.output); } @Override @@ -260,7 +269,10 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { BetterEnd.LOGGER.debug("Can't add Anvil recipe {}! Ingeredient or output not exists.", id); return; } - BCLRecipeManager.addRecipe(TYPE, new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage)); + BCLRecipeManager.addRecipe( + TYPE, + new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage) + ); } } } diff --git a/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java b/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java index 648a460f..70d5ea40 100644 --- a/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java +++ b/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java @@ -29,7 +29,11 @@ import java.util.Arrays; public class InfusionRecipe implements Recipe, BetterEndRecipe { public final static String GROUP = "infusion"; public final static RecipeType TYPE = BCLRecipeManager.registerType(BetterEnd.MOD_ID, GROUP); - public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer(BetterEnd.MOD_ID, GROUP, new Serializer()); + public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer( + BetterEnd.MOD_ID, + GROUP, + new Serializer() + ); private final ResourceLocation id; private final Ingredient[] catalysts; @@ -175,11 +179,17 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { public void build() { if (exist) { if (input == null) { - BetterEnd.LOGGER.warning("Input for Infusion recipe can't be 'null', recipe {} will be ignored!", id); + BetterEnd.LOGGER.warning( + "Input for Infusion recipe can't be 'null', recipe {} will be ignored!", + id + ); return; } if (output == null) { - BetterEnd.LOGGER.warning("Output for Infusion recipe can't be 'null', recipe {} will be ignored!", id); + BetterEnd.LOGGER.warning( + "Output for Infusion recipe can't be 'null', recipe {} will be ignored!", + id + ); return; } InfusionRecipe recipe = new InfusionRecipe(id, input, output); diff --git a/src/main/java/ru/betterend/registry/EndAttributes.java b/src/main/java/ru/betterend/registry/EndAttributes.java index 7d35fb04..8262d5ba 100644 --- a/src/main/java/ru/betterend/registry/EndAttributes.java +++ b/src/main/java/ru/betterend/registry/EndAttributes.java @@ -10,7 +10,11 @@ public class EndAttributes { public final static Attribute BLINDNESS_RESISTANCE = registerAttribute("generic.blindness_resistance", 0.0, true); public static Attribute registerAttribute(String name, double value, boolean syncable) { - return Registry.register(Registry.ATTRIBUTE, BetterEnd.makeID(name), new EndAttribute("attribute.name." + name, value).setSyncable(syncable)); + return Registry.register( + Registry.ATTRIBUTE, + BetterEnd.makeID(name), + new EndAttribute("attribute.name." + name, value).setSyncable(syncable) + ); } public static AttributeSupplier.Builder addLivingEntityAttributes(AttributeSupplier.Builder builder) { diff --git a/src/main/java/ru/betterend/registry/EndBiomes.java b/src/main/java/ru/betterend/registry/EndBiomes.java index e64f9d27..6e8c676f 100644 --- a/src/main/java/ru/betterend/registry/EndBiomes.java +++ b/src/main/java/ru/betterend/registry/EndBiomes.java @@ -135,8 +135,13 @@ public class EndBiomes { biomeRegistry.forEach((biome) -> { if (biome.getBiomeCategory() == BiomeCategory.THEEND) { ResourceLocation id = biomeRegistry.getKey(biome); - if (!id.getNamespace().equals("ultra_amplified_dimension") && Configs.BIOME_CONFIG.getBoolean(id, "enabled", true)) { - if (!LAND_BIOMES.containsImmutable(id) && !VOID_BIOMES.containsImmutable(id) && !SUBBIOMES_UNMUTABLES.contains(id)) { + if (!id.getNamespace().equals("ultra_amplified_dimension") && Configs.BIOME_CONFIG.getBoolean( + id, + "enabled", + true + )) { + if (!LAND_BIOMES.containsImmutable(id) && !VOID_BIOMES.containsImmutable(id) && !SUBBIOMES_UNMUTABLES + .contains(id)) { JsonObject config = configs.get(id.getNamespace()); if (config == null) { config = loadJsonConfig(id.getNamespace()); diff --git a/src/main/java/ru/betterend/registry/EndBlockEntities.java b/src/main/java/ru/betterend/registry/EndBlockEntities.java index 1b0ed400..6b90487d 100644 --- a/src/main/java/ru/betterend/registry/EndBlockEntities.java +++ b/src/main/java/ru/betterend/registry/EndBlockEntities.java @@ -15,11 +15,26 @@ import ru.betterend.blocks.entities.InfusionPedestalEntity; import ru.betterend.blocks.entities.PedestalBlockEntity; public class EndBlockEntities { - public final static BlockEntityType END_STONE_SMELTER = registerBlockEntity(EndStoneSmelter.ID, FabricBlockEntityTypeBuilder.create(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER)); - public final static BlockEntityType PEDESTAL = registerBlockEntity("pedestal", FabricBlockEntityTypeBuilder.create(PedestalBlockEntity::new, getPedestals())); - public final static BlockEntityType ETERNAL_PEDESTAL = registerBlockEntity("eternal_pedestal", FabricBlockEntityTypeBuilder.create(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL)); - public final static BlockEntityType INFUSION_PEDESTAL = registerBlockEntity("infusion_pedestal", FabricBlockEntityTypeBuilder.create(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL)); - public final static BlockEntityType HYDROTHERMAL_VENT = registerBlockEntity("hydrother_malvent", FabricBlockEntityTypeBuilder.create(BlockEntityHydrothermalVent::new, EndBlocks.HYDROTHERMAL_VENT)); + public final static BlockEntityType END_STONE_SMELTER = registerBlockEntity( + EndStoneSmelter.ID, + FabricBlockEntityTypeBuilder.create(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER) + ); + public final static BlockEntityType PEDESTAL = registerBlockEntity( + "pedestal", + FabricBlockEntityTypeBuilder.create(PedestalBlockEntity::new, getPedestals()) + ); + public final static BlockEntityType ETERNAL_PEDESTAL = registerBlockEntity( + "eternal_pedestal", + FabricBlockEntityTypeBuilder.create(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL) + ); + public final static BlockEntityType INFUSION_PEDESTAL = registerBlockEntity( + "infusion_pedestal", + FabricBlockEntityTypeBuilder.create(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL) + ); + public final static BlockEntityType HYDROTHERMAL_VENT = registerBlockEntity( + "hydrother_malvent", + FabricBlockEntityTypeBuilder.create(BlockEntityHydrothermalVent::new, EndBlocks.HYDROTHERMAL_VENT) + ); public static BlockEntityType registerBlockEntity(String id, FabricBlockEntityTypeBuilder builder) { return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.makeID(id), builder.build(null)); @@ -31,6 +46,9 @@ public class EndBlockEntities { } static Block[] getPedestals() { - return EndBlocks.getModBlocks().stream().filter(block -> block instanceof PedestalBlock && !((PedestalBlock) block).hasUniqueEntity()).toArray(Block[]::new); + return EndBlocks.getModBlocks() + .stream() + .filter(block -> block instanceof PedestalBlock && !((PedestalBlock) block).hasUniqueEntity()) + .toArray(Block[]::new); } } diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index 110831de..b452fab6 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -125,7 +125,16 @@ import ru.betterend.blocks.UmbrellaTreeClusterEmptyBlock; import ru.betterend.blocks.UmbrellaTreeMembraneBlock; import ru.betterend.blocks.UmbrellaTreeSaplingBlock; import ru.betterend.blocks.VentBubbleColumnBlock; -import ru.betterend.blocks.basis.*; +import ru.betterend.blocks.basis.EndAnvilBlock; +import ru.betterend.blocks.basis.EndTerrainBlock; +import ru.betterend.blocks.basis.EndTripleTerrain; +import ru.betterend.blocks.basis.EndUnderwaterWallPlantBlock; +import ru.betterend.blocks.basis.EndWallMushroom; +import ru.betterend.blocks.basis.EndWallPlantBlock; +import ru.betterend.blocks.basis.FurBlock; +import ru.betterend.blocks.basis.PottableCropBlock; +import ru.betterend.blocks.basis.PottableLeavesBlock; +import ru.betterend.blocks.basis.StoneLanternBlock; import ru.betterend.blocks.complex.ColoredMaterial; import ru.betterend.blocks.complex.CrystalSubblocksMaterial; import ru.betterend.blocks.complex.MetalMaterial; @@ -142,22 +151,37 @@ import java.util.stream.Collectors; public class EndBlocks extends BlocksRegistry { // Terrain // public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new EndstoneDustBlock()); - public static final Block END_MYCELIUM = registerBlock("end_mycelium", new EndTerrainBlock(MaterialColor.COLOR_LIGHT_BLUE)); + public static final Block END_MYCELIUM = registerBlock( + "end_mycelium", + new EndTerrainBlock(MaterialColor.COLOR_LIGHT_BLUE) + ); public static final Block END_MOSS = registerBlock("end_moss", new EndTerrainBlock(MaterialColor.COLOR_CYAN)); - public static final Block CHORUS_NYLIUM = registerBlock("chorus_nylium", new EndTerrainBlock(MaterialColor.COLOR_MAGENTA)); + public static final Block CHORUS_NYLIUM = registerBlock( + "chorus_nylium", + new EndTerrainBlock(MaterialColor.COLOR_MAGENTA) + ); public static final Block CAVE_MOSS = registerBlock("cave_moss", new EndTripleTerrain(MaterialColor.COLOR_PURPLE)); - public static final Block CRYSTAL_MOSS = registerBlock("crystal_moss", new EndTerrainBlock(MaterialColor.COLOR_PINK)); + public static final Block CRYSTAL_MOSS = registerBlock( + "crystal_moss", + new EndTerrainBlock(MaterialColor.COLOR_PINK) + ); public static final Block SHADOW_GRASS = registerBlock("shadow_grass", new ShadowGrassBlock()); public static final Block PINK_MOSS = registerBlock("pink_moss", new EndTerrainBlock(MaterialColor.COLOR_PINK)); public static final Block AMBER_MOSS = registerBlock("amber_moss", new EndTerrainBlock(MaterialColor.COLOR_ORANGE)); - public static final Block JUNGLE_MOSS = registerBlock("jungle_moss", new EndTerrainBlock(MaterialColor.COLOR_GREEN)); + public static final Block JUNGLE_MOSS = registerBlock( + "jungle_moss", + new EndTerrainBlock(MaterialColor.COLOR_GREEN) + ); public static final Block SANGNUM = registerBlock("sangnum", new EndTerrainBlock(MaterialColor.COLOR_RED)); public static final Block RUTISCUS = registerBlock("rutiscus", new EndTerrainBlock(MaterialColor.COLOR_ORANGE)); // Roads // public static final Block END_MYCELIUM_PATH = registerBlock("end_mycelium_path", new BasePathBlock(END_MYCELIUM)); public static final Block END_MOSS_PATH = registerBlock("end_moss_path", new BasePathBlock(END_MOSS)); - public static final Block CHORUS_NYLIUM_PATH = registerBlock("chorus_nylium_path", new BasePathBlock(CHORUS_NYLIUM)); + public static final Block CHORUS_NYLIUM_PATH = registerBlock( + "chorus_nylium_path", + new BasePathBlock(CHORUS_NYLIUM) + ); public static final Block CAVE_MOSS_PATH = registerBlock("cave_moss_path", new BasePathBlock(CAVE_MOSS)); public static final Block CRYSTAL_MOSS_PATH = registerBlock("crystal_moss_path", new BasePathBlock(CRYSTAL_MOSS)); public static final Block SHADOW_GRASS_PATH = registerBlock("shadow_grass_path", new BasePathBlock(SHADOW_GRASS)); @@ -168,9 +192,18 @@ public class EndBlocks extends BlocksRegistry { public static final Block RUTISCUS_PATH = registerBlock("rutiscus_path", new BasePathBlock(RUTISCUS)); public static final Block MOSSY_OBSIDIAN = registerBlock("mossy_obsidian", new MossyObsidian()); - public static final Block DRAGON_BONE_BLOCK = registerBlock("dragon_bone_block", new BaseRotatedPillarBlock(Blocks.BONE_BLOCK)); - public static final Block DRAGON_BONE_STAIRS = registerBlock("dragon_bone_stairs", new BaseStairsBlock(DRAGON_BONE_BLOCK)); - public static final Block DRAGON_BONE_SLAB = registerBlock("dragon_bone_slab", new BaseSlabBlock(DRAGON_BONE_BLOCK)); + public static final Block DRAGON_BONE_BLOCK = registerBlock( + "dragon_bone_block", + new BaseRotatedPillarBlock(Blocks.BONE_BLOCK) + ); + public static final Block DRAGON_BONE_STAIRS = registerBlock( + "dragon_bone_stairs", + new BaseStairsBlock(DRAGON_BONE_BLOCK) + ); + public static final Block DRAGON_BONE_SLAB = registerBlock( + "dragon_bone_slab", + new BaseSlabBlock(DRAGON_BONE_BLOCK) + ); public static final Block MOSSY_DRAGON_BONE = registerBlock("mossy_dragon_bone", new MossyDragonBoneBlock()); // Rocks // @@ -178,82 +211,203 @@ public class EndBlocks extends BlocksRegistry { public static final StoneMaterial VIOLECITE = new StoneMaterial("violecite", MaterialColor.COLOR_PURPLE); public static final StoneMaterial SULPHURIC_ROCK = new StoneMaterial("sulphuric_rock", MaterialColor.COLOR_BROWN); public static final StoneMaterial VIRID_JADESTONE = new StoneMaterial("virid_jadestone", MaterialColor.COLOR_GREEN); - public static final StoneMaterial AZURE_JADESTONE = new StoneMaterial("azure_jadestone", MaterialColor.COLOR_LIGHT_BLUE); - public static final StoneMaterial SANDY_JADESTONE = new StoneMaterial("sandy_jadestone", MaterialColor.COLOR_YELLOW); + public static final StoneMaterial AZURE_JADESTONE = new StoneMaterial( + "azure_jadestone", + MaterialColor.COLOR_LIGHT_BLUE + ); + public static final StoneMaterial SANDY_JADESTONE = new StoneMaterial( + "sandy_jadestone", + MaterialColor.COLOR_YELLOW + ); public static final StoneMaterial UMBRALITH = new StoneMaterial("umbralith", MaterialColor.DEEPSLATE); public static final Block BRIMSTONE = registerBlock("brimstone", new BrimstoneBlock()); public static final Block SULPHUR_CRYSTAL = registerBlock("sulphur_crystal", new SulphurCrystalBlock()); public static final Block MISSING_TILE = registerBlock("missing_tile", new MissingTileBlock()); - public static final Block ENDSTONE_FLOWER_POT = registerBlock("endstone_flower_pot", new FlowerPotBlock(Blocks.END_STONE)); + public static final Block ENDSTONE_FLOWER_POT = registerBlock( + "endstone_flower_pot", + new FlowerPotBlock(Blocks.END_STONE) + ); public static final Block FLAVOLITE_RUNED = registerBlock("flavolite_runed", new RunedFlavolite(false)); - public static final Block FLAVOLITE_RUNED_ETERNAL = registerBlock("flavolite_runed_eternal", new RunedFlavolite(true)); + public static final Block FLAVOLITE_RUNED_ETERNAL = registerBlock( + "flavolite_runed_eternal", + new RunedFlavolite(true) + ); - public static final Block ANDESITE_PEDESTAL = registerBlock("andesite_pedestal", new PedestalVanilla(Blocks.ANDESITE)); + public static final Block ANDESITE_PEDESTAL = registerBlock( + "andesite_pedestal", + new PedestalVanilla(Blocks.ANDESITE) + ); public static final Block DIORITE_PEDESTAL = registerBlock("diorite_pedestal", new PedestalVanilla(Blocks.DIORITE)); public static final Block GRANITE_PEDESTAL = registerBlock("granite_pedestal", new PedestalVanilla(Blocks.GRANITE)); - public static final Block QUARTZ_PEDESTAL = registerBlock("quartz_pedestal", new PedestalVanilla(Blocks.QUARTZ_BLOCK)); - public static final Block PURPUR_PEDESTAL = registerBlock("purpur_pedestal", new PedestalVanilla(Blocks.PURPUR_BLOCK)); + public static final Block QUARTZ_PEDESTAL = registerBlock( + "quartz_pedestal", + new PedestalVanilla(Blocks.QUARTZ_BLOCK) + ); + public static final Block PURPUR_PEDESTAL = registerBlock( + "purpur_pedestal", + new PedestalVanilla(Blocks.PURPUR_BLOCK) + ); public static final Block HYDROTHERMAL_VENT = registerBlock("hydrothermal_vent", new HydrothermalVentBlock()); - public static final Block VENT_BUBBLE_COLUMN = registerEndBlockOnly("vent_bubble_column", new VentBubbleColumnBlock()); + public static final Block VENT_BUBBLE_COLUMN = registerEndBlockOnly( + "vent_bubble_column", + new VentBubbleColumnBlock() + ); public static final Block DENSE_SNOW = registerBlock("dense_snow", new DenseSnowBlock()); public static final Block EMERALD_ICE = registerBlock("emerald_ice", new EmeraldIceBlock()); public static final Block DENSE_EMERALD_ICE = registerBlock("dense_emerald_ice", new DenseEmeraldIceBlock()); public static final Block ANCIENT_EMERALD_ICE = registerBlock("ancient_emerald_ice", new AncientEmeraldIceBlock()); - public static final Block END_STONE_STALACTITE = registerBlock("end_stone_stalactite", new StalactiteBlock(Blocks.END_STONE)); - public static final Block END_STONE_STALACTITE_CAVEMOSS = registerBlock("end_stone_stalactite_cavemoss", new StalactiteBlock(CAVE_MOSS)); + public static final Block END_STONE_STALACTITE = registerBlock( + "end_stone_stalactite", + new StalactiteBlock(Blocks.END_STONE) + ); + public static final Block END_STONE_STALACTITE_CAVEMOSS = registerBlock( + "end_stone_stalactite_cavemoss", + new StalactiteBlock(CAVE_MOSS) + ); // Wooden Materials And Trees // - public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock("mossy_glowshroom_sapling", new MossyGlowshroomSaplingBlock()); - public static final Block MOSSY_GLOWSHROOM_CAP = registerBlock("mossy_glowshroom_cap", new MossyGlowshroomCapBlock()); - public static final Block MOSSY_GLOWSHROOM_HYMENOPHORE = registerBlock("mossy_glowshroom_hymenophore", new GlowingHymenophoreBlock()); - public static final Block MOSSY_GLOWSHROOM_FUR = registerBlock("mossy_glowshroom_fur", new FurBlock(MOSSY_GLOWSHROOM_SAPLING, 15, 16, true)); - public static final WoodenMaterial MOSSY_GLOWSHROOM = new WoodenMaterial("mossy_glowshroom", MaterialColor.COLOR_GRAY, MaterialColor.WOOD); + public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock( + "mossy_glowshroom_sapling", + new MossyGlowshroomSaplingBlock() + ); + public static final Block MOSSY_GLOWSHROOM_CAP = registerBlock( + "mossy_glowshroom_cap", + new MossyGlowshroomCapBlock() + ); + public static final Block MOSSY_GLOWSHROOM_HYMENOPHORE = registerBlock( + "mossy_glowshroom_hymenophore", + new GlowingHymenophoreBlock() + ); + public static final Block MOSSY_GLOWSHROOM_FUR = registerBlock( + "mossy_glowshroom_fur", + new FurBlock(MOSSY_GLOWSHROOM_SAPLING, 15, 16, true) + ); + public static final WoodenMaterial MOSSY_GLOWSHROOM = new WoodenMaterial( + "mossy_glowshroom", + MaterialColor.COLOR_GRAY, + MaterialColor.WOOD + ); - public static final Block PYTHADENDRON_SAPLING = registerBlock("pythadendron_sapling", new PythadendronSaplingBlock()); - public static final Block PYTHADENDRON_LEAVES = registerBlock("pythadendron_leaves", new PottableLeavesBlock(PYTHADENDRON_SAPLING, MaterialColor.COLOR_MAGENTA)); - public static final WoodenMaterial PYTHADENDRON = new WoodenMaterial("pythadendron", MaterialColor.COLOR_MAGENTA, MaterialColor.COLOR_PURPLE); + public static final Block PYTHADENDRON_SAPLING = registerBlock( + "pythadendron_sapling", + new PythadendronSaplingBlock() + ); + public static final Block PYTHADENDRON_LEAVES = registerBlock( + "pythadendron_leaves", + new PottableLeavesBlock(PYTHADENDRON_SAPLING, MaterialColor.COLOR_MAGENTA) + ); + public static final WoodenMaterial PYTHADENDRON = new WoodenMaterial( + "pythadendron", + MaterialColor.COLOR_MAGENTA, + MaterialColor.COLOR_PURPLE + ); public static final Block END_LOTUS_SEED = registerBlock("end_lotus_seed", new EndLotusSeedBlock()); public static final Block END_LOTUS_STEM = registerBlock("end_lotus_stem", new EndLotusStemBlock()); public static final Block END_LOTUS_LEAF = registerEndBlockOnly("end_lotus_leaf", new EndLotusLeafBlock()); public static final Block END_LOTUS_FLOWER = registerEndBlockOnly("end_lotus_flower", new EndLotusFlowerBlock()); - public static final WoodenMaterial END_LOTUS = new WoodenMaterial("end_lotus", MaterialColor.COLOR_LIGHT_BLUE, MaterialColor.COLOR_CYAN); + public static final WoodenMaterial END_LOTUS = new WoodenMaterial( + "end_lotus", + MaterialColor.COLOR_LIGHT_BLUE, + MaterialColor.COLOR_CYAN + ); public static final Block LACUGROVE_SAPLING = registerBlock("lacugrove_sapling", new LacugroveSaplingBlock()); - public static final Block LACUGROVE_LEAVES = registerBlock("lacugrove_leaves", new PottableLeavesBlock(LACUGROVE_SAPLING, MaterialColor.COLOR_CYAN)); - public static final WoodenMaterial LACUGROVE = new WoodenMaterial("lacugrove", MaterialColor.COLOR_BROWN, MaterialColor.COLOR_YELLOW); + public static final Block LACUGROVE_LEAVES = registerBlock( + "lacugrove_leaves", + new PottableLeavesBlock(LACUGROVE_SAPLING, MaterialColor.COLOR_CYAN) + ); + public static final WoodenMaterial LACUGROVE = new WoodenMaterial( + "lacugrove", + MaterialColor.COLOR_BROWN, + MaterialColor.COLOR_YELLOW + ); public static final Block DRAGON_TREE_SAPLING = registerBlock("dragon_tree_sapling", new DragonTreeSaplingBlock()); - public static final Block DRAGON_TREE_LEAVES = registerBlock("dragon_tree_leaves", new PottableLeavesBlock(DRAGON_TREE_SAPLING, MaterialColor.COLOR_MAGENTA)); - public static final WoodenMaterial DRAGON_TREE = new WoodenMaterial("dragon_tree", MaterialColor.COLOR_BLACK, MaterialColor.COLOR_MAGENTA); + public static final Block DRAGON_TREE_LEAVES = registerBlock( + "dragon_tree_leaves", + new PottableLeavesBlock(DRAGON_TREE_SAPLING, MaterialColor.COLOR_MAGENTA) + ); + public static final WoodenMaterial DRAGON_TREE = new WoodenMaterial( + "dragon_tree", + MaterialColor.COLOR_BLACK, + MaterialColor.COLOR_MAGENTA + ); public static final Block TENANEA_SAPLING = registerBlock("tenanea_sapling", new TenaneaSaplingBlock()); - public static final Block TENANEA_LEAVES = registerBlock("tenanea_leaves", new PottableLeavesBlock(TENANEA_SAPLING, MaterialColor.COLOR_PINK)); + public static final Block TENANEA_LEAVES = registerBlock( + "tenanea_leaves", + new PottableLeavesBlock(TENANEA_SAPLING, MaterialColor.COLOR_PINK) + ); public static final Block TENANEA_FLOWERS = registerBlock("tenanea_flowers", new TenaneaFlowersBlock()); - public static final Block TENANEA_OUTER_LEAVES = registerBlock("tenanea_outer_leaves", new FurBlock(TENANEA_SAPLING, 32)); - public static final WoodenMaterial TENANEA = new WoodenMaterial("tenanea", MaterialColor.COLOR_BROWN, MaterialColor.COLOR_PINK); + public static final Block TENANEA_OUTER_LEAVES = registerBlock( + "tenanea_outer_leaves", + new FurBlock(TENANEA_SAPLING, 32) + ); + public static final WoodenMaterial TENANEA = new WoodenMaterial( + "tenanea", + MaterialColor.COLOR_BROWN, + MaterialColor.COLOR_PINK + ); public static final Block HELIX_TREE_SAPLING = registerBlock("helix_tree_sapling", new HelixTreeSaplingBlock()); public static final Block HELIX_TREE_LEAVES = registerBlock("helix_tree_leaves", new HelixTreeLeavesBlock()); - public static final WoodenMaterial HELIX_TREE = new WoodenMaterial("helix_tree", MaterialColor.COLOR_GRAY, MaterialColor.COLOR_ORANGE); + public static final WoodenMaterial HELIX_TREE = new WoodenMaterial( + "helix_tree", + MaterialColor.COLOR_GRAY, + MaterialColor.COLOR_ORANGE + ); - public static final Block UMBRELLA_TREE_SAPLING = registerBlock("umbrella_tree_sapling", new UmbrellaTreeSaplingBlock()); - public static final Block UMBRELLA_TREE_MEMBRANE = registerBlock("umbrella_tree_membrane", new UmbrellaTreeMembraneBlock()); - public static final Block UMBRELLA_TREE_CLUSTER = registerBlock("umbrella_tree_cluster", new UmbrellaTreeClusterBlock()); - public static final Block UMBRELLA_TREE_CLUSTER_EMPTY = registerBlock("umbrella_tree_cluster_empty", new UmbrellaTreeClusterEmptyBlock()); - public static final WoodenMaterial UMBRELLA_TREE = new WoodenMaterial("umbrella_tree", MaterialColor.COLOR_BLUE, MaterialColor.COLOR_GREEN); + public static final Block UMBRELLA_TREE_SAPLING = registerBlock( + "umbrella_tree_sapling", + new UmbrellaTreeSaplingBlock() + ); + public static final Block UMBRELLA_TREE_MEMBRANE = registerBlock( + "umbrella_tree_membrane", + new UmbrellaTreeMembraneBlock() + ); + public static final Block UMBRELLA_TREE_CLUSTER = registerBlock( + "umbrella_tree_cluster", + new UmbrellaTreeClusterBlock() + ); + public static final Block UMBRELLA_TREE_CLUSTER_EMPTY = registerBlock( + "umbrella_tree_cluster_empty", + new UmbrellaTreeClusterEmptyBlock() + ); + public static final WoodenMaterial UMBRELLA_TREE = new WoodenMaterial( + "umbrella_tree", + MaterialColor.COLOR_BLUE, + MaterialColor.COLOR_GREEN + ); - public static final Block JELLYSHROOM_CAP_PURPLE = registerBlock("jellyshroom_cap_purple", new JellyshroomCapBlock(217, 142, 255, 164, 0, 255)); - public static final WoodenMaterial JELLYSHROOM = new WoodenMaterial("jellyshroom", MaterialColor.COLOR_PURPLE, MaterialColor.COLOR_LIGHT_BLUE); + public static final Block JELLYSHROOM_CAP_PURPLE = registerBlock( + "jellyshroom_cap_purple", + new JellyshroomCapBlock(217, 142, 255, 164, 0, 255) + ); + public static final WoodenMaterial JELLYSHROOM = new WoodenMaterial( + "jellyshroom", + MaterialColor.COLOR_PURPLE, + MaterialColor.COLOR_LIGHT_BLUE + ); public static final Block LUCERNIA_SAPLING = registerBlock("lucernia_sapling", new LucerniaSaplingBlock()); - public static final Block LUCERNIA_LEAVES = registerBlock("lucernia_leaves", new PottableLeavesBlock(LUCERNIA_SAPLING, MaterialColor.COLOR_ORANGE)); - public static final Block LUCERNIA_OUTER_LEAVES = registerBlock("lucernia_outer_leaves", new FurBlock(LUCERNIA_SAPLING, 32)); - public static final WoodenMaterial LUCERNIA = new WoodenMaterial("lucernia", MaterialColor.COLOR_ORANGE, MaterialColor.COLOR_ORANGE); + public static final Block LUCERNIA_LEAVES = registerBlock( + "lucernia_leaves", + new PottableLeavesBlock(LUCERNIA_SAPLING, MaterialColor.COLOR_ORANGE) + ); + public static final Block LUCERNIA_OUTER_LEAVES = registerBlock( + "lucernia_outer_leaves", + new FurBlock(LUCERNIA_SAPLING, 32) + ); + public static final WoodenMaterial LUCERNIA = new WoodenMaterial( + "lucernia", + MaterialColor.COLOR_ORANGE, + MaterialColor.COLOR_ORANGE + ); // Small Plants // public static final Block UMBRELLA_MOSS = registerBlock("umbrella_moss", new UmbrellaMossBlock()); @@ -265,15 +419,27 @@ public class EndBlocks extends BlocksRegistry { public static final Block SHADOW_PLANT = registerBlock("shadow_plant", new TerrainPlantBlock(SHADOW_GRASS)); public static final Block BUSHY_GRASS = registerBlock("bushy_grass", new TerrainPlantBlock(PINK_MOSS)); public static final Block AMBER_GRASS = registerBlock("amber_grass", new TerrainPlantBlock(AMBER_MOSS)); - public static final Block TWISTED_UMBRELLA_MOSS = registerBlock("twisted_umbrella_moss", new TwistedUmbrellaMossBlock()); - public static final Block TWISTED_UMBRELLA_MOSS_TALL = registerBlock("twisted_umbrella_moss_tall", new TwistedUmbrellaMossTallBlock()); + public static final Block TWISTED_UMBRELLA_MOSS = registerBlock( + "twisted_umbrella_moss", + new TwistedUmbrellaMossBlock() + ); + public static final Block TWISTED_UMBRELLA_MOSS_TALL = registerBlock( + "twisted_umbrella_moss_tall", + new TwistedUmbrellaMossTallBlock() + ); public static final Block JUNGLE_GRASS = registerBlock("jungle_grass", new TerrainPlantBlock(JUNGLE_MOSS)); public static final Block BLOOMING_COOKSONIA = registerBlock("blooming_cooksonia", new TerrainPlantBlock(END_MOSS)); public static final Block SALTEAGO = registerBlock("salteago", new TerrainPlantBlock(END_MOSS)); public static final Block VAIOLUSH_FERN = registerBlock("vaiolush_fern", new TerrainPlantBlock(END_MOSS)); public static final Block FRACTURN = registerBlock("fracturn", new TerrainPlantBlock(END_MOSS)); - public static final Block CLAWFERN = registerBlock("clawfern", new TerrainPlantBlock(SANGNUM, MOSSY_OBSIDIAN, MOSSY_DRAGON_BONE)); - public static final Block GLOBULAGUS = registerBlock("globulagus", new TerrainPlantBlock(SANGNUM, MOSSY_OBSIDIAN, MOSSY_DRAGON_BONE)); + public static final Block CLAWFERN = registerBlock( + "clawfern", + new TerrainPlantBlock(SANGNUM, MOSSY_OBSIDIAN, MOSSY_DRAGON_BONE) + ); + public static final Block GLOBULAGUS = registerBlock( + "globulagus", + new TerrainPlantBlock(SANGNUM, MOSSY_OBSIDIAN, MOSSY_DRAGON_BONE) + ); public static final Block ORANGO = registerBlock("orango", new TerrainPlantBlock(RUTISCUS)); public static final Block AERIDIUM = registerBlock("aeridium", new TerrainPlantBlock(RUTISCUS)); public static final Block LUTEBUS = registerBlock("lutebus", new TerrainPlantBlock(RUTISCUS)); @@ -282,15 +448,27 @@ public class EndBlocks extends BlocksRegistry { public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlueVineSeedBlock()); public static final Block BLUE_VINE = registerEndBlockOnly("blue_vine", new BlueVineBlock()); public static final Block BLUE_VINE_LANTERN = registerBlock("blue_vine_lantern", new BlueVineLanternBlock()); - public static final Block BLUE_VINE_FUR = registerBlock("blue_vine_fur", new FurBlock(BLUE_VINE_SEED, 15, 3, false)); + public static final Block BLUE_VINE_FUR = registerBlock( + "blue_vine_fur", + new FurBlock(BLUE_VINE_SEED, 15, 3, false) + ); public static final Block LANCELEAF_SEED = registerBlock("lanceleaf_seed", new LanceleafSeedBlock()); public static final Block LANCELEAF = registerEndBlockOnly("lanceleaf", new LanceleafBlock()); public static final Block GLOWING_PILLAR_SEED = registerBlock("glowing_pillar_seed", new GlowingPillarSeedBlock()); - public static final Block GLOWING_PILLAR_ROOTS = registerEndBlockOnly("glowing_pillar_roots", new GlowingPillarRootsBlock()); - public static final Block GLOWING_PILLAR_LUMINOPHOR = registerBlock("glowing_pillar_luminophor", new GlowingPillarLuminophorBlock()); - public static final Block GLOWING_PILLAR_LEAVES = registerBlock("glowing_pillar_leaves", new FurBlock(GLOWING_PILLAR_SEED, 15, 3, false)); + public static final Block GLOWING_PILLAR_ROOTS = registerEndBlockOnly( + "glowing_pillar_roots", + new GlowingPillarRootsBlock() + ); + public static final Block GLOWING_PILLAR_LUMINOPHOR = registerBlock( + "glowing_pillar_luminophor", + new GlowingPillarLuminophorBlock() + ); + public static final Block GLOWING_PILLAR_LEAVES = registerBlock( + "glowing_pillar_leaves", + new FurBlock(GLOWING_PILLAR_SEED, 15, 3, false) + ); public static final Block SMALL_JELLYSHROOM = registerBlock("small_jellyshroom", new SmallJellyshroomBlock()); public static final Block BOLUX_MUSHROOM = registerBlock("bolux_mushroom", new BoluxMushroomBlock()); @@ -298,25 +476,52 @@ public class EndBlocks extends BlocksRegistry { public static final Block LUMECORN_SEED = registerBlock("lumecorn_seed", new LumecornSeedBlock()); public static final Block LUMECORN = registerEndBlockOnly("lumecorn", new LumecornBlock()); - public static final Block SMALL_AMARANITA_MUSHROOM = registerBlock("small_amaranita_mushroom", new SmallAmaranitaBlock()); - public static final Block LARGE_AMARANITA_MUSHROOM = registerEndBlockOnly("large_amaranita_mushroom", new LargeAmaranitaBlock()); + public static final Block SMALL_AMARANITA_MUSHROOM = registerBlock( + "small_amaranita_mushroom", + new SmallAmaranitaBlock() + ); + public static final Block LARGE_AMARANITA_MUSHROOM = registerEndBlockOnly( + "large_amaranita_mushroom", + new LargeAmaranitaBlock() + ); public static final Block AMARANITA_STEM = registerBlock("amaranita_stem", new AmaranitaStemBlock()); public static final Block AMARANITA_HYPHAE = registerBlock("amaranita_hyphae", new AmaranitaStemBlock()); - public static final Block AMARANITA_HYMENOPHORE = registerBlock("amaranita_hymenophore", new AmaranitaHymenophoreBlock()); + public static final Block AMARANITA_HYMENOPHORE = registerBlock( + "amaranita_hymenophore", + new AmaranitaHymenophoreBlock() + ); public static final Block AMARANITA_LANTERN = registerBlock("amaranita_lantern", new GlowingHymenophoreBlock()); - public static final Block AMARANITA_FUR = registerBlock("amaranita_fur", new FurBlock(SMALL_AMARANITA_MUSHROOM, 15, 4, true)); + public static final Block AMARANITA_FUR = registerBlock( + "amaranita_fur", + new FurBlock(SMALL_AMARANITA_MUSHROOM, 15, 4, true) + ); public static final Block AMARANITA_CAP = registerBlock("amaranita_cap", new AmaranitaCapBlock()); public static final Block NEON_CACTUS = registerBlock("neon_cactus", new NeonCactusPlantBlock()); public static final Block NEON_CACTUS_BLOCK = registerBlock("neon_cactus_block", new NeonCactusBlock()); - public static final Block NEON_CACTUS_BLOCK_STAIRS = registerBlock("neon_cactus_stairs", new BaseStairsBlock(NEON_CACTUS_BLOCK)); - public static final Block NEON_CACTUS_BLOCK_SLAB = registerBlock("neon_cactus_slab", new BaseSlabBlock(NEON_CACTUS_BLOCK)); + public static final Block NEON_CACTUS_BLOCK_STAIRS = registerBlock( + "neon_cactus_stairs", + new BaseStairsBlock(NEON_CACTUS_BLOCK) + ); + public static final Block NEON_CACTUS_BLOCK_SLAB = registerBlock( + "neon_cactus_slab", + new BaseSlabBlock(NEON_CACTUS_BLOCK) + ); // Crops public static final Block SHADOW_BERRY = registerBlock("shadow_berry", new ShadowBerryBlock()); - public static final Block BLOSSOM_BERRY = registerBlock("blossom_berry_seed", new PottableCropBlock(EndItems.BLOSSOM_BERRY, PINK_MOSS)); - public static final Block AMBER_ROOT = registerBlock("amber_root_seed", new PottableCropBlock(EndItems.AMBER_ROOT_RAW, AMBER_MOSS)); - public static final Block CHORUS_MUSHROOM = registerBlock("chorus_mushroom_seed", new PottableCropBlock(EndItems.CHORUS_MUSHROOM_RAW, CHORUS_NYLIUM)); + public static final Block BLOSSOM_BERRY = registerBlock( + "blossom_berry_seed", + new PottableCropBlock(EndItems.BLOSSOM_BERRY, PINK_MOSS) + ); + public static final Block AMBER_ROOT = registerBlock( + "amber_root_seed", + new PottableCropBlock(EndItems.AMBER_ROOT_RAW, AMBER_MOSS) + ); + public static final Block CHORUS_MUSHROOM = registerBlock( + "chorus_mushroom_seed", + new PottableCropBlock(EndItems.CHORUS_MUSHROOM_RAW, CHORUS_NYLIUM) + ); //public static final Block PEARLBERRY = registerBlock("pearlberry_seed", new PottableCropBlock(EndItems.BLOSSOM_BERRY, END_MOSS, END_MYCELIUM)); public static final Block CAVE_PUMPKIN_SEED = registerBlock("cave_pumpkin_seed", new CavePumpkinVineBlock()); public static final Block CAVE_PUMPKIN = registerBlock("cave_pumpkin", new CavePumpkinBlock()); @@ -338,13 +543,20 @@ public class EndBlocks extends BlocksRegistry { public static final Block HYDRALUX_SAPLING = registerBlock("hydralux_sapling", new HydraluxSaplingBlock()); public static final Block HYDRALUX = registerEndBlockOnly("hydralux", new HydraluxBlock()); public static final Block HYDRALUX_PETAL_BLOCK = registerBlock("hydralux_petal_block", new HydraluxPetalBlock()); - public static final ColoredMaterial HYDRALUX_PETAL_BLOCK_COLORED = new ColoredMaterial(HydraluxPetalColoredBlock::new, HYDRALUX_PETAL_BLOCK, true); + public static final ColoredMaterial HYDRALUX_PETAL_BLOCK_COLORED = new ColoredMaterial( + HydraluxPetalColoredBlock::new, + HYDRALUX_PETAL_BLOCK, + true + ); public static final Block POND_ANEMONE = registerBlock("pond_anemone", new PondAnemoneBlock()); public static final Block FLAMAEA = registerBlock("flamaea", new FlamaeaBlock()); - public static final Block CAVE_BUSH = registerBlock("cave_bush", new SimpleLeavesBlock(MaterialColor.COLOR_MAGENTA)); + public static final Block CAVE_BUSH = registerBlock( + "cave_bush", + new SimpleLeavesBlock(MaterialColor.COLOR_MAGENTA) + ); public static final Block MURKWEED = registerBlock("murkweed", new MurkweedBlock()); public static final Block NEEDLEGRASS = registerBlock("needlegrass", new NeedlegrassBlock()); @@ -381,37 +593,83 @@ public class EndBlocks extends BlocksRegistry { public static final Block AMBER_ORE = registerBlock("amber_ore", new BaseOreBlock(EndItems.RAW_AMBER, 1, 2, 4)); // Materials // - public static final MetalMaterial THALLASIUM = MetalMaterial.makeNormal("thallasium", MaterialColor.COLOR_BLUE, EndToolMaterial.THALLASIUM, EndArmorMaterial.THALLASIUM); - public static final MetalMaterial TERMINITE = MetalMaterial.makeOreless("terminite", MaterialColor.WARPED_WART_BLOCK, 7F, 9F, EndToolMaterial.TERMINITE, EndArmorMaterial.TERMINITE); + public static final MetalMaterial THALLASIUM = MetalMaterial.makeNormal( + "thallasium", + MaterialColor.COLOR_BLUE, + EndToolMaterial.THALLASIUM, + EndArmorMaterial.THALLASIUM + ); + public static final MetalMaterial TERMINITE = MetalMaterial.makeOreless( + "terminite", + MaterialColor.WARPED_WART_BLOCK, + 7F, + 9F, + EndToolMaterial.TERMINITE, + EndArmorMaterial.TERMINITE + ); public static final Block AETERNIUM_BLOCK = registerBlock("aeternium_block", new AeterniumBlock()); public static final Block CHARCOAL_BLOCK = registerBlock("charcoal_block", new CharcoalBlock()); public static final Block ENDER_BLOCK = registerBlock("ender_block", new EnderBlock()); public static final Block AURORA_CRYSTAL = registerBlock("aurora_crystal", new AuroraCrystalBlock()); public static final Block AMBER_BLOCK = registerBlock("amber_block", new AmberBlock()); - public static final Block SMARAGDANT_CRYSTAL_SHARD = registerBlock("smaragdant_crystal_shard", new SmaragdantCrystalShardBlock()); + public static final Block SMARAGDANT_CRYSTAL_SHARD = registerBlock( + "smaragdant_crystal_shard", + new SmaragdantCrystalShardBlock() + ); public static final Block SMARAGDANT_CRYSTAL = registerBlock("smaragdant_crystal", new SmaragdantCrystalBlock()); - public static final CrystalSubblocksMaterial SMARAGDANT_SUBBLOCKS = new CrystalSubblocksMaterial("smaragdant_crystal", SMARAGDANT_CRYSTAL); + public static final CrystalSubblocksMaterial SMARAGDANT_SUBBLOCKS = new CrystalSubblocksMaterial( + "smaragdant_crystal", + SMARAGDANT_CRYSTAL + ); public static final Block RESPAWN_OBELISK = registerBlock("respawn_obelisk", new RespawnObeliskBlock()); // Lanterns - public static final Block ANDESITE_LANTERN = registerBlock("andesite_lantern", new StoneLanternBlock(Blocks.ANDESITE)); + public static final Block ANDESITE_LANTERN = registerBlock( + "andesite_lantern", + new StoneLanternBlock(Blocks.ANDESITE) + ); public static final Block DIORITE_LANTERN = registerBlock("diorite_lantern", new StoneLanternBlock(Blocks.DIORITE)); public static final Block GRANITE_LANTERN = registerBlock("granite_lantern", new StoneLanternBlock(Blocks.GRANITE)); - public static final Block QUARTZ_LANTERN = registerBlock("quartz_lantern", new StoneLanternBlock(Blocks.QUARTZ_BLOCK)); - public static final Block PURPUR_LANTERN = registerBlock("purpur_lantern", new StoneLanternBlock(Blocks.PURPUR_BLOCK)); - public static final Block END_STONE_LANTERN = registerBlock("end_stone_lantern", new StoneLanternBlock(Blocks.END_STONE)); - public static final Block BLACKSTONE_LANTERN = registerBlock("blackstone_lantern", new StoneLanternBlock(Blocks.BLACKSTONE)); + public static final Block QUARTZ_LANTERN = registerBlock( + "quartz_lantern", + new StoneLanternBlock(Blocks.QUARTZ_BLOCK) + ); + public static final Block PURPUR_LANTERN = registerBlock( + "purpur_lantern", + new StoneLanternBlock(Blocks.PURPUR_BLOCK) + ); + public static final Block END_STONE_LANTERN = registerBlock( + "end_stone_lantern", + new StoneLanternBlock(Blocks.END_STONE) + ); + public static final Block BLACKSTONE_LANTERN = registerBlock( + "blackstone_lantern", + new StoneLanternBlock(Blocks.BLACKSTONE) + ); public static final Block IRON_BULB_LANTERN = registerBlock("iron_bulb_lantern", new BulbVineLanternBlock()); - public static final ColoredMaterial IRON_BULB_LANTERN_COLORED = new ColoredMaterial(BulbVineLanternColoredBlock::new, IRON_BULB_LANTERN, false); + public static final ColoredMaterial IRON_BULB_LANTERN_COLORED = new ColoredMaterial( + BulbVineLanternColoredBlock::new, + IRON_BULB_LANTERN, + false + ); - public static final Block IRON_CHANDELIER = EndBlocks.registerBlock("iron_chandelier", new ChandelierBlock(Blocks.GOLD_BLOCK)); - public static final Block GOLD_CHANDELIER = EndBlocks.registerBlock("gold_chandelier", new ChandelierBlock(Blocks.GOLD_BLOCK)); + public static final Block IRON_CHANDELIER = EndBlocks.registerBlock( + "iron_chandelier", + new ChandelierBlock(Blocks.GOLD_BLOCK) + ); + public static final Block GOLD_CHANDELIER = EndBlocks.registerBlock( + "gold_chandelier", + new ChandelierBlock(Blocks.GOLD_BLOCK) + ); // Blocks With Entity // - public static final Block END_STONE_FURNACE = registerBlock("end_stone_furnace", new BaseFurnaceBlock(Blocks.END_STONE)); + public static final Block END_STONE_FURNACE = registerBlock( + "end_stone_furnace", + new BaseFurnaceBlock(Blocks.END_STONE) + ); public static final Block END_STONE_SMELTER = registerBlock("end_stone_smelter", new EndStoneSmelter()); public static final Block ETERNAL_PEDESTAL = registerBlock("eternal_pedestal", new EternalPedestal()); public static final Block INFUSION_PEDESTAL = registerBlock("infusion_pedestal", new InfusionPedestal()); @@ -427,9 +685,12 @@ public class EndBlocks extends BlocksRegistry { } public static List getModBlocks() { - return getModBlocks(BetterEnd.MOD_ID).stream().filter(BlockItem.class::isInstance).map(item -> ((BlockItem) item).getBlock()).collect(Collectors.toList()); + return getModBlocks(BetterEnd.MOD_ID).stream() + .filter(BlockItem.class::isInstance) + .map(item -> ((BlockItem) item).getBlock()) + .collect(Collectors.toList()); } - + public static Block registerAnvil(String name, EndAnvilBlock anvilBlock) { if (!Configs.BLOCK_CONFIG.getBooleanRoot(name, true)) { return anvilBlock; diff --git a/src/main/java/ru/betterend/registry/EndEntities.java b/src/main/java/ru/betterend/registry/EndEntities.java index c016c825..1f874fde 100644 --- a/src/main/java/ru/betterend/registry/EndEntities.java +++ b/src/main/java/ru/betterend/registry/EndEntities.java @@ -23,12 +23,72 @@ import ru.betterend.entity.SilkMothEntity; import ru.betterend.util.SpawnHelper; public class EndEntities { - public static final EntityType DRAGONFLY = register("dragonfly", MobCategory.AMBIENT, 0.6F, 0.5F, DragonflyEntity::new, DragonflyEntity.createMobAttributes(), true, ColorUtil.color(32, 42, 176), ColorUtil.color(115, 225, 249)); - public static final EntityType END_SLIME = register("end_slime", MobCategory.MONSTER, 2F, 2F, EndSlimeEntity::new, EndSlimeEntity.createMobAttributes(), false, ColorUtil.color(28, 28, 28), ColorUtil.color(99, 11, 99)); - public static final EntityType END_FISH = register("end_fish", MobCategory.WATER_AMBIENT, 0.5F, 0.5F, EndFishEntity::new, EndFishEntity.createMobAttributes(), true, ColorUtil.color(3, 50, 76), ColorUtil.color(120, 206, 255)); - public static final EntityType SHADOW_WALKER = register("shadow_walker", MobCategory.MONSTER, 0.6F, 1.95F, ShadowWalkerEntity::new, ShadowWalkerEntity.createMobAttributes(), true, ColorUtil.color(30, 30, 30), ColorUtil.color(5, 5, 5)); - public static final EntityType CUBOZOA = register("cubozoa", MobCategory.WATER_AMBIENT, 0.6F, 1F, CubozoaEntity::new, CubozoaEntity.createMobAttributes(), true, ColorUtil.color(151, 77, 181), ColorUtil.color(93, 176, 238)); - public static final EntityType SILK_MOTH = register("silk_moth", MobCategory.AMBIENT, 0.6F, 0.6F, SilkMothEntity::new, SilkMothEntity.createMobAttributes(), true, ColorUtil.color(198, 138, 204), ColorUtil.color(242, 220, 236)); + public static final EntityType DRAGONFLY = register( + "dragonfly", + MobCategory.AMBIENT, + 0.6F, + 0.5F, + DragonflyEntity::new, + DragonflyEntity.createMobAttributes(), + true, + ColorUtil.color(32, 42, 176), + ColorUtil.color(115, 225, 249) + ); + public static final EntityType END_SLIME = register( + "end_slime", + MobCategory.MONSTER, + 2F, + 2F, + EndSlimeEntity::new, + EndSlimeEntity.createMobAttributes(), + false, + ColorUtil.color(28, 28, 28), + ColorUtil.color(99, 11, 99) + ); + public static final EntityType END_FISH = register( + "end_fish", + MobCategory.WATER_AMBIENT, + 0.5F, + 0.5F, + EndFishEntity::new, + EndFishEntity.createMobAttributes(), + true, + ColorUtil.color(3, 50, 76), + ColorUtil.color(120, 206, 255) + ); + public static final EntityType SHADOW_WALKER = register( + "shadow_walker", + MobCategory.MONSTER, + 0.6F, + 1.95F, + ShadowWalkerEntity::new, + ShadowWalkerEntity.createMobAttributes(), + true, + ColorUtil.color(30, 30, 30), + ColorUtil.color(5, 5, 5) + ); + public static final EntityType CUBOZOA = register( + "cubozoa", + MobCategory.WATER_AMBIENT, + 0.6F, + 1F, + CubozoaEntity::new, + CubozoaEntity.createMobAttributes(), + true, + ColorUtil.color(151, 77, 181), + ColorUtil.color(93, 176, 238) + ); + public static final EntityType SILK_MOTH = register( + "silk_moth", + MobCategory.AMBIENT, + 0.6F, + 0.6F, + SilkMothEntity::new, + SilkMothEntity.createMobAttributes(), + true, + ColorUtil.color(198, 138, 204), + ColorUtil.color(242, 220, 236) + ); public static void register() { SpawnHelper.restrictionAir(DRAGONFLY, DragonflyEntity::canSpawn); @@ -41,7 +101,9 @@ public class EndEntities { protected static EntityType register(String name, MobCategory group, float width, float height, EntityFactory entity) { ResourceLocation id = BetterEnd.makeID(name); - EntityType type = FabricEntityTypeBuilder.create(group, entity).dimensions(EntityDimensions.fixed(width, height)).build(); + EntityType type = FabricEntityTypeBuilder.create(group, entity) + .dimensions(EntityDimensions.fixed(width, height)) + .build(); if (Configs.ENTITY_CONFIG.getBooleanRoot(id.getPath(), true)) { return Registry.register(Registry.ENTITY_TYPE, id, type); } @@ -50,7 +112,12 @@ public class EndEntities { private static EntityType register(String name, MobCategory group, float width, float height, EntityFactory entity, Builder attributes, boolean fixedSize, int eggColor, int dotsColor) { ResourceLocation id = BetterEnd.makeID(name); - EntityType type = FabricEntityTypeBuilder.create(group, entity).dimensions(fixedSize ? EntityDimensions.fixed(width, height) : EntityDimensions.scalable(width, height)).build(); + EntityType type = FabricEntityTypeBuilder.create(group, entity) + .dimensions(fixedSize ? EntityDimensions.fixed( + width, + height + ) : EntityDimensions.scalable(width, height)) + .build(); if (Configs.ENTITY_CONFIG.getBooleanRoot(id.getPath(), true)) { FabricDefaultAttributeRegistry.register(type, attributes); EndItems.registerEndEgg("spawn_egg_" + name, type, eggColor, dotsColor); diff --git a/src/main/java/ru/betterend/registry/EndEntitiesRenders.java b/src/main/java/ru/betterend/registry/EndEntitiesRenders.java index cd322df0..f4ba1b0e 100644 --- a/src/main/java/ru/betterend/registry/EndEntitiesRenders.java +++ b/src/main/java/ru/betterend/registry/EndEntitiesRenders.java @@ -50,15 +50,24 @@ public class EndEntitiesRenders { register(EndEntities.SILK_MOTH, SilkMothEntityRenderer.class); EntityModelLayerRegistry.registerModelLayer(DRAGONFLY_MODEL, DragonflyEntityModel::getTexturedModelData); - EntityModelLayerRegistry.registerModelLayer(END_SLIME_SHELL_MODEL, EndSlimeEntityModel::getShellOnlyTexturedModelData); + EntityModelLayerRegistry.registerModelLayer( + END_SLIME_SHELL_MODEL, + EndSlimeEntityModel::getShellOnlyTexturedModelData + ); EntityModelLayerRegistry.registerModelLayer(END_SLIME_MODEL, EndSlimeEntityModel::getCompleteTexturedModelData); EntityModelLayerRegistry.registerModelLayer(END_FISH_MODEL, EndFishEntityModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(CUBOZOA_MODEL, CubozoaEntityModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(SILK_MOTH_MODEL, SilkMothEntityModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(ARMORED_ELYTRA, ArmoredElytraModel::getTexturedModelData); - EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_CHESTPLATE, CrystaliteChestplateModel::getRegularTexturedModelData); - EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_CHESTPLATE_THIN, CrystaliteChestplateModel::getThinTexturedModelData); + EntityModelLayerRegistry.registerModelLayer( + CRYSTALITE_CHESTPLATE, + CrystaliteChestplateModel::getRegularTexturedModelData + ); + EntityModelLayerRegistry.registerModelLayer( + CRYSTALITE_CHESTPLATE_THIN, + CrystaliteChestplateModel::getThinTexturedModelData + ); EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_HELMET, CrystaliteHelmetModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_LEGGINGS, CrystaliteLeggingsModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_BOOTS, CrystaliteBootsModel::getTexturedModelData); diff --git a/src/main/java/ru/betterend/registry/EndFeatures.java b/src/main/java/ru/betterend/registry/EndFeatures.java index 7042b14e..070b8362 100644 --- a/src/main/java/ru/betterend/registry/EndFeatures.java +++ b/src/main/java/ru/betterend/registry/EndFeatures.java @@ -83,114 +83,401 @@ import java.util.function.Supplier; public class EndFeatures { // Trees // - public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom", new MossyGlowshroomFeature(), 3); - public static final BCLFeature PYTHADENDRON_TREE = redisterVegetation("pythadendron_tree", new PythadendronTreeFeature(), 2); + public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation( + "mossy_glowshroom", + new MossyGlowshroomFeature(), + 3 + ); + public static final BCLFeature PYTHADENDRON_TREE = redisterVegetation( + "pythadendron_tree", + new PythadendronTreeFeature(), + 2 + ); public static final BCLFeature LACUGROVE = redisterVegetation("lacugrove", new LacugroveFeature(), 4); public static final BCLFeature DRAGON_TREE = redisterVegetation("dragon_tree", new DragonTreeFeature(), 3); public static final BCLFeature TENANEA = redisterVegetation("tenanea", new TenaneaFeature(), 3); public static final BCLFeature HELIX_TREE = redisterVegetation("helix_tree", new HelixTreeFeature(), 2); public static final BCLFeature UMBRELLA_TREE = redisterVegetation("umbrella_tree", new UmbrellaTreeFeature(), 4); public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 3); - public static final BCLFeature GIGANTIC_AMARANITA = redisterVegetation("gigantic_amaranita", new GiganticAmaranitaFeature(), 1); + public static final BCLFeature GIGANTIC_AMARANITA = redisterVegetation( + "gigantic_amaranita", + new GiganticAmaranitaFeature(), + 1 + ); public static final BCLFeature LUCERNIA = redisterVegetation("lucernia", new LucerniaFeature(), 3); // Bushes // - public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation("pythadendron_bush", new BushFeature(EndBlocks.PYTHADENDRON_LEAVES, EndBlocks.PYTHADENDRON.bark), 4); - public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.bark), 15); + public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation( + "pythadendron_bush", + new BushFeature(EndBlocks.PYTHADENDRON_LEAVES, EndBlocks.PYTHADENDRON.bark), + 4 + ); + public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation( + "dragon_tree_bush", + new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.bark), + 15 + ); public static final BCLFeature TENANEA_BUSH = redisterVegetation("tenanea_bush", new TenaneaBushFeature(), 10); public static final BCLFeature LUMECORN = redisterVegetation("lumecorn", new Lumecorn(), 5); - public static final BCLFeature LARGE_AMARANITA = redisterVegetation("large_amaranita", new LargeAmaranitaFeature(), 5); - public static final BCLFeature LUCERNIA_BUSH = redisterVegetation("lucernia_bush", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), 10); - public static final BCLFeature LUCERNIA_BUSH_RARE = redisterVegetation("lucernia_bush_rare", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), 1); + public static final BCLFeature LARGE_AMARANITA = redisterVegetation( + "large_amaranita", + new LargeAmaranitaFeature(), + 5 + ); + public static final BCLFeature LUCERNIA_BUSH = redisterVegetation( + "lucernia_bush", + new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), + 10 + ); + public static final BCLFeature LUCERNIA_BUSH_RARE = redisterVegetation( + "lucernia_bush_rare", + new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), + 1 + ); public static final BCLFeature NEON_CACTUS = redisterVegetation("neon_cactus", new NeonCactusFeature(), 2); // Plants // - public static final BCLFeature UMBRELLA_MOSS = redisterVegetation("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 5); - public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 5); + public static final BCLFeature UMBRELLA_MOSS = redisterVegetation( + "umbrella_moss", + new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), + 5 + ); + public static final BCLFeature CREEPING_MOSS = redisterVegetation( + "creeping_moss", + new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), + 5 + ); public static final BCLFeature BLUE_VINE = redisterVegetation("blue_vine", new BlueVineFeature(), 1); - public static final BCLFeature CHORUS_GRASS = redisterVegetation("chorus_grass", new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4), 5); - public static final BCLFeature CRYSTAL_GRASS = redisterVegetation("crystal_grass", new SinglePlantFeature(EndBlocks.CRYSTAL_GRASS, 8, false), 5); - public static final BCLFeature SHADOW_PLANT = redisterVegetation("shadow_plant", new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6), 9); - public static final BCLFeature MURKWEED = redisterVegetation("murkweed", new SinglePlantFeature(EndBlocks.MURKWEED, 3), 2); - public static final BCLFeature NEEDLEGRASS = redisterVegetation("needlegrass", new SinglePlantFeature(EndBlocks.NEEDLEGRASS, 3), 2); - public static final BCLFeature SHADOW_BERRY = redisterVegetation("shadow_berry", new SinglePlantFeature(EndBlocks.SHADOW_BERRY, 2), 1); - public static final BCLFeature BUSHY_GRASS = redisterVegetation("bushy_grass", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 8, false), 20); - public static final BCLFeature BUSHY_GRASS_WG = redisterVegetation("bushy_grass_wg", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 5), 10); - public static final BCLFeature AMBER_GRASS = redisterVegetation("amber_grass", new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6), 9); + public static final BCLFeature CHORUS_GRASS = redisterVegetation( + "chorus_grass", + new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4), + 5 + ); + public static final BCLFeature CRYSTAL_GRASS = redisterVegetation( + "crystal_grass", + new SinglePlantFeature(EndBlocks.CRYSTAL_GRASS, 8, false), + 5 + ); + public static final BCLFeature SHADOW_PLANT = redisterVegetation( + "shadow_plant", + new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6), + 9 + ); + public static final BCLFeature MURKWEED = redisterVegetation( + "murkweed", + new SinglePlantFeature(EndBlocks.MURKWEED, 3), + 2 + ); + public static final BCLFeature NEEDLEGRASS = redisterVegetation( + "needlegrass", + new SinglePlantFeature(EndBlocks.NEEDLEGRASS, 3), + 2 + ); + public static final BCLFeature SHADOW_BERRY = redisterVegetation( + "shadow_berry", + new SinglePlantFeature(EndBlocks.SHADOW_BERRY, 2), + 1 + ); + public static final BCLFeature BUSHY_GRASS = redisterVegetation( + "bushy_grass", + new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 8, false), + 20 + ); + public static final BCLFeature BUSHY_GRASS_WG = redisterVegetation( + "bushy_grass_wg", + new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 5), + 10 + ); + public static final BCLFeature AMBER_GRASS = redisterVegetation( + "amber_grass", + new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6), + 9 + ); public static final BCLFeature LANCELEAF = redisterVegetation("lanceleaf", new LanceleafFeature(), 3); public static final BCLFeature GLOW_PILLAR = redisterVegetation("glow_pillar", new GlowPillarFeature(), 1); - public static final BCLFeature TWISTED_UMBRELLA_MOSS = redisterVegetation("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), 5); - public static final BCLFeature JUNGLE_GRASS = redisterVegetation("jungle_grass", new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), 8); - public static final BCLFeature SMALL_JELLYSHROOM_FLOOR = redisterVegetation("small_jellyshroom_floor", new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM, 5, 5), 4); - public static final BCLFeature BLOSSOM_BERRY = redisterVegetation("blossom_berry", new SinglePlantFeature(EndBlocks.BLOSSOM_BERRY, 3, 3), 2); - public static final BCLFeature BLOOMING_COOKSONIA = redisterVegetation("blooming_cooksonia", new SinglePlantFeature(EndBlocks.BLOOMING_COOKSONIA, 5), 5); - public static final BCLFeature SALTEAGO = redisterVegetation("salteago", new SinglePlantFeature(EndBlocks.SALTEAGO, 5), 5); - public static final BCLFeature VAIOLUSH_FERN = redisterVegetation("vaiolush_fern", new SinglePlantFeature(EndBlocks.VAIOLUSH_FERN, 5), 5); - public static final BCLFeature FRACTURN = redisterVegetation("fracturn", new SinglePlantFeature(EndBlocks.FRACTURN, 5), 5); - public static final BCLFeature UMBRELLA_MOSS_RARE = redisterVegetation("umbrella_moss_rare", new SinglePlantFeature(EndBlocks.UMBRELLA_MOSS, 3), 2); - public static final BCLFeature CREEPING_MOSS_RARE = redisterVegetation("creeping_moss_rare", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 3), 2); - public static final BCLFeature TWISTED_UMBRELLA_MOSS_RARE = redisterVegetation("twisted_umbrella_moss_rare", new SinglePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, 3), 2); - public static final BCLFeature ORANGO = redisterVegetation("orango", new SinglePlantFeature(EndBlocks.ORANGO, 5), 6); - public static final BCLFeature AERIDIUM = redisterVegetation("aeridium", new SinglePlantFeature(EndBlocks.AERIDIUM, 5, 4), 5); - public static final BCLFeature LUTEBUS = redisterVegetation("lutebus", new SinglePlantFeature(EndBlocks.LUTEBUS, 5, 2), 5); - public static final BCLFeature LAMELLARIUM = redisterVegetation("lamellarium", new SinglePlantFeature(EndBlocks.LAMELLARIUM, 5), 6); - public static final BCLFeature SMALL_AMARANITA = redisterVegetation("small_amaranita", new SinglePlantFeature(EndBlocks.SMALL_AMARANITA_MUSHROOM, 5, 5), 4); - public static final BCLFeature GLOBULAGUS = redisterVegetation("globulagus", new SinglePlantFeature(EndBlocks.GLOBULAGUS, 5, 3), 6); - public static final BCLFeature CLAWFERN = redisterVegetation("clawfern", new SinglePlantFeature(EndBlocks.CLAWFERN, 5, 4), 5); - public static final BCLFeature BOLUX_MUSHROOM = redisterVegetation("bolux_mushroom", new SinglePlantFeature(EndBlocks.BOLUX_MUSHROOM, 5, 5), 2); - public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom", new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 5, 5), 1); - public static final BCLFeature AMBER_ROOT = redisterVegetation("amber_root", new SinglePlantFeature(EndBlocks.AMBER_ROOT, 5, 5), 1); + public static final BCLFeature TWISTED_UMBRELLA_MOSS = redisterVegetation( + "twisted_umbrella_moss", + new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), + 5 + ); + public static final BCLFeature JUNGLE_GRASS = redisterVegetation( + "jungle_grass", + new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), + 8 + ); + public static final BCLFeature SMALL_JELLYSHROOM_FLOOR = redisterVegetation( + "small_jellyshroom_floor", + new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM, 5, 5), + 4 + ); + public static final BCLFeature BLOSSOM_BERRY = redisterVegetation( + "blossom_berry", + new SinglePlantFeature(EndBlocks.BLOSSOM_BERRY, 3, 3), + 2 + ); + public static final BCLFeature BLOOMING_COOKSONIA = redisterVegetation( + "blooming_cooksonia", + new SinglePlantFeature(EndBlocks.BLOOMING_COOKSONIA, 5), + 5 + ); + public static final BCLFeature SALTEAGO = redisterVegetation( + "salteago", + new SinglePlantFeature(EndBlocks.SALTEAGO, 5), + 5 + ); + public static final BCLFeature VAIOLUSH_FERN = redisterVegetation( + "vaiolush_fern", + new SinglePlantFeature(EndBlocks.VAIOLUSH_FERN, 5), + 5 + ); + public static final BCLFeature FRACTURN = redisterVegetation( + "fracturn", + new SinglePlantFeature(EndBlocks.FRACTURN, 5), + 5 + ); + public static final BCLFeature UMBRELLA_MOSS_RARE = redisterVegetation( + "umbrella_moss_rare", + new SinglePlantFeature(EndBlocks.UMBRELLA_MOSS, 3), + 2 + ); + public static final BCLFeature CREEPING_MOSS_RARE = redisterVegetation( + "creeping_moss_rare", + new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 3), + 2 + ); + public static final BCLFeature TWISTED_UMBRELLA_MOSS_RARE = redisterVegetation( + "twisted_umbrella_moss_rare", + new SinglePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, 3), + 2 + ); + public static final BCLFeature ORANGO = redisterVegetation( + "orango", + new SinglePlantFeature(EndBlocks.ORANGO, 5), + 6 + ); + public static final BCLFeature AERIDIUM = redisterVegetation( + "aeridium", + new SinglePlantFeature(EndBlocks.AERIDIUM, 5, 4), + 5 + ); + public static final BCLFeature LUTEBUS = redisterVegetation( + "lutebus", + new SinglePlantFeature(EndBlocks.LUTEBUS, 5, 2), + 5 + ); + public static final BCLFeature LAMELLARIUM = redisterVegetation( + "lamellarium", + new SinglePlantFeature(EndBlocks.LAMELLARIUM, 5), + 6 + ); + public static final BCLFeature SMALL_AMARANITA = redisterVegetation( + "small_amaranita", + new SinglePlantFeature(EndBlocks.SMALL_AMARANITA_MUSHROOM, 5, 5), + 4 + ); + public static final BCLFeature GLOBULAGUS = redisterVegetation( + "globulagus", + new SinglePlantFeature(EndBlocks.GLOBULAGUS, 5, 3), + 6 + ); + public static final BCLFeature CLAWFERN = redisterVegetation( + "clawfern", + new SinglePlantFeature(EndBlocks.CLAWFERN, 5, 4), + 5 + ); + public static final BCLFeature BOLUX_MUSHROOM = redisterVegetation( + "bolux_mushroom", + new SinglePlantFeature(EndBlocks.BOLUX_MUSHROOM, 5, 5), + 2 + ); + public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation( + "chorus_mushroom", + new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 5, 5), + 1 + ); + public static final BCLFeature AMBER_ROOT = redisterVegetation( + "amber_root", + new SinglePlantFeature(EndBlocks.AMBER_ROOT, 5, 5), + 1 + ); //public static final BCLFeature PEARLBERRY = redisterVegetation("pearlberry", new SinglePlantFeature(EndBlocks.PEARLBERRY, 5, 5), 1); // Vines // - public static final BCLFeature DENSE_VINE = redisterVegetation("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3); - public static final BCLFeature TWISTED_VINE = redisterVegetation("twisted_vine", new VineFeature(EndBlocks.TWISTED_VINE, 24), 3); - public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 5); - public static final BCLFeature JUNGLE_VINE = redisterVegetation("jungle_vine", new VineFeature(EndBlocks.JUNGLE_VINE, 24), 5); + public static final BCLFeature DENSE_VINE = redisterVegetation( + "dense_vine", + new VineFeature(EndBlocks.DENSE_VINE, 24), + 3 + ); + public static final BCLFeature TWISTED_VINE = redisterVegetation( + "twisted_vine", + new VineFeature(EndBlocks.TWISTED_VINE, 24), + 3 + ); + public static final BCLFeature BULB_VINE = redisterVegetation( + "bulb_vine", + new VineFeature(EndBlocks.BULB_VINE, 24), + 5 + ); + public static final BCLFeature JUNGLE_VINE = redisterVegetation( + "jungle_vine", + new VineFeature(EndBlocks.JUNGLE_VINE, 24), + 5 + ); // Ceil plants - public static final BCLFeature SMALL_JELLYSHROOM_CEIL = redisterVegetation("small_jellyshroom_ceil", new SingleInvertedScatterFeature(EndBlocks.SMALL_JELLYSHROOM, 8), 8); + public static final BCLFeature SMALL_JELLYSHROOM_CEIL = redisterVegetation( + "small_jellyshroom_ceil", + new SingleInvertedScatterFeature(EndBlocks.SMALL_JELLYSHROOM, 8), + 8 + ); // Wall Plants // - public static final BCLFeature PURPLE_POLYPORE = redisterVegetation("purple_polypore", new WallPlantOnLogFeature(EndBlocks.PURPLE_POLYPORE, 3), 5); - public static final BCLFeature AURANT_POLYPORE = redisterVegetation("aurant_polypore", new WallPlantOnLogFeature(EndBlocks.AURANT_POLYPORE, 3), 5); - public static final BCLFeature TAIL_MOSS = redisterVegetation("tail_moss", new WallPlantFeature(EndBlocks.TAIL_MOSS, 3), 15); - public static final BCLFeature CYAN_MOSS = redisterVegetation("cyan_moss", new WallPlantFeature(EndBlocks.CYAN_MOSS, 3), 15); - public static final BCLFeature TAIL_MOSS_WOOD = redisterVegetation("tail_moss_wood", new WallPlantOnLogFeature(EndBlocks.TAIL_MOSS, 4), 25); - public static final BCLFeature CYAN_MOSS_WOOD = redisterVegetation("cyan_moss_wood", new WallPlantOnLogFeature(EndBlocks.CYAN_MOSS, 4), 25); - public static final BCLFeature TWISTED_MOSS = redisterVegetation("twisted_moss", new WallPlantFeature(EndBlocks.TWISTED_MOSS, 6), 15); - public static final BCLFeature TWISTED_MOSS_WOOD = redisterVegetation("twisted_moss_wood", new WallPlantOnLogFeature(EndBlocks.TWISTED_MOSS, 6), 25); - public static final BCLFeature BULB_MOSS = redisterVegetation("bulb_moss", new WallPlantFeature(EndBlocks.BULB_MOSS, 6), 1); - public static final BCLFeature BULB_MOSS_WOOD = redisterVegetation("bulb_moss_wood", new WallPlantOnLogFeature(EndBlocks.BULB_MOSS, 6), 15); - public static final BCLFeature SMALL_JELLYSHROOM_WALL = redisterVegetation("small_jellyshroom_wall", new WallPlantFeature(EndBlocks.SMALL_JELLYSHROOM, 4), 4); - public static final BCLFeature SMALL_JELLYSHROOM_WOOD = redisterVegetation("small_jellyshroom_wood", new WallPlantOnLogFeature(EndBlocks.SMALL_JELLYSHROOM, 4), 8); - public static final BCLFeature JUNGLE_FERN_WOOD = redisterVegetation("jungle_fern_wood", new WallPlantOnLogFeature(EndBlocks.JUNGLE_FERN, 3), 12); + public static final BCLFeature PURPLE_POLYPORE = redisterVegetation( + "purple_polypore", + new WallPlantOnLogFeature(EndBlocks.PURPLE_POLYPORE, 3), + 5 + ); + public static final BCLFeature AURANT_POLYPORE = redisterVegetation( + "aurant_polypore", + new WallPlantOnLogFeature(EndBlocks.AURANT_POLYPORE, 3), + 5 + ); + public static final BCLFeature TAIL_MOSS = redisterVegetation( + "tail_moss", + new WallPlantFeature(EndBlocks.TAIL_MOSS, 3), + 15 + ); + public static final BCLFeature CYAN_MOSS = redisterVegetation( + "cyan_moss", + new WallPlantFeature(EndBlocks.CYAN_MOSS, 3), + 15 + ); + public static final BCLFeature TAIL_MOSS_WOOD = redisterVegetation( + "tail_moss_wood", + new WallPlantOnLogFeature(EndBlocks.TAIL_MOSS, 4), + 25 + ); + public static final BCLFeature CYAN_MOSS_WOOD = redisterVegetation( + "cyan_moss_wood", + new WallPlantOnLogFeature(EndBlocks.CYAN_MOSS, 4), + 25 + ); + public static final BCLFeature TWISTED_MOSS = redisterVegetation( + "twisted_moss", + new WallPlantFeature(EndBlocks.TWISTED_MOSS, 6), + 15 + ); + public static final BCLFeature TWISTED_MOSS_WOOD = redisterVegetation( + "twisted_moss_wood", + new WallPlantOnLogFeature(EndBlocks.TWISTED_MOSS, 6), + 25 + ); + public static final BCLFeature BULB_MOSS = redisterVegetation( + "bulb_moss", + new WallPlantFeature(EndBlocks.BULB_MOSS, 6), + 1 + ); + public static final BCLFeature BULB_MOSS_WOOD = redisterVegetation( + "bulb_moss_wood", + new WallPlantOnLogFeature(EndBlocks.BULB_MOSS, 6), + 15 + ); + public static final BCLFeature SMALL_JELLYSHROOM_WALL = redisterVegetation( + "small_jellyshroom_wall", + new WallPlantFeature(EndBlocks.SMALL_JELLYSHROOM, 4), + 4 + ); + public static final BCLFeature SMALL_JELLYSHROOM_WOOD = redisterVegetation( + "small_jellyshroom_wood", + new WallPlantOnLogFeature(EndBlocks.SMALL_JELLYSHROOM, 4), + 8 + ); + public static final BCLFeature JUNGLE_FERN_WOOD = redisterVegetation( + "jungle_fern_wood", + new WallPlantOnLogFeature(EndBlocks.JUNGLE_FERN, 3), + 12 + ); public static final BCLFeature RUSCUS = redisterVegetation("ruscus", new WallPlantFeature(EndBlocks.RUSCUS, 6), 10); - public static final BCLFeature RUSCUS_WOOD = redisterVegetation("ruscus_wood", new WallPlantOnLogFeature(EndBlocks.RUSCUS, 6), 10); + public static final BCLFeature RUSCUS_WOOD = redisterVegetation( + "ruscus_wood", + new WallPlantOnLogFeature(EndBlocks.RUSCUS, 6), + 10 + ); // Sky plants public static final BCLFeature FILALUX = redisterVegetation("filalux", new FilaluxFeature(), 1); // Water // - public static final BCLFeature BUBBLE_CORAL = redisterVegetation("bubble_coral", new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 6), 10); - public static final BCLFeature BUBBLE_CORAL_RARE = redisterVegetation("bubble_coral_rare", new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 3), 4); + public static final BCLFeature BUBBLE_CORAL = redisterVegetation( + "bubble_coral", + new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 6), + 10 + ); + public static final BCLFeature BUBBLE_CORAL_RARE = redisterVegetation( + "bubble_coral_rare", + new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 3), + 4 + ); public static final BCLFeature END_LILY = redisterVegetation("end_lily", new EndLilyFeature(6), 10); public static final BCLFeature END_LILY_RARE = redisterVegetation("end_lily_rare", new EndLilyFeature(3), 4); public static final BCLFeature END_LOTUS = redisterVegetation("end_lotus", new EndLotusFeature(7), 5); - public static final BCLFeature END_LOTUS_LEAF = redisterVegetation("end_lotus_leaf", new EndLotusLeafFeature(20), 25); + public static final BCLFeature END_LOTUS_LEAF = redisterVegetation( + "end_lotus_leaf", + new EndLotusLeafFeature(20), + 25 + ); public static final BCLFeature HYDRALUX = redisterVegetation("hydralux", new HydraluxFeature(5), 5); - public static final BCLFeature POND_ANEMONE = redisterVegetation("pond_anemone", new UnderwaterPlantFeature(EndBlocks.POND_ANEMONE, 6), 10); + public static final BCLFeature POND_ANEMONE = redisterVegetation( + "pond_anemone", + new UnderwaterPlantFeature(EndBlocks.POND_ANEMONE, 6), + 10 + ); - public static final BCLFeature CHARNIA_RED = redisterVegetation("charnia_red", new CharniaFeature(EndBlocks.CHARNIA_RED), 10); - public static final BCLFeature CHARNIA_PURPLE = redisterVegetation("charnia_purple", new CharniaFeature(EndBlocks.CHARNIA_PURPLE), 10); - public static final BCLFeature CHARNIA_CYAN = redisterVegetation("charnia_cyan", new CharniaFeature(EndBlocks.CHARNIA_CYAN), 10); - public static final BCLFeature CHARNIA_LIGHT_BLUE = redisterVegetation("charnia_light_blue", new CharniaFeature(EndBlocks.CHARNIA_LIGHT_BLUE), 10); - public static final BCLFeature CHARNIA_ORANGE = redisterVegetation("charnia_orange", new CharniaFeature(EndBlocks.CHARNIA_ORANGE), 10); - public static final BCLFeature CHARNIA_GREEN = redisterVegetation("charnia_green", new CharniaFeature(EndBlocks.CHARNIA_GREEN), 10); + public static final BCLFeature CHARNIA_RED = redisterVegetation( + "charnia_red", + new CharniaFeature(EndBlocks.CHARNIA_RED), + 10 + ); + public static final BCLFeature CHARNIA_PURPLE = redisterVegetation( + "charnia_purple", + new CharniaFeature(EndBlocks.CHARNIA_PURPLE), + 10 + ); + public static final BCLFeature CHARNIA_CYAN = redisterVegetation( + "charnia_cyan", + new CharniaFeature(EndBlocks.CHARNIA_CYAN), + 10 + ); + public static final BCLFeature CHARNIA_LIGHT_BLUE = redisterVegetation( + "charnia_light_blue", + new CharniaFeature(EndBlocks.CHARNIA_LIGHT_BLUE), + 10 + ); + public static final BCLFeature CHARNIA_ORANGE = redisterVegetation( + "charnia_orange", + new CharniaFeature(EndBlocks.CHARNIA_ORANGE), + 10 + ); + public static final BCLFeature CHARNIA_GREEN = redisterVegetation( + "charnia_green", + new CharniaFeature(EndBlocks.CHARNIA_GREEN), + 10 + ); public static final BCLFeature MENGER_SPONGE = redisterVegetation("menger_sponge", new MengerSpongeFeature(5), 1); - public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation("charnia_red_rare", new CharniaFeature(EndBlocks.CHARNIA_RED), 2); - public static final BCLFeature BIOME_ISLAND = BCLFeature.makeFeatureConfigured(BetterEnd.makeID("overworld_island"), new BiomeIslandFeature()); - public static final BCLFeature FLAMAEA = redisterVegetation("flamaea", new SinglePlantFeature(EndBlocks.FLAMAEA, 12, false, 5), 20); + public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation( + "charnia_red_rare", + new CharniaFeature(EndBlocks.CHARNIA_RED), + 2 + ); + public static final BCLFeature BIOME_ISLAND = BCLFeature.makeFeatureConfigured( + BetterEnd.makeID("overworld_island"), + new BiomeIslandFeature() + ); + public static final BCLFeature FLAMAEA = redisterVegetation( + "flamaea", + new SinglePlantFeature(EndBlocks.FLAMAEA, 12, false, 5), + 20 + ); // Terrain // public static final BCLFeature END_LAKE = registerLake("end_lake", new EndLakeFeature(), 4); @@ -202,22 +489,63 @@ public class EndFeatures { public static final BCLFeature FLOATING_SPIRE = registerRawGen("floating_spire", new FloatingSpireFeature(), 8); public static final BCLFeature GEYSER = registerRawGen("geyser", new GeyserFeature(), 8); public static final BCLFeature SULPHURIC_LAKE = registerLake("sulphuric_lake", new SulphuricLakeFeature(), 8); - public static final BCLFeature SULPHURIC_CAVE = BCLFeature.makeCountRawFeature(BetterEnd.makeID("sulphuric_cave"), new SulphuricCaveFeature(), 2); + public static final BCLFeature SULPHURIC_CAVE = BCLFeature.makeCountRawFeature( + BetterEnd.makeID("sulphuric_cave"), + new SulphuricCaveFeature(), + 2 + ); public static final BCLFeature ICE_STAR = registerRawGen("ice_star", new IceStarFeature(5, 15, 10, 25), 15); - public static final BCLFeature ICE_STAR_SMALL = registerRawGen("ice_star_small", new IceStarFeature(3, 5, 7, 12), 8); + public static final BCLFeature ICE_STAR_SMALL = registerRawGen( + "ice_star_small", + new IceStarFeature(3, 5, 7, 12), + 8 + ); public static final BCLFeature SURFACE_VENT = registerChanced("surface_vent", new SurfaceVentFeature(), 4); public static final BCLFeature SULPHUR_HILL = registerChanced("sulphur_hill", new SulphurHillFeature(), 8); - public static final BCLFeature OBSIDIAN_PILLAR_BASEMENT = registerChanced("obsidian_pillar_basement", new ObsidianPillarBasementFeature(), 8); - public static final BCLFeature OBSIDIAN_BOULDER = registerChanced("obsidian_boulder", new ObsidianBoulderFeature(), 10); + public static final BCLFeature OBSIDIAN_PILLAR_BASEMENT = registerChanced( + "obsidian_pillar_basement", + new ObsidianPillarBasementFeature(), + 8 + ); + public static final BCLFeature OBSIDIAN_BOULDER = registerChanced( + "obsidian_boulder", + new ObsidianBoulderFeature(), + 10 + ); public static final BCLFeature FALLEN_PILLAR = registerChanced("fallen_pillar", new FallenPillarFeature(), 20); - public static final BCLFeature TUNEL_CAVE = BCLFeature.makeChunkFeature(BetterEnd.makeID("tunel_cave"), new TunelCaveFeature()); + public static final BCLFeature TUNEL_CAVE = BCLFeature.makeChunkFeature( + BetterEnd.makeID("tunel_cave"), + new TunelCaveFeature() + ); // Ores // - public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8, 0, 5, 128); + public static final BCLFeature THALLASIUM_ORE = registerOre( + "thallasium_ore", + EndBlocks.THALLASIUM.ore, + 24, + 8, + 0, + 5, + 128 + ); public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4, 0, 5, 128); public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 24, 6, 0, 5, 128); - public static final BCLFeature VIOLECITE_LAYER = registerLayer("violecite_layer", EndBlocks.VIOLECITE, 15, 16, 128, 8); - public static final BCLFeature FLAVOLITE_LAYER = registerLayer("flavolite_layer", EndBlocks.FLAVOLITE, 12, 16, 128, 6); + public static final BCLFeature VIOLECITE_LAYER = registerLayer( + "violecite_layer", + EndBlocks.VIOLECITE, + 15, + 16, + 128, + 8 + ); + public static final BCLFeature FLAVOLITE_LAYER = registerLayer( + "flavolite_layer", + EndBlocks.FLAVOLITE, + 12, + 16, + 128, + 6 + ); // Buildings public static final BCLFeature CRASHED_SHIP = registerChanced("crashed_ship", new CrashedShipFeature(), 500); @@ -233,10 +561,27 @@ public class EndFeatures { public static final DefaultFeature CAVE_GRASS = new SingleBlockFeature(EndBlocks.CAVE_GRASS); public static final DefaultFeature RUBINEA = new VineFeature(EndBlocks.RUBINEA, 8); public static final DefaultFeature MAGNULA = new VineFeature(EndBlocks.MAGNULA, 8); - public static final DefaultFeature END_STONE_STALACTITE = new StalactiteFeature(true, EndBlocks.END_STONE_STALACTITE, Blocks.END_STONE); - public static final DefaultFeature END_STONE_STALAGMITE = new StalactiteFeature(false, EndBlocks.END_STONE_STALACTITE, Blocks.END_STONE); - public static final DefaultFeature END_STONE_STALACTITE_CAVEMOSS = new StalactiteFeature(true, EndBlocks.END_STONE_STALACTITE_CAVEMOSS, Blocks.END_STONE, EndBlocks.CAVE_MOSS); - public static final DefaultFeature END_STONE_STALAGMITE_CAVEMOSS = new StalactiteFeature(false, EndBlocks.END_STONE_STALACTITE_CAVEMOSS, EndBlocks.CAVE_MOSS); + public static final DefaultFeature END_STONE_STALACTITE = new StalactiteFeature( + true, + EndBlocks.END_STONE_STALACTITE, + Blocks.END_STONE + ); + public static final DefaultFeature END_STONE_STALAGMITE = new StalactiteFeature( + false, + EndBlocks.END_STONE_STALACTITE, + Blocks.END_STONE + ); + public static final DefaultFeature END_STONE_STALACTITE_CAVEMOSS = new StalactiteFeature( + true, + EndBlocks.END_STONE_STALACTITE_CAVEMOSS, + Blocks.END_STONE, + EndBlocks.CAVE_MOSS + ); + public static final DefaultFeature END_STONE_STALAGMITE_CAVEMOSS = new StalactiteFeature( + false, + EndBlocks.END_STONE_STALACTITE_CAVEMOSS, + EndBlocks.CAVE_MOSS + ); public static final DefaultFeature CAVE_PUMPKIN = new CavePumpkinFeature(); private static BCLFeature redisterVegetation(String name, Feature feature, int density) { @@ -262,7 +607,9 @@ public class EndFeatures { private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) { OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY); - ConfiguredFeature configured = layer.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(count))); + ConfiguredFeature configured = layer.configured(FeatureConfiguration.NONE) + .decorated(FeatureDecorator.COUNT.configured(new CountConfiguration( + count))); return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured); } diff --git a/src/main/java/ru/betterend/registry/EndItems.java b/src/main/java/ru/betterend/registry/EndItems.java index d8e8b97d..23e90f65 100644 --- a/src/main/java/ru/betterend/registry/EndItems.java +++ b/src/main/java/ru/betterend/registry/EndItems.java @@ -17,13 +17,11 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.TieredItem; import net.minecraft.world.item.Tiers; import org.jetbrains.annotations.NotNull; -import ru.bclib.items.BaseAnvilItem; import ru.bclib.items.BaseArmorItem; import ru.bclib.items.tool.BaseAxeItem; import ru.bclib.items.tool.BaseHoeItem; import ru.bclib.items.tool.BaseShovelItem; import ru.bclib.items.tool.BaseSwordItem; -import ru.bclib.registry.BaseRegistry; import ru.bclib.registry.ItemsRegistry; import ru.betterend.BetterEnd; import ru.betterend.config.Configs; @@ -66,33 +64,88 @@ public class EndItems extends ItemsRegistry { public final static Item SILK_FIBER = registerEndItem("silk_fiber"); public final static Item LUMECORN_ROD = registerEndItem("lumecorn_rod"); public final static Item SILK_MOTH_MATRIX = registerEndItem("silk_moth_matrix"); - public final static Item ENCHANTED_MEMBRANE = registerEndItem("enchanted_membrane", new EnchantedItem(Items.PHANTOM_MEMBRANE)); + public final static Item ENCHANTED_MEMBRANE = registerEndItem( + "enchanted_membrane", + new EnchantedItem(Items.PHANTOM_MEMBRANE) + ); // Music Discs - public final static Item MUSIC_DISC_STRANGE_AND_ALIEN = registerEndDisc("music_disc_strange_and_alien", 0, EndSounds.RECORD_STRANGE_AND_ALIEN); - public final static Item MUSIC_DISC_GRASPING_AT_STARS = registerEndDisc("music_disc_grasping_at_stars", 0, EndSounds.RECORD_GRASPING_AT_STARS); - public final static Item MUSIC_DISC_ENDSEEKER = registerEndDisc("music_disc_endseeker", 0, EndSounds.RECORD_ENDSEEKER); - public final static Item MUSIC_DISC_EO_DRACONA = registerEndDisc("music_disc_eo_dracona", 0, EndSounds.RECORD_EO_DRACONA); + public final static Item MUSIC_DISC_STRANGE_AND_ALIEN = registerEndDisc( + "music_disc_strange_and_alien", + 0, + EndSounds.RECORD_STRANGE_AND_ALIEN + ); + public final static Item MUSIC_DISC_GRASPING_AT_STARS = registerEndDisc( + "music_disc_grasping_at_stars", + 0, + EndSounds.RECORD_GRASPING_AT_STARS + ); + public final static Item MUSIC_DISC_ENDSEEKER = registerEndDisc( + "music_disc_endseeker", + 0, + EndSounds.RECORD_ENDSEEKER + ); + public final static Item MUSIC_DISC_EO_DRACONA = registerEndDisc( + "music_disc_eo_dracona", + 0, + EndSounds.RECORD_EO_DRACONA + ); // Armor // - public static final Item AETERNIUM_HELMET = registerEndItem("aeternium_helmet", new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.HEAD, makeEndItemSettings().fireResistant())); - public static final Item AETERNIUM_CHESTPLATE = registerEndItem("aeternium_chestplate", new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.CHEST, makeEndItemSettings().fireResistant())); - public static final Item AETERNIUM_LEGGINGS = registerEndItem("aeternium_leggings", new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.LEGS, makeEndItemSettings().fireResistant())); - public static final Item AETERNIUM_BOOTS = registerEndItem("aeternium_boots", new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.FEET, makeEndItemSettings().fireResistant())); + public static final Item AETERNIUM_HELMET = registerEndItem( + "aeternium_helmet", + new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.HEAD, makeEndItemSettings().fireResistant()) + ); + public static final Item AETERNIUM_CHESTPLATE = registerEndItem( + "aeternium_chestplate", + new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.CHEST, makeEndItemSettings().fireResistant()) + ); + public static final Item AETERNIUM_LEGGINGS = registerEndItem( + "aeternium_leggings", + new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.LEGS, makeEndItemSettings().fireResistant()) + ); + public static final Item AETERNIUM_BOOTS = registerEndItem( + "aeternium_boots", + new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.FEET, makeEndItemSettings().fireResistant()) + ); public static final Item CRYSTALITE_HELMET = registerEndItem("crystalite_helmet", new CrystaliteHelmet()); - public static final Item CRYSTALITE_CHESTPLATE = registerEndItem("crystalite_chestplate", new CrystaliteChestplate()); + public static final Item CRYSTALITE_CHESTPLATE = registerEndItem( + "crystalite_chestplate", + new CrystaliteChestplate() + ); public static final Item CRYSTALITE_LEGGINGS = registerEndItem("crystalite_leggings", new CrystaliteLeggings()); public static final Item CRYSTALITE_BOOTS = registerEndItem("crystalite_boots", new CrystaliteBoots()); - public static final Item ARMORED_ELYTRA = registerEndItem("elytra_armored", new ArmoredElytra("elytra_armored", EndArmorMaterial.AETERNIUM, Items.PHANTOM_MEMBRANE, 900, 0.975D, true)); + public static final Item ARMORED_ELYTRA = registerEndItem( + "elytra_armored", + new ArmoredElytra("elytra_armored", EndArmorMaterial.AETERNIUM, Items.PHANTOM_MEMBRANE, 900, 0.975D, true) + ); public static final Item CRYSTALITE_ELYTRA = registerEndItem("elytra_crystalite", new CrystaliteElytra(650, 0.99D)); // Tools // - public static final TieredItem AETERNIUM_SHOVEL = registerEndTool("aeternium_shovel", new BaseShovelItem(EndToolMaterial.AETERNIUM, 1.5F, -3.0F, makeEndItemSettings().fireResistant())); - public static final TieredItem AETERNIUM_SWORD = registerEndTool("aeternium_sword", new BaseSwordItem(EndToolMaterial.AETERNIUM, 3, -2.4F, makeEndItemSettings().fireResistant())); - public static final TieredItem AETERNIUM_PICKAXE = registerEndTool("aeternium_pickaxe", new EndPickaxe(EndToolMaterial.AETERNIUM, 1, -2.8F, makeEndItemSettings().fireResistant())); - public static final TieredItem AETERNIUM_AXE = registerEndTool("aeternium_axe", new BaseAxeItem(EndToolMaterial.AETERNIUM, 5.0F, -3.0F, makeEndItemSettings().fireResistant())); - public static final TieredItem AETERNIUM_HOE = registerEndTool("aeternium_hoe", new BaseHoeItem(EndToolMaterial.AETERNIUM, -3, 0.0F, makeEndItemSettings().fireResistant())); - public static final TieredItem AETERNIUM_HAMMER = registerEndTool("aeternium_hammer", new EndHammerItem(EndToolMaterial.AETERNIUM, 6.0F, -3.0F, 0.3D, makeEndItemSettings().fireResistant())); + public static final TieredItem AETERNIUM_SHOVEL = registerEndTool( + "aeternium_shovel", + new BaseShovelItem(EndToolMaterial.AETERNIUM, 1.5F, -3.0F, makeEndItemSettings().fireResistant()) + ); + public static final TieredItem AETERNIUM_SWORD = registerEndTool( + "aeternium_sword", + new BaseSwordItem(EndToolMaterial.AETERNIUM, 3, -2.4F, makeEndItemSettings().fireResistant()) + ); + public static final TieredItem AETERNIUM_PICKAXE = registerEndTool( + "aeternium_pickaxe", + new EndPickaxe(EndToolMaterial.AETERNIUM, 1, -2.8F, makeEndItemSettings().fireResistant()) + ); + public static final TieredItem AETERNIUM_AXE = registerEndTool( + "aeternium_axe", + new BaseAxeItem(EndToolMaterial.AETERNIUM, 5.0F, -3.0F, makeEndItemSettings().fireResistant()) + ); + public static final TieredItem AETERNIUM_HOE = registerEndTool( + "aeternium_hoe", + new BaseHoeItem(EndToolMaterial.AETERNIUM, -3, 0.0F, makeEndItemSettings().fireResistant()) + ); + public static final TieredItem AETERNIUM_HAMMER = registerEndTool( + "aeternium_hammer", + new EndHammerItem(EndToolMaterial.AETERNIUM, 6.0F, -3.0F, 0.3D, makeEndItemSettings().fireResistant()) + ); // Toolparts // public final static Item AETERNIUM_SHOVEL_HEAD = registerEndItem("aeternium_shovel_head"); @@ -104,20 +157,40 @@ public class EndItems extends ItemsRegistry { public final static Item AETERNIUM_SWORD_HANDLE = registerEndItem("aeternium_sword_handle"); // Hammers // - public static final TieredItem IRON_HAMMER = registerEndTool("iron_hammer", new EndHammerItem(Tiers.IRON, 5.0F, -3.2F, 0.2D, makeEndItemSettings())); - public static final TieredItem GOLDEN_HAMMER = registerEndTool("golden_hammer", new EndHammerItem(Tiers.GOLD, 4.5F, -3.4F, 0.3D, makeEndItemSettings())); - public static final TieredItem DIAMOND_HAMMER = registerEndTool("diamond_hammer", new EndHammerItem(Tiers.DIAMOND, 5.5F, -3.1F, 0.2D, makeEndItemSettings())); - public static final TieredItem NETHERITE_HAMMER = registerEndTool("netherite_hammer", new EndHammerItem(Tiers.NETHERITE, 5.0F, -3.0F, 0.2D, makeEndItemSettings().fireResistant())); + public static final TieredItem IRON_HAMMER = registerEndTool( + "iron_hammer", + new EndHammerItem(Tiers.IRON, 5.0F, -3.2F, 0.2D, makeEndItemSettings()) + ); + public static final TieredItem GOLDEN_HAMMER = registerEndTool( + "golden_hammer", + new EndHammerItem(Tiers.GOLD, 4.5F, -3.4F, 0.3D, makeEndItemSettings()) + ); + public static final TieredItem DIAMOND_HAMMER = registerEndTool( + "diamond_hammer", + new EndHammerItem(Tiers.DIAMOND, 5.5F, -3.1F, 0.2D, makeEndItemSettings()) + ); + public static final TieredItem NETHERITE_HAMMER = registerEndTool( + "netherite_hammer", + new EndHammerItem(Tiers.NETHERITE, 5.0F, -3.0F, 0.2D, makeEndItemSettings().fireResistant()) + ); // Food // public final static Item SHADOW_BERRY_RAW = registerEndFood("shadow_berry_raw", 4, 0.5F); public final static Item SHADOW_BERRY_COOKED = registerEndFood("shadow_berry_cooked", 6, 0.7F); public final static Item END_FISH_RAW = registerEndFood("end_fish_raw", Foods.SALMON); public final static Item END_FISH_COOKED = registerEndFood("end_fish_cooked", Foods.COOKED_SALMON); - public final static Item BUCKET_END_FISH = registerEndItem("bucket_end_fish", new EndBucketItem(EndEntities.END_FISH)); + public final static Item BUCKET_END_FISH = registerEndItem( + "bucket_end_fish", + new EndBucketItem(EndEntities.END_FISH) + ); public final static Item BUCKET_CUBOZOA = registerEndItem("bucket_cubozoa", new EndBucketItem(EndEntities.CUBOZOA)); public final static Item SWEET_BERRY_JELLY = registerEndFood("sweet_berry_jelly", 8, 0.7F); - public final static Item SHADOW_BERRY_JELLY = registerEndFood("shadow_berry_jelly", 6, 0.8F, new MobEffectInstance(MobEffects.NIGHT_VISION, 400)); + public final static Item SHADOW_BERRY_JELLY = registerEndFood( + "shadow_berry_jelly", + 6, + 0.8F, + new MobEffectInstance(MobEffects.NIGHT_VISION, 400) + ); public final static Item BLOSSOM_BERRY_JELLY = registerEndFood("blossom_berry_jelly", 8, 0.7F); public final static Item BLOSSOM_BERRY = registerEndFood("blossom_berry", Foods.APPLE); public final static Item AMBER_ROOT_RAW = registerEndFood("amber_root_raw", 2, 0.8F); diff --git a/src/main/java/ru/betterend/registry/EndParticles.java b/src/main/java/ru/betterend/registry/EndParticles.java index 2fb673a6..eef59ab0 100644 --- a/src/main/java/ru/betterend/registry/EndParticles.java +++ b/src/main/java/ru/betterend/registry/EndParticles.java @@ -23,7 +23,10 @@ import ru.betterend.particle.SmaragdantParticle; public class EndParticles { public static final SimpleParticleType GLOWING_SPHERE = register("glowing_sphere"); public static final SimpleParticleType PORTAL_SPHERE = register("portal_sphere"); - public static final ParticleType INFUSION = register("infusion", FabricParticleTypes.complex(InfusionParticleType.PARAMETERS_FACTORY)); + public static final ParticleType INFUSION = register( + "infusion", + FabricParticleTypes.complex(InfusionParticleType.PARAMETERS_FACTORY) + ); public static final SimpleParticleType SULPHUR_PARTICLE = register("sulphur_particle"); public static final SimpleParticleType GEYSER_PARTICLE = registerFar("geyser_particle"); public static final SimpleParticleType SNOWFLAKE = register("snowflake"); diff --git a/src/main/java/ru/betterend/registry/EndPortals.java b/src/main/java/ru/betterend/registry/EndPortals.java index f72ff29b..2d3d905e 100644 --- a/src/main/java/ru/betterend/registry/EndPortals.java +++ b/src/main/java/ru/betterend/registry/EndPortals.java @@ -104,7 +104,13 @@ public class EndPortals { } private static PortalInfo makeDefault() { - return new PortalInfo(new ResourceLocation("minecraft:overworld"), BetterEnd.makeID("eternal_crystal"), 255, 255, 255); + return new PortalInfo( + new ResourceLocation("minecraft:overworld"), + BetterEnd.makeID("eternal_crystal"), + 255, + 255, + 255 + ); } private static class PortalInfo { @@ -114,7 +120,13 @@ public class EndPortals { private ServerLevel world; PortalInfo(JsonObject obj) { - this(new ResourceLocation(JsonFactory.getString(obj, "dimension", "minecraft:overworld")), new ResourceLocation(JsonFactory.getString(obj, "item", "betterend:eternal_crystal")), JsonFactory.getInt(obj, "colorRed", 255), JsonFactory.getInt(obj, "colorGreen", 255), JsonFactory.getInt(obj, "colorBlue", 255)); + this( + new ResourceLocation(JsonFactory.getString(obj, "dimension", "minecraft:overworld")), + new ResourceLocation(JsonFactory.getString(obj, "item", "betterend:eternal_crystal")), + JsonFactory.getInt(obj, "colorRed", 255), + JsonFactory.getInt(obj, "colorGreen", 255), + JsonFactory.getInt(obj, "colorBlue", 255) + ); } PortalInfo(ResourceLocation dimension, ResourceLocation item, int r, int g, int b) { diff --git a/src/main/java/ru/betterend/registry/EndStructures.java b/src/main/java/ru/betterend/registry/EndStructures.java index 7ebc2fac..827db4a4 100644 --- a/src/main/java/ru/betterend/registry/EndStructures.java +++ b/src/main/java/ru/betterend/registry/EndStructures.java @@ -30,16 +30,51 @@ public class EndStructures { public static final StructurePieceType MOUNTAIN_PIECE = register("mountain_piece", CrystalMountainPiece::new); public static final StructurePieceType CAVE_PIECE = register("cave_piece", CavePiece::new); public static final StructurePieceType LAKE_PIECE = register("lake_piece", LakePiece::new); - public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register("painted_mountain_piece", PaintedMountainPiece::new); + public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register( + "painted_mountain_piece", + PaintedMountainPiece::new + ); public static final StructurePieceType NBT_PIECE = register("nbt_piece", NBTPiece::new); - public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(BetterEnd.makeID("giant_mossy_glowshroom"), new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); - public static final BCLStructureFeature MEGALAKE = new BCLStructureFeature(BetterEnd.makeID("megalake"), new MegaLakeStructure(), Decoration.RAW_GENERATION, 4, 1); - public static final BCLStructureFeature MEGALAKE_SMALL = new BCLStructureFeature(BetterEnd.makeID("megalake_small"), new MegaLakeSmallStructure(), Decoration.RAW_GENERATION, 4, 1); - public static final BCLStructureFeature MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID("mountain"), new MountainStructure(), Decoration.RAW_GENERATION, 3, 2); - public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID("painted_mountain"), new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2); - public static final BCLStructureFeature ETERNAL_PORTAL = new BCLStructureFeature(BetterEnd.makeID("eternal_portal"), new EternalPortalStructure(), Decoration.SURFACE_STRUCTURES, 16, 6); - public static final BCLStructureFeature GIANT_ICE_STAR = new BCLStructureFeature(BetterEnd.makeID("giant_ice_star"), new GiantIceStarStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); + public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(BetterEnd.makeID( + "giant_mossy_glowshroom"), new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); + public static final BCLStructureFeature MEGALAKE = new BCLStructureFeature( + BetterEnd.makeID("megalake"), + new MegaLakeStructure(), + Decoration.RAW_GENERATION, + 4, + 1 + ); + public static final BCLStructureFeature MEGALAKE_SMALL = new BCLStructureFeature( + BetterEnd.makeID("megalake_small"), + new MegaLakeSmallStructure(), + Decoration.RAW_GENERATION, + 4, + 1 + ); + public static final BCLStructureFeature MOUNTAIN = new BCLStructureFeature( + BetterEnd.makeID("mountain"), + new MountainStructure(), + Decoration.RAW_GENERATION, + 3, + 2 + ); + public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID( + "painted_mountain"), new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2); + public static final BCLStructureFeature ETERNAL_PORTAL = new BCLStructureFeature( + BetterEnd.makeID("eternal_portal"), + new EternalPortalStructure(), + Decoration.SURFACE_STRUCTURES, + 16, + 6 + ); + public static final BCLStructureFeature GIANT_ICE_STAR = new BCLStructureFeature( + BetterEnd.makeID("giant_ice_star"), + new GiantIceStarStructure(), + Decoration.SURFACE_STRUCTURES, + 16, + 8 + ); public static void register() { } diff --git a/src/main/java/ru/betterend/registry/EndTags.java b/src/main/java/ru/betterend/registry/EndTags.java index 3938c3e7..53fdaa4a 100644 --- a/src/main/java/ru/betterend/registry/EndTags.java +++ b/src/main/java/ru/betterend/registry/EndTags.java @@ -110,12 +110,28 @@ public class EndTags { ToolManagerImpl.tag(TagAPI.HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(hammers)); TagHelper.addTag(TagAPI.HAMMERS, EndItems.AETERNIUM_HAMMER); - TagHelper.addTag(TagAPI.GEN_TERRAIN, EndBlocks.ENDER_ORE, EndBlocks.FLAVOLITE.stone, EndBlocks.VIOLECITE.stone, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE, EndBlocks.VIRID_JADESTONE.stone, EndBlocks.AZURE_JADESTONE.stone, EndBlocks.SANDY_JADESTONE.stone); + TagHelper.addTag( + TagAPI.GEN_TERRAIN, + EndBlocks.ENDER_ORE, + EndBlocks.FLAVOLITE.stone, + EndBlocks.VIOLECITE.stone, + EndBlocks.SULPHURIC_ROCK.stone, + EndBlocks.BRIMSTONE, + EndBlocks.VIRID_JADESTONE.stone, + EndBlocks.AZURE_JADESTONE.stone, + EndBlocks.SANDY_JADESTONE.stone + ); TagHelper.addTag(TagAPI.END_GROUND, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE); TagHelper.addTag(BlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL); TagHelper.addTag(BlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK); TagHelper.addTag(ItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT); - TagHelper.addTag(TagAPI.DRAGON_IMMUNE, EndBlocks.ENDER_ORE, EndBlocks.ETERNAL_PEDESTAL, EndBlocks.FLAVOLITE_RUNED_ETERNAL, EndBlocks.FLAVOLITE_RUNED); + TagHelper.addTag( + TagAPI.DRAGON_IMMUNE, + EndBlocks.ENDER_ORE, + EndBlocks.ETERNAL_PEDESTAL, + EndBlocks.FLAVOLITE_RUNED_ETERNAL, + EndBlocks.FLAVOLITE_RUNED + ); TagHelper.addTag(TagAPI.IRON_INGOTS, EndBlocks.THALLASIUM.ingot); TagHelper.addTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON); diff --git a/src/main/java/ru/betterend/rituals/EternalRitual.java b/src/main/java/ru/betterend/rituals/EternalRitual.java index 98cc3bee..c0a2fca1 100644 --- a/src/main/java/ru/betterend/rituals/EternalRitual.java +++ b/src/main/java/ru/betterend/rituals/EternalRitual.java @@ -45,10 +45,49 @@ import java.util.Set; import java.util.function.Predicate; public class EternalRitual { - private final static Set STRUCTURE_MAP = Sets.newHashSet(new Point(-4, -5), new Point(-4, 5), new Point(-6, 0), new Point(4, -5), new Point(4, 5), new Point(6, 0)); - private final static Set FRAME_MAP = Sets.newHashSet(new Point(0, 0), new Point(0, 6), new Point(1, 0), new Point(1, 6), new Point(2, 1), new Point(2, 5), new Point(3, 2), new Point(3, 3), new Point(3, 4)); - private final static Set PORTAL_MAP = Sets.newHashSet(new Point(0, 0), new Point(0, 1), new Point(0, 2), new Point(0, 3), new Point(0, 4), new Point(1, 0), new Point(1, 1), new Point(1, 2), new Point(1, 3), new Point(1, 4), new Point(2, 1), new Point(2, 2), new Point(2, 3)); - private final static Set BASE_MAP = Sets.newHashSet(new Point(3, 0), new Point(2, 0), new Point(2, 1), new Point(1, 1), new Point(1, 2), new Point(0, 1), new Point(0, 2)); + private final static Set STRUCTURE_MAP = Sets.newHashSet( + new Point(-4, -5), + new Point(-4, 5), + new Point(-6, 0), + new Point(4, -5), + new Point(4, 5), + new Point(6, 0) + ); + private final static Set FRAME_MAP = Sets.newHashSet( + new Point(0, 0), + new Point(0, 6), + new Point(1, 0), + new Point(1, 6), + new Point(2, 1), + new Point(2, 5), + new Point(3, 2), + new Point(3, 3), + new Point(3, 4) + ); + private final static Set PORTAL_MAP = Sets.newHashSet( + new Point(0, 0), + new Point(0, 1), + new Point(0, 2), + new Point(0, 3), + new Point(0, 4), + new Point(1, 0), + new Point(1, 1), + new Point(1, 2), + new Point(1, 3), + new Point(1, 4), + new Point(2, 1), + new Point(2, 2), + new Point(2, 3) + ); + private final static Set BASE_MAP = Sets.newHashSet( + new Point(3, 0), + new Point(2, 0), + new Point(2, 1), + new Point(1, 1), + new Point(1, 2), + new Point(0, 1), + new Point(0, 2) + ); private final static Block BASE = EndBlocks.FLAVOLITE.tiles; private final static Block PEDESTAL = EndBlocks.ETERNAL_PEDESTAL; @@ -190,8 +229,28 @@ public class EternalRitual { for (Point pos : STRUCTURE_MAP) { BlockPos.MutableBlockPos p = center.mutable(); p.move(moveX, pos.x).move(moveY, pos.y); - serverWorld.sendParticles(ParticleTypes.PORTAL, p.getX() + 0.5, p.getY() + 1.5, p.getZ() + 0.5, 20, 0, 0, 0, 1); - serverWorld.sendParticles(ParticleTypes.REVERSE_PORTAL, p.getX() + 0.5, p.getY() + 1.5, p.getZ() + 0.5, 20, 0, 0, 0, 0.3); + serverWorld.sendParticles( + ParticleTypes.PORTAL, + p.getX() + 0.5, + p.getY() + 1.5, + p.getZ() + 0.5, + 20, + 0, + 0, + 0, + 1 + ); + serverWorld.sendParticles( + ParticleTypes.REVERSE_PORTAL, + p.getX() + 0.5, + p.getY() + 1.5, + p.getZ() + 0.5, + 20, + 0, + 0, + 0, + 0.3 + ); } serverWorld.playSound(null, center, SoundEvents.END_PORTAL_SPAWN, SoundSource.NEUTRAL, 16, 1); } @@ -213,7 +272,9 @@ public class EternalRitual { } }); Direction.Axis portalAxis = Direction.Axis.X == axis ? Direction.Axis.Z : Direction.Axis.X; - BlockState portal = PORTAL.defaultBlockState().setValue(EndPortalBlock.AXIS, portalAxis).setValue(EndPortalBlock.PORTAL, portalId); + BlockState portal = PORTAL.defaultBlockState() + .setValue(EndPortalBlock.AXIS, portalAxis) + .setValue(EndPortalBlock.PORTAL, portalId); ParticleOptions effect = new BlockParticleOption(ParticleTypes.BLOCK, portal); ServerLevel serverWorld = (ServerLevel) world; @@ -221,14 +282,54 @@ public class EternalRitual { BlockPos pos = center.mutable().move(moveDir, point.x).move(Direction.UP, point.y); if (!world.getBlockState(pos).is(PORTAL)) { world.setBlockAndUpdate(pos, portal); - serverWorld.sendParticles(effect, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 10, 0.5, 0.5, 0.5, 0.1); - serverWorld.sendParticles(ParticleTypes.REVERSE_PORTAL, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 10, 0.5, 0.5, 0.5, 0.3); + serverWorld.sendParticles( + effect, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + 10, + 0.5, + 0.5, + 0.5, + 0.1 + ); + serverWorld.sendParticles( + ParticleTypes.REVERSE_PORTAL, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + 10, + 0.5, + 0.5, + 0.5, + 0.3 + ); } pos = center.mutable().move(moveDir, -point.x).move(Direction.UP, point.y); if (!world.getBlockState(pos).is(PORTAL)) { world.setBlockAndUpdate(pos, portal); - serverWorld.sendParticles(effect, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 10, 0.5, 0.5, 0.5, 0.1); - serverWorld.sendParticles(ParticleTypes.REVERSE_PORTAL, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 10, 0.5, 0.5, 0.5, 0.3); + serverWorld.sendParticles( + effect, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + 10, + 0.5, + 0.5, + 0.5, + 0.1 + ); + serverWorld.sendParticles( + ParticleTypes.REVERSE_PORTAL, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + 10, + 0.5, + 0.5, + 0.5, + 0.3 + ); } }); } @@ -269,7 +370,13 @@ public class EternalRitual { @Nullable private BlockPos findFrame(Level world, BlockPos.MutableBlockPos startPos) { - List foundPos = findAllBlockPos(world, startPos, (SEARCH_RADIUS >> 4) + 1, FRAME, blockState -> blockState.is(FRAME) && !blockState.getValue(ACTIVE)); + List foundPos = findAllBlockPos( + world, + startPos, + (SEARCH_RADIUS >> 4) + 1, + FRAME, + blockState -> blockState.is(FRAME) && !blockState.getValue(ACTIVE) + ); for (BlockPos.MutableBlockPos testPos : foundPos) { if (checkFrame(world, testPos)) { return testPos; @@ -281,9 +388,15 @@ public class EternalRitual { private BlockPos findPortalPos(int portalId) { MinecraftServer server = world.getServer(); ServerLevel targetWorld = (ServerLevel) getTargetWorld(portalId); - Registry registry = Objects.requireNonNull(server).registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); + Registry registry = Objects.requireNonNull(server) + .registryAccess() + .registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); double multiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale(); - BlockPos.MutableBlockPos basePos = center.mutable().set(center.getX() / multiplier, center.getY(), center.getZ() / multiplier); + BlockPos.MutableBlockPos basePos = center.mutable() + .set(center.getX() / multiplier, + center.getY(), + center.getZ() / multiplier + ); BlockPos framePos = findFrame(targetWorld, basePos.mutable()); if (framePos != null) { return framePos.above(); @@ -302,8 +415,16 @@ public class EternalRitual { for (int i = 0; i < (step >> 1); i++) { ChunkAccess chunk = targetWorld.getChunk(checkPos); if (chunk != null) { - int surfaceY = chunk.getHeight(Heightmap.Types.WORLD_SURFACE, checkPos.getX() & 15, checkPos.getZ() & 15); - int motionY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, checkPos.getX() & 15, checkPos.getZ() & 15); + int surfaceY = chunk.getHeight( + Heightmap.Types.WORLD_SURFACE, + checkPos.getX() & 15, + checkPos.getZ() & 15 + ); + int motionY = chunk.getHeight( + Heightmap.Types.MOTION_BLOCKING, + checkPos.getX() & 15, + checkPos.getZ() & 15 + ); int ceil = Math.min(Math.max(surfaceY, motionY) + 1, worldCeil); if (ceil < 5) continue; checkPos.setY(ceil); @@ -321,12 +442,23 @@ public class EternalRitual { } } if (targetWorld.dimension() == Level.END) { - Features.END_ISLAND.place(targetWorld, targetWorld.getChunkSource().getGenerator(), new Random(basePos.asLong()), basePos.below()); + Features.END_ISLAND.place( + targetWorld, + targetWorld.getChunkSource().getGenerator(), + new Random(basePos.asLong()), + basePos.below() + ); } else if (targetWorld.dimension() == Level.OVERWORLD) { - basePos.setY(targetWorld.getChunk(basePos).getHeight(Heightmap.Types.WORLD_SURFACE, basePos.getX(), basePos.getZ()) + 1); + basePos.setY(targetWorld.getChunk(basePos) + .getHeight(Heightmap.Types.WORLD_SURFACE, basePos.getX(), basePos.getZ()) + 1); } - EndFeatures.BIOME_ISLAND.getFeatureConfigured().place(targetWorld, targetWorld.getChunkSource().getGenerator(), new Random(basePos.asLong()), basePos.below()); + EndFeatures.BIOME_ISLAND.getFeatureConfigured() + .place(targetWorld, + targetWorld.getChunkSource().getGenerator(), + new Random(basePos.asLong()), + basePos.below() + ); generatePortal(targetWorld, basePos, portalAxis, portalId); return basePos.immutable(); } @@ -510,7 +642,9 @@ public class EternalRitual { pos = framePos.mutable().move(moveDir, -point.x).move(Direction.UP, point.y); world.setBlockAndUpdate(pos, frame); }); - BlockState portal = PORTAL.defaultBlockState().setValue(EndPortalBlock.AXIS, axis).setValue(EndPortalBlock.PORTAL, portalId); + BlockState portal = PORTAL.defaultBlockState() + .setValue(EndPortalBlock.AXIS, axis) + .setValue(EndPortalBlock.PORTAL, portalId); PORTAL_MAP.forEach(point -> { BlockPos pos = center.mutable().move(moveDir, point.x).move(Direction.UP, point.y); world.setBlockAndUpdate(pos, portal); @@ -537,7 +671,10 @@ public class EternalRitual { public static boolean checkArea(Level world, BlockPos center, Direction.Axis axis) { Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH : Direction.EAST; - for (BlockPos checkPos : BlockPos.betweenClosed(center.relative(moveDir.getClockWise()), center.relative(moveDir.getCounterClockWise()))) { + for (BlockPos checkPos : BlockPos.betweenClosed( + center.relative(moveDir.getClockWise()), + center.relative(moveDir.getCounterClockWise()) + )) { for (Point point : PORTAL_MAP) { BlockPos pos = checkPos.mutable().move(moveDir, point.x).move(Direction.UP, point.y); BlockState state = world.getBlockState(pos); diff --git a/src/main/java/ru/betterend/rituals/InfusionRitual.java b/src/main/java/ru/betterend/rituals/InfusionRitual.java index 4043fc3a..689e9fca 100644 --- a/src/main/java/ru/betterend/rituals/InfusionRitual.java +++ b/src/main/java/ru/betterend/rituals/InfusionRitual.java @@ -20,7 +20,16 @@ import java.util.Arrays; import java.util.Objects; public class InfusionRitual implements Container { - private static final Point[] PEDESTALS_MAP = new Point[]{new Point(0, 3), new Point(2, 2), new Point(3, 0), new Point(2, -2), new Point(0, -3), new Point(-2, -2), new Point(-3, 0), new Point(-2, 2)}; + private static final Point[] PEDESTALS_MAP = new Point[] { + new Point(0, 3), + new Point(2, 2), + new Point(3, 0), + new Point(2, -2), + new Point(0, -3), + new Point(-2, -2), + new Point(-3, 0), + new Point(-2, 2) + }; private Level world; private BlockPos worldPos; @@ -119,7 +128,17 @@ public class InfusionRitual implements Container { double sx = start.getX() + 0.5; double sy = start.getY() + 1.25; double sz = start.getZ() + 0.5; - serverLevel.sendParticles(new InfusionParticleType(stack), sx, sy, sz, 0, tx - sx, ty - sy, tz - sz, 0.5); + serverLevel.sendParticles( + new InfusionParticleType(stack), + sx, + sy, + sz, + 0, + tx - sx, + ty - sy, + tz - sz, + 0.5 + ); } } } diff --git a/src/main/java/ru/betterend/tab/CreativeTabs.java b/src/main/java/ru/betterend/tab/CreativeTabs.java index f0fb6dc2..05f1ea61 100644 --- a/src/main/java/ru/betterend/tab/CreativeTabs.java +++ b/src/main/java/ru/betterend/tab/CreativeTabs.java @@ -3,7 +3,6 @@ package ru.betterend.tab; import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; -import ru.bclib.items.BaseAnvilItem; import ru.betterend.BetterEnd; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; @@ -15,11 +14,19 @@ public class CreativeTabs { public static final CreativeModeTab TAB_ITEMS; static { - TAB_BLOCKS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_blocks")).icon(() -> new ItemStack(EndBlocks.END_MYCELIUM)) - .appendItems(stacks -> stacks.addAll(EndBlocks.getModBlocks().stream().map(ItemStack::new).collect(Collectors.toList()))) - .build(); - TAB_ITEMS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_items")).icon(() -> new ItemStack(EndItems.ETERNAL_CRYSTAL)) - .appendItems(stacks -> stacks.addAll(EndItems.getModItems().stream().map(ItemStack::new).collect(Collectors.toList()))) - .build(); + TAB_BLOCKS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_blocks")) + .icon(() -> new ItemStack(EndBlocks.END_MYCELIUM)) + .appendItems(stacks -> stacks.addAll(EndBlocks.getModBlocks() + .stream() + .map(ItemStack::new) + .collect(Collectors.toList()))) + .build(); + TAB_ITEMS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_items")) + .icon(() -> new ItemStack(EndItems.ETERNAL_CRYSTAL)) + .appendItems(stacks -> stacks.addAll(EndItems.getModItems() + .stream() + .map(ItemStack::new) + .collect(Collectors.toList()))) + .build(); } } diff --git a/src/main/java/ru/betterend/util/BlockFixer.java b/src/main/java/ru/betterend/util/BlockFixer.java index aba30ef3..34f521c4 100644 --- a/src/main/java/ru/betterend/util/BlockFixer.java +++ b/src/main/java/ru/betterend/util/BlockFixer.java @@ -116,13 +116,19 @@ public class BlockFixer { for (Direction dir : BlocksHelper.HORIZONTAL) { BlockPos p = pos.relative(dir); BlockState st = world.getBlockState(p); - if ((st.is(Blocks.CHORUS_PLANT) || st.is(Blocks.CHORUS_FLOWER)) && !st.canSurvive(world, p)) { + if ((st.is(Blocks.CHORUS_PLANT) || st.is(Blocks.CHORUS_FLOWER)) && !st.canSurvive( + world, + p + )) { add.add(p); } } BlockPos p = pos.above(); BlockState st = world.getBlockState(p); - if ((st.is(Blocks.CHORUS_PLANT) || st.is(Blocks.CHORUS_FLOWER)) && !st.canSurvive(world, p)) { + if ((st.is(Blocks.CHORUS_PLANT) || st.is(Blocks.CHORUS_FLOWER)) && !st.canSurvive( + world, + p + )) { add.add(p); } }); @@ -173,7 +179,8 @@ public class BlockFixer { else { // Blue Vine if (state.getBlock() instanceof BlueVineBlock) { - while (state.is(EndBlocks.BLUE_VINE) || state.is(EndBlocks.BLUE_VINE_LANTERN) || state.is(EndBlocks.BLUE_VINE_FUR)) { + while (state.is(EndBlocks.BLUE_VINE) || state.is(EndBlocks.BLUE_VINE_LANTERN) || state.is( + EndBlocks.BLUE_VINE_FUR)) { setWithoutUpdate(world, POS, AIR); POS.setY(POS.getY() + 1); state = world.getBlockState(POS); diff --git a/src/main/java/ru/betterend/util/BonemealPlants.java b/src/main/java/ru/betterend/util/BonemealPlants.java index 25283670..b8d0ad24 100644 --- a/src/main/java/ru/betterend/util/BonemealPlants.java +++ b/src/main/java/ru/betterend/util/BonemealPlants.java @@ -4,7 +4,6 @@ import com.google.common.collect.Lists; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import ru.bclib.api.BonemealAPI; -import ru.bclib.api.TagAPI; import ru.betterend.blocks.basis.EndTerrainBlock; import ru.betterend.registry.EndBiomes; import ru.betterend.registry.EndBlocks; @@ -29,14 +28,33 @@ public class BonemealPlants { BonemealAPI.addLandGrass(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.JUNGLE_MOSS); BonemealAPI.addLandGrass(EndBlocks.SMALL_JELLYSHROOM, EndBlocks.JUNGLE_MOSS, 0.1F); - BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.BLOOMING_COOKSONIA, EndBlocks.END_MOSS); + BonemealAPI.addLandGrass( + EndBiomes.GLOWING_GRASSLANDS.getID(), + EndBlocks.BLOOMING_COOKSONIA, + EndBlocks.END_MOSS + ); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.VAIOLUSH_FERN, EndBlocks.END_MOSS); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.FRACTURN, EndBlocks.END_MOSS); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.SALTEAGO, EndBlocks.END_MOSS); - BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.CREEPING_MOSS, EndBlocks.END_MOSS, 0.1F); - BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.UMBRELLA_MOSS, EndBlocks.END_MOSS, 0.1F); - BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.END_MOSS, 0.1F); + BonemealAPI.addLandGrass( + EndBiomes.GLOWING_GRASSLANDS.getID(), + EndBlocks.CREEPING_MOSS, + EndBlocks.END_MOSS, + 0.1F + ); + BonemealAPI.addLandGrass( + EndBiomes.GLOWING_GRASSLANDS.getID(), + EndBlocks.UMBRELLA_MOSS, + EndBlocks.END_MOSS, + 0.1F + ); + BonemealAPI.addLandGrass( + EndBiomes.GLOWING_GRASSLANDS.getID(), + EndBlocks.TWISTED_UMBRELLA_MOSS, + EndBlocks.END_MOSS, + 0.1F + ); BonemealAPI.addLandGrass(EndBlocks.ORANGO, EndBlocks.RUTISCUS); BonemealAPI.addLandGrass(EndBlocks.AERIDIUM, EndBlocks.RUTISCUS, 0.2F); @@ -47,8 +65,18 @@ public class BonemealPlants { BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS.getID(), EndBlocks.LAMELLARIUM, EndBlocks.RUTISCUS); BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS.getID(), EndBlocks.BOLUX_MUSHROOM, EndBlocks.RUTISCUS, 0.05F); - BonemealAPI.addLandGrass(EndBlocks.GLOBULAGUS, EndBlocks.SANGNUM, EndBlocks.MOSSY_OBSIDIAN, EndBlocks.MOSSY_DRAGON_BONE); - BonemealAPI.addLandGrass(EndBlocks.CLAWFERN, EndBlocks.SANGNUM, EndBlocks.MOSSY_OBSIDIAN, EndBlocks.MOSSY_DRAGON_BONE); + BonemealAPI.addLandGrass( + EndBlocks.GLOBULAGUS, + EndBlocks.SANGNUM, + EndBlocks.MOSSY_OBSIDIAN, + EndBlocks.MOSSY_DRAGON_BONE + ); + BonemealAPI.addLandGrass( + EndBlocks.CLAWFERN, + EndBlocks.SANGNUM, + EndBlocks.MOSSY_OBSIDIAN, + EndBlocks.MOSSY_DRAGON_BONE + ); BonemealAPI.addLandGrass(EndBlocks.SANGNUM, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F); BonemealAPI.addLandGrass(EndBlocks.SMALL_AMARANITA_MUSHROOM, EndBlocks.MOSSY_OBSIDIAN, 0.1F); BonemealAPI.addLandGrass(EndBlocks.SMALL_AMARANITA_MUSHROOM, EndBlocks.MOSSY_DRAGON_BONE, 0.1F); @@ -86,7 +114,7 @@ public class BonemealPlants { terrain.add(EndBlocks.SANDY_JADESTONE.stone); terrain.add(EndBlocks.BRIMSTONE); Block[] terrainBlocks = terrain.toArray(new Block[terrain.size()]); - for (Block charnia: charnias) { + for (Block charnia : charnias) { BonemealAPI.addWaterGrass(charnia, terrainBlocks); } } diff --git a/src/main/java/ru/betterend/util/FeaturesHelper.java b/src/main/java/ru/betterend/util/FeaturesHelper.java index 22bfeb96..bb131ba0 100644 --- a/src/main/java/ru/betterend/util/FeaturesHelper.java +++ b/src/main/java/ru/betterend/util/FeaturesHelper.java @@ -24,7 +24,8 @@ public class FeaturesHelper { BiomeGenerationSettingsAccessor accessor = (BiomeGenerationSettingsAccessor) biome.getGenerationSettings(); List>> structures = Lists.newArrayList(accessor.be_getStructures()); List>>> preFeatures = accessor.be_getFeatures(); - List>>> features = new ArrayList>>>(preFeatures.size()); + List>>> features = new ArrayList>>>( + preFeatures.size()); preFeatures.forEach((list) -> { features.add(Lists.newArrayList(list)); }); diff --git a/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java b/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java index 86c0dde2..c581095e 100644 --- a/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java +++ b/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java @@ -10,6 +10,16 @@ import ru.betterend.world.biome.EndBiome; public class BiomeIceStarfield extends EndBiome { public BiomeIceStarfield() { - super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")).addCustomData("has_caves", false).addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured()).setFogColor(224, 245, 254).setTemperature(0F).setFogDensity(2.2F).setFoliageColor(193, 244, 244).setGenChance(0.25F).setParticles(EndParticles.SNOWFLAKE, 0.002F).addFeature(EndFeatures.ICE_STAR).addFeature(EndFeatures.ICE_STAR_SMALL).addMobSpawn(EntityType.ENDERMAN, 20, 1, 4)); + super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")).addCustomData("has_caves", false) + .addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured()) + .setFogColor(224, 245, 254) + .setTemperature(0F) + .setFogDensity(2.2F) + .setFoliageColor(193, 244, 244) + .setGenChance(0.25F) + .setParticles(EndParticles.SNOWFLAKE, 0.002F) + .addFeature(EndFeatures.ICE_STAR) + .addFeature(EndFeatures.ICE_STAR_SMALL) + .addMobSpawn(EntityType.ENDERMAN, 20, 1, 4)); } } diff --git a/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java index 1ed7ef16..83b371d1 100644 --- a/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java @@ -7,7 +7,11 @@ import ru.betterend.registry.EndParticles; public class EmptyAuroraCaveBiome extends EndCaveBiome { public EmptyAuroraCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")).setFogColor(150, 30, 68).setFogDensity(2.0F).setPlantsColor(108, 25, 46).setWaterAndFogColor(186, 77, 237).setParticles(EndParticles.GLOWING_SPHERE, 0.001F)); + super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")).setFogColor(150, 30, 68) + .setFogDensity(2.0F) + .setPlantsColor(108, 25, 46) + .setWaterAndFogColor(186, 77, 237) + .setParticles(EndParticles.GLOWING_SPHERE, 0.001F)); this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); diff --git a/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java index 15330771..b77fd747 100644 --- a/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java @@ -7,7 +7,11 @@ import ru.betterend.registry.EndParticles; public class EmptySmaragdantCaveBiome extends EndCaveBiome { public EmptySmaragdantCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")).setFogColor(0, 253, 182).setFogDensity(2.0F).setPlantsColor(0, 131, 145).setWaterAndFogColor(31, 167, 212).setParticles(EndParticles.SMARAGDANT, 0.001F)); + super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")).setFogColor(0, 253, 182) + .setFogDensity(2.0F) + .setPlantsColor(0, 131, 145) + .setWaterAndFogColor(31, 167, 212) + .setParticles(EndParticles.SMARAGDANT, 0.001F)); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); diff --git a/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java index b0b65ed0..e628edfc 100644 --- a/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java @@ -9,8 +9,8 @@ import ru.bclib.api.BiomeAPI; import ru.bclib.world.biomes.BCLBiomeDef; import ru.bclib.world.features.BCLFeature; import ru.betterend.BetterEnd; -import ru.betterend.registry.EndSounds; import ru.betterend.interfaces.ShuffelingListExtended; +import ru.betterend.registry.EndSounds; import ru.betterend.world.biome.EndBiome; import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature; @@ -23,7 +23,11 @@ public class EndCaveBiome extends EndBiome { } private static BCLBiomeDef makeDef(BCLBiomeDef definition) { - BCLFeature feature = BCLFeature.makeChunkFeature(BetterEnd.makeID(definition.getID().getPath() + "_cave_populator"), new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID()))); + BCLFeature feature = BCLFeature.makeChunkFeature( + BetterEnd.makeID(definition.getID() + .getPath() + "_cave_populator"), + new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID())) + ); definition.setCategory(BiomeCategory.NONE).addFeature(feature); definition.setMusic(EndSounds.MUSIC_CAVES); definition.setLoop(EndSounds.AMBIENT_CAVES); @@ -39,11 +43,13 @@ public class EndCaveBiome extends EndBiome { } public Feature getFloorFeature() { - return ((ShuffelingListExtended>) floorFeatures).isEmpty() ? null : ((ShuffelingListExtended>) floorFeatures).getOne(); + return ((ShuffelingListExtended>) floorFeatures).isEmpty() ? null : ((ShuffelingListExtended>) floorFeatures) + .getOne(); } public Feature getCeilFeature() { - return ((ShuffelingListExtended>) ceilFeatures).isEmpty() ? null : ((ShuffelingListExtended>) ceilFeatures).getOne(); + return ((ShuffelingListExtended>) ceilFeatures).isEmpty() ? null : ((ShuffelingListExtended>) ceilFeatures) + .getOne(); } public float getFloorDensity() { diff --git a/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java index 05f34321..be061028 100644 --- a/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java @@ -14,7 +14,9 @@ public class JadeCaveBiome extends EndCaveBiome { private static final BlockState[] JADE = new BlockState[3]; public JadeCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112).setFogDensity(2.0F).setWaterAndFogColor(95, 223, 255)); + super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112) + .setFogDensity(2.0F) + .setWaterAndFogColor(95, 223, 255)); JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState(); JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState(); JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState(); diff --git a/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java index 053c7938..2e476aa9 100644 --- a/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java @@ -11,7 +11,12 @@ import ru.betterend.registry.EndParticles; public class LushAuroraCaveBiome extends EndCaveBiome { public LushAuroraCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")).setFogColor(150, 30, 68).setFogDensity(2.0F).setPlantsColor(108, 25, 46).setWaterAndFogColor(186, 77, 237).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setSurface(EndBlocks.CAVE_MOSS)); + super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")).setFogColor(150, 30, 68) + .setFogDensity(2.0F) + .setPlantsColor(108, 25, 46) + .setWaterAndFogColor(186, 77, 237) + .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) + .setSurface(EndBlocks.CAVE_MOSS)); this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); this.addFloorFeature(EndFeatures.CAVE_BUSH, 5); @@ -37,6 +42,7 @@ public class LushAuroraCaveBiome extends EndCaveBiome { @Override public BlockState getCeil(BlockPos pos) { - return EndBlocks.CAVE_MOSS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP); + return EndBlocks.CAVE_MOSS.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP); } } diff --git a/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java index fa7b3ab3..f40c33a4 100644 --- a/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java @@ -8,7 +8,12 @@ import ru.betterend.registry.EndParticles; public class LushSmaragdantCaveBiome extends EndCaveBiome { public LushSmaragdantCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")).setFogColor(0, 253, 182).setFogDensity(2.0F).setPlantsColor(0, 131, 145).setWaterAndFogColor(31, 167, 212).setParticles(EndParticles.SMARAGDANT, 0.001F).setSurface(EndBlocks.CAVE_MOSS)); + super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")).setFogColor(0, 253, 182) + .setFogDensity(2.0F) + .setPlantsColor(0, 131, 145) + .setWaterAndFogColor(31, 167, 212) + .setParticles(EndParticles.SMARAGDANT, 0.001F) + .setSurface(EndBlocks.CAVE_MOSS)); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); diff --git a/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java b/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java index a1e984df..d89a2f0d 100644 --- a/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java @@ -13,6 +13,27 @@ import ru.betterend.world.biome.EndBiome; public class AmberLandBiome extends EndBiome { public AmberLandBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("amber_land")).setFogColor(255, 184, 71).setFogDensity(2.0F).setPlantsColor(219, 115, 38).setWaterAndFogColor(145, 108, 72).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_AMBER_LAND).setParticles(EndParticles.AMBER_SPHERE, 0.001F).setSurface(EndBlocks.AMBER_MOSS).addFeature(EndFeatures.AMBER_ORE).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.HELIX_TREE).addFeature(EndFeatures.LANCELEAF).addFeature(EndFeatures.GLOW_PILLAR).addFeature(EndFeatures.AMBER_GRASS).addFeature(EndFeatures.AMBER_ROOT).addFeature(EndFeatures.BULB_MOSS).addFeature(EndFeatures.BULB_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4).addMobSpawn(EndEntities.END_SLIME, 30, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("amber_land")).setFogColor(255, 184, 71) + .setFogDensity(2.0F) + .setPlantsColor(219, 115, 38) + .setWaterAndFogColor(145, 108, 72) + .setMusic(EndSounds.MUSIC_FOREST) + .setLoop(EndSounds.AMBIENT_AMBER_LAND) + .setParticles(EndParticles.AMBER_SPHERE, 0.001F) + .setSurface(EndBlocks.AMBER_MOSS) + .addFeature(EndFeatures.AMBER_ORE) + .addFeature(EndFeatures.END_LAKE_RARE) + .addFeature(EndFeatures.HELIX_TREE) + .addFeature(EndFeatures.LANCELEAF) + .addFeature(EndFeatures.GLOW_PILLAR) + .addFeature(EndFeatures.AMBER_GRASS) + .addFeature(EndFeatures.AMBER_ROOT) + .addFeature(EndFeatures.BULB_MOSS) + .addFeature(EndFeatures.BULB_MOSS_WOOD) + .addFeature(EndFeatures.CHARNIA_ORANGE) + .addFeature(EndFeatures.CHARNIA_RED) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) + .addMobSpawn(EndEntities.END_SLIME, 30, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java b/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java index 8eaaf0fe..6016c949 100644 --- a/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java @@ -11,6 +11,25 @@ import ru.betterend.world.biome.EndBiome; public class BlossomingSpiresBiome extends EndBiome { public BlossomingSpiresBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires")).addCustomData("has_caves", false).setFogColor(241, 146, 229).setFogDensity(1.7F).setPlantsColor(122, 45, 122).setSurface(EndBlocks.PINK_MOSS).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES).addFeature(EndFeatures.SPIRE).addFeature(EndFeatures.FLOATING_SPIRE).addFeature(EndFeatures.TENANEA).addFeature(EndFeatures.TENANEA_BUSH).addFeature(EndFeatures.BULB_VINE).addFeature(EndFeatures.BUSHY_GRASS).addFeature(EndFeatures.BUSHY_GRASS_WG).addFeature(EndFeatures.BLOSSOM_BERRY).addFeature(EndFeatures.TWISTED_MOSS).addFeature(EndFeatures.TWISTED_MOSS_WOOD).addFeature(EndFeatures.SILK_MOTH_NEST).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4).addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires")).addCustomData("has_caves", false) + .setFogColor(241, 146, 229) + .setFogDensity(1.7F) + .setPlantsColor(122, 45, 122) + .setSurface(EndBlocks.PINK_MOSS) + .setMusic(EndSounds.MUSIC_FOREST) + .setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES) + .addFeature(EndFeatures.SPIRE) + .addFeature(EndFeatures.FLOATING_SPIRE) + .addFeature(EndFeatures.TENANEA) + .addFeature(EndFeatures.TENANEA_BUSH) + .addFeature(EndFeatures.BULB_VINE) + .addFeature(EndFeatures.BUSHY_GRASS) + .addFeature(EndFeatures.BUSHY_GRASS_WG) + .addFeature(EndFeatures.BLOSSOM_BERRY) + .addFeature(EndFeatures.TWISTED_MOSS) + .addFeature(EndFeatures.TWISTED_MOSS_WOOD) + .addFeature(EndFeatures.SILK_MOTH_NEST) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) + .addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java b/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java index 1fef31e2..0081a58f 100644 --- a/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java @@ -15,6 +15,35 @@ import ru.betterend.world.biome.EndBiome; public class ChorusForestBiome extends EndBiome { public ChorusForestBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest")).setFogColor(87, 26, 87).setFogDensity(1.5F).setPlantsColor(122, 45, 122).setWaterAndFogColor(73, 30, 73).setSurface(EndBlocks.CHORUS_NYLIUM).setParticles(ParticleTypes.PORTAL, 0.01F).setLoop(EndSounds.AMBIENT_CHORUS_FOREST).setMusic(EndSounds.MUSIC_DARK).addFeature(EndFeatures.VIOLECITE_LAYER).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.PYTHADENDRON_TREE).addFeature(EndFeatures.PYTHADENDRON_BUSH).addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT).addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT).addFeature(EndFeatures.CHORUS_GRASS).addFeature(EndFeatures.CHORUS_MUSHROOM).addFeature(EndFeatures.TAIL_MOSS).addFeature(EndFeatures.TAIL_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_PURPLE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); + super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest")).setFogColor(87, 26, 87) + .setFogDensity(1.5F) + .setPlantsColor(122, 45, 122) + .setWaterAndFogColor(73, 30, 73) + .setSurface(EndBlocks.CHORUS_NYLIUM) + .setParticles(ParticleTypes.PORTAL, 0.01F) + .setLoop(EndSounds.AMBIENT_CHORUS_FOREST) + .setMusic(EndSounds.MUSIC_DARK) + .addFeature(EndFeatures.VIOLECITE_LAYER) + .addFeature(EndFeatures.END_LAKE_RARE) + .addFeature(EndFeatures.PYTHADENDRON_TREE) + .addFeature(EndFeatures.PYTHADENDRON_BUSH) + .addFeature(EndFeatures.PURPLE_POLYPORE) + .addFeature( + Decoration.VEGETAL_DECORATION, + Features.CHORUS_PLANT + ) + .addFeature( + Decoration.VEGETAL_DECORATION, + Features.CHORUS_PLANT + ) + .addFeature(EndFeatures.CHORUS_GRASS) + .addFeature(EndFeatures.CHORUS_MUSHROOM) + .addFeature(EndFeatures.TAIL_MOSS) + .addFeature(EndFeatures.TAIL_MOSS_WOOD) + .addFeature(EndFeatures.CHARNIA_PURPLE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java b/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java index d4f57290..88197427 100644 --- a/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java @@ -11,6 +11,12 @@ import ru.betterend.world.biome.EndBiome; public class CrystalMountainsBiome extends EndBiome { public CrystalMountainsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains")).addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured()).setPlantsColor(255, 133, 211).setSurface(EndBlocks.CRYSTAL_MOSS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.ROUND_CAVE).addFeature(EndFeatures.CRYSTAL_GRASS).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains")).addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured()) + .setPlantsColor(255, 133, 211) + .setSurface(EndBlocks.CRYSTAL_MOSS) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .addFeature(EndFeatures.ROUND_CAVE) + .addFeature(EndFeatures.CRYSTAL_GRASS) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java b/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java index e02302a0..6694ec8c 100644 --- a/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java @@ -11,6 +11,23 @@ import ru.betterend.world.biome.EndBiome; public class DragonGraveyardsBiome extends EndBiome { public DragonGraveyardsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards")).setGenChance(0.1F).setFogColor(244, 46, 79).setFogDensity(1.3F).setParticles(EndParticles.FIREFLY, 0.0007F).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS).setSurface(EndBlocks.SANGNUM).setWaterAndFogColor(203, 59, 167).setPlantsColor(244, 46, 79).addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT).addFeature(EndFeatures.FALLEN_PILLAR).addFeature(EndFeatures.OBSIDIAN_BOULDER).addFeature(EndFeatures.GIGANTIC_AMARANITA).addFeature(EndFeatures.LARGE_AMARANITA).addFeature(EndFeatures.SMALL_AMARANITA).addFeature(EndFeatures.GLOBULAGUS).addFeature(EndFeatures.CLAWFERN).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards")).setGenChance(0.1F) + .setFogColor(244, 46, 79) + .setFogDensity(1.3F) + .setParticles(EndParticles.FIREFLY, 0.0007F) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS) + .setSurface(EndBlocks.SANGNUM) + .setWaterAndFogColor(203, 59, 167) + .setPlantsColor(244, 46, 79) + .addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT) + .addFeature(EndFeatures.FALLEN_PILLAR) + .addFeature(EndFeatures.OBSIDIAN_BOULDER) + .addFeature(EndFeatures.GIGANTIC_AMARANITA) + .addFeature(EndFeatures.LARGE_AMARANITA) + .addFeature(EndFeatures.SMALL_AMARANITA) + .addFeature(EndFeatures.GLOBULAGUS) + .addFeature(EndFeatures.CLAWFERN) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java b/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java index 8f3955e8..308a1ee5 100644 --- a/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java @@ -11,6 +11,18 @@ import ru.betterend.world.biome.EndBiome; public class DryShrublandBiome extends EndBiome { public DryShrublandBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland")).setFogColor(132, 35, 13).setFogDensity(1.2F).setWaterAndFogColor(113, 88, 53).setPlantsColor(237, 122, 66).setSurface(EndBlocks.RUTISCUS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.LUCERNIA_BUSH_RARE).addFeature(EndFeatures.ORANGO).addFeature(EndFeatures.AERIDIUM).addFeature(EndFeatures.LUTEBUS).addFeature(EndFeatures.LAMELLARIUM).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland")).setFogColor(132, 35, 13) + .setFogDensity(1.2F) + .setWaterAndFogColor(113, 88, 53) + .setPlantsColor(237, 122, 66) + .setSurface(EndBlocks.RUTISCUS) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .addFeature(EndFeatures.LUCERNIA_BUSH_RARE) + .addFeature(EndFeatures.ORANGO) + .addFeature(EndFeatures.AERIDIUM) + .addFeature(EndFeatures.LUTEBUS) + .addFeature(EndFeatures.LAMELLARIUM) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java b/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java index 50724299..0be8d1dc 100644 --- a/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java @@ -11,6 +11,15 @@ import ru.betterend.world.biome.EndBiome; public class DustWastelandsBiome extends EndBiome { public DustWastelandsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands")).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(192, 180, 131).setSurface(EndBlocks.ENDSTONE_DUST).setDepth(1.5F).setParticles(ParticleTypes.WHITE_ASH, 0.01F).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setMusic(EndSounds.MUSIC_OPENSPACE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands")).setFogColor(226, 239, 168) + .setFogDensity(2) + .setWaterAndFogColor(192, 180, 131) + .setSurface(EndBlocks.ENDSTONE_DUST) + .setDepth(1.5F) + .setParticles(ParticleTypes.WHITE_ASH, 0.01F) + .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java b/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java index 4e608789..b25d3add 100644 --- a/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java @@ -14,8 +14,38 @@ import ru.betterend.world.biome.EndBiome; public class FoggyMushroomlandBiome extends EndBiome { public FoggyMushroomlandBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland")).addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(41, 122, 173).setFogDensity(3).setWaterAndFogColor(119, 227, 250).setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND).setMusic(EndSounds.MUSIC_FOREST).addFeature(EndFeatures.END_LAKE).addFeature(EndFeatures.MOSSY_GLOWSHROOM).addFeature(EndFeatures.BLUE_VINE).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.DENSE_VINE) - //.addFeature(EndFeatures.PEARLBERRY) - .addFeature(EndFeatures.CYAN_MOSS).addFeature(EndFeatures.CYAN_MOSS_WOOD).addFeature(EndFeatures.END_LILY).addFeature(EndFeatures.BUBBLE_CORAL).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5).addMobSpawn(EndEntities.END_FISH, 20, 2, 5).addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8).addMobSpawn(EndEntities.END_SLIME, 10, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland")).addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM + .getFeatureConfigured()) + .setPlantsColor(73, 210, 209) + .setFogColor(41, 122, 173) + .setFogDensity(3) + .setWaterAndFogColor(119, 227, 250) + .setSurface( + EndBlocks.END_MOSS, + EndBlocks.END_MYCELIUM + ) + .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) + .setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND) + .setMusic(EndSounds.MUSIC_FOREST) + .addFeature(EndFeatures.END_LAKE) + .addFeature(EndFeatures.MOSSY_GLOWSHROOM) + .addFeature(EndFeatures.BLUE_VINE) + .addFeature(EndFeatures.UMBRELLA_MOSS) + .addFeature(EndFeatures.CREEPING_MOSS) + .addFeature(EndFeatures.DENSE_VINE) + //.addFeature(EndFeatures.PEARLBERRY) + .addFeature(EndFeatures.CYAN_MOSS) + .addFeature(EndFeatures.CYAN_MOSS_WOOD) + .addFeature(EndFeatures.END_LILY) + .addFeature(EndFeatures.BUBBLE_CORAL) + .addFeature(EndFeatures.CHARNIA_CYAN) + .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5) + .addMobSpawn(EndEntities.END_FISH, 20, 2, 5) + .addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8) + .addMobSpawn(EndEntities.END_SLIME, 10, 1, 2) + .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java b/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java index eafb5f8d..6fac2557 100644 --- a/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java @@ -12,6 +12,28 @@ import ru.betterend.world.biome.EndBiome; public class GlowingGrasslandsBiome extends EndBiome { public GlowingGrasslandsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands")).setFogColor(99, 228, 247).setFogDensity(1.3F).setParticles(EndParticles.FIREFLY, 0.001F).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS).setSurface(EndBlocks.END_MOSS).setWaterAndFogColor(92, 250, 230).setPlantsColor(73, 210, 209).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.LUMECORN).addFeature(EndFeatures.BLOOMING_COOKSONIA).addFeature(EndFeatures.SALTEAGO).addFeature(EndFeatures.VAIOLUSH_FERN).addFeature(EndFeatures.FRACTURN).addFeature(EndFeatures.UMBRELLA_MOSS_RARE).addFeature(EndFeatures.CREEPING_MOSS_RARE).addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands")).setFogColor(99, 228, 247) + .setFogDensity(1.3F) + .setParticles(EndParticles.FIREFLY, 0.001F) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS) + .setSurface(EndBlocks.END_MOSS) + .setWaterAndFogColor(92, 250, 230) + .setPlantsColor(73, 210, 209) + .addFeature(EndFeatures.END_LAKE_RARE) + .addFeature(EndFeatures.LUMECORN) + .addFeature(EndFeatures.BLOOMING_COOKSONIA) + .addFeature(EndFeatures.SALTEAGO) + .addFeature(EndFeatures.VAIOLUSH_FERN) + .addFeature(EndFeatures.FRACTURN) + .addFeature(EndFeatures.UMBRELLA_MOSS_RARE) + .addFeature(EndFeatures.CREEPING_MOSS_RARE) + .addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE) + .addFeature(EndFeatures.CHARNIA_CYAN) + .addFeature(EndFeatures.CHARNIA_GREEN) + .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java b/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java index 7f131d13..b438aa05 100644 --- a/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java @@ -12,6 +12,28 @@ import ru.betterend.world.biome.EndBiome; public class LanternWoodsBiome extends EndBiome { public LanternWoodsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods")).setFogColor(189, 82, 70).setFogDensity(1.1F).setWaterAndFogColor(171, 234, 226).setPlantsColor(254, 85, 57).setSurface(EndBlocks.RUTISCUS).setMusic(EndSounds.MUSIC_FOREST).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).addFeature(EndFeatures.END_LAKE_NORMAL).addFeature(EndFeatures.FLAMAEA).addFeature(EndFeatures.LUCERNIA).addFeature(EndFeatures.LUCERNIA_BUSH).addFeature(EndFeatures.FILALUX).addFeature(EndFeatures.AERIDIUM).addFeature(EndFeatures.LAMELLARIUM).addFeature(EndFeatures.BOLUX_MUSHROOM).addFeature(EndFeatures.AURANT_POLYPORE).addFeature(EndFeatures.POND_ANEMONE).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED).addFeature(EndFeatures.RUSCUS).addFeature(EndFeatures.RUSCUS_WOOD).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods")).setFogColor(189, 82, 70) + .setFogDensity(1.1F) + .setWaterAndFogColor(171, 234, 226) + .setPlantsColor(254, 85, 57) + .setSurface(EndBlocks.RUTISCUS) + .setMusic(EndSounds.MUSIC_FOREST) + .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) + .addFeature(EndFeatures.END_LAKE_NORMAL) + .addFeature(EndFeatures.FLAMAEA) + .addFeature(EndFeatures.LUCERNIA) + .addFeature(EndFeatures.LUCERNIA_BUSH) + .addFeature(EndFeatures.FILALUX) + .addFeature(EndFeatures.AERIDIUM) + .addFeature(EndFeatures.LAMELLARIUM) + .addFeature(EndFeatures.BOLUX_MUSHROOM) + .addFeature(EndFeatures.AURANT_POLYPORE) + .addFeature(EndFeatures.POND_ANEMONE) + .addFeature(EndFeatures.CHARNIA_ORANGE) + .addFeature(EndFeatures.CHARNIA_RED) + .addFeature(EndFeatures.RUSCUS) + .addFeature(EndFeatures.RUSCUS_WOOD) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java b/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java index dceecceb..de9207fc 100644 --- a/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java @@ -12,8 +12,30 @@ import ru.betterend.world.biome.EndBiome; public class MegalakeBiome extends EndBiome { public MegalakeBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("megalake")).addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(178, 209, 248).setWaterAndFogColor(96, 163, 255).setFogDensity(1.75F).setMusic(EndSounds.MUSIC_WATER).setLoop(EndSounds.AMBIENT_MEGALAKE).setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST).setDepth(0F).addFeature(EndFeatures.END_LOTUS).addFeature(EndFeatures.END_LOTUS_LEAF).addFeature(EndFeatures.BUBBLE_CORAL_RARE).addFeature(EndFeatures.END_LILY_RARE).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS) - //.addFeature(EndFeatures.PEARLBERRY) - .addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addFeature(EndFeatures.MENGER_SPONGE).addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3).addMobSpawn(EndEntities.END_FISH, 50, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("megalake")).addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured()) + .setPlantsColor(73, 210, 209) + .setFogColor(178, 209, 248) + .setWaterAndFogColor(96, 163, 255) + .setFogDensity(1.75F) + .setMusic(EndSounds.MUSIC_WATER) + .setLoop(EndSounds.AMBIENT_MEGALAKE) + .setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST) + .setDepth(0F) + .addFeature(EndFeatures.END_LOTUS) + .addFeature(EndFeatures.END_LOTUS_LEAF) + .addFeature(EndFeatures.BUBBLE_CORAL_RARE) + .addFeature(EndFeatures.END_LILY_RARE) + .addFeature(EndFeatures.UMBRELLA_MOSS) + .addFeature(EndFeatures.CREEPING_MOSS) + //.addFeature(EndFeatures.PEARLBERRY) + .addFeature(EndFeatures.CHARNIA_CYAN) + .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addFeature(EndFeatures.MENGER_SPONGE) + .addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3) + .addMobSpawn(EndEntities.END_FISH, 50, 3, 8) + .addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) + .addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) + .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java b/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java index af0b1747..b554ab04 100644 --- a/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java @@ -13,8 +13,32 @@ import ru.betterend.world.biome.EndBiome; public class MegalakeGroveBiome extends EndBiome { public MegalakeGroveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove")).addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(178, 209, 248).setWaterAndFogColor(96, 163, 255).setFogDensity(2.0F).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setMusic(EndSounds.MUSIC_WATER).setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE).setSurface(EndBlocks.END_MOSS).setDepth(0F).addFeature(EndFeatures.LACUGROVE).addFeature(EndFeatures.END_LOTUS).addFeature(EndFeatures.END_LOTUS_LEAF).addFeature(EndFeatures.BUBBLE_CORAL_RARE).addFeature(EndFeatures.END_LILY_RARE).addFeature(EndFeatures.UMBRELLA_MOSS) - //.addFeature(EndFeatures.PEARLBERRY) - .addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addFeature(EndFeatures.MENGER_SPONGE).addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3).addMobSpawn(EndEntities.END_FISH, 20, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove")).addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured()) + .setPlantsColor(73, 210, 209) + .setFogColor(178, 209, 248) + .setWaterAndFogColor(96, 163, 255) + .setFogDensity(2.0F) + .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) + .setMusic(EndSounds.MUSIC_WATER) + .setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE) + .setSurface(EndBlocks.END_MOSS) + .setDepth(0F) + .addFeature(EndFeatures.LACUGROVE) + .addFeature(EndFeatures.END_LOTUS) + .addFeature(EndFeatures.END_LOTUS_LEAF) + .addFeature(EndFeatures.BUBBLE_CORAL_RARE) + .addFeature(EndFeatures.END_LILY_RARE) + .addFeature(EndFeatures.UMBRELLA_MOSS) + //.addFeature(EndFeatures.PEARLBERRY) + .addFeature(EndFeatures.CREEPING_MOSS) + .addFeature(EndFeatures.CHARNIA_CYAN) + .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addFeature(EndFeatures.MENGER_SPONGE) + .addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3) + .addMobSpawn(EndEntities.END_FISH, 20, 3, 8) + .addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) + .addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) + .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java b/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java index d3269e79..e33d68c6 100644 --- a/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java @@ -12,6 +12,22 @@ import ru.betterend.world.biome.EndBiome; public class NeonOasisBiome extends EndBiome { public NeonOasisBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis")).setGenChance(0.5F).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(106, 238, 215).setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS).setParticles(ParticleTypes.WHITE_ASH, 0.01F).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.DESERT_LAKE).addFeature(EndFeatures.NEON_CACTUS).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_RED).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis")).setGenChance(0.5F) + .setFogColor(226, 239, 168) + .setFogDensity(2) + .setWaterAndFogColor(106, 238, 215) + .setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS) + .setParticles(ParticleTypes.WHITE_ASH, 0.01F) + .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .addFeature(EndFeatures.DESERT_LAKE) + .addFeature(EndFeatures.NEON_CACTUS) + .addFeature(EndFeatures.UMBRELLA_MOSS) + .addFeature(EndFeatures.CREEPING_MOSS) + .addFeature(EndFeatures.CHARNIA_GREEN) + .addFeature(EndFeatures.CHARNIA_CYAN) + .addFeature(EndFeatures.CHARNIA_RED) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java b/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java index dd09cbf0..6d3ffa10 100644 --- a/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java @@ -11,6 +11,14 @@ import ru.betterend.world.biome.EndBiome; public class PaintedMountainsBiome extends EndBiome { public PaintedMountainsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains")).addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured()).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(192, 180, 131).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setSurface(EndBlocks.ENDSTONE_DUST).setParticles(ParticleTypes.WHITE_ASH, 0.01F).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains")).addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured()) + .setFogColor(226, 239, 168) + .setFogDensity(2) + .setWaterAndFogColor(192, 180, 131) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) + .setSurface(EndBlocks.ENDSTONE_DUST) + .setParticles(ParticleTypes.WHITE_ASH, 0.01F) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java b/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java index 3c1fce3f..4047555f 100644 --- a/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java @@ -13,6 +13,31 @@ import ru.betterend.world.biome.EndBiome; public class ShadowForestBiome extends EndBiome { public ShadowForestBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest")).setFogColor(0, 0, 0).setFogDensity(2.5F).setPlantsColor(45, 45, 45).setWaterAndFogColor(42, 45, 80).setSurface(EndBlocks.SHADOW_GRASS).setParticles(ParticleTypes.MYCELIUM, 0.01F).setLoop(EndSounds.AMBIENT_CHORUS_FOREST).setMusic(EndSounds.MUSIC_DARK).addFeature(EndFeatures.VIOLECITE_LAYER).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.DRAGON_TREE).addFeature(EndFeatures.DRAGON_TREE_BUSH).addFeature(EndFeatures.SHADOW_PLANT).addFeature(EndFeatures.MURKWEED).addFeature(EndFeatures.NEEDLEGRASS).addFeature(EndFeatures.SHADOW_BERRY).addFeature(EndFeatures.TWISTED_VINE).addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(EndFeatures.TAIL_MOSS).addFeature(EndFeatures.TAIL_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_PURPLE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4).addMobSpawn(EntityType.ENDERMAN, 40, 1, 4).addMobSpawn(EntityType.PHANTOM, 1, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest")).setFogColor(0, 0, 0) + .setFogDensity(2.5F) + .setPlantsColor(45, 45, 45) + .setWaterAndFogColor(42, 45, 80) + .setSurface(EndBlocks.SHADOW_GRASS) + .setParticles(ParticleTypes.MYCELIUM, 0.01F) + .setLoop(EndSounds.AMBIENT_CHORUS_FOREST) + .setMusic(EndSounds.MUSIC_DARK) + .addFeature(EndFeatures.VIOLECITE_LAYER) + .addFeature(EndFeatures.END_LAKE_RARE) + .addFeature(EndFeatures.DRAGON_TREE) + .addFeature(EndFeatures.DRAGON_TREE_BUSH) + .addFeature(EndFeatures.SHADOW_PLANT) + .addFeature(EndFeatures.MURKWEED) + .addFeature(EndFeatures.NEEDLEGRASS) + .addFeature(EndFeatures.SHADOW_BERRY) + .addFeature(EndFeatures.TWISTED_VINE) + .addFeature(EndFeatures.PURPLE_POLYPORE) + .addFeature(EndFeatures.TAIL_MOSS) + .addFeature(EndFeatures.TAIL_MOSS_WOOD) + .addFeature(EndFeatures.CHARNIA_PURPLE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4) + .addMobSpawn(EntityType.ENDERMAN, 40, 1, 4) + .addMobSpawn(EntityType.PHANTOM, 1, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java b/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java index d17128c4..238a7095 100644 --- a/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java @@ -12,6 +12,27 @@ import ru.betterend.world.surface.SurfaceBuilders; public class SulphurSpringsBiome extends EndBiome { public SulphurSpringsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs")).addCustomData("has_caves", false).setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG)).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS).setWaterColor(25, 90, 157).setWaterFogColor(30, 65, 61).setFogColor(207, 194, 62).setFogDensity(1.5F).setDepth(0F).setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F).addFeature(EndFeatures.GEYSER).addFeature(EndFeatures.SURFACE_VENT).addFeature(EndFeatures.SULPHURIC_LAKE).addFeature(EndFeatures.SULPHURIC_CAVE).addFeature(EndFeatures.HYDRALUX).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED_RARE).addMobSpawn(EndEntities.END_FISH, 50, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); + super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs")).addCustomData("has_caves", false) + .setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured( + SurfaceBuilders.DEFAULT_END_CONFIG)) + .setMusic(EndSounds.MUSIC_OPENSPACE) + .setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS) + .setWaterColor(25, 90, 157) + .setWaterFogColor(30, 65, 61) + .setFogColor(207, 194, 62) + .setFogDensity(1.5F) + .setDepth(0F) + .setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F) + .addFeature(EndFeatures.GEYSER) + .addFeature(EndFeatures.SURFACE_VENT) + .addFeature(EndFeatures.SULPHURIC_LAKE) + .addFeature(EndFeatures.SULPHURIC_CAVE) + .addFeature(EndFeatures.HYDRALUX) + .addFeature(EndFeatures.CHARNIA_GREEN) + .addFeature(EndFeatures.CHARNIA_ORANGE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addMobSpawn(EndEntities.END_FISH, 50, 3, 8) + .addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/UmbraValleyBiome.java b/src/main/java/ru/betterend/world/biome/land/UmbraValleyBiome.java index 09c1752c..22525819 100644 --- a/src/main/java/ru/betterend/world/biome/land/UmbraValleyBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/UmbraValleyBiome.java @@ -2,7 +2,6 @@ package ru.betterend.world.biome.land; import ru.bclib.world.biomes.BCLBiomeDef; import ru.betterend.BetterEnd; -import ru.betterend.registry.EndBlocks; import ru.betterend.world.biome.EndBiome; import ru.betterend.world.surface.SurfaceBuilders; @@ -10,10 +9,10 @@ public class UmbraValleyBiome extends EndBiome { public UmbraValleyBiome() { super( new BCLBiomeDef(BetterEnd.makeID("umbra_valley")) - .setFogColor(100, 100, 100) - .setPlantsColor(200, 200, 200) - .setWaterAndFogColor(69, 104, 134) - .setSurface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG)) + .setFogColor(100, 100, 100) + .setPlantsColor(200, 200, 200) + .setWaterAndFogColor(69, 104, 134) + .setSurface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG)) ); } } diff --git a/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java b/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java index 24683b76..1c0fae69 100644 --- a/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java @@ -12,6 +12,32 @@ import ru.betterend.world.biome.EndBiome; public class UmbrellaJungleBiome extends EndBiome { public UmbrellaJungleBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle")).setFogColor(87, 223, 221).setWaterAndFogColor(119, 198, 253).setFoliageColor(27, 183, 194).setFogDensity(2.3F).setParticles(EndParticles.JUNGLE_SPORE, 0.001F).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE).setSurface(EndBlocks.JUNGLE_MOSS).addFeature(EndFeatures.END_LAKE).addFeature(EndFeatures.UMBRELLA_TREE).addFeature(EndFeatures.JELLYSHROOM).addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS).addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR).addFeature(EndFeatures.JUNGLE_GRASS).addFeature(EndFeatures.CYAN_MOSS).addFeature(EndFeatures.CYAN_MOSS_WOOD).addFeature(EndFeatures.JUNGLE_FERN_WOOD).addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL).addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD).addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL).addFeature(EndFeatures.JUNGLE_VINE).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle")).setFogColor(87, 223, 221) + .setWaterAndFogColor(119, 198, 253) + .setFoliageColor(27, 183, 194) + .setFogDensity(2.3F) + .setParticles(EndParticles.JUNGLE_SPORE, 0.001F) + .setMusic(EndSounds.MUSIC_FOREST) + .setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE) + .setSurface(EndBlocks.JUNGLE_MOSS) + .addFeature(EndFeatures.END_LAKE) + .addFeature(EndFeatures.UMBRELLA_TREE) + .addFeature(EndFeatures.JELLYSHROOM) + .addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS) + .addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR) + .addFeature(EndFeatures.JUNGLE_GRASS) + .addFeature(EndFeatures.CYAN_MOSS) + .addFeature(EndFeatures.CYAN_MOSS_WOOD) + .addFeature(EndFeatures.JUNGLE_FERN_WOOD) + .addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL) + .addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD) + .addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL) + .addFeature(EndFeatures.JUNGLE_VINE) + .addFeature(EndFeatures.CHARNIA_CYAN) + .addFeature(EndFeatures.CHARNIA_GREEN) + .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) + .addFeature(EndFeatures.CHARNIA_RED_RARE) + .addStructureFeature(StructureFeatures.END_CITY) + .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } \ No newline at end of file diff --git a/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java b/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java index 846b7514..22838b86 100644 --- a/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java +++ b/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java @@ -59,7 +59,10 @@ public class BiomeIslandFeature extends DefaultFeature { float deltaZ = Math.abs(pos.z()); if (deltaY < 2.0f && (deltaX < 3.0f || deltaZ < 3.0F)) return 0.0f; return (float) simplexNoise.eval(CENTER.getX() + pos.x(), CENTER.getY() + pos.y(), CENTER.getZ() + pos.z()); - }).setSource(sdfCone).setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.getMaterial().isReplaceable()); + }) + .setSource(sdfCone) + .setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.getMaterial() + .isReplaceable()); return sdfCone; } diff --git a/src/main/java/ru/betterend/world/features/BlueVineFeature.java b/src/main/java/ru/betterend/world/features/BlueVineFeature.java index 73037656..43aec70d 100644 --- a/src/main/java/ru/betterend/world/features/BlueVineFeature.java +++ b/src/main/java/ru/betterend/world/features/BlueVineFeature.java @@ -18,7 +18,10 @@ public class BlueVineFeature extends ScatterFeature { @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { - float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F; + float d = MHelper.length( + center.getX() - blockPos.getX(), + center.getZ() - blockPos.getZ() + ) / radius * 0.6F + random.nextFloat() * 0.4F; small = d > 0.5F; return EndBlocks.BLUE_VINE_SEED.canSurvive(AIR, world, blockPos); } @@ -26,7 +29,11 @@ public class BlueVineFeature extends ScatterFeature { @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { if (small) { - BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.BLUE_VINE_SEED.defaultBlockState().setValue(EndPlantWithAgeBlock.AGE, random.nextInt(4))); + BlocksHelper.setWithoutUpdate( + world, + blockPos, + EndBlocks.BLUE_VINE_SEED.defaultBlockState().setValue(EndPlantWithAgeBlock.AGE, random.nextInt(4)) + ); } else { EndPlantWithAgeBlock seed = ((EndPlantWithAgeBlock) EndBlocks.BLUE_VINE_SEED); diff --git a/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java b/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java index 3b5ea0d7..f99df6b7 100644 --- a/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java +++ b/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java @@ -18,14 +18,23 @@ public class CavePumpkinFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock(pos.below())) { + if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock( + pos.below())) { return false; } int age = random.nextInt(4); - BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.CAVE_PUMPKIN_SEED.defaultBlockState().setValue(EndBlockProperties.AGE, age)); + BlocksHelper.setWithoutUpdate( + world, + pos, + EndBlocks.CAVE_PUMPKIN_SEED.defaultBlockState().setValue(EndBlockProperties.AGE, age) + ); if (age > 1) { - BlocksHelper.setWithoutUpdate(world, pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(EndBlockProperties.SMALL, age < 3)); + BlocksHelper.setWithoutUpdate( + world, + pos.below(), + EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(EndBlockProperties.SMALL, age < 3) + ); } return true; diff --git a/src/main/java/ru/betterend/world/features/CrashedShipFeature.java b/src/main/java/ru/betterend/world/features/CrashedShipFeature.java index 704aca73..560f5136 100644 --- a/src/main/java/ru/betterend/world/features/CrashedShipFeature.java +++ b/src/main/java/ru/betterend/world/features/CrashedShipFeature.java @@ -90,7 +90,12 @@ public class CrashedShipFeature extends NBTStructureFeature { StructureTemplate structure = getStructure(world, center, random); Rotation rotation = getRotation(world, center, random); Mirror mirror = getMirror(world, center, random); - BlockPos offset = StructureTemplate.transform(new BlockPos(structure.getSize()), mirror, rotation, BlockPos.ZERO); + BlockPos offset = StructureTemplate.transform( + new BlockPos(structure.getSize()), + mirror, + rotation, + BlockPos.ZERO + ); center = center.offset(0, 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); @@ -102,7 +107,11 @@ public class CrashedShipFeature extends NBTStructureFeature { structure.placeInWorld(world, center, center, placementData.setBoundingBox(bounds), random, 2); StructureHelper.erodeIntense(world, bounds, random); - BlockFixer.fixBlocks(world, new BlockPos(bounds.minX(), bounds.minY(), bounds.minZ()), new BlockPos(bounds.maxX(), bounds.maxY(), bounds.maxZ())); + BlockFixer.fixBlocks( + world, + new BlockPos(bounds.minX(), bounds.minY(), bounds.minZ()), + new BlockPos(bounds.maxX(), bounds.maxY(), bounds.maxZ()) + ); return true; } diff --git a/src/main/java/ru/betterend/world/features/DoublePlantFeature.java b/src/main/java/ru/betterend/world/features/DoublePlantFeature.java index f4f40612..2a8ccb5c 100644 --- a/src/main/java/ru/betterend/world/features/DoublePlantFeature.java +++ b/src/main/java/ru/betterend/world/features/DoublePlantFeature.java @@ -23,7 +23,10 @@ public class DoublePlantFeature extends ScatterFeature { @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { - float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F; + float d = MHelper.length( + center.getX() - blockPos.getX(), + center.getZ() - blockPos.getZ() + ) / radius * 0.6F + random.nextFloat() * 0.4F; plant = d < 0.5F ? largePlant : smallPlant; return plant.canSurvive(plant.defaultBlockState(), world, blockPos); } diff --git a/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java b/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java index 788b4cf3..eab0eb99 100644 --- a/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java +++ b/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java @@ -40,12 +40,22 @@ public class EndLotusLeafFeature extends ScatterFeature { BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState(); BlocksHelper.setWithoutUpdate(world, pos, leaf.setValue(EndLotusLeafBlock.SHAPE, TripleShape.BOTTOM)); for (Direction move : BlocksHelper.HORIZONTAL) { - BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move).setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE)); + BlocksHelper.setWithoutUpdate( + world, + p.set(pos).move(move), + leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move) + .setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE) + ); } for (int i = 0; i < 4; i++) { Direction d1 = BlocksHelper.HORIZONTAL[i]; Direction d2 = BlocksHelper.HORIZONTAL[(i + 1) & 3]; - BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1).setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP)); + BlocksHelper.setWithoutUpdate( + world, + p.set(pos).move(d1).move(d2), + leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1) + .setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP) + ); } } diff --git a/src/main/java/ru/betterend/world/features/FilaluxFeature.java b/src/main/java/ru/betterend/world/features/FilaluxFeature.java index d991f638..4ead10d7 100644 --- a/src/main/java/ru/betterend/world/features/FilaluxFeature.java +++ b/src/main/java/ru/betterend/world/features/FilaluxFeature.java @@ -23,9 +23,17 @@ public class FilaluxFeature extends SkyScatterFeature { BlockState vine = EndBlocks.FILALUX.defaultBlockState(); BlockState wings = EndBlocks.FILALUX_WINGS.defaultBlockState(); BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.FILALUX_LANTERN); - BlocksHelper.setWithoutUpdate(world, blockPos.above(), wings.setValue(BlockStateProperties.FACING, Direction.UP)); + BlocksHelper.setWithoutUpdate( + world, + blockPos.above(), + wings.setValue(BlockStateProperties.FACING, Direction.UP) + ); for (Direction dir : BlocksHelper.HORIZONTAL) { - BlocksHelper.setWithoutUpdate(world, blockPos.relative(dir), wings.setValue(BlockStateProperties.FACING, dir)); + BlocksHelper.setWithoutUpdate( + world, + blockPos.relative(dir), + wings.setValue(BlockStateProperties.FACING, dir) + ); } int length = MHelper.randRange(1, 3, random); for (int i = 1; i <= length; i++) { diff --git a/src/main/java/ru/betterend/world/features/ScatterFeature.java b/src/main/java/ru/betterend/world/features/ScatterFeature.java index e3adb7f0..f6d50c56 100644 --- a/src/main/java/ru/betterend/world/features/ScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/ScatterFeature.java @@ -75,7 +75,13 @@ public abstract class ScatterFeature extends DefaultFeature { float z = pr * (float) Math.sin(theta); POS.set(center.getX() + x, center.getY() + getYOffset(), center.getZ() + z); - if (getGroundPlant(world, POS) && canGenerate(world, random, center, POS, r) && (getChance() < 2 || random.nextInt(getChance()) == 0)) { + if (getGroundPlant(world, POS) && canGenerate( + world, + random, + center, + POS, + r + ) && (getChance() < 2 || random.nextInt(getChance()) == 0)) { generate(world, random, POS); } } diff --git a/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java b/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java index ec402a17..3e918d28 100644 --- a/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java +++ b/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java @@ -45,9 +45,19 @@ public class SilkMothNestFeature extends DefaultFeature { POS.setY(y); if (canGenerate(world, POS)) { Direction dir = BlocksHelper.randomHorizontal(random); - BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir).setValue(BlockProperties.ACTIVE, false)); + BlocksHelper.setWithoutUpdate( + world, + POS, + EndBlocks.SILK_MOTH_NEST.defaultBlockState() + .setValue(BlockStateProperties.HORIZONTAL_FACING, dir) + .setValue(BlockProperties.ACTIVE, false) + ); POS.setY(y - 1); - BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir)); + BlocksHelper.setWithoutUpdate( + world, + POS, + EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir) + ); return true; } } diff --git a/src/main/java/ru/betterend/world/features/bushes/BushFeature.java b/src/main/java/ru/betterend/world/features/bushes/BushFeature.java index 20768d89..a1854d03 100644 --- a/src/main/java/ru/betterend/world/features/bushes/BushFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/BushFeature.java @@ -39,7 +39,8 @@ public class BushFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND)) + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()) + .is(TagAPI.END_GROUND)) return false; float radius = MHelper.randRange(1.8F, 3.5F, random); @@ -52,7 +53,8 @@ public class BushFeature extends DefaultFeature { sphere = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-2F, 2F, random); }).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere) + .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere.setReplaceFunction(REPLACE); sphere.addPostProcess((info) -> { if (info.getState().getBlock() instanceof LeavesBlock) { @@ -72,7 +74,11 @@ public class BushFeature extends DefaultFeature { BlockPos p = pos.relative(d); if (world.isEmptyBlock(p)) { if (leaves instanceof LeavesBlock) { - BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)); + BlocksHelper.setWithoutUpdate( + world, + p, + leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1) + ); } else { BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState()); diff --git a/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java b/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java index 26ac4748..7b09690f 100644 --- a/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java @@ -43,7 +43,8 @@ public class BushWithOuterFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND)) + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()) + .is(TagAPI.END_GROUND)) return false; float radius = MHelper.randRange(1.8F, 3.5F, random); @@ -56,7 +57,8 @@ public class BushWithOuterFeature extends DefaultFeature { sphere = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-2F, 2F, random); }).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere) + .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere.setReplaceFunction(REPLACE); sphere.addPostProcess((info) -> { if (info.getState().getBlock() instanceof LeavesBlock) { @@ -74,7 +76,10 @@ public class BushWithOuterFeature extends DefaultFeature { MHelper.shuffle(DIRECTIONS, random); for (Direction dir : DIRECTIONS) { if (info.getState(dir).isAir()) { - info.setBlockPos(info.getPos().relative(dir), outer_leaves.defaultBlockState().setValue(BlockStateProperties.FACING, dir)); + info.setBlockPos( + info.getPos().relative(dir), + outer_leaves.defaultBlockState().setValue(BlockStateProperties.FACING, dir) + ); } } } @@ -86,7 +91,11 @@ public class BushWithOuterFeature extends DefaultFeature { BlockPos p = pos.relative(d); if (world.isEmptyBlock(p)) { if (leaves instanceof LeavesBlock) { - BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)); + BlocksHelper.setWithoutUpdate( + world, + p, + leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1) + ); } else { BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState()); diff --git a/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java index 189a4cf8..cf28e054 100644 --- a/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java @@ -38,9 +38,17 @@ public class LargeAmaranitaFeature extends DefaultFeature { BlockState state = EndBlocks.LARGE_AMARANITA_MUSHROOM.defaultBlockState(); BlocksHelper.setWithUpdate(world, mut, state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM)); if (height > 2) { - BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)); + BlocksHelper.setWithUpdate( + world, + mut.move(Direction.UP), + state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE) + ); } - BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)); + BlocksHelper.setWithUpdate( + world, + mut.move(Direction.UP), + state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP) + ); return true; } diff --git a/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java b/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java index a6abc5d0..df7ed8e2 100644 --- a/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java +++ b/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java @@ -34,23 +34,42 @@ public class Lumecorn extends DefaultFeature { } } mut.set(pos); - BlockState topMiddle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP_MIDDLE); - BlockState middle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_MIDDLE); - BlockState bottom = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_BOTTOM); + BlockState topMiddle = EndBlocks.LUMECORN.defaultBlockState() + .setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP_MIDDLE); + BlockState middle = EndBlocks.LUMECORN.defaultBlockState() + .setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_MIDDLE); + BlockState bottom = EndBlocks.LUMECORN.defaultBlockState() + .setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_BOTTOM); BlockState top = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP); if (height == 4) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)); + BlocksHelper.setWithoutUpdate( + world, + mut, + EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL) + ); BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom); BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), topMiddle); BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), top); return true; } if (random.nextBoolean()) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)); + BlocksHelper.setWithoutUpdate( + world, + mut, + EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL) + ); } else { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG)); - BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.MIDDLE)); + BlocksHelper.setWithoutUpdate( + world, + mut, + EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG) + ); + BlocksHelper.setWithoutUpdate( + world, + mut.move(Direction.UP), + EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.MIDDLE) + ); height--; } BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom); diff --git a/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java b/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java index afff518e..c1eaa9fb 100644 --- a/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java @@ -49,9 +49,14 @@ public class TenaneaBushFeature extends DefaultFeature { BlockState leaves = EndBlocks.TENANEA_LEAVES.defaultBlockState(); SDF sphere = new SDFSphere().setRadius(radius).setBlock(leaves); sphere = new SDFScale3D().setScale(1, 0.75F, 1).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) -> (float) noise.eval( + vec.x() * 0.2, + vec.y() * 0.2, + vec.z() * 0.2 + ) * 3).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-2F, 2F, random)).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere) + .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere.setReplaceFunction(REPLACE); List support = Lists.newArrayList(); sphere.addPostProcess((info) -> { @@ -66,7 +71,10 @@ public class TenaneaBushFeature extends DefaultFeature { MHelper.shuffle(DIRECTIONS, random); for (Direction d : DIRECTIONS) { if (info.getState(d).isAir()) { - info.setBlockPos(info.getPos().relative(d), EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState().setValue(FurBlock.FACING, d)); + info.setBlockPos( + info.getPos().relative(d), + EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState().setValue(FurBlock.FACING, d) + ); } } @@ -89,9 +97,12 @@ public class TenaneaBushFeature extends DefaultFeature { } MutableBlockPos mut = new MutableBlockPos(); - BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); - BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); - BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); + BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); + BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); + BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); support.forEach((bpos) -> { BlockState state = world.getBlockState(bpos); if (state.isAir() || state.is(EndBlocks.TENANEA_OUTER_LEAVES)) { diff --git a/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java b/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java index e46350e2..2e43e221 100644 --- a/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java @@ -34,11 +34,16 @@ public class BigAuroraCrystalFeature extends DefaultFeature { pos = new BlockPos(pos.getX(), y, pos.getZ()); int height = MHelper.randRange(5, 25, random); - SDF prism = new SDFHexPrism().setHeight(height).setRadius(MHelper.randRange(1.7F, 3F, random)).setBlock(EndBlocks.AURORA_CRYSTAL); + SDF prism = new SDFHexPrism().setHeight(height) + .setRadius(MHelper.randRange(1.7F, 3F, random)) + .setBlock(EndBlocks.AURORA_CRYSTAL); Vector3f vec = MHelper.randomHorizontal(random); prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism); prism.setReplaceFunction((bState) -> { - return bState.getMaterial().isReplaceable() || bState.is(TagAPI.GEN_TERRAIN) || bState.getMaterial().equals(Material.PLANT) || bState.getMaterial().equals(Material.LEAVES); + return bState.getMaterial().isReplaceable() || bState.is(TagAPI.GEN_TERRAIN) || bState.getMaterial() + .equals(Material.PLANT) || bState + .getMaterial() + .equals(Material.LEAVES); }); prism.fillRecursive(world, pos); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.AURORA_CRYSTAL); diff --git a/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java index 943ddfe0..130feb90 100644 --- a/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java @@ -109,7 +109,11 @@ public class DesertLakeFeature extends DefaultFeature { size *= 0.8; add = 5; } - double r = (add * 1.8 + radius * (NOISE.eval(x * 0.2, y * 0.2, z * 0.2) * 0.25 + 0.75)) - 1.0 / size; + double r = (add * 1.8 + radius * (NOISE.eval( + x * 0.2, + y * 0.2, + z * 0.2 + ) * 0.25 + 0.75)) - 1.0 / size; if (r > 0) { r *= r; if (x2 + z2 <= r) { @@ -119,12 +123,23 @@ public class DesertLakeFeature extends DefaultFeature { } pos = POS.below(); if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) { - state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + state = world.getBiome(pos) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); else if (y > waterLevel) - BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()); + BlocksHelper.setWithoutUpdate( + world, + pos, + random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState() + ); else - BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); + BlocksHelper.setWithoutUpdate( + world, + pos, + EndBlocks.ENDSTONE_DUST.defaultBlockState() + ); } } } @@ -169,7 +184,8 @@ public class DesertLakeFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); } pos = POS.above(); - while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState().isEmpty()) { + while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState() + .isEmpty()) { BlocksHelper.setWithoutUpdate(world, pos, pos.getY() < waterLevel ? WATER : AIR); pos = pos.above(); } @@ -182,12 +198,23 @@ public class DesertLakeFeature extends DefaultFeature { } else if (y < waterLevel) { if (world.isEmptyBlock(POS.above())) { - state = world.getBiome(POS).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); - BlocksHelper.setWithoutUpdate(world, POS, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()); + state = world.getBiome(POS) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); + BlocksHelper.setWithoutUpdate( + world, + POS, + random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState() + ); BlocksHelper.setWithoutUpdate(world, POS.below(), END_STONE); } else { - BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.ENDSTONE_DUST.defaultBlockState()); + BlocksHelper.setWithoutUpdate( + world, + POS, + EndBlocks.ENDSTONE_DUST.defaultBlockState() + ); BlocksHelper.setWithoutUpdate(world, POS.below(), END_STONE); } } @@ -197,12 +224,21 @@ public class DesertLakeFeature extends DefaultFeature { } } - BlockFixer.fixBlocks(world, new BlockPos(minX - 2, waterLevel - 2, minZ - 2), new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2)); + BlockFixer.fixBlocks( + world, + new BlockPos(minX - 2, waterLevel - 2, minZ - 2), + new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2) + ); return true; } private boolean canReplace(BlockState state) { - return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT); + return state.getMaterial() + .isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() + .equals( + Material.PLANT) || state + .getMaterial() + .equals(Material.WATER_PLANT); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java index 83468973..2773a4a7 100644 --- a/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java @@ -109,7 +109,11 @@ public class EndLakeFeature extends DefaultFeature { size *= 0.8; add = 5; } - double r = (add * 1.8 + radius * (NOISE.eval(x * 0.2, y * 0.2, z * 0.2) * 0.25 + 0.75)) - 1.0 / size; + double r = (add * 1.8 + radius * (NOISE.eval( + x * 0.2, + y * 0.2, + z * 0.2 + ) * 0.25 + 0.75)) - 1.0 / size; if (r > 0) { r *= r; if (x2 + z2 <= r) { @@ -119,12 +123,23 @@ public class EndLakeFeature extends DefaultFeature { } pos = POS.below(); if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) { - state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + state = world.getBiome(pos) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); else if (y > waterLevel) - BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()); + BlocksHelper.setWithoutUpdate( + world, + pos, + random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState() + ); else - BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); + BlocksHelper.setWithoutUpdate( + world, + pos, + EndBlocks.ENDSTONE_DUST.defaultBlockState() + ); } } } @@ -169,7 +184,8 @@ public class EndLakeFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); } pos = POS.above(); - while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState().isEmpty()) { + while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState() + .isEmpty()) { BlocksHelper.setWithoutUpdate(world, pos, pos.getY() < waterLevel ? WATER : AIR); pos = pos.above(); } @@ -177,8 +193,15 @@ public class EndLakeFeature extends DefaultFeature { // Make border else if (y < waterLevel && y2 + x2 + z2 <= rb) { if (world.isEmptyBlock(POS.above())) { - state = world.getBiome(POS).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); - BlocksHelper.setWithoutUpdate(world, POS, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()); + state = world.getBiome(POS) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); + BlocksHelper.setWithoutUpdate( + world, + POS, + random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState() + ); BlocksHelper.setWithoutUpdate(world, POS.below(), END_STONE); } else { @@ -191,12 +214,21 @@ public class EndLakeFeature extends DefaultFeature { } } - BlockFixer.fixBlocks(world, new BlockPos(minX - 2, waterLevel - 2, minZ - 2), new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2)); + BlockFixer.fixBlocks( + world, + new BlockPos(minX - 2, waterLevel - 2, minZ - 2), + new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2) + ); return true; } private boolean canReplace(BlockState state) { - return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT); + return state.getMaterial() + .isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() + .equals( + Material.PLANT) || state + .getMaterial() + .equals(Material.WATER_PLANT); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java b/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java index f9ceac04..bf1c84b3 100644 --- a/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java @@ -27,14 +27,20 @@ public class FallenPillarFeature extends DefaultFeature { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); + pos = getPosOnSurface( + world, + new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) + ); if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) { return false; } float height = MHelper.randRange(20F, 40F, random); float radius = MHelper.randRange(2F, 4F, random); - SDF pillar = new SDFCappedCone().setRadius1(radius).setRadius2(radius).setHeight(height * 0.5F).setBlock(Blocks.OBSIDIAN); + SDF pillar = new SDFCappedCone().setRadius1(radius) + .setRadius2(radius) + .setHeight(height * 0.5F) + .setBlock(Blocks.OBSIDIAN); pillar = new SDFTranslate().setTranslate(0, radius * 0.5F - 2, 0).setSource(pillar); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); pillar = new SDFDisplacement().setFunction((vec) -> { @@ -51,7 +57,8 @@ public class FallenPillarFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT); + return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial() + .equals(Material.PLANT); }).fillRecursive(world, pos); return true; diff --git a/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java b/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java index ba395aaf..612fc6e9 100644 --- a/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java @@ -28,7 +28,11 @@ public class FloatingSpireFeature extends SpireFeature { final WorldGenLevel world = featureConfig.level(); final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator(); int minY = getYOnSurface(world, pos.getX(), pos.getZ()); - int y = minY > 57 ? MHelper.floor(MHelper.randRange(minY, minY * 2, random) * 0.5F + 32) : MHelper.randRange(64, 192, random); + int y = minY > 57 ? MHelper.floor(MHelper.randRange(minY, minY * 2, random) * 0.5F + 32) : MHelper.randRange( + 64, + 192, + random + ); pos = new BlockPos(pos.getX(), y, pos.getZ()); SDF sdf = new SDFSphere().setRadius(MHelper.randRange(2, 3, random)).setBlock(Blocks.END_STONE); @@ -45,7 +49,11 @@ public class FloatingSpireFeature extends SpireFeature { OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); sdf = new SDFDisplacement().setFunction((vec) -> { - return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); + return (float) (Math.abs(noise.eval( + vec.x() * 0.1, + vec.y() * 0.1, + vec.z() * 0.1 + )) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); }).setSource(sdf); final BlockPos center = pos; List support = Lists.newArrayList(); @@ -57,7 +65,10 @@ public class FloatingSpireFeature extends SpireFeature { return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); } else if (info.getState(Direction.UP, 3).isAir()) { - return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getUnderMaterial(); + return world.getBiome(info.getPos()) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getUnderMaterial(); } return info.getState(); }); @@ -65,7 +76,8 @@ public class FloatingSpireFeature extends SpireFeature { support.forEach((bpos) -> { if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) { - EndFeatures.TENANEA_BUSH.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null)); + EndFeatures.TENANEA_BUSH.getFeature() + .place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null)); } }); diff --git a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java index 80179102..a6cfe4d6 100644 --- a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java @@ -72,7 +72,10 @@ public class GeyserFeature extends DefaultFeature { int halfHeight = MHelper.randRange(10, 20, random); float radius1 = halfHeight * 0.5F; float radius2 = halfHeight * 0.1F + 0.5F; - SDF sdf = new SDFCappedCone().setHeight(halfHeight).setRadius1(radius1).setRadius2(radius2).setBlock(EndBlocks.SULPHURIC_ROCK.stone); + SDF sdf = new SDFCappedCone().setHeight(halfHeight) + .setRadius1(radius1) + .setRadius2(radius2) + .setBlock(EndBlocks.SULPHURIC_ROCK.stone); sdf = new SDFTranslate().setTranslate(0, halfHeight - 3, 0).setSource(sdf); int count = halfHeight; @@ -81,9 +84,15 @@ public class GeyserFeature extends DefaultFeature { float delta = (float) i / (float) (count - 1); float radius = Mth.lerp(delta, radius1, radius2) * 1.3F; - SDF bowl = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.SULPHURIC_ROCK.stone); + SDF bowl = new SDFCappedCone().setHeight(radius) + .setRadius1(0) + .setRadius2(radius) + .setBlock(EndBlocks.SULPHURIC_ROCK.stone); - SDF brimstone = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.BRIMSTONE); + SDF brimstone = new SDFCappedCone().setHeight(radius) + .setRadius1(0) + .setRadius2(radius) + .setBlock(EndBlocks.BRIMSTONE); brimstone = new SDFTranslate().setTranslate(0, 2F, 0).setSource(brimstone); bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(brimstone); bowl = new SDFUnion().setSourceA(brimstone).setSourceB(bowl); @@ -172,7 +181,11 @@ public class GeyserFeature extends DefaultFeature { } for (int i = 0; i < 150; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 4 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 4 + 0.5)); + mut.set(pos) + .move(MHelper.floor(random.nextGaussian() * 4 + 0.5), + -halfHeight - 10, + MHelper.floor(random.nextGaussian() * 4 + 0.5) + ); float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()); int dist = MHelper.floor(6 - distRaw) + random.nextInt(2); if (dist >= 0) { @@ -188,12 +201,18 @@ public class GeyserFeature extends DefaultFeature { for (Direction dir : HORIZONTAL) { BlockPos p = mut.relative(dir); if (random.nextBoolean() && world.getBlockState(p).is(Blocks.WATER)) { - BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, dir)); + BlocksHelper.setWithoutUpdate( + world, + p, + EndBlocks.TUBE_WORM.defaultBlockState() + .setValue(HorizontalDirectionalBlock.FACING, dir) + ); } } mut.setY(mut.getY() + 1); } - state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2); + state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState() + .setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2); BlocksHelper.setWithoutUpdate(world, mut, state); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); @@ -207,7 +226,11 @@ public class GeyserFeature extends DefaultFeature { } for (int i = 0; i < 10; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 0.7 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 0.7 + 0.5)); + mut.set(pos) + .move(MHelper.floor(random.nextGaussian() * 0.7 + 0.5), + -halfHeight - 10, + MHelper.floor(random.nextGaussian() * 0.7 + 0.5) + ); float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()); int dist = MHelper.floor(6 - distRaw) + random.nextInt(2); if (dist >= 0) { @@ -221,7 +244,8 @@ public class GeyserFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); mut.setY(mut.getY() + 1); } - state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2); + state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState() + .setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2); BlocksHelper.setWithoutUpdate(world, mut, state); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); @@ -234,7 +258,8 @@ public class GeyserFeature extends DefaultFeature { } } - EndFeatures.SULPHURIC_LAKE.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, pos, null)); + EndFeatures.SULPHURIC_LAKE.getFeature() + .place(new FeaturePlaceContext<>(world, chunkGenerator, random, pos, null)); double distance = radius1 * 1.7; BlockPos start = pos.offset(-distance, -halfHeight - 15 - distance, -distance); @@ -260,7 +285,8 @@ public class GeyserFeature extends DefaultFeature { }; IGNORE = (state) -> { - return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state.is(EndBlocks.BRIMSTONE); + return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state + .is(EndBlocks.BRIMSTONE); }; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java b/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java index 032eefa1..fa5b1618 100644 --- a/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java @@ -41,7 +41,10 @@ public class IceStarFeature extends DefaultFeature { int count = MHelper.randRange(minCount, maxCount, random); List points = getFibonacciPoints(count); SDF sdf = null; - SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW); + SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F) + .setRadius2(0) + .setHeight(size) + .setBlock(EndBlocks.DENSE_SNOW); spike = new SDFTranslate().setTranslate(0, size - 0.5F, 0).setSource(spike); for (Vector3f point : points) { SDF rotated = spike; @@ -77,7 +80,11 @@ public class IceStarFeature extends DefaultFeature { float px = bpos.getX() - center.getX(); float py = bpos.getY() - center.getY(); float pz = bpos.getZ() - center.getZ(); - float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(px, py, pz) * 0.4F + random.nextFloat() * randScale; + float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance( + px, + py, + pz + ) * 0.4F + random.nextFloat() * randScale; if (distance < ancientRadius) { return ancient; } diff --git a/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java b/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java index b88c2a08..b21174b5 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java @@ -25,14 +25,20 @@ public class ObsidianBoulderFeature extends DefaultFeature { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); + pos = getPosOnSurface( + world, + new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) + ); if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) { return false; } int count = MHelper.randRange(1, 5, random); for (int i = 0; i < count; i++) { - BlockPos p = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16) - 8, pos.getY(), pos.getZ() + random.nextInt(16) - 8)); + BlockPos p = getPosOnSurface( + world, + new BlockPos(pos.getX() + random.nextInt(16) - 8, pos.getY(), pos.getZ() + random.nextInt(16) - 8) + ); makeBoulder(world, p, random); } @@ -62,7 +68,8 @@ public class ObsidianBoulderFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT); + return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial() + .equals(Material.PLANT); }).fillRecursive(world, pos); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java b/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java index c6f0b403..c16ef5fa 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java @@ -29,14 +29,20 @@ public class ObsidianPillarBasementFeature extends DefaultFeature { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); + pos = getPosOnSurface( + world, + new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) + ); if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) { return false; } float height = MHelper.randRange(10F, 35F, random); float radius = MHelper.randRange(2F, 5F, random); - SDF pillar = new SDFCappedCone().setRadius1(radius).setRadius2(radius).setHeight(height * 0.5F).setBlock(Blocks.OBSIDIAN); + SDF pillar = new SDFCappedCone().setRadius1(radius) + .setRadius2(radius) + .setHeight(height * 0.5F) + .setBlock(Blocks.OBSIDIAN); pillar = new SDFTranslate().setTranslate(0, height * 0.5F - 3, 0).setSource(pillar); SDF cut = new SDFFlatland().setBlock(Blocks.OBSIDIAN); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); @@ -58,7 +64,8 @@ public class ObsidianPillarBasementFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT); + return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial() + .equals(Material.PLANT); }).fillRecursive(world, pos); return true; diff --git a/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java b/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java index c69bf173..35318b8a 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java @@ -30,8 +30,12 @@ public class SmaragdantCrystalFeature extends DefaultFeature { BlockState crystal = EndBlocks.SMARAGDANT_CRYSTAL.defaultBlockState(); BlockState shard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState(); for (int i = 0; i < count; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5)); - int dist = MHelper.floor(1.5F - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(3); + mut.set(pos) + .move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5)); + int dist = MHelper.floor(1.5F - MHelper.length( + mut.getX() - pos.getX(), + mut.getZ() - pos.getZ() + )) + random.nextInt(3); if (dist > 0) { BlockState state = world.getBlockState(mut); for (int n = 0; n < 10 && state.isAir(); n++) { @@ -44,7 +48,11 @@ public class SmaragdantCrystalFeature extends DefaultFeature { mut.setY(mut.getY() + 1); } boolean waterlogged = !world.getFluidState(mut).isEmpty(); - BlocksHelper.setWithoutUpdate(world, mut, shard.setValue(BlockStateProperties.WATERLOGGED, waterlogged)); + BlocksHelper.setWithoutUpdate( + world, + mut, + shard.setValue(BlockStateProperties.WATERLOGGED, waterlogged) + ); } } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java b/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java index 6751cb6c..fa487652 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java @@ -38,7 +38,9 @@ public class SpireFeature extends DefaultFeature { final WorldGenLevel world = featureConfig.level(); final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator(); pos = getPosOnSurfaceWG(world, pos); - if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN) || !world.getBlockState(pos.below(6)).is(TagAPI.GEN_TERRAIN)) { + if (pos.getY() < 10 || !world.getBlockState(pos.below(3)) + .is(TagAPI.GEN_TERRAIN) || !world.getBlockState(pos.below(6)) + .is(TagAPI.GEN_TERRAIN)) { return false; } @@ -50,7 +52,11 @@ public class SpireFeature extends DefaultFeature { } OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); sdf = new SDFDisplacement().setFunction((vec) -> { - return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); + return (float) (Math.abs(noise.eval( + vec.x() * 0.1, + vec.y() * 0.1, + vec.z() * 0.1 + )) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); }).setSource(sdf); final BlockPos center = pos; List support = Lists.newArrayList(); @@ -62,14 +68,18 @@ public class SpireFeature extends DefaultFeature { return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); } else if (info.getState(Direction.UP, 3).isAir()) { - return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getUnderMaterial(); + return world.getBiome(info.getPos()) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getUnderMaterial(); } return info.getState(); }).fillRecursive(world, center); support.forEach((bpos) -> { if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) { - EndFeatures.TENANEA_BUSH.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null)); + EndFeatures.TENANEA_BUSH.getFeature() + .place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null)); } }); @@ -78,7 +88,8 @@ public class SpireFeature extends DefaultFeature { protected SDF addSegment(SDF sdf, float radius, Random random) { SDF sphere = new SDFSphere().setRadius(radius).setBlock(Blocks.END_STONE); - SDF offseted = new SDFTranslate().setTranslate(0, radius + random.nextFloat() * 0.25F * radius, 0).setSource(sdf); + SDF offseted = new SDFTranslate().setTranslate(0, radius + random.nextFloat() * 0.25F * radius, 0) + .setSource(sdf); return new SDFSmoothUnion().setRadius(radius * 0.5F).setSourceA(sphere).setSourceB(offseted); } diff --git a/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java b/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java index 2ce040b0..de8ac175 100644 --- a/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java @@ -60,8 +60,13 @@ public class StalactiteFeature extends DefaultFeature { mut.setY(pos.getY() + i * dir); int size = stalagnate ? Mth.clamp((int) (Mth.abs(i - center) + 1), 1, 7) : height - i - 1; boolean waterlogged = !world.getFluidState(mut).isEmpty(); - BlockState base = block.defaultBlockState().setValue(StalactiteBlock.SIZE, size).setValue(BlockStateProperties.WATERLOGGED, waterlogged); - BlockState state = stalagnate ? base.setValue(StalactiteBlock.IS_FLOOR, dir > 0 ? i < center : i > center) : base.setValue(StalactiteBlock.IS_FLOOR, dir > 0); + BlockState base = block.defaultBlockState() + .setValue(StalactiteBlock.SIZE, size) + .setValue(BlockStateProperties.WATERLOGGED, waterlogged); + BlockState state = stalagnate ? base.setValue( + StalactiteBlock.IS_FLOOR, + dir > 0 ? i < center : i > center + ) : base.setValue(StalactiteBlock.IS_FLOOR, dir > 0); BlocksHelper.setWithoutUpdate(world, mut, state); } diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java index c19af4f2..de60314c 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java @@ -106,7 +106,11 @@ public class SulphuricCaveFeature extends DefaultFeature { else if (dist < r2 * r2) { state = world.getBlockState(mut); if (state.is(TagAPI.GEN_TERRAIN) || state.is(Blocks.AIR)) { - double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5; + double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval( + x * 0.03, + y * 0.03, + z * 0.03 + ) * 0.5; if (v > 0.4) { brimstone.add(mut.immutable()); } @@ -125,22 +129,35 @@ public class SulphuricCaveFeature extends DefaultFeature { if (random.nextInt(4) == 0) { int count = MHelper.randRange(5, 20, random); for (int i = 0; i < count; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 0, MHelper.floor(random.nextGaussian() * 2 + 0.5)); - int dist = MHelper.floor(3 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); + mut.set(pos) + .move(MHelper.floor(random.nextGaussian() * 2 + 0.5), + 0, + MHelper.floor(random.nextGaussian() * 2 + 0.5) + ); + int dist = MHelper.floor(3 - MHelper.length( + mut.getX() - pos.getX(), + mut.getZ() - pos.getZ() + )) + random.nextInt(2); if (dist > 0) { state = world.getBlockState(mut); while (!state.getFluidState().isEmpty() || state.getMaterial().equals(Material.WATER_PLANT)) { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { + if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()) + .is(EndBlocks.HYDROTHERMAL_VENT)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); MHelper.shuffle(HORIZONTAL, random); for (Direction dir : HORIZONTAL) { BlockPos p = mut.relative(dir); if (random.nextBoolean() && world.getBlockState(p).is(Blocks.WATER)) { - BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, dir)); + BlocksHelper.setWithoutUpdate( + world, + p, + EndBlocks.TUBE_WORM.defaultBlockState() + .setValue(HorizontalDirectionalBlock.FACING, dir) + ); } } mut.setY(mut.getY() + 1); @@ -150,7 +167,8 @@ public class SulphuricCaveFeature extends DefaultFeature { state = world.getBlockState(mut); while (state.is(Blocks.WATER)) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.VENT_BUBBLE_COLUMN.defaultBlockState()); - world.getBlockTicks().scheduleTick(mut, EndBlocks.VENT_BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); + world.getBlockTicks() + .scheduleTick(mut, EndBlocks.VENT_BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); } @@ -165,7 +183,11 @@ public class SulphuricCaveFeature extends DefaultFeature { } private boolean isReplaceable(BlockState state) { - return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state.is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES); + return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state + .is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial() + .equals(Material.PLANT) || state + .getMaterial() + .equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES); } private void placeBrimstone(WorldGenLevel world, BlockPos pos, Random random) { @@ -189,7 +211,10 @@ public class SulphuricCaveFeature extends DefaultFeature { for (Direction dir : BlocksHelper.DIRECTIONS) { BlockPos side; if (random.nextInt(16) == 0 && world.getBlockState((side = pos.relative(dir))).is(Blocks.WATER)) { - BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); + BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState() + .setValue(SulphurCrystalBlock.WATERLOGGED, true) + .setValue(SulphurCrystalBlock.FACING, dir) + .setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); BlocksHelper.setWithoutUpdate(world, side, state); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java index 244c0a4f..825cfcca 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java @@ -166,7 +166,11 @@ public class SulphuricLakeFeature extends DefaultFeature { private boolean isDeepWater(WorldGenLevel world, BlockPos pos) { int y = pos.getY() + 1; for (Direction dir : BlocksHelper.DIRECTIONS) { - if (getYOnSurface(world, pos.getX() + dir.getStepX(), pos.getZ() + dir.getStepZ()) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 2, pos.getZ() + dir.getStepZ() * 2) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 3, pos.getZ() + dir.getStepZ() * 3) < y) { + if (getYOnSurface(world, pos.getX() + dir.getStepX(), pos.getZ() + dir.getStepZ()) < y || getYOnSurface( + world, + pos.getX() + dir.getStepX() * 2, + pos.getZ() + dir.getStepZ() * 2 + ) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 3, pos.getZ() + dir.getStepZ() * 3) < y) { return false; } } @@ -194,7 +198,10 @@ public class SulphuricLakeFeature extends DefaultFeature { for (Direction dir : BlocksHelper.DIRECTIONS) { BlockPos side; if (random.nextInt(16) == 0 && world.getBlockState((side = pos.relative(dir))).is(Blocks.WATER)) { - BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); + BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState() + .setValue(SulphurCrystalBlock.WATERLOGGED, true) + .setValue(SulphurCrystalBlock.FACING, dir) + .setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); BlocksHelper.setWithoutUpdate(world, side, state); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java b/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java index 1b205a1c..b661750a 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java @@ -21,17 +21,25 @@ public class SurfaceVentFeature extends DefaultFeature { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); + pos = getPosOnSurface( + world, + new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) + ); if (!world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)) { return false; } MutableBlockPos mut = new MutableBlockPos(); int count = MHelper.randRange(15, 30, random); - BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.WATERLOGGED, false); + BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState() + .setValue(HydrothermalVentBlock.WATERLOGGED, false); for (int i = 0; i < count; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5)); - int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); + mut.set(pos) + .move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5)); + int dist = MHelper.floor(2 - MHelper.length( + mut.getX() - pos.getX(), + mut.getZ() - pos.getZ() + )) + random.nextInt(2); if (dist > 0) { BlockState state = world.getBlockState(mut); for (int n = 0; n < 10 && state.isAir(); n++) { diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java index 4c374b20..8d420424 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java @@ -74,7 +74,10 @@ public abstract class EndCaveFeature extends DefaultFeature { } } }); - BlockState surfaceBlock = biome.getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + BlockState surfaceBlock = biome.getBiome() + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); placeFloor(world, biome, floorPositions, random, surfaceBlock); placeCeil(world, biome, ceilPositions, random); placeWalls(world, biome, caveBlocks, random); @@ -126,7 +129,8 @@ public abstract class EndCaveFeature extends DefaultFeature { if (wallBlock != null) { for (Vec3i offset : SPHERE) { BlockPos wallPos = pos.offset(offset); - if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(TagAPI.GEN_TERRAIN)) { + if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos) + .is(TagAPI.GEN_TERRAIN)) { wallBlock = biome.getWall(wallPos); BlocksHelper.setWithoutUpdate(world, wallPos, wallBlock); placed.add(wallPos); @@ -256,6 +260,6 @@ public abstract class EndCaveFeature extends DefaultFeature { } } } - SPHERE = prePos.toArray(new Vec3i[]{}); + SPHERE = prePos.toArray(new Vec3i[] {}); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java index 502da6f9..94dead51 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java @@ -74,6 +74,9 @@ public class RoundCaveFeature extends EndCaveFeature { } private boolean isReplaceable(BlockState state) { - return state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.LEAVES); + return state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().isReplaceable() || state.getMaterial() + .equals(Material.PLANT) || state + .getMaterial() + .equals(Material.LEAVES); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java index 34cd0eb0..9f5a8222 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java @@ -74,7 +74,10 @@ public class TunelCaveFeature extends EndCaveFeature { break; } float val = Mth.abs((float) noiseH.eval(pos.getX() * 0.02, y * 0.01, pos.getZ() * 0.02)); - float vert = Mth.sin((y + (float) noiseV.eval(pos.getX() * 0.01, pos.getZ() * 0.01) * 20) * 0.1F) * 0.9F; + float vert = Mth.sin((y + (float) noiseV.eval( + pos.getX() * 0.01, + pos.getZ() * 0.01 + ) * 20) * 0.1F) * 0.9F; float dist = (float) noiseD.eval(pos.getX() * 0.1, y * 0.1, pos.getZ() * 0.1) * 0.12F; val = (val + vert * vert + dist) + density + gradient; if (val < 0.15 && world.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && noWaterNear(world, pos)) { @@ -163,7 +166,10 @@ public class TunelCaveFeature extends EndCaveFeature { } floorSets.forEach((biome, floorPositions) -> { - BlockState surfaceBlock = biome.getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + BlockState surfaceBlock = biome.getBiome() + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); placeFloor(world, biome, floorPositions, random, surfaceBlock); }); ceilSets.forEach((biome, ceilPositions) -> { @@ -215,7 +221,10 @@ public class TunelCaveFeature extends EndCaveFeature { } protected boolean hasCaves(WorldGenLevel world, BlockPos pos) { - return hasCavesInBiome(world, pos.offset(-8, 0, -8)) && hasCavesInBiome(world, pos.offset(8, 0, -8)) && hasCavesInBiome(world, pos.offset(-8, 0, 8)) && hasCavesInBiome(world, pos.offset(8, 0, 8)); + return hasCavesInBiome(world, pos.offset(-8, 0, -8)) && hasCavesInBiome( + world, + pos.offset(8, 0, -8) + ) && hasCavesInBiome(world, pos.offset(-8, 0, 8)) && hasCavesInBiome(world, pos.offset(8, 0, 8)); } protected boolean hasCavesInBiome(WorldGenLevel world, BlockPos pos) { diff --git a/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java index 87f64a6a..36e37c0e 100644 --- a/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java @@ -118,7 +118,9 @@ public class DragonTreeFeature extends DefaultFeature { } private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) { - SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.DRAGON_TREE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + SDF sphere = new SDFSphere().setRadius(radius) + .setBlock(EndBlocks.DRAGON_TREE_LEAVES.defaultBlockState() + .setValue(LeavesBlock.DISTANCE, 6)); SDF sub = new SDFScale().setScale(5).setSource(sphere); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); @@ -169,7 +171,11 @@ public class DragonTreeFeature extends DefaultFeature { if (radius > 5) { 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); + BlockPos p = pos.offset( + random.nextGaussian() * 1, + random.nextGaussian() * 1, + random.nextGaussian() * 1 + ); boolean place = true; for (Direction d : Direction.values()) { BlockState state = world.getBlockState(p.relative(d)); @@ -212,7 +218,13 @@ public class DragonTreeFeature extends DefaultFeature { return info.getState(); }; - BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.1F, 0.3F, 0), new Vector3f(0.4F, 0.6F, 0), new Vector3f(0.8F, 0.8F, 0), new Vector3f(1, 1, 0)); + BRANCH = Lists.newArrayList( + new Vector3f(0, 0, 0), + new Vector3f(0.1F, 0.3F, 0), + new Vector3f(0.4F, 0.6F, 0), + new Vector3f(0.8F, 0.8F, 0), + new Vector3f(1, 1, 0) + ); SIDE1 = Lists.newArrayList(new Vector3f(0.4F, 0.6F, 0), new Vector3f(0.8F, 0.8F, 0), new Vector3f(1, 1, 0)); SIDE2 = SplineHelper.copySpline(SIDE1); @@ -226,7 +238,13 @@ public class DragonTreeFeature extends DefaultFeature { SplineHelper.offset(SIDE1, offset2); SplineHelper.offset(SIDE2, offset2); - ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.7F, 0), new Vector3f(0.3F, 0.3F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.2F, 0)); + ROOT = Lists.newArrayList( + new Vector3f(0F, 1F, 0), + new Vector3f(0.1F, 0.7F, 0), + new Vector3f(0.3F, 0.3F, 0), + new Vector3f(0.7F, 0.05F, 0), + new Vector3f(0.8F, -0.2F, 0) + ); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); } } diff --git a/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java b/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java index 72b6145b..08afa8b6 100644 --- a/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java @@ -48,7 +48,12 @@ public class GiganticAmaranitaFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, pos, AIR); float radius = size * 0.17F;// MHelper.randRange(0.8F, 1.2F, random); - SDF function = SplineHelper.buildSDF(spline, radius, 0.2F, (bpos) -> EndBlocks.AMARANITA_STEM.defaultBlockState()); + SDF function = SplineHelper.buildSDF( + spline, + radius, + 0.2F, + (bpos) -> EndBlocks.AMARANITA_STEM.defaultBlockState() + ); 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)); @@ -96,7 +101,12 @@ public class GiganticAmaranitaFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_LANTERN); mut.move(Direction.DOWN); if (world.getBlockState(mut).getMaterial().isReplaceable()) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN)); + BlocksHelper.setWithoutUpdate( + world, + mut, + EndBlocks.AMARANITA_FUR.defaultBlockState() + .setValue(BaseAttachedBlock.FACING, Direction.DOWN) + ); } } } @@ -159,13 +169,25 @@ public class GiganticAmaranitaFeature extends DefaultFeature { int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1; BlockPos offseted = mut.relative(axis, distance); if (world.getBlockState(offseted).getMaterial().isReplaceable()) { - Direction dir = Direction.fromAxisAndDirection(axis, distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE); - BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)); + Direction dir = Direction.fromAxisAndDirection( + axis, + distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE + ); + BlocksHelper.setWithoutUpdate( + world, + offseted, + EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir) + ); } mut.move(Direction.DOWN); } if (world.getBlockState(mut).getMaterial().isReplaceable()) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN)); + BlocksHelper.setWithoutUpdate( + world, + mut, + EndBlocks.AMARANITA_FUR.defaultBlockState() + .setValue(BaseAttachedBlock.FACING, Direction.DOWN) + ); } } } @@ -252,7 +274,10 @@ public class GiganticAmaranitaFeature extends DefaultFeature { } for (int i = 0; i < 4; i++) { - mut.set(pos).move(Direction.UP).move(BlocksHelper.HORIZONTAL[i], 3).move(BlocksHelper.HORIZONTAL[(i + 1) & 3], 3); + mut.set(pos) + .move(Direction.UP) + .move(BlocksHelper.HORIZONTAL[i], 3) + .move(BlocksHelper.HORIZONTAL[(i + 1) & 3], 3); if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); } @@ -270,13 +295,25 @@ public class GiganticAmaranitaFeature extends DefaultFeature { int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1; BlockPos offseted = mut.relative(axis, distance); if (world.getBlockState(offseted).getMaterial().isReplaceable()) { - Direction dir = Direction.fromAxisAndDirection(axis, distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE); - BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)); + Direction dir = Direction.fromAxisAndDirection( + axis, + distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE + ); + BlocksHelper.setWithoutUpdate( + world, + offseted, + EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir) + ); } mut.move(Direction.DOWN); } if (world.getBlockState(mut).getMaterial().isReplaceable()) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN)); + BlocksHelper.setWithoutUpdate( + world, + mut, + EndBlocks.AMARANITA_FUR.defaultBlockState() + .setValue(BaseAttachedBlock.FACING, Direction.DOWN) + ); } } } @@ -303,12 +340,16 @@ public class GiganticAmaranitaFeature extends DefaultFeature { for (int z = -2; z < 3; z++) { mut.setZ(pos.getZ() + z); if (y < 6) { - if (((x / 2) == 0 || (z / 2) == 0) && world.getBlockState(mut).getMaterial().isReplaceable()) { + if (((x / 2) == 0 || (z / 2) == 0) && world.getBlockState(mut) + .getMaterial() + .isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP); } } else { - if ((x == 0 || z == 0) && (Math.abs(x) < 2 && Math.abs(z) < 2) && world.getBlockState(mut).getMaterial().isReplaceable()) { + if ((x == 0 || z == 0) && (Math.abs(x) < 2 && Math.abs(z) < 2) && world.getBlockState(mut) + .getMaterial() + .isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP); } } diff --git a/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java index 8976ec1c..3e6d04ee 100644 --- a/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java @@ -82,9 +82,15 @@ public class HelixTreeFeature extends DefaultFeature { }); SplineHelper.scale(spline2, scale); BlockPos leafStart = pos.offset(lastPoint.x() + 0.5, lastPoint.y() + 0.5, lastPoint.z() + 0.5); - SplineHelper.fillSplineForce(spline2, world, EndBlocks.HELIX_TREE.log.defaultBlockState(), leafStart, (state) -> { - return state.getMaterial().isReplaceable(); - }); + SplineHelper.fillSplineForce( + spline2, + world, + EndBlocks.HELIX_TREE.log.defaultBlockState(), + leafStart, + (state) -> { + return state.getMaterial().isReplaceable(); + } + ); spline.clear(); float rad = MHelper.randRange(8F, 11F, random); diff --git a/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java b/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java index e47891c5..703475d4 100644 --- a/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java @@ -113,7 +113,12 @@ public class JellyshroomFeature extends DefaultFeature { } static { - ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + ROOT = Lists.newArrayList( + new Vector3f(0.1F, 0.70F, 0), + new Vector3f(0.3F, 0.30F, 0), + new Vector3f(0.7F, 0.05F, 0), + new Vector3f(0.8F, -0.20F, 0) + ); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); REPLACE = (state) -> { diff --git a/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java b/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java index 4c986fc1..5df25849 100644 --- a/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java @@ -92,8 +92,13 @@ public class LacugroveFeature extends DefaultFeature { for (int y = top; y >= minY; y--) { mut.setY(y); BlockState state = world.getBlockState(mut); - if (state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.is(TagAPI.END_GROUND)) { - BlocksHelper.setWithoutUpdate(world, mut, y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log); + if (state.getMaterial().isReplaceable() || state.getMaterial() + .equals(Material.PLANT) || state.is(TagAPI.END_GROUND)) { + BlocksHelper.setWithoutUpdate( + world, + mut, + y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log + ); } else { break; @@ -108,14 +113,17 @@ public class LacugroveFeature extends DefaultFeature { } private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) { - SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.LACUGROVE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + 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 SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere) + .setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere)); MutableBlockPos mut = new MutableBlockPos(); sphere.addPostProcess((info) -> { if (random.nextInt(5) == 0) { @@ -156,7 +164,11 @@ public class LacugroveFeature extends DefaultFeature { if (radius > 5) { 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); + BlockPos p = pos.offset( + random.nextGaussian() * 1, + random.nextGaussian() * 1, + random.nextGaussian() * 1 + ); boolean place = true; for (Direction d : Direction.values()) { BlockState state = world.getBlockState(p.relative(d)); diff --git a/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java b/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java index 3a5fe576..010157c5 100644 --- a/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java @@ -71,12 +71,18 @@ public class LucerniaFeature extends DefaultFeature { } private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise, boolean natural) { - SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.LUCERNIA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + SDF sphere = new SDFSphere().setRadius(radius) + .setBlock(EndBlocks.LUCERNIA_LEAVES.defaultBlockState() + .setValue(LeavesBlock.DISTANCE, 6)); SDF sub = new SDFScale().setScale(5).setSource(sphere); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere); + sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval( + vec.x() * 0.2, + vec.y() * 0.2, + vec.z() * 0.2 + ) * 2F).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere); MutableBlockPos mut = new MutableBlockPos(); @@ -90,8 +96,10 @@ public class LucerniaFeature extends DefaultFeature { } BlockState top = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); - BlockState middle = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); - BlockState bottom = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); + BlockState middle = EndBlocks.FILALUX.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); + BlockState bottom = EndBlocks.FILALUX.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); BlockState outer = EndBlocks.LUCERNIA_OUTER_LEAVES.defaultBlockState(); List support = Lists.newArrayList(); @@ -200,9 +208,21 @@ public class LucerniaFeature extends DefaultFeature { IGNORE = EndBlocks.LUCERNIA::isTreeLog; - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); + SPLINE = Lists.newArrayList( + new Vector3f(0.00F, 0.00F, 0.00F), + new Vector3f(0.10F, 0.35F, 0.00F), + new Vector3f(0.20F, 0.50F, 0.00F), + new Vector3f(0.30F, 0.55F, 0.00F), + new Vector3f(0.42F, 0.70F, 0.00F), + new Vector3f(0.50F, 1.00F, 0.00F) + ); - ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + ROOT = Lists.newArrayList( + new Vector3f(0.1F, 0.70F, 0), + new Vector3f(0.3F, 0.30F, 0), + new Vector3f(0.7F, 0.05F, 0), + new Vector3f(0.8F, -0.20F, 0) + ); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); } } diff --git a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java index bddf9706..05cfcd87 100644 --- a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java @@ -83,17 +83,20 @@ public class MossyGlowshroomFeature extends DefaultFeature { new SDFScale().setScale(scale).setSource(FUNCTION).setReplaceFunction(REPLACE).addPostProcess((info) -> { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState() + .setValue(MossyGlowshroomCapBlock.TRANSITION, true)); return info.getState(); } - else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { + else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog( + info.getStateDown())) { info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState()); return info.getState(); } } else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState() + .setValue(MossyGlowshroomCapBlock.TRANSITION, true)); return info.getState(); } @@ -103,12 +106,18 @@ public class MossyGlowshroomFeature extends DefaultFeature { else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { for (Direction dir : BlocksHelper.HORIZONTAL) { if (info.getState(dir) == AIR) { - info.setBlockPos(info.getPos().relative(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)); + info.setBlockPos( + info.getPos().relative(dir), + EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir) + ); } } if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN)); + info.setBlockPos( + info.getPos().below(), + EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN) + ); } } return info.getState(); @@ -121,7 +130,8 @@ public class MossyGlowshroomFeature extends DefaultFeature { SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F); SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F); SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2); - SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2)); + SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0) + .setSource(new SDFScale().setScale(2).setSource(cone2)); SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3); SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone); SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave); @@ -143,18 +153,23 @@ public class MossyGlowshroomFeature extends DefaultFeature { OpenSimplexNoise noise = new OpenSimplexNoise(1234); cones = new SDFCoordModify().setFunction((pos) -> { float dist = MHelper.length(pos.x(), pos.z()); - float y = pos.y() + (float) noise.eval(pos.x() * 0.1 + CENTER.x(), pos.z() * 0.1 + CENTER.z()) * dist * 0.3F - dist * 0.15F; + float y = pos.y() + (float) noise.eval( + pos.x() * 0.1 + CENTER.x(), + pos.z() * 0.1 + CENTER.z() + ) * dist * 0.3F - dist * 0.15F; pos.set(pos.x(), y, pos.z()); }).setSource(cones); - HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0).setSource(cones)); + HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0) + .setSource(cones)); SDF roots = new SDFSphere().setRadius(4F); ROOTS = (SDFPrimitive) roots; roots = new SDFScale3D().setScale(1, 0.7F, 1).setSource(roots); ROOTS_ROT = (SDFFlatWave) new SDFFlatWave().setRaysCount(5).setIntensity(1.5F).setSource(roots); - FUNCTION = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT)); + FUNCTION = new SDFSmoothUnion().setRadius(4) + .setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT)); REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { diff --git a/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java index f56aced9..8b36632a 100644 --- a/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java @@ -51,7 +51,17 @@ public class PythadendronTreeFeature extends DefaultFeature { int depth = MHelper.floor((size - 10F) * 3F / 10F + 1F); float bsize = (10F - (size - 10F)) / 10F + 1.5F; - branch(last.x(), last.y(), last.z(), size * bsize, MHelper.randRange(0, MHelper.PI2, random), random, depth, world, pos); + branch( + last.x(), + last.y(), + last.z(), + size * bsize, + MHelper.randRange(0, MHelper.PI2, random), + random, + depth, + world, + pos + ); SDF function = SplineHelper.buildSDF(spline, 1.7F, 1.1F, (bpos) -> { return EndBlocks.PYTHADENDRON.bark.defaultBlockState(); @@ -79,14 +89,26 @@ public class PythadendronTreeFeature extends DefaultFeature { SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F); Vector3f pos1 = spline.get(spline.size() - 1); - boolean s1 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, REPLACE); + boolean s1 = SplineHelper.fillSpline( + spline, + world, + EndBlocks.PYTHADENDRON.bark.defaultBlockState(), + pos, + REPLACE + ); spline = SplineHelper.makeSpline(x, y, z, x2, y, z2, 5); SplineHelper.powerOffset(spline, size * MHelper.randRange(1.0F, 2.0F, random), 4); SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F); Vector3f pos2 = spline.get(spline.size() - 1); - boolean s2 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, REPLACE); + boolean s2 = SplineHelper.fillSpline( + spline, + world, + EndBlocks.PYTHADENDRON.bark.defaultBlockState(), + pos, + REPLACE + ); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); if (depth < 3) { @@ -114,7 +136,9 @@ public class PythadendronTreeFeature extends DefaultFeature { private void leavesBall(WorldGenLevel world, BlockPos pos, Random random, OpenSimplexNoise noise) { float radius = MHelper.randRange(4.5F, 6.5F, random); - SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.PYTHADENDRON_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + SDF sphere = new SDFSphere().setRadius(radius) + .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; @@ -122,7 +146,8 @@ public class PythadendronTreeFeature extends DefaultFeature { sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere) + .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); MutableBlockPos mut = new MutableBlockPos(); sphere.addPostProcess((info) -> { if (random.nextInt(5) == 0) { diff --git a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java index 0aac6a7b..085e9f6e 100644 --- a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java @@ -67,12 +67,18 @@ public class TenaneaFeature extends DefaultFeature { } private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) { - SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.TENANEA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + SDF sphere = new SDFSphere().setRadius(radius) + .setBlock(EndBlocks.TENANEA_LEAVES.defaultBlockState() + .setValue(LeavesBlock.DISTANCE, 6)); SDF sub = new SDFScale().setScale(5).setSource(sphere); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere); + sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval( + vec.x() * 0.2, + vec.y() * 0.2, + vec.z() * 0.2 + ) * 2F).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere); MutableBlockPos mut = new MutableBlockPos(); @@ -85,9 +91,12 @@ public class TenaneaFeature extends DefaultFeature { } } - BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); - BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); - BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); + BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); + BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); + BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState() + .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); BlockState outer = EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState(); List support = Lists.newArrayList(); @@ -180,6 +189,13 @@ public class TenaneaFeature extends DefaultFeature { IGNORE = EndBlocks.TENANEA::isTreeLog; - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); + SPLINE = Lists.newArrayList( + new Vector3f(0.00F, 0.00F, 0.00F), + new Vector3f(0.10F, 0.35F, 0.00F), + new Vector3f(0.20F, 0.50F, 0.00F), + new Vector3f(0.30F, 0.55F, 0.00F), + new Vector3f(0.42F, 0.70F, 0.00F), + new Vector3f(0.50F, 1.00F, 0.00F) + ); } } diff --git a/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java index e520e0b7..8430d0a0 100644 --- a/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java @@ -47,9 +47,12 @@ public class UmbrellaTreeFeature extends DefaultFeature { if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; BlockState wood = EndBlocks.UMBRELLA_TREE.bark.defaultBlockState(); - BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState().setValue(UmbrellaTreeMembraneBlock.COLOR, 1); - BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState().setValue(UmbrellaTreeMembraneBlock.COLOR, 0); - BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState().setValue(UmbrellaTreeClusterBlock.NATURAL, true); + BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState() + .setValue(UmbrellaTreeMembraneBlock.COLOR, 1); + BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState() + .setValue(UmbrellaTreeMembraneBlock.COLOR, 0); + BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState() + .setValue(UmbrellaTreeClusterBlock.NATURAL, true); float size = MHelper.randRange(10, 20, random); int count = (int) (size * 0.15F); @@ -89,7 +92,12 @@ public class UmbrellaTreeFeature extends DefaultFeature { float pz = MHelper.floor(vec.z()) + 0.5F; mem = new SDFTranslate().setTranslate(px, py, pz).setSource(mem); sdf = new SDFSmoothUnion().setRadius(2).setSourceA(sdf).setSourceB(mem); - centers.add(new Center(pos.getX() + (double) (px * scale), pos.getY() + (double) (py * scale), pos.getZ() + (double) (pz * scale), radius * scale)); + centers.add(new Center( + pos.getX() + (double) (px * scale), + pos.getY() + (double) (py * scale), + pos.getZ() + (double) (pz * scale), + radius * scale + )); vec = spline.get(0); } @@ -194,13 +202,26 @@ public class UmbrellaTreeFeature extends DefaultFeature { } static { - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); + SPLINE = Lists.newArrayList( + new Vector3f(0.00F, 0.00F, 0.00F), + new Vector3f(0.10F, 0.35F, 0.00F), + new Vector3f(0.20F, 0.50F, 0.00F), + new Vector3f(0.30F, 0.55F, 0.00F), + new Vector3f(0.42F, 0.70F, 0.00F), + new Vector3f(0.50F, 1.00F, 0.00F) + ); - ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + ROOT = Lists.newArrayList( + new Vector3f(0.1F, 0.70F, 0), + new Vector3f(0.3F, 0.30F, 0), + new Vector3f(0.7F, 0.05F, 0), + new Vector3f(0.8F, -0.20F, 0) + ); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); REPLACE = (state) -> { - if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) { + if (state.is(TagAPI.END_GROUND) || state.getMaterial() + .equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) { return true; } return state.getMaterial().isReplaceable(); diff --git a/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java b/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java index 20c971b4..816b5877 100644 --- a/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java +++ b/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java @@ -105,13 +105,20 @@ public class BetterEndBiomeSource extends BiomeSource { } } else { - float height = TheEndBiomeSource.getHeightValue(noise, (biomeX >> 1) + 1, (biomeZ >> 1) + 1) + (float) SMALL_NOISE.eval(biomeX, biomeZ) * 5; + float height = TheEndBiomeSource.getHeightValue( + noise, + (biomeX >> 1) + 1, + (biomeZ >> 1) + 1 + ) + (float) SMALL_NOISE.eval(biomeX, biomeZ) * 5; if (height > -20F && height < -5F) { return barrens; } - endBiome = height < -10F ? mapVoid.getBiome(biomeX << 2, biomeZ << 2) : mapLand.getBiome(biomeX << 2, biomeZ << 2); + endBiome = height < -10F ? mapVoid.getBiome(biomeX << 2, biomeZ << 2) : mapLand.getBiome( + biomeX << 2, + biomeZ << 2 + ); } return BiomeAPI.getActualBiome(endBiome); diff --git a/src/main/java/ru/betterend/world/generator/GeneratorOptions.java b/src/main/java/ru/betterend/world/generator/GeneratorOptions.java index 4a9fb012..d79793a9 100644 --- a/src/main/java/ru/betterend/world/generator/GeneratorOptions.java +++ b/src/main/java/ru/betterend/world/generator/GeneratorOptions.java @@ -40,17 +40,49 @@ public class GeneratorOptions { hasDragonFights = Configs.GENERATOR_CONFIG.getBooleanRoot("hasDragonFights", true); swapOverworldToEnd = Configs.GENERATOR_CONFIG.getBooleanRoot("swapOverworldToEnd", false); changeChorusPlant = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "changeChorusPlant", true); - removeChorusFromVanillaBiomes = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "removeChorusFromVanillaBiomes", true); + removeChorusFromVanillaBiomes = Configs.GENERATOR_CONFIG.getBoolean( + "chorusPlant", + "removeChorusFromVanillaBiomes", + true + ); newGenerator = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "useNewGenerator", true); noRingVoid = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "noRingVoid", false); generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", true); endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5); generateObsidianPlatform = Configs.GENERATOR_CONFIG.getBooleanRoot("generateObsidianPlatform", true); - bigOptions = new LayerOptions("customGenerator.layers.bigIslands", Configs.GENERATOR_CONFIG, 300, 200, 70, 10, false); - mediumOptions = new LayerOptions("customGenerator.layers.mediumIslands", Configs.GENERATOR_CONFIG, 150, 100, 70, 20, true); - smallOptions = new LayerOptions("customGenerator.layers.smallIslands", Configs.GENERATOR_CONFIG, 60, 50, 70, 30, false); + bigOptions = new LayerOptions( + "customGenerator.layers.bigIslands", + Configs.GENERATOR_CONFIG, + 300, + 200, + 70, + 10, + false + ); + mediumOptions = new LayerOptions( + "customGenerator.layers.mediumIslands", + Configs.GENERATOR_CONFIG, + 150, + 100, + 70, + 20, + true + ); + smallOptions = new LayerOptions( + "customGenerator.layers.smallIslands", + Configs.GENERATOR_CONFIG, + 60, + 50, + 70, + 30, + false + ); changeSpawn = Configs.GENERATOR_CONFIG.getBoolean("spawn", "changeSpawn", false); - spawn = new BlockPos(Configs.GENERATOR_CONFIG.getInt("spawn.point", "x", 20), Configs.GENERATOR_CONFIG.getInt("spawn.point", "y", 65), Configs.GENERATOR_CONFIG.getInt("spawn.point", "z", 0)); + spawn = new BlockPos( + Configs.GENERATOR_CONFIG.getInt("spawn.point", "x", 20), + Configs.GENERATOR_CONFIG.getInt("spawn.point", "y", 65), + Configs.GENERATOR_CONFIG.getInt("spawn.point", "z", 0) + ); replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true); replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true); int circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000); diff --git a/src/main/java/ru/betterend/world/generator/IslandLayer.java b/src/main/java/ru/betterend/world/generator/IslandLayer.java index 800eba1f..0eb33a7e 100644 --- a/src/main/java/ru/betterend/world/generator/IslandLayer.java +++ b/src/main/java/ru/betterend/world/generator/IslandLayer.java @@ -41,7 +41,10 @@ public class IslandLayer { SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2); SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4); - noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed).setRadius(0.5F).setIntensity(0.2F).setSource(coneTop); + noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed) + .setRadius(0.5F) + .setIntensity(0.2F) + .setSource(coneTop); island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom); } @@ -78,7 +81,8 @@ public class IslandLayer { } } - if (GeneratorOptions.hasCentralIsland() && Math.abs(ix) < GeneratorOptions.getIslandDistChunk() && Math.abs(iz) < GeneratorOptions.getIslandDistChunk()) { + if (GeneratorOptions.hasCentralIsland() && Math.abs(ix) < GeneratorOptions.getIslandDistChunk() && Math.abs(iz) < GeneratorOptions + .getIslandDistChunk()) { int count = positions.size(); for (int n = 0; n < count; n++) { BlockPos pos = positions.get(n); diff --git a/src/main/java/ru/betterend/world/generator/TerrainGenerator.java b/src/main/java/ru/betterend/world/generator/TerrainGenerator.java index 499d7511..908455ab 100644 --- a/src/main/java/ru/betterend/world/generator/TerrainGenerator.java +++ b/src/main/java/ru/betterend/world/generator/TerrainGenerator.java @@ -46,8 +46,14 @@ public class TerrainGenerator { mediumIslands.clearCache(); smallIslands.clearCache(); - double distortion1 = noise1.eval(x * 0.1, z * 0.1) * 20 + noise2.eval(x * 0.2, z * 0.2) * 10 + noise1.eval(x * 0.4, z * 0.4) * 5; - double distortion2 = noise2.eval(x * 0.1, z * 0.1) * 20 + noise1.eval(x * 0.2, z * 0.2) * 10 + noise2.eval(x * 0.4, z * 0.4) * 5; + double distortion1 = noise1.eval(x * 0.1, z * 0.1) * 20 + noise2.eval( + x * 0.2, + z * 0.2 + ) * 10 + noise1.eval(x * 0.4, z * 0.4) * 5; + double distortion2 = noise2.eval(x * 0.1, z * 0.1) * 20 + noise1.eval( + x * 0.2, + z * 0.2 + ) * 10 + noise2.eval(x * 0.4, z * 0.4) * 5; double px = (double) x * SCALE_XZ + distortion1; double pz = (double) z * SCALE_XZ + distortion2; @@ -123,8 +129,14 @@ public class TerrainGenerator { double px = (x >> 1) + 0.5; double pz = (z >> 1) + 0.5; - double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(px * 0.4, pz * 0.4) * 5; - double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(px * 0.4, pz * 0.4) * 5; + double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval( + px * 0.4, + pz * 0.4 + ) * 5; + double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval( + px * 0.4, + pz * 0.4 + ) * 5; px = px * SCALE_XZ + distortion1; pz = pz * SCALE_XZ + distortion2; @@ -167,8 +179,14 @@ public class TerrainGenerator { double px = (double) x / 8.0; double pz = (double) z / 8.0; - double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(px * 0.4, pz * 0.4) * 5; - double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(px * 0.4, pz * 0.4) * 5; + double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval( + px * 0.4, + pz * 0.4 + ) * 5; + double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval( + px * 0.4, + pz * 0.4 + ) * 5; px = (double) x * SCALE_XZ + distortion1; pz = (double) z * SCALE_XZ + distortion2; @@ -210,7 +228,7 @@ public class TerrainGenerator { } } } - OFFS = pos.toArray(new Point[]{}); + OFFS = pos.toArray(new Point[] {}); COEF = new float[coef.size()]; for (int i = 0; i < COEF.length; i++) { COEF[i] = coef.get(i) / sum; diff --git a/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java b/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java index 65c4f8ed..4b9d0735 100644 --- a/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java @@ -16,7 +16,6 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf import net.minecraft.world.level.levelgen.structure.StructureStart; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; -import ru.bclib.util.MHelper; import ru.bclib.util.StructureHelper; import ru.betterend.BetterEnd; import ru.betterend.world.structures.piece.NBTPiece; @@ -32,10 +31,25 @@ public class EternalPortalStructure extends FeatureBaseStructure { if (x + z < 1024L) { return false; } - if (chunkGenerator.getBaseHeight(pos.getBlockX(8), pos.getBlockX(8), Heightmap.Types.WORLD_SURFACE_WG, levelHeightAccessor) < 5) { + if (chunkGenerator.getBaseHeight( + pos.getBlockX(8), + pos.getBlockX(8), + Heightmap.Types.WORLD_SURFACE_WG, + levelHeightAccessor + ) < 5) { return false; } - return super.isFeatureChunk(chunkGenerator, biomeSource, worldSeed, chunkRandom, pos, biome, chunkPos, featureConfig, levelHeightAccessor); + return super.isFeatureChunk( + chunkGenerator, + biomeSource, + worldSeed, + chunkRandom, + pos, + biome, + chunkPos, + featureConfig, + levelHeightAccessor + ); } @Override @@ -53,7 +67,14 @@ public class EternalPortalStructure extends FeatureBaseStructure { int x = chunkPos.getBlockX(8); int z = chunkPos.getBlockZ(8); int y = chunkGenerator.getBaseHeight(x, z, Types.WORLD_SURFACE_WG, levelHeightAccessor); - this.pieces.add(new NBTPiece(STRUCTURE_ID, STRUCTURE, new BlockPos(x, y - 4, z), random.nextInt(5), true, random)); + this.pieces.add(new NBTPiece( + STRUCTURE_ID, + STRUCTURE, + new BlockPos(x, y - 4, z), + random.nextInt(5), + true, + random + )); } } } diff --git a/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java b/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java index 1ac7ad59..ff3b5ad5 100644 --- a/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java @@ -48,7 +48,12 @@ public abstract class FeatureBaseStructure extends StructureFeature points = getFibonacciPoints(count); SDF sdf = null; - SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW); + SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F) + .setRadius2(0) + .setHeight(size) + .setBlock(EndBlocks.DENSE_SNOW); spike = new SDFTranslate().setTranslate(0, size - 0.5F, 0).setSource(spike); for (Vector3f point : points) { SDF rotated = spike; @@ -69,7 +72,11 @@ public class GiantIceStarStructure extends SDFStructureFeature { float px = bpos.getX() - center.getX(); float py = bpos.getY() - center.getY(); float pz = bpos.getZ() - center.getZ(); - float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(px, py, pz) * 0.4F + random.nextFloat() * randScale; + float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance( + px, + py, + pz + ) * 0.4F + random.nextFloat() * randScale; if (distance < ancientRadius) { return ancient; } diff --git a/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java b/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java index 50726751..0720b74b 100644 --- a/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java @@ -34,7 +34,8 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature { SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F); SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F); SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2); - SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2)); + SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0) + .setSource(new SDFScale().setScale(2).setSource(cone2)); SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3); SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone); SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave); @@ -53,18 +54,23 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature { OpenSimplexNoise noise = new OpenSimplexNoise(1234); cones = new SDFCoordModify().setFunction((pos) -> { float dist = MHelper.length(pos.x(), pos.z()); - float y = pos.y() + (float) noise.eval(pos.x() * 0.1 + center.getX(), pos.z() * 0.1 + center.getZ()) * dist * 0.3F - dist * 0.15F; + float y = pos.y() + (float) noise.eval( + pos.x() * 0.1 + center.getX(), + pos.z() * 0.1 + center.getZ() + ) * dist * 0.3F - dist * 0.15F; pos.set(pos.x(), y, pos.z()); }).setSource(cones); - SDFTranslate HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0).setSource(cones)); + SDFTranslate HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0) + .setSource(cones)); SDF roots = new SDFSphere().setRadius(4F); SDFPrimitive primRoots = (SDFPrimitive) roots; roots = new SDFScale3D().setScale(1, 0.7F, 1).setSource(roots); SDFFlatWave rotRoots = (SDFFlatWave) new SDFFlatWave().setRaysCount(5).setIntensity(1.5F).setSource(roots); - SDFBinary function = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(rotRoots)); + SDFBinary function = new SDFSmoothUnion().setRadius(4) + .setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(rotRoots)); cone1.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP); cone2.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP); @@ -85,38 +91,58 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature { rotRoots.setAngle(random.nextFloat() * MHelper.PI2); function.setSourceA(sdf); - return new SDFRound().setRadius(1.5F).setSource(new SDFScale().setScale(scale).setSource(function)).addPostProcess((info) -> { - if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { - if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); - return info.getState(); - } - else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState()); - return info.getState(); - } - } - else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { - if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); - return info.getState(); - } + return new SDFRound().setRadius(1.5F) + .setSource(new SDFScale().setScale(scale).setSource(function)) + .addPostProcess((info) -> { + if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { + if (random.nextBoolean() && info.getStateUp() + .getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState() + .setValue( + MossyGlowshroomCapBlock.TRANSITION, + true + )); + return info.getState(); + } + else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM + .isTreeLog(info.getStateDown())) { + info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState()); + return info.getState(); + } + } + else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { + if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState() + .setValue( + MossyGlowshroomCapBlock.TRANSITION, + true + )); + return info.getState(); + } - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()); - return info.getState(); - } - else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - for (Direction dir : BlocksHelper.HORIZONTAL) { - if (info.getState(dir) == AIR) { - info.setBlockPos(info.getPos().relative(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)); - } - } + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()); + return info.getState(); + } + else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { + for (Direction dir : BlocksHelper.HORIZONTAL) { + if (info.getState(dir) == AIR) { + info.setBlockPos( + info.getPos().relative(dir), + EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState() + .setValue(FurBlock.FACING, dir) + ); + } + } - if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN)); - } - } - return info.getState(); - }); + if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { + info.setBlockPos( + info.getPos().below(), + EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState() + .setValue(FurBlock.FACING, Direction.DOWN) + ); + } + } + return info.getState(); + }); } } diff --git a/src/main/java/ru/betterend/world/structures/features/MountainStructure.java b/src/main/java/ru/betterend/world/structures/features/MountainStructure.java index 44c8eaf3..8f61a6f9 100644 --- a/src/main/java/ru/betterend/world/structures/features/MountainStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/MountainStructure.java @@ -33,7 +33,13 @@ public class MountainStructure extends FeatureBaseStructure { if (y > 5) { float radius = MHelper.randRange(50, 100, random); float height = radius * MHelper.randRange(0.8F, 1.2F, random); - CrystalMountainPiece piece = new CrystalMountainPiece(new BlockPos(x, y, z), radius, height, random, biome); + CrystalMountainPiece piece = new CrystalMountainPiece( + new BlockPos(x, y, z), + radius, + height, + random, + biome + ); this.pieces.add(piece); } diff --git a/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java b/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java index ab8144d5..d67faea4 100644 --- a/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java @@ -51,6 +51,10 @@ public class PaintedMountainStructure extends FeatureBaseStructure { } static { - VARIANTS = new BlockState[]{Blocks.END_STONE.defaultBlockState(), EndBlocks.FLAVOLITE.stone.defaultBlockState(), EndBlocks.VIOLECITE.stone.defaultBlockState(),}; + VARIANTS = new BlockState[] { + Blocks.END_STONE.defaultBlockState(), + EndBlocks.FLAVOLITE.stone.defaultBlockState(), + EndBlocks.VIOLECITE.stone.defaultBlockState(), + }; } } diff --git a/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java index 6708c172..4326ec5c 100644 --- a/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java @@ -68,7 +68,8 @@ public class CrystalMountainPiece extends MountainPiece { continue; } pos.setY(minY); - while (!chunk.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(pos.below()).is(Blocks.CAVE_AIR)) { + while (!chunk.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState( + pos.below()).is(Blocks.CAVE_AIR)) { pos.setY(pos.getY() - 1); } minY = pos.getY(); @@ -81,10 +82,18 @@ public class CrystalMountainPiece extends MountainPiece { maxY += center.getY(); int maxYI = (int) (maxY); int cover = maxYI - 1; - boolean needCover = (noise1.eval(px * 0.1, pz * 0.1) + MHelper.randRange(-0.4, 0.4, random) - (center.getY() + 14) * 0.1) > 0; + boolean needCover = (noise1.eval(px * 0.1, pz * 0.1) + MHelper.randRange( + -0.4, + 0.4, + random + ) - (center.getY() + 14) * 0.1) > 0; for (int y = minY - 1; y < maxYI; y++) { pos.setY(y); - chunk.setBlockState(pos, needCover && y == cover ? top : Blocks.END_STONE.defaultBlockState(), false); + chunk.setBlockState( + pos, + needCover && y == cover ? top : Blocks.END_STONE.defaultBlockState(), + false + ); } } } diff --git a/src/main/java/ru/betterend/world/structures/piece/LakePiece.java b/src/main/java/ru/betterend/world/structures/piece/LakePiece.java index 510a976d..daf70cb6 100644 --- a/src/main/java/ru/betterend/world/structures/piece/LakePiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/LakePiece.java @@ -125,13 +125,20 @@ public class LakePiece extends BasePiece { else if (dist <= r3 && mut.getY() < center.getY()) { BlockState state = chunk.getBlockState(mut); BlockPos worldPos = mut.offset(sx, 0, sz); - if (!state.isCollisionShapeFullBlock(world, worldPos) && !state.isRedstoneConductor(world, worldPos)) { + if (!state.isCollisionShapeFullBlock(world, worldPos) && !state.isRedstoneConductor( + world, + worldPos + )) { state = chunk.getBlockState(mut.above()); if (state.isAir()) { - state = random.nextBoolean() ? ENDSTONE : world.getBiome(worldPos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + state = random.nextBoolean() ? ENDSTONE : world.getBiome(worldPos) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); } else { - state = state.getFluidState().isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState(); + state = state.getFluidState() + .isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState(); } chunk.setBlockState(mut, state, false); } @@ -160,10 +167,14 @@ public class LakePiece extends BasePiece { BlockState bState = chunk.getBlockState(mut); if (bState.isAir()) { - bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz)).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz)) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); } else { - bState = bState.getFluidState().isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState(); + bState = bState.getFluidState() + .isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState(); } mut.setY(y); @@ -178,10 +189,14 @@ public class LakePiece extends BasePiece { mut.setY(y + 1); BlockState bState = chunk.getBlockState(mut); if (bState.isAir()) { - bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz)).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz)) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); } else { - bState = bState.getFluidState().isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState(); + bState = bState.getFluidState() + .isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState(); } mut.setY(y); makeEndstonePillar(chunk, mut, bState); diff --git a/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java index e1b7e8d0..7d95ab4b 100644 --- a/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java @@ -93,7 +93,10 @@ public abstract class MountainPiece extends BasePiece { return h; } - h = MHelper.floor(noise2.eval(pos.getX() * 0.01, pos.getZ() * 0.01) * noise2.eval(pos.getX() * 0.002, pos.getZ() * 0.002) * 8 + 8); + h = MHelper.floor(noise2.eval(pos.getX() * 0.01, pos.getZ() * 0.01) * noise2.eval( + pos.getX() * 0.002, + pos.getZ() * 0.002 + ) * 8 + 8); if (h < 0) { heightmap.put(p, 0); diff --git a/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java b/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java index da226992..061a2b20 100644 --- a/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java @@ -70,8 +70,14 @@ public class NBTPiece extends BasePiece { @Override public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { - BoundingBox bounds = BoundingBox.fromCorners(new Vec3i(blockBox.minX(), this.boundingBox.minY(), blockBox.minZ()), new Vec3i(blockBox.maxX(), this.boundingBox.maxX(), blockBox.maxZ())); - StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror).setBoundingBox(bounds); + BoundingBox bounds = BoundingBox.fromCorners(new Vec3i( + blockBox.minX(), + this.boundingBox.minY(), + blockBox.minZ() + ), new Vec3i(blockBox.maxX(), this.boundingBox.maxX(), blockBox.maxZ())); + StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation) + .setMirror(mirror) + .setBoundingBox(bounds); structure.placeInWorld(world, pos, pos, placementData, random, 2); if (erosion > 0) { int x1 = MHelper.min(bounds.maxX(), boundingBox.maxX()); diff --git a/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java index 49f46f95..9ff908cc 100644 --- a/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java @@ -87,7 +87,10 @@ public class PaintedMountainPiece extends MountainPiece { maxY *= (float) noise1.eval(px * 0.05, pz * 0.05) * 0.3F + 0.7F; maxY *= (float) noise1.eval(px * 0.1, pz * 0.1) * 0.1F + 0.9F; maxY += center.getY(); - float offset = (float) (noise1.eval(px * 0.07, pz * 0.07) * 5 + noise1.eval(px * 0.2, pz * 0.2) * 2 + 7); + float offset = (float) (noise1.eval(px * 0.07, pz * 0.07) * 5 + noise1.eval( + px * 0.2, + pz * 0.2 + ) * 2 + 7); for (int y = minY - 1; y < maxY; y++) { pos.setY(y); int index = MHelper.floor((y + offset) * 0.65F) % slises.length; diff --git a/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java b/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java index 4d53ea58..b692cd39 100644 --- a/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java +++ b/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java @@ -1,6 +1,5 @@ package ru.betterend.world.surface; -import net.minecraft.core.Registry; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkAccess; @@ -20,18 +19,78 @@ public class SulphuricSurfaceBuilder extends SurfaceBuilder SULPHURIC_SURFACE = register("sulphuric_surface", new SulphuricSurfaceBuilder()); - public static final SurfaceBuilder UMBRA_SURFACE = register("umbra_surface", new UmbraSurfaceBuilder()); + public static final SurfaceBuilder SULPHURIC_SURFACE = register( + "sulphuric_surface", + new SulphuricSurfaceBuilder() + ); + public static final SurfaceBuilder UMBRA_SURFACE = register( + "umbra_surface", + new UmbraSurfaceBuilder() + ); private static SurfaceBuilder register(String name, SurfaceBuilder builder) { return Registry.register(Registry.SURFACE_BUILDER, name, builder); diff --git a/src/main/java/ru/betterend/world/surface/UmbraSurfaceBuilder.java b/src/main/java/ru/betterend/world/surface/UmbraSurfaceBuilder.java index fc4ace91..15b6ba54 100644 --- a/src/main/java/ru/betterend/world/surface/UmbraSurfaceBuilder.java +++ b/src/main/java/ru/betterend/world/surface/UmbraSurfaceBuilder.java @@ -19,6 +19,20 @@ public class UmbraSurfaceBuilder extends SurfaceBuilder { - return new ResourceLocation(identifier.getNamespace(), "textures/models/armor/" + identifier.getPath() + "_layer_" + (secondLayer ? 2 : 1) + (suffix == null ? "" : "_" + suffix) + ".png"); + return new ResourceLocation( + identifier.getNamespace(), + "textures/models/armor/" + identifier.getPath() + "_layer_" + (secondLayer ? 2 : 1) + (suffix == null ? "" : "_" + suffix) + ".png" + ); }, items); } diff --git a/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java b/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java index 39c6cdc1..62e9adc5 100644 --- a/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java +++ b/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java @@ -89,7 +89,12 @@ public abstract class MixinArmorFeatureRenderer extends RenderLayer { ItemStack stack = storedEntity.getItemBySlot(slot); HumanoidModel defaultModel = cir.getReturnValue(); - HumanoidModel model = ArmorRenderingRegistry.getArmorModel(storedEntity, stack, slot, defaultModel); + HumanoidModel model = ArmorRenderingRegistry.getArmorModel( + storedEntity, + stack, + slot, + defaultModel + ); if (model != defaultModel) { cir.setReturnValue(model); @@ -98,7 +103,14 @@ public abstract class MixinArmorFeatureRenderer extends RenderLayer { @Inject(method = "getArmorLocation", at = @At(value = "INVOKE", target = "Ljava/util/Map;computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD) private void getArmorTexture(ArmorItem armorItem, boolean secondLayer, /* @Nullable */ String suffix, CallbackInfoReturnable cir, String vanillaIdentifier) { - String texture = ArmorRenderingRegistry.getArmorTexture(storedEntity, storedEntity.getItemBySlot(storedSlot), storedSlot, secondLayer, suffix, new ResourceLocation(vanillaIdentifier)).toString(); + String texture = ArmorRenderingRegistry.getArmorTexture( + storedEntity, + storedEntity.getItemBySlot(storedSlot), + storedSlot, + secondLayer, + suffix, + new ResourceLocation(vanillaIdentifier) + ).toString(); if (!Objects.equals(texture, vanillaIdentifier)) { cir.setReturnValue(ARMOR_LOCATION_CACHE.computeIfAbsent(texture, ResourceLocation::new));