36 Commits

Author SHA1 Message Date
ec3b792ef3 [FEAT] Add Pumpkin Trio recipes 2023-04-02 20:52:36 +02:00
113219604f [FEAT] Re-Add Jack-o-Lantern Trios 2023-04-02 17:57:09 +02:00
9e39a83b15 [BUG] Fix model scaling for held and dropped - #1 2023-04-02 17:25:19 +02:00
61fbeb58df [FEAT] Advanced Candle Recipe 2023-04-02 17:15:01 +02:00
f31f98817f [CHORE] Bump CraterLib and fix imports 2023-04-02 17:06:13 +02:00
0860f01720 [BUG] Fix Advanced Candle block states. 2023-04-02 17:05:43 +02:00
e7953754f0 [FEAT] Update Candle Models and Textures. 2023-04-02 17:05:22 +02:00
3961f95852 [BUG] Fix BatteryNeon not draining power when not lit - #1 2023-04-02 14:41:45 +02:00
39f9e2d7b9 [BUG] Fix Campfires cooking progress being reversed on TheOneProbe - #1 2023-04-02 14:27:05 +02:00
5032fee771 [BUG] Fix Campfires ignoring litByDefault config option - #1 2023-04-02 14:24:14 +02:00
cde200fee5 [BUG] Fix AdvancedTorches breaking when block underneath them changes - #1 2023-04-02 14:22:31 +02:00
006ee6d8fe [CHORE] Update CraterLib to fix config comments issue 2023-04-02 14:21:49 +02:00
a2238fa663 Finish recipes for currently implemented blocks and items 2023-03-19 17:24:35 +02:00
932259087c Rework Torch recipe 2023-03-19 16:31:18 +02:00
5b531ffaf3 Cleanup Imports 2023-03-19 15:59:36 +02:00
21161af4aa Fix Block Drops 2023-03-19 15:59:27 +02:00
da2d3da484 Fix CreativeTab assignment (Fabric) 2023-03-19 15:56:12 +02:00
8bb3e0c0a9 Fix CraterLib dependency 2023-03-19 15:55:52 +02:00
d08e7d1fd7 Fix invalid file name 2023-03-19 15:55:23 +02:00
0e633eef04 Port to 1.19.4 2023-03-19 14:35:24 +02:00
c0dbe967f3 Fix Solar Panel GUI display 2022-10-16 19:18:55 +02:00
eec26991b5 Fix BatteryNeon Bounding boxes and Config Screen title 2022-10-16 18:43:01 +02:00
48951c35b8 Fix Campfire Cooking Progress on TOP 2022-09-25 19:18:53 +02:00
edf386377b Adjust code for CraterLib service changes 2022-09-25 13:37:12 +02:00
2550b63d2a Candle in a Jar is back 2022-09-25 12:01:53 +02:00
7e978f539d Fix Color Handling for Battery Neon (Forge/Fabric) 2022-09-25 02:19:05 +02:00
d1fa3eac46 Initial re-implementation of Wireless Battery and Battery neon. Fabric needs more work 2022-09-25 01:54:15 +02:00
0c38a73a46 Uh? Code cleanup I guess? Not really sure what to call this 2022-09-24 13:27:56 +02:00
16556542b7 Integrate Candles with Colored Lighting 2022-09-24 13:27:36 +02:00
f261878a93 Disable Rubidium and fix The One Probe maven config 2022-09-24 13:27:22 +02:00
73c6bd2246 Added missing Language entries 2022-09-24 13:26:55 +02:00
cd9a786686 Fix Broken Config Registration 2022-09-24 13:26:32 +02:00
8e46be5df8 WTHIT and TOP integration 2022-09-24 13:26:13 +02:00
6c22a10e93 Solar Panel re-implementation 2022-09-24 13:25:29 +02:00
5697847d74 Fix Candle Blockstates 2022-09-18 22:50:12 +02:00
87fdb68256 Bump to 1.19.2 and remove Sodium 2022-09-18 22:49:14 +02:00
167 changed files with 2849 additions and 602 deletions

View File

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

View File

@@ -0,0 +1,8 @@
package me.hypherionmc.hyperlighting.api;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public interface SwitchModule {
}

View File

@@ -4,8 +4,8 @@ import me.hypherionmc.craterlib.common.config.ModuleConfig;
import me.hypherionmc.craterlib.common.config.annotations.SubConfig; import me.hypherionmc.craterlib.common.config.annotations.SubConfig;
import me.hypherionmc.hyperlighting.Constants; import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration; import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import me.hypherionmc.nightconfig.core.conversion.Path; import shadow.hypherionmc.moonconfig.core.conversion.Path;
import me.hypherionmc.nightconfig.core.conversion.SpecComment; import shadow.hypherionmc.moonconfig.core.conversion.SpecComment;
public class HyperLightingClientConfig extends ModuleConfig { public class HyperLightingClientConfig extends ModuleConfig {
@@ -29,8 +29,14 @@ public class HyperLightingClientConfig extends ModuleConfig {
@SubConfig @SubConfig
public CandleConfig candleConfig = new CandleConfig(); public CandleConfig candleConfig = new CandleConfig();
@Path("pumpkinTrioConfig")
@SpecComment("Pumpkin Trio Configuration")
@SubConfig
public PumpkinTrioConfig pumpkinTrioConfig = new PumpkinTrioConfig();
public HyperLightingClientConfig() { public HyperLightingClientConfig() {
super(Constants.MOD_ID, "hyperlighting-client"); super(Constants.MOD_ID, "hyperlighting-client");
registerAndSetup(this);
} }
@Override @Override
@@ -93,4 +99,18 @@ public class HyperLightingClientConfig extends ModuleConfig {
@SpecComment("Should Candles emit colored Lighting when SHIMMER is installed") @SpecComment("Should Candles emit colored Lighting when SHIMMER is installed")
public boolean coloredLighting = true; public boolean coloredLighting = true;
} }
public static class PumpkinTrioConfig {
@Path("litByDefault")
@SpecComment("Should Pumpkin Trios be lit by default when placed")
public boolean litByDefault = false;
@Path("requiresTool")
@SpecComment("Is the Torch Lighter tool needed to light Pumpkin Trios")
public boolean requiresTool = true;
@Path("coloredLighting")
@SpecComment("Should Pumpkin Trios emit colored Lighting when SHIMMER is installed")
public boolean coloredLighting = true;
}
} }

View File

@@ -0,0 +1,70 @@
package me.hypherionmc.hyperlighting.client.gui;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
import me.hypherionmc.hyperlighting.common.containers.BatteryNeonContainer;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import java.util.ArrayList;
import java.util.List;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class BatteryNeonScreen extends AbstractContainerScreen<BatteryNeonContainer> {
private static final ResourceLocation TEXTURE = new ResourceLocation(Constants.MOD_ID, "textures/gui/neon_light.png");
private final Inventory player;
private final BatteryNeonBlockEntity te;
public BatteryNeonScreen(BatteryNeonContainer container, Inventory inventory, Component title) {
super(container, inventory, title);
this.te = container.getBlockEntity();
this.player = inventory;
}
@Override
protected void renderBg(PoseStack poseStack, float v, int i, int i1) {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, TEXTURE);
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
blit(poseStack, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
blit(poseStack, this.leftPos + 47, this.topPos + 20, 0, 198, (int) (((float) this.te.getEnergyStorage().getPowerLevel() / this.te.getEnergyStorage().getPowerCapacity()) * 110), 16);
if (this.te.isCharging()) {
blit(poseStack, this.leftPos + 26, this.topPos + 38, 185, 17, 4, 4);
}
}
@Override
protected void renderLabels(PoseStack matrixStack, int mouseX, int mouseY) {
super.renderLabels(matrixStack, mouseX, mouseY);
this.drawPowerToolTip(matrixStack, mouseX, mouseY, leftPos + this.menu.slots.get(0).x, topPos + this.menu.slots.get(0).y, 16, 16, ChatFormatting.YELLOW + "Power Slot", "Place a wireless battery", "module in this slot", "linked to a solar panel", "to charge the light");
this.drawPowerToolTip(matrixStack, mouseX, mouseY, leftPos + this.menu.slots.get(1).x, topPos + this.menu.slots.get(1).y, 16, 16, ChatFormatting.YELLOW + "Dye Slot", "Place dye here to", "change the color of the", "light");
this.drawPowerToolTip(matrixStack, mouseX, mouseY, this.leftPos + 47, this.topPos + 20, 110, 16, ChatFormatting.YELLOW + "Power Level", ChatFormatting.BLUE + "" + (int) (((float) this.te.getEnergyStorage().getPowerLevel() / this.te.getEnergyStorage().getPowerCapacity()) * 100) + "%", (te.isCharging() ? ChatFormatting.GREEN + "Charging" : ChatFormatting.RED + "Not Charging"));
}
private void drawPowerToolTip(PoseStack stack, int mouseX, int mouseY, int startX, int startY, int sizeX, int sizeY, String title, String... description) {
int k = (this.width - this.imageWidth) / 2;
int l = (this.height - this.imageHeight) / 2;
if (mouseX > startX && mouseX < startX + sizeX) {
if (mouseY > startY && mouseY < startY + sizeY) {
List<Component> list = new ArrayList<>();
list.add(Component.translatable(title));
for (String desc : description) {
list.add(Component.translatable(desc));
}
renderComponentTooltip(stack, list, mouseX - k, mouseY - l);
}
}
}
}

View File

