From 43e8c1eb2c6bf94e7e8d13a5479011229fb0107c Mon Sep 17 00:00:00 2001 From: SD Date: Sun, 19 Jul 2020 12:44:41 +0530 Subject: [PATCH] Fixed limbo sky color and made vignette stronger in limbo Changes to be committed: new file: src/main/java/org/dimdev/dimdoors/mixin/InGameHudMixin.java modified: src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java modified: src/main/resources/dimdoors.mixins.json --- .../dimdev/dimdoors/mixin/InGameHudMixin.java | 25 +++++++++++++++++++ .../dimdoors/world/limbo/LimboBiome.java | 11 ++++++++ src/main/resources/dimdoors.mixins.json | 1 + 3 files changed, 37 insertions(+) create mode 100644 src/main/java/org/dimdev/dimdoors/mixin/InGameHudMixin.java diff --git a/src/main/java/org/dimdev/dimdoors/mixin/InGameHudMixin.java b/src/main/java/org/dimdev/dimdoors/mixin/InGameHudMixin.java new file mode 100644 index 00000000..556ea243 --- /dev/null +++ b/src/main/java/org/dimdev/dimdoors/mixin/InGameHudMixin.java @@ -0,0 +1,25 @@ +package org.dimdev.dimdoors.mixin; + +import com.mojang.blaze3d.systems.RenderSystem; +import org.dimdev.dimdoors.world.limbo.LimboBiome; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.hud.InGameHud; +import net.minecraft.entity.Entity; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +@Environment(EnvType.CLIENT) +@Mixin(InGameHud.class) +public class InGameHudMixin { + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;getTextureManager()Lnet/minecraft/client/texture/TextureManager;"), method = "renderVignetteOverlay(Lnet/minecraft/entity/Entity;)V") + public void renderVignetteOverlay(Entity entity, CallbackInfo info) { + if(entity.getEntityWorld().getBiome(entity.getBlockPos()) instanceof LimboBiome) { + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java b/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java index 6864b79e..19e79e6b 100644 --- a/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java +++ b/src/main/java/org/dimdev/dimdoors/world/limbo/LimboBiome.java @@ -1,5 +1,7 @@ package org.dimdev.dimdoors.world.limbo; +import java.awt.Color; + import com.google.common.collect.ImmutableList; import org.dimdev.dimdoors.block.ModBlocks; import org.dimdev.dimdoors.entity.ModEntityTypes; @@ -10,6 +12,9 @@ import net.minecraft.world.biome.BiomeEffects; import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder; import net.minecraft.world.gen.surfacebuilder.TernarySurfaceConfig; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + public class LimboBiome extends Biome { public LimboBiome() { super(new Biome.Settings() @@ -39,4 +44,10 @@ public class LimboBiome extends Biome { .noises(ImmutableList.of(new Biome.MixedNoisePoint(0.0F, 0.0F, 0.0F, -0.5F, 1.0F)))); this.addSpawn(SpawnGroup.MONSTER, new Biome.SpawnEntry(ModEntityTypes.MONOLITH, 1, 0, 1)); } + + @Environment(EnvType.CLIENT) + @Override + public int getSkyColor() { + return 0x404040; + } } diff --git a/src/main/resources/dimdoors.mixins.json b/src/main/resources/dimdoors.mixins.json index 916fe607..eee982be 100644 --- a/src/main/resources/dimdoors.mixins.json +++ b/src/main/resources/dimdoors.mixins.json @@ -3,6 +3,7 @@ "package": "org.dimdev.dimdoors.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ + "InGameHudMixin" ], "client": [ ],