Add: Option to ask for money for an alias
Add: Bypass to not have to pay anything
Add: Placeholder [player] was added to the messages to show the player name who executed the alias
This commit is contained in:
2022-06-07 06:33:57 +02:00
parent a702b8b791
commit 346a629bcd
20 changed files with 397 additions and 474 deletions

View File

@@ -0,0 +1,42 @@
package net.t2code.alias.Spigot.system;
import net.t2code.alias.Spigot.Main;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class BCommandSenderReciver {
public static void sendToBungee(CommandSender sender, String information, Boolean console) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DataOutputStream output = new DataOutputStream(stream);
try {
if (console) {
output.writeUTF("T2Code-Console");
} else {
if (sender instanceof Player) {
output.writeUTF(sender.getName());
} else {
output.writeUTF("T2Code-Console");
}
}
output.writeUTF(information);
} catch (IOException e) {
e.printStackTrace();
}
if (sender instanceof Player) {
Player player = (Player) sender;
player.sendPluginMessage(Main.plugin, "t2codealias:bungee", stream.toByteArray());
}else {
for(Player player : Bukkit.getOnlinePlayers()){
player.sendPluginMessage(Main.plugin, "t2codealias:bungee", stream.toByteArray());
return;
}
}
}
}