@@ -1,15 +1,16 @@
package me.hypherionmc.hyperlighting.client.init; package me.hypherionmc.hyperlighting.client.init;
import me.hypherionmc.craterlib.api.rendering.CustomRenderType;
import me.hypherionmc.craterlib.client.events.ColorRegistrationEvent; import me.hypherionmc.craterlib.client.events.ColorRegistrationEvent;
import me.hypherionmc.craterlib.client.registry.ClientRegistry; import me.hypherionmc.craterlib.client.registry.ClientRegistry;
import me.hypherionmc.craterlib.events.CraterEventBus; import me.hypherionmc.craterlib.events.CraterEventBus;
import me.hypherionmc.craterlib.platform.Services; import me.hypherionmc.craterlib.platform.ClientPlatform;
import me.hypherionmc.hyperlighting.client.gui.BatteryNeonScreen;
import me.hypherionmc.hyperlighting.common.init.HLBlocks; import me.hypherionmc.hyperlighting.common.init.HLBlocks;
import me.hypherionmc.hyperlighting.common.init.HLContainers;
import me.hypherionmc.hyperlighting.common.init.HLItems; import me.hypherionmc.hyperlighting.common.init.HLItems;
import me.hypherionmc.hyperlighting.common.init.HLPackets;
import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations; import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations;
import net.minecraft.client.renderer.ItemBlockRenderTypes; import me.hypherionmc.hyperlighting.mixin.access.MenuScreensAccess;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
/** /**
* @author HypherionSA * @author HypherionSA
@@ -18,8 +19,11 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
public class ClientRegistration { public class ClientRegistration {
public void registerAll() { public void registerAll() {
Services.CLIENT_HELPER.registerCustomRenderTypes(HLBlocks.BLOCKS.getEntries(), HLItems.ITEMS.getEntries()); ClientPlatform.CLIENT_HELPER.registerCustomRenderTypes(HLBlocks.BLOCKS.getEntries(), HLItems.ITEMS.getEntries());
HyperLightingIntegrations.registerClient(); HyperLightingIntegrations.registerClient();
MenuScreensAccess.crater_register(HLContainers.BATTERY_NEON.get(), BatteryNeonScreen::new);
HLPackets.registerClient();
} }
public void registerEvents() { public void registerEvents() {

View File

@@ -1,16 +1,16 @@
package me.hypherionmc.hyperlighting.client.renderer.blockentity; package me.hypherionmc.hyperlighting.client.renderer.blockentity;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f; import com.mojang.math.Axis;
import me.hypherionmc.hyperlighting.common.blockentities.AdvancedCampfireBlockEntity; import me.hypherionmc.hyperlighting.common.blockentities.AdvancedCampfireBlockEntity;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedCampfire; import me.hypherionmc.hyperlighting.common.blocks.AdvancedCampfire;
import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.NonNullList; import net.minecraft.core.NonNullList;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
/** /**
@@ -33,17 +33,17 @@ public class AdvancedCampfireRenderer implements BlockEntityRenderer<AdvancedCam
int blockPos = (int)campfire.getBlockPos().asLong(); int blockPos = (int)campfire.getBlockPos().asLong();
for(int i = 0; i < items.size(); ++i) { for(int i = 0; i < items.size(); ++i) {
ItemStack $$10 = items.get(i); ItemStack stack = items.get(i);
if ($$10 != ItemStack.EMPTY) { if (stack != ItemStack.EMPTY) {
poseStack.pushPose(); poseStack.pushPose();
poseStack.translate(0.5, 0.44921875, 0.5); poseStack.translate(0.5, 0.44921875, 0.5);
Direction direction1 = Direction.from2DDataValue((i + direction.get2DDataValue()) % 4); Direction direction1 = Direction.from2DDataValue((i + direction.get2DDataValue()) % 4);
float rot = -direction1.toYRot(); float rot = -direction1.toYRot();
poseStack.mulPose(Vector3f.YP.rotationDegrees(rot)); poseStack.mulPose(Axis.YP.rotationDegrees(rot));
poseStack.mulPose(Vector3f.XP.rotationDegrees(90.0F)); poseStack.mulPose(Axis.XP.rotationDegrees(90.0F));
poseStack.translate(-0.3125, -0.3125, 0.0); poseStack.translate(-0.3125, -0.3125, 0.0);
poseStack.scale(0.375F, 0.375F, 0.375F); poseStack.scale(0.375F, 0.375F, 0.375F);
this.itemRenderer.renderStatic($$10, ItemTransforms.TransformType.FIXED, combinedLight, overlay, poseStack, bufferSource, blockPos + i); this.itemRenderer.renderStatic(stack, ItemDisplayContext.FIXED, combinedLight, overlay, poseStack, bufferSource, campfire.getLevel(), blockPos + i);
poseStack.popPose(); poseStack.popPose();
} }
} }

View File

@@ -53,12 +53,14 @@ public class AdvancedCampfireBlockEntity extends BlockEntity implements Clearabl
isDirty = true; isDirty = true;
int time = be.cookingProgress[i]++; int time = be.cookingProgress[i]++;
if (be.cookingProgress[i] >= be.cookingTime[i]) { if (be.cookingProgress[i] >= be.cookingTime[i]) {
Container container = new SimpleContainer(inStack); Container $$7 = new SimpleContainer(inStack);
ItemStack outStack = be.quickCheck.getRecipeFor(container, level).map(r -> r.assemble(container)).orElse(inStack); ItemStack $$8 = ((AdvancedCampfireBlockEntity) blockEntity).quickCheck.getRecipeFor($$7, level).map(($$2x) -> $$2x.assemble($$7, level.registryAccess())).orElse(inStack);
Containers.dropItemStack(level, blockPos.getX(), blockPos.getY(), blockPos.getZ(), outStack); if ($$8.isItemEnabled(level.enabledFeatures())) {
be.items.set(i, ItemStack.EMPTY); Containers.dropItemStack(level, blockPos.getX(), blockPos.getY(), blockPos.getZ(), $$8);
level.sendBlockUpdated(blockPos, blockState, blockState, 3); ((AdvancedCampfireBlockEntity) blockEntity).items.set(i, ItemStack.EMPTY);
level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(blockState)); level.sendBlockUpdated(blockPos, blockState, blockState, 3);
level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(blockState));
}
} }
} }
} }

View File

@@ -0,0 +1,140 @@
package me.hypherionmc.hyperlighting.common.blockentities;
import me.hypherionmc.craterlib.api.blockentities.ITickable;
import me.hypherionmc.craterlib.api.blockentities.caps.CapabilityHandler;
import me.hypherionmc.craterlib.common.blockentity.CraterBlockEntity;
import me.hypherionmc.craterlib.systems.energy.CustomEnergyStorage;
import me.hypherionmc.craterlib.systems.inventory.SimpleInventory;
import me.hypherionmc.hyperlighting.common.blocks.BatteryNeon;
import me.hypherionmc.hyperlighting.common.init.HLBlockEntities;
import me.hypherionmc.hyperlighting.common.items.WirelessBattery;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.Containers;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.DyeItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import java.util.Optional;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class BatteryNeonBlockEntity extends CraterBlockEntity implements ITickable {
private final CustomEnergyStorage energyStorage = new CustomEnergyStorage(500, 20, 0);
private final SimpleInventory inventory = new SimpleInventory(2, 1);
private boolean isCharging = false;
public BatteryNeonBlockEntity(BlockPos pos, BlockState state) {
super(HLBlockEntities.BATTERY_NEON.get(), pos, state);
}
@Override
protected void saveAdditional(CompoundTag tag) {
super.saveAdditional(tag);
tag.putBoolean("isCharging", isCharging);
energyStorage.writeNBT(tag);
inventory.writeNBT(tag);
}
@Override
public void load(CompoundTag tag) {
super.load(tag);
this.isCharging = tag.getBoolean("isCharging");
this.energyStorage.readNBT(tag);
inventory.clearContent();
inventory.readNBT(tag);
}
public boolean isCharging() {
return isCharging;
}
public CustomEnergyStorage getEnergyStorage() {
return energyStorage;
}
public SimpleInventory getInventory() {
return inventory;
}
@Override
public void sendUpdates() {
BlockState state = level.getBlockState(this.getBlockPos());
if (inventory.getItemHandler().getItem(1).getItem() instanceof DyeItem dyeItem) {
if (state.getValue(BatteryNeon.COLOR) != dyeItem.getDyeColor()) {
state = state.setValue(BatteryNeon.COLOR, dyeItem.getDyeColor());
level.setBlock(this.getBlockPos(), state, 2);
}
} else {
state = state.setValue(BatteryNeon.COLOR, DyeColor.WHITE);
level.setBlock(this.getBlockPos(), state, 2);
}
this.level.blockEntityChanged(this.getBlockPos());
this.level.sendBlockUpdated(this.getBlockPos(), this.level.getBlockState(this.getBlockPos()), state, 3);
this.setChanged();
}
@Override
public void tick(Level level, BlockPos blockPos, BlockState blockState, BlockEntity blockEntity) {
if (level.getGameTime() % 20L == 0L) {
ItemStack stack = inventory.getItemHandler().getItem(0);
if (!stack.isEmpty() && stack.getItem() instanceof WirelessBattery battery) {
if (battery.isLinked(stack, level)) {
BlockPos pos = battery.getLinkedPos(stack);
if (level.getBlockEntity(pos) instanceof SolarPanelBlockEntity solarPanel) {
CustomEnergyStorage storage = solarPanel.getEnergyStorage();
if (storage.extractEnergy(20, true) > 0 && this.energyStorage.receiveEnergy(20, true) > 0) {
this.isCharging = true;
storage.extractEnergy(this.energyStorage.receiveEnergy(20, false), false);
} else {
this.isCharging = false;
}
}
} else {
isCharging = false;
}
}
}
if (level.getGameTime() % 40L == 0L) {
if (level.getBlockState(blockPos).getValue(BatteryNeon.LIT)) {
this.energyStorage.extractEnergyInternal(1, false);
}
}
this.sendUpdates();
}
@Override
public void setRemoved() {
dropInventory();
super.setRemoved();
}
public void dropInventory() {
if (!inventory.getItemHandler().getItem(0).isEmpty()) {
Containers.dropItemStack(level, worldPosition.getX(), worldPosition.getY(), worldPosition.getZ(), inventory.getItemHandler().getItem(0));
}
if (!inventory.getItemHandler().getItem(1).isEmpty()) {
Containers.dropItemStack(level, worldPosition.getX(), worldPosition.getY(), worldPosition.getZ(), inventory.getItemHandler().getItem(1));
}
}
@Override
public <T> Optional<T> getCapability(CapabilityHandler capability, Direction side) {
if (capability == CapabilityHandler.ENERGY && side == null) {
return (Optional<T>) Optional.of(energyStorage);
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,73 @@
package me.hypherionmc.hyperlighting.common.blockentities;
import me.hypherionmc.craterlib.api.blockentities.ITickable;
import me.hypherionmc.craterlib.api.blockentities.caps.CapabilityHandler;
import me.hypherionmc.craterlib.common.blockentity.CraterBlockEntity;
import me.hypherionmc.craterlib.systems.energy.CustomEnergyStorage;
import me.hypherionmc.hyperlighting.common.blocks.SolarPanel;
import me.hypherionmc.hyperlighting.common.init.HLBlockEntities;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Mth;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LightLayer;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import java.util.Optional;
/**
* @author HypherionSA
* @date 18/09/2022
*/
public class SolarPanelBlockEntity extends CraterBlockEntity implements ITickable {
private CustomEnergyStorage energyStorage = new CustomEnergyStorage(2000, 50, 1000);
public SolarPanelBlockEntity(BlockPos pos, BlockState state) {
super(HLBlockEntities.SOLAR_PANEL.get(), pos, state);
}
@Override
public void tick(Level level, BlockPos blockPos, BlockState blockState, BlockEntity blockEntity) {
if (this.getBlockState().getBlock() instanceof SolarPanel && level.isDay() && level.canSeeSky(blockPos)) {
int i = level.getBrightness(LightLayer.SKY, blockPos) - level.getSkyDarken();
float f = level.getSunAngle(1.0F);
if (i > 8 && this.energyStorage.getPowerLevel() < this.energyStorage.getPowerCapacity()) {
float f1 = f < (float) Math.PI ? 0.0F : ((float) Math.PI * 2F);
f = f + (f1 - f) * 0.2F;
i = Math.round((float) i * Mth.cos(f));
i = Mth.clamp(i, 0, 15);
this.energyStorage.receiveEnergyInternal(i, false);
}
this.sendUpdates();
}
}
@Override
public void load(CompoundTag tag) {
super.load(tag);
this.energyStorage.readNBT(tag);
}
@Override
public void saveAdditional(CompoundTag tag) {
super.saveAdditional(tag);
this.energyStorage.writeNBT(tag);
}
@Override
public <T> Optional<T> getCapability(CapabilityHandler forgeCapability, Direction direction) {
if (forgeCapability == CapabilityHandler.ENERGY && (direction == Direction.DOWN || direction == null)) {
return (Optional<T>) Optional.of(energyStorage);
}
return Optional.empty();
}
public CustomEnergyStorage getEnergyStorage() {
return energyStorage;
}
}

View File

@@ -1,8 +1,10 @@
package me.hypherionmc.hyperlighting.common.blocks; package me.hypherionmc.hyperlighting.common.blocks;
import me.hypherionmc.craterlib.api.inventory.CraterCreativeModeTab;
import me.hypherionmc.craterlib.api.rendering.CustomRenderType; import me.hypherionmc.craterlib.api.rendering.CustomRenderType;
import me.hypherionmc.craterlib.api.rendering.DyableBlock; import me.hypherionmc.craterlib.api.rendering.DyableBlock;
import me.hypherionmc.craterlib.common.item.BlockItemDyable; import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.craterlib.util.BlockStateUtils; import me.hypherionmc.craterlib.util.BlockStateUtils;
import me.hypherionmc.craterlib.util.RenderUtils; import me.hypherionmc.craterlib.util.RenderUtils;
import me.hypherionmc.hyperlighting.api.LightableBlock; import me.hypherionmc.hyperlighting.api.LightableBlock;
@@ -27,7 +29,6 @@ import net.minecraft.util.RandomSource;
import net.minecraft.world.Containers; import net.minecraft.world.Containers;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
@@ -80,7 +81,7 @@ public class AdvancedCampfire extends BaseEntityBlock implements DyableBlock, Li
private DyeColor color; private DyeColor color;
public AdvancedCampfire(String name, DyeColor color, CreativeModeTab tab) { public AdvancedCampfire(String name, DyeColor color, CraterCreativeModeTab tab) {
super(Properties.of( super(Properties.of(
Material.WOOD, Material.WOOD,
MaterialColor.COLOR_BROWN) MaterialColor.COLOR_BROWN)
@@ -94,7 +95,7 @@ public class AdvancedCampfire extends BaseEntityBlock implements DyableBlock, Li
this.color = color; this.color = color;
this.registerDefaultState(this.defaultBlockState().setValue(LIT, CommonRegistration.config.campfireConfig.litByDefault).setValue(SIGNAL_FIRE, false).setValue(FACING, Direction.NORTH).setValue(COLOR, color)); this.registerDefaultState(this.defaultBlockState().setValue(LIT, CommonRegistration.config.campfireConfig.litByDefault).setValue(SIGNAL_FIRE, false).setValue(FACING, Direction.NORTH).setValue(COLOR, color));
HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties().tab(tab))); CreativeTabRegistry.setCreativeTab(tab, HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties())));
} }
@Override @Override
@@ -145,7 +146,7 @@ public class AdvancedCampfire extends BaseEntityBlock implements DyableBlock, Li
@Override @Override
public void entityInside(BlockState blockState, Level level, BlockPos blockPos, Entity entity) { public void entityInside(BlockState blockState, Level level, BlockPos blockPos, Entity entity) {
if (blockState.getValue(LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity)entity)) { if (blockState.getValue(LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity)entity)) {
entity.hurt(DamageSource.IN_FIRE, (float)this.fireDamage); entity.hurt(level.damageSources().inFire(), (float)this.fireDamage);
} }
super.entityInside(blockState, level, blockPos, entity); super.entityInside(blockState, level, blockPos, entity);
} }
@@ -168,7 +169,7 @@ public class AdvancedCampfire extends BaseEntityBlock implements DyableBlock, Li
LevelAccessor levelAccessor = blockPlaceContext.getLevel(); LevelAccessor levelAccessor = blockPlaceContext.getLevel();
BlockPos blockPos = blockPlaceContext.getClickedPos(); BlockPos blockPos = blockPlaceContext.getClickedPos();
boolean bl = levelAccessor.getFluidState(blockPos).getType() == Fluids.WATER; boolean bl = levelAccessor.getFluidState(blockPos).getType() == Fluids.WATER;
return this.defaultBlockState().setValue(SIGNAL_FIRE, this.isSmokeSource(levelAccessor.getBlockState(blockPos.below()))).setValue(LIT, !bl).setValue(FACING, blockPlaceContext.getHorizontalDirection()); return this.defaultBlockState().setValue(SIGNAL_FIRE, this.isSmokeSource(levelAccessor.getBlockState(blockPos.below()))).setValue(LIT, !bl && CommonRegistration.config.campfireConfig.litByDefault).setValue(FACING, blockPlaceContext.getHorizontalDirection());
} }
@Override @Override

