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

@@ -55,7 +55,7 @@ public class NoppesUtil {
float height = buffer.readFloat();
float width = buffer.readFloat();
float yOffset = buffer.readFloat();
String particle = Server.readString(buffer);
World worldObj = Minecraft.getMinecraft().theWorld;
@@ -121,7 +121,7 @@ public class NoppesUtil {
}
public static void clickSound() {
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
}
private static EntityNPCInterface lastNpc;
@@ -135,7 +135,7 @@ public class NoppesUtil {
public static void openGUI(EntityPlayer player, Object guiscreen) {
CustomNpcs.proxy.openGui(player, guiscreen);
}
public static void openFolder(File dir){
String s = dir.getAbsolutePath();
@@ -196,19 +196,19 @@ public class NoppesUtil {
return;
Vector<String> data = new Vector<String>();
String line;
try {
int size = buffer.readInt();
for(int i = 0; i < size; i++){
data.add(Server.readString(buffer));
}
} catch (Exception e) {
}
((IScrollData)gui).setData(data,null);
}
private static HashMap<String,Integer> data = new HashMap<String,Integer>();
private static HashMap<String,Integer> group = new HashMap<String,Integer>();
@@ -259,7 +259,7 @@ public class NoppesUtil {
} catch (Exception e) {
}
}
public static void setScrollData(ByteBuf buffer) {
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
if(gui == null)
@@ -291,10 +291,8 @@ public class NoppesUtil {
NoppesUtil.openGUI(player, new GuiQuestCompletion(quest));
}
}
public static void openDialog(NBTTagCompound compound, EntityNPCInterface npc, EntityPlayer player){
if(DialogController.Instance == null)
DialogController.Instance = new DialogController();
Dialog dialog = new Dialog();
dialog.readNBT(compound);
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
@@ -309,20 +307,20 @@ public class NoppesUtil {
int x = compound.getInteger("x");
int y = compound.getInteger("y");
int z = compound.getInteger("z");
TileEntity tile = player.worldObj.getTileEntity(x, y, z);
tile.readFromNBT(compound);
CustomNpcs.proxy.openGui(x, y, z, EnumGuiType.RedstoneBlock, player);
}
public static void saveWayPointBlock(EntityPlayer player, NBTTagCompound compound){
int x = compound.getInteger("x");
int y = compound.getInteger("y");
int z = compound.getInteger("z");
TileEntity tile = player.worldObj.getTileEntity(x, y, z);
tile.readFromNBT(compound);
CustomNpcs.proxy.openGui(x, y, z, EnumGuiType.Waypoint, player);
}
@@ -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))