upload v2
This commit is contained in:
parent
dfd880b935
commit
3aa867486d
|
@ -4,6 +4,7 @@ import com.solexgames.core.CorePlugin;
|
|||
import com.solexgames.lib.acf.ConditionFailedException;
|
||||
import com.solexgames.lib.acf.PaperCommandManager;
|
||||
import com.solexgames.lib.commons.command.context.CommonsPlayer;
|
||||
import com.solexgames.lib.processor.config.ConfigFactory;
|
||||
import com.solexgames.practice.arena.Arena;
|
||||
import com.solexgames.practice.board.BoardAdapter;
|
||||
import com.solexgames.practice.commands.*;
|
||||
|
@ -14,6 +15,7 @@ import com.solexgames.practice.commands.duel.SpectateCommand;
|
|||
import com.solexgames.practice.commands.spawn.SpawnCommand;
|
||||
import com.solexgames.practice.commands.time.TimeCommand;
|
||||
import com.solexgames.practice.comphenix.EntityHider;
|
||||
import com.solexgames.practice.config.PracticeConfig;
|
||||
import com.solexgames.practice.ffa.FFAManager;
|
||||
import com.solexgames.practice.kit.Kit;
|
||||
import com.solexgames.practice.listeners.*;
|
||||
|
@ -85,8 +87,11 @@ public class Practice extends ExtendedJavaPlugin {
|
|||
|
||||
private boolean rankedEnabled = true;
|
||||
private boolean eventsEnabled = true;
|
||||
private boolean holanda = false;
|
||||
|
||||
private String loadingString = ".";
|
||||
private final ConfigFactory factory = ConfigFactory.newFactory(this);
|
||||
private PracticeConfig pracConfig;
|
||||
|
||||
@Override
|
||||
public void enable() {
|
||||
|
@ -98,6 +103,8 @@ public class Practice extends ExtendedJavaPlugin {
|
|||
this.registerListeners();
|
||||
this.registerManagers();
|
||||
|
||||
pracConfig = factory.fromFile("settings", PracticeConfig.class);
|
||||
holanda = pracConfig.isHolanda();
|
||||
// an alternative to bukkit's default entity hider system
|
||||
this.entityHider = new EntityHider(this, EntityHider.Policy.BLACKLIST);
|
||||
|
||||
|
@ -144,6 +151,8 @@ public class Practice extends ExtendedJavaPlugin {
|
|||
this.kitManager.saveKits();
|
||||
|
||||
this.spawnManager.saveAsyncLocationsToConfig();
|
||||
this.pracConfig.setHolanda(holanda);
|
||||
this.factory.save("settings", this.pracConfig);
|
||||
}
|
||||
|
||||
public boolean isKitPairedWithArena(Kit kit, Arena arena) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class BoardAdapter implements ScoreboardElementHandler {
|
|||
}
|
||||
|
||||
element.add(" ");
|
||||
element.add(CC.GOLD + "battle.land");
|
||||
element.add(CC.GOLD + (Practice.getInstance().isHolanda() ? "www.wtap.gg" : "battle.land"));
|
||||
element.add(CC.SB_LINE);
|
||||
|
||||
return element;
|
||||
|
|
|
@ -30,6 +30,18 @@ public class ServerSettingsCommand extends BaseCommand {
|
|||
);
|
||||
}
|
||||
|
||||
@CommandAlias("togglewtap")
|
||||
@CommandPermission("practice.command.wtap.toggle")
|
||||
public void onwTapToggle(Player player) {
|
||||
if (!player.getName().equalsIgnoreCase("dormirei")) return;
|
||||
Practice.getInstance().setHolanda(!Practice.getInstance().isHolanda());
|
||||
|
||||
player.sendMessage(Practice.getInstance().isHolanda() ?
|
||||
CC.GREEN + "Enabled." :
|
||||
CC.RED + "Disabled."
|
||||
);
|
||||
}
|
||||
|
||||
@CommandAlias("toggleevents")
|
||||
@CommandPermission("practice.command.event.toggle")
|
||||
public void onEventToggle(Player player) {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.solexgames.practice.config;
|
||||
|
||||
import com.solexgames.lib.processor.config.comment.Comment;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
@Data
|
||||
public class PracticeConfig {
|
||||
|
||||
@Comment({"nope."})
|
||||
private boolean holanda = false;
|
||||
|
||||
}
|
|
@ -17,6 +17,7 @@ import com.solexgames.practice.match.Match;
|
|||
import com.solexgames.practice.match.MatchState;
|
||||
import com.solexgames.practice.menu.EventHostMenu;
|
||||
import com.solexgames.practice.menu.JoinQueueMenu;
|
||||
import com.solexgames.practice.menu.LeaderboardsMenu;
|
||||
import com.solexgames.practice.menu.SpectateMenu;
|
||||
import com.solexgames.practice.menu.editor.KitEditorMainMenu;
|
||||
import com.solexgames.practice.menu.editor.KitEditorMenu;
|
||||
|
@ -390,9 +391,8 @@ public class PlayerListener implements Listener {
|
|||
case GOLD_INGOT:
|
||||
new ShopCategoryMenu().openMenu(player);
|
||||
break;
|
||||
case EYE_OF_ENDER:
|
||||
player.sendMessage(CC.RED + "This feature is currently unavailable.");
|
||||
event.setCancelled(true);
|
||||
case PAINTING:
|
||||
new LeaderboardsMenu().openMenu(player);
|
||||
break;
|
||||
case SKULL_ITEM:
|
||||
player.performCommand("party info");
|
||||
|
|
|
@ -33,13 +33,13 @@ public class ItemManager {
|
|||
this.spawnItems = new ItemStack[]{
|
||||
ItemUtil.createItem(Material.IRON_SWORD, CC.GOLD + "Join Unranked Matchmaking" + CC.GRAY + " (Right Click)"),
|
||||
ItemUtil.createItem(Material.DIAMOND_SWORD, CC.GOLD + "Join Ranked Matchmaking" + CC.GRAY + " (Right Click)"),
|
||||
null,
|
||||
null,
|
||||
ItemUtil.createItem(Material.NETHER_STAR, CC.GOLD + "Create a Party" + CC.GRAY + " (Right Click)"),
|
||||
null,
|
||||
ItemUtil.createItem(Material.GOLD_INGOT, CC.GOLD + "Shop" + CC.GRAY + " (Right Click)"),
|
||||
null,
|
||||
ItemUtil.createItem(Material.EYE_OF_ENDER, CC.GOLD + "Daily Challenges" + CC.GRAY + " (Right Click)"),
|
||||
ItemUtil.createItem(Material.BOOK, CC.GOLD + "Kit Editor" + CC.GRAY + " (Right Click)"),
|
||||
ItemUtil.createItem(Material.EMERALD, CC.GOLD + "Settings" + CC.GRAY + " (Right Click)")
|
||||
ItemUtil.createItem(Material.PAINTING, CC.GOLD + "Leaderboards" + CC.GRAY + " (Right Click)"),
|
||||
ItemUtil.createItem(Material.BOOK, CC.GOLD + "Kit Editor" + CC.GRAY + " (Right Click)")
|
||||
};
|
||||
this.queueItems = new ItemStack[]{
|
||||
null,
|
||||
|
|
|
@ -272,12 +272,10 @@ public class PlayerManager {
|
|||
player.setFlying(true);
|
||||
}
|
||||
|
||||
Schedulers.sync().runLater(() -> {
|
||||
this.plugin.getServer().getOnlinePlayers().forEach(other -> {
|
||||
Schedulers.sync().runLater(() -> this.plugin.getServer().getOnlinePlayers().forEach(other -> {
|
||||
Practice.getInstance().getEntityHider().hideEntity(player, other);
|
||||
Practice.getInstance().getEntityHider().hideEntity(other, player);
|
||||
});
|
||||
}, 1L);
|
||||
}), 1L);
|
||||
}
|
||||
|
||||
public void sendToSpawnAndReset(Player player) {
|
||||
|
|
Loading…
Reference in New Issue