Compare commits
No commits in common. "7e9352e60a50b3c7a976757c5c061e658be5e803" and "aa461c322f3d22fd3f8d66eaae4bb09128e62387" have entirely different histories.
7e9352e60a
...
aa461c322f
@ -96,6 +96,7 @@ import ru.dbotthepony.mc.otm.core.math.Decimal
|
|||||||
import ru.dbotthepony.mc.otm.core.math.RGBColorDFUCodec
|
import ru.dbotthepony.mc.otm.core.math.RGBColorDFUCodec
|
||||||
import ru.dbotthepony.mc.otm.core.math.minus
|
import ru.dbotthepony.mc.otm.core.math.minus
|
||||||
import ru.dbotthepony.mc.otm.core.nbt.getCompoundList
|
import ru.dbotthepony.mc.otm.core.nbt.getCompoundList
|
||||||
|
import ru.dbotthepony.mc.otm.core.nbt.getIntList
|
||||||
import ru.dbotthepony.mc.otm.core.nbt.getStringList
|
import ru.dbotthepony.mc.otm.core.nbt.getStringList
|
||||||
import ru.dbotthepony.mc.otm.core.nbt.set
|
import ru.dbotthepony.mc.otm.core.nbt.set
|
||||||
import ru.dbotthepony.mc.otm.core.util.Savetables
|
import ru.dbotthepony.mc.otm.core.util.Savetables
|
||||||
@ -534,8 +535,8 @@ class MatteryPlayer(val ply: Player) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val input = MatteryContainer(Runnable { notify(IdleReason.ITEM) }, 1)
|
val input = MatteryContainer({ notify(IdleReason.ITEM) }, 1)
|
||||||
val output = MatteryContainer(Runnable { notify(IdleReason.ITEM) }, 1)
|
val output = MatteryContainer({ notify(IdleReason.ITEM) }, 1)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
savetables.stateful(::input, "exopack_smelter_input_$index")
|
savetables.stateful(::input, "exopack_smelter_input_$index")
|
||||||
@ -599,7 +600,6 @@ class MatteryPlayer(val ply: Player) {
|
|||||||
|
|
||||||
fun invalidateNetworkState() {
|
fun invalidateNetworkState() {
|
||||||
privateSyncherRemote.invalidate()
|
privateSyncherRemote.invalidate()
|
||||||
publicSyncherRemote.invalidate()
|
|
||||||
remoteSynchers.values.forEach { it.invalidate() }
|
remoteSynchers.values.forEach { it.invalidate() }
|
||||||
|
|
||||||
for (instance in research.values) {
|
for (instance in research.values) {
|
||||||
@ -949,7 +949,12 @@ class MatteryPlayer(val ply: Player) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tag.putIntArray("slotsChargeFlag", slotsChargeFlag.toIntArray())
|
tag["slotsChargeFlag"] = ListTag().also {
|
||||||
|
for (value in slotsChargeFlag) {
|
||||||
|
it.add(IntTag.valueOf(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return tag
|
return tag
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -980,8 +985,8 @@ class MatteryPlayer(val ply: Player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ("slotsChargeFlag" in tag) {
|
if ("slotsChargeFlag" in tag) {
|
||||||
for (v in tag.getIntArray("slotsChargeFlag")) {
|
for (v in tag.getIntList("slotsChargeFlag")) {
|
||||||
this.slotsChargeFlag.add(v)
|
this.slotsChargeFlag.add(v.asInt)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
slotChargeToDefault()
|
slotChargeToDefault()
|
||||||
|
@ -79,6 +79,18 @@ fun <T> CompoundTag.mapString(index: String, mapper: (String) -> T, orElse: T):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
|
fun CompoundTag.getByteList(key: String): MutableList<ByteTag> = getList(key, Tag.TAG_BYTE.toInt()) as MutableList<ByteTag>
|
||||||
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
|
fun CompoundTag.getShortList(key: String): MutableList<ShortTag> = getList(key, Tag.TAG_SHORT.toInt()) as MutableList<ShortTag>
|
||||||
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
|
fun CompoundTag.getIntList(key: String): MutableList<IntTag> = getList(key, Tag.TAG_INT.toInt()) as MutableList<IntTag>
|
||||||
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
|
fun CompoundTag.getLongList(key: String): MutableList<LongTag> = getList(key, Tag.TAG_LONG.toInt()) as MutableList<LongTag>
|
||||||
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
|
fun CompoundTag.getFloatList(key: String): MutableList<FloatTag> = getList(key, Tag.TAG_FLOAT.toInt()) as MutableList<FloatTag>
|
||||||
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
|
fun CompoundTag.getDoubleList(key: String): MutableList<DoubleTag> = getList(key, Tag.TAG_DOUBLE.toInt()) as MutableList<DoubleTag>
|
||||||
@Suppress("unchecked_cast") // type is checked inside getList
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
fun CompoundTag.getByteArrayList(key: String): MutableList<ByteArrayTag> = getList(key, Tag.TAG_BYTE_ARRAY.toInt()) as MutableList<ByteArrayTag>
|
fun CompoundTag.getByteArrayList(key: String): MutableList<ByteArrayTag> = getList(key, Tag.TAG_BYTE_ARRAY.toInt()) as MutableList<ByteArrayTag>
|
||||||
@Suppress("unchecked_cast") // type is checked inside getList
|
@Suppress("unchecked_cast") // type is checked inside getList
|
||||||
|
@ -76,7 +76,7 @@ class DelegateSyncher : Observer {
|
|||||||
|
|
||||||
fun read(registry: RegistryAccess, bytes: ByteArrayList) {
|
fun read(registry: RegistryAccess, bytes: ByteArrayList) {
|
||||||
return decodePayload(registry, bytes) {
|
return decodePayload(registry, bytes) {
|
||||||
read(it)
|
read(RegistryFriendlyByteBuf(it, registry, ConnectionType.NEOFORGE))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user