Skip to content

Commit

Permalink
Angelica support (#18)
Browse files Browse the repository at this point in the history
* behavior change - Angelica support

Texture now stretches over sides of the info panel, instead of repeating

* Update ModelInfoPanel.java

* Whatt?

Why, exactly, were those calls there?

* update BS

(cherry picked from commit 5fb069d)
  • Loading branch information
ah-OOG-ah authored and Dream-Master committed Dec 20, 2023
1 parent 16b9b9b commit 3225150
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 69 deletions.
29 changes: 8 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1700844281
//version: 1702141377
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit

buildscript {
repositories {
mavenCentral()

maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven {
// GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
}
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}

mavenLocal()
}
}
Expand All @@ -69,7 +54,7 @@ plugins {
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.26'
}

print("You might want to check out './gradlew :faq' if your build fails.\n")
Expand Down Expand Up @@ -628,7 +613,7 @@ repositories {
}
maven {
name = "ic2"
url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/")
url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/")
content {
includeGroup "net.industrial-craft"
}
Expand Down Expand Up @@ -687,6 +672,8 @@ configurations.all {
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")

substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets')
}
}

Expand Down Expand Up @@ -793,12 +780,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}

dependencies {
def lwjgl3ifyVersion = '1.5.1'
def lwjgl3ifyVersion = '1.5.7'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
}

java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
Expand Down Expand Up @@ -1310,7 +1297,7 @@ def addCurseForgeRelation(String type, String name) {

// Updating

def buildscriptGradleVersion = "8.2.1"
def buildscriptGradleVersion = "8.5"

tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package shedar.mods.ic2.nuclearcontrol.renderers.model;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.Facing;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

Expand All @@ -18,8 +17,12 @@
@SideOnly(Side.CLIENT)
public class ModelInfoPanel {

private static final String TEXTURE_FILE = "nuclearcontrol:textures/blocks/infoPanel/panelAdvancedSide.png";
private static final ResourceLocation TEXTURE_LOCATION = new ResourceLocation(TEXTURE_FILE);
private static final String TEXTURE_FILE = "nuclearcontrol:infoPanel/panelAdvancedSide";
private static final IIcon advSideTex = Minecraft.getMinecraft().getTextureMapBlocks().registerIcon(TEXTURE_FILE);
private static final double Uma = advSideTex.getMaxU();
private static final double Umi = advSideTex.getMinU();
private static final double Vma = advSideTex.getMaxV();
private static final double Vmi = advSideTex.getMinV();

private double[] coordinates = new double[24];
private static final byte[][] pointMap = { { 0, 3, 2, 1 }, { 4, 5, 6, 7 }, { 0, 4, 7, 3 }, { 6, 5, 1, 2 },
Expand Down Expand Up @@ -264,9 +267,7 @@ private void drawFacing(int facing, int rotation, Screen screen, TileEntityAdvan
double u2 = texture.getMaxU();
double v1 = texture.getMinV();
double v2 = texture.getMaxV();
GL11.glDepthMask(false);
addPoints(pointMap[facing], normalMap[facing], u1, u2, v1, v2);
GL11.glDepthMask(true);
texture = block.getIcon(panel.getWorldObj(), panel.xCoord, panel.yCoord, panel.zCoord, facing);

u1 = texture.getMinU();
Expand Down Expand Up @@ -296,77 +297,67 @@ public void renderScreen(Block block, TileEntityAdvancedInfoPanel panel, double
if (panel.getTransparencyMode() == 0) { // Check if face should be transparent
drawFacing(facing, panel.getRotation(), screen, panel, block, tess);
}
//
tess.draw();

// SIDES
if (panel.getTransparencyMode() == 0) { // Check if block should be transparent
Tessellator.instance.startDrawingQuads();
renderer.minecraftRB.renderEngine.bindTexture(TEXTURE_LOCATION);

Tessellator.instance.setBrightness(
block.getMixedBrightnessForBlock(panel.getWorldObj(), panel.xCoord, panel.yCoord, panel.zCoord));
Tessellator.instance.setColorOpaque_F(0.5F, 0.5F, 0.5F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

int dx = screen.getDx() + 1;
int dy = screen.getDy() + 1;
int dz = screen.getDz() + 1;

// bottom
if (facing != 0) {
Tessellator.instance.setNormal(0, -1, 0);
addPoint(0, 0, 0);
addPoint(3, dx, 0);
addPoint(2, dx, dz);
addPoint(1, 0, dz);
addPoint(0, Umi, Vmi);
addPoint(3, Uma, Vmi);
addPoint(2, Uma, Vma);
addPoint(1, Umi, Vma);
}

if (facing != 1) {
Tessellator.instance.setNormal(0, 1, 0);
addPoint(4, 0, 0);
addPoint(5, dz, 0);
addPoint(6, dz, dx);
addPoint(7, 0, dx);
addPoint(4, Umi, Vmi);
addPoint(5, Uma, Vmi);
addPoint(6, Uma, Vma);
addPoint(7, Umi, Vma);
}

if (facing != 2) {
Tessellator.instance.setNormal(0, 0, -1);
addPoint(0, 0, 0);
addPoint(4, dy, 0);
addPoint(7, dy, dx);
addPoint(3, 0, dx);
addPoint(0, Umi, Vmi);
addPoint(4, Uma, Vmi);
addPoint(7, Uma, Vma);
addPoint(3, Umi, Vma);
}

if (facing != 3) {
Tessellator.instance.setNormal(0, 0, 1);
addPoint(6, 0, 0);
addPoint(5, dx, 0);
addPoint(1, dx, dy);
addPoint(2, 0, dy);
addPoint(6, Umi, Vmi);
addPoint(5, Uma, Vmi);
addPoint(1, Uma, Vma);
addPoint(2, Umi, Vma);
}

if (facing != 4) {
Tessellator.instance.setNormal(-1, 0, 0);
addPoint(5, 0, 0);
addPoint(4, dz, 0);
addPoint(0, dz, dy);
addPoint(1, 0, dy);
addPoint(5, Umi, Vmi);
addPoint(4, Uma, Vmi);
addPoint(0, Uma, Vma);
addPoint(1, Umi, Vma);
}

if (facing != 5) {
Tessellator.instance.setNormal(1, 0, 0);
addPoint(2, 0, 0);
addPoint(3, dz, 0);
addPoint(7, dz, dy);
addPoint(6, 0, dy);
addPoint(2, Umi, Vmi);
addPoint(3, Uma, Vmi);
addPoint(7, Uma, Vma);
addPoint(6, Umi, Vma);
}
Tessellator.instance.draw();
}

// RETURN TO MC DRAWING
Tessellator.instance.startDrawingQuads();
renderer.minecraftRB.renderEngine.bindTexture(TEXTURE_LOCATION);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Tessellator.instance.setColorOpaque_F(0.5F, 0.5F, 0.5F);
renderer.minecraftRB.renderEngine.bindTexture(TextureMap.locationBlocksTexture/* blocks texture atlas */);
}
}

0 comments on commit 3225150

Please sign in to comment.