Add support for 1.9 blocks and textures

This commit is contained in:
Mike Primm 2011-09-22 22:55:48 -05:00
parent ad6f6f4316
commit 085e06eb43
5 changed files with 120 additions and 27 deletions

View file

@ -83,6 +83,8 @@ public class IsoHDPerspective implements HDPerspective {
private static final int IRONFENCE_BLKTYPEID = 101;
private static final int GLASSPANE_BLKTYPEID = 102;
private static final int FENCEGATE_BLKTYPEID = 107;
private static final int NETHERFENCE_BLKTYPEID = 113;
private enum ChestData {
SINGLE_WEST, SINGLE_SOUTH, SINGLE_EAST, SINGLE_NORTH, LEFT_WEST, LEFT_SOUTH, LEFT_EAST, LEFT_NORTH, RIGHT_WEST, RIGHT_SOUTH, RIGHT_EAST, RIGHT_NORTH
};
@ -338,27 +340,27 @@ public class IsoHDPerspective implements HDPerspective {
nonairhit = false;
skiptoair = isnether;
}
private int generateFenceBlockData(MapIterator mapiter) {
private int generateFenceBlockData(MapIterator mapiter, int blkid) {
int blockdata = 0;
int id;
/* Check north */
id = mapiter.getBlockTypeIDAt(BlockStep.X_MINUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 1;
}
/* Look east */
id = mapiter.getBlockTypeIDAt(BlockStep.Z_MINUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 2;
}
/* Look south */
id = mapiter.getBlockTypeIDAt(BlockStep.X_PLUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 4;
}
/* Look west */
id = mapiter.getBlockTypeIDAt(BlockStep.Z_PLUS);
if((id == FENCE_BLKTYPEID) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
blockdata |= 8;
}
return blockdata;
@ -537,7 +539,8 @@ public class IsoHDPerspective implements HDPerspective {
blockdata = mapiter.getBlockData();
switch(blocktypeid) {
case FENCE_BLKTYPEID: /* Special case for fence - need to fake data so we can render properly */
blockrenderdata = generateFenceBlockData(mapiter);
case NETHERFENCE_BLKTYPEID:
blockrenderdata = generateFenceBlockData(mapiter, blocktypeid);
break;
case CHEST_BLKTYPEID: /* Special case for chest - need to fake data so we can render */
blockrenderdata = generateChestBlockData(mapiter);

View file

@ -1,6 +1,9 @@
package org.dynmap.utils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* scalable flags primitive - used for keeping track of potentially huge number of tiles
*
@ -17,6 +20,37 @@ public class TileFlags {
public TileFlags() {
}
public List<String> save() {
ArrayList<String> v = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for(Map.Entry<Long, long[]> ent : chunkmap.entrySet()) {
sb.append(String.format("%lx", ent.getKey().longValue()));
long[] val = ent.getValue();
for(long vv : val) {
sb.append(String.format(":%lx", vv));
}
v.add(sb.toString());
sb.setLength(0);
}
return v;
}
public void load(List<String> vals) {
clear();
for(String v : vals) {
String[] tok = v.split(":");
long[] row = new long[64];
try {
long rowaddr = Long.parseLong(tok[0], 16);
for(int i = 0; (i < 64) && (i < (tok.length-1)); i++) {
row[i] = Long.parseLong(tok[i+1], 16);
}
chunkmap.put(rowaddr, row);
} catch (NumberFormatException nfx) {
}
}
}
public boolean getFlag(int x, int y) {
long k = (((long)(x >> 6)) << 32) | (0xFFFFFFFFL & (long)(y >> 6));
long[] row;

View file

@ -2,7 +2,8 @@
# Cobblestone Stair - up south
# Brick Stair - up south
# Stone Brick Stair - up south
block:id=53,id=67,id=108,id=109,data=0,scale=2
# Nether brick stair - up south
block:id=53,id=67,id=108,id=109,id=114,data=0,scale=2
layer:0
**
**
@ -13,19 +14,22 @@ layer:1
# Cobblestone Stair - up north
# Brick Stair - up north
# Stone Brick Stair - up north
block:id=53,id=67,id=108,id=109,data=1,scale=2
# Nether brick stair - up north
block:id=53,id=67,id=108,id=109,id=114,data=1,scale=2
rotate:id=53,data=0,rot=180
# Wood Stair - up west
# Cobblestone Stair - up west
# Brick Stair - up west
# Stone Brick Stair - up west
block:id=53,id=67,id=108,id=109,data=2,scale=2
# Nether brick stair - up west
block:id=53,id=67,id=108,id=109,id=114,data=2,scale=2
rotate:id=53,data=0,rot=90
# Wood Stair - up east
# Cobblestone Stair - up east
# Brick Stair - up east
# Stone Brick Stair - up east
block:id=53,id=67,id=108,id=109,data=3,scale=2
# Nether brick stair - up east
block:id=53,id=67,id=108,id=109,id=114,data=3,scale=2
rotate:id=53,data=0,rot=270
# Slab (stone, sandstone, wood, cobblestone)
block:id=44,data=*,scale=4
@ -171,7 +175,8 @@ block:id=50,id=75,id=76,data=4,scale=16
rotate:id=50,data=1,rot=270
# Fence - (data is faked: 1=north,2=east,4=south,8=west)
# Fence - no neighbors
block:id=85,data=0,scale=16
# Nether Brick Fence
block:id=85,id=113,data=0,scale=16
layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
----------------
----------------
@ -190,7 +195,8 @@ layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
----------------
----------------
# Fence - just north neighbor
block:id=85,data=1,scale=16
# Nether Brick Fence
block:id=85,id=113,data=1,scale=16
layer:0,1,2,3,4,5,9,10,11,15
----------------
----------------
@ -226,16 +232,20 @@ layer:6,7,8,12,13,14
----------------
----------------
# Fence - just east neighbor
block:id=85,data=2,scale=16
# Nether Brick Fence
block:id=85,id=113,data=2,scale=16
rotate:id=85,data=1,rot=90
# Fence - just south neighbor
block:id=85,data=4,scale=16
# Nether Brick Fence
block:id=85,id=113,data=4,scale=16
rotate:id=85,data=1,rot=180
# Fence - just south neighbor
block:id=85,data=8,scale=16
# Nether Brick Fence
block:id=85,id=113,data=8,scale=16
rotate:id=85,data=1,rot=270
# Fence - north and east neighbor
block:id=85,data=3,scale=16
# Nether Brick Fence
block:id=85,id=113,data=3,scale=16
layer:0,1,2,3,4,5,9,10,11,15
----------------
----------------
@ -271,16 +281,20 @@ layer:6,7,8,12,13,14
----------------
----------------
# Fence - east and south neighbor
block:id=85,data=6,scale=16
# Nether Brick Fence
block:id=85,id=113,data=6,scale=16
rotate:id=85,data=3,rot=90
# Fence - south and west neighbor
block:id=85,data=12,scale=16
# Nether Brick Fence
block:id=85,id=113,data=12,scale=16
rotate:id=85,data=3,rot=180
# Fence - west and north neighbor
block:id=85,data=9,scale=16
# Nether Brick Fence
block:id=85,id=113,data=9,scale=16
rotate:id=85,data=3,rot=270
# Fence - north and south neighbor
block:id=85,data=5,scale=16
# Nether Brick Fence
block:id=85,id=113,data=5,scale=16
layer:0,1,2,3,4,5,9,10,11,15
----------------
----------------
@ -316,10 +330,12 @@ layer:6,7,8,12,13,14
-------**-------
-------**-------
# Fence - east and west neighbor
block:id=85,data=10,scale=16
# Nether Brick Fence
block:id=85,id=113,data=10,scale=16
rotate:id=85,data=5,rot=90
# Fence - north, east and south neighbor
block:id=85,data=7,scale=16
# Nether Brick Fence
block:id=85,id=113,data=7,scale=16
layer:0,1,2,3,4,5,9,10,11,15
----------------
----------------
@ -355,16 +371,20 @@ layer:6,7,8,12,13,14
-------**-------
-------**-------
# Fence - east, south and west neighbor
block:id=85,data=14,scale=16
# Nether Brick Fence
block:id=85,id=113,data=14,scale=16
rotate:id=85,data=7,rot=90
# Fence - south, west and north neighbor
block:id=85,data=13,scale=16
# Nether Brick Fence
block:id=85,id=113,data=13,scale=16
rotate:id=85,data=7,rot=180
# Fence - west, north and east neighbor
block:id=85,data=11,scale=16
# Nether Brick Fence
block:id=85,id=113,data=11,scale=16
rotate:id=85,data=7,rot=270
# Fence - north, south, east, west neightbors
block:id=85,data=15,scale=16
# Nether Brick Fence
block:id=85,id=113,data=15,scale=16
layer:0,1,2,3,4,5,9,10,11,15
----------------
----------------
@ -2231,7 +2251,8 @@ rotate:id=102,data=6,rot=180
block:id=102,id=101,data=3,scale=16
rotate:id=102,data=6,rot=270
# Web
block:id=30,data=*,scale=16
# Nether Wart
block:id=30,id=115,data=*,scale=16
layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
*--------------*
-*------------*-
@ -2472,3 +2493,22 @@ layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
----------------
----------------
----------------
# Lily pad
block:id=111,scale=16
layer:0
****************
****************
****************
****************
****************
****************
****************
****************
****************
****************
****************
****************
****************
****************
****************
****************

View file

@ -527,3 +527,19 @@ block:id=107,allsides=4,topbottom=4004,transparency=TRANSPARENT
block:id=108,allfaces=7,transparency=SEMITRANSPARENT
# Stone brick stair
block:id=109,allfaces=54,transparency=SEMITRANSPARENT
# Mycelium
block:id=110,top=78,allsides=77,bottom=2
# Lilly pad
block:id=111,topbottom=1076,transparency=TRANSPARENT
# Nether brick
block:id=112,allfaces=224
# Nether brick fence
block:id=113,allfaces=224,transparency=TRANSPARENT
# Nether brick stairs
block:id=114,allfaces=224,transparency=SEMITRANSPARENT
# Nether Wart (small)
block:id=115,data=0,allsides=226,transparency=TRANSPARENT
# Nether Wart (medium)
block:id=115,data=1,data=2,allsides=227,transparency=TRANSPARENT
# Nether Wart (large)
block:id=115,data=3,data=4,data=5,data=6,data=7,allsides=228,transparency=TRANSPARENT

BIN
texturepacks/standard/terrain.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Before After
Before After