[BLIND] Implement MC 1.5 snow levels with an extra block-flag.

This commit is contained in:
asofold 2013-03-13 20:27:55 +01:00
parent a2b1412ab1
commit a9564ea8fd
2 changed files with 20 additions and 0 deletions

View File

@ -28,6 +28,10 @@ public class BlocksMC1_5 implements BlockPropertiesSetup {
// TODO: This is guessing !
/////////////////////
// New blocks
////////////////////
// 146 Trapped Chest
setFlagsAs(146, Material.CHEST);
BlockProperties.setBlockProps(146, BlockProperties.getBlockProps(Material.CHEST.getId()));
@ -61,6 +65,13 @@ public class BlocksMC1_5 implements BlockPropertiesSetup {
// 157 Activator Rail
setFlagsAs(157, Material.DETECTOR_RAIL);
/////////////////////
// Changed blocks
////////////////////
// 78 Snow
addFlags(78, BlockProperties.F_HEIGHT_8_INC);
}
/**

View File

@ -1428,6 +1428,10 @@ public class BlockProperties {
if (data < 3) return 0;
else return 0.5;
}
else if ((flags & F_HEIGHT_8_INC) != 0){
final int data = (access.getData(x, y, z) & 0xF) % 8;
return 0.125 * (double) data;
}
// Height 100 is ignored (!).
else if ((flags & F_HEIGHT150) != 0){
return 1.5;
@ -1781,6 +1785,11 @@ public class BlockProperties {
// bmaxY = (double) (1 + data) / 8.0;
bmaxY = data < 3 ? 0 : 0.5;
}
else if ((flags & F_HEIGHT_8_INC) != 0){
bminY = 0;
final int data = (access.getData(x, y, z) & 0xF) % 8;
bmaxY = 0.125 * data;
}
else if ((flags & F_HEIGHT150) != 0){
bminY = 0;
bmaxY = 1.5;