Getters interfaces to Providers rename

This commit is contained in:
paulevsGitch 2021-07-20 00:16:42 +03:00
parent c6afa74529
commit db8dc41c8f
52 changed files with 120 additions and 122 deletions

View file

@ -24,16 +24,15 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.CustomItemGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.CustomItemProvider;
import ru.bclib.items.BaseAnvilItem;
import ru.bclib.registry.BlocksRegistry;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public abstract class BaseAnvilBlock extends AnvilBlock implements BlockModelGetter, CustomItemGetter {
public abstract class BaseAnvilBlock extends AnvilBlock implements BlockModelProvider, CustomItemProvider {
public static final IntegerProperty DESTRUCTION = BlockProperties.DESTRUCTION;
public BaseAnvilBlock(MaterialColor color) {

View file

@ -30,7 +30,7 @@ import ru.bclib.blockentities.BaseBarrelBlockEntity;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.registry.BaseBlockEntities;
import java.util.List;
@ -38,7 +38,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.Random;
public class BaseBarrelBlock extends BarrelBlock implements BlockModelGetter {
public class BaseBarrelBlock extends BarrelBlock implements BlockModelProvider {
public BaseBarrelBlock(Block source) {
super(FabricBlockSettings.copyOf(source).noOcclusion());
}

View file

@ -8,7 +8,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
@ -23,7 +23,7 @@ import java.util.function.Consumer;
* <li>Automatically create an Item-Model from the Block-Model</li>
* </ul>
*/
public class BaseBlock extends Block implements BlockModelGetter {
public class BaseBlock extends Block implements BlockModelProvider {
/**
* Creates a new Block with the passed properties
*

View file

@ -17,14 +17,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelGetter {
public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelProvider {
private final Block parent;

View file

@ -18,15 +18,15 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseChainBlock extends ChainBlock implements BlockModelGetter, RenderLayerGetter {
public class BaseChainBlock extends ChainBlock implements BlockModelProvider, RenderLayerProvider {
public BaseChainBlock(MaterialColor color) {
super(FabricBlockSettings.copyOf(Blocks.CHAIN).mapColor(color));
}

View file

@ -17,13 +17,13 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.registry.BaseBlockEntities;
import java.util.List;
import java.util.Optional;
public class BaseChestBlock extends ChestBlock implements BlockModelGetter {
public class BaseChestBlock extends ChestBlock implements BlockModelProvider {
private final Block parent;
public BaseChestBlock(Block source) {

View file

@ -16,14 +16,14 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.ModelsHelper.MultiPartBuilder;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseComposterBlock extends ComposterBlock implements BlockModelGetter {
public class BaseComposterBlock extends ComposterBlock implements BlockModelProvider {
public BaseComposterBlock(Block source) {
super(FabricBlockSettings.copyOf(source));
}

View file

@ -14,14 +14,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
public class BaseCraftingTableBlock extends CraftingTableBlock implements BlockModelGetter {
public class BaseCraftingTableBlock extends CraftingTableBlock implements BlockModelProvider {
public BaseCraftingTableBlock(Block source) {
super(FabricBlockSettings.copyOf(source));
}

View file

@ -21,15 +21,15 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseDoorBlock extends DoorBlock implements RenderLayerGetter, BlockModelGetter {
public class BaseDoorBlock extends DoorBlock implements RenderLayerProvider, BlockModelProvider {
public BaseDoorBlock(Block source) {
super(FabricBlockSettings.copyOf(source).strength(3F, 3F).noOcclusion());
}

View file

@ -31,14 +31,14 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.util.BlocksHelper;
import java.util.List;
import java.util.Random;
@SuppressWarnings("deprecation")
public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements RenderLayerGetter, BonemealableBlock {
public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements RenderLayerProvider, 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");

View file

@ -18,14 +18,14 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.ModelsHelper.MultiPartBuilder;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseFenceBlock extends FenceBlock implements BlockModelGetter {
public class BaseFenceBlock extends FenceBlock implements BlockModelProvider {
private final Block parent;
public BaseFenceBlock(Block source) {

View file

@ -29,15 +29,15 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.registry.BaseBlockEntities;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseFurnaceBlock extends FurnaceBlock implements BlockModelGetter, RenderLayerGetter {
public class BaseFurnaceBlock extends FurnaceBlock implements BlockModelProvider, RenderLayerProvider {
public BaseFurnaceBlock(Block source) {
super(FabricBlockSettings.copyOf(source).luminance(state -> state.getValue(LIT) ? 13 : 0));
}

View file

@ -16,14 +16,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseGateBlock extends FenceGateBlock implements BlockModelGetter {
public class BaseGateBlock extends FenceGateBlock implements BlockModelProvider {
private final Block parent;
public BaseGateBlock(Block source) {

View file

@ -31,15 +31,15 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.util.BlocksHelper;
import java.util.Map;
import java.util.Optional;
@SuppressWarnings("deprecation")
public class BaseLadderBlock extends BaseBlockNotFull implements RenderLayerGetter, BlockModelGetter {
public class BaseLadderBlock extends BaseBlockNotFull implements RenderLayerProvider, BlockModelProvider {
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
protected static final VoxelShape EAST_SHAPE = Block.box(0.0D, 0.0D, 0.0D, 3.0D, 16.0D, 16.0D);

View file

@ -16,15 +16,15 @@ import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.util.MHelper;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
public class BaseLeavesBlock extends LeavesBlock implements BlockModelGetter, RenderLayerGetter {
public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, RenderLayerProvider {
private final Block sapling;
private static FabricBlockSettings makeLeaves(MaterialColor color) {

View file

@ -19,15 +19,15 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseMetalBarsBlock extends IronBarsBlock implements BlockModelGetter, RenderLayerGetter {
public class BaseMetalBarsBlock extends IronBarsBlock implements BlockModelProvider, RenderLayerProvider {
public BaseMetalBarsBlock(Block source) {
super(FabricBlockSettings.copyOf(source).strength(5.0F, 6.0F).noOcclusion());
}

View file

@ -16,13 +16,13 @@ import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.util.MHelper;
import java.util.Collections;
import java.util.List;
public class BaseOreBlock extends OreBlock implements BlockModelGetter {
public class BaseOreBlock extends OreBlock implements BlockModelProvider {
private final Item dropItem;
private final int minCount;
private final int maxCount;

View file

@ -27,13 +27,13 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.List;
import java.util.Random;
@SuppressWarnings("deprecation")
public abstract class BasePlantBlock extends BaseBlockNotFull implements RenderLayerGetter, BonemealableBlock {
public abstract class BasePlantBlock extends BaseBlockNotFull implements RenderLayerProvider, BonemealableBlock {
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
public BasePlantBlock() {

View file

@ -16,14 +16,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BasePressurePlateBlock extends PressurePlateBlock implements BlockModelGetter {
public class BasePressurePlateBlock extends PressurePlateBlock implements BlockModelProvider {
private final Block parent;
public BasePressurePlateBlock(Sensitivity rule, Block source) {

View file

@ -14,14 +14,14 @@ import net.minecraft.world.level.storage.loot.LootContext;
import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseRotatedPillarBlock extends RotatedPillarBlock implements BlockModelGetter {
public class BaseRotatedPillarBlock extends RotatedPillarBlock implements BlockModelProvider {
public BaseRotatedPillarBlock(Properties settings) {
super(settings);
}

View file

@ -42,16 +42,15 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
import ru.bclib.blockentities.BaseSignBlockEntity;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.CustomItemGetter;
import ru.bclib.registry.BlocksRegistry;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.CustomItemProvider;
import ru.bclib.util.BlocksHelper;
import java.util.Collections;
import java.util.List;
@SuppressWarnings("deprecation")
public class BaseSignBlock extends SignBlock implements BlockModelGetter, CustomItemGetter {
public class BaseSignBlock extends SignBlock implements BlockModelProvider, CustomItemProvider {
public static final IntegerProperty ROTATION = BlockStateProperties.ROTATION_16;
public static final BooleanProperty FLOOR = BooleanProperty.create("floor");
private static final VoxelShape[] WALL_SHAPES = new VoxelShape[] {

View file

@ -18,14 +18,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseSlabBlock extends SlabBlock implements BlockModelGetter {
public class BaseSlabBlock extends SlabBlock implements BlockModelProvider {
private final Block parent;
public BaseSlabBlock(Block source) {

View file

@ -19,14 +19,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseStairsBlock extends StairBlock implements BlockModelGetter {
public class BaseStairsBlock extends StairBlock implements BlockModelProvider {
private final Block parent;

View file

@ -18,8 +18,8 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.Collections;
import java.util.HashMap;
@ -27,7 +27,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseTrapdoorBlock extends TrapDoorBlock implements RenderLayerGetter, BlockModelGetter {
public class BaseTrapdoorBlock extends TrapDoorBlock implements RenderLayerProvider, BlockModelProvider {
public BaseTrapdoorBlock(Block source) {
super(FabricBlockSettings.copyOf(source).strength(3.0F, 3.0F).noOcclusion());
}

View file

@ -30,14 +30,14 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.util.BlocksHelper;
import java.util.List;
import java.util.Random;
@SuppressWarnings("deprecation")
public class BaseVineBlock extends BaseBlockNotFull implements RenderLayerGetter, BonemealableBlock {
public class BaseVineBlock extends BaseBlockNotFull implements RenderLayerProvider, BonemealableBlock {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape VOXEL_SHAPE = Block.box(2, 0, 2, 14, 16, 14);

View file

@ -18,14 +18,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseWallBlock extends WallBlock implements BlockModelGetter {
public class BaseWallBlock extends WallBlock implements BlockModelProvider {
private final Block parent;

View file

@ -16,14 +16,14 @@ import org.jetbrains.annotations.Nullable;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class BaseWeightedPlateBlock extends WeightedPressurePlateBlock implements BlockModelGetter {
public class BaseWeightedPlateBlock extends WeightedPressurePlateBlock implements BlockModelProvider {
private final Block parent;
public BaseWeightedPlateBlock(Block source) {

View file

@ -28,8 +28,8 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.Collections;
import java.util.List;
@ -37,7 +37,7 @@ import java.util.Optional;
import java.util.Random;
@SuppressWarnings("deprecation")
public abstract class FeatureSaplingBlock extends SaplingBlock implements RenderLayerGetter, BlockModelGetter {
public abstract class FeatureSaplingBlock extends SaplingBlock implements RenderLayerProvider, BlockModelProvider {
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
public FeatureSaplingBlock() {

View file

@ -5,9 +5,9 @@ import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
public class SimpleLeavesBlock extends BaseBlockNotFull implements RenderLayerGetter {
public class SimpleLeavesBlock extends BaseBlockNotFull implements RenderLayerProvider {
public SimpleLeavesBlock(MaterialColor color) {
super(FabricBlockSettings.of(Material.LEAVES)
.strength(0.2F)

View file

@ -37,13 +37,13 @@ import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.Map;
import java.util.Optional;
@SuppressWarnings("deprecation")
public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer, RenderLayerGetter {
public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer, RenderLayerProvider {
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR;
public static final IntegerProperty SIZE = BlockProperties.SIZE;

View file

@ -31,13 +31,13 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.List;
import java.util.Random;
@SuppressWarnings("deprecation")
public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements RenderLayerGetter, BonemealableBlock, LiquidBlockContainer {
public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements RenderLayerProvider, BonemealableBlock, LiquidBlockContainer {
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
public UnderwaterPlantBlock() {

View file

@ -24,12 +24,12 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
import java.util.List;
@SuppressWarnings("deprecation")
public abstract class UpDownPlantBlock extends BaseBlockNotFull implements RenderLayerGetter {
public abstract class UpDownPlantBlock extends BaseBlockNotFull implements RenderLayerProvider {
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
public UpDownPlantBlock() {

View file

@ -7,7 +7,7 @@ import net.minecraft.core.Registry;
import ru.bclib.api.ModIntegrationAPI;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.PostInitable;
import ru.bclib.interfaces.RenderLayerGetter;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.registry.BaseBlockEntityRenders;
public class BCLibClient implements ClientModInitializer {
@ -27,8 +27,8 @@ public class BCLibClient implements ClientModInitializer {
RenderType cutout = RenderType.cutout();
RenderType translucent = RenderType.translucent();
Registry.BLOCK.forEach(block -> {
if (block instanceof RenderLayerGetter) {
BCLRenderLayer layer = ((RenderLayerGetter) block).getRenderLayer();
if (block instanceof RenderLayerProvider) {
BCLRenderLayer layer = ((RenderLayerProvider) block).getRenderLayer();
if (layer == BCLRenderLayer.CUTOUT) BlockRenderLayerMap.INSTANCE.putBlock(block, cutout);
else if (layer == BCLRenderLayer.TRANSLUCENT) BlockRenderLayerMap.INSTANCE.putBlock(block, translucent);
}

View file

@ -16,7 +16,7 @@ import java.util.Optional;
import static net.minecraft.client.resources.model.ModelBakery.MISSING_MODEL_LOCATION;
public interface BlockModelGetter extends ItemModelGetter {
public interface BlockModelProvider extends ItemModelProvider {
@Environment(EnvType.CLIENT)
default @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
Optional<String> pattern = PatternsHelper.createBlockSimple(resourceLocation);

View file

@ -3,7 +3,7 @@ package ru.bclib.interfaces;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
public interface ColorProviderGetter {
public interface CustomColorProvider {
BlockColor getProvider();
ItemColor getItemProvider();

View file

@ -5,7 +5,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem;
import ru.bclib.registry.BlocksRegistry;
public interface CustomItemGetter {
public interface CustomItemProvider {
/**
* Used to replace default Block Item when block is registered.
*

View file

@ -6,7 +6,7 @@ import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.resources.ResourceLocation;
import ru.bclib.client.models.ModelsHelper;
public interface ItemModelGetter {
public interface ItemModelProvider {
@Environment(EnvType.CLIENT)
default BlockModel getItemModel(ResourceLocation resourceLocation) {
return ModelsHelper.createItemModel(resourceLocation);

View file

@ -2,6 +2,6 @@ package ru.bclib.interfaces;
import ru.bclib.client.render.BCLRenderLayer;
public interface RenderLayerGetter {
public interface RenderLayerProvider {
BCLRenderLayer getRenderLayer();
}

View file

@ -16,11 +16,11 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.Nullable;
import ru.bclib.blocks.BaseAnvilBlock;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
import java.util.List;
public class BaseAnvilItem extends BlockItem implements ItemModelGetter {
public class BaseAnvilItem extends BlockItem implements ItemModelProvider {
public final static String DESTRUCTION = "destruction";
@ -54,6 +54,6 @@ public class BaseAnvilItem extends BlockItem implements ItemModelGetter {
public BlockModel getItemModel(ResourceLocation resourceLocation) {
Block anvilBlock = getBlock();
ResourceLocation blockId = Registry.BLOCK.getKey(anvilBlock);
return ((ItemModelGetter) anvilBlock).getItemModel(blockId);
return ((ItemModelProvider) anvilBlock).getItemModel(blockId);
}
}

View file

@ -8,11 +8,11 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ArmorMaterial;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
import java.util.UUID;
public class BaseArmorItem extends ArmorItem implements ItemModelGetter {
public class BaseArmorItem extends ArmorItem implements ItemModelProvider {
protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[] {
UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"),

View file

@ -5,9 +5,9 @@ import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.MobBucketItem;
import net.minecraft.world.level.material.Fluids;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class BaseBucketItem extends MobBucketItem implements ItemModelGetter {
public class BaseBucketItem extends MobBucketItem implements ItemModelProvider {
public BaseBucketItem(EntityType<?> type, FabricItemSettings settings) {
super(type, Fluids.WATER, SoundEvents.BUCKET_EMPTY_FISH, settings.stacksTo(1));
}

View file

@ -2,9 +2,9 @@ package ru.bclib.items;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.item.RecordItem;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class BaseDiscItem extends RecordItem implements ItemModelGetter {
public class BaseDiscItem extends RecordItem implements ItemModelProvider {
public BaseDiscItem(int comparatorOutput, SoundEvent sound, Properties settings) {
super(comparatorOutput, sound, settings);
}

View file

@ -10,11 +10,11 @@ import net.minecraft.world.item.SpawnEggItem;
import ru.bclib.client.models.BasePatterns;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.models.PatternsHelper;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
import java.util.Optional;
public class BaseSpawnEggItem extends SpawnEggItem implements ItemModelGetter {
public class BaseSpawnEggItem extends SpawnEggItem implements ItemModelProvider {
public BaseSpawnEggItem(EntityType<? extends Mob> type, int primaryColor, int secondaryColor, Properties settings) {
super(type, primaryColor, secondaryColor, settings);
}

View file

@ -6,9 +6,9 @@ import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class ModelProviderItem extends Item implements ItemModelGetter {
public class ModelProviderItem extends Item implements ItemModelProvider {
public ModelProviderItem(Properties settings) {
super(settings);
}

View file

@ -14,9 +14,9 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Tier;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class BaseAxeItem extends AxeItem implements DynamicAttributeTool, ItemModelGetter {
public class BaseAxeItem extends AxeItem implements DynamicAttributeTool, ItemModelProvider {
public BaseAxeItem(Tier material, float attackDamage, float attackSpeed, Properties settings) {
super(material, attackDamage, attackSpeed, settings);
}

View file

@ -7,9 +7,9 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.HoeItem;
import net.minecraft.world.item.Tier;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class BaseHoeItem extends HoeItem implements ItemModelGetter {
public class BaseHoeItem extends HoeItem implements ItemModelProvider {
public BaseHoeItem(Tier material, int attackDamage, float attackSpeed, Properties settings) {
super(material, attackDamage, attackSpeed, settings);
}

View file

@ -16,9 +16,9 @@ import net.minecraft.world.item.PickaxeItem;
import net.minecraft.world.item.Tier;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class BasePickaxeItem extends PickaxeItem implements DynamicAttributeTool, ItemModelGetter {
public class BasePickaxeItem extends PickaxeItem implements DynamicAttributeTool, ItemModelProvider {
public BasePickaxeItem(Tier material, int attackDamage, float attackSpeed, Properties settings) {
super(material, attackDamage, attackSpeed, settings);
}

View file

@ -16,9 +16,9 @@ import net.minecraft.world.item.ShovelItem;
import net.minecraft.world.item.Tier;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class BaseShovelItem extends ShovelItem implements DynamicAttributeTool, ItemModelGetter {
public class BaseShovelItem extends ShovelItem implements DynamicAttributeTool, ItemModelProvider {
public BaseShovelItem(Tier material, float attackDamage, float attackSpeed, Properties settings) {
super(material, attackDamage, attackSpeed, settings);
}

View file

@ -8,9 +8,9 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.SwordItem;
import net.minecraft.world.item.Tier;
import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.ItemModelProvider;
public class BaseSwordItem extends SwordItem implements DynamicAttributeTool, ItemModelGetter {
public class BaseSwordItem extends SwordItem implements DynamicAttributeTool, ItemModelProvider {
public BaseSwordItem(Tier material, int attackDamage, float attackSpeed, Properties settings) {
super(material, attackDamage, attackSpeed, settings);
}

View file

@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.bclib.interfaces.ColorProviderGetter;
import ru.bclib.interfaces.CustomColorProvider;
@Mixin(Minecraft.class)
public class MinecraftMixin {
@ -26,8 +26,8 @@ public class MinecraftMixin {
@Inject(method = "<init>*", at = @At("TAIL"))
private void bclib_onMCInit(GameConfig args, CallbackInfo info) {
Registry.BLOCK.forEach(block -> {
if (block instanceof ColorProviderGetter) {
ColorProviderGetter provider = (ColorProviderGetter) block;
if (block instanceof CustomColorProvider) {
CustomColorProvider provider = (CustomColorProvider) block;
blockColors.register(provider.getProvider(), block);
itemColors.register(provider.getItemProvider(), block.asItem());
}

View file

@ -20,8 +20,8 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.bclib.BCLib;
import ru.bclib.interfaces.BlockModelGetter;
import ru.bclib.interfaces.ItemModelGetter;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.ItemModelProvider;
import java.util.List;
import java.util.Map;
@ -51,14 +51,14 @@ public abstract class ModelBakeryMixin {
ResourceLocation itemModelLoc = new ResourceLocation(modId, "models/" + itemLoc.getPath() + ".json");
if (!resourceManager.hasResource(itemModelLoc)) {
Item item = Registry.ITEM.get(clearLoc);
ItemModelGetter modelProvider = null;
if (item instanceof ItemModelGetter) {
modelProvider = (ItemModelGetter) item;
ItemModelProvider modelProvider = null;
if (item instanceof ItemModelProvider) {
modelProvider = (ItemModelProvider) item;
}
else if (item instanceof BlockItem) {
Block block = Registry.BLOCK.get(clearLoc);
if (block instanceof ItemModelGetter) {
modelProvider = (ItemModelGetter) block;
if (block instanceof ItemModelProvider) {
modelProvider = (ItemModelProvider) block;
}
}
if (modelProvider != null) {
@ -79,7 +79,7 @@ public abstract class ModelBakeryMixin {
ResourceLocation stateLoc = new ResourceLocation(modId, "blockstates/" + path + ".json");
if (!resourceManager.hasResource(stateLoc)) {
Block block = Registry.BLOCK.get(clearLoc);
if (block instanceof BlockModelGetter) {
if (block instanceof BlockModelProvider) {
List<BlockState> possibleStates = block.getStateDefinition().getPossibleStates();
Optional<BlockState> possibleState = possibleStates.stream()
.filter(state -> modelId.equals(
@ -89,7 +89,7 @@ public abstract class ModelBakeryMixin {
)))
.findFirst();
if (possibleState.isPresent()) {
UnbakedModel modelVariant = ((BlockModelGetter) block).getModelVariant(
UnbakedModel modelVariant = ((BlockModelProvider) block).getModelVariant(
modelId,
possibleState.get(),
unbakedCache

View file

@ -7,7 +7,7 @@ import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import ru.bclib.interfaces.CustomItemGetter;
import ru.bclib.interfaces.CustomItemProvider;
public abstract class BlocksRegistry extends BaseRegistry<Block> {
@ -18,8 +18,8 @@ public abstract class BlocksRegistry extends BaseRegistry<Block> {
@Override
public Block register(ResourceLocation id, Block block) {
BlockItem item = null;
if (block instanceof CustomItemGetter) {
item = ((CustomItemGetter) block).getCustomItem(id, makeItemSettings());
if (block instanceof CustomItemProvider) {
item = ((CustomItemProvider) block).getCustomItem(id, makeItemSettings());
}
else {
item = new BlockItem(block, makeItemSettings());