fix building

This commit is contained in:
creeper123123321 2021-05-26 20:56:13 -03:00
parent 087778ff2b
commit 8d086c4c3f
2 changed files with 7 additions and 6 deletions

View File

@ -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 {

View File

@ -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 -> {