mirror of
https://github.com/taoneill/war.git
synced 2024-11-27 12:46:11 +01:00
Missing extraLoadouts stuff. Kind of broken. Need more testing.
This commit is contained in:
parent
c6a8bc555c
commit
1ba2fa2e06
@ -361,10 +361,10 @@ public class War extends JavaPlugin {
|
||||
if (loadoutName.equals("default")) {
|
||||
this.inventoryToLoadout(player, warzone.getLoadout());
|
||||
} else {
|
||||
HashMap<Integer, ItemStack> extraLoadout = this.getDefaultExtraLoadouts().get(loadoutName);
|
||||
HashMap<Integer, ItemStack> extraLoadout = warzone.getExtraLoadouts().get(loadoutName);
|
||||
if (extraLoadout == null) {
|
||||
HashMap<Integer, ItemStack> newLoadout = new HashMap<Integer, ItemStack>();
|
||||
this.getDefaultExtraLoadouts().put(loadoutName, newLoadout);
|
||||
warzone.getExtraLoadouts().put(loadoutName, newLoadout);
|
||||
}
|
||||
this.inventoryToLoadout(player, extraLoadout);
|
||||
}
|
||||
@ -509,8 +509,18 @@ public class War extends JavaPlugin {
|
||||
if (commandSender instanceof Player) {
|
||||
Player player = (Player) commandSender;
|
||||
if (namedParams.containsKey("loadout")) {
|
||||
this.inventoryToLoadout(player, this.getDefaultLoadout());
|
||||
returnMessage.append(" respawn loadout updated.");
|
||||
String loadoutName = namedParams.get("loadout");
|
||||
if (loadoutName.equals("default")) {
|
||||
this.inventoryToLoadout(player, this.getDefaultLoadout());
|
||||
} else {
|
||||
HashMap<Integer, ItemStack> extraLoadout = this.getDefaultExtraLoadouts().get(loadoutName);
|
||||
if (extraLoadout == null) {
|
||||
HashMap<Integer, ItemStack> newLoadout = new HashMap<Integer, ItemStack>();
|
||||
this.getDefaultExtraLoadouts().put(loadoutName, newLoadout);
|
||||
}
|
||||
this.inventoryToLoadout(player, extraLoadout);
|
||||
}
|
||||
returnMessage.append(loadoutName + " respawn loadout updated.");
|
||||
}
|
||||
if (namedParams.containsKey("reward")) {
|
||||
this.inventoryToLoadout(player, this.getDefaultReward());
|
||||
|
@ -468,7 +468,7 @@ public class WarPlayerListener extends PlayerListener {
|
||||
|
||||
@Override
|
||||
public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
|
||||
if (War.war.isLoaded()) {
|
||||
if (War.war.isLoaded() && event.isSneaking()) {
|
||||
Warzone playerWarzone = Warzone.getZoneByLocation(event.getPlayer());
|
||||
if (playerWarzone != null && playerWarzone.getNewlyRespawned().keySet().contains(event.getPlayer().getName())) {
|
||||
Integer currentIndex = playerWarzone.getNewlyRespawned().get(event.getPlayer().getName());
|
||||
|
Loading…
Reference in New Issue
Block a user