mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 22:16:22 +00:00
leave & join
This commit is contained in:
1 parent
f62350ab68
commit
46ba7512ac
22 files changed
+402
-4
No files matched your search
@@ -155,4 +155,22 @@ public class PaperUserManager implements UserManager<CarbonPlayerPaper>, SaveOnC
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addLeftChannel(final UUID id, final Key channel) {
|
||||
if (this.proxiedUserManager instanceof SaveOnChange saveOnChange) {
|
||||
return saveOnChange.addLeftChannel(id, channel);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeLeftChannel(final UUID id, final Key channel) {
|
||||
if (this.proxiedUserManager instanceof SaveOnChange saveOnChange) {
|
||||
return saveOnChange.removeLeftChannel(id, channel);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,15 +21,18 @@ package net.draycia.carbon.paper.users;
|
||||
|
||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import net.draycia.carbon.api.channels.ChatChannel;
|
||||
import net.draycia.carbon.api.users.CarbonPlayer;
|
||||
import net.draycia.carbon.api.util.InventorySlot;
|
||||
import net.draycia.carbon.common.users.CarbonPlayerCommon;
|
||||
import net.draycia.carbon.common.users.WrappedCarbonPlayer;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.audience.ForwardingAudience;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -180,6 +183,21 @@ public final class CarbonPlayerPaper extends WrappedCarbonPlayer implements Forw
|
||||
return this.hasVanishMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Key> leftChannels() {
|
||||
return this.carbonPlayerCommon.leftChannels();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void joinChannel(final ChatChannel channel) {
|
||||
this.carbonPlayerCommon.joinChannel(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leaveChannel(final ChatChannel channel) {
|
||||
this.carbonPlayerCommon.leaveChannel(channel);
|
||||
}
|
||||
|
||||
// Supported by PremiumVanish, SuperVanish, VanishNoPacket
|
||||
private boolean hasVanishMeta() {
|
||||
return this.player().stream()
|
||||
|
||||
Reference in new issue
Block a user