diff --git a/src/WorldEdit.java b/src/WorldEdit.java index 91f70bc04..bb532b063 100644 --- a/src/WorldEdit.java +++ b/src/WorldEdit.java @@ -96,4 +96,13 @@ private String getVersion() { return "(unknown)"; } } + + /** + * Returns the listener. + * + * @return + */ + public WorldEditListener getListener() { + return listener; + } } diff --git a/src/WorldEditListener.java b/src/WorldEditListener.java index 11a1bada0..4c5aa5527 100644 --- a/src/WorldEditListener.java +++ b/src/WorldEditListener.java @@ -1371,4 +1371,23 @@ public void deregisterCommands() { etc.getInstance().removeCommand(key); } } + + /** + * Gets the WorldEditLibrary session for a player. Used for the bridge. + * + * @param player + * @return + */ + public WorldEditSession _bridgeSession(Player pl) { + WorldEditPlayer player = new WorldEditPlayer(pl); + + if (sessions.containsKey(player)) { + return sessions.get(player); + } else { + WorldEditSession session = new WorldEditSession(); + session.setBlockChangeLimit(defaultChangeLimit); + sessions.put(player, session); + return session; + } + } } diff --git a/src/com/sk89q/worldedit/WorldEditNotInstalled.java b/src/com/sk89q/worldedit/WorldEditNotInstalled.java new file mode 100644 index 000000000..8da44fdca --- /dev/null +++ b/src/com/sk89q/worldedit/WorldEditNotInstalled.java @@ -0,0 +1,29 @@ +// $Id$ +/* + * WorldEdit + * Copyright (C) 2010 sk89q + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +package com.sk89q.worldedit; + +/** + * Raised when WorldEdit is not installed. + * + * @author Albert + */ +public class WorldEditNotInstalled extends WorldEditException { + +}