Started Rewriting Packet Handling

Started rewriting our packet handling code. Deleted PacketHandler in
favor of using sided (Server-, Client-) packet handlers to make it
easier to follow what's going on in our code. Added some event-based
handling of updates which greatly simplified signaling that data needs
to be sent, but it's not completely done yet.
This commit is contained in:
SenseiKiwi
2013-09-01 22:01:17 -04:00
parent efa5b3eb4c
commit 62fed83e2f
17 changed files with 421 additions and 221 deletions

View File

@@ -1,10 +1,7 @@
package StevenDimDoors.mod_pocketDim;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.CompressedStreamTools;
@@ -47,7 +44,6 @@ public class CommonProxy implements IGuiHandler
public void writeNBTToFile(World world)
{
boolean flag = true;
boolean secondTry = false;
try
{
@@ -58,7 +54,6 @@ public class CommonProxy implements IGuiHandler
if (!flag)
{
dirFolder.replace("saves/", FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName());
secondTry = true;
}
File file = new File(dirFolder, "GGMData.dat");
@@ -91,7 +86,6 @@ public class CommonProxy implements IGuiHandler
public void readNBTFromFile(World world)
{
boolean flag = true;
boolean secondTry = false;
try
{
@@ -102,7 +96,6 @@ public class CommonProxy implements IGuiHandler
if (!flag)
{
dirFolder.replace("saves/", FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName());
secondTry = true;
}
File file = new File(dirFolder, "GGMData.dat");
@@ -117,12 +110,9 @@ public class CommonProxy implements IGuiHandler
fileoutputstream.close();
}
FileInputStream fileinputstream = new FileInputStream(file);
/*FileInputStream fileinputstream = new FileInputStream(file);
NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream);
fileinputstream.close();
fileinputstream.close();*/
}
catch (Exception exception)
{