mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-19 02:25:10 +01:00
MidnightLib 0.4.0 - Color support, Client and Server-only config options, cleanup
This commit is contained in:
@@ -10,15 +10,14 @@ public class MidnightColorUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* @credit https://stackoverflow.com/questions/4129666/how-to-convert-hex-to-rgb-using-java
|
||||
* @param colorStr e.g. "FFFFFF"
|
||||
* @param colorStr e.g. "FFFFFF" or "#FFFFFF"
|
||||
* @return Color as RGB
|
||||
*/
|
||||
public static Color hex2Rgb(String colorStr) {
|
||||
return new Color(
|
||||
Integer.valueOf( colorStr.substring( 0, 2 ), 16 ),
|
||||
Integer.valueOf( colorStr.substring( 2, 4 ), 16 ),
|
||||
Integer.valueOf( colorStr.substring( 4, 6 ), 16 ));
|
||||
try {
|
||||
return Color.decode("#" + colorStr.replace("#", ""));
|
||||
} catch (Exception ignored) {}
|
||||
return Color.BLACK;
|
||||
}
|
||||
|
||||
public static Color radialRainbow(float saturation, float brightness) {
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package eu.midnightdust.lib.util.render.entity;
|
||||
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.entity.feature.EyesFeatureRenderer;
|
||||
import net.minecraft.client.render.entity.feature.FeatureRendererContext;
|
||||
import net.minecraft.client.render.entity.model.EntityModel;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class EmissiveOverlayRenderer<T extends LivingEntity> extends EyesFeatureRenderer<T, EntityModel<T>> {
|
||||
private final RenderLayer SKIN;
|
||||
|
||||
public EmissiveOverlayRenderer(FeatureRendererContext<T, EntityModel<T>> featureRendererContext, Identifier texture) {
|
||||
super(featureRendererContext);
|
||||
SKIN = RenderLayer.getEyes(texture);
|
||||
}
|
||||
public RenderLayer getEyesTexture() {
|
||||
return SKIN;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user