Skip to content

Commit

Permalink
fix server crash
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Jul 13, 2024
1 parent 1c33dd3 commit c72c4e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.pinkgoosik.winterly.Winterly;
import ru.pinkgoosik.winterly.client.render.MobDecorations;
import ru.pinkgoosik.winterly.extension.DecoratedMob;
import ru.pinkgoosik.winterly.util.HolidayUtils;

Expand All @@ -34,7 +33,7 @@ void finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, Mob
if(!this.level().dimension().equals(Level.NETHER)) {
int chance = Winterly.config.mobDecorations.chance;
if(chance > 0 && Math.random() < (double)chance / 100) {
decorated.winterly$setDecoration(level.getRandom().nextInt(MobDecorations.LIST.size()));
decorated.winterly$setDecoration(level.getRandom().nextInt(11));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.pinkgoosik.winterly.Winterly;
import ru.pinkgoosik.winterly.client.render.MobDecorations;
import ru.pinkgoosik.winterly.extension.DecoratedMob;
import ru.pinkgoosik.winterly.util.HolidayUtils;

Expand Down Expand Up @@ -72,7 +71,7 @@ void finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, Mob
if(!this.level().dimension().equals(Level.NETHER)) {
int chance = Winterly.config.mobDecorations.chance;
if(chance > 0 && Math.random() < (double)chance / 100) {
this.winterly$setDecoration(level.getRandom().nextInt(MobDecorations.LIST.size()));
this.winterly$setDecoration(level.getRandom().nextInt(11));
}
}

Expand Down

0 comments on commit c72c4e3

Please sign in to comment.