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