Skip to content

Commit 1676540

Browse files
committed
Misc fixes
1 parent f66238a commit 1676540

11 files changed

Lines changed: 38 additions & 38 deletions

File tree

common/src/backend/java/dev/engine_room/flywheel/backend/engine/CommonCrumbling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static void applyCrumblingProperties(SimpleMaterial.Builder crumblingMate
1616
.cutout(CutoutShaders.ONE_TENTH)
1717
.light(LightShaders.SMOOTH_WHEN_EMBEDDED)
1818
.polygonOffset(true)
19-
.transparency(Transparency.OPAQUE)
19+
.transparency(Transparency.CRUMBLING)
2020
.writeMask(WriteMask.COLOR)
2121
.useOverlay(false)
2222
.useLight(false)

common/src/backend/java/dev/engine_room/flywheel/backend/engine/MeshPool.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ public boolean isInvalid() {
183183

184184
public void draw(int instanceCount) {
185185
if (instanceCount > 1) {
186-
187186
GL32.glDrawElementsInstancedBaseVertex(GlConst.toGl(VertexFormat.Mode.TRIANGLES), mesh.indexCount(), GlConst.GL_UNSIGNED_INT, firstIndexByteOffset(), instanceCount, baseVertex);
188187
} else {
189188
GL32.glDrawElementsBaseVertex(GlConst.toGl(VertexFormat.Mode.TRIANGLES), mesh.indexCount(), GlConst.GL_UNSIGNED_INT, firstIndexByteOffset(), baseVertex);

common/src/backend/java/dev/engine_room/flywheel/backend/engine/uniform/UniformBuffer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import dev.engine_room.flywheel.lib.math.MoreMath;
99
import dev.engine_room.flywheel.lib.memory.MemoryBlock;
1010

11-
public class UniformBuffer {
11+
public class UniformBuffer {
1212
private final int index;
1313
private final MemoryBlock clientBuffer;
1414
@Nullable

common/src/backend/java/dev/engine_room/flywheel/backend/util/AtomicBitSet.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import java.util.BitSet;
77
import java.util.concurrent.atomic.AtomicReference;
88

9-
import org.jspecify.annotations.NonNull;
10-
119
// https://github.com/Netflix/hollow/blob/master/hollow/src/main/java/com/netflix/hollow/core/memory/ThreadSafeBitSet.java
1210
// Refactored to remove unused methods, deduplicate some code segments, and add extra functionality with #forEachSetSpan
1311
public class AtomicBitSet {
@@ -481,7 +479,7 @@ private long[] segmentForPosition(int segmentIndex) {
481479
return expandToFit(segmentIndex).getSegment(segmentIndex);
482480
}
483481

484-
private AtomicBitSet.@NonNull AtomicBitSetSegments expandToFit(int segmentIndex) {
482+
private AtomicBitSet.AtomicBitSetSegments expandToFit(int segmentIndex) {
485483
AtomicBitSetSegments visibleSegments = segments.get();
486484

487485
while (visibleSegments.numSegments() <= segmentIndex) {

common/src/backend/resources/flywheel.backend.mixins.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"required" : true,
3-
"minVersion" : "0.8",
4-
"package" : "dev.engine_room.flywheel.backend.mixin",
5-
"compatibilityLevel" : "JAVA_25",
6-
"client" : [
2+
"required": true,
3+
"minVersion": "0.8",
4+
"package": "dev.engine_room.flywheel.backend.mixin",
5+
"compatibilityLevel": "JAVA_25",
6+
"client": [
77
"AbstractClientPlayerAccessor",
88
"CameraAccessor",
99
"CameraMixin",
@@ -21,7 +21,7 @@
2121
"light.SkyDataLayerStorageMapAccessor",
2222
"light.SkyLightSectionStorageMixin"
2323
],
24-
"injectors" : {
25-
"defaultRequire" : 1
24+
"injectors": {
25+
"defaultRequire": 1
2626
}
2727
}
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
vec4 linearFogFade(vec4 color, float distance, float fogStart, float fogEnd) {
2-
if (distance <= fogStart) {
3-
return color;
4-
} else if (distance >= fogEnd) {
5-
return vec4(0.0);
6-
}
1+
vec4 linearFogFade(vec4 color, float sphericalVertexDistance, float cylindricalVertexDistance, float environmentalStart, float environmentalEnd, float renderDistanceStart, float renderDistanceEnd) {
2+
float sphericalValue = smoothstep(environmentalEnd, environmentalStart, sphericalVertexDistance);
3+
float cylindricalValue = smoothstep(renderDistanceEnd, renderDistanceStart, cylindricalVertexDistance);
4+
float fadeValue = min(sphericalValue, cylindricalValue);
75

8-
return color * smoothstep(fogEnd, fogStart, distance);
6+
return color * fadeValue;
97
}
108

119
vec4 flw_fogFilter(vec4 color) {
12-
return linearFogFade(color, flw_distance, flw_fogRange.x, flw_fogRange.y);
10+
return linearFogFade(color, flw_sphericalDistance, flw_cylindricalDistance, flw_fogEnvironmentalStart, flw_fogEnvironmentalEnd, flw_fogRenderDistanceStart, flw_fogRenderDistanceEnd);
1311
}

common/src/main/resources/assets/flywheel/lang/en_us.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"command.flywheel.limit_updates.get.off": "Update limiting is currently disabled",
77
"command.flywheel.limit_updates.get.on": "Update limiting is currently enabled",
88
"command.flywheel.limit_updates.set.off": "Update limiting is now disabled",
9-
"command.flywheel.limit_updates.set.on" : "Update limiting is now enabled",
10-
"command.flywheel.use_light_directions.get.off" : "Not using light directions",
11-
"command.flywheel.use_light_directions.get.on" : "Using light directions",
12-
"command.flywheel.use_light_directions.set.off" : "Set light directions to off",
13-
"command.flywheel.use_light_directions.set.on" : "Set light directions to on"
9+
"command.flywheel.limit_updates.set.on": "Update limiting is now enabled",
10+
"command.flywheel.use_light_directions.get.off": "Not using light directions",
11+
"command.flywheel.use_light_directions.get.on": "Using light directions",
12+
"command.flywheel.use_light_directions.set.off": "Set light directions to off",
13+
"command.flywheel.use_light_directions.set.on": "Set light directions to on"
1414
}

fabric/src/lib/java/dev/engine_room/flywheel/lib/model/baked/FabricPartialModel.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.util.concurrent.ConcurrentMap;
44

55
import org.jetbrains.annotations.ApiStatus;
6-
import org.jetbrains.annotations.NotNull;
76

87
import com.google.common.collect.MapMaker;
98

@@ -22,11 +21,13 @@
2221
import net.minecraft.server.packs.resources.ResourceManager;
2322
import net.minecraft.server.packs.resources.ResourceManagerReloadListener;
2423

24+
import org.jspecify.annotations.NullMarked;
25+
2526
@ApiStatus.Internal
2627
public class FabricPartialModel extends PartialModel {
2728
private static final ConcurrentMap<Identifier, FabricPartialModel> ALL = new MapMaker().weakValues().makeMap();
2829

29-
private final ExtraModelKey<@NotNull BlockStateModel> key;
30+
private final ExtraModelKey<BlockStateModel> key;
3031

3132
public FabricPartialModel(Identifier modelId) {
3233
super(modelId);
@@ -49,7 +50,8 @@ public static void refreshAll(ModelManager modelManager) {
4950
}
5051
}
5152

52-
private class Unbaked implements UnbakedExtraModel<@NotNull BlockStateModel> {
53+
@NullMarked
54+
private class Unbaked implements UnbakedExtraModel<BlockStateModel> {
5355
@Override
5456
public BlockStateModel bake(ModelBaker baker) {
5557
return new SingleVariant(SimpleModelWrapper.bake(baker, modelId, BlockModelRotation.IDENTITY));
@@ -61,6 +63,7 @@ public void resolveDependencies(Resolver resolver) {
6163
}
6264
}
6365

66+
@NullMarked
6467
public static class ResourceReloadListener implements ResourceManagerReloadListener {
6568
public static final Identifier ID = IdentifierUtil.id("partial_models");
6669

fabric/src/main/resources/fabric.mod.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"schemaVersion": 1,
3-
"id" : "${mod_id}",
4-
"name" : "${mod_name}",
5-
"version" : "${mod_version}",
6-
"description" : "${mod_description}",
3+
"id": "${mod_id}",
4+
"name": "${mod_name}",
5+
"version": "${mod_version}",
6+
"description": "${mod_description}",
77
"authors": [
88
"${mod_authors_json}"
99
],

neoforge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/NeoForgePartialModel.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.util.concurrent.ConcurrentMap;
44

55
import org.jetbrains.annotations.ApiStatus;
6-
import org.jetbrains.annotations.NotNull;
76

87
import com.google.common.collect.MapMaker;
98

@@ -20,11 +19,13 @@
2019
import net.neoforged.neoforge.client.model.standalone.StandaloneModelKey;
2120
import net.neoforged.neoforge.client.model.standalone.UnbakedStandaloneModel;
2221

22+
import org.jspecify.annotations.NullMarked;
23+
2324
@ApiStatus.Internal
2425
public class NeoForgePartialModel extends PartialModel {
2526
private static final ConcurrentMap<Identifier, NeoForgePartialModel> ALL = new MapMaker().weakValues().makeMap();
2627

27-
private final StandaloneModelKey<@NotNull BlockStateModel> key;
28+
private final StandaloneModelKey<BlockStateModel> key;
2829

2930
public NeoForgePartialModel(Identifier modelId) {
3031
super(modelId);
@@ -49,9 +50,10 @@ public static void refreshAll(ModelEvent.BakingCompleted event) {
4950
}
5051
}
5152

52-
private class Unbaked implements UnbakedStandaloneModel<@NotNull BlockStateModel> {
53+
@NullMarked
54+
private class Unbaked implements UnbakedStandaloneModel<BlockStateModel> {
5355
@Override
54-
public @NotNull BlockStateModel bake(ModelBaker baker, ModelDebugName name) {
56+
public BlockStateModel bake(ModelBaker baker, ModelDebugName name) {
5557
return new SingleVariant(SimpleModelWrapper.bake(baker, modelId, BlockModelRotation.IDENTITY));
5658
}
5759

0 commit comments

Comments
 (0)