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){
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 = {};
function initLookup(){
var Facing = Packages.net.minecraft.util.EnumFacing,

View file

@ -1,6 +1,18 @@
var textcolors = require('textcolors');
var Canary = Packages.net.canarymod.Canary;
var sb = Canary.scoreboards().getScoreboard();
'use strict';
/*global Packages, require, server, exports*/
/*
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 ){
server.executeVanillaCommand(server, command);
}
@ -20,7 +32,10 @@ function createScoreboard( objectiveName, displayName ){
function addTeamToScoreboard( teamName, color){
execCommand('scoreboard teams add ' + 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);
}
function removeScoreboard( name ){

View file

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

View file

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

View file

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