Skip to content

Commit

Permalink
add private nw ctor access and init after research init
Browse files Browse the repository at this point in the history
  • Loading branch information
khjxiaogu committed Jan 18, 2025
1 parent 6a7f5e9 commit 91b3b3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/teammoeg/frostedheart/FHNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public static SimpleChannel get() {
public static synchronized <T extends CMessage> void registerMessage(String name, Class<T> msg) {
classesId.put(msg, FHMain.rl(name));
try {
Constructor<T> ctor = msg.getConstructor(FriendlyByteBuf.class);
Constructor<T> ctor = msg.getDeclaredConstructor(FriendlyByteBuf.class);
ctor.setAccessible(true);
CHANNEL.registerMessage(++iid, msg, CMessage::encode, pb -> {
try {
return ctor.newInstance(pb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void handle(Supplier<NetworkEvent.Context> 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<TeamResearchData> 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);
}
Expand Down

0 comments on commit 91b3b3f

Please sign in to comment.