Class Horn
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.settings.impl.Horn
- All Implemented Interfaces:
Setting
The horn settings.
-
Constructor Summary
ConstructorsConstructorDescriptionHorn()
Construct a disabled Horn.Horn
(boolean enabled, Sounds.Sound sound) Construct a new Horn.Horn
(Sounds.Sound sound) Construct an enabled Horn. -
Method Summary
Modifier and TypeMethodDescriptionint
The horning cooldown.getSound()
The sound of the horn.boolean
horn
(org.bukkit.Location loc) Play the horn if enabled.boolean
Is the horn enabled?void
setEnabled
(boolean enabled) Is the horn enabled?void
setSound
(Sounds.Sound sound) The sound of the horn.toString()
-
Constructor Details
-
Horn
public Horn()Construct a disabled Horn. -
Horn
Construct an enabled Horn.- Parameters:
sound
- The sound of the horn.
-
Horn
Construct a new Horn.- Parameters:
enabled
- Is the horn enabled?sound
- The sound of the horn.
-
-
Method Details
-
horn
public boolean horn(org.bukkit.Location loc) Play the horn if enabled.- Parameters:
loc
- The location to play the horn.- Returns:
- True if played, false if not (because not enabled or in cooldown).
-
toString
-
isEnabled
public boolean isEnabled()Is the horn enabled? -
getSound
The sound of the horn. -
getCooldown
public int getCooldown()The horning cooldown. -
setEnabled
public void setEnabled(boolean enabled) Is the horn enabled? -
setSound
The sound of the horn.
-