Updates for Minecraft 1.17

Still needs a bit of tweaking
This commit is contained in:
Markil3
2021-06-18 08:27:59 -06:00
parent cf4ed2d4af
commit 3b73bf6cb8
18 changed files with 24 additions and 27 deletions

0
.github/workflows/build.yml vendored Normal file → Executable file
View File

2
.gitignore vendored Normal file → Executable file
View File

@@ -32,3 +32,5 @@ bin/
run/ run/
/logs/ /logs/
local.properties
remappedSrc/

0
LICENSE Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

15
build.gradle Normal file → Executable file
View File

@@ -1,10 +1,10 @@
plugins { plugins {
id 'fabric-loom' version '0.5-SNAPSHOT' id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_16
archivesBaseName = project.archives_base_name archivesBaseName = project.archives_base_name
version = project.mod_version + "-" + project.minecraft_version + "-fabric" version = project.mod_version + "-" + project.minecraft_version + "-fabric"
@@ -43,13 +43,8 @@ tasks.withType(JavaCompile).configureEach {
// If Javadoc is generated, this must be specified in that task too. // If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too // Minecraft 1.17 (21w19a) upwards uses Java 16.
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. it.options.release = 16
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
} }
java { java {

10
gradle.properties Normal file → Executable file
View File

@@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.16.4 minecraft_version=1.17
yarn_mappings=1.16.4+build.9 yarn_mappings=1.17+build.1
loader_version=0.11.1 loader_version=0.11.3
cloth_version=4.11.14 cloth_version=5.0.34
modmenu_version=1.16.8 modmenu_version=2.0.2
# Mod Properties # Mod Properties
mod_version = 1.1.1 mod_version = 1.1.1

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

0
settings.gradle Normal file → Executable file
View File

0
src/main/java/markil3/immersive_hud/ConfigManager.java Normal file → Executable file
View File

View File

0
src/main/java/markil3/immersive_hud/Main.java Normal file → Executable file
View File

0
src/main/java/markil3/immersive_hud/ModMenu.java Normal file → Executable file
View File

12
src/main/java/markil3/immersive_hud/TimerUtils.java Normal file → Executable file
View File

@@ -173,7 +173,7 @@ public class TimerUtils
*/ */
public static void setAlpha(float alpha) public static void setAlpha(float alpha)
{ {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, alpha); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, alpha);
} }
/** /**
@@ -847,7 +847,7 @@ public class TimerUtils
return true; return true;
} }
if (entity.method_3151() > 0) if (entity.getMountJumpStrength() > 0)
{ {
jumpTime = jump.getMaxTime() - (jumpTime > 0 ? jumpTime = jump.getMaxTime() - (jumpTime > 0 ?
jump.getFadeInTime() : jump.getFadeInTime() :
@@ -1125,9 +1125,9 @@ public class TimerUtils
/* /*
* Checks for a change in what slot is used. * Checks for a change in what slot is used.
*/ */
if (selectedHotbarSlot != entity.inventory.selectedSlot) if (selectedHotbarSlot != entity.getInventory().selectedSlot)
{ {
selectedHotbarSlot = entity.inventory.selectedSlot; selectedHotbarSlot = entity.getInventory().selectedSlot;
mainHandTime = handTime; mainHandTime = handTime;
changed = true; changed = true;
} }
@@ -1158,9 +1158,9 @@ public class TimerUtils
{ {
ConfigManager.TimeValues hotbar = ConfigManager.TimeValues hotbar =
ConfigManager.getInstance().getHotbarTime(); ConfigManager.getInstance().getHotbarTime();
RenderSystem.pushMatrix(); // RenderSystem.pushMatrix();
stack.push(); stack.push();
RenderSystem.translatef(0F, TimerUtils.getHotbarTranslation(), 0F); stack.translate(0F, TimerUtils.getHotbarTranslation(), 0F);
setAlpha(Main.getAlpha(hotbarTime, setAlpha(Main.getAlpha(hotbarTime,
hotbar.getMaxTime(), hotbar.getMaxTime(),
hotbar.getFadeInTime(), hotbar.getFadeInTime(),

View File

View File

3
src/main/java/markil3/immersive_hud/mixin/HudHook.java Normal file → Executable file
View File

@@ -634,7 +634,7 @@ public class HudHook
* @since 0.1-1.16.4-fabric * @since 0.1-1.16.4-fabric
*/ */
@Inject(method = "renderHotbar", at = @At(value = "INVOKE", target = @Inject(method = "renderHotbar", at = @At(value = "INVOKE", target =
"Lcom/mojang/blaze3d/systems/RenderSystem;color4f(FFFF)V", shift "Lcom/mojang/blaze3d/systems/RenderSystem;setShaderColor(FFFF)V", shift
= At.Shift.AFTER)) = At.Shift.AFTER))
public void adjustHotbar(float tickDelta, public void adjustHotbar(float tickDelta,
MatrixStack matrices, MatrixStack matrices,
@@ -671,7 +671,6 @@ public class HudHook
{ {
try try
{ {
RenderSystem.popMatrix();
stack.pop(); stack.pop();
/* /*
* Resets the color so that nothing else is bothered. * Resets the color so that nothing else is bothered.

View File

@@ -34,8 +34,9 @@
], ],
"depends": { "depends": {
"fabricloader": ">=0.7.4", "fabricloader": ">=0.11.3",
"minecraft": "1.16.x" "minecraft": "1.17.x",
"java": ">=16"
}, },
"suggests": { "suggests": {
"modmenu": "*", "modmenu": "*",

View File

@@ -2,7 +2,7 @@
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "markil3.immersive_hud.mixin", "package": "markil3.immersive_hud.mixin",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_16",
"mixins": [ "mixins": [
], ],
"client": [ "client": [