Skip to content

Incorrect return value in stress provider #56

@patryk3211

Description

@patryk3211

The current implementation of CCStressProvider can break other Create addons which register their own stress providers. It returns a valid DoubleSupplier for all blocks, even if they don't come from Compressed Creativity, which blocks all downstream providers from firing. The default return value for impact and capacity functions should be null.

public DoubleSupplier getImpact(Block block) {
if (block instanceof RotationalCompressorBlock) {
return (() -> CommonConfig.ROTATIONAL_COMPRESSOR_STRESS.get() / 256.0);
}
return (() -> 0.0);
}
public DoubleSupplier getCapacity(Block block) {
if (block instanceof CompressedAirEngineBlock) {
return (() -> CommonConfig.COMPRESSED_AIR_ENGINE_STRESS.get() / 256.0);
}
return (() -> 0.0);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions