diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/CustomBlockModel.java b/DynmapCore/src/main/java/org/dynmap/hdmap/CustomBlockModel.java index 6f9b3b25..dd82d8a8 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/CustomBlockModel.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/CustomBlockModel.java @@ -1,5 +1,6 @@ package org.dynmap.hdmap; +import java.util.BitSet; import java.util.Map; import org.dynmap.Log; @@ -11,7 +12,7 @@ import org.dynmap.renderer.RenderPatch; public class CustomBlockModel extends HDBlockModel { public CustomRenderer render; - public CustomBlockModel(String blockname, int databits, String classname, Map classparm, String blockset) { + public CustomBlockModel(String blockname, BitSet databits, String classname, Map classparm, String blockset) { super(blockname, databits, blockset); try { Class cls = Class.forName(classname); /* Get class */ @@ -24,7 +25,7 @@ public class CustomBlockModel extends HDBlockModel { if(render.getTileEntityFieldsNeeded() != null) { DynmapBlockState bbs = DynmapBlockState.getBaseStateByName(blockname); for(int i = 0; i < bbs.getStateCount(); i++) { - if ((databits & (1 << i)) != 0) { + if (databits.isEmpty() || databits.get(i)) { DynmapBlockState bs = bbs.getState(i); HDBlockModels.customModelsRequestingTileData.set(bs.globalStateIndex); } diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModel.java b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModel.java index 6f319881..7c4b545a 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModel.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModel.java @@ -1,5 +1,7 @@ package org.dynmap.hdmap; +import java.util.BitSet; + import org.dynmap.renderer.DynmapBlockState; public abstract class HDBlockModel { @@ -10,12 +12,12 @@ public abstract class HDBlockModel { * @param databits - bitmap of block data bits matching this model (bit N is set if data=N would match) * @param blockset - ID of block definition set */ - protected HDBlockModel(String blockname, int databits, String blockset) { + protected HDBlockModel(String blockname, BitSet databits, String blockset) { this.blockset = blockset; DynmapBlockState bblk = DynmapBlockState.getBaseStateByName(blockname); if (bblk.isNotAir()) { for (int i = 0; i < bblk.getStateCount(); i++) { - if((databits & (1< blknames = new ArrayList(); - int databits = 0; + databits.clear(); scale = 0; line = line.substring(6); String[] args = line.split(","); @@ -375,16 +376,16 @@ public class HDBlockModels { } else if(av[0].equals("data")) { if(av[1].equals("*")) - databits = 0xFFFF; + databits.clear(); else - databits |= (1 << getIntValue(varvals,av[1])); + databits.set(getIntValue(varvals,av[1])); } else if(av[0].equals("scale")) { scale = Integer.parseInt(av[1]); } } /* If we have everything, build block */ - if((blknames.size() > 0) && (databits != 0) && (scale > 0)) { + if((blknames.size() > 0) && (scale > 0)) { modlist.clear(); for(String bname : blknames) { DynmapBlockState bblk = DynmapBlockState.getBaseStateByName(bname); @@ -521,7 +522,7 @@ public class HDBlockModels { } else if(line.startsWith("ignore-updates:")) { ArrayList blknames = new ArrayList(); - int blkdat = 0; + databits.clear(); line = line.substring(line.indexOf(':')+1); String[] args = line.split(","); for(String a : args) { @@ -532,18 +533,19 @@ public class HDBlockModels { } else if(av[0].equals("data")) { if(av[1].equals("*")) - blkdat = 0xFFFF; + databits.clear(); else - blkdat |= (1 << getIntValue(varvals,av[1])); + databits.set(getIntValue(varvals,av[1])); } } - if(blkdat == 0) blkdat = 0xFFFF; for (String nm : blknames) { DynmapBlockState bbs = DynmapBlockState.getBaseStateByName(nm); if (bbs.isNotAir()) { for (int i = 0; i < bbs.getStateCount(); i++) { DynmapBlockState bs = bbs.getState(i); - changeIgnoredBlocks.set(bs.globalStateIndex); + if (databits.isEmpty() || databits.get(i)) { + changeIgnoredBlocks.set(bs.globalStateIndex); + } } } else { @@ -681,7 +683,7 @@ public class HDBlockModels { } else if(line.startsWith("patchblock:")) { ArrayList blknames = new ArrayList(); - int databits = 0; + databits.clear(); line = line.substring(11); String[] args = line.split(","); ArrayList patches = new ArrayList(); @@ -693,9 +695,9 @@ public class HDBlockModels { } else if(av[0].equals("data")) { if(av[1].equals("*")) - databits = 0xFFFF; + databits.clear(); else - databits |= (1 << getIntValue(varvals,av[1])); + databits.set(getIntValue(varvals,av[1])); } else if(av[0].startsWith("patch")) { int patchnum0, patchnum1; @@ -730,7 +732,7 @@ public class HDBlockModels { } /* If we have everything, build block */ pmodlist.clear(); - if((blknames.size() > 0) && (databits != 0)) { + if (blknames.size() > 0) { PatchDefinition[] patcharray = patches.toArray(new PatchDefinition[patches.size()]); if(patcharray.length > max_patches) max_patches = patcharray.length; @@ -753,7 +755,7 @@ public class HDBlockModels { // Shortcut for defining a patchblock that is a simple rectangular prism, with sidex corresponding to full block sides else if(line.startsWith("boxblock:")) { ArrayList blknames = new ArrayList(); - int databits = 0; + databits.clear(); line = line.substring(9); String[] args = line.split(","); double xmin = 0.0, xmax = 1.0, ymin = 0.0, ymax = 1.0, zmin = 0.0, zmax = 1.0; @@ -765,9 +767,9 @@ public class HDBlockModels { } else if(av[0].equals("data")) { if(av[1].equals("*")) - databits = 0xFFFF; + databits.clear(); else - databits |= (1 << getIntValue(varvals,av[1])); + databits.set(getIntValue(varvals,av[1])); } else if(av[0].equals("xmin")) { xmin = Double.parseDouble(av[1]); @@ -790,7 +792,7 @@ public class HDBlockModels { } /* If we have everything, build block */ pmodlist.clear(); - if((blknames.size() > 0) && (databits != 0)) { + if (blknames.size() > 0) { ArrayList pd = new ArrayList(); CustomRenderer.addBox(pdf, pd, xmin, xmax, ymin, ymax, zmin, zmax, boxPatchList); PatchDefinition[] patcharray = new PatchDefinition[pd.size()]; @@ -817,7 +819,7 @@ public class HDBlockModels { else if(line.startsWith("customblock:")) { ArrayList blknames = new ArrayList(); HashMap custargs = new HashMap(); - int databits = 0; + databits.clear(); line = line.substring(12); String[] args = line.split(","); String cls = null; @@ -829,9 +831,9 @@ public class HDBlockModels { } else if(av[0].equals("data")) { if(av[1].equals("*")) - databits = 0xFFFF; + databits.clear(); else - databits |= (1 << getIntValue(varvals,av[1])); + databits.set(getIntValue(varvals,av[1])); } else if(av[0].equals("class")) { cls = av[1]; @@ -846,7 +848,7 @@ public class HDBlockModels { } } /* If we have everything, build block */ - if((blknames.size() > 0) && (databits != 0) && (cls != null)) { + if ((blknames.size() > 0) && (cls != null)) { for (String nm : blknames) { DynmapBlockState bs = DynmapBlockState.getBaseStateByName(nm); if (bs.isNotAir()) { diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockPatchModel.java b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockPatchModel.java index 32b5693c..000244b6 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockPatchModel.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockPatchModel.java @@ -1,5 +1,7 @@ package org.dynmap.hdmap; +import java.util.BitSet; + import org.dynmap.utils.PatchDefinition; public class HDBlockPatchModel extends HDBlockModel { @@ -14,7 +16,7 @@ public class HDBlockPatchModel extends HDBlockModel { * @param patches - list of patches (surfaces composing model) * @param blockset - ID of set of blocks defining model */ - public HDBlockPatchModel(String blockname, int databits, PatchDefinition[] patches, String blockset) { + public HDBlockPatchModel(String blockname, BitSet databits, PatchDefinition[] patches, String blockset) { super(blockname, databits, blockset); this.patches = patches; int max = 0; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockVolumetricModel.java b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockVolumetricModel.java index 6efd3eb5..c23e1c72 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockVolumetricModel.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockVolumetricModel.java @@ -1,5 +1,6 @@ package org.dynmap.hdmap; +import java.util.BitSet; import java.util.HashMap; public class HDBlockVolumetricModel extends HDBlockModel { @@ -17,7 +18,7 @@ public class HDBlockVolumetricModel extends HDBlockModel { * if array is short, other elements area are assumed to be zero (fills from bottom of block up) * @param blockset - ID of set of blocks defining model */ - public HDBlockVolumetricModel(String blockname, int databits, int nativeres, long[] blockflags, String blockset) { + public HDBlockVolumetricModel(String blockname, BitSet databits, int nativeres, long[] blockflags, String blockset) { super(blockname, databits, blockset); this.nativeres = nativeres; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/BoxRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/BoxRenderer.java index 1a0bfd6a..c28f568a 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/BoxRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/BoxRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -18,7 +19,7 @@ public class BoxRenderer extends CustomRenderer { private static final int patchlist[] = { 1, 4, 2, 5, 0, 3 }; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; double xmin = 0.0, xmax = 1.0; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CTMVertTextureRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CTMVertTextureRenderer.java index 7deb028c..d641fee1 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CTMVertTextureRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CTMVertTextureRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -24,7 +25,7 @@ public class CTMVertTextureRenderer extends CustomRenderer { private RenderPatch[] mesh_both_neighbor; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; blk = DynmapBlockState.getBaseStateByName(blkname); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ChestRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ChestRenderer.java index 2fad8946..b1b0ddcf 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ChestRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ChestRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -29,7 +30,7 @@ public class ChestRenderer extends CustomRenderer { private boolean double_chest = false; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CuboidRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CuboidRenderer.java index b1be5630..9f2a000b 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CuboidRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/CuboidRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.Log; @@ -28,7 +29,7 @@ public class CuboidRenderer extends CustomRenderer { return f; } @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; ArrayList list = new ArrayList(); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/DoorRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/DoorRenderer.java index 47a2a5dd..c771c079 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/DoorRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/DoorRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -20,7 +21,7 @@ public class DoorRenderer extends CustomRenderer { private RenderPatch[][] models = new RenderPatch[32][]; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; int[] txt = new int[6]; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceGateBlockRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceGateBlockRenderer.java index dcabae4d..b86af7be 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceGateBlockRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceGateBlockRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.List; import java.util.Map; @@ -18,7 +19,7 @@ public class FenceGateBlockRenderer extends CustomRenderer { private RenderPatch[][] meshes = new RenderPatch[8][]; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; buildMeshes(rpf); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceWallBlockRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceWallBlockRenderer.java index c81ccc9d..1337e432 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceWallBlockRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FenceWallBlockRenderer.java @@ -41,7 +41,7 @@ public class FenceWallBlockRenderer extends CustomRenderer { } } @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; addIDs(blkname); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FrameRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FrameRenderer.java index 77f58471..a59bdaa5 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FrameRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/FrameRenderer.java @@ -49,7 +49,7 @@ public class FrameRenderer extends CustomRenderer { } } @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; String linkset = custparm.get("linkset"); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ImmibisMicroRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ImmibisMicroRenderer.java index 47614c36..e3ba6fe9 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ImmibisMicroRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ImmibisMicroRenderer.java @@ -2,6 +2,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; import java.util.Arrays; +import java.util.BitSet; import java.util.List; import java.util.Map; @@ -199,7 +200,7 @@ public class ImmibisMicroRenderer extends CustomRenderer { { 22, 101, 22, 22, 22, 22 } // 89 = dropper }; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; /* Flesh out sides map */ diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PaneRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PaneRenderer.java index d1700cd6..8527da7e 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PaneRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PaneRenderer.java @@ -1,5 +1,6 @@ package org.dynmap.hdmap.renderer; +import java.util.BitSet; import java.util.Map; import org.dynmap.hdmap.HDBlockStateTextureMap; @@ -27,7 +28,7 @@ public class PaneRenderer extends CustomRenderer { private RenderPatch[][] meshes = new RenderPatch[16][]; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; buildPatches(rpf); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PlantRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PlantRenderer.java index cc17e95d..ef03d80e 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PlantRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/PlantRenderer.java @@ -1,5 +1,6 @@ package org.dynmap.hdmap.renderer; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -19,7 +20,7 @@ public class PlantRenderer extends CustomRenderer { private int metaCnt = 16; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; String idxsrc = custparm.get("metasrc"); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPMicroRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPMicroRenderer.java index 5580e0ef..ece1b99b 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPMicroRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPMicroRenderer.java @@ -2,6 +2,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; import java.util.Arrays; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -158,7 +159,7 @@ public class RPMicroRenderer extends CustomRenderer { { 69 } // 68 = Copper Block (blockStorage:5) }; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; /* Flesh out sides map */ diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPRotatedBoxRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPRotatedBoxRenderer.java index f88b5a13..374625cb 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPRotatedBoxRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPRotatedBoxRenderer.java @@ -1,5 +1,6 @@ package org.dynmap.hdmap.renderer; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -42,7 +43,7 @@ public class RPRotatedBoxRenderer extends CustomRenderer { private String[] tileEntityAttribs = { "rot" }; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPSupportFrameRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPSupportFrameRenderer.java index 65f283ef..f2759ca3 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPSupportFrameRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RPSupportFrameRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.MapDataContext; @@ -12,7 +13,7 @@ public class RPSupportFrameRenderer extends RPMicroRenderer { private int frame_txt_side; private int frame_txt_edge; - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; frame_txt_side = super.getMaximumTextureCount(); /* Get index for side and edge textures */ diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftSlabBlockRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftSlabBlockRenderer.java index 40e497a8..0dfdf130 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftSlabBlockRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftSlabBlockRenderer.java @@ -35,7 +35,7 @@ public class RailCraftSlabBlockRenderer extends CustomRenderer { } @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; setID(blkname); /* Mark block as a stair */ diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftTrackRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftTrackRenderer.java index f333e650..2d1f4609 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftTrackRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RailCraftTrackRenderer.java @@ -1,5 +1,6 @@ package org.dynmap.hdmap.renderer; +import java.util.BitSet; import java.util.Map; import org.dynmap.Log; @@ -16,7 +17,7 @@ public class RailCraftTrackRenderer extends CustomRenderer { private int maxTrackId; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RedstoneWireRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RedstoneWireRenderer.java index c699a61d..a0a512ef 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RedstoneWireRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RedstoneWireRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -23,7 +24,7 @@ public class RedstoneWireRenderer extends CustomRenderer { private RenderPatch[][] meshes = new RenderPatch[256][]; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; blkbs = DynmapBlockState.getBaseStateByName(blkname); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedBoxRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedBoxRenderer.java index 050a1052..41d1e3f6 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedBoxRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedBoxRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.Log; @@ -20,7 +21,7 @@ public class RotatedBoxRenderer extends CustomRenderer { private String[] tileEntityAttribs = null; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; /* See if index attribute defined */ diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedPatchRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedPatchRenderer.java index 97b471b5..f127261c 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedPatchRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/RotatedPatchRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.Log; @@ -32,7 +33,7 @@ public class RotatedPatchRenderer extends CustomRenderer { private String[] tileEntityAttribs = null; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; ArrayList patches = new ArrayList(); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/SkullRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/SkullRenderer.java index 26dbc3ec..ecf57819 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/SkullRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/SkullRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -18,7 +19,7 @@ public class SkullRenderer extends CustomRenderer { private RenderPatch meshes[][] = new RenderPatch[NUM_FACES * NUM_DIRECTIONS][]; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/StairBlockRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/StairBlockRenderer.java index 786472a1..e04301e7 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/StairBlockRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/StairBlockRenderer.java @@ -38,7 +38,7 @@ public class StairBlockRenderer extends CustomRenderer { } } @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; setID(blkname); /* Mark block as a stair */ diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/StairStateRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/StairStateRenderer.java new file mode 100644 index 00000000..0fa80a30 --- /dev/null +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/StairStateRenderer.java @@ -0,0 +1,162 @@ +package org.dynmap.hdmap.renderer; + +import java.util.ArrayList; +import java.util.BitSet; +import java.util.List; +import java.util.Map; + +import org.dynmap.renderer.CustomRenderer; +import org.dynmap.renderer.MapDataContext; +import org.dynmap.renderer.RenderPatch; +import org.dynmap.renderer.RenderPatchFactory; + +public class StairStateRenderer extends CustomRenderer { + private static final int TEXTURE_SIDES = 0; + private static final int TEXTURE_TOP = 1; + private static final int TEXTURE_BOTTOM = 2; + + // Array of meshes for normal steps - index = (data value & 7) + private RenderPatch[][] stepmeshes = new RenderPatch[8][]; + // Array of meshes for 3/4 steps - index = (data value & 7), with extra one clockwise from normal step + private RenderPatch[][] step_3_4_meshes = new RenderPatch[8][]; + // Array of meshes for 1/4 steps - index = (data value & 7), with clockwise quarter clopped from normal step + private RenderPatch[][] step_1_4_meshes = new RenderPatch[8][]; + + @Override + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { + if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) + return false; + /* Build step meshes */ + for(int i = 0; i < 8; i++) { + stepmeshes[i] = buildStepMeshes(rpf, i); + step_1_4_meshes[i] = buildCornerStepMeshes(rpf, i); + step_3_4_meshes[i] = buildIntCornerStepMeshes(rpf, i); + } + return true; + } + + @Override + public int getMaximumTextureCount() { + return 3; + } + + private static final int[] patchlist = { TEXTURE_BOTTOM, TEXTURE_TOP, TEXTURE_SIDES, TEXTURE_SIDES, TEXTURE_SIDES, TEXTURE_SIDES }; + + private void addBox(RenderPatchFactory rpf, List list, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) { + addBox(rpf, list, xmin, xmax, ymin, ymax, zmin, zmax, patchlist); + } + + private RenderPatch[] buildStepMeshes(RenderPatchFactory rpf, int dat) { + ArrayList list = new ArrayList(); + /* If inverted, add half top */ + if((dat & 0x4) != 0) { + addBox(rpf, list, 0, 1, 0.5, 1, 0, 1); + } + else { // Else, add half bottom + addBox(rpf, list, 0, 1, 0.0, 0.5, 0, 1); + } + switch(dat & 0x3) { + case 0: + addBox(rpf, list, 0.5, 1, 0, 1, 0, 1); + break; + case 1: + addBox(rpf, list, 0, 0.5, 0, 1, 0, 1); + break; + case 2: + addBox(rpf, list, 0, 1, 0, 1, 0.5, 1); + break; + case 3: + addBox(rpf, list, 0, 1, 0, 1, 0, 0.5); + break; + } + return list.toArray(new RenderPatch[list.size()]); + } + + private RenderPatch[] buildCornerStepMeshes(RenderPatchFactory rpf, int dat) { + ArrayList list = new ArrayList(); + /* If inverted, add half top */ + if((dat & 0x4) != 0) { + addBox(rpf, list, 0, 1, 0.5, 1, 0, 1); + } + else { // Else, add half bottom + addBox(rpf, list, 0, 1, 0.0, 0.5, 0, 1); + } + switch(dat & 0x3) { + case 0: + addBox(rpf, list, 0.5, 1, 0, 1, 0.5, 1.0); + break; + case 1: + addBox(rpf, list, 0, 0.5, 0, 1, 0, 0.5); + break; + case 2: + addBox(rpf, list, 0, 0.5, 0, 1, 0.5, 1.0); + break; + case 3: + addBox(rpf, list, 0.5, 1, 0, 1, 0, 0.5); + break; + } + return list.toArray(new RenderPatch[list.size()]); + } + + private RenderPatch[] buildIntCornerStepMeshes(RenderPatchFactory rpf, int dat) { + ArrayList list = new ArrayList(); + /* If inverted, add half top */ + if((dat & 0x4) != 0) { + addBox(rpf, list, 0, 1, 0.5, 1, 0, 1); + } + else { // Else, add half bottom + addBox(rpf, list, 0, 1, 0.0, 0.5, 0, 1); + } + switch(dat & 0x3) { + case 3: + addBox(rpf, list, 0.5, 1, 0, 1, 0, 1); + addBox(rpf, list, 0, 0.5, 0, 1, 0, 0.5); + break; + case 0: + addBox(rpf, list, 0.5, 1, 0, 1, 0, 1); + addBox(rpf, list, 0, 0.5, 0, 1, 0.5, 1); + break; + case 1: + addBox(rpf, list, 0, 0.5, 0, 1, 0, 1); + addBox(rpf, list, 0.5, 1, 0, 1, 0, 0.5); + break; + case 2: + addBox(rpf, list, 0, 0.5, 0, 1, 0, 1); + addBox(rpf, list, 0.5, 1, 0, 1, 0.5, 1); + break; + } + return list.toArray(new RenderPatch[list.size()]); + } + + // Outer and inner left equivalent to outer and innter right minus 90 degrees + private static final int midx_by_facing[] = { 3, 2, 1, 0 }; + private static final int midx_by_facing_left[] = { 1, 0, 2, 3 }; + @Override + public RenderPatch[] getRenderPatchList(MapDataContext ctx) { + int idx = ctx.getBlockType().stateIndex; + // Parse index + int shape = (idx >> 1) % 5; // 0=straight, 1=inner left, 2 = inner right, 3=outer left, 4=outer right + int half = (idx / 10) % 2; // 0=top, 1=bottom + int facing = (idx / 20) % 4; // 0=north, 1=south, 2=west, 3=east + // Compute model index + RenderPatch[] rp = null; + switch (shape) { + case 0: // Straight + rp = stepmeshes[midx_by_facing[facing] + ((1-half) * 4)]; + break; + case 1: // inner left + rp = step_3_4_meshes[midx_by_facing_left[facing] + ((1-half) * 4)]; + break; + case 2: // inner right + rp = step_3_4_meshes[midx_by_facing[facing] + ((1-half) * 4)]; + break; + case 3: // Outer left + rp = step_1_4_meshes[midx_by_facing_left[facing] + ((1-half) * 4)]; + break; + case 4: // Outer right + rp = step_1_4_meshes[midx_by_facing[facing] + ((1-half) * 4)]; + break; + } + return rp; + } +} diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCLooseRockRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCLooseRockRenderer.java index 5f751163..8d4680df 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCLooseRockRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCLooseRockRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import java.util.Random; @@ -12,7 +13,7 @@ import org.dynmap.renderer.RenderPatchFactory; public class TFCLooseRockRenderer extends CustomRenderer { @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCSupportRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCSupportRenderer.java index 6883316f..6ae2b131 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCSupportRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCSupportRenderer.java @@ -36,7 +36,7 @@ public class TFCSupportRenderer extends CustomRenderer { } } @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; String vert = custparm.get("vert"); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCWoodRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCWoodRenderer.java index 936d73f4..2de6fbd2 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCWoodRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/TFCWoodRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.List; import java.util.Map; @@ -25,7 +26,7 @@ public class TFCWoodRenderer extends CustomRenderer { private RenderPatch[][] meshes = new RenderPatch[32][]; @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; blkbs = DynmapBlockState.getBaseStateByName(blkname); diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ThaumFurnaceRenderer.java b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ThaumFurnaceRenderer.java index 4da82bc4..12fd9d9b 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ThaumFurnaceRenderer.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/renderer/ThaumFurnaceRenderer.java @@ -1,6 +1,7 @@ package org.dynmap.hdmap.renderer; import java.util.ArrayList; +import java.util.BitSet; import java.util.Map; import org.dynmap.renderer.CustomRenderer; @@ -23,7 +24,7 @@ public class ThaumFurnaceRenderer extends CustomRenderer { private static final int TXTIDX_LAVA = 24; /* Lava */ @Override - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm)) return false; blkbs = DynmapBlockState.getBaseStateByName(blkname); /* Remember our block ID */ diff --git a/DynmapCore/src/main/resources/models_1.txt b/DynmapCore/src/main/resources/models_1.txt index 160adf02..01ac113d 100644 --- a/DynmapCore/src/main/resources/models_1.txt +++ b/DynmapCore/src/main/resources/models_1.txt @@ -175,7 +175,7 @@ ignore-updates:id=leaves,id=leaves2,data=* # Birch Wood stair # Jungle Wood stair # (156) Quartz Stairs -customblock:idoak_stairs,id=stone_stairs,id=brick_stairs,id=stone_brick_stairs,id=nether_brick_stairs,id=sandstone_stairs,id=spruce_stairs,id=birch_stairs,id=jungle_stairs,id=quartz_stairs,data=*,class=org.dynmap.hdmap.renderer.StairBlockRenderer +customblock:idoak_stairs,id=stone_stairs,id=brick_stairs,id=stone_brick_stairs,id=nether_brick_stairs,id=sandstone_stairs,id=spruce_stairs,id=birch_stairs,id=jungle_stairs,id=quartz_stairs,data=*,class=org.dynmap.hdmap.renderer.StairStateRenderer # Slab (stone, sandstone, wood, cobblestone) # Wood Slab @@ -1143,123 +1143,123 @@ layer:11,12,13,14,15 **************** # Colored glass pane (160) -[1.7.0-]customblock:id=stained_glass_pane,data=*,class=org.dynmap.hdmap.renderer.PaneRenderer +customblock:id=stained_glass_pane,data=*,class=org.dynmap.hdmap.renderer.PaneRenderer # Acacia Stairs (163) # Dark Oak Stairs (164) -[1.7.0-]customblock:id=acacia_stairs,id=dark_oak_stairs,data=*,class=org.dynmap.hdmap.renderer.StairBlockRenderer +customblock:id=acacia_stairs,id=dark_oak_stairs,data=*,class=org.dynmap.hdmap.renderer.StairStateRenderer # (171) Carpet boxblock:id=carpet,data=*,ymax=0.0625 # (175) Double Plant -[1.7.0-]customblock:id=double_plant,data=0,data=1,data=2,data=3,data=4,data=5,class=org.dynmap.hdmap.renderer.PlantRenderer,metacnt=6 -[1.7.0-]customblock:id=double_plant,data=8,data=9,data=10,data=11,data=12,data=13,data=14,data=15,class=org.dynmap.hdmap.renderer.PlantRenderer,metacnt=6,metasrc=below +customblock:id=double_plant,data=0,data=1,data=2,data=3,data=4,data=5,class=org.dynmap.hdmap.renderer.PlantRenderer,metacnt=6 +customblock:id=double_plant,data=8,data=9,data=10,data=11,data=12,data=13,data=14,data=15,class=org.dynmap.hdmap.renderer.PlantRenderer,metacnt=6,metasrc=below # 1.8 blocks # Iron Trapdoor -[1.8.0-]boxblock:id=iron_trapdoor,data=0,data=1,data=2,data=3,ymax=0.1875 -[1.8.0-]boxblock:id=iron_trapdoor,data=4,data=12,zmin=0.8125 -[1.8.0-]boxblock:id=iron_trapdoor,data=5,data=13,zmax=0.1875 -[1.8.0-]boxblock:id=iron_trapdoor,data=6,data=14,xmin=0.8125 -[1.8.0-]boxblock:id=iron_trapdoor,data=7,data=15,xmax=0.1875 -[1.8.0-]boxblock:id=iron_trapdoor,data=8,data=9,data=10,data=11,ymin=0.8125 +boxblock:id=iron_trapdoor,data=0,data=1,data=2,data=3,ymax=0.1875 +boxblock:id=iron_trapdoor,data=4,data=12,zmin=0.8125 +boxblock:id=iron_trapdoor,data=5,data=13,zmax=0.1875 +boxblock:id=iron_trapdoor,data=6,data=14,xmin=0.8125 +boxblock:id=iron_trapdoor,data=7,data=15,xmax=0.1875 +boxblock:id=iron_trapdoor,data=8,data=9,data=10,data=11,ymin=0.8125 # Inverted Daylight Sensor -[1.8.0-]boxblock:id=daylight_detector_inverted,data=*,ymax=0.375 +boxblock:id=daylight_detector_inverted,data=*,ymax=0.375 # Red Sandstone stairs -[1.8.0-]customblock:id=red_sandstone_stairs,data=*,class=org.dynmap.hdmap.renderer.StairBlockRenderer +customblock:id=red_sandstone_stairs,data=*,class=org.dynmap.hdmap.renderer.StairStateRenderer # Red Sandstone Slab -[1.8.0-]boxblock:id=stone_slab2,data=0,ymax=0.5 -[1.8.0-]boxblock:id=stone_slab2,data=8,ymin=0.5 +boxblock:id=stone_slab2,data=0,ymax=0.5 +boxblock:id=stone_slab2,data=8,ymin=0.5 # Fence Gate (Spruce) -[1.8.0-]customblock:id=spruce_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer +customblock:id=spruce_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer # Fence Gate (Birch) -[1.8.0-]customblock:id=birch_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer +customblock:id=birch_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer # Fence Gate (Jungle) -[1.8.0-]customblock:id=jungle_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer +customblock:id=jungle_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer # Fence Gate (Dark Oak) -[1.8.0-]customblock:id=dark_oak_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer +customblock:id=dark_oak_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer # Fence Gate (Acacia) -[1.8.0-]customblock:id=acacia_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer +customblock:id=acacia_fence_gate,data=*,class=org.dynmap.hdmap.renderer.FenceGateBlockRenderer # Fence (Spruce) -[1.8.0-]customblock:id=spruce_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=183 +customblock:id=spruce_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=183 # Fence (Birch) -[1.8.0-]customblock:id=birch_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=184 +customblock:id=birch_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=184 # Fence (Jungle) -[1.8.0-]customblock:id=jungle_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=185 +customblock:id=jungle_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=185 # Fence (Dark Oak) -[1.8.0-]customblock:id=dark_oak_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=186 +customblock:id=dark_oak_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=186 # Fence (Acacia) -[1.8.0-]customblock:id=acacia_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=187 +customblock:id=acacia_fence,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=fence,link0=187 # Wooden Door Block (Spruce) # Wooden Door Block (Birch) # Wooden Door Block (Jungle) # Wooden Door Block (Acacia) # Wooden Door Block (Dark Oak) -[1.8.0-]customblock:id=spruce_door,id=birch_door,id=jungle_door,id=acacia_door,id=dark_oak_door,data=*,class=org.dynmap.hdmap.renderer.DoorRenderer +customblock:id=spruce_door,id=birch_door,id=jungle_door,id=acacia_door,id=dark_oak_door,data=*,class=org.dynmap.hdmap.renderer.DoorRenderer # 1.9 models # End rod -#[1.9.0-]block:id=end_rod,data=*,patch0=0:end_rod,transparency=TRANSPARENT +#block:id=end_rod,data=*,patch0=0:end_rod,transparency=TRANSPARENT # Chorus Plant -[1.9.0-]customblock:id=chorus_plant,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=wall,link0=200 +customblock:id=chorus_plant,data=*,class=org.dynmap.hdmap.renderer.FenceWallBlockRenderer,type=wall,link0=200 # Chorus Flower -[1.9.0-]block:id=chorus_flower,data=*,scale=8 -[1.9.0-]layer:0,7 -[1.9.0-]-------- -[1.9.0-]-******- -[1.9.0-]-******- -[1.9.0-]-******- -[1.9.0-]-******- -[1.9.0-]-******- -[1.9.0-]-******- -[1.9.0-]-------- -[1.9.0-]layer:1,2,3,4,5,6 -[1.9.0-]-******- -[1.9.0-]******** -[1.9.0-]******** -[1.9.0-]******** -[1.9.0-]******** -[1.9.0-]******** -[1.9.0-]******** -[1.9.0-]-******- +block:id=chorus_flower,data=*,scale=8 +layer:0,7 +-------- +-******- +-******- +-******- +-******- +-******- +-******- +-------- +layer:1,2,3,4,5,6 +-******- +******** +******** +******** +******** +******** +******** +-******- # Purpur Block # Purpur Pillar # Purpur Stairs -[1.9.0-]customblock:id=purpur_stairs,data=*,class=org.dynmap.hdmap.renderer.StairBlockRenderer +customblock:id=purpur_stairs,data=*,class=org.dynmap.hdmap.renderer.StairStateRenderer # Purpur Slab (Double) # Purpur Slab -[1.9.0-]boxblock:id=purpur_slab,data=0,data=1,data=2,data=3,data=4,data=5,data=6,data=7,ymax=0.5 -[1.9.0-]boxblock:id=purpur_slab,data=8,data=9,data=10,data=11,data=12,data=13,data=14,data=15,ymin=0.5 +boxblock:id=purpur_slab,data=0,data=1,data=2,data=3,data=4,data=5,data=6,data=7,ymax=0.5 +boxblock:id=purpur_slab,data=8,data=9,data=10,data=11,data=12,data=13,data=14,data=15,ymin=0.5 # End Stone Bricks # Beetroot -[1.9.0-]patchblock:id=beetroots,data=*,patch0=VertX075,patch1=VertX075@90,patch2=VertX025,patch3=VertX025@90 +patchblock:id=beetroots,data=*,patch0=VertX075,patch1=VertX075@90,patch2=VertX025,patch3=VertX025@90 # Grass Path -[1.9.0-]boxblock:id=grass_path,data=*,ymax=0.9375 +boxblock:id=grass_path,data=*,ymax=0.9375 # 209 End Gateway diff --git a/DynmapCore/src/main/resources/texture_1.txt b/DynmapCore/src/main/resources/texture_1.txt index 1e1db54e..2eafe95e 100644 --- a/DynmapCore/src/main/resources/texture_1.txt +++ b/DynmapCore/src/main/resources/texture_1.txt @@ -105,7 +105,7 @@ texture:id=brown_wool texture:id=cyan_wool texture:id=gray_wool texture:id=green_wool -texture:id=light_blue_wppl +texture:id=light_blue_wool texture:id=lime_wool texture:id=magenta_wool texture:id=orange_wool @@ -174,9 +174,9 @@ texture:id=furnace_front_on texture:id=dispenser_front_horizontal texture:id=dispenser_front_vertical texture:id=sandstone_bottom -texture:id=sandstone_carved -texture:id=sandstone_normal -texture:id=sandstone_smooth +texture:id=chiseled_sandstone +texture:id=sandstone +texture:id=cut_sandstone texture:id=sandstone_top texture:id=noteblock texture:id=rail_golden_powered @@ -411,9 +411,9 @@ texture:id=prismarine_rough texture:id=sea_lantern texture:id=daylight_detector_inverted_top texture:id=red_sandstone_bottom -texture:id=red_sandstone_carved -texture:id=red_sandstone_normal -texture:id=red_sandstone_smooth +texture:id=chiseled_red_sandstone +texture:id=red_sandstone +texture:id=cut_red_sandstone texture:id=red_sandstone_top texture:id=dark_oak_planks texture:id=acacia_door_lower @@ -721,11 +721,11 @@ block:id=dispenser,data=6,data=7,face0=0:furnace_top,face1=0:furnace_top,face2=0 block:id=dispenser,data=8,data=9,face0=0:furnace_top,face1=0:furnace_top,face2=0:furnace_side,face3=0:furnace_side,face4=0:dispenser_front_horizontal,face5=0:furnace_side,stdrot=true block:id=dispenser,data=10,data=11,face0=0:furnace_top,face1=0:furnace_top,face2=0:furnace_side,face3=0:furnace_side,face4=0:furnace_side,face5=0:dispenser_front_horizontal,stdrot=true # Sandstone -block:id=sandstone,bottom=0:sandstone_bottom,top=0:sandstone_top,allsides=0:sandstone_normal,stdrot=true +block:id=sandstone,bottom=0:sandstone_bottom,top=0:sandstone_top,allsides=0:sandstone,stdrot=true # Carved Sandstone -block:id=chiseled_sandstone,allsides=0:sandstone_carved,topbottom=0:sandstone_top,stdrot=true +block:id=chiseled_sandstone,allsides=0:chiseled_sandstone,topbottom=0:sandstone_top,stdrot=true # Smooth Sandstone -block:id=cut_sandstone,allsides=0:sandstone_smooth,topbottom=0:sandstone_top,stdrot=true +block:id=cut_sandstone,allsides=0:cut_sandstone,topbottom=0:sandstone_top,stdrot=true # Note Block block:id=note_block,allfaces=0:noteblock,stdrot=true # White Bed @@ -828,7 +828,7 @@ block:id=dead_bush,patch0-1=0:dead_bush,transparency=TRANSPARENT block:id=seagrass,patch0-1=1000:seagrass,transparency=TRANSPARENT # Tall seagrass block:id=seagrass,data=0,patch0-1=1000:tall_seagrass_top,transparency=TRANSPARENT -block:id=seagrass,data=1.patch0-1=1000:tall_seagrass_bottom,transparency=TRANSPARENT +block:id=seagrass,data=1,patch0-1=1000:tall_seagrass_bottom,transparency=TRANSPARENT # Piston - facing down block:id=piston,data=0,top=0:piston_bottom,bottom=0:piston_top_normal,allsides=5000:piston_side,transparency=TRANSPARENT # Piston - facing up @@ -920,7 +920,7 @@ block:id=iron_block,allfaces=0:iron_block,stdrot=true block:id=double_stone_slab,data=0,allsides=0:stone_slab_side,topbottom=0:stone_slab_top,stdrot=true block:id=double_stone_slab,data=8,allfaces=0:stone_slab_top,stdrot=true # Double Slab - Sandstone -block:id=double_stone_slab,data=1,bottom=0:sandstone_bottom,top=0:sandstone_top,allsides=0:sandstone_normal,stdrot=true +block:id=double_stone_slab,data=1,bottom=0:sandstone_bottom,top=0:sandstone_top,allsides=0:sandstone,stdrot=true block:id=double_stone_slab,data=9,allfaces=0:sandstone_top,stdrot=true # Double Slab - Wood block:id=double_stone_slab,data=2,allfaces=0:oak_planks,stdrot=true @@ -943,7 +943,7 @@ block:id=double_stone_slab,data=15,top=0:quartz_block_top,bottom=0:quartz_block_ # Slab - stone block:id=stone_slab,data=0,data=8,allsides=0:stone_slab_side,topbottom=0:stone_slab_top,stdrot=true,transparency=SEMITRANSPARENT # Slab - Sandstone -block:id=stone_slab,data=1,data=9,bottom=0:sandstone_bottom,top=0:sandstone_top,allsides=0:sandstone_normal,stdrot=true,transparency=SEMITRANSPARENT +block:id=stone_slab,data=1,data=9,bottom=0:sandstone_bottom,top=0:sandstone_top,allsides=0:sandstone,stdrot=true,transparency=SEMITRANSPARENT # Slab - Wood block:id=stone_slab,data=2,data=10,allfaces=0:oak_planks,stdrot=true,transparency=SEMITRANSPARENT # Slab - Cobblestone @@ -1286,7 +1286,7 @@ block:id=wooden_slab,data=5,data=13,allfaces=0:dark_oak_planks,stdrot=true,trans # Cocoa Plant (TODO: handle different stages, orientations) block:id=cocoa,data=*,allsides=0:cocoa_stage_2 # Sandstone stairs -block:id=sandstone_stairs,data=*,patch0=0:sandstone_normal,patch1=0:sandstone_top,patch2=0:sandstone_bottom,transparency=SEMITRANSPARENT +block:id=sandstone_stairs,data=*,patch0=0:sandstone,patch1=0:sandstone_top,patch2=0:sandstone_bottom,transparency=SEMITRANSPARENT # Emerald Ore block:id=emerald_ore,data=*,allfaces=0:emerald_ore,stdrot=true # Ender Chest (facing east) @@ -1332,7 +1332,7 @@ block:id=flower_pot,data=8,patch0-5=0:flower_pot,patch6=0:dirt,patch7-8=0:mushro # Flower pot with cactus block:id=flower_pot,data=9,patch0-5=0:flower_pot,patch6=0:dirt,patch7-10=0:cactus_side,patch11=0:cactus_top,transparency=TRANSPARENT # Flower pot with dead bush -block:id=flower_pot,data=10,patch0-5=0:flower_pot,patch6=0:dirt,patch7-8=0:deadbush,transparency=TRANSPARENT +block:id=flower_pot,data=10,patch0-5=0:flower_pot,patch6=0:dirt,patch7-8=0:dead_bush,transparency=TRANSPARENT # Flower pot with fern block:id=flower_pot,data=11,patch0-5=0:flower_pot,patch6=0:dirt,patch7-8=1000:fern,transparency=TRANSPARENT # Carrots @@ -1521,23 +1521,23 @@ block:id=sea_lantern,data=*,allfaces=0:sea_lantern,stdrot=true block:id=daylight_detector_inverted,data=*,allsides=0:daylight_detector_side,bottom=0:daylight_detector_side,top=0:daylight_detector_inverted_top,stdrot=true,transparency=TRANSPARENT # Red Sandstone -block:id=red_sandstone,data=0,bottom=0:red_sandstone_bottom,top=0:red_sandstone_top,allsides=0:red_sandstone_normal,stdrot=true +block:id=red_sandstone,bottom=0:red_sandstone_bottom,top=0:red_sandstone_top,allsides=0:red_sandstone,stdrot=true # Carved Red Sandstone -block:id=red_sandstone,data=1,data=3,data=4,data=5,data=6,data=7,data=8,data=9,data=10,data=11,data=12,data=13,data=14,data=15,allsides=0:red_sandstone_carved,topbottom=0:red_sandstone_top,stdrot=true +block:id=chiseled_red_sandstone,allsides=0:chiseled_red_sandstone,topbottom=0:red_sandstone_top,stdrot=true # Smooth Red Sandstone -block:id=red_sandstone,data=2,allsides=0:red_sandstone_smooth,topbottom=0:red_sandstone_top,stdrot=true +block:id=cut_red_sandstone,allsides=0:cut_red_sandstone,topbottom=0:red_sandstone_top,stdrot=true # Red Sandstone stairs -block:id=red_sandstone_stairs,data=*,patch0=0:red_sandstone_normal,patch1=0:red_sandstone_top,patch2=0:red_sandstone_bottom,transparency=SEMITRANSPARENT +block:id=red_sandstone_stairs,data=*,patch0=0:red_sandstone,patch1=0:red_sandstone_top,patch2=0:red_sandstone_bottom,transparency=SEMITRANSPARENT # Red Sandstone Slab (Double) -block:id=double_stone_slab2,data=0,bottom=0:red_sandstone_bottom,top=0:red_sandstone_top,allsides=0:red_sandstone_normal,stdrot=true +block:id=double_stone_slab2,data=0,bottom=0:red_sandstone_bottom,top=0:red_sandstone_top,allsides=0:red_sandstone,stdrot=true block:id=double_stone_slab2,data=8,allfaces=0:red_sandstone_top,stdrot=true # Red Sandstone Slab -block:id=stone_slab2,data=0,data=8,bottom=0:red_sandstone_bottom,top=0:red_sandstone_top,allsides=0:red_sandstone_normal,stdrot=true,transparency=SEMITRANSPARENT +block:id=stone_slab2,data=0,data=8,bottom=0:red_sandstone_bottom,top=0:red_sandstone_top,allsides=0:red_sandstone,stdrot=true,transparency=SEMITRANSPARENT # Fence Gate (Spruce) block:id=spruce_fence_gate,patch0-2=0:spruce_planks,stdrot=true,transparency=TRANSPARENT diff --git a/DynmapCoreAPI/src/main/java/org/dynmap/renderer/CustomRenderer.java b/DynmapCoreAPI/src/main/java/org/dynmap/renderer/CustomRenderer.java index e3286982..da9a6a5f 100644 --- a/DynmapCoreAPI/src/main/java/org/dynmap/renderer/CustomRenderer.java +++ b/DynmapCoreAPI/src/main/java/org/dynmap/renderer/CustomRenderer.java @@ -1,5 +1,6 @@ package org.dynmap.renderer; +import java.util.BitSet; import java.util.List; import java.util.Map; @@ -28,7 +29,7 @@ public abstract class CustomRenderer { * @param custparm - parameter strings for custom renderer - renderer specific * @return true if initialized successfully, false if not */ - public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, int blockdatamask, Map custparm) { + public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map custparm) { return true; } /**