Merge branch '1.19' of github.com:quiqueck/BetterEnd into 1.19

 Conflicts:
	src/main/java/org/betterx/betterend/integration/EnderscapeIntegration.java
This commit is contained in:
Frank 2022-06-09 16:56:42 +02:00
commit 34fd95ac11
420 changed files with 6494 additions and 5302 deletions

View file

@ -46,9 +46,8 @@ dependencies {
} else { } else {
modImplementation "com.github.quiqueck:BCLib:${project.bclib_version}" modImplementation "com.github.quiqueck:BCLib:${project.bclib_version}"
} }
useOptional "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
// useOptional "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}" useOptional "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
//useOptional "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
} }
def useOptional(String dep) { def useOptional(String dep) {

View file

@ -19,5 +19,5 @@ 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 # 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 patchouli_version = 55-FABRIC-SNAPSHOT
bclib_version = 1.19-SNAPSHOT bclib_version = 2.0.1
rei_version = 9.0.458 rei_version = 9.0.472

View file

@ -1,11 +1,5 @@
package org.betterx.betterend; package org.betterx.betterend;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biomes;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import org.betterx.bclib.api.v2.WorldDataAPI; import org.betterx.bclib.api.v2.WorldDataAPI;
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI; import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI;
import org.betterx.bclib.util.Logger; import org.betterx.bclib.util.Logger;
@ -21,6 +15,12 @@ import org.betterx.betterend.util.LootTableUtil;
import org.betterx.betterend.world.generator.GeneratorOptions; import org.betterx.betterend.world.generator.GeneratorOptions;
import org.betterx.betterend.world.generator.TerrainGenerator; import org.betterx.betterend.world.generator.TerrainGenerator;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biomes;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
public class BetterEnd implements ModInitializer { public class BetterEnd implements ModInitializer {
public static final String MOD_ID = "betterend"; public static final String MOD_ID = "betterend";
public static final Logger LOGGER = new Logger(MOD_ID); public static final Logger LOGGER = new Logger(MOD_ID);
@ -60,8 +60,10 @@ public class BetterEnd implements ModInitializer {
if (GeneratorOptions.useNewGenerator()) { if (GeneratorOptions.useNewGenerator()) {
org.betterx.bclib.api.v2.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock()); org.betterx.bclib.api.v2.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock());
org.betterx.bclib.api.v2.generator.GeneratorOptions.setEndLandFunction((pos) -> TerrainGenerator.isLand(pos.x, org.betterx.bclib.api.v2.generator.GeneratorOptions.setEndLandFunction((pos) -> TerrainGenerator.isLand(
pos.y)); pos.x,
pos.y
));
} }
BiomeAPI.registerEndBiomeModification((biomeID, biome) -> { BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {

View file

@ -1,15 +1,15 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import org.betterx.bclib.items.BaseAnvilItem; import org.betterx.bclib.items.BaseAnvilItem;
import org.betterx.betterend.blocks.basis.EndAnvilBlock; import org.betterx.betterend.blocks.basis.EndAnvilBlock;
import org.betterx.betterend.item.material.EndToolMaterial; import org.betterx.betterend.item.material.EndToolMaterial;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
public class AeterniumAnvil extends EndAnvilBlock { public class AeterniumAnvil extends EndAnvilBlock {
public AeterniumAnvil() { public AeterniumAnvil() {
super(EndBlocks.AETERNIUM_BLOCK.defaultMaterialColor(), EndToolMaterial.AETERNIUM.getLevel()); super(EndBlocks.AETERNIUM_BLOCK.defaultMaterialColor(), EndToolMaterial.AETERNIUM.getLevel());

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.CustomItemProvider;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
@ -9,18 +12,15 @@ import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.CustomItemProvider;
public class AeterniumBlock extends BaseBlock implements CustomItemProvider { public class AeterniumBlock extends BaseBlock implements CustomItemProvider {
public AeterniumBlock() { public AeterniumBlock() {
super(FabricBlockSettings super(FabricBlockSettings
.of(Material.METAL, MaterialColor.COLOR_GRAY) .of(Material.METAL, MaterialColor.COLOR_GRAY)
.hardness(65F) .hardness(65F)
.resistance(1200F) .resistance(1200F)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.sound(SoundType.NETHERITE_BLOCK) .sound(SoundType.NETHERITE_BLOCK)
); );
} }
@Override @Override

View file

@ -1,13 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
public class AmaranitaCapBlock extends BaseBlock implements AddMineableAxe { public class AmaranitaCapBlock extends BaseBlock implements AddMineableAxe {
public AmaranitaCapBlock() { public AmaranitaCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD)); super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));

View file

@ -1,15 +1,15 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableAxe; import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class AmaranitaHymenophoreBlock extends BaseBlock implements RenderLayerProvider, AddMineableAxe { public class AmaranitaHymenophoreBlock extends BaseBlock implements RenderLayerProvider, AddMineableAxe {
public AmaranitaHymenophoreBlock() { public AmaranitaHymenophoreBlock() {
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD)); super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));

View file

@ -1,12 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
public class AmaranitaStemBlock extends BaseRotatedPillarBlock { public class AmaranitaStemBlock extends BaseRotatedPillarBlock {
public AmaranitaStemBlock() { public AmaranitaStemBlock() {
super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).mapColor(MaterialColor.COLOR_LIGHT_GREEN)); super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).mapColor(MaterialColor.COLOR_LIGHT_GREEN));

View file

@ -1,12 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
public class AmberBlock extends BaseBlock { public class AmberBlock extends BaseBlock {
public AmberBlock() { public AmberBlock() {
super(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MaterialColor.COLOR_YELLOW)); super(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MaterialColor.COLOR_YELLOW));

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndParticles;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -16,12 +22,6 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndParticles;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -68,7 +68,7 @@ public class AncientEmeraldIceBlock extends BaseBlock {
0.5, 0.5,
0.5, 0.5,
0 0
); );
} }
@Override @Override

View file

@ -1,5 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableHammer;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -21,14 +30,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableHammer;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndItems;
import java.util.List; import java.util.List;
@ -39,21 +40,23 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye
public AuroraCrystalBlock() { public AuroraCrystalBlock() {
super(FabricBlockSettings super(FabricBlockSettings
.of(Material.GLASS) .of(Material.GLASS)
.hardness(1F) .hardness(1F)
.resistance(1F) .resistance(1F)
.luminance(15) .luminance(15)
.noOcclusion() .noOcclusion()
.isSuffocating((state, world, pos) -> false) .isSuffocating((state, world, pos) -> false)
.sound(SoundType.GLASS)); .sound(SoundType.GLASS));
} }
@Override @Override
@Deprecated @Deprecated
public VoxelShape getVisualShape(BlockState blockState, public VoxelShape getVisualShape(
BlockGetter blockGetter, BlockState blockState,
BlockPos blockPos, BlockGetter blockGetter,
CollisionContext collisionContext) { BlockPos blockPos,
CollisionContext collisionContext
) {
return this.getCollisionShape(blockState, blockGetter, blockPos, collisionContext); return this.getCollisionShape(blockState, blockGetter, blockPos, collisionContext);
} }

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.UpDownPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.UpDownPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class BlueVineBlock extends UpDownPlantBlock { public class BlueVineBlock extends UpDownPlantBlock {
public static final EnumProperty<BlockProperties.TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty<BlockProperties.TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
@ -14,11 +19,6 @@ import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import org.betterx.betterend.registry.EndBlocks;
public class BlueVineLanternBlock extends BaseBlock implements AddMineableAxe { public class BlueVineLanternBlock extends BaseBlock implements AddMineableAxe {
public static final BooleanProperty NATURAL = BlockProperties.NATURAL; public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
@ -37,12 +37,14 @@ public class BlueVineLanternBlock extends BaseBlock implements AddMineableAxe {
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (!canSurvive(state, world, pos)) { if (!canSurvive(state, world, pos)) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
} else { } else {

View file

@ -1,12 +1,5 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
@ -14,6 +7,13 @@ import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.blocks.basis.FurBlock; import org.betterx.betterend.blocks.basis.FurBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
public class BlueVineSeedBlock extends EndPlantWithAgeBlock { public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
public BlueVineSeedBlock() { public BlueVineSeedBlock() {
super(p -> p.offsetType(BlockBehaviour.OffsetType.NONE)); super(p -> p.offsetType(BlockBehaviour.OffsetType.NONE));
@ -31,21 +31,21 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
pos, pos,
EndBlocks.BLUE_VINE.defaultBlockState() EndBlocks.BLUE_VINE.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.BOTTOM) .setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.BOTTOM)
); );
for (int i = 1; i < height; i++) { for (int i = 1; i < height; i++) {
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
pos.above(i), pos.above(i),
EndBlocks.BLUE_VINE.defaultBlockState() EndBlocks.BLUE_VINE.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.MIDDLE) .setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.MIDDLE)
); );
} }
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
pos.above(height), pos.above(height),
EndBlocks.BLUE_VINE.defaultBlockState() EndBlocks.BLUE_VINE.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP) .setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP)
); );
placeLantern(world, pos.above(height + 1)); placeLantern(world, pos.above(height + 1));
} }
@ -54,7 +54,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
world, world,
pos, pos,
EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true) EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)
); );
for (Direction dir : BlocksHelper.HORIZONTAL) { for (Direction dir : BlocksHelper.HORIZONTAL) {
BlockPos p = pos.relative(dir); BlockPos p = pos.relative(dir);
if (world.isEmptyBlock(p)) { if (world.isEmptyBlock(p)) {
@ -62,7 +62,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
world, world,
p, p,
EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir) EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)
); );
} }
} }
if (world.isEmptyBlock(pos.above())) { if (world.isEmptyBlock(pos.above())) {
@ -70,7 +70,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
world, world,
pos.above(), pos.above(),
EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP) EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP)
); );
} }
} }

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -13,8 +16,6 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import java.util.List; import java.util.List;

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@ -19,11 +24,6 @@ import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class BrimstoneBlock extends BaseBlock { public class BrimstoneBlock extends BaseBlock {
@ -40,11 +40,13 @@ public class BrimstoneBlock extends BaseBlock {
} }
@Override @Override
public void setPlacedBy(Level world, public void setPlacedBy(
BlockPos pos, Level world,
BlockState state, BlockPos pos,
@Nullable LivingEntity placer, BlockState state,
ItemStack itemStack) { @Nullable LivingEntity placer,
ItemStack itemStack
) {
if (world.isClientSide()) { if (world.isClientSide()) {
updateChunks((ClientLevel) world, pos); updateChunks((ClientLevel) world, pos);
} }

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -17,9 +20,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements AddMineableShears { public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16); private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseVineBlock;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -8,11 +14,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootContext;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.blocks.BaseVineBlock;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import java.util.List; import java.util.List;

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.betterend.blocks.basis.EndLanternBlock;
import org.betterx.betterend.client.models.Patterns;
import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -17,13 +25,6 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.betterend.blocks.basis.EndLanternBlock;
import org.betterx.betterend.client.models.Patterns;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
@ -68,7 +69,7 @@ public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayer
? Patterns.createJson( ? Patterns.createJson(
Patterns.BLOCK_BULB_LANTERN_FLOOR, Patterns.BLOCK_BULB_LANTERN_FLOOR,
textures textures
) )
: Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures); : Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures);
return ModelsHelper.fromPattern(pattern); return ModelsHelper.fromPattern(pattern);
} }

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.ColorUtil;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.ColorUtil;
public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements CustomColorProvider { public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements CustomColorProvider {
public BulbVineLanternColoredBlock(FabricBlockSettings settings) { public BulbVineLanternColoredBlock(FabricBlockSettings settings) {
super(settings); super(settings);

View file

@ -1,12 +1,5 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
import org.betterx.bclib.api.v2.tag.CommonBlockTags; import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape; import org.betterx.bclib.blocks.BlockProperties.TripleShape;
@ -14,6 +7,13 @@ import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock; import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
public class BulbVineSeedBlock extends EndPlantWithAgeBlock { public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
@Override @Override
@ -30,20 +30,20 @@ public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
world, world,
pos, pos,
EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP) EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)
); );
for (int i = 1; i < h; i++) { for (int i = 1; i < h; i++) {
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
pos.below(i), pos.below(i),
EndBlocks.BULB_VINE.defaultBlockState() EndBlocks.BULB_VINE.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE) .setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)
); );
} }
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
pos.below(h), pos.below(h),
EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM) EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM)
); );
} }
} }
} }

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -15,12 +21,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.registry.EndBlocks;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -14,10 +18,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks;
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock { public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
public CavePumpkinVineBlock() { public CavePumpkinVineBlock() {
super(p -> p.offsetType(BlockBehaviour.OffsetType.NONE)); super(p -> p.offsetType(BlockBehaviour.OffsetType.NONE));
@ -44,7 +44,7 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
world.setBlockAndUpdate( world.setBlockAndUpdate(
pos.below(), pos.below(),
EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(BlockProperties.SMALL, true) EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(BlockProperties.SMALL, true)
); );
} else if (age == 3) { } else if (age == 3) {
world.setBlockAndUpdate(pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState()); world.setBlockAndUpdate(pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState());
} }
@ -56,12 +56,14 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
state = super.updateShape(state, facing, neighborState, world, pos, neighborPos); state = super.updateShape(state, facing, neighborState, world, pos, neighborPos);
if (state.is(this) && state.getValue(BlockProperties.AGE) > 1) { if (state.is(this) && state.getValue(BlockProperties.AGE) > 1) {
BlockState down = world.getBlockState(pos.below()); BlockState down = world.getBlockState(pos.below());

View file

@ -1,5 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.client.models.Patterns;
import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.client.resources.model.BlockModelRotation; import net.minecraft.client.resources.model.BlockModelRotation;
import net.minecraft.client.resources.model.UnbakedModel; import net.minecraft.client.resources.model.UnbakedModel;
@ -18,12 +25,6 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.client.models.Patterns;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.Map; import java.util.Map;
@ -77,9 +78,11 @@ public class ChandelierBlock extends BaseAttachedBlock implements RenderLayerPro
@Override @Override
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public UnbakedModel getModelVariant(ResourceLocation stateId, public UnbakedModel getModelVariant(
BlockState blockState, ResourceLocation stateId,
Map<ResourceLocation, UnbakedModel> modelCache) { BlockState blockState,
Map<ResourceLocation, UnbakedModel> modelCache
) {
String state = "_wall"; String state = "_wall";
BlockModelRotation rotation = BlockModelRotation.X0_Y0; BlockModelRotation rotation = BlockModelRotation.X0_Y0;
switch (blockState.getValue(FACING)) { switch (blockState.getValue(FACING)) {

View file

@ -1,12 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.registry.FuelRegistry; import net.fabricmc.fabric.api.registry.FuelRegistry;
import org.betterx.bclib.blocks.BaseBlock;
public class CharcoalBlock extends BaseBlock { public class CharcoalBlock extends BaseBlock {
public CharcoalBlock() { public CharcoalBlock() {
super(FabricBlockSettings.copyOf(Blocks.COAL_BLOCK)); super(FabricBlockSettings.copyOf(Blocks.COAL_BLOCK));

View file

@ -1,13 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
public class CharniaBlock extends EndUnderwaterPlantBlock { public class CharniaBlock extends EndUnderwaterPlantBlock {
@Override @Override

View file

@ -1,10 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.EndPlantBlock; import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.world.level.block.state.BlockState;
public class ChorusGrassBlock extends EndPlantBlock { public class ChorusGrassBlock extends EndPlantBlock {
public ChorusGrassBlock() { public ChorusGrassBlock() {
super(true); super(true);

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.item.enchantment.Enchantments;
@ -10,10 +14,6 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;

View file

@ -1,12 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
public class DenseSnowBlock extends BaseBlock { public class DenseSnowBlock extends BaseBlock {
public DenseSnowBlock() { public DenseSnowBlock() {
super(FabricBlockSettings.of(Material.SNOW).strength(0.2F).sound(SoundType.SNOW)); super(FabricBlockSettings.of(Material.SNOW).strength(0.2F).sound(SoundType.SNOW));

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
public class DragonTreeSaplingBlock extends PottableFeatureSapling { public class DragonTreeSaplingBlock extends PottableFeatureSapling {
public DragonTreeSaplingBlock() { public DragonTreeSaplingBlock() {
super((state) -> EndFeatures.DRAGON_TREE); super((state) -> EndFeatures.DRAGON_TREE);

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -23,10 +27,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -42,12 +42,14 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements RenderLayer
} }
@Override @Override
public void playerDestroy(Level world, public void playerDestroy(
Player player, Level world,
BlockPos pos, Player player,
BlockState state, BlockPos pos,
@Nullable BlockEntity blockEntity, BlockState state,
ItemStack stack) { @Nullable BlockEntity blockEntity,
ItemStack stack
) {
super.playerDestroy(world, player, pos, state, blockEntity, stack); super.playerDestroy(world, player, pos, state, blockEntity, stack);
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) { if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) {
if (world.dimensionType().ultraWarm()) { if (world.dimensionType().ultraWarm()) {

View file

@ -1,13 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.betterend.registry.EndPortals;
import net.minecraft.util.StringRepresentable; import net.minecraft.util.StringRepresentable;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.betterend.registry.EndPortals;
public class EndBlockProperties extends BlockProperties { public class EndBlockProperties extends BlockProperties {
public static final EnumProperty<HydraluxShape> HYDRALUX_SHAPE = EnumProperty.create("shape", HydraluxShape.class); public static final EnumProperty<HydraluxShape> HYDRALUX_SHAPE = EnumProperty.create("shape", HydraluxShape.class);
public static final EnumProperty<PedestalState> PEDESTAL_STATE = EnumProperty.create("state", PedestalState.class); public static final EnumProperty<PedestalState> PEDESTAL_STATE = EnumProperty.create("state", PedestalState.class);

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -27,13 +35,6 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -51,12 +52,14 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineable
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (!canSurvive(state, world, pos)) { if (!canSurvive(state, world, pos)) {
return state.getValue(SHAPE) == TripleShape.TOP return state.getValue(SHAPE) == TripleShape.TOP
? Blocks.AIR.defaultBlockState() ? Blocks.AIR.defaultBlockState()
@ -103,7 +106,7 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineable
return Lists.newArrayList( return Lists.newArrayList(
new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE)), new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE)),
new ItemStack(EndBlocks.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE)) new ItemStack(EndBlocks.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE))
); );
} }
return Collections.emptyList(); return Collections.emptyList();
} }

View file

@ -1,17 +1,17 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids;
import org.betterx.bclib.api.v2.tag.CommonBlockTags; import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BlockProperties.TripleShape; import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock; import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids;
public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock { public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
@Override @Override
public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) { public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) {
@ -20,21 +20,21 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
world, world,
pos, pos,
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.BOTTOM) EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.BOTTOM)
); );
BlockPos up = pos.above(); BlockPos up = pos.above();
while (world.getFluidState(up).isSource()) { while (world.getFluidState(up).isSource()) {
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
up, up,
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.MIDDLE) EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.MIDDLE)
); );
up = up.above(); up = up.above();
} }
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
up, up,
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP) EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP)
); );
} }
} }

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -16,9 +20,6 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import java.util.List; import java.util.List;

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -22,14 +30,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
public class EndLotusLeafBlock extends BaseBlockNotFull implements RenderLayerProvider { public class EndLotusLeafBlock extends BaseBlockNotFull implements RenderLayerProvider {
public static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; public static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@ -8,12 +14,6 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
@Override @Override
public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) { public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) {
@ -43,7 +43,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
world, world,
bpos, bpos,
startLeaf.setValue(EndLotusStemBlock.SHAPE, shape).setValue(EndLotusStemBlock.FACING, dir) startLeaf.setValue(EndLotusStemBlock.SHAPE, shape).setValue(EndLotusStemBlock.FACING, dir)
); );
} else { } else {
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, shape)); BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, shape));
} }
@ -103,7 +103,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
p.set(pos).move(move), p.set(pos).move(move),
leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move) leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move)
.setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE) .setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE)
); );
} }
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
Direction d1 = BlocksHelper.HORIZONTAL[i]; Direction d1 = BlocksHelper.HORIZONTAL[i];
@ -113,7 +113,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
p.set(pos).move(d1).move(d2), p.set(pos).move(d1).move(d2),
leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1) leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1)
.setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP) .setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP)
); );
} }
} }

