mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 11:06:14 +01:00
Add support for a per-arena default class.
This commit is contained in:
parent
d2fd8b4fc2
commit
692d7f52dc
@ -71,6 +71,7 @@ public class ArenaImpl implements Arena
|
||||
private Set<Player> randoms;
|
||||
|
||||
// Classes stuff
|
||||
private ArenaClass defaultClass;
|
||||
private Map<String,ArenaClass> classes;
|
||||
private Map<Player,PermissionAttachment> attachments;
|
||||
|
||||
@ -139,6 +140,11 @@ public class ArenaImpl implements Arena
|
||||
this.classes = plugin.getArenaMaster().getClasses();
|
||||
this.attachments = new HashMap<Player,PermissionAttachment>();
|
||||
this.limitManager = new ClassLimitManager(this, classes, makeSection(section, "class-limits"));
|
||||
|
||||
String defaultClassName = settings.getString("default-class", null);
|
||||
if (defaultClassName != null) {
|
||||
this.defaultClass = classes.get(defaultClassName);
|
||||
}
|
||||
|
||||
// Blocks and pets
|
||||
this.repairQueue = new PriorityBlockingQueue<Repairable>(100, new RepairableComparator());
|
||||
@ -615,6 +621,14 @@ public class ArenaImpl implements Arena
|
||||
} else if (autoStartTimer.isRunning()) {
|
||||
Messenger.tell(p, Msg.ARENA_AUTO_START, "" + autoStartTimer.getRemaining() / 20l);
|
||||
}
|
||||
|
||||
if (defaultClass != null) {
|
||||
// Assign default class if applicable
|
||||
if (!ClassChests.assignClassFromStoredClassChest(this, p, defaultClass)) {
|
||||
assignClass(p, defaultClass.getLowercaseName());
|
||||
Messenger.tell(p, Msg.LOBBY_CLASS_PICKED, defaultClass.getConfigName());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ world: ''
|
||||
enabled: true
|
||||
protect: true
|
||||
entry-fee: ''
|
||||
default-class: ''
|
||||
clear-wave-before-next: false
|
||||
clear-boss-before-next: false
|
||||
clear-wave-before-boss: false
|
||||
|
Loading…
Reference in New Issue
Block a user