Disable Vanish.
This commit is contained in:
@@ -92,7 +92,7 @@ public final class HubPlugin extends JavaPlugin {
|
||||
protected void start() {
|
||||
this.worldService = new HubWorldService(config);
|
||||
HubJoinListener joinListener = new HubJoinListener(config, filter);
|
||||
HubMessageListener messageListener = new HubMessageListener(config, filter, resolveVanishService());
|
||||
HubMessageListener messageListener = new HubMessageListener(config, filter, /* vanish disabled */ null);
|
||||
this.hudVisibility = new HubHudVisibility(config.inventory.hidden_hud_components);
|
||||
hudVisibility.setChangeListener(this::onHudVisibilityChange);
|
||||
HubInventoryListener inventoryListener = new HubInventoryListener(config.inventory, filter, hudVisibility);
|
||||
@@ -214,6 +214,7 @@ public final class HubPlugin extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
/* Vanish system disabled — VanishService integration commented out.
|
||||
@javax.annotation.Nullable
|
||||
private Object resolveVanishService() {
|
||||
try {
|
||||
@@ -228,6 +229,7 @@ public final class HubPlugin extends JavaPlugin {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
private void showXpHud(@Nonnull PlayerReadyEvent event) {
|
||||
Ref<EntityStore> ref = event.getPlayerRef();
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.kewwbec.hub.util.HubMessageFormatter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.Method;
|
||||
// import java.lang.reflect.Method; // Vanish system disabled.
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -27,25 +27,28 @@ public final class HubMessageListener {
|
||||
|
||||
private final HubConfig config;
|
||||
private final HubWorldFilter filter;
|
||||
@Nullable private final Object vanish;
|
||||
@Nullable private final Method isVanished;
|
||||
// Vanish system disabled.
|
||||
// @Nullable private final Object vanish;
|
||||
// @Nullable private final Method isVanished;
|
||||
|
||||
public HubMessageListener(@Nonnull HubConfig config,
|
||||
@Nonnull HubWorldFilter filter,
|
||||
@Nullable Object vanish) {
|
||||
this.config = config;
|
||||
this.filter = filter;
|
||||
this.vanish = vanish;
|
||||
this.isVanished = resolveIsVanished(vanish);
|
||||
// Vanish system disabled.
|
||||
// this.vanish = vanish;
|
||||
// this.isVanished = resolveIsVanished(vanish);
|
||||
}
|
||||
|
||||
public void onAdd(@Nonnull AddPlayerToWorldEvent event) {
|
||||
if (!filter.isHub(event.getWorld())) return;
|
||||
Subject s = resolveSubject(event.getHolder());
|
||||
if (isVanished(s.uuid)) {
|
||||
event.setBroadcastJoinMessage(false);
|
||||
return;
|
||||
}
|
||||
// Vanish system disabled.
|
||||
// if (isVanished(s.uuid)) {
|
||||
// event.setBroadcastJoinMessage(false);
|
||||
// return;
|
||||
// }
|
||||
String template = config.messages.join_announcement;
|
||||
if (template == null || template.isBlank()) {
|
||||
event.setBroadcastJoinMessage(false);
|
||||
@@ -58,10 +61,11 @@ public final class HubMessageListener {
|
||||
public void onRemove(@Nonnull RemovedPlayerFromWorldEvent event) {
|
||||
if (!filter.isHub(event.getWorld())) return;
|
||||
Subject s = resolveSubject(event.getHolder());
|
||||
if (isVanished(s.uuid)) {
|
||||
event.setBroadcastLeaveMessage(false);
|
||||
return;
|
||||
}
|
||||
// Vanish system disabled.
|
||||
// if (isVanished(s.uuid)) {
|
||||
// event.setBroadcastLeaveMessage(false);
|
||||
// return;
|
||||
// }
|
||||
String template = config.messages.leave_announcement;
|
||||
if (template == null || template.isBlank()) {
|
||||
event.setBroadcastLeaveMessage(false);
|
||||
@@ -79,6 +83,7 @@ public final class HubMessageListener {
|
||||
return new Subject(ref.getUsername(), ref.getUuid());
|
||||
}
|
||||
|
||||
/* Vanish system disabled.
|
||||
private boolean isVanished(@Nonnull UUID uuid) {
|
||||
if (vanish == null || isVanished == null) {
|
||||
return false;
|
||||
@@ -102,6 +107,7 @@ public final class HubMessageListener {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
private record Subject(@Nonnull String name, @Nonnull UUID uuid) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user