public class DimensionalBlocks
extends org.bukkit.plugin.java.JavaPlugin
| Constructor and Description |
|---|
DimensionalBlocks() |
| Modifier and Type | Method and Description |
|---|---|
static void |
applyPhysics(DBlock block,
org.bukkit.Location location)
Updates the physics for the given block at the given location, if it exists.
|
static void |
createBlockStateDumpFile(java.io.File dump)
Create a dump file with all the current blockstates and their assigned ids.
|
static DBlockData |
getDBlockDataAt(org.bukkit.Location location)
Get the
DBlockData of a DBlock at the specified location. |
static DBlockData |
getDBlockDataFrom(org.bukkit.block.Block block)
Get the
DBlockData of a DBlock from a given block. |
static DBlockData |
getDBlockDataOf(DTileEntity entity)
Get the
DBlockData associated with the given tile entity. |
static DBlockData |
getDefaultBlockDataFor(DBlock block)
Get a
DBlockData representing the default state of the given DBlock. |
static DTileEntity |
getDTileEntityAt(org.bukkit.Location location)
Fetch a
DTileEntity from a given location, if it exists. |
static org.bukkit.Location |
getLocationOf(DTileEntity entity)
Get the location associated with the given tile entity.
|
boolean |
onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command command,
java.lang.String label,
java.lang.String[] args) |
void |
onDisable() |
void |
onEnable() |
static void |
register(DBlock block)
Register a custom
DBlock. |
static void |
register(DBlock block,
java.util.function.Supplier<DTileEntity> tileEntity,
java.lang.String id)
Register a custom
DBlock and associate it with a given DTileEntity. |
static DBlockData |
setDBlockAt(DBlock block,
org.bukkit.Location location)
Set a
DBlock with the default DBlockData at the given location and update with physics. |
static DBlockData |
setDBlockAt(DBlock block,
org.bukkit.Location location,
boolean doPhysics)
Set a
DBlock with the default DBlockData at the given location. |
static void |
setDBlockDataAt(DBlockData data,
org.bukkit.Location location)
Set a
DBlockData to a current location and update with physics. |
static void |
setDBlockDataAt(DBlockData data,
org.bukkit.Location location,
boolean doPhysics)
Set the block at a current location to the provided
DBlockData. |
static void |
tickLocation(org.bukkit.Location location,
DBlock block,
int delay)
Call the
DBlock.tick(DBlockData, Location, java.util.Random) method after a certain amount of ticks. |
getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, isEnabled, isNaggable, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setNaggable, toStringpublic void onEnable()
onEnable in interface org.bukkit.plugin.PluginonEnable in class org.bukkit.plugin.java.JavaPluginpublic void onDisable()
onDisable in interface org.bukkit.plugin.PluginonDisable in class org.bukkit.plugin.java.JavaPluginpublic boolean onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command command,
java.lang.String label,
java.lang.String[] args)
onCommand in interface org.bukkit.command.CommandExecutoronCommand in class org.bukkit.plugin.java.JavaPluginpublic static void register(DBlock block)
DBlock. This should only be called once for each block.block - A custom DBlock.public static void register(DBlock block, java.util.function.Supplier<DTileEntity> tileEntity, java.lang.String id)
DBlock and associate it with a given DTileEntity. This
can be called with the same DTileEntity and id more than once, if you want
to assign it to mulitple blocks.block - The DBlock to register and associate with.tileEntity - A supplier that provides a new instance of the DTileEntity when requiredid - A unique id that will be used to identify the DTileEntity.public static DBlockData getDBlockDataAt(org.bukkit.Location location)
DBlockData of a DBlock at the specified location.location - The location to fetch.DBlockData instance, or null if it isn't a custom DBlock.public static DBlockData getDBlockDataFrom(org.bukkit.block.Block block)
DBlockData of a DBlock from a given block.block - The Bukkit block to convert.DBlockData instance, or null if the block isn't a DBlock.public static DBlockData setDBlockAt(DBlock block, org.bukkit.Location location)
DBlock with the default DBlockData at the given location and update with physics.block - The DBlock must be registered.location - The location to set.DBlockData of the DBlock created at the new location.public static DBlockData setDBlockAt(DBlock block, org.bukkit.Location location, boolean doPhysics)
DBlock with the default DBlockData at the given location.block - The DBlock must be registered.location - The location to set.doPhysics - Whether or not nearby blocks should be updated.DBlockData of the DBlock created at the new location.public static void setDBlockDataAt(DBlockData data, org.bukkit.Location location)
DBlockData to a current location and update with physics.data - The DBlock of the data must be registered.location - The location to set.public static void setDBlockDataAt(DBlockData data, org.bukkit.Location location, boolean doPhysics)
DBlockData.data - The DBlock of the DBlockData must be registered.location - The location to set.doPhysics - Whether or not nearby blocks should be updated.public static DBlockData getDefaultBlockDataFor(DBlock block)
DBlockData representing the default state of the given DBlock.block - The DBlock to fetch the default state for. It must be registered.public static DTileEntity getDTileEntityAt(org.bukkit.Location location)
DTileEntity from a given location, if it exists.location - The location to fetch a DTileEntityDTileEntity if it exists, or null.public static org.bukkit.Location getLocationOf(DTileEntity entity)
entity - public static DBlockData getDBlockDataOf(DTileEntity entity)
DBlockData associated with the given tile entity.entity - public static void tickLocation(org.bukkit.Location location,
DBlock block,
int delay)
DBlock.tick(DBlockData, Location, java.util.Random) method after a certain amount of ticks.location - The location to tick.block - The DBlock that requires ticking. It must be registered.delay - Delay in amount of ticks.public static void applyPhysics(DBlock block, org.bukkit.Location location)
block - The DBlock to update. It must be registered.location - The location to updatepublic static void createBlockStateDumpFile(java.io.File dump)
dump - The file to dump in. It will be cleared and overwritten if it already exists.