mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-22 12:05:45 +01:00
fix building
This commit is contained in:
parent
087778ff2b
commit
8d086c4c3f
@ -46,12 +46,12 @@ version = "0.4.0-SNAPSHOT+" + try {
|
||||
extra.set("archivesBaseName", "VIAaaS")
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots")
|
||||
maven("https://repo.viaversion.com/")
|
||||
maven("https://repo.aikar.co/content/groups/aikar/")
|
||||
maven("https://jitpack.io")
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -9,20 +9,21 @@ import de.gerrygames.viarewind.protocol.protocol1_8to1_7_6_10.metadata.MetaIndex
|
||||
object MetadataRewriter {
|
||||
fun transform(type: Entity1_10Types.EntityType?, list: MutableList<Metadata>) {
|
||||
for (entry in ArrayList(list)) {
|
||||
val metaIndex = MetaIndex1_8to1_7_6_10.searchIndex(type, entry.id)
|
||||
val metaIndex = MetaIndex1_8to1_7_6_10.searchIndex(type, entry.id())
|
||||
try {
|
||||
if (metaIndex == null) throw Exception("Could not find valid metadata")
|
||||
if (metaIndex.newType == MetaType1_8.NonExistent) {
|
||||
if (metaIndex.newType == MetaType1_8.NonExistent || metaIndex.newType == null) {
|
||||
list.remove(entry)
|
||||
return
|
||||
}
|
||||
val value = entry.value
|
||||
if (!value.javaClass.isAssignableFrom(metaIndex.oldType.type.outputClass)) {
|
||||
if (value == null
|
||||
|| !value.javaClass.isAssignableFrom(metaIndex.oldType.type().outputClass)) {
|
||||
list.remove(entry)
|
||||
return
|
||||
}
|
||||
entry.metaType = metaIndex.newType
|
||||
entry.id = metaIndex.newIndex
|
||||
entry.setMetaType(metaIndex.newType)
|
||||
entry.setId(metaIndex.newIndex)
|
||||
when (metaIndex.newType) {
|
||||
MetaType1_8.Int -> entry.value = (value as Number).toInt()
|
||||
MetaType1_8.Byte -> {
|
||||
|
Loading…
Reference in New Issue
Block a user