Candle Block Implementation

~~~~~~~~~~~~~
- Implemented the Candle Block
~~~~~~~~~~~~~
"No; I haven't fixed the bounding box yet. Yes; I'm going to fix it later." - Zenith
This commit is contained in:
Zenith
2022-08-12 21:55:46 +08:00
parent 20454e6d0a
commit 5d3f72ca7c
33 changed files with 672 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ minecraft {
dependencies {
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
compileOnly("me.hypherionmc.craterlib:CraterLib-common-1.19.1:${craterlib_version}")
compileOnly("com.lowdragmc.shimmer:Shimmer-common-1.19.1:${shimmer_version}")
}
processResources {

View File

@@ -7,6 +7,7 @@ import me.hypherionmc.craterlib.events.CraterEventBus;
import me.hypherionmc.craterlib.platform.Services;
import me.hypherionmc.hyperlighting.common.init.HLBlocks;
import me.hypherionmc.hyperlighting.common.init.HLItems;
import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
/**
@@ -17,6 +18,7 @@ public class ClientRegistration {
public void registerAll() {
Services.CLIENT_HELPER.registerCustomRenderTypes(HLBlocks.BLOCKS.getEntries(), HLItems.ITEMS.getEntries());
HyperLightingIntegrations.registerClient();
}
public void registerEvents() {

View File

@@ -0,0 +1,217 @@
package me.hypherionmc.hyperlighting.common.blocks;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import me.hypherionmc.craterlib.api.rendering.DyableBlock;
import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.util.BlockStateUtils;
import me.hypherionmc.craterlib.util.RenderUtils;
import me.hypherionmc.hyperlighting.api.LightableBlock;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import me.hypherionmc.hyperlighting.common.init.FlameParticles;
import me.hypherionmc.hyperlighting.common.init.HLItems;
import me.hypherionmc.hyperlighting.common.init.HLSounds;
import me.hypherionmc.hyperlighting.util.StackUtil;
import net.minecraft.ChatFormatting;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.*;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.AttachFace;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Map;
public class AdvancedCandleBlock extends HorizontalDirectionalBlock implements DyableBlock, LightableBlock {
//region Properties
public static final BooleanProperty LIT = BlockStateProperties.LIT;
public static final EnumProperty<DyeColor> COLOR = EnumProperty.create("color", DyeColor.class);
public static final EnumProperty<AttachFace> ATTACH_FACE = EnumProperty.create("face", AttachFace.class, AttachFace.FLOOR, AttachFace.WALL);
//endregion
//region Bounding Boxes
private static final Map<Direction, VoxelShape> SHAPES = Maps.newEnumMap(
ImmutableMap.of(
Direction.NORTH, Block.box(5.5D, 2.0D, 11.0D, 10.5D, 12.0D, 16.0D),
Direction.SOUTH, Block.box(5.5D, 2.0D, 0.0D, 10.5D, 12.0D, 5.0D),
Direction.WEST, Block.box(11.0D, 2.0D, 5.5D, 16.0D, 12.0D, 10.5D),
Direction.EAST, Block.box(0.0D, 2.0D, 5.5D, 5.0D, 12.0D, 10.5D),
Direction.UP, Block.box(6.0D, 0.0D, 6.0D, 10.0D, 10.0D, 10.0D)
)
);
//endregion
private DyeColor color;
public AdvancedCandleBlock(String name, DyeColor color, CreativeModeTab tab) {
super(Properties.of(Material.WOOD).noCollission().instabreak().lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(15)));
this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(LIT, CommonRegistration.config.torchConfig.litByDefault).setValue(COLOR, color));
this.color = color;
HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties().tab(tab)));
}
@Override
public VoxelShape getShape(BlockState blockState, BlockGetter level, BlockPos pos, CollisionContext context) {
return switch (blockState.getValue(ATTACH_FACE)) {
case FLOOR -> SHAPES.get(Direction.UP);
case WALL -> SHAPES.get(blockState.getValue(FACING));
case CEILING -> null;
};
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(LIT, ATTACH_FACE, FACING, COLOR);
super.createBlockStateDefinition(builder);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
Direction direction = context.getClickedFace();
BlockState state = this.defaultBlockState();
if (direction == Direction.UP) {
state = state.setValue(ATTACH_FACE, AttachFace.FLOOR);
} else {
state = state.setValue(ATTACH_FACE, AttachFace.WALL).setValue(FACING, direction);
}
return state.setValue(LIT, CommonRegistration.config.torchConfig.litByDefault);
}
@Override
public BlockState updateShape(BlockState stateIn, Direction facing, BlockState neighbourState, LevelAccessor levelIn, BlockPos currentPos, BlockPos newPos) {
if (facing == Direction.DOWN && !this.isValidPosition(stateIn, levelIn, currentPos, facing)) {
return Blocks.AIR.defaultBlockState();
}
return super.updateShape(stateIn, facing, neighbourState, levelIn, currentPos, newPos);
}
public boolean isValidPosition(BlockState state, LevelAccessor levelAccessor, BlockPos pos, Direction direction) {
return canSupportCenter(levelAccessor, pos, direction);
}
@Override
public void toggleLight(Level worldIn, BlockState state, BlockPos pos) {
state = state.setValue(LIT, !state.getValue(LIT));
worldIn.setBlock(pos, state, 2);
if (!state.getValue(LIT)) {
worldIn.playSound(null, pos, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 1.0f);
} else {
worldIn.playSound(null, pos, HLSounds.TORCH_IGNITE.get(), SoundSource.BLOCKS, 0.3f, 1.0f);
}
worldIn.blockUpdated(pos, this);
}
@Override
public BlockColor dyeHandler() {
return ((blockState, blockAndTintGetter, blockPos, i) -> {
if (blockState.getValue(LIT)) {
return RenderUtils.renderColorFromDye(blockState.getValue(COLOR));
} else {
return RenderUtils.renderColorFromDye(DyeColor.BLACK);
}
});
}
@Override
public DyeColor defaultDyeColor() {
return this.defaultBlockState().getValue(COLOR);
}
/** Check if player clicked the block with DYE and apply Color Tint **/
@Override
public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
if (!level.isClientSide()) {
if (!player.getItemInHand(handIn).isEmpty() && player.getItemInHand(handIn).getItem() instanceof DyeItem dyeItem) {
state = state.setValue(COLOR, dyeItem.getDyeColor());
this.color = dyeItem.getDyeColor();
level.setBlock(pos, state, 3);
level.sendBlockUpdated(pos, state, state, 3);
if (!player.isCreative()) {
ItemStack stack = player.getItemInHand(handIn);
stack.shrink(1);
player.setItemInHand(handIn, stack);
}
return InteractionResult.CONSUME;
} else if (!CommonRegistration.config.torchConfig.requiresTool) {
state = state.cycle(LIT);
level.setBlock(pos, state, 3);
level.sendBlockUpdated(pos, state, state, 3);
if (!state.getValue(LIT)) {
level.playSound(null, pos, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 1.0f);
} else {
level.playSound(null, pos, HLSounds.TORCH_IGNITE.get(), SoundSource.BLOCKS, 0.3f, 1.0f);
}
return InteractionResult.CONSUME;
}
}
return InteractionResult.PASS;
}
@Override
public void appendHoverText(ItemStack stack, BlockGetter level, List<Component> tooltip, TooltipFlag options) {
tooltip.add(Component.literal(ChatFormatting.YELLOW + "Dyable"));
tooltip.add(Component.literal(ChatFormatting.GREEN + "Color: " + color.getName()));
super.appendHoverText(stack, level, tooltip, options);
}
@Override
public void animateTick(BlockState stateIn, Level levelIn, BlockPos pos, RandomSource random) {
if (stateIn.getValue(LIT)) {
DyeColor color = stateIn.getValue(COLOR);
if (stateIn.getValue(ATTACH_FACE) == AttachFace.FLOOR) {
double d0 = (double) pos.getX() + 0.5D;
double d1 = (double) pos.getY() + 0.7D;
double d2 = (double) pos.getZ() + 0.5D;
levelIn.addParticle(ParticleTypes.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D);
levelIn.addParticle(FlameParticles.getParticleByColor(color).get(), d0, d1, d2, 0D, 0D, 0D);
} else {
Direction direction = stateIn.getValue(FACING);
double d0 = (double) pos.getX() + 0.5D;
double d1 = (double) pos.getY() + 0.7D;
double d2 = (double) pos.getZ() + 0.5D;
Direction direction1 = direction.getOpposite();
levelIn.addParticle(ParticleTypes.SMOKE, d0 + 0.37D * (double) direction1.getStepX(), d1 + 0.15D, d2 + 0.37D * (double) direction1.getStepZ(), 0.0D, 0.0D, 0.0D);
levelIn.addParticle(FlameParticles.getParticleByColor(color).get(), d0 + 0.37D * (double) direction1.getStepX(), d1 + 0.15D, d2 + 0.37D * (double) direction1.getStepZ(), 0D, 0D, 0D);
}
}
}
@Override
public @NotNull ItemStack getCloneItemStack(@NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull BlockState state) {
return StackUtil.getColorStack(this, state.getValue(COLOR));
}
@Override
public List<ItemStack> getDrops(BlockState blockState, LootContext.Builder lootBuilder) {
return List.of(StackUtil.getColorStack(this, blockState.getValue(COLOR)));
}
}

