Skip to content

Peppercorn Vines Entity Crash #21

@EngineOfDarkness

Description

@EngineOfDarkness

This is in 1.21.1, without any seasons mod.

-- Ticking Exception #1 - (BlockState: Peppercorn Vines) --
Details:
	Message: java.lang.NoSuchMethodError: 'float com.dtteam.dynamictrees.systems.season.SeasonHelper.globalSeasonalFruitProductionFactor(com.dtteam.dynamictrees.api.worldgen.LevelContext, net.minecraft.core.BlockPos, float, boolean)'
	Position: MutableBlockPos{x=-1630, y=70, z=795}
	BlockState: Block{dtphc2:peppercorn_vine}[up=false,north=false,east=false,age=0,west=true,south=false]
Stacktrace:
	at TRANSFORMER/[email protected]/maxhyper.dtphc2.blocks.FruitVineBlock.getFruitingChance(FruitVineBlock.java:202) ~[dtphc2-1.4.1.jar%23757!/:?] {re:classloading}
	at TRANSFORMER/[email protected]/maxhyper.dtphc2.blocks.FruitVineBlock.tryGrow(FruitVineBlock.java:147) ~[dtphc2-1.4.1.jar%23757!/:?] {re:classloading}
	at TRANSFORMER/[email protected]/maxhyper.dtphc2.blocks.FruitVineBlock.doTick(FruitVineBlock.java:141) ~[dtphc2-1.4.1.jar%23757!/:?] {re:classloading}
	at TRANSFORMER/[email protected]/maxhyper.dtphc2.blocks.FruitVineBlock.randomTick(FruitVineBlock.java:267) ~[dtphc2-1.4.1.jar%23757!/:?] {re:classloading}

private float getFruitingChance(Level world, BlockPos pos) {
if (seasonOffset == null) return baseFruitingChance;
float fruitFactor = SeasonHelper.globalSeasonalFruitProductionFactor(LevelContext.create(world), pos, seasonOffset, true);
return baseFruitingChance * Math.max((fruitFactor + 0.25f), 1);
}

While this seems similar to #19 I think (I haven't checked in dept though) the issue might be different one.

If I understand the way Java Types work correctly the property is nullable due to the @Nullable, but defaults to float 0

@Nullable
private Float seasonOffset = 0f;

However I don't think nullable could ever happen here, because the setter does not allow it (due to the missing @Nullable I assume?)

}
public FruitVineBlock setSeasonOffset(Float seasonOffset){
this.seasonOffset = seasonOffset;
return this;
}
public Float getSeasonOffset (){
return seasonOffset;
}

Thus all the checks in this class like seasonOffset == null would never be hit, potentially causing bugs (like I encountered)


Given this is the second type of "Seasons Mod not installed" type of bug, perhaps checking the other parts of the code for similar problems would be something to think about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions