upload v2

This commit is contained in:
Matheus 2024-06-13 18:26:38 -04:00
parent dfd880b935
commit 3aa867486d
7 changed files with 46 additions and 14 deletions

View File

@ -4,6 +4,7 @@ import com.solexgames.core.CorePlugin;
import com.solexgames.lib.acf.ConditionFailedException; import com.solexgames.lib.acf.ConditionFailedException;
import com.solexgames.lib.acf.PaperCommandManager; import com.solexgames.lib.acf.PaperCommandManager;
import com.solexgames.lib.commons.command.context.CommonsPlayer; 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.arena.Arena;
import com.solexgames.practice.board.BoardAdapter; import com.solexgames.practice.board.BoardAdapter;
import com.solexgames.practice.commands.*; 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.spawn.SpawnCommand;
import com.solexgames.practice.commands.time.TimeCommand; import com.solexgames.practice.commands.time.TimeCommand;
import com.solexgames.practice.comphenix.EntityHider; import com.solexgames.practice.comphenix.EntityHider;
import com.solexgames.practice.config.PracticeConfig;
import com.solexgames.practice.ffa.FFAManager; import com.solexgames.practice.ffa.FFAManager;
import com.solexgames.practice.kit.Kit; import com.solexgames.practice.kit.Kit;
import com.solexgames.practice.listeners.*; import com.solexgames.practice.listeners.*;
@ -85,8 +87,11 @@ public class Practice extends ExtendedJavaPlugin {
private boolean rankedEnabled = true; private boolean rankedEnabled = true;
private boolean eventsEnabled = true; private boolean eventsEnabled = true;
private boolean holanda = false;
private String loadingString = "."; private String loadingString = ".";
private final ConfigFactory factory = ConfigFactory.newFactory(this);
private PracticeConfig pracConfig;
@Override @Override
public void enable() { public void enable() {
@ -98,6 +103,8 @@ public class Practice extends ExtendedJavaPlugin {
this.registerListeners(); this.registerListeners();
this.registerManagers(); this.registerManagers();
pracConfig = factory.fromFile("settings", PracticeConfig.class);
holanda = pracConfig.isHolanda();
// an alternative to bukkit's default entity hider system // an alternative to bukkit's default entity hider system
this.entityHider = new EntityHider(this, EntityHider.Policy.BLACKLIST); this.entityHider = new EntityHider(this, EntityHider.Policy.BLACKLIST);
@ -144,6 +151,8 @@ public class Practice extends ExtendedJavaPlugin {
this.kitManager.saveKits(); this.kitManager.saveKits();
this.spawnManager.saveAsyncLocationsToConfig(); this.spawnManager.saveAsyncLocationsToConfig();
this.pracConfig.setHolanda(holanda);
this.factory.save("settings", this.pracConfig);
} }
public boolean isKitPairedWithArena(Kit kit, Arena arena) { public boolean isKitPairedWithArena(Kit kit, Arena arena) {

View File

@ -58,7 +58,7 @@ public class BoardAdapter implements ScoreboardElementHandler {
} }
element.add(" "); 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); element.add(CC.SB_LINE);
return element; return element;

View File

@ -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") @CommandAlias("toggleevents")
@CommandPermission("practice.command.event.toggle") @CommandPermission("practice.command.event.toggle")
public void onEventToggle(Player player) { public void onEventToggle(Player player) {

View File

@ -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;
}

View File

@ -17,6 +17,7 @@ import com.solexgames.practice.match.Match;
import com.solexgames.practice.match.MatchState; import com.solexgames.practice.match.MatchState;
import com.solexgames.practice.menu.EventHostMenu; import com.solexgames.practice.menu.EventHostMenu;
import com.solexgames.practice.menu.JoinQueueMenu; import com.solexgames.practice.menu.JoinQueueMenu;
import com.solexgames.practice.menu.LeaderboardsMenu;
import com.solexgames.practice.menu.SpectateMenu; import com.solexgames.practice.menu.SpectateMenu;
import com.solexgames.practice.menu.editor.KitEditorMainMenu; import com.solexgames.practice.menu.editor.KitEditorMainMenu;
import com.solexgames.practice.menu.editor.KitEditorMenu; import com.solexgames.practice.menu.editor.KitEditorMenu;
@ -390,9 +391,8 @@ public class PlayerListener implements Listener {
case GOLD_INGOT: case GOLD_INGOT:
new ShopCategoryMenu().openMenu(player); new ShopCategoryMenu().openMenu(player);
break; break;
case EYE_OF_ENDER: case PAINTING:
player.sendMessage(CC.RED + "This feature is currently unavailable."); new LeaderboardsMenu().openMenu(player);
event.setCancelled(true);
break; break;
case SKULL_ITEM: case SKULL_ITEM:
player.performCommand("party info"); player.performCommand("party info");

View File

@ -33,13 +33,13 @@ public class ItemManager {
this.spawnItems = new ItemStack[]{ this.spawnItems = new ItemStack[]{
ItemUtil.createItem(Material.IRON_SWORD, CC.GOLD + "Join Unranked Matchmaking" + CC.GRAY + " (Right Click)"), 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)"), 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)"), ItemUtil.createItem(Material.NETHER_STAR, CC.GOLD + "Create a Party" + CC.GRAY + " (Right Click)"),
null, null,
ItemUtil.createItem(Material.GOLD_INGOT, CC.GOLD + "Shop" + CC.GRAY + " (Right Click)"),
null, null,
ItemUtil.createItem(Material.EYE_OF_ENDER, CC.GOLD + "Daily Challenges" + 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)"), ItemUtil.createItem(Material.BOOK, CC.GOLD + "Kit Editor" + CC.GRAY + " (Right Click)")
ItemUtil.createItem(Material.EMERALD, CC.GOLD + "Settings" + CC.GRAY + " (Right Click)")
}; };
this.queueItems = new ItemStack[]{ this.queueItems = new ItemStack[]{
null, null,

View File

@ -272,12 +272,10 @@ public class PlayerManager {
player.setFlying(true); player.setFlying(true);
} }
Schedulers.sync().runLater(() -> { Schedulers.sync().runLater(() -> this.plugin.getServer().getOnlinePlayers().forEach(other -> {
this.plugin.getServer().getOnlinePlayers().forEach(other -> { Practice.getInstance().getEntityHider().hideEntity(player, other);
Practice.getInstance().getEntityHider().hideEntity(player, other); Practice.getInstance().getEntityHider().hideEntity(other, player);
Practice.getInstance().getEntityHider().hideEntity(other, player); }), 1L);
});
}, 1L);
} }
public void sendToSpawnAndReset(Player player) { public void sendToSpawnAndReset(Player player) {