View File

@@ -19,6 +19,11 @@ public class HyperLightingConfig extends ModuleConfig {
@SubConfig
public LanternConfig lanternConfig = new LanternConfig();
@Path("candleConfig")
@SpecComment("Candle Configuration")
@SubConfig
public CandleConfig candleConfig = new CandleConfig();
public HyperLightingConfig() {
super(Constants.MOD_ID, "hyperlighting-common");
registerAndSetup(this);
@@ -48,4 +53,14 @@ public class HyperLightingConfig extends ModuleConfig {
@SpecComment("Is the Torch Lighter tool needed to light Lanterns")
public boolean requiresTool = true;
}
public static class CandleConfig {
@Path("litByDefault")
@SpecComment("Should Candles be lit by default when placed")
public boolean litByDefault = false;
@Path("requiresTool")
@SpecComment("Is the Torch Lighter tool needed to light Candles")
public boolean requiresTool = true;
}
}

View File

@@ -2,6 +2,7 @@ package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.client.gui.tabs.CreativeTabBuilder;
import me.hypherionmc.hyperlighting.common.config.HyperLightingConfig;
import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
@@ -18,6 +19,7 @@ public class CommonRegistration {
HLBlocks.loadAll();
HLItems.loadAll();
HLEntities.loadAll();
HyperLightingIntegrations.registerCommon();
}
}

