Tweaks for Spigot 1.8

This commit is contained in:
walterhiggins 2015-01-03 12:32:57 +00:00
parent dad20186d7
commit 62821db815
5 changed files with 37 additions and 13 deletions

View file

@ -6,7 +6,12 @@ var blocks = require('blocks'),
if (__plugin.canary){ if (__plugin.canary){
bountiful = parseFloat(server.canaryModVersion) > 1.7; bountiful = parseFloat(server.canaryModVersion) > 1.7;
} }
if (__plugin.bukkit){
/*
wph 20150103 - metadata still applies for Craftbukkit 1.8
bountiful = parseFloat(server.bukkitVersion) > 1.7;
*/
}
var lookup = {}; var lookup = {};
function initLookup(){ function initLookup(){
var Facing = Packages.net.minecraft.util.EnumFacing, var Facing = Packages.net.minecraft.util.EnumFacing,

View file

@ -1,6 +1,18 @@
var textcolors = require('textcolors'); 'use strict';
var Canary = Packages.net.canarymod.Canary; /*global Packages, require, server, exports*/
var sb = Canary.scoreboards().getScoreboard();
/*
wph 20150103 - temporarily commenting out - textcolors was removed.
var textcolors = require('textcolors');
*/
var sb;
if (__plugin.canary){
var Canary = Packages.net.canarymod.Canary;
sb = Canary.scoreboards().getScoreboard();
} else {
console.warn('Scoreboard not yet supported in CraftBukkit');
return;
}
function execCommand( command ){ function execCommand( command ){
server.executeVanillaCommand(server, command); server.executeVanillaCommand(server, command);
} }
@ -20,7 +32,10 @@ function createScoreboard( objectiveName, displayName ){
function addTeamToScoreboard( teamName, color){ function addTeamToScoreboard( teamName, color){
execCommand('scoreboard teams add ' + teamName); execCommand('scoreboard teams add ' + teamName);
var team = getTeamByName( teamName ); var team = getTeamByName( teamName );
team.prefix = textcolors.colorize(color, ''); /*
wph 20150103 - temporarily commenting out - textcolors was removed.
team.prefix = textcolors.colorize(color, '');
*/
//execCommand('scoreboard teams option ' + teamName + ' color ' + color); //execCommand('scoreboard teams option ' + teamName + ' color ' + color);
} }
function removeScoreboard( name ){ function removeScoreboard( name ){

View file

@ -1,5 +1,5 @@
'use strict'; 'use strict';
/*global require, Packages*/ /*global require, Packages, __plugin*/
var Drone = require('./drone').Drone, var Drone = require('./drone').Drone,
blocks = require('blocks'); blocks = require('blocks');
/************************************************************************ /************************************************************************
@ -44,8 +44,10 @@ function bed(){
.set('facing',this.dir) .set('facing',this.dir)
.set('part', BedHalf.HEAD); .set('part', BedHalf.HEAD);
} }
foot.update(); if (__plugin.canary){
head.update(); foot.update();
head.update();
}
}); });
} }

View file

@ -49,7 +49,7 @@ Create double iron doors
var Drone = require('./drone').Drone, var Drone = require('./drone').Drone,
blocks = require('blocks'); blocks = require('blocks');
/*global require, Packages*/ /*global require, Packages, __plugin*/
function door( doorMaterial, hinge) { function door( doorMaterial, hinge) {
if ( typeof doorMaterial == 'undefined' ) { if ( typeof doorMaterial == 'undefined' ) {
doorMaterial = blocks.door_wood; // wood doorMaterial = blocks.door_wood; // wood
@ -71,8 +71,10 @@ function door( doorMaterial, hinge) {
.set('hinge', hinge == 'left' ? HingePosition.LEFT: HingePosition.RIGHT) .set('hinge', hinge == 'left' ? HingePosition.LEFT: HingePosition.RIGHT)
.set('half', DoorHalf.UPPER); .set('half', DoorHalf.UPPER);
} }
lower.update(); if (__plugin.canary){
upper.update(); lower.update();
upper.update();
}
}); });
} }
Drone.extend( door ); Drone.extend( door );

View file

@ -41,8 +41,8 @@ your own mini-game...
***/ ***/
if (__plugin.canary){ if (__plugin.canary || __plugin.bukkit){
console.warn('cow-clicker minigame is not yet supported in CanaryMod'); console.warn('cow-clicker minigame is not yet supported in CanaryMod and Craftbukkit');
return; return;
} }
var store = {}, var store = {},