View File

@@ -1,9 +1,9 @@
package me.hypherionmc.hyperlighting.common.blocks; package me.hypherionmc.hyperlighting.common.blocks;
import com.google.common.collect.ImmutableMap; import me.hypherionmc.craterlib.api.inventory.CraterCreativeModeTab;
import com.google.common.collect.Maps;
import me.hypherionmc.craterlib.api.rendering.DyableBlock; import me.hypherionmc.craterlib.api.rendering.DyableBlock;
import me.hypherionmc.craterlib.common.item.BlockItemDyable; import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.craterlib.util.BlockStateUtils; import me.hypherionmc.craterlib.util.BlockStateUtils;
import me.hypherionmc.craterlib.util.RenderUtils; import me.hypherionmc.craterlib.util.RenderUtils;
import me.hypherionmc.hyperlighting.api.LightableBlock; import me.hypherionmc.hyperlighting.api.LightableBlock;
@@ -31,10 +31,8 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; 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.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; 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.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
@@ -44,174 +42,146 @@ import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.stream.Stream;
public class AdvancedCandleBlock extends HorizontalDirectionalBlock implements DyableBlock, LightableBlock { public class AdvancedCandleBlock extends Block implements DyableBlock, LightableBlock {
//region Properties //region Properties
public static final BooleanProperty LIT = BlockStateProperties.LIT; public static final BooleanProperty LIT = BlockStateProperties.LIT;
public static final EnumProperty<DyeColor> COLOR = EnumProperty.create("color", DyeColor.class); 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
//endregion
//region Bounding Boxes //region Bounding Boxes
private static final Map<Direction, VoxelShape> SHAPES = Maps.newEnumMap( VoxelShape BOUNDING_BOX = Block.box(4, 0, 4, 11, 10, 11);
ImmutableMap.of( //endregion
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; private DyeColor color;
public AdvancedCandleBlock(String name, DyeColor color, CreativeModeTab tab) { public AdvancedCandleBlock(String name, DyeColor color, CraterCreativeModeTab tab) {
super(Properties.of(Material.WOOD).noCollission().instabreak().lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(15))); super(Properties.of(Material.WOOD).noCollission().instabreak().lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(15)));
this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(LIT, CommonRegistration.config.candleConfig.litByDefault).setValue(COLOR, color)); this.registerDefaultState(this.defaultBlockState().setValue(LIT, CommonRegistration.config.candleConfig.litByDefault).setValue(COLOR, color));
this.color = color; this.color = color;
HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties().tab(tab))); CreativeTabRegistry.setCreativeTab(tab, HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties())));
}
@Override
public VoxelShape getShape(BlockState blockState, BlockGetter level, BlockPos pos, CollisionContext context) {
return BOUNDING_BOX;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(LIT, COLOR);
super.createBlockStateDefinition(builder);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
BlockState state = this.defaultBlockState();
return state.setValue(LIT, CommonRegistration.config.candleConfig.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);
}
@Override public boolean isValidPosition(BlockState state, LevelAccessor levelAccessor, BlockPos pos, Direction direction) {
public VoxelShape getShape(BlockState blockState, BlockGetter level, BlockPos pos, CollisionContext context) { return canSupportCenter(levelAccessor, pos, direction);
return switch (blockState.getValue(ATTACH_FACE)) { }
case FLOOR -> SHAPES.get(Direction.UP);
case WALL -> SHAPES.get(blockState.getValue(FACING)); @Override
case CEILING -> null; 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 @Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { public BlockColor dyeHandler() {
builder.add(LIT, ATTACH_FACE, FACING, COLOR); return ((blockState, blockAndTintGetter, blockPos, i) -> {
super.createBlockStateDefinition(builder); if (blockState.getValue(LIT)) {
} return RenderUtils.renderColorFromDye(blockState.getValue(COLOR));
@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 { } else {
state = state.setValue(ATTACH_FACE, AttachFace.WALL).setValue(FACING, direction); return RenderUtils.renderColorFromDye(DyeColor.BLACK);
} }
return state.setValue(LIT, CommonRegistration.config.candleConfig.litByDefault); });
} }
@Override @Override
public BlockState updateShape(BlockState stateIn, Direction facing, BlockState neighbourState, LevelAccessor levelIn, BlockPos currentPos, BlockPos newPos) { public DyeColor defaultDyeColor() {
if (facing == Direction.DOWN && !this.isValidPosition(stateIn, levelIn, currentPos, facing)) { return this.defaultBlockState().getValue(COLOR);
return Blocks.AIR.defaultBlockState(); }
}
return super.updateShape(stateIn, facing, neighbourState, levelIn, currentPos, newPos);
}
public boolean isValidPosition(BlockState state, LevelAccessor levelAccessor, BlockPos pos, Direction direction) { /** Check if player clicked the block with DYE and apply Color Tint **/
return canSupportCenter(levelAccessor, pos, direction); @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);
@Override if (!player.isCreative()) {
public void toggleLight(Level worldIn, BlockState state, BlockPos pos) { ItemStack stack = player.getItemInHand(handIn);
state = state.setValue(LIT, !state.getValue(LIT)); stack.shrink(1);
worldIn.setBlock(pos, state, 2); player.setItemInHand(handIn, stack);
if (!state.getValue(LIT)) { }
worldIn.playSound(null, pos, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 1.0f); return InteractionResult.CONSUME;
} else { } else if (!CommonRegistration.config.candleConfig.requiresTool) {
worldIn.playSound(null, pos, HLSounds.TORCH_IGNITE.get(), SoundSource.BLOCKS, 0.3f, 1.0f); state = state.cycle(LIT);
} level.setBlock(pos, state, 3);
worldIn.blockUpdated(pos, this); level.sendBlockUpdated(pos, state, state, 3);
} if (!state.getValue(LIT)) {
level.playSound(null, pos, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 0.3f, 1.0f);
@Override
public BlockColor dyeHandler() {
return ((blockState, blockAndTintGetter, blockPos, i) -> {
if (blockState.getValue(LIT)) {
return RenderUtils.renderColorFromDye(blockState.getValue(COLOR));
} else { } else {
return RenderUtils.renderColorFromDye(DyeColor.BLACK); level.playSound(null, pos, HLSounds.TORCH_IGNITE.get(), SoundSource.BLOCKS, 0.3f, 1.0f);
}
});
}
@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.candleConfig.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);
} }
return InteractionResult.CONSUME;
} }
} }
return InteractionResult.PASS;
}
@Override @Override
public @NotNull ItemStack getCloneItemStack(@NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull BlockState state) { public void appendHoverText(ItemStack stack, BlockGetter level, List<Component> tooltip, TooltipFlag options) {
return StackUtil.getColorStack(this, state.getValue(COLOR)); tooltip.add(Component.literal(ChatFormatting.YELLOW + "Dyable"));
} tooltip.add(Component.literal(ChatFormatting.GREEN + "Color: " + color.getName()));
super.appendHoverText(stack, level, tooltip, options);
}
@Override @Override
public List<ItemStack> getDrops(BlockState blockState, LootContext.Builder lootBuilder) { public void animateTick(BlockState stateIn, Level levelIn, BlockPos pos, RandomSource random) {
return List.of(StackUtil.getColorStack(this, blockState.getValue(COLOR))); if (stateIn.getValue(LIT)) {
DyeColor color = stateIn.getValue(COLOR);
double d0 = (double) pos.getX() + 0.48D;
double d1 = (double) pos.getY() + 0.79D;
double d2 = (double) pos.getZ() + 0.45D;
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);
} }
}
@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

@@ -1,8 +1,10 @@
package me.hypherionmc.hyperlighting.common.blocks; package me.hypherionmc.hyperlighting.common.blocks;
import me.hypherionmc.craterlib.api.inventory.CraterCreativeModeTab;
import me.hypherionmc.craterlib.api.rendering.CustomRenderType; import me.hypherionmc.craterlib.api.rendering.CustomRenderType;
import me.hypherionmc.craterlib.api.rendering.DyableBlock; import me.hypherionmc.craterlib.api.rendering.DyableBlock;
import me.hypherionmc.craterlib.common.item.BlockItemDyable; import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.craterlib.util.BlockStateUtils; import me.hypherionmc.craterlib.util.BlockStateUtils;
import me.hypherionmc.craterlib.util.MathUtils; import me.hypherionmc.craterlib.util.MathUtils;
import me.hypherionmc.craterlib.util.RenderUtils; import me.hypherionmc.craterlib.util.RenderUtils;
@@ -68,7 +70,7 @@ public class AdvancedLanternBlock extends FaceAttachedHorizontalDirectionalBlock
private DyeColor color; private DyeColor color;
public AdvancedLanternBlock(String name, DyeColor color, CreativeModeTab tab) { public AdvancedLanternBlock(String name, DyeColor color, CraterCreativeModeTab tab) {
super(Properties.of(Material.HEAVY_METAL) super(Properties.of(Material.HEAVY_METAL)
.instabreak() .instabreak()
.sound(SoundType.LANTERN) .sound(SoundType.LANTERN)
@@ -76,7 +78,8 @@ public class AdvancedLanternBlock extends FaceAttachedHorizontalDirectionalBlock
); );
this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(LIT, CommonRegistration.config.lanternConfig.litByDefault).setValue(COLOR, color)); this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(LIT, CommonRegistration.config.lanternConfig.litByDefault).setValue(COLOR, color));
this.color = color; this.color = color;
HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties().tab(tab)));
CreativeTabRegistry.setCreativeTab(tab, HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties())));
} }
@Override @Override

View File

