LabyMod / LabyMod/labymod4-server-api

+ LabyModPlayerSwitchServerEvent

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
Java
Stars
12
Forks
3
PR merge metrics
No merged PRs in 30d

Description

General Troubleshooting
  • I am using the latest version of the LabyMod 4 Server API.
  • I have checked for similar issues on the Issue-tracker.
  • I have checked for Pull Requests that might already address this issue.
Feature Request
  • LabyModPlayerSwitchServerEvent

An event with which you can query a player's sub-server. With the ServerSwitchEvent from Bungeecord this works with 1.8 to 1.12 but everything above that is not recognized by the ServerSwitchEvent, something like Subtitles or TabListBanner etc

Example Use-Case
@EventHandler(priority = 0)
  public static void onServerjoin2(LabyModPlayerSwitchServerEvent event) {
	  final ProxiedPlayer player = event.getPlayer();
	  LabyModPlayer labyModPlayer = LabyModProtocolService.get().getPlayer(player.getUniqueId());
	  LabyModProtocol labyModProtocol = LabyModProtocolService.get().labyModProtocol();
	  List<String> addonsToDisable = new ArrayList<>();
	  PermissionGroup permissionGroup = CloudAPI.getInstance().getOnlinePlayer(player.getUniqueId()).getPermissionEntity().getHighestPermissionGroup(CloudAPI.getInstance().getPermissionPool());
	  labyModPlayer.sendTabListBanner(null);
	  labyModPlayer.sendTabListBanner("https://yourpng.com");
	  labyModProtocol.sendPacket(labyModPlayer.getUniqueId(), new PlayingGameModePacket(null));
	  if (player.getServer().getInfo().getName() == null) {
		  return;
	  }
	  else if (player.getServer().getInfo().getName().contains("CityBuild")) {
		  labyModProtocol.sendPacket(labyModPlayer.getUniqueId(), new PlayingGameModePacket("§3§lCB"));
	  }
	  else if (player.getServer().getInfo().getName().contains("Lobby")) { 
		  labyModProtocol.sendPacket(labyModPlayer.getUniqueId(), new PlayingGameModePacket("§bLobby"));
		  labyModPlayer.revertDisabledAddons();
	  }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files or tests; start by tracing the Server API's event handling and the BungeeCord ServerSwitchEvent behavior described. Done means a LabyModPlayerSwitchServerEvent can expose a player's sub-server for newer protocol versions and support the shown event-handler use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.