View file

@ -1,5 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis; import net.minecraft.core.Direction.Axis;
@ -20,12 +27,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import java.util.Map; import java.util.Map;
@ -84,12 +85,14 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction direction, BlockState state,
BlockState newState, Direction direction,
LevelAccessor world, BlockState newState,
BlockPos pos, LevelAccessor world,
BlockPos posFrom) { BlockPos pos,
BlockPos posFrom
) {
if (state.getValue(WATERLOGGED)) { if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world)); world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
} }

View file

@ -1,12 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import java.util.Map; import java.util.Map;

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.interfaces.TeleportingEntity;
import org.betterx.betterend.registry.EndParticles;
import org.betterx.betterend.registry.EndPortals;
import org.betterx.betterend.rituals.EternalRitual;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -31,14 +39,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.interfaces.TeleportingEntity;
import org.betterx.betterend.registry.EndParticles;
import org.betterx.betterend.registry.EndPortals;
import org.betterx.betterend.rituals.EternalRitual;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
@ -70,7 +70,7 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
0.5F, 0.5F,
random.nextFloat() * 0.4F + 0.8F, random.nextFloat() * 0.4F + 0.8F,
false false
); );
} }
double x = pos.getX() + random.nextDouble(); double x = pos.getX() + random.nextDouble();
@ -91,12 +91,14 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction direction, BlockState state,
BlockState newState, Direction direction,
LevelAccessor world, BlockState newState,
BlockPos pos, LevelAccessor world,
BlockPos posFrom) { BlockPos pos,
BlockPos posFrom
) {
return state; return state;
} }
@ -119,7 +121,7 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
exitPos.getZ() + 0.5, exitPos.getZ() + 0.5,
entity.getYRot(), entity.getYRot(),
entity.getXRot() entity.getXRot()
); );
} else { } else {
((TeleportingEntity) entity).be_setExitPos(exitPos); ((TeleportingEntity) entity).be_setExitPos(exitPos);
Optional<Entity> teleported = Optional.ofNullable(entity.changeDimension(destination)); Optional<Entity> teleported = Optional.ofNullable(entity.changeDimension(destination));
@ -136,10 +138,12 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
return BCLRenderLayer.TRANSLUCENT; return BCLRenderLayer.TRANSLUCENT;
} }
private BlockPos findExitPos(ServerLevel currentWorld, private BlockPos findExitPos(
ServerLevel targetWorld, ServerLevel currentWorld,
BlockPos currentPos, ServerLevel targetWorld,
Entity entity) { BlockPos currentPos,
Entity entity
) {
if (targetWorld == null) return null; if (targetWorld == null) return null;
Registry<DimensionType> registry = targetWorld.registryAccess() Registry<DimensionType> registry = targetWorld.registryAccess()
.registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); .registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);
@ -149,10 +153,11 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
double currentMultiplier = Objects.requireNonNull(registry.get(currentWorldId)).coordinateScale(); double currentMultiplier = Objects.requireNonNull(registry.get(currentWorldId)).coordinateScale();
double multiplier = targetMultiplier > currentMultiplier ? 1.0 / targetMultiplier : currentMultiplier; double multiplier = targetMultiplier > currentMultiplier ? 1.0 / targetMultiplier : currentMultiplier;
MutableBlockPos basePos = currentPos.mutable() MutableBlockPos basePos = currentPos.mutable()
.set(currentPos.getX() * multiplier, .set(
currentPos.getY(), currentPos.getX() * multiplier,
currentPos.getZ() * multiplier currentPos.getY(),
); currentPos.getZ() * multiplier
);
MutableBlockPos checkPos = basePos.mutable(); MutableBlockPos checkPos = basePos.mutable();
BlockState currentState = currentWorld.getBlockState(currentPos); BlockState currentState = currentWorld.getBlockState(currentPos);
int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1; int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1;
@ -162,7 +167,7 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
radius, radius,
this, this,
state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL)) state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL))
); );
if (checkPos != null) { if (checkPos != null) {
BlockState checkState = targetWorld.getBlockState(checkPos); BlockState checkState = targetWorld.getBlockState(checkPos);
Axis axis = checkState.getValue(AXIS); Axis axis = checkState.getValue(AXIS);

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockWithEntity;
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import org.betterx.betterend.registry.EndBlockEntities;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
@ -33,9 +37,6 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.blocks.BaseBlockWithEntity;
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import org.betterx.betterend.registry.EndBlockEntities;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -56,12 +57,14 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public InteractionResult use(BlockState state, public InteractionResult use(
Level world, BlockState state,
BlockPos pos, Level world,
Player player, BlockPos pos,
InteractionHand hand, Player player,
BlockHitResult hit) { InteractionHand hand,
BlockHitResult hit
) {
if (world.isClientSide) { if (world.isClientSide) {
return InteractionResult.SUCCESS; return InteractionResult.SUCCESS;
} else { } else {
@ -154,7 +157,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
1.0F, 1.0F,
1.0F, 1.0F,
false false
); );
} }
Direction direction = state.getValue(FACING); Direction direction = state.getValue(FACING);
@ -170,13 +173,15 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
@Override @Override
@Nullable @Nullable
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, public <T extends BlockEntity> BlockEntityTicker<T> getTicker(
BlockState blockState, Level level,
BlockEntityType<T> blockEntityType) { BlockState blockState,
BlockEntityType<T> blockEntityType
) {
return level.isClientSide() ? null : createTickerHelper( return level.isClientSide() ? null : createTickerHelper(
blockEntityType, blockEntityType,
EndBlockEntities.END_STONE_SMELTER, EndBlockEntities.END_STONE_SMELTER,
EndStoneSmelterBlockEntity::tick EndStoneSmelterBlockEntity::tick
); );
} }
} }

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
@ -11,8 +13,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
public class EnderBlock extends BaseBlock { public class EnderBlock extends BaseBlock {
public EnderBlock() { public EnderBlock() {

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.interfaces.TagProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShovel;
import org.betterx.bclib.util.ColorUtil;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.tags.TagKey; import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
@ -15,11 +20,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.interfaces.TagProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShovel;
import org.betterx.bclib.util.ColorUtil;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -29,9 +29,9 @@ public class EndstoneDustBlock extends FallingBlock implements TagProvider, AddM
public EndstoneDustBlock() { public EndstoneDustBlock() {
super(FabricBlockSettings super(FabricBlockSettings
.copyOf(Blocks.SAND) .copyOf(Blocks.SAND)
.mapColor(Blocks.END_STONE.defaultMaterialColor()) .mapColor(Blocks.END_STONE.defaultMaterialColor())
); );
} }
@Override @Override

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import org.betterx.betterend.blocks.entities.EternalPedestalEntity;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndPortals;
import org.betterx.betterend.rituals.EternalRitual;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
@ -20,11 +26,6 @@ import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import org.betterx.betterend.blocks.entities.EternalPedestalEntity;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndPortals;
import org.betterx.betterend.rituals.EternalRitual;
import java.util.List; import java.util.List;
@ -75,12 +76,14 @@ public class EternalPedestal extends PedestalBlock {
@Override @Override
@Deprecated @Deprecated
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction direction, BlockState state,
BlockState newState, Direction direction,
LevelAccessor world, BlockState newState,
BlockPos pos, LevelAccessor world,
BlockPos posFrom) { BlockPos pos,
BlockPos posFrom
) {
BlockState updated = super.updateShape(state, direction, newState, world, pos, posFrom); BlockState updated = super.updateShape(state, direction, newState, world, pos, posFrom);
if (!updated.is(this)) return updated; if (!updated.is(this)) return updated;
if (!this.isPlaceable(updated)) { if (!this.isPlaceable(updated)) {

View file

@ -1,9 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.world.level.block.state.BlockBehaviour;
import org.betterx.bclib.blocks.BaseVineBlock; import org.betterx.bclib.blocks.BaseVineBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
public class FilaluxBlock extends BaseVineBlock { public class FilaluxBlock extends BaseVineBlock {
public FilaluxBlock() { public FilaluxBlock() {
super(15, true, p -> p.offsetType(BlockBehaviour.OffsetType.NONE)); super(15, true, p -> p.offsetType(BlockBehaviour.OffsetType.NONE));

View file

@ -1,13 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
public class FilaluxLanternBlock extends BaseBlock implements AddMineableAxe { public class FilaluxLanternBlock extends BaseBlock implements AddMineableAxe {
public FilaluxLanternBlock() { public FilaluxLanternBlock() {
super(FabricBlockSettings.of(Material.WOOD) super(FabricBlockSettings.of(Material.WOOD)

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -13,10 +18,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import java.util.EnumMap; import java.util.EnumMap;

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.interfaces.CustomItemProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
@ -20,9 +24,6 @@ import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.interfaces.CustomItemProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import java.util.List; import java.util.List;

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -12,10 +16,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class FlammalixBlock extends EndPlantBlock { public class FlammalixBlock extends EndPlantBlock {
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14); private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);

View file

@ -1,5 +1,25 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.models.BasePatterns;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.models.ModelsHelper.MultiPartBuilder;
import org.betterx.bclib.client.models.PatternsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.PostInitable;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.JsonFactory;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.basis.PottableLeavesBlock;
import org.betterx.betterend.client.models.Patterns;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.interfaces.PottablePlant;
import org.betterx.betterend.interfaces.PottableTerrain;
import org.betterx.betterend.registry.EndBlocks;
import com.mojang.math.Transformation;
import com.mojang.math.Vector3f;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.client.resources.model.ModelResourceLocation;
@ -38,25 +58,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.mojang.math.Transformation;
import com.mojang.math.Vector3f;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.models.BasePatterns;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.models.ModelsHelper.MultiPartBuilder;
import org.betterx.bclib.client.models.PatternsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.PostInitable;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.JsonFactory;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.basis.PottableLeavesBlock;
import org.betterx.betterend.client.models.Patterns;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.interfaces.PottablePlant;
import org.betterx.betterend.interfaces.PottableTerrain;
import org.betterx.betterend.registry.EndBlocks;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
@ -79,7 +80,7 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
.setValue(PLANT_ID, 0) .setValue(PLANT_ID, 0)
.setValue(SOIL_ID, 0) .setValue(SOIL_ID, 0)
.setValue(POT_LIGHT, 0) .setValue(POT_LIGHT, 0)
); );
} }
@Override @Override
@ -104,12 +105,14 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
int plantID = state.getValue(PLANT_ID); int plantID = state.getValue(PLANT_ID);
if (plantID < 1 || plantID > plants.length || plants[plantID - 1] == null) { if (plantID < 1 || plantID > plants.length || plants[plantID - 1] == null) {
return state.getValue(POT_LIGHT) > 0 ? state.setValue(POT_LIGHT, 0) : state; return state.getValue(POT_LIGHT) > 0 ? state.setValue(POT_LIGHT, 0) : state;
@ -205,12 +208,14 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public InteractionResult use(BlockState state, public InteractionResult use(
Level level, BlockState state,
BlockPos pos, Level level,
Player player, BlockPos pos,
InteractionHand hand, Player player,
BlockHitResult hit) { InteractionHand hand,
BlockHitResult hit
) {
if (level.isClientSide) { if (level.isClientSide) {
return InteractionResult.CONSUME; return InteractionResult.CONSUME;
} }
@ -236,7 +241,7 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
SoundSource.BLOCKS, SoundSource.BLOCKS,
1, 1,
1 1
); );
return InteractionResult.SUCCESS; return InteractionResult.SUCCESS;
} }
} }
@ -276,7 +281,7 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
SoundSource.BLOCKS, SoundSource.BLOCKS,
1, 1,
1 1
); );
if (!player.isCreative()) { if (!player.isCreative()) {
itemStack.shrink(1); itemStack.shrink(1);
} }
@ -295,9 +300,11 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
@Override @Override
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public UnbakedModel getModelVariant(ResourceLocation stateId, public UnbakedModel getModelVariant(
BlockState blockState, ResourceLocation stateId,
Map<ResourceLocation, UnbakedModel> modelCache) { BlockState blockState,
Map<ResourceLocation, UnbakedModel> modelCache
) {
MultiPartBuilder model = MultiPartBuilder.create(stateDefinition); MultiPartBuilder model = MultiPartBuilder.create(stateDefinition);
model.part(new ModelResourceLocation(stateId.getNamespace(), stateId.getPath(), "inventory")).add(); model.part(new ModelResourceLocation(stateId.getNamespace(), stateId.getPath(), "inventory")).add();
Transformation offset = new Transformation(new Vector3f(0, 7.5F / 16F, 0), null, null, null); Transformation offset = new Transformation(new Vector3f(0, 7.5F / 16F, 0), null, null, null);

View file

@ -1,13 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
public class GlowingHymenophoreBlock extends BaseBlock implements AddMineableAxe { public class GlowingHymenophoreBlock extends BaseBlock implements AddMineableAxe {
public GlowingHymenophoreBlock() { public GlowingHymenophoreBlock() {
super(FabricBlockSettings.of(Material.WOOD) super(FabricBlockSettings.of(Material.WOOD)

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
@ -7,9 +10,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class GlowingMossBlock extends EndPlantBlock { public class GlowingMossBlock extends EndPlantBlock {
public GlowingMossBlock(int light) { public GlowingMossBlock(int light) {
super(light); super(light);

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
@ -15,10 +19,6 @@ import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.registry.EndBlocks;
public class GlowingPillarLuminophorBlock extends BaseBlock implements AddMineableShears { public class GlowingPillarLuminophorBlock extends BaseBlock implements AddMineableShears {
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL; public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
@ -39,12 +39,14 @@ public class GlowingPillarLuminophorBlock extends BaseBlock implements AddMineab
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (!canSurvive(state, world, pos)) { if (!canSurvive(state, world, pos)) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
} else { } else {

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.blocks.UpDownPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -11,11 +16,6 @@ import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.blocks.UpDownPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class GlowingPillarRootsBlock extends UpDownPlantBlock { public class GlowingPillarRootsBlock extends UpDownPlantBlock {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@ -12,14 +20,6 @@ import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks;
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddMineableShears { public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddMineableShears {
public GlowingPillarSeedBlock() { public GlowingPillarSeedBlock() {
@ -53,7 +53,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddM
world, world,
mut, mut,
EndBlocks.GLOWING_PILLAR_LUMINOPHOR.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true) EndBlocks.GLOWING_PILLAR_LUMINOPHOR.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)
); );
for (Direction dir : BlocksHelper.DIRECTIONS) { for (Direction dir : BlocksHelper.DIRECTIONS) {
pos = mut.relative(dir); pos = mut.relative(dir);
if (world.isEmptyBlock(pos)) { if (world.isEmptyBlock(pos)) {
@ -61,7 +61,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddM
world, world,
pos, pos,
EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, dir) EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, dir)
); );
} }
} }
mut.move(Direction.UP); mut.move(Direction.UP);
@ -71,7 +71,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddM
mut, mut,
EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState() EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState()
.setValue(BlockStateProperties.FACING, Direction.UP) .setValue(BlockStateProperties.FACING, Direction.UP)
); );
} }
} }

View file

@ -1,5 +1,16 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.NamedBlockTags;
import org.betterx.bclib.api.v2.tag.TagAPI;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BaseLeavesBlock;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.noise.OpenSimplexNoise;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
@ -16,17 +27,6 @@ import net.minecraft.world.level.storage.loot.LootContext;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.api.v2.tag.NamedBlockTags;
import org.betterx.bclib.api.v2.tag.TagAPI;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BaseLeavesBlock;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.noise.OpenSimplexNoise;
import org.betterx.betterend.registry.EndBlocks;
import java.util.List; import java.util.List;
public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider, AddMineableShears { public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider, AddMineableShears {
@ -35,12 +35,12 @@ public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvid
public HelixTreeLeavesBlock() { public HelixTreeLeavesBlock() {
super(FabricBlockSettings super(FabricBlockSettings
.of(Material.LEAVES) .of(Material.LEAVES)
.mapColor(MaterialColor.COLOR_ORANGE) .mapColor(MaterialColor.COLOR_ORANGE)
.sound(SoundType.WART_BLOCK) .sound(SoundType.WART_BLOCK)
.sound(SoundType.GRASS) .sound(SoundType.GRASS)
.strength(0.2F) .strength(0.2F)
); );
TagAPI.addBlockTag(NamedBlockTags.LEAVES, this); TagAPI.addBlockTag(NamedBlockTags.LEAVES, this);
} }

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
public class HelixTreeSaplingBlock extends PottableFeatureSapling { public class HelixTreeSaplingBlock extends PottableFeatureSapling {
public HelixTreeSaplingBlock() { public HelixTreeSaplingBlock() {
super((state) -> EndFeatures.HELIX_TREE); super((state) -> EndFeatures.HELIX_TREE);

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.UnderwaterPlantBlock;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.EndBlockProperties.HydraluxShape;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -19,13 +27,6 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.UnderwaterPlantBlock;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.EndBlockProperties.HydraluxShape;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -84,8 +85,10 @@ public class HydraluxBlock extends UnderwaterPlantBlock implements AddMineableSh
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
HydraluxShape shape = state.getValue(SHAPE); HydraluxShape shape = state.getValue(SHAPE);
if (shape == HydraluxShape.FLOWER_BIG_BOTTOM || shape == HydraluxShape.FLOWER_SMALL_BOTTOM) { if (shape == HydraluxShape.FLOWER_BIG_BOTTOM || shape == HydraluxShape.FLOWER_SMALL_BOTTOM) {
return Lists.newArrayList(new ItemStack(EndItems.HYDRALUX_PETAL, return Lists.newArrayList(new ItemStack(
MHelper.randRange(1, 4, MHelper.RANDOM_SOURCE))); EndItems.HYDRALUX_PETAL,
MHelper.randRange(1, 4, MHelper.RANDOM_SOURCE)
));
} else if (shape == HydraluxShape.ROOTS) { } else if (shape == HydraluxShape.ROOTS) {
return Lists.newArrayList(new ItemStack( return Lists.newArrayList(new ItemStack(
EndBlocks.HYDRALUX_SAPLING, EndBlocks.HYDRALUX_SAPLING,

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
@ -10,9 +13,6 @@ import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
public class HydraluxPetalBlock extends BaseBlock implements AddMineableAxe { public class HydraluxPetalBlock extends BaseBlock implements AddMineableAxe {
public HydraluxPetalBlock() { public HydraluxPetalBlock() {
this( this(
@ -22,7 +22,7 @@ public class HydraluxPetalBlock extends BaseBlock implements AddMineableAxe {
.resistance(1) .resistance(1)
.mapColor(MaterialColor.PODZOL) .mapColor(MaterialColor.PODZOL)
.sound(SoundType.WART_BLOCK) .sound(SoundType.WART_BLOCK)
); );
} }
public HydraluxPetalBlock(Properties settings) { public HydraluxPetalBlock(Properties settings) {

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.client.models.Patterns;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.block.model.BlockModel;
@ -10,11 +15,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.client.models.Patterns;
import java.util.Optional; import java.util.Optional;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -7,11 +12,6 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock { public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
@Override @Override
@ -32,14 +32,14 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
world, world,
pos, pos,
state.setValue(EndBlockProperties.HYDRALUX_SHAPE, EndBlockProperties.HydraluxShape.ROOTS) state.setValue(EndBlockProperties.HYDRALUX_SHAPE, EndBlockProperties.HydraluxShape.ROOTS)
); );
for (int i = 1; i < h - 2; i++) { for (int i = 1; i < h - 2; i++) {
mut.setY(pos.getY() + i); mut.setY(pos.getY() + i);
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
mut, mut,
state.setValue(EndBlockProperties.HYDRALUX_SHAPE, EndBlockProperties.HydraluxShape.VINE) state.setValue(EndBlockProperties.HYDRALUX_SHAPE, EndBlockProperties.HydraluxShape.VINE)
); );
} }
mut.setY(mut.getY() + 1); mut.setY(mut.getY() + 1);
@ -52,8 +52,8 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
big big
? EndBlockProperties.HydraluxShape.FLOWER_BIG_BOTTOM ? EndBlockProperties.HydraluxShape.FLOWER_BIG_BOTTOM
: EndBlockProperties.HydraluxShape.FLOWER_SMALL_BOTTOM : EndBlockProperties.HydraluxShape.FLOWER_SMALL_BOTTOM
) )
); );
mut.setY(mut.getY() + 1); mut.setY(mut.getY() + 1);
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
@ -64,8 +64,8 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
big big
? EndBlockProperties.HydraluxShape.FLOWER_BIG_TOP ? EndBlockProperties.HydraluxShape.FLOWER_BIG_TOP
: EndBlockProperties.HydraluxShape.FLOWER_SMALL_TOP : EndBlockProperties.HydraluxShape.FLOWER_SMALL_TOP
) )
); );
} }
@Override @Override

View file

@ -1,5 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.entities.BlockEntityHydrothermalVent;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
@ -31,13 +38,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.entities.BlockEntityHydrothermalVent;
import org.betterx.betterend.registry.EndBlocks;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@ -81,12 +81,14 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (!canSurvive(state, world, pos)) { if (!canSurvive(state, world, pos)) {
return Blocks.WATER.defaultBlockState(); return Blocks.WATER.defaultBlockState();
} else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) { } else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) {
@ -123,11 +125,13 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
} }
@Override @Override
public void setPlacedBy(Level world, public void setPlacedBy(
BlockPos pos, Level world,
BlockState state, BlockPos pos,
@Nullable LivingEntity placer, BlockState state,
ItemStack itemStack) { @Nullable LivingEntity placer,
ItemStack itemStack
) {
if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above()) if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above())
.is(Blocks.WATER)) { .is(Blocks.WATER)) {
tick(state, (ServerLevel) world, pos, world.random); tick(state, (ServerLevel) world, pos, world.random);
@ -147,9 +151,11 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
@Nullable @Nullable
@Override @Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, public <T extends BlockEntity> BlockEntityTicker<T> getTicker(
BlockState blockState, Level level,
BlockEntityType<T> blockEntityType) { BlockState blockState,
BlockEntityType<T> blockEntityType
) {
return BlockEntityHydrothermalVent::tick; return BlockEntityHydrothermalVent::tick;
} }
} }

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import org.betterx.betterend.blocks.entities.InfusionPedestalEntity;
import org.betterx.betterend.rituals.InfusionRitual;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
@ -13,10 +17,6 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import org.betterx.betterend.blocks.entities.InfusionPedestalEntity;
import org.betterx.betterend.rituals.InfusionRitual;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@ -79,9 +79,11 @@ public class InfusionPedestal extends PedestalBlock {
@Override @Override
@Nullable @Nullable
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, public <T extends BlockEntity> BlockEntityTicker<T> getTicker(
BlockState blockState, Level level,
BlockEntityType<T> blockEntityType) { BlockState blockState,
BlockEntityType<T> blockEntityType
) {
return InfusionPedestalEntity::tickEnity; return InfusionPedestalEntity::tickEnity;
} }

View file

@ -1,5 +1,15 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.client.models.Patterns;
import org.betterx.betterend.noise.OpenSimplexNoise;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.renderer.block.model.BlockModel;
@ -21,15 +31,6 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.client.models.Patterns;
import org.betterx.betterend.noise.OpenSimplexNoise;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
public class LacugroveSaplingBlock extends PottableFeatureSapling { public class LacugroveSaplingBlock extends PottableFeatureSapling {
public LacugroveSaplingBlock() { public LacugroveSaplingBlock() {
super((state) -> EndFeatures.LACUGROVE); super((state) -> EndFeatures.LACUGROVE);

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.PentaShape;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -13,12 +19,6 @@ import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootContext;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.PentaShape;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -50,12 +50,14 @@ public class LanceleafBlock extends EndPlantBlock {
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (!canSurvive(state, world, pos)) { if (!canSurvive(state, world, pos)) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
} else { } else {

View file

@ -1,12 +1,5 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.PentaShape; import org.betterx.bclib.blocks.BlockProperties.PentaShape;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
@ -14,6 +7,13 @@ import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock; import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
public class LanceleafSeedBlock extends EndPlantWithAgeBlock { public class LanceleafSeedBlock extends EndPlantWithAgeBlock {
public LanceleafSeedBlock() { public LanceleafSeedBlock() {
super(p -> p.offsetType(OffsetType.NONE)); super(p -> p.offsetType(OffsetType.NONE));
@ -34,24 +34,24 @@ public class LanceleafSeedBlock extends EndPlantWithAgeBlock {
world, world,
mut.move(Direction.UP), mut.move(Direction.UP),
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_BOTTOM) plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_BOTTOM)
); );
for (int i = 2; i < height - 2; i++) { for (int i = 2; i < height - 2; i++) {
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
mut.move(Direction.UP), mut.move(Direction.UP),
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.MIDDLE) plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.MIDDLE)
); );
} }
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
mut.move(Direction.UP), mut.move(Direction.UP),
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_TOP) plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_TOP)
); );
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
mut.move(Direction.UP), mut.move(Direction.UP),
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.TOP) plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.TOP)
); );
} }
@Override @Override

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -17,12 +23,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class LargeAmaranitaBlock extends EndPlantBlock implements AddMineableShears { public class LargeAmaranitaBlock extends EndPlantBlock implements AddMineableShears {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 14, 12); private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 14, 12);

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
public class LucerniaSaplingBlock extends PottableFeatureSapling { public class LucerniaSaplingBlock extends PottableFeatureSapling {
public LucerniaSaplingBlock() { public LucerniaSaplingBlock() {
super((state) -> EndFeatures.LUCERNIA); super((state) -> EndFeatures.LUCERNIA);

View file

@ -1,5 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -20,22 +29,15 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableAxe { public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableAxe {
public static final EnumProperty<EndBlockProperties.LumecornShape> SHAPE = EnumProperty.create("shape", public static final EnumProperty<EndBlockProperties.LumecornShape> SHAPE = EnumProperty.create(
EndBlockProperties.LumecornShape.class); "shape",
EndBlockProperties.LumecornShape.class
);
private static final VoxelShape SHAPE_BOTTOM = Block.box(6, 0, 6, 10, 16, 10); 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); private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10);
@ -73,12 +75,14 @@ public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvid
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (!canSurvive(state, world, pos)) { if (!canSurvive(state, world, pos)) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
} else { } else {

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
@ -8,10 +12,6 @@ import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import java.util.Optional; import java.util.Optional;
public class LumecornSeedBlock extends EndPlantWithAgeBlock { public class LumecornSeedBlock extends EndPlantWithAgeBlock {
@ -28,7 +28,8 @@ public class LumecornSeedBlock extends EndPlantWithAgeBlock {
null, null,
random, random,
pos, pos,
null)); null
));
} }
@Override @Override

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.tags.FluidTags; import net.minecraft.tags.FluidTags;
@ -21,10 +26,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.betterend.registry.EndBlocks;
import java.util.Queue; import java.util.Queue;
@ -44,12 +45,14 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (absorbWater(world, pos)) { if (absorbWater(world, pos)) {
return EndBlocks.MENGER_SPONGE_WET.defaultBlockState(); return EndBlocks.MENGER_SPONGE_WET.defaultBlockState();
} }
@ -76,7 +79,7 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
world, world,
blockPos2, blockPos2,
blockState blockState
) )
.isEmpty()) { .isEmpty()) {
++i; ++i;
if (j < 6) { if (j < 6) {
@ -114,23 +117,25 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
} }
@Override @Override
public VoxelShape getShape(BlockState blockState, public VoxelShape getShape(
BlockGetter blockGetter, BlockState blockState,
BlockPos blockPos, BlockGetter blockGetter,
CollisionContext collisionContext) { BlockPos blockPos,
CollisionContext collisionContext
) {
return SHAPE; return SHAPE;
} }
static { static {
SHAPE = Shapes.or( SHAPE = Shapes.or(
Shapes.or(box(0, 0, 0, 16, 6, 6), box(0, 0, 10, 16, 6, 16), Shapes.or(box(0, 0, 0, 16, 6, 6), box(0, 0, 10, 16, 6, 16),
Shapes.or(box(0, 10, 0, 16, 16, 6), box(0, 10, 10, 16, 16, 16)), Shapes.or(box(0, 10, 0, 16, 16, 6), box(0, 10, 10, 16, 16, 16)),
Shapes.or(box(0, 0, 0, 6, 6, 16), box(10, 0, 0, 16, 6, 16)), Shapes.or(box(0, 0, 0, 6, 6, 16), box(10, 0, 0, 16, 6, 16)),
Shapes.or(box(0, 10, 0, 6, 16, 16), box(10, 10, 0, 16, 16, 16)), Shapes.or(box(0, 10, 0, 6, 16, 16), box(10, 10, 0, 16, 16, 16)),
Shapes.or(box(0, 0, 0, 6, 16, 6), box(10, 0, 0, 16, 16, 6)), Shapes.or(box(0, 0, 0, 6, 16, 6), box(10, 0, 0, 16, 16, 6)),
Shapes.or(box(0, 0, 10, 6, 16, 16), box(10, 0, 10, 16, 16, 16)) Shapes.or(box(0, 0, 10, 6, 16, 16), box(10, 0, 10, 16, 16, 16))
)); ));
} }
} }

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
@ -23,12 +29,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLayerProvider { public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLayerProvider {
public MengerSpongeWetBlock() { public MengerSpongeWetBlock() {
@ -47,7 +47,7 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLaye
SoundSource.BLOCKS, SoundSource.BLOCKS,
1.0F, 1.0F,
(1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F (1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F
); );
} }
} }
@ -119,10 +119,12 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLaye
} }
@Override @Override
public VoxelShape getShape(BlockState blockState, public VoxelShape getShape(
BlockGetter blockGetter, BlockState blockState,
BlockPos blockPos, BlockGetter blockGetter,
CollisionContext collisionContext) { BlockPos blockPos,
CollisionContext collisionContext
) {
return EndBlocks.MENGER_SPONGE.getShape(blockState, blockGetter, blockPos, collisionContext); return EndBlocks.MENGER_SPONGE.getShape(blockState, blockGetter, blockPos, collisionContext);
} }
} }

View file

@ -1,11 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
public class MissingTileBlock extends BaseBlock { public class MissingTileBlock extends BaseBlock {
public MissingTileBlock() { public MissingTileBlock() {
super(FabricBlockSettings.copyOf(Blocks.END_STONE)); super(FabricBlockSettings.copyOf(Blocks.END_STONE));

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -17,9 +20,6 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
import org.betterx.betterend.registry.EndBlocks;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -62,7 +62,7 @@ public class MossyDragonBoneBlock extends BaseRotatedPillarBlock {
blockPos, blockPos,
Direction.UP, Direction.UP,
blockState.getLightBlock(worldView, blockPos) blockState.getLightBlock(worldView, blockPos)
); );
return i < 5; return i < 5;
} }
} }

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.NamedMineableTags;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.TagProvider;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.tags.TagKey; import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
@ -12,11 +17,6 @@ import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.api.v2.tag.NamedMineableTags;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.TagProvider;
import org.betterx.betterend.registry.EndBlocks;
import java.util.List; import java.util.List;
public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider { public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
@ -33,7 +33,7 @@ public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
TRANSITION, TRANSITION,
EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel() EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel()
.getBlockState(ctx.getClickedPos().below())) .getBlockState(ctx.getClickedPos().below()))
); );
} }
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling { public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling {
public MossyGlowshroomSaplingBlock() { public MossyGlowshroomSaplingBlock() {
super(7, (state) -> EndFeatures.MOSSY_GLOWSHROOM); super(7, (state) -> EndFeatures.MOSSY_GLOWSHROOM);

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -17,8 +19,6 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -61,7 +61,7 @@ public class MossyObsidian extends BaseBlock {
blockPos, blockPos,
Direction.UP, Direction.UP,
blockState.getLightBlock(worldView, blockPos) blockState.getLightBlock(worldView, blockPos)
); );
return i < 5; return i < 5;
} }
} }

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -15,9 +18,6 @@ import net.minecraft.world.level.pathfinder.PathComputationType;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class MurkweedBlock extends EndPlantBlock { public class MurkweedBlock extends EndPlantBlock {
@Override @Override
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
@ -16,10 +21,6 @@ import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import java.util.List; import java.util.List;
@ -38,7 +39,7 @@ public class NeedlegrassBlock extends EndPlantBlock {
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel( if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
Enchantments.SILK_TOUCH, Enchantments.SILK_TOUCH,
tool tool
) > 0) { ) > 0) {
return Lists.newArrayList(new ItemStack(this)); return Lists.newArrayList(new ItemStack(this));
} else { } else {
return Lists.newArrayList(new ItemStack(Items.STICK, MHelper.randRange(0, 2, MHelper.RANDOM_SOURCE))); return Lists.newArrayList(new ItemStack(Items.STICK, MHelper.randRange(0, 2, MHelper.RANDOM_SOURCE)));

View file

@ -1,11 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.LitPillarBlock;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.betterend.blocks.basis.LitPillarBlock;
public class NeonCactusBlock extends LitPillarBlock { public class NeonCactusBlock extends LitPillarBlock {
public NeonCactusBlock() { public NeonCactusBlock() {
super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15)); super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15));

View file

@ -1,5 +1,17 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.EndBlockProperties.CactusBottom;
import org.betterx.betterend.interfaces.PottablePlant;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@ -29,17 +41,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.EndBlockProperties.CactusBottom;
import org.betterx.betterend.interfaces.PottablePlant;
import org.betterx.betterend.registry.EndBlocks;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.List; import java.util.List;
@ -106,12 +107,14 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction direction, BlockState state,
BlockState newState, Direction direction,
LevelAccessor world, BlockState newState,
BlockPos pos, LevelAccessor world,
BlockPos posFrom) { BlockPos pos,
BlockPos posFrom
) {
world.scheduleTick(pos, this, 2); world.scheduleTick(pos, this, 2);
if (state.getValue(WATERLOGGED)) { if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world)); world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
@ -235,11 +238,13 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
} }
} }
private boolean growIteration(WorldGenLevel world, private boolean growIteration(
MutableBlockPos pos, WorldGenLevel world,
RandomSource random, MutableBlockPos pos,
List<MutableBlockPos> ends, RandomSource random,
int length) { List<MutableBlockPos> ends,
int length
) {
BlockState state = world.getBlockState(pos); BlockState state = world.getBlockState(pos);
if (!state.is(this)) { if (!state.is(this)) {
return false; return false;
@ -278,11 +283,13 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
return true; return true;
} }
private Direction getSideDirection(WorldGenLevel world, private Direction getSideDirection(
BlockPos pos, WorldGenLevel world,
BlockState iterState, BlockPos pos,
Direction dir, BlockState iterState,
RandomSource random) { Direction dir,
RandomSource random
) {
MutableBlockPos iterPos = pos.mutable(); MutableBlockPos iterPos = pos.mutable();
Direction startDir = dir; Direction startDir = dir;
Direction lastDir = null; Direction lastDir = null;
@ -312,10 +319,12 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
} }
@Override @Override
public boolean isPathfindable(BlockState blockState, public boolean isPathfindable(
BlockGetter blockGetter, BlockState blockState,
BlockPos blockPos, BlockGetter blockGetter,
PathComputationType pathComputationType) { BlockPos blockPos,
PathComputationType pathComputationType
) {
return false; return false;
} }

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.basis.EndTerrainBlock;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.client.resources.model.UnbakedModel; import net.minecraft.client.resources.model.UnbakedModel;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -17,10 +21,6 @@ import net.minecraft.world.phys.BlockHitResult;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.basis.EndTerrainBlock;
import org.betterx.betterend.registry.EndBlocks;
import java.util.Map; import java.util.Map;
public class PallidiumBlock extends EndTerrainBlock { public class PallidiumBlock extends EndTerrainBlock {
@ -41,12 +41,14 @@ public class PallidiumBlock extends EndTerrainBlock {
} }
@Override @Override
public InteractionResult use(BlockState state, public InteractionResult use(
Level level, BlockState state,
BlockPos pos, Level level,
Player player, BlockPos pos,
InteractionHand hand, Player player,
BlockHitResult hit) { InteractionHand hand,
BlockHitResult hit
) {
if (nextLevel == null) { if (nextLevel == null) {
return InteractionResult.PASS; return InteractionResult.PASS;
} else if (level.isClientSide) { } else if (level.isClientSide) {
@ -66,9 +68,11 @@ public class PallidiumBlock extends EndTerrainBlock {
@Override @Override
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public UnbakedModel getModelVariant(ResourceLocation stateId, public UnbakedModel getModelVariant(
BlockState blockState, ResourceLocation stateId,
Map<ResourceLocation, UnbakedModel> modelCache) { BlockState blockState,
Map<ResourceLocation, UnbakedModel> modelCache
) {
return this.getBlockModel(stateId, blockState); return this.getBlockModel(stateId, blockState);
} }
} }

View file

@ -1,11 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -16,9 +19,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
public class PondAnemoneBlock extends EndUnderwaterPlantBlock implements AddMineableShears { public class PondAnemoneBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14); private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
public class PythadendronSaplingBlock extends PottableFeatureSapling { public class PythadendronSaplingBlock extends PottableFeatureSapling {
public PythadendronSaplingBlock() { public PythadendronSaplingBlock() {
super((state) -> EndFeatures.PYTHADENDRON_TREE); super((state) -> EndFeatures.PYTHADENDRON_TREE);

View file

@ -1,5 +1,17 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.betterend.particle.InfusionParticleType;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -32,17 +44,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.betterend.particle.InfusionParticleType;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -82,11 +83,13 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
} }
@Override @Override
public void setPlacedBy(Level world, public void setPlacedBy(
BlockPos pos, Level world,
BlockState state, BlockPos pos,
@Nullable LivingEntity placer, BlockState state,
ItemStack itemStack) { @Nullable LivingEntity placer,
ItemStack itemStack
) {
state = this.defaultBlockState(); state = this.defaultBlockState();
BlocksHelper.setWithUpdate(world, pos, state.setValue(SHAPE, TripleShape.BOTTOM)); BlocksHelper.setWithUpdate(world, pos, state.setValue(SHAPE, TripleShape.BOTTOM));
BlocksHelper.setWithUpdate(world, pos.above(), state.setValue(SHAPE, TripleShape.MIDDLE)); BlocksHelper.setWithUpdate(world, pos.above(), state.setValue(SHAPE, TripleShape.MIDDLE));
@ -95,12 +98,14 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
TripleShape shape = state.getValue(SHAPE); TripleShape shape = state.getValue(SHAPE);
if (shape == TripleShape.BOTTOM) { if (shape == TripleShape.BOTTOM) {
if (world.getBlockState(pos.above()).is(this)) { if (world.getBlockState(pos.above()).is(this)) {
@ -164,12 +169,14 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public InteractionResult use(BlockState state, public InteractionResult use(
Level world, BlockState state,
BlockPos pos, Level world,
Player player, BlockPos pos,
InteractionHand hand, Player player,
BlockHitResult hit) { InteractionHand hand,
BlockHitResult hit
) {
ItemStack itemStack = player.getItemInHand(hand); ItemStack itemStack = player.getItemInHand(hand);
boolean canActivate = itemStack.getItem() == EndItems.AMBER_GEM && itemStack.getCount() > 5; boolean canActivate = itemStack.getItem() == EndItems.AMBER_GEM && itemStack.getCount() > 5;
if (hand != InteractionHand.MAIN_HAND || !canActivate) { if (hand != InteractionHand.MAIN_HAND || !canActivate) {
@ -178,7 +185,7 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
serverPlayerEntity.displayClientMessage( serverPlayerEntity.displayClientMessage(
Component.translatable("message.betterend.fail_spawn"), Component.translatable("message.betterend.fail_spawn"),
true true
); );
} }
return InteractionResult.FAIL; return InteractionResult.FAIL;
} else if (!world.isClientSide) { } else if (!world.isClientSide) {

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
@ -12,10 +17,6 @@ import net.minecraft.world.level.storage.loot.LootContext;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.registry.EndBlocks;
import java.util.List; import java.util.List;
@ -29,7 +30,7 @@ public class RunedFlavolite extends BaseBlock {
unbreakable unbreakable
? Blocks.BEDROCK.getExplosionResistance() ? Blocks.BEDROCK.getExplosionResistance()
: Blocks.OBSIDIAN.getExplosionResistance() : Blocks.OBSIDIAN.getExplosionResistance()
) )
.luminance(state -> { .luminance(state -> {
return state.getValue(ACTIVATED) ? 8 : 0; return state.getValue(ACTIVATED) ? 8 : 0;
})); }));

View file

@ -1,5 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableCropBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
@ -7,10 +11,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import org.betterx.betterend.blocks.basis.PottableCropBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
public class ShadowBerryBlock extends PottableCropBlock { public class ShadowBerryBlock extends PottableCropBlock {
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 8, 15); private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 8, 15);

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.interfaces.TagProvider;
import org.betterx.betterend.blocks.basis.EndTerrainBlock;
import org.betterx.betterend.registry.EndParticles;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.tags.TagKey; import net.minecraft.tags.TagKey;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -12,11 +17,6 @@ import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.interfaces.TagProvider;
import org.betterx.betterend.blocks.basis.EndTerrainBlock;
import org.betterx.betterend.registry.EndParticles;
import java.util.List; import java.util.List;
public class ShadowGrassBlock extends EndTerrainBlock implements TagProvider { public class ShadowGrassBlock extends EndTerrainBlock implements TagProvider {
@ -36,7 +36,7 @@ public class ShadowGrassBlock extends EndTerrainBlock implements TagProvider {
0.0D, 0.0D,
0.0D, 0.0D,
0.0D 0.0D
); );
} }
} }

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.entity.SilkMothEntity;
import org.betterx.betterend.registry.EndEntities;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -29,14 +37,6 @@ import net.minecraft.world.phys.Vec3;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.entity.SilkMothEntity;
import org.betterx.betterend.registry.EndEntities;
import org.betterx.betterend.registry.EndItems;
public class SilkMothHiveBlock extends BaseBlock { public class SilkMothHiveBlock extends BaseBlock {
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS; public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS;
@ -98,12 +98,14 @@ public class SilkMothHiveBlock extends BaseBlock {
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public InteractionResult use(BlockState state, public InteractionResult use(
Level world, BlockState state,
BlockPos pos, Level world,
Player player, BlockPos pos,
InteractionHand hand, Player player,
BlockHitResult hit) { InteractionHand hand,
BlockHitResult hit
) {
if (hand == InteractionHand.MAIN_HAND) { if (hand == InteractionHand.MAIN_HAND) {
ItemStack stack = player.getMainHandItem(); ItemStack stack = player.getMainHandItem();
if (BaseShearsItem.isShear(stack) && state.getValue(FULLNESS) == 3) { if (BaseShearsItem.isShear(stack) && state.getValue(FULLNESS) == 3) {

View file

@ -1,5 +1,15 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.entity.SilkMothEntity;
import org.betterx.betterend.registry.EndEntities;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -33,16 +43,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.entity.SilkMothEntity;
import org.betterx.betterend.registry.EndEntities;
import org.betterx.betterend.registry.EndItems;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -87,12 +87,14 @@ public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, public BlockState updateShape(
Direction facing, BlockState state,
BlockState neighborState, Direction facing,
LevelAccessor world, BlockState neighborState,
BlockPos pos, LevelAccessor world,
BlockPos neighborPos) { BlockPos pos,
BlockPos neighborPos
) {
if (!state.getValue(ACTIVE)) { if (!state.getValue(ACTIVE)) {
if (canSupportCenter(world, pos.above(), Direction.DOWN) || world.getBlockState(pos.above()) if (canSupportCenter(world, pos.above(), Direction.DOWN) || world.getBlockState(pos.above())
.is(BlockTags.LEAVES)) { .is(BlockTags.LEAVES)) {
@ -163,12 +165,14 @@ public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public InteractionResult use(BlockState state, public InteractionResult use(
Level world, BlockState state,
BlockPos pos, Level world,
Player player, BlockPos pos,
InteractionHand hand, Player player,
BlockHitResult hit) { InteractionHand hand,
BlockHitResult hit
) {
if (hand == InteractionHand.MAIN_HAND) { if (hand == InteractionHand.MAIN_HAND) {
ItemStack stack = player.getMainHandItem(); ItemStack stack = player.getMainHandItem();
if (BaseShearsItem.isShear(stack) && state.getValue(ACTIVE) && state.getValue(FULLNESS) == 3) { if (BaseShearsItem.isShear(stack) && state.getValue(ACTIVE) && state.getValue(FULLNESS) == 3) {

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -8,18 +13,11 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import java.util.Optional; import java.util.Optional;
public class SmallAmaranitaBlock extends EndPlantBlock { public class SmallAmaranitaBlock extends EndPlantBlock {
@ -35,7 +33,14 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
BlockPos bigPos = growBig(world, pos); BlockPos bigPos = growBig(world, pos);
if (bigPos != null) { if (bigPos != null) {
if (EndFeatures.GIGANTIC_AMARANITA.getFeature() if (EndFeatures.GIGANTIC_AMARANITA.getFeature()
.place(new FeaturePlaceContext<>(Optional.empty(), world, null, random, bigPos, null))) { .place(new FeaturePlaceContext<>(
Optional.empty(),
world,
null,
random,
bigPos,
null
))) {
replaceMushroom(world, bigPos); replaceMushroom(world, bigPos);
replaceMushroom(world, bigPos.south()); replaceMushroom(world, bigPos.south());
replaceMushroom(world, bigPos.east()); replaceMushroom(world, bigPos.east());
@ -49,7 +54,8 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
null, null,
random, random,
pos, pos,
null)); null
));
} }
@Override @Override
@ -72,7 +78,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
private boolean checkFrame(ServerLevel world, BlockPos pos) { private boolean checkFrame(ServerLevel world, BlockPos pos) {
return world.getBlockState(pos).is(this) && world.getBlockState(pos.south()).is(this) && world.getBlockState(pos return world.getBlockState(pos).is(this) && world.getBlockState(pos.south()).is(this) && world.getBlockState(pos
.east()) .east())
.is(this) && world.getBlockState( .is(this) && world.getBlockState(
pos.south().east()).is(this); pos.south().east()).is(this);
} }

View file

@ -1,5 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.interfaces.PottablePlant;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -29,14 +38,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.interfaces.PottablePlant;
import org.betterx.betterend.registry.EndFeatures;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.List; import java.util.List;
@ -61,7 +62,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel( if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
Enchantments.SILK_TOUCH, Enchantments.SILK_TOUCH,
tool tool
) > 0) { ) > 0) {
return Lists.newArrayList(new ItemStack(this)); return Lists.newArrayList(new ItemStack(this));
} else { } else {
return Lists.newArrayList(); return Lists.newArrayList();
@ -110,7 +111,8 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
null, null,
random, random,
pos, pos,
null)); null
));
} }
@Override @Override

View file

@ -1,13 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.betterend.blocks.basis.LitPillarBlock;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.betterend.blocks.basis.LitPillarBlock;
public class SmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe { public class SmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe {
public SmaragdantCrystalBlock() { public SmaragdantCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS) super(FabricBlockSettings.of(Material.GLASS)

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
@ -22,10 +27,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import java.util.EnumMap; import java.util.EnumMap;

View file

@ -1,5 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -26,13 +34,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems;
import java.util.Collections; import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;

View file

@ -1,5 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseVineBlock;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndParticles;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -13,12 +19,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import org.betterx.bclib.blocks.BaseVineBlock;
import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndParticles;
public class TenaneaFlowersBlock extends BaseVineBlock implements CustomColorProvider { public class TenaneaFlowersBlock extends BaseVineBlock implements CustomColorProvider {
public static final Vec3i[] COLORS; public static final Vec3i[] COLORS;

View file

@ -1,14 +1,14 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures;
public class TenaneaSaplingBlock extends PottableFeatureSapling { public class TenaneaSaplingBlock extends PottableFeatureSapling {
public TenaneaSaplingBlock() { public TenaneaSaplingBlock() {
super((state) -> EndFeatures.TENANEA); super((state) -> EndFeatures.TENANEA);

View file

@ -1,10 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
public class TerrainPlantBlock extends EndPlantBlock { public class TerrainPlantBlock extends EndPlantBlock {
private final Block[] ground; private final Block[] ground;

Some files were not shown because too many files have changed in this diff Show more