use of net.silentchaos512.gear.network.SyncGearCraftingItemsPacket in project Silent-Gear by SilentChaos512.
the class ServerEvents method onPlayerJoinServer.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void onPlayerJoinServer(PlayerEvent.PlayerLoggedInEvent event) {
Player player = event.getPlayer();
if (!(player instanceof ServerPlayer))
return;
ServerPlayer playerMP = (ServerPlayer) player;
// Send crafting items packets to correct for registry changes
SilentGear.LOGGER.debug("Sending materials crafting item correction packet");
Network.channel.sendTo(new SyncMaterialCraftingItemsPacket(MaterialManager.getValues()), playerMP.connection.connection, NetworkDirection.PLAY_TO_CLIENT);
SilentGear.LOGGER.debug("Sending parts crafting item correction packet");
Network.channel.sendTo(new SyncGearCraftingItemsPacket(), playerMP.connection.connection, NetworkDirection.PLAY_TO_CLIENT);
TraitManager.getErrorMessages(playerMP).forEach(text -> playerMP.sendMessage(text, Util.NIL_UUID));
MaterialManager.getErrorMessages(playerMP).forEach(text -> playerMP.sendMessage(text, Util.NIL_UUID));
PartManager.getErrorMessages(playerMP).forEach(text -> playerMP.sendMessage(text, Util.NIL_UUID));
}
Aggregations