diff --git a/codechicken/multipart/asm/ASMMixinCompiler.scala b/codechicken/multipart/asm/ASMMixinCompiler.scala index f2ae9e2..69afe55 100644 --- a/codechicken/multipart/asm/ASMMixinCompiler.scala +++ b/codechicken/multipart/asm/ASMMixinCompiler.scala @@ -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") diff --git a/codechicken/multipart/handler/EventHandler.scala b/codechicken/multipart/handler/EventHandler.scala index 4467bcc..342fded 100644 --- a/codechicken/multipart/handler/EventHandler.scala +++ b/codechicken/multipart/handler/EventHandler.scala @@ -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 diff --git a/codechicken/multipart/handler/PacketHandlers.scala b/codechicken/multipart/handler/PacketHandlers.scala index 97bdeff..2490b47 100644 --- a/codechicken/multipart/handler/PacketHandlers.scala +++ b/codechicken/multipart/handler/PacketHandlers.scala @@ -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) diff --git a/codechicken/multipart/handler/Proxies.scala b/codechicken/multipart/handler/Proxies.scala index 6c317ba..344b7e2 100644 --- a/codechicken/multipart/handler/Proxies.scala +++ b/codechicken/multipart/handler/Proxies.scala @@ -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) }