mirror of
https://github.com/wisplite/crystalline-sky.git
synced 2026-10-30 13:32:18 -05:00
add ordinal to all name = "..." local selectors
This commit is contained in:
+11
-10
@@ -29,7 +29,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
// todo replace all name = "..." locals with ordinal
|
// todone add ordinal to all name = "..." locals
|
||||||
@Mixin(ChunkSkyLightProvider.class)
|
@Mixin(ChunkSkyLightProvider.class)
|
||||||
public abstract class ChunkSkyLightProviderMixin<M extends ChunkToNibbleArrayMap<M>, S extends LightStorage<M>> extends ChunkLightProvider<M, S> {
|
public abstract class ChunkSkyLightProviderMixin<M extends ChunkToNibbleArrayMap<M>, S extends LightStorage<M>> extends ChunkLightProvider<M, S> {
|
||||||
@Shadow
|
@Shadow
|
||||||
@@ -68,11 +68,12 @@ public abstract class ChunkSkyLightProviderMixin<M extends ChunkToNibbleArrayMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Definition(id = "y", local = @Local(type = int.class, name = "y"))
|
@SuppressWarnings("LocalMayBeArgsOnly")
|
||||||
@Definition(id = "lowestSourceY", local = @Local(type = int.class, name = "lowestSourceY"))
|
@Definition(id = "y", local = @Local(type = int.class, name = "y", ordinal = 1))
|
||||||
|
@Definition(id = "lowestSourceY", local = @Local(type = int.class, name = "lowestSourceY", ordinal = 3))
|
||||||
@Expression("y >= lowestSourceY")
|
@Expression("y >= lowestSourceY")
|
||||||
@WrapOperation(method = "checkNode", at = @At("MIXINEXTRAS:EXPRESSION"))
|
@WrapOperation(method = "checkNode", at = @At("MIXINEXTRAS:EXPRESSION"))
|
||||||
private boolean weepBelowTheLowest(int y, int lowestSourceY, Operation<Boolean> original, @Local(name = "x") int x, @Local(name = "z") int z) {
|
private boolean weepBelowTheLowest(int y, int lowestSourceY, Operation<Boolean> original, @Local(name = "x", ordinal = 0) int x, @Local(name = "z", ordinal = 2) int z) {
|
||||||
if (original.call(y, lowestSourceY)) {
|
if (original.call(y, lowestSourceY)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -162,7 +163,7 @@ public abstract class ChunkSkyLightProviderMixin<M extends ChunkToNibbleArrayMap
|
|||||||
|
|
||||||
@Inject(method = "addSourcesAbove", at = @At("RETURN"))
|
@Inject(method = "addSourcesAbove", at = @At("RETURN"))
|
||||||
private void addAdditionalWeepingSourcesAbove(int x, int z, int lowestSourceY, int minY, CallbackInfo ci,
|
private void addAdditionalWeepingSourcesAbove(int x, int z, int lowestSourceY, int minY, CallbackInfo ci,
|
||||||
@Local(name = "maxAdjacentLowestSourceY") int maxAdjacentLowestSourceY) {
|
@Local(name = "maxAdjacentLowestSourceY", ordinal = 6) int maxAdjacentLowestSourceY) {
|
||||||
LightSourceView chunk = chunkProvider.getChunk(ChunkSectionPos.getSectionCoord(x), ChunkSectionPos.getSectionCoord(z));
|
LightSourceView chunk = chunkProvider.getChunk(ChunkSectionPos.getSectionCoord(x), ChunkSectionPos.getSectionCoord(z));
|
||||||
if (chunk == null) return;
|
if (chunk == null) return;
|
||||||
|
|
||||||
@@ -236,11 +237,11 @@ public abstract class ChunkSkyLightProviderMixin<M extends ChunkToNibbleArrayMap
|
|||||||
|
|
||||||
@Inject(method = "propagateLight", at = @At("RETURN"))
|
@Inject(method = "propagateLight", at = @At("RETURN"))
|
||||||
private void propagateWeepingLight(ChunkPos chunkPos, CallbackInfo ci,
|
private void propagateWeepingLight(ChunkPos chunkPos, CallbackInfo ci,
|
||||||
@Local(name = "sourcesO") ChunkSkyLight sourcesO,
|
@Local(name = "sourcesO", ordinal = 0) ChunkSkyLight sourcesO,
|
||||||
@Local(name = "sourcesZN") ChunkSkyLight sourcesZN,
|
@Local(name = "sourcesZN", ordinal = 1) ChunkSkyLight sourcesZN,
|
||||||
@Local(name = "sourcesZP") ChunkSkyLight sourcesZP,
|
@Local(name = "sourcesZP", ordinal = 2) ChunkSkyLight sourcesZP,
|
||||||
@Local(name = "sourcesXN") ChunkSkyLight sourcesXN,
|
@Local(name = "sourcesXN", ordinal = 3) ChunkSkyLight sourcesXN,
|
||||||
@Local(name = "sourcesXP") ChunkSkyLight sourcesXP
|
@Local(name = "sourcesXP", ordinal = 4) ChunkSkyLight sourcesXP
|
||||||
) {
|
) {
|
||||||
WeepingStorage weepingStorage = ((ChunkSkyLight_Duck) sourcesO).crystalline_sky$getWeepingStorage();
|
WeepingStorage weepingStorage = ((ChunkSkyLight_Duck) sourcesO).crystalline_sky$getWeepingStorage();
|
||||||
if (weepingStorage == null) return;
|
if (weepingStorage == null) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user