Skip to content

Commit

Permalink
Fix VengeanceSpirit using wrong RandomSource
Browse files Browse the repository at this point in the history
Closes #1064
  • Loading branch information
rubensworks committed Oct 2, 2024
1 parent 0fee307 commit dfd71f4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public EntityVengeanceSpirit(EntityType<? extends EntityVengeanceSpirit> type, L
this.blocksBuilding = false;

float damage = 0.5F;
int remainingLife = Mth.nextInt(level.random, REMAININGLIFE_MIN, REMAININGLIFE_MAX);
int remainingLife = Mth.nextInt(this.getRandom(), REMAININGLIFE_MIN, REMAININGLIFE_MAX);
if(isSwarm()) {
damage += 0.5D * getSwarmTier();
remainingLife += (REMAININGLIFE_MAX - REMAININGLIFE_MIN) * getSwarmTier();
Expand Down Expand Up @@ -648,9 +648,9 @@ public static EntityVengeanceSpirit spawnRandom(Level level, BlockPos blockPos,
int baseDistance = 5;
while(canSpawnNew(level, blockPos) && attempts > 0) {
BlockPos spawnPos = blockPos.offset(
Mth.nextInt(level.random, baseDistance, baseDistance + area) * Mth.nextInt(level.random, -1, 1),
Mth.nextInt(level.random, 0, 3) * Mth.nextInt(level.random, -1, 1),
Mth.nextInt(level.random, baseDistance, baseDistance + area) * Mth.nextInt(level.random, -1, 1)
Mth.nextInt(spirit.random, baseDistance, baseDistance + area) * Mth.nextInt(spirit.random, -1, 1),
Mth.nextInt(spirit.random, 0, 3) * Mth.nextInt(spirit.random, -1, 1),
Mth.nextInt(spirit.random, baseDistance, baseDistance + area) * Mth.nextInt(spirit.random, -1, 1)
);

if(BlockHelpers.doesBlockHaveSolidTopSurface(level, spawnPos.offset(0, -1, 0))) {
Expand Down

0 comments on commit dfd71f4

Please sign in to comment.