mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-11 18:37:40 +01:00
Add more 1.17 blocks (mostly copper related)
This commit is contained in:
parent
d16900f76d
commit
eb41195984
@ -0,0 +1,58 @@
|
||||
package org.dynmap.hdmap.renderer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.BitSet;
|
||||
import java.util.Map;
|
||||
|
||||
import org.dynmap.renderer.CustomRenderer;
|
||||
import org.dynmap.renderer.MapDataContext;
|
||||
import org.dynmap.renderer.RenderPatch;
|
||||
import org.dynmap.renderer.RenderPatchFactory;
|
||||
import org.dynmap.renderer.RenderPatchFactory.SideVisible;
|
||||
|
||||
/*
|
||||
* Glow lichen renderer for v1.17+
|
||||
*/
|
||||
public class GlowLichenStateRenderer extends CustomRenderer {
|
||||
|
||||
// Meshes, indexed by state index (bit5=down, bit4=east, bit3=north, bit2=south, bit1=up, bit0=west)
|
||||
protected RenderPatch[][] meshes = new RenderPatch[64][];
|
||||
|
||||
@Override
|
||||
public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map<String,String> custparm) {
|
||||
if(!super.initializeRenderer(rpf, blkname, blockdatamask, custparm))
|
||||
return false;
|
||||
buildPatches(rpf);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void buildPatches(RenderPatchFactory rpf) {
|
||||
RenderPatch Top = rpf.getPatch(0.0, 0.95, 0.0, 1.0, 0.95, 0.0, 0.0, 0.95, 1.0, 0.0, 1.0, 0.0, 1.0, SideVisible.BOTH, 0);
|
||||
RenderPatch Bottom = rpf.getPatch(0.0, 0.05, 0.0, 1.0, 0.05, 0.0, 0.0, 0.05, 1.0, 0.0, 1.0, 0.0, 1.0, SideVisible.BOTH, 0);
|
||||
RenderPatch West = rpf.getPatch(0.05, 0.0, 0.0, 0.05, 0.0, 1.0, 0.05, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, SideVisible.BOTH, 0);
|
||||
RenderPatch East = rpf.getPatch(0.95, 0.0, 0.0, 0.95, 0.0, 1.0, 0.95, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, SideVisible.BOTH, 0);
|
||||
RenderPatch North = rpf.getPatch(0.0, 0.0, 0.05, 1.0, 0.0, 0.05, 0.0, 1.0, 0.05, 0.0, 1.0, 0.0, 1.0, SideVisible.BOTH, 0);
|
||||
RenderPatch South = rpf.getPatch(0.0, 0.0, 0.95, 1.0, 0.0, 0.95, 0.0, 1.0, 0.95, 0.0, 1.0, 0.0, 1.0, SideVisible.BOTH, 0);
|
||||
ArrayList<RenderPatch> list = new ArrayList<RenderPatch>();
|
||||
for (int i = 0; i < 64; i++) {
|
||||
list.clear();
|
||||
if ((i & 0x20) == 0) list.add(Bottom);
|
||||
if ((i & 0x10) == 0) list.add(East);
|
||||
if ((i & 0x08) == 0) list.add(North);
|
||||
if ((i & 0x04) == 0) list.add(South);
|
||||
if ((i & 0x02) == 0) list.add(Top);
|
||||
if ((i & 0x01) == 0) list.add(West);
|
||||
meshes[i] = list.toArray(new RenderPatch[list.size()]);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getMaximumTextureCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RenderPatch[] getRenderPatchList(MapDataContext ctx) {
|
||||
int idx = ((ctx.getBlockType().stateIndex & 0x7C) >> 1) + (ctx.getBlockType().stateIndex & 0x1); // Shift out waterlogged bit
|
||||
return meshes[idx];
|
||||
}
|
||||
}
|
@ -1641,15 +1641,26 @@ patchblock:id=bubble_column
|
||||
# Deepslate brick stairs
|
||||
# Deepslate tile stairs
|
||||
# Polished deepslate stairs
|
||||
[1.17-]customblock:id=cobbled_deepslate_stairs,id=deepslate_brick_stairs,id=deepslate_tile_stairs,id=polished_deepslate_stairs,class=org.dynmap.hdmap.renderer.StairStateRenderer
|
||||
# Cut copper stairs
|
||||
# Exposed cut copper stairs
|
||||
# Weathered cut copper stairs
|
||||
# Oxidized cut copper stairs
|
||||
[1.17-]customblock:id=cobbled_deepslate_stairs,id=deepslate_brick_stairs,id=deepslate_tile_stairs,id=polished_deepslate_stairs,id=cut_copper_stairs,id=oxidized_cut_copper_stairs,id=exposed_cut_copper_stairs,id=weathered_cut_copper_stairs,class=org.dynmap.hdmap.renderer.StairStateRenderer
|
||||
# Cobbled deepslate slab
|
||||
# Deepslate brick slab
|
||||
# Deepslate tile slab
|
||||
# Polished deepslate slab
|
||||
[1.17-]boxblock:id=cobbled_deepslate_slab,id=deepslate_brick_slab,id=deepslate_tile_slab,id=polished_deepslate_slab,data=0,data=1,ymin=0.5
|
||||
[1.17-]boxblock:id=cobbled_deepslate_slab,id=deepslate_brick_slab,id=deepslate_tile_slab,id=polished_deepslate_slab,data=2,data=3,ymax=0.5
|
||||
# Cut copper slab
|
||||
# Exposed cut copper slab
|
||||
# Weathered cut copper slab
|
||||
# Oxidized cut copper slab
|
||||
[1.17-]boxblock:id=cobbled_deepslate_slab,id=deepslate_brick_slab,id=deepslate_tile_slab,id=polished_deepslate_slab,id=cut_copper_slab,id=exposed_cut_copper_slab,id=weathered_cut_copper_slab,id=oxidized_cut_copper_slab,data=0,data=1,ymin=0.5
|
||||
[1.17-]boxblock:id=cobbled_deepslate_slab,id=deepslate_brick_slab,id=deepslate_tile_slab,id=polished_deepslate_slab,id=cut_copper_slab,id=exposed_cut_copper_slab,id=weathered_cut_copper_slab,id=oxidized_cut_copper_slab,data=2,data=3,ymax=0.5
|
||||
# Cobbled deepslate wall
|
||||
# Deepslate brick wall
|
||||
# Deepslate tile wall
|
||||
# Polished deepslate wall
|
||||
[1.17-]customblock:id=cobbled_deepslate_wall,id=deepslate_brick_wall,id=deepslate_tile_wall,id=polished_deepslate_wall,class=org.dynmap.hdmap.renderer.FenceWallBlockStateRenderer,type=tallwall
|
||||
# Glow lichens
|
||||
[1.17-]customblock:id=glow_lichen,class=org.dynmap.hdmap.renderer.GlowLichenStateRenderer
|
||||
|
||||
|
@ -2657,6 +2657,21 @@ block:id=horn_coral,patch0-1=0:horn_coral,transparency=TRANSPARENT
|
||||
[1.17-]texture:id=cracked_deepslate_tiles
|
||||
[1.17-]texture:id=chiseled_deepslate
|
||||
[1.17-]texture:id=deepslate_copper_ore
|
||||
[1.17-]texture:id=azalea_leaves
|
||||
[1.17-]texture:id=flowering_azalea_leaves
|
||||
[1.17-]texture:id=glow_lichen
|
||||
[1.17-]texture:id=calcite
|
||||
[1.17-]texture:id=tinted_glass,material=GLASS
|
||||
[1.17-]texture:id=powder_snow
|
||||
[1.17-]texture:id=oxidized_copper
|
||||
[1.17-]texture:id=weathered_copper
|
||||
[1.17-]texture:id=exposed_copper
|
||||
[1.17-]texture:id=copper_block
|
||||
[1.17-]texture:id=copper_ore
|
||||
[1.17-]texture:id=oxidized_cut_copper
|
||||
[1.17-]texture:id=weathered_cut_copper
|
||||
[1.17-]texture:id=exposed_cut_copper
|
||||
[1.17-]texture:id=cut_copper
|
||||
|
||||
# Dirt path
|
||||
[1.17-]block:id=dirt_path,allsides=0:dirt_path_side,top=0:dirt_path_top,bottom=0:dirt,stdrot=true, transparency=TRANSPARENT
|
||||
@ -2718,7 +2733,7 @@ block:id=horn_coral,patch0-1=0:horn_coral,transparency=TRANSPARENT
|
||||
[1.17-]block:id=cracked_deepslate_tiles,allfaces=0:cracked_deepslate_tiles,stdrot=true
|
||||
# Cracked deepslate bricks
|
||||
[1.17-]block:id=cracked_deepslate_bricks,allfaces=0:cracked_deepslate_bricks,stdrot=true
|
||||
# Indested deepslate
|
||||
# Infested deepslate
|
||||
[1.17-]block:id=infested_deepslate,data=1,allsides=0:deepslate,topbottom=0:deepslate_top,stdrot=true
|
||||
[1.17-]block:id=infested_deepslate,data=0,north=0:deepslate_top,south=0:deepslate_top,east=4000:deepslate,west=4000:deepslate,top=0:deepslate,bottom=0:deepslate
|
||||
[1.17-]block:id=infested_deepslate,data=2,north=4000:deepslate,south=4000:deepslate,east=0:deepslate_top,west=0:deepslate_top,top=4000:deepslate,bottom=4000:deepslate
|
||||
@ -2726,4 +2741,59 @@ block:id=horn_coral,patch0-1=0:horn_coral,transparency=TRANSPARENT
|
||||
[1.17-]block:id=chiseled_deepslate,allfaces=0:chiseled_deepslate,stdrot=true
|
||||
# Deepslate copper ore
|
||||
[1.17-]block:id=deepslate_copper_ore,allfaces=0:deepslate_copper_ore,stdrot=true
|
||||
# Leaves (azalea)
|
||||
[1.17-]block:id=azalea_leaves,allfaces=2000:azalea_leaves,stdrot=true,transparency=LEAVES
|
||||
# Leaves (flowering azalea)
|
||||
[1.17-]block:id=flowering_azalea_leaves,allfaces=2000:flowering_azalea_leaves,stdrot=true,transparency=LEAVES
|
||||
# Glow lichens
|
||||
[1.17-]block:id=glow_lichen,patch0-4=0:glow_lichen,transparency=TRANSPARENT
|
||||
# Calcite
|
||||
[1.17-]block:id=calcite,allfaces=0:calcite,stdrot=true
|
||||
# Tinted Glass
|
||||
[1.17-]block:id=tinted_glass,allfaces=12000:tinted_glass,stdrot=true,transparency=TRANSPARENT
|
||||
# Powder snow
|
||||
[1.17-]block:id=powder_snow,allfaces=0:powder_snow,stdrot=true
|
||||
# Oxidized copper
|
||||
[1.17-]block:id=oxidized_copper,allfaces=0:oxidized_copper,stdrot=true
|
||||
# Weathered copper
|
||||
[1.17-]block:id=weathered_copper,allfaces=0:weathered_copper,stdrot=true
|
||||
# Exposed copper
|
||||
[1.17-]block:id=exposed_copper,allfaces=0:exposed_copper,stdrot=true
|
||||
# Copper block
|
||||
# Waxed copper block
|
||||
[1.17-]block:id=copper_block,id=waxed_copper_block,allfaces=0:copper_block,stdrot=true
|
||||
# Copper ore
|
||||
[1.17-]block:id=copper_ore,allfaces=0:copper_ore,stdrot=true
|
||||
# Oxidized cut copper
|
||||
# Waxed oxidized cut copper
|
||||
[1.17-]block:id=oxidized_cut_copper,id=waxed_oxidized_cut_copper,allfaces=0:oxidized_cut_copper,stdrot=true
|
||||
# Weathered cut copper
|
||||
# Waxed weathered cut copper
|
||||
[1.17-]block:id=weathered_cut_copper,id=waxed_weathered_cut_copper,allfaces=0:weathered_cut_copper,stdrot=true
|
||||
# Exposed cut copper
|
||||
# Waxed exposed cut copper
|
||||
[1.17-]block:id=exposed_cut_copper,id=waxed_exposed_cut_copper,allfaces=0:exposed_cut_copper,stdrot=true
|
||||
# Cut copper
|
||||
# Waxed cut copper
|
||||
[1.17-]block:id=cut_copper,id=waxed_cut_copper,allfaces=0:cut_copper,stdrot=true
|
||||
# Cut copper stairs
|
||||
[1.17-]block:id=cut_copper_stairs,patch0-2=0:cut_copper,transparency=SEMITRANSPARENT
|
||||
# Cut copper slab
|
||||
[1.17-]block:id=cut_copper_slab,data=0,data=1,data=2,data=3,allfaces=0:cut_copper,stdrot=true,transparency=SEMITRANSPARENT
|
||||
[1.17-]block:id=cut_copper_slab,data=4,data=5,allfaces=0:cut_copper,stdrot=true
|
||||
# Exposed cut copper stairs
|
||||
[1.17-]block:id=exposed_cut_copper_stairs,patch0-2=0:exposed_cut_copper,transparency=SEMITRANSPARENT
|
||||
# Exposed cut copper slab
|
||||
[1.17-]block:id=exposed_cut_copper_slab,data=0,data=1,data=2,data=3,allfaces=0:exposed_cut_copper,stdrot=true,transparency=SEMITRANSPARENT
|
||||
[1.17-]block:id=exposed_cut_copper_slab,data=4,data=5,allfaces=0:exposed_cut_copper,stdrot=true
|
||||
# Weathered cut copper stairs
|
||||
[1.17-]block:id=weathered_cut_copper_stairs,patch0-2=0:weathered_cut_copper,transparency=SEMITRANSPARENT
|
||||
# Weathered cut copper slab
|
||||
[1.17-]block:id=weathered_cut_copper_slab,data=0,data=1,data=2,data=3,allfaces=0:weathered_cut_copper,stdrot=true,transparency=SEMITRANSPARENT
|
||||
[1.17-]block:id=weathered_cut_copper_slab,data=4,data=5,allfaces=0:weathered_cut_copper,stdrot=true
|
||||
# Oxidized cut copper stairs
|
||||
[1.17-]block:id=oxidized_cut_copper_stairs,patch0-2=0:oxidized_cut_copper,transparency=SEMITRANSPARENT
|
||||
# Oxidized cut copper slab
|
||||
[1.17-]block:id=oxidized_cut_copper_slab,data=0,data=1,data=2,data=3,allfaces=0:oxidized_cut_copper,stdrot=true,transparency=SEMITRANSPARENT
|
||||
[1.17-]block:id=oxidized_cut_copper_slab,data=4,data=5,allfaces=0:oxidized_cut_copper,stdrot=true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user