mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-28 07:55:41 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e90643ea1 |
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ buildscript {
|
|||||||
apply plugin: 'scala'
|
apply plugin: 'scala'
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
|
|
||||||
version = "1.6.3"
|
version = "1.6.4"
|
||||||
|
|
||||||
if (project.hasProperty('buildnum')) {
|
if (project.hasProperty('buildnum')) {
|
||||||
project.version = project.version + '.' + project.buildnum
|
project.version = project.version + '.' + project.buildnum
|
||||||
|
|||||||
@@ -19,10 +19,13 @@ import scala.collection.mutable
|
|||||||
trait TileDataSlots extends TileExtended {
|
trait TileDataSlots extends TileExtended {
|
||||||
val dataSlots = mutable.HashMap.empty[String, DataSlot]
|
val dataSlots = mutable.HashMap.empty[String, DataSlot]
|
||||||
var lastChange = 0L
|
var lastChange = 0L
|
||||||
|
var lastGuiPacket = 0L
|
||||||
|
|
||||||
final val TRACE = false
|
final val TRACE = false
|
||||||
|
|
||||||
def doSave(kind: UpdateKind.Value, t: NBTTagCompound) {
|
def doSave(kind: UpdateKind.Value, t: NBTTagCompound) {
|
||||||
|
if (kind == UpdateKind.GUI)
|
||||||
|
t.setLong("BDLib_TS", getWorldObj.getTotalWorldTime)
|
||||||
for ((n, s) <- dataSlots if s.updateKind.contains(kind)) {
|
for ((n, s) <- dataSlots if s.updateKind.contains(kind)) {
|
||||||
s.save(t, kind)
|
s.save(t, kind)
|
||||||
if (TRACE) printf("%s: %s S=> %s\n".format(kind, n, t.getTag(n)))
|
if (TRACE) printf("%s: %s S=> %s\n".format(kind, n, t.getTag(n)))
|
||||||
@@ -30,6 +33,14 @@ trait TileDataSlots extends TileExtended {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def doLoad(kind: UpdateKind.Value, t: NBTTagCompound) {
|
def doLoad(kind: UpdateKind.Value, t: NBTTagCompound) {
|
||||||
|
if (kind == UpdateKind.GUI) {
|
||||||
|
val ts = t.getLong("BDLib_TS")
|
||||||
|
if (ts > lastGuiPacket) {
|
||||||
|
lastGuiPacket = ts
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
for ((n, s) <- dataSlots if s.updateKind.contains(kind)) {
|
for ((n, s) <- dataSlots if s.updateKind.contains(kind)) {
|
||||||
if (TRACE) printf("%s: %s L<= %s\n".format(kind, n, t.getTag(n)))
|
if (TRACE) printf("%s: %s L<= %s\n".format(kind, n, t.getTag(n)))
|
||||||
s.load(t, kind)
|
s.load(t, kind)
|
||||||
|
|||||||
Reference in new issue
Block a user