diff --git a/src/main/java/com/teammoeg/frostedheart/FHNetwork.java b/src/main/java/com/teammoeg/frostedheart/FHNetwork.java index 6bb759f64..5e35b92e2 100644 --- a/src/main/java/com/teammoeg/frostedheart/FHNetwork.java +++ b/src/main/java/com/teammoeg/frostedheart/FHNetwork.java @@ -98,7 +98,8 @@ public static SimpleChannel get() { public static synchronized void registerMessage(String name, Class msg) { classesId.put(msg, FHMain.rl(name)); try { - Constructor ctor = msg.getConstructor(FriendlyByteBuf.class); + Constructor ctor = msg.getDeclaredConstructor(FriendlyByteBuf.class); + ctor.setAccessible(true); CHANNEL.registerMessage(++iid, msg, CMessage::encode, pb -> { try { return ctor.newInstance(pb); diff --git a/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchDataSyncPacket.java b/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchDataSyncPacket.java index 4545a0e7e..19f19a004 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchDataSyncPacket.java +++ b/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchDataSyncPacket.java @@ -61,7 +61,7 @@ public void handle(Supplier context) { // Grant Effects on Client // TODO: Why not just sync the UnlockLists through TeamResearchData.Codec, so that the above line is all we need? TeamDataClosure closure = CClientTeamDataManager.INSTANCE.getInstance().getDataHolder(FHSpecialDataTypes.RESEARCH_DATA); - closure.get().grantAllEffects(closure.team()); + closure.get().initResearch(closure.team()); } catch (Exception e) { FHMain.LOGGER.error("Failed to load data when syncing research data", e); }