View File

@@ -3,6 +3,7 @@ package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.systems.reg.BlockRegistryObject;
import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedCandleBlock;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedLanternBlock;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedTorchBlock;
import net.minecraft.core.Registry;
@@ -21,6 +22,10 @@ public class HLBlocks {
/* Lanterns */
public static BlockRegistryObject<Block> ADVANCED_LANTERN = register("advanced_lantern", () -> new AdvancedLanternBlock("advanced_lantern", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB));
/* Candles */
public static BlockRegistryObject<Block> ADVANCED_CANDLE = register("advanced_candle", () -> new AdvancedCandleBlock("advanced_candle", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB));
public static void loadAll() {}
public static <B extends Block> BlockRegistryObject<B> register(String name, Supplier<? extends B> block) {

View File

@@ -0,0 +1,22 @@
package me.hypherionmc.hyperlighting.integration;
import me.hypherionmc.craterlib.platform.Services;
import me.hypherionmc.hyperlighting.integration.shimmer.HyperLightingShimmer;
/**
* @author HypherionSA
* @date 07/08/2022
*/
public class HyperLightingIntegrations {
public static void registerCommon() {
}
public static void registerClient() {
if (Services.PLATFORM.isModLoaded("shimmer")) {
HyperLightingShimmer.registerAll();
}
}
}

View File

@@ -0,0 +1,46 @@
package me.hypherionmc.hyperlighting.integration.shimmer;
import com.lowdragmc.shimmer.client.light.ColorPointLight;
import com.lowdragmc.shimmer.client.light.LightManager;
import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.util.RenderUtils;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedLanternBlock;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedTorchBlock;
import me.hypherionmc.hyperlighting.common.init.HLBlocks;
import net.minecraft.world.item.DyeColor;
/**
* @author HypherionSA
* @date 07/08/2022
*/
public class HyperLightingShimmer {
public static void registerAll() {
registerBlocks();
registerItems();
}
private static void registerItems() {
LightManager.INSTANCE.registerItemLight(HLBlocks.ADVANCED_TORCH.asItem(), stack -> new ColorPointLight.Template(stack.getCount() / 10 + 6, RenderUtils.alphaColorFromDye(((BlockItemDyable)stack.getItem()).getColor(stack), 1f)));
LightManager.INSTANCE.registerItemLight(HLBlocks.ADVANCED_LANTERN.asItem(), stack -> new ColorPointLight.Template(stack.getCount() / 10 + 6, RenderUtils.alphaColorFromDye(((BlockItemDyable)stack.getItem()).getColor(stack), 1f)));
}
private static void registerBlocks() {
LightManager.INSTANCE.registerBlockLight(HLBlocks.ADVANCED_TORCH.get(), (state, blockPos) -> {
if (state.getValue(AdvancedTorchBlock.LIT)) {
DyeColor color = state.getValue(AdvancedTorchBlock.COLOR);
return new ColorPointLight.Template(10, RenderUtils.alphaColorFromDye(color, 1f));
}
return null;
});
LightManager.INSTANCE.registerBlockLight(HLBlocks.ADVANCED_LANTERN.get(), (state, blockPos) -> {
if (state.getValue(AdvancedLanternBlock.LIT)) {
DyeColor color = state.getValue(AdvancedLanternBlock.COLOR);
return new ColorPointLight.Template(10, RenderUtils.alphaColorFromDye(color, 1f));
}
return null;
});
}
}

View File

@@ -0,0 +1,163 @@
{
"variants": {
"facing=up,lit=true,color=white": {"model": "hyperlighting:block/candle/white_candle"},
"facing=up,lit=false,color=white": {"model": "hyperlighting:block/candle/white_candle"},
"facing=east,lit=true,color=white": {"model": "hyperlighting:block/candle/white_candle"},
"facing=east,lit=false,color=white": {"model": "hyperlighting:block/candle/white_candle"},
"facing=south,lit=true,color=white": {"model": "hyperlighting:block/candle/white_candle", "y": 90},
"facing=south,lit=false,color=white": {"model": "hyperlighting:block/candle/white_candle", "y": 90},
"facing=west,lit=true,color=white": {"model": "hyperlighting:block/candle/white_candle", "y": 180},
"facing=west,lit=false,color=white": {"model": "hyperlighting:block/candle/white_candle", "y": 180},
"facing=north,lit=true,color=white": {"model": "hyperlighting:block/candle/white_candle", "y": 270},
"facing=north,lit=false,color=white": {"model": "hyperlighting:block/candle/white_candle", "y": 270},
"facing=up,lit=true,color=orange": {"model": "hyperlighting:block/candle/orange_candle"},
"facing=up,lit=false,color=orange": {"model": "hyperlighting:block/candle/orange_candle"},
"facing=east,lit=true,color=orange": {"model": "hyperlighting:block/candle/orange_candle"},
"facing=east,lit=false,color=orange": {"model": "hyperlighting:block/candle/orange_candle"},
"facing=south,lit=true,color=orange": {"model": "hyperlighting:block/candle/orange_candle", "y": 90},
"facing=south,lit=false,color=orange": {"model": "hyperlighting:block/candle/orange_candle", "y": 90},
"facing=west,lit=true,color=orange": {"model": "hyperlighting:block/candle/orange_candle", "y": 180},
"facing=west,lit=false,color=orange": {"model": "hyperlighting:block/candle/orange_candle", "y": 180},
"facing=north,lit=true,color=orange": {"model": "hyperlighting:block/candle/orange_candle", "y": 270},
"facing=north,lit=false,color=orange": {"model": "hyperlighting:block/candle/orange_candle", "y": 270},
"facing=up,lit=true,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle"},
"facing=up,lit=false,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle"},
"facing=east,lit=true,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle"},
"facing=east,lit=false,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle"},
"facing=south,lit=true,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle", "y": 90},
"facing=south,lit=false,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle", "y": 90},
"facing=west,lit=true,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle", "y": 180},
"facing=west,lit=false,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle", "y": 180},
"facing=north,lit=true,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle", "y": 270},
"facing=north,lit=false,color=magenta": {"model": "hyperlighting:block/candle/magenta_candle", "y": 270},
"facing=up,lit=true,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle"},
"facing=up,lit=false,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle"},
"facing=east,lit=true,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle"},
"facing=east,lit=false,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle"},
"facing=south,lit=true,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle", "y": 90},
"facing=south,lit=false,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle", "y": 90},
"facing=west,lit=true,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle", "y": 180},
"facing=west,lit=false,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle", "y": 180},
"facing=north,lit=true,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle", "y": 270},
"facing=north,lit=false,color=light_blue": {"model": "hyperlighting:block/candle/light_blue_candle", "y": 270},
"facing=up,lit=true,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle"},
"facing=up,lit=false,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle"},
"facing=east,lit=true,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle"},
"facing=east,lit=false,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle"},
"facing=south,lit=true,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle", "y": 90},
"facing=south,lit=false,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle", "y": 90},
"facing=west,lit=true,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle", "y": 180},
"facing=west,lit=false,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle", "y": 180},
"facing=north,lit=true,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle", "y": 270},
"facing=north,lit=false,color=yellow": {"model": "hyperlighting:block/candle/yellow_candle", "y": 270},
"facing=up,lit=true,color=lime": {"model": "hyperlighting:block/candle/lime_candle"},
"facing=up,lit=false,color=lime": {"model": "hyperlighting:block/candle/lime_candle"},
"facing=east,lit=true,color=lime": {"model": "hyperlighting:block/candle/lime_candle"},
"facing=east,lit=false,color=lime": {"model": "hyperlighting:block/candle/lime_candle"},
"facing=south,lit=true,color=lime": {"model": "hyperlighting:block/candle/lime_candle", "y": 90},
"facing=south,lit=false,color=lime": {"model": "hyperlighting:block/candle/lime_candle", "y": 90},
"facing=west,lit=true,color=lime": {"model": "hyperlighting:block/candle/lime_candle", "y": 180},
"facing=west,lit=false,color=lime": {"model": "hyperlighting:block/candle/lime_candle", "y": 180},
"facing=north,lit=true,color=lime": {"model": "hyperlighting:block/candle/lime_candle", "y": 270},
"facing=north,lit=false,color=lime": {"model": "hyperlighting:block/candle/lime_candle", "y": 270},
"facing=up,lit=true,color=pink": {"model": "hyperlighting:block/candle/pink_candle"},
"facing=up,lit=false,color=pink": {"model": "hyperlighting:block/candle/pink_candle"},
"facing=east,lit=true,color=pink": {"model": "hyperlighting:block/candle/pink_candle"},
"facing=east,lit=false,color=pink": {"model": "hyperlighting:block/candle/pink_candle"},
"facing=south,lit=true,color=pink": {"model": "hyperlighting:block/candle/pink_candle", "y": 90},
"facing=south,lit=false,color=pink": {"model": "hyperlighting:block/candle/pink_candle", "y": 90},
"facing=west,lit=true,color=pink": {"model": "hyperlighting:block/candle/pink_candle", "y": 180},
"facing=west,lit=false,color=pink": {"model": "hyperlighting:block/candle/pink_candle", "y": 180},
"facing=north,lit=true,color=pink": {"model": "hyperlighting:block/candle/pink_candle", "y": 270},
"facing=north,lit=false,color=pink": {"model": "hyperlighting:block/candle/pink_candle", "y": 270},
"facing=up,lit=true,color=gray": {"model": "hyperlighting:block/candle/gray_candle"},
"facing=up,lit=false,color=gray": {"model": "hyperlighting:block/candle/gray_candle"},
"facing=east,lit=true,color=gray": {"model": "hyperlighting:block/candle/gray_candle"},
"facing=east,lit=false,color=gray": {"model": "hyperlighting:block/candle/gray_candle"},
"facing=south,lit=true,color=gray": {"model": "hyperlighting:block/candle/gray_candle", "y": 90},
"facing=south,lit=false,color=gray": {"model": "hyperlighting:block/candle/gray_candle", "y": 90},
"facing=west,lit=true,color=gray": {"model": "hyperlighting:block/candle/gray_candle", "y": 180},
"facing=west,lit=false,color=gray": {"model": "hyperlighting:block/candle/gray_candle", "y": 180},
"facing=north,lit=true,color=gray": {"model": "hyperlighting:block/candle/gray_candle", "y": 270},
"facing=north,lit=false,color=gray": {"model": "hyperlighting:block/candle/gray_candle", "y": 270},
"facing=up,lit=true,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle"},
"facing=up,lit=false,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle"},
"facing=east,lit=true,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle"},
"facing=east,lit=false,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle"},
"facing=south,lit=true,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle", "y": 90},
"facing=south,lit=false,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle", "y": 90},
"facing=west,lit=true,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle", "y": 180},
"facing=west,lit=false,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle", "y": 180},
"facing=north,lit=true,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle", "y": 270},
"facing=north,lit=false,color=light_gray": {"model": "hyperlighting:block/candle/light_gray_candle", "y": 270},
"facing=up,lit=true,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle"},
"facing=up,lit=false,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle"},
"facing=east,lit=true,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle"},
"facing=east,lit=false,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle"},
"facing=south,lit=true,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle", "y": 90},
"facing=south,lit=false,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle", "y": 90},
"facing=west,lit=true,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle", "y": 180},
"facing=west,lit=false,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle", "y": 180},
"facing=north,lit=true,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle", "y": 270},
"facing=north,lit=false,color=cyan": {"model": "hyperlighting:block/candle/cyan_candle", "y": 270},
"facing=up,lit=true,color=purple": {"model": "hyperlighting:block/candle/purple_candle"},
"facing=up,lit=false,color=purple": {"model": "hyperlighting:block/candle/purple_candle"},
"facing=east,lit=true,color=purple": {"model": "hyperlighting:block/candle/purple_candle"},
"facing=east,lit=false,color=purple": {"model": "hyperlighting:block/candle/purple_candle"},
"facing=south,lit=true,color=purple": {"model": "hyperlighting:block/candle/purple_candle", "y": 90},
"facing=south,lit=false,color=purple": {"model": "hyperlighting:block/candle/purple_candle", "y": 90},
"facing=west,lit=true,color=purple": {"model": "hyperlighting:block/candle/purple_candle", "y": 180},
"facing=west,lit=false,color=purple": {"model": "hyperlighting:block/candle/purple_candle", "y": 180},
"facing=north,lit=true,color=purple": {"model": "hyperlighting:block/candle/purple_candle", "y": 270},
"facing=north,lit=false,color=purple": {"model": "hyperlighting:block/candle/purple_candle", "y": 270},
"facing=up,lit=true,color=blue": {"model": "hyperlighting:block/candle/blue_candle"},
"facing=up,lit=false,color=blue": {"model": "hyperlighting:block/candle/blue_candle"},
"facing=east,lit=true,color=blue": {"model": "hyperlighting:block/candle/blue_candle"},
"facing=east,lit=false,color=blue": {"model": "hyperlighting:block/candle/blue_candle"},
"facing=south,lit=true,color=blue": {"model": "hyperlighting:block/candle/blue_candle", "y": 90},
"facing=south,lit=false,color=blue": {"model": "hyperlighting:block/candle/blue_candle", "y": 90},
"facing=west,lit=true,color=blue": {"model": "hyperlighting:block/candle/blue_candle", "y": 180},
"facing=west,lit=false,color=blue": {"model": "hyperlighting:block/candle/blue_candle", "y": 180},
"facing=north,lit=true,color=blue": {"model": "hyperlighting:block/candle/blue_candle", "y": 270},
"facing=north,lit=false,color=blue": {"model": "hyperlighting:block/candle/blue_candle", "y": 270},
"facing=up,lit=true,color=brown": {"model": "hyperlighting:block/candle/brown_candle"},
"facing=up,lit=false,color=brown": {"model": "hyperlighting:block/candle/brown_candle"},
"facing=east,lit=true,color=brown": {"model": "hyperlighting:block/candle/brown_candle"},
"facing=east,lit=false,color=brown": {"model": "hyperlighting:block/candle/brown_candle"},
"facing=south,lit=true,color=brown": {"model": "hyperlighting:block/candle/brown_candle", "y": 90},
"facing=south,lit=false,color=brown": {"model": "hyperlighting:block/candle/brown_candle", "y": 90},
"facing=west,lit=true,color=brown": {"model": "hyperlighting:block/candle/brown_candle", "y": 180},
"facing=west,lit=false,color=brown": {"model": "hyperlighting:block/candle/brown_candle", "y": 180},
"facing=north,lit=true,color=brown": {"model": "hyperlighting:block/candle/brown_candle", "y": 270},
"facing=north,lit=false,color=brown": {"model": "hyperlighting:block/candle/brown_candle", "y": 270},
"facing=up,lit=true,color=green": {"model": "hyperlighting:block/candle/green_candle"},
"facing=up,lit=false,color=green": {"model": "hyperlighting:block/candle/green_candle"},
"facing=east,lit=true,color=green": {"model": "hyperlighting:block/candle/green_candle"},
"facing=east,lit=false,color=green": {"model": "hyperlighting:block/candle/green_candle"},
"facing=south,lit=true,color=green": {"model": "hyperlighting:block/candle/green_candle", "y": 90},
"facing=south,lit=false,color=green": {"model": "hyperlighting:block/candle/green_candle", "y": 90},
"facing=west,lit=true,color=green": {"model": "hyperlighting:block/candle/green_candle", "y": 180},
"facing=west,lit=false,color=green": {"model": "hyperlighting:block/candle/green_candle", "y": 180},
"facing=north,lit=true,color=green": {"model": "hyperlighting:block/candle/green_candle", "y": 270},
"facing=north,lit=false,color=green": {"model": "hyperlighting:block/candle/green_candle", "y": 270},
"facing=up,lit=true,color=red": {"model": "hyperlighting:block/candle/red_candle"},
"facing=up,lit=false,color=red": {"model": "hyperlighting:block/candle/red_candle"},
"facing=east,lit=true,color=red": {"model": "hyperlighting:block/candle/red_candle"},
"facing=east,lit=false,color=red": {"model": "hyperlighting:block/candle/red_candle"},
"facing=south,lit=true,color=red": {"model": "hyperlighting:block/candle/red_candle", "y": 90},
"facing=south,lit=false,color=red": {"model": "hyperlighting:block/candle/red_candle", "y": 90},
"facing=west,lit=true,color=red": {"model": "hyperlighting:block/candle/red_candle", "y": 180},
"facing=west,lit=false,color=red": {"model": "hyperlighting:block/candle/red_candle", "y": 180},
"facing=north,lit=true,color=red": {"model": "hyperlighting:block/candle/red_candle", "y": 270},
"facing=north,lit=false,color=red": {"model": "hyperlighting:block/candle/red_candle", "y": 270},
"facing=up,lit=true,color=black": {"model": "hyperlighting:block/candle/black_candle"},
"facing=up,lit=false,color=black": {"model": "hyperlighting:block/candle/black_candle"},
"facing=east,lit=true,color=black": {"model": "hyperlighting:block/candle/black_candle"},
"facing=east,lit=false,color=black": {"model": "hyperlighting:block/candle/black_candle"},
"facing=south,lit=true,color=black": {"model": "hyperlighting:block/candle/black_candle", "y": 90},
"facing=south,lit=false,color=black": {"model": "hyperlighting:block/candle/black_candle", "y": 90},
"facing=west,lit=true,color=black": {"model": "hyperlighting:block/candle/black_candle", "y": 180},
"facing=west,lit=false,color=black": {"model": "hyperlighting:block/candle/black_candle", "y": 180},
"facing=north,lit=true,color=black": {"model": "hyperlighting:block/candle/black_candle", "y": 270},
"facing=north,lit=false,color=black": {"model": "hyperlighting:block/candle/black_candle", "y": 270} }
}

