Moved the IDMap registry packet to the Packet250 system as the NetworkMod idMap is not initialized from the server early enough.

Added asm debug config flag
This commit is contained in:
Chicken Bones committed 2013-07-13 22:24:51 +10:00
1 parent 646e84a163
commit ad5f65e0d5
4 files changed
+12 -7

No files matched your search

@@ -19,10 +19,11 @@ import java.io.PrintWriter
import ScalaSignature._
import java.lang.reflect.Method
import java.lang.reflect.Modifier
import codechicken.multipart.handler.MultipartProxy
object DebugPrinter
{
def debug = !obfuscated
def debug = MultipartProxy.config.getTag("debug_asm").getBooleanValue(!obfuscated)
private var permGenUsed = 0
val dir = new File("asm/multipart")
@@ -50,7 +50,7 @@ object MultipartEventHandler extends IConnectionHandler with ITickHandler
def connectionReceived(loginHandler:NetLoginHandler, netManager:INetworkManager):String =
{
val packet = new PacketCustom(MultipartSPH.channel, 1)
val packet = new PacketCustom(MultipartSPH.registryChannel, 1)
MultiPartRegistry.writeIDMap(packet)
netManager.addToSendQueue(packet.toPacket)
return null
@@ -28,10 +28,14 @@ import net.minecraft.world.WorldServer
import net.minecraft.world.ChunkCoordIntPair
import MultipartProxy._
object MultipartCPH extends IClientPacketHandler
class MultipartPH
{
val channel = MultipartMod
val registryChannel = "ForgeMultipart"//Must use the 250 system for ID registry as the NetworkMod idMap hasn't been properly initialized from the server yet.
}
object MultipartCPH extends MultipartPH with IClientPacketHandler
{
val channel = MultipartMod;
def handlePacket(packet:PacketCustom, netHandler:NetClientHandler, mc:Minecraft)
{
packet.getType match
@@ -74,14 +78,13 @@ object MultipartCPH extends IClientPacketHandler
}
}
object MultipartSPH extends IServerPacketHandler
object MultipartSPH extends MultipartPH with IServerPacketHandler
{
class MCByteStream(bout:ByteArrayOutputStream) extends MCOutputStreamWrapper(new DataOutputStream(bout))
{
def getBytes = bout.toByteArray
}
val channel = MultipartMod
private val updateMap = mutable.Map[World, mutable.Map[BlockCoord, MCByteStream]]()
def handlePacket(packet:PacketCustom, netHandler:NetServerHandler, sender:EntityPlayerMP)
@@ -77,6 +77,7 @@ class MultipartProxy_clientImpl extends MultipartProxy_serverImpl
super.postInit()
RenderingRegistry.registerBlockHandler(MultipartRenderer);
PacketCustom.assignHandler(MultipartCPH.channel, MultipartCPH)
PacketCustom.assignHandler(MultipartCPH.registryChannel, 1, 127, MultipartCPH)
KeyBindingRegistry.registerKeyBinding(ControlKeyHandler)
}