From bca6647670a8127b6fe74e5b2ca66a825066f8c8 Mon Sep 17 00:00:00 2001 From: Lukas Rieger Date: Mon, 19 Aug 2024 08:37:01 +0200 Subject: [PATCH] Add support for emissive textures (#601) --- .../core/map/hires/blockmodel/ResourceModelBuilder.java | 5 +++-- .../resources/pack/resourcepack/blockmodel/Element.java | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java index 3e709484..d5cd5c49 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java @@ -305,8 +305,9 @@ private void createElementFace(Element element, Direction faceDir, VectorM3f c0, } // ####### blocklight - tileModel.setBlocklight(face1, blockLight); - tileModel.setBlocklight(face2, blockLight); + int emissiveBlockLight = Math.max(blockLight, element.getLightEmission()); + tileModel.setBlocklight(face1, emissiveBlockLight); + tileModel.setBlocklight(face2, emissiveBlockLight); // ####### sunlight tileModel.setSunlight(face1, sunLight); diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/pack/resourcepack/blockmodel/Element.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/pack/resourcepack/blockmodel/Element.java index 95093935..38ce530b 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/pack/resourcepack/blockmodel/Element.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/pack/resourcepack/blockmodel/Element.java @@ -46,6 +46,7 @@ public class Element { private Vector3f from = FULL_BLOCK_MIN, to = FULL_BLOCK_MAX; private Rotation rotation = Rotation.ZERO; private boolean shade = true; + private int lightEmission = 0; private EnumMap faces = new EnumMap<>(Direction.class); @SuppressWarnings("unused") @@ -56,6 +57,7 @@ private Element(Element copyFrom) { this.to = copyFrom.to; this.rotation = copyFrom.rotation; this.shade = copyFrom.shade; + this.lightEmission = copyFrom.lightEmission; copyFrom.faces.forEach((direction, face) -> this.faces.put(direction, face.copy())); } @@ -132,6 +134,10 @@ public boolean isShade() { return shade; } + public int getLightEmission() { + return lightEmission; + } + public EnumMap getFaces() { return faces; }