Added and registered a new packet, the Packet251Extended.

It is the same as a 250, but without the dumb size limit (should solve ALL chunk prbs).
Also added a small method to draw lines (thx to Azanor for it).
This commit is contained in:
ProfMobius committed 2013-11-11 11:15:00 +01:00
1 parent 4244f3750c
commit 35e95ac335
10 files changed
+86 -7

No files matched your search

@@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mapwriter.region.MwChunk;
import mcp.mobius.opis.modOpis;
import mcp.mobius.opis.network.Packet251Extended;
import mcp.mobius.opis.network.Packets;
import net.minecraft.client.Minecraft;
import net.minecraft.network.packet.Packet250CustomPayload;
@@ -53,7 +54,8 @@ public class Packet_Chunks {
}
public static Packet250CustomPayload create(int dim, boolean hasNoSky, ArrayList<Chunk> chunks){
Packet250CustomPayload packet = new Packet250CustomPayload();
//Packet250CustomPayload packet = new Packet250CustomPayload();
Packet251Extended packet = new Packet251Extended();
ByteArrayOutputStream bos = new ByteArrayOutputStream(1);
DataOutputStream outputStream = new DataOutputStream(bos);
@@ -70,11 +72,13 @@ public class Packet_Chunks {
packet.data = bos.toByteArray();
packet.length = bos.size();
/*
if (packet.length > 32767){
//throw new IllegalArgumentException(String.format("Payload may not be larger than 32k : %s", packet.length));
modOpis.log.log(Level.WARNING, String.format("Payload may not be larger than 32k : %s", packet.length));
return null;
}
*/
return packet;
}