Skip to content

Commit 50cf512

Browse files
committed
Merge remote-tracking branch 'origin/mc1.20.1/dev' into mc1.20.1/dev
2 parents eb87c5e + a1c95bb commit 50cf512

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

SECURITY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The versions currently supported can be found [here](https://wiki.createmod.net/users/development-status)
6+
7+
## Reporting a Vulnerability
8+
9+
To report a vulnerability please head [here](https://github.com/Creators-of-Create/Create/security/advisories/new)

src/main/java/com/simibubi/create/content/trains/track/TrackVisual.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import dev.engine_room.flywheel.lib.instance.FlatLit;
2222
import dev.engine_room.flywheel.lib.instance.InstanceTypes;
2323
import dev.engine_room.flywheel.lib.instance.TransformedInstance;
24-
import dev.engine_room.flywheel.lib.model.Models;
2524
import dev.engine_room.flywheel.lib.transform.TransformStack;
2625
import dev.engine_room.flywheel.lib.visual.AbstractBlockEntityVisual;
2726
import it.unimi.dsi.fastutil.longs.LongArraySet;
@@ -30,6 +29,7 @@
3029
import net.createmod.catnip.data.Iterate;
3130
import net.minecraft.core.BlockPos;
3231
import net.minecraft.core.SectionPos;
32+
import net.minecraft.util.Mth;
3333
import net.minecraft.world.level.Level;
3434
import net.minecraft.world.level.LightLayer;
3535

@@ -98,14 +98,15 @@ public LongSet collectLightSections() {
9898
int maxY = Integer.MIN_VALUE;
9999
int maxZ = Integer.MIN_VALUE;
100100
for (BezierConnection connection : blockEntity.connections.values()) {
101-
for (BlockPos pos : connection.bePositions) {
102-
minX = Math.min(minX, pos.getX());
103-
minY = Math.min(minY, pos.getY());
104-
minZ = Math.min(minZ, pos.getZ());
105-
maxX = Math.max(maxX, pos.getX());
106-
maxY = Math.max(maxY, pos.getY());
107-
maxZ = Math.max(maxZ, pos.getZ());
108-
}
101+
// The start and end positions are not enough to enclose the entire curve.
102+
// Check the computed bounds but expand by one for safety.
103+
var bounds = connection.getBounds();
104+
minX = Math.min(minX, Mth.floor(bounds.minX) - 1);
105+
minY = Math.min(minY, Mth.floor(bounds.minY) - 1);
106+
minZ = Math.min(minZ, Mth.floor(bounds.minZ) - 1);
107+
maxX = Math.max(maxX, Mth.ceil(bounds.maxX) + 1);
108+
maxY = Math.max(maxY, Mth.ceil(bounds.maxY) + 1);
109+
maxZ = Math.max(maxZ, Mth.ceil(bounds.maxZ) + 1);
109110
}
110111

111112
var minSectionX = ContraptionVisual.minLightSection(minX);
@@ -230,9 +231,9 @@ private GirderVisual(BezierConnection bc) {
230231
beams = Couple.create(() -> new TransformedInstance[segCount]);
231232
beamCaps = Couple.create(() -> Couple.create(() -> new TransformedInstance[segCount]));
232233
lightPos = new BlockPos[segCount];
233-
beams.forEach(instancerProvider().instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.GIRDER_SEGMENT_MIDDLE))::createInstances);
234+
beams.forEach(instancerProvider().instancer(InstanceTypes.TRANSFORMED, SpecialModels.flatChunk(AllPartialModels.GIRDER_SEGMENT_MIDDLE))::createInstances);
234235
beamCaps.forEachWithContext((c, top) -> {
235-
var partialModel = Models.partial(top ? AllPartialModels.GIRDER_SEGMENT_TOP : AllPartialModels.GIRDER_SEGMENT_BOTTOM);
236+
var partialModel = SpecialModels.flatChunk(top ? AllPartialModels.GIRDER_SEGMENT_TOP : AllPartialModels.GIRDER_SEGMENT_BOTTOM);
236237
c.forEach(instancerProvider().instancer(InstanceTypes.TRANSFORMED, partialModel)::createInstances);
237238
});
238239

0 commit comments

Comments
 (0)