Expand syncing capabilities

This commit is contained in:
Bernhard Bonigl committed 2016-10-01 20:59:18 +02:00
1 parent e328399520
commit 339941cac2
2 files changed
+24 -1

No files matched your search

@@ -21,7 +21,7 @@ public abstract class AbstractConfigSyncPacket extends AbstractPacket {
@Override
public IMessage handleClient(NetHandlerPlayClient netHandler) {
AbstractConfig.syncConfig(getConfig(), config);
sync();
return null;
}
@@ -31,6 +31,11 @@ public abstract class AbstractConfigSyncPacket extends AbstractPacket {
throw new UnsupportedOperationException("Trying to sync client configs to the server. You registered the packet for the wrong side.");
}
protected boolean sync() {
return AbstractConfig.syncConfig(getConfig(), config);
}
@Override
public void fromBytes(ByteBuf buf) {
config = new ArrayList<>();