Merge remote-tracking branch 'upstream/master'

This commit is contained in:
jamesb6626 2014-06-24 16:52:25 +01:00
commit 41579f85bc
2 changed files with 16 additions and 8 deletions

View File

@ -1,7 +1,7 @@
minecraft.version=1.6.4
forge.version=9.11.1.964
oc.version=1.3.0
oc.subversion=beta.1
oc.subversion=rc.1
ccl.version=1.0.0.62
fmp.version=1.0.0.250
maven.url=file:///var/www/users/fnuecke/maven.cil.li

View File

@ -531,43 +531,51 @@ object TextBuffer {
}
class ServerProxy(val owner: TextBuffer) extends Proxy {
// TODO This is a to prevent a NPE reported in #350.
// It is a workaround at best, as this is treating the symptons, and not
// the cause - which seems to be that the TickHandler used for adding nodes
// to the network may fail to run before the tile entities' update is
// performed -- even though it is marked to run at the start of the tick.
// I have no idea why that would be, however, so this has to do for now.
private def isValid = owner.node != null && owner.node.address != null
override def onScreenColorChange() {
owner.owner.markChanged()
ServerPacketSender.sendTextBufferColorChange(owner.node.address, owner.data.foreground, owner.data.background, owner.owner)
if (isValid) ServerPacketSender.sendTextBufferColorChange(owner.node.address, owner.data.foreground, owner.data.background, owner.owner)
}
override def onScreenCopy(col: Int, row: Int, w: Int, h: Int, tx: Int, ty: Int) {
super.onScreenCopy(col, row, w, h, tx, ty)
owner.owner.markChanged()
ServerPacketSender.sendTextBufferCopy(owner.node.address, col, row, w, h, tx, ty, owner.owner)
if (isValid) ServerPacketSender.sendTextBufferCopy(owner.node.address, col, row, w, h, tx, ty, owner.owner)
}
override def onScreenDepthChange(depth: ColorDepth) {
owner.owner.markChanged()
ServerPacketSender.sendTextBufferDepthChange(owner.node.address, depth, owner.owner)
if (isValid) ServerPacketSender.sendTextBufferDepthChange(owner.node.address, depth, owner.owner)
}
override def onScreenFill(col: Int, row: Int, w: Int, h: Int, c: Char) {
super.onScreenFill(col, row, w, h, c)
owner.owner.markChanged()
ServerPacketSender.sendTextBufferFill(owner.node.address, col, row, w, h, c, owner.owner)
if (isValid) ServerPacketSender.sendTextBufferFill(owner.node.address, col, row, w, h, c, owner.owner)
}
override def onScreenPaletteChange(index: Int) {
owner.owner.markChanged()
ServerPacketSender.sendTextBufferPaletteChange(owner.node.address, index, owner.getPaletteColor(index), owner.owner)
if (isValid) ServerPacketSender.sendTextBufferPaletteChange(owner.node.address, index, owner.getPaletteColor(index), owner.owner)
}
override def onScreenResolutionChange(w: Int, h: Int) {
super.onScreenResolutionChange(w, h)
owner.owner.markChanged()
ServerPacketSender.sendTextBufferResolutionChange(owner.node.address, w, h, owner.owner)
if (isValid) ServerPacketSender.sendTextBufferResolutionChange(owner.node.address, w, h, owner.owner)
}
override def onScreenSet(col: Int, row: Int, s: String, vertical: Boolean) {
super.onScreenSet(col, row, s, vertical)
owner.owner.markChanged()
ServerPacketSender.sendTextBufferSet(owner.node.address, col, row, s, vertical, owner.owner)
if (isValid) ServerPacketSender.sendTextBufferSet(owner.node.address, col, row, s, vertical, owner.owner)
}
override def keyDown(character: Char, code: Int, player: EntityPlayer) {