-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🦾 Spigot command & Group permissions & fixed bug that started servers…
… after going ingame & added lombok This is a bit bigger release. Please update Spigot & BungeeCord and update permissions!
- Loading branch information
Showing
15 changed files
with
191 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/de/luuuuuis/privateserver/bungee/events/PluginMessageReceive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package de.luuuuuis.privateserver.bungee.events; | ||
|
||
import com.google.common.io.ByteArrayDataInput; | ||
import com.google.common.io.ByteStreams; | ||
import net.md_5.bungee.api.ProxyServer; | ||
import net.md_5.bungee.api.connection.ProxiedPlayer; | ||
import net.md_5.bungee.api.event.PluginMessageEvent; | ||
import net.md_5.bungee.api.plugin.Listener; | ||
import net.md_5.bungee.event.EventHandler; | ||
|
||
public class PluginMessageReceive implements Listener { | ||
|
||
/** | ||
* access and execute every privateserver command on bungee. No need to check anything on spigot cause bungee does :3 | ||
* | ||
* @param e event | ||
*/ | ||
@EventHandler | ||
public void onReceive(PluginMessageEvent e) { | ||
if (!e.getTag().equals("pv:cmd")) return; | ||
|
||
@SuppressWarnings("UnstableApiUsage") ByteArrayDataInput in = ByteStreams.newDataInput(e.getData()); | ||
String utf_in = in.readUTF(); | ||
if (!(e.getReceiver() instanceof ProxiedPlayer)) return; // ah shit, i guess,,, | ||
|
||
ProxiedPlayer player = (ProxiedPlayer) e.getReceiver(); | ||
|
||
ProxyServer.getInstance().getPluginManager().dispatchCommand(player, "privateserver " + utf_in); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.