View File

@@ -1,6 +1,7 @@
{
"block.hyperlighting.advanced_torch": "Advanced Torch (%s)",
"block.hyperlighting.advanced_lantern": "Advanced Lantern (%s)",
"block.hyperlighting.advanced_candle": "Advanced Candle (%s)",
"item.hyperlighting.lighter_tool": "Torch Lighter Tool",

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/black"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/blue"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/brown"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/cyan"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/gray"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/green"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/light_blue"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/light_gray"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/lime"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/magenta"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/orange"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/pink"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/purple"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/red"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/white"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/candle_base",
"textures": {
"0": "hyperlighting:block/candle/color/yellow"
}
}

View File

@@ -0,0 +1,50 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "hyperlighting:block/candle_wax",
"1": "minecraft:block/coal_block",
"particle": "hyperlighting:block/candle_wax"
},
"elements": [
{
"name": "candle_body",
"from": [7, 0, 7],
"to": [9, 10, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [0, -1, 0]},
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#0"},
"east": {"uv": [0, 0, 2, 10], "texture": "#0"},
"south": {"uv": [0, 0, 2, 10], "texture": "#0"},
"west": {"uv": [0, 0, 2, 10], "texture": "#0"},
"up": {"uv": [0, 0, 2, 2], "texture": "#0"},
"down": {"uv": [0, 0, 2, 2], "texture": "#0"}
}
},
{
"from": [7.71194, 9.94134, 7.75],
"to": [8.21194, 10.69134, 8.25],
"rotation": {"angle": 0, "axis": "y", "origin": [7.96194, 7.19134, 8]},
"faces": {
"north": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"east": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"south": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"west": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"up": {"uv": [0, 0, 15.5, 15.5], "texture": "#1"},
"down": {"uv": [0, 0, 15.5, 15.5], "texture": "#1"}
}
},
{
"from": [7.53963, 10.59567, 7.75],
"to": [8.03963, 11.34567, 8.25],
"rotation": {"angle": 22.5, "axis": "z", "origin": [7.8853, 11.07664, 8]},
"faces": {
"north": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"east": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"south": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"west": {"uv": [0, 0, 15.5, 15.75], "texture": "#1"},
"up": {"uv": [0, 0, 15.5, 15.5], "texture": "#1"},
"down": {"uv": [0, 0, 15.5, 15.5], "texture": "#1"}
}
}
]
}

