Fix issue #269 for both spigot and canary - make sure new stairs don't cause same issue again.
This commit is contained in:
parent
0dbff00703
commit
bff23932a7
3 changed files with 36 additions and 44 deletions
|
@ -98,18 +98,10 @@ function applyFacing( block, metadata ){
|
|||
function face(direction){
|
||||
property(block).set('facing', lookup.facing[direction]);
|
||||
}
|
||||
if ( blocks.isStair(block.typeId) ){
|
||||
face( ['east','west','south','north'] [metadata] );
|
||||
} else {
|
||||
switch( block.typeId ){
|
||||
case blocks.stairs.oak:
|
||||
case blocks.stairs.cobblestone:
|
||||
case blocks.stairs.brick:
|
||||
case blocks.stairs.stone:
|
||||
case blocks.stairs.nether:
|
||||
case blocks.stairs.sandstone:
|
||||
case blocks.stairs.spruce:
|
||||
case blocks.stairs.jungle:
|
||||
case blocks.stairs.quartz:
|
||||
face( ['east','west','south','north'][metadata] );
|
||||
break;
|
||||
case blocks.sign:
|
||||
case blocks.ladder:
|
||||
// bug: furnace, chest, dispenser don't always use the right metadata
|
||||
|
@ -124,6 +116,7 @@ function applyFacing( block, metadata ){
|
|||
face( ['up'/* default */,'east','west','south','north','up'][metadata] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
function applyColors( block, metadata ){
|
||||
switch( block.typeId){
|
||||
|
|
|
@ -325,5 +325,12 @@ blocks.rainbow = [
|
|||
blocks.stained_glass.blue,
|
||||
blocks.stained_glass.purple
|
||||
];
|
||||
|
||||
blocks.isStair = function(id){
|
||||
var p;
|
||||
for (p in this.stairs){
|
||||
if (this.stairs[p] == id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
module.exports = blocks;
|
||||
|
|
|
@ -773,19 +773,10 @@ function getBlockIdAndMeta( b ) {
|
|||
if (typeof b === 'number' || /^[0-9]+$/.test(b)) {
|
||||
// wph 20130414 - use sensible defaults for certain blocks e.g. stairs
|
||||
// should face the drone.
|
||||
switch (b) {
|
||||
case blocks.stairs.birch:
|
||||
case blocks.stairs.brick:
|
||||
case blocks.stairs.cobblestone:
|
||||
case blocks.stairs.jungle:
|
||||
case blocks.stairs.nether:
|
||||
case blocks.stairs.oak:
|
||||
case blocks.stairs.quartz:
|
||||
case blocks.stairs.sandstone:
|
||||
case blocks.stairs.spruce:
|
||||
case blocks.stairs.stone:
|
||||
if ( blocks.isStair(b) ) {
|
||||
defaultMeta = Drone.PLAYER_STAIRS_FACING[ this.dir % 4 ];
|
||||
break;
|
||||
} else {
|
||||
switch (b) {
|
||||
case blocks.sign:
|
||||
case blocks.ladder:
|
||||
// bug: furnace, chest, dispenser don't always use the right metadata
|
||||
|
@ -800,6 +791,7 @@ function getBlockIdAndMeta( b ) {
|
|||
defaultMeta = ( 12 + ( ( this.dir + 2 ) * 4 ) ) % 16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return [ b, defaultMeta ];
|
||||
}
|
||||
if ( typeof b === 'string' ) {
|
||||
|
|
Reference in a new issue