mirror of
https://github.com/GTNewHorizons/ForgeRelocation.git
synced 2026-11-12 00:17:58 +00:00
Preserve relocation structure deduplication
This commit is contained in:
1 parent
45377a81c0
commit
ad25d59d47
1 file changed
+8
-1
@@ -280,7 +280,12 @@ class WorldStructs {
|
||||
false
|
||||
}
|
||||
|
||||
def addStruct(b: BlockStruct) = synchronized {
|
||||
def addStruct(b: BlockStruct): Unit = synchronized {
|
||||
var i = 0
|
||||
while (i < numStructs) {
|
||||
if (structsArr(i).id == b.id) return
|
||||
i += 1
|
||||
}
|
||||
if (numStructs == structsArr.length) {
|
||||
val ns = new Array[BlockStruct](structsArr.length * 2)
|
||||
System.arraycopy(structsArr, 0, ns, 0, numStructs)
|
||||
@@ -469,6 +474,8 @@ class BlockStruct {
|
||||
case _ => false
|
||||
}
|
||||
|
||||
override def hashCode() = id
|
||||
|
||||
def writeDesc(out: MCDataOutput) {
|
||||
out.writeFloat(progress.toFloat)
|
||||
out.writeFloat(speed.toFloat)
|
||||
|
||||
Reference in new issue
Block a user