mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 01:48:04 -04:00
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:
parent
175f6d0729
commit
7726de25c7
@ -40,7 +40,7 @@ class WeightedBlockRender(
|
|||||||
if (random == null) return models.first().model
|
if (random == null) return models.first().model
|
||||||
random.setSeed(position.positionHash)
|
random.setSeed(position.positionHash)
|
||||||
|
|
||||||
var weightLeft = abs(random.nextLong() % totalWeight)
|
var weightLeft = abs(random.nextLong().toInt() % totalWeight)
|
||||||
|
|
||||||
for ((weight, model) in models) {
|
for ((weight, model) in models) {
|
||||||
weightLeft -= weight
|
weightLeft -= weight
|
||||||
|
Loading…
x
Reference in New Issue
Block a user