From 62821db8157b6528102eec8fd0b6e922dce9c359 Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Sat, 3 Jan 2015 12:32:57 +0000 Subject: [PATCH] Tweaks for Spigot 1.8 --- src/main/js/modules/blockhelper.js | 7 +++++- src/main/js/modules/minigames/scoreboard.js | 23 ++++++++++++++++---- src/main/js/plugins/drone/bed.js | 8 ++++--- src/main/js/plugins/drone/doors.js | 8 ++++--- src/main/js/plugins/minigames/cow-clicker.js | 4 ++-- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/main/js/modules/blockhelper.js b/src/main/js/modules/blockhelper.js index ca6a5d9..72296c6 100644 --- a/src/main/js/modules/blockhelper.js +++ b/src/main/js/modules/blockhelper.js @@ -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, diff --git a/src/main/js/modules/minigames/scoreboard.js b/src/main/js/modules/minigames/scoreboard.js index 493099d..988718d 100644 --- a/src/main/js/modules/minigames/scoreboard.js +++ b/src/main/js/modules/minigames/scoreboard.js @@ -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 ){ diff --git a/src/main/js/plugins/drone/bed.js b/src/main/js/plugins/drone/bed.js index 062fbed..86c1303 100644 --- a/src/main/js/plugins/drone/bed.js +++ b/src/main/js/plugins/drone/bed.js @@ -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(); + } }); } diff --git a/src/main/js/plugins/drone/doors.js b/src/main/js/plugins/drone/doors.js index ef1c51d..31b7049 100644 --- a/src/main/js/plugins/drone/doors.js +++ b/src/main/js/plugins/drone/doors.js @@ -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 ); diff --git a/src/main/js/plugins/minigames/cow-clicker.js b/src/main/js/plugins/minigames/cow-clicker.js index 2b690a2..9b6836e 100644 --- a/src/main/js/plugins/minigames/cow-clicker.js +++ b/src/main/js/plugins/minigames/cow-clicker.js @@ -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 = {},