public class SoundBuilder extends Object implements com.github.shynixn.petblocks.api.persistence.entity.SoundMeta
Do not remove this header!
Version 1.0
MIT License
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Constructor and Description |
|---|
SoundBuilder()
Initializes a new soundBuilder
|
SoundBuilder(Map<String,Object> items)
Initializes a new soundBuilder from serialized Content
|
SoundBuilder(String text)
Initializes a new soundBuilder
|
SoundBuilder(String text,
double volume,
double pitch)
Initializes a new soundBuilder
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Collection<org.bukkit.entity.Player> players)
Plays the sound to all given players at their location
|
void |
apply(org.bukkit.Location location)
Plays the sound to all players in the world at the given location.
|
void |
apply(org.bukkit.Location location,
Collection<org.bukkit.entity.Player> players)
Plays the sound to the given players at the given location.
|
void |
apply(org.bukkit.Location location,
org.bukkit.entity.Player... players)
Plays the sound to the given players at the given location.
|
void |
apply(org.bukkit.entity.Player... players)
Plays the sound to all given players at their location
|
void |
applyToLocation(Object location)
Applies the sound at the given location
|
void |
applyToPlayers(Object... players)
Applies the sound to the given player
|
static String |
getAvailableSounds()
Returns all available sound names
|
long |
getId()
Returns the id of the object
|
String |
getName()
Returns the name of the sound
|
double |
getPitch()
Returns the pitch of the sound
|
org.bukkit.Sound |
getSound()
Returns the sound and throws exception if the sound does not exist
|
static org.bukkit.Sound |
getSoundFromName(String name)
Returns the sound from the given name
|
double |
getVolume()
Returns the volume of the sound
|
Map<String,Object> |
serialize()
Serializes the builder
|
SoundBuilder |
setName(String name)
Sets the name of the sound
|
SoundBuilder |
setPitch(double pitch)
Sets the pitch of the sound
|
SoundBuilder |
setSound(org.bukkit.Sound sound)
Sets the bukkit sound of the sound
|
SoundBuilder |
setVolume(double volume)
Sets the volume of the sound
|
public SoundBuilder()
public SoundBuilder(String text)
text - textpublic SoundBuilder(String text, double volume, double pitch)
text - textvolume - volumepitch - pitchpublic void apply(Collection<org.bukkit.entity.Player> players) throws Exception
players - playersException - exceptionpublic void apply(org.bukkit.entity.Player... players)
throws Exception
players - playersException - exceptionpublic void apply(org.bukkit.Location location)
throws Exception
location - locationException - exceptionpublic void apply(org.bukkit.Location location,
Collection<org.bukkit.entity.Player> players)
throws Exception
location - locationplayers - playersException - exceptionpublic void apply(org.bukkit.Location location,
org.bukkit.entity.Player... players)
throws Exception
location - locationplayers - playersException - exceptionpublic void applyToLocation(Object location) throws Exception
applyToLocation in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetalocation - locationExceptionpublic void applyToPlayers(Object... players) throws Exception
applyToPlayers in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetaplayers - playersExceptionpublic String getName()
getName in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetapublic SoundBuilder setName(String name)
setName in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetaname - namepublic org.bukkit.Sound getSound()
throws Exception
Exception - exceptionpublic SoundBuilder setSound(org.bukkit.Sound sound)
sound - soundpublic double getVolume()
getVolume in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetapublic SoundBuilder setVolume(double volume)
setVolume in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetavolume - volumepublic double getPitch()
getPitch in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetapublic SoundBuilder setPitch(double pitch)
setPitch in interface com.github.shynixn.petblocks.api.persistence.entity.SoundMetapitch - pitchpublic static org.bukkit.Sound getSoundFromName(String name)
name - namepublic static String getAvailableSounds()
public long getId()
getId in interface com.github.shynixn.petblocks.api.persistence.entity.PersistenceableCopyright © 2017. All rights reserved.