This commit is contained in:
parent
899c6be294
commit
c12c02bda6
3 changed files with 7 additions and 7 deletions
|
@ -32,7 +32,7 @@ public class MessagePacketMixin {
|
||||||
|
|
||||||
@Inject(method = "handle", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "handle", at = @At("HEAD"), cancellable = true)
|
||||||
private void event_on_message(CallbackInfo ci, @Local NetworkIdentity identity, @Local ChannelHandlerContext ctx){
|
private void event_on_message(CallbackInfo ci, @Local NetworkIdentity identity, @Local ChannelHandlerContext ctx){
|
||||||
if (((boolean)prop.panel_prop.getOrDefault("chat_shadow_enabled",true)) && ply_msgs.containsKey(playerUniqueId)){
|
if (Boolean.parseBoolean((String)prop.panel_prop.getOrDefault("chat_shadow_enabled",true)) && ply_msgs.containsKey(playerUniqueId)){
|
||||||
MessageInfo msg = ply_msgs.get(playerUniqueId);
|
MessageInfo msg = ply_msgs.get(playerUniqueId);
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
if (msg.last_msg+msg.msg_delay>time || (msg.last_msg_txt.equals(message) && msg.last_msg+msg.msg_delay*2>time)) {
|
if (msg.last_msg+msg.msg_delay>time || (msg.last_msg_txt.equals(message) && msg.last_msg+msg.msg_delay*2>time)) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import static net.pietru.cookie_utils.utils.prop.get_server_property_array;
|
||||||
public class NettyServerMixin {
|
public class NettyServerMixin {
|
||||||
|
|
||||||
@Inject(method = "run", at = @At("HEAD"))
|
@Inject(method = "run", at = @At("HEAD"))
|
||||||
private static void on_singletons_create(CallbackInfo ci){
|
private void on_singletons_create(CallbackInfo ci){
|
||||||
try {
|
try {
|
||||||
ArrayList<String> zones = get_server_property_array("zones","[]");
|
ArrayList<String> zones = get_server_property_array("zones","[]");
|
||||||
for (String zoneId : zones){
|
for (String zoneId : zones){
|
||||||
|
|
|
@ -55,15 +55,15 @@ public class prop {
|
||||||
boolean save = false;
|
boolean save = false;
|
||||||
|
|
||||||
if (!panel_prop.containsKey("zones")){
|
if (!panel_prop.containsKey("zones")){
|
||||||
panel_prop.put("zones",new ArrayList<String>()); save=true;}
|
panel_prop.put("zones","[]"); save=true;}
|
||||||
|
|
||||||
if (!panel_prop.containsKey("chat_shadow_enabled")){
|
if (!panel_prop.containsKey("chat_shadow_enabled")){
|
||||||
panel_prop.put("chat_shadow_enabled",true); save=true;}
|
panel_prop.put("chat_shadow_enabled","true"); save=true;}
|
||||||
if (!panel_prop.containsKey("chat_shadow_delay")){
|
if (!panel_prop.containsKey("chat_shadow_delay")){
|
||||||
panel_prop.put("chat_shadow_delay",500); save=true;}
|
panel_prop.put("chat_shadow_delay","500"); save=true;}
|
||||||
if (!panel_prop.containsKey("log_level")){
|
if (!panel_prop.containsKey("log_level")){
|
||||||
panel_prop.put("log_level",1); save=true;}
|
panel_prop.put("log_level","1"); save=true;}
|
||||||
log_level = (int) panel_prop.getOrDefault("log_level",1);
|
log_level = Integer.parseInt((String) panel_prop.getOrDefault("log_level",1));
|
||||||
|
|
||||||
if (save)
|
if (save)
|
||||||
panel_prop.store(new FileWriter(config_file.toString()), "This file is CookieServerUtils config file.");
|
panel_prop.store(new FileWriter(config_file.toString()), "This file is CookieServerUtils config file.");
|
||||||
|
|
Loading…
Reference in a new issue