2011-01-01 01:06:42 +00:00
|
|
|
// $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/>.
|
2011-01-01 18:33:18 +00:00
|
|
|
*/
|
2011-01-01 01:06:42 +00:00
|
|
|
|
2011-01-01 01:40:07 +00:00
|
|
|
package com.sk89q.worldedit;
|
|
|
|
|
2011-01-01 01:06:42 +00:00
|
|
|
import com.sk89q.worldedit.blocks.BaseItemStack;
|
|
|
|
|
|
|
|
/**
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @author sk89q
|
|
|
|
*/
|
|
|
|
public abstract class ServerInterface {
|
|
|
|
/**
|
|
|
|
* Set block type.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract boolean setBlockType(LocalWorld world, Vector pt, int type);
|
|
|
|
|
2011-01-01 01:06:42 +00:00
|
|
|
/**
|
|
|
|
* Get block type.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract int getBlockType(LocalWorld world, Vector pt);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set block data.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param data
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract void setBlockData(LocalWorld world, Vector pt, int data);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get block data.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract int getBlockData(LocalWorld world, Vector pt);
|
|
|
|
|
2011-01-01 01:06:42 +00:00
|
|
|
/**
|
|
|
|
* Set sign text.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param text
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract void setSignText(LocalWorld world, Vector pt, String[] text);
|
|
|
|
|
2011-01-01 01:06:42 +00:00
|
|
|
/**
|
|
|
|
* Get sign text.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract String[] getSignText(LocalWorld world, Vector pt);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the contents of chests. Will return null if the chest does not
|
|
|
|
* really exist or it is the second block for a double chest.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract BaseItemStack[] getChestContents(LocalWorld world, Vector pt);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a chest slot.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param contents
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract boolean setChestContents(LocalWorld world, Vector pt,
|
|
|
|
BaseItemStack[] contents);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear a chest's contents.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract boolean clearChest(LocalWorld world, Vector pt);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if a mob type is valid.
|
|
|
|
*
|
|
|
|
* @param type
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract boolean isValidMobType(String type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set mob spawner mob type.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param mobType
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract void setMobSpawnerType(LocalWorld world, Vector pt,
|
|
|
|
String mobType);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get mob spawner mob type. May return an empty string.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param mobType
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract String getMobSpawnerType(LocalWorld world, Vector pt);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a tree at a location.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract boolean generateTree(EditSession editSession,
|
|
|
|
LocalWorld world, Vector pt);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Drop an item.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @param count
|
|
|
|
* @param times
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract void dropItem(LocalWorld world, Vector pt, int type,
|
|
|
|
int count, int times);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Drop an item.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @param count
|
|
|
|
* @param times
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract void dropItem(LocalWorld world, Vector pt, int type,
|
|
|
|
int count);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Drop an item.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2011-01-01 01:06:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @param count
|
|
|
|
* @param times
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract void dropItem(LocalWorld world, Vector pt, int type);
|
2011-01-01 01:06:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Simulate a block being mined.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract void simulateBlockMine(LocalWorld world, Vector pt);
|
|
|
|
|
2011-01-01 01:40:07 +00:00
|
|
|
/**
|
|
|
|
* Resolves an item name to its ID.
|
|
|
|
*
|
|
|
|
* @param name
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract int resolveItem(String name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Kill mobs in an area.
|
|
|
|
*
|
|
|
|
* @param origin
|
|
|
|
* @param radius
|
|
|
|
* @return
|
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract int killMobs(LocalWorld world, Vector origin, int radius);
|
2011-01-01 01:06:42 +00:00
|
|
|
}
|