-
Recently Browsing
No registered users viewing this page.
-
Posts
-
By BIGDog8808 · Posted
https://drive.google.com/drive/folders/1lIZLDI40nI-DyAqA2PUu5TP3va3Tfb2v?usp=sharing here is the link -
Okay, I believe I've done what you have told me, and my gui does update me gaining xp. However, theres something wrong with my sync method, as whenever it is called, it resets all xp values to zero. So the values in my gui are lost when reloading the world. Heres the sync method in my Skills class: @Override public void sync(ServerPlayerEntity player) { if(entity instanceof ServerPlayerEntity) { PacketHandler.sendTo(new SkillsPacket(serializeNBT()), player); } } Heres my attempt at syncing on login, in my player event handler: @SubscribeEvent public static void onPlayerConnect(PlayerLoggedInEvent event) { ServerPlayerEntity player = (ServerPlayerEntity) event.getPlayer(); if(!player.world.isRemote) { player.getCapability(SkillCapability.SKILL_CAP).ifPresent(c -> c.sync(player)); } } Updated my git repo, here.
-
Topics
-
Who's Online (See full list)