@@ -2,8 +2,10 @@ package me.hypherionmc.hyperlighting.common.blocks;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import me.hypherionmc.craterlib.api.inventory.CraterCreativeModeTab;
import me.hypherionmc.craterlib.api.rendering.DyableBlock; import me.hypherionmc.craterlib.api.rendering.DyableBlock;
import me.hypherionmc.craterlib.common.item.BlockItemDyable; import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.craterlib.util.BlockStateUtils; import me.hypherionmc.craterlib.util.BlockStateUtils;
import me.hypherionmc.craterlib.util.RenderUtils; import me.hypherionmc.craterlib.util.RenderUtils;
import me.hypherionmc.hyperlighting.api.LightableBlock; import me.hypherionmc.hyperlighting.api.LightableBlock;
@@ -29,9 +31,8 @@ import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; 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.AttachFace;
@@ -70,16 +71,16 @@ public class AdvancedTorchBlock extends HorizontalDirectionalBlock implements Dy
private DyeColor color; private DyeColor color;
public AdvancedTorchBlock(String name, DyeColor color, CreativeModeTab tab) { public AdvancedTorchBlock(String name, DyeColor color, CraterCreativeModeTab tab) {
super(Properties.of(Material.WOOD).noCollission().instabreak().lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(15))); 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.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(LIT, CommonRegistration.config.torchConfig.litByDefault).setValue(COLOR, color));
this.color = color; this.color = color;
HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties().tab(tab))); CreativeTabRegistry.setCreativeTab(tab, HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties())));
} }
@Override @Override
public VoxelShape getShape(BlockState blockState, BlockGetter level, BlockPos pos, CollisionContext context) { public @NotNull VoxelShape getShape(BlockState blockState, @NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull CollisionContext context) {
return switch (blockState.getValue(ATTACH_FACE)) { return switch (blockState.getValue(ATTACH_FACE)) {
case FLOOR -> SHAPES.get(Direction.UP); case FLOOR -> SHAPES.get(Direction.UP);
case WALL -> SHAPES.get(blockState.getValue(FACING)); case WALL -> SHAPES.get(blockState.getValue(FACING));
@@ -87,6 +88,54 @@ public class AdvancedTorchBlock extends HorizontalDirectionalBlock implements Dy
}; };
} }
@Override
public @NotNull BlockState updateShape(@NotNull BlockState stateIn, @NotNull Direction facing, @NotNull BlockState neighbourState, @NotNull LevelAccessor levelIn, @NotNull BlockPos currentPos, @NotNull BlockPos newPos) {
AttachFace attachFace = stateIn.getValue(ATTACH_FACE);
if (attachFace == AttachFace.FLOOR) {
return facing == Direction.DOWN && !this.canSurvive(stateIn, levelIn, currentPos) ? Blocks.AIR.defaultBlockState() : super.updateShape(stateIn, facing, neighbourState, levelIn, currentPos, newPos);
}
return facing.getOpposite() == stateIn.getValue(FACING) && !stateIn.canSurvive(levelIn, currentPos) ? Blocks.AIR.defaultBlockState() : stateIn;
}
@Override
public boolean canSurvive(BlockState stateIn, @NotNull LevelReader levelIn, @NotNull BlockPos currentPos) {
AttachFace attachFace = stateIn.getValue(ATTACH_FACE);
if (attachFace == AttachFace.FLOOR) {
return canSupportCenter(levelIn, currentPos.below(), Direction.UP);
}
Direction direction = stateIn.getValue(FACING);
BlockPos neighbourPos = currentPos.relative(direction.getOpposite());
BlockState currentState = levelIn.getBlockState(neighbourPos);
return currentState.isFaceSturdy(levelIn, neighbourPos, direction);
}
@Override
public void animateTick(BlockState stateIn, @NotNull Level levelIn, @NotNull BlockPos pos, @NotNull 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 @Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(LIT, ATTACH_FACE, FACING, COLOR); builder.add(LIT, ATTACH_FACE, FACING, COLOR);
@@ -105,17 +154,6 @@ public class AdvancedTorchBlock extends HorizontalDirectionalBlock implements Dy
return state.setValue(LIT, CommonRegistration.config.torchConfig.litByDefault); 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 @Override
public void toggleLight(Level worldIn, BlockState state, BlockPos pos) { public void toggleLight(Level worldIn, BlockState state, BlockPos pos) {
@@ -183,29 +221,6 @@ public class AdvancedTorchBlock extends HorizontalDirectionalBlock implements Dy
super.appendHoverText(stack, level, tooltip, options); 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 @Override
public @NotNull ItemStack getCloneItemStack(@NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull BlockState state) { public @NotNull ItemStack getCloneItemStack(@NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull BlockState state) {
return StackUtil.getColorStack(this, state.getValue(COLOR)); return StackUtil.getColorStack(this, state.getValue(COLOR));

View File

@@ -0,0 +1,183 @@
package me.hypherionmc.hyperlighting.common.blocks;
import me.hypherionmc.craterlib.api.rendering.DyableBlock;
import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.craterlib.util.BlockStateUtils;
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import me.hypherionmc.hyperlighting.common.init.HLItems;
import me.hypherionmc.hyperlighting.network.OpenGuiPacket;
import net.minecraft.ChatFormatting;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
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.DirectionProperty;
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 javax.annotation.Nullable;
import java.util.List;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class BatteryNeon extends BaseEntityBlock implements DyableBlock {
public static final BooleanProperty LIT = BlockStateProperties.LIT;
public static final DirectionProperty FACING = BlockStateProperties.FACING;
public static final EnumProperty<DyeColor> COLOR = EnumProperty.create("color", DyeColor.class);
private static final VoxelShape DOWN_BOUNDING_BOX = Block.box(0, 0.005, 7, 16, 3.005, 9);
private static final VoxelShape UP_BOUNDING_BOX = Block.box(0, 12.995, 7, 16, 15.995, 9);
private static final VoxelShape SOUTH_BOUNDING_BOX = Block.box(0, 7, 12.995, 16, 9, 15.995);
private static final VoxelShape EAST_BOUNDING_BOX = Block.box(12.995, 7, 0, 15.995, 9, 16);
private static final VoxelShape WEST_BOUNDING_BOX = Block.box(0.005, 7, 0, 3.005, 9, 16);
private static final VoxelShape NORTH_BOUNDING_BOX = Block.box(0, 7, 0.005, 16, 9, 3.005);
public BatteryNeon(String name) {
super(Properties.of(Material.GLASS).sound(SoundType.GLASS).lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(14)));
this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(COLOR, DyeColor.WHITE));
CreativeTabRegistry.setCreativeTab(CommonRegistration.LIGHTS_TAB, HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties())));
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return switch (state.getValue(FACING)) {
case UP -> DOWN_BOUNDING_BOX;
case DOWN -> UP_BOUNDING_BOX;
case NORTH -> SOUTH_BOUNDING_BOX;
case EAST -> WEST_BOUNDING_BOX;
case WEST -> EAST_BOUNDING_BOX;
case SOUTH -> NORTH_BOUNDING_BOX;
};
}
@Override
public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
if (worldIn.isClientSide) {
if (Screen.hasControlDown()) {
OpenGuiPacket openGUIPacket = new OpenGuiPacket(11, pos);
CommonRegistration.networkHandler.sendToServer(openGUIPacket);
return InteractionResult.SUCCESS;
}
} else {
if (state.getValue(LIT)) {
sendBlockUpdate(state, pos, worldIn, false);
return InteractionResult.SUCCESS;
} else {
if (worldIn.getBlockEntity(pos) != null && worldIn.getBlockEntity(pos) instanceof BatteryNeonBlockEntity be && be.getEnergyStorage().getPowerLevel() > 0) {
sendBlockUpdate(state, pos, worldIn, true);
return InteractionResult.SUCCESS;
} else {
sendBlockUpdate(state, pos, worldIn, false);
player.displayClientMessage(Component.literal("Out of power"), true);
return InteractionResult.SUCCESS;
}
}
}
return InteractionResult.SUCCESS;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(LIT, FACING, COLOR);
super.createBlockStateDefinition(builder);
}
@Nullable
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState().setValue(FACING, context.getClickedFace()).setValue(LIT, false).setValue(COLOR, DyeColor.WHITE);
}
@Override
public RenderShape getRenderShape(BlockState state) {
return RenderShape.MODEL;
}
@Override
public BlockColor dyeHandler() {
return (state, world, pos, tintIndex) -> {
if (state.getValue(LIT)) {
return state.getValue(COLOR).getMaterialColor().col;
} else {
return DyeColor.BLACK.getMaterialColor().col;
}
};
}
@Override
public DyeColor defaultDyeColor() {
return DyeColor.WHITE;
}
@Override
public void appendHoverText(ItemStack stack, @Nullable BlockGetter worldIn, List<Component> tooltip, TooltipFlag flagIn) {
tooltip.add(Component.literal(ChatFormatting.YELLOW + "Dyable"));
tooltip.add(Component.literal(ChatFormatting.GREEN + "Color: " + defaultDyeColor().name()));
tooltip.add(Component.literal(ChatFormatting.BLUE + "Colored Lighting Supported"));
super.appendHoverText(stack, worldIn, tooltip, flagIn);
}
@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new BatteryNeonBlockEntity(pos, state);
}
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState p_153213_, BlockEntityType<T> p_153214_) {
return (level1, blockPos, blockState, t) -> {
if (!level.isClientSide()) {
if (t instanceof BatteryNeonBlockEntity tile) {
tile.tick(level1, blockPos, blockState, tile);
}
}
};
}
private void sendBlockUpdate(BlockState state, BlockPos pos, Level worldIn, boolean litState) {
BlockState oldState = state;
state = state.setValue(LIT, litState);
worldIn.setBlock(pos, state, 2);
worldIn.sendBlockUpdated(pos, oldState, state, 4);
}
@Override
public List<ItemStack> getDrops(BlockState blockState, LootContext.Builder lootBuilder) {
return List.of(new ItemStack(this));
}
}

View File

@@ -0,0 +1,73 @@
package me.hypherionmc.hyperlighting.common.blocks;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.craterlib.util.BlockStateUtils;
import me.hypherionmc.hyperlighting.api.LightableBlock;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import me.hypherionmc.hyperlighting.common.init.HLItems;
import me.hypherionmc.hyperlighting.common.init.HLSounds;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.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.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
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.DirectionProperty;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
public class PumpkinTrioBlock extends Block implements LightableBlock {
public static final BooleanProperty LIT = BlockStateProperties.LIT;
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
private static final VoxelShape BOUNDING_BOX = Block.box(0, 0, 0, 16, 0.256, 16);
public PumpkinTrioBlock(String name) {
super(Properties.of(Material.VEGETABLE).sound(SoundType.LILY_PAD).lightLevel(BlockStateUtils.createLightLevelFromLitBlockState(10)));
this.registerDefaultState(this.defaultBlockState().setValue(LIT, CommonRegistration.config.pumpkinTrioConfig.litByDefault).setValue(FACING, Direction.NORTH));
CreativeTabRegistry.setCreativeTab(CommonRegistration.LIGHTS_TAB, HLItems.register(name, () -> new BlockItem(this, new Item.Properties())));
}
@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
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING, LIT);
super.createBlockStateDefinition(builder);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
return BOUNDING_BOX;
}
@Nullable
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
Direction face = context.getPlayer().getDirection();
return this.defaultBlockState().setValue(FACING, face).setValue(LIT, CommonRegistration.config.pumpkinTrioConfig.litByDefault);
}
}

View File

@@ -0,0 +1,73 @@
package me.hypherionmc.hyperlighting.common.blocks;
import me.hypherionmc.craterlib.common.item.BlockItemDyable;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.hyperlighting.common.blockentities.SolarPanelBlockEntity;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import me.hypherionmc.hyperlighting.common.init.HLItems;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
import java.util.List;
/**
* @author HypherionSA
* @date 18/09/2022
*/
public class SolarPanel extends BaseEntityBlock {
private final VoxelShape BOUNDS = Block.box(0, 0, 0, 16, 1.92, 16);
public SolarPanel(String name) {
super(Properties.of(Material.GLASS).sound(SoundType.GLASS).noCollission().noOcclusion());
CreativeTabRegistry.setCreativeTab(CommonRegistration.MACHINES_TAB, HLItems.register(name, () -> new BlockItemDyable(this, new Item.Properties())));
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter blockGetter, BlockPos pos, CollisionContext context) {
return BOUNDS;
}
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
return (level1, blockPos, blockState1, t) -> {
if (!level1.isClientSide() && t instanceof SolarPanelBlockEntity be) {
be.tick(level1, blockPos, blockState1, be);
}
};
}
@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
return new SolarPanelBlockEntity(blockPos, blockState);
}
@Override
public RenderShape getRenderShape(BlockState state) {
return RenderShape.MODEL;
}
@Override
public List<ItemStack> getDrops(BlockState blockState, LootContext.Builder lootBuilder) {
return List.of(new ItemStack(this));
}
}

View File

@@ -0,0 +1,107 @@
package me.hypherionmc.hyperlighting.common.containers;
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
import me.hypherionmc.hyperlighting.common.init.HLContainers;
import me.hypherionmc.hyperlighting.common.items.WirelessBattery;
import net.minecraft.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.DyeItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class BatteryNeonContainer extends AbstractContainerMenu {
private final BatteryNeonBlockEntity blockEntity;
public BatteryNeonContainer(int windowID, Inventory inventory, FriendlyByteBuf buf) {
this(windowID, inventory.player.level, buf.readBlockPos(), inventory);
}
public BatteryNeonContainer(int windowID, Level level, BlockPos pos, Inventory inventory) {
super(HLContainers.BATTERY_NEON.get(), windowID);
this.blockEntity = (BatteryNeonBlockEntity) level.getBlockEntity(pos);
Container inventory1 = blockEntity.getInventory().getItemHandler();
this.addSlot(new Slot(inventory1, 0, 27, 20));
this.addSlot(new Slot(inventory1, 1, 7, 20));
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
this.addSlot(new Slot(inventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
}
}
for (int x = 0; x < 9; x++) {
this.addSlot(new Slot(inventory, x, 8 + x * 18, 142));
}
}
@Override
public boolean stillValid(Player playerIn) {
return true;
}
@Override
public void broadcastChanges() {
super.broadcastChanges();
}
@Override
public ItemStack quickMoveStack(Player playerIn, int index) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = this.slots.get(index);
if (slot != null && slot.hasItem()) {
ItemStack itemstack1 = slot.getItem();
itemstack = itemstack1.copy();
if (index == 0) {
if (!this.moveItemStackTo(itemstack1, 1, 38, true)) {
return ItemStack.EMPTY;
}
slot.onQuickCraft(itemstack1, itemstack);
} if (index == 1) {
if (!this.moveItemStackTo(itemstack1, 2, 38, true)) {
return ItemStack.EMPTY;
}
slot.onQuickCraft(itemstack1, itemstack);
} else {
if (itemstack1.getItem() instanceof DyeItem) {
if (!this.moveItemStackTo(itemstack1, 0, 1, false)) {
return ItemStack.EMPTY;
}
} else if (itemstack1.getItem() instanceof WirelessBattery) {
if (!this.moveItemStackTo(itemstack1, 1, 2, false)) {
return ItemStack.EMPTY;
}
}
}
if (itemstack1.isEmpty()) {
slot.set(ItemStack.EMPTY);
} else {
slot.setChanged();
}
if (itemstack1.getCount() == itemstack.getCount()) {
return ItemStack.EMPTY;
}
slot.onTake(playerIn, itemstack1);
}
return itemstack;
}
public BatteryNeonBlockEntity getBlockEntity() {
return blockEntity;
}
}

View File

