Skip to content

Commit

Permalink
Remove shadowy skies
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Papel committed Feb 8, 2022
1 parent 248fde4 commit 4b7e6b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.id.aether.util.MapColorCreator;
import net.minecraft.block.MapColor;

@Environment(EnvType.CLIENT)
public class AetherMapColorUtil {
public static final MapColor AETHER_BACKGROUND = MapColorCreator.createMapColor(62, 0xe3fffd);

public static int getColor(MapColor material, int shade) {
int newColor = recolor(material.id) == -1 ? material.color : recolor(material.id);

int value = 220;

// From here on out, standard brightness and color calculations.
if (shade == 3) value = 135;
if (material == AETHER_BACKGROUND) value = 220;
else if (shade == 3) value = 135;
else if (shade == 2) value = 255;
else if (shade == 1) value = 220;
else if (shade == 0) value = 180;
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/net/id/aether/mixin/item/FilledMapMixin.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.id.aether.mixin.item;

import net.id.aether.util.MapColorCreator;
import net.id.aether.client.rendering.util.AetherMapColorUtil;
import net.id.aether.world.dimension.AetherDimension;
import net.minecraft.block.*;
import net.minecraft.item.FilledMapItem;
Expand All @@ -9,17 +9,12 @@
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;

@Mixin(FilledMapItem.class)
public abstract class FilledMapMixin {

@Unique
private final MapColor AETHER_BACKGROUND = MapColorCreator.createMapColor(62, 0xe3fffd);

/**
* Changes the color of the aether void to a pleasant blue.
* @author Jack Papel
Expand All @@ -40,7 +35,7 @@ public abstract class FilledMapMixin {
private MapColor fixAetherVoidColor(BlockState instance, BlockView world, BlockPos pos) {
if (((World) world).getRegistryKey().equals(AetherDimension.AETHER_WORLD_KEY)
&& pos.equals(Vec3i.ZERO) && !world.getBlockState(pos).isOf(Blocks.BEDROCK)){
return AETHER_BACKGROUND;
return AetherMapColorUtil.AETHER_BACKGROUND;
}
else return instance.getMapColor(world, pos);
}
Expand Down

0 comments on commit 4b7e6b6

Please sign in to comment.