public class Node
extends java.lang.Object
Constructor and Description |
---|
Node(SpellScript p,
org.bukkit.entity.Player sender,
ChatWrapper chatWrapper,
java.lang.String command,
java.lang.String[] args,
org.bukkit.Location loc) |
Modifier and Type | Method and Description |
---|---|
void |
addPotionEffect(LivingEntityWrapper live,
org.bukkit.potion.PotionEffect effect)
Adds a potion effect to the living entity.
|
void |
announce(PlayerWrapper player,
java.lang.String message)
Sends a message to the specified player.
|
void |
breakBlock()
Breaks the block the node is currently occupying.
|
void |
burn()
Sets the current block the node resides in on fire if the block is air.
|
org.bukkit.potion.PotionEffect |
createPotionEffect(java.lang.String potionEffectType,
int duration,
int amplifier)
Creates a potion effect.
|
ItemWrapper |
dropItem(int slot,
int amount)
Drops the item in the current slot and returns it's ItemWrapper.
|
boolean |
equals(java.lang.Object object) |
java.lang.String[] |
getArgs()
Gets the node's arguments.
|
PlayerWrapper |
getCaster()
Gets the node's caster.
|
ChatWrapper |
getChatWrapper()
Gets the ChatWrapper that represents the most recent player chat in that world
|
java.lang.String |
getCommand()
Gets the node's command.
|
org.bukkit.util.Vector |
getDirection()
Gets the node's direction
|
ItemStackWrapper |
getItemInInv(int slot)
Gets the ItemStackWrapper in the specified slot of the node's inventory.
|
double[] |
getLocation()
Gets the node's location
|
java.util.Map<java.lang.String,java.lang.Object> |
getMap()
Gets the node's map for storing information visible to other nodes
|
java.util.List<EntityWrapper> |
getNearbyEntities(double distance)
Gets a list of nearby entities within a radius
|
java.util.List<NodeWrapper> |
getNearbyNodes(double distance)
Gets a list of nearby nodes within a radius
|
double |
getPower()
Gets the power in the node
|
java.util.UUID |
getUid()
Gets the node's uid.
|
void |
givePower(LivingEntityWrapper live,
double amount)
Gives power to a living entity in the form of health.
|
void |
givePower(NodeWrapper node,
double amount)
Gives power to a node.
|
org.bukkit.Material |
inspectBlock()
Gets the material the block the node resides in is made of.
|
boolean |
isAlive()
Gets whether or not the node is still alive
|
void |
moveForward()
Moves the node forward on it's set direction
|
void |
placeBlock(int slot)
Places the block in the current slot in the location the node resides.
|
void |
selfDestruct()
Creates an explosion at the location of the node which has a power of (remainingPower/1000)
|
void |
sendBlockChange(PlayerWrapper player,
double[] location,
java.lang.String type,
byte data)
Sends a block change to the player.
|
void |
setDirection(org.bukkit.util.Vector direction)
Sets the node's direction
|
void |
setEyeDirection(LivingEntityWrapper live,
org.bukkit.util.Vector vec)
Sets the living entity's facing direction.
|
void |
setFallDistance(EntityWrapper entity,
float distance)
Sets the fall distance of the entity.
|
void |
setFireTicks(EntityWrapper entity,
int ticks)
Sets the fire ticks of the entity.
|
void |
setFoodLevel(PlayerWrapper live,
int level)
Sets the food level of the specified player.
|
void |
setItemMeta(int slot,
org.bukkit.inventory.meta.ItemMeta meta)
Sets the item meta of an item in the inventory.
|
void |
setItemMeta(ItemWrapper item,
org.bukkit.inventory.meta.ItemMeta meta)
Sets the item meta of an Item entity
|
void |
setPassenger(EntityWrapper passenger,
EntityWrapper vehicle)
Sets the vehicle entity's passenger.
|
void |
setPickupDelay(ItemWrapper item,
int delay)
Sets the pickup delay of an ItemWrapper.
|
void |
setRemainingAir(LivingEntityWrapper live,
int air)
Sets the living entity's remaining air.
|
void |
setVelocity(EntityWrapper entity,
org.bukkit.util.Vector vector)
Sets the velocity of the entity.
|
void |
sleep(double seconds)
Makes the node sleep for the specified number of seconds
|
void |
suicide()
Destroys the node
|
void |
takeItem(ItemWrapper item)
Incorporates the selected ItemWrapper into the node's inventory.
|
void |
takePower(LivingEntityWrapper live,
double amount)
Takes power as health from a living entity, giving it to the node.
|
void |
takePower(NodeWrapper node,
double amount)
Takes power from a node, giving it to this node.
|
void |
teleport(EntityWrapper entity,
double[] location)
Teleports the entity to the specified location.
|
public Node(SpellScript p, org.bukkit.entity.Player sender, ChatWrapper chatWrapper, java.lang.String command, java.lang.String[] args, org.bukkit.Location loc)
public ChatWrapper getChatWrapper()
public void suicide()
public void sleep(double seconds)
seconds
- - Seconds to sleeppublic void moveForward()
public void setDirection(org.bukkit.util.Vector direction)
direction
- - Vectorpublic org.bukkit.util.Vector getDirection()
public double[] getLocation()
public void teleport(EntityWrapper entity, double[] location)
entity
- - Entity to teleportlocation
- - Location to teleport topublic double getPower()
public java.util.Map<java.lang.String,java.lang.Object> getMap()
public void takePower(LivingEntityWrapper live, double amount)
live
- - Living entityamount
- - less than or equal to 1000public void takePower(NodeWrapper node, double amount)
node
- - Targetamount
- - Less than or equal to 1000public void givePower(LivingEntityWrapper live, double amount)
live
- - LivingEntityamount
- - Less than or equal to 1000public void givePower(NodeWrapper node, double amount)
node
- - Receiving nodeamount
- - Less than or equal to 1000public void setVelocity(EntityWrapper entity, org.bukkit.util.Vector vector)
entity
- - Entity to set the velocity ofvector
- - Vector for velocitypublic java.util.List<EntityWrapper> getNearbyEntities(double distance)
distance
- - Radius to check for entities inpublic java.util.List<NodeWrapper> getNearbyNodes(double distance)
distance
- - Radius to check for nodes inpublic void breakBlock()
public ItemStackWrapper getItemInInv(int slot)
slot
- - Specified slotpublic void placeBlock(int slot)
slot
- - Slot numberpublic void takeItem(ItemWrapper item)
item
- - Selected ItemWrapperpublic ItemWrapper dropItem(int slot, int amount)
slot
- - Specified slot of the node's inventoryamount
- - Number of items to droppublic PlayerWrapper getCaster()
public java.lang.String getCommand()
public java.lang.String[] getArgs()
public void setPassenger(EntityWrapper passenger, EntityWrapper vehicle)
passenger
- - EntityWrappervehicle
- - EntityWrapperpublic void setFireTicks(EntityWrapper entity, int ticks)
entity
- - EntityWrapperticks
- - ticks the entity will be on firepublic void setFallDistance(EntityWrapper entity, float distance)
entity
- - EntityWrapperdistance
- - fall distancepublic void announce(PlayerWrapper player, java.lang.String message)
player
- - PlayerWrappermessage
- - Stringpublic void addPotionEffect(LivingEntityWrapper live, org.bukkit.potion.PotionEffect effect)
live
- - LivingEntityWrappereffect
- - PotionEffectpublic org.bukkit.potion.PotionEffect createPotionEffect(java.lang.String potionEffectType, int duration, int amplifier)
potionEffectType
- - String name of potion effect typeduration
- - Duration in ticksamplifier
- - Amplifier. The base effect is 0public void setRemainingAir(LivingEntityWrapper live, int air)
live
- - LivingEntityWrapperair
- - remaining air in tickspublic void setFoodLevel(PlayerWrapper live, int level)
live
- - PlayerWrapperlevel
- - Food levelpublic void sendBlockChange(PlayerWrapper player, double[] location, java.lang.String type, byte data)
player
- - PlayerWrapperlocation
- - Location of block change as an array of 3 doublestype
- - Material of block change as a stringdata
- - Data as bytepublic void setItemMeta(int slot, org.bukkit.inventory.meta.ItemMeta meta)
slot
- - Slot numbermeta
- - ItemMetapublic void setItemMeta(ItemWrapper item, org.bukkit.inventory.meta.ItemMeta meta)
item
- - ItemWrappermeta
- - ItemMetapublic void setPickupDelay(ItemWrapper item, int delay)
item
- - ItemWrapperdelay
- - delay in tickspublic void burn()
public org.bukkit.Material inspectBlock()
public void selfDestruct()
public void setEyeDirection(LivingEntityWrapper live, org.bukkit.util.Vector vec)
live
- - LivingEntityWrappervec
- - Facing direction as a vectorpublic boolean isAlive()
public java.util.UUID getUid()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object