Class PackAssignment
java.lang.Object
de.themoep.resourcepacksplugin.core.PackAssignment
Created by Phoenix616 on 06.03.2017.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddOptionalPack(ResourcePack pack) Add a new optional packbooleanaddOptionalPack(String pack) Add a new optional packbooleanaddPack(ResourcePack pack) Add a new packbooleanAdd a new packbooleanaddSecondary(ResourcePack pack) Deprecated.booleanaddSecondary(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.longGet the delay in ticks to wait before sending the packs from this assignmentprotected String[]Get all possible update actionsbooleanisEmpty()Check whether or not this assignment contains any pack settingsbooleanisOptionalPack(ResourcePack pack) Check whether certain pack is an optional pack in this assignmentbooleanisOptionalPack(String pack) Check whether a certain pack is an optional pack in this assignmentbooleanisPack(ResourcePack pack) Check whether certain pack is a pack in this assignmentbooleanCheck whether a certain pack is a pack in this assignmentbooleanisSecondary(ResourcePack pack) Deprecated.booleanisSecondary(String pack) Deprecated.booleanRemove an optional packbooleanremoveOptionalPack(String pack) Remove an optional packbooleanremovePack(ResourcePack pack) Remove a packbooleanremovePack(String pack) Remove a packbooleanremoveSecondary(ResourcePack pack) Deprecated.booleanremoveSecondary(String pack) Deprecated.Serialize this assignment to a mapbooleansetPack(ResourcePack pack) Deprecated.booleanDeprecated.booleanSet the key name regex of this assignmentbooleansetSendDelay(long sendDelay) Set the delay in ticks to wait before sending the packs from this assignmenttoString()booleanupdate(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:
trueif this pack list contains this pack;falseif not
-
isPack
Check whether certain pack is a pack in this assignment- Parameters:
pack- The pack- Returns:
trueif this pack list contains this pack;falseif not (or pack is null)
-
addPack
Add a new pack- Parameters:
pack- The pack to add- Returns:
trueas defined in Collections.add
-
addPack
Add a new pack- Parameters:
pack- The name of the pack to add- Returns:
trueas defined in Collections.add
-
removePack
Remove a pack- Parameters:
pack- The pack to remove- Returns:
trueif that pack was a main pack,falseif not
-
removePack
Remove a pack- Parameters:
pack- The name of the pack to remove- Returns:
trueif that pack was a main pack,falseif 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:
trueif this optional pack list contains this pack;falseif not
-
isOptionalPack
Check whether certain pack is an optional pack in this assignment- Parameters:
pack- The pack- Returns:
trueif this optional pack list contains this pack;falseif not (or pack is null)
-
addOptionalPack
Add a new optional pack- Parameters:
pack- The pack to add- Returns:
trueas defined in Collections.add
-
addOptionalPack
Add a new optional pack- Parameters:
pack- The name of the pack to add- Returns:
trueas defined in Collections.add
-
removeOptionalPack
Remove an optional pack- Parameters:
pack- The pack to remove- Returns:
trueif that pack was a optional one,falseif not
-
removeOptionalPack
Remove an optional pack- Parameters:
pack- The name of the pack to remove- Returns:
trueif that pack was a optional one,falseif 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:
trueif this secondary list contains this pack;falseif not
-
isSecondary
Deprecated.Check whether or not a certain pack is a secondary in this assignment- Parameters:
pack- The the pack- Returns:
trueif this secondary list contains this pack;falseif not (or pack is null)
-
addSecondary
Deprecated.Add a new secondary pack- Parameters:
pack- The pack to add- Returns:
trueas defined in Collections.add
-
addSecondary
Deprecated.Add a new secondary pack- Parameters:
pack- The name of the pack to add- Returns:
trueas defined in Collections.add
-
removeSecondary
Deprecated.Remove a secondary pack- Parameters:
pack- The pack to remove- Returns:
trueif that pack was a secondary one,falseif not
-
removeSecondary
Deprecated.Remove a secondary pack- Parameters:
pack- The name of the pack to remove- Returns:
trueif that pack was a secondary one,falseif not
-
isEmpty
public boolean isEmpty()Check whether or not this assignment contains any pack settings- Returns:
trueif it has no packs or secondaries;falseif 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
nullif 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)