Merge remote-tracking branch 'refs/remotes/origin/1.19' into 1.19

This commit is contained in:
Shazuli 2022-06-08 21:20:09 +02:00
commit b6ba0ed869
416 changed files with 5772 additions and 4573 deletions

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,9 +12,6 @@ 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

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;

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;
@ -50,10 +51,12 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye
@Override @Override
@Deprecated @Deprecated
public VoxelShape getVisualShape(BlockState blockState, public VoxelShape getVisualShape(
BlockState blockState,
BlockGetter blockGetter, BlockGetter blockGetter,
BlockPos blockPos, BlockPos blockPos,
CollisionContext collisionContext) { 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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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));

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(
Level world,
BlockPos pos, BlockPos pos,
BlockState state, BlockState state,
@Nullable LivingEntity placer, @Nullable LivingEntity placer,
ItemStack itemStack) { 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;

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

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));
@ -56,12 +56,14 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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(
ResourceLocation stateId,
BlockState blockState, BlockState blockState,
Map<ResourceLocation, UnbakedModel> modelCache) { 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(
Level world,
Player player, Player player,
BlockPos pos, BlockPos pos,
BlockState state, BlockState state,
@Nullable BlockEntity blockEntity, @Nullable BlockEntity blockEntity,
ItemStack stack) { 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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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()

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) {

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) {

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(
BlockState state,
Direction direction, Direction direction,
BlockState newState, BlockState newState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos posFrom) { 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;
@ -91,12 +91,14 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
} }
@Override @Override
public BlockState updateShape(BlockState state, public BlockState updateShape(
BlockState state,
Direction direction, Direction direction,
BlockState newState, BlockState newState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos posFrom) { BlockPos posFrom
) {
return state; return state;
} }
@ -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 currentWorld,
ServerLevel targetWorld, ServerLevel targetWorld,
BlockPos currentPos, BlockPos currentPos,
Entity entity) { 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,7 +153,8 @@ 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.getX() * multiplier,
currentPos.getY(), currentPos.getY(),
currentPos.getZ() * multiplier currentPos.getZ() * multiplier
); );

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(
BlockState state,
Level world, Level world,
BlockPos pos, BlockPos pos,
Player player, Player player,
InteractionHand hand, InteractionHand hand,
BlockHitResult hit) { BlockHitResult hit
) {
if (world.isClientSide) { if (world.isClientSide) {
return InteractionResult.SUCCESS; return InteractionResult.SUCCESS;
} else { } else {
@ -170,9 +173,11 @@ 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(
Level level,
BlockState blockState, BlockState blockState,
BlockEntityType<T> blockEntityType) { BlockEntityType<T> blockEntityType
) {
return level.isClientSide() ? null : createTickerHelper( return level.isClientSide() ? null : createTickerHelper(
blockEntityType, blockEntityType,
EndBlockEntities.END_STONE_SMELTER, EndBlockEntities.END_STONE_SMELTER,

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;

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(
BlockState state,
Direction direction, Direction direction,
BlockState newState, BlockState newState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos posFrom) { 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;
@ -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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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(
BlockState state,
Level level, Level level,
BlockPos pos, BlockPos pos,
Player player, Player player,
InteractionHand hand, InteractionHand hand,
BlockHitResult hit) { BlockHitResult hit
) {
if (level.isClientSide) { if (level.isClientSide) {
return InteractionResult.CONSUME; return InteractionResult.CONSUME;
} }
@ -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(
ResourceLocation stateId,
BlockState blockState, BlockState blockState,
Map<ResourceLocation, UnbakedModel> modelCache) { 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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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() {

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 {

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(

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

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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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(
Level world,
BlockPos pos, BlockPos pos,
BlockState state, BlockState state,
@Nullable LivingEntity placer, @Nullable LivingEntity placer,
ItemStack itemStack) { 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(
Level level,
BlockState blockState, BlockState blockState,
BlockEntityType<T> blockEntityType) { 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(
Level level,
BlockState blockState, BlockState blockState,
BlockEntityType<T> blockEntityType) { 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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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));

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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { BlockPos neighborPos
) {
if (absorbWater(world, pos)) { if (absorbWater(world, pos)) {
return EndBlocks.MENGER_SPONGE_WET.defaultBlockState(); return EndBlocks.MENGER_SPONGE_WET.defaultBlockState();
} }
@ -114,10 +117,12 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
} }
@Override @Override
public VoxelShape getShape(BlockState blockState, public VoxelShape getShape(
BlockState blockState,
BlockGetter blockGetter, BlockGetter blockGetter,
BlockPos blockPos, BlockPos blockPos,
CollisionContext collisionContext) { CollisionContext collisionContext
) {
return SHAPE; return SHAPE;
} }

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() {
@ -119,10 +119,12 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLaye
} }
@Override @Override
public VoxelShape getShape(BlockState blockState, public VoxelShape getShape(
BlockState blockState,
BlockGetter blockGetter, BlockGetter blockGetter,
BlockPos blockPos, BlockPos blockPos,
CollisionContext collisionContext) { 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;

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 {

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;

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;

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(
BlockState state,
Direction direction, Direction direction,
BlockState newState, BlockState newState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos posFrom) { 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(
WorldGenLevel world,
MutableBlockPos pos, MutableBlockPos pos,
RandomSource random, RandomSource random,
List<MutableBlockPos> ends, List<MutableBlockPos> ends,
int length) { 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(
WorldGenLevel world,
BlockPos pos, BlockPos pos,
BlockState iterState, BlockState iterState,
Direction dir, Direction dir,
RandomSource random) { 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(
BlockState blockState,
BlockGetter blockGetter, BlockGetter blockGetter,
BlockPos blockPos, BlockPos blockPos,
PathComputationType pathComputationType) { 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(
BlockState state,
Level level, Level level,
BlockPos pos, BlockPos pos,
Player player, Player player,
InteractionHand hand, InteractionHand hand,
BlockHitResult hit) { 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(
ResourceLocation stateId,
BlockState blockState, BlockState blockState,
Map<ResourceLocation, UnbakedModel> modelCache) { 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(
Level world,
BlockPos pos, BlockPos pos,
BlockState state, BlockState state,
@Nullable LivingEntity placer, @Nullable LivingEntity placer,
ItemStack itemStack) { 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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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(
BlockState state,
Level world, Level world,
BlockPos pos, BlockPos pos,
Player player, Player player,
InteractionHand hand, InteractionHand hand,
BlockHitResult hit) { 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) {

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;

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 {

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(
BlockState state,
Level world, Level world,
BlockPos pos, BlockPos pos,
Player player, Player player,
InteractionHand hand, InteractionHand hand,
BlockHitResult hit) { 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(
BlockState state,
Direction facing, Direction facing,
BlockState neighborState, BlockState neighborState,
LevelAccessor world, LevelAccessor world,
BlockPos pos, BlockPos pos,
BlockPos neighborPos) { 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(
BlockState state,
Level world, Level world,
BlockPos pos, BlockPos pos,
Player player, Player player,
InteractionHand hand, InteractionHand hand,
BlockHitResult hit) { 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

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;
@ -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;

View file

@ -1,5 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseDoublePlantBlock;
import org.betterx.bclib.util.BlocksHelper;
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.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@ -10,11 +15,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.BaseDoublePlantBlock;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class TwistedUmbrellaMossBlock extends EndPlantBlock { public class TwistedUmbrellaMossBlock extends EndPlantBlock {
public TwistedUmbrellaMossBlock() { public TwistedUmbrellaMossBlock() {
super(11); super(11);

View file

@ -1,5 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseDoublePlantBlock;
import org.betterx.betterend.registry.EndBlocks;
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;
@ -7,9 +10,6 @@ import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import org.betterx.bclib.blocks.BaseDoublePlantBlock;
import org.betterx.betterend.registry.EndBlocks;
public class TwistedUmbrellaMossTallBlock extends BaseDoublePlantBlock { public class TwistedUmbrellaMossTallBlock extends BaseDoublePlantBlock {
public TwistedUmbrellaMossTallBlock() { public TwistedUmbrellaMossTallBlock() {
super(12); super(12);

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