From fd66ced479bc1aa07ee9423676dad8a9c895e9f7 Mon Sep 17 00:00:00 2001 From: MrTJP Date: Sat, 11 May 2024 13:53:53 -0400 Subject: [PATCH 1/4] fix: array gates not seeing single-pulse inputs to top wire --- .../integration/part/ArrayGatePart.java | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/integration/src/main/java/mrtjp/projectred/integration/part/ArrayGatePart.java b/integration/src/main/java/mrtjp/projectred/integration/part/ArrayGatePart.java index 279347426..dccfe9296 100644 --- a/integration/src/main/java/mrtjp/projectred/integration/part/ArrayGatePart.java +++ b/integration/src/main/java/mrtjp/projectred/integration/part/ArrayGatePart.java @@ -613,7 +613,7 @@ public static abstract class TopWireArrayGate extends ArrayGatePart implements I private static final int KEY_SIGNAL = 20; - protected byte signal = 0; + private byte signal = 0; public TopWireArrayGate(GateType type) { super(type); @@ -743,25 +743,27 @@ public SimpleTopWireArrayGate(GateType type) { @Override protected void gateLogicOnChange() { int iMask = inputMask(shape()); + int rMask = redwireMask(shape()); int oMask = outputMask(shape()); int fMask = feedbackMask(shape()); int oldInput = getState() & 0xF; - int newInput = getInput(iMask | fMask); + int newInput = getInput(iMask | fMask) | getRedwireInput(rMask); if (oldInput != newInput) { setState(getState() & 0xF0 | newInput); onInputChange(); } - int newOutput = calcOutput(state() & iMask) & oMask; + int newOutput = calcOutput(state() & (iMask | rMask)) & oMask; if (newOutput != (state() >> 4)) scheduleTick(getDelay(shape())); } @Override protected void gateLogicOnScheduledTick() { int iMask = inputMask(shape()); + int rMask = redwireMask(shape()); int oMask = outputMask(shape()); int oldOutput = state() >> 4; - int newOutput = calcOutput(state() & iMask) & oMask; + int newOutput = calcOutput(state() & (iMask | rMask)) & oMask; if (oldOutput != newOutput) { setState(state() & 0xF | newOutput << 4); onOutputChange(oMask); @@ -772,23 +774,29 @@ protected void gateLogicOnScheduledTick() { @Override protected void gateLogicSetup() { int iMask = inputMask(shape()); + int rMask = redwireMask(shape()); int oMask = outputMask(shape()); - int output = calcOutput(getInput(iMask)) & oMask; + int input = getInput(iMask) | getRedwireInput(rMask); + int output = calcOutput(input) & oMask; if (output != 0) { setState(output << 4); onOutputChange(output); //use output for change mask because nothing is going low } } - int getDelay(int shape) { + protected int getDelay(int shape) { return 2; } - int feedbackMask(int shape) { + protected int feedbackMask(int shape) { return 0; } - int calcOutput(int input) { + protected int getRedwireInput(int mask) { + return getSignal(mask) != 0 ? mask : 0; + } + + protected int calcOutput(int input) { return 0; } //endregion @@ -812,8 +820,8 @@ protected int inputMask(int shape) { } @Override - int calcOutput(int input) { - return input == 4 && signal != 0 ? 1 : 0; + protected int calcOutput(int input) { + return (input & 4) != 0 && (input & 0xA) != 0 ? 1 : 0; } } @@ -834,8 +842,8 @@ protected int inputMask(int shape) { } @Override - int calcOutput(int input) { - return signal == 0 ? state() >> 4 : (input & 4) == 0 ? 0 : 1; + protected int calcOutput(int input) { + return (input & 0xA) == 0 ? state() >> 4 : (input & 4) == 0 ? 0 : 1; } } } From 16ec44a2e23a3a1303320a5c98ac5a69ebe9ea01 Mon Sep 17 00:00:00 2001 From: MrTJP Date: Sat, 11 May 2024 14:04:50 -0400 Subject: [PATCH 2/4] fix: insulated wires powering above/below --- .../part/InsulatedRedAlloyWirePart.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/transmission/src/main/java/mrtjp/projectred/transmission/part/InsulatedRedAlloyWirePart.java b/transmission/src/main/java/mrtjp/projectred/transmission/part/InsulatedRedAlloyWirePart.java index f5e1c1918..c244b7906 100644 --- a/transmission/src/main/java/mrtjp/projectred/transmission/part/InsulatedRedAlloyWirePart.java +++ b/transmission/src/main/java/mrtjp/projectred/transmission/part/InsulatedRedAlloyWirePart.java @@ -51,13 +51,15 @@ public int strongPowerLevel(int side) { @Override public int weakPowerLevel(int side) { + // Can't power above or below + if (side == getSide() || side == (getSide() ^ 1)) + return 0; + + // Can't power unconnected sides (unlike uninsulated) + int r = absoluteRot(side); + if (!maskConnects(r)) + return 0; - // If side is towards a rotation - if ((side & 6) != (getSide() & 6)) { - int r = absoluteRot(side); - if (!maskConnects(r)) - return 0; - } return super.weakPowerLevel(side); } //endregion From bb7a7178c7591e6ea54a659595df9901ce715ce7 Mon Sep 17 00:00:00 2001 From: MrTJP Date: Sat, 11 May 2024 15:53:46 -0400 Subject: [PATCH 3/4] feat: add Illumar Smart Lamp --- .../projectred/core/BundledSignalsLib.java | 12 + .../projectred/core/client/HaloRenderer.java | 268 ++++++++--- .../projectred/core/init/CoreClientInit.java | 4 +- .../2b7776bd503c0a3d6dc4b121fe385660c1c6dc19 | 3 +- .../3c5437fdfe8bcc1d7d617f64e23b502caa42a0e1 | 3 +- .../73585f9635c75d62bca484a7ea9ba4b7d3c67a68 | 3 +- .../be1ef78e8a7cc1ad66607d87653d2e29da533af1 | 5 +- .../c622617f6fabf890a00b9275cd5f643584a8a2c8 | 4 +- .../blockstates/illumar_smart_lamp.json | 436 ++++++++++++++++++ .../projectred_illumination/lang/en_us.json | 1 + .../models/block/illumar_smart_lamp.json | 8 + .../models/block/illumar_smart_lamp_on.json | 8 + .../models/item/illumar_smart_lamp.json | 3 + .../blocks/illumar_smart_lamp.json | 15 + .../recipes/illumar_smart_lamp.json | 28 ++ .../MultipartLightProperties.java | 4 +- .../illumination/ProjectRedIllumination.java | 4 + .../block/IllumarSmartLampBlock.java | 55 +++ .../client/IllumarLampItemRenderer.java | 7 +- .../client/IllumarLampTileRenderer.java | 2 +- .../IllumarSmartLampBlockEntityRenderer.java | 30 ++ .../client/IllumarSmartLampItemRenderer.java | 118 +++++ .../client/MultipartLightPartRenderer.java | 2 +- .../data/IlluminationBlockLootProvider.java | 4 + .../IlluminationBlockStateModelProvider.java | 36 ++ .../data/IlluminationItemModelProvider.java | 3 + .../data/IlluminationLanguageProvider.java | 4 + .../data/IlluminationRecipeProvider.java | 12 + .../illumination/init/IlluminationBlocks.java | 26 ++ .../init/IlluminationClientInit.java | 13 +- .../part/IllumarLampMicroMaterial.java | 5 +- .../tile/IllumarSmartLampBlockEntity.java | 269 +++++++++++ .../block/illumar_smart_lamp_bottom.png | Bin 0 -> 3491 bytes .../block/illumar_smart_lamp_side.png | Bin 0 -> 3355 bytes .../block/illumar_smart_lamp_side_on.png | Bin 0 -> 3458 bytes .../textures/block/illumar_smart_lamp_top.png | Bin 0 -> 3228 bytes .../block/illumar_smart_lamp_top_on.png | Bin 0 -> 3319 bytes .../client/GateComponentModels.java | 2 +- 38 files changed, 1310 insertions(+), 87 deletions(-) create mode 100644 illumination/src/main/generated/assets/projectred_illumination/blockstates/illumar_smart_lamp.json create mode 100644 illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp.json create mode 100644 illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp_on.json create mode 100644 illumination/src/main/generated/assets/projectred_illumination/models/item/illumar_smart_lamp.json create mode 100644 illumination/src/main/generated/data/projectred_illumination/loot_tables/blocks/illumar_smart_lamp.json create mode 100644 illumination/src/main/generated/data/projectred_illumination/recipes/illumar_smart_lamp.json create mode 100644 illumination/src/main/java/mrtjp/projectred/illumination/block/IllumarSmartLampBlock.java create mode 100644 illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampBlockEntityRenderer.java create mode 100644 illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampItemRenderer.java create mode 100644 illumination/src/main/java/mrtjp/projectred/illumination/tile/IllumarSmartLampBlockEntity.java create mode 100644 illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_bottom.png create mode 100644 illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_side.png create mode 100644 illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_side_on.png create mode 100644 illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_top.png create mode 100644 illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_top_on.png diff --git a/core/src/main/java/mrtjp/projectred/core/BundledSignalsLib.java b/core/src/main/java/mrtjp/projectred/core/BundledSignalsLib.java index 890a96978..0969fdd6a 100644 --- a/core/src/main/java/mrtjp/projectred/core/BundledSignalsLib.java +++ b/core/src/main/java/mrtjp/projectred/core/BundledSignalsLib.java @@ -139,6 +139,18 @@ public static void applyChangeMask(byte[] source, byte[] dest, int mask) { } } + public static int applyAndGetChangeMask(@Nullable byte[] source, byte[] dest) { + int mask = 0; + for (int i = 0; i < 16; i++) { + byte newVal = source == null ? 0 : source[i]; + if (dest[i] != newVal) { + dest[i] = newVal; + mask |= 1 << i; + } + } + return mask; + } + public static byte[] raiseSignal(@Nullable byte[] signal, @Nullable byte[] source) { if (signal == null) signal = new byte[16]; if (source == null) return signal; diff --git a/core/src/main/java/mrtjp/projectred/core/client/HaloRenderer.java b/core/src/main/java/mrtjp/projectred/core/client/HaloRenderer.java index 3b035d065..416f3d55b 100644 --- a/core/src/main/java/mrtjp/projectred/core/client/HaloRenderer.java +++ b/core/src/main/java/mrtjp/projectred/core/client/HaloRenderer.java @@ -15,6 +15,7 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderStateShard; import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.core.BlockPos; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.phys.Vec3; @@ -29,6 +30,7 @@ import static mrtjp.projectred.core.ProjectRedCore.MOD_ID; import static net.minecraft.client.renderer.RenderStateShard.*; +import static net.minecraftforge.client.event.RenderLevelStageEvent.Stage.AFTER_PARTICLES; public class HaloRenderer { @@ -78,11 +80,14 @@ public class HaloRenderer { private static boolean postChainFlushPending = false; - private static final LinkedList levelLights = new LinkedList<>(); - + // In-level halos in block-space. These will render both glow and bloom + private static final LinkedList levelHalos = new LinkedList<>(); + // Entity halos for held and item entity rendering. Bloom only, as the glow is rendered immediately + private static final LinkedList entityHalos = new LinkedList<>(); + // Global offset for moving block entities private static final Vector3 offset = Vector3.ZERO.copy(); - //region Init + //region Init and event handlers public static void init() { // Register callback for moving block entities if (ProjectRedAPI.expansionAPI != null) { @@ -99,28 +104,51 @@ public void onMovingPostRender() { }); } } + + public static void onRenderLevelStageEvent(final RenderLevelStageEvent event) { + if (event.getStage().equals(AFTER_PARTICLES)) { + onRenderStageAfterParticles(event); + } + } + + public static void onRenderLevelLastEvent(final RenderLevelLastEvent event) { + onRenderStageAfterLevel(event); + } + + public static void onResourceManagerReload(ResourceManager manager) { + loadPostChain(); + } //endregion - //region World renderer - public static void addLight(BlockPos pos, int colour, Cuboid6 box) { - addLight(new Translation(pos), colour, box); + //region Level rendering + public static void addLight(BlockPos pos, Cuboid6 box, int colourIndex) { + addLight(new Translation(pos), box, colourIndex); } - public static void addLight(Transformation t, int colour, Cuboid6 box) { + public static void addLight(Transformation t, Cuboid6 box, int colourIndex) { Transformation t2 = new TransformationList(t, new Translation(offset)); - levelLights.add(new LevelLight(t2, colour, box)); - if (Configurator.lightHaloMax > -1 && levelLights.size() > Configurator.lightHaloMax) { - levelLights.poll(); - } + addHalo(levelHalos, new HaloRenderData(box, t2).setColourIndex(colourIndex)); } - public static void onRenderWorldStageEvent(final RenderLevelStageEvent event) { + public static void addMultiLight(BlockPos pos, Cuboid6 box, byte[] alphas) { + addMultiLight(new Translation(pos), box, alphas); + } - if (event.getStage() != RenderLevelStageEvent.Stage.AFTER_PARTICLES) { - return; + public static void addMultiLight(Transformation t, Cuboid6 box, byte[] alphas) { + Transformation t2 = new TransformationList(t, new Translation(offset)); + addHalo(levelHalos, new HaloRenderData(box, t2).setMultiColourAlphas(alphas)); + } + + private static void addHalo(LinkedList list, HaloRenderData data) { + list.add(data); + if (Configurator.lightHaloMax > -1 && list.size() > Configurator.lightHaloMax) { + list.poll(); } + } + + public static void onRenderStageAfterParticles(final RenderLevelStageEvent event) { - if (levelLights.isEmpty()) { + if (levelHalos.isEmpty() && entityHalos.isEmpty()) { return; } @@ -128,64 +156,69 @@ public static void onRenderWorldStageEvent(final RenderLevelStageEvent event) { return; } - // Build light list - List lightList = new LinkedList<>(); - LevelLight l; - while ((l = levelLights.poll()) != null) { - lightList.add(l); - } - // Setup post-chain preparePostChain(); assert HALO_POST_CHAIN != null; HALO_POST_CHAIN.getInputTarget().clear(Minecraft.ON_OSX); HALO_POST_CHAIN.getInputTarget().copyDepthFrom(Minecraft.getInstance().getMainRenderTarget()); + // Prepare render state + CCRenderState ccrs = CCRenderState.instance(); + ccrs.reset(); + MultiBufferSource.BufferSource buffers = Minecraft.getInstance().renderBuffers().bufferSource(); + + // Translate pose to camera position Vec3 cam = event.getCamera().getPosition(); PoseStack stack = event.getPoseStack(); stack.pushPose(); stack.translate(-cam.x, -cam.y, -cam.z); - CCRenderState ccrs = CCRenderState.instance(); - ccrs.reset(); - MultiBufferSource.BufferSource buffers = Minecraft.getInstance().renderBuffers().bufferSource(); + // Poll all pending level halos + List lightList = pollHalos(levelHalos); // Render to normal render target for primary visuals ccrs.bind(HALO_GLOW_RENDER_TYPE, buffers, stack); - for (LevelLight light : lightList) { - renderToCCRS(ccrs, light.box, light.colour, light.t, HaloContext.LEVEL_RENDERER); + for (var light : lightList) { + renderToCCRS(ccrs, light.box, light.t, light.levelGlowRgba); } // Update depth buffer ccrs.bind(HALO_FABULOUS_DEPTH_RENDER_TYPE, buffers, stack); - for (LevelLight light : lightList) { - renderToCCRS(ccrs, light.box, light.colour, light.t, HaloContext.LEVEL_RENDERER); + for (var light : lightList) { + renderToCCRS(ccrs, light.box, light.t, 0xFFFFFFFF); } // Render to post chain for post-processing effects ccrs.bind(HALO_FABULOUS_BLOOM_RENDER_TYPE, buffers, stack); - for (LevelLight light : lightList) { - renderToCCRS(ccrs, light.box, light.colour, light.t, HaloContext.BLOOM_RENDERER); + for (var light : lightList) { + renderToCCRS(ccrs, light.box, light.t, light.bloomRgba); } - postChainFlushPending = true; - buffers.endBatch(); stack.popPose(); + + // Render entity halos for held blocks and item entities + List entityLightList = pollHalos(entityHalos); + ccrs.bind(HALO_FABULOUS_BLOOM_RENDER_TYPE, buffers); // No pose, should have their own complete transforms + for (var light : entityLightList) { + renderToCCRS(ccrs, light.box, light.t, light.bloomRgba); + } + + // Force-end batch + buffers.endBatch(); + + // Flag to flush post-chain at end of level render + postChainFlushPending = true; } - public static void onRenderWorldLastEvent(final RenderLevelLastEvent event) { + public static void onRenderStageAfterLevel(final RenderLevelLastEvent event) { // Unfabulous rendering. Batched rendering doesn't seem to work from stage events when not // on fabulous for some reason, so we have to do it here instead. if (!isFabulous()) { - if (levelLights.isEmpty()) return; + if (levelHalos.isEmpty()) return; // Poll all pending lights from queue - List lightList = new LinkedList<>(); - LevelLight l; - while ((l = levelLights.poll()) != null) { - lightList.add(l); - } + List lightList = pollHalos(levelHalos); // Prepare render Vec3 cam = Minecraft.getInstance().getEntityRenderDispatcher().camera.getPosition(); @@ -199,8 +232,8 @@ public static void onRenderWorldLastEvent(final RenderLevelLastEvent event) { // Render to normal render target for primary visuals ccrs.bind(HALO_GLOW_RENDER_TYPE, buffers, stack); - for (LevelLight light : lightList) { - renderToCCRS(ccrs, light.box, light.colour, light.t, HaloContext.LEVEL_RENDERER); + for (var light : lightList) { + renderToCCRS(ccrs, light.box, light.t, light.levelGlowRgba); } // Finish render @@ -217,8 +250,13 @@ public static void onRenderWorldLastEvent(final RenderLevelLastEvent event) { } } - public static void onResourceManagerReload(ResourceManager manager) { - loadPostChain(); + private static List pollHalos(LinkedList src) { + List dest = new LinkedList<>(); + HaloRenderData l; + while ((l = src.poll()) != null) { + dest.add(l); + } + return dest; } //endregion @@ -255,28 +293,114 @@ private static boolean isFabulous() { //endregion //region Render functions - private static void renderToCCRS(CCRenderState ccrs, Cuboid6 cuboid, int colour, Transformation t, HaloContext context) { + private static void renderToCCRS(CCRenderState ccrs, Cuboid6 cuboid, Transformation t, int rgba) { ccrs.setPipeline(t); - ccrs.baseColour = getBaseColour(colour, context); + ccrs.baseColour = rgba; BlockRenderer.renderCuboid(ccrs, cuboid, 0); } - public static void renderInventoryHalo(CCRenderState ccrs, PoseStack mStack, MultiBufferSource buffers, Cuboid6 cuboid, int colour, Vector3 pos) { + public static void renderInventoryHalo(CCRenderState ccrs, PoseStack mStack, MultiBufferSource buffers, Cuboid6 cuboid, Vector3 pos, int colourIndex) { + int rgba = getBaseColour(colourIndex, HaloContext.ITEM_GLOW); + renderInventoryHaloRgba(ccrs, mStack, buffers, cuboid, pos, rgba); + } + + public static void renderInventoryMultiHalo(CCRenderState ccrs, PoseStack mStack, MultiBufferSource buffers, Cuboid6 cuboid, Vector3 pos, byte[] alphas) { + int rgba = getBlendedColour(alphas, HaloContext.ITEM_GLOW); + renderInventoryHaloRgba(ccrs, mStack, buffers, cuboid, pos, rgba); + } + + private static void renderInventoryHaloRgba(CCRenderState ccrs, PoseStack mStack, MultiBufferSource buffers, Cuboid6 cuboid, Vector3 pos, int rgba) { RenderType type = isFabulous() ? HALO_FABULOUS_ITEM_ENTITY_RENDER_TYPE : HALO_GLOW_RENDER_TYPE; ccrs.reset(); ccrs.bind(type, buffers, mStack); - renderToCCRS(ccrs, cuboid, colour, pos.translation(), HaloContext.ITEM_RENDERER); + renderToCCRS(ccrs, cuboid, pos.translation(), rgba); + } + + public static void addItemRendererBloom(ItemTransforms.TransformType transformType, PoseStack stack, Vector3 pos, Cuboid6 box, int colourIndex) { + if (isEntityItemRenderType(transformType)) { + addItemRendererBloom(stack, pos, box, colourIndex); + } + } + + public static void addItemRendererBloom(PoseStack stack, Vector3 pos, Cuboid6 box, int colourIndex) { + Transformation t = new Matrix4(stack.last().pose()).with(pos.translation()); + addHalo(entityHalos, new HaloRenderData(box, t).setColourIndex(colourIndex)); + } + + public static void addItemRendererMultiBloom(ItemTransforms.TransformType transformType, PoseStack stack, Vector3 pos, Cuboid6 box, byte[] alphas) { + if (isEntityItemRenderType(transformType)) { + addItemRendererMultiBloom(stack, pos, box, alphas); + } + } + + public static void addItemRendererMultiBloom(PoseStack stack, Vector3 pos, Cuboid6 box, byte[] alphas) { + Transformation t = new Matrix4(stack.last().pose()).with(pos.translation()); + addHalo(entityHalos, new HaloRenderData(box, t).setMultiColourAlphas(alphas)); + } + + private static boolean isEntityItemRenderType(ItemTransforms.TransformType transformType) { + return switch (transformType) { + case GROUND, THIRD_PERSON_LEFT_HAND, THIRD_PERSON_RIGHT_HAND, FIRST_PERSON_LEFT_HAND, FIRST_PERSON_RIGHT_HAND -> true; + default -> false; + }; } //endregion + //region Colour calculations private static int getBaseColour(int colorIndex, HaloContext context) { return LightColours.byIndex(colorIndex).rgbaByContext(context); } + /** + * Mix all 16 colours given input array of alpha values. Colours are additively blended + * using same calculations as GL_SRC_ALPHA/GL_ONE_MINUS_SRC_ALPHA blending. + * + * @param alphas 16-element array of alpha values + * @return Blended colour (rgba) + */ + private static int getBlendedColour(byte[] alphas, HaloContext context) { + // Find the total alpha + int aTotal = 0; + int aMax = 0; + for (int i = 0; i < 16; i++) { + aTotal += alphas[i] & 0xFF; + aMax = Math.max(aMax, alphas[i] & 0xFF); + } + + if (aTotal == 0) { + return 0; + } + + // Normalize alpha values + float[] aNorm = new float[16]; + for (int i = 0; i < 16; i++) { + aNorm[i] = (alphas[i] & 0xFF) / (float) aTotal * aMax / 255f; + } + + float r = 0, g = 0, b = 0, a = 0; + for (int i = 0; i < 16; i++) { + if (alphas[i] == 0) continue; + + int colour = getBaseColour(i, context); + float rsrc = ((colour >> 24) & 0xFF) / 255f; + float gsrc = ((colour >> 16) & 0xFF) / 255f; + float bsrc = ((colour >> 8) & 0xFF) / 255f; + float asrc = aNorm[i]; + + r = rsrc * asrc + r * (1 - asrc); + g = gsrc * asrc + g * (1 - asrc); + b = bsrc * asrc + b * (1 - asrc); + a = asrc * asrc + a * (1 - asrc); + } + + // Note: Below alpha controls how halo renderer blends it into the render target, not alpha used to blend colours together + return (int) (r * 255) << 24 | (int) (g * 255) << 16 | (int) (b * 255) << 8 | 0xA0; + } + private enum HaloContext { - ITEM_RENDERER, - LEVEL_RENDERER, - BLOOM_RENDERER + ITEM_GLOW, + LEVEL_GLOW, + BLOOM } /** @@ -328,21 +452,11 @@ private enum LightColours { //@formatter:on //noinspection FieldCanBeLocal - private final int rgba; - private final float glowBrightness; - private final float itemGlowBrightness; - private final float bloomBrightness; - public final int blockGlowRgba; public final int itemGlowRgba; public final int bloomRgba; LightColours(int rgba, float glowBrightness, float itemGlowBrightness, float bloomBrightness) { - this.rgba = rgba; - this.glowBrightness = glowBrightness; - this.itemGlowBrightness = itemGlowBrightness; - this.bloomBrightness = bloomBrightness; - this.blockGlowRgba = scaleBrightness(rgba, glowBrightness); this.itemGlowRgba = scaleBrightness(rgba, itemGlowBrightness); this.bloomRgba = scaleBrightness(rgba, bloomBrightness); @@ -350,9 +464,9 @@ private enum LightColours { public int rgbaByContext(HaloContext context) { return switch (context) { - case ITEM_RENDERER -> itemGlowRgba; - case LEVEL_RENDERER -> blockGlowRgba; - case BLOOM_RENDERER -> bloomRgba; + case ITEM_GLOW -> itemGlowRgba; + case LEVEL_GLOW -> blockGlowRgba; + case BLOOM -> bloomRgba; }; } @@ -372,8 +486,32 @@ public static LightColours byIndex(int index) { return values()[index]; } } + //endregion - private record LevelLight(Transformation t, int colour, Cuboid6 box) { + private static class HaloRenderData { + public final Cuboid6 box; + public final Transformation t; + public int levelGlowRgba; + public int inventoryGlowRgba; + public int bloomRgba; + public HaloRenderData(Cuboid6 box, Transformation t) { + this.box = box; + this.t = t; + } + + public HaloRenderData setColourIndex(int colourIndex) { + levelGlowRgba = getBaseColour(colourIndex, HaloContext.LEVEL_GLOW); + inventoryGlowRgba = getBaseColour(colourIndex, HaloContext.ITEM_GLOW); + bloomRgba = getBaseColour(colourIndex, HaloContext.BLOOM); + return this; + } + + public HaloRenderData setMultiColourAlphas(byte[] alphas) { + levelGlowRgba = getBlendedColour(alphas, HaloContext.LEVEL_GLOW); + inventoryGlowRgba = getBlendedColour(alphas, HaloContext.ITEM_GLOW); + bloomRgba = getBlendedColour(alphas, HaloContext.BLOOM); + return this; + } } } diff --git a/core/src/main/java/mrtjp/projectred/core/init/CoreClientInit.java b/core/src/main/java/mrtjp/projectred/core/init/CoreClientInit.java index 6f72cab7d..3180e8ae7 100644 --- a/core/src/main/java/mrtjp/projectred/core/init/CoreClientInit.java +++ b/core/src/main/java/mrtjp/projectred/core/init/CoreClientInit.java @@ -37,8 +37,8 @@ private static void clientSetup(final FMLClientSetupEvent event) { HaloRenderer.init(); // Register Halo renderer - MinecraftForge.EVENT_BUS.addListener(HaloRenderer::onRenderWorldStageEvent); - MinecraftForge.EVENT_BUS.addListener(HaloRenderer::onRenderWorldLastEvent); + MinecraftForge.EVENT_BUS.addListener(HaloRenderer::onRenderLevelStageEvent); + MinecraftForge.EVENT_BUS.addListener(HaloRenderer::onRenderLevelLastEvent); // Register resource reload listener ResourceUtils.registerReloadListener(HaloRenderer::onResourceManagerReload); diff --git a/illumination/src/main/generated/.cache/2b7776bd503c0a3d6dc4b121fe385660c1c6dc19 b/illumination/src/main/generated/.cache/2b7776bd503c0a3d6dc4b121fe385660c1c6dc19 index 5bf4c7697..b3bca1420 100644 --- a/illumination/src/main/generated/.cache/2b7776bd503c0a3d6dc4b121fe385660c1c6dc19 +++ b/illumination/src/main/generated/.cache/2b7776bd503c0a3d6dc4b121fe385660c1c6dc19 @@ -1,4 +1,4 @@ -// 1.19.2 2024-03-05T10:08:22.223009 ProjectRed-Illumination Item Models +// 1.19.2 2024-05-06T17:00:08.454488 ProjectRed-Illumination Item Models a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/black_cage_light.json a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/black_fallout_light.json a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/black_fixture_light.json @@ -59,6 +59,7 @@ a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/i 3b57b1bd43ea0d8e0b5691177b1431a5c5b8e6fa assets/projectred_illumination/models/item/green_inverted_illumar_lamp.json a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/green_inverted_lantern.json a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/green_lantern.json +f08f45f7fd93ac70ed2e01d17acf536a88abe652 assets/projectred_illumination/models/item/illumar_smart_lamp.json a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/light_blue_cage_light.json a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/light_blue_fallout_light.json a163c9ce1e63e428f3fa804b66e491b455f18540 assets/projectred_illumination/models/item/light_blue_fixture_light.json diff --git a/illumination/src/main/generated/.cache/3c5437fdfe8bcc1d7d617f64e23b502caa42a0e1 b/illumination/src/main/generated/.cache/3c5437fdfe8bcc1d7d617f64e23b502caa42a0e1 index 76e83bade..2efacaa59 100644 --- a/illumination/src/main/generated/.cache/3c5437fdfe8bcc1d7d617f64e23b502caa42a0e1 +++ b/illumination/src/main/generated/.cache/3c5437fdfe8bcc1d7d617f64e23b502caa42a0e1 @@ -1,4 +1,4 @@ -// 1.19.2 2024-03-05T10:08:22.240051 ProjectRed-Illumination Recipes +// 1.19.2 2024-05-08T21:36:25.799111 ProjectRed-Illumination Recipes bab0e0ace8eafa4f132dd7aa9ea77ce3743620f1 data/projectred_illumination/recipes/black_cage_light.json 7346715a74ba4257b555898569b21950b6c69747 data/projectred_illumination/recipes/black_fallout_light.json 408cec0af00793db8e5895042fe84e4120c17b33 data/projectred_illumination/recipes/black_fixture_light.json @@ -59,6 +59,7 @@ bd0ba40afb2e62423d4e81e30adba54004eb2483 data/projectred_illumination/recipes/gr 6afac6792ea3525e6a20140fec5038fcf60066ce data/projectred_illumination/recipes/green_inverted_illumar_lamp.json 3cbcf89e8fca3b497f11a8b47f3e169b5559e1f9 data/projectred_illumination/recipes/green_inverted_lantern.json c849335acf420adbd919fd18bf0828690eabba30 data/projectred_illumination/recipes/green_lantern.json +4186608e2b704efdf4cb473b603a5cca3623617a data/projectred_illumination/recipes/illumar_smart_lamp.json 343c00444ba713d21c9d7800377363b528676b1f data/projectred_illumination/recipes/light_blue_cage_light.json 250e310dadd501be6ab7a84d0f3204fb5200eda2 data/projectred_illumination/recipes/light_blue_fallout_light.json c1be8144957ba247e87114e8473c6e4f34557d04 data/projectred_illumination/recipes/light_blue_fixture_light.json diff --git a/illumination/src/main/generated/.cache/73585f9635c75d62bca484a7ea9ba4b7d3c67a68 b/illumination/src/main/generated/.cache/73585f9635c75d62bca484a7ea9ba4b7d3c67a68 index e33084706..a7f9bd843 100644 --- a/illumination/src/main/generated/.cache/73585f9635c75d62bca484a7ea9ba4b7d3c67a68 +++ b/illumination/src/main/generated/.cache/73585f9635c75d62bca484a7ea9ba4b7d3c67a68 @@ -1,4 +1,4 @@ -// 1.19.2 2024-03-05T10:08:22.239755 ProjectRed-Illumination Block Loot Tables +// 1.19.2 2024-05-08T16:20:21.395168 ProjectRed-Illumination Block Loot Tables ca2aba13d5b4bcbedec5753a41db442358432327 data/projectred_illumination/loot_tables/blocks/black_illumar_lamp.json 6f70dd57e208bacc8c06e451db975c57cfa5a3a6 data/projectred_illumination/loot_tables/blocks/black_inverted_illumar_lamp.json df6b2b1652062f4dbcabe57c04201f9c03b655ca data/projectred_illumination/loot_tables/blocks/blue_illumar_lamp.json @@ -11,6 +11,7 @@ bf9d87f4ec56c5a82548eca928f2a00e2f47048b data/projectred_illumination/loot_table c7d386cf69bfcf351d594c19416129dcdb92a50c data/projectred_illumination/loot_tables/blocks/gray_inverted_illumar_lamp.json 93ce38abe30aa4f1d205453c89f750226d037031 data/projectred_illumination/loot_tables/blocks/green_illumar_lamp.json 44bca255835e3cd52a14a0d7ae64ca5c2af0f794 data/projectred_illumination/loot_tables/blocks/green_inverted_illumar_lamp.json +02a0f482e29ef8f4f2f4e4e36592d07d2af1332e data/projectred_illumination/loot_tables/blocks/illumar_smart_lamp.json 2cf051942144dd90ce174df0886e0c693bd603ad data/projectred_illumination/loot_tables/blocks/light_blue_illumar_lamp.json f2802e525768f1e0f7dc0f7726b2ee283dff792e data/projectred_illumination/loot_tables/blocks/light_blue_inverted_illumar_lamp.json dcc7947bad8775d1ff68dc0c0d20b06ab6b902fd data/projectred_illumination/loot_tables/blocks/light_gray_illumar_lamp.json diff --git a/illumination/src/main/generated/.cache/be1ef78e8a7cc1ad66607d87653d2e29da533af1 b/illumination/src/main/generated/.cache/be1ef78e8a7cc1ad66607d87653d2e29da533af1 index c50793f46..bfe3f5a8d 100644 --- a/illumination/src/main/generated/.cache/be1ef78e8a7cc1ad66607d87653d2e29da533af1 +++ b/illumination/src/main/generated/.cache/be1ef78e8a7cc1ad66607d87653d2e29da533af1 @@ -1,4 +1,4 @@ -// 1.19.2 2024-03-05T10:08:22.238879 ProjectRed-Illumination Block Models +// 1.19.2 2024-05-07T15:02:14.42821 ProjectRed-Illumination Block Models 0746294f4d3dd435feb6f198d7131a6fe4be71fa assets/projectred_illumination/blockstates/black_illumar_lamp.json 0746294f4d3dd435feb6f198d7131a6fe4be71fa assets/projectred_illumination/blockstates/black_inverted_illumar_lamp.json 14312633b8d330d240fa130218c89f36a16579c1 assets/projectred_illumination/blockstates/blue_illumar_lamp.json @@ -11,6 +11,7 @@ eccf141f058ae9adb65b77fd11c82ccbc44e5108 assets/projectred_illumination/blocksta eccf141f058ae9adb65b77fd11c82ccbc44e5108 assets/projectred_illumination/blockstates/gray_inverted_illumar_lamp.json d49ec0eee75ebf8b26b19bd7947521c052fab378 assets/projectred_illumination/blockstates/green_illumar_lamp.json d49ec0eee75ebf8b26b19bd7947521c052fab378 assets/projectred_illumination/blockstates/green_inverted_illumar_lamp.json +d6ebdb5e8eadaba44c9200e53c4982b04dd77359 assets/projectred_illumination/blockstates/illumar_smart_lamp.json 3c01dccff2ba9c4e93ed0fc989f5b93af0edc1ad assets/projectred_illumination/blockstates/light_blue_illumar_lamp.json 3c01dccff2ba9c4e93ed0fc989f5b93af0edc1ad assets/projectred_illumination/blockstates/light_blue_inverted_illumar_lamp.json e31dd0781aa8551edcdad8f3d0f51d02f69ae9d5 assets/projectred_illumination/blockstates/light_gray_illumar_lamp.json @@ -43,6 +44,8 @@ f81f1a943995009a435634ce66184a37b91142ef assets/projectred_illumination/models/b b74a5d560b10ff6da6302100aa2a3576859567e8 assets/projectred_illumination/models/block/gray_illumar_lamp_on.json c2ea0630753528faa979169f4896680edd444740 assets/projectred_illumination/models/block/green_illumar_lamp.json f8618a27bdb622b34d2159a0971a1ecc82eb7830 assets/projectred_illumination/models/block/green_illumar_lamp_on.json +a10bc3eccc0d66e962e91821236deadc48cff693 assets/projectred_illumination/models/block/illumar_smart_lamp.json +ef2683c5a198564370912026bb7d58ee36cdbf2f assets/projectred_illumination/models/block/illumar_smart_lamp_on.json 05aa22099bae4f9fa31127b214f3ce3aa62e36ee assets/projectred_illumination/models/block/light_blue_illumar_lamp.json a7d29aab07598cbd6028e141475541aabcd62979 assets/projectred_illumination/models/block/light_blue_illumar_lamp_on.json 672ed59c46c3acc2baf1825ec0696da87620c095 assets/projectred_illumination/models/block/light_gray_illumar_lamp.json diff --git a/illumination/src/main/generated/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/illumination/src/main/generated/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 index 3930de9b5..59e524781 100644 --- a/illumination/src/main/generated/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/illumination/src/main/generated/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 @@ -1,2 +1,2 @@ -// 1.19.2 2024-03-05T10:08:22.238073 Languages: en_us -548cfaf60e6a16b400fd90c0cc5da98891f425cf assets/projectred_illumination/lang/en_us.json +// 1.19.2 2024-05-07T15:11:08.498971 Languages: en_us +bd4c754665d90437f9a3014a701298a4082d18cc assets/projectred_illumination/lang/en_us.json diff --git a/illumination/src/main/generated/assets/projectred_illumination/blockstates/illumar_smart_lamp.json b/illumination/src/main/generated/assets/projectred_illumination/blockstates/illumar_smart_lamp.json new file mode 100644 index 000000000..66b0174ea --- /dev/null +++ b/illumination/src/main/generated/assets/projectred_illumination/blockstates/illumar_smart_lamp.json @@ -0,0 +1,436 @@ +{ + "variants": { + "level=0,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp" + }, + "level=0,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp", + "x": 180, + "y": 180 + }, + "level=0,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp", + "x": 90, + "y": 180 + }, + "level=0,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp", + "x": 90 + }, + "level=0,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp", + "x": 90, + "y": 90 + }, + "level=0,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp", + "x": 90, + "y": 270 + }, + "level=1,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=1,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=1,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=1,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=1,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=1,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=10,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=10,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=10,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=10,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=10,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=10,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=11,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=11,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=11,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=11,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=11,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=11,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=12,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=12,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=12,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=12,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=12,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=12,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=13,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=13,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=13,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=13,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=13,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=13,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=14,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=14,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=14,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=14,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=14,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=14,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=15,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=15,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=15,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=15,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=15,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=15,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=2,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=2,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=2,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=2,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=2,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=2,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=3,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=3,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=3,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=3,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=3,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=3,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=4,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=4,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=4,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=4,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=4,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=4,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=5,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=5,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=5,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=5,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=5,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=5,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=6,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=6,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=6,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=6,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=6,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=6,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=7,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=7,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=7,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=7,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=7,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=7,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=8,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=8,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=8,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=8,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=8,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=8,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + }, + "level=9,side=0": { + "model": "projectred_illumination:block/illumar_smart_lamp_on" + }, + "level=9,side=1": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 180, + "y": 180 + }, + "level=9,side=2": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 180 + }, + "level=9,side=3": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90 + }, + "level=9,side=4": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 90 + }, + "level=9,side=5": { + "model": "projectred_illumination:block/illumar_smart_lamp_on", + "x": 90, + "y": 270 + } + } +} \ No newline at end of file diff --git a/illumination/src/main/generated/assets/projectred_illumination/lang/en_us.json b/illumination/src/main/generated/assets/projectred_illumination/lang/en_us.json index 415889ea8..b28b44184 100644 --- a/illumination/src/main/generated/assets/projectred_illumination/lang/en_us.json +++ b/illumination/src/main/generated/assets/projectred_illumination/lang/en_us.json @@ -11,6 +11,7 @@ "block.projectred_illumination.gray_inverted_illumar_lamp": "Gray Inverted Illumar Lamp", "block.projectred_illumination.green_illumar_lamp": "Green Illumar Lamp", "block.projectred_illumination.green_inverted_illumar_lamp": "Green Inverted Illumar Lamp", + "block.projectred_illumination.illumar_smart_lamp": "Illumar Smart Lamp", "block.projectred_illumination.light_blue_illumar_lamp": "Light Blue Illumar Lamp", "block.projectred_illumination.light_blue_inverted_illumar_lamp": "Light Blue Inverted Illumar Lamp", "block.projectred_illumination.light_gray_illumar_lamp": "Light Gray Illumar Lamp", diff --git a/illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp.json b/illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp.json new file mode 100644 index 000000000..0ec35f1bb --- /dev/null +++ b/illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "projectred_illumination:block/illumar_smart_lamp_bottom", + "side": "projectred_illumination:block/illumar_smart_lamp_side", + "top": "projectred_illumination:block/illumar_smart_lamp_top" + } +} \ No newline at end of file diff --git a/illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp_on.json b/illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp_on.json new file mode 100644 index 000000000..303a310ca --- /dev/null +++ b/illumination/src/main/generated/assets/projectred_illumination/models/block/illumar_smart_lamp_on.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "projectred_illumination:block/illumar_smart_lamp_bottom", + "side": "projectred_illumination:block/illumar_smart_lamp_side_on", + "top": "projectred_illumination:block/illumar_smart_lamp_top_on" + } +} \ No newline at end of file diff --git a/illumination/src/main/generated/assets/projectred_illumination/models/item/illumar_smart_lamp.json b/illumination/src/main/generated/assets/projectred_illumination/models/item/illumar_smart_lamp.json new file mode 100644 index 000000000..319ef8b07 --- /dev/null +++ b/illumination/src/main/generated/assets/projectred_illumination/models/item/illumar_smart_lamp.json @@ -0,0 +1,3 @@ +{ + "parent": "projectred_illumination:block/illumar_smart_lamp" +} \ No newline at end of file diff --git a/illumination/src/main/generated/data/projectred_illumination/loot_tables/blocks/illumar_smart_lamp.json b/illumination/src/main/generated/data/projectred_illumination/loot_tables/blocks/illumar_smart_lamp.json new file mode 100644 index 000000000..811308658 --- /dev/null +++ b/illumination/src/main/generated/data/projectred_illumination/loot_tables/blocks/illumar_smart_lamp.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "projectred_illumination:illumar_smart_lamp" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/illumination/src/main/generated/data/projectred_illumination/recipes/illumar_smart_lamp.json b/illumination/src/main/generated/data/projectred_illumination/recipes/illumar_smart_lamp.json new file mode 100644 index 000000000..7b6abf625 --- /dev/null +++ b/illumination/src/main/generated/data/projectred_illumination/recipes/illumar_smart_lamp.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "key": { + "B": { + "item": "projectred_core:blue_illumar" + }, + "C": { + "item": "projectred_core:bundled_plate" + }, + "G": { + "item": "projectred_core:green_illumar" + }, + "P": { + "tag": "forge:glass_panes/colorless" + }, + "R": { + "item": "projectred_core:red_illumar" + } + }, + "pattern": [ + "PRP", + "PGP", + "CBC" + ], + "result": { + "item": "projectred_illumination:illumar_smart_lamp" + } +} \ No newline at end of file diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/MultipartLightProperties.java b/illumination/src/main/java/mrtjp/projectred/illumination/MultipartLightProperties.java index b4150dd97..dcd53e74a 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/MultipartLightProperties.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/MultipartLightProperties.java @@ -36,6 +36,7 @@ import java.util.Map; import static mrtjp.projectred.illumination.ProjectRedIllumination.MOD_ID; +import static net.minecraft.client.renderer.block.model.ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND; public abstract class MultipartLightProperties { @@ -115,7 +116,8 @@ public void renderItem(ItemStack stack, ItemTransforms.TransformType transformTy renderInventory(lightItem.getColor(), lightItem.isInverted(), Vector3.ZERO, ccrs); if (lightItem.isInverted()) { - HaloRenderer.renderInventoryHalo(ccrs, mStack, getter, getInventoryGlowBounds(), lightItem.getColor(), Vector3.ZERO); + HaloRenderer.renderInventoryHalo(ccrs, mStack, getter, getInventoryGlowBounds(), Vector3.ZERO, lightItem.getColor()); + HaloRenderer.addItemRendererBloom(transformType, mStack, Vector3.ZERO, getInventoryGlowBounds(), lightItem.getColor()); } } diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/ProjectRedIllumination.java b/illumination/src/main/java/mrtjp/projectred/illumination/ProjectRedIllumination.java index cf66496ad..6399763fa 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/ProjectRedIllumination.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/ProjectRedIllumination.java @@ -23,6 +23,8 @@ import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import static mrtjp.projectred.illumination.ProjectRedIllumination.MOD_ID; @@ -31,6 +33,8 @@ public class ProjectRedIllumination { public static final String MOD_ID = "projectred_illumination"; + public static final Logger LOGGER = LogManager.getLogger(MOD_ID); + public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MOD_ID); public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID); public static final DeferredRegister> BLOCK_ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, MOD_ID); diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/block/IllumarSmartLampBlock.java b/illumination/src/main/java/mrtjp/projectred/illumination/block/IllumarSmartLampBlock.java new file mode 100644 index 000000000..cc1e721a7 --- /dev/null +++ b/illumination/src/main/java/mrtjp/projectred/illumination/block/IllumarSmartLampBlock.java @@ -0,0 +1,55 @@ +package mrtjp.projectred.illumination.block; + +import mrtjp.projectred.core.block.ProjectRedBlock; +import mrtjp.projectred.illumination.init.IlluminationBlocks; +import mrtjp.projectred.illumination.tile.IllumarSmartLampBlockEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.LightBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.material.Material; +import org.jetbrains.annotations.Nullable; + +import java.util.function.ToIntFunction; + +public class IllumarSmartLampBlock extends ProjectRedBlock implements EntityBlock { + + public static final IntegerProperty LEVEL = LightBlock.LEVEL; + public static final ToIntFunction LIGHT_EMISSION = LightBlock.LIGHT_EMISSION; + + public IllumarSmartLampBlock() { + super(BlockBehaviour.Properties.of(Material.BUILDABLE_GLASS) + .strength(0.5F) + .lightLevel(LIGHT_EMISSION)); + + this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, 0)); + } + + protected void createBlockStateDefinition(StateDefinition.Builder pBuilder) { + pBuilder.add(LEVEL).add(ProjectRedBlock.SIDE); + } + + @Nullable + @Override + public BlockState getStateForPlacement(BlockPlaceContext pContext) { + return defaultBlockState().setValue(LEVEL, 0); + } + + @Override + protected BlockEntityType getBlockEntityType() { + return IlluminationBlocks.ILLUMAR_SMART_LAMP_BLOCK_ENTITY.get(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { + return new IllumarSmartLampBlockEntity(pPos, pState); + } +} diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampItemRenderer.java b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampItemRenderer.java index 1bca0b01b..b7643bec6 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampItemRenderer.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampItemRenderer.java @@ -17,17 +17,13 @@ import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.model.BakedModel; -import net.minecraft.client.resources.model.ModelState; import net.minecraft.core.Direction; import net.minecraft.util.RandomSource; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.levelgen.RandomState; import org.jetbrains.annotations.Nullable; -import java.util.Random; - public class IllumarLampItemRenderer extends WrappedItemModel implements IItemRenderer { private static final Cuboid6 BLOCK_BOUNDS = Cuboid6.full.copy().expand(-0.02D); @@ -69,7 +65,8 @@ public void renderItem(ItemStack stack, ItemTransforms.TransformType transformTy BlockRenderer.renderCuboid(ccrs, BLOCK_BOUNDS, 0); // Render halo - HaloRenderer.renderInventoryHalo(ccrs, mStack, getter, GLOW_BOUNDS, block.getColor(), Vector3.ZERO); + HaloRenderer.renderInventoryHalo(ccrs, mStack, getter, GLOW_BOUNDS, Vector3.ZERO, block.getColor()); + HaloRenderer.addItemRendererBloom(transformType, mStack, Vector3.ZERO, GLOW_BOUNDS, block.getColor()); } @Override diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampTileRenderer.java b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampTileRenderer.java index b42de872a..7e1f3c82f 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampTileRenderer.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarLampTileRenderer.java @@ -24,7 +24,7 @@ public void render(IllumarLampTile tile, float partialTicks, PoseStack matrixSta if (tile.getLevel() != null) { BlockState state = tile.getLevel().getBlockState(tile.getBlockPos()); if (state.getBlock() instanceof IllumarLampBlock && tile.isLit()) { - HaloRenderer.addLight(tile.getBlockPos(), tile.color, GLOW_BOUNDS); + HaloRenderer.addLight(tile.getBlockPos(), GLOW_BOUNDS, tile.color); } } } diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampBlockEntityRenderer.java b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampBlockEntityRenderer.java new file mode 100644 index 000000000..85cc03036 --- /dev/null +++ b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampBlockEntityRenderer.java @@ -0,0 +1,30 @@ +package mrtjp.projectred.illumination.client; + +import codechicken.lib.vec.Cuboid6; +import com.mojang.blaze3d.vertex.PoseStack; +import mrtjp.projectred.core.BundledSignalsLib; +import mrtjp.projectred.core.client.HaloRenderer; +import mrtjp.projectred.illumination.tile.IllumarSmartLampBlockEntity; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; + +public class IllumarSmartLampBlockEntityRenderer implements BlockEntityRenderer { + + public static final IllumarSmartLampBlockEntityRenderer INSTANCE = new IllumarSmartLampBlockEntityRenderer(); + + public static final Cuboid6 GLOW_BOUNDS = Cuboid6.full.copy().expand(0.05D); + + @Override + public void render(IllumarSmartLampBlockEntity tile, float pPartialTick, PoseStack pPoseStack, MultiBufferSource pBufferSource, int pPackedLight, int pPackedOverlay) { + + byte[] signal = tile.getSignal(); + if (!BundledSignalsLib.isSignalZero(signal)) { + HaloRenderer.addMultiLight(tile.getBlockPos(), GLOW_BOUNDS, tile.getSignal()); + } + } + + @Override + public int getViewDistance() { + return 256; + } +} diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampItemRenderer.java b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampItemRenderer.java new file mode 100644 index 000000000..f367e3d9b --- /dev/null +++ b/illumination/src/main/java/mrtjp/projectred/illumination/client/IllumarSmartLampItemRenderer.java @@ -0,0 +1,118 @@ +package mrtjp.projectred.illumination.client; + +import codechicken.lib.model.PerspectiveModelState; +import codechicken.lib.model.bakedmodels.WrappedItemModel; +import codechicken.lib.render.BlockRenderer; +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.item.IItemRenderer; +import codechicken.lib.util.TransformUtils; +import codechicken.lib.vec.Cuboid6; +import codechicken.lib.vec.Vector3; +import codechicken.lib.vec.uv.MultiIconTransformation; +import com.mojang.blaze3d.vertex.PoseStack; +import mrtjp.projectred.core.client.HaloRenderer; +import mrtjp.projectred.illumination.block.IllumarSmartLampBlock; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.block.model.ItemTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; + +public class IllumarSmartLampItemRenderer extends WrappedItemModel implements IItemRenderer { + + private static final Cuboid6 BLOCK_BOUNDS = Cuboid6.full.copy().expand(-0.02D); + private static final Cuboid6 GLOW_BOUNDS = Cuboid6.full.copy().expand(0.02D); + private static final RandomSource random = RandomSource.create(); + + private final byte[] signal = new byte[16]; + private long lastSignalAnimateTime = -1L; + + public IllumarSmartLampItemRenderer(BakedModel wrapped) { + super(wrapped); + } + + @Override + public void renderItem(ItemStack stack, ItemTransforms.TransformType transformType, PoseStack mStack, MultiBufferSource getter, int packedLight, int packedOverlay) { + Item item = stack.getItem(); + if (!(item instanceof BlockItem blockItem)) return; + + if (!(blockItem.getBlock() instanceof IllumarSmartLampBlock block)) return; + + // Render actual block. Required because renderWrapped does not play nice with + // halo rendering. Halo completely obscures wrapped render. + + // Obtain texture from original block model + TextureAtlasSprite[] icons = new TextureAtlasSprite[6]; + for (Direction dir : Direction.values()) { + icons[dir.get3DDataValue()] = wrapped.getQuads(null, dir, random).get(0).getSprite(); + } + MultiIconTransformation iconT = new MultiIconTransformation(icons); + + + // Render block + CCRenderState ccrs = CCRenderState.instance(); + ccrs.reset(); + ccrs.brightness = packedLight; + ccrs.overlay = packedOverlay; + ccrs.bind(RenderType.cutout(), getter, mStack); + + ccrs.setPipeline(iconT); + BlockRenderer.renderCuboid(ccrs, BLOCK_BOUNDS, 0); + + // Animate signals + animateSignal(); + + // Render halo + HaloRenderer.renderInventoryMultiHalo(ccrs, mStack, getter, GLOW_BOUNDS, Vector3.ZERO, signal); + HaloRenderer.addItemRendererMultiBloom(transformType, mStack, Vector3.ZERO, GLOW_BOUNDS, signal); + } + + private void animateSignal() { + + Level level = Minecraft.getInstance().level; + long time = level != null ? level.getGameTime() : System.currentTimeMillis() / 50L; // approximate time progression if no level + + // Only do this once per tick + if (time == lastSignalAnimateTime) return; + lastSignalAnimateTime = time; + + // Sine-wave animation + double t = (Math.sin(time / 200.0) + 1.0) / 2.0 * 15.0; // Sine wave with bounds [0, 15] + double d = 1.5; // Max distance (max active colours / 2) + + for (int i = 0; i < 16; i++) { + double diff = Math.min(Math.abs(t - i), d); + double brightness = 1.0 - diff / d; + signal[i] = (byte) (255 * brightness); + } + } + + @Override + public @Nullable PerspectiveModelState getModelState() { + return TransformUtils.DEFAULT_BLOCK; + } + + @Override + public boolean useAmbientOcclusion() { + return true; + } + + @Override + public boolean isGui3d() { + return true; + } + + @Override + public boolean usesBlockLight() { + return true; + } + +} diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/client/MultipartLightPartRenderer.java b/illumination/src/main/java/mrtjp/projectred/illumination/client/MultipartLightPartRenderer.java index 9386e033c..4d530e4f4 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/client/MultipartLightPartRenderer.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/client/MultipartLightPartRenderer.java @@ -28,6 +28,6 @@ public void renderStatic(MultipartLightPart part, @Nullable RenderType layer, CC @Override public void renderDynamic(MultipartLightPart part, PoseStack pStack, MultiBufferSource buffers, int packedLight, int packedOverlay, float partialTicks) { if (part.isLightOn()) - HaloRenderer.addLight(part.pos(), part.getColor(), part.getProperties().getGlowBounds(part.getSide())); + HaloRenderer.addLight(part.pos(), part.getProperties().getGlowBounds(part.getSide()), part.getColor()); } } diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockLootProvider.java b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockLootProvider.java index 6b6c73f76..a8f9c46c6 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockLootProvider.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockLootProvider.java @@ -4,6 +4,8 @@ import mrtjp.projectred.illumination.BlockLightType; import net.minecraft.data.DataGenerator; +import static mrtjp.projectred.illumination.init.IlluminationBlocks.ILLUMAR_SMART_LAMP; + public class IlluminationBlockLootProvider extends LootTableProvider.BlockLootProvider { public IlluminationBlockLootProvider(DataGenerator dataGenerator) { @@ -23,5 +25,7 @@ protected void registerTables() { register(lampType.getBlock(color, true), singleItem(lampType.getBlock(color, true))); } } + + register(ILLUMAR_SMART_LAMP.get(), singleItem(ILLUMAR_SMART_LAMP.get())); } } diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockStateModelProvider.java b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockStateModelProvider.java index b6035bdf1..680fab056 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockStateModelProvider.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationBlockStateModelProvider.java @@ -1,19 +1,28 @@ package mrtjp.projectred.illumination.data; +import mrtjp.projectred.core.block.ProjectRedBlock; import mrtjp.projectred.illumination.BlockLightType; import mrtjp.projectred.illumination.ProjectRedIllumination; import mrtjp.projectred.illumination.block.IllumarLampBlock; +import mrtjp.projectred.illumination.block.IllumarSmartLampBlock; import net.minecraft.data.DataGenerator; import net.minecraft.world.level.block.Block; import net.minecraftforge.client.model.generators.BlockModelBuilder; import net.minecraftforge.client.model.generators.BlockStateProvider; import net.minecraftforge.client.model.generators.ConfiguredModel; +import net.minecraftforge.client.model.generators.ModelFile; import net.minecraftforge.common.data.ExistingFileHelper; +import net.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nonnull; +import static mrtjp.projectred.illumination.init.IlluminationBlocks.ILLUMAR_SMART_LAMP; + public class IlluminationBlockStateModelProvider extends BlockStateProvider { + // XY rotations for non-rotatable sided devices + private static final int[][] DEVICE_SIDED_ROTATIONS = { {0, 0}, {2, 2}, {1, 2}, {1, 0}, {1, 1}, {1, 3} }; + public IlluminationBlockStateModelProvider(DataGenerator gen, ExistingFileHelper exFileHelper) { super(gen, ProjectRedIllumination.MOD_ID, exFileHelper); } @@ -31,6 +40,10 @@ protected void registerStatesAndModels() { addIllumarLampVariants(lampType.getBlock(color, false)); } } + + addSidedBlockVariants(ILLUMAR_SMART_LAMP.get(), + createSmartLampModel(ILLUMAR_SMART_LAMP.get(), false), + createSmartLampModel(ILLUMAR_SMART_LAMP.get(), true)); } private void addIllumarLampVariants(Block block) { @@ -43,4 +56,27 @@ private BlockModelBuilder createLampModel(Block block, boolean lit) { String textureName = BlockLightType.ILLUMAR_LAMP.getRegistryID(((IllumarLampBlock) block).getColor(), false) + (lit ? "_on" : ""); // Always use non-inverted unlocal name for textures return models().cubeAll(textureName, modLoc("block/" + textureName)); } + + private void addSidedBlockVariants(Block block, ModelFile offModel, ModelFile onModel) { + getVariantBuilder(block).forAllStates(state -> { + int s = state.getValue(ProjectRedBlock.SIDE); + boolean lit = state.getValue(IllumarSmartLampBlock.LEVEL) > 0; + + return ConfiguredModel.builder() + .modelFile(lit ? onModel : offModel) + .rotationX(DEVICE_SIDED_ROTATIONS[s][0] * 90) + .rotationY(DEVICE_SIDED_ROTATIONS[s][1] * 90) + .build(); + }); + } + + private BlockModelBuilder createSmartLampModel(Block block, boolean lit) { + String texture = ForgeRegistries.BLOCKS.getKey(block).getPath(); + String litKey = lit ? "_on" : ""; + String modelName = texture + litKey; + return models().cubeBottomTop(modelName, + modLoc("block/" + texture + "_side" + litKey), + modLoc("block/" + texture + "_bottom"), + modLoc("block/" + texture + "_top" + litKey)); + } } diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationItemModelProvider.java b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationItemModelProvider.java index 28fd15e5c..94bc6fb6d 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationItemModelProvider.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationItemModelProvider.java @@ -8,6 +8,7 @@ import net.minecraftforge.common.data.ExistingFileHelper; import static mrtjp.projectred.illumination.ProjectRedIllumination.MOD_ID; +import static mrtjp.projectred.illumination.init.IlluminationBlocks.ILLUMAR_SMART_LAMP; public class IlluminationItemModelProvider extends ItemModelProvider { @@ -33,6 +34,8 @@ protected void registerModels() { } } + simpleItemBlock(ILLUMAR_SMART_LAMP.get()); + for (MultipartLightType type : MultipartLightType.values()) { for (int color = 0; color < 16; color++) { generated(type.getItem(color, false)).noTexture(); diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationLanguageProvider.java b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationLanguageProvider.java index 11aef80ea..66f55c56b 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationLanguageProvider.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationLanguageProvider.java @@ -6,6 +6,7 @@ import net.minecraftforge.common.data.LanguageProvider; import static mrtjp.projectred.illumination.ProjectRedIllumination.MOD_ID; +import static mrtjp.projectred.illumination.init.IlluminationBlocks.ILLUMAR_SMART_LAMP; public class IlluminationLanguageProvider extends LanguageProvider { @@ -31,6 +32,9 @@ protected void addTranslations() { } } + // Illumar smart lamp + addBlock(ILLUMAR_SMART_LAMP, "Illumar Smart Lamp"); + // Multipart lights for (MultipartLightType type : MultipartLightType.values()) { for (int color = 0; color < 16; color++) { diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationRecipeProvider.java b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationRecipeProvider.java index b7233a8e9..938a49940 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationRecipeProvider.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/data/IlluminationRecipeProvider.java @@ -9,6 +9,7 @@ import net.minecraftforge.common.Tags; import static mrtjp.projectred.core.init.CoreItems.*; +import static mrtjp.projectred.illumination.init.IlluminationBlocks.ILLUMAR_SMART_LAMP; public class IlluminationRecipeProvider extends RecipeProvider { @@ -43,6 +44,17 @@ protected void registerRecipes() { .patternLine("GRG"); } + //Smart lamp + shapedRecipe(ILLUMAR_SMART_LAMP.get(), 1) + .key('P', Tags.Items.GLASS_PANES_COLORLESS) + .key('C', BUNDLED_PLATE_ITEM.get()) + .key('R', RED_ILLUMAR_ITEM.get()) + .key('G', GREEN_ILLUMAR_ITEM.get()) + .key('B', BLUE_ILLUMAR_ITEM.get()) + .patternLine("PRP") + .patternLine("PGP") + .patternLine("CBC"); + //Lanterns for (int c = 0; c < 16; c++) { shapedRecipe(MultipartLightType.LANTERN.getItem(c, false), 1) diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationBlocks.java b/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationBlocks.java index 76ca0448a..dc8e2f82c 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationBlocks.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationBlocks.java @@ -1,16 +1,42 @@ package mrtjp.projectred.illumination.init; import mrtjp.projectred.illumination.BlockLightType; +import mrtjp.projectred.illumination.block.IllumarSmartLampBlock; +import mrtjp.projectred.illumination.tile.IllumarSmartLampBlockEntity; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraftforge.registries.RegistryObject; import static mrtjp.projectred.illumination.ProjectRedIllumination.*; +@SuppressWarnings({ "DataFlowIssue", "NotNullFieldNotInitialized" }) public class IlluminationBlocks { + public static final String ID_ILLUMAR_SMART_LAMP = "illumar_smart_lamp"; + + // Blocks + public static RegistryObject ILLUMAR_SMART_LAMP; + + // Block Entities + public static RegistryObject> ILLUMAR_SMART_LAMP_BLOCK_ENTITY; + + public static void register() { // Block lights for (BlockLightType lampType : BlockLightType.values()) { lampType.registerBlocks(BLOCKS, ITEMS, BLOCK_ENTITY_TYPES); } + + // Blocks + ILLUMAR_SMART_LAMP = BLOCKS.register(ID_ILLUMAR_SMART_LAMP, IllumarSmartLampBlock::new); + + // Block Items + ITEMS.register(ID_ILLUMAR_SMART_LAMP, () -> new BlockItem(ILLUMAR_SMART_LAMP.get(), new Item.Properties().tab(ILLUMINATION_GROUP))); + + // Block Entities + ILLUMAR_SMART_LAMP_BLOCK_ENTITY = BLOCK_ENTITY_TYPES.register(ID_ILLUMAR_SMART_LAMP, () -> BlockEntityType.Builder.of(IllumarSmartLampBlockEntity::new, ILLUMAR_SMART_LAMP.get()).build(null)); } } diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationClientInit.java b/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationClientInit.java index cb4a4cd3d..66ef3cdb2 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationClientInit.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/init/IlluminationClientInit.java @@ -5,9 +5,7 @@ import codechicken.multipart.api.MultipartClientRegistry; import mrtjp.projectred.illumination.BlockLightType; import mrtjp.projectred.illumination.MultipartLightType; -import mrtjp.projectred.illumination.client.IllumarLampItemRenderer; -import mrtjp.projectred.illumination.client.IllumarLampTileRenderer; -import mrtjp.projectred.illumination.client.MultipartLightPartRenderer; +import mrtjp.projectred.illumination.client.*; import net.covers1624.quack.util.SneakyUtils; import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; import net.minecraft.client.resources.model.BakedModel; @@ -47,6 +45,13 @@ public static void init() { new ModelResourceLocation(blockRL, "inventory"), new IllumarLampItemRenderer(litModel)); } + + // Illumar smart lamp renderer + ResourceLocation smartLampRl = Objects.requireNonNull(ForgeRegistries.BLOCKS.getKey(IlluminationBlocks.ILLUMAR_SMART_LAMP.get())); + BakedModel smartLampModel = e.getModels().get(new ModelResourceLocation(smartLampRl, "level=15,side=0")); + e.getModels().put( + new ModelResourceLocation(smartLampRl, "inventory"), + new IllumarSmartLampItemRenderer(smartLampModel)); }); } @@ -60,6 +65,8 @@ private static void clientSetup(final FMLClientSetupEvent event) { } } + BlockEntityRenderers.register(SneakyUtils.unsafeCast(IlluminationBlocks.ILLUMAR_SMART_LAMP_BLOCK_ENTITY.get()), c -> IllumarSmartLampBlockEntityRenderer.INSTANCE); + // Register light part renderers for (MultipartLightType type : MultipartLightType.values()) { for (int colour = 0; colour < 16; colour++) { diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/part/IllumarLampMicroMaterial.java b/illumination/src/main/java/mrtjp/projectred/illumination/part/IllumarLampMicroMaterial.java index f3ae940e0..745fa4cc1 100644 --- a/illumination/src/main/java/mrtjp/projectred/illumination/part/IllumarLampMicroMaterial.java +++ b/illumination/src/main/java/mrtjp/projectred/illumination/part/IllumarLampMicroMaterial.java @@ -46,9 +46,10 @@ public void renderDynamic(MicroblockPart part, @Nullable ItemTransforms.Transfor Cuboid6 cuboid = part.getBounds().copy().expand(0.025D); if (transform != null) { // Inventory rendering - HaloRenderer.renderInventoryHalo(ccrs, pStack, buffers, cuboid, getLightColor(), Vector3.ZERO); + HaloRenderer.renderInventoryHalo(ccrs, pStack, buffers, cuboid, Vector3.ZERO, getLightColor()); + HaloRenderer.addItemRendererBloom(transform, pStack, Vector3.ZERO, cuboid, getLightColor()); } else { - HaloRenderer.addLight(part.pos(), getLightColor(), cuboid); + HaloRenderer.addLight(part.pos(), cuboid, getLightColor()); } } diff --git a/illumination/src/main/java/mrtjp/projectred/illumination/tile/IllumarSmartLampBlockEntity.java b/illumination/src/main/java/mrtjp/projectred/illumination/tile/IllumarSmartLampBlockEntity.java new file mode 100644 index 000000000..d03a8986c --- /dev/null +++ b/illumination/src/main/java/mrtjp/projectred/illumination/tile/IllumarSmartLampBlockEntity.java @@ -0,0 +1,269 @@ +package mrtjp.projectred.illumination.tile; + +import codechicken.lib.data.MCDataInput; +import codechicken.lib.data.MCDataOutput; +import codechicken.lib.vec.Rotation; +import mrtjp.projectred.api.IBundledEmitter; +import mrtjp.projectred.api.IBundledTile; +import mrtjp.projectred.api.IConnectable; +import mrtjp.projectred.api.IMaskedBundledTile; +import mrtjp.projectred.core.BundledSignalsLib; +import mrtjp.projectred.core.CenterLookup; +import mrtjp.projectred.core.FaceLookup; +import mrtjp.projectred.core.tile.BaseConnectableTile; +import mrtjp.projectred.core.tile.IOrientableBlockEntity; +import mrtjp.projectred.illumination.block.IllumarSmartLampBlock; +import mrtjp.projectred.illumination.init.IlluminationBlocks; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; + +import javax.annotation.Nullable; +import java.util.Objects; + +public class IllumarSmartLampBlockEntity extends BaseConnectableTile implements IOrientableBlockEntity, IMaskedBundledTile { + + private static final int PACKET_SIGNAL = 10; + + private final byte[] signal = new byte[16]; + + public IllumarSmartLampBlockEntity(BlockPos pos, BlockState state) { + super(IlluminationBlocks.ILLUMAR_SMART_LAMP_BLOCK_ENTITY.get(), pos, state); + } + + public byte[] getSignal() { + return signal; + } + + @Override + public void saveToNBT(CompoundTag tag) { + super.saveToNBT(tag); + tag.putByteArray("signal", signal); + } + + @Override + public void loadFromNBT(CompoundTag tag) { + super.loadFromNBT(tag); + + var s = tag.getByteArray("signal"); + if (s.length == 16) + System.arraycopy(s, 0, signal, 0, 16); + } + + @Override + public void writeDesc(MCDataOutput out) { + super.writeDesc(out); + for (int i = 0; i < 16; i++) + out.writeByte(signal[i]); + } + + @Override + public void readDesc(MCDataInput in) { + super.readDesc(in); + for (int i = 0; i < 16; i++) + signal[i] = in.readByte(); + } + + @Override + public void receiveUpdateFromServer(int key, MCDataInput input) { + switch (key) { + case PACKET_SIGNAL -> readSignalUpdate(input); + default -> super.receiveUpdateFromServer(key, input); + } + } + + private void readSignalUpdate(MCDataInput input) { + short changeMask = input.readShort(); + for (int i = 0; i < 16; i++) { + if ((changeMask & (1 << i)) != 0) { + signal[i] = input.readByte(); + } + } + } + + private void sendSignalUpdate(int changeMask) { + if (changeMask == 0) return; + + sendUpdateToPlayersWatchingChunk(PACKET_SIGNAL, stream -> { + stream.writeShort(changeMask); + for (int i = 0; i < 16; i++) { + if ((changeMask & (1 << i)) != 0) { + stream.writeByte(signal[i]); + } + } + }); + } + + @Override + public BlockState storeBlockState(BlockState defaultState) { + int max = 0; + for (byte b : signal) { + max = Math.max(max, b & 0xFF); + } + return super.storeBlockState(defaultState) + .setValue(IllumarSmartLampBlock.LEVEL, max / 17); // 255 -> 15 + } + + //region IMaskedBundled tile + @Override + public byte[] getBundledSignal(int dir) { + return null; // Block is input only + } + + @Override + public boolean canConnectBundled(int side) { + return side != (getSide() ^ 1); + } + + @Override + public int getConnectionMask(int side) { + if (side == getSide()) { + return 0x1F; // All edges and center + } if (side == (getSide() ^ 1)) { + return 0; // No connections on top + } else { + return 1 << Rotation.rotationTo(side, getSide()); // Bottom edge + } + } + //endregion + + @Override + public boolean canConnectPart(IConnectable part, int s, int edgeRot) { + if (!(part instanceof IBundledEmitter)) return false; + + int side = getSide(); + + if (s == side) { // Bottom side can input from all 4 edges and center + return true; + } + if (s == (side ^ 1)) { // Top side cannot input at all + return false; + } + + return edgeRot == Rotation.rotationTo(s, side); // Other sides input on edge touching bottom side + } + + @Override + public void onNeighborBlockChanged(BlockPos neighborPos) { + super.onNeighborBlockChanged(neighborPos); + + if (!getLevel().isClientSide) { + checkSignal(); + } + } + + @Override + public void onBlockPlaced(@Nullable LivingEntity player, ItemStack item) { + super.onBlockPlaced(player, item); + + if (!getLevel().isClientSide) { + checkSignal(); + } + } + + @Override + public void onOrientationChange() { + if (!getLevel().isClientSide) { + updateExternals(); + checkSignal(); + } + } + + private void checkSignal() { + byte[] newSig = calcBundledInput(); + // Send update if any byte is different + int changeMask = BundledSignalsLib.applyAndGetChangeMask(newSig, signal); + if (changeMask != 0) { + pushBlockState(); + sendSignalUpdate(changeMask); + } + } + + //region Signal acquisition + protected byte[] calcBundledInput() { + byte[] newSignal = new byte[16]; + + for (int s = 0; s < 6; s++) { + if (s == (getSide() ^ 1)) { // Cant connect on top + continue; + } + + if (s == getSide()) { // Bottom can connect straight or on edges + // Center connection + if (maskConnectsStraightCenter(s)) { + BundledSignalsLib.raiseSignal(newSignal, calcCenterSignal(s)); + } + + // Edge connections + for (int r = 0; r < 4; r++) { + if (maskConnectsStraight(s, r)) { // Straight down + BundledSignalsLib.raiseSignal(newSignal, calcStraightSignal(s, r)); + } else if (maskConnectsCorner(s, r)) { // Corner towards sides + BundledSignalsLib.raiseSignal(newSignal, calcCornerSignal(s, r)); + } + } + + continue; + } + + // Perpendicular faces can connect only on bottom edge + int r = Rotation.rotationTo(s, getSide()); + if (maskConnectsStraight(s, r)) { + BundledSignalsLib.raiseSignal(newSignal, calcStraightSignal(s, r)); + } else if (maskConnectsCorner(s, r)) { + BundledSignalsLib.raiseSignal(newSignal, calcCornerSignal(s, r)); + } + } + + return newSignal; + } + + private @Nullable byte[] calcCornerSignal(int s, int r) { + int vs = Rotation.rotateSide(s, r); // virtual internal face + int vr = Rotation.rotationTo(vs, s); // virtual rotation + FaceLookup lookup = FaceLookup.lookupCorner(getLevel(), getBlockPos(), vs, vr); + return resolveArray(lookup); + } + + private @Nullable byte[] calcStraightSignal(int s, int r) { + int vs = Rotation.rotateSide(s, r); // virtual internal face + int vr = Rotation.rotationTo(vs, s); // virtual rotation + FaceLookup lookup = FaceLookup.lookupStraight(getLevel(), getBlockPos(), vs, vr); + return resolveArray(lookup); + } + + private @Nullable byte[] calcCenterSignal(int s) { + CenterLookup lookup = CenterLookup.lookupStraightCenter(getLevel(), getBlockPos(), s); + return resolveArray(lookup); + } + + protected @Nullable byte[] resolveArray(FaceLookup lookup) { + if (lookup.part instanceof IBundledEmitter) { + return ((IBundledEmitter) lookup.part).getBundledSignal(lookup.otherRotation); + + } else if (lookup.tile instanceof IBundledTile) { + return ((IBundledTile) lookup.tile).getBundledSignal(Rotation.rotateSide(lookup.otherSide, lookup.otherRotation)); + + } else if (lookup.tile != null) { + return BundledSignalsLib.getBundledSignalViaInteraction(Objects.requireNonNull(lookup.tile.getLevel()), lookup.tile.getBlockPos(), Direction.values()[Rotation.rotateSide(lookup.otherSide, lookup.otherRotation)]); + } + return null; + } + + protected @Nullable byte[] resolveArray(CenterLookup lookup) { + if (lookup.part instanceof IBundledEmitter) { + return ((IBundledEmitter) lookup.part).getBundledSignal(lookup.otherDirection); + + } else if (lookup.tile instanceof IBundledTile) { + return ((IBundledTile) lookup.tile).getBundledSignal(lookup.otherDirection); + + } else if (lookup.tile != null) { + return BundledSignalsLib.getBundledSignalViaInteraction(Objects.requireNonNull(lookup.tile.getLevel()), lookup.tile.getBlockPos(), Direction.values()[lookup.otherDirection]); + } + return null; + } + //endregion +} diff --git a/illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_bottom.png b/illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_bottom.png new file mode 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Df~ceQX@Dh|Ry<-sT4rhI$jQ0Sq~!`#Eo-%($2E^vo}is5J@NVEf|KK?WT&2;PCq@=ncR8z zO#GQ^T~S@VXG71PKNocFOt)Y6$@AXlk6rM*aP%VgV%sIRORYVwJx6|U{ozQjTW{-S z_si{9Jg#)~P3t?+@6&(!YQWWV*Z9{iU7vZq@5byKw{9lg9JnRA_4s!7?H6|n?o8ZW zdXIRo{Jz@#>IeD{>VLHUv1Pz*;P_y`V9&!@5AO~Mho1hF|I>%z(nrik)gwkDjgOrl z9~%uCz4Bzvli{bbrxVZ0epdf^>vOB;-~HnIOV3#R*zgPai_gEVd8zYq@2jb=I>#f& zAH2?aJ@KaetzkT+(ckZ1#4T_1>1iqH!Xwc7DO^w@EEj14h`(_Xd&cqHzjOAc7*Z`QEotdn(vtJ@bDvIYnrVZC zfP_GhKu{sbdoKhLM0KA9XuFQC?TFQ6!n0>zakyNPw_8F8l&cjImF;*>kie>55{Nv! z>p@_-nsI->;l~#*h{a^W!F)#OTGDod2PM=~yby+Vi-_P_fk(Q{JrIzlWVu*S)iu%0 zNNr31+aIL6TeOJew#5SMx;rEY+vXkW%EMg?z-IS``DdSCX8Qs!3heO*WX)KN#N!24 zC_@JtgmJpSJTk-*LGY7fOcgUHnmcXo_;-9w<{p)Tii%|L);1{0=p|x-TOJS>(%^h- z4Q@s>Gt>(X<%oxz5R`IkC?zoB6cRZM$7qNI-I0=Us7urZbKg%GyTr|39pl@Ks8d4A=DQ1~y<`hNX$(Qy0Eh@? z2EfI|1x2~SJd@3kv$HdIcdAK6KlEH*U-R|Lmu!F^zB?iRGcx_@OZxPRqmy4aJw2sq z8oI8dEKB0m)fH7$;qDB>K;QSQ0eMnTUe5rSFIs%_6xAy(FE3Hm{r(t0rW0FC-$9D9CS1ONa407*qoM6N<$g4Q^Z#Q*>R literal 0 HcmV?d00001 diff --git a/illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_top.png b/illumination/src/main/resources/assets/projectred_illumination/textures/block/illumar_smart_lamp_top.png new file mode 100644 index 0000000000000000000000000000000000000000..7b8d48594d4d47c7b27669c272040333ab3efe28 GIT binary patch literal 3228 zcmV;N3}f?&P)StO&>uS)ve<0AYj>5AR{$W90N^4L=L-RlQUJ&DC0@ZjPh;=*jPLSYvv5M~MFBAl0-BNIsH z15C~g000{K(ZT*WKal6<?_01!^k@7iDG<<3=fuAC~28EsPoqkpK{9G%|Vj005J}`Hw&=0RYXHq~ibpyyzHQsFW8>#s~laM4*8xut5h5 z!4#~(4xGUqyucR%VFpA%3?#rj5JCpzfE)^;7?wd9RKPme1hudO8lVxH;SjXJF*pt9 z;1XPc>u?taU>Kgl7`%oF1VP9M6Ja4bh!J9r*dopd7nzO(B4J20l7OTj>4+3jBE`sZ zqynizYLQ(?Bl0bB6giDtK>Co|$RIL`{EECsF_eL_Q3KQhbwIhO9~z3rpmWi5G!I>X zmZEFX8nhlgfVQHi(M#xcbO3#dj$?q)F%D*o*1Pf{>6$SWH+$s3q(pv=X`qR|$iJF~TPzlc-O$C3+J1 z#CT#lv5;6stS0Uu9wDA3UMCI{Uz12A4#|?_P6{CkNG+sOq(0IRX`DyT~9-sA|ffUF>wk++Z!kWZ5P$;0Hg6gtI-;!FvmBvPc55=u2?Kjj3apE5$3psG>L zsh-pbs)#zDT1jo7c2F-(3)vyY4>O^>2$gY-Gd%Qm(Z8e zYv>2*=jns=cMJ`N4THx>VkjAF8G9M07`GWOnM|ey)0dgZR4~^v8<}UA514ONSSt1^ zd=-((5|uiYR+WC0=c-gyb5%dpd8!Lkt5pxHURHgkMpd&=fR^vEcAI*_=wwAG2sV%zY%w@v@XU~7=xdm1xY6*0;iwVIXu6TaXrs|dqbIl~ z?uTdNHFy_3W~^@g_pF#!K2~{F^;XxcN!DEJEbDF7 zS8PxlSDOr*I-AS3sI8l=#CDr)-xT5$k15hA^;2%zG3@;83hbKf2JJcaVfH2VZT8O{ z%p4LO);n}Nd~$Sk%yw*Wyz8XlG{dRHsl(}4XB%gs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@VXG71PKNocFOt)Y6$@AXlk6rM*aP%VgV%sIRORYVwJx6|U{ozQjTW{-S z_si{9Jg#)~P3t?+@6&(!YQWWV*Z9{iU7vZq@5byKw{9lg9JnRA_4s!7?H6|n?o8ZW zdXIRo{Jz@#>IeD{>VLHUv1Pz*;P_y`V9&!@5AO~Mho1hF|I>%z(nrik)gwkDjgOrl z9~%uCz4Bzvli{bbrxVZ0epdf^>vOB;-~HnIOV3#R*zgPai_gEVd8zYq@2jb=I>#f& zAH2?aJ@Kaet9$2 z=r|k>jK?E2TVuW5*`6EQ^%Dv5=N~x4ZT{5c_s-cQP*Co`$e1eZIV5pZ93gMR2_L^py zCX<3E24Ir`(?~#U7<-SyqWQH#W@FxFuG8PBb_~6t24Bn9tCc7ezNU$^(a`8?M`ojD z8mAHL8Y?JKK@bFq!8?foECgW4ouFZxLpgBi-YB(l=+3x`On~HVxDXV0b~xeOp9pDh zu%*dNngddJ+lffw-0|In0dHU%C!~zGq}s_mKWWRx`Z=K@hH}6qxGr}LXzd9H*Xskk zUu)L~Eng~Z+s3+V%#W2Qf#xUf3hVNOfcD&VXl+*`(=Sh|(;NV%n)tfi(EIzl z$8qFzIwDm{0Y#xosQmApOCcl_K`DjD Date: Sun, 12 May 2024 13:09:49 -0400 Subject: [PATCH 4/4] fix: coloured backpack recipes --- .../0aed8341631ecb057f97f8866d5170e4ddc46c8c | 33 ++++++++++--------- .../recipes/black_backpack.json | 19 +++++++++++ .../recipes/blue_backpack.json | 5 ++- .../recipes/brown_backpack.json | 5 ++- .../recipes/cyan_backpack.json | 5 ++- .../recipes/gray_backpack.json | 5 ++- .../recipes/green_backpack.json | 5 ++- .../recipes/light_blue_backpack.json | 5 ++- .../recipes/light_gray_backpack.json | 5 ++- .../recipes/lime_backpack.json | 5 ++- .../recipes/magenta_backpack.json | 5 ++- .../recipes/orange_backpack.json | 5 ++- .../recipes/pink_backpack.json | 5 ++- .../recipes/purple_backpack.json | 5 ++- .../recipes/red_backpack.json | 5 ++- .../recipes/white_backpack.json | 5 +-- .../recipes/yellow_backpack.json | 5 ++- .../data/ExplorationRecipeProvider.java | 4 +-- 18 files changed, 95 insertions(+), 36 deletions(-) create mode 100644 exploration/src/main/generated/data/projectred_exploration/recipes/black_backpack.json diff --git a/exploration/src/main/generated/.cache/0aed8341631ecb057f97f8866d5170e4ddc46c8c b/exploration/src/main/generated/.cache/0aed8341631ecb057f97f8866d5170e4ddc46c8c index adc85bc19..4c7f3832e 100644 --- a/exploration/src/main/generated/.cache/0aed8341631ecb057f97f8866d5170e4ddc46c8c +++ b/exploration/src/main/generated/.cache/0aed8341631ecb057f97f8866d5170e4ddc46c8c @@ -1,4 +1,4 @@ -// 1.19.2 2024-03-04T11:14:23.547941 ProjectRed-Exploration Recipes +// 1.19.2 2024-05-12T13:08:16.608624 ProjectRed-Exploration Recipes 516fc1e95323b31fb9ba7e0a14ebf236e38eb240 data/projectred_exploration/recipes/athame.json c580751c155e6c97873ca79fcefd56de6adb0f79 data/projectred_exploration/recipes/backpack_dye.json bffb872878c8c398815a8379ba3da55bdc2f403d data/projectred_exploration/recipes/basalt.json @@ -6,9 +6,10 @@ bffb872878c8c398815a8379ba3da55bdc2f403d data/projectred_exploration/recipes/bas 29da3a1779dce66c770a26e7ed76cbea93653a99 data/projectred_exploration/recipes/basalt_brick_wall.json 5faf0b193cdb996aeab45fd276f65d8f37cb3eb8 data/projectred_exploration/recipes/basalt_cobble_wall.json a7b89ed7c2567ecc46f1bf9cba7ac985fe636696 data/projectred_exploration/recipes/basalt_wall.json -b5ef92dbe2e06edc69c5701e794cf8b4d5e115df data/projectred_exploration/recipes/blue_backpack.json -1534fd97d1fddc9d81fc765ac53798fca3d61080 data/projectred_exploration/recipes/brown_backpack.json -53c3c28ca8fd31572fc5cc4b1495c27addd744a5 data/projectred_exploration/recipes/cyan_backpack.json +f4e73c4de0c9f8f76519f7060c3561d14d801c5b data/projectred_exploration/recipes/black_backpack.json +1e661c0a7f636375b4182e198270b5d7a88a2059 data/projectred_exploration/recipes/blue_backpack.json +4be73d78f75ecafefea5aa597471f53ae7dee796 data/projectred_exploration/recipes/brown_backpack.json +9885fbdf76c3ca29ba047274691c7fb73a5faea5 data/projectred_exploration/recipes/cyan_backpack.json ef7657b6fbe71d8bacf8d133fd4f02014b10fa0f data/projectred_exploration/recipes/diamond_sickle.json f4dfba6fd848afc45037e3461b267724df6a6f17 data/projectred_exploration/recipes/electrotine_block.json 9d1606ac50f680514a4aacc97bd3d051a205d8ad data/projectred_exploration/recipes/electrotine_block_wall.json @@ -17,17 +18,17 @@ ea0f98150adf3119687e07a01a863f70aa5d4c57 data/projectred_exploration/recipes/ele 649cb806f4a28e83bbf9da291c59502e0efb160c data/projectred_exploration/recipes/electrotine_dust_from_nineblock.json 99b9e93e3456ba774e6443534a77d1d94b223802 data/projectred_exploration/recipes/gold_saw.json 612da094117b37fb571b8437a83895703c9a28b1 data/projectred_exploration/recipes/gold_sickle.json -0cc6b01d8fb80d53fbb912747245d25dce719be1 data/projectred_exploration/recipes/gray_backpack.json -4b981412622c77bef9a7ee0f959dcde5a7015338 data/projectred_exploration/recipes/green_backpack.json +52104f0dfd5cb8a4ac27c95a66c2b032d1424a92 data/projectred_exploration/recipes/gray_backpack.json +815dcee9a0edd3f0c28aad0462daf8055c56d390 data/projectred_exploration/recipes/green_backpack.json 417650820c985d30b49de077890af44b90cf1b95 data/projectred_exploration/recipes/iron_sickle.json -845b3a0f7aa118ba2263c26d2552a33fec13c422 data/projectred_exploration/recipes/light_blue_backpack.json -9388d2fe3e585473d67900ec85a56a6162cb7c12 data/projectred_exploration/recipes/light_gray_backpack.json -c20139a5ae9ce213cae270244d8dfe77fbe4da4d data/projectred_exploration/recipes/lime_backpack.json -363f59bc4db8f555dc823b2a42aa073cd833bc27 data/projectred_exploration/recipes/magenta_backpack.json +78031516e6cfcb1515be58acf6d1a273896e402b data/projectred_exploration/recipes/light_blue_backpack.json +8359f46bb1c133ef2a2566f39cb967c8cc44b795 data/projectred_exploration/recipes/light_gray_backpack.json +8fdd81913172ece1bedda794d5b1ba79544fcd5d data/projectred_exploration/recipes/lime_backpack.json +9d2fa7b429b3124747a8f15a16e1aa3c50bd119c data/projectred_exploration/recipes/magenta_backpack.json 4e114595836fa28d08d27aff8bfc742cbd06ae36 data/projectred_exploration/recipes/marble_brick.json 0ba50afd6cd5b0a2dd2b3ca86e1f2530c6e5a0f8 data/projectred_exploration/recipes/marble_brick_wall.json 42e6ec6574368ebb262cbab16f0215ce91c68b52 data/projectred_exploration/recipes/marble_wall.json -729f631fe42902860056f32449244ecb756ee644 data/projectred_exploration/recipes/orange_backpack.json +cb491c2a40e7a50098bafbfb051d68a18fa9fe6e data/projectred_exploration/recipes/orange_backpack.json 5a0a0c6ab3e93d0ae234823b48fa66829a50ef77 data/projectred_exploration/recipes/peridot_axe.json 3c6693564927d3750dc85525faf3117a19b91518 data/projectred_exploration/recipes/peridot_block.json ed768fbd04cc5576de326f8b5c72e7ae5068f20d data/projectred_exploration/recipes/peridot_block_wall.json @@ -44,13 +45,13 @@ c7d2651976143b2f2291ceafc16e7c905feb7eb8 data/projectred_exploration/recipes/per ab328a30bb5c5f11ea3c9eabc01af037d052c881 data/projectred_exploration/recipes/peridot_shovel.json 198af25f92429514ab0517736be51cd92e7cf94f data/projectred_exploration/recipes/peridot_sickle.json ca495e85a2bab6477dbd71fe25a8758f6e3d0e6e data/projectred_exploration/recipes/peridot_sword.json -195913166d141e21916ec96bb24042df856f7089 data/projectred_exploration/recipes/pink_backpack.json -82328b007b75858accb067906b3c2b5d74eefcac data/projectred_exploration/recipes/purple_backpack.json +b94fe6b34e64e736edfd8c57112e615e6133fb93 data/projectred_exploration/recipes/pink_backpack.json +ca15a8900e8340f0cda344ddcc7c7261d5b2db19 data/projectred_exploration/recipes/purple_backpack.json d0f867fc87bfcfcb49cafc64c7727aa99c58524e data/projectred_exploration/recipes/raw_silver_block.json 4f40453e0046a71705b431de7e3d72e925de15fa data/projectred_exploration/recipes/raw_silver_from_nineblock.json e89bb0c2515f603135f2de50d1503e343c4fd399 data/projectred_exploration/recipes/raw_tin_block.json efee17d4f20fd8084d6fb6f4bcd098b07e722124 data/projectred_exploration/recipes/raw_tin_from_nineblock.json -866cc8c6bad927204281ea72f7ade66eecf35978 data/projectred_exploration/recipes/red_backpack.json +653f9339f5a1fbec688aca56e01af603f561ac5b data/projectred_exploration/recipes/red_backpack.json a5b68914ee96aed435b2ed9b72917047b820b25e data/projectred_exploration/recipes/ruby_axe.json 0e1a99055c5ec032304bf00604d6690cd3bad45d data/projectred_exploration/recipes/ruby_block.json 99913b72d89cda5de6a876ae85a7c392caf2d6cd data/projectred_exploration/recipes/ruby_block_wall.json @@ -95,7 +96,7 @@ aaaf54f311c8b7c0730bb52f4c14d7b4587a50de data/projectred_exploration/recipes/str 3d679e8e776418981c57e29e3b6d2909b8fa4624 data/projectred_exploration/recipes/tin_ingot_from_nineblock.json a8b49d5b4a38d5f2f3a0fa1a41e5c0881c1284a1 data/projectred_exploration/recipes/tin_ingot_from_raw_tin_smelting.json 88d663776697ca2996d58d97ef2c5bc94829ea8b data/projectred_exploration/recipes/tin_ingot_from_tin_ore_smelting.json -ce3a40d106fb63552eee5d84dea28be0f5694032 data/projectred_exploration/recipes/white_backpack.json +cb98188ef77b9420ff33b16eb36533e26267b803 data/projectred_exploration/recipes/white_backpack.json 38dbf984da79493395fbaceda5f359cd9a262793 data/projectred_exploration/recipes/wood_sickle.json 571f740df980fb4f565ca1bde50e7a32cc2adf40 data/projectred_exploration/recipes/wool_gin.json -0b64ec445ce98d8b4b26be177071d305d744e8b2 data/projectred_exploration/recipes/yellow_backpack.json +344ed363e368115ba5de67c1b252e936d9fff949 data/projectred_exploration/recipes/yellow_backpack.json diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/black_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/black_backpack.json new file mode 100644 index 000000000..c2ea3641a --- /dev/null +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/black_backpack.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "key": { + "C": { + "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/black" + } + }, + "pattern": [ + "CCC", + "CDC", + "CCC" + ], + "result": { + "item": "projectred_exploration:black_backpack" + } +} \ No newline at end of file diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/blue_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/blue_backpack.json index 29df09876..f51d76524 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/blue_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/blue_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/blue" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/brown_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/brown_backpack.json index 1b9c764f8..2feb97ca8 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/brown_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/brown_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/brown" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/cyan_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/cyan_backpack.json index 0cf558e5f..98ae1053a 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/cyan_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/cyan_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/cyan" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/gray_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/gray_backpack.json index 8781aceb8..100cb2de5 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/gray_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/gray_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/gray" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/green_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/green_backpack.json index 462322ea0..72a883754 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/green_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/green_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/green" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/light_blue_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/light_blue_backpack.json index 3f98c3626..627a68591 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/light_blue_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/light_blue_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/light_blue" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/light_gray_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/light_gray_backpack.json index 7ad093ed0..c418168bb 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/light_gray_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/light_gray_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/light_gray" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/lime_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/lime_backpack.json index b0e34dc83..9c1785bba 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/lime_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/lime_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/lime" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/magenta_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/magenta_backpack.json index f358924b6..c2ed6f820 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/magenta_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/magenta_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/magenta" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/orange_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/orange_backpack.json index 9e87654bb..be4ecff92 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/orange_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/orange_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/orange" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/pink_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/pink_backpack.json index d16fc1c2b..0096b6cf6 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/pink_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/pink_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/pink" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/purple_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/purple_backpack.json index 7a1b02793..e28b5b12c 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/purple_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/purple_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/purple" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/red_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/red_backpack.json index 2657e2b26..9b18b5dcd 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/red_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/red_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/red" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/white_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/white_backpack.json index c4c7c2582..8e3279f8d 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/white_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/white_backpack.json @@ -3,14 +3,11 @@ "key": { "C": { "item": "projectred_core:woven_cloth" - }, - "D": { - "tag": "forge:dyes/white" } }, "pattern": [ "CCC", - "CDC", + "C C", "CCC" ], "result": { diff --git a/exploration/src/main/generated/data/projectred_exploration/recipes/yellow_backpack.json b/exploration/src/main/generated/data/projectred_exploration/recipes/yellow_backpack.json index 9154255c7..a0c747307 100644 --- a/exploration/src/main/generated/data/projectred_exploration/recipes/yellow_backpack.json +++ b/exploration/src/main/generated/data/projectred_exploration/recipes/yellow_backpack.json @@ -3,11 +3,14 @@ "key": { "C": { "item": "projectred_core:woven_cloth" + }, + "D": { + "tag": "forge:dyes/yellow" } }, "pattern": [ "CCC", - "C C", + "CDC", "CCC" ], "result": { diff --git a/exploration/src/main/java/mrtjp/projectred/exploration/data/ExplorationRecipeProvider.java b/exploration/src/main/java/mrtjp/projectred/exploration/data/ExplorationRecipeProvider.java index ccdbd0581..43c7e0e44 100644 --- a/exploration/src/main/java/mrtjp/projectred/exploration/data/ExplorationRecipeProvider.java +++ b/exploration/src/main/java/mrtjp/projectred/exploration/data/ExplorationRecipeProvider.java @@ -159,7 +159,7 @@ protected void registerRecipes() { bootsRecipe(PERIDOT_BOOTS.get(), PERIDOT_GEM_TAG); // Backpacks - for (int i = 0; i < 15; i++) { + for (int i = 0; i < 16; i++) { backpackRecipe(getBackpackByColor(i)); } @@ -305,7 +305,7 @@ private void backpackRecipe(Item backpack) { ShapedRecipeBuilder builder = shapedRecipe(backpack) .key('C', WOVEN_CLOTH_ITEM.get()); - if (color != DyeColor.WHITE) { // White is default and doesn't need a dye + if (color == DyeColor.WHITE) { // White is default and doesn't need a dye builder.patternLine("CCC") .patternLine("C C") .patternLine("CCC");