26.1-snap-2
This commit is contained in:
1 parent
0595f0ced7
commit
dee2d0fb87
8 files changed
+27
-27
No files matched your search
+2
-2
@@ -7,8 +7,8 @@ org.gradle.configuration-cache=false
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check https://fabricmc.net/develop/
|
# check https://fabricmc.net/develop/
|
||||||
minecraft_version=26.1-snapshot-1
|
minecraft_version=26.1-snapshot-2
|
||||||
loader_version=0.18.3
|
loader_version=0.18.4
|
||||||
loom_version=1.14-SNAPSHOT
|
loom_version=1.14-SNAPSHOT
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public abstract class LevelChunk_movableBEMixin extends ChunkAccess implements W
|
|||||||
if (hadOnlyAir != hasOnlyAir)
|
if (hadOnlyAir != hasOnlyAir)
|
||||||
{
|
{
|
||||||
this.level.getChunkSource().getLightEngine().updateSectionStatus(blockPos_1, 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)) {
|
if (LightEngine.hasDifferentLightProperties(oldBlockState, newBlockState)) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class LevelEntityGetterAdapter_scarpetMixin<T extends EntityAccess> imple
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<T> getChunkEntities(ChunkPos chpos) {
|
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();
|
ChunkPos pos = chunk.getPos();
|
||||||
chunk.setLightCorrect(false);
|
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);
|
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
|
() -> "Remove light data " + pos
|
||||||
));
|
));
|
||||||
@@ -59,7 +59,7 @@ public abstract class ThreadedLevelLightEngine_scarpetChunkCreationMixin extends
|
|||||||
{
|
{
|
||||||
ChunkPos pos = chunk.getPos();
|
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);
|
super.propagateLightSources(pos);
|
||||||
int minY = chunk.getMinY();
|
int minY = chunk.getMinY();
|
||||||
int maxY = chunk.getMaxY();
|
int maxY = chunk.getMaxY();
|
||||||
@@ -92,7 +92,7 @@ public abstract class ThreadedLevelLightEngine_scarpetChunkCreationMixin extends
|
|||||||
},
|
},
|
||||||
() -> "Release relight ticket " + pos
|
() -> "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)
|
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
||||||
{
|
{
|
||||||
handler.call(
|
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)
|
() -> world.getServer().createCommandSourceStack().withLevel(world)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -521,7 +521,7 @@ public class CarpetEventServer
|
|||||||
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
||||||
{
|
{
|
||||||
handler.call(
|
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)
|
() -> world.getServer().createCommandSourceStack().withLevel(world)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -533,7 +533,7 @@ public class CarpetEventServer
|
|||||||
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
|
||||||
{
|
{
|
||||||
handler.call(
|
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)
|
() -> world.getServer().createCommandSourceStack().withLevel(world)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -570,9 +570,9 @@ public class WorldAccess
|
|||||||
expression.addContextFunction("in_slime_chunk", -1, (c, t, lv) ->
|
expression.addContextFunction("in_slime_chunk", -1, (c, t, lv) ->
|
||||||
{
|
{
|
||||||
BlockPos pos = BlockArgument.findIn((CarpetContext) c, lv, 0).block.getPos();
|
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(
|
return BooleanValue.of(WorldgenRandom.seedSlimeChunk(
|
||||||
chunkPos.x, chunkPos.z,
|
chunkPos.x(), chunkPos.z(),
|
||||||
((CarpetContext) c).level().getSeed(),
|
((CarpetContext) c).level().getSeed(),
|
||||||
987234911L
|
987234911L
|
||||||
).nextInt(10) == 0);
|
).nextInt(10) == 0);
|
||||||
@@ -624,7 +624,7 @@ public class WorldAccess
|
|||||||
{
|
{
|
||||||
force = lv.get(locator.offset).getBoolean();
|
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) ->
|
expression.addContextFunction("generation_status", -1, (c, t, lv) ->
|
||||||
@@ -651,14 +651,14 @@ public class WorldAccess
|
|||||||
{
|
{
|
||||||
for (long key : levelTickets.keySet())
|
for (long key : levelTickets.keySet())
|
||||||
{
|
{
|
||||||
ChunkPos chpos = new ChunkPos(key);
|
ChunkPos chpos = ChunkPos.unpack(key);
|
||||||
for (Ticket ticket : levelTickets.get(key))
|
for (Ticket ticket : levelTickets.get(key))
|
||||||
{
|
{
|
||||||
res.add(ListValue.of(
|
res.add(ListValue.of(
|
||||||
new StringValue(ticket.getType().toString()),
|
new StringValue(ticket.getType().toString()),
|
||||||
new NumericValue(33 - ticket.getTicketLevel()),
|
new NumericValue(33 - ticket.getTicketLevel()),
|
||||||
new NumericValue(chpos.x),
|
new NumericValue(chpos.x()),
|
||||||
new NumericValue(chpos.z)
|
new NumericValue(chpos.z())
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -667,7 +667,7 @@ public class WorldAccess
|
|||||||
{
|
{
|
||||||
BlockArgument blockArgument = BlockArgument.findIn((CarpetContext) c, lv, 0);
|
BlockArgument blockArgument = BlockArgument.findIn((CarpetContext) c, lv, 0);
|
||||||
BlockPos pos = blockArgument.block.getPos();
|
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)
|
if (tickets != null)
|
||||||
{
|
{
|
||||||
for (Ticket ticket : tickets)
|
for (Ticket ticket : tickets)
|
||||||
@@ -1574,7 +1574,7 @@ public class WorldAccess
|
|||||||
world.getChunk(chpos.getWorldPosition()).getAllReferences();
|
world.getChunk(chpos.getWorldPosition()).getAllReferences();
|
||||||
if (references.containsKey(configuredStructure) && references.get(configuredStructure) != null)
|
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");
|
throw new InternalExpressionException("Ticket radius should be between 1 and 32 chunks");
|
||||||
}
|
}
|
||||||
// due to types we will wing it:
|
// due to types we will wing it:
|
||||||
ChunkPos target = new ChunkPos(pos);
|
ChunkPos target = ChunkPos.containing(pos);
|
||||||
if (ticket == TicketType.PORTAL) // portal
|
if (ticket == TicketType.PORTAL) // portal
|
||||||
{
|
{
|
||||||
cc.level().getChunkSource().addTicketWithRadius(TicketType.PORTAL, target, radius);
|
cc.level().getChunkSource().addTicketWithRadius(TicketType.PORTAL, target, radius);
|
||||||
|
|||||||
@@ -239,8 +239,8 @@ public class FeatureGenerator
|
|||||||
ChunkGenerator generator = chunkSource.getGenerator();
|
ChunkGenerator generator = chunkSource.getGenerator();
|
||||||
ChunkGeneratorStructureState structureState = chunkSource.getGeneratorState();
|
ChunkGeneratorStructureState structureState = chunkSource.getGeneratorState();
|
||||||
List<StructurePlacement> structureConfig = structureState.getPlacementsForStructure(Holder.direct(structure));
|
List<StructurePlacement> structureConfig = structureState.getPlacementsForStructure(Holder.direct(structure));
|
||||||
ChunkPos chunkPos = new ChunkPos(pos);
|
ChunkPos chunkPos = ChunkPos.containing(pos);
|
||||||
boolean couldPlace = structureConfig.stream().anyMatch(p -> p.isStructureChunk(structureState, chunkPos.x, chunkPos.z));
|
boolean couldPlace = structureConfig.stream().anyMatch(p -> p.isStructureChunk(structureState, chunkPos.x(), chunkPos.z()));
|
||||||
if (!couldPlace)
|
if (!couldPlace)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -418,7 +418,7 @@ public class FeatureGenerator
|
|||||||
checks.set(true);
|
checks.set(true);
|
||||||
try
|
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)
|
if (start == StructureStart.INVALID_START)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -426,7 +426,7 @@ public class FeatureGenerator
|
|||||||
RandomSource rand = RandomSource.create(world.getRandom().nextInt());
|
RandomSource rand = RandomSource.create(world.getRandom().nextInt());
|
||||||
int j = pos.getX() >> 4;
|
int j = pos.getX() >> 4;
|
||||||
int k = pos.getZ() >> 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).setStartForStructure(structure, start);
|
||||||
world.getChunk(j, k).addReferenceForStructure(structure, chId);
|
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)
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -159,8 +159,8 @@ public class WorldTools
|
|||||||
|
|
||||||
public static void forceChunkUpdate(BlockPos pos, ServerLevel world)
|
public static void forceChunkUpdate(BlockPos pos, ServerLevel world)
|
||||||
{
|
{
|
||||||
ChunkPos chunkPos = new ChunkPos(pos);
|
ChunkPos chunkPos = ChunkPos.containing(pos);
|
||||||
LevelChunk worldChunk = world.getChunkSource().getChunk(chunkPos.x, chunkPos.z, false);
|
LevelChunk worldChunk = world.getChunkSource().getChunk(chunkPos.x(), chunkPos.z(), false);
|
||||||
if (worldChunk != null)
|
if (worldChunk != null)
|
||||||
{
|
{
|
||||||
List<ServerPlayer> players = world.getChunkSource().chunkMap.getPlayers(chunkPos, false);
|
List<ServerPlayer> players = world.getChunkSource().chunkMap.getPlayers(chunkPos, false);
|
||||||
|
|||||||
Reference in new issue
Block a user