Added dimension indication to tab list
Some checks failed
build / build (push) Has been cancelled

This commit is contained in:
2025-03-18 16:06:43 +01:00
parent 0ee3031742
commit 4894b7d389
8 changed files with 171 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.Text;
import net.minecraft.world.GameMode;
import wtf.hak.survivalfabric.utils.DimensionTeams;
import java.util.HashMap;
import java.util.Map;
@ -35,6 +36,7 @@ public class SpectatorCommand {
player.teleport(data.world, data.x, data.y, data.z, Set.of(), data.yaw, data.pitch, false);
player.changeGameMode(GameMode.SURVIVAL);
spectating.remove(player);
DimensionTeams.assignCorrectTeam(player, data.world.getRegistryKey().getValue().toTranslationKey());
} else {
spectating.put(player, new LocationData(player
@ -45,6 +47,7 @@ public class SpectatorCommand {
.getPitch(), player
.getServerWorld()));
player.changeGameMode(GameMode.SPECTATOR);
DimensionTeams.assignCorrectTeam(player, "");
}
return 1;
}