@@ -1,9 +1,11 @@
package me.hypherionmc.hyperlighting.common.init; package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.client.gui.tabs.CreativeTabBuilder; import me.hypherionmc.craterlib.api.inventory.CraterCreativeModeTab;
import me.hypherionmc.craterlib.network.CraterNetworkHandler;
import me.hypherionmc.craterlib.platform.Platform;
import me.hypherionmc.hyperlighting.client.config.HyperLightingClientConfig; import me.hypherionmc.hyperlighting.client.config.HyperLightingClientConfig;
import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations; import me.hypherionmc.hyperlighting.integration.HyperLightingIntegrations;
import net.minecraft.world.item.CreativeModeTab; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import static me.hypherionmc.hyperlighting.Constants.MOD_ID; import static me.hypherionmc.hyperlighting.Constants.MOD_ID;
@@ -11,7 +13,10 @@ import static me.hypherionmc.hyperlighting.Constants.MOD_ID;
public class CommonRegistration { public class CommonRegistration {
public static HyperLightingClientConfig config = new HyperLightingClientConfig(); public static HyperLightingClientConfig config = new HyperLightingClientConfig();
public static final CreativeModeTab LIGHTS_TAB = CreativeTabBuilder.builder(MOD_ID, "lighting").setIcon(() -> new ItemStack(HLBlocks.ADVANCED_LANTERN)).build(); public static final CraterCreativeModeTab LIGHTS_TAB = new CraterCreativeModeTab.Builder(new ResourceLocation(MOD_ID, "lighting")).setIcon(() -> new ItemStack(HLBlocks.ADVANCED_LANTERN)).build();
public static final CraterCreativeModeTab MACHINES_TAB = new CraterCreativeModeTab.Builder(new ResourceLocation(MOD_ID, "machines")).setIcon(() -> new ItemStack(HLBlocks.ADVANCED_TORCH)).build();
public static CraterNetworkHandler networkHandler = Platform.COMMON_HELPER.createPacketHandler(MOD_ID);
public static void registerAll() { public static void registerAll() {
HLSounds.loadAll(); HLSounds.loadAll();
@@ -20,7 +25,9 @@ public class CommonRegistration {
HLItems.loadAll(); HLItems.loadAll();
HLBlockEntities.loadAll(); HLBlockEntities.loadAll();
HLEntities.loadAll(); HLEntities.loadAll();
HLContainers.loadAll();
HyperLightingIntegrations.registerCommon(); HyperLightingIntegrations.registerCommon();
HLPackets.registerServer();
} }
} }

View File

@@ -4,7 +4,9 @@ import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.craterlib.systems.reg.RegistryObject; import me.hypherionmc.craterlib.systems.reg.RegistryObject;
import me.hypherionmc.hyperlighting.Constants; import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.blockentities.AdvancedCampfireBlockEntity; import me.hypherionmc.hyperlighting.common.blockentities.AdvancedCampfireBlockEntity;
import net.minecraft.core.Registry; import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
import me.hypherionmc.hyperlighting.common.blockentities.SolarPanelBlockEntity;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
/** /**
@@ -13,9 +15,13 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
*/ */
public class HLBlockEntities { public class HLBlockEntities {
public static final RegistrationProvider<BlockEntityType<?>> BE = RegistrationProvider.get(Registry.BLOCK_ENTITY_TYPE, Constants.MOD_ID); public static final RegistrationProvider<BlockEntityType<?>> BE = RegistrationProvider.get(BuiltInRegistries.BLOCK_ENTITY_TYPE, Constants.MOD_ID);
public static RegistryObject<BlockEntityType<AdvancedCampfireBlockEntity>> CAMPFIRE = BE.register("campfire", () -> BlockEntityType.Builder.of(AdvancedCampfireBlockEntity::new, HLBlocks.ADVANCED_CAMPFIRE.get()).build(null)); public static RegistryObject<BlockEntityType<AdvancedCampfireBlockEntity>> CAMPFIRE = BE.register("campfire", () -> BlockEntityType.Builder.of(AdvancedCampfireBlockEntity::new, HLBlocks.ADVANCED_CAMPFIRE.get()).build(null));
public static RegistryObject<BlockEntityType<SolarPanelBlockEntity>> SOLAR_PANEL = BE.register("solar_panel", () -> BlockEntityType.Builder.of(SolarPanelBlockEntity::new, HLBlocks.SOLAR_PANEL.get()).build(null));
public static RegistryObject<BlockEntityType<BatteryNeonBlockEntity>> BATTERY_NEON = BE.register("battery_neon", () -> BlockEntityType.Builder.of(BatteryNeonBlockEntity::new, HLBlocks.BATTERY_NEON.get()).build(null));
public static void loadAll() {} public static void loadAll() {}
} }

View File

@@ -3,11 +3,8 @@ package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.systems.reg.BlockRegistryObject; import me.hypherionmc.craterlib.systems.reg.BlockRegistryObject;
import me.hypherionmc.craterlib.systems.reg.RegistrationProvider; import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.hyperlighting.Constants; import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedCandleBlock; import me.hypherionmc.hyperlighting.common.blocks.*;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedCampfire; import net.minecraft.core.registries.BuiltInRegistries;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedLanternBlock;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedTorchBlock;
import net.minecraft.core.Registry;
import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
@@ -15,7 +12,7 @@ import java.util.function.Supplier;
public class HLBlocks { public class HLBlocks {
public static RegistrationProvider<Block> BLOCKS = RegistrationProvider.get(Registry.BLOCK_REGISTRY, Constants.MOD_ID); public static RegistrationProvider<Block> BLOCKS = RegistrationProvider.get(BuiltInRegistries.BLOCK, Constants.MOD_ID);
/* Torches */ /* Torches */
public static BlockRegistryObject<Block> ADVANCED_TORCH = register("advanced_torch", () -> new AdvancedTorchBlock("advanced_torch", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB)); public static BlockRegistryObject<Block> ADVANCED_TORCH = register("advanced_torch", () -> new AdvancedTorchBlock("advanced_torch", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB));
@@ -30,6 +27,14 @@ public class HLBlocks {
/* Candles */ /* Candles */
public static BlockRegistryObject<Block> ADVANCED_CANDLE = register("advanced_candle", () -> new AdvancedCandleBlock("advanced_candle", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB)); public static BlockRegistryObject<Block> ADVANCED_CANDLE = register("advanced_candle", () -> new AdvancedCandleBlock("advanced_candle", DyeColor.ORANGE, CommonRegistration.LIGHTS_TAB));
/* Machines */
public static BlockRegistryObject<Block> SOLAR_PANEL = register("solar_panel", () -> new SolarPanel("solar_panel"));
/* Other */
public static BlockRegistryObject<Block> BATTERY_NEON = register("battery_neon", () -> new BatteryNeon("battery_neon"));
public static BlockRegistryObject<Block> PUMPKIN_TRIO = register("pumpkin_trio", () -> new PumpkinTrioBlock("pumpkin_trio"));
public static BlockRegistryObject<Block> PUMPKIN_TRIO_INVERTED = register("pumpkin_trio_inverted", () -> new PumpkinTrioBlock("pumpkin_trio_inverted"));
public static void loadAll() {} public static void loadAll() {}
public static <B extends Block> BlockRegistryObject<B> register(String name, Supplier<? extends B> block) { public static <B extends Block> BlockRegistryObject<B> register(String name, Supplier<? extends B> block) {

View File

@@ -0,0 +1,27 @@
package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.platform.Platform;
import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.craterlib.systems.reg.RegistryObject;
import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.containers.BatteryNeonContainer;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.MenuType;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class HLContainers {
public static RegistrationProvider<MenuType<?>> CONTAINERS = RegistrationProvider.get(BuiltInRegistries.MENU, Constants.MOD_ID);
public static final RegistryObject<MenuType<BatteryNeonContainer>> BATTERY_NEON = register("battery_neon", Platform.COMMON_HELPER.createMenuType(BatteryNeonContainer::new));
public static <T extends AbstractContainerMenu> RegistryObject<MenuType<T>> register(String key, MenuType<T> builder) {
return CONTAINERS.register(key, () -> builder);
}
public static void loadAll() {}
}

View File

@@ -4,7 +4,7 @@ import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.craterlib.systems.reg.RegistryObject; import me.hypherionmc.craterlib.systems.reg.RegistryObject;
import me.hypherionmc.hyperlighting.Constants; import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.entities.NeonFlyEntity; import me.hypherionmc.hyperlighting.common.entities.NeonFlyEntity;
import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory; import net.minecraft.world.entity.MobCategory;
@@ -14,7 +14,7 @@ import net.minecraft.world.entity.MobCategory;
*/ */
public class HLEntities { public class HLEntities {
public static final RegistrationProvider<EntityType<?>> ENTITIES = RegistrationProvider.get(Registry.ENTITY_TYPE, Constants.MOD_ID); public static final RegistrationProvider<EntityType<?>> ENTITIES = RegistrationProvider.get(BuiltInRegistries.ENTITY_TYPE, Constants.MOD_ID);
public static final RegistryObject<EntityType<NeonFlyEntity>> NEONFLY = ENTITIES.register("neonfly", () -> EntityType.Builder.of(NeonFlyEntity::new, MobCategory.AMBIENT) public static final RegistryObject<EntityType<NeonFlyEntity>> NEONFLY = ENTITIES.register("neonfly", () -> EntityType.Builder.of(NeonFlyEntity::new, MobCategory.AMBIENT)
.sized(1f, 1f) .sized(1f, 1f)

View File

@@ -3,18 +3,26 @@ package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.systems.reg.RegistrationProvider; import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.craterlib.systems.reg.RegistryObject; import me.hypherionmc.craterlib.systems.reg.RegistryObject;
import me.hypherionmc.hyperlighting.Constants; import me.hypherionmc.hyperlighting.Constants;
import me.hypherionmc.hyperlighting.common.items.CandleInAJar;
import me.hypherionmc.hyperlighting.common.items.LighterTool; import me.hypherionmc.hyperlighting.common.items.LighterTool;
import net.minecraft.core.Registry; import me.hypherionmc.hyperlighting.common.items.WirelessBattery;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import java.util.function.Supplier; import java.util.function.Supplier;
public class HLItems { public class HLItems {
public static final RegistrationProvider<Item> ITEMS = RegistrationProvider.get(Registry.ITEM_REGISTRY, Constants.MOD_ID); public static final RegistrationProvider<Item> ITEMS = RegistrationProvider.get(BuiltInRegistries.ITEM, Constants.MOD_ID);
/* Tools */ /* Tools */
public static RegistryObject<Item> TORCH_TOOL = register("lighter_tool", LighterTool::new); public static RegistryObject<Item> TORCH_TOOL = register("lighter_tool", LighterTool::new);
/* Machines */
public static RegistryObject<Item> WIRELESS_BATTERY = register("wireless_battery", WirelessBattery::new);
/* Lights */
public static RegistryObject<Item> CANDLE_IN_A_JAR = register("candle_jar", CandleInAJar::new);
public static void loadAll() {} public static void loadAll() {}
public static <T extends Item> RegistryObject<T> register(String name, Supplier<? extends T> item) { public static <T extends Item> RegistryObject<T> register(String name, Supplier<? extends T> item) {

View File

@@ -0,0 +1,20 @@
package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.network.PacketDirection;
import me.hypherionmc.hyperlighting.network.OpenGuiPacket;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class HLPackets {
public static void registerServer() {
CommonRegistration.networkHandler.registerPacket(OpenGuiPacket.class, OpenGuiPacket::new, PacketDirection.TO_SERVER);
}
public static void registerClient() {
}
}

View File

@@ -3,14 +3,14 @@ package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.systems.reg.RegistrationProvider; import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.craterlib.systems.reg.RegistryObject; import me.hypherionmc.craterlib.systems.reg.RegistryObject;
import me.hypherionmc.hyperlighting.Constants; import me.hypherionmc.hyperlighting.Constants;
import net.minecraft.core.Registry;
import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.ParticleType;
import net.minecraft.core.registries.BuiltInRegistries;
import java.util.function.Supplier; import java.util.function.Supplier;
public class HLParticles { public class HLParticles {
public static final RegistrationProvider<ParticleType<?>> PARTICLES = RegistrationProvider.get(Registry.PARTICLE_TYPE_REGISTRY, Constants.MOD_ID); public static final RegistrationProvider<ParticleType<?>> PARTICLES = RegistrationProvider.get(BuiltInRegistries.PARTICLE_TYPE, Constants.MOD_ID);
public static <T extends ParticleType<?>> RegistryObject<T> register(String name, Supplier<T> particle) { public static <T extends ParticleType<?>> RegistryObject<T> register(String name, Supplier<T> particle) {
return PARTICLES.register(name, particle); return PARTICLES.register(name, particle);

View File

@@ -3,7 +3,7 @@ package me.hypherionmc.hyperlighting.common.init;
import me.hypherionmc.craterlib.systems.reg.RegistrationProvider; import me.hypherionmc.craterlib.systems.reg.RegistrationProvider;
import me.hypherionmc.craterlib.systems.reg.RegistryObject; import me.hypherionmc.craterlib.systems.reg.RegistryObject;
import me.hypherionmc.hyperlighting.Constants; import me.hypherionmc.hyperlighting.Constants;
import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
/** /**
@@ -12,13 +12,13 @@ import net.minecraft.sounds.SoundEvent;
*/ */
public class HLSounds { public class HLSounds {
public static final RegistrationProvider<SoundEvent> SOUNDS = RegistrationProvider.get(Registry.SOUND_EVENT, Constants.MOD_ID); public static final RegistrationProvider<SoundEvent> SOUNDS = RegistrationProvider.get(BuiltInRegistries.SOUND_EVENT, Constants.MOD_ID);
public static RegistryObject<SoundEvent> TORCH_IGNITE = createSound("block.torch_ignite"); public static RegistryObject<SoundEvent> TORCH_IGNITE = createSound("block.torch_ignite");
public static RegistryObject<SoundEvent> createSound(String location) { public static RegistryObject<SoundEvent> createSound(String location) {
final var soundLocation = Constants.rl(location); final var soundLocation = Constants.rl(location);
return SOUNDS.register(location, () -> new SoundEvent(soundLocation)); return SOUNDS.register(location, () -> SoundEvent.createVariableRangeEvent(soundLocation));
} }
public static void loadAll() {} public static void loadAll() {}

View File

@@ -0,0 +1,23 @@
package me.hypherionmc.hyperlighting.common.items;
import me.hypherionmc.craterlib.platform.Platform;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import net.minecraft.world.item.Item;
/**
* @author HypherionSA
* @date 25/09/2022
*/
public class CandleInAJar extends Item {
private static final Properties shimmerLoaded = new Properties(); //.tab(CommonRegistration.LIGHTS_TAB);
public CandleInAJar() {
super(new Properties().stacksTo(1));
if (Platform.LOADER.isModLoaded("shimmer")) {
CreativeTabRegistry.setCreativeTab(CommonRegistration.LIGHTS_TAB, () -> this);
}
}
}

View File

@@ -1,5 +1,6 @@
package me.hypherionmc.hyperlighting.common.items; package me.hypherionmc.hyperlighting.common.items;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.hyperlighting.api.LightableBlock; import me.hypherionmc.hyperlighting.api.LightableBlock;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration; import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
@@ -10,7 +11,8 @@ import net.minecraft.world.level.block.state.BlockState;
public class LighterTool extends Item { public class LighterTool extends Item {
public LighterTool() { public LighterTool() {
super(new Properties().stacksTo(1).tab(CommonRegistration.LIGHTS_TAB).durability(20)); super(new Properties().stacksTo(1)/*.tab(CommonRegistration.LIGHTS_TAB)*/.durability(20));
CreativeTabRegistry.setCreativeTab(CommonRegistration.LIGHTS_TAB, () -> this);
} }
@Override @Override

View File

@@ -0,0 +1,80 @@
package me.hypherionmc.hyperlighting.common.items;
import me.hypherionmc.craterlib.systems.internal.CreativeTabRegistry;
import me.hypherionmc.hyperlighting.api.SwitchModule;
import me.hypherionmc.hyperlighting.common.blocks.SolarPanel;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class WirelessBattery extends Item implements SwitchModule {
public WirelessBattery() {
super(new Properties().stacksTo(1));
CreativeTabRegistry.setCreativeTab(CommonRegistration.MACHINES_TAB, () -> this);
}
@Override
public void onCraftedBy(ItemStack stack, Level level, Player player) {
super.onCraftedBy(stack, level, player);
if (!stack.hasTag()) {
stack.setTag(new CompoundTag());
}
}
@Override
public InteractionResult useOn(UseOnContext context) {
Level level = context.getLevel();
Player player = context.getPlayer();
BlockPos pos = context.getClickedPos();
InteractionHand hand = context.getHand();
if (!level.isClientSide()) {
if (player.getItemInHand(hand).getItem() instanceof WirelessBattery) {
ItemStack stack = player.getItemInHand(hand);
CompoundTag tag = stack.getOrCreateTag();
tag.put("linked_pos", NbtUtils.writeBlockPos(pos));
stack.setTag(tag);
player.displayClientMessage(Component.literal("Linked to " + pos), false);
} else {
ItemStack stack = player.getItemInHand(hand);
if (isLinked(stack, level)) {
player.displayClientMessage(Component.literal("Linked to block " + getLinkedPos(stack)), false);
} else {
player.displayClientMessage(Component.literal("Not linked"), false);
}
return InteractionResult.PASS;
}
}
return InteractionResult.SUCCESS;
}
public boolean isLinked(ItemStack stack, Level level) {
CompoundTag compound = stack.getOrCreateTag();
if (compound.getCompound("linked_pos") != null && stack.getItem() instanceof WirelessBattery) {
BlockPos pos = getLinkedPos(stack);
return level.getBlockState(pos).getBlock() instanceof SolarPanel;
} else {
return false;
}
}
public BlockPos getLinkedPos(ItemStack stack) {
CompoundTag compound = stack.getOrCreateTag();
return NbtUtils.readBlockPos(compound.getCompound("linked_pos"));
}
}

View File

@@ -1,6 +1,6 @@
package me.hypherionmc.hyperlighting.integration; package me.hypherionmc.hyperlighting.integration;
import me.hypherionmc.craterlib.platform.Services; import me.hypherionmc.craterlib.platform.Platform;
import me.hypherionmc.hyperlighting.integration.shimmer.HyperLightingShimmer; import me.hypherionmc.hyperlighting.integration.shimmer.HyperLightingShimmer;
/** /**
@@ -14,7 +14,7 @@ public class HyperLightingIntegrations {
} }
public static void registerClient() { public static void registerClient() {
if (Services.PLATFORM.isModLoaded("shimmer")) { if (Platform.LOADER.isModLoaded("shimmer")) {
HyperLightingShimmer.registerAll(); HyperLightingShimmer.registerAll();
} }
} }

View File

@@ -1,16 +1,5 @@
package me.hypherionmc.hyperlighting.integration.shimmer; 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.AdvancedCampfire;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedLanternBlock;
import me.hypherionmc.hyperlighting.common.blocks.AdvancedTorchBlock;
import me.hypherionmc.hyperlighting.common.init.CommonRegistration;
import me.hypherionmc.hyperlighting.common.init.HLBlocks;
import net.minecraft.world.item.DyeColor;
/** /**
* @author HypherionSA * @author HypherionSA
* @date 07/08/2022 * @date 07/08/2022
@@ -23,12 +12,14 @@ public class HyperLightingShimmer {
} }
private static void 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_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))); //LightManager.INSTANCE.registerItemLight(HLBlocks.ADVANCED_LANTERN.asItem(), stack -> new ColorPointLight.Template(stack.getCount() / 10 + 6, RenderUtils.alphaColorFromDye(((BlockItemDyable)stack.getItem()).getColor(stack), 1f)));
//LightManager.INSTANCE.registerItemLight(HLItems.CANDLE_IN_A_JAR.get(), stack -> new ColorPointLight.Template(10, RenderUtils.alphaColorFromDye(DyeColor.WHITE, 1f)));
} }
private static void registerBlocks() { private static void registerBlocks() {
LightManager.INSTANCE.registerBlockLight(HLBlocks.ADVANCED_TORCH.get(), (state, blockPos) -> { /*LightManager.INSTANCE.registerBlockLight(HLBlocks.ADVANCED_TORCH.get(), (state, blockPos) -> {
if (state.getValue(AdvancedTorchBlock.LIT) && CommonRegistration.config.torchConfig.coloredLighting) { if (state.getValue(AdvancedTorchBlock.LIT) && CommonRegistration.config.torchConfig.coloredLighting) {
DyeColor color = state.getValue(AdvancedTorchBlock.COLOR); DyeColor color = state.getValue(AdvancedTorchBlock.COLOR);
return new ColorPointLight.Template(10, RenderUtils.alphaColorFromDye(color, 1f)); return new ColorPointLight.Template(10, RenderUtils.alphaColorFromDye(color, 1f));
@@ -51,6 +42,14 @@ public class HyperLightingShimmer {
} }
return null; return null;
}); });
LightManager.INSTANCE.registerBlockLight(HLBlocks.ADVANCED_CANDLE.get(), (state, blockPos) -> {
if (state.getValue(AdvancedCandleBlock.LIT) && CommonRegistration.config.candleConfig.coloredLighting) {
DyeColor color = state.getValue(AdvancedCandleBlock.COLOR);
return new ColorPointLight.Template(10, RenderUtils.alphaColorFromDye(color, 1f));
}
return null;
});*/
} }
} }

View File

@@ -0,0 +1,23 @@
package me.hypherionmc.hyperlighting.mixin.access;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.MenuAccess;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.MenuType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
/**
* @author HypherionSA
* @date 24/09/2022
*/
@Mixin(MenuScreens.class)
public interface MenuScreensAccess {
@Invoker("register")
static <M extends AbstractContainerMenu, U extends Screen & MenuAccess<M>> void crater_register(MenuType<? extends M> p_216911_0_, MenuScreens.ScreenConstructor<M, U> p_216911_1_) {
throw new Error("Mixin did not apply!");
}
}

View File

@@ -0,0 +1,78 @@
package me.hypherionmc.hyperlighting.network;
import me.hypherionmc.craterlib.network.CraterPacket;
import me.hypherionmc.craterlib.platform.Platform;
import me.hypherionmc.hyperlighting.common.blockentities.BatteryNeonBlockEntity;
import me.hypherionmc.hyperlighting.common.containers.BatteryNeonContainer;
import net.minecraft.core.BlockPos;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.block.entity.BlockEntity;
import org.jetbrains.annotations.Nullable;
/**
* @author HypherionSA
* @date 24/09/2022
*/
public class OpenGuiPacket implements CraterPacket<OpenGuiPacket> {
private BlockPos posToSet;
private int guiid;
public OpenGuiPacket() {}
public OpenGuiPacket(int id, BlockPos pos) {
this.posToSet = pos;
this.guiid = id;
}
@Override
public void write(FriendlyByteBuf friendlyByteBuf) {
friendlyByteBuf.writeBlockPos(posToSet);
friendlyByteBuf.writeInt(guiid);
}
@Override
public void read(FriendlyByteBuf friendlyByteBuf) {
this.posToSet = friendlyByteBuf.readBlockPos();
this.guiid = friendlyByteBuf.readInt();
}
@Override
public PacketHandler createHandler() {
return new PacketHandler() {
@Override
public void handle(CraterPacket packet, Player player, Object o) {
BlockEntity be = player.level.getBlockEntity(posToSet);
MenuProvider containerProvider = new MenuProvider() {
@Override
public Component getDisplayName() {
if (be instanceof BatteryNeonBlockEntity) {
return Component.translatable("block.hyperlighting.battery_neon");
}
return null;
}
@Nullable
@Override
public AbstractContainerMenu createMenu(int i, Inventory inventory, Player player) {
if (be instanceof BatteryNeonBlockEntity) {
return new BatteryNeonContainer(i, player.level, posToSet, inventory);
}
return null;
}
};
if (containerProvider.getDisplayName() != null) {
Platform.COMMON_HELPER.openMenu((ServerPlayer) player, containerProvider, buf -> buf.writeBlockPos(posToSet));
}
}
};
}
}

View File

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

@@ -0,0 +1,16 @@
{
"variants": {
"facing=up,lit=true": { "model": "hyperlighting:block/solar_neon", "uvlock": true },
"facing=down,lit=true": { "model": "hyperlighting:block/solar_neon", "uvlock": true, "x": 180 },
"facing=east,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 270 },
"facing=west,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 90 },
"facing=south,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true },
"facing=north,lit=true": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "x": 180 },
"facing=up,lit=false": { "model": "hyperlighting:block/solar_neon", "uvlock": true },
"facing=down,lit=false": { "model": "hyperlighting:block/solar_neon", "uvlock": true, "x": 180 },
"facing=east,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 270 },
"facing=west,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "y": 90 },
"facing=south,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true },
"facing=north,lit=false": { "model": "hyperlighting:block/solar_neon_wall", "uvlock": true, "x": 180 }
}
}

View File

@@ -0,0 +1,12 @@
{
"variants": {
"facing=north,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio", "y": 180 },
"facing=south,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio" },
"facing=east,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio", "y": 270 },
"facing=west,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio", "y": 90 },
"facing=north,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio", "y": 180 },
"facing=south,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio" },
"facing=east,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio", "y": 270 },
"facing=west,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio", "y": 90 }
}
}

View File

@@ -0,0 +1,12 @@
{
"variants": {
"facing=north,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio_inverted", "y": 180 },
"facing=south,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio_inverted" },
"facing=east,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio_inverted", "y": 270 },
"facing=west,lit=true": { "model": "hyperlighting:block/jack_o_lantern_trio_inverted", "y": 90 },
"facing=north,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio_inverted", "y": 180 },
"facing=south,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio_inverted" },
"facing=east,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio_inverted", "y": 270 },
"facing=west,lit=false": { "model": "hyperlighting:block/carved_pumpkin_trio_inverted", "y": 90 }
}
}

View File

@@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "hyperlighting:block/solar_panel" }
}
}

