Package com.hazebyte.crate.api.crate
Interface BlockCrateRegistrar
-
public interface BlockCrateRegistrar
Contain methods used to retrieve and manipulate location based crates.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Crate
getCrate(org.bukkit.Location location, Crate crate)
Returns the crate if it exists at the location.Crate
getCrate(org.bukkit.Location location, String crateName)
Returns the crate with the crate name at the location.List<Crate>
getCrates(org.bukkit.Location location)
Returns the list of crates at a given location.Crate
getFirstCrate(org.bukkit.Location location)
Returns the first crate, if it exists, at the location.List<org.bukkit.Location>
getLocations()
boolean
hasCrate(org.bukkit.Location location, Crate crate)
Returns true if the crate exists at the location.boolean
hasCrates(org.bukkit.Location location)
Returns true if there are crates at the location.boolean
removeCrate(org.bukkit.Location location, Crate crate)
save
defaults totrue
boolean
removeCrate(org.bukkit.Location location, Crate crate, boolean save)
Removes a location from listening for crate events.boolean
save()
Saves the list of block crates to a file storage.boolean
setCrate(org.bukkit.Location location, Crate crate)
save
defaults totrue
.boolean
setCrate(org.bukkit.Location location, Crate crate, boolean save)
Sets a location to listen for crate events.
-
-
-
Method Detail
-
setCrate
boolean setCrate(org.bukkit.Location location, Crate crate)
save
defaults totrue
.- See Also:
setCrate(Location, Crate, boolean)
-
setCrate
boolean setCrate(org.bukkit.Location location, Crate crate, boolean save)
Sets a location to listen for crate events. This activates holograms and starts effects.- Parameters:
location
- the location to activate events forcrate
- the crate that handles the eventssave
- true to save to file storage, otherwise false.- Returns:
- true if the crate is set, otherwise false.
-
removeCrate
boolean removeCrate(org.bukkit.Location location, Crate crate)
save
defaults totrue
- See Also:
removeCrate(Location, Crate, boolean)
-
removeCrate
boolean removeCrate(org.bukkit.Location location, Crate crate, boolean save)
Removes a location from listening for crate events. This removes holograms and effects.- Parameters:
location
- the location that has a listenercrate
- the crate that is handling eventssave
- true to save to file storage, otherwise false- Returns:
- true if the crate is removed, otherwise false
-
save
boolean save()
Saves the list of block crates to a file storage.- Returns:
- true if written, otherwise false
-
getCrate
Crate getCrate(org.bukkit.Location location, Crate crate)
Returns the crate if it exists at the location.- Parameters:
location
- the location where the crate is at.crate
- the crate to search for- Returns:
- the crate if it exists, otherwise null
-
getCrate
Crate getCrate(org.bukkit.Location location, String crateName)
Returns the crate with the crate name at the location.- Parameters:
location
- the location where the crate is at.crateName
- the crate name to search for- Returns:
- the crate if the crate name matches a crate, otherwise false.
-
getCrates
List<Crate> getCrates(org.bukkit.Location location)
Returns the list of crates at a given location.- Parameters:
location
- the location to search for- Returns:
- a non-null list of crates. If there are no crates, it'll return the null.
-
getFirstCrate
Crate getFirstCrate(org.bukkit.Location location)
Returns the first crate, if it exists, at the location.- Parameters:
location
- the location to search for.- Returns:
- the crate if it exist, otherwise null
-
hasCrate
boolean hasCrate(org.bukkit.Location location, Crate crate)
Returns true if the crate exists at the location.- Parameters:
location
- the location to search for.crate
- the crate to check.- Returns:
- true if it exists, false otherwise.
-
hasCrates
boolean hasCrates(org.bukkit.Location location)
Returns true if there are crates at the location.- Parameters:
location
- the location to search for.- Returns:
- true if there are crates set.
-
getLocations
List<org.bukkit.Location> getLocations()
-
-