mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-09 07:15:11 -04:00
client packet handler is client anyway, so getting the world instance directly from the player object should work
This commit is contained in:
parent
92d58f70c9
commit
cb7d54c788
@ -2,7 +2,6 @@ package li.cil.oc.client
|
||||
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.DataInputStream
|
||||
|
||||
import cpw.mods.fml.common.network.IPacketHandler
|
||||
import cpw.mods.fml.common.network.Player
|
||||
import li.cil.oc.OpenComputers
|
||||
@ -10,6 +9,7 @@ import li.cil.oc.client.components.Screen
|
||||
import li.cil.oc.common.PacketType
|
||||
import net.minecraft.network.INetworkManager
|
||||
import net.minecraft.network.packet.Packet250CustomPayload
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
|
||||
/**
|
||||
* Client side packet handler, processes packets sent from the server.
|
||||
@ -66,7 +66,7 @@ class PacketHandler extends IPacketHandler {
|
||||
|
||||
/** Utility class for packet parsing. */
|
||||
private class PacketParser(packet: Packet250CustomPayload, player: Player) extends DataInputStream(new ByteArrayInputStream(packet.data)) {
|
||||
val world = OpenComputers.proxy.getWorldForPlayer(player)
|
||||
val world = player.asInstanceOf[EntityPlayer].worldObj
|
||||
val packetType = PacketType(readByte())
|
||||
|
||||
def readTileEntity[T]() = {
|
||||
|
@ -36,7 +36,4 @@ class CommonProxy {
|
||||
// over the course of a game, since that could lead to weird effects.
|
||||
Drivers.locked = true
|
||||
}
|
||||
|
||||
// TODO
|
||||
def getWorldForPlayer(player: Player): World = null
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user