- Base Anvil model fix;

- Some base blocks renamed;
This commit is contained in:
Aleksey 2021-06-11 14:55:54 +03:00
parent 809e913683
commit da1c27a14d
13 changed files with 877 additions and 869 deletions

View file

@ -8,7 +8,7 @@ yarn_mappings=6
loader_version=0.11.3
# Mod Properties
mod_version = 0.1.26
mod_version = 0.1.27
maven_group = ru.bclib
archives_base_name = bclib

View file

@ -71,6 +71,7 @@ public class BaseAnvilBlock extends AnvilBlock implements BlockModelProvider {
int destruction = blockState.getValue(destructionProperty);
String name = blockId.getPath();
Map<String, String> textures = Maps.newHashMap();
textures.put("%modid%", blockId.getNamespace());
textures.put("%anvil%", name);
textures.put("%top%", name + "_top_" + destruction);
Optional<String> pattern = PatternsHelper.createJson(BasePatterns.BLOCK_ANVIL, textures);

View file

@ -38,12 +38,12 @@ import ru.bclib.client.render.ERenderLayer;
import ru.bclib.interfaces.IRenderTyped;
import ru.bclib.util.BlocksHelper;
public abstract class DoublePlantBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock {
public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock {
private static final VoxelShape SHAPE = Block.box(4, 2, 4, 12, 16, 12);
public static final IntegerProperty ROTATION = BlockProperties.ROTATION;
public static final BooleanProperty TOP = BooleanProperty.create("top");
public DoublePlantBlock() {
public BaseDoublePlantBlock() {
super(FabricBlockSettings.of(Material.PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
@ -52,7 +52,7 @@ public abstract class DoublePlantBlock extends BaseBlockNotFull implements IRend
this.registerDefaultState(this.stateDefinition.any().setValue(TOP, false));
}
public DoublePlantBlock(int light) {
public BaseDoublePlantBlock(int light) {
super(FabricBlockSettings.of(Material.PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)

View file

@ -30,13 +30,14 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
public abstract class BasePathBlock extends BaseBlockNotFull {
@SuppressWarnings("deprecation")
public class BasePathBlock extends BaseBlockNotFull {
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 15, 16);
private Block baseBlock;
public BasePathBlock(Block source) {
super(FabricBlockSettings.copyOf(source).isValidSpawn((state, world, pos, type) -> { return false; }));
super(FabricBlockSettings.copyOf(source).isValidSpawn((state, world, pos, type) -> false));
this.baseBlock = Blocks.DIRT;
if (source instanceof BaseTerrainBlock) {
BaseTerrainBlock terrain = (BaseTerrainBlock) source;

View file

@ -1,9 +0,0 @@
package ru.bclib.blocks;
import net.minecraft.world.level.block.Block;
public class BasePressureStonePlateBlock extends BasePressurePlateBlock {
public BasePressureStonePlateBlock(Block source) {
super(Sensitivity.MOBS, source);
}
}

View file

@ -1,9 +0,0 @@
package ru.bclib.blocks;
import net.minecraft.world.level.block.Block;
public class BasePressureWoodenPlateBlock extends BasePressurePlateBlock {
public BasePressureWoodenPlateBlock(Block source) {
super(Sensitivity.EVERYTHING, source);
}
}

View file

@ -44,6 +44,7 @@ import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.sound.BlockSounds;
@SuppressWarnings("deprecation")
public class BaseTerrainBlock extends BaseBlock {
private final Block baseBlock;
@ -96,7 +97,7 @@ public class BaseTerrainBlock extends BaseBlock {
public boolean canStay(BlockState state, LevelReader worldView, BlockPos pos) {
BlockPos blockPos = pos.above();
BlockState blockState = worldView.getBlockState(blockPos);
if (blockState.is(Blocks.SNOW) && (Integer) blockState.getValue(SnowLayerBlock.LAYERS) == 1) {
if (blockState.is(Blocks.SNOW) && blockState.getValue(SnowLayerBlock.LAYERS) == 1) {
return true;
}
else if (blockState.getFluidState().getAmount() == 8) {

View file

@ -37,19 +37,19 @@ import ru.bclib.client.render.ERenderLayer;
import ru.bclib.interfaces.IRenderTyped;
import ru.bclib.util.BlocksHelper;
public class VineBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock {
public class BaseVineBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape VOXEL_SHAPE = Block.box(2, 0, 2, 14, 16, 14);
public VineBlock() {
public BaseVineBlock() {
this(0, false);
}
public VineBlock(int light) {
public BaseVineBlock(int light) {
this(light, false);
}
public VineBlock(int light, boolean bottomOnly) {
public BaseVineBlock(int light, boolean bottomOnly) {
super(FabricBlockSettings.of(Material.PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)

View file

@ -0,0 +1,9 @@
package ru.bclib.blocks;
import net.minecraft.world.level.block.Block;
public class StonePressurePlateBlock extends BasePressurePlateBlock {
public StonePressurePlateBlock(Block source) {
super(Sensitivity.MOBS, source);
}
}

View file

@ -16,10 +16,10 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.phys.BlockHitResult;
public class StrippableBarkBlock extends BaseBarkBlock {
public class StripableBarkBlock extends BaseBarkBlock {
private final Block striped;
public StrippableBarkBlock(MaterialColor color, Block striped) {
public StripableBarkBlock(MaterialColor color, Block striped) {
super(FabricBlockSettings.copyOf(striped).materialColor(color));
this.striped = striped;
}

View file

@ -40,6 +40,11 @@ import ru.bclib.client.models.PatternsHelper;
public class TripleTerrainBlock extends BaseTerrainBlock {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
public TripleTerrainBlock(Block baseBlock) {
super(baseBlock, baseBlock.defaultMaterialColor());
this.registerDefaultState(defaultBlockState().setValue(SHAPE, TripleShape.BOTTOM));
}
public TripleTerrainBlock(Block baseBlock, MaterialColor color) {
super(baseBlock, color);
this.registerDefaultState(defaultBlockState().setValue(SHAPE, TripleShape.BOTTOM));

View file

@ -0,0 +1,9 @@
package ru.bclib.blocks;
import net.minecraft.world.level.block.Block;
public class WoodenPressurePlateBlock extends BasePressurePlateBlock {
public WoodenPressurePlateBlock(Block source) {
super(Sensitivity.EVERYTHING, source);
}
}