Some work, need to fix somethings at a later date
This commit is contained in:
parent
45d0f36286
commit
a38899184d
6 changed files with 52 additions and 23 deletions
|
@ -3,7 +3,11 @@ package techreborn.packets;
|
|||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.client.gui.GuiIDSU;
|
||||
import techreborn.cofhLib.gui.element.listbox.ListBoxElementText;
|
||||
import techreborn.tiles.idsu.ClientSideIDSUManager;
|
||||
import techreborn.tiles.idsu.IDSUManager;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -36,5 +40,23 @@ public class PacketSendIDSUManager extends SimplePacket {
|
|||
@Override
|
||||
public void execute() {
|
||||
ClientSideIDSUManager.CLIENT.loadFromString(json, player.worldObj);
|
||||
|
||||
if(player.worldObj != null){
|
||||
GuiIDSU.listBox._elements.clear();
|
||||
for(World world : ClientSideIDSUManager.CLIENT.worldData.keySet()){
|
||||
// System.out.println(world.n + ":" + idsu.getWorldObj().getProviderName());
|
||||
//if(world.getProviderName().equals(idsu.getWorldObj().getProviderName())){
|
||||
IDSUManager.IDSUWorldSaveData saveData = ClientSideIDSUManager.CLIENT.getWorldDataFormWorld(world);
|
||||
for(Integer id : saveData.idsuValues.keySet()){
|
||||
IDSUManager.IDSUValueSaveData valueSaveData = saveData.idsuValues.get(id);
|
||||
if(!valueSaveData.name.isEmpty()){
|
||||
GuiIDSU.listBox._elements.add(new ListBoxElementText(valueSaveData.name + " - " + id));
|
||||
} else {
|
||||
GuiIDSU.listBox._elements.add(new ListBoxElementText(id.toString()));
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue