Skip to content

Commit

Permalink
Merge branch '1.19.4' into 1.20.1
Browse files Browse the repository at this point in the history
* 1.19.4:
  Added missing translation
  Lowered fabric api version requirement
  Fixed forge networking issue

# Conflicts:
#	common/src/main/resources/assets/friendsandfoes/lang/en_us.json
  • Loading branch information
Faboslav committed Dec 18, 2023
2 parents d1a159f + afb6500 commit fdc31c7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,4 @@ public static <T extends Packet<T>> void sendToServer(Identifier channel, T pack
public static <T extends Packet<T>> void sendToPlayer(Identifier channel, T packet, PlayerEntity player) {
throw new NotImplementedException();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,6 @@
"subtitle.entity.friendsandfoes.wildfire.shockwave": "Wilsfire shockwaves",
"subtitle.entity.friendsandfoes.wildfire.shoot": "Wildfire shoots",
"subtitle.entity.friendsandfoes.wildfire.step": "Footsteps",
"subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Wildfire summons blazes"
}
"subtitle.entity.friendsandfoes.wildfire.summon_blaze": "Wildfire summons blazes",
"trinkets.slot.charm.charm": "Charm"
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,12 @@ private static void onSetup(FMLCommonSetupEvent event) {
}

private static void onDatapackSync(OnDatapackSyncEvent event) {
if (event.getPlayer() != null) {
DatapackSyncEvent.EVENT.invoke(new DatapackSyncEvent(event.getPlayer()));
} else {
event.getPlayerList().getPlayerList().forEach(player -> DatapackSyncEvent.EVENT.invoke(new DatapackSyncEvent(player)));
if (FMLEnvironment.dist.isDedicatedServer()) {
if (event.getPlayer() != null) {
DatapackSyncEvent.EVENT.invoke(new DatapackSyncEvent(event.getPlayer()));
} else {
event.getPlayerList().getPlayerList().forEach(player -> DatapackSyncEvent.EVENT.invoke(new DatapackSyncEvent(player)));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ public static <T extends Packet<T>> void registerS2CPacket(
}
channel.channel.registerMessage(++channel.packets, packetClass, handler::encode, handler::decode, (msg, ctx) -> {
NetworkEvent.Context context = ctx.get();
PlayerEntity player = null;
if (context.getSender() == null) {
player = PlayerProvider.getClientPlayer();
}

context.enqueueWork(() -> {
PlayerEntity player = null;
if (context.getSender() == null) {
player = PlayerProvider.getClientPlayer();
}

if (player != null) {
PlayerEntity finalPlayer = player;
handler.handle(msg).apply(finalPlayer, finalPlayer.getWorld());
}
});

if (player != null) {
PlayerEntity finalPlayer = player;
context.enqueueWork(() -> handler.handle(msg).apply(finalPlayer, finalPlayer.getWorld()));
}
context.setPacketHandled(true);
});
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.configureondemand=false
# Mod
mod_name=Friends&Foes
mod_id=friendsandfoes
mod_version=2.0.5
mod_version=2.0.6
mod_author=Faboslav
mod_description=Adds outvoted and forgotten mobs from the mob votes in a believable vanilla plus style.
maven_group=com.faboslav.friendsandfoes
Expand Down

0 comments on commit fdc31c7

Please sign in to comment.