View File

@@ -0,0 +1,21 @@
{
"parent": "hyperlighting:block/candle_base",
"overrides": [
{ "predicate": { "color": 0 }, "model": "hyperlighting:block/candle/white_candle" },
{ "predicate": { "color": 1 }, "model": "hyperlighting:block/candle/orange_candle" },
{ "predicate": { "color": 2 }, "model": "hyperlighting:block/candle/magenta_candle" },
{ "predicate": { "color": 3 }, "model": "hyperlighting:block/candle/light_blue_candle" },
{ "predicate": { "color": 4 }, "model": "hyperlighting:block/candle/yellow_candle" },
{ "predicate": { "color": 5 }, "model": "hyperlighting:block/candle/lime_candle" },
{ "predicate": { "color": 6 }, "model": "hyperlighting:block/candle/pink_candle" },
{ "predicate": { "color": 7 }, "model": "hyperlighting:block/candle/gray_candle" },
{ "predicate": { "color": 8 }, "model": "hyperlighting:block/candle/light_gray_candle" },
{ "predicate": { "color": 9 }, "model": "hyperlighting:block/candle/cyan_candle" },
{ "predicate": { "color": 10 }, "model": "hyperlighting:block/candle/purple_candle" },
{ "predicate": { "color": 11 }, "model": "hyperlighting:block/candle/blue_candle" },
{ "predicate": { "color": 12 }, "model": "hyperlighting:block/candle/brown_candle" },
{ "predicate": { "color": 13 }, "model": "hyperlighting:block/candle/green_candle" },
{ "predicate": { "color": 14 }, "model": "hyperlighting:block/candle/red_candle" },
{ "predicate": { "color": 15 }, "model": "hyperlighting:block/candle/black_candle" }
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -20,6 +20,18 @@ dependencies {
modApi("com.terraformersmc:modmenu:${mod_menu_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
// Sodium
modImplementation ("curse.maven:sodium-394468:${sodium_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
// This is a dependency of Sodium....
implementation 'org.joml:joml:1.10.4'
// Shimmer
modImplementation ("com.lowdragmc.shimmer:Shimmer-fabric-1.19.1:${shimmer_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
}
loom {

View File

@@ -84,6 +84,12 @@ dependencies {
compileOnly project(":Common")
annotationProcessor 'org.spongepowered:mixin:0.8.4-SNAPSHOT:processor'
implementation fg.deobf("me.hypherionmc.craterlib:CraterLib-forge-1.19.1:${craterlib_version}")
// Rubidium
implementation fg.deobf("curse.maven:rubidium-574856:${ribidium_version}")
// Shimmer
implementation fg.deobf("com.lowdragmc.shimmer:Shimmer-forge-1.19.1:${shimmer_version}")
}
tasks.withType(JavaCompile) {

View File

@@ -42,13 +42,21 @@ subprojects {
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
name = 'First Dark Dev Maven'
name = 'First Dark Dev Maven Snapshots'
url = 'https://maven.firstdarkdev.xyz/snapshots'
}
maven {
name = 'First Dark Dev Maven Releases'
url = 'https://maven.firstdarkdev.xyz/releases'
}
maven {
name = "TerraformersMC Maven"
url = "https://maven.terraformersmc.com/releases"
}
maven {
name = "Curseforge Maven"
url 'https://cfa2.cursemaven.com'
}
}

View File

@@ -28,5 +28,8 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
#dependencies
craterlib_version=1.0.5d
craterlib_version=1.0.6d
mod_menu_version=4.0.5
shimmer_version=0.1.11d
sodium_version=3820973
ribidium_version=3864138