mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-21 04:49:51 +08:00
Added class to access WorldEdit from other plugins.
This commit is contained in:
parent
138787c1e2
commit
97a49d4492
@ -96,4 +96,13 @@ private String getVersion() {
|
|||||||
return "(unknown)";
|
return "(unknown)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the listener.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public WorldEditListener getListener() {
|
||||||
|
return listener;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1371,4 +1371,23 @@ public void deregisterCommands() {
|
|||||||
etc.getInstance().removeCommand(key);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
29
src/com/sk89q/worldedit/WorldEditNotInstalled.java
Normal file
29
src/com/sk89q/worldedit/WorldEditNotInstalled.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// $Id$
|
||||||
|
/*
|
||||||
|
* WorldEdit
|
||||||
|
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sk89q.worldedit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raised when WorldEdit is not installed.
|
||||||
|
*
|
||||||
|
* @author Albert
|
||||||
|
*/
|
||||||
|
public class WorldEditNotInstalled extends WorldEditException {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user