carpet client synchronizations and protocols

This commit is contained in:
gnembon committed 2020-05-28 00:06:28 -03:00
1 parent 2522884da3
commit e540f9e238
19 files changed
+406 -173

No files matched your search

@@ -2,6 +2,7 @@ package carpet.settings;
import carpet.CarpetServer;
import carpet.CarpetSettings;
import carpet.network.ServerNetworkHandler;
import carpet.utils.Translations;
import carpet.utils.Messenger;
import com.google.common.collect.ImmutableList;
@@ -80,7 +81,7 @@ public class SettingsManager
public void detachServer()
{
for (ParsedRule<?> rule : rules.values()) rule.resetToDefault(server.getCommandSource());
for (ParsedRule<?> rule : rules.values()) rule.resetToDefault(null);
server = null;
}
@@ -103,6 +104,7 @@ public class SettingsManager
void notifyRuleChanged(ServerCommandSource source, ParsedRule<?> rule, String userTypedValue)
{
observers.forEach(observer -> observer.accept(source, rule, userTypedValue));
ServerNetworkHandler.updateRuleWithConnectedClients(rule);
}
public Iterable<String> getCategories()
@@ -584,8 +586,6 @@ public class SettingsManager
rules.get(setting).set(source, strOption);
}
}
}
}
}