mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Make the sky red when raging
This commit is contained in:
parent
8e19ab6a96
commit
d4fe4c549d
3 changed files with 29 additions and 0 deletions
|
@ -25,6 +25,7 @@ import net.minecraft.util.math.*;
|
|||
|
||||
public class WorldRenderDelegate {
|
||||
public static final WorldRenderDelegate INSTANCE = new WorldRenderDelegate();
|
||||
private static final Optional<Vec3d> RED_SKY_COLOR = Optional.of(new Vec3d(1, 0, 0));
|
||||
|
||||
private final EntityReplacementManager disguiseLookup = new EntityReplacementManager();
|
||||
private final EntityDisguiseRenderer disguiseRenderer = new EntityDisguiseRenderer(this);
|
||||
|
@ -35,6 +36,13 @@ public class WorldRenderDelegate {
|
|||
|
||||
final MinecraftClient client = MinecraftClient.getInstance();
|
||||
|
||||
public Optional<Vec3d> getSkyColor(float tickDelta) {
|
||||
if (EquinePredicates.RAGING.test(client.player)) {
|
||||
return RED_SKY_COLOR;
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public boolean beforeEntityRender(Entity entity,
|
||||
double x, double y, double z, float yaw,
|
||||
float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light) {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.minelittlepony.unicopia.mixin.client;
|
||||
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
import com.minelittlepony.unicopia.client.render.WorldRenderDelegate;
|
||||
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
@Mixin(ClientWorld.class)
|
||||
abstract class MixinClientWorld {
|
||||
|
||||
@Inject(method = "getSkyColor", at = @At("HEAD"), cancellable = true)
|
||||
public void getSkyColor(Vec3d cameraPos, float tickDelta, CallbackInfoReturnable<Vec3d> info) {
|
||||
WorldRenderDelegate.INSTANCE.getSkyColor(tickDelta).ifPresent(info::setReturnValue);
|
||||
}
|
||||
}
|
|
@ -57,6 +57,7 @@
|
|||
"client.MixinAnimalModel",
|
||||
"client.MixinArmorFeatureRenderer",
|
||||
"client.MixinCamera",
|
||||
"client.MixinClientWorld",
|
||||
"client.MixinEntityRenderDispatcher",
|
||||
"client.MixinGameRenderer",
|
||||
"client.MixinHeldItemRenderer",
|
||||
|
|
Loading…
Reference in a new issue