Skip to content

Commit

Permalink
Fix toats not showing up (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowan-vr authored Apr 15, 2023
1 parent bbcfbe1 commit a372792
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ default CompletableFuture<Void> sendAdvancementPacket(Player player, boolean cle

sendAdvancementPacketImpl(player, clear,
new ArrayList<>(),
remove,
new HashSet<>(), // Do not send removal as this removes the children too, we don't want that.
new HashMap<>()
).join();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public CompletableFuture<Void> sendAdvancements(Player player, boolean clear) {
new TextComponent(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
!advancement.isAnnounced(player) && displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
Expand Down Expand Up @@ -282,7 +282,7 @@ public CompletableFuture<Void> updateAdvancement(Player player, CAdvancement...
new TextComponent(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
!advancement.isAnnounced(player) && displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public CompletableFuture<Void> sendAdvancements(Player player, boolean clear) {
new TextComponent(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
!advancement.isAnnounced(player) && displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
Expand Down Expand Up @@ -286,7 +286,7 @@ public CompletableFuture<Void> updateAdvancement(Player player, CAdvancement...
new TextComponent(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
!advancement.isAnnounced(player) && displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public CompletableFuture<Void> sendAdvancements(Player player, boolean clear) {
new TextComponent(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
Expand Down Expand Up @@ -282,7 +282,7 @@ public CompletableFuture<Void> updateAdvancement(Player player, CAdvancement...
new TextComponent(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public CompletableFuture<Void> loadAdvancements(List<AdvancementTree> trees) {
Component.literal(cAdvancement.getDescription() == null ? "No Description Set" : cAdvancement.getDescription(null)),
null,
getFrameType(cAdvancement.getMinecraftGuiFrame().getValue()),
false,
false,
cAdvancement.isMinecraftChatAnnounce(),
cAdvancement.isHidden());

Expand Down Expand Up @@ -190,10 +190,12 @@ public CompletableFuture<Void> sendAdvancements(Player player, boolean clear) {
Component.literal(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
System.out.println(updatedAdv.getId() + ":[Announced] " + advancement.isAnnounced(player));
System.out.println(updatedAdv.getId() + ":[Show Toast] " + updatedAdv.getDisplay().shouldShowToast());
updatedAdv.getDisplay().setLocation(displayInfo.getX(), displayInfo.getY());
sending.add(updatedAdv);

Expand Down Expand Up @@ -283,7 +285,7 @@ public CompletableFuture<Void> updateAdvancement(Player player, CAdvancement...
Component.literal(advancement.getDescription(player)),
displayInfo.getBackground(),
displayInfo.getFrame(),
!advancement.isAnnounced(player) && displayInfo.shouldShowToast(),
!advancement.isAnnounced(player) && advancement.isMinecraftToast(),
displayInfo.shouldAnnounceChat(),
displayInfo.isHidden()
).parent(adv.getParent()).build(location);
Expand Down

0 comments on commit a372792

Please sign in to comment.