Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
e981cf5c02
Commit
65fcb5329f
@ -3,7 +3,6 @@ package de.steamwar.bungeecore.listeners.mods;
|
||||
import de.steamwar.bungeecore.listeners.BasicListener;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.md_5.bungee.protocol.packet.PluginMessage;
|
||||
|
||||
public class Badlion extends BasicListener {
|
||||
|
||||
@ -27,6 +26,6 @@ public class Badlion extends BasicListener {
|
||||
}
|
||||
*/
|
||||
|
||||
event.getPlayer().unsafe().sendPacket(new PluginMessage("badlion:mods", ("{\"Clear Glass\":{\"disabled\":true},\"ClearWater\":{\"disabled\":true},\"FOV Changer\":{\"disabled\":true},\"Hitboxes\":{\"disabled\":true},\"MiniMap\":{\"disabled\":true},\"MLG Cobweb\":{\"disabled\":true},\"Replay\":{\"disabled\":true},\"Schematica\":{\"disabled\":true},\"ToggleSneak\":{\"disabled\":true},\"ToggleSprint\":{\"disabled\":true},\"TNT Time\":{\"disabled\":true}}").getBytes(), false));
|
||||
event.getPlayer().sendData("badlion:mods", ("{\"Clear Glass\":{\"disabled\":true},\"ClearWater\":{\"disabled\":true},\"FOV Changer\":{\"disabled\":true},\"Hitboxes\":{\"disabled\":true},\"MiniMap\":{\"disabled\":true},\"MLG Cobweb\":{\"disabled\":true},\"Replay\":{\"disabled\":true},\"Schematica\":{\"disabled\":true},\"ToggleSneak\":{\"disabled\":true},\"ToggleSprint\":{\"disabled\":true},\"TNT Time\":{\"disabled\":true}}").getBytes());
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.handler.codec.MessageToMessageDecoder;
|
||||
import net.md_5.bungee.ServerConnection;
|
||||
import net.md_5.bungee.UserConnection;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
@ -68,10 +69,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
if (connection == null)
|
||||
return;
|
||||
|
||||
player.unsafe().sendPacket(new PlayerListHeaderFooter(
|
||||
ComponentSerializer.toString(header(viewer, seconds)),
|
||||
ComponentSerializer.toString(viewer.parse(false, "TABLIST_FOOTER", connection.getInfo().getName(), ping(), ProxyServer.getInstance().getPlayers().size()))
|
||||
));
|
||||
player.setTabHeader(header(viewer, seconds), viewer.parse(false, "TABLIST_FOOTER", connection.getInfo().getName(), ping(), ProxyServer.getInstance().getPlayers().size()));
|
||||
|
||||
List<TablistPart.Item> tablist = new ArrayList<>();
|
||||
List<TablistPart.Item> direct = new ArrayList<>();
|
||||
@ -168,7 +166,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
pipeline.remove("steamwar-tablist");
|
||||
|
||||
pipeline.addBefore(PipelineUtils.BOSS_HANDLER, "steamwar-tablist", this);
|
||||
player.unsafe().sendPacket(teamPacket);
|
||||
sendQueued(player, teamPacket);
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,16 +310,16 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
PlayerListItem packet = new PlayerListItem();
|
||||
packet.setAction(action);
|
||||
packet.setItems(items.toArray(new PlayerListItem.Item[0]));
|
||||
player.unsafe().sendPacket(packet);
|
||||
sendQueued(player, packet);
|
||||
} else if(action == PlayerListItem.Action.REMOVE_PLAYER) {
|
||||
PlayerListItemRemove packet = new PlayerListItemRemove();
|
||||
packet.setUuids(items.stream().map(PlayerListItem.Item::getUuid).toArray(UUID[]::new));
|
||||
player.unsafe().sendPacket(packet);
|
||||
sendQueued(player, packet);
|
||||
} else {
|
||||
PlayerListItemUpdate packet = new PlayerListItemUpdate();
|
||||
packet.setActions(action == PlayerListItem.Action.UPDATE_DISPLAY_NAME ? EnumSet.of(PlayerListItemUpdate.Action.UPDATE_DISPLAY_NAME, PlayerListItemUpdate.Action.UPDATE_LISTED) : EnumSet.of(PlayerListItemUpdate.Action.ADD_PLAYER, PlayerListItemUpdate.Action.UPDATE_DISPLAY_NAME, PlayerListItemUpdate.Action.UPDATE_LATENCY, PlayerListItemUpdate.Action.UPDATE_LISTED, PlayerListItemUpdate.Action.UPDATE_GAMEMODE));
|
||||
packet.setItems(items.toArray(new PlayerListItem.Item[0]));
|
||||
player.unsafe().sendPacket(packet);
|
||||
sendQueued(player, packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -331,7 +329,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
Team packet = new Team(TAB_TEAM);
|
||||
packet.setMode((byte) (remove ? 4 : 3));
|
||||
packet.setPlayers(names.toArray(new String[0]));
|
||||
player.unsafe().sendPacket(packet);
|
||||
sendQueued(player, packet);
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,4 +355,8 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
return "§c" + ping;
|
||||
}
|
||||
}
|
||||
|
||||
private static void sendQueued(ProxiedPlayer player, DefinedPacket packet) {
|
||||
((UserConnection)player).sendPacketQueued(packet);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren