From 6b07f50b9e46a90ce785d5966c717df2c6cbf132 Mon Sep 17 00:00:00 2001 From: "yrsegal@gmail.com" Date: Tue, 3 Oct 2023 21:26:24 -0400 Subject: [PATCH] =?UTF-8?q?quark=20=F0=9F=AB=B1=F0=9F=8F=BF=20=F0=9F=AB=B2?= =?UTF-8?q?=20quark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit insert meme here --- src/main/java/vazkii/quark/base/Quark.java | 10 +-- .../vazkii/quark/base/module/LoadModule.java | 8 +- .../base/module/config/ConfigFlagManager.java | 18 +++-- .../module/config/ConfigObjectSerializer.java | 17 ++--- .../base/module/config/ConfigResolver.java | 2 +- .../base/module/sync/SyncedFlagHandler.java | 75 +++++++++++++++++++ .../quark/base/network/QuarkNetwork.java | 45 +++++++---- .../message/structural/C2SLoginFlag.java | 33 ++++++++ .../message/structural/C2SUpdateFlag.java | 34 +++++++++ .../message/structural/HandshakeMessage.java | 29 +++++++ .../message/structural/S2CLoginFlag.java | 42 +++++++++++ .../message/structural/S2CUpdateFlag.java | 34 +++++++++ .../vazkii/quark/base/proxy/ClientProxy.java | 3 + .../vazkii/quark/base/proxy/CommonProxy.java | 2 + 14 files changed, 312 insertions(+), 40 deletions(-) create mode 100644 src/main/java/vazkii/quark/base/module/sync/SyncedFlagHandler.java create mode 100644 src/main/java/vazkii/quark/base/network/message/structural/C2SLoginFlag.java create mode 100644 src/main/java/vazkii/quark/base/network/message/structural/C2SUpdateFlag.java create mode 100644 src/main/java/vazkii/quark/base/network/message/structural/HandshakeMessage.java create mode 100644 src/main/java/vazkii/quark/base/network/message/structural/S2CLoginFlag.java create mode 100644 src/main/java/vazkii/quark/base/network/message/structural/S2CUpdateFlag.java diff --git a/src/main/java/vazkii/quark/base/Quark.java b/src/main/java/vazkii/quark/base/Quark.java index a148b32c95..5b3e6ec6fc 100644 --- a/src/main/java/vazkii/quark/base/Quark.java +++ b/src/main/java/vazkii/quark/base/Quark.java @@ -13,17 +13,17 @@ public class Quark { public static final String MOD_ID = "quark"; public static final String ODDITIES_ID = "quarkoddities"; - + public static Quark instance; public static CommonProxy proxy; public static final Logger LOG = LogManager.getLogger(MOD_ID); - + public Quark() { instance = this; - - proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> CommonProxy::new); + + proxy = DistExecutor.safeRunForDist(() -> ClientProxy::new, () -> CommonProxy::new); proxy.start(); } - + } diff --git a/src/main/java/vazkii/quark/base/module/LoadModule.java b/src/main/java/vazkii/quark/base/module/LoadModule.java index 01825710ea..627efd278e 100644 --- a/src/main/java/vazkii/quark/base/module/LoadModule.java +++ b/src/main/java/vazkii/quark/base/module/LoadModule.java @@ -1,18 +1,18 @@ package vazkii.quark.base.module; +import net.minecraftforge.api.distmarker.Dist; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import net.minecraftforge.api.distmarker.Dist; - @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface LoadModule { ModuleCategory category(); - + String name() default ""; String description() default ""; String[] antiOverlap() default { }; @@ -21,5 +21,5 @@ Dist[] subscribeOn() default { Dist.CLIENT, Dist.DEDICATED_SERVER }; boolean enabledByDefault() default true; - + } diff --git a/src/main/java/vazkii/quark/base/module/config/ConfigFlagManager.java b/src/main/java/vazkii/quark/base/module/config/ConfigFlagManager.java index ffb67b502b..25cadbdacb 100644 --- a/src/main/java/vazkii/quark/base/module/config/ConfigFlagManager.java +++ b/src/main/java/vazkii/quark/base/module/config/ConfigFlagManager.java @@ -1,21 +1,23 @@ package vazkii.quark.base.module.config; -import java.util.HashMap; -import java.util.Map; - import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; import net.minecraftforge.common.crafting.CraftingHelper; import vazkii.quark.base.Quark; import vazkii.quark.base.module.QuarkModule; +import vazkii.quark.base.module.sync.SyncedFlagHandler; import vazkii.quark.base.recipe.ingredient.FlagIngredient; import vazkii.quark.base.recipe.ingredient.PotionIngredient; +import java.util.*; + public final class ConfigFlagManager { public static LootItemConditionType flagLootConditionType; + private final List orderedFlags = new ArrayList<>(); + private final Set allFlags = new HashSet<>(); private final Map flags = new HashMap<>(); private boolean registered = false; @@ -28,12 +30,14 @@ public void registerConfigBoundElements() { CraftingHelper.register(new FlagRecipeCondition.Serializer(this, new ResourceLocation(Quark.MOD_ID, "flag"))); CraftingHelper.register(new FlagAdvancementCondition.Serializer(this, new ResourceLocation(Quark.MOD_ID, "advancement_flag"))); - + flagLootConditionType = new LootItemConditionType(new FlagLootCondition.FlagSerializer(this)); Registry.register(Registry.LOOT_CONDITION_TYPE, new ResourceLocation(Quark.MOD_ID, "flag"), flagLootConditionType); CraftingHelper.register(new ResourceLocation(Quark.MOD_ID, "potion"), PotionIngredient.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation(Quark.MOD_ID, "flag"), new FlagIngredient.Serializer(this)); + + SyncedFlagHandler.setupFlagManager(this, orderedFlags); } public void clear() { @@ -42,10 +46,14 @@ public void clear() { public void putFlag(QuarkModule module, String flag, boolean value) { flags.put(flag, value && module.enabled); + if (!allFlags.contains(flag)) { + orderedFlags.add(flag); + allFlags.add(flag); + } } public void putEnabledFlag(QuarkModule module) { - flags.put(module.lowercaseName, module.enabled); + putFlag(module, module.lowercaseName, true); } public boolean isValidFlag(String flag) { diff --git a/src/main/java/vazkii/quark/base/module/config/ConfigObjectSerializer.java b/src/main/java/vazkii/quark/base/module/config/ConfigObjectSerializer.java index 3f4de37c05..37df1fd0ee 100644 --- a/src/main/java/vazkii/quark/base/module/config/ConfigObjectSerializer.java +++ b/src/main/java/vazkii/quark/base/module/config/ConfigObjectSerializer.java @@ -1,5 +1,12 @@ package vazkii.quark.base.module.config; +import net.minecraftforge.common.ForgeConfigSpec; +import org.apache.commons.lang3.text.WordUtils; +import org.jetbrains.annotations.Nullable; +import vazkii.quark.base.module.QuarkModule; +import vazkii.quark.base.module.config.type.IConfigType; +import vazkii.quark.base.module.hint.HintManager; + import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -12,20 +19,12 @@ import java.util.function.Predicate; import java.util.function.Supplier; -import org.apache.commons.lang3.text.WordUtils; -import org.jetbrains.annotations.Nullable; - -import net.minecraftforge.common.ForgeConfigSpec; -import vazkii.quark.base.module.QuarkModule; -import vazkii.quark.base.module.config.type.IConfigType; -import vazkii.quark.base.module.hint.HintManager; - public final class ConfigObjectSerializer { public static void serialize(IConfigBuilder builder, ConfigFlagManager flagManager, List callbacks, Object object) throws ReflectiveOperationException { serialize(builder, flagManager, callbacks, object, object); } - + public static void serialize(IConfigBuilder builder, ConfigFlagManager flagManager, List callbacks, Object object, Object root) throws ReflectiveOperationException { List fields = recursivelyGetFields(object.getClass()); for(Field f : fields) { diff --git a/src/main/java/vazkii/quark/base/module/config/ConfigResolver.java b/src/main/java/vazkii/quark/base/module/config/ConfigResolver.java index df30640cca..104dbdb8ca 100644 --- a/src/main/java/vazkii/quark/base/module/config/ConfigResolver.java +++ b/src/main/java/vazkii/quark/base/module/config/ConfigResolver.java @@ -33,7 +33,7 @@ public class ConfigResolver { private final ConfigFlagManager flagManager; - private List refreshRunnables = new LinkedList<>(); + private final List refreshRunnables = new LinkedList<>(); private ModConfig config; public ConfigResolver() { diff --git a/src/main/java/vazkii/quark/base/module/sync/SyncedFlagHandler.java b/src/main/java/vazkii/quark/base/module/sync/SyncedFlagHandler.java new file mode 100644 index 0000000000..dfbddf3571 --- /dev/null +++ b/src/main/java/vazkii/quark/base/module/sync/SyncedFlagHandler.java @@ -0,0 +1,75 @@ +package vazkii.quark.base.module.sync; + +import net.minecraft.client.Minecraft; +import net.minecraft.network.PacketListener; +import net.minecraft.server.level.ServerPlayer; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import vazkii.quark.base.module.config.ConfigFlagManager; +import vazkii.quark.base.network.QuarkNetwork; +import vazkii.quark.base.network.message.structural.S2CUpdateFlag; + +import java.util.*; + +public class SyncedFlagHandler { + private static ConfigFlagManager flagManager; + private static List allFlags; + + public static void setupFlagManager(ConfigFlagManager manager, List flags) { + flagManager = manager; + allFlags = flags; + } + + public static BitSet compileFlagInfo() { + BitSet set = new BitSet(); + int i = 0; + for (String flag : allFlags) set.set(i++, flagManager.getFlag(flag)); + + return set; + } + + private static Set decodeFlags(BitSet bitSet) { + Set enabledFlags = new HashSet<>(); + + for (int i = bitSet.nextSetBit(0); i >= 0; i = bitSet.nextSetBit(i + 1)) { + enabledFlags.add(allFlags.get(i)); + } + + return enabledFlags; + } + + public static void receiveFlagInfoFromPlayer(ServerPlayer player, BitSet bitSet) { + flagsFromPlayers.put(player, decodeFlags(bitSet)); + } + + @OnlyIn(Dist.CLIENT) + public static void receiveFlagInfoFromServer(BitSet bitSet) { + flagsFromServer.put(Minecraft.getInstance().getConnection(), decodeFlags(bitSet)); + } + + public static void sendFlagInfoToPlayers() { + QuarkNetwork.sendToPlayers(new S2CUpdateFlag(), flagsFromPlayers.keySet()); + } + + private static final WeakHashMap> flagsFromServer = new WeakHashMap<>(); + private static final WeakHashMap> flagsFromPlayers = new WeakHashMap<>(); + + public static boolean getFlagForPlayer(ServerPlayer player, String flag) { + Set enabledFlags = flagsFromPlayers.get(player); + if (enabledFlags == null) + return flagManager.getFlag(flag); + + return enabledFlags.contains(flag); + } + + @OnlyIn(Dist.CLIENT) + public static boolean getFlagForServer(String flag) { + for (PacketListener listener : flagsFromServer.keySet()) { + Set enabledFlags = flagsFromServer.get(listener); + if (enabledFlags != null) + return enabledFlags.contains(flag); + } + + return flagManager.getFlag(flag); + } +} diff --git a/src/main/java/vazkii/quark/base/network/QuarkNetwork.java b/src/main/java/vazkii/quark/base/network/QuarkNetwork.java index 249993c77d..cc3b38b14c 100644 --- a/src/main/java/vazkii/quark/base/network/QuarkNetwork.java +++ b/src/main/java/vazkii/quark/base/network/QuarkNetwork.java @@ -1,37 +1,29 @@ package vazkii.quark.base.network; -import java.time.Instant; - import net.minecraft.network.chat.LastSeenMessages; import net.minecraft.network.chat.MessageSignature; import net.minecraft.network.protocol.Packet; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.network.NetworkDirection; +import net.minecraftforge.network.simple.SimpleChannel; import vazkii.arl.network.IMessage; import vazkii.arl.network.MessageSerializer; import vazkii.arl.network.NetworkHandler; import vazkii.quark.base.Quark; -import vazkii.quark.base.network.message.ChangeHotbarMessage; -import vazkii.quark.base.network.message.DoEmoteMessage; -import vazkii.quark.base.network.message.DoubleDoorMessage; -import vazkii.quark.base.network.message.EditSignMessage; -import vazkii.quark.base.network.message.HarvestMessage; -import vazkii.quark.base.network.message.InventoryTransferMessage; -import vazkii.quark.base.network.message.RequestEmoteMessage; -import vazkii.quark.base.network.message.ScrollOnBundleMessage; -import vazkii.quark.base.network.message.SetLockProfileMessage; -import vazkii.quark.base.network.message.ShareItemMessage; -import vazkii.quark.base.network.message.SortInventoryMessage; -import vazkii.quark.base.network.message.UpdateTridentMessage; +import vazkii.quark.base.network.message.*; import vazkii.quark.base.network.message.experimental.PlaceVariantUpdateMessage; import vazkii.quark.base.network.message.oddities.HandleBackpackMessage; import vazkii.quark.base.network.message.oddities.MatrixEnchanterOperationMessage; import vazkii.quark.base.network.message.oddities.ScrollCrateMessage; +import vazkii.quark.base.network.message.structural.*; + +import java.time.Instant; +import java.util.BitSet; public final class QuarkNetwork { - private static final int PROTOCOL_VERSION = 1; + private static final int PROTOCOL_VERSION = 2; private static NetworkHandler network; @@ -39,6 +31,7 @@ public static void setup() { MessageSerializer.mapHandlers(Instant.class, (buf, field) -> buf.readInstant(), (buf, field, instant) -> buf.writeInstant(instant)); MessageSerializer.mapHandlers(MessageSignature.class, (buf, field) -> new MessageSignature(buf), (buf, field, signature) -> signature.write(buf)); MessageSerializer.mapHandlers(LastSeenMessages.Update.class, (buf, field) -> new LastSeenMessages.Update(buf), (buf, field, update) -> update.write(buf)); + MessageSerializer.mapHandlers(BitSet.class, (buf, field) -> BitSet.valueOf(buf.readLongArray()), (buf, field, bitSet) -> buf.writeLongArray(bitSet.toLongArray())); network = new NetworkHandler(Quark.MOD_ID, PROTOCOL_VERSION); @@ -60,12 +53,32 @@ public static void setup() { // Experimental network.register(PlaceVariantUpdateMessage.class, NetworkDirection.PLAY_TO_SERVER); - + // Clientbound network.register(DoEmoteMessage.class, NetworkDirection.PLAY_TO_CLIENT); network.register(EditSignMessage.class, NetworkDirection.PLAY_TO_CLIENT); network.register(UpdateTridentMessage.class, NetworkDirection.PLAY_TO_CLIENT); + // Flag Syncing + network.register(S2CUpdateFlag.class, NetworkDirection.PLAY_TO_CLIENT); + network.register(C2SUpdateFlag.class, NetworkDirection.PLAY_TO_SERVER); + loginIndexedBuilder(S2CLoginFlag.class, 96, NetworkDirection.LOGIN_TO_CLIENT) + .decoder(S2CLoginFlag::new) + .buildLoginPacketList(S2CLoginFlag::generateRegistryPackets) + .add(); + loginIndexedBuilder(C2SLoginFlag.class, 97, NetworkDirection.LOGIN_TO_SERVER) + .decoder(C2SLoginFlag::new) + .noResponse() + .add(); + } + + private static SimpleChannel.MessageBuilder loginIndexedBuilder(Class clazz, int id, NetworkDirection direction) { + return network.channel.messageBuilder(clazz, id, direction) + .loginIndex(HandshakeMessage::getLoginIndex, HandshakeMessage::setLoginIndex) + .encoder(HandshakeMessage::encode) + .consumerNetworkThread((msg, context) -> { + return msg.consume(context.get(), network.channel::reply); + }); } public static void sendToPlayer(IMessage msg, ServerPlayer player) { diff --git a/src/main/java/vazkii/quark/base/network/message/structural/C2SLoginFlag.java b/src/main/java/vazkii/quark/base/network/message/structural/C2SLoginFlag.java new file mode 100644 index 0000000000..85da95b290 --- /dev/null +++ b/src/main/java/vazkii/quark/base/network/message/structural/C2SLoginFlag.java @@ -0,0 +1,33 @@ +package vazkii.quark.base.network.message.structural; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraftforge.network.NetworkEvent; +import vazkii.quark.base.module.sync.SyncedFlagHandler; + +import java.util.BitSet; +import java.util.function.BiConsumer; + +public class C2SLoginFlag extends HandshakeMessage { + + public BitSet flags; + + public C2SLoginFlag() { + flags = SyncedFlagHandler.compileFlagInfo(); + } + + public C2SLoginFlag(FriendlyByteBuf buf) { + this.flags = BitSet.valueOf(buf.readLongArray()); + } + + @Override + public void encode(FriendlyByteBuf buf) { + buf.writeLongArray(flags.toLongArray()); + } + + @Override + public boolean consume(NetworkEvent.Context context, BiConsumer reply) { + SyncedFlagHandler.receiveFlagInfoFromPlayer(context.getSender(), flags); + return true; + } + +} diff --git a/src/main/java/vazkii/quark/base/network/message/structural/C2SUpdateFlag.java b/src/main/java/vazkii/quark/base/network/message/structural/C2SUpdateFlag.java new file mode 100644 index 0000000000..0b1458c249 --- /dev/null +++ b/src/main/java/vazkii/quark/base/network/message/structural/C2SUpdateFlag.java @@ -0,0 +1,34 @@ +package vazkii.quark.base.network.message.structural; + +import net.minecraftforge.network.NetworkEvent; +import vazkii.arl.network.IMessage; +import vazkii.quark.base.module.sync.SyncedFlagHandler; + +import java.io.Serial; +import java.util.BitSet; + +public class C2SUpdateFlag implements IMessage { + + @Serial + private static final long serialVersionUID = 7483741039149504284L; + + public BitSet flags; + + @Override + public boolean receive(NetworkEvent.Context context) { + SyncedFlagHandler.receiveFlagInfoFromPlayer(context.getSender(), flags); + return true; + } + + public C2SUpdateFlag() { + // NO-OP + } + + private C2SUpdateFlag(BitSet flags) { + this.flags = flags; + } + + public static C2SUpdateFlag createPacket() { + return new C2SUpdateFlag(SyncedFlagHandler.compileFlagInfo()); + } +} diff --git a/src/main/java/vazkii/quark/base/network/message/structural/HandshakeMessage.java b/src/main/java/vazkii/quark/base/network/message/structural/HandshakeMessage.java new file mode 100644 index 0000000000..2b4d469647 --- /dev/null +++ b/src/main/java/vazkii/quark/base/network/message/structural/HandshakeMessage.java @@ -0,0 +1,29 @@ +package vazkii.quark.base.network.message.structural; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraftforge.network.NetworkEvent; + +import java.util.function.BiConsumer; +import java.util.function.IntSupplier; + +// Not an IMessage to avoid serializing things like loginIndex +public abstract class HandshakeMessage implements IntSupplier { + private int loginIndex; + + public void setLoginIndex(final int loginIndex) { + this.loginIndex = loginIndex; + } + + public int getLoginIndex() { + return loginIndex; + } + + @Override + public int getAsInt() { + return loginIndex; + } + + public abstract void encode(FriendlyByteBuf buf); + + public abstract boolean consume(NetworkEvent.Context context, BiConsumer reply); +} diff --git a/src/main/java/vazkii/quark/base/network/message/structural/S2CLoginFlag.java b/src/main/java/vazkii/quark/base/network/message/structural/S2CLoginFlag.java new file mode 100644 index 0000000000..1a2ae3b68b --- /dev/null +++ b/src/main/java/vazkii/quark/base/network/message/structural/S2CLoginFlag.java @@ -0,0 +1,42 @@ +package vazkii.quark.base.network.message.structural; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraftforge.network.NetworkEvent; +import org.apache.commons.lang3.tuple.Pair; +import vazkii.quark.base.module.sync.SyncedFlagHandler; + +import java.util.BitSet; +import java.util.Collections; +import java.util.List; +import java.util.function.BiConsumer; + +public class S2CLoginFlag extends HandshakeMessage { + + public BitSet flags; + + public S2CLoginFlag() { + flags = SyncedFlagHandler.compileFlagInfo(); + } + + public S2CLoginFlag(FriendlyByteBuf buf) { + this.flags = BitSet.valueOf(buf.readLongArray()); + } + + @Override + public void encode(FriendlyByteBuf buf) { + buf.writeLongArray(flags.toLongArray()); + } + + public static List> generateRegistryPackets(boolean isLocal) { + return !isLocal ? + Collections.singletonList(Pair.of(S2CLoginFlag.class.getName(), new S2CLoginFlag())) : + Collections.emptyList(); + } + + @Override + public boolean consume(NetworkEvent.Context context, BiConsumer reply) { + SyncedFlagHandler.receiveFlagInfoFromServer(flags); + reply.accept(new C2SLoginFlag(), context); + return true; + } +} diff --git a/src/main/java/vazkii/quark/base/network/message/structural/S2CUpdateFlag.java b/src/main/java/vazkii/quark/base/network/message/structural/S2CUpdateFlag.java new file mode 100644 index 0000000000..ca0431de46 --- /dev/null +++ b/src/main/java/vazkii/quark/base/network/message/structural/S2CUpdateFlag.java @@ -0,0 +1,34 @@ +package vazkii.quark.base.network.message.structural; + +import net.minecraftforge.network.NetworkEvent; +import vazkii.arl.network.IMessage; +import vazkii.quark.base.module.sync.SyncedFlagHandler; + +import java.io.Serial; +import java.util.BitSet; + +public class S2CUpdateFlag implements IMessage { + + @Serial + private static final long serialVersionUID = 2346906475290526858L; + + public BitSet flags; + + @Override + public boolean receive(NetworkEvent.Context context) { + SyncedFlagHandler.receiveFlagInfoFromServer(flags); + return true; + } + + public S2CUpdateFlag() { + // NO-OP + } + + private S2CUpdateFlag(BitSet flags) { + this.flags = flags; + } + + public static S2CUpdateFlag createPacket() { + return new S2CUpdateFlag(SyncedFlagHandler.compileFlagInfo()); + } +} diff --git a/src/main/java/vazkii/quark/base/proxy/ClientProxy.java b/src/main/java/vazkii/quark/base/proxy/ClientProxy.java index abbd8caf9b..7959d98c51 100644 --- a/src/main/java/vazkii/quark/base/proxy/ClientProxy.java +++ b/src/main/java/vazkii/quark/base/proxy/ClientProxy.java @@ -28,6 +28,8 @@ import vazkii.quark.base.handler.WoodSetHandler; import vazkii.quark.base.module.ModuleLoader; import vazkii.quark.base.module.config.IConfigCallback; +import vazkii.quark.base.network.QuarkNetwork; +import vazkii.quark.base.network.message.structural.C2SUpdateFlag; import vazkii.quark.mixin.client.accessor.AccessorMultiPlayerGameMode; import java.io.File; @@ -132,6 +134,7 @@ public void handleQuarkConfigChange() { super.handleQuarkConfigChange(); ModuleLoader.INSTANCE.configChangedClient(); + QuarkNetwork.sendToServer(C2SUpdateFlag.createPacket()); IngameConfigHandler.INSTANCE.refresh(); Minecraft mc = Minecraft.getInstance(); diff --git a/src/main/java/vazkii/quark/base/proxy/CommonProxy.java b/src/main/java/vazkii/quark/base/proxy/CommonProxy.java index 2a2d9cb069..b236c2ce0a 100644 --- a/src/main/java/vazkii/quark/base/proxy/CommonProxy.java +++ b/src/main/java/vazkii/quark/base/proxy/CommonProxy.java @@ -21,6 +21,7 @@ import vazkii.quark.base.handler.*; import vazkii.quark.base.module.ModuleLoader; import vazkii.quark.base.module.config.IConfigCallback; +import vazkii.quark.base.module.sync.SyncedFlagHandler; import vazkii.quark.base.network.QuarkNetwork; import vazkii.quark.base.recipe.*; import vazkii.quark.base.world.EntitySpawnHandler; @@ -103,6 +104,7 @@ public void registerCapabilities(RegisterCapabilitiesEvent event) { public void handleQuarkConfigChange() { ModuleLoader.INSTANCE.configChanged(); EntitySpawnHandler.refresh(); + SyncedFlagHandler.sendFlagInfoToPlayers(); } /**