Add Insane Sync Data Control from BACK in the BROKEN 1.9 BETA >:D

This commit is contained in:
Kam committed 2024-03-07 22:22:39 -05:00
1 parent d225122016
commit dd7a0b7f12
25 files changed
+435 -79

No files matched your search

@@ -33,16 +33,20 @@ import noppes.npcs.config.ConfigClient;
import noppes.npcs.constants.EnumGuiType;
import noppes.npcs.constants.EnumPacketClient;
import noppes.npcs.constants.EnumPacketServer;
import noppes.npcs.constants.SyncType;
import noppes.npcs.controllers.RecipeController;
import noppes.npcs.controllers.SyncController;
import noppes.npcs.controllers.data.Animation;
import noppes.npcs.controllers.data.AnimationData;
import noppes.npcs.controllers.data.MarkData;
import noppes.npcs.controllers.data.RecipeCarpentry;
import noppes.npcs.entity.EntityDialogNpc;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.items.ItemScripted;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class PacketHandlerClient extends PacketHandlerServer{
@@ -105,6 +109,27 @@ public class PacketHandlerClient extends PacketHandlerServer{
RecipeController.Instance.anvilRecipes = RecipeController.syncRecipes;
RecipeController.syncRecipes = new HashMap<Integer, RecipeCarpentry>();
}
else if(type == EnumPacketClient.SYNC_ADD || type == EnumPacketClient.SYNC_END){
int synctype = buffer.readInt();
NBTTagCompound compound = Server.readNBT(buffer);
SyncController.clientSync(synctype, compound, type == EnumPacketClient.SYNC_END);
if(synctype == SyncType.PLAYER_DATA){
ClientProxy.playerData.setNBT(compound);
}
}
else if(type == EnumPacketClient.SYNC_UPDATE){
int synctype = buffer.readInt();
NBTTagCompound compound = Server.readNBT(buffer);
SyncController.clientSyncUpdate(synctype, compound, buffer);
}
else if(type == EnumPacketClient.SYNC_REMOVE){
int synctype = buffer.readInt();
int id = buffer.readInt();
SyncController.clientSyncRemove(synctype, id);
}
else if(type == EnumPacketClient.MARK_DATA){
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(buffer.readInt());
if(!(entity instanceof EntityNPCInterface))