26.1-snap-2
This commit is contained in:
1 parent
0595f0ced7
commit
dee2d0fb87
8 files changed
+27
-27
No files matched your search
@@ -108,7 +108,7 @@ public abstract class LevelChunk_movableBEMixin extends ChunkAccess implements W
|
||||
if (hadOnlyAir != hasOnlyAir)
|
||||
{
|
||||
this.level.getChunkSource().getLightEngine().updateSectionStatus(blockPos_1, hasOnlyAir);
|
||||
this.level.getChunkSource().onSectionEmptinessChanged(chunkPos.x, SectionPos.blockToSectionCoord(y), chunkPos.z, hasOnlyAir);
|
||||
this.level.getChunkSource().onSectionEmptinessChanged(chunkPos.x(), SectionPos.blockToSectionCoord(y), chunkPos.z(), hasOnlyAir);
|
||||
}
|
||||
|
||||
if (LightEngine.hasDifferentLightProperties(oldBlockState, newBlockState)) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class LevelEntityGetterAdapter_scarpetMixin<T extends EntityAccess> imple
|
||||
|
||||
@Override
|
||||
public List<T> getChunkEntities(ChunkPos chpos) {
|
||||
return this.sectionStorage.getExistingSectionsInChunk(chpos.toLong()).flatMap(EntitySection::getEntities).collect(Collectors.toList());
|
||||
return this.sectionStorage.getExistingSectionsInChunk(chpos.pack()).flatMap(EntitySection::getEntities).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ public abstract class ThreadedLevelLightEngine_scarpetChunkCreationMixin extends
|
||||
ChunkPos pos = chunk.getPos();
|
||||
chunk.setLightCorrect(false);
|
||||
|
||||
this.addTask(pos.x, pos.z, () -> 0, ThreadedLevelLightEngine.TaskType.PRE_UPDATE, Util.name(() -> {
|
||||
this.addTask(pos.x(), pos.z(), () -> 0, ThreadedLevelLightEngine.TaskType.PRE_UPDATE, Util.name(() -> {
|
||||
super.setLightEnabled(pos, false);
|
||||
((Lighting_scarpetChunkCreationInterface) this).removeLightData(SectionPos.getZeroNode(SectionPos.asLong(pos.x, 0, pos.z)));
|
||||
((Lighting_scarpetChunkCreationInterface) this).removeLightData(SectionPos.getZeroNode(SectionPos.asLong(pos.x(), 0, pos.z())));
|
||||
},
|
||||
() -> "Remove light data " + pos
|
||||
));
|
||||
@@ -59,7 +59,7 @@ public abstract class ThreadedLevelLightEngine_scarpetChunkCreationMixin extends
|
||||
{
|
||||
ChunkPos pos = chunk.getPos();
|
||||
|
||||
this.addTask(pos.x, pos.z, () -> 0, ThreadedLevelLightEngine.TaskType.PRE_UPDATE, Util.name(() -> {
|
||||
this.addTask(pos.x(), pos.z(), () -> 0, ThreadedLevelLightEngine.TaskType.PRE_UPDATE, Util.name(() -> {
|
||||
super.propagateLightSources(pos);
|
||||
int minY = chunk.getMinY();
|
||||
int maxY = chunk.getMaxY();
|
||||
@@ -92,7 +92,7 @@ public abstract class ThreadedLevelLightEngine_scarpetChunkCreationMixin extends
|
||||
},
|
||||
() -> "Release relight ticket " + pos
|
||||
),
|
||||
runnable -> this.addTask(pos.x, pos.z, () -> 0, ThreadedLevelLightEngine.TaskType.POST_UPDATE, runnable)
|
||||
runnable -> this.addTask(pos.x(), pos.z(), () -> 0, ThreadedLevelLightEngine.TaskType.POST_UPDATE, runnable)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -509,7 +509,7 @@ public class CarpetEventServer
|
||||
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
||||
{
|
||||
handler.call(
|
||||
() -> Arrays.asList(new NumericValue(chPos.x << 4), new NumericValue(chPos.z << 4)),
|
||||
() -> Arrays.asList(new NumericValue(chPos.x() << 4), new NumericValue(chPos.z() << 4)),
|
||||
() -> world.getServer().createCommandSourceStack().withLevel(world)
|
||||
);
|
||||
}
|
||||
@@ -521,7 +521,7 @@ public class CarpetEventServer
|
||||
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
||||
{
|
||||
handler.call(
|
||||
() -> Arrays.asList(new NumericValue(chPos.x << 4), new NumericValue(chPos.z << 4)),
|
||||
() -> Arrays.asList(new NumericValue(chPos.x() << 4), new NumericValue(chPos.z() << 4)),
|
||||
() -> world.getServer().createCommandSourceStack().withLevel(world)
|
||||
);
|
||||
}
|
||||
@@ -533,7 +533,7 @@ public class CarpetEventServer
|
||||
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
||||
{
|
||||
handler.call(
|
||||
() -> Arrays.asList(new NumericValue(chPos.x << 4), new NumericValue(chPos.z << 4)),
|
||||
() -> Arrays.asList(new NumericValue(chPos.x() << 4), new NumericValue(chPos.z() << 4)),
|
||||
() -> world.getServer().createCommandSourceStack().withLevel(world)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -570,9 +570,9 @@ public class WorldAccess
|
||||
expression.addContextFunction("in_slime_chunk", -1, (c, t, lv) ->
|
||||
{
|
||||
BlockPos pos = BlockArgument.findIn((CarpetContext) c, lv, 0).block.getPos();
|
||||
ChunkPos chunkPos = new ChunkPos(pos);
|
||||
ChunkPos chunkPos = ChunkPos.containing(pos);
|
||||
return BooleanValue.of(WorldgenRandom.seedSlimeChunk(
|
||||
chunkPos.x, chunkPos.z,
|
||||
chunkPos.x(), chunkPos.z(),
|
||||
((CarpetContext) c).level().getSeed(),
|
||||
987234911L
|
||||
).nextInt(10) == 0);
|
||||
@@ -624,7 +624,7 @@ public class WorldAccess
|
||||
{
|
||||
force = lv.get(locator.offset).getBoolean();
|
||||
}
|
||||
return BooleanValue.of(canHasChunk(((CarpetContext) c).level(), new ChunkPos(pos), null, force));
|
||||
return BooleanValue.of(canHasChunk(((CarpetContext) c).level(), ChunkPos.containing(pos), null, force));
|
||||
});
|
||||
|
||||
expression.addContextFunction("generation_status", -1, (c, t, lv) ->
|
||||
@@ -651,14 +651,14 @@ public class WorldAccess
|
||||
{
|
||||
for (long key : levelTickets.keySet())
|
||||
{
|
||||
ChunkPos chpos = new ChunkPos(key);
|
||||
ChunkPos chpos = ChunkPos.unpack(key);
|
||||
for (Ticket ticket : levelTickets.get(key))
|
||||
{
|
||||
res.add(ListValue.of(
|
||||
new StringValue(ticket.getType().toString()),
|
||||
new NumericValue(33 - ticket.getTicketLevel()),
|
||||
new NumericValue(chpos.x),
|
||||
new NumericValue(chpos.z)
|
||||
new NumericValue(chpos.x()),
|
||||
new NumericValue(chpos.z())
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -667,7 +667,7 @@ public class WorldAccess
|
||||
{
|
||||
BlockArgument blockArgument = BlockArgument.findIn((CarpetContext) c, lv, 0);
|
||||
BlockPos pos = blockArgument.block.getPos();
|
||||
List<Ticket> tickets = levelTickets.get(new ChunkPos(pos).toLong());
|
||||
List<Ticket> tickets = levelTickets.get(ChunkPos.containing(pos).pack());
|
||||
if (tickets != null)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
@@ -1574,7 +1574,7 @@ public class WorldAccess
|
||||
world.getChunk(chpos.getWorldPosition()).getAllReferences();
|
||||
if (references.containsKey(configuredStructure) && references.get(configuredStructure) != null)
|
||||
{
|
||||
references.get(configuredStructure).remove(structureChunkPos.toLong());
|
||||
references.get(configuredStructure).remove(structureChunkPos.pack());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1695,7 +1695,7 @@ public class WorldAccess
|
||||
throw new InternalExpressionException("Ticket radius should be between 1 and 32 chunks");
|
||||
}
|
||||
// due to types we will wing it:
|
||||
ChunkPos target = new ChunkPos(pos);
|
||||
ChunkPos target = ChunkPos.containing(pos);
|
||||
if (ticket == TicketType.PORTAL) // portal
|
||||
{
|
||||
cc.level().getChunkSource().addTicketWithRadius(TicketType.PORTAL, target, radius);
|
||||
|
||||
@@ -239,8 +239,8 @@ public class FeatureGenerator
|
||||
ChunkGenerator generator = chunkSource.getGenerator();
|
||||
ChunkGeneratorStructureState structureState = chunkSource.getGeneratorState();
|
||||
List<StructurePlacement> structureConfig = structureState.getPlacementsForStructure(Holder.direct(structure));
|
||||
ChunkPos chunkPos = new ChunkPos(pos);
|
||||
boolean couldPlace = structureConfig.stream().anyMatch(p -> p.isStructureChunk(structureState, chunkPos.x, chunkPos.z));
|
||||
ChunkPos chunkPos = ChunkPos.containing(pos);
|
||||
boolean couldPlace = structureConfig.stream().anyMatch(p -> p.isStructureChunk(structureState, chunkPos.x(), chunkPos.z()));
|
||||
if (!couldPlace)
|
||||
{
|
||||
return null;
|
||||
@@ -418,7 +418,7 @@ public class FeatureGenerator
|
||||
checks.set(true);
|
||||
try
|
||||
{
|
||||
StructureStart start = structure.generate(Holder.direct(structure), world.dimension(), world.registryAccess(), generator, generator.getBiomeSource(), world.getChunkSource().randomState(), world.getStructureManager(), world.getSeed(), new ChunkPos(pos), 0, world, b -> true);
|
||||
StructureStart start = structure.generate(Holder.direct(structure), world.dimension(), world.registryAccess(), generator, generator.getBiomeSource(), world.getChunkSource().randomState(), world.getStructureManager(), world.getSeed(), ChunkPos.containing(pos), 0, world, b -> true);
|
||||
if (start == StructureStart.INVALID_START)
|
||||
{
|
||||
return false;
|
||||
@@ -426,7 +426,7 @@ public class FeatureGenerator
|
||||
RandomSource rand = RandomSource.create(world.getRandom().nextInt());
|
||||
int j = pos.getX() >> 4;
|
||||
int k = pos.getZ() >> 4;
|
||||
long chId = ChunkPos.asLong(j, k);
|
||||
long chId = ChunkPos.pack(j, k);
|
||||
world.getChunk(j, k).setStartForStructure(structure, start);
|
||||
world.getChunk(j, k).addReferenceForStructure(structure, chId);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class WorldTools
|
||||
|
||||
public static boolean canHasChunk(ServerLevel world, ChunkPos chpos, @Nullable Map<String, RegionFile> regionCache, boolean deepcheck)
|
||||
{
|
||||
if (world.getChunk(chpos.x, chpos.z, ChunkStatus.STRUCTURE_STARTS, false) != null)
|
||||
if (world.getChunk(chpos.x(), chpos.z(), ChunkStatus.STRUCTURE_STARTS, false) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -159,8 +159,8 @@ public class WorldTools
|
||||
|
||||
public static void forceChunkUpdate(BlockPos pos, ServerLevel world)
|
||||
{
|
||||
ChunkPos chunkPos = new ChunkPos(pos);
|
||||
LevelChunk worldChunk = world.getChunkSource().getChunk(chunkPos.x, chunkPos.z, false);
|
||||
ChunkPos chunkPos = ChunkPos.containing(pos);
|
||||
LevelChunk worldChunk = world.getChunkSource().getChunk(chunkPos.x(), chunkPos.z(), false);
|
||||
if (worldChunk != null)
|
||||
{
|
||||
List<ServerPlayer> players = world.getChunkSource().chunkMap.getPlayers(chunkPos, false);
|
||||
|
||||
Reference in new issue
Block a user