mensagens mais bonitas, blocos sumindo depois de 3 minutos apenas, etc..
This commit is contained in:
parent
2c0718aa82
commit
20a1658781
|
@ -1,23 +1,17 @@
|
|||
package land.battle.practice.board;
|
||||
|
||||
import com.solexgames.core.CorePlugin;
|
||||
import com.solexgames.core.player.PotPlayer;
|
||||
import com.solexgames.core.util.Color;
|
||||
import land.battle.practice.Practice;
|
||||
import land.battle.practice.PracticeConstants;
|
||||
import land.battle.practice.party.Party;
|
||||
import land.battle.practice.player.PlayerData;
|
||||
import land.battle.practice.player.PlayerState;
|
||||
import land.battle.practice.settings.item.SidebarOptionsItemState;
|
||||
import land.battle.practice.util.CC;
|
||||
import io.github.nosequel.scoreboard.element.ScoreboardElement;
|
||||
import io.github.nosequel.scoreboard.element.ScoreboardElementHandler;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* @author BattleLand Team
|
||||
* @since 8/14/2021
|
||||
*/
|
||||
|
||||
public class BoardAdapter implements ScoreboardElementHandler {
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +29,14 @@ public class BoardAdapter implements ScoreboardElementHandler {
|
|||
|
||||
final Party party = Practice.getInstance().getPartyManager().getParty(player.getUniqueId());
|
||||
|
||||
switch (playerData.getOptions().getScoreboardStyle()) {
|
||||
case MODERN:
|
||||
element.add("");
|
||||
break;
|
||||
case OLD:
|
||||
element.add(CC.SB_LINE);
|
||||
break;
|
||||
}
|
||||
|
||||
final boolean queued = this.isState(playerData, PlayerState.QUEUE);
|
||||
|
||||
|
@ -57,10 +58,17 @@ public class BoardAdapter implements ScoreboardElementHandler {
|
|||
PracticeConstants.handleAdapter("editor", element, player, playerData, party);
|
||||
}
|
||||
|
||||
switch (playerData.getOptions().getScoreboardStyle()) {
|
||||
case MODERN:
|
||||
element.add("");
|
||||
element.add(CC.GOLD + (Practice.getInstance().isHolanda() ? "wtap.gg" : "battle.land") + " " + CC.GRAY + " " + CC.GRAY + " ");
|
||||
break;
|
||||
case OLD:
|
||||
element.add("");
|
||||
element.add(CC.GOLD + (Practice.getInstance().isHolanda() ? "wtap.gg" : "battle.land"));
|
||||
element.add(CC.SB_LINE);
|
||||
|
||||
break;
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ package land.battle.practice.flags;
|
|||
public enum Flag {
|
||||
|
||||
DEFAULT,
|
||||
SOUP,
|
||||
HCF,
|
||||
SUMO,
|
||||
BUILD,
|
||||
|
|
|
@ -371,9 +371,9 @@ public class MatchListener implements Listener {
|
|||
|
||||
|
||||
eloMessage = String.join("\n",
|
||||
CC.PINK + "ELO Updates:",
|
||||
CC.GRAY + Constants.THIN_VERTICAL_LINE + " " + CC.GREEN + winnerLeader.getName() + ":" + CC.WHITE + " " + (rankings[0]) + " " + CC.GRAY + "(" + CC.GREEN + "+" + (rankings[0] - winnerElo) + CC.GRAY + ")",
|
||||
CC.GRAY + Constants.THIN_VERTICAL_LINE + " " + CC.RED + loserLeader.getName() + ":" + CC.WHITE + " " + (rankings[1]) + " " + CC.GRAY + "(" + CC.RED + (rankings[1] - loserElo) + CC.GRAY + ")",
|
||||
CC.YELLOW + "ELO Changes:",
|
||||
CC.GRAY + Constants.DOT_SYMBOL + " " + CC.GREEN + winnerLeader.getName() + ":" + CC.WHITE + " " + (rankings[0]) + " " + CC.GRAY + "(" + CC.GREEN + "+" + (rankings[0] - winnerElo) + CC.GRAY + ")",
|
||||
CC.GRAY + Constants.DOT_SYMBOL + " " + CC.RED + loserLeader.getName() + ":" + CC.WHITE + " " + (rankings[1]) + " " + CC.GRAY + "(" + CC.RED + (rankings[1] - loserElo) + CC.GRAY + ")",
|
||||
("")
|
||||
);
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ public class InventorySnapshot extends Menu {
|
|||
)
|
||||
.toButton()
|
||||
);
|
||||
|
||||
buttonMap.put(52, (new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial())).setDurability(15).setDisplayName(" ").toButton());
|
||||
buttonMap.put(46, (new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial())).setDurability(15).setDisplayName(" ").toButton());
|
||||
|
||||
|
|
|
@ -5,37 +5,27 @@ import org.bukkit.Location;
|
|||
import org.bukkit.Material;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
* @author BattleLand Team
|
||||
* @since 5/25/2021
|
||||
*/
|
||||
|
||||
public class BlockRemoveRunnable extends BukkitRunnable {
|
||||
|
||||
private final Location location;
|
||||
|
||||
private int ticks;
|
||||
|
||||
public BlockRemoveRunnable(Location location) {
|
||||
this.location = location;
|
||||
this.ticks = 14;
|
||||
|
||||
this.runTaskTimer(Practice.getInstance(), 20L, 20L);
|
||||
this.ticks = 180;
|
||||
this.runTaskTimer(Practice.getInstance(), 20L, 20L); // Run every 1 second (20 ticks)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
this.ticks--;
|
||||
|
||||
if (this.location == null) {
|
||||
if (this.location == null || this.ticks <= 0) {
|
||||
this.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.ticks == 0) {
|
||||
if (this.location.getBlock() != null) {
|
||||
if (this.location != null && this.location.getBlock() != null) {
|
||||
this.location.getBlock().setType(Material.AIR);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import land.battle.practice.menu.KillMessageMenu;
|
|||
import land.battle.practice.menu.MatchmakingSettingsMenu;
|
||||
import land.battle.practice.player.PlayerData;
|
||||
import land.battle.practice.settings.item.ProfileOptionsItemState;
|
||||
import land.battle.practice.settings.item.SidebarOptionsItemState;
|
||||
import land.battle.practice.util.CC;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -77,6 +78,30 @@ public class PracticeSettingsImpl implements ISettings {
|
|||
})
|
||||
);
|
||||
|
||||
buttonList.add(new ItemBuilder(Material.PAINTING)
|
||||
.setDisplayName(Color.MAIN_COLOR + CC.BOLD + "Sidebar Lines")
|
||||
.addLore(
|
||||
"",
|
||||
CC.GRAY + "would you like a different view",
|
||||
CC.GRAY + "on your scoreboard?",
|
||||
" ",
|
||||
(data.getOptions().getScoreboardStyle().name().equals("OLD") ? CC.GREEN + CC.BOLD + "■ " : CC.DARK_GRAY + CC.BOLD + "■ ") + "&fOld",
|
||||
(data.getOptions().getScoreboardStyle().name().equals("MODERN") ? CC.GREEN + CC.BOLD + "■ " : CC.DARK_GRAY + CC.BOLD + "■ ") + "&fModern"
|
||||
)
|
||||
.toUpdatingButton((player1, clickType) -> {
|
||||
switch (data.getOptions().getScoreboardStyle()) {
|
||||
case OLD:
|
||||
data.getOptions().setScoreboardStyle(SidebarOptionsItemState.OLD);
|
||||
break;
|
||||
case MODERN:
|
||||
data.getOptions().setScoreboardStyle(SidebarOptionsItemState.MODERN);
|
||||
break;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
|
||||
buttonList.add(new ItemBuilder(Material.LEASH)
|
||||
.setDisplayName(Color.MAIN_COLOR + CC.BOLD + "Duel Requests")
|
||||
.addLore(
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package land.battle.practice.settings;
|
||||
|
||||
import land.battle.practice.settings.item.ProfileOptionsItemState;
|
||||
import land.battle.practice.settings.item.SidebarOptionsItemState;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
@ -18,5 +19,7 @@ public class ProfileOptions {
|
|||
private boolean autoGg = true;
|
||||
|
||||
private ProfileOptionsItemState scoreboardState = ProfileOptionsItemState.PING;
|
||||
private SidebarOptionsItemState scoreboardStyle = SidebarOptionsItemState.OLD;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package land.battle.practice.settings.item;
|
||||
|
||||
public enum SidebarOptionsItemState {
|
||||
|
||||
MODERN,
|
||||
OLD,
|
||||
|
||||
}
|
|
@ -29,7 +29,7 @@ public final class CC {
|
|||
public static final String UNDER_LINE = ChatColor.UNDERLINE.toString();
|
||||
public static final String ITALIC = ChatColor.ITALIC.toString();
|
||||
public static final String RESET = ChatColor.RESET.toString();
|
||||
public static final String SB_LINE = ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "-------------------";
|
||||
public static final String SB_LINE = ChatColor.GRAY + ChatColor.STRIKETHROUGH.toString() + "------------------";
|
||||
|
||||
public String translate(String s) {
|
||||
return ChatColor.translateAlternateColorCodes('&', s);
|
||||
|
|
Loading…
Reference in New Issue