File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/org/mvplugins/multiverse/inventories/share Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 22
33import com .dumptruckman .minecraft .util .Logging ;
44import com .google .common .collect .Sets ;
5+ import org .bukkit .GameRule ;
56import org .bukkit .Material ;
67import org .bukkit .advancement .AdvancementProgress ;
78import org .jetbrains .annotations .ApiStatus ;
@@ -739,6 +740,10 @@ public boolean updatePlayer(Player player, ProfileData profile) {
739740 int totalExperience = player .getTotalExperience ();
740741 int level = player .getLevel ();
741742 float exp = player .getExp ();
743+ boolean announceAdvancements = Boolean .TRUE .equals (player .getWorld ().getGameRuleValue (GameRule .ANNOUNCE_ADVANCEMENTS ));
744+ if (announceAdvancements ) {
745+ player .getWorld ().setGameRule (GameRule .ANNOUNCE_ADVANCEMENTS , false );
746+ }
742747
743748 Bukkit .advancementIterator ().forEachRemaining (advancement -> {
744749 AdvancementProgress advancementProgress = player .getAdvancementProgress (advancement );
@@ -758,6 +763,9 @@ public boolean updatePlayer(Player player, ProfileData profile) {
758763 player .setExp (exp );
759764 player .setLevel (level );
760765 player .setTotalExperience (totalExperience );
766+ if (announceAdvancements ) {
767+ player .getWorld ().setGameRule (GameRule .ANNOUNCE_ADVANCEMENTS , true );
768+ }
761769
762770 return advancements != null ;
763771 }
You can’t perform that action at this time.
0 commit comments