Merge remote-tracking branch 'refs/remotes/origin/1.19' into 1.19
This commit is contained in:
commit
b6ba0ed869
416 changed files with 5772 additions and 4573 deletions
|
@ -1,11 +1,5 @@
|
|||
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.levelgen.biomes.BiomeAPI;
|
||||
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.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 static final String MOD_ID = "betterend";
|
||||
public static final Logger LOGGER = new Logger(MOD_ID);
|
||||
|
@ -60,8 +60,10 @@ public class BetterEnd implements ModInitializer {
|
|||
|
||||
if (GeneratorOptions.useNewGenerator()) {
|
||||
org.betterx.bclib.api.v2.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock());
|
||||
org.betterx.bclib.api.v2.generator.GeneratorOptions.setEndLandFunction((pos) -> TerrainGenerator.isLand(pos.x,
|
||||
pos.y));
|
||||
org.betterx.bclib.api.v2.generator.GeneratorOptions.setEndLandFunction((pos) -> TerrainGenerator.isLand(
|
||||
pos.x,
|
||||
pos.y
|
||||
));
|
||||
}
|
||||
|
||||
BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
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.betterend.blocks.basis.EndAnvilBlock;
|
||||
import org.betterx.betterend.item.material.EndToolMaterial;
|
||||
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 AeterniumAnvil() {
|
||||
super(EndBlocks.AETERNIUM_BLOCK.defaultMaterialColor(), EndToolMaterial.AETERNIUM.getLevel());
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.world.item.BlockItem;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
|
@ -9,18 +12,15 @@ import net.minecraft.world.level.material.MaterialColor;
|
|||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.fabricmc.fabric.api.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 AeterniumBlock() {
|
||||
super(FabricBlockSettings
|
||||
.of(Material.METAL, MaterialColor.COLOR_GRAY)
|
||||
.hardness(65F)
|
||||
.resistance(1200F)
|
||||
.requiresCorrectToolForDrops()
|
||||
.sound(SoundType.NETHERITE_BLOCK)
|
||||
);
|
||||
.of(Material.METAL, MaterialColor.COLOR_GRAY)
|
||||
.hardness(65F)
|
||||
.resistance(1200F)
|
||||
.requiresCorrectToolForDrops()
|
||||
.sound(SoundType.NETHERITE_BLOCK)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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.material.Material;
|
||||
|
||||
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 AmaranitaCapBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
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.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
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 AmaranitaHymenophoreBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
|
||||
|
||||
public class AmaranitaStemBlock extends BaseRotatedPillarBlock {
|
||||
public AmaranitaStemBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).mapColor(MaterialColor.COLOR_LIGHT_GREEN));
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
public class AmberBlock extends BaseBlock {
|
||||
public AmberBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MaterialColor.COLOR_YELLOW));
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.Direction;
|
||||
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 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.List;
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class AncientEmeraldIceBlock extends BaseBlock {
|
|||
0.5,
|
||||
0.5,
|
||||
0
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
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.item.ItemColor;
|
||||
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 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;
|
||||
|
||||
|
@ -39,21 +40,23 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye
|
|||
|
||||
public AuroraCrystalBlock() {
|
||||
super(FabricBlockSettings
|
||||
.of(Material.GLASS)
|
||||
.hardness(1F)
|
||||
.resistance(1F)
|
||||
.luminance(15)
|
||||
.noOcclusion()
|
||||
.isSuffocating((state, world, pos) -> false)
|
||||
.sound(SoundType.GLASS));
|
||||
.of(Material.GLASS)
|
||||
.hardness(1F)
|
||||
.resistance(1F)
|
||||
.luminance(15)
|
||||
.noOcclusion()
|
||||
.isSuffocating((state, world, pos) -> false)
|
||||
.sound(SoundType.GLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public VoxelShape getVisualShape(BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
CollisionContext collisionContext) {
|
||||
public VoxelShape getVisualShape(
|
||||
BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
CollisionContext collisionContext
|
||||
) {
|
||||
return this.getCollisionShape(blockState, blockGetter, blockPos, collisionContext);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
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 static final EnumProperty<BlockProperties.TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.Direction;
|
||||
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 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 static final BooleanProperty NATURAL = BlockProperties.NATURAL;
|
||||
|
||||
|
@ -37,12 +37,14 @@ public class BlueVineLanternBlock extends BaseBlock implements AddMineableAxe {
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
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.util.BlocksHelper;
|
||||
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.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 BlueVineSeedBlock() {
|
||||
super(p -> p.offsetType(BlockBehaviour.OffsetType.NONE));
|
||||
|
@ -31,21 +31,21 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
|||
pos,
|
||||
EndBlocks.BLUE_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.BOTTOM)
|
||||
);
|
||||
);
|
||||
for (int i = 1; i < height; i++) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.above(i),
|
||||
EndBlocks.BLUE_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.MIDDLE)
|
||||
);
|
||||
);
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.above(height),
|
||||
EndBlocks.BLUE_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP)
|
||||
);
|
||||
);
|
||||
placeLantern(world, pos.above(height + 1));
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
|||
world,
|
||||
pos,
|
||||
EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)
|
||||
);
|
||||
);
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
BlockPos p = pos.relative(dir);
|
||||
if (world.isEmptyBlock(p)) {
|
||||
|
@ -62,7 +62,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
|||
world,
|
||||
p,
|
||||
EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
if (world.isEmptyBlock(pos.above())) {
|
||||
|
@ -70,7 +70,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
|||
world,
|
||||
pos.above(),
|
||||
EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.util.RandomSource;
|
||||
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 com.google.common.collect.Lists;
|
||||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.core.BlockPos;
|
||||
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 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;
|
||||
|
||||
public class BrimstoneBlock extends BaseBlock {
|
||||
|
@ -40,11 +40,13 @@ public class BrimstoneBlock extends BaseBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setPlacedBy(Level world,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable LivingEntity placer,
|
||||
ItemStack itemStack) {
|
||||
public void setPlacedBy(
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable LivingEntity placer,
|
||||
ItemStack itemStack
|
||||
) {
|
||||
if (world.isClientSide()) {
|
||||
updateChunks((ClientLevel) world, pos);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.particles.ParticleTypes;
|
||||
import net.minecraft.util.RandomSource;
|
||||
|
@ -17,9 +20,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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 {
|
||||
|
||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.world.item.ItemStack;
|
||||
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 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;
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.core.BlockPos;
|
||||
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 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.Optional;
|
||||
|
@ -68,7 +69,7 @@ public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayer
|
|||
? Patterns.createJson(
|
||||
Patterns.BLOCK_BULB_LANTERN_FLOOR,
|
||||
textures
|
||||
)
|
||||
)
|
||||
: Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures);
|
||||
return ModelsHelper.fromPattern(pattern);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.item.ItemColor;
|
||||
|
||||
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 BulbVineLanternColoredBlock(FabricBlockSettings settings) {
|
||||
super(settings);
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
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.blocks.BlockProperties;
|
||||
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.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 {
|
||||
|
||||
@Override
|
||||
|
@ -30,20 +30,20 @@ public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
|||
world,
|
||||
pos,
|
||||
EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)
|
||||
);
|
||||
);
|
||||
for (int i = 1; i < h; i++) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.below(i),
|
||||
EndBlocks.BULB_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)
|
||||
);
|
||||
);
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.below(h),
|
||||
EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.world.item.ItemStack;
|
||||
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 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.List;
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.Direction;
|
||||
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.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 CavePumpkinVineBlock() {
|
||||
super(p -> p.offsetType(BlockBehaviour.OffsetType.NONE));
|
||||
|
@ -44,7 +44,7 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
|||
world.setBlockAndUpdate(
|
||||
pos.below(),
|
||||
EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(BlockProperties.SMALL, true)
|
||||
);
|
||||
);
|
||||
} else if (age == 3) {
|
||||
world.setBlockAndUpdate(pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState());
|
||||
}
|
||||
|
@ -56,12 +56,14 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
state = super.updateShape(state, facing, neighborState, world, pos, neighborPos);
|
||||
if (state.is(this) && state.getValue(BlockProperties.AGE) > 1) {
|
||||
BlockState down = world.getBlockState(pos.below());
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
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.resources.model.BlockModelRotation;
|
||||
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 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.Map;
|
||||
|
@ -77,9 +78,11 @@ public class ChandelierBlock extends BaseAttachedBlock implements RenderLayerPro
|
|||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public UnbakedModel getModelVariant(ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||
public UnbakedModel getModelVariant(
|
||||
ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache
|
||||
) {
|
||||
String state = "_wall";
|
||||
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
|
||||
switch (blockState.getValue(FACING)) {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.registry.FuelRegistry;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
public class CharcoalBlock extends BaseBlock {
|
||||
public CharcoalBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.COAL_BLOCK));
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
|
||||
public class CharniaBlock extends EndUnderwaterPlantBlock {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class ChorusGrassBlock extends EndPlantBlock {
|
||||
public ChorusGrassBlock() {
|
||||
super(true);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.enchantment.EnchantmentHelper;
|
||||
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 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.List;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
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;
|
||||
|
||||
public class DenseSnowBlock extends BaseBlock {
|
||||
public DenseSnowBlock() {
|
||||
super(FabricBlockSettings.of(Material.SNOW).strength(0.2F).sound(SoundType.SNOW));
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
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 DragonTreeSaplingBlock() {
|
||||
super((state) -> EndFeatures.DRAGON_TREE);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -23,10 +27,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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.List;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -42,12 +42,14 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements RenderLayer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void playerDestroy(Level world,
|
||||
Player player,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable BlockEntity blockEntity,
|
||||
ItemStack stack) {
|
||||
public void playerDestroy(
|
||||
Level world,
|
||||
Player player,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable BlockEntity blockEntity,
|
||||
ItemStack stack
|
||||
) {
|
||||
super.playerDestroy(world, player, pos, state, blockEntity, stack);
|
||||
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) {
|
||||
if (world.dimensionType().ultraWarm()) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
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 static final EnumProperty<HydraluxShape> HYDRALUX_SHAPE = EnumProperty.create("shape", HydraluxShape.class);
|
||||
public static final EnumProperty<PedestalState> PEDESTAL_STATE = EnumProperty.create("state", PedestalState.class);
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.Direction;
|
||||
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 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.List;
|
||||
|
@ -51,12 +52,14 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineable
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return state.getValue(SHAPE) == TripleShape.TOP
|
||||
? Blocks.AIR.defaultBlockState()
|
||||
|
@ -103,7 +106,7 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineable
|
|||
return Lists.newArrayList(
|
||||
new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE)),
|
||||
new ItemStack(EndBlocks.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE))
|
||||
);
|
||||
);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
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.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.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 {
|
||||
@Override
|
||||
public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) {
|
||||
|
@ -20,21 +20,21 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
world,
|
||||
pos,
|
||||
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.BOTTOM)
|
||||
);
|
||||
);
|
||||
BlockPos up = pos.above();
|
||||
while (world.getFluidState(up).isSource()) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
up,
|
||||
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.MIDDLE)
|
||||
);
|
||||
);
|
||||
up = up.above();
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
up,
|
||||
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.world.item.ItemStack;
|
||||
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 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;
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.Direction;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -22,14 +30,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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 static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.MutableBlockPos;
|
||||
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.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 {
|
||||
@Override
|
||||
public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) {
|
||||
|
@ -43,7 +43,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
world,
|
||||
bpos,
|
||||
startLeaf.setValue(EndLotusStemBlock.SHAPE, shape).setValue(EndLotusStemBlock.FACING, dir)
|
||||
);
|
||||
);
|
||||
} else {
|
||||
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, shape));
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
p.set(pos).move(move),
|
||||
leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move)
|
||||
.setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE)
|
||||
);
|
||||
);
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Direction d1 = BlocksHelper.HORIZONTAL[i];
|
||||
|
@ -113,7 +113,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
p.set(pos).move(d1).move(d2),
|
||||
leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1)
|
||||
.setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
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.Direction;
|
||||
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 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;
|
||||
|
||||
|
@ -84,12 +85,14 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom
|
||||
) {
|
||||
if (state.getValue(WATERLOGGED)) {
|
||||
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
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.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.blocks.basis.PedestalBlock;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.item.ItemColor;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
@ -31,14 +39,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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.Optional;
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
|
|||
0.5F,
|
||||
random.nextFloat() * 0.4F + 0.8F,
|
||||
false
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
double x = pos.getX() + random.nextDouble();
|
||||
|
@ -91,12 +91,14 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom
|
||||
) {
|
||||
return state;
|
||||
}
|
||||
|
||||
|
@ -119,7 +121,7 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
|
|||
exitPos.getZ() + 0.5,
|
||||
entity.getYRot(),
|
||||
entity.getXRot()
|
||||
);
|
||||
);
|
||||
} else {
|
||||
((TeleportingEntity) entity).be_setExitPos(exitPos);
|
||||
Optional<Entity> teleported = Optional.ofNullable(entity.changeDimension(destination));
|
||||
|
@ -136,10 +138,12 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
|
|||
return BCLRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
private BlockPos findExitPos(ServerLevel currentWorld,
|
||||
ServerLevel targetWorld,
|
||||
BlockPos currentPos,
|
||||
Entity entity) {
|
||||
private BlockPos findExitPos(
|
||||
ServerLevel currentWorld,
|
||||
ServerLevel targetWorld,
|
||||
BlockPos currentPos,
|
||||
Entity entity
|
||||
) {
|
||||
if (targetWorld == null) return null;
|
||||
Registry<DimensionType> registry = targetWorld.registryAccess()
|
||||
.registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);
|
||||
|
@ -149,10 +153,11 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
|
|||
double currentMultiplier = Objects.requireNonNull(registry.get(currentWorldId)).coordinateScale();
|
||||
double multiplier = targetMultiplier > currentMultiplier ? 1.0 / targetMultiplier : currentMultiplier;
|
||||
MutableBlockPos basePos = currentPos.mutable()
|
||||
.set(currentPos.getX() * multiplier,
|
||||
currentPos.getY(),
|
||||
currentPos.getZ() * multiplier
|
||||
);
|
||||
.set(
|
||||
currentPos.getX() * multiplier,
|
||||
currentPos.getY(),
|
||||
currentPos.getZ() * multiplier
|
||||
);
|
||||
MutableBlockPos checkPos = basePos.mutable();
|
||||
BlockState currentState = currentWorld.getBlockState(currentPos);
|
||||
int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1;
|
||||
|
@ -162,7 +167,7 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
|
|||
radius,
|
||||
this,
|
||||
state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL))
|
||||
);
|
||||
);
|
||||
if (checkPos != null) {
|
||||
BlockState checkState = targetWorld.getBlockState(checkPos);
|
||||
Axis axis = checkState.getValue(AXIS);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.Direction;
|
||||
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 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 org.jetbrains.annotations.Nullable;
|
||||
|
@ -56,12 +57,14 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
|||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public InteractionResult use(BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit) {
|
||||
public InteractionResult use(
|
||||
BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit
|
||||
) {
|
||||
if (world.isClientSide) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
|
@ -154,7 +157,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
|||
1.0F,
|
||||
1.0F,
|
||||
false
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
Direction direction = state.getValue(FACING);
|
||||
|
@ -170,13 +173,15 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level,
|
||||
BlockState blockState,
|
||||
BlockEntityType<T> blockEntityType) {
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(
|
||||
Level level,
|
||||
BlockState blockState,
|
||||
BlockEntityType<T> blockEntityType
|
||||
) {
|
||||
return level.isClientSide() ? null : createTickerHelper(
|
||||
blockEntityType,
|
||||
EndBlockEntities.END_STONE_SMELTER,
|
||||
EndStoneSmelterBlockEntity::tick
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
|
@ -11,8 +13,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
public class EnderBlock extends BaseBlock {
|
||||
|
||||
public EnderBlock() {
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.tags.TagKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
|
@ -15,11 +20,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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.List;
|
||||
|
||||
|
@ -29,9 +29,9 @@ public class EndstoneDustBlock extends FallingBlock implements TagProvider, AddM
|
|||
|
||||
public EndstoneDustBlock() {
|
||||
super(FabricBlockSettings
|
||||
.copyOf(Blocks.SAND)
|
||||
.mapColor(Blocks.END_STONE.defaultMaterialColor())
|
||||
);
|
||||
.copyOf(Blocks.SAND)
|
||||
.mapColor(Blocks.END_STONE.defaultMaterialColor())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.Direction;
|
||||
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 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;
|
||||
|
||||
|
@ -75,12 +76,14 @@ public class EternalPedestal extends PedestalBlock {
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom
|
||||
) {
|
||||
BlockState updated = super.updateShape(state, direction, newState, world, pos, posFrom);
|
||||
if (!updated.is(this)) return updated;
|
||||
if (!this.isPlaceable(updated)) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseVineBlock;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
|
||||
public class FilaluxBlock extends BaseVineBlock {
|
||||
public FilaluxBlock() {
|
||||
super(15, true, p -> p.offsetType(BlockBehaviour.OffsetType.NONE));
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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.material.Material;
|
||||
|
||||
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 FilaluxLanternBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD)
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.Direction;
|
||||
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 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;
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.resources.ResourceLocation;
|
||||
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 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;
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.core.BlockPos;
|
||||
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.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 {
|
||||
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
||||
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
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.renderer.block.model.BlockModel;
|
||||
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.gson.JsonElement;
|
||||
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.util.List;
|
||||
|
@ -79,7 +80,7 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
|
|||
.setValue(PLANT_ID, 0)
|
||||
.setValue(SOIL_ID, 0)
|
||||
.setValue(POT_LIGHT, 0)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -104,12 +105,14 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
int plantID = state.getValue(PLANT_ID);
|
||||
if (plantID < 1 || plantID > plants.length || plants[plantID - 1] == null) {
|
||||
return state.getValue(POT_LIGHT) > 0 ? state.setValue(POT_LIGHT, 0) : state;
|
||||
|
@ -205,12 +208,14 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public InteractionResult use(BlockState state,
|
||||
Level level,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit) {
|
||||
public InteractionResult use(
|
||||
BlockState state,
|
||||
Level level,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit
|
||||
) {
|
||||
if (level.isClientSide) {
|
||||
return InteractionResult.CONSUME;
|
||||
}
|
||||
|
@ -236,7 +241,7 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
|
|||
SoundSource.BLOCKS,
|
||||
1,
|
||||
1
|
||||
);
|
||||
);
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -276,7 +281,7 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
|
|||
SoundSource.BLOCKS,
|
||||
1,
|
||||
1
|
||||
);
|
||||
);
|
||||
if (!player.isCreative()) {
|
||||
itemStack.shrink(1);
|
||||
}
|
||||
|
@ -295,9 +300,11 @@ public class FlowerPotBlock extends BaseBlockNotFull implements RenderLayerProvi
|
|||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public UnbakedModel getModelVariant(ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||
public UnbakedModel getModelVariant(
|
||||
ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache
|
||||
) {
|
||||
MultiPartBuilder model = MultiPartBuilder.create(stateDefinition);
|
||||
model.part(new ModelResourceLocation(stateId.getNamespace(), stateId.getPath(), "inventory")).add();
|
||||
Transformation offset = new Transformation(new Vector3f(0, 7.5F / 16F, 0), null, null, null);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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.material.Material;
|
||||
|
||||
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 GlowingHymenophoreBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.world.level.BlockGetter;
|
||||
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.Environment;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
public class GlowingMossBlock extends EndPlantBlock {
|
||||
public GlowingMossBlock(int light) {
|
||||
super(light);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.Direction;
|
||||
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 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 static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
||||
|
||||
|
@ -39,12 +39,14 @@ public class GlowingPillarLuminophorBlock extends BaseBlock implements AddMineab
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.world.item.ItemStack;
|
||||
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.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 static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.MutableBlockPos;
|
||||
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 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 GlowingPillarSeedBlock() {
|
||||
|
@ -53,7 +53,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddM
|
|||
world,
|
||||
mut,
|
||||
EndBlocks.GLOWING_PILLAR_LUMINOPHOR.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)
|
||||
);
|
||||
);
|
||||
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||
pos = mut.relative(dir);
|
||||
if (world.isEmptyBlock(pos)) {
|
||||
|
@ -61,7 +61,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddM
|
|||
world,
|
||||
pos,
|
||||
EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, dir)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
mut.move(Direction.UP);
|
||||
|
@ -71,7 +71,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddM
|
|||
mut,
|
||||
EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState()
|
||||
.setValue(BlockStateProperties.FACING, Direction.UP)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
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.item.ItemColor;
|
||||
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 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;
|
||||
|
||||
public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider, AddMineableShears {
|
||||
|
@ -35,12 +35,12 @@ public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvid
|
|||
|
||||
public HelixTreeLeavesBlock() {
|
||||
super(FabricBlockSettings
|
||||
.of(Material.LEAVES)
|
||||
.mapColor(MaterialColor.COLOR_ORANGE)
|
||||
.sound(SoundType.WART_BLOCK)
|
||||
.sound(SoundType.GRASS)
|
||||
.strength(0.2F)
|
||||
);
|
||||
.of(Material.LEAVES)
|
||||
.mapColor(MaterialColor.COLOR_ORANGE)
|
||||
.sound(SoundType.WART_BLOCK)
|
||||
.sound(SoundType.GRASS)
|
||||
.strength(0.2F)
|
||||
);
|
||||
|
||||
TagAPI.addBlockTag(NamedBlockTags.LEAVES, this);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
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 HelixTreeSaplingBlock() {
|
||||
super((state) -> EndFeatures.HELIX_TREE);
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.util.RandomSource;
|
||||
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 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.List;
|
||||
|
@ -84,8 +85,10 @@ public class HydraluxBlock extends UnderwaterPlantBlock implements AddMineableSh
|
|||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
HydraluxShape shape = state.getValue(SHAPE);
|
||||
if (shape == HydraluxShape.FLOWER_BIG_BOTTOM || shape == HydraluxShape.FLOWER_SMALL_BOTTOM) {
|
||||
return Lists.newArrayList(new ItemStack(EndItems.HYDRALUX_PETAL,
|
||||
MHelper.randRange(1, 4, MHelper.RANDOM_SOURCE)));
|
||||
return Lists.newArrayList(new ItemStack(
|
||||
EndItems.HYDRALUX_PETAL,
|
||||
MHelper.randRange(1, 4, MHelper.RANDOM_SOURCE)
|
||||
));
|
||||
} else if (shape == HydraluxShape.ROOTS) {
|
||||
return Lists.newArrayList(new ItemStack(
|
||||
EndBlocks.HYDRALUX_SAPLING,
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.world.entity.Entity;
|
||||
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 org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
|
||||
|
||||
public class HydraluxPetalBlock extends BaseBlock implements AddMineableAxe {
|
||||
public HydraluxPetalBlock() {
|
||||
this(
|
||||
|
@ -22,7 +22,7 @@ public class HydraluxPetalBlock extends BaseBlock implements AddMineableAxe {
|
|||
.resistance(1)
|
||||
.mapColor(MaterialColor.PODZOL)
|
||||
.sound(SoundType.WART_BLOCK)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
public HydraluxPetalBlock(Properties settings) {
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.item.ItemColor;
|
||||
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.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 org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.MutableBlockPos;
|
||||
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.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 {
|
||||
|
||||
@Override
|
||||
|
@ -32,14 +32,14 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
|
|||
world,
|
||||
pos,
|
||||
state.setValue(EndBlockProperties.HYDRALUX_SHAPE, EndBlockProperties.HydraluxShape.ROOTS)
|
||||
);
|
||||
);
|
||||
for (int i = 1; i < h - 2; i++) {
|
||||
mut.setY(pos.getY() + i);
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut,
|
||||
state.setValue(EndBlockProperties.HYDRALUX_SHAPE, EndBlockProperties.HydraluxShape.VINE)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
mut.setY(mut.getY() + 1);
|
||||
|
@ -52,8 +52,8 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
|
|||
big
|
||||
? EndBlockProperties.HydraluxShape.FLOWER_BIG_BOTTOM
|
||||
: EndBlockProperties.HydraluxShape.FLOWER_SMALL_BOTTOM
|
||||
)
|
||||
);
|
||||
)
|
||||
);
|
||||
|
||||
mut.setY(mut.getY() + 1);
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
|
@ -64,8 +64,8 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
|
|||
big
|
||||
? EndBlockProperties.HydraluxShape.FLOWER_BIG_TOP
|
||||
: EndBlockProperties.HydraluxShape.FLOWER_SMALL_TOP
|
||||
)
|
||||
);
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
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.Direction;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
|
@ -31,13 +38,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -81,12 +81,14 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return Blocks.WATER.defaultBlockState();
|
||||
} else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) {
|
||||
|
@ -123,11 +125,13 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setPlacedBy(Level world,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable LivingEntity placer,
|
||||
ItemStack itemStack) {
|
||||
public void setPlacedBy(
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable LivingEntity placer,
|
||||
ItemStack itemStack
|
||||
) {
|
||||
if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above())
|
||||
.is(Blocks.WATER)) {
|
||||
tick(state, (ServerLevel) world, pos, world.random);
|
||||
|
@ -147,9 +151,11 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level,
|
||||
BlockState blockState,
|
||||
BlockEntityType<T> blockEntityType) {
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(
|
||||
Level level,
|
||||
BlockState blockState,
|
||||
BlockEntityType<T> blockEntityType
|
||||
) {
|
||||
return BlockEntityHydrothermalVent::tick;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.world.level.BlockGetter;
|
||||
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.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;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -79,9 +79,11 @@ public class InfusionPedestal extends PedestalBlock {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level,
|
||||
BlockState blockState,
|
||||
BlockEntityType<T> blockEntityType) {
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(
|
||||
Level level,
|
||||
BlockState blockState,
|
||||
BlockEntityType<T> blockEntityType
|
||||
) {
|
||||
return InfusionPedestalEntity::tickEnity;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
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.item.ItemColor;
|
||||
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 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.Optional;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
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 LacugroveSaplingBlock() {
|
||||
super((state) -> EndFeatures.LACUGROVE);
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.Direction;
|
||||
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.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.List;
|
||||
|
||||
|
@ -50,12 +50,14 @@ public class LanceleafBlock extends EndPlantBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
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.PentaShape;
|
||||
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.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 LanceleafSeedBlock() {
|
||||
super(p -> p.offsetType(OffsetType.NONE));
|
||||
|
@ -34,24 +34,24 @@ public class LanceleafSeedBlock extends EndPlantWithAgeBlock {
|
|||
world,
|
||||
mut.move(Direction.UP),
|
||||
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_BOTTOM)
|
||||
);
|
||||
);
|
||||
for (int i = 2; i < height - 2; i++) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut.move(Direction.UP),
|
||||
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.MIDDLE)
|
||||
);
|
||||
);
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut.move(Direction.UP),
|
||||
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_TOP)
|
||||
);
|
||||
);
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut.move(Direction.UP),
|
||||
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.TOP)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.util.RandomSource;
|
||||
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 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 static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 14, 12);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
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 LucerniaSaplingBlock() {
|
||||
super((state) -> EndFeatures.LUCERNIA);
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
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.Direction;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -20,22 +29,15 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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.List;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableAxe {
|
||||
public static final EnumProperty<EndBlockProperties.LumecornShape> SHAPE = EnumProperty.create("shape",
|
||||
EndBlockProperties.LumecornShape.class);
|
||||
public static final EnumProperty<EndBlockProperties.LumecornShape> SHAPE = EnumProperty.create(
|
||||
"shape",
|
||||
EndBlockProperties.LumecornShape.class
|
||||
);
|
||||
private static final VoxelShape SHAPE_BOTTOM = Block.box(6, 0, 6, 10, 16, 10);
|
||||
private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10);
|
||||
|
||||
|
@ -73,12 +75,14 @@ public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.util.RandomSource;
|
||||
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.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;
|
||||
|
||||
public class LumecornSeedBlock extends EndPlantWithAgeBlock {
|
||||
|
@ -28,7 +28,8 @@ public class LumecornSeedBlock extends EndPlantWithAgeBlock {
|
|||
null,
|
||||
random,
|
||||
pos,
|
||||
null));
|
||||
null
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.Direction;
|
||||
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 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;
|
||||
|
||||
|
@ -44,12 +45,14 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (absorbWater(world, pos)) {
|
||||
return EndBlocks.MENGER_SPONGE_WET.defaultBlockState();
|
||||
}
|
||||
|
@ -76,7 +79,7 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
|
|||
world,
|
||||
blockPos2,
|
||||
blockState
|
||||
)
|
||||
)
|
||||
.isEmpty()) {
|
||||
++i;
|
||||
if (j < 6) {
|
||||
|
@ -114,23 +117,25 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
|
|||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
CollisionContext collisionContext) {
|
||||
public VoxelShape getShape(
|
||||
BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
CollisionContext collisionContext
|
||||
) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
static {
|
||||
SHAPE = Shapes.or(
|
||||
Shapes.or(box(0, 0, 0, 16, 6, 6), box(0, 0, 10, 16, 6, 16),
|
||||
Shapes.or(box(0, 10, 0, 16, 16, 6), box(0, 10, 10, 16, 16, 16)),
|
||||
Shapes.or(box(0, 10, 0, 16, 16, 6), box(0, 10, 10, 16, 16, 16)),
|
||||
|
||||
Shapes.or(box(0, 0, 0, 6, 6, 16), box(10, 0, 0, 16, 6, 16)),
|
||||
Shapes.or(box(0, 10, 0, 6, 16, 16), box(10, 10, 0, 16, 16, 16)),
|
||||
Shapes.or(box(0, 0, 0, 6, 6, 16), box(10, 0, 0, 16, 6, 16)),
|
||||
Shapes.or(box(0, 10, 0, 6, 16, 16), box(10, 10, 0, 16, 16, 16)),
|
||||
|
||||
Shapes.or(box(0, 0, 0, 6, 16, 6), box(10, 0, 0, 16, 16, 6)),
|
||||
Shapes.or(box(0, 0, 10, 6, 16, 16), box(10, 0, 10, 16, 16, 16))
|
||||
));
|
||||
Shapes.or(box(0, 0, 0, 6, 16, 6), box(10, 0, 0, 16, 16, 6)),
|
||||
Shapes.or(box(0, 0, 10, 6, 16, 16), box(10, 0, 10, 16, 16, 16))
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.Direction;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
|
@ -23,12 +29,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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")
|
||||
public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLayerProvider {
|
||||
public MengerSpongeWetBlock() {
|
||||
|
@ -47,7 +47,7 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLaye
|
|||
SoundSource.BLOCKS,
|
||||
1.0F,
|
||||
(1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,10 +119,12 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements RenderLaye
|
|||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
CollisionContext collisionContext) {
|
||||
public VoxelShape getShape(
|
||||
BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
CollisionContext collisionContext
|
||||
) {
|
||||
return EndBlocks.MENGER_SPONGE.getShape(blockState, blockGetter, blockPos, collisionContext);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
public class MissingTileBlock extends BaseBlock {
|
||||
public MissingTileBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.END_STONE));
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.Direction;
|
||||
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 org.betterx.bclib.blocks.BaseRotatedPillarBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class MossyDragonBoneBlock extends BaseRotatedPillarBlock {
|
|||
blockPos,
|
||||
Direction.UP,
|
||||
blockState.getLightBlock(worldView, blockPos)
|
||||
);
|
||||
);
|
||||
return i < 5;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.world.item.Item;
|
||||
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 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;
|
||||
|
||||
public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
|
||||
|
@ -33,7 +33,7 @@ public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
|
|||
TRANSITION,
|
||||
EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel()
|
||||
.getBlockState(ctx.getClickedPos().below()))
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
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 MossyGlowshroomSaplingBlock() {
|
||||
super(7, (state) -> EndFeatures.MOSSY_GLOWSHROOM);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
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 org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class MossyObsidian extends BaseBlock {
|
|||
blockPos,
|
||||
Direction.UP,
|
||||
blockState.getLightBlock(worldView, blockPos)
|
||||
);
|
||||
);
|
||||
return i < 5;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.particles.ParticleTypes;
|
||||
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.Environment;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
public class MurkweedBlock extends EndPlantBlock {
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.world.damagesource.DamageSource;
|
||||
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 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;
|
||||
|
||||
|
@ -38,7 +39,7 @@ public class NeedlegrassBlock extends EndPlantBlock {
|
|||
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
|
||||
Enchantments.SILK_TOUCH,
|
||||
tool
|
||||
) > 0) {
|
||||
) > 0) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
} else {
|
||||
return Lists.newArrayList(new ItemStack(Items.STICK, MHelper.randRange(0, 2, MHelper.RANDOM_SOURCE)));
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.LitPillarBlock;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.LitPillarBlock;
|
||||
|
||||
public class NeonCactusBlock extends LitPillarBlock {
|
||||
public NeonCactusBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15));
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
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.MutableBlockPos;
|
||||
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.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.List;
|
||||
|
@ -106,12 +107,14 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom
|
||||
) {
|
||||
world.scheduleTick(pos, this, 2);
|
||||
if (state.getValue(WATERLOGGED)) {
|
||||
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,
|
||||
MutableBlockPos pos,
|
||||
RandomSource random,
|
||||
List<MutableBlockPos> ends,
|
||||
int length) {
|
||||
private boolean growIteration(
|
||||
WorldGenLevel world,
|
||||
MutableBlockPos pos,
|
||||
RandomSource random,
|
||||
List<MutableBlockPos> ends,
|
||||
int length
|
||||
) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (!state.is(this)) {
|
||||
return false;
|
||||
|
@ -278,11 +283,13 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
|||
return true;
|
||||
}
|
||||
|
||||
private Direction getSideDirection(WorldGenLevel world,
|
||||
BlockPos pos,
|
||||
BlockState iterState,
|
||||
Direction dir,
|
||||
RandomSource random) {
|
||||
private Direction getSideDirection(
|
||||
WorldGenLevel world,
|
||||
BlockPos pos,
|
||||
BlockState iterState,
|
||||
Direction dir,
|
||||
RandomSource random
|
||||
) {
|
||||
MutableBlockPos iterPos = pos.mutable();
|
||||
Direction startDir = dir;
|
||||
Direction lastDir = null;
|
||||
|
@ -312,10 +319,12 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isPathfindable(BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
PathComputationType pathComputationType) {
|
||||
public boolean isPathfindable(
|
||||
BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
PathComputationType pathComputationType
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -17,10 +21,6 @@ import net.minecraft.world.phys.BlockHitResult;
|
|||
import net.fabricmc.api.EnvType;
|
||||
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;
|
||||
|
||||
public class PallidiumBlock extends EndTerrainBlock {
|
||||
|
@ -41,12 +41,14 @@ public class PallidiumBlock extends EndTerrainBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public InteractionResult use(BlockState state,
|
||||
Level level,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit) {
|
||||
public InteractionResult use(
|
||||
BlockState state,
|
||||
Level level,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit
|
||||
) {
|
||||
if (nextLevel == null) {
|
||||
return InteractionResult.PASS;
|
||||
} else if (level.isClientSide) {
|
||||
|
@ -66,9 +68,11 @@ public class PallidiumBlock extends EndTerrainBlock {
|
|||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public UnbakedModel getModelVariant(ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||
public UnbakedModel getModelVariant(
|
||||
ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache
|
||||
) {
|
||||
return this.getBlockModel(stateId, blockState);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.PedestalBlock;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.PedestalBlock;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.particles.ParticleTypes;
|
||||
import net.minecraft.util.RandomSource;
|
||||
|
@ -16,9 +19,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
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 {
|
||||
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
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 PythadendronSaplingBlock() {
|
||||
super((state) -> EndFeatures.PYTHADENDRON_TREE);
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
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.item.ItemColor;
|
||||
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 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 org.jetbrains.annotations.Nullable;
|
||||
|
@ -82,11 +83,13 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setPlacedBy(Level world,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable LivingEntity placer,
|
||||
ItemStack itemStack) {
|
||||
public void setPlacedBy(
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable LivingEntity placer,
|
||||
ItemStack itemStack
|
||||
) {
|
||||
state = this.defaultBlockState();
|
||||
BlocksHelper.setWithUpdate(world, pos, state.setValue(SHAPE, TripleShape.BOTTOM));
|
||||
BlocksHelper.setWithUpdate(world, pos.above(), state.setValue(SHAPE, TripleShape.MIDDLE));
|
||||
|
@ -95,12 +98,14 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
TripleShape shape = state.getValue(SHAPE);
|
||||
if (shape == TripleShape.BOTTOM) {
|
||||
if (world.getBlockState(pos.above()).is(this)) {
|
||||
|
@ -164,12 +169,14 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public InteractionResult use(BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit) {
|
||||
public InteractionResult use(
|
||||
BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit
|
||||
) {
|
||||
ItemStack itemStack = player.getItemInHand(hand);
|
||||
boolean canActivate = itemStack.getItem() == EndItems.AMBER_GEM && itemStack.getCount() > 5;
|
||||
if (hand != InteractionHand.MAIN_HAND || !canActivate) {
|
||||
|
@ -178,7 +185,7 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
|
|||
serverPlayerEntity.displayClientMessage(
|
||||
Component.translatable("message.betterend.fail_spawn"),
|
||||
true
|
||||
);
|
||||
);
|
||||
}
|
||||
return InteractionResult.FAIL;
|
||||
} else if (!world.isClientSide) {
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.level.Explosion;
|
||||
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 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;
|
||||
|
||||
|
@ -29,7 +30,7 @@ public class RunedFlavolite extends BaseBlock {
|
|||
unbreakable
|
||||
? Blocks.BEDROCK.getExplosionResistance()
|
||||
: Blocks.OBSIDIAN.getExplosionResistance()
|
||||
)
|
||||
)
|
||||
.luminance(state -> {
|
||||
return state.getValue(ACTIVATED) ? 8 : 0;
|
||||
}));
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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.world.level.BlockGetter;
|
||||
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.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 {
|
||||
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 8, 15);
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.tags.TagKey;
|
||||
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.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;
|
||||
|
||||
public class ShadowGrassBlock extends EndTerrainBlock implements TagProvider {
|
||||
|
@ -36,7 +36,7 @@ public class ShadowGrassBlock extends EndTerrainBlock implements TagProvider {
|
|||
0.0D,
|
||||
0.0D,
|
||||
0.0D
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.Direction;
|
||||
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 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 static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS;
|
||||
|
@ -98,12 +98,14 @@ public class SilkMothHiveBlock extends BaseBlock {
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public InteractionResult use(BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit) {
|
||||
public InteractionResult use(
|
||||
BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit
|
||||
) {
|
||||
if (hand == InteractionHand.MAIN_HAND) {
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
if (BaseShearsItem.isShear(stack) && state.getValue(FULLNESS) == 3) {
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
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.Direction;
|
||||
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 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.List;
|
||||
|
||||
|
@ -87,12 +87,14 @@ public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!state.getValue(ACTIVE)) {
|
||||
if (canSupportCenter(world, pos.above(), Direction.DOWN) || world.getBlockState(pos.above())
|
||||
.is(BlockTags.LEAVES)) {
|
||||
|
@ -163,12 +165,14 @@ public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public InteractionResult use(BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit) {
|
||||
public InteractionResult use(
|
||||
BlockState state,
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit
|
||||
) {
|
||||
if (hand == InteractionHand.MAIN_HAND) {
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
if (BaseShearsItem.isShear(stack) && state.getValue(ACTIVE) && state.getValue(FULLNESS) == 3) {
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.server.level.ServerLevel;
|
||||
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.Blocks;
|
||||
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.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
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;
|
||||
|
||||
public class SmallAmaranitaBlock extends EndPlantBlock {
|
||||
|
@ -35,7 +33,14 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
BlockPos bigPos = growBig(world, pos);
|
||||
if (bigPos != null) {
|
||||
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.south());
|
||||
replaceMushroom(world, bigPos.east());
|
||||
|
@ -49,7 +54,8 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
null,
|
||||
random,
|
||||
pos,
|
||||
null));
|
||||
null
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,7 +78,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
|
||||
private boolean checkFrame(ServerLevel world, BlockPos pos) {
|
||||
return world.getBlockState(pos).is(this) && world.getBlockState(pos.south()).is(this) && world.getBlockState(pos
|
||||
.east())
|
||||
.east())
|
||||
.is(this) && world.getBlockState(
|
||||
pos.south().east()).is(this);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
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.Direction;
|
||||
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.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.List;
|
||||
|
@ -61,7 +62,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
|
|||
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
|
||||
Enchantments.SILK_TOUCH,
|
||||
tool
|
||||
) > 0) {
|
||||
) > 0) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
} else {
|
||||
return Lists.newArrayList();
|
||||
|
@ -110,7 +111,8 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
|
|||
null,
|
||||
random,
|
||||
pos,
|
||||
null));
|
||||
null
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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.material.Material;
|
||||
|
||||
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 SmaragdantCrystalBlock() {
|
||||
super(FabricBlockSettings.of(Material.GLASS)
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.Direction;
|
||||
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 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;
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
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.Direction;
|
||||
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.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.EnumMap;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
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.item.ItemColor;
|
||||
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.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 static final Vec3i[] COLORS;
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
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 TenaneaSaplingBlock() {
|
||||
super((state) -> EndFeatures.TENANEA);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
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.state.BlockState;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
|
||||
public class TerrainPlantBlock extends EndPlantBlock {
|
||||
private final Block[] ground;
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
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.server.level.ServerLevel;
|
||||
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.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 TwistedUmbrellaMossBlock() {
|
||||
super(11);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.server.level.ServerLevel;
|
||||
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.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseDoublePlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
public class TwistedUmbrellaMossTallBlock extends BaseDoublePlantBlock {
|
||||
public TwistedUmbrellaMossTallBlock() {
|
||||
super(12);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue