mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 03:46:42 +00:00
Removed foundation.* package.
This commit is contained in:
59
src/main/java/com/sk89q/worldedit/world/NbtValued.java
Normal file
59
src/main/java/com/sk89q/worldedit/world/NbtValued.java
Normal file
@ -0,0 +1,59 @@
|
||||
// $Id$
|
||||
/*
|
||||
* This file is a part of WorldEdit.
|
||||
* Copyright (c) sk89q <http://www.sk89q.com>
|
||||
* Copyright (c) the WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* (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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.world;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
|
||||
/**
|
||||
* Indicates an object that contains extra data identified as an NBT structure. This
|
||||
* interface is used when saving and loading objects to a serialized format, but may
|
||||
* be used in other cases.
|
||||
*/
|
||||
public interface NbtValued {
|
||||
|
||||
/**
|
||||
* Returns whether the block contains NBT data. {@link #getNbtData()} must not return
|
||||
* null if this method returns true.
|
||||
*
|
||||
* @return true if there is NBT data
|
||||
*/
|
||||
public boolean hasNbtData();
|
||||
|
||||
/**
|
||||
* Get the object's NBT data (tile entity data). The returned tag, if modified
|
||||
* in any way, should be sent to {@link #setNbtData(CompoundTag)} so that
|
||||
* the instance knows of the changes. Making changes without calling
|
||||
* {@link #setNbtData(CompoundTag)} could have unintended consequences.
|
||||
* </p>
|
||||
* {@link #hasNbtData()} must return true if and only if method does not return null.
|
||||
*
|
||||
* @return compound tag, or null
|
||||
*/
|
||||
CompoundTag getNbtData();
|
||||
|
||||
/**
|
||||
* Set the object's NBT data (tile entity data).
|
||||
*
|
||||
* @param nbtData NBT data, or null if no data
|
||||
* @throws DataException if possibly the data is invalid
|
||||
*/
|
||||
void setNbtData(CompoundTag nbtData) throws DataException;
|
||||
|
||||
}
|
71
src/main/java/com/sk89q/worldedit/world/World.java
Normal file
71
src/main/java/com/sk89q/worldedit/world/World.java
Normal file
@ -0,0 +1,71 @@
|
||||
// $Id$
|
||||
/*
|
||||
* This file is a part of WorldEdit.
|
||||
* Copyright (c) sk89q <http://www.sk89q.com>
|
||||
* Copyright (c) the WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* (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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.world;
|
||||
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.foundation.Block;
|
||||
|
||||
/**
|
||||
* Represents a world instance that can be modified. The world instance could be
|
||||
* loaded in-game or loaded in a stand-alone editor.
|
||||
* </p>
|
||||
* This class is meant to replace {@link LocalWorld} eventually, once this class has been
|
||||
* fleshed out with the required methods and it has been decided that it is time to
|
||||
* start breaking some API compatibility.
|
||||
*/
|
||||
public interface World {
|
||||
|
||||
/**
|
||||
* Change the block at the given location to the given block. The operation may
|
||||
* not tie the given {@link BaseBlock} to the world, so future changes to the
|
||||
* {@link BaseBlock} do not affect the world until this method is called again.
|
||||
* </p>
|
||||
* Implementations may or may not consider the value of the notifyAdjacent
|
||||
* parameter, and implementations may to choose to either apply physics anyway or
|
||||
* to not apply any physics (particularly in a stand-alone implementation).
|
||||
* </p>
|
||||
* The return value of this method indicates whether the change "went through," as
|
||||
* in the block was changed in the world in any way. If the new block is no different
|
||||
* than the block already at the position in the world, 'false' would be returned.
|
||||
* If the position is invalid (out of bounds, for example), then nothing should
|
||||
* occur and 'false' should be returned. If possible, the return value should be
|
||||
* accurate as possible, but implementations may choose to not provide an accurate
|
||||
* value if it is not possible to know.
|
||||
*
|
||||
* @param location location of the block
|
||||
* @param block block to set
|
||||
* @param notifyAdjacent true to to notify adjacent (perform physics)
|
||||
* @return true if the block was successfully set (return value may not be accurate)
|
||||
*/
|
||||
boolean setBlock(Vector location, BaseBlock block, boolean notifyAdjacent);
|
||||
|
||||
/**
|
||||
* Get a copy of the block at the given location. May return null if the location
|
||||
* given is out of bounds. The returned block must not be tied to any real block
|
||||
* in the world, so changes to the returned {@link Block} have no effect until
|
||||
* {@link #setBlock(Vector, BaseBlock, boolean)} is called.
|
||||
*
|
||||
* @param location location of the block
|
||||
* @return the block, or null if the block does not exist
|
||||
*/
|
||||
BaseBlock getBlock(Vector location);
|
||||
|
||||
}
|
Reference in New Issue
Block a user