Skip to content

Commit

Permalink
[#34] Add deprecation text to old notification system
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeinerLP committed May 26, 2024
1 parent 58cfe2b commit 29eb52f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ private void addPlayer(@NotNull Player player) {
*/
private void removePlayer(@NotNull Player player) {
final UUID uuid = player.getUuid();
if (!PLAYER_TAB_MAP.containsKey(uuid)) {
return;
}
Set<AdvancementTab> tabs = PLAYER_TAB_MAP.get(uuid);
if (tabs == null) return;
tabs.remove(this);
if (tabs.isEmpty()) {
PLAYER_TAB_MAP.remove(uuid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

/**
* Represents a message which can be sent using the {@link NotificationCenter}.
* @deprecated As of Minestom 22a8ccabfae38c53df0605000aa7eed49765c1ab, because the Maintainability is very hard and
* can break everytime from Mojang side because bad api design use {@link net.minestom.server.notifications.Notification#builder()} instead.
*/
@Deprecated(since = "1.4.1", forRemoval = true)
public record Notification(@NotNull Component title, @NotNull FrameType frameType, @NotNull ItemStack icon) {
public Notification(@NotNull Component title, @NotNull FrameType frameType, @NotNull Material icon) {
this(title, frameType, ItemStack.of(icon));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
* Works by sending a completed advancement and remove it immediately.
* <p>
* You can simply create a {@link Notification} object and call {@link #send(Notification, Player)}.
* @deprecated As of Minestom 22a8ccabfae38c53df0605000aa7eed49765c1ab, because the Maintainability is very hard and
* can break everytime from Mojang side because bad api design use {@link net.minestom.server.notifications.Notification#builder()} instead.
*/
@Deprecated(since = "1.4.1", forRemoval = true)
public final class NotificationCenter {
private static final String IDENTIFIER = "minestom:notification";
private static final AdvancementsPacket REMOVE_PACKET = new AdvancementsPacket(false, List.of(), List.of(IDENTIFIER), List.of());
Expand Down

0 comments on commit 29eb52f

Please sign in to comment.