mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2025-02-21 02:31:37 +01:00
Cleanup
This commit is contained in:
parent
70da6026af
commit
938058f02c
@ -25,18 +25,12 @@ import com.discordsrv.common.util.ComponentUtil;
|
||||
import com.discordsrv.fabric.FabricDiscordSRV;
|
||||
import com.discordsrv.fabric.module.AbstractFabricModule;
|
||||
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.translation.GlobalTranslator;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
public class FabricDeathModule extends AbstractFabricModule {
|
||||
private final FabricDiscordSRV discordSRV;
|
||||
|
||||
|
@ -21,16 +21,12 @@ package com.discordsrv.fabric.module.chat;
|
||||
import com.discordsrv.api.component.MinecraftComponent;
|
||||
import com.discordsrv.api.events.message.receive.game.JoinMessageReceiveEvent;
|
||||
import com.discordsrv.api.player.DiscordSRVPlayer;
|
||||
import com.discordsrv.common.feature.bansync.BanSyncModule;
|
||||
import com.discordsrv.common.util.ComponentUtil;
|
||||
import com.discordsrv.fabric.FabricDiscordSRV;
|
||||
import com.discordsrv.fabric.module.AbstractFabricModule;
|
||||
import com.discordsrv.fabric.requiredlinking.FabricRequiredLinkingModule;
|
||||
import net.fabricmc.fabric.api.networking.v1.PacketSender;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.translation.GlobalTranslator;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
@ -38,7 +34,6 @@ import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class FabricJoinModule extends AbstractFabricModule {
|
||||
@ -58,14 +53,14 @@ public class FabricJoinModule extends AbstractFabricModule {
|
||||
if (!enabled) return;
|
||||
|
||||
FabricRequiredLinkingModule module = discordSRV.getModule(FabricRequiredLinkingModule.class);
|
||||
if(module != null && !module.isLoginCancelled(serverPlayNetworkHandler.player.getUuid())) {
|
||||
if(module != null && module.isLoginCancelled(serverPlayNetworkHandler.player.getUuid())) {
|
||||
module.removeLoginCancelled(serverPlayNetworkHandler.player.getUuid());
|
||||
return;
|
||||
}
|
||||
|
||||
ServerPlayerEntity playerEntity = serverPlayNetworkHandler.player;
|
||||
MinecraftComponent component = getJoinMessage(playerEntity);
|
||||
boolean firstJoin = !Objects.requireNonNull(minecraftServer.getUserCache()).findByName(serverPlayNetworkHandler.player.getGameProfile().getName()).isPresent();
|
||||
boolean firstJoin = Objects.requireNonNull(minecraftServer.getUserCache()).findByName(serverPlayNetworkHandler.player.getGameProfile().getName()).isEmpty();
|
||||
|
||||
DiscordSRVPlayer player = discordSRV.playerProvider().player(playerEntity);
|
||||
discordSRV.eventBus().publish(
|
||||
|
@ -20,23 +20,16 @@ package com.discordsrv.fabric.module.chat;
|
||||
|
||||
import com.discordsrv.api.component.MinecraftComponent;
|
||||
import com.discordsrv.api.events.message.receive.game.LeaveMessageReceiveEvent;
|
||||
import com.discordsrv.api.player.DiscordSRVPlayer;
|
||||
import com.discordsrv.common.util.ComponentUtil;
|
||||
import com.discordsrv.fabric.FabricDiscordSRV;
|
||||
import com.discordsrv.fabric.module.AbstractFabricModule;
|
||||
import com.discordsrv.fabric.player.FabricPlayer;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.translation.GlobalTranslator;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class FabricQuitModule extends AbstractFabricModule {
|
||||
private final FabricDiscordSRV discordSRV;
|
||||
@ -47,7 +40,6 @@ public class FabricQuitModule extends AbstractFabricModule {
|
||||
}
|
||||
|
||||
public void register() {
|
||||
// First phase
|
||||
ServerPlayConnectionEvents.DISCONNECT.register(this::onDisconnect);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user