Comments (3)
Rather it not doing at ping time xD
pretty expensive method.
from bungeecord.
Then it's best to do as originally specified, and use ChatColor.translateAlternateColorCodes('&', motd); at command time.
from bungeecord.
Here's a copy-pastable version :)
Actual line:
BungeeCord.instance.config.motd = ChatColor.translateAlternateColorCodes('&', newMOTD);
Full code:
package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
/**
* Command to set a temp copy of the motd in real-time without stopping the
* proxy.
*/
public class CommandMotd extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getPermission(sender) != Permission.ADMIN)
{
sender.sendMessage(ChatColor.RED + "You do not have permission to use this command");
} else
{
String newMOTD = "";
for (String s : args)
{
newMOTD = newMOTD + s + " ";
}
newMOTD = newMOTD.substring(0, newMOTD.length() - 1);
BungeeCord.instance.config.motd = ChatColor.translateAlternateColorCodes('&', newMOTD);
}
}
}
from bungeecord.
Related Issues (20)
- Bungee make some players crash HOT 1
- Chat Validation Error Issue HOT 4
- Disable responses to InitialHandler handshake pings? HOT 2
- Hacker can log in with player uuid HOT 1
- Connecting Forge servers HOT 3
- When sending a ping to an offline server, a response occurs after 2 seconds. HOT 1
- Bungeecode source not delomboked HOT 10
- Cannot get ID for packet class net.md_5.bungee.protocol.packet.PlayerListItemRemove in phase CONFIGURATION with direction TO_CLIENT HOT 11
- Could not connect to a default or fallback server. Incorrectly configured address/port/firewall HOT 4
- "Your not registerd" How do i fix this? HOT 1
- Bungeecord error for last version HOT 1
- Invalid signature for profile public key HOT 5
- Can't connect to servers - invalid signature key HOT 16
- InitialHandler - could not decode packet! HOT 1
- Player locale can be null when queried in the PostLoginEvent HOT 4
- Cannot get ID for packet class net.md_5.bungee.protocol.packet.StartConfiguration in phase CONFIGURATION with direction TO_CLIENT @ io.netty.handler.codec.MessageToByteEncoder:125 HOT 2
- Sending components of an item in HoverEvent is not possible HOT 6
- HAProxy layer 7 health-check not possible anymore HOT 11
- Support in ChatComponent API for fetching translation strings on server side HOT 8
- ServerKickEvent is not fired when kicked from a server stop HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bungeecord.