Class PackAssignment
java.lang.Object
de.themoep.resourcepacksplugin.core.PackAssignment
Created by Phoenix616 on 06.03.2017.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addOptionalPack
(ResourcePack pack) Add a new optional packboolean
addOptionalPack
(String pack) Add a new optional packboolean
addPack
(ResourcePack pack) Add a new packboolean
Add a new packboolean
addSecondary
(ResourcePack pack) Deprecated.boolean
addSecondary
(String pack) Deprecated.getName()
Get the name of this assignmentGet a list of optional packsgetPack()
Deprecated.UsegetPacks()
getPacks()
Get the list of packsgetRegex()
Get the compiled Pattern of this assignment's key regexString[]
Get replacementsDeprecated.long
Get the delay in ticks to wait before sending the packs from this assignmentprotected String[]
Get all possible update actionsboolean
isEmpty()
Check whether or not this assignment contains any pack settingsboolean
isOptionalPack
(ResourcePack pack) Check whether certain pack is an optional pack in this assignmentboolean
isOptionalPack
(String pack) Check whether a certain pack is an optional pack in this assignmentboolean
isPack
(ResourcePack pack) Check whether certain pack is a pack in this assignmentboolean
Check whether a certain pack is a pack in this assignmentboolean
isSecondary
(ResourcePack pack) Deprecated.boolean
isSecondary
(String pack) Deprecated.boolean
Remove an optional packboolean
removeOptionalPack
(String pack) Remove an optional packboolean
removePack
(ResourcePack pack) Remove a packboolean
removePack
(String pack) Remove a packboolean
removeSecondary
(ResourcePack pack) Deprecated.boolean
removeSecondary
(String pack) Deprecated.Serialize this assignment to a mapboolean
setPack
(ResourcePack pack) Deprecated.boolean
Deprecated.boolean
Set the key name regex of this assignmentboolean
setSendDelay
(long sendDelay) Set the delay in ticks to wait before sending the packs from this assignmenttoString()
boolean
update
(PluginCommandExecutor command, ResourcepacksPlayer sender, String[] args) Update this assignment
-
Constructor Details
-
PackAssignment
-
PackAssignment
-
-
Method Details
-
setPack
Deprecated.Set the main pack of this assignment- Parameters:
pack
- The main pack- Returns:
- Whether or not the value changed
-
setPack
Deprecated.Set the main pack of this assignment- Parameters:
pack
- The name of the main pack- Returns:
- Whether or not the value changed
-
getPack
Deprecated.UsegetPacks()
Get the name of the main pack of this assignment- Returns:
- The (lowercase) name of the pack
-
getPacks
Get the list of packs- Returns:
- The (lowercase) names of main packs
-
isPack
Check whether a certain pack is a pack in this assignment- Parameters:
pack
- The name of the pack- Returns:
true
if this pack list contains this pack;false
if not
-
isPack
Check whether certain pack is a pack in this assignment- Parameters:
pack
- The pack- Returns:
true
if this pack list contains this pack;false
if not (or pack is null)
-
addPack
Add a new pack- Parameters:
pack
- The pack to add- Returns:
true
as defined in Collections.add
-
addPack
Add a new pack- Parameters:
pack
- The name of the pack to add- Returns:
true
as defined in Collections.add
-
removePack
Remove a pack- Parameters:
pack
- The pack to remove- Returns:
true
if that pack was a main pack,false
if not
-
removePack
Remove a pack- Parameters:
pack
- The name of the pack to remove- Returns:
true
if that pack was a main pack,false
if not
-
getOptionalPacks
Get a list of optional packs- Returns:
- The (lowercase) names of optional packs
-
isOptionalPack
Check whether a certain pack is an optional pack in this assignment- Parameters:
pack
- The name of the pack- Returns:
true
if this optional pack list contains this pack;false
if not
-
isOptionalPack
Check whether certain pack is an optional pack in this assignment- Parameters:
pack
- The pack- Returns:
true
if this optional pack list contains this pack;false
if not (or pack is null)
-
addOptionalPack
Add a new optional pack- Parameters:
pack
- The pack to add- Returns:
true
as defined in Collections.add
-
addOptionalPack
Add a new optional pack- Parameters:
pack
- The name of the pack to add- Returns:
true
as defined in Collections.add
-
removeOptionalPack
Remove an optional pack- Parameters:
pack
- The pack to remove- Returns:
true
if that pack was a optional one,false
if not
-
removeOptionalPack
Remove an optional pack- Parameters:
pack
- The name of the pack to remove- Returns:
true
if that pack was a optional one,false
if not
-
getSecondaries
Deprecated.Get a list of secondary packs- Returns:
- The (lowercase) names of secondary packs
-
isSecondary
Deprecated.Check whether or not a certain pack is a secondary in this assignment- Parameters:
pack
- The name of the pack- Returns:
true
if this secondary list contains this pack;false
if not
-
isSecondary
Deprecated.Check whether or not a certain pack is a secondary in this assignment- Parameters:
pack
- The the pack- Returns:
true
if this secondary list contains this pack;false
if not (or pack is null)
-
addSecondary
Deprecated.Add a new secondary pack- Parameters:
pack
- The pack to add- Returns:
true
as defined in Collections.add
-
addSecondary
Deprecated.Add a new secondary pack- Parameters:
pack
- The name of the pack to add- Returns:
true
as defined in Collections.add
-
removeSecondary
Deprecated.Remove a secondary pack- Parameters:
pack
- The pack to remove- Returns:
true
if that pack was a secondary one,false
if not
-
removeSecondary
Deprecated.Remove a secondary pack- Parameters:
pack
- The name of the pack to remove- Returns:
true
if that pack was a secondary one,false
if not
-
isEmpty
public boolean isEmpty()Check whether or not this assignment contains any pack settings- Returns:
true
if it has no packs or secondaries;false
if it has some
-
setSendDelay
public boolean setSendDelay(long sendDelay) Set the delay in ticks to wait before sending the packs from this assignment- Parameters:
sendDelay
- The delay in ticks- Returns:
- Whether or not the value changed
-
getSendDelay
public long getSendDelay()Get the delay in ticks to wait before sending the packs from this assignment- Returns:
- The delay in ticks; -1 if there was no special one configured
-
toString
-
setRegex
Set the key name regex of this assignment- Parameters:
regex
- The compiled Pattern of this regex- Returns:
- Whether or not the value changed
-
getRegex
Get the compiled Pattern of this assignment's key regex- Returns:
- The compiled regex pattern or
null
if none is set and the key should be used literally
-
getName
Get the name of this assignment- Returns:
- The name of this assignment
-
serialize
Serialize this assignment to a map- Returns:
- A map holding the data of this object
-
getReplacements
Get replacements- Returns:
- The placeholder replacements of this pack as an array. Index n is the placeholder, n+1 the value.
-
getUpdateActions
Get all possible update actions- Returns:
- The possible update actions
-
update
Update this assignment- Parameters:
command
- The command triggering the updatesender
- The sender updating itargs
- The arguments for updating the assignment- Returns:
- Whether or not the update completed properly
-
addOptionalPack(ResourcePack)