mappings
This commit is contained in:
1 parent
b6543ff8dd
commit
3b90bd5d3a
12 files changed
+48
-48
No files matched your search
@@ -31,14 +31,14 @@ public abstract class BlockLightStorage_scarpetChunkCreationMixin extends LightS
|
||||
for (int y = -1; y < 17; ++y)
|
||||
{
|
||||
final long sectionPos = ChunkSectionPos.asLong(ChunkSectionPos.getX(cPos), y, ChunkSectionPos.getZ(cPos));
|
||||
final long pos = BlockPos.asLong(ChunkSectionPos.getWorldCoord(ChunkSectionPos.getX(sectionPos)), ChunkSectionPos.getWorldCoord(y), ChunkSectionPos.getWorldCoord(ChunkSectionPos.getZ(sectionPos)));
|
||||
final long pos = BlockPos.asLong(ChunkSectionPos.getBlockCoord(ChunkSectionPos.getX(sectionPos)), ChunkSectionPos.getBlockCoord(y), ChunkSectionPos.getBlockCoord(ChunkSectionPos.getZ(sectionPos)));
|
||||
|
||||
if (!this.hasLight(sectionPos))
|
||||
if (!this.hasSection(sectionPos))
|
||||
continue;
|
||||
|
||||
for (final Direction dir : Direction.Type.HORIZONTAL)
|
||||
{
|
||||
final ChunkNibbleArray neighborLightArray = this.getLightArray(ChunkSectionPos.offset(sectionPos, dir));
|
||||
final ChunkNibbleArray neighborLightArray = this.getLightSection(ChunkSectionPos.offset(sectionPos, dir));
|
||||
|
||||
if (neighborLightArray == null)
|
||||
continue;
|
||||
@@ -55,7 +55,7 @@ public abstract class BlockLightStorage_scarpetChunkCreationMixin extends LightS
|
||||
final long dst = BlockPos.add(pos, ox + t * dx, dy, oz + t * dz);
|
||||
final long src = BlockPos.offset(dst, dir);
|
||||
|
||||
final int srcLevel = ((ChunkLightProviderInterface) lightProvider).callGetCurrentLevelFromArray(neighborLightArray, src);
|
||||
final int srcLevel = ((ChunkLightProviderInterface) lightProvider).callGetCurrentLevelFromSection(neighborLightArray, src);
|
||||
|
||||
levelPropagator.invokeUpdateLevel(src, dst, levelPropagator.callGetPropagatedLevel(src, dst, srcLevel), true);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@ public abstract class ChunkLightProvider_scarpetChunkCreationMixin implements Li
|
||||
}
|
||||
|
||||
@Override
|
||||
@Invoker("getCurrentLevelFromArray")
|
||||
public abstract int callGetCurrentLevelFromArray(ChunkNibbleArray array, long blockPos);
|
||||
@Invoker("getCurrentLevelFromSection")
|
||||
public abstract int callGetCurrentLevelFromSection(ChunkNibbleArray array, long blockPos);
|
||||
}
|
||||
@@ -24,26 +24,26 @@ import net.minecraft.world.chunk.light.LightStorage;
|
||||
public abstract class LightStorage_scarpetChunkCreationMixin implements LightStorageInterface
|
||||
{
|
||||
@Shadow
|
||||
protected abstract ChunkNibbleArray getLightArray(final long sectionPos, final boolean cached);
|
||||
protected abstract ChunkNibbleArray getLightSection(final long sectionPos, final boolean cached);
|
||||
|
||||
@Shadow
|
||||
protected abstract void removeChunkData(final ChunkLightProvider<?, ?> storage, final long blockChunkPos);
|
||||
protected abstract void removeSection(final ChunkLightProvider<?, ?> storage, final long blockChunkPos);
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
protected LongSet field_15802;
|
||||
protected LongSet dirtySections;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
protected ChunkToNibbleArrayMap<?> lightArrays;
|
||||
protected ChunkToNibbleArrayMap<?> storage;
|
||||
|
||||
@Shadow protected abstract boolean hasLight(final long sectionPos);
|
||||
@Shadow protected abstract boolean hasSection(final long sectionPos);
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
protected Long2ObjectMap<ChunkNibbleArray> lightArraysToAdd;
|
||||
protected Long2ObjectMap<ChunkNibbleArray> queuedSections;
|
||||
|
||||
@Shadow protected abstract void setLightEnabled(final long l, final boolean bl);
|
||||
@Shadow protected abstract void setColumnEnabled(final long l, final boolean bl);
|
||||
|
||||
@Unique
|
||||
private final LongSet removedChunks = new LongOpenHashSet();
|
||||
@@ -64,7 +64,7 @@ public abstract class LightStorage_scarpetChunkCreationMixin implements LightSto
|
||||
}
|
||||
|
||||
@Inject(
|
||||
method = "updateLightArrays(Lnet/minecraft/world/chunk/light/ChunkLightProvider;ZZ)V",
|
||||
method = "updateLight(Lnet/minecraft/world/chunk/light/ChunkLightProvider;ZZ)V",
|
||||
at = @At("HEAD")
|
||||
)
|
||||
private void processData(final ChunkLightProvider<?, ?> lightProvider, final boolean doSkylight, final boolean skipEdgeLightPropagation, final CallbackInfo ci)
|
||||
@@ -77,16 +77,16 @@ public abstract class LightStorage_scarpetChunkCreationMixin implements LightSto
|
||||
{
|
||||
final long sectionPos = ChunkSectionPos.asLong(ChunkSectionPos.getX(cPos), y, ChunkSectionPos.getZ(cPos));
|
||||
|
||||
this.lightArraysToAdd.remove(sectionPos);
|
||||
this.queuedSections.remove(sectionPos);
|
||||
|
||||
if (this.hasLight(sectionPos))
|
||||
if (this.hasSection(sectionPos))
|
||||
{
|
||||
this.removeChunkData(lightProvider, sectionPos);
|
||||
this.removeSection(lightProvider, sectionPos);
|
||||
|
||||
if (this.field_15802.add(sectionPos))
|
||||
this.lightArrays.replaceWithCopy(sectionPos);
|
||||
if (this.dirtySections.add(sectionPos))
|
||||
this.storage.replaceWithCopy(sectionPos);
|
||||
|
||||
Arrays.fill(this.getLightArray(sectionPos, true).asByteArray(), (byte) 0);
|
||||
Arrays.fill(this.getLightSection(sectionPos, true).asByteArray(), (byte) 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public abstract class ServerLightingProvider_scarpetChunkCreationMixin extends L
|
||||
chunk.setLightOn(false);
|
||||
|
||||
this.enqueue(pos.x, pos.z, () -> 0, ServerLightingProvider.Stage.PRE_UPDATE, Util.debugRunnable(() -> {
|
||||
super.setLightEnabled(pos, false);
|
||||
super.setColumnEnabled(pos, false);
|
||||
((Lighting_scarpetChunkCreationInterface) this).removeLightData(ChunkSectionPos.withZeroZ(ChunkSectionPos.asLong(pos.x, 0, pos.z)));
|
||||
},
|
||||
() -> "Remove light data " + pos
|
||||
@@ -60,7 +60,7 @@ public abstract class ServerLightingProvider_scarpetChunkCreationMixin extends L
|
||||
final ChunkPos pos = chunk.getPos();
|
||||
|
||||
this.enqueue(pos.x, pos.z, () -> 0, ServerLightingProvider.Stage.PRE_UPDATE, Util.debugRunnable(() -> {
|
||||
super.setLightEnabled(pos, true);
|
||||
super.setColumnEnabled(pos, true);
|
||||
|
||||
chunk.getLightSourcesStream().forEach(
|
||||
blockPos -> super.addLightSource(blockPos, chunk.getLuminance(blockPos))
|
||||
|
||||
@@ -38,14 +38,14 @@ public abstract class ServerLightingProvider_scarpetMixin extends LightingProvid
|
||||
//ChunkPos pos = new ChunkPos(x, z);
|
||||
int j;
|
||||
for(j = -1; j < 17; ++j) { // skip some recomp
|
||||
super.queueData(LightType.BLOCK, ChunkSectionPos.from(pos, j), new ChunkNibbleArray(), false);
|
||||
super.queueData(LightType.SKY, ChunkSectionPos.from(pos, j), new ChunkNibbleArray(), false);
|
||||
super.enqueueSectionData(LightType.BLOCK, ChunkSectionPos.from(pos, j), new ChunkNibbleArray(), false);
|
||||
super.enqueueSectionData(LightType.SKY, ChunkSectionPos.from(pos, j), new ChunkNibbleArray(), false);
|
||||
}
|
||||
for(j = 0; j < 16; ++j) {
|
||||
super.updateSectionStatus(ChunkSectionPos.from(pos, j), true);
|
||||
super.setSectionStatus(ChunkSectionPos.from(pos, j), true);
|
||||
}
|
||||
|
||||
super.setLightEnabled(pos, true);
|
||||
super.setColumnEnabled(pos, true);
|
||||
|
||||
chunk.getLightSourcesStream().forEach((blockPos) -> {
|
||||
super.addLightSource(blockPos, chunk.getLuminance(blockPos));
|
||||
|
||||
@@ -28,19 +28,19 @@ public abstract class SkyLightStorage_scarpetChunkCreationMixin extends LightSto
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private LongSet pendingSkylightUpdates;
|
||||
private LongSet sectionsToUpdate;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private LongSet field_15816;
|
||||
private LongSet sectionsToRemove;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private LongSet field_15820;
|
||||
|
||||
@Shadow protected abstract boolean isAboveTopmostLightArray(final long pos);
|
||||
@Shadow protected abstract boolean isAtOrAboveTopmostSection(final long pos);
|
||||
|
||||
@Shadow protected abstract boolean isLightEnabled(final long sectionPos);
|
||||
@Shadow protected abstract boolean isSectionEnabled(final long sectionPos);
|
||||
|
||||
@Override
|
||||
public void processRemoveLightData(final long cPos)
|
||||
@@ -49,8 +49,8 @@ public abstract class SkyLightStorage_scarpetChunkCreationMixin extends LightSto
|
||||
{
|
||||
final long sectionPos = ChunkSectionPos.asLong(ChunkSectionPos.getX(cPos), y, ChunkSectionPos.getZ(cPos));
|
||||
|
||||
this.pendingSkylightUpdates.remove(sectionPos);
|
||||
this.field_15816.remove(sectionPos);
|
||||
this.sectionsToUpdate.remove(sectionPos);
|
||||
this.sectionsToRemove.remove(sectionPos);
|
||||
|
||||
this.field_15820.remove(sectionPos);
|
||||
}
|
||||
@@ -64,22 +64,22 @@ public abstract class SkyLightStorage_scarpetChunkCreationMixin extends LightSto
|
||||
for (int y = -1; y < 17; ++y)
|
||||
{
|
||||
final long sectionPos = ChunkSectionPos.asLong(ChunkSectionPos.getX(cPos), y, ChunkSectionPos.getZ(cPos));
|
||||
final long pos = BlockPos.asLong(ChunkSectionPos.getWorldCoord(ChunkSectionPos.getX(sectionPos)), ChunkSectionPos.getWorldCoord(y), ChunkSectionPos.getWorldCoord(ChunkSectionPos.getZ(sectionPos)));
|
||||
final long pos = BlockPos.asLong(ChunkSectionPos.getBlockCoord(ChunkSectionPos.getX(sectionPos)), ChunkSectionPos.getBlockCoord(y), ChunkSectionPos.getBlockCoord(ChunkSectionPos.getZ(sectionPos)));
|
||||
|
||||
if (!this.hasLight(sectionPos))
|
||||
if (!this.hasSection(sectionPos))
|
||||
continue;
|
||||
|
||||
for (final Direction dir : Direction.Type.HORIZONTAL)
|
||||
{
|
||||
long neighborCeilingSectionPos = ChunkSectionPos.offset(sectionPos, dir);
|
||||
final ChunkNibbleArray neighborLightArray = this.getLightArray(neighborCeilingSectionPos);
|
||||
final ChunkNibbleArray neighborLightArray = this.getLightSection(neighborCeilingSectionPos);
|
||||
|
||||
ChunkNibbleArray neighborCeilingLightArray = neighborLightArray;
|
||||
|
||||
while (neighborCeilingLightArray == null && !this.isAboveTopmostLightArray(neighborCeilingSectionPos))
|
||||
while (neighborCeilingLightArray == null && !this.isAtOrAboveTopmostSection(neighborCeilingSectionPos))
|
||||
{
|
||||
neighborCeilingSectionPos = ChunkSectionPos.offset(neighborCeilingSectionPos, Direction.UP);
|
||||
neighborCeilingLightArray = this.getLightArray(neighborCeilingSectionPos);
|
||||
neighborCeilingLightArray = this.getLightSection(neighborCeilingSectionPos);
|
||||
}
|
||||
|
||||
final int ox = 15 * Math.max(dir.getOffsetX(), 0);
|
||||
@@ -95,11 +95,11 @@ public abstract class SkyLightStorage_scarpetChunkCreationMixin extends LightSto
|
||||
long src = BlockPos.offset(dst, dir);
|
||||
|
||||
if (neighborLightArray == null)
|
||||
src = BlockPos.asLong(BlockPos.unpackLongX(src), ChunkSectionPos.getWorldCoord(ChunkSectionPos.getY(neighborCeilingSectionPos)), BlockPos.unpackLongZ(src));
|
||||
src = BlockPos.asLong(BlockPos.unpackLongX(src), ChunkSectionPos.getBlockCoord(ChunkSectionPos.getY(neighborCeilingSectionPos)), BlockPos.unpackLongZ(src));
|
||||
|
||||
final int srcLevel = neighborCeilingLightArray != null ?
|
||||
((ChunkLightProviderInterface) lightProvider).callGetCurrentLevelFromArray(neighborCeilingLightArray, src)
|
||||
: this.isLightEnabled(ChunkSectionPos.withZeroZ(neighborCeilingSectionPos)) ? 0 : 15;
|
||||
((ChunkLightProviderInterface) lightProvider).callGetCurrentLevelFromSection(neighborCeilingLightArray, src)
|
||||
: this.isSectionEnabled(ChunkSectionPos.withZeroZ(neighborCeilingSectionPos)) ? 0 : 15;
|
||||
|
||||
levelPropagator.invokeUpdateLevel(src, dst, levelPropagator.callGetPropagatedLevel(src, dst, srcLevel), true);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, BlockBox.empty(),0,worldIn.getSeed());
|
||||
if (config == null)
|
||||
config = new DefaultFeatureConfig();
|
||||
structurestart1.init(worldIn.method_30349(), generator, worldIn.getStructureManager() , chunkpos.x, chunkpos.z, biome_1, config);
|
||||
structurestart1.init(worldIn.getRegistryManager(), generator, worldIn.getStructureManager() , chunkpos.x, chunkpos.z, biome_1, config);
|
||||
structurestart = structurestart1.hasChildren() ? structurestart1 : StructureStart.DEFAULT;
|
||||
|
||||
if (structurestart.hasChildren())
|
||||
|
||||
@@ -101,7 +101,7 @@ public abstract class WorldChunk_movableTEMixin implements WorldChunkInterface
|
||||
boolean boolean_3 = chunkSection.isEmpty();
|
||||
if (boolean_2 != boolean_3)
|
||||
{
|
||||
this.world.getChunkManager().getLightingProvider().updateSectionStatus(blockPos_1, boolean_3);
|
||||
this.world.getChunkManager().getLightingProvider().setSectionStatus(blockPos_1, boolean_3);
|
||||
}
|
||||
|
||||
if (!this.world.isClient)
|
||||
|
||||
Reference in new issue
Block a user