Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Jan 25, 2023
1 parent 0c97882 commit 986a5cd
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 59 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ minecraft_version = 1.19.3
yarn_mappings = 1.19.3+build.5
loader_version = 0.14.11

mod_version = 1.14
mod_version = 1.15
maven_group = net.krlite
archives_base_name = equator-lib-1.19.3

# Dependencies
fabric_version = 0.71.0+1.19.3
equator_utils_version = v1.1.11
equator_utils_version = v1.1.12
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
package net.krlite.equator.animator;
package net.krlite.equator.animation;

import net.krlite.equator.animation.base.ValueAnimator;
import net.krlite.equator.annotation.See;
import net.krlite.equator.color.core.BasicRGBA;

@See(ValueAnimator.class)
/**
* @see ValueAnimator
* @see BasicRGBA
*/
public class ColorAnimator extends ValueAnimator<BasicRGBA<?>> {
/**
* Creates a new value animator.
*
* @param start The animator's start value.
* @param end The animator's end value.
* @param delta The animator's animation ratio.
*/
public ColorAnimator(BasicRGBA<?> start, BasicRGBA<?> end, double delta) {
super(start, end, delta);
}

/**
* Creates a new value animator with the default
* animation ratio of 0.075.
*
* @param start The animator's start value.
* @param end The animator's end value.
*/
public ColorAnimator(BasicRGBA<?> start, BasicRGBA<?> end) {
super(start, end);
}
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/net/krlite/equator/annotation/See.java

This file was deleted.

5 changes: 0 additions & 5 deletions src/main/java/net/krlite/equator/annotation/Sees.java

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/net/krlite/equator/color/PreciseColor.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package net.krlite.equator.color;

import net.krlite.equator.annotation.See;
import net.krlite.equator.base.HashCodeComparable;
import net.krlite.equator.color.core.BasicRGBA;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;

import java.awt.*;

@See(BasicRGBA.class)
public class PreciseColor extends HashCodeComparable implements BasicRGBA<PreciseColor> {
public static final PreciseColor WHITE = new PreciseColor(1, 1, 1);
public static final PreciseColor BLACK = new PreciseColor(0, 0, 0);
Expand Down
50 changes: 30 additions & 20 deletions src/main/java/net/krlite/equator/color/PreciseColors.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package net.krlite.equator.color;

import net.krlite.equator.annotation.See;
import net.krlite.equator.annotation.Sees;
import net.krlite.equator.color.core.BasicRGBA;

@See(BasicRGBA.class)
@See(PreciseColor.class)
@SuppressWarnings("unused")
public class PreciseColors {
// === Translucent basic ===
/*
* TRANSLUCENT BASIC
*/
public static final PreciseColor TRANSLUCENT_WHITE = new PreciseColor(1, 1, 1, 0.5);
public static final PreciseColor TRANSLUCENT_BLACK = new PreciseColor(0, 0, 0, 0.5);
public static final PreciseColor TRANSLUCENT_RED = new PreciseColor(1, 0, 0, 0.5);
Expand All @@ -18,14 +13,18 @@ public class PreciseColors {
public static final PreciseColor TRANSLUCENT_MAGENTA = new PreciseColor(1, 0, 1, 0.5);
public static final PreciseColor TRANSLUCENT_CYAN = new PreciseColor(0, 1, 1, 0.5);

// === Grayscale ===
/*
* GRAYSCALE
*/
public static final PreciseColor NEAR_WHITE = new PreciseColor(0.95);
public static final PreciseColor LIGHT_GRAY = new PreciseColor(0.75);
public static final PreciseColor GRAY = new PreciseColor(0.5);
public static final PreciseColor DARK_GRAY = new PreciseColor(0.25);
public static final PreciseColor NEAR_BLACK = new PreciseColor(0.05);

// === Normal ===
/*
* NORMAL
*/
public static final PreciseColor GOLD = new PreciseColor(1, 0.85, 0);
public static final PreciseColor SILVER = new PreciseColor(0.65, 0.66, 0.67);
public static final PreciseColor LIME = new PreciseColor(0.75, 1, 0);
Expand All @@ -34,23 +33,29 @@ public class PreciseColors {
public static final PreciseColor PURPLE = new PreciseColor(0.5, 0, 0.5);
public static final PreciseColor PINK = new PreciseColor(1, 0.75, 0.8);

// === Dark basic ===
/*
* DARK BASIC
*/
public static final PreciseColor DARK_RED = new PreciseColor(0.5, 0, 0);
public static final PreciseColor DARK_GREEN = new PreciseColor(0, 0.5, 0);
public static final PreciseColor DARK_BLUE = new PreciseColor(0, 0, 0.5);
public static final PreciseColor DARK_YELLOW = new PreciseColor(0.5, 0.5, 0);
public static final PreciseColor DARK_MAGENTA = new PreciseColor(0.5, 0, 0.5);
public static final PreciseColor DARK_CYAN = new PreciseColor(0, 0.5, 0.5);

// === Light basic ===
/*
* LIGHT BASIC
*/
public static final PreciseColor LIGHT_RED = new PreciseColor(1, 0.5, 0.5);
public static final PreciseColor LIGHT_GREEN = new PreciseColor(0.5, 1, 0.5);
public static final PreciseColor LIGHT_BLUE = new PreciseColor(0.5, 0.5, 1);
public static final PreciseColor LIGHT_YELLOW = new PreciseColor(1, 1, 0.5);
public static final PreciseColor LIGHT_MAGENTA = new PreciseColor(1, 0.5, 1);
public static final PreciseColor LIGHT_CYAN = new PreciseColor(0.5, 1, 1);

// === Dark normal ===
/*
* DARK NORMAL
*/
public static final PreciseColor DARK_GOLD = new PreciseColor(0.5, 0.425, 0);
public static final PreciseColor DARK_SILVER = new PreciseColor(0.325, 0.33, 0.335);
public static final PreciseColor DARK_LIME = new PreciseColor(0.375, 0.5, 0);
Expand All @@ -59,7 +64,9 @@ public class PreciseColors {
public static final PreciseColor DARK_BROWN = new PreciseColor(0.4, 0.25, 0.12);
public static final PreciseColor DARK_PINK = new PreciseColor(1, 0.41, 0.71);

// === Light normal ===
/*
* LIGHT NORMAL
*/
public static final PreciseColor LIGHT_GOLD = new PreciseColor(1, 0.7, 0.2);
public static final PreciseColor LIGHT_SILVER = new PreciseColor(0.8, 0.8, 0.8);
public static final PreciseColor LIGHT_LIME = new PreciseColor(0.8, 1, 0.2);
Expand All @@ -68,9 +75,12 @@ public class PreciseColors {
public static final PreciseColor LIGHT_BROWN = new PreciseColor(0.7, 0.6, 0.5);
public static final PreciseColor LIGHT_PINK = new PreciseColor(1, 0.71, 0.76);

// === Minecraft ===
// Mojang
/*
* MINECRAFT
*/
public static final PreciseColor MOJANG_RED = new PreciseColor(1, 0, 0.5);
public static final PreciseColor MINECRAFT_MISSING_TEXTURE_PURPLE = PreciseColor.of(0xF800F8);
public static final PreciseColor MINECRAFT_MISSING_TEXTURE_BLACK = PreciseColor.of(0x000000);
// Foreground
public static final PreciseColor MINECOIN_GOLD = PreciseColor.of(0xDDD605);
public static final PreciseColor MINECRAFT_BLACK = PreciseColor.of(0x000000);
Expand Down Expand Up @@ -108,11 +118,10 @@ public class PreciseColors {
public static final PreciseColor MINECRAFT_BACKGROUND_LIGHT_PURPLE = PreciseColor.of(0x3F153F);
public static final PreciseColor MINECRAFT_BACKGROUND_YELLOW = PreciseColor.of(0x3F3F15);
public static final PreciseColor MINECRAFT_BACKGROUND_WHITE = PreciseColor.of(0x3F3F3F);
// Miscellaneous
public static final PreciseColor MINECRAFT_MISSING_TEXTURE_PURPLE = PreciseColor.of(0xF800F8);
public static final PreciseColor MINECRAFT_MISSING_TEXTURE_BLACK = PreciseColor.of(0x000000);

// === Fashionable ===
/*
* FASHIONABLE
*/
public static final PreciseColor TURQUOISE = new PreciseColor(0.25, 0.88, 0.82);
public static final PreciseColor TEAL = new PreciseColor(0, 0.5, 0.5);
public static final PreciseColor OLIVE = new PreciseColor(0.5, 0.5, 0);
Expand Down Expand Up @@ -165,4 +174,5 @@ public class PreciseColors {
public static final PreciseColor SLATE_GRAY = new PreciseColor(0.44, 0.5, 0.56);
public static final PreciseColor SLATE_GREEN = new PreciseColor(0.31, 0.5, 0.44);
public static final PreciseColor TIN = new PreciseColor(0.8, 0.8, 0.8);
public static final PreciseColor TIN_SHINE = new PreciseColor(0.9, 0.9, 0.9);
}
2 changes: 1 addition & 1 deletion src/main/java/net/krlite/equator/geometry/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.krlite.equator.core.Operatable;
import net.krlite.equator.core.ShortStringable;
import net.krlite.equator.core.SimpleOperations;
import net.krlite.equator.function.AngleFunctions;
import net.krlite.equator.math.AngleFunctions;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.math.Vec3d;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.krlite.equator.math;

import net.krlite.equator.function.AngleFunctions;
import net.minecraft.entity.player.PlayerEntity;

import java.util.Objects;
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/net/krlite/equator/render/Equator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.krlite.equator.annotation.See;
import net.krlite.equator.color.PreciseColor;
import net.krlite.equator.color.PreciseColors;
import net.krlite.equator.color.core.BasicRGBA;
Expand All @@ -14,8 +13,6 @@
import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.*;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.texture.SpriteAtlasTexture;
Expand Down Expand Up @@ -525,9 +522,8 @@ private static void applyModelView(MatrixStack matrixStack, Quaterniondc quatern
RenderSystem.applyModelViewMatrix();
}

@See(ItemRenderer.class)
public record ItemModel(ItemStack itemStack) implements ShortStringable, Cloneable {
public ItemModel render(Vec3d pos, boolean leftHanded, @See(QuaternionAdapter.class) Quaterniondc quaternion) {
public ItemModel render(Vec3d pos, boolean leftHanded, Quaterniondc quaternion) {
BakedModel bakedModel = MinecraftClient.getInstance().getItemRenderer().getModel(itemStack, null, null, 0);
prepareModel();
MatrixStack matrixStack = RenderSystem.getModelViewStack();
Expand Down Expand Up @@ -651,9 +647,8 @@ public ItemModel clone() {
}
}

@See(BlockRenderManager.class)
public record BlockModel(BlockState blockState) implements ShortStringable, Cloneable {
public BlockModel render(Vec3d pos, @See(QuaternionAdapter.class) Quaterniondc quaternion) {
public BlockModel render(Vec3d pos, Quaterniondc quaternion) {
prepareModel();
MatrixStack matrixStack = RenderSystem.getModelViewStack();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package net.krlite.equator.render.sprite;

import net.krlite.equator.annotation.See;
import net.krlite.equator.core.ShortStringable;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;

/**
* A sprite that defines a horizontal set of {@link IdentifierSprite}s.
*/
@See(IdentifierSprite.class)
public record HorizontalSprite(Identifier identifier, int step) implements ShortStringable, Cloneable {
/**
* Creates a {@link HorizontalSprite} by splitting an {@link Identifier} horizontally into slices.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.krlite.equator.render.sprite;

import net.krlite.equator.annotation.See;
import net.krlite.equator.core.ShortStringable;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
Expand All @@ -10,7 +9,6 @@
/**
* A sprite that defines a 2D array set of {@link IdentifierSprite}s.
*/
@See(IdentifierSprite.class)
public record SurfaceSprite(Identifier identifier, int stepX, int stepY) implements ShortStringable, Cloneable {
/**
* Creates a {@link SurfaceSprite} by splitting an {@link Identifier} into pieces.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.krlite.equator.render.sprite;

import net.krlite.equator.annotation.See;
import net.krlite.equator.core.ShortStringable;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
Expand All @@ -10,7 +9,6 @@
/**
* A sprite that defines a vertical set of {@link IdentifierSprite}s.
*/
@See(IdentifierSprite.class)
public record VerticalSprite(Identifier identifier, int step) implements ShortStringable, Cloneable {
/**
* Creates a {@link VerticalSprite} by splitting an {@link Identifier} vertically into slices.
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/net/krlite/equator/util/QuaternionAdapter.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package net.krlite.equator.util;

import net.krlite.equator.annotation.See;
import org.joml.Quaterniond;
import org.joml.Quaterniondc;
import org.joml.Quaternionf;
import org.joml.Quaternionfc;

@See(Quaternionfc.class)
@See(Quaterniondc.class)
public class QuaternionAdapter {
public static Quaterniond fromEulerDeg(double x, double y, double z, double w) {
return new Quaterniond(Math.toRadians(x), Math.toRadians(y), Math.toRadians(z), w);
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/net/krlite/equator/util/pair/ColorPair.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package net.krlite.equator.util.pair;

import net.krlite.equator.color.PreciseColor;
import net.krlite.equator.color.core.BasicRGBA;

import java.awt.*;

public class ColorPair extends Pair<PreciseColor, PreciseColor> {
/**
* Creates a new pair.
*
* @param first The first element.
* @param second The second element.
*/
public ColorPair(BasicRGBA<?> first, BasicRGBA<?> second) {
super(PreciseColor.of(first), PreciseColor.of(second));
}

public ColorPair(Color first, Color second) {
super(PreciseColor.of(first), PreciseColor.of(second));
}
}

0 comments on commit 986a5cd

Please sign in to comment.