From 79f27e9565db55ae1c090cbe61086821ec0f8c1a Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 5 Feb 2022 18:24:38 -0600 Subject: [PATCH] Add support for shade=false models, switch light/fire blocks over to use it --- .../java/org/dynmap/hdmap/HDBlockModels.java | 10 ++- .../org/dynmap/hdmap/HDPerspectiveState.java | 4 + .../org/dynmap/hdmap/IsoHDPerspective.java | 19 +++- .../org/dynmap/hdmap/ShadowHDLighting.java | 4 +- .../org/dynmap/hdmap/TexturePackHDShader.java | 90 ++++++++++--------- .../impl/ModModelDefinitionImpl.java | 4 +- .../modsupport/impl/ModelBlockModelImpl.java | 13 ++- .../org/dynmap/utils/PatchDefinition.java | 15 +++- .../dynmap/utils/PatchDefinitionFactory.java | 6 +- DynmapCore/src/main/resources/models_1.txt | 33 ++++--- DynmapCore/src/main/resources/texture_1.txt | 4 +- .../dynmap/modsupport/ModelBlockModel.java | 6 +- 12 files changed, 125 insertions(+), 83 deletions(-) diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java index 43393765..dcd777b0 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java @@ -317,6 +317,7 @@ public class HDBlockModels { double[] to = new double[3]; double xrot = 0, yrot = 0, zrot = 0; double xrotorig = 8, yrotorig = 8, zrotorig = 8; + boolean shade = true; ArrayList sides = new ArrayList(); }; @@ -916,12 +917,15 @@ public class HDBlockModels { String[] prms = av[1].split(":"); ModelBox box = new ModelBox(); - if (prms.length > 0) { // Handle from (from-x/y/z) + if (prms.length > 0) { // Handle from (from-x/y/z or from-x/y/z/shadow) String[] xyz = prms[0].split("/"); - if (xyz.length == 3) { + if ((xyz.length == 3) || (xyz.length == 4)) { box.from[0] = Double.parseDouble(xyz[0]); box.from[1] = Double.parseDouble(xyz[1]); box.from[2] = Double.parseDouble(xyz[2]); + if ((xyz.length >= 4) && (xyz[3].equals("false"))) { + box.shade = false; + } } else { Log.severe("Invalid modellist FROM value (" + prms[0] + " at line " + lineNum); @@ -1004,7 +1008,7 @@ public class HDBlockModels { for (ModelBox bl : boxes) { // Loop through faces for (ModelBoxSide side : bl.sides) { - PatchDefinition patch = pdf.getModelFace(bl.from, bl.to, side.side, side.uv, side.rot, side.textureid); + PatchDefinition patch = pdf.getModelFace(bl.from, bl.to, side.side, side.uv, side.rot, bl.shade, side.textureid); if (patch != null) { // If any rotations, apply them here if ((bl.xrot != 0) || (bl.yrot != 0) || (bl.zrot != 0)) { diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/HDPerspectiveState.java b/DynmapCore/src/main/java/org/dynmap/hdmap/HDPerspectiveState.java index a8f55270..3490d936 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/HDPerspectiveState.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/HDPerspectiveState.java @@ -53,6 +53,10 @@ public interface HDPerspectiveState { * @return y coordinate */ int getPixelY(); + /** + * Get current patch shade setting (false = no shadows) + */ + boolean getShade(); /** * Return submodel alpha value (-1 if no submodel rendered) * @return alpha value diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java b/DynmapCore/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java index 7766db9f..f9ff2d71 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java @@ -128,12 +128,14 @@ public class IsoHDPerspective implements HDPerspective { double patch_t[] = new double[2*HDBlockModels.getMaxPatchCount()]; double patch_u[] = new double[2*HDBlockModels.getMaxPatchCount()]; double patch_v[] = new double[2*HDBlockModels.getMaxPatchCount()]; + boolean patch_shade[] = new boolean[2*HDBlockModels.getMaxPatchCount()]; BlockStep patch_step[] = new BlockStep[2*HDBlockModels.getMaxPatchCount()]; int patch_id[] = new int[2*HDBlockModels.getMaxPatchCount()]; int cur_patch = -1; double cur_patch_u; double cur_patch_v; double cur_patch_t; + boolean cur_shade; int[] subblock_xyz = new int[3]; final MapIterator mapiter; @@ -452,6 +454,7 @@ public class IsoHDPerspective implements HDPerspective { patch_t[hitcnt] = t; patch_u[hitcnt] = u; patch_v[hitcnt] = v; + patch_shade[hitcnt] = pd.shade; patch_id[hitcnt] = pd.textureindex; if(det > 0) { patch_step[hitcnt] = pd.step.opposite(); @@ -514,6 +517,7 @@ public class IsoHDPerspective implements HDPerspective { cur_patch = patch_id[best_patch]; /* Mark this as current patch */ cur_patch_u = patch_u[best_patch]; cur_patch_v = patch_v[best_patch]; + cur_shade = patch_shade[best_patch]; laststep = patch_step[best_patch]; cur_patch_t = best_t; // If the water patch, switch to water state and patch index @@ -905,7 +909,7 @@ public class IsoHDPerspective implements HDPerspective { * Get current texture index */ @Override - public int getTextureIndex() { + public final int getTextureIndex() { return cur_patch; } @@ -913,7 +917,7 @@ public class IsoHDPerspective implements HDPerspective { * Get current U of patch intercept */ @Override - public double getPatchU() { + public final double getPatchU() { return cur_patch_u; } @@ -921,10 +925,19 @@ public class IsoHDPerspective implements HDPerspective { * Get current V of patch intercept */ @Override - public double getPatchV() { + public final double getPatchV() { return cur_patch_v; } + /** + * Get current patch noShadow setting (true = no shadows/lighting) + */ + @Override + public final boolean getShade() { + // Shade if shade set OR not patch + return cur_shade || (cur_patch < 0); /* If patch hit */ + } +/** * Light level cache * @param index of light level (0-3) */ diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/ShadowHDLighting.java b/DynmapCore/src/main/java/org/dynmap/hdmap/ShadowHDLighting.java index 5381e961..8d41546a 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/ShadowHDLighting.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/ShadowHDLighting.java @@ -217,8 +217,8 @@ public class ShadowHDLighting extends DefaultHDLighting { /* Apply lighting to given pixel colors (1 outcolor if normal, 2 if night/day) */ public void applyLighting(HDPerspectiveState ps, HDShaderState ss, Color incolor, Color[] outcolor) { - int[] shadowscale = null; - if(smooth) { + int[] shadowscale = null; + if (smooth && ps.getShade()) { shadowscale = ss.getLightingTable(); if (shadowscale == null) { shadowscale = defLightingTable; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java b/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java index 0fe12de5..8536d323 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackHDShader.java @@ -202,50 +202,52 @@ public class TexturePackHDShader implements HDShader { if (c.getAlpha() > 0) { /* Scale brightness depending upon face */ - if (this.lightingTable != null) { - switch(ps.getLastBlockStep()) { - case X_MINUS: - case X_PLUS: - /* 60% brightness */ - c.blendColor(0xFF999999); - break; - case Y_MINUS: - // 95% for even - if((mapiter.getY() & 0x01) == 0) { - c.blendColor(0xFFF3F3F3); - } - break; - case Y_PLUS: - /* 50%*/ - c.blendColor(0xFF808080); - break; - case Z_MINUS: - case Z_PLUS: - default: - /* 80%*/ - c.blendColor(0xFFCDCDCD); - break; - } - } - else { - switch(ps.getLastBlockStep()) { - case X_MINUS: - case X_PLUS: - /* 60% brightness */ - c.blendColor(0xFFA0A0A0); - break; - case Y_MINUS: - case Y_PLUS: - /* 85% brightness for even, 90% for even*/ - if((mapiter.getY() & 0x01) == 0) - c.blendColor(0xFFD9D9D9); - else - c.blendColor(0xFFE6E6E6); - break; - default: - break; - } - } + if (ps.getShade()) { + if (this.lightingTable != null) { + switch (ps.getLastBlockStep()) { + case X_MINUS: + case X_PLUS: + /* 60% brightness */ + c.blendColor(0xFF999999); + break; + case Y_MINUS: + // 95% for even + if((mapiter.getY() & 0x01) == 0) { + c.blendColor(0xFFF3F3F3); + } + break; + case Y_PLUS: + /* 50%*/ + c.blendColor(0xFF808080); + break; + case Z_MINUS: + case Z_PLUS: + default: + /* 80%*/ + c.blendColor(0xFFCDCDCD); + break; + } + } + else { + switch (ps.getLastBlockStep()) { + case X_MINUS: + case X_PLUS: + /* 60% brightness */ + c.blendColor(0xFFA0A0A0); + break; + case Y_MINUS: + case Y_PLUS: + /* 85% brightness for even, 90% for even*/ + if((mapiter.getY() & 0x01) == 0) + c.blendColor(0xFFD9D9D9); + else + c.blendColor(0xFFE6E6E6); + break; + default: + break; + } + } + } /* Handle light level, if needed */ lighting.applyLighting(ps, this, c, tmpcolor); /* If grid scale, add it */ diff --git a/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModModelDefinitionImpl.java b/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModModelDefinitionImpl.java index 51ce4f3b..a83041b7 100644 --- a/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModModelDefinitionImpl.java +++ b/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModModelDefinitionImpl.java @@ -223,8 +223,8 @@ public class ModModelDefinitionImpl implements ModModelDefinition { return id; } - public String getModelFacePatchID(double[] from, double[] to, BlockSide face, double[] uv, ModelBlockModel.SideRotation rot, int textureid) { - PatchDefinition pd = pdf.getModelFace(from, to, face, uv, rot, textureid); + public String getModelFacePatchID(double[] from, double[] to, BlockSide face, double[] uv, ModelBlockModel.SideRotation rot, boolean shade, int textureid) { + PatchDefinition pd = pdf.getModelFace(from, to, face, uv, rot, shade, textureid); if (pd == null) return null; // Invalid patch for (int i = 0; i < blkPatch.size(); i++) { diff --git a/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModelBlockModelImpl.java b/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModelBlockModelImpl.java index 73412e23..1afd348c 100644 --- a/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModelBlockModelImpl.java +++ b/DynmapCore/src/main/java/org/dynmap/modsupport/impl/ModelBlockModelImpl.java @@ -19,6 +19,7 @@ public class ModelBlockModelImpl extends BlockModelImpl implements ModelBlockMod private double[] from = { 0, 0, 0 }; private double[] to = { 16, 16, 16 }; private double xrot = 0, yrot = 0, zrot = 0; + private boolean shade; @Override public void addBlockSide(BlockSide side, double[] uv, SideRotation rot, int textureid) { ModelSide ms = new ModelSide(); @@ -85,7 +86,11 @@ public class ModelBlockModelImpl extends BlockModelImpl implements ModelBlockMod } else { for (ModelBlockImpl mb: boxes) { - line += String.format(",box=%f/%f/%f:%f/%f/%f", mb.from[0], mb.from[1], mb.from[2], mb.to[0], mb.to[1], mb.to[2]); + line += String.format(",box=%f/%f/%f", mb.from[0], mb.from[1], mb.from[2]); + if (!mb.shade) { // if shade=false + line += "/false"; + } + line += String.format(":%f/%f/%f", mb.to[0], mb.to[1], mb.to[2]); if ((mb.xrot != 0) || (mb.yrot != 0) || (mb.zrot != 0)) { // If needed, add rotation line += String.format("/%f/%f/%f", mb.xrot, mb.yrot, mb.zrot); } @@ -134,13 +139,17 @@ public class ModelBlockModelImpl extends BlockModelImpl implements ModelBlockMod * @param xrot - degrees of rotation of block around X * @param yrot - degrees of rotation of block around Y * @param zrot - degrees of rotation of block around Z + * @param shade - shade setting for model * @return model block to add faces to */ - public ModelBlock addModelBlock(double[] from, double[] to, double xrot, double yrot, double zrot) { + @Override + public ModelBlock addModelBlock(double[] from, double[] to, double xrot, double yrot, double zrot, + boolean shade) { ModelBlockImpl mbi = new ModelBlockImpl(); if (from != null) { mbi.from[0] = from[0]; mbi.from[1] = from[1]; mbi.from[2] = from[2]; } if (to != null) { mbi.to[0] = to[0]; mbi.to[1] = to[1]; mbi.to[2] = to[2]; } mbi.xrot = xrot; mbi.yrot = yrot; mbi.zrot = zrot; + mbi.shade = shade; boxes.add(mbi); return mbi; } diff --git a/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinition.java b/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinition.java index 6a1c283f..64aca6f5 100644 --- a/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinition.java +++ b/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinition.java @@ -29,6 +29,7 @@ public class PatchDefinition implements RenderPatch { public SideVisible sidevis; /* Which side is visible */ public int textureindex; public BlockStep step; /* Best approximation of orientation of surface, from top (positive determinent) */ + public boolean shade; // If false, patch is not shaded private int hc; /* Offset vector of middle of block */ private static final Vector3D offsetCenter = new Vector3D(0.5,0.5,0.5); @@ -45,6 +46,7 @@ public class PatchDefinition implements RenderPatch { v = new Vector3D(); sidevis = SideVisible.BOTH; textureindex = 0; + shade = true; update(); } PatchDefinition(PatchDefinition pd) { @@ -68,6 +70,7 @@ public class PatchDefinition implements RenderPatch { this.sidevis = pd.sidevis; this.textureindex = pd.textureindex; this.step = pd.step; + this.shade = pd.shade; this.hc = pd.hc; } /** @@ -110,6 +113,7 @@ public class PatchDefinition implements RenderPatch { vmaxatumax = orig.vmaxatumax; vminatumax = orig.vminatumax; sidevis = orig.sidevis; + shade = orig.shade; this.textureindex = (textureindex < 0) ? orig.textureindex : textureindex; u = new Vector3D(); v = new Vector3D(); @@ -291,7 +295,8 @@ public class PatchDefinition implements RenderPatch { (umin == p.umin) && (umax == p.umax) && (vmin == p.vmin) && (vmax == p.vmax) && (vmaxatumax == p.vmaxatumax) && - (vminatumax == p.vminatumax) && (sidevis == p.sidevis)) { + (vminatumax == p.vminatumax) && (sidevis == p.sidevis) && + (shade == p.shade)) { return true; } } @@ -307,8 +312,8 @@ public class PatchDefinition implements RenderPatch { } @Override public String toString() { - return String.format("xyz0=%f/%f/%f,xyzU=%f/%f/%f,xyzV=%f/%f/%f,minU=%f,maxU=%f,vMin=%f/%f,vmax=%f/%f,side=%s,txtidx=%d", - x0, y0, z0, xu, yu, zu, xv, yv, zv, umin, umax, vmin, vminatumax, vmax, vmaxatumax, sidevis, textureindex); + return String.format("xyz0=%f/%f/%f,xyzU=%f/%f/%f,xyzV=%f/%f/%f,minU=%f,maxU=%f,vMin=%f/%f,vmax=%f/%f,side=%s,txtidx=%d,shade=%b", + x0, y0, z0, xu, yu, zu, xv, yv, zv, umin, umax, vmin, vminatumax, vmax, vmaxatumax, sidevis, textureindex, shade); } // @@ -324,9 +329,11 @@ public class PatchDefinition implements RenderPatch { // @param face - which face (determines use of xyz-min vs xyz-max // @param uv - bounds on UV (umin, vmin, umax, vmax): if undefined, default based on face range (minecraft UV is relative to top left corner of texture) // @param rot - texture rotation (default 0 - DEG0, DEG90, DEG180, DEG270) + // @param shade - if false, no shadows on patch // @param textureid - texture ID - public void updateModelFace(double[] from, double[] to, BlockSide face, double[] uv, ModelBlockModel.SideRotation rot, int textureid) { + public void updateModelFace(double[] from, double[] to, BlockSide face, double[] uv, ModelBlockModel.SideRotation rot, boolean shade, int textureid) { if (rot == null) rot = ModelBlockModel.SideRotation.DEG0; + this.shade = shade; // Compute corners of the face Vector3D lowleft; Vector3D lowright; diff --git a/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinitionFactory.java b/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinitionFactory.java index 596b6a38..a9174044 100644 --- a/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinitionFactory.java +++ b/DynmapCore/src/main/java/org/dynmap/utils/PatchDefinitionFactory.java @@ -64,10 +64,10 @@ public class PatchDefinitionFactory implements RenderPatchFactory { } } - - public PatchDefinition getModelFace(double[] from, double[] to, BlockSide face, double[] uv, ModelBlockModel.SideRotation rot, int textureid) { + + public PatchDefinition getModelFace(double[] from, double[] to, BlockSide face, double[] uv, ModelBlockModel.SideRotation rot, boolean shade, int textureid) { synchronized(lock) { - lookup.updateModelFace(from, to, face, uv, rot, textureid); + lookup.updateModelFace(from, to, face, uv, rot, shade, textureid); if(lookup.validate() == false) return null; PatchDefinition pd2 = patches.get(lookup); /* See if in cache already */ diff --git a/DynmapCore/src/main/resources/models_1.txt b/DynmapCore/src/main/resources/models_1.txt index 71ae480c..97cd282d 100644 --- a/DynmapCore/src/main/resources/models_1.txt +++ b/DynmapCore/src/main/resources/models_1.txt @@ -216,9 +216,9 @@ boxblock:id=snow,data=6,ymax=0.875 # Torch # Redstone torch -modellist:id=torch,id=redstone_torch,box=7/0/7:9/10/9:d/0/7/13/9/15:u/0/7/6/9/8,box=7/0/0:9/16/16:w/0:e/0,box=0/0/7:16/16/9:n/0:s/0 +modellist:id=torch,id=redstone_torch,box=7/0/7/false:9/10/9:d/0/7/13/9/15:u/0/7/6/9/8,box=7/0/0/false:9/16/16:w/0:e/0,box=0/0/7/false:16/16/9:n/0:s/0 # Wall Torch -modellist:id=wall_torch,state=facing:east,box=-1/3.5/7:1/13.5/9/0/0/-22.5/0/3.5/8:d/0/7/13/9/15,u/0/7/6/9/8,box=-1/3.5/0:1/19.5/16/0/0/-22.5/0/3.5/8:w/0:e/0,box=-8/3.5/7:8/19.5/9/0/0/-22.5/0/3.5/8:n/0:s/0 +modellist:id=wall_torch,state=facing:east,box=-1/3.5/7/false:1/13.5/9/0/0/-22.5/0/3.5/8:d/0/7/13/9/15,u/0/7/6/9/8,box=-1/3.5/0/false:1/19.5/16/0/0/-22.5/0/3.5/8:w/0:e/0,box=-8/3.5/7/false:8/19.5/9/0/0/-22.5/0/3.5/8:n/0:s/0 patchblock:id=wall_torch,state=facing:north patchrotate:id=wall_torch,state=facing:east,roty=270 patchblock:id=wall_torch,state=facing:south @@ -424,7 +424,8 @@ ignore-updates:id=redstone_wire [-1.13.2]patchblock:id=sign,data=22-23,patch0=SignFront@67,patch1=SignBack@67,patch2=SignTop@67,patch3=SignBottom@67,patch4=SignLeft@67,patch5=SignRight@67,patch6=PostFront@67,patch7=PostBack@67,patch8=PostLeft@67,patch9=PostRight@67 [1.14-]patchblock:id=oak_sign,id=spruce_sign,id=birch_sign,id=acacia_sign,id=jungle_sign,id=dark_oak_sign,data=22-23,patch0=SignFront@67,patch1=SignBack@67,patch2=SignTop@67,patch3=SignBottom@67,patch4=SignLeft@67,patch5=SignRight@67,patch6=PostFront@67,patch7=PostBack@67,patch8=PostLeft@67,patch9=PostRight@67 # Fire -patchblock:id=fire,patch0=VertX0,patch1=VertX0@90,patch2=VertX0@180,patch3=VertX0@270,patch4=SlopeXUpZTop675,patch5=SlopeXUpZTop675@90,patch6=SlopeXUpZTop675@180,patch4=SlopeXUpZTop675@270 +modellist:id=fire,box=0/0/8.8/false:16/16/8.8/-22.5/0/0:s/0/0/0/16/16,box=0/0/7.2/false:16/16/7.2/22.5/0/0:n/0/0/0/16/16,box=8.8/0/0/false:8.8/16/16/0/0/-22/5:w/0/0/0/16/16,box=7.2/0/0/false:7.2/16/16/0/0/22.5:e/0/0/0/16/16,box=0/0/0.01/false:16/16/0.01:s/0/0/0/16/16:n/0/0/0/16/16,box=0/0/0.01/false:16/16/0.01/0/90/0:s/0/0/0/16/16:n/0/0/0/16/16,box=0/0/0.01/false:16/16/0.01/0/180/0:s/0/0/0/16/16:n/0/0/0/16/16,box=0/0/0.01/false:16/16/0.01/0/270/0:s/0/0/0/16/16:n/0/0/0/16/16 + # Bed - head - pointing west block:id=white_bed,id=orange_bed,id=magenta_bed,id=light_blue_bed,id=yellow_bed,id=lime_bed,id=pink_bed,id=gray_bed,id=light_gray_bed,id=cyan_bed,id=purple_bed,id=blue_bed,id=brown_bed,id=green_bed,id=red_bed,id=black_bed,data=8,scale=16 layer:0,1,2 @@ -1356,22 +1357,19 @@ patchblock:id=bubble_column # Cut sandstone slab [1.14-]boxblock:id=smooth_stone_slab,id=cut_sandstone_slab,id=cut_red_sandstone_slab,state=type:top,ymin=0.5 [1.14-]boxblock:id=smooth_stone_slab,id=cut_sandstone_slab,id=cut_red_sandstone_slab,state=type:bottom,ymax=0.5 -# Bamboo -[1.14-]boxblock:id=bamboo,data=0-5,xmin=0.4275,xmax=0.5625,zmin=0.4275,zmax=0.5625 -[1.14-]boxblock:id=bamboo,data=6-11,xmin=0.38,xmax=0.62,zmin=0.38,zmax=0.62 # Bamboo (bamboo_stalk, bamboo_small_leaves, bamboo_large_leaves [1.14-]modellist:id=bamboo,state=age:0/leaves:none/stage:0,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/0/0/2/16:s/0/0/0/2/16:w/0/0/0/2/16:e/0/0/0/2/16 [1.14-]modellist:id=bamboo,state=age:0/leaves:none/stage:1,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/3/0/5/16:s/0/3/0/5/16:w/0/3/0/5/16:e/0/3/0/5/16 -[1.14-]modellist:id=bamboo,state=age:0/leaves:small/stage:0,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/0/0/2/16:s/0/0/0/2/16:w/0/0/0/2/16:e/0/0/0/2/16,box=0.8/0/8:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 -[1.14-]modellist:id=bamboo,state=age:0/leaves:small/stage:1,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/3/0/5/16:s/0/3/0/5/16:w/0/3/0/5/16:e/0/3/0/5/16,box=0.8/0/8:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 -[1.14-]modellist:id=bamboo,state=age:0/leaves:large/stage:0,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/0/0/2/16:s/0/0/0/2/16:w/0/0/0/2/16:e/0/0/0/2/16,box=0.8/0/8:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 -[1.14-]modellist:id=bamboo,state=age:0/leaves:large/stage:1,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/3/0/5/16:s/0/3/0/5/16:w/0/3/0/5/16:e/0/3/0/5/16,box=0.8/0/8:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:0/leaves:small/stage:0,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/0/0/2/16:s/0/0/0/2/16:w/0/0/0/2/16:e/0/0/0/2/16,box=0.8/0/8/false:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:0/leaves:small/stage:1,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/3/0/5/16:s/0/3/0/5/16:w/0/3/0/5/16:e/0/3/0/5/16,box=0.8/0/8/false:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:0/leaves:large/stage:0,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/0/0/2/16:s/0/0/0/2/16:w/0/0/0/2/16:e/0/0/0/2/16,box=0.8/0/8/false:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:0/leaves:large/stage:1,box=7/0/7:9/16/9:d/0/13/4/15/6:u/0/13/0/15/2:n/0/3/0/5/16:s/0/3/0/5/16:w/0/3/0/5/16:e/0/3/0/5/16,box=0.8/0/8/false:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 [1.14-]modellist:id=bamboo,state=age:1/leaves:none/stage:0,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/0/0/3/16:s/0/0/0/3/16:w/0/0/0/3/16:e/0/0/0/3/16 [1.14-]modellist:id=bamboo,state=age:1/leaves:none/stage:1,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/3/0/6/16:s/0/3/0/6/16:w/0/3/0/6/16:e/0/3/0/6/16 -[1.14-]modellist:id=bamboo,state=age:1/leaves:small/stage:0,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/0/0/3/16:s/0/0/0/3/16:w/0/0/0/3/16:e/0/0/0/3/16,box=0.8/0/8:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 -[1.14-]modellist:id=bamboo,state=age:1/leaves:small/stage:1,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/3/0/6/16:s/0/3/0/6/16:w/0/3/0/6/16:e/0/3/0/6/16,box=0.8/0/8:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 -[1.14-]modellist:id=bamboo,state=age:1/leaves:large/stage:0,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/0/0/3/16:s/0/0/0/3/16:w/0/0/0/3/16:e/0/0/0/3/16,box=0.8/0/8:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 -[1.14-]modellist:id=bamboo,state=age:1/leaves:large/stage:1,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/3/0/6/16:s/0/3/0/6/16:w/0/3/0/6/16:e/0/3/0/6/16,box=0.8/0/8:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:1/leaves:small/stage:0,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/0/0/3/16:s/0/0/0/3/16:w/0/0/0/3/16:e/0/0/0/3/16,box=0.8/0/8/false:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:1/leaves:small/stage:1,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/3/0/6/16:s/0/3/0/6/16:w/0/3/0/6/16:e/0/3/0/6/16,box=0.8/0/8/false:15.2/16/8:n/1/0/0/16/16:s/1/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/1/0/0/16/16:e/1/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:1/leaves:large/stage:0,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/0/0/3/16:s/0/0/0/3/16:w/0/0/0/3/16:e/0/0/0/3/16,box=0.8/0/8/false:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 +[1.14-]modellist:id=bamboo,state=age:1/leaves:large/stage:1,box=6.5/0/6.5:9.5/16/9.5:d/0/13/4/16/7:u/0/13/0/16/3:n/0/3/0/6/16:s/0/3/0/6/16:w/0/3/0/6/16:e/0/3/0/6/16,box=0.8/0/8/false:15.2/16/8:n/2/0/0/16/16:s/2/0/0/16/16,box=8/0/0.8/false:8/16/15.2:w/2/0/0/16/16:e/2/0/0/16/16 # Potted Bamboo [1.14-]patchblock:id=potted_bamboo,patch0=FlowerPotTop,patch1=FlowerPotBottom,patch2=FlowerPotSide,patch3=FlowerPotSide@90,patch4=FlowerPotSide@180,patch5=FlowerPotSide@270,patch6=FlowerPotDirt,patch7=FlowerPotFlower,patch8=FlowerPotFlower@90 @@ -1516,7 +1514,7 @@ patchblock:id=bubble_column [1.14-]patchblock:id=stonecutter,data=3 [1.14-]patchrotate:id=stonecutter,data=0,roty=90 # Campfire (lit) (unlit log, lit log, fire) -[1.14-]modellist:id=campfire,data=8,data=9,data=10,data=11,box=1/0/0:5/4/16:n/0/0/4/4/8:e/1/0/1/16/5:s/0/0/4/4/8:w/0/16/0/0/4:u90/0/0/0/16/4:d90/0/0/0/16/4,box=0/3/11:16/7/15:n/1/16/0/0/4:e/0/0/4/4/8:s/1/0/0/16/4:w/0/0/4/4/8:u180/1/0/0/16/4:d/1/0/4/16/8,box=11/0/0:15/4/16:n/0/0/4/4/8:e/0/0/0/16/4:s/0/0/4/4/8:w/1/16/1/0/5:u90/0/0/0/16/4:d90/0/0/0/16/4,box=0/3/1:16/7/5:n/1/0/0/16/4:e/0/0/4/4/8:s/1/16/0/0/4:w/0/0/4/4/8:u180/0/0/0/16/4:d/1/0/4/16/8,box=5/0/0:11/1/16:n/0/0/15/6/16:s/0/10/15/16/16:u90/1/0/8/16/14:d90/0/0/8/16/14,box=0.8/1/8:15.2/17/8/0/45/0:n/2/0/0/16/16:s/2/0/0/16/16,box=8/1/0.8:8/17/15.2/0/45/0:w/2/0/0/16/16:e/2/0/0/16/16 +[1.14-]modellist:id=campfire,data=8,data=9,data=10,data=11,box=1/0/0:5/4/16:n/0/0/4/4/8:e/1/0/1/16/5:s/0/0/4/4/8:w/0/16/0/0/4:u90/0/0/0/16/4:d90/0/0/0/16/4,box=0/3/11:16/7/15:n/1/16/0/0/4:e/0/0/4/4/8:s/1/0/0/16/4:w/0/0/4/4/8:u180/1/0/0/16/4:d/1/0/4/16/8,box=11/0/0:15/4/16:n/0/0/4/4/8:e/0/0/0/16/4:s/0/0/4/4/8:w/1/16/1/0/5:u90/0/0/0/16/4:d90/0/0/0/16/4,box=0/3/1:16/7/5:n/1/0/0/16/4:e/0/0/4/4/8:s/1/16/0/0/4:w/0/0/4/4/8:u180/0/0/0/16/4:d/1/0/4/16/8,box=5/0/0:11/1/16:n/0/0/15/6/16:s/0/10/15/16/16:u90/1/0/8/16/14:d90/0/0/8/16/14,box=0.8/1/8/false:15.2/17/8/0/45/0:n/2/0/0/16/16:s/2/0/0/16/16,box=8/1/0.8/false:8/17/15.2/0/45/0:w/2/0/0/16/16:e/2/0/0/16/16 [1.14-]patchblock:id=campfire,data=0,data=1,data=2,data=3 [1.14-]patchrotate:id=campfire,data=8,roty=180 [1.14-]patchblock:id=campfire,data=16,data=17,data=18,data=19 @@ -1606,7 +1604,8 @@ patchblock:id=bubble_column # 1.16 blocks # Soul Fire -[1.16-]patchblock:id=soul_fire,patch0=VertX0,patch1=VertX0@90,patch2=VertX0@180,patch3=VertX0@270,patch4=SlopeXUpZTop675,patch5=SlopeXUpZTop675@90,patch6=SlopeXUpZTop675@180,patch4=SlopeXUpZTop675@270 +[1.16-]patchblock:id=soul_fire +[1.16-]patchrotate:id=fire,data=0,roty=0 # Soul Torch [1.16-]patchblock:id=soul_torch [1.16-]patchrotate:id=torch,data=0,roty=0 @@ -1620,7 +1619,7 @@ patchblock:id=bubble_column [1.16-]patchblock:id=soul_wall_torch,data=2 [1.16-]patchrotate:id=wall_torch,data=3,roty=180 # Chain -[1.16-]modellist:id=chain,state=axis:y,box=6.5/0/8:9.5/16/8/0/45/0:n/0/3/0/0/16:s/0/0/0/3/16,box=8/0/6.5:8/16/9.5/0/45/0:w/0/6/0/3/16:e/0/3/0/6/16 +[1.16-]modellist:id=chain,state=axis:y,box=6.5/0/8/false:9.5/16/8/0/45/0:n/0/3/0/0/16:s/0/0/0/3/16,box=8/0/6.5/false:8/16/9.5/0/45/0:w/0/6/0/3/16:e/0/3/0/6/16 [1.16-]patchblock:id=chain,state=axis:x [1.16-]patchrotate:id=chain,state=axis:y/waterlogged:true,rotx=90,roty=90 [1.16-]patchblock:id=chain,state=axis:z diff --git a/DynmapCore/src/main/resources/texture_1.txt b/DynmapCore/src/main/resources/texture_1.txt index 7bb746ee..e53c0cfa 100644 --- a/DynmapCore/src/main/resources/texture_1.txt +++ b/DynmapCore/src/main/resources/texture_1.txt @@ -885,7 +885,7 @@ block:id=torch,patch0=0:torch,transparency=TRANSPARENT # Wall torch block:id=wall_torch,state=*,patch0=0:torch,transparency=TRANSPARENT # Fire -block:id=fire,patch0-3=0:fire_0,patch4-7=0:fire_1,transparency=TRANSPARENT +block:id=fire,patch0=0:fire_0,transparency=TRANSPARENT # Monster spawner block:id=spawner,allfaces=0:spawner,stdrot=true,transparency=TRANSPARENT # Wooden stairs @@ -2407,7 +2407,7 @@ block:id=black_banner,id=black_wall_banner,data=*,patch0=0:oak_planks,patch1=0:b # Nether gold ore [1.16-]block:id=nether_gold_ore,allfaces=0:nether_gold_ore,stdrot=true # Soul Fire -[1.16-]block:id=soul_fire,patch0-3=0:soul_fire_0,patch4-7=0:soul_fire_1,transparency=TRANSPARENT +[1.16-]block:id=soul_fire,patch0=0:soul_fire_0,transparency=TRANSPARENT # Soul soil [1.16-]block:id=soul_soil,allfaces=0:soul_soil,stdrot=true # Basalt diff --git a/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/ModelBlockModel.java b/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/ModelBlockModel.java index 820c6e12..045768cf 100644 --- a/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/ModelBlockModel.java +++ b/DynmapCoreAPI/src/main/java/org/dynmap/modsupport/ModelBlockModel.java @@ -35,7 +35,11 @@ public interface ModelBlockModel extends BlockModel { * @param xrot - degrees of rotation of block around X * @param yrot - degrees of rotation of block around Y * @param zrot - degrees of rotation of block around Z + * @param shade - shade setting for model * @return model block to add faces to */ - public ModelBlock addModelBlock(double[] from, double[] to, double xrot, double yrot, double zrot); + public ModelBlock addModelBlock(double[] from, double[] to, double xrot, double yrot, double zrot, boolean shade); + default public ModelBlock addModelBlock(double[] from, double[] to, double xrot, double yrot, double zrot) { + return addModelBlock(from, to, xrot, yrot, zrot, true); + } }