public class TrainProperties extends TrainPropertiesStore implements IProperties
Modifier and Type | Field and Description |
---|---|
CollisionMode |
blockCollision |
static TrainProperties |
EMPTY |
CollisionMode |
miscCollision |
CollisionMode |
playerCollision |
boolean |
requirePoweredMinecart |
CollisionMode |
trainCollision |
Modifier and Type | Method and Description |
---|---|
boolean |
add(CartProperties properties) |
void |
add(MinecartMember<?> member) |
void |
addTags(java.lang.String... tags)
Adds one or more tags
|
void |
addTicket(java.lang.String ticketName)
Adds a new ticket that can be used for entering this train.
|
void |
clearDestination()
Clears the destination set
|
void |
clearOwnerPermissions()
Clears all permission nodes used to define owners
|
void |
clearOwners()
Clears all owners set
|
void |
clearTags()
Clears all set tags
|
void |
clearTickets() |
CartProperties |
get(int index) |
java.util.Set<CollisionMode> |
getAllCollisionModes()
Gets the Collision Mode for colliding with the Entity specified
|
double |
getBankingSmoothness() |
double |
getBankingStrength() |
boolean |
getColliding()
Gets whether this Train can collide with other Entities and Trains
|
double |
getCollisionDamage() |
CollisionMode |
getCollisionMode(CollisionConfig collisionConfigObject) |
CollisionMode |
getCollisionMode(org.bukkit.entity.Entity entity) |
java.lang.String |
getDestination()
Gets the destination
|
java.lang.String |
getDisplayName()
Gets the Display Name of these properties
|
MinecartGroup |
getHolder()
Gets the owner of these properties
|
java.lang.String |
getKillMessage() |
java.lang.String |
getLastPathNode()
Gets the name of the last path finding node that was visited
|
com.bergerkiller.bukkit.common.BlockLocation |
getLocation()
Gets a predicted location of the Minecart (and thus Train)
|
java.util.Set<java.lang.String> |
getOwnerPermissions()
Gets a Set of all permission nodes granting players ownership
|
java.util.Set<java.lang.String> |
getOwners()
Gets a Set of all player owner names (lower cased)
|
boolean |
getPlayersEnter()
Gets whether players can enter
|
boolean |
getPlayersExit()
Gets whether players can exit
|
SignSkipOptions |
getSkipOptions() |
boolean |
getSpawnItemDrops()
Gets whether items are dropped when this cart is broken
|
double |
getSpeedLimit()
Gets the maximum speed this Train can move at.
|
java.util.Collection<java.lang.String> |
getTags()
Gets all the tags set
|
java.util.List<java.lang.String> |
getTickets()
Gets a list of tickets that can be used for entering this train
|
java.lang.String |
getTrainName() |
java.lang.String |
getTypeName()
Gets the type name (train/cart) of these properties
|
double |
getWaitDistance()
Gets the wait distance.
|
boolean |
hasDestination()
Gets whether a destination is set
|
boolean |
hasHolder()
Gets whether these properties have a valid (loaded) owner
|
boolean |
hasOwnerPermissions()
Checks whether owner permissions are set for (some of) the carts of this train
|
boolean |
hasOwners()
Checks whether owners are set for (some of) the carts of this train
|
boolean |
hasOwnership(org.bukkit.entity.Player player)
Checks whether a given player has ownership, and can alter these
properties or use the owner of these properties
|
boolean |
hasSuffocation()
Gets whether passengers inside this train sustain suffocation damage when their
head is submerged inside a block.
|
boolean |
hasTags()
Tests if tags are contained
|
boolean |
isInvincible()
Gets wether train is invincible
|
boolean |
isKeepingChunksLoaded()
Gets whether this Train keeps nearby chunks loaded
|
boolean |
isLoaded() |
boolean |
isManualMovementAllowed()
Gets whether minecart passengers can manually move the train they are in
|
boolean |
isOwnedByEveryone()
Gets whether these properties can be altered by everyone.
|
boolean |
isOwner(org.bukkit.entity.Player player)
Gets whether a certain player is an owner set in these properties.
|
boolean |
isPlayerTakeable()
Gets whether this Train supports players taking minecarts with them when they leave.
|
boolean |
isPublic()
Gets whether it can be publicly accessed
|
boolean |
isSlowingDown()
Deprecated.
|
boolean |
isSlowingDown(SlowdownMode mode)
Gets whether a particular slow down mode is activated
|
boolean |
isSlowingDownAll()
Gets whether the slow down options are set to a default, where all slowdown modes are active.
|
boolean |
isSlowingDownNone()
Gets whether all slow down options are disabled.
|
boolean |
isSoundEnabled()
Gets whether ambient Minecart sounds are enabled
|
boolean |
isTrainRenamed() |
void |
load(com.bergerkiller.bukkit.common.config.ConfigurationNode node)
Loads the information from the Configuration Node specified
|
void |
load(TrainProperties source)
Loads the properties from the TrainProperties source specified
Cart properties are not transferred or cleared! |
boolean |
matchName(java.lang.String expression) |
boolean |
matchName(java.lang.String[] expressionElements,
boolean firstAny,
boolean lastAny) |
boolean |
matchTag(java.lang.String tag)
Tests if the tag specified matches one of the tags set
|
boolean |
parseSet(java.lang.String key,
java.lang.String arg)
Sets a property denoted by the key by parsing the args specified
|
boolean |
remove(java.lang.Object o) |
void |
removeTags(java.lang.String... tags)
Removes one or more tags
|
void |
removeTicket(java.lang.String ticketName)
Revokes a ticket from being used for entering this train.
|
boolean |
restore()
Restores the Train of these properties if it is not already loaded.
|
void |
save(com.bergerkiller.bukkit.common.config.ConfigurationNode node)
Saves the information to the Configuration Node specified as a means of state saving
Only changed information is written |
void |
saveAsDefault(com.bergerkiller.bukkit.common.config.ConfigurationNode node)
Saves the information to the Configuration Node specified as a means of default
The full information is written |
void |
setBankingSmoothness(double smoothness) |
void |
setBankingStrength(double strength) |
void |
setColliding(boolean state)
Sets whether this Train can collide with other Entities and Trains
|
void |
setCollisionDamage(double collisionDamage) |
boolean |
setCollisionMode(java.lang.String key,
java.lang.String value) |
void |
setDefault() |
void |
setDefault(com.bergerkiller.bukkit.common.config.ConfigurationNode node) |
void |
setDefault(org.bukkit.entity.Player player) |
void |
setDefault(java.lang.String key) |
void |
setDestination(java.lang.String destination)
Sets a destination
|
void |
setDisplayName(java.lang.String displayName)
Sets the Display Name for these properties
If a null or empty String is passed in as argument, the display name is set to the train name. |
void |
setEnterMessage(java.lang.String message)
Sets the Enter Message displayed when a player enters
|
void |
setInvincible(boolean enabled)
Sets wether the train is invincible
|
void |
setKeepChunksLoaded(boolean state)
Sets whether this Train keeps nearby chunks loaded
|
void |
setKillMessage(java.lang.String killMessage) |
void |
setLastPathNode(java.lang.String nodeName)
Sets the name of the last path finding node that was visited
|
void |
setManualMovementAllowed(boolean allow)
Sets whether minecart passengers can manually move the train they are in
|
TrainProperties |
setName(java.lang.String newtrainname)
Renames this train, this should be called to rename the train safely
|
void |
setPickup(boolean pickup)
Sets whether nearby items are picked up by the Minecart(s)
|
void |
setPlayersEnter(boolean state)
Sets whether players can enter
|
void |
setPlayersExit(boolean state)
Sets whether players can exit
|
void |
setPlayerTakeable(boolean takeable)
Sets whether this Train supports players taking minecarts with them when they leave.
|
void |
setPublic(boolean state)
Sets whether it can be publicly accessed
|
void |
setSkipOptions(SignSkipOptions options) |
void |
setSlowingDown(boolean slowingDown)
Sets whether the Train slows down over time.
Note: sets or clears all possible slowdown options at once |
void |
setSlowingDown(SlowdownMode mode,
boolean slowingDown)
Sets whether a particular slow down mode is activated
|
void |
setSoundEnabled(boolean enabled)
Sets whether ambient Minecart sounds are enabled
|
void |
setSpawnItemDrops(boolean spawnDrops)
Sets whether items are dropped when this cart is broken
|
void |
setSpeedLimit(double limit)
Sets the maximum speed this Train can move at
The maximum speed limit is enforced. |
void |
setSuffocation(boolean suffocation)
Sets whether passengers inside this train sustain suffocation damage when their
head is submerged inside a block.
|
void |
setTags(java.lang.String... tags)
Sets all the tags contained
|
void |
setWaitDistance(double waitDistance)
Sets the wait distance.
|
void |
tryUpdate() |
void |
updateAllCollisionProperties(CollisionMode mode) |
boolean |
updateCollisionProperties(java.lang.String mobType,
CollisionMode mode) |
clearAll, create, exists, generateTrainName, generateTrainName, get, getAll, getDefaultsByName, getDefaultsByPlayer, load, loadDefaults, markForAutosave, matchAll, remove, rename, save
addAll, containsAll, retainAll, toArray, toArray, toString
public static final TrainProperties EMPTY
public CollisionMode playerCollision
public CollisionMode miscCollision
public CollisionMode trainCollision
public CollisionMode blockCollision
public boolean requirePoweredMinecart
public java.lang.String getTypeName()
IProperties
getTypeName
in interface IProperties
public MinecartGroup getHolder()
IProperties
getHolder
in interface IProperties
public boolean hasHolder()
IProperties
hasHolder
in interface IProperties
public boolean restore()
IProperties
restore
in interface IProperties
public double getWaitDistance()
public void setWaitDistance(double waitDistance)
waitDistance
- public double getSpeedLimit()
public void setSpeedLimit(double limit)
limit
- in blocks/tick@Deprecated public boolean isSlowingDown()
public boolean isSlowingDownAll()
public boolean isSlowingDownNone()
public void setSlowingDown(boolean slowingDown)
slowingDown
- state to set topublic boolean isSlowingDown(SlowdownMode mode)
mode
- to checkpublic void setSlowingDown(SlowdownMode mode, boolean slowingDown)
mode
- to setslowingDown
- option to set that mode topublic boolean getColliding()
public void setColliding(boolean state)
state
- to set topublic java.lang.String getDisplayName()
public void setDisplayName(java.lang.String displayName)
displayName
- to set topublic boolean isKeepingChunksLoaded()
public void setKeepChunksLoaded(boolean state)
state
- to set topublic boolean isSoundEnabled()
public void setSoundEnabled(boolean enabled)
enabled
- state to set topublic void add(MinecartMember<?> member)
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<CartProperties>
remove
in interface java.util.Set<CartProperties>
remove
in class java.util.HashSet<CartProperties>
public boolean add(CartProperties properties)
add
in interface java.util.Collection<CartProperties>
add
in interface java.util.Set<CartProperties>
add
in class java.util.HashSet<CartProperties>
public CartProperties get(int index)
public void setPickup(boolean pickup)
IProperties
setPickup
in interface IProperties
pickup
- True if items are picked up, False if notpublic boolean isOwnedByEveryone()
IProperties
isOwnedByEveryone
in interface IProperties
public boolean hasOwners()
IProperties
hasOwners
in interface IProperties
public boolean hasOwnership(org.bukkit.entity.Player player)
IProperties
hasOwnership
in interface IProperties
player
- to checkpublic boolean isOwner(org.bukkit.entity.Player player)
IProperties
isOwner
in interface IProperties
player
- to testpublic boolean hasOwnerPermissions()
IProperties
hasOwnerPermissions
in interface IProperties
public java.util.Set<java.lang.String> getOwnerPermissions()
IProperties
getOwnerPermissions
in interface IProperties
public java.util.Set<java.lang.String> getOwners()
IProperties
getOwners
in interface IProperties
public void clearOwners()
IProperties
clearOwners
in interface IProperties
public void clearOwnerPermissions()
IProperties
clearOwnerPermissions
in interface IProperties
public boolean isPlayerTakeable()
public void setPlayerTakeable(boolean takeable)
takeable
- state to set topublic double getBankingStrength()
public double getBankingSmoothness()
public void setBankingStrength(double strength)
public void setBankingSmoothness(double smoothness)
public boolean isPublic()
IProperties
isPublic
in interface IProperties
public void setPublic(boolean state)
IProperties
setPublic
in interface IProperties
state
- to set topublic void setEnterMessage(java.lang.String message)
IProperties
setEnterMessage
in interface IProperties
message
- to set topublic boolean matchTag(java.lang.String tag)
IProperties
matchTag
in interface IProperties
tag
- to matchpublic boolean hasTags()
IProperties
hasTags
in interface IProperties
public java.util.Collection<java.lang.String> getTags()
IProperties
getTags
in interface IProperties
public void setTags(java.lang.String... tags)
IProperties
setTags
in interface IProperties
tags
- to set topublic void clearTags()
IProperties
clearTags
in interface IProperties
public void addTags(java.lang.String... tags)
IProperties
addTags
in interface IProperties
tags
- to addpublic void removeTags(java.lang.String... tags)
IProperties
removeTags
in interface IProperties
tags
- to removepublic boolean getPlayersEnter()
IProperties
getPlayersEnter
in interface IProperties
public void setPlayersEnter(boolean state)
IProperties
setPlayersEnter
in interface IProperties
state
- to set topublic boolean getPlayersExit()
IProperties
getPlayersExit
in interface IProperties
public void setPlayersExit(boolean state)
IProperties
setPlayersExit
in interface IProperties
state
- to set topublic boolean isInvincible()
IProperties
isInvincible
in interface IProperties
public void setInvincible(boolean enabled)
IProperties
setInvincible
in interface IProperties
enabled
- to set topublic boolean getSpawnItemDrops()
IProperties
getSpawnItemDrops
in interface IProperties
public void setSpawnItemDrops(boolean spawnDrops)
IProperties
setSpawnItemDrops
in interface IProperties
spawnDrops
- to set topublic boolean hasDestination()
IProperties
hasDestination
in interface IProperties
public java.lang.String getDestination()
IProperties
getDestination
in interface IProperties
public void setDestination(java.lang.String destination)
IProperties
setDestination
in interface IProperties
destination
- to set topublic void clearDestination()
IProperties
clearDestination
in interface IProperties
public java.lang.String getLastPathNode()
IProperties
getLastPathNode
in interface IProperties
public void setLastPathNode(java.lang.String nodeName)
IProperties
setLastPathNode
in interface IProperties
nodeName
- to set topublic java.util.Set<CollisionMode> getAllCollisionModes()
entity
- to collide withpublic CollisionMode getCollisionMode(org.bukkit.entity.Entity entity)
public java.lang.String getTrainName()
public TrainProperties setName(java.lang.String newtrainname)
newtrainname
- to set topublic boolean hasSuffocation()
public void setSuffocation(boolean suffocation)
suffocation
- optionpublic boolean isManualMovementAllowed()
public void setManualMovementAllowed(boolean allow)
allow
- state to set topublic java.util.List<java.lang.String> getTickets()
public void addTicket(java.lang.String ticketName)
ticketName
- to addpublic void removeTicket(java.lang.String ticketName)
ticketName
- to removepublic void clearTickets()
public SignSkipOptions getSkipOptions()
public void setSkipOptions(SignSkipOptions options)
public java.lang.String getKillMessage()
public void setKillMessage(java.lang.String killMessage)
public boolean isTrainRenamed()
public boolean isLoaded()
public boolean matchName(java.lang.String expression)
public boolean matchName(java.lang.String[] expressionElements, boolean firstAny, boolean lastAny)
public com.bergerkiller.bukkit.common.BlockLocation getLocation()
IProperties
getLocation
in interface IProperties
public void setDefault()
public void setDefault(java.lang.String key)
public void setDefault(com.bergerkiller.bukkit.common.config.ConfigurationNode node)
public void setDefault(org.bukkit.entity.Player player)
public void tryUpdate()
public boolean parseSet(java.lang.String key, java.lang.String arg)
IParsable
public boolean setCollisionMode(java.lang.String key, java.lang.String value)
public boolean updateCollisionProperties(java.lang.String mobType, CollisionMode mode)
public void updateAllCollisionProperties(CollisionMode mode)
public void load(com.bergerkiller.bukkit.common.config.ConfigurationNode node)
IProperties
load
in interface IProperties
node
- to usepublic void load(TrainProperties source)
source
- to load frompublic CollisionMode getCollisionMode(CollisionConfig collisionConfigObject)
public void saveAsDefault(com.bergerkiller.bukkit.common.config.ConfigurationNode node)
IProperties
saveAsDefault
in interface IProperties
node
- to save topublic void save(com.bergerkiller.bukkit.common.config.ConfigurationNode node)
IProperties
save
in interface IProperties
node
- to save topublic double getCollisionDamage()
public void setCollisionDamage(double collisionDamage)