View File

@@ -3,17 +3,33 @@
"block.hyperlighting.advanced_lantern": "Advanced Lantern (%s)", "block.hyperlighting.advanced_lantern": "Advanced Lantern (%s)",
"block.hyperlighting.advanced_candle": "Advanced Candle (%s)", "block.hyperlighting.advanced_candle": "Advanced Candle (%s)",
"block.hyperlighting.advanced_campfire": "Advanced Campfire (%s)", "block.hyperlighting.advanced_campfire": "Advanced Campfire (%s)",
"block.hyperlighting.solar_panel": "Solar Panel",
"block.hyperlighting.battery_neon": "Battery Fluorescent Light",
"block.hyperlighting.pumpkin_trio": "Jack-o'-Lantern Trio",
"block.hyperlighting.pumpkin_trio_inverted": "Jack-o'-Lantern Trio (Inverted)",
"item.hyperlighting.lighter_tool": "Torch Lighter Tool", "item.hyperlighting.lighter_tool": "Torch Lighter Tool",
"item.hyperlighting.wireless_battery": "Wireless Battery",
"item.hyperlighting.candle_jar": "Candle In A Jar",
"subtitles.torch_ignite": "Flame Ignite Sound", "subtitles.torch_ignite": "Flame Ignite Sound",
"entity.hyperlighting.neonfly": "Neon Fly", "entity.hyperlighting.neonfly": "Neon Fly",
"cl.hyperlightingconfig.title": "Hyper Lighting Config", "cl.hyperlightingclientconfig.title": "Hyper Lighting Config",
"cl.torchconfig.litbydefault": "Lit when Placed", "cl.torchconfig.litbydefault": "Lit when Placed",
"cl.torchconfig.requirestool": "Requires Torch Lighter", "cl.torchconfig.requirestool": "Requires Torch Lighter",
"cl.torchconfig.coloredlighting": "Shimmer Integration",
"cl.lanternconfig.litbydefault": "Lit when Placed", "cl.lanternconfig.litbydefault": "Lit when Placed",
"cl.lanternconfig.requirestool": "Requires Torch Lighter", "cl.lanternconfig.requirestool": "Requires Torch Lighter",
"itemGroup.hyperlighting.lighting": "Hyper Lighting (Lights)" "cl.lanternconfig.coloredlighting": "Shimmer Integration",
"cl.campfireconfig.litbydefault": "Lit when Placed",
"cl.campfireconfig.requirestool": "Requires Torch Lighter",
"cl.campfireconfig.coloredlighting": "Shimmer Integration",
"cl.candleconfig.litbydefault": "Lit when Placed",
"cl.candleconfig.requirestool": "Requires Torch Lighter",
"cl.candleconfig.coloredlighting": "Shimmer Integration",
"itemGroup.hyperlighting.lighting": "Hyper Lighting (Lights)",
"itemGroup.hyperlighting.machines": "Hyper Lighting (Machines)"
} }

