SpoiledZ

SpoiledZ

588 Downloads

crash on startup specifically on dedicated server

abudq opened this issue ยท 2 comments

commented

Minecraft Version

1.20.x

Mod Loader Version

0.15.6

Mod Version

1.0.9

Describe the Issue

crash on start up server with fabric seasons and spoiledz installed

latest.log

https://gist.github.com/abudq/46f6c2ed62196932f655b752e2be0e26

Do you use any other mods except the required ones?

no

commented

simple enough fix. just need to pass a this reference when calling getCurrentSeason

if ((int) timeOfDay % 20 == 0 && this.currentSeason == null || this.currentSeason != FabricSeasons.getCurrentSeason()) {
if (this.currentSeason != null) {
for (Map.Entry<BlockPos, ItemStack> entry : new ArrayList<>(this.foodBlockMap.getFoodBlockMap().entrySet())) {
if (this.getBlockState(entry.getKey()).contains(SpoiledUtil.SPOILED)) {
int spoilTime = SpoiledUtil.getSpoilingTime(this, entry.getValue());
if (spoilTime != -1 && spoilTime >= 4) {
this.getBlockState(entry.getKey()).scheduledTick((ServerWorld) (Object) this, entry.getKey(), random);
this.foodBlockMap.removeFoodBlock(entry.getKey());
}
} else {
this.foodBlockMap.removeFoodBlock(entry.getKey());
}
}
}
this.currentSeason = FabricSeasons.getCurrentSeason();

https://github.com/lucaargolo/fabric-seasons/blob/ed49f84b889c398d884f7d26d7b519aac6155c64/src/main/java/io/github/lucaargolo/seasons/FabricSeasons.java#L226

commented

Thanks Linguardium for the hint, source code of Seasons even says the method is for client side only, don't know how I missed that.
Fixed with 495db3c