fix weighted model retrieving

Yes, that `.toInt()` was missing. It literally took me over one hour to debug. I attached a debugger to minecraft and it was a total mess.
This commit is contained in:
Moritz Zwerger 2023-07-30 23:32:43 +02:00
parent 175f6d0729
commit 7726de25c7
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -40,7 +40,7 @@ class WeightedBlockRender(
if (random == null) return models.first().model
random.setSeed(position.positionHash)
var weightLeft = abs(random.nextLong() % totalWeight)
var weightLeft = abs(random.nextLong().toInt() % totalWeight)
for ((weight, model) in models) {
weightLeft -= weight