View File

@@ -0,0 +1,230 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "hyperlighting:block/candle/base/advanced_candle",
"particle": "hyperlighting:block/candle/base/advanced_candle"
},
"elements": [
{
"from": [6, 0, 5],
"to": [9, 10, 6],
"faces": {
"north": {"uv": [7, 0, 10, 10], "texture": "#0"},
"east": {"uv": [6, 0, 7, 10], "texture": "#0"},
"south": {"uv": [7, 0, 10, 10], "texture": "#0"},
"west": {"uv": [5, 0, 6, 10], "texture": "#0"},
"up": {"uv": [11, 0, 14, 1], "texture": "#0"},
"down": {"uv": [0, 11, 3, 12], "texture": "#0"}
}
},
{
"from": [6, 0, 9],
"to": [9, 10, 10],
"faces": {
"north": {"uv": [7, 0, 10, 10], "texture": "#0"},
"east": {"uv": [5, 0, 6, 10], "texture": "#0"},
"south": {"uv": [7, 0, 10, 10], "texture": "#0"},
"west": {"uv": [6, 0, 7, 10], "texture": "#0"},
"up": {"uv": [11, 4, 14, 5], "texture": "#0"},
"down": {"uv": [0, 11, 3, 12], "texture": "#0"}
}
},
{
"from": [6, 0, 6],
"to": [9, 10, 9],
"faces": {
"north": {"uv": [7, 0, 10, 10], "texture": "#0"},
"east": {"uv": [2, 0, 5, 10], "texture": "#0"},
"south": {"uv": [7, 0, 10, 10], "texture": "#0"},
"west": {"uv": [2, 0, 5, 10], "texture": "#0"},
"up": {"uv": [11, 1, 14, 4], "texture": "#0"},
"down": {"uv": [0, 11, 3, 14], "texture": "#0"}
}
},
{
"from": [5, 0, 6],
"to": [6, 10, 9],
"faces": {
"north": {"uv": [1, 0, 2, 10], "texture": "#0"},
"east": {"uv": [2, 0, 5, 10], "texture": "#0"},
"south": {"uv": [0, 0, 1, 10], "texture": "#0"},
"west": {"uv": [2, 0, 5, 10], "texture": "#0"},
"up": {"uv": [10, 4, 11, 1], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 11, 1, 14], "texture": "#0"}
}
},
{
"from": [9, 0, 6],
"to": [10, 10, 9],
"faces": {
"north": {"uv": [0, 0, 1, 10], "texture": "#0"},
"east": {"uv": [2, 0, 5, 10], "texture": "#0"},
"south": {"uv": [1, 0, 2, 10], "texture": "#0"},
"west": {"uv": [2, 0, 5, 10], "texture": "#0"},
"up": {"uv": [14, 1, 15, 4], "texture": "#0"},
"down": {"uv": [0, 11, 1, 14], "texture": "#0"}
}
},
{
"from": [10, 0, 6],
"to": [11, 1, 10],
"faces": {
"north": {"uv": [0, 10, 1, 11], "texture": "#0"},
"east": {"uv": [0, 10, 4, 11], "texture": "#0"},
"south": {"uv": [0, 10, 1, 11], "texture": "#0"},
"west": {"uv": [0, 10, 4, 11], "texture": "#0"},
"up": {"uv": [0, 10, 1, 14], "texture": "#0"},
"down": {"uv": [0, 10, 1, 14], "texture": "#0"}
}
},
{
"from": [4, 0, 5],
"to": [5, 1, 7],
"faces": {
"north": {"uv": [1, 11, 2, 12], "texture": "#0"},
"east": {"uv": [1, 11, 3, 12], "texture": "#0"},
"south": {"uv": [1, 11, 2, 12], "texture": "#0"},
"west": {"uv": [1, 11, 3, 12], "texture": "#0"},
"up": {"uv": [1, 11, 2, 13], "texture": "#0"},
"down": {"uv": [1, 11, 2, 13], "texture": "#0"}
}
},
{
"from": [7, 0, 10],
"to": [10, 1, 11],
"faces": {
"north": {"uv": [4, 10, 7, 11], "texture": "#0"},
"east": {"uv": [4, 10, 5, 11], "texture": "#0"},
"south": {"uv": [4, 10, 7, 11], "texture": "#0"},
"west": {"uv": [4, 10, 5, 11], "texture": "#0"},
"up": {"uv": [4, 10, 7, 11], "texture": "#0"},
"down": {"uv": [4, 10, 7, 11], "texture": "#0"}
}
},
{
"from": [5, 0, 4],
"to": [7, 1, 5],
"faces": {
"north": {"uv": [7, 10, 9, 11], "texture": "#0"},
"east": {"uv": [7, 10, 8, 11], "texture": "#0"},
"south": {"uv": [7, 10, 9, 11], "texture": "#0"},
"west": {"uv": [7, 10, 8, 11], "texture": "#0"},
"up": {"uv": [7, 10, 9, 11], "texture": "#0"},
"down": {"uv": [7, 10, 9, 11], "texture": "#0"}
}
},
{
"from": [9, 0, 5],
"to": [10, 1, 6],
"faces": {
"north": {"uv": [9, 10, 10, 11], "texture": "#0"},
"east": {"uv": [9, 10, 10, 11], "texture": "#0"},
"south": {"uv": [9, 10, 10, 11], "texture": "#0"},
"west": {"uv": [9, 10, 10, 11], "texture": "#0"},
"up": {"uv": [9, 10, 10, 11], "texture": "#0"},
"down": {"uv": [9, 10, 10, 11], "texture": "#0"}
}
},
{
"from": [5, 0, 5],
"to": [6, 1, 6],
"faces": {
"north": {"uv": [0, 11, 1, 12], "texture": "#0"},
"east": {"uv": [0, 11, 1, 12], "texture": "#0"},
"south": {"uv": [0, 11, 1, 12], "texture": "#0"},
"west": {"uv": [0, 11, 1, 12], "texture": "#0"},
"up": {"uv": [0, 11, 1, 12], "texture": "#0"},
"down": {"uv": [0, 11, 1, 12], "texture": "#0"}
}
},
{
"from": [9, 0, 9],
"to": [10, 1, 10],
"faces": {
"north": {"uv": [0, 13, 1, 14], "texture": "#0"},
"east": {"uv": [0, 13, 1, 14], "texture": "#0"},
"south": {"uv": [0, 13, 1, 14], "texture": "#0"},
"west": {"uv": [0, 13, 1, 14], "texture": "#0"},
"up": {"uv": [0, 13, 1, 14], "texture": "#0"},
"down": {"uv": [0, 13, 1, 14], "texture": "#0"}
}
},
{
"name": "wick",
"from": [7.5, 10, 7],
"to": [7.5, 12, 8],
"rotation": {"angle": 45, "axis": "y", "origin": [7.5, 0, 7.5]},
"faces": {
"north": {"uv": [4, 11, 4, 13], "texture": "#0"},
"east": {"uv": [3, 11, 4, 13], "texture": "#0"},
"south": {"uv": [4, 11, 4, 13], "texture": "#0"},
"west": {"uv": [3, 11, 4, 13], "texture": "#0"},
"up": {"uv": [3, 13, 4, 13], "texture": "#0"},
"down": {"uv": [3, 13, 4, 13], "texture": "#0"}
}
},
{
"name": "wick",
"from": [7.5, 10, 7],
"to": [7.5, 12, 8],
"rotation": {"angle": -45, "axis": "y", "origin": [7.5, 0, 7.5]},
"faces": {
"north": {"uv": [4, 11, 4, 13], "texture": "#0"},
"east": {"uv": [3, 11, 4, 13], "texture": "#0"},
"south": {"uv": [4, 11, 4, 13], "texture": "#0"},
"west": {"uv": [3, 11, 4, 13], "texture": "#0"},
"up": {"uv": [3, 13, 4, 13], "texture": "#0"},
"down": {"uv": [3, 13, 4, 13], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"fixed": {
"rotation": [0, 180, 0]
}
},
"groups": [
{
"name": "candle_body",
"origin": [0, 0, 0],
"color": 0,
"children": [
0,
1,
2,
3,
4,
{
"name": "dripped_wax",
"origin": [0, 0, 0],
"color": 0,
"children": [5, 6, 7, 8, 9, 10, 11]
}
]
},
12,
13
]
}

View File

@@ -96,5 +96,29 @@
"down": {"uv": [0, 0, 16, 0], "rotation": 90, "texture": "#2"} "down": {"uv": [0, 0, 16, 0], "rotation": 90, "texture": "#2"}
} }
} }
] ],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
}
}
} }

View File

@@ -68,5 +68,29 @@
"down": {"uv": [0, 0, 16, 6], "rotation": 90, "texture": "#1"} "down": {"uv": [0, 0, 16, 6], "rotation": 90, "texture": "#1"}
} }
} }
] ],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
}
}
} }

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/black_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/blue_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/brown_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/cyan_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/gray_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/green_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/light_blue_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/light_gray_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/lime_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/magenta_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/orange_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/pink_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/purple_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/red_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/white_advanced_candle_lit"
}
}

View File

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

View File

@@ -0,0 +1,6 @@
{
"parent": "hyperlighting:block/advanced_candle_base",
"textures": {
"0": "hyperlighting:block/candle/lit/yellow_advanced_candle_lit"
}
}

View File

@@ -1,50 +0,0 @@
{
"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,107 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"1": "minecraft:block/oak_planks",
"2": "hyperlighting:block/small_carved_pumpkin",
"3": "minecraft:block/hay_block_top",
"particle": "minecraft:block/hay_block_top"
},
"elements": [
{
"name": "Left Pumpkin",
"from": [8, 1, 2],
"to": [14, 7, 8],
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Right Pumpkin",
"from": [2, 1, 6],
"to": [8, 7, 12],
"rotation": {"angle": 45, "axis": "y", "origin": [5, 0, 9]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Top Pumpkin",
"from": [7, 7, 7],
"to": [13, 13, 13],
"rotation": {"angle": 22.5, "axis": "y", "origin": [10, 6, 10]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [0, 6, 6, 12], "texture": "#2"}
}
},
{
"name": "Stand",
"from": [9, 1, 10],
"to": [12, 7, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [9, 0, 10]},
"faces": {
"north": {"uv": [13, 3, 16, 9], "texture": "#1"},
"east": {"uv": [4, 3, 7, 9], "texture": "#1"},
"south": {"uv": [10, 3, 13, 9], "texture": "#1"},
"west": {"uv": [0, 3, 3, 9], "texture": "#1"},
"up": {"uv": [0, 0, 3, 3], "texture": "#1"},
"down": {"uv": [0, 0, 3, 3], "texture": "#1"}
}
},
{
"name": "Straw",
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [0, 15, 16, 16], "texture": "#3"},
"east": {"uv": [0, 15, 16, 16], "texture": "#3"},
"south": {"uv": [0, 15, 16, 16], "texture": "#3"},
"west": {"uv": [0, 15, 16, 16], "texture": "#3"},
"up": {"uv": [0, 0, 16, 16], "texture": "#3"},
"down": {"uv": [0, 0, 16, 16], "texture": "#3"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [0, 180, 0]
}
}
}

View File

@@ -0,0 +1,108 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"1": "minecraft:block/oak_planks",
"2": "hyperlighting:block/small_carved_pumpkin",
"3": "minecraft:block/hay_block_top",
"particle": "block/hay_block_top"
},
"elements": [
{
"name": "Left Pumpkin",
"from": [8, 1, 2],
"to": [14, 7, 8],
"rotation": {"angle": -45, "axis": "y", "origin": [5, 0, 9]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Right Pumpkin",
"from": [2, 1, 6],
"to": [8, 7, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 9]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Top Pumpkin",
"from": [7, 7, 7],
"to": [13, 13, 13],
"rotation": {"angle": -22.5, "axis": "y", "origin": [10, 6, 10]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [0, 6, 6, 12], "texture": "#2"}
}
},
{
"name": "Stand",
"from": [9, 1, 10],
"to": [12, 7, 13],
"rotation": {"angle": -45, "axis": "y", "origin": [9, 0, 10]},
"faces": {
"north": {"uv": [13, 3, 16, 9], "texture": "#1"},
"east": {"uv": [4, 3, 7, 9], "texture": "#1"},
"south": {"uv": [10, 3, 13, 9], "texture": "#1"},
"west": {"uv": [0, 3, 3, 9], "texture": "#1"},
"up": {"uv": [0, 0, 3, 3], "texture": "#1"},
"down": {"uv": [0, 0, 3, 3], "texture": "#1"}
}
},
{
"name": "Straw",
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [0, 15, 16, 16], "texture": "#3"},
"east": {"uv": [0, 15, 16, 16], "texture": "#3"},
"south": {"uv": [0, 15, 16, 16], "texture": "#3"},
"west": {"uv": [0, 15, 16, 16], "texture": "#3"},
"up": {"uv": [0, 0, 16, 16], "texture": "#3"},
"down": {"uv": [0, 0, 16, 16], "texture": "#3"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [0, 180, 0]
}
}
}

