-
-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/1.20.3' into 1.20.6
# Conflicts: # src/main/java/net/irisshaders/iris/gui/element/ShaderPackOptionList.java
- Loading branch information
Showing
22 changed files
with
557 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/net/irisshaders/iris/gl/buffer/ShaderStorageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package net.irisshaders.iris.gl.buffer; | ||
|
||
public record ShaderStorageInfo(int size, boolean relative, float scaleX, float scaleY) { | ||
public record ShaderStorageInfo(long size, boolean relative, float scaleX, float scaleY) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/net/irisshaders/iris/mixin/MixinBiomeAmbientSoundsHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package net.irisshaders.iris.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import net.irisshaders.iris.Iris; | ||
import net.irisshaders.iris.mixinterface.BiomeAmbienceInterface; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.player.LocalPlayer; | ||
import net.minecraft.client.resources.sounds.BiomeAmbientSoundsHandler; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.util.Mth; | ||
import net.minecraft.world.level.LightLayer; | ||
import net.minecraft.world.level.biome.AmbientMoodSettings; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(BiomeAmbientSoundsHandler.class) | ||
public class MixinBiomeAmbientSoundsHandler implements BiomeAmbienceInterface { | ||
@Shadow | ||
@Final | ||
private LocalPlayer player; | ||
|
||
@Unique | ||
private float constantMoodiness; | ||
|
||
@Inject(method = "method_26271", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;getBrightness(Lnet/minecraft/world/level/LightLayer;Lnet/minecraft/core/BlockPos;)I", ordinal = 0)) | ||
private void calculateConstantMoodiness(AmbientMoodSettings ambientMoodSettings, CallbackInfo ci, @Local BlockPos blockPos) { | ||
int j = this.player.level().getBrightness(LightLayer.SKY, blockPos); | ||
if (j > 0) { | ||
this.constantMoodiness -= (float)j / (float)this.player.level().getMaxLightLevel() * 0.001F; | ||
} else { | ||
this.constantMoodiness -= (float)(this.player.level().getBrightness(LightLayer.BLOCK, blockPos) - 1) / (float)ambientMoodSettings.getTickDelay(); | ||
} | ||
|
||
this.constantMoodiness = Mth.clamp(constantMoodiness, 0.0f, 1.0f); | ||
} | ||
|
||
@Override | ||
public float getConstantMood() { | ||
return constantMoodiness; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/net/irisshaders/iris/mixin/MixinLocalPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.irisshaders.iris.mixin; | ||
|
||
import net.irisshaders.iris.mixinterface.BiomeAmbienceInterface; | ||
import net.irisshaders.iris.mixinterface.LocalPlayerInterface; | ||
import net.minecraft.client.player.LocalPlayer; | ||
import net.minecraft.client.resources.sounds.AmbientSoundHandler; | ||
import net.minecraft.client.resources.sounds.BiomeAmbientSoundsHandler; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(LocalPlayer.class) | ||
public class MixinLocalPlayer implements LocalPlayerInterface { | ||
@Shadow | ||
@Final | ||
private List<AmbientSoundHandler> ambientSoundHandlers; | ||
|
||
@Override | ||
public float getCurrentConstantMood() { | ||
for(AmbientSoundHandler ambientSoundHandler : this.ambientSoundHandlers) { | ||
if (ambientSoundHandler instanceof BiomeAmbientSoundsHandler) { | ||
return ((BiomeAmbienceInterface)ambientSoundHandler).getConstantMood(); | ||
} | ||
} | ||
|
||
return 0.0F; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/net/irisshaders/iris/mixinterface/BiomeAmbienceInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.irisshaders.iris.mixinterface; | ||
|
||
public interface BiomeAmbienceInterface { | ||
float getConstantMood(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...isshaders/iris/parsing/ExtendedBiome.java → ...ders/iris/mixinterface/ExtendedBiome.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/net/irisshaders/iris/mixinterface/LocalPlayerInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.irisshaders.iris.mixinterface; | ||
|
||
public interface LocalPlayerInterface { | ||
float getCurrentConstantMood(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...ine/programs/ShaderInstanceInterface.java → ...mixinterface/ShaderInstanceInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.