Merge branch 'develop' into spigot_api

This commit is contained in:
tastybento 2022-11-26 23:05:17 -08:00 committed by GitHub
commit 587ceccaf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -57,6 +57,11 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "boxed.broadcast-advancements")
private boolean broadcastAdvancements;
@ConfigComment("Deny advancements for visitors.")
@ConfigComment("Visitors cannot get an advancement. Note visitors will still get the reward, e.g., experience")
@ConfigEntry(path = "boxed.deny-visitor-advancements")
private boolean denyVisitorAdvancements = true;
/* WORLD */
@ConfigComment("Friendly name for this world. Used in admin commands. Must be a single word")
@ConfigEntry(path = "world.friendly-name")

View File

@ -80,7 +80,7 @@ public class AdvancementListener implements Listener {
if (Util.sameWorld(e.getPlayer().getWorld(), addon.getOverWorld())) {
// Only allow members or higher to get advancements in a box
if (!addon.getIslands().getIslandAt(e.getPlayer().getLocation()).map(i -> i.getMemberSet().contains(e.getPlayer().getUniqueId())).orElse(false)) {
if (addon.getSettings().isDenyVisitorAdvancements() && !addon.getIslands().getIslandAt(e.getPlayer().getLocation()).map(i -> i.getMemberSet().contains(e.getPlayer().getUniqueId())).orElse(false)) {
// Remove advancement from player
e.getAdvancement().getCriteria().forEach(c ->
e.getPlayer().getAdvancementProgress(e.getAdvancement()).revokeCriteria(c));

View File

@ -18,6 +18,9 @@ boxed:
# Announce advancements. We recommend you set the game rule `/gamerule announceAdvancements false`
# but that blocks all new advancement announcements. This setting tells Boxed to broadcast new advancements.
broadcast-advancements: false
# Deny advancements for visitors.
# Visitors cannot get an advancement. Note visitors will still get the reward, e.g., experience
deny-visitor-advancements: true
world:
# Friendly name for this world. Used in admin commands. Must be a single word
friendly-name: Boxed