This commit is contained in:
Anuken
2021-03-05 22:16:29 -05:00
parent fce30e6ae5
commit 07d11f02d8
3 changed files with 20 additions and 1 deletions

View File

@@ -190,7 +190,7 @@ public class NetClient implements ApplicationListener{
public static void sendChatMessage(Player player, String message){
//do not receive chat messages from clients that are too young or not registered
if(Time.timeSinceMillis(player.con.connectTime) < 500 || !player.con.hasConnected || !player.isAdded()) return;
if(net.server() && player != null && (Time.timeSinceMillis(player.con.connectTime) < 500 || !player.con.hasConnected || !player.isAdded())) return;
if(message.length() > maxTextLength){
throw new ValidateException(player, "Player has sent a message above the text limit.");

View File

@@ -92,6 +92,16 @@ public class ContentParser{
readFields(result, data);
return result;
});
put(Weather.class, (type, data) -> {
if(data.isString()){
return field(Weathers.class, data);
}
var bc = resolve(data.getString("type", ""), ParticleWeather.class);
data.remove("type");
Weather result = make(bc);
readFields(result, data);
return result;
});
put(DrawBlock.class, (type, data) -> {
if(data.isString()){
//try to instantiate