Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Dont throw error on interact with unknown prefab
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Sep 11, 2022
1 parent 5c8989e commit 0154f15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ fun ItemStack.toGearyOrNull(player: Player): GearyEntity? {
pdc.decode<UUID>()?.let { return globalContextMC.uuid2entity[it] }

// If no UUID, try to read as a player-instanced item
val prefab = pdc.decodePrefabs().firstOrNull() ?: return null
return player.toGeary().get<PlayerItemCache>()?.getInstance(prefab.toEntity())
val prefab = pdc.decodePrefabs().firstOrNull()?.toEntityOrNull() ?: return null
return player.toGeary().get<PlayerItemCache>()?.getInstance(prefab)
}

0 comments on commit 0154f15

Please sign in to comment.