diff --git a/src/main/java/ru/bclib/api/BiomeAPI.java b/src/main/java/ru/bclib/api/BiomeAPI.java index a63db6fd..81026c3d 100644 --- a/src/main/java/ru/bclib/api/BiomeAPI.java +++ b/src/main/java/ru/bclib/api/BiomeAPI.java @@ -24,7 +24,12 @@ public class BiomeAPI { * Empty biome used as default value if requested biome doesn't exist or linked. Shouldn't be registered anywhere to prevent bugs. * Have {@code Biomes.THE_VOID} as the reference biome. */ - public static final BCLBiome EMPTY_BIOME = new BCLBiome(Biomes.THE_VOID.location(), BuiltinRegistries.BIOME.get(Biomes.THE_VOID), 1, 0); + public static final BCLBiome EMPTY_BIOME = new BCLBiome( + Biomes.THE_VOID.location(), + BuiltinRegistries.BIOME.get(Biomes.THE_VOID), + 1, + 0 + ); private static final HashMap ID_MAP = Maps.newHashMap(); private static final HashMap CLIENT = Maps.newHashMap(); @@ -55,7 +60,13 @@ public class BiomeAPI { public static void addNetherBiomeToFabricApi(BCLBiome biome) { ResourceKey key = BuiltinRegistries.BIOME.getResourceKey(biome.getBiome()).get(); Random random = new Random(biome.getID().toString().hashCode()); - ClimateParameters parameters = new ClimateParameters(MHelper.randRange(-2F, 2F, random), MHelper.randRange(-2F, 2F, random), MHelper.randRange(-2F, 2F, random), MHelper.randRange(-2F, 2F, random), MHelper.randRange(-2F, 2F, random)); + ClimateParameters parameters = new ClimateParameters( + MHelper.randRange(-2F, 2F, random), + MHelper.randRange(-2F, 2F, random), + MHelper.randRange(-2F, 2F, random), + MHelper.randRange(-2F, 2F, random), + MHelper.randRange(-2F, 2F, random) + ); InternalBiomeData.addNetherBiome(key, parameters); } @@ -106,7 +117,9 @@ public class BiomeAPI { BCLBiome endBiome = CLIENT.get(biome); if (endBiome == null) { Minecraft minecraft = Minecraft.getInstance(); - ResourceLocation id = minecraft.level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).getKey(biome); + ResourceLocation id = minecraft.level.registryAccess() + .registryOrThrow(Registry.BIOME_REGISTRY) + .getKey(biome); endBiome = id == null ? EMPTY_BIOME : ID_MAP.getOrDefault(id, EMPTY_BIOME); CLIENT.put(biome, endBiome); } diff --git a/src/main/java/ru/bclib/api/DataFixerAPI2.java b/src/main/java/ru/bclib/api/DataFixerAPI2.java index 3863ea49..fa660ead 100644 --- a/src/main/java/ru/bclib/api/DataFixerAPI2.java +++ b/src/main/java/ru/bclib/api/DataFixerAPI2.java @@ -166,12 +166,20 @@ public class DataFixerAPI2 { if (modID == null || "".equals(modID)) { throw new RuntimeException("[INTERNAL ERROR] Patches need a valid modID!"); } - if (!ALL.stream().filter(p -> p.getModID().equals(modID)).noneMatch(p -> p.getLevel() >= level) || level <= 0) { - throw new RuntimeException("[INTERNAL ERROR] Patch-levels need to be created in ascending order beginning with 1."); + if (!ALL.stream() + .filter(p -> p.getModID().equals(modID)) + .noneMatch(p -> p.getLevel() >= level) || level <= 0) { + throw new RuntimeException( + "[INTERNAL ERROR] Patch-levels need to be created in ascending order beginning with 1."); } - BCLib.LOGGER.info("Creating Patchlevel {} ({}, {})", level, ALL, ALL.stream().noneMatch(p -> p.getLevel() >= level)); + BCLib.LOGGER.info( + "Creating Patchlevel {} ({}, {})", + level, + ALL, + ALL.stream().noneMatch(p -> p.getLevel() >= level) + ); this.level = level; this.modID = modID; } @@ -229,7 +237,10 @@ public class DataFixerAPI2 { private MigrationData(PathConfig config) { this.config = config; - this.mods = Collections.unmodifiableSet(Patch.getALL().stream().map(p -> p.modID).collect(Collectors.toSet())); + this.mods = Collections.unmodifiableSet(Patch.getALL() + .stream() + .map(p -> p.modID) + .collect(Collectors.toSet())); HashMap replacements = new HashMap(); for (String modID : mods) { @@ -249,7 +260,13 @@ public class DataFixerAPI2 { final public void markApplied() { for (String modID : mods) { - LOGGER.info("Updating Patch-Level for '{}' from {} to {} -> {}", modID, currentPatchLevel(modID), Patch.maxPatchLevel(modID), config.setInt(Configs.MAIN_PATCH_CATEGORY, modID, Patch.maxPatchLevel(modID))); + LOGGER.info( + "Updating Patch-Level for '{}' from {} to {} -> {}", + modID, + currentPatchLevel(modID), + Patch.maxPatchLevel(modID), + config.setInt(Configs.MAIN_PATCH_CATEGORY, modID, Patch.maxPatchLevel(modID)) + ); } config.saveChanges(); diff --git a/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java b/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java index 571fb407..314503d4 100644 --- a/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java +++ b/src/main/java/ru/bclib/blockentities/BaseBarrelBlockEntity.java @@ -134,7 +134,16 @@ public class BaseBarrelBlockEntity extends RandomizableContainerBlockEntity { double d = (double) this.worldPosition.getX() + 0.5D + (double) vec3i.getX() / 2.0D; double e = (double) this.worldPosition.getY() + 0.5D + (double) vec3i.getY() / 2.0D; double f = (double) this.worldPosition.getZ() + 0.5D + (double) vec3i.getZ() / 2.0D; - level.playSound(null, d, e, f, soundEvent, SoundSource.BLOCKS, 0.5F, this.level.random.nextFloat() * 0.1F + 0.9F); + level.playSound( + null, + d, + e, + f, + soundEvent, + SoundSource.BLOCKS, + 0.5F, + this.level.random.nextFloat() * 0.1F + 0.9F + ); } } } \ No newline at end of file diff --git a/src/main/java/ru/bclib/blocks/BaseAnvilBlock.java b/src/main/java/ru/bclib/blocks/BaseAnvilBlock.java index 192624c2..69283002 100644 --- a/src/main/java/ru/bclib/blocks/BaseAnvilBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseAnvilBlock.java @@ -4,10 +4,12 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.client.resources.model.UnbakedModel; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.AnvilBlock; @@ -20,16 +22,18 @@ import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; 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.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 BlockModelProvider { +public abstract class BaseAnvilBlock extends AnvilBlock implements BlockModelGetter, CustomItemGetter { public static final IntegerProperty DESTRUCTION = BlockProperties.DESTRUCTION; public BaseAnvilBlock(MaterialColor color) { @@ -91,4 +95,9 @@ public abstract class BaseAnvilBlock extends AnvilBlock implements BlockModelPro registerBlockModel(stateId, modelLocation, blockState, modelCache); return ModelsHelper.createFacingModel(modelLocation, blockState.getValue(FACING), false, false); } + + @Override + public BlockItem getCustomItem(ResourceLocation blockID, FabricItemSettings settings) { + return new BaseAnvilItem(this, settings); + } } diff --git a/src/main/java/ru/bclib/blocks/BaseBarrelBlock.java b/src/main/java/ru/bclib/blocks/BaseBarrelBlock.java index cde83356..baca4bdb 100644 --- a/src/main/java/ru/bclib/blocks/BaseBarrelBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseBarrelBlock.java @@ -28,9 +28,9 @@ import net.minecraft.world.phys.BlockHitResult; import org.jetbrains.annotations.Nullable; import ru.bclib.blockentities.BaseBarrelBlockEntity; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; 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 BlockModelProvider { +public class BaseBarrelBlock extends BarrelBlock implements BlockModelGetter { public BaseBarrelBlock(Block source) { super(FabricBlockSettings.copyOf(source).noOcclusion()); } diff --git a/src/main/java/ru/bclib/blocks/BaseBlock.java b/src/main/java/ru/bclib/blocks/BaseBlock.java index 0f17e517..da796ab1 100644 --- a/src/main/java/ru/bclib/blocks/BaseBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseBlock.java @@ -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.client.models.BlockModelProvider; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; @@ -23,7 +23,7 @@ import java.util.function.Consumer; *
  • Automatically create an Item-Model from the Block-Model
  • * */ -public class BaseBlock extends Block implements BlockModelProvider { +public class BaseBlock extends Block implements BlockModelGetter { /** * Creates a new Block with the passed properties * diff --git a/src/main/java/ru/bclib/blocks/BaseButtonBlock.java b/src/main/java/ru/bclib/blocks/BaseButtonBlock.java index 5fbd0d2c..5afd08e1 100644 --- a/src/main/java/ru/bclib/blocks/BaseButtonBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseButtonBlock.java @@ -15,16 +15,16 @@ import net.minecraft.world.level.block.state.properties.AttachFace; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelProvider { +public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelGetter { private final Block parent; @@ -51,7 +51,10 @@ public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelP @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { ResourceLocation parentId = Registry.BLOCK.getKey(parent); - Optional pattern = blockState.getValue(POWERED) ? PatternsHelper.createJson(BasePatterns.BLOCK_BUTTON_PRESSED, parentId) : PatternsHelper.createJson(BasePatterns.BLOCK_BUTTON, parentId); + Optional pattern = blockState.getValue(POWERED) ? PatternsHelper.createJson( + BasePatterns.BLOCK_BUTTON_PRESSED, + parentId + ) : PatternsHelper.createJson(BasePatterns.BLOCK_BUTTON, parentId); return ModelsHelper.fromPattern(pattern); } diff --git a/src/main/java/ru/bclib/blocks/BaseChainBlock.java b/src/main/java/ru/bclib/blocks/BaseChainBlock.java index 4b3cc0ef..97257e9a 100644 --- a/src/main/java/ru/bclib/blocks/BaseChainBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseChainBlock.java @@ -15,18 +15,18 @@ import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseChainBlock extends ChainBlock implements BlockModelProvider, IRenderTyped { +public class BaseChainBlock extends ChainBlock implements BlockModelGetter, RenderLayerGetter { public BaseChainBlock(MaterialColor color) { super(FabricBlockSettings.copyOf(Blocks.CHAIN).mapColor(color)); } diff --git a/src/main/java/ru/bclib/blocks/BaseChestBlock.java b/src/main/java/ru/bclib/blocks/BaseChestBlock.java index a38d3b28..94f7c722 100644 --- a/src/main/java/ru/bclib/blocks/BaseChestBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseChestBlock.java @@ -15,15 +15,15 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import ru.bclib.registry.BaseBlockEntities; import java.util.List; import java.util.Optional; -public class BaseChestBlock extends ChestBlock implements BlockModelProvider { +public class BaseChestBlock extends ChestBlock implements BlockModelGetter { private final Block parent; public BaseChestBlock(Block source) { diff --git a/src/main/java/ru/bclib/blocks/BaseComposterBlock.java b/src/main/java/ru/bclib/blocks/BaseComposterBlock.java index b7735daf..44ee2ddd 100644 --- a/src/main/java/ru/bclib/blocks/BaseComposterBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseComposterBlock.java @@ -13,17 +13,17 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; 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 java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseComposterBlock extends ComposterBlock implements BlockModelProvider { +public class BaseComposterBlock extends ComposterBlock implements BlockModelGetter { public BaseComposterBlock(Block source) { super(FabricBlockSettings.copyOf(source)); } diff --git a/src/main/java/ru/bclib/blocks/BaseCraftingTableBlock.java b/src/main/java/ru/bclib/blocks/BaseCraftingTableBlock.java index f4718e40..5addddc0 100644 --- a/src/main/java/ru/bclib/blocks/BaseCraftingTableBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseCraftingTableBlock.java @@ -12,16 +12,16 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Optional; -public class BaseCraftingTableBlock extends CraftingTableBlock implements BlockModelProvider { +public class BaseCraftingTableBlock extends CraftingTableBlock implements BlockModelGetter { public BaseCraftingTableBlock(Block source) { super(FabricBlockSettings.copyOf(source)); } diff --git a/src/main/java/ru/bclib/blocks/BaseCropBlock.java b/src/main/java/ru/bclib/blocks/BaseCropBlock.java index ec0ce04b..18a16c06 100644 --- a/src/main/java/ru/bclib/blocks/BaseCropBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseCropBlock.java @@ -38,7 +38,12 @@ public class BaseCropBlock extends BasePlantBlock { private final Item drop; public BaseCropBlock(Item drop, Block... terrain) { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.HOES).breakByHand(true).sound(SoundType.GRASS).randomTicks().noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.HOES) + .breakByHand(true) + .sound(SoundType.GRASS) + .randomTicks() + .noCollission()); this.drop = drop; this.terrain = terrain; this.registerDefaultState(defaultBlockState().setValue(AGE, 0)); diff --git a/src/main/java/ru/bclib/blocks/BaseDoorBlock.java b/src/main/java/ru/bclib/blocks/BaseDoorBlock.java index c903f642..540a5638 100644 --- a/src/main/java/ru/bclib/blocks/BaseDoorBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseDoorBlock.java @@ -18,18 +18,18 @@ import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseDoorBlock extends DoorBlock implements IRenderTyped, BlockModelProvider { +public class BaseDoorBlock extends DoorBlock implements RenderLayerGetter, BlockModelGetter { public BaseDoorBlock(Block source) { super(FabricBlockSettings.copyOf(source).strength(3F, 3F).noOcclusion()); } @@ -114,7 +114,10 @@ public class BaseDoorBlock extends DoorBlock implements IRenderTyped, BlockModel } break; } - ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_" + doorType); + ResourceLocation modelId = new ResourceLocation( + stateId.getNamespace(), + "block/" + stateId.getPath() + "_" + doorType + ); registerBlockModel(stateId, modelId, blockState, modelCache); return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false); } diff --git a/src/main/java/ru/bclib/blocks/BaseDoublePlantBlock.java b/src/main/java/ru/bclib/blocks/BaseDoublePlantBlock.java index 05bf1f15..837fcee2 100644 --- a/src/main/java/ru/bclib/blocks/BaseDoublePlantBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseDoublePlantBlock.java @@ -31,25 +31,34 @@ 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.IRenderTyped; +import ru.bclib.interfaces.RenderLayerGetter; import ru.bclib.util.BlocksHelper; import java.util.List; import java.util.Random; @SuppressWarnings("deprecation") -public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock { +public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements RenderLayerGetter, 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 BaseDoublePlantBlock() { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS) + .noCollission()); this.registerDefaultState(this.stateDefinition.any().setValue(TOP, false)); } public BaseDoublePlantBlock(int light) { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).lightLevel((state) -> state.getValue(TOP) ? light : 0).noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS) + .lightLevel((state) -> state.getValue(TOP) ? light : 0) + .noCollission()); this.registerDefaultState(this.stateDefinition.any().setValue(TOP, false)); } @@ -101,7 +110,10 @@ public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements I } ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else { @@ -126,7 +138,13 @@ public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements I @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { - ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(this)); + ItemEntity item = new ItemEntity( + world, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + new ItemStack(this) + ); world.addFreshEntity(item); } diff --git a/src/main/java/ru/bclib/blocks/BaseFenceBlock.java b/src/main/java/ru/bclib/blocks/BaseFenceBlock.java index 7c721437..fecd6ecb 100644 --- a/src/main/java/ru/bclib/blocks/BaseFenceBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseFenceBlock.java @@ -15,17 +15,17 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; 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 java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseFenceBlock extends FenceBlock implements BlockModelProvider { +public class BaseFenceBlock extends FenceBlock implements BlockModelGetter { private final Block parent; public BaseFenceBlock(Block source) { @@ -72,9 +72,21 @@ public class BaseFenceBlock extends FenceBlock implements BlockModelProvider { MultiPartBuilder builder = MultiPartBuilder.create(stateDefinition); builder.part(sideId).setCondition(state -> state.getValue(NORTH)).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(EAST)).setTransformation(BlockModelRotation.X0_Y90.getRotation()).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(SOUTH)).setTransformation(BlockModelRotation.X0_Y180.getRotation()).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(WEST)).setTransformation(BlockModelRotation.X0_Y270.getRotation()).setUVLock(true).add(); + builder.part(sideId) + .setCondition(state -> state.getValue(EAST)) + .setTransformation(BlockModelRotation.X0_Y90.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideId) + .setCondition(state -> state.getValue(SOUTH)) + .setTransformation(BlockModelRotation.X0_Y180.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideId) + .setCondition(state -> state.getValue(WEST)) + .setTransformation(BlockModelRotation.X0_Y270.getRotation()) + .setUVLock(true) + .add(); builder.part(postId).add(); return builder.build(); diff --git a/src/main/java/ru/bclib/blocks/BaseFurnaceBlock.java b/src/main/java/ru/bclib/blocks/BaseFurnaceBlock.java index ac6624ba..062f7ee5 100644 --- a/src/main/java/ru/bclib/blocks/BaseFurnaceBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseFurnaceBlock.java @@ -26,18 +26,18 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import org.jetbrains.annotations.Nullable; import ru.bclib.blockentities.BaseFurnaceBlockEntity; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; import ru.bclib.registry.BaseBlockEntities; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseFurnaceBlock extends FurnaceBlock implements BlockModelProvider, IRenderTyped { +public class BaseFurnaceBlock extends FurnaceBlock implements BlockModelGetter, RenderLayerGetter { public BaseFurnaceBlock(Block source) { super(FabricBlockSettings.copyOf(source).luminance(state -> state.getValue(LIT) ? 13 : 0)); } @@ -119,6 +119,10 @@ public class BaseFurnaceBlock extends FurnaceBlock implements BlockModelProvider @Nullable protected static BlockEntityTicker createFurnaceTicker(Level level, BlockEntityType blockEntityType, BlockEntityType blockEntityType2) { - return level.isClientSide ? null : createTickerHelper(blockEntityType, blockEntityType2, AbstractFurnaceBlockEntity::serverTick); + return level.isClientSide ? null : createTickerHelper( + blockEntityType, + blockEntityType2, + AbstractFurnaceBlockEntity::serverTick + ); } } diff --git a/src/main/java/ru/bclib/blocks/BaseGateBlock.java b/src/main/java/ru/bclib/blocks/BaseGateBlock.java index 7b239a7e..c2e6a1c1 100644 --- a/src/main/java/ru/bclib/blocks/BaseGateBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseGateBlock.java @@ -14,16 +14,16 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseGateBlock extends FenceGateBlock implements BlockModelProvider { +public class BaseGateBlock extends FenceGateBlock implements BlockModelGetter { private final Block parent; public BaseGateBlock(Block source) { @@ -51,10 +51,16 @@ public class BaseGateBlock extends FenceGateBlock implements BlockModelProvider ResourceLocation parentId = Registry.BLOCK.getKey(parent); Optional pattern; if (inWall) { - pattern = isOpen ? PatternsHelper.createJson(BasePatterns.BLOCK_GATE_OPEN_WALL, parentId) : PatternsHelper.createJson(BasePatterns.BLOCK_GATE_CLOSED_WALL, parentId); + pattern = isOpen ? PatternsHelper.createJson( + BasePatterns.BLOCK_GATE_OPEN_WALL, + parentId + ) : PatternsHelper.createJson(BasePatterns.BLOCK_GATE_CLOSED_WALL, parentId); } else { - pattern = isOpen ? PatternsHelper.createJson(BasePatterns.BLOCK_GATE_OPEN, parentId) : PatternsHelper.createJson(BasePatterns.BLOCK_GATE_CLOSED, parentId); + pattern = isOpen ? PatternsHelper.createJson( + BasePatterns.BLOCK_GATE_OPEN, + parentId + ) : PatternsHelper.createJson(BasePatterns.BLOCK_GATE_CLOSED, parentId); } return ModelsHelper.fromPattern(pattern); } diff --git a/src/main/java/ru/bclib/blocks/BaseLadderBlock.java b/src/main/java/ru/bclib/blocks/BaseLadderBlock.java index d5020846..404e6e28 100644 --- a/src/main/java/ru/bclib/blocks/BaseLadderBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseLadderBlock.java @@ -28,18 +28,18 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; import ru.bclib.util.BlocksHelper; import java.util.Map; import java.util.Optional; @SuppressWarnings("deprecation") -public class BaseLadderBlock extends BaseBlockNotFull implements IRenderTyped, BlockModelProvider { +public class BaseLadderBlock extends BaseBlockNotFull implements RenderLayerGetter, BlockModelGetter { 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); diff --git a/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java b/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java index 3bbcb5aa..d89887b5 100644 --- a/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseLeavesBlock.java @@ -15,20 +15,27 @@ import net.minecraft.world.level.block.state.BlockState; 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.models.BlockModelProvider; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; import ru.bclib.util.MHelper; import java.util.Collections; import java.util.List; import java.util.function.Consumer; -public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, IRenderTyped { +public class BaseLeavesBlock extends LeavesBlock implements BlockModelGetter, RenderLayerGetter { private final Block sapling; private static FabricBlockSettings makeLeaves(MaterialColor color) { - return FabricBlockSettings.copyOf(Blocks.OAK_LEAVES).mapColor(color).breakByTool(FabricToolTags.HOES).breakByTool(FabricToolTags.SHEARS).breakByHand(true).allowsSpawning((state, world, pos, type) -> false).suffocates((state, world, pos) -> false).blockVision((state, world, pos) -> false); + return FabricBlockSettings.copyOf(Blocks.OAK_LEAVES) + .mapColor(color) + .breakByTool(FabricToolTags.HOES) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .allowsSpawning((state, world, pos, type) -> false) + .suffocates((state, world, pos) -> false) + .blockVision((state, world, pos) -> false); } public BaseLeavesBlock(Block sapling, MaterialColor color, Consumer customizeProperties) { @@ -61,7 +68,10 @@ public class BaseLeavesBlock extends LeavesBlock implements BlockModelProvider, public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); if (tool != null) { - if (FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Collections.singletonList(new ItemStack(this)); } int fortune = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_FORTUNE, tool); diff --git a/src/main/java/ru/bclib/blocks/BaseMetalBarsBlock.java b/src/main/java/ru/bclib/blocks/BaseMetalBarsBlock.java index d29ff46d..5ed2ecec 100644 --- a/src/main/java/ru/bclib/blocks/BaseMetalBarsBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseMetalBarsBlock.java @@ -16,18 +16,18 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseMetalBarsBlock extends IronBarsBlock implements BlockModelProvider, IRenderTyped { +public class BaseMetalBarsBlock extends IronBarsBlock implements BlockModelGetter, RenderLayerGetter { public BaseMetalBarsBlock(Block source) { super(FabricBlockSettings.copyOf(source).strength(5.0F, 6.0F).noOcclusion()); } @@ -81,11 +81,26 @@ public class BaseMetalBarsBlock extends IronBarsBlock implements BlockModelProvi registerBlockModel(sideId, sideId, blockState, modelCache); ModelsHelper.MultiPartBuilder builder = ModelsHelper.MultiPartBuilder.create(stateDefinition); - builder.part(postId).setCondition(state -> !state.getValue(NORTH) && !state.getValue(EAST) && !state.getValue(SOUTH) && !state.getValue(WEST)).add(); + builder.part(postId) + .setCondition(state -> !state.getValue(NORTH) && !state.getValue(EAST) && !state.getValue(SOUTH) && !state + .getValue(WEST)) + .add(); builder.part(sideId).setCondition(state -> state.getValue(NORTH)).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(EAST)).setTransformation(BlockModelRotation.X0_Y90.getRotation()).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(SOUTH)).setTransformation(BlockModelRotation.X0_Y180.getRotation()).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(WEST)).setTransformation(BlockModelRotation.X0_Y270.getRotation()).setUVLock(true).add(); + builder.part(sideId) + .setCondition(state -> state.getValue(EAST)) + .setTransformation(BlockModelRotation.X0_Y90.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideId) + .setCondition(state -> state.getValue(SOUTH)) + .setTransformation(BlockModelRotation.X0_Y180.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideId) + .setCondition(state -> state.getValue(WEST)) + .setTransformation(BlockModelRotation.X0_Y270.getRotation()) + .setUVLock(true) + .add(); return builder.build(); } diff --git a/src/main/java/ru/bclib/blocks/BaseOreBlock.java b/src/main/java/ru/bclib/blocks/BaseOreBlock.java index ebf88679..e5c17f15 100644 --- a/src/main/java/ru/bclib/blocks/BaseOreBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseOreBlock.java @@ -16,19 +16,23 @@ 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.client.models.BlockModelProvider; +import ru.bclib.interfaces.BlockModelGetter; import ru.bclib.util.MHelper; import java.util.Collections; import java.util.List; -public class BaseOreBlock extends OreBlock implements BlockModelProvider { +public class BaseOreBlock extends OreBlock implements BlockModelGetter { private final Item dropItem; private final int minCount; private final int maxCount; public BaseOreBlock(Item drop, int minCount, int maxCount, int experience) { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.SAND).hardness(3F).resistance(9F).requiresCorrectToolForDrops().sound(SoundType.STONE), UniformInt.of(1, experience)); + super(FabricBlockSettings.of(Material.STONE, MaterialColor.SAND) + .hardness(3F) + .resistance(9F) + .requiresCorrectToolForDrops() + .sound(SoundType.STONE), UniformInt.of(1, experience)); this.dropItem = drop; this.minCount = minCount; this.maxCount = maxCount; diff --git a/src/main/java/ru/bclib/blocks/BasePlantBlock.java b/src/main/java/ru/bclib/blocks/BasePlantBlock.java index c7818a90..a9fe59fa 100644 --- a/src/main/java/ru/bclib/blocks/BasePlantBlock.java +++ b/src/main/java/ru/bclib/blocks/BasePlantBlock.java @@ -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.IRenderTyped; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.List; import java.util.Random; @SuppressWarnings("deprecation") -public abstract class BasePlantBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock { +public abstract class BasePlantBlock extends BaseBlockNotFull implements RenderLayerGetter, BonemealableBlock { private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12); public BasePlantBlock() { @@ -45,11 +45,20 @@ public abstract class BasePlantBlock extends BaseBlockNotFull implements IRender } public BasePlantBlock(boolean replaceable) { - super(FabricBlockSettings.of(replaceable ? Material.REPLACEABLE_PLANT : Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).noCollission()); + super(FabricBlockSettings.of(replaceable ? Material.REPLACEABLE_PLANT : Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .noCollission()); } public BasePlantBlock(boolean replaceable, int light) { - super(FabricBlockSettings.of(replaceable ? Material.REPLACEABLE_PLANT : Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(light).sound(SoundType.GRASS).noCollission()); + super(FabricBlockSettings.of(replaceable ? Material.REPLACEABLE_PLANT : Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .luminance(light) + .sound(SoundType.GRASS) + .noCollission()); } public BasePlantBlock(Properties settings) { @@ -88,7 +97,10 @@ public abstract class BasePlantBlock extends BaseBlockNotFull implements IRender @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else { @@ -113,7 +125,13 @@ public abstract class BasePlantBlock extends BaseBlockNotFull implements IRender @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { - ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(this)); + ItemEntity item = new ItemEntity( + world, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + new ItemStack(this) + ); world.addFreshEntity(item); } } diff --git a/src/main/java/ru/bclib/blocks/BasePlantWithAgeBlock.java b/src/main/java/ru/bclib/blocks/BasePlantWithAgeBlock.java index 89749c6e..4d8ce1b0 100644 --- a/src/main/java/ru/bclib/blocks/BasePlantWithAgeBlock.java +++ b/src/main/java/ru/bclib/blocks/BasePlantWithAgeBlock.java @@ -19,7 +19,12 @@ public abstract class BasePlantWithAgeBlock extends BasePlantBlock { public static final IntegerProperty AGE = BlockProperties.AGE; public BasePlantWithAgeBlock() { - this(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).randomTicks().noCollission()); + this(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .randomTicks() + .noCollission()); } public BasePlantWithAgeBlock(Properties settings) { diff --git a/src/main/java/ru/bclib/blocks/BasePressurePlateBlock.java b/src/main/java/ru/bclib/blocks/BasePressurePlateBlock.java index dd76e216..a7f834c4 100644 --- a/src/main/java/ru/bclib/blocks/BasePressurePlateBlock.java +++ b/src/main/java/ru/bclib/blocks/BasePressurePlateBlock.java @@ -14,16 +14,16 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BasePressurePlateBlock extends PressurePlateBlock implements BlockModelProvider { +public class BasePressurePlateBlock extends PressurePlateBlock implements BlockModelGetter { private final Block parent; public BasePressurePlateBlock(Sensitivity rule, Block source) { diff --git a/src/main/java/ru/bclib/blocks/BaseRotatedPillarBlock.java b/src/main/java/ru/bclib/blocks/BaseRotatedPillarBlock.java index d866c9d2..9eac0d81 100644 --- a/src/main/java/ru/bclib/blocks/BaseRotatedPillarBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseRotatedPillarBlock.java @@ -12,16 +12,16 @@ import net.minecraft.world.level.block.RotatedPillarBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseRotatedPillarBlock extends RotatedPillarBlock implements BlockModelProvider { +public class BaseRotatedPillarBlock extends RotatedPillarBlock implements BlockModelGetter { public BaseRotatedPillarBlock(Properties settings) { super(settings); } diff --git a/src/main/java/ru/bclib/blocks/BaseSignBlock.java b/src/main/java/ru/bclib/blocks/BaseSignBlock.java index 98ed4864..05ec9de3 100644 --- a/src/main/java/ru/bclib/blocks/BaseSignBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseSignBlock.java @@ -2,6 +2,7 @@ package ru.bclib.blocks; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.core.BlockPos; @@ -13,6 +14,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.Mth; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; @@ -39,25 +41,34 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import ru.bclib.blockentities.BaseSignBlockEntity; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; -import ru.bclib.interfaces.ISpetialItem; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.CustomItemGetter; +import ru.bclib.registry.BlocksRegistry; import ru.bclib.util.BlocksHelper; import java.util.Collections; import java.util.List; @SuppressWarnings("deprecation") -public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpetialItem { +public class BaseSignBlock extends SignBlock implements BlockModelGetter, CustomItemGetter { public static final IntegerProperty ROTATION = BlockStateProperties.ROTATION_16; public static final BooleanProperty FLOOR = BooleanProperty.create("floor"); - private static final VoxelShape[] WALL_SHAPES = new VoxelShape[] {Block.box(0.0D, 4.5D, 14.0D, 16.0D, 12.5D, 16.0D), Block.box(0.0D, 4.5D, 0.0D, 2.0D, 12.5D, 16.0D), Block.box(0.0D, 4.5D, 0.0D, 16.0D, 12.5D, 2.0D), Block.box(14.0D, 4.5D, 0.0D, 16.0D, 12.5D, 16.0D)}; + private static final VoxelShape[] WALL_SHAPES = new VoxelShape[] { + Block.box(0.0D, 4.5D, 14.0D, 16.0D, 12.5D, 16.0D), + Block.box(0.0D, 4.5D, 0.0D, 2.0D, 12.5D, 16.0D), + Block.box(0.0D, 4.5D, 0.0D, 16.0D, 12.5D, 2.0D), + Block.box(14.0D, 4.5D, 0.0D, 16.0D, 12.5D, 16.0D) + }; private final Block parent; public BaseSignBlock(Block source) { super(FabricBlockSettings.copyOf(source).strength(1.0F, 1.0F).noCollission().noOcclusion(), WoodType.OAK); - this.registerDefaultState(this.stateDefinition.any().setValue(ROTATION, 0).setValue(FLOOR, false).setValue(WATERLOGGED, false)); + this.registerDefaultState(this.stateDefinition.any() + .setValue(ROTATION, 0) + .setValue(FLOOR, false) + .setValue(WATERLOGGED, false)); this.parent = source; } @@ -98,7 +109,8 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world)); } if (!canSurvive(state, world, pos)) { - return state.getValue(WATERLOGGED) ? state.getFluidState().createLegacyBlock() : Blocks.AIR.defaultBlockState(); + return state.getValue(WATERLOGGED) ? state.getFluidState() + .createLegacyBlock() : Blocks.AIR.defaultBlockState(); } return super.updateShape(state, facing, neighborState, world, pos, neighborPos); } @@ -118,7 +130,10 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe public BlockState getStateForPlacement(BlockPlaceContext ctx) { if (ctx.getClickedFace() == Direction.UP) { FluidState fluidState = ctx.getLevel().getFluidState(ctx.getClickedPos()); - return this.defaultBlockState().setValue(FLOOR, true).setValue(ROTATION, Mth.floor((180.0 + ctx.getRotation() * 16.0 / 360.0) + 0.5 - 12) & 15).setValue(WATERLOGGED, fluidState.getType() == Fluids.WATER); + return this.defaultBlockState() + .setValue(FLOOR, true) + .setValue(ROTATION, Mth.floor((180.0 + ctx.getRotation() * 16.0 / 360.0) + 0.5 - 12) & 15) + .setValue(WATERLOGGED, fluidState.getType() == Fluids.WATER); } else if (ctx.getClickedFace() != Direction.DOWN) { BlockState blockState = this.defaultBlockState(); @@ -133,7 +148,8 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe int rot = Mth.floor((180.0 + dir.toYRot() * 16.0 / 360.0) + 0.5 + 4) & 15; blockState = blockState.setValue(ROTATION, rot); if (blockState.canSurvive(worldView, blockPos)) { - return blockState.setValue(FLOOR, false).setValue(WATERLOGGED, fluidState.getType() == Fluids.WATER); + return blockState.setValue(FLOOR, false) + .setValue(WATERLOGGED, fluidState.getType() == Fluids.WATER); } } } @@ -177,12 +193,7 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe } @Override - public int getStackSize() { - return 16; - } - - @Override - public boolean canPlaceOnWater() { - return false; + public BlockItem getCustomItem(ResourceLocation blockID, FabricItemSettings settings) { + return new BlockItem(this, settings.maxCount(16)); } } \ No newline at end of file diff --git a/src/main/java/ru/bclib/blocks/BaseSlabBlock.java b/src/main/java/ru/bclib/blocks/BaseSlabBlock.java index 4d949ca5..dfdb1894 100644 --- a/src/main/java/ru/bclib/blocks/BaseSlabBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseSlabBlock.java @@ -16,16 +16,16 @@ import net.minecraft.world.level.block.state.properties.SlabType; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseSlabBlock extends SlabBlock implements BlockModelProvider { +public class BaseSlabBlock extends SlabBlock implements BlockModelGetter { private final Block parent; public BaseSlabBlock(Block source) { @@ -63,7 +63,10 @@ public class BaseSlabBlock extends SlabBlock implements BlockModelProvider { @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { SlabType type = blockState.getValue(TYPE); - ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_" + type); + ResourceLocation modelId = new ResourceLocation( + stateId.getNamespace(), + "block/" + stateId.getPath() + "_" + type + ); registerBlockModel(stateId, modelId, blockState, modelCache); if (type == SlabType.TOP) { return ModelsHelper.createMultiVariant(modelId, BlockModelRotation.X180_Y0.getRotation(), true); diff --git a/src/main/java/ru/bclib/blocks/BaseStairsBlock.java b/src/main/java/ru/bclib/blocks/BaseStairsBlock.java index 5c0c176c..2f444a1e 100644 --- a/src/main/java/ru/bclib/blocks/BaseStairsBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseStairsBlock.java @@ -17,16 +17,16 @@ import net.minecraft.world.level.block.state.properties.StairsShape; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseStairsBlock extends StairBlock implements BlockModelProvider { +public class BaseStairsBlock extends StairBlock implements BlockModelGetter { private final Block parent; diff --git a/src/main/java/ru/bclib/blocks/BaseStripableLogBlock.java b/src/main/java/ru/bclib/blocks/BaseStripableLogBlock.java index a552e9fc..eb82ebbe 100644 --- a/src/main/java/ru/bclib/blocks/BaseStripableLogBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseStripableLogBlock.java @@ -30,7 +30,11 @@ public class BaseStripableLogBlock extends BaseRotatedPillarBlock { if (FabricToolTags.AXES.contains(player.getMainHandItem().getItem())) { world.playSound(player, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); if (!world.isClientSide) { - world.setBlock(pos, striped.defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)), 11); + world.setBlock(pos, + striped.defaultBlockState() + .setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)), + 11 + ); if (!player.isCreative()) { player.getMainHandItem().hurt(1, world.random, (ServerPlayer) player); } diff --git a/src/main/java/ru/bclib/blocks/BaseTerrainBlock.java b/src/main/java/ru/bclib/blocks/BaseTerrainBlock.java index 5516246e..cd53cc56 100644 --- a/src/main/java/ru/bclib/blocks/BaseTerrainBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseTerrainBlock.java @@ -51,7 +51,10 @@ public class BaseTerrainBlock extends BaseBlock { private Block pathBlock; public BaseTerrainBlock(Block baseBlock, MaterialColor color) { - super(FabricBlockSettings.copyOf(baseBlock).materialColor(color).sound(BlockSounds.TERRAIN_SOUND).randomTicks()); + super(FabricBlockSettings.copyOf(baseBlock) + .materialColor(color) + .sound(BlockSounds.TERRAIN_SOUND) + .randomTicks()); this.baseBlock = baseBlock; } @@ -104,7 +107,15 @@ public class BaseTerrainBlock extends BaseBlock { return false; } else { - int i = LayerLightEngine.getLightBlockInto(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getLightBlock(worldView, blockPos)); + int i = LayerLightEngine.getLightBlockInto( + worldView, + state, + pos, + blockState, + blockPos, + Direction.UP, + blockState.getLightBlock(worldView, blockPos) + ); return i < 5; } } diff --git a/src/main/java/ru/bclib/blocks/BaseTrapdoorBlock.java b/src/main/java/ru/bclib/blocks/BaseTrapdoorBlock.java index fd2c4d5b..84a3b1b1 100644 --- a/src/main/java/ru/bclib/blocks/BaseTrapdoorBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseTrapdoorBlock.java @@ -15,11 +15,11 @@ import net.minecraft.world.level.block.state.properties.Half; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; 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 IRenderTyped, BlockModelProvider { +public class BaseTrapdoorBlock extends TrapDoorBlock implements RenderLayerGetter, BlockModelGetter { public BaseTrapdoorBlock(Block source) { super(FabricBlockSettings.copyOf(source).strength(3.0F, 3.0F).noOcclusion()); } @@ -53,15 +53,18 @@ public class BaseTrapdoorBlock extends TrapDoorBlock implements IRenderTyped, Bl @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { String name = resourceLocation.getPath(); - Optional pattern = PatternsHelper.createJson(BasePatterns.BLOCK_TRAPDOOR, new HashMap() { - private static final long serialVersionUID = 1L; - - { - put("%modid%", resourceLocation.getNamespace()); - put("%texture%", name); - put("%side%", name.replace("trapdoor", "door_side")); + Optional pattern = PatternsHelper.createJson( + BasePatterns.BLOCK_TRAPDOOR, + new HashMap() { + private static final long serialVersionUID = 1L; + + { + put("%modid%", resourceLocation.getNamespace()); + put("%texture%", name); + put("%side%", name.replace("trapdoor", "door_side")); + } } - }); + ); return ModelsHelper.fromPattern(pattern); } diff --git a/src/main/java/ru/bclib/blocks/BaseUnderwaterWallPlantBlock.java b/src/main/java/ru/bclib/blocks/BaseUnderwaterWallPlantBlock.java index 50201937..2c226cf4 100644 --- a/src/main/java/ru/bclib/blocks/BaseUnderwaterWallPlantBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseUnderwaterWallPlantBlock.java @@ -17,11 +17,20 @@ import net.minecraft.world.level.material.Material; public abstract class BaseUnderwaterWallPlantBlock extends BaseWallPlantBlock implements LiquidBlockContainer { public BaseUnderwaterWallPlantBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS) + .noCollission()); } public BaseUnderwaterWallPlantBlock(int light) { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(light).sound(SoundType.WET_GRASS).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .luminance(light) + .sound(SoundType.WET_GRASS) + .noCollission()); } public BaseUnderwaterWallPlantBlock(Properties settings) { diff --git a/src/main/java/ru/bclib/blocks/BaseVineBlock.java b/src/main/java/ru/bclib/blocks/BaseVineBlock.java index 3437a49b..7b473eb2 100644 --- a/src/main/java/ru/bclib/blocks/BaseVineBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseVineBlock.java @@ -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.IRenderTyped; +import ru.bclib.interfaces.RenderLayerGetter; import ru.bclib.util.BlocksHelper; import java.util.List; import java.util.Random; @SuppressWarnings("deprecation") -public class BaseVineBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock { +public class BaseVineBlock extends BaseBlockNotFull implements RenderLayerGetter, BonemealableBlock { public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; private static final VoxelShape VOXEL_SHAPE = Block.box(2, 0, 2, 14, 16, 14); @@ -50,7 +50,12 @@ public class BaseVineBlock extends BaseBlockNotFull implements IRenderTyped, Bon } public BaseVineBlock(int light, boolean bottomOnly) { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).lightLevel((state) -> bottomOnly ? state.getValue(SHAPE) == TripleShape.BOTTOM ? light : 0 : light).noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .lightLevel((state) -> bottomOnly ? state.getValue(SHAPE) == TripleShape.BOTTOM ? light : 0 : light) + .noCollission()); this.registerDefaultState(this.stateDefinition.any().setValue(SHAPE, TripleShape.BOTTOM)); } @@ -99,7 +104,10 @@ public class BaseVineBlock extends BaseBlockNotFull implements IRenderTyped, Bon @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else { diff --git a/src/main/java/ru/bclib/blocks/BaseWallBlock.java b/src/main/java/ru/bclib/blocks/BaseWallBlock.java index 682bea1e..349f1e3e 100644 --- a/src/main/java/ru/bclib/blocks/BaseWallBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseWallBlock.java @@ -16,16 +16,16 @@ import net.minecraft.world.level.block.state.properties.WallSide; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseWallBlock extends WallBlock implements BlockModelProvider { +public class BaseWallBlock extends WallBlock implements BlockModelGetter { private final Block parent; @@ -71,20 +71,50 @@ public class BaseWallBlock extends WallBlock implements BlockModelProvider { public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { ResourceLocation postId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_post"); ResourceLocation sideId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_side"); - ResourceLocation sideTallId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_side_tall"); + ResourceLocation sideTallId = new ResourceLocation( + stateId.getNamespace(), + "block/" + stateId.getPath() + "_side_tall" + ); registerBlockModel(postId, postId, blockState, modelCache); registerBlockModel(sideId, sideId, blockState, modelCache); registerBlockModel(sideTallId, sideTallId, blockState, modelCache); ModelsHelper.MultiPartBuilder builder = ModelsHelper.MultiPartBuilder.create(stateDefinition); builder.part(sideId).setCondition(state -> state.getValue(NORTH_WALL) == WallSide.LOW).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(EAST_WALL) == WallSide.LOW).setTransformation(BlockModelRotation.X0_Y90.getRotation()).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(SOUTH_WALL) == WallSide.LOW).setTransformation(BlockModelRotation.X0_Y180.getRotation()).setUVLock(true).add(); - builder.part(sideId).setCondition(state -> state.getValue(WEST_WALL) == WallSide.LOW).setTransformation(BlockModelRotation.X0_Y270.getRotation()).setUVLock(true).add(); - builder.part(sideTallId).setCondition(state -> state.getValue(NORTH_WALL) == WallSide.TALL).setUVLock(true).add(); - builder.part(sideTallId).setCondition(state -> state.getValue(EAST_WALL) == WallSide.TALL).setTransformation(BlockModelRotation.X0_Y90.getRotation()).setUVLock(true).add(); - builder.part(sideTallId).setCondition(state -> state.getValue(SOUTH_WALL) == WallSide.TALL).setTransformation(BlockModelRotation.X0_Y180.getRotation()).setUVLock(true).add(); - builder.part(sideTallId).setCondition(state -> state.getValue(WEST_WALL) == WallSide.TALL).setTransformation(BlockModelRotation.X0_Y270.getRotation()).setUVLock(true).add(); + builder.part(sideId) + .setCondition(state -> state.getValue(EAST_WALL) == WallSide.LOW) + .setTransformation(BlockModelRotation.X0_Y90.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideId) + .setCondition(state -> state.getValue(SOUTH_WALL) == WallSide.LOW) + .setTransformation(BlockModelRotation.X0_Y180.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideId) + .setCondition(state -> state.getValue(WEST_WALL) == WallSide.LOW) + .setTransformation(BlockModelRotation.X0_Y270.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideTallId) + .setCondition(state -> state.getValue(NORTH_WALL) == WallSide.TALL) + .setUVLock(true) + .add(); + builder.part(sideTallId) + .setCondition(state -> state.getValue(EAST_WALL) == WallSide.TALL) + .setTransformation(BlockModelRotation.X0_Y90.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideTallId) + .setCondition(state -> state.getValue(SOUTH_WALL) == WallSide.TALL) + .setTransformation(BlockModelRotation.X0_Y180.getRotation()) + .setUVLock(true) + .add(); + builder.part(sideTallId) + .setCondition(state -> state.getValue(WEST_WALL) == WallSide.TALL) + .setTransformation(BlockModelRotation.X0_Y270.getRotation()) + .setUVLock(true) + .add(); builder.part(postId).setCondition(state -> state.getValue(UP)).add(); return builder.build(); diff --git a/src/main/java/ru/bclib/blocks/BaseWallPlantBlock.java b/src/main/java/ru/bclib/blocks/BaseWallPlantBlock.java index 5a398081..ee022070 100644 --- a/src/main/java/ru/bclib/blocks/BaseWallPlantBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseWallPlantBlock.java @@ -28,15 +28,33 @@ import ru.bclib.util.BlocksHelper; import java.util.EnumMap; public abstract class BaseWallPlantBlock extends BasePlantBlock { - private static final EnumMap SHAPES = Maps.newEnumMap(ImmutableMap.of(Direction.NORTH, Block.box(1, 1, 8, 15, 15, 16), Direction.SOUTH, Block.box(1, 1, 0, 15, 15, 8), Direction.WEST, Block.box(8, 1, 1, 16, 15, 15), Direction.EAST, Block.box(0, 1, 1, 8, 15, 15))); + private static final EnumMap SHAPES = Maps.newEnumMap(ImmutableMap.of( + Direction.NORTH, + Block.box(1, 1, 8, 15, 15, 16), + Direction.SOUTH, + Block.box(1, 1, 0, 15, 15, 8), + Direction.WEST, + Block.box(8, 1, 1, 16, 15, 15), + Direction.EAST, + Block.box(0, 1, 1, 8, 15, 15) + )); public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; public BaseWallPlantBlock() { - this(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).noCollission()); + this(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .noCollission()); } public BaseWallPlantBlock(int light) { - this(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(light).sound(SoundType.GRASS).noCollission()); + this(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .luminance(light) + .sound(SoundType.GRASS) + .noCollission()); } public BaseWallPlantBlock(Properties settings) { diff --git a/src/main/java/ru/bclib/blocks/BaseWeightedPlateBlock.java b/src/main/java/ru/bclib/blocks/BaseWeightedPlateBlock.java index 20b2f8f7..6b396c71 100644 --- a/src/main/java/ru/bclib/blocks/BaseWeightedPlateBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseWeightedPlateBlock.java @@ -14,20 +14,23 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.storage.loot.LootContext; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.BlockModelGetter; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -public class BaseWeightedPlateBlock extends WeightedPressurePlateBlock implements BlockModelProvider { +public class BaseWeightedPlateBlock extends WeightedPressurePlateBlock implements BlockModelGetter { private final Block parent; public BaseWeightedPlateBlock(Block source) { - super(15, FabricBlockSettings.copyOf(source).noCollission().noOcclusion().requiresCorrectToolForDrops().strength(0.5F)); + super( + 15, + FabricBlockSettings.copyOf(source).noCollission().noOcclusion().requiresCorrectToolForDrops().strength(0.5F) + ); this.parent = source; } diff --git a/src/main/java/ru/bclib/blocks/FeatureSaplingBlock.java b/src/main/java/ru/bclib/blocks/FeatureSaplingBlock.java index 42c727b6..c5492614 100644 --- a/src/main/java/ru/bclib/blocks/FeatureSaplingBlock.java +++ b/src/main/java/ru/bclib/blocks/FeatureSaplingBlock.java @@ -25,11 +25,11 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.BlockModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.Collections; import java.util.List; @@ -37,15 +37,32 @@ import java.util.Optional; import java.util.Random; @SuppressWarnings("deprecation") -public abstract class FeatureSaplingBlock extends SaplingBlock implements IRenderTyped, BlockModelProvider { +public abstract class FeatureSaplingBlock extends SaplingBlock implements RenderLayerGetter, BlockModelGetter { private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12); public FeatureSaplingBlock() { - super(null, FabricBlockSettings.of(Material.PLANT).breakByHand(true).collidable(false).instabreak().sound(SoundType.GRASS).randomTicks()); + super( + null, + FabricBlockSettings.of(Material.PLANT) + .breakByHand(true) + .collidable(false) + .instabreak() + .sound(SoundType.GRASS) + .randomTicks() + ); } public FeatureSaplingBlock(int light) { - super(null, FabricBlockSettings.of(Material.PLANT).breakByHand(true).collidable(false).luminance(light).instabreak().sound(SoundType.GRASS).randomTicks()); + super( + null, + FabricBlockSettings.of(Material.PLANT) + .breakByHand(true) + .collidable(false) + .luminance(light) + .instabreak() + .sound(SoundType.GRASS) + .randomTicks() + ); } protected abstract Feature getFeature(); @@ -73,7 +90,13 @@ public abstract class FeatureSaplingBlock extends SaplingBlock implements IRende @Override public void advanceTree(ServerLevel world, BlockPos pos, BlockState blockState, Random random) { - FeaturePlaceContext context = new FeaturePlaceContext(world, world.getChunkSource().getGenerator(), random, pos, null); + FeaturePlaceContext context = new FeaturePlaceContext( + world, + world.getChunkSource().getGenerator(), + random, + pos, + null + ); getFeature().place(context); } diff --git a/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java b/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java index 8fe7c375..4c17edd0 100644 --- a/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java +++ b/src/main/java/ru/bclib/blocks/SimpleLeavesBlock.java @@ -5,15 +5,30 @@ 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.IRenderTyped; +import ru.bclib.interfaces.RenderLayerGetter; -public class SimpleLeavesBlock extends BaseBlockNotFull implements IRenderTyped { +public class SimpleLeavesBlock extends BaseBlockNotFull implements RenderLayerGetter { public SimpleLeavesBlock(MaterialColor color) { - super(FabricBlockSettings.of(Material.LEAVES).strength(0.2F).mapColor(color).sound(SoundType.GRASS).noOcclusion().isValidSpawn((state, world, pos, type) -> false).isSuffocating((state, world, pos) -> false).isViewBlocking((state, world, pos) -> false)); + super(FabricBlockSettings.of(Material.LEAVES) + .strength(0.2F) + .mapColor(color) + .sound(SoundType.GRASS) + .noOcclusion() + .isValidSpawn((state, world, pos, type) -> false) + .isSuffocating((state, world, pos) -> false) + .isViewBlocking((state, world, pos) -> false)); } public SimpleLeavesBlock(MaterialColor color, int light) { - super(FabricBlockSettings.of(Material.LEAVES).luminance(light).mapColor(color).strength(0.2F).sound(SoundType.GRASS).noOcclusion().isValidSpawn((state, world, pos, type) -> false).isSuffocating((state, world, pos) -> false).isViewBlocking((state, world, pos) -> false)); + super(FabricBlockSettings.of(Material.LEAVES) + .luminance(light) + .mapColor(color) + .strength(0.2F) + .sound(SoundType.GRASS) + .noOcclusion() + .isValidSpawn((state, world, pos, type) -> false) + .isSuffocating((state, world, pos) -> false) + .isViewBlocking((state, world, pos) -> false)); } @Override diff --git a/src/main/java/ru/bclib/blocks/StalactiteBlock.java b/src/main/java/ru/bclib/blocks/StalactiteBlock.java index 11ae5224..04dd00b9 100644 --- a/src/main/java/ru/bclib/blocks/StalactiteBlock.java +++ b/src/main/java/ru/bclib/blocks/StalactiteBlock.java @@ -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.IRenderTyped; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.Map; import java.util.Optional; @SuppressWarnings("deprecation") -public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer, IRenderTyped { +public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer, RenderLayerGetter { public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR; public static final IntegerProperty SIZE = BlockProperties.SIZE; @@ -51,7 +51,10 @@ public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterlogg public StalactiteBlock(Block source) { super(FabricBlockSettings.copy(source).noOcclusion()); - this.registerDefaultState(getStateDefinition().any().setValue(SIZE, 0).setValue(IS_FLOOR, true).setValue(WATERLOGGED, false)); + this.registerDefaultState(getStateDefinition().any() + .setValue(SIZE, 0) + .setValue(IS_FLOOR, true) + .setValue(WATERLOGGED, false)); } @Override @@ -212,7 +215,10 @@ public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterlogg @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { BlockModelRotation rotation = blockState.getValue(IS_FLOOR) ? BlockModelRotation.X0_Y0 : BlockModelRotation.X180_Y0; - ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), stateId.getPath() + "_" + blockState.getValue(SIZE)); + ResourceLocation modelId = new ResourceLocation( + stateId.getNamespace(), + stateId.getPath() + "_" + blockState.getValue(SIZE) + ); registerBlockModel(modelId, modelId, blockState, modelCache); return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false); } diff --git a/src/main/java/ru/bclib/blocks/StripableBarkBlock.java b/src/main/java/ru/bclib/blocks/StripableBarkBlock.java index d0195177..d87f973a 100644 --- a/src/main/java/ru/bclib/blocks/StripableBarkBlock.java +++ b/src/main/java/ru/bclib/blocks/StripableBarkBlock.java @@ -30,7 +30,11 @@ public class StripableBarkBlock extends BaseBarkBlock { if (FabricToolTags.AXES.contains(player.getMainHandItem().getItem())) { world.playSound(player, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); if (!world.isClientSide) { - world.setBlock(pos, striped.defaultBlockState().setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)), 11); + world.setBlock(pos, + striped.defaultBlockState() + .setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)), + 11 + ); if (!player.isCreative()) { player.getMainHandItem().hurt(1, world.random, (ServerPlayer) player); } diff --git a/src/main/java/ru/bclib/blocks/TripleTerrainBlock.java b/src/main/java/ru/bclib/blocks/TripleTerrainBlock.java index e04b13c3..9cc581c2 100644 --- a/src/main/java/ru/bclib/blocks/TripleTerrainBlock.java +++ b/src/main/java/ru/bclib/blocks/TripleTerrainBlock.java @@ -153,7 +153,17 @@ public class TripleTerrainBlock extends BaseTerrainBlock { return new MultiVariant(variants); } else if (blockState.getValue(SHAPE) == TripleShape.TOP) { - return new MultiVariant(Lists.newArrayList(new Variant(modelId, BlockModelRotation.X180_Y0.getRotation(), false, 1), new Variant(modelId, BlockModelRotation.X180_Y90.getRotation(), false, 1), new Variant(modelId, BlockModelRotation.X180_Y180.getRotation(), false, 1), new Variant(modelId, BlockModelRotation.X180_Y270.getRotation(), false, 1))); + return new MultiVariant(Lists.newArrayList( + new Variant( + modelId, + BlockModelRotation.X180_Y0.getRotation(), + false, + 1 + ), + new Variant(modelId, BlockModelRotation.X180_Y90.getRotation(), false, 1), + new Variant(modelId, BlockModelRotation.X180_Y180.getRotation(), false, 1), + new Variant(modelId, BlockModelRotation.X180_Y270.getRotation(), false, 1) + )); } return ModelsHelper.createRandomTopModel(modelId); } diff --git a/src/main/java/ru/bclib/blocks/UnderwaterPlantBlock.java b/src/main/java/ru/bclib/blocks/UnderwaterPlantBlock.java index dd92f183..86c21d86 100644 --- a/src/main/java/ru/bclib/blocks/UnderwaterPlantBlock.java +++ b/src/main/java/ru/bclib/blocks/UnderwaterPlantBlock.java @@ -31,21 +31,30 @@ 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.IRenderTyped; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.List; import java.util.Random; @SuppressWarnings("deprecation") -public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements IRenderTyped, BonemealableBlock, LiquidBlockContainer { +public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements RenderLayerGetter, BonemealableBlock, LiquidBlockContainer { private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12); public UnderwaterPlantBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS) + .noCollission()); } public UnderwaterPlantBlock(int light) { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(light).sound(SoundType.WET_GRASS).noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .luminance(light) + .sound(SoundType.WET_GRASS) + .noCollission()); } public UnderwaterPlantBlock(Properties settings) { @@ -86,7 +95,10 @@ public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements I @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else { @@ -111,7 +123,13 @@ public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements I @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { - ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(this)); + ItemEntity item = new ItemEntity( + world, + pos.getX() + 0.5, + pos.getY() + 0.5, + pos.getZ() + 0.5, + new ItemStack(this) + ); world.addFreshEntity(item); } diff --git a/src/main/java/ru/bclib/blocks/UnderwaterPlantWithAgeBlock.java b/src/main/java/ru/bclib/blocks/UnderwaterPlantWithAgeBlock.java index 9855d9d2..a2ad3dd0 100644 --- a/src/main/java/ru/bclib/blocks/UnderwaterPlantWithAgeBlock.java +++ b/src/main/java/ru/bclib/blocks/UnderwaterPlantWithAgeBlock.java @@ -18,7 +18,12 @@ public abstract class UnderwaterPlantWithAgeBlock extends UnderwaterPlantBlock { public static final IntegerProperty AGE = BlockProperties.AGE; public UnderwaterPlantWithAgeBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).randomTicks().noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.WET_GRASS) + .randomTicks() + .noCollission()); } @Override diff --git a/src/main/java/ru/bclib/blocks/UpDownPlantBlock.java b/src/main/java/ru/bclib/blocks/UpDownPlantBlock.java index 92941bbf..593edcab 100644 --- a/src/main/java/ru/bclib/blocks/UpDownPlantBlock.java +++ b/src/main/java/ru/bclib/blocks/UpDownPlantBlock.java @@ -24,16 +24,20 @@ 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.IRenderTyped; +import ru.bclib.interfaces.RenderLayerGetter; import java.util.List; @SuppressWarnings("deprecation") -public abstract class UpDownPlantBlock extends BaseBlockNotFull implements IRenderTyped { +public abstract class UpDownPlantBlock extends BaseBlockNotFull implements RenderLayerGetter { private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12); public UpDownPlantBlock() { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.SHEARS) + .breakByHand(true) + .sound(SoundType.GRASS) + .noCollission()); } protected abstract boolean isTerrain(BlockState state); @@ -67,7 +71,10 @@ public abstract class UpDownPlantBlock extends BaseBlockNotFull implements IRend @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); - if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { + if (tool != null && FabricToolTags.SHEARS.contains(tool.getItem()) || EnchantmentHelper.getItemEnchantmentLevel( + Enchantments.SILK_TOUCH, + tool + ) > 0) { return Lists.newArrayList(new ItemStack(this)); } else { diff --git a/src/main/java/ru/bclib/blocks/WallMushroomBlock.java b/src/main/java/ru/bclib/blocks/WallMushroomBlock.java index 4f483977..a4aabaf3 100644 --- a/src/main/java/ru/bclib/blocks/WallMushroomBlock.java +++ b/src/main/java/ru/bclib/blocks/WallMushroomBlock.java @@ -16,7 +16,14 @@ import java.util.List; public abstract class WallMushroomBlock extends BaseWallPlantBlock { public WallMushroomBlock(int light) { - super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.AXES).breakByHand(true).luminance(light).hardness(0.2F).sound(SoundType.GRASS).sound(SoundType.WOOD).noCollission()); + super(FabricBlockSettings.of(Material.PLANT) + .breakByTool(FabricToolTags.AXES) + .breakByHand(true) + .luminance(light) + .hardness(0.2F) + .sound(SoundType.GRASS) + .sound(SoundType.WOOD) + .noCollission()); } @Override diff --git a/src/main/java/ru/bclib/client/BCLibClient.java b/src/main/java/ru/bclib/client/BCLibClient.java index 5cb2d390..56a82c37 100644 --- a/src/main/java/ru/bclib/client/BCLibClient.java +++ b/src/main/java/ru/bclib/client/BCLibClient.java @@ -6,8 +6,8 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.core.Registry; import ru.bclib.api.ModIntegrationAPI; import ru.bclib.client.render.BCLRenderLayer; -import ru.bclib.interfaces.IPostInit; -import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.interfaces.PostInitable; +import ru.bclib.interfaces.RenderLayerGetter; import ru.bclib.registry.BaseBlockEntityRenders; public class BCLibClient implements ClientModInitializer { @@ -17,8 +17,8 @@ public class BCLibClient implements ClientModInitializer { BaseBlockEntityRenders.register(); registerRenderLayers(); Registry.BLOCK.forEach(block -> { - if (block instanceof IPostInit) { - ((IPostInit) block).postInit(); + if (block instanceof PostInitable) { + ((PostInitable) block).postInit(); } }); } @@ -27,8 +27,8 @@ public class BCLibClient implements ClientModInitializer { RenderType cutout = RenderType.cutout(); RenderType translucent = RenderType.translucent(); Registry.BLOCK.forEach(block -> { - if (block instanceof IRenderTyped) { - BCLRenderLayer layer = ((IRenderTyped) block).getRenderLayer(); + if (block instanceof RenderLayerGetter) { + BCLRenderLayer layer = ((RenderLayerGetter) block).getRenderLayer(); if (layer == BCLRenderLayer.CUTOUT) BlockRenderLayerMap.INSTANCE.putBlock(block, cutout); else if (layer == BCLRenderLayer.TRANSLUCENT) BlockRenderLayerMap.INSTANCE.putBlock(block, translucent); } diff --git a/src/main/java/ru/bclib/client/gui/BlockSignEditScreen.java b/src/main/java/ru/bclib/client/gui/BlockSignEditScreen.java index 22121169..76f22816 100644 --- a/src/main/java/ru/bclib/client/gui/BlockSignEditScreen.java +++ b/src/main/java/ru/bclib/client/gui/BlockSignEditScreen.java @@ -53,28 +53,48 @@ public class BlockSignEditScreen extends Screen { protected void init() { //set up a default model - model = new SignRenderer.SignModel(this.minecraft.getEntityModels().bakeLayer(ModelLayers.createSignModelName(WoodType.OAK))); + model = new SignRenderer.SignModel(this.minecraft.getEntityModels() + .bakeLayer(ModelLayers.createSignModelName(WoodType.OAK))); minecraft.keyboardHandler.setSendRepeatsToGui(true); - this.addRenderableWidget(new Button(this.width / 2 - 100, this.height / 4 + 120, 200, 20, CommonComponents.GUI_DONE, (buttonWidget) -> { - this.finishEditing(); - })); + this.addRenderableWidget(new Button( + this.width / 2 - 100, + this.height / 4 + 120, + 200, + 20, + CommonComponents.GUI_DONE, + (buttonWidget) -> { + this.finishEditing(); + } + )); this.sign.setEditable(false); - this.selectionManager = new TextFieldHelper(() -> { - return this.text[this.currentRow]; - }, (string) -> { - this.text[this.currentRow] = string; - this.sign.setMessage(this.currentRow, new TextComponent(string)); - }, TextFieldHelper.createClipboardGetter(this.minecraft), TextFieldHelper.createClipboardSetter(this.minecraft), (string) -> { - return this.minecraft.font.width(string) <= 90; - }); + this.selectionManager = new TextFieldHelper( + () -> { + return this.text[this.currentRow]; + }, + (string) -> { + this.text[this.currentRow] = string; + this.sign.setMessage(this.currentRow, new TextComponent(string)); + }, + TextFieldHelper.createClipboardGetter(this.minecraft), + TextFieldHelper.createClipboardSetter(this.minecraft), + (string) -> { + return this.minecraft.font.width(string) <= 90; + } + ); } public void removed() { minecraft.keyboardHandler.setSendRepeatsToGui(false); ClientPacketListener clientPlayNetworkHandler = this.minecraft.getConnection(); if (clientPlayNetworkHandler != null) { - clientPlayNetworkHandler.send(new ServerboundSignUpdatePacket(this.sign.getBlockPos(), this.text[0], this.text[1], this.text[2], this.text[3])); + clientPlayNetworkHandler.send(new ServerboundSignUpdatePacket( + this.sign.getBlockPos(), + this.text[0], + this.text[1], + this.text[2], + this.text[3] + )); } this.sign.setEditable(true); @@ -167,12 +187,36 @@ public class BlockSignEditScreen extends Screen { } float n = (float) (-this.minecraft.font.width(string2) / 2); - this.minecraft.font.drawInBatch(string2, n, (float) (m * 10 - this.text.length * 5), i, false, matrix4f, immediate, false, 0, 15728880, false); + this.minecraft.font.drawInBatch( + string2, + n, + (float) (m * 10 - this.text.length * 5), + i, + false, + matrix4f, + immediate, + false, + 0, + 15728880, + false + ); if (m == this.currentRow && j >= 0 && bl2) { s = this.minecraft.font.width(string2.substring(0, Math.max(Math.min(j, string2.length()), 0))); t = s - this.minecraft.font.width(string2) / 2; if (j >= string2.length()) { - this.minecraft.font.drawInBatch("_", (float) t, (float) l, i, false, matrix4f, immediate, false, 0, 15728880, false); + this.minecraft.font.drawInBatch( + "_", + (float) t, + (float) l, + i, + false, + matrix4f, + immediate, + false, + 0, + 15728880, + false + ); } } } diff --git a/src/main/java/ru/bclib/client/models/BaseChestBlockModel.java b/src/main/java/ru/bclib/client/models/BaseChestBlockModel.java index bdea5197..745e12f0 100644 --- a/src/main/java/ru/bclib/client/models/BaseChestBlockModel.java +++ b/src/main/java/ru/bclib/client/models/BaseChestBlockModel.java @@ -23,31 +23,71 @@ public class BaseChestBlockModel { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); CubeDeformation deformation_partC = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partC", CubeListBuilder.create().texOffs(0, 19).addBox(1.0f, 0.0f, 1.0f, 14.0f, 9.0f, 14.0f, deformation_partC), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "partC", + CubeListBuilder.create().texOffs(0, 19).addBox(1.0f, 0.0f, 1.0f, 14.0f, 9.0f, 14.0f, deformation_partC), + PartPose.ZERO + ); CubeDeformation deformation_partA = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partA", CubeListBuilder.create().texOffs(0, 0).addBox(1.0f, 0.0f, 0.0f, 14.0f, 5.0f, 14.0f, deformation_partA), PartPose.offset(0.0f, 9.0f, 1.0f)); + modelPartData.addOrReplaceChild( + "partA", + CubeListBuilder.create().texOffs(0, 0).addBox(1.0f, 0.0f, 0.0f, 14.0f, 5.0f, 14.0f, deformation_partA), + PartPose.offset(0.0f, 9.0f, 1.0f) + ); CubeDeformation deformation_partB = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partB", CubeListBuilder.create().texOffs(0, 0).addBox(7.0f, -1.0f, 15.0f, 2.0f, 4.0f, 1.0f, deformation_partB), PartPose.offset(0.0f, 8.0f, 0.0f)); + modelPartData.addOrReplaceChild( + "partB", + CubeListBuilder.create().texOffs(0, 0).addBox(7.0f, -1.0f, 15.0f, 2.0f, 4.0f, 1.0f, deformation_partB), + PartPose.offset(0.0f, 8.0f, 0.0f) + ); CubeDeformation deformation_partRightC = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partRightC", CubeListBuilder.create().texOffs(0, 19).addBox(1.0f, 0.0f, 1.0f, 15.0f, 9.0f, 14.0f, deformation_partRightC), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "partRightC", + CubeListBuilder.create() + .texOffs(0, 19) + .addBox(1.0f, 0.0f, 1.0f, 15.0f, 9.0f, 14.0f, deformation_partRightC), + PartPose.ZERO + ); CubeDeformation deformation_partRightA = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partRightA", CubeListBuilder.create().texOffs(0, 0).addBox(1.0f, 0.0f, 0.0f, 15.0f, 5.0f, 14.0f, deformation_partRightA), PartPose.offset(0.0f, 9.0f, 1.0f)); + modelPartData.addOrReplaceChild( + "partRightA", + CubeListBuilder.create().texOffs(0, 0).addBox(1.0f, 0.0f, 0.0f, 15.0f, 5.0f, 14.0f, deformation_partRightA), + PartPose.offset(0.0f, 9.0f, 1.0f) + ); CubeDeformation deformation_partRightB = new CubeDeformation(0.0f); - PartDefinition partRightB = modelPartData.addOrReplaceChild("partRightB", CubeListBuilder.create().texOffs(0, 0).addBox(15.0f, -1.0f, 15.0f, 1.0f, 4.0f, 1.0f, deformation_partRightB), PartPose.offset(0.0f, 8.0f, 0.0f)); + PartDefinition partRightB = modelPartData.addOrReplaceChild( + "partRightB", + CubeListBuilder.create() + .texOffs(0, 0) + .addBox(15.0f, -1.0f, 15.0f, 1.0f, 4.0f, 1.0f, deformation_partRightB), + PartPose.offset(0.0f, 8.0f, 0.0f) + ); CubeDeformation deformation_partLeftC = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partLeftC", CubeListBuilder.create().texOffs(0, 19).addBox(0.0f, 0.0f, 1.0f, 15.0f, 9.0f, 14.0f, deformation_partLeftC), PartPose.ZERO); + modelPartData.addOrReplaceChild( + "partLeftC", + CubeListBuilder.create().texOffs(0, 19).addBox(0.0f, 0.0f, 1.0f, 15.0f, 9.0f, 14.0f, deformation_partLeftC), + PartPose.ZERO + ); CubeDeformation deformation_partLeftA = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partLeftA", CubeListBuilder.create().texOffs(0, 0).addBox(0.0f, 0.0f, 0.0f, 15.0f, 5.0f, 14.0f, deformation_partLeftA), PartPose.offset(0.0f, 9.0f, 1.0f)); + modelPartData.addOrReplaceChild( + "partLeftA", + CubeListBuilder.create().texOffs(0, 0).addBox(0.0f, 0.0f, 0.0f, 15.0f, 5.0f, 14.0f, deformation_partLeftA), + PartPose.offset(0.0f, 9.0f, 1.0f) + ); CubeDeformation deformation_partLeftB = new CubeDeformation(0.0f); - modelPartData.addOrReplaceChild("partLeftB", CubeListBuilder.create().texOffs(0, 0).addBox(0.0f, -1.0f, 15.0f, 1.0f, 4.0f, 1.0f, deformation_partLeftB), PartPose.offset(0.0f, 8.0f, 0.0f)); + modelPartData.addOrReplaceChild( + "partLeftB", + CubeListBuilder.create().texOffs(0, 0).addBox(0.0f, -1.0f, 15.0f, 1.0f, 4.0f, 1.0f, deformation_partLeftB), + PartPose.offset(0.0f, 8.0f, 0.0f) + ); return LayerDefinition.create(modelData, 64, 64); } diff --git a/src/main/java/ru/bclib/client/models/ModelsHelper.java b/src/main/java/ru/bclib/client/models/ModelsHelper.java index 8e9b2382..e8992cbe 100644 --- a/src/main/java/ru/bclib/client/models/ModelsHelper.java +++ b/src/main/java/ru/bclib/client/models/ModelsHelper.java @@ -78,7 +78,12 @@ public class ModelsHelper { } public static MultiVariant createRandomTopModel(ResourceLocation resourceLocation) { - return new MultiVariant(Lists.newArrayList(new Variant(resourceLocation, Transformation.identity(), false, 1), new Variant(resourceLocation, BlockModelRotation.X0_Y90.getRotation(), false, 1), new Variant(resourceLocation, BlockModelRotation.X0_Y180.getRotation(), false, 1), new Variant(resourceLocation, BlockModelRotation.X0_Y270.getRotation(), false, 1))); + return new MultiVariant(Lists.newArrayList( + new Variant(resourceLocation, Transformation.identity(), false, 1), + new Variant(resourceLocation, BlockModelRotation.X0_Y90.getRotation(), false, 1), + new Variant(resourceLocation, BlockModelRotation.X0_Y180.getRotation(), false, 1), + new Variant(resourceLocation, BlockModelRotation.X0_Y270.getRotation(), false, 1) + )); } public static class MultiPartBuilder { diff --git a/src/main/java/ru/bclib/client/models/PatternsHelper.java b/src/main/java/ru/bclib/client/models/PatternsHelper.java index 134e59c9..ace06642 100644 --- a/src/main/java/ru/bclib/client/models/PatternsHelper.java +++ b/src/main/java/ru/bclib/client/models/PatternsHelper.java @@ -52,7 +52,8 @@ public class PatternsHelper { public static Optional createJson(ResourceLocation patternId, Map textures) { ResourceManager resourceManager = Minecraft.getInstance().getResourceManager(); try (InputStream input = resourceManager.getResource(patternId).getInputStream()) { - String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)).lines().collect(Collectors.joining()); + String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)).lines() + .collect(Collectors.joining()); for (Map.Entry texture : textures.entrySet()) { json = json.replace(texture.getKey(), texture.getValue()); } diff --git a/src/main/java/ru/bclib/client/render/BaseChestBlockEntityRenderer.java b/src/main/java/ru/bclib/client/render/BaseChestBlockEntityRenderer.java index ab661e2c..2ac5e080 100644 --- a/src/main/java/ru/bclib/client/render/BaseChestBlockEntityRenderer.java +++ b/src/main/java/ru/bclib/client/render/BaseChestBlockEntityRenderer.java @@ -51,7 +51,11 @@ public class BaseChestBlockEntityRenderer implements BlockEntityRenderer { - List list = this.font.split(component, 90); - return list.isEmpty() ? FormattedCharSequence.EMPTY : (FormattedCharSequence) list.get(0); - }); + FormattedCharSequence[] formattedCharSequences = signBlockEntity.getRenderMessages( + Minecraft.getInstance() + .isTextFilteringEnabled(), + (component) -> { + List list = this.font.split(component, 90); + return list.isEmpty() ? FormattedCharSequence.EMPTY : (FormattedCharSequence) list.get(0); + } + ); int drawColor; boolean drawOutlined; int drawLight; @@ -109,10 +113,30 @@ public class BaseSignBlockEntityRenderer implements BlockEntityRenderer pattern = PatternsHelper.createBlockSimple(resourceLocation); diff --git a/src/main/java/ru/bclib/interfaces/IColorProvider.java b/src/main/java/ru/bclib/interfaces/ColorProviderGetter.java similarity index 83% rename from src/main/java/ru/bclib/interfaces/IColorProvider.java rename to src/main/java/ru/bclib/interfaces/ColorProviderGetter.java index b10ffe31..7433981e 100644 --- a/src/main/java/ru/bclib/interfaces/IColorProvider.java +++ b/src/main/java/ru/bclib/interfaces/ColorProviderGetter.java @@ -3,7 +3,7 @@ package ru.bclib.interfaces; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; -public interface IColorProvider { +public interface ColorProviderGetter { BlockColor getProvider(); ItemColor getItemProvider(); diff --git a/src/main/java/ru/bclib/interfaces/CustomItemGetter.java b/src/main/java/ru/bclib/interfaces/CustomItemGetter.java new file mode 100644 index 00000000..0964f996 --- /dev/null +++ b/src/main/java/ru/bclib/interfaces/CustomItemGetter.java @@ -0,0 +1,15 @@ +package ru.bclib.interfaces; + +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.BlockItem; +import ru.bclib.registry.BlocksRegistry; + +public interface CustomItemGetter { + /** + * Used to replace default Block Item when block is registered. + * + * @return {@link BlockItem} + */ + BlockItem getCustomItem(ResourceLocation blockID, FabricItemSettings settings); +} diff --git a/src/main/java/ru/bclib/interfaces/ISpetialItem.java b/src/main/java/ru/bclib/interfaces/ISpetialItem.java deleted file mode 100644 index e54e5d3c..00000000 --- a/src/main/java/ru/bclib/interfaces/ISpetialItem.java +++ /dev/null @@ -1,7 +0,0 @@ -package ru.bclib.interfaces; - -public interface ISpetialItem { - boolean canPlaceOnWater(); - - int getStackSize(); -} diff --git a/src/main/java/ru/bclib/client/models/ItemModelProvider.java b/src/main/java/ru/bclib/interfaces/ItemModelGetter.java similarity index 76% rename from src/main/java/ru/bclib/client/models/ItemModelProvider.java rename to src/main/java/ru/bclib/interfaces/ItemModelGetter.java index 50930e6c..162959ca 100644 --- a/src/main/java/ru/bclib/client/models/ItemModelProvider.java +++ b/src/main/java/ru/bclib/interfaces/ItemModelGetter.java @@ -1,11 +1,12 @@ -package ru.bclib.client.models; +package ru.bclib.interfaces; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.resources.ResourceLocation; +import ru.bclib.client.models.ModelsHelper; -public interface ItemModelProvider { +public interface ItemModelGetter { @Environment(EnvType.CLIENT) default BlockModel getItemModel(ResourceLocation resourceLocation) { return ModelsHelper.createItemModel(resourceLocation); diff --git a/src/main/java/ru/bclib/interfaces/IPostInit.java b/src/main/java/ru/bclib/interfaces/PostInitable.java similarity index 60% rename from src/main/java/ru/bclib/interfaces/IPostInit.java rename to src/main/java/ru/bclib/interfaces/PostInitable.java index 341a6229..23073c9c 100644 --- a/src/main/java/ru/bclib/interfaces/IPostInit.java +++ b/src/main/java/ru/bclib/interfaces/PostInitable.java @@ -1,5 +1,5 @@ package ru.bclib.interfaces; -public interface IPostInit { +public interface PostInitable { void postInit(); } diff --git a/src/main/java/ru/bclib/interfaces/IRenderTyped.java b/src/main/java/ru/bclib/interfaces/RenderLayerGetter.java similarity index 75% rename from src/main/java/ru/bclib/interfaces/IRenderTyped.java rename to src/main/java/ru/bclib/interfaces/RenderLayerGetter.java index 445f9e6b..2d4e94dc 100644 --- a/src/main/java/ru/bclib/interfaces/IRenderTyped.java +++ b/src/main/java/ru/bclib/interfaces/RenderLayerGetter.java @@ -2,6 +2,6 @@ package ru.bclib.interfaces; import ru.bclib.client.render.BCLRenderLayer; -public interface IRenderTyped { +public interface RenderLayerGetter { BCLRenderLayer getRenderLayer(); } diff --git a/src/main/java/ru/bclib/items/BaseAnvilItem.java b/src/main/java/ru/bclib/items/BaseAnvilItem.java index 5abab41d..e3c3b075 100644 --- a/src/main/java/ru/bclib/items/BaseAnvilItem.java +++ b/src/main/java/ru/bclib/items/BaseAnvilItem.java @@ -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.client.models.ItemModelProvider; +import ru.bclib.interfaces.ItemModelGetter; import java.util.List; -public class BaseAnvilItem extends BlockItem implements ItemModelProvider { +public class BaseAnvilItem extends BlockItem implements ItemModelGetter { public final static String DESTRUCTION = "destruction"; @@ -54,6 +54,6 @@ public class BaseAnvilItem extends BlockItem implements ItemModelProvider { public BlockModel getItemModel(ResourceLocation resourceLocation) { Block anvilBlock = getBlock(); ResourceLocation blockId = Registry.BLOCK.getKey(anvilBlock); - return ((ItemModelProvider) anvilBlock).getItemModel(blockId); + return ((ItemModelGetter) anvilBlock).getItemModel(blockId); } } diff --git a/src/main/java/ru/bclib/items/BaseArmorItem.java b/src/main/java/ru/bclib/items/BaseArmorItem.java index 39e1cf00..ea99dd98 100644 --- a/src/main/java/ru/bclib/items/BaseArmorItem.java +++ b/src/main/java/ru/bclib/items/BaseArmorItem.java @@ -8,13 +8,18 @@ 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.client.models.ItemModelProvider; +import ru.bclib.interfaces.ItemModelGetter; import java.util.UUID; -public class BaseArmorItem extends ArmorItem implements ItemModelProvider { +public class BaseArmorItem extends ArmorItem implements ItemModelGetter { - protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[] {UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")}; + protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[] { + UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), + UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), + UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), + UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150") + }; protected final Multimap defaultModifiers; @@ -22,10 +27,23 @@ public class BaseArmorItem extends ArmorItem implements ItemModelProvider { super(material, equipmentSlot, settings); this.defaultModifiers = HashMultimap.create(); UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[equipmentSlot.getIndex()]; - addAttributeModifier(Attributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", getDefense(), AttributeModifier.Operation.ADDITION)); - addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(uuid, "Armor toughness", getToughness(), AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + Attributes.ARMOR, + new AttributeModifier(uuid, "Armor modifier", getDefense(), AttributeModifier.Operation.ADDITION) + ); + addAttributeModifier( + Attributes.ARMOR_TOUGHNESS, + new AttributeModifier(uuid, "Armor toughness", getToughness(), AttributeModifier.Operation.ADDITION) + ); if (knockbackResistance > 0.0F) { - addAttributeModifier(Attributes.KNOCKBACK_RESISTANCE, new AttributeModifier(uuid, "Armor knockback resistance", knockbackResistance, AttributeModifier.Operation.ADDITION)); + addAttributeModifier( + Attributes.KNOCKBACK_RESISTANCE, + new AttributeModifier(uuid, + "Armor knockback resistance", + knockbackResistance, + AttributeModifier.Operation.ADDITION + ) + ); } } diff --git a/src/main/java/ru/bclib/items/BaseBucketItem.java b/src/main/java/ru/bclib/items/BaseBucketItem.java index fae47053..9d98f969 100644 --- a/src/main/java/ru/bclib/items/BaseBucketItem.java +++ b/src/main/java/ru/bclib/items/BaseBucketItem.java @@ -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.client.models.ItemModelProvider; +import ru.bclib.interfaces.ItemModelGetter; -public class BaseBucketItem extends MobBucketItem implements ItemModelProvider { +public class BaseBucketItem extends MobBucketItem implements ItemModelGetter { public BaseBucketItem(EntityType type, FabricItemSettings settings) { super(type, Fluids.WATER, SoundEvents.BUCKET_EMPTY_FISH, settings.stacksTo(1)); } diff --git a/src/main/java/ru/bclib/items/BaseDiscItem.java b/src/main/java/ru/bclib/items/BaseDiscItem.java index 3b6a8e46..5c39b6e4 100644 --- a/src/main/java/ru/bclib/items/BaseDiscItem.java +++ b/src/main/java/ru/bclib/items/BaseDiscItem.java @@ -2,9 +2,9 @@ package ru.bclib.items; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.item.RecordItem; -import ru.bclib.client.models.ItemModelProvider; +import ru.bclib.interfaces.ItemModelGetter; -public class BaseDiscItem extends RecordItem implements ItemModelProvider { +public class BaseDiscItem extends RecordItem implements ItemModelGetter { public BaseDiscItem(int comparatorOutput, SoundEvent sound, Properties settings) { super(comparatorOutput, sound, settings); } diff --git a/src/main/java/ru/bclib/items/BaseSpawnEggItem.java b/src/main/java/ru/bclib/items/BaseSpawnEggItem.java index 6a221400..e3b078f5 100644 --- a/src/main/java/ru/bclib/items/BaseSpawnEggItem.java +++ b/src/main/java/ru/bclib/items/BaseSpawnEggItem.java @@ -8,13 +8,13 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.item.SpawnEggItem; import ru.bclib.client.models.BasePatterns; -import ru.bclib.client.models.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.PatternsHelper; +import ru.bclib.interfaces.ItemModelGetter; import java.util.Optional; -public class BaseSpawnEggItem extends SpawnEggItem implements ItemModelProvider { +public class BaseSpawnEggItem extends SpawnEggItem implements ItemModelGetter { public BaseSpawnEggItem(EntityType type, int primaryColor, int secondaryColor, Properties settings) { super(type, primaryColor, secondaryColor, settings); } diff --git a/src/main/java/ru/bclib/items/ModelProviderItem.java b/src/main/java/ru/bclib/items/ModelProviderItem.java index 4fbd6a00..1562651c 100644 --- a/src/main/java/ru/bclib/items/ModelProviderItem.java +++ b/src/main/java/ru/bclib/items/ModelProviderItem.java @@ -5,10 +5,10 @@ import net.fabricmc.api.Environment; import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; -import ru.bclib.client.models.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; +import ru.bclib.interfaces.ItemModelGetter; -public class ModelProviderItem extends Item implements ItemModelProvider { +public class ModelProviderItem extends Item implements ItemModelGetter { public ModelProviderItem(Properties settings) { super(settings); } diff --git a/src/main/java/ru/bclib/items/tool/BaseAxeItem.java b/src/main/java/ru/bclib/items/tool/BaseAxeItem.java index 92099882..caaf5df8 100644 --- a/src/main/java/ru/bclib/items/tool/BaseAxeItem.java +++ b/src/main/java/ru/bclib/items/tool/BaseAxeItem.java @@ -13,10 +13,10 @@ import net.minecraft.world.item.Item; 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.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; +import ru.bclib.interfaces.ItemModelGetter; -public class BaseAxeItem extends AxeItem implements DynamicAttributeTool, ItemModelProvider { +public class BaseAxeItem extends AxeItem implements DynamicAttributeTool, ItemModelGetter { public BaseAxeItem(Tier material, float attackDamage, float attackSpeed, Properties settings) { super(material, attackDamage, attackSpeed, settings); } diff --git a/src/main/java/ru/bclib/items/tool/BaseHoeItem.java b/src/main/java/ru/bclib/items/tool/BaseHoeItem.java index 6e1aeab4..8ad78f00 100644 --- a/src/main/java/ru/bclib/items/tool/BaseHoeItem.java +++ b/src/main/java/ru/bclib/items/tool/BaseHoeItem.java @@ -6,10 +6,10 @@ import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.HoeItem; import net.minecraft.world.item.Tier; -import ru.bclib.client.models.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; +import ru.bclib.interfaces.ItemModelGetter; -public class BaseHoeItem extends HoeItem implements ItemModelProvider { +public class BaseHoeItem extends HoeItem implements ItemModelGetter { public BaseHoeItem(Tier material, int attackDamage, float attackSpeed, Properties settings) { super(material, attackDamage, attackSpeed, settings); } diff --git a/src/main/java/ru/bclib/items/tool/BasePickaxeItem.java b/src/main/java/ru/bclib/items/tool/BasePickaxeItem.java index 213c530b..7be7301a 100644 --- a/src/main/java/ru/bclib/items/tool/BasePickaxeItem.java +++ b/src/main/java/ru/bclib/items/tool/BasePickaxeItem.java @@ -15,10 +15,10 @@ import net.minecraft.world.item.ItemStack; 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.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; +import ru.bclib.interfaces.ItemModelGetter; -public class BasePickaxeItem extends PickaxeItem implements DynamicAttributeTool, ItemModelProvider { +public class BasePickaxeItem extends PickaxeItem implements DynamicAttributeTool, ItemModelGetter { public BasePickaxeItem(Tier material, int attackDamage, float attackSpeed, Properties settings) { super(material, attackDamage, attackSpeed, settings); } @@ -34,7 +34,10 @@ public class BasePickaxeItem extends PickaxeItem implements DynamicAttributeTool @Override public float getDestroySpeed(ItemStack stack, BlockState state) { Entry entry = ToolManagerImpl.entryNullable(state.getBlock()); - return (entry != null && entry.getMiningLevel(FabricToolTags.PICKAXES) >= 0) ? speed : super.getDestroySpeed(stack, state); + return (entry != null && entry.getMiningLevel(FabricToolTags.PICKAXES) >= 0) ? speed : super.getDestroySpeed( + stack, + state + ); } @Override diff --git a/src/main/java/ru/bclib/items/tool/BaseShovelItem.java b/src/main/java/ru/bclib/items/tool/BaseShovelItem.java index 1a84ee98..d91aa55e 100644 --- a/src/main/java/ru/bclib/items/tool/BaseShovelItem.java +++ b/src/main/java/ru/bclib/items/tool/BaseShovelItem.java @@ -15,10 +15,10 @@ import net.minecraft.world.item.ItemStack; 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.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; +import ru.bclib.interfaces.ItemModelGetter; -public class BaseShovelItem extends ShovelItem implements DynamicAttributeTool, ItemModelProvider { +public class BaseShovelItem extends ShovelItem implements DynamicAttributeTool, ItemModelGetter { public BaseShovelItem(Tier material, float attackDamage, float attackSpeed, Properties settings) { super(material, attackDamage, attackSpeed, settings); } @@ -34,7 +34,10 @@ public class BaseShovelItem extends ShovelItem implements DynamicAttributeTool, @Override public float getDestroySpeed(ItemStack stack, BlockState state) { Entry entry = ToolManagerImpl.entryNullable(state.getBlock()); - return (entry != null && entry.getMiningLevel(FabricToolTags.SHOVELS) >= 0) ? speed : super.getDestroySpeed(stack, state); + return (entry != null && entry.getMiningLevel(FabricToolTags.SHOVELS) >= 0) ? speed : super.getDestroySpeed( + stack, + state + ); } @Override diff --git a/src/main/java/ru/bclib/items/tool/BaseSwordItem.java b/src/main/java/ru/bclib/items/tool/BaseSwordItem.java index f78098a3..56615a1f 100644 --- a/src/main/java/ru/bclib/items/tool/BaseSwordItem.java +++ b/src/main/java/ru/bclib/items/tool/BaseSwordItem.java @@ -7,10 +7,10 @@ import net.minecraft.client.renderer.block.model.BlockModel; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.SwordItem; import net.minecraft.world.item.Tier; -import ru.bclib.client.models.ItemModelProvider; import ru.bclib.client.models.ModelsHelper; +import ru.bclib.interfaces.ItemModelGetter; -public class BaseSwordItem extends SwordItem implements DynamicAttributeTool, ItemModelProvider { +public class BaseSwordItem extends SwordItem implements DynamicAttributeTool, ItemModelGetter { public BaseSwordItem(Tier material, int attackDamage, float attackSpeed, Properties settings) { super(material, attackDamage, attackSpeed, settings); } diff --git a/src/main/java/ru/bclib/mixin/client/EnchantingTableBlockMixin.java b/src/main/java/ru/bclib/mixin/client/EnchantingTableBlockMixin.java index 99fe6e8f..53ed82db 100644 --- a/src/main/java/ru/bclib/mixin/client/EnchantingTableBlockMixin.java +++ b/src/main/java/ru/bclib/mixin/client/EnchantingTableBlockMixin.java @@ -34,7 +34,15 @@ public abstract class EnchantingTableBlockMixin extends Block { if (!world.isEmptyBlock(pos.offset(px / 2, 0, pz / 2))) { break; } - world.addParticle(ParticleTypes.ENCHANT, pos.getX() + 0.5, pos.getY() + 2.0, pos.getZ() + 0.5, px + random.nextFloat() - 0.5, py - random.nextFloat() - 1.0, pz + random.nextFloat() - 0.5); + world.addParticle( + ParticleTypes.ENCHANT, + pos.getX() + 0.5, + pos.getY() + 2.0, + pos.getZ() + 0.5, + px + random.nextFloat() - 0.5, + py - random.nextFloat() - 1.0, + pz + random.nextFloat() - 0.5 + ); } } } diff --git a/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java b/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java index 98d56db3..6f9e45c2 100644 --- a/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java +++ b/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java @@ -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.IColorProvider; +import ru.bclib.interfaces.ColorProviderGetter; @Mixin(Minecraft.class) public class MinecraftMixin { @@ -26,8 +26,8 @@ public class MinecraftMixin { @Inject(method = "*", at = @At("TAIL")) private void bclib_onMCInit(GameConfig args, CallbackInfo info) { Registry.BLOCK.forEach(block -> { - if (block instanceof IColorProvider) { - IColorProvider provider = (IColorProvider) block; + if (block instanceof ColorProviderGetter) { + ColorProviderGetter provider = (ColorProviderGetter) block; blockColors.register(provider.getProvider(), block); itemColors.register(provider.getItemProvider(), block.asItem()); } diff --git a/src/main/java/ru/bclib/mixin/client/ModelBakeryMixin.java b/src/main/java/ru/bclib/mixin/client/ModelBakeryMixin.java index cee9f054..33719f1f 100644 --- a/src/main/java/ru/bclib/mixin/client/ModelBakeryMixin.java +++ b/src/main/java/ru/bclib/mixin/client/ModelBakeryMixin.java @@ -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.client.models.BlockModelProvider; -import ru.bclib.client.models.ItemModelProvider; +import ru.bclib.interfaces.BlockModelGetter; +import ru.bclib.interfaces.ItemModelGetter; 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); - ItemModelProvider modelProvider = null; - if (item instanceof ItemModelProvider) { - modelProvider = (ItemModelProvider) item; + ItemModelGetter modelProvider = null; + if (item instanceof ItemModelGetter) { + modelProvider = (ItemModelGetter) item; } else if (item instanceof BlockItem) { Block block = Registry.BLOCK.get(clearLoc); - if (block instanceof ItemModelProvider) { - modelProvider = (ItemModelProvider) block; + if (block instanceof ItemModelGetter) { + modelProvider = (ItemModelGetter) block; } } if (modelProvider != null) { @@ -79,15 +79,28 @@ 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 BlockModelProvider) { + if (block instanceof BlockModelGetter) { List possibleStates = block.getStateDefinition().getPossibleStates(); - Optional possibleState = possibleStates.stream().filter(state -> modelId.equals(BlockModelShaper.stateToModelLocation(clearLoc, state))).findFirst(); + Optional possibleState = possibleStates.stream() + .filter(state -> modelId.equals( + BlockModelShaper.stateToModelLocation( + clearLoc, + state + ))) + .findFirst(); if (possibleState.isPresent()) { - UnbakedModel modelVariant = ((BlockModelProvider) block).getModelVariant(modelId, possibleState.get(), unbakedCache); + UnbakedModel modelVariant = ((BlockModelGetter) block).getModelVariant( + modelId, + possibleState.get(), + unbakedCache + ); if (modelVariant != null) { if (modelVariant instanceof MultiPart) { possibleStates.forEach(state -> { - ResourceLocation stateId = BlockModelShaper.stateToModelLocation(clearLoc, state); + ResourceLocation stateId = BlockModelShaper.stateToModelLocation( + clearLoc, + state + ); cacheAndQueueDependencies(stateId, modelVariant); }); } diff --git a/src/main/java/ru/bclib/mixin/client/TextureAtlasMixin.java b/src/main/java/ru/bclib/mixin/client/TextureAtlasMixin.java index ef8019bc..fc6ba619 100644 --- a/src/main/java/ru/bclib/mixin/client/TextureAtlasMixin.java +++ b/src/main/java/ru/bclib/mixin/client/TextureAtlasMixin.java @@ -29,12 +29,18 @@ public class TextureAtlasMixin { private void bclib_loadSprite(ResourceManager resourceManager, TextureAtlasSprite.Info spriteInfo, int atlasWidth, int atlasHeight, int maxLevel, int posX, int posY, CallbackInfoReturnable info) { ResourceLocation location = spriteInfo.name(); if (bclib_modifyAtlas && location.getPath().startsWith("block")) { - ResourceLocation emissiveLocation = new ResourceLocation(location.getNamespace(), "textures/" + location.getPath() + "_e.png"); + ResourceLocation emissiveLocation = new ResourceLocation( + location.getNamespace(), + "textures/" + location.getPath() + "_e.png" + ); if (resourceManager.hasResource(emissiveLocation)) { NativeImage sprite = null; NativeImage emission = null; try { - ResourceLocation spriteLocation = new ResourceLocation(location.getNamespace(), "textures/" + location.getPath() + ".png"); + ResourceLocation spriteLocation = new ResourceLocation( + location.getNamespace(), + "textures/" + location.getPath() + ".png" + ); Resource resource = resourceManager.getResource(spriteLocation); sprite = NativeImage.read(resource.getInputStream()); resource.close(); @@ -65,7 +71,16 @@ public class TextureAtlasMixin { } } TextureAtlas self = (TextureAtlas) (Object) this; - FabricSprite result = new FabricSprite(self, spriteInfo, maxLevel, atlasWidth, atlasHeight, posX, posY, sprite); + FabricSprite result = new FabricSprite( + self, + spriteInfo, + maxLevel, + atlasWidth, + atlasHeight, + posX, + posY, + sprite + ); info.setReturnValue(result); } } diff --git a/src/main/java/ru/bclib/mixin/common/BoneMealItemMixin.java b/src/main/java/ru/bclib/mixin/common/BoneMealItemMixin.java index 89945814..52357c1a 100644 --- a/src/main/java/ru/bclib/mixin/common/BoneMealItemMixin.java +++ b/src/main/java/ru/bclib/mixin/common/BoneMealItemMixin.java @@ -99,7 +99,8 @@ public class BoneMealItemMixin { for (int y = y1; y >= y2; y--) { bclib_BLOCK_POS.setY(y); BlockPos down = bclib_BLOCK_POS.below(); - if (BlocksHelper.isFluid(world.getBlockState(bclib_BLOCK_POS)) && !BlocksHelper.isFluid(world.getBlockState(down))) { + if (BlocksHelper.isFluid(world.getBlockState(bclib_BLOCK_POS)) && !BlocksHelper.isFluid(world.getBlockState( + down))) { BlockState grass = bclib_getWaterGrassState(world, down); if (grass != null) { BlocksHelper.setWithoutUpdate(world, bclib_BLOCK_POS, grass); diff --git a/src/main/java/ru/bclib/mixin/common/EnchantmentMenuMixin.java b/src/main/java/ru/bclib/mixin/common/EnchantmentMenuMixin.java index c5595382..3c5c66cf 100644 --- a/src/main/java/ru/bclib/mixin/common/EnchantmentMenuMixin.java +++ b/src/main/java/ru/bclib/mixin/common/EnchantmentMenuMixin.java @@ -66,7 +66,11 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { int j; for (j = -1; j <= 1; ++j) { for (int k = -1; k <= 1; ++k) { - if ((j != 0 || k != 0) && world.isEmptyBlock(blockPos.offset(k, 0, j)) && world.isEmptyBlock(blockPos.offset(k, 1, j))) { + if ((j != 0 || k != 0) && world.isEmptyBlock(blockPos.offset( + k, + 0, + j + )) && world.isEmptyBlock(blockPos.offset(k, 1, j))) { if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(TagAPI.BOOKSHELVES)) { ++i; } @@ -111,7 +115,8 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { if (this.costs[j] > 0) { List list = this.getEnchantmentList(itemStack, j, this.costs[j]); if (list != null && !list.isEmpty()) { - EnchantmentInstance enchantmentLevelEntry = (EnchantmentInstance) list.get(this.random.nextInt(list.size())); + EnchantmentInstance enchantmentLevelEntry = (EnchantmentInstance) list.get(this.random.nextInt( + list.size())); enchantClue[j] = Registry.ENCHANTMENT.getId(enchantmentLevelEntry.enchantment); levelClue[j] = enchantmentLevelEntry.level; } diff --git a/src/main/java/ru/bclib/noise/OpenSimplexNoise.java b/src/main/java/ru/bclib/noise/OpenSimplexNoise.java index 0c2ef0dd..9a59f424 100644 --- a/src/main/java/ru/bclib/noise/OpenSimplexNoise.java +++ b/src/main/java/ru/bclib/noise/OpenSimplexNoise.java @@ -2256,21 +2256,48 @@ public class OpenSimplexNoise { double attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0 - dw_ext0 * dw_ext0; if (attn_ext0 > 0) { attn_ext0 *= attn_ext0; - value += attn_ext0 * attn_ext0 * extrapolate(xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0, dx_ext0, dy_ext0, dz_ext0, dw_ext0); + value += attn_ext0 * attn_ext0 * extrapolate( + xsv_ext0, + ysv_ext0, + zsv_ext0, + wsv_ext0, + dx_ext0, + dy_ext0, + dz_ext0, + dw_ext0 + ); } // Second extra vertex double attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1 - dw_ext1 * dw_ext1; if (attn_ext1 > 0) { attn_ext1 *= attn_ext1; - value += attn_ext1 * attn_ext1 * extrapolate(xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1, dx_ext1, dy_ext1, dz_ext1, dw_ext1); + value += attn_ext1 * attn_ext1 * extrapolate( + xsv_ext1, + ysv_ext1, + zsv_ext1, + wsv_ext1, + dx_ext1, + dy_ext1, + dz_ext1, + dw_ext1 + ); } // Third extra vertex double attn_ext2 = 2 - dx_ext2 * dx_ext2 - dy_ext2 * dy_ext2 - dz_ext2 * dz_ext2 - dw_ext2 * dw_ext2; if (attn_ext2 > 0) { attn_ext2 *= attn_ext2; - value += attn_ext2 * attn_ext2 * extrapolate(xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2, dx_ext2, dy_ext2, dz_ext2, dw_ext2); + value += attn_ext2 * attn_ext2 * extrapolate( + xsv_ext2, + ysv_ext2, + zsv_ext2, + wsv_ext2, + dx_ext2, + dy_ext2, + dz_ext2, + dw_ext2 + ); } return value / NORM_CONSTANT_4D; @@ -2304,11 +2331,341 @@ public class OpenSimplexNoise { // vertices of a rhombicuboctahedron from the center, skewed so // that the triangular and square facets can be inscribed inside // circles of the same radius. - private static byte[] gradients3D = new byte[] {-11, 4, 4, -4, 11, 4, -4, 4, 11, 11, 4, 4, 4, 11, 4, 4, 4, 11, -11, -4, 4, -4, -11, 4, -4, -4, 11, 11, -4, 4, 4, -11, 4, 4, -4, 11, -11, 4, -4, -4, 11, -4, -4, 4, -11, 11, 4, -4, 4, 11, -4, 4, 4, -11, -11, -4, -4, -4, -11, -4, -4, -4, -11, 11, -4, -4, 4, -11, -4, 4, -4, -11,}; + private static byte[] gradients3D = new byte[] { + -11, + 4, + 4, + -4, + 11, + 4, + -4, + 4, + 11, + 11, + 4, + 4, + 4, + 11, + 4, + 4, + 4, + 11, + -11, + -4, + 4, + -4, + -11, + 4, + -4, + -4, + 11, + 11, + -4, + 4, + 4, + -11, + 4, + 4, + -4, + 11, + -11, + 4, + -4, + -4, + 11, + -4, + -4, + 4, + -11, + 11, + 4, + -4, + 4, + 11, + -4, + 4, + 4, + -11, + -11, + -4, + -4, + -4, + -11, + -4, + -4, + -4, + -11, + 11, + -4, + -4, + 4, + -11, + -4, + 4, + -4, + -11, + }; // Gradients for 4D. They approximate the directions to the // vertices of a disprismatotesseractihexadecachoron from the center, // skewed so that the tetrahedral and cubic facets can be inscribed inside // spheres of the same radius. - private static byte[] gradients4D = new byte[] {3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3,}; + private static byte[] gradients4D = new byte[] { + 3, + 1, + 1, + 1, + 1, + 3, + 1, + 1, + 1, + 1, + 3, + 1, + 1, + 1, + 1, + 3, + -3, + 1, + 1, + 1, + -1, + 3, + 1, + 1, + -1, + 1, + 3, + 1, + -1, + 1, + 1, + 3, + 3, + -1, + 1, + 1, + 1, + -3, + 1, + 1, + 1, + -1, + 3, + 1, + 1, + -1, + 1, + 3, + -3, + -1, + 1, + 1, + -1, + -3, + 1, + 1, + -1, + -1, + 3, + 1, + -1, + -1, + 1, + 3, + 3, + 1, + -1, + 1, + 1, + 3, + -1, + 1, + 1, + 1, + -3, + 1, + 1, + 1, + -1, + 3, + -3, + 1, + -1, + 1, + -1, + 3, + -1, + 1, + -1, + 1, + -3, + 1, + -1, + 1, + -1, + 3, + 3, + -1, + -1, + 1, + 1, + -3, + -1, + 1, + 1, + -1, + -3, + 1, + 1, + -1, + -1, + 3, + -3, + -1, + -1, + 1, + -1, + -3, + -1, + 1, + -1, + -1, + -3, + 1, + -1, + -1, + -1, + 3, + 3, + 1, + 1, + -1, + 1, + 3, + 1, + -1, + 1, + 1, + 3, + -1, + 1, + 1, + 1, + -3, + -3, + 1, + 1, + -1, + -1, + 3, + 1, + -1, + -1, + 1, + 3, + -1, + -1, + 1, + 1, + -3, + 3, + -1, + 1, + -1, + 1, + -3, + 1, + -1, + 1, + -1, + 3, + -1, + 1, + -1, + 1, + -3, + -3, + -1, + 1, + -1, + -1, + -3, + 1, + -1, + -1, + -1, + 3, + -1, + -1, + -1, + 1, + -3, + 3, + 1, + -1, + -1, + 1, + 3, + -1, + -1, + 1, + 1, + -3, + -1, + 1, + 1, + -1, + -3, + -3, + 1, + -1, + -1, + -1, + 3, + -1, + -1, + -1, + 1, + -3, + -1, + -1, + 1, + -1, + -3, + 3, + -1, + -1, + -1, + 1, + -3, + -1, + -1, + 1, + -1, + -3, + -1, + 1, + -1, + -1, + -3, + -3, + -1, + -1, + -1, + -1, + -3, + -1, + -1, + -1, + -1, + -3, + -1, + -1, + -1, + -1, + -3, + }; } \ No newline at end of file diff --git a/src/main/java/ru/bclib/noise/VoronoiNoise.java b/src/main/java/ru/bclib/noise/VoronoiNoise.java index 3e1424ec..5575b203 100644 --- a/src/main/java/ru/bclib/noise/VoronoiNoise.java +++ b/src/main/java/ru/bclib/noise/VoronoiNoise.java @@ -133,8 +133,16 @@ public class VoronoiNoise { } } - BlockPos p1 = new BlockPos((ix + (double) selX) * scale, (iy + (double) selY) * scale, (iz + (double) selZ) * scale); - BlockPos p2 = new BlockPos((ix + (double) selXPre) * scale, (iy + (double) selYPre) * scale, (iz + (double) selZPre) * scale); + BlockPos p1 = new BlockPos( + (ix + (double) selX) * scale, + (iy + (double) selY) * scale, + (iz + (double) selZ) * scale + ); + BlockPos p2 = new BlockPos( + (ix + (double) selXPre) * scale, + (iy + (double) selYPre) * scale, + (iz + (double) selZPre) * scale + ); return new BlockPos[] {p1, p2}; } } diff --git a/src/main/java/ru/bclib/recipes/CraftingRecipes.java b/src/main/java/ru/bclib/recipes/CraftingRecipes.java index ec9788e5..1d43873a 100644 --- a/src/main/java/ru/bclib/recipes/CraftingRecipes.java +++ b/src/main/java/ru/bclib/recipes/CraftingRecipes.java @@ -9,19 +9,79 @@ import ru.bclib.config.Configs; public class CraftingRecipes { public static void init() { - GridRecipe.make(BCLib.MOD_ID, "tag_smith_table", Blocks.SMITHING_TABLE).setShape("II", "##", "##").addMaterial('#', ItemTags.PLANKS).addMaterial('I', TagAPI.IRON_INGOTS).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_cauldron", Blocks.CAULDRON).setShape("I I", "I I", "III").addMaterial('I', TagAPI.IRON_INGOTS).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_hopper", Blocks.HOPPER).setShape("I I", "ICI", " I ").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('C', TagAPI.ITEM_CHEST).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_piston", Blocks.PISTON).setShape("WWW", "CIC", "CDC").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('D', Items.REDSTONE).addMaterial('C', Items.COBBLESTONE).addMaterial('W', ItemTags.PLANKS).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_rail", Blocks.RAIL).setOutputCount(16).setShape("I I", "ISI", "I I").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('S', Items.STICK).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_stonecutter", Blocks.STONECUTTER).setShape(" I ", "SSS").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('S', Items.STONE).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_bucket", Items.BUCKET).setShape("I I", " I ").addMaterial('I', TagAPI.IRON_INGOTS).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_compass", Items.COMPASS).setShape(" I ", "IDI", " I ").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('D', Items.REDSTONE).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_minecart", Items.MINECART).setShape("I I", "III").addMaterial('I', TagAPI.IRON_INGOTS).checkConfig(Configs.RECIPE_CONFIG).build(); - GridRecipe.make(BCLib.MOD_ID, "tag_shield", Items.SHIELD).setShape("WIW", "WWW", " W ").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('W', ItemTags.PLANKS).checkConfig(Configs.RECIPE_CONFIG).build(); + GridRecipe.make(BCLib.MOD_ID, "tag_smith_table", Blocks.SMITHING_TABLE) + .setShape("II", "##", "##") + .addMaterial('#', ItemTags.PLANKS) + .addMaterial('I', TagAPI.IRON_INGOTS) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_cauldron", Blocks.CAULDRON) + .setShape("I I", "I I", "III") + .addMaterial('I', TagAPI.IRON_INGOTS) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_hopper", Blocks.HOPPER) + .setShape("I I", "ICI", " I ") + .addMaterial('I', TagAPI.IRON_INGOTS) + .addMaterial('C', TagAPI.ITEM_CHEST) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_piston", Blocks.PISTON) + .setShape("WWW", "CIC", "CDC") + .addMaterial('I', TagAPI.IRON_INGOTS) + .addMaterial('D', Items.REDSTONE) + .addMaterial('C', Items.COBBLESTONE) + .addMaterial('W', ItemTags.PLANKS) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_rail", Blocks.RAIL) + .setOutputCount(16) + .setShape("I I", "ISI", "I I") + .addMaterial('I', TagAPI.IRON_INGOTS) + .addMaterial('S', Items.STICK) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_stonecutter", Blocks.STONECUTTER) + .setShape(" I ", "SSS") + .addMaterial('I', TagAPI.IRON_INGOTS) + .addMaterial('S', Items.STONE) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_bucket", Items.BUCKET) + .setShape("I I", " I ") + .addMaterial('I', TagAPI.IRON_INGOTS) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_compass", Items.COMPASS) + .setShape(" I ", "IDI", " I ") + .addMaterial('I', TagAPI.IRON_INGOTS) + .addMaterial('D', Items.REDSTONE) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_minecart", Items.MINECART) + .setShape("I I", "III") + .addMaterial('I', TagAPI.IRON_INGOTS) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); + GridRecipe.make(BCLib.MOD_ID, "tag_shield", Items.SHIELD) + .setShape("WIW", "WWW", " W ") + .addMaterial('I', TagAPI.IRON_INGOTS) + .addMaterial('W', ItemTags.PLANKS) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); - GridRecipe.make(BCLib.MOD_ID, "tag_hopper", Blocks.HOPPER).setShape("I I", "ICI", " I ").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('C', TagAPI.ITEM_CHEST).checkConfig(Configs.RECIPE_CONFIG).build(); + GridRecipe.make(BCLib.MOD_ID, "tag_hopper", Blocks.HOPPER) + .setShape("I I", "ICI", " I ") + .addMaterial('I', TagAPI.IRON_INGOTS) + .addMaterial('C', TagAPI.ITEM_CHEST) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); - GridRecipe.make(BCLib.MOD_ID, "tag_shulker_box", Blocks.SHULKER_BOX).setShape("S", "C", "S").addMaterial('S', Items.SHULKER_SHELL).addMaterial('C', TagAPI.ITEM_CHEST).checkConfig(Configs.RECIPE_CONFIG).build(); + GridRecipe.make(BCLib.MOD_ID, "tag_shulker_box", Blocks.SHULKER_BOX) + .setShape("S", "C", "S") + .addMaterial('S', Items.SHULKER_SHELL) + .addMaterial('C', TagAPI.ITEM_CHEST) + .checkConfig(Configs.RECIPE_CONFIG) + .build(); } } diff --git a/src/main/java/ru/bclib/recipes/FurnaceRecipe.java b/src/main/java/ru/bclib/recipes/FurnaceRecipe.java index 38d20a4b..fbdd57ea 100644 --- a/src/main/java/ru/bclib/recipes/FurnaceRecipe.java +++ b/src/main/java/ru/bclib/recipes/FurnaceRecipe.java @@ -77,21 +77,49 @@ public class FurnaceRecipe { public void build(boolean blasting, boolean campfire, boolean smoker) { if (exist) { - SmeltingRecipe recipe = new SmeltingRecipe(id, group, Ingredient.of(input), new ItemStack(output, count), xp, time); + SmeltingRecipe recipe = new SmeltingRecipe( + id, + group, + Ingredient.of(input), + new ItemStack(output, count), + xp, + time + ); BCLRecipeManager.addRecipe(RecipeType.SMELTING, recipe); if (blasting) { - BlastingRecipe recipe2 = new BlastingRecipe(id, group, Ingredient.of(input), new ItemStack(output, count), xp, time / 2); + BlastingRecipe recipe2 = new BlastingRecipe( + id, + group, + Ingredient.of(input), + new ItemStack(output, count), + xp, + time / 2 + ); BCLRecipeManager.addRecipe(RecipeType.BLASTING, recipe2); } if (campfire) { - CampfireCookingRecipe recipe2 = new CampfireCookingRecipe(id, group, Ingredient.of(input), new ItemStack(output, count), xp, time * 3); + CampfireCookingRecipe recipe2 = new CampfireCookingRecipe( + id, + group, + Ingredient.of(input), + new ItemStack(output, count), + xp, + time * 3 + ); BCLRecipeManager.addRecipe(RecipeType.CAMPFIRE_COOKING, recipe2); } if (smoker) { - SmokingRecipe recipe2 = new SmokingRecipe(id, group, Ingredient.of(input), new ItemStack(output, count), xp, time / 2); + SmokingRecipe recipe2 = new SmokingRecipe( + id, + group, + Ingredient.of(input), + new ItemStack(output, count), + xp, + time / 2 + ); BCLRecipeManager.addRecipe(RecipeType.SMOKING, recipe2); } } diff --git a/src/main/java/ru/bclib/recipes/GridRecipe.java b/src/main/java/ru/bclib/recipes/GridRecipe.java index c74f3117..cc902a35 100644 --- a/src/main/java/ru/bclib/recipes/GridRecipe.java +++ b/src/main/java/ru/bclib/recipes/GridRecipe.java @@ -116,7 +116,14 @@ public class GridRecipe { ItemStack result = new ItemStack(output, count); NonNullList materials = this.getMaterials(width, height); - CraftingRecipe recipe = shaped ? new ShapedRecipe(id, group, width, height, materials, result) : new ShapelessRecipe(id, group, result, materials); + CraftingRecipe recipe = shaped ? new ShapedRecipe( + id, + group, + width, + height, + materials, + result + ) : new ShapelessRecipe(id, group, result, materials); BCLRecipeManager.addRecipe(type, recipe); } else { diff --git a/src/main/java/ru/bclib/registry/BaseBlockEntities.java b/src/main/java/ru/bclib/registry/BaseBlockEntities.java index c9958888..7e3c0bcb 100644 --- a/src/main/java/ru/bclib/registry/BaseBlockEntities.java +++ b/src/main/java/ru/bclib/registry/BaseBlockEntities.java @@ -18,10 +18,16 @@ import ru.bclib.blocks.BaseFurnaceBlock; import ru.bclib.blocks.BaseSignBlock; public class BaseBlockEntities { - public static final DynamicBlockEntityType CHEST = registerBlockEntityType(BCLib.makeID("chest"), BaseChestBlockEntity::new); - public static final DynamicBlockEntityType BARREL = registerBlockEntityType(BCLib.makeID("barrel"), BaseBarrelBlockEntity::new); - public static final DynamicBlockEntityType SIGN = registerBlockEntityType(BCLib.makeID("sign"), BaseSignBlockEntity::new); - public static final DynamicBlockEntityType FURNACE = registerBlockEntityType(BCLib.makeID("furnace"), BaseFurnaceBlockEntity::new); + public static final DynamicBlockEntityType CHEST = registerBlockEntityType(BCLib.makeID( + "chest"), BaseChestBlockEntity::new); + public static final DynamicBlockEntityType BARREL = registerBlockEntityType(BCLib.makeID( + "barrel"), BaseBarrelBlockEntity::new); + public static final DynamicBlockEntityType SIGN = registerBlockEntityType( + BCLib.makeID("sign"), + BaseSignBlockEntity::new + ); + public static final DynamicBlockEntityType FURNACE = registerBlockEntityType(BCLib.makeID( + "furnace"), BaseFurnaceBlockEntity::new); public static DynamicBlockEntityType registerBlockEntityType(ResourceLocation typeId, BlockEntitySupplier supplier) { return Registry.register(Registry.BLOCK_ENTITY_TYPE, typeId, new DynamicBlockEntityType<>(supplier)); @@ -30,19 +36,39 @@ public class BaseBlockEntities { public static void register() {} public static Block[] getChests() { - return BaseRegistry.getRegisteredBlocks().values().stream().filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseChestBlock).map(item -> ((BlockItem) item).getBlock()).toArray(Block[]::new); + return BaseRegistry.getRegisteredBlocks() + .values() + .stream() + .filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseChestBlock) + .map(item -> ((BlockItem) item).getBlock()) + .toArray(Block[]::new); } public static Block[] getBarrels() { - return BaseRegistry.getRegisteredBlocks().values().stream().filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseBarrelBlock).map(item -> ((BlockItem) item).getBlock()).toArray(Block[]::new); + return BaseRegistry.getRegisteredBlocks() + .values() + .stream() + .filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseBarrelBlock) + .map(item -> ((BlockItem) item).getBlock()) + .toArray(Block[]::new); } public static Block[] getSigns() { - return BaseRegistry.getRegisteredBlocks().values().stream().filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseSignBlock).map(item -> ((BlockItem) item).getBlock()).toArray(Block[]::new); + return BaseRegistry.getRegisteredBlocks() + .values() + .stream() + .filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseSignBlock) + .map(item -> ((BlockItem) item).getBlock()) + .toArray(Block[]::new); } public static Block[] getFurnaces() { - return BaseRegistry.getRegisteredBlocks().values().stream().filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseFurnaceBlock).map(item -> ((BlockItem) item).getBlock()).toArray(Block[]::new); + return BaseRegistry.getRegisteredBlocks() + .values() + .stream() + .filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseFurnaceBlock) + .map(item -> ((BlockItem) item).getBlock()) + .toArray(Block[]::new); } public static boolean registerSpecialBlock(Block block) { diff --git a/src/main/java/ru/bclib/registry/BaseRegistry.java b/src/main/java/ru/bclib/registry/BaseRegistry.java index 9369bc72..a6e985d8 100644 --- a/src/main/java/ru/bclib/registry/BaseRegistry.java +++ b/src/main/java/ru/bclib/registry/BaseRegistry.java @@ -14,11 +14,12 @@ import java.util.List; import java.util.Map; public abstract class BaseRegistry { - private static final List> REGISTRIES = Lists.newArrayList(); private static final Map> MOD_BLOCKS = Maps.newHashMap(); private static final Map> MOD_ITEMS = Maps.newHashMap(); + protected final CreativeModeTab creativeTab; + public static Map> getRegisteredBlocks() { return MOD_BLOCKS; } @@ -49,8 +50,6 @@ public abstract class BaseRegistry { REGISTRIES.forEach(BaseRegistry::registerInternal); } - protected final CreativeModeTab creativeTab; - protected BaseRegistry(CreativeModeTab creativeTab) { this.creativeTab = creativeTab; REGISTRIES.add(this); diff --git a/src/main/java/ru/bclib/registry/BlocksRegistry.java b/src/main/java/ru/bclib/registry/BlocksRegistry.java index 3da2f9c4..d6d4cee2 100644 --- a/src/main/java/ru/bclib/registry/BlocksRegistry.java +++ b/src/main/java/ru/bclib/registry/BlocksRegistry.java @@ -6,10 +6,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; -import net.minecraft.world.item.Item.Properties; -import net.minecraft.world.item.WaterLilyBlockItem; import net.minecraft.world.level.block.Block; -import ru.bclib.interfaces.ISpetialItem; +import ru.bclib.interfaces.CustomItemGetter; public abstract class BlocksRegistry extends BaseRegistry { @@ -19,21 +17,17 @@ public abstract class BlocksRegistry extends BaseRegistry { @Override public Block register(ResourceLocation id, Block block) { - int maxCount = 64; - boolean placeOnWater = false; - if (block instanceof ISpetialItem) { - ISpetialItem item = (ISpetialItem) block; - maxCount = item.getStackSize(); - placeOnWater = item.canPlaceOnWater(); - } - Properties item = makeItemSettings().stacksTo(maxCount); - if (placeOnWater) { - registerBlockItem(id, new WaterLilyBlockItem(block, item)); + BlockItem item = null; + if (block instanceof CustomItemGetter) { + item = ((CustomItemGetter) block).getCustomItem(id, makeItemSettings()); } else { - registerBlockItem(id, new BlockItem(block, item)); + item = new BlockItem(block, makeItemSettings()); } - if (block.defaultBlockState().getMaterial().isFlammable() && FlammableBlockRegistry.getDefaultInstance().get(block).getBurnChance() == 0) { + registerBlockItem(id, item); + if (block.defaultBlockState().getMaterial().isFlammable() && FlammableBlockRegistry.getDefaultInstance() + .get(block) + .getBurnChance() == 0) { FlammableBlockRegistry.getDefaultInstance().add(block, 5, 5); } return Registry.register(Registry.BLOCK, id, block); diff --git a/src/main/java/ru/bclib/registry/ItemsRegistry.java b/src/main/java/ru/bclib/registry/ItemsRegistry.java index fd9b728a..2f491b49 100644 --- a/src/main/java/ru/bclib/registry/ItemsRegistry.java +++ b/src/main/java/ru/bclib/registry/ItemsRegistry.java @@ -78,7 +78,15 @@ public abstract class ItemsRegistry extends BaseRegistry { public ItemStack execute(BlockSource pointer, ItemStack stack) { Direction direction = pointer.getBlockState().getValue(DispenserBlock.FACING); EntityType entityType = ((SpawnEggItem) stack.getItem()).getType(stack.getTag()); - entityType.spawn(pointer.getLevel(), stack, null, pointer.getPos().relative(direction), MobSpawnType.DISPENSER, direction != Direction.UP, false); + entityType.spawn( + pointer.getLevel(), + stack, + null, + pointer.getPos().relative(direction), + MobSpawnType.DISPENSER, + direction != Direction.UP, + false + ); stack.shrink(1); return stack; } diff --git a/src/main/java/ru/bclib/sdf/operator/SDFRadialNoiseMap.java b/src/main/java/ru/bclib/sdf/operator/SDFRadialNoiseMap.java index 921768db..3e3be641 100644 --- a/src/main/java/ru/bclib/sdf/operator/SDFRadialNoiseMap.java +++ b/src/main/java/ru/bclib/sdf/operator/SDFRadialNoiseMap.java @@ -34,7 +34,10 @@ public class SDFRadialNoiseMap extends SDFDisplacement { } private float getNoise(double x, double z) { - return (float) noise.eval(x, z) + (float) noise.eval(x * 3 + 1000, z * 3) * 0.5F + (float) noise.eval(x * 9 + 1000, z * 9) * 0.2F; + return (float) noise.eval(x, z) + (float) noise.eval( + x * 3 + 1000, + z * 3 + ) * 0.5F + (float) noise.eval(x * 9 + 1000, z * 9) * 0.2F; } public SDFRadialNoiseMap setSeed(long seed) { diff --git a/src/main/java/ru/bclib/sdf/primitive/SDFCappedCone.java b/src/main/java/ru/bclib/sdf/primitive/SDFCappedCone.java index d66e0f46..bd3230ba 100644 --- a/src/main/java/ru/bclib/sdf/primitive/SDFCappedCone.java +++ b/src/main/java/ru/bclib/sdf/primitive/SDFCappedCone.java @@ -30,7 +30,11 @@ public class SDFCappedCone extends SDFPrimitive { float k2y = 2 * height; float cax = qx - MHelper.min(qx, (y < 0F) ? radius1 : radius2); float cay = Math.abs(y) - height; - float mlt = Mth.clamp(MHelper.dot(radius2 - qx, height - y, k2x, k2y) / MHelper.dot(k2x, k2y, k2x, k2y), 0F, 1F); + float mlt = Mth.clamp( + MHelper.dot(radius2 - qx, height - y, k2x, k2y) / MHelper.dot(k2x, k2y, k2x, k2y), + 0F, + 1F + ); float cbx = qx - radius2 + k2x * mlt; float cby = y - height + k2y * mlt; float s = (cbx < 0F && cay < 0F) ? -1F : 1F; diff --git a/src/main/java/ru/bclib/server/BCLibServer.java b/src/main/java/ru/bclib/server/BCLibServer.java index de5bf700..35520c02 100644 --- a/src/main/java/ru/bclib/server/BCLibServer.java +++ b/src/main/java/ru/bclib/server/BCLibServer.java @@ -3,15 +3,15 @@ package ru.bclib.server; import net.fabricmc.api.DedicatedServerModInitializer; import net.minecraft.core.Registry; import ru.bclib.api.ModIntegrationAPI; -import ru.bclib.interfaces.IPostInit; +import ru.bclib.interfaces.PostInitable; public class BCLibServer implements DedicatedServerModInitializer { @Override public void onInitializeServer() { ModIntegrationAPI.registerAll(); Registry.BLOCK.forEach(block -> { - if (block instanceof IPostInit) { - ((IPostInit) block).postInit(); + if (block instanceof PostInitable) { + ((PostInitable) block).postInit(); } }); } diff --git a/src/main/java/ru/bclib/util/SplineHelper.java b/src/main/java/ru/bclib/util/SplineHelper.java index 844e357a..de5b9a0a 100644 --- a/src/main/java/ru/bclib/util/SplineHelper.java +++ b/src/main/java/ru/bclib/util/SplineHelper.java @@ -85,7 +85,10 @@ public class SplineHelper { for (int i = 1; i < count; i++) { Vector3f pos = spline.get(i); float delta = (float) (i - 1) / max; - SDF line = new SDFLine().setRadius(Mth.lerp(delta, radius1, radius2)).setStart(start.x(), start.y(), start.z()).setEnd(pos.x(), pos.y(), pos.z()).setBlock(placerFunction); + SDF line = new SDFLine().setRadius(Mth.lerp(delta, radius1, radius2)) + .setStart(start.x(), start.y(), start.z()) + .setEnd(pos.x(), pos.y(), pos.z()) + .setBlock(placerFunction); result = result == null ? line : new SDFUnion().setSourceA(result).setSourceB(line); start = pos; } @@ -100,7 +103,10 @@ public class SplineHelper { for (int i = 1; i < count; i++) { Vector3f pos = spline.get(i); float delta = (float) (i - 1) / max; - SDF line = new SDFLine().setRadius(radiusFunction.apply(delta)).setStart(start.x(), start.y(), start.z()).setEnd(pos.x(), pos.y(), pos.z()).setBlock(placerFunction); + SDF line = new SDFLine().setRadius(radiusFunction.apply(delta)) + .setStart(start.x(), start.y(), start.z()) + .setEnd(pos.x(), pos.y(), pos.z()) + .setBlock(placerFunction); result = result == null ? line : new SDFUnion().setSourceA(result).setSourceB(line); start = pos; } diff --git a/src/main/java/ru/bclib/util/StructureHelper.java b/src/main/java/ru/bclib/util/StructureHelper.java index aed50005..536a25ec 100644 --- a/src/main/java/ru/bclib/util/StructureHelper.java +++ b/src/main/java/ru/bclib/util/StructureHelper.java @@ -87,7 +87,12 @@ public class StructureHelper { } public static BlockPos offsetPos(BlockPos pos, StructureTemplate structure, Rotation rotation, Mirror mirror) { - Vec3 offset = StructureTemplate.transform(Vec3.atCenterOf(structure.getSize()), mirror, rotation, BlockPos.ZERO); + Vec3 offset = StructureTemplate.transform( + Vec3.atCenterOf(structure.getSize()), + mirror, + rotation, + BlockPos.ZERO + ); return pos.offset(-offset.x * 0.5, 0, -offset.z * 0.5); } @@ -97,7 +102,9 @@ public class StructureHelper { public static void placeCenteredBottom(WorldGenLevel world, BlockPos pos, StructureTemplate structure, Rotation rotation, Mirror mirror, BoundingBox bounds, Random random) { BlockPos offset = offsetPos(pos, structure, rotation, mirror); - StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror).setBoundingBox(bounds); + StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation) + .setMirror(mirror) + .setBoundingBox(bounds); structure.placeInWorld(world, offset, offset, placementData, random, 4); } @@ -140,7 +147,11 @@ public class StructureHelper { mut.setY(y); BlockState state = world.getBlockState(mut); boolean ignore = ignore(state, world, mut); - if (canDestruct && BlocksHelper.isInvulnerable(state, world, mut) && random.nextInt(8) == 0 && world.isEmptyBlock(mut.below(2))) { + if (canDestruct && BlocksHelper.isInvulnerable( + state, + world, + mut + ) && random.nextInt(8) == 0 && world.isEmptyBlock(mut.below(2))) { int r = MHelper.randRange(1, 4, random); int cx = mut.getX(); int cy = mut.getY(); @@ -163,7 +174,11 @@ public class StructureHelper { int dz = pz - cz; dz *= dz; mut.setZ(pz); - if (dx + dy + dz <= r && BlocksHelper.isInvulnerable(world.getBlockState(mut), world, mut)) { + if (dx + dy + dz <= r && BlocksHelper.isInvulnerable( + world.getBlockState(mut), + world, + mut + )) { BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR); } } @@ -181,7 +196,8 @@ public class StructureHelper { if (!state.isAir() && random.nextBoolean()) { MHelper.shuffle(DIR, random); for (Direction dir : DIR) { - if (world.isEmptyBlock(mut.relative(dir)) && world.isEmptyBlock(mut.below().relative(dir))) { + if (world.isEmptyBlock(mut.relative(dir)) && world.isEmptyBlock(mut.below() + .relative(dir))) { BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR); mut.move(dir).move(Direction.DOWN); for (int py = mut.getY(); y >= bounds.minY() - 10; y--) { @@ -196,7 +212,11 @@ public class StructureHelper { } break; } - else if (random.nextInt(8) == 0 && !BlocksHelper.isInvulnerable(world.getBlockState(mut.above()), world, mut)) { + else if (random.nextInt(8) == 0 && !BlocksHelper.isInvulnerable( + world.getBlockState(mut.above()), + world, + mut + )) { BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR); } } @@ -344,7 +364,12 @@ public class StructureHelper { } private static boolean ignore(BlockState state, WorldGenLevel world, BlockPos pos) { - return state.getMaterial().isReplaceable() || !state.getFluidState().isEmpty() || state.is(TagAPI.END_GROUND) || state.is(BlockTags.LOGS) || state.is(BlockTags.LEAVES) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.LEAVES) || BlocksHelper.isInvulnerable(state, world, pos); + return state.getMaterial().isReplaceable() || !state.getFluidState() + .isEmpty() || state.is(TagAPI.END_GROUND) || state.is( + BlockTags.LOGS) || state.is(BlockTags.LEAVES) || state.getMaterial() + .equals(Material.PLANT) || state.getMaterial() + .equals(Material.LEAVES) || BlocksHelper + .isInvulnerable(state, world, pos); } public static void cover(WorldGenLevel world, BoundingBox bounds, Random random) { @@ -357,7 +382,9 @@ public class StructureHelper { for (int y = bounds.maxY(); y >= bounds.minY(); y--) { mut.setY(y); BlockState state = world.getBlockState(mut); - if (state.is(TagAPI.END_GROUND) && !world.getBlockState(mut.above()).getMaterial().isSolidBlocking()) { + if (state.is(TagAPI.END_GROUND) && !world.getBlockState(mut.above()) + .getMaterial() + .isSolidBlocking()) { BlocksHelper.setWithoutUpdate(world, mut, top); } } diff --git a/src/main/java/ru/bclib/world/biomes/BCLBiome.java b/src/main/java/ru/bclib/world/biomes/BCLBiome.java index 7b021574..0cf21cbb 100644 --- a/src/main/java/ru/bclib/world/biomes/BCLBiome.java +++ b/src/main/java/ru/bclib/world/biomes/BCLBiome.java @@ -142,7 +142,11 @@ public class BCLBiome { list.add(new StructureInfo(structure, offsetY, terrainMerge)); }); if (!list.isEmpty()) { - structuresFeature = BCLFeature.makeChansedFeature(new ResourceLocation(ns, nm + "_structures"), new ListFeature(list), 10); + structuresFeature = BCLFeature.makeChansedFeature( + new ResourceLocation(ns, nm + "_structures"), + new ListFeature(list), + 10 + ); } } } diff --git a/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java b/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java index 3c5e6013..cc405214 100644 --- a/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java +++ b/src/main/java/ru/bclib/world/biomes/BCLBiomeDef.java @@ -140,12 +140,19 @@ public class BCLBiomeDef { } public BCLBiomeDef setSurface(Block block) { - setSurface(SurfaceBuilder.DEFAULT.configured(new SurfaceBuilderBaseConfiguration(block.defaultBlockState(), Blocks.END_STONE.defaultBlockState(), Blocks.END_STONE.defaultBlockState()))); + setSurface(SurfaceBuilder.DEFAULT.configured(new SurfaceBuilderBaseConfiguration( + block.defaultBlockState(), + Blocks.END_STONE.defaultBlockState(), + Blocks.END_STONE.defaultBlockState() + ))); return this; } public BCLBiomeDef setSurface(Block block1, Block block2) { - setSurface(DoubleBlockSurfaceBuilder.register("bclib_" + id.getPath() + "_surface").setBlock1(block1).setBlock2(block2).configured()); + setSurface(DoubleBlockSurfaceBuilder.register("bclib_" + id.getPath() + "_surface") + .setBlock1(block1) + .setBlock2(block2) + .configured()); return this; } @@ -299,7 +306,10 @@ public class BCLBiomeDef { Builder effects = new Builder(); mobs.forEach((spawn) -> { - spawnSettings.addSpawn(spawn.type.getCategory(), new MobSpawnSettings.SpawnerData(spawn.type, spawn.weight, spawn.minGroupSize, spawn.maxGroupSize)); + spawnSettings.addSpawn( + spawn.type.getCategory(), + new MobSpawnSettings.SpawnerData(spawn.type, spawn.weight, spawn.minGroupSize, spawn.maxGroupSize) + ); }); spawns.forEach((entry) -> { @@ -311,14 +321,28 @@ public class BCLBiomeDef { features.forEach((info) -> generationSettings.addFeature(info.featureStep, info.feature)); carvers.forEach((info) -> generationSettings.addCarver(info.carverStep, info.carver)); - effects.skyColor(0).waterColor(waterColor).waterFogColor(waterFogColor).fogColor(fogColor).foliageColorOverride(foliageColor).grassColorOverride(grassColor); + effects.skyColor(0) + .waterColor(waterColor) + .waterFogColor(waterFogColor) + .fogColor(fogColor) + .foliageColorOverride(foliageColor) + .grassColorOverride(grassColor); if (loop != null) effects.ambientLoopSound(loop); if (mood != null) effects.ambientMoodSound(mood); if (additions != null) effects.ambientAdditionsSound(additions); if (particleConfig != null) effects.ambientParticle(particleConfig); effects.backgroundMusic(music != null ? new Music(music, 600, 2400, true) : Musics.END); - return new Biome.BiomeBuilder().precipitation(precipitation).biomeCategory(category).depth(depth).scale(0.2F).temperature(temperature).downfall(downfall).specialEffects(effects.build()).mobSpawnSettings(spawnSettings.build()).generationSettings(generationSettings.build()).build(); + return new Biome.BiomeBuilder().precipitation(precipitation) + .biomeCategory(category) + .depth(depth) + .scale(0.2F) + .temperature(temperature) + .downfall(downfall) + .specialEffects(effects.build()) + .mobSpawnSettings(spawnSettings.build()) + .generationSettings(generationSettings.build()) + .build(); } private static final class SpawnInfo { diff --git a/src/main/java/ru/bclib/world/features/BCLFeature.java b/src/main/java/ru/bclib/world/features/BCLFeature.java index df27a021..1c3f9f0c 100644 --- a/src/main/java/ru/bclib/world/features/BCLFeature.java +++ b/src/main/java/ru/bclib/world/features/BCLFeature.java @@ -39,39 +39,65 @@ public class BCLFeature { } public static BCLFeature makeVegetationFeature(ResourceLocation id, Feature feature, int density) { - ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE).decorated(BCLDecorators.HEIGHTMAP_SQUARE).countRandom(density); + ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE) + .decorated(BCLDecorators.HEIGHTMAP_SQUARE) + .countRandom(density); return new BCLFeature(id, feature, GenerationStep.Decoration.VEGETAL_DECORATION, configured); } public static BCLFeature makeRawGenFeature(ResourceLocation id, Feature feature, int chance) { - ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.CHANCE.configured(new ChanceDecoratorConfiguration(chance))); + ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE) + .decorated(FeatureDecorator.CHANCE.configured(new ChanceDecoratorConfiguration( + chance))); return new BCLFeature(id, feature, GenerationStep.Decoration.RAW_GENERATION, configured); } public static BCLFeature makeLakeFeature(ResourceLocation id, Feature feature, int chance) { - ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.LAVA_LAKE.configured(new ChanceDecoratorConfiguration(chance))); + ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE) + .decorated(FeatureDecorator.LAVA_LAKE.configured(new ChanceDecoratorConfiguration( + chance))); return new BCLFeature(id, feature, GenerationStep.Decoration.LAKES, configured); } public static BCLFeature makeOreFeature(ResourceLocation id, Block blockOre, int veins, int veinSize, int offset, int minY, int maxY) { - OreConfiguration featureConfig = new OreConfiguration(new BlockMatchTest(Blocks.END_STONE), blockOre.defaultBlockState(), veinSize); + OreConfiguration featureConfig = new OreConfiguration( + new BlockMatchTest(Blocks.END_STONE), + blockOre.defaultBlockState(), + veinSize + ); OreConfiguration config = new OreConfiguration(ANY_TERRAIN, blockOre.defaultBlockState(), 33); - ConfiguredFeature oreFeature = Feature.ORE.configured(featureConfig).rangeUniform(VerticalAnchor.absolute(minY), VerticalAnchor.absolute(maxY)).squared().count(veins); - return new BCLFeature(Feature.ORE, Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, oreFeature), GenerationStep.Decoration.UNDERGROUND_ORES); + ConfiguredFeature oreFeature = Feature.ORE.configured(featureConfig) + .rangeUniform( + VerticalAnchor.absolute(minY), + VerticalAnchor.absolute(maxY) + ) + .squared() + .count(veins); + return new BCLFeature( + Feature.ORE, + Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, oreFeature), + GenerationStep.Decoration.UNDERGROUND_ORES + ); } public static BCLFeature makeChunkFeature(ResourceLocation id, Feature feature) { - ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(1))); + ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE) + .decorated(FeatureDecorator.COUNT.configured(new CountConfiguration( + 1))); return new BCLFeature(id, feature, GenerationStep.Decoration.LOCAL_MODIFICATIONS, configured); } public static BCLFeature makeChansedFeature(ResourceLocation id, Feature feature, int chance) { - ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.CHANCE.configured(new ChanceDecoratorConfiguration(chance))); + ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE) + .decorated(FeatureDecorator.CHANCE.configured(new ChanceDecoratorConfiguration( + chance))); return new BCLFeature(id, feature, GenerationStep.Decoration.SURFACE_STRUCTURES, configured); } public static BCLFeature makeCountRawFeature(ResourceLocation id, Feature feature, int chance) { - ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(chance))); + ConfiguredFeature configured = feature.configured(FeatureConfiguration.NONE) + .decorated(FeatureDecorator.COUNT.configured(new CountConfiguration( + chance))); return new BCLFeature(id, feature, GenerationStep.Decoration.RAW_GENERATION, configured); } diff --git a/src/main/java/ru/bclib/world/features/NBTStructureFeature.java b/src/main/java/ru/bclib/world/features/NBTStructureFeature.java index afbad417..5d5201c5 100644 --- a/src/main/java/ru/bclib/world/features/NBTStructureFeature.java +++ b/src/main/java/ru/bclib/world/features/NBTStructureFeature.java @@ -93,11 +93,18 @@ public abstract class NBTStructureFeature extends DefaultFeature { StructureTemplate structure = getStructure(world, center, random); Rotation rotation = getRotation(world, center, random); Mirror mirror = getMirror(world, center, random); - BlockPos offset = StructureTemplate.transform(new BlockPos(structure.getSize()), mirror, rotation, BlockPos.ZERO); + BlockPos offset = StructureTemplate.transform( + new BlockPos(structure.getSize()), + mirror, + rotation, + BlockPos.ZERO + ); center = center.offset(0, getYOffset(structure, world, center, random) + 0.5, 0); BoundingBox bounds = makeBox(center); - StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror).setBoundingBox(bounds); + StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation) + .setMirror(mirror) + .setBoundingBox(bounds); addStructureData(placementData); center = center.offset(-offset.getX() * 0.5, 0, -offset.getZ() * 0.5); structure.placeInWorld(world, center, center, placementData, random, 4); @@ -135,7 +142,9 @@ public abstract class NBTStructureFeature extends DefaultFeature { BlockState stateSt = world.getBlockState(mut); if (!stateSt.is(TagAPI.GEN_TERRAIN)) { if (merge == TerrainMerge.SURFACE) { - SurfaceBuilderConfiguration config = world.getBiome(mut).getGenerationSettings().getSurfaceBuilderConfig(); + SurfaceBuilderConfiguration config = world.getBiome(mut) + .getGenerationSettings() + .getSurfaceBuilderConfig(); boolean isTop = mut.getY() == surfMax && state.getMaterial().isSolidBlocking(); BlockState top = isTop ? config.getTopMaterial() : config.getUnderMaterial(); BlocksHelper.setWithoutUpdate(world, mut, top); @@ -147,7 +156,9 @@ public abstract class NBTStructureFeature extends DefaultFeature { else { if (stateSt.is(TagAPI.END_GROUND) && state.getMaterial().isSolidBlocking()) { if (merge == TerrainMerge.SURFACE) { - SurfaceBuilderConfiguration config = world.getBiome(mut).getGenerationSettings().getSurfaceBuilderConfig(); + SurfaceBuilderConfiguration config = world.getBiome(mut) + .getGenerationSettings() + .getSurfaceBuilderConfig(); BlocksHelper.setWithoutUpdate(world, mut, config.getUnderMaterial()); } else { diff --git a/src/main/java/ru/bclib/world/processors/DestructionStructureProcessor.java b/src/main/java/ru/bclib/world/processors/DestructionStructureProcessor.java index 4c63a7e7..381bd324 100644 --- a/src/main/java/ru/bclib/world/processors/DestructionStructureProcessor.java +++ b/src/main/java/ru/bclib/world/processors/DestructionStructureProcessor.java @@ -18,7 +18,11 @@ public class DestructionStructureProcessor extends StructureProcessor { @Override public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, StructurePlaceSettings structurePlacementData) { - if (!BlocksHelper.isInvulnerable(structureBlockInfo2.state, worldView, structureBlockInfo2.pos) && MHelper.RANDOM.nextInt(chance) == 0) { + if (!BlocksHelper.isInvulnerable( + structureBlockInfo2.state, + worldView, + structureBlockInfo2.pos + ) && MHelper.RANDOM.nextInt(chance) == 0) { return null; } return structureBlockInfo2; diff --git a/src/main/java/ru/bclib/world/processors/TerrainStructureProcessor.java b/src/main/java/ru/bclib/world/processors/TerrainStructureProcessor.java index 8231cde8..1f758427 100644 --- a/src/main/java/ru/bclib/world/processors/TerrainStructureProcessor.java +++ b/src/main/java/ru/bclib/world/processors/TerrainStructureProcessor.java @@ -14,7 +14,10 @@ public class TerrainStructureProcessor extends StructureProcessor { public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, StructurePlaceSettings structurePlacementData) { BlockPos bpos = structureBlockInfo2.pos; if (structureBlockInfo2.state.is(Blocks.END_STONE) && worldView.isEmptyBlock(bpos.above())) { - BlockState top = worldView.getBiome(structureBlockInfo2.pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); + BlockState top = worldView.getBiome(structureBlockInfo2.pos) + .getGenerationSettings() + .getSurfaceBuilderConfig() + .getTopMaterial(); return new StructureBlockInfo(bpos, top, structureBlockInfo2.nbt); } return structureBlockInfo2; diff --git a/src/main/java/ru/bclib/world/structures/BCLStructureFeature.java b/src/main/java/ru/bclib/world/structures/BCLStructureFeature.java index d8655332..4497bfc7 100644 --- a/src/main/java/ru/bclib/world/structures/BCLStructureFeature.java +++ b/src/main/java/ru/bclib/world/structures/BCLStructureFeature.java @@ -19,7 +19,10 @@ public class BCLStructureFeature { public BCLStructureFeature(ResourceLocation id, StructureFeature structure, GenerationStep.Decoration step, int spacing, int separation) { this.featureStep = step; - this.structure = FabricStructureBuilder.create(id, structure).step(step).defaultConfig(spacing, separation, RANDOM.nextInt(8192)).register(); + this.structure = FabricStructureBuilder.create(id, structure) + .step(step) + .defaultConfig(spacing, separation, RANDOM.nextInt(8192)) + .register(); this.featureConfigured = this.structure.configured(NoneFeatureConfiguration.NONE); BuiltinRegistries.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, id, this.featureConfigured); FlatChunkGeneratorConfigAccessor.getStructureToFeatures().put(this.structure, this.featureConfigured); diff --git a/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceBuilder.java b/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceBuilder.java index 9e78a08c..434b1a39 100644 --- a/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceBuilder.java +++ b/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceBuilder.java @@ -47,6 +47,20 @@ public class DoubleBlockSurfaceBuilder extends SurfaceBuilder 0 ? config1 : config2); + SurfaceBuilder.DEFAULT.apply( + random, + chunkAccess, + biome, + x, + z, + height, + noise, + defaultBlock, + defaultFluid, + l, + m, + seed, + noise > 0 ? config1 : config2 + ); } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/models/block/chest_item.json b/src/main/resources/assets/bclib/models/block/chest_item.json index c0a3265f..4f96625e 100644 --- a/src/main/resources/assets/bclib/models/block/chest_item.json +++ b/src/main/resources/assets/bclib/models/block/chest_item.json @@ -3,188 +3,188 @@ "parent": "block/block", "elements": [ { - "__comment": "Box1", - "faces": { - "down": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 3.5, - 4.75, - 7, - 8.25 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 3.5, - 10.75, - 7, - 8.25 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 10.5, - 10.75, - 14, - 8.25 - ] - }, - "south": { - "texture": "#texture", - "uv": [ - 0, - 10.75, - 3.5, - 8.25 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 7, - 10.75, - 10.5, - 8.25 - ] - } + "__comment": "Box1", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 3.5, + 4.75, + 7, + 8.25 + ] }, - "from": [ - 1, - 0, - 1 - ], - "to": [ - 15, - 10, - 15 - ] + "east": { + "texture": "#texture", + "uv": [ + 3.5, + 10.75, + 7, + 8.25 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 10.5, + 10.75, + 14, + 8.25 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 0, + 10.75, + 3.5, + 8.25 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 7, + 10.75, + 10.5, + 8.25 + ] + } + }, + "from": [ + 1, + 0, + 1 + ], + "to": [ + 15, + 10, + 15 + ] }, { - "__comment": "Box1", - "faces": { - "east": { - "texture": "#texture", - "uv": [ - 3.5, - 4.75, - 7, - 3.75 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 10.5, - 4.75, - 14, - 3.75 - ] - }, - "south": { - "texture": "#texture", - "uv": [ - 0, - 4.75, - 3.5, - 3.75 - ] - }, - "up": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 7, - 0, - 10.5, - 3.5 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 7, - 4.75, - 10.5, - 3.75 - ] - } + "__comment": "Box1", + "faces": { + "east": { + "texture": "#texture", + "uv": [ + 3.5, + 4.75, + 7, + 3.75 + ] }, - "from": [ - 1, - 10, - 1 - ], - "to": [ - 15, - 14, - 15 - ] + "north": { + "texture": "#texture", + "uv": [ + 10.5, + 4.75, + 14, + 3.75 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 0, + 4.75, + 3.5, + 3.75 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 7, + 0, + 10.5, + 3.5 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 7, + 4.75, + 10.5, + 3.75 + ] + } + }, + "from": [ + 1, + 10, + 1 + ], + "to": [ + 15, + 14, + 15 + ] }, { - "__comment": "Box1", - "faces": { - "down": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 0.25, - 0, - 0.75, - 0.25 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 0, - 1.25, - 0.25, - 0.25 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 0.5, - 1.25, - 1, - 0.25 - ] - }, - "up": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 0.75, - 0, - 1.25, - 0.25 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 0, - 1.25, - 0.25, - 0.25 - ] - } + "__comment": "Box1", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 0.25, + 0, + 0.75, + 0.25 + ] }, - "from": [ - 7, - 7, - 0 - ], - "to": [ - 9, - 11, - 1 - ] + "east": { + "texture": "#texture", + "uv": [ + 0, + 1.25, + 0.25, + 0.25 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 0.5, + 1.25, + 1, + 0.25 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 0.75, + 0, + 1.25, + 0.25 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 0, + 1.25, + 0.25, + 0.25 + ] + } + }, + "from": [ + 7, + 7, + 0 + ], + "to": [ + 9, + 11, + 1 + ] } ] } diff --git a/src/main/resources/assets/bclib/models/block/ladder.json b/src/main/resources/assets/bclib/models/block/ladder.json index 65ea537b..710f39cd 100644 --- a/src/main/resources/assets/bclib/models/block/ladder.json +++ b/src/main/resources/assets/bclib/models/block/ladder.json @@ -2,436 +2,436 @@ "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", "elements": [ { - "__comment": "Box1", - "faces": { - "down": { - "cullface": "down", - "rotation": 180, - "texture": "#texture", - "uv": [ - 2, - 15, - 4, - 16 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 2, - 0, - 3, - 16 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 2, - 0, - 4, - 16 - ] - }, - "south": { - "cullface": "north", - "texture": "#texture", - "uv": [ - 2, - 0, - 4, - 16 - ] - }, - "up": { - "cullface": "up", - "rotation": 180, - "texture": "#texture", - "uv": [ - 2, - 0, - 4, - 1 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 3, - 0, - 4, - 16 - ] - } + "__comment": "Box1", + "faces": { + "down": { + "cullface": "down", + "rotation": 180, + "texture": "#texture", + "uv": [ + 2, + 15, + 4, + 16 + ] }, - "from": [ - 12, - 0, - 15 - ], - "to": [ - 14, - 16, - 16 - ] + "east": { + "texture": "#texture", + "uv": [ + 2, + 0, + 3, + 16 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 2, + 0, + 4, + 16 + ] + }, + "south": { + "cullface": "north", + "texture": "#texture", + "uv": [ + 2, + 0, + 4, + 16 + ] + }, + "up": { + "cullface": "up", + "rotation": 180, + "texture": "#texture", + "uv": [ + 2, + 0, + 4, + 1 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 3, + 0, + 4, + 16 + ] + } + }, + "from": [ + 12, + 0, + 15 + ], + "to": [ + 14, + 16, + 16 + ] }, { - "__comment": "Box1", - "faces": { - "down": { - "cullface": "down", - "rotation": 180, - "texture": "#texture", - "uv": [ - 12, - 15, - 14, - 16 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 2, - 0, - 3, - 16 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 12, - 0, - 14, - 16 - ] - }, - "south": { - "cullface": "north", - "texture": "#texture", - "uv": [ - 12, - 0, - 14, - 16 - ] - }, - "up": { - "cullface": "up", - "rotation": 180, - "texture": "#texture", - "uv": [ - 12, - 0, - 14, - 1 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 3, - 0, - 4, - 16 - ] - } + "__comment": "Box1", + "faces": { + "down": { + "cullface": "down", + "rotation": 180, + "texture": "#texture", + "uv": [ + 12, + 15, + 14, + 16 + ] }, - "from": [ - 2, - 0, - 15 - ], - "to": [ - 4, - 16, - 16 - ] + "east": { + "texture": "#texture", + "uv": [ + 2, + 0, + 3, + 16 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 12, + 0, + 14, + 16 + ] + }, + "south": { + "cullface": "north", + "texture": "#texture", + "uv": [ + 12, + 0, + 14, + 16 + ] + }, + "up": { + "cullface": "up", + "rotation": 180, + "texture": "#texture", + "uv": [ + 12, + 0, + 14, + 1 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 3, + 0, + 4, + 16 + ] + } + }, + "from": [ + 2, + 0, + 15 + ], + "to": [ + 4, + 16, + 16 + ] }, { - "__comment": "Box3", - "faces": { - "down": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 14, - 15, - 15 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 1, - 13, - 2, - 15 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 1, - 13, - 15, - 15 - ] - }, - "south": { - "texture": "#texture", - "uv": [ - 1, - 13, - 15, - 15 - ] - }, - "up": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 13, - 15, - 14 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 14, - 13, - 15, - 15 - ] - } + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 14, + 15, + 15 + ] }, - "from": [ - 1, - 1, - 14.5 - ], - "to": [ - 15, - 3, - 15.5 - ] + "east": { + "texture": "#texture", + "uv": [ + 1, + 13, + 2, + 15 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 13, + 15, + 15 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 13, + 15, + 15 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 13, + 15, + 14 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 13, + 15, + 15 + ] + } + }, + "from": [ + 1, + 1, + 14.5 + ], + "to": [ + 15, + 3, + 15.5 + ] }, { - "__comment": "Box3", - "faces": { - "down": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 10, - 15, - 11 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 1, - 9, - 2, - 11 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 1, - 9, - 15, - 11 - ] - }, - "south": { - "texture": "#texture", - "uv": [ - 1, - 9, - 15, - 11 - ] - }, - "up": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 9, - 15, - 10 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 14, - 9, - 15, - 11 - ] - } + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 10, + 15, + 11 + ] }, - "from": [ - 1, - 5, - 14.5 - ], - "to": [ - 15, - 7, - 15.5 - ] + "east": { + "texture": "#texture", + "uv": [ + 1, + 9, + 2, + 11 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 9, + 15, + 11 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 9, + 15, + 11 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 9, + 15, + 10 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 9, + 15, + 11 + ] + } + }, + "from": [ + 1, + 5, + 14.5 + ], + "to": [ + 15, + 7, + 15.5 + ] }, { - "__comment": "Box3", - "faces": { - "down": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 6, - 15, - 7 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 1, - 5, - 2, - 7 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 1, - 5, - 15, - 7 - ] - }, - "south": { - "texture": "#texture", - "uv": [ - 1, - 5, - 15, - 7 - ] - }, - "up": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 5, - 15, - 6 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 14, - 5, - 15, - 7 - ] - } + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 6, + 15, + 7 + ] }, - "from": [ - 1, - 9, - 14.5 - ], - "to": [ - 15, - 11, - 15.5 - ] + "east": { + "texture": "#texture", + "uv": [ + 1, + 5, + 2, + 7 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 5, + 15, + 7 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 5, + 15, + 7 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 5, + 15, + 6 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 5, + 15, + 7 + ] + } + }, + "from": [ + 1, + 9, + 14.5 + ], + "to": [ + 15, + 11, + 15.5 + ] }, { - "__comment": "Box3", - "faces": { - "down": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 2, - 15, - 3 - ] - }, - "east": { - "texture": "#texture", - "uv": [ - 1, - 1, - 2, - 3 - ] - }, - "north": { - "texture": "#texture", - "uv": [ - 1, - 1, - 15, - 3 - ] - }, - "south": { - "texture": "#texture", - "uv": [ - 1, - 1, - 15, - 3 - ] - }, - "up": { - "rotation": 180, - "texture": "#texture", - "uv": [ - 1, - 1, - 15, - 2 - ] - }, - "west": { - "texture": "#texture", - "uv": [ - 14, - 1, - 15, - 3 - ] - } + "__comment": "Box3", + "faces": { + "down": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 2, + 15, + 3 + ] }, - "from": [ - 1, - 13, - 14.5 - ], - "to": [ - 15, - 15, - 15.5 - ] + "east": { + "texture": "#texture", + "uv": [ + 1, + 1, + 2, + 3 + ] + }, + "north": { + "texture": "#texture", + "uv": [ + 1, + 1, + 15, + 3 + ] + }, + "south": { + "texture": "#texture", + "uv": [ + 1, + 1, + 15, + 3 + ] + }, + "up": { + "rotation": 180, + "texture": "#texture", + "uv": [ + 1, + 1, + 15, + 2 + ] + }, + "west": { + "texture": "#texture", + "uv": [ + 14, + 1, + 15, + 3 + ] + } + }, + "from": [ + 1, + 13, + 14.5 + ], + "to": [ + 15, + 15, + 15.5 + ] } ], "parent": "block/ladder", diff --git a/src/main/resources/assets/bclib/models/block/path.json b/src/main/resources/assets/bclib/models/block/path.json index 04fed330..696ef5f5 100644 --- a/src/main/resources/assets/bclib/models/block/path.json +++ b/src/main/resources/assets/bclib/models/block/path.json @@ -1,18 +1,81 @@ -{ "parent": "block/block", - "textures": { - "particle": "#bottom" - }, - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 16, 15, 16 ], - "faces": { - "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, - "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, - "north": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "north" }, - "south": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "south" }, - "west": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "west" }, - "east": { "uv": [ 0, 1, 16, 16 ], "texture": "#side", "cullface": "east" } - } - } - ] +{ + "parent": "block/block", + "textures": { + "particle": "#bottom" + }, + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 15, + 16 + ], + "faces": { + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#bottom", + "cullface": "down" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#top" + }, + "north": { + "uv": [ + 0, + 1, + 16, + 16 + ], + "texture": "#side", + "cullface": "north" + }, + "south": { + "uv": [ + 0, + 1, + 16, + 16 + ], + "texture": "#side", + "cullface": "south" + }, + "west": { + "uv": [ + 0, + 1, + 16, + 16 + ], + "texture": "#side", + "cullface": "west" + }, + "east": { + "uv": [ + 0, + 1, + 16, + 16 + ], + "texture": "#side", + "cullface": "east" + } + } + } + ] } diff --git a/src/main/resources/assets/bclib/models/block/sided_door_bottom.json b/src/main/resources/assets/bclib/models/block/sided_door_bottom.json index 6fddf595..debe45de 100644 --- a/src/main/resources/assets/bclib/models/block/sided_door_bottom.json +++ b/src/main/resources/assets/bclib/models/block/sided_door_bottom.json @@ -1,18 +1,71 @@ { - "ambientocclusion": false, - "textures": { - "particle": "#facade" - }, - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 3, 16, 16 ], - "faces": { - "down": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, - "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, - "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade", "cullface": "west" }, - "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade" } - } - } - ] + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 3, + 16, + 16 + ], + "faces": { + "down": { + "uv": [ + 13, + 0, + 16, + 16 + ], + "texture": "#side", + "cullface": "down" + }, + "north": { + "uv": [ + 3, + 0, + 0, + 16 + ], + "texture": "#side", + "cullface": "north" + }, + "south": { + "uv": [ + 0, + 0, + 3, + 16 + ], + "texture": "#side", + "cullface": "south" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#facade", + "cullface": "west" + }, + "east": { + "uv": [ + 16, + 0, + 0, + 16 + ], + "texture": "#facade" + } + } + } + ] } diff --git a/src/main/resources/assets/bclib/models/block/sided_door_bottom_rh.json b/src/main/resources/assets/bclib/models/block/sided_door_bottom_rh.json index e6294d19..112dcc5b 100644 --- a/src/main/resources/assets/bclib/models/block/sided_door_bottom_rh.json +++ b/src/main/resources/assets/bclib/models/block/sided_door_bottom_rh.json @@ -1,18 +1,71 @@ { - "ambientocclusion": false, - "textures": { - "particle": "#facade" - }, - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 3, 16, 16 ], - "faces": { - "down": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, - "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, - "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, - "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade", "cullface": "west" }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade" } - } - } - ] + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 3, + 16, + 16 + ], + "faces": { + "down": { + "uv": [ + 13, + 0, + 16, + 16 + ], + "texture": "#side", + "cullface": "down" + }, + "north": { + "uv": [ + 3, + 0, + 0, + 16 + ], + "texture": "#side", + "cullface": "north" + }, + "south": { + "uv": [ + 0, + 0, + 3, + 16 + ], + "texture": "#side", + "cullface": "south" + }, + "west": { + "uv": [ + 16, + 0, + 0, + 16 + ], + "texture": "#facade", + "cullface": "west" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#facade" + } + } + } + ] } diff --git a/src/main/resources/assets/bclib/models/block/sided_door_top.json b/src/main/resources/assets/bclib/models/block/sided_door_top.json index 4a646108..df8005ff 100644 --- a/src/main/resources/assets/bclib/models/block/sided_door_top.json +++ b/src/main/resources/assets/bclib/models/block/sided_door_top.json @@ -1,18 +1,71 @@ { - "ambientocclusion": false, - "textures": { - "particle": "#facade" - }, - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 3, 16, 16 ], - "faces": { - "up": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "up" }, - "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, - "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade", "cullface": "west" }, - "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade" } - } - } - ] + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 3, + 16, + 16 + ], + "faces": { + "up": { + "uv": [ + 13, + 0, + 16, + 16 + ], + "texture": "#side", + "cullface": "up" + }, + "north": { + "uv": [ + 3, + 0, + 0, + 16 + ], + "texture": "#side", + "cullface": "north" + }, + "south": { + "uv": [ + 0, + 0, + 3, + 16 + ], + "texture": "#side", + "cullface": "south" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#facade", + "cullface": "west" + }, + "east": { + "uv": [ + 16, + 0, + 0, + 16 + ], + "texture": "#facade" + } + } + } + ] } diff --git a/src/main/resources/assets/bclib/models/block/sided_door_top_rh.json b/src/main/resources/assets/bclib/models/block/sided_door_top_rh.json index c706fe16..6e564e02 100644 --- a/src/main/resources/assets/bclib/models/block/sided_door_top_rh.json +++ b/src/main/resources/assets/bclib/models/block/sided_door_top_rh.json @@ -1,18 +1,71 @@ { - "ambientocclusion": false, - "textures": { - "particle": "#facade" - }, - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 3, 16, 16 ], - "faces": { - "up": { "uv": [ 13, 0, 16, 16 ], "texture": "#side", "cullface": "up" }, - "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#side", "cullface": "north" }, - "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#side", "cullface": "south" }, - "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#facade", "cullface": "west" }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#facade" } - } - } - ] + "ambientocclusion": false, + "textures": { + "particle": "#facade" + }, + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 3, + 16, + 16 + ], + "faces": { + "up": { + "uv": [ + 13, + 0, + 16, + 16 + ], + "texture": "#side", + "cullface": "up" + }, + "north": { + "uv": [ + 3, + 0, + 0, + 16 + ], + "texture": "#side", + "cullface": "north" + }, + "south": { + "uv": [ + 0, + 0, + 3, + 16 + ], + "texture": "#side", + "cullface": "south" + }, + "west": { + "uv": [ + 16, + 0, + 0, + 16 + ], + "texture": "#facade", + "cullface": "west" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#facade" + } + } + } + ] } diff --git a/src/main/resources/assets/bclib/models/block/sided_trapdoor.json b/src/main/resources/assets/bclib/models/block/sided_trapdoor.json index 9f776427..c6b99a46 100644 --- a/src/main/resources/assets/bclib/models/block/sided_trapdoor.json +++ b/src/main/resources/assets/bclib/models/block/sided_trapdoor.json @@ -1,18 +1,85 @@ -{ "parent": "block/thin_block", - "textures": { - "particle": "#texture" - }, - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 16, 3, 16 ], - "faces": { - "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, - "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, - "north": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "north", "rotation": 90 }, - "south": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "south", "rotation": 90 }, - "west": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "west", "rotation": 90 }, - "east": { "uv": [ 16, 0, 13, 16 ], "texture": "#side", "cullface": "east", "rotation": 90 } - } - } - ] +{ + "parent": "block/thin_block", + "textures": { + "particle": "#texture" + }, + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 3, + 16 + ], + "faces": { + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture", + "cullface": "down" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture" + }, + "north": { + "uv": [ + 16, + 0, + 13, + 16 + ], + "texture": "#side", + "cullface": "north", + "rotation": 90 + }, + "south": { + "uv": [ + 16, + 0, + 13, + 16 + ], + "texture": "#side", + "cullface": "south", + "rotation": 90 + }, + "west": { + "uv": [ + 16, + 0, + 13, + 16 + ], + "texture": "#side", + "cullface": "west", + "rotation": 90 + }, + "east": { + "uv": [ + 16, + 0, + 13, + 16 + ], + "texture": "#side", + "cullface": "east", + "rotation": 90 + } + } + } + ] } diff --git a/src/main/resources/assets/bclib/models/block/tint_cube.json b/src/main/resources/assets/bclib/models/block/tint_cube.json index f65b5c05..a99494bf 100644 --- a/src/main/resources/assets/bclib/models/block/tint_cube.json +++ b/src/main/resources/assets/bclib/models/block/tint_cube.json @@ -3,18 +3,86 @@ "textures": { "particle": "#texture" }, - "elements": [ + "elements": [ { "__comment": "Box1", - "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 16, + 16 + ], "faces": { - "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, - "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "up", "tintindex": 0 }, - "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, - "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture", + "cullface": "down", + "tintindex": 0 + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture", + "cullface": "up", + "tintindex": 0 + }, + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture", + "cullface": "north", + "tintindex": 0 + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture", + "cullface": "south", + "tintindex": 0 + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture", + "cullface": "west", + "tintindex": 0 + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture", + "cullface": "east", + "tintindex": 0 + } } } ] diff --git a/src/main/resources/assets/bclib/patterns/block/anvil.json b/src/main/resources/assets/bclib/patterns/block/anvil.json index 7710c9a1..94bc7a6c 100644 --- a/src/main/resources/assets/bclib/patterns/block/anvil.json +++ b/src/main/resources/assets/bclib/patterns/block/anvil.json @@ -8,61 +8,270 @@ "panel": "%modid%:block/%anvil%_panel", "bottom": "%modid%:block/%anvil%_bottom" }, - "elements": [ + "elements": [ { "__comment": "Bottom", - "from": [ 2, 0, 2 ], - "to": [ 14, 4, 14 ], + "from": [ + 2, + 0, + 2 + ], + "to": [ + 14, + 4, + 14 + ], "faces": { - "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#bottom", "cullface": "down" }, - "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#panel" }, - "north": { "uv": [ 2, 12, 14, 16 ], "texture": "#back" }, - "south": { "uv": [ 2, 12, 14, 16 ], "texture": "#back" }, - "west": { "uv": [ 2, 12, 14, 16 ], "texture": "#front" }, - "east": { "uv": [ 2, 12, 14, 16 ], "texture": "#front" } + "down": { + "uv": [ + 2, + 2, + 14, + 14 + ], + "texture": "#bottom", + "cullface": "down" + }, + "up": { + "uv": [ + 2, + 2, + 14, + 14 + ], + "texture": "#panel" + }, + "north": { + "uv": [ + 2, + 12, + 14, + 16 + ], + "texture": "#back" + }, + "south": { + "uv": [ + 2, + 12, + 14, + 16 + ], + "texture": "#back" + }, + "west": { + "uv": [ + 2, + 12, + 14, + 16 + ], + "texture": "#front" + }, + "east": { + "uv": [ + 2, + 12, + 14, + 16 + ], + "texture": "#front" + } } }, { "__comment": "Plate", - "from": [ 4, 4, 3 ], - "to": [ 12, 5, 13 ], + "from": [ + 4, + 4, + 3 + ], + "to": [ + 12, + 5, + 13 + ], "faces": { - "up": { "uv": [ 4, 3, 12, 13 ], "texture": "#panel" }, - "north": { "uv": [ 4, 11, 12, 12 ], "texture": "#back" }, - "south": { "uv": [ 4, 11, 12, 12 ], "texture": "#back" }, - "west": { "uv": [ 3, 11, 13, 12 ], "texture": "#front" }, - "east": { "uv": [ 3, 11, 13, 12 ], "texture": "#front" } + "up": { + "uv": [ + 4, + 3, + 12, + 13 + ], + "texture": "#panel" + }, + "north": { + "uv": [ + 4, + 11, + 12, + 12 + ], + "texture": "#back" + }, + "south": { + "uv": [ + 4, + 11, + 12, + 12 + ], + "texture": "#back" + }, + "west": { + "uv": [ + 3, + 11, + 13, + 12 + ], + "texture": "#front" + }, + "east": { + "uv": [ + 3, + 11, + 13, + 12 + ], + "texture": "#front" + } } }, { "__comment": "Support", - "from": [ 6, 5, 4 ], - "to": [ 10, 10, 12 ], + "from": [ + 6, + 5, + 4 + ], + "to": [ + 10, + 10, + 12 + ], "faces": { - "north": { "uv": [ 6, 6, 10, 11 ], "texture": "#back" }, - "south": { "uv": [ 6, 6, 10, 11 ], "texture": "#back" }, - "west": { "uv": [ 4, 6, 12, 11 ], "texture": "#front" }, - "east": { "uv": [ 4, 6, 12, 11 ], "texture": "#front" } + "north": { + "uv": [ + 6, + 6, + 10, + 11 + ], + "texture": "#back" + }, + "south": { + "uv": [ + 6, + 6, + 10, + 11 + ], + "texture": "#back" + }, + "west": { + "uv": [ + 4, + 6, + 12, + 11 + ], + "texture": "#front" + }, + "east": { + "uv": [ + 4, + 6, + 12, + 11 + ], + "texture": "#front" + } } }, { "__comment": "Top", - "from": [ 3, 10, 0 ], - "to": [ 13, 16, 16 ], + "from": [ + 3, + 10, + 0 + ], + "to": [ + 13, + 16, + 16 + ], "faces": { - "down": { "uv": [ 3, 0, 13, 16 ], "texture": "#top" }, - "up": { "uv": [ 3, 0, 13, 16 ], "texture": "#top" }, - "north": { "uv": [ 3, 0, 13, 6 ], "texture": "#back" }, - "south": { "uv": [ 3, 0, 13, 6 ], "texture": "#back" }, - "west": { "uv": [ 0, 0, 16, 6 ], "texture": "#front" }, - "east": { "uv": [ 0, 0, 16, 6 ], "texture": "#front" } + "down": { + "uv": [ + 3, + 0, + 13, + 16 + ], + "texture": "#top" + }, + "up": { + "uv": [ + 3, + 0, + 13, + 16 + ], + "texture": "#top" + }, + "north": { + "uv": [ + 3, + 0, + 13, + 6 + ], + "texture": "#back" + }, + "south": { + "uv": [ + 3, + 0, + 13, + 6 + ], + "texture": "#back" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 6 + ], + "texture": "#front" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 6 + ], + "texture": "#front" + } } } ], "display": { "fixed": { - "rotation": [ 0, 90, 0 ], - "scale": [ 0.5, 0.5, 0.5 ] + "rotation": [ + 0, + 90, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] } } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/bars_post.json b/src/main/resources/assets/bclib/patterns/block/bars_post.json index 0dee124c..8ef444bc 100644 --- a/src/main/resources/assets/bclib/patterns/block/bars_post.json +++ b/src/main/resources/assets/bclib/patterns/block/bars_post.json @@ -4,18 +4,76 @@ "top": "%modid%:block/%texture%_top", "particle": "#top" }, - "elements": [ + "elements": [ { "__comment": "Box1", - "from": [ 7, 0, 7 ], - "to": [ 9, 16, 9 ], + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 16, + 9 + ], "faces": { - "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#top", "cullface": "down" }, - "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#top", "cullface": "up" }, - "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" }, - "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" }, - "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" }, - "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#top" } + "down": { + "uv": [ + 7, + 7, + 9, + 9 + ], + "texture": "#top", + "cullface": "down" + }, + "up": { + "uv": [ + 7, + 7, + 9, + 9 + ], + "texture": "#top", + "cullface": "up" + }, + "north": { + "uv": [ + 7, + 0, + 9, + 16 + ], + "texture": "#top" + }, + "south": { + "uv": [ + 7, + 0, + 9, + 16 + ], + "texture": "#top" + }, + "west": { + "uv": [ + 7, + 0, + 9, + 16 + ], + "texture": "#top" + }, + "east": { + "uv": [ + 7, + 0, + 9, + 16 + ], + "texture": "#top" + } } } ] diff --git a/src/main/resources/assets/bclib/patterns/block/bars_side.json b/src/main/resources/assets/bclib/patterns/block/bars_side.json index 44794f8e..c22a18fa 100644 --- a/src/main/resources/assets/bclib/patterns/block/bars_side.json +++ b/src/main/resources/assets/bclib/patterns/block/bars_side.json @@ -5,18 +5,77 @@ "top": "%modid%:block/%texture%_top", "particle": "#side" }, - "elements": [ + "elements": [ { "__comment": "Box1", - "from": [ 7, 0, 0 ], - "to": [ 9, 16, 9 ], + "from": [ + 7, + 0, + 0 + ], + "to": [ + 9, + 16, + 9 + ], "faces": { - "down": { "uv": [ 7, 7, 9, 16 ], "texture": "#top", "cullface": "down" }, - "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#top", "cullface": "up" }, - "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#side", "cullface": "north" }, - "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#side" }, - "west": { "uv": [ 0, 0, 9, 16 ], "texture": "#side" }, - "east": { "uv": [ 7, 0, 16, 16 ], "texture": "#side" } + "down": { + "uv": [ + 7, + 7, + 9, + 16 + ], + "texture": "#top", + "cullface": "down" + }, + "up": { + "uv": [ + 7, + 0, + 9, + 9 + ], + "texture": "#top", + "cullface": "up" + }, + "north": { + "uv": [ + 7, + 0, + 9, + 16 + ], + "texture": "#side", + "cullface": "north" + }, + "south": { + "uv": [ + 7, + 0, + 9, + 16 + ], + "texture": "#side" + }, + "west": { + "uv": [ + 0, + 0, + 9, + 16 + ], + "texture": "#side" + }, + "east": { + "uv": [ + 7, + 0, + 16, + 16 + ], + "texture": "#side" + } } } ] diff --git a/src/main/resources/assets/bclib/patterns/block/block.json b/src/main/resources/assets/bclib/patterns/block/block.json index 431bc5cf..b827a128 100644 --- a/src/main/resources/assets/bclib/patterns/block/block.json +++ b/src/main/resources/assets/bclib/patterns/block/block.json @@ -1,6 +1,6 @@ { - "parent": "block/cube_all", - "textures": { - "all": "%modid%:block/%texture%" - } + "parent": "block/cube_all", + "textures": { + "all": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/button.json b/src/main/resources/assets/bclib/patterns/block/button.json index e09625cd..14a6c8f2 100644 --- a/src/main/resources/assets/bclib/patterns/block/button.json +++ b/src/main/resources/assets/bclib/patterns/block/button.json @@ -1,6 +1,6 @@ { - "parent": "block/button", - "textures": { - "texture": "%modid%:block/%texture%" - } + "parent": "block/button", + "textures": { + "texture": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/button_pressed.json b/src/main/resources/assets/bclib/patterns/block/button_pressed.json index dfe04d40..23c89dd8 100644 --- a/src/main/resources/assets/bclib/patterns/block/button_pressed.json +++ b/src/main/resources/assets/bclib/patterns/block/button_pressed.json @@ -1,6 +1,6 @@ { - "parent": "block/button_pressed", - "textures": { - "texture": "%modid%:block/%texture%" - } + "parent": "block/button_pressed", + "textures": { + "texture": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/composter.json b/src/main/resources/assets/bclib/patterns/block/composter.json index cddf7792..82fb4e2a 100644 --- a/src/main/resources/assets/bclib/patterns/block/composter.json +++ b/src/main/resources/assets/bclib/patterns/block/composter.json @@ -9,51 +9,145 @@ }, "elements": [ { - "from": [ 0, 0, 0 ], - "to": [ 16, 2, 16 ], + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 2, + 16 + ], "faces": { - "up": { "texture": "#inside", "cullface": "up" }, - "down": { "texture": "#bottom", "cullface": "down" } + "up": { + "texture": "#inside", + "cullface": "up" + }, + "down": { + "texture": "#bottom", + "cullface": "down" + } } }, { - "from": [ 0, 0, 0 ], - "to": [ 2, 16, 16 ], + "from": [ + 0, + 0, + 0 + ], + "to": [ + 2, + 16, + 16 + ], "faces": { - "up": { "texture": "#top", "cullface": "up" }, - "north": { "texture": "#side", "cullface": "north" }, - "south": { "texture": "#side", "cullface": "south" }, - "west": { "texture": "#side", "cullface": "west" }, - "east": { "texture": "#side", "cullface": "up" } + "up": { + "texture": "#top", + "cullface": "up" + }, + "north": { + "texture": "#side", + "cullface": "north" + }, + "south": { + "texture": "#side", + "cullface": "south" + }, + "west": { + "texture": "#side", + "cullface": "west" + }, + "east": { + "texture": "#side", + "cullface": "up" + } } }, { - "from": [ 14, 0, 0 ], - "to": [ 16, 16, 16 ], + "from": [ + 14, + 0, + 0 + ], + "to": [ + 16, + 16, + 16 + ], "faces": { - "up": { "texture": "#top", "cullface": "up" }, - "north": { "texture": "#side", "cullface": "north" }, - "south": { "texture": "#side", "cullface": "south" }, - "west": { "texture": "#side", "cullface": "up" }, - "east": { "texture": "#side", "cullface": "east" } + "up": { + "texture": "#top", + "cullface": "up" + }, + "north": { + "texture": "#side", + "cullface": "north" + }, + "south": { + "texture": "#side", + "cullface": "south" + }, + "west": { + "texture": "#side", + "cullface": "up" + }, + "east": { + "texture": "#side", + "cullface": "east" + } } }, { - "from": [ 2, 0, 0 ], - "to": [ 14, 16, 2 ], + "from": [ + 2, + 0, + 0 + ], + "to": [ + 14, + 16, + 2 + ], "faces": { - "up": { "texture": "#top", "cullface": "up" }, - "north": { "texture": "#side", "cullface": "north" }, - "south": { "texture": "#side", "cullface": "up" } + "up": { + "texture": "#top", + "cullface": "up" + }, + "north": { + "texture": "#side", + "cullface": "north" + }, + "south": { + "texture": "#side", + "cullface": "up" + } } }, { - "from": [ 2, 0, 14 ], - "to": [ 14, 16, 16 ], + "from": [ + 2, + 0, + 14 + ], + "to": [ + 14, + 16, + 16 + ], "faces": { - "up": { "texture": "#top", "cullface": "up" }, - "north": { "texture": "#side", "cullface": "up" }, - "south": { "texture": "#side", "cullface": "south" } + "up": { + "texture": "#top", + "cullface": "up" + }, + "north": { + "texture": "#side", + "cullface": "up" + }, + "south": { + "texture": "#side", + "cullface": "south" + } } } ] diff --git a/src/main/resources/assets/bclib/patterns/block/cross_shaded.json b/src/main/resources/assets/bclib/patterns/block/cross_shaded.json index 1db00d86..421f42bd 100644 --- a/src/main/resources/assets/bclib/patterns/block/cross_shaded.json +++ b/src/main/resources/assets/bclib/patterns/block/cross_shaded.json @@ -5,20 +5,88 @@ "particle": "#cross" }, "elements": [ - { "from": [ 0.8, 0, 8 ], - "to": [ 15.2, 16, 8 ], - "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + { + "from": [ + 0.8, + 0, + 8 + ], + "to": [ + 15.2, + 16, + 8 + ], + "rotation": { + "origin": [ + 8, + 8, + 8 + ], + "axis": "y", + "angle": 45, + "rescale": true + }, "faces": { - "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }, - "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" } + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cross" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cross" + } } }, - { "from": [ 8, 0, 0.8 ], - "to": [ 8, 16, 15.2 ], - "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + { + "from": [ + 8, + 0, + 0.8 + ], + "to": [ + 8, + 16, + 15.2 + ], + "rotation": { + "origin": [ + 8, + 8, + 8 + ], + "axis": "y", + "angle": 45, + "rescale": true + }, "faces": { - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" } + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cross" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cross" + } } } ] diff --git a/src/main/resources/assets/bclib/patterns/block/furnace_glow.json b/src/main/resources/assets/bclib/patterns/block/furnace_glow.json index caa5ffdc..12b059a5 100644 --- a/src/main/resources/assets/bclib/patterns/block/furnace_glow.json +++ b/src/main/resources/assets/bclib/patterns/block/furnace_glow.json @@ -8,30 +8,79 @@ }, "display": { "firstperson_righthand": { - "rotation": [ 0, 135, 0 ], - "translation": [ 0, 0, 0 ], - "scale": [ 0.40, 0.40, 0.40 ] + "rotation": [ + 0, + 135, + 0 + ], + "translation": [ + 0, + 0, + 0 + ], + "scale": [ + 0.40, + 0.40, + 0.40 + ] } }, "elements": [ { - "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 16, + 16 + ], "faces": { - "down": { "texture": "#top", "cullface": "down" }, - "up": { "texture": "#top", "cullface": "up" }, - "north": { "texture": "#front", "cullface": "north" }, - "south": { "texture": "#side", "cullface": "south" }, - "west": { "texture": "#side", "cullface": "west" }, - "east": { "texture": "#side", "cullface": "east" } + "down": { + "texture": "#top", + "cullface": "down" + }, + "up": { + "texture": "#top", + "cullface": "up" + }, + "north": { + "texture": "#front", + "cullface": "north" + }, + "south": { + "texture": "#side", + "cullface": "south" + }, + "west": { + "texture": "#side", + "cullface": "west" + }, + "east": { + "texture": "#side", + "cullface": "east" + } } }, { - "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 16, + 16 + ], "shade": false, "faces": { - "north": { "texture": "#glow", "cullface": "north" } + "north": { + "texture": "#glow", + "cullface": "north" + } } } ] diff --git a/src/main/resources/assets/bclib/patterns/block/path.json b/src/main/resources/assets/bclib/patterns/block/path.json index 347121bb..d73787a0 100644 --- a/src/main/resources/assets/bclib/patterns/block/path.json +++ b/src/main/resources/assets/bclib/patterns/block/path.json @@ -1,7 +1,8 @@ -{ "parent": "bclib:block/path", - "textures": { - "top": "%modid%:block/%top%", - "side": "%modid%:block/%side%", - "bottom": "%bottom%" - } +{ + "parent": "bclib:block/path", + "textures": { + "top": "%modid%:block/%top%", + "side": "%modid%:block/%side%", + "bottom": "%bottom%" + } } diff --git a/src/main/resources/assets/bclib/patterns/block/pressure_plate_down.json b/src/main/resources/assets/bclib/patterns/block/pressure_plate_down.json index 60147e84..7de574bb 100644 --- a/src/main/resources/assets/bclib/patterns/block/pressure_plate_down.json +++ b/src/main/resources/assets/bclib/patterns/block/pressure_plate_down.json @@ -1,6 +1,6 @@ { - "parent": "block/pressure_plate_down", - "textures": { - "texture": "%modid%:block/%texture%" - } + "parent": "block/pressure_plate_down", + "textures": { + "texture": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/pressure_plate_up.json b/src/main/resources/assets/bclib/patterns/block/pressure_plate_up.json index 66c028a3..274d36ba 100644 --- a/src/main/resources/assets/bclib/patterns/block/pressure_plate_up.json +++ b/src/main/resources/assets/bclib/patterns/block/pressure_plate_up.json @@ -1,6 +1,6 @@ { - "parent": "block/pressure_plate_up", - "textures": { - "texture": "%modid%:block/%texture%" - } + "parent": "block/pressure_plate_up", + "textures": { + "texture": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/slab.json b/src/main/resources/assets/bclib/patterns/block/slab.json index 7012e909..02fb5d29 100644 --- a/src/main/resources/assets/bclib/patterns/block/slab.json +++ b/src/main/resources/assets/bclib/patterns/block/slab.json @@ -1,8 +1,8 @@ { - "parent": "block/slab", - "textures": { - "bottom": "%modid%:block/%texture%", - "side": "%modid%:block/%texture%", - "top": "%modid%:block/%texture%" - } + "parent": "block/slab", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/stairs.json b/src/main/resources/assets/bclib/patterns/block/stairs.json index af694555..6db6d51b 100644 --- a/src/main/resources/assets/bclib/patterns/block/stairs.json +++ b/src/main/resources/assets/bclib/patterns/block/stairs.json @@ -1,8 +1,8 @@ { - "parent": "block/stairs", - "textures": { - "bottom": "%modid%:block/%texture%", - "side": "%modid%:block/%texture%", - "top": "%modid%:block/%texture%" - } + "parent": "block/stairs", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/stairs_inner.json b/src/main/resources/assets/bclib/patterns/block/stairs_inner.json index 30b7d9bf..4f9f2f9d 100644 --- a/src/main/resources/assets/bclib/patterns/block/stairs_inner.json +++ b/src/main/resources/assets/bclib/patterns/block/stairs_inner.json @@ -1,8 +1,8 @@ { - "parent": "block/inner_stairs", - "textures": { - "bottom": "%modid%:block/%texture%", - "side": "%modid%:block/%texture%", - "top": "%modid%:block/%texture%" - } + "parent": "block/inner_stairs", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/stairs_outer.json b/src/main/resources/assets/bclib/patterns/block/stairs_outer.json index 3544d10f..fa54a797 100644 --- a/src/main/resources/assets/bclib/patterns/block/stairs_outer.json +++ b/src/main/resources/assets/bclib/patterns/block/stairs_outer.json @@ -1,8 +1,8 @@ { - "parent": "block/outer_stairs", - "textures": { - "bottom": "%modid%:block/%texture%", - "side": "%modid%:block/%texture%", - "top": "%modid%:block/%texture%" - } + "parent": "block/outer_stairs", + "textures": { + "bottom": "%modid%:block/%texture%", + "side": "%modid%:block/%texture%", + "top": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/wall_inventory.json b/src/main/resources/assets/bclib/patterns/block/wall_inventory.json index 85d64810..c6c852ad 100644 --- a/src/main/resources/assets/bclib/patterns/block/wall_inventory.json +++ b/src/main/resources/assets/bclib/patterns/block/wall_inventory.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_inventory", - "textures": { - "wall": "%modid%:block/%texture%" - } + "parent": "block/wall_inventory", + "textures": { + "wall": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/wall_post.json b/src/main/resources/assets/bclib/patterns/block/wall_post.json index 466b91eb..a4f1819d 100644 --- a/src/main/resources/assets/bclib/patterns/block/wall_post.json +++ b/src/main/resources/assets/bclib/patterns/block/wall_post.json @@ -1,6 +1,6 @@ { - "parent": "block/template_wall_post", - "textures": { - "wall": "%modid%:block/%texture%" - } + "parent": "block/template_wall_post", + "textures": { + "wall": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/wall_side.json b/src/main/resources/assets/bclib/patterns/block/wall_side.json index e93fd118..e44d462a 100644 --- a/src/main/resources/assets/bclib/patterns/block/wall_side.json +++ b/src/main/resources/assets/bclib/patterns/block/wall_side.json @@ -1,6 +1,6 @@ { - "parent": "block/template_wall_side", - "textures": { - "wall": "%modid%:block/%texture%" - } + "parent": "block/template_wall_side", + "textures": { + "wall": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/block/wall_side_tall.json b/src/main/resources/assets/bclib/patterns/block/wall_side_tall.json index 86451081..69e4647d 100644 --- a/src/main/resources/assets/bclib/patterns/block/wall_side_tall.json +++ b/src/main/resources/assets/bclib/patterns/block/wall_side_tall.json @@ -1,6 +1,6 @@ { - "parent": "block/template_wall_side_tall", - "textures": { - "wall": "%modid%:block/%texture%" - } + "parent": "block/template_wall_side_tall", + "textures": { + "wall": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_button.json b/src/main/resources/assets/bclib/patterns/item/pattern_button.json index 7cc6b6e0..ceacffba 100644 --- a/src/main/resources/assets/bclib/patterns/item/pattern_button.json +++ b/src/main/resources/assets/bclib/patterns/item/pattern_button.json @@ -1,6 +1,6 @@ { - "parent": "block/button_inventory", - "textures": { - "texture": "%modid%:block/%texture%" - } + "parent": "block/button_inventory", + "textures": { + "texture": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_item_spawn_egg.json b/src/main/resources/assets/bclib/patterns/item/pattern_item_spawn_egg.json index 765225c9..debcb565 100644 --- a/src/main/resources/assets/bclib/patterns/item/pattern_item_spawn_egg.json +++ b/src/main/resources/assets/bclib/patterns/item/pattern_item_spawn_egg.json @@ -1,3 +1,3 @@ { - "parent": "item/template_spawn_egg" + "parent": "item/template_spawn_egg" } diff --git a/src/main/resources/assets/bclib/patterns/item/pattern_wall.json b/src/main/resources/assets/bclib/patterns/item/pattern_wall.json index 85d64810..c6c852ad 100644 --- a/src/main/resources/assets/bclib/patterns/item/pattern_wall.json +++ b/src/main/resources/assets/bclib/patterns/item/pattern_wall.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_inventory", - "textures": { - "wall": "%modid%:block/%texture%" - } + "parent": "block/wall_inventory", + "textures": { + "wall": "%modid%:block/%texture%" + } } \ No newline at end of file diff --git a/src/main/resources/bclib.mixins.client.json b/src/main/resources/bclib.mixins.client.json index 689cb36b..267fb2fb 100644 --- a/src/main/resources/bclib.mixins.client.json +++ b/src/main/resources/bclib.mixins.client.json @@ -7,7 +7,7 @@ "EnchantingTableBlockMixin", "BackgroundRendererMixin", "TextureAtlasMixin", - "ModelBakeryMixin", + "ModelBakeryMixin", "MinecraftMixin" ], "injectors": { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 6d8a5cb6..01ea9f48 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "bclib", "version": "${version}", - "name": "BCLib", "description": "A library for BetterX team mods", "authors": [ @@ -14,10 +13,8 @@ "issues": "https://github.com/paulevsGitch/bclib/issues", "sources": "https://github.com/paulevsGitch/bclib" }, - "license": "MIT", "icon": "assets/bclib/icon.png", - "environment": "*", "entrypoints": { "main": [ @@ -34,7 +31,6 @@ "bclib.mixins.common.json", "bclib.mixins.client.json" ], - "depends": { "fabricloader": ">=0.11.6", "fabric": ">=0.36.0",