View File

@@ -0,0 +1,159 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"1": "minecraft:block/oak_planks",
"2": "hyperlighting:block/small_jack_o_lantern",
"3": "minecraft:block/hay_block_top",
"particle": "minecraft:block/hay_block_top"
},
"elements": [
{
"name": "Left Pumpkin",
"from": [8, 1, 2],
"to": [14, 7, 8],
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Right Pumpkin",
"from": [2, 1, 6],
"to": [8, 7, 12],
"rotation": {"angle": 45, "axis": "y", "origin": [5, 0, 9]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Top Pumpkin",
"from": [7, 7, 7],
"to": [13, 13, 13],
"rotation": {"angle": 22.5, "axis": "y", "origin": [10, 6, 10]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [0, 6, 6, 12], "texture": "#2"}
}
},
{
"name": "Stand",
"from": [9, 1, 10],
"to": [12, 7, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [9, 0, 10]},
"faces": {
"north": {"uv": [13, 3, 16, 9], "texture": "#1"},
"east": {"uv": [4, 3, 7, 9], "texture": "#1"},
"south": {"uv": [10, 3, 13, 9], "texture": "#1"},
"west": {"uv": [0, 3, 3, 9], "texture": "#1"},
"up": {"uv": [0, 0, 3, 3], "texture": "#1"},
"down": {"uv": [0, 0, 3, 3], "texture": "#1"}
}
},
{
"name": "Straw",
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [0, 15, 16, 16], "texture": "#3"},
"east": {"uv": [0, 15, 16, 16], "texture": "#3"},
"south": {"uv": [0, 15, 16, 16], "texture": "#3"},
"west": {"uv": [0, 15, 16, 16], "texture": "#3"},
"up": {"uv": [0, 0, 16, 16], "texture": "#3"},
"down": {"uv": [0, 0, 16, 16], "texture": "#3"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [
75,
45,
0
],
"translation": [
0,
2.5,
0
],
"scale": [
0.375,
0.375,
0.375
]
},
"thirdperson_lefthand": {
"rotation": [
75,
45,
0
],
"translation": [
0,
2.5,
0
],
"scale": [
0.375,
0.375,
0.375
]
},
"firstperson_righthand": {
"rotation": [
0,
45,
0
],
"scale": [
0.4,
0.4,
0.4
]
},
"firstperson_lefthand": {
"rotation": [
0,
225,
0
],
"scale": [
0.4,
0.4,
0.4
]
},
"ground": {
"translation": [
0,
3,
0
],
"scale": [
0.25,
0.25,
0.25
]
},
"gui": {
"rotation": [
0,
180,
0
]
}
}
}

View File

@@ -0,0 +1,108 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"1": "minecraft:block/oak_planks",
"2": "hyperlighting:block/small_jack_o_lantern",
"3": "minecraft:block/hay_block_top",
"particle": "minecraft:block/hay_block_top"
},
"elements": [
{
"name": "Left Pumpkin",
"from": [8, 1, 2],
"to": [14, 7, 8],
"rotation": {"angle": -45, "axis": "y", "origin": [5, 0, 9]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Right Pumpkin",
"from": [2, 1, 6],
"to": [8, 7, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 9]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [6, 6, 12, 12], "texture": "#2"}
}
},
{
"name": "Top Pumpkin",
"from": [7, 7, 7],
"to": [13, 13, 13],
"rotation": {"angle": -22.5, "axis": "y", "origin": [10, 6, 10]},
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#2"},
"east": {"uv": [6, 0, 12, 6], "texture": "#2"},
"south": {"uv": [6, 0, 12, 6], "texture": "#2"},
"west": {"uv": [6, 0, 12, 6], "texture": "#2"},
"up": {"uv": [0, 6, 6, 12], "texture": "#2"},
"down": {"uv": [0, 6, 6, 12], "texture": "#2"}
}
},
{
"name": "Stand",
"from": [9, 1, 10],
"to": [12, 7, 13],
"rotation": {"angle": -45, "axis": "y", "origin": [9, 0, 10]},
"faces": {
"north": {"uv": [13, 3, 16, 9], "texture": "#1"},
"east": {"uv": [4, 3, 7, 9], "texture": "#1"},
"south": {"uv": [10, 3, 13, 9], "texture": "#1"},
"west": {"uv": [0, 3, 3, 9], "texture": "#1"},
"up": {"uv": [0, 0, 3, 3], "texture": "#1"},
"down": {"uv": [0, 0, 3, 3], "texture": "#1"}
}
},
{
"name": "Straw",
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [0, 15, 16, 16], "texture": "#3"},
"east": {"uv": [0, 15, 16, 16], "texture": "#3"},
"south": {"uv": [0, 15, 16, 16], "texture": "#3"},
"west": {"uv": [0, 15, 16, 16], "texture": "#3"},
"up": {"uv": [0, 0, 16, 16], "texture": "#3"},
"down": {"uv": [0, 0, 16, 16], "texture": "#3"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 2.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [0, 180, 0]
}
}
}

View File

@@ -2,11 +2,11 @@
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"textures": { "textures": {
"1": "hyperlighting:block/grayscale_glass", "1": "hyperlighting:block/grayscale_glass",
"2": "block/anvil", "2": "minecraft:block/anvil",
"3": "block/anvil_top", "3": "minecraft:block/anvil_top",
"5": "block/coal_block", "5": "minecraft:block/coal_block",
"6": "block/candle", "6": "minecraft:block/candle",
"particle": "block/coal_block" "particle": "minecraft:block/coal_block"
}, },
"elements": [ "elements": [
{ {
@@ -313,6 +313,30 @@
} }
} }
], ],
"display": {
"thirdperson_righthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
}
},
"groups": [ "groups": [
{ {
"name": "lantern", "name": "lantern",

View File

@@ -2,11 +2,11 @@
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"textures": { "textures": {
"1": "hyperlighting:block/grayscale_glass", "1": "hyperlighting:block/grayscale_glass",
"2": "block/anvil", "2": "minecraft:block/anvil",
"3": "block/anvil_top", "3": "minecraft:block/anvil_top",
"5": "block/coal_block", "5": "minecraft:block/coal_block",
"6": "block/candle", "6": "minecraft:block/candle",
"particle": "block/coal_block" "particle": "minecraft:block/coal_block"
}, },
"elements": [ "elements": [
{ {
@@ -313,6 +313,30 @@
} }
} }
], ],
"display": {
"thirdperson_righthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
}
},
"groups": [ "groups": [
{ {
"name": "lantern", "name": "lantern",

View File

@@ -0,0 +1,79 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "hyperlighting:block/metal_base_disco_ball",
"2": "hyperlighting:block/dmx_top_on",
"particle": "hyperlighting:block/metal_base_disco_ball"
},
"elements": [
{
"from": [14, 0.05, 7],
"to": [16, 3.05, 9],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 1.25, 8]},
"faces": {
"north": {"uv": [0, 0, 3, 4], "texture": "#0"},
"east": {"uv": [0, 0, 3, 4], "texture": "#0"},
"south": {"uv": [0, 0, 3, 4], "texture": "#0"},
"west": {"uv": [0, 0, 3, 4], "texture": "#0"},
"up": {"uv": [0, 0, 3, 3], "texture": "#0"},
"down": {"uv": [0, 0, 3, 3], "texture": "#0"}
}
},
{
"from": [0, 0.05, 7],
"to": [2, 3.05, 9],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 1.25, 8]},
"faces": {
"north": {"uv": [0, 0, 3, 4], "texture": "#0"},
"east": {"uv": [0, 0, 3, 4], "texture": "#0"},
"south": {"uv": [0, 0, 3, 4], "texture": "#0"},
"west": {"uv": [0, 0, 3, 4], "texture": "#0"},
"up": {"uv": [0, 0, 3, 3], "texture": "#0"},
"down": {"uv": [0, 0, 3, 3], "texture": "#0"}
}
},
{
"from": [2, 1.05, 7],
"to": [14, 3.05, 9],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 1.25, 8]},
"faces": {
"north": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
"east": {"uv": [0, 0, 2, 2], "texture": "#2", "tintindex": 0},
"south": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
"west": {"uv": [0, 0, 2, 2], "texture": "#2", "tintindex": 0},
"up": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
"down": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0}
}
}
],
"display": {
"thirdperson_righthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
}
},
"groups": [
{
"name": "group",
"origin": [10, 9, 15],
"color": 0,
"children": [0, 1, 2]
}
]
}

View File

@@ -0,0 +1,56 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "hyperlighting:block/metal_base_disco_ball",
"2": "hyperlighting:block/dmx_top_on",
"particle": "hyperlighting:block/metal_base_disco_ball"
},
"elements": [
{
"from": [14, 7, 0.05],
"to": [16, 9, 3.05],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 1.25]},
"faces": {
"north": {"uv": [0, 0, 3, 3], "rotation": 180, "texture": "#0"},
"east": {"uv": [0, 0, 3, 4], "rotation": 270, "texture": "#0"},
"south": {"uv": [0, 0, 3, 3], "texture": "#0"},
"west": {"uv": [0, 0, 3, 4], "rotation": 90, "texture": "#0"},
"up": {"uv": [0, 0, 3, 4], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 0, 3, 4], "texture": "#0"}
}
},
{
"from": [0, 7, 0.05],
"to": [2, 9, 3.05],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 1.25]},
"faces": {
"north": {"uv": [0, 0, 3, 3], "rotation": 180, "texture": "#0"},
"east": {"uv": [0, 0, 3, 4], "rotation": 270, "texture": "#0"},
"south": {"uv": [0, 0, 3, 3], "texture": "#0"},
"west": {"uv": [0, 0, 3, 4], "rotation": 90, "texture": "#0"},
"up": {"uv": [0, 0, 3, 4], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 0, 3, 4], "texture": "#0"}
}
},
{
"from": [2, 7, 1.05],
"to": [14, 9, 3.05],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 1.25]},
"faces": {
"north": {"uv": [0, 0, 12, 2], "rotation": 180, "texture": "#2", "tintindex": 0},
"east": {"uv": [0, 0, 2, 2], "rotation": 270, "texture": "#2", "tintindex": 0},
"south": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0},
"west": {"uv": [0, 0, 2, 2], "rotation": 90, "texture": "#2", "tintindex": 0},
"up": {"uv": [0, 0, 12, 2], "rotation": 180, "texture": "#2", "tintindex": 0},
"down": {"uv": [0, 0, 12, 2], "texture": "#2", "tintindex": 0}
}
}
],
"groups": [
{
"name": "group",
"origin": [10, 9, 15],
"children": [0, 1, 2]
}
]
}

View File

@@ -0,0 +1,49 @@
{
"credit": "Made with Blockbench",
"texture_size": [16, 32],
"textures": {
"0": "hyperlighting:block/solar",
"particle": "hyperlighting:block/solar"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 2, 16],
"faces": {
"north": {"uv": [0, 8, 16, 10], "texture": "#0"},
"east": {"uv": [0, 8, 16, 10], "texture": "#0"},
"south": {"uv": [0, 8, 16, 10], "texture": "#0"},
"west": {"uv": [0, 8, 16, 10], "texture": "#0"},
"up": {"uv": [0, 0, 16, 8], "texture": "#0"},
"down": {"uv": [0, 8, 16, 16], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"translation": [0, 3.75, 0],
"scale": [0.5, 0.5, 0.5]
},
"thirdperson_lefthand": {
"translation": [0, 3.75, 0],
"scale": [0.5, 0.5, 0.5]
},
"firstperson_righthand": {
"rotation": [56, 0, 0]
},
"firstperson_lefthand": {
"rotation": [56, 0, 0]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [90, 0, 0]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, 0, -7.5]
}
}
}

View File

@@ -31,5 +31,29 @@
"down": {"uv": [7, 14, 9, 16], "texture": "#1"} "down": {"uv": [7, 14, 9, 16], "texture": "#1"}
} }
} }
] ],
"display": {
"thirdperson_righthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"translation": [0, 3, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
}
}
} }

View File

@@ -1,5 +1,5 @@
{ {
"parent": "hyperlighting:block/candle_base", "parent": "hyperlighting:block/advanced_candle_base",
"overrides": [ "overrides": [
{ "predicate": { "color": 0 }, "model": "hyperlighting:block/candle/white_candle" }, { "predicate": { "color": 0 }, "model": "hyperlighting:block/candle/white_candle" },
{ "predicate": { "color": 1 }, "model": "hyperlighting:block/candle/orange_candle" }, { "predicate": { "color": 1 }, "model": "hyperlighting:block/candle/orange_candle" },

View File

@@ -0,0 +1,3 @@
{
"parent": "hyperlighting:block/solar_neon"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "hyperlighting:item/handheld_lantern"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "hyperlighting:block/jack_o_lantern_trio"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "hyperlighting:block/jack_o_lantern_trio_inverted"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "hyperlighting:block/solar_panel"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "hyperlighting:item/battery"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Some files were not shown because too many files have changed in this diff Show More