Compare commits

...
Author SHA1 Message Date
Caedis 5bcb9174fa Add initial break progress bar 2024-01-01 16:34:18 -06:00
Caedis fae07b5ca2 update bs and deps 2024-01-01 12:03:39 -06:00
12 changed files with 72 additions and 25 deletions

No files matched your search

+9 -22
View File
@@ -1,4 +1,4 @@
//version: 1699290261 //version: 1702141377
/* /*
DO NOT CHANGE THIS FILE! DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available. Also, you may replace this file at any time if there is an update available.
@@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit
buildscript { buildscript {
repositories { repositories {
mavenCentral()
maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven { maven {
// GTNH RetroFuturaGradle and ASM Fork // GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven" name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true 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() mavenLocal()
} }
} }
@@ -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.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.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' 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") print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -302,7 +287,7 @@ if (apiPackage) {
} }
if (accessTransformersFile) { if (accessTransformersFile) {
for (atFile in accessTransformersFile.split(",")) { for (atFile in accessTransformersFile.split(" ")) {
String targetFile = "src/main/resources/META-INF/" + atFile.trim() String targetFile = "src/main/resources/META-INF/" + atFile.trim()
if (!getFile(targetFile).exists()) { if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
@@ -628,7 +613,7 @@ repositories {
} }
maven { maven {
name = "ic2" 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 { content {
includeGroup "net.industrial-craft" includeGroup "net.industrial-craft"
} }
@@ -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: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('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('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')
} }
} }
@@ -793,12 +780,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
} }
dependencies { dependencies {
def lwjgl3ifyVersion = '1.5.1' def lwjgl3ifyVersion = '1.5.7'
if (modId != 'lwjgl3ify') { if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
} }
if (modId != 'hodgepodge') { 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} java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
@@ -1310,7 +1297,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating // Updating
def buildscriptGradleVersion = "8.2.1" def buildscriptGradleVersion = "8.5"
tasks.named('wrapper', Wrapper).configure { tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion gradleVersion = buildscriptGradleVersion
+1 -1
View File
@@ -1,7 +1,7 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev') implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev')
shadowImplementation('au.com.bytecode:opencsv:2.4') shadowImplementation('au.com.bytecode:opencsv:2.4')
} }
+1 -1
View File
@@ -39,7 +39,7 @@ apiPackage = api
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ # Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg # Example value: mymodid_at.cfg
accessTransformersFile = accessTransformersFile = Waila_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false usesMixins = false
@@ -49,4 +49,6 @@ public interface IWailaDataAccessor {
ForgeDirection getSide(); ForgeDirection getSide();
ItemStack getStack(); ItemStack getStack();
float getBlockBreakDamage();
} }
@@ -150,6 +150,8 @@ public class ConfigHandler implements IWailaConfigHandler {
OverlayConfig.posY = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, 100).getInt(); OverlayConfig.posY = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, 100).getInt();
OverlayConfig.alpha = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 80).getInt(); OverlayConfig.alpha = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 80).getInt();
OverlayConfig.breakprogress = config
.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BREAK_PROGRESS, true).getBoolean();
OverlayConfig.bgcolor = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0x100010) OverlayConfig.bgcolor = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0x100010)
.getInt(); .getInt();
OverlayConfig.gradient1 = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0x5000ff) OverlayConfig.gradient1 = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0x5000ff)
@@ -1,6 +1,7 @@
package mcp.mobius.waila.api.impl; package mcp.mobius.waila.api.impl;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -21,6 +22,7 @@ import mcp.mobius.waila.utils.NBTUtil;
public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAccessor, IWailaEntityAccessor { public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAccessor, IWailaEntityAccessor {
private static final Minecraft MC = Minecraft.getMinecraft();
public World world; public World world;
public EntityPlayer player; public EntityPlayer player;
public MovingObjectPosition mop; public MovingObjectPosition mop;
@@ -37,6 +39,7 @@ public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAcces
public ItemStack stack; public ItemStack stack;
public static DataAccessorCommon instance = new DataAccessorCommon(); public static DataAccessorCommon instance = new DataAccessorCommon();
public float blockBreakDamage;
public void set(World _world, EntityPlayer _player, MovingObjectPosition _mop) { public void set(World _world, EntityPlayer _player, MovingObjectPosition _mop) {
this.set(_world, _player, _mop, null, 0.0); this.set(_world, _player, _mop, null, 0.0);
@@ -55,6 +58,7 @@ public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAcces
this.entity = null; this.entity = null;
this.blockID = Block.getIdFromBlock(this.block); this.blockID = Block.getIdFromBlock(this.block);
this.blockResource = GameData.getBlockRegistry().getNameForObject(this.block); this.blockResource = GameData.getBlockRegistry().getNameForObject(this.block);
this.blockBreakDamage = MC.playerController.curBlockDamageMP;
try { try {
this.stack = new ItemStack(this.block, 1, this.metadata); this.stack = new ItemStack(this.block, 1, this.metadata);
} catch (Exception e) {} } catch (Exception e) {}
@@ -200,6 +204,11 @@ public class DataAccessorCommon implements IWailaCommonAccessor, IWailaDataAcces
return this.stack; return this.stack;
} }
@Override
public float getBlockBreakDamage() {
return this.blockBreakDamage;
}
public boolean isTimeElapsed(long time) { public boolean isTimeElapsed(long time) {
return System.currentTimeMillis() - this.timeLastUpdate >= time; return System.currentTimeMillis() - this.timeLastUpdate >= time;
} }
@@ -124,6 +124,37 @@ public class DisplayUtil {
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D);
} }
public static void drawGradientRect(int x, int y, double w, double h, int grad1, int grad2) {
float zLevel = 0.0f;
float f = (float) (grad1 >> 24 & 255) / 255.0F;
float f1 = (float) (grad1 >> 16 & 255) / 255.0F;
float f2 = (float) (grad1 >> 8 & 255) / 255.0F;
float f3 = (float) (grad1 & 255) / 255.0F;
float f4 = (float) (grad2 >> 24 & 255) / 255.0F;
float f5 = (float) (grad2 >> 16 & 255) / 255.0F;
float f6 = (float) (grad2 >> 8 & 255) / 255.0F;
float f7 = (float) (grad2 & 255) / 255.0F;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(f1, f2, f3, f);
tessellator.addVertex((x + w), y, zLevel);
tessellator.addVertex(x, y, zLevel);
tessellator.setColorRGBA_F(f5, f6, f7, f4);
tessellator.addVertex(x, y + h, zLevel);
tessellator.addVertex(x + w, y + h, zLevel);
tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
public static void drawTexturedModalRect(int x, int y, int u, int v, int w, int h, int tw, int th) { public static void drawTexturedModalRect(int x, int y, int u, int v, int w, int h, int tw, int th) {
float f = 0.00390625F; float f = 0.00390625F;
float f1 = 0.00390625F; float f1 = 0.00390625F;
@@ -15,6 +15,7 @@ public class OverlayConfig {
public static int gradient2; public static int gradient2;
public static int fontcolor; public static int fontcolor;
public static float scale; public static float scale;
public static boolean breakprogress;
public static void updateColors() { public static void updateColors() {
OverlayConfig.alpha = (int) (ConfigHandler.instance() OverlayConfig.alpha = (int) (ConfigHandler.instance()
@@ -7,6 +7,7 @@ import net.minecraft.util.MovingObjectPosition;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.impl.ConfigHandler; import mcp.mobius.waila.api.impl.ConfigHandler;
public class OverlayRenderer { public class OverlayRenderer {
@@ -62,6 +63,19 @@ public class OverlayRenderer {
OverlayConfig.gradient1, OverlayConfig.gradient1,
OverlayConfig.gradient2); OverlayConfig.gradient2);
if (OverlayConfig.breakprogress && tooltip.accessor instanceof IWailaDataAccessor) {
IWailaDataAccessor data = ((IWailaDataAccessor) tooltip.accessor);
if (data.getBlockBreakDamage() > 0) {
DisplayUtil.drawGradientRect(
tooltip.x + 1,
tooltip.y + tooltip.h,
(double) (tooltip.w - 1) * (data.getBlockBreakDamage()),
1,
0xffffffff,
0xffffffff);
}
}
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
tooltip.draw(); tooltip.draw();
@@ -78,7 +78,6 @@ public class WailaTickHandler {
accessor.set(world, player, target); accessor.set(world, player, target);
ItemStack targetStack = RayTracing.instance().getTargetStack(); // Here we get either the proper stack ItemStack targetStack = RayTracing.instance().getTargetStack(); // Here we get either the proper stack
// or the override // or the override
if (targetStack != null) { if (targetStack != null) {
this.currenttip = new TipList<String, String>(); this.currenttip = new TipList<String, String>();
this.currenttipHead = new TipList<String, String>(); this.currenttipHead = new TipList<String, String>();
@@ -30,6 +30,7 @@ public final class Constants {
public static String CFG_WAILA_NHEARTS = "waila.cfg.heartsperline"; public static String CFG_WAILA_NHEARTS = "waila.cfg.heartsperline";
public static String CFG_WAILA_MAXHP = "waila.cfg.maxhpbeforetext"; public static String CFG_WAILA_MAXHP = "waila.cfg.maxhpbeforetext";
public static String CFG_WAILA_NEWFILTERS = "waila.cfg.newfilters"; public static String CFG_WAILA_NEWFILTERS = "waila.cfg.newfilters";
public static String CFG_WAILA_BREAK_PROGRESS = "waila.cfg.breakprogress";
public static String CFG_WAILA_ALPHA = "waila.cfg.alpha"; public static String CFG_WAILA_ALPHA = "waila.cfg.alpha";
public static String CFG_WAILA_BGCOLOR = "waila.cfg.bgcolor"; public static String CFG_WAILA_BGCOLOR = "waila.cfg.bgcolor";
+1
View File
@@ -0,0 +1 @@
public net.minecraft.client.multiplayer.PlayerControllerMP field_78770_f # curBlockDamageMP