-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New features: - Added {prefix} support to all messages - Added unformatted player names for kill and bed destroy message - Added unbreakable to mellee weapons #245 - Addded Elytra auto equip #663 - add toggle for halloween special (#632) - Added Placeholders to upgrade message #668 For developers: - add sidebar init event - exposed sidebar to the API - fix team identifier length (Sidebar kick issue (#682, #666 ) - Fix Moneys reward team-support on Solo & update variables names - Bug fixes and placeholder adjustments (#685) - Fixed command error when lobby location is not set - Fixed spanish translation error #599 - Fixed spanish translation error #599 - Netherite armor support in 1.16+ #657 - Wins placeholder not in lobby sidebar #658 - Sidebar Title animation not working #660 - Player levels showing numbers #661 - Fixed In-game arena Scoreboard lines in the wrong spot #662 - NPE when clicking outside of shop inventory #664 - Added Placeholders to upgrade message #668 - Fixed players can collect drops during respawn #669 --------- Co-authored-by: Tom Keuper <tomkeuper@live.nl> Co-authored-by: Yuri <84080587+Xxyuri2005xX@users.noreply.github.com>
- Loading branch information
1 parent
767a050
commit f71953d
Showing
45 changed files
with
797 additions
and
728 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...s-api/src/main/java/com/andrei1058/bedwars/api/events/sidebar/PlayerSidebarInitEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.andrei1058.bedwars.api.events.sidebar; | ||
|
||
import com.andrei1058.bedwars.api.sidebar.ISidebar; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class PlayerSidebarInitEvent extends Event implements Cancellable { | ||
|
||
private static final HandlerList HANDLERS = new HandlerList(); | ||
private boolean cancelled = false; | ||
|
||
private Player player; | ||
private ISidebar sidebar; | ||
|
||
public PlayerSidebarInitEvent(Player player, ISidebar sidebar) { | ||
this.player = player; | ||
this.sidebar = sidebar; | ||
} | ||
|
||
public HandlerList getHandlers() { | ||
return HANDLERS; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return HANDLERS; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return cancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancel) { | ||
this.cancelled = cancel; | ||
} | ||
|
||
public Player getPlayer() { | ||
return player; | ||
} | ||
|
||
public void setPlayer(Player player) { | ||
this.player = player; | ||
} | ||
|
||
public ISidebar getSidebar() { | ||
return sidebar; | ||
} | ||
|
||
public void setSidebar(ISidebar sidebar) { | ||
this.sidebar = sidebar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
bedwars-api/src/main/java/com/andrei1058/bedwars/api/sidebar/ISidebar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.andrei1058.bedwars.api.sidebar; | ||
|
||
import com.andrei1058.bedwars.api.arena.IArena; | ||
import com.andrei1058.spigot.sidebar.PlaceholderProvider; | ||
import com.andrei1058.spigot.sidebar.Sidebar; | ||
import com.andrei1058.spigot.sidebar.SidebarLine; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
public interface ISidebar { | ||
|
||
/** | ||
* Sidebar holder. | ||
*/ | ||
Player getPlayer(); | ||
|
||
/** | ||
* Coincides with the arena where the player is on. | ||
*/ | ||
@Nullable | ||
IArena getArena(); | ||
|
||
/** | ||
* Get sidebar lib handle. | ||
*/ | ||
Sidebar getHandle(); | ||
|
||
/** | ||
* Set sidebar content. | ||
*/ | ||
void setContent(List<String> titleArray, List<String> lineArray, @Nullable IArena arena); | ||
|
||
/** | ||
* Convert an animated string to an object. | ||
*/ | ||
SidebarLine normalizeTitle(@Nullable List<String> titleArray); | ||
|
||
/** | ||
* Convert string lines to string objects. | ||
*/ | ||
@NotNull List<SidebarLine> normalizeLines(@NotNull List<String> lineArray); | ||
|
||
/** | ||
* Will update tab prefix and suffix for the given player on current sidebar. | ||
* | ||
* @param player format given player on current holder's sidebar. | ||
* @param skipStateCheck will skip checking if tab formatting is disabled. | ||
*/ | ||
void giveUpdateTabFormat(@NotNull Player player, boolean skipStateCheck); | ||
|
||
|
||
/** | ||
* @return true if tab formatting is disabled for current sidebar/ arena stage | ||
*/ | ||
boolean isTabFormattingDisabled(); | ||
|
||
/** | ||
* Register a placeholder that is not going to be removed trough game state changes. | ||
*/ | ||
boolean registerPersistentPlaceholder(PlaceholderProvider placeholderProvider); | ||
} |
51 changes: 51 additions & 0 deletions
51
bedwars-api/src/main/java/com/andrei1058/bedwars/api/sidebar/ISidebarService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.andrei1058.bedwars.api.sidebar; | ||
|
||
import com.andrei1058.bedwars.api.arena.IArena; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* BedWars scoreboard manager. | ||
*/ | ||
public interface ISidebarService { | ||
|
||
/** | ||
* Send player scoreboard based on conditions. | ||
*/ | ||
void giveSidebar(@NotNull Player player, @Nullable IArena arena, boolean delay); | ||
|
||
/** | ||
* Remove a player scoreboard. | ||
*/ | ||
void remove(@NotNull Player player); | ||
|
||
/** | ||
* Refresh title on all scoreboards. | ||
*/ | ||
void refreshTitles(); | ||
|
||
/** | ||
* Refresh placeholders on all sidebars. | ||
*/ | ||
void refreshPlaceholders(); | ||
|
||
/** | ||
* Refresh placeholders for sidebars in a given arena; | ||
*/ | ||
void refreshPlaceholders(IArena arena); | ||
|
||
/** | ||
* Refresh all tab-list header and footer strings for every sidebar. | ||
*/ | ||
void refreshTabList(); | ||
|
||
/** | ||
* Refresh player healths. | ||
*/ | ||
void refreshHealth(); | ||
|
||
@Nullable | ||
ISidebar getSidebar(@NotNull Player player); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.