Update to 1.19

This commit is contained in:
Tara Piccari 2024-01-31 19:01:08 -07:00
parent ce4667b6b4
commit 2039236aec
9 changed files with 97 additions and 77 deletions

View file

@ -3,22 +3,22 @@
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
libzontreck=1.10.012124.1709 libzontreck=1.10.013124.1729
## Environment Properties ## Environment Properties
# The Minecraft version must agree with the Forge version to get a valid artifact # The Minecraft version must agree with the Forge version to get a valid artifact
minecraft_version=1.18.2 minecraft_version=1.19.2
# The Minecraft version range can use any release version of Minecraft as bounds. # The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions. # as they do not follow standard versioning conventions.
minecraft_version_range=[1.18.2,1.19) minecraft_version_range=[1.19,1.20)
# The Forge version must agree with the Minecraft version to get a valid artifact # The Forge version must agree with the Minecraft version to get a valid artifact
forge_version=40.2.1 forge_version=43.3.0
# The Forge version range can use any version of Forge as bounds or match the loader version range # The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[40,) forge_version_range=[43,)
# The loader version range can only use the major version of Forge/FML as bounds # The loader version range can only use the major version of Forge/FML as bounds
loader_version_range=[40,) loader_version_range=[43,)
# The mapping channel to use for mappings. # The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"]. # The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin. # Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
@ -36,7 +36,7 @@ loader_version_range=[40,)
mapping_channel=parchment mapping_channel=parchment
# The mapping version to query from the mapping channel. # The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel. # This must match the format required by the mapping channel.
mapping_version=2022.11.06-1.18.2 mapping_version=2022.11.27-1.19.2
## Mod Properties ## Mod Properties
@ -49,7 +49,7 @@ mod_name=Aria's Essentials
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3 mod_license=GPLv3
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=1.2.012124.2356 mod_version=1.2.013124.1836
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html # See https://maven.apache.org/guides/mini/guide-naming-conventions.html

Binary file not shown.

View file

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

12
gradlew vendored
View file

@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -80,11 +80,11 @@ do
esac esac
done done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # 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"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@ -143,16 +143,12 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
case $MAX_FD in #( case $MAX_FD in #(
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac

1
gradlew.bat vendored
View file

@ -26,7 +26,6 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%

View file

@ -22,7 +22,7 @@ public class AutoWalk {
static long lastPress; static long lastPress;
@SubscribeEvent @SubscribeEvent
public static void onKeyPress(InputEvent.KeyInputEvent event) { public static void onKeyPress(InputEvent.Key event) {
if(Keybindings.AUTOWALK.matches(event.getKey(), event.getScanCode()) && Minecraft.getInstance().screen == null && Keybindings.AUTOWALK.isDown()) if(Keybindings.AUTOWALK.matches(event.getKey(), event.getScanCode()) && Minecraft.getInstance().screen == null && Keybindings.AUTOWALK.isDown())
{ {
lastPress = Instant.now().getEpochSecond(); lastPress = Instant.now().getEpochSecond();
@ -36,10 +36,11 @@ public class AutoWalk {
private static void startWalking() { private static void startWalking() {
isWalking=true; isWalking=true;
autoJump = Minecraft.getInstance().options.autoJump; autoJump = Minecraft.getInstance().options.autoJump().get();
Minecraft.getInstance().options.autoJump = true; Minecraft.getInstance().options.autoJump().set(true);
Minecraft.getInstance().player.sendMessage(ChatHelpers.macro(Messages.ESSENTIALS_PREFIX + "!Dark_Green!AutoWalking started"), new UUID(0,0));
Minecraft.getInstance().player.displayClientMessage(ChatHelpers.macro(Messages.ESSENTIALS_PREFIX + "!Dark_Green!AutoWalking started"), false);
runner = new Thread(()->{ runner = new Thread(()->{
while(AutoWalk.isWalking) while(AutoWalk.isWalking)
@ -55,10 +56,10 @@ public class AutoWalk {
isWalking=false; isWalking=false;
runner.interrupt(); runner.interrupt();
runner=null; runner=null;
Minecraft.getInstance().options.autoJump = autoJump; Minecraft.getInstance().options.autoJump().set(autoJump);
Minecraft.getInstance().options.keyUp.setDown(false); Minecraft.getInstance().options.keyUp.setDown(false);
Minecraft.getInstance().player.sendMessage(ChatHelpers.macro(Messages.ESSENTIALS_PREFIX + "!Dark_Green!AutoWalking stopped"), new UUID(0,0)); Minecraft.getInstance().player.displayClientMessage(ChatHelpers.macro(Messages.ESSENTIALS_PREFIX + "!Dark_Green!AutoWalking stopped"), false);
} }
} }

View file

@ -28,8 +28,10 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGuiOverlayEvent;
import net.minecraftforge.client.gui.ForgeIngameGui; import net.minecraftforge.client.gui.overlay.ForgeGui;
import net.minecraftforge.client.gui.overlay.GuiOverlayManager;
import net.minecraftforge.client.gui.overlay.NamedGuiOverlay;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
@ -77,12 +79,28 @@ public class HeartsRenderer {
* @param event Event instance * @param event Event instance
*/ */
@SubscribeEvent(priority = EventPriority.LOW) @SubscribeEvent(priority = EventPriority.LOW)
public void renderHealthbar(RenderGameOverlayEvent.PreLayer event) { public void renderHealthbar(RenderGuiOverlayEvent.Pre event) {
if (event.isCanceled() || !AEClientConfig.getInstance().EnableHearts || event.getOverlay() != ForgeIngameGui.PLAYER_HEALTH_ELEMENT) { NamedGuiOverlay ActualOverlay = GuiOverlayManager.findOverlay(new ResourceLocation("minecraft:player_health"));
if (ActualOverlay == null) {
if (GuiOverlayManager.getOverlays() == null) {
AriasEssentials.LOGGER.info("Overlays non existent?!");
}
for (NamedGuiOverlay overlay : GuiOverlayManager.getOverlays()) {
// Next print
// LibZontreck.LOGGER.info("GUI OVERLAY: "+overlay.id().getPath());
if (overlay.id().getPath().equals("player_health")) {
ActualOverlay = overlay;
break;
}
}
}
if (event.isCanceled() || !AEClientConfig.getInstance().EnableHearts || event.getOverlay() != ActualOverlay) {
return; return;
} }
// ensure its visible // ensure its visible
if (!(mc.gui instanceof ForgeIngameGui gui) || mc.options.hideGui || !gui.shouldDrawSurvivalElements()) { if (!(mc.gui instanceof ForgeGui gui) || mc.options.hideGui || !gui.shouldDrawSurvivalElements()) {
return; return;
} }
Entity renderViewEnity = this.mc.getCameraEntity(); Entity renderViewEnity = this.mc.getCameraEntity();
@ -94,7 +112,7 @@ public class HeartsRenderer {
this.mc.getProfiler().push("health"); this.mc.getProfiler().push("health");
// extra setup stuff from us // extra setup stuff from us
int left_height = gui.left_height; int left_height = gui.leftHeight;
int width = this.mc.getWindow().getGuiScaledWidth(); int width = this.mc.getWindow().getGuiScaledWidth();
int height = this.mc.getWindow().getGuiScaledHeight(); int height = this.mc.getWindow().getGuiScaledHeight();
int updateCounter = this.mc.gui.getGuiTicks(); int updateCounter = this.mc.gui.getGuiTicks();
@ -103,13 +121,13 @@ public class HeartsRenderer {
// changes are indicated by comment // changes are indicated by comment
int health = Mth.ceil(player.getHealth()); int health = Mth.ceil(player.getHealth());
boolean highlight = this.healthUpdateCounter > (long) updateCounter && (this.healthUpdateCounter - (long) updateCounter) / 3L % 2L == 1L; boolean highlight = this.healthUpdateCounter > (long) updateCounter
&& (this.healthUpdateCounter - (long) updateCounter) / 3L % 2L == 1L;
if (health < this.playerHealth && player.invulnerableTime > 0) { if (health < this.playerHealth && player.invulnerableTime > 0) {
this.lastSystemTime = Util.getMillis(); this.lastSystemTime = Util.getMillis();
this.healthUpdateCounter = (updateCounter + 20); this.healthUpdateCounter = (updateCounter + 20);
} } else if (health > this.playerHealth && player.invulnerableTime > 0) {
else if (health > this.playerHealth && player.invulnerableTime > 0) {
this.lastSystemTime = Util.getMillis(); this.lastSystemTime = Util.getMillis();
this.healthUpdateCounter = (updateCounter + 10); this.healthUpdateCounter = (updateCounter + 10);
} }
@ -127,7 +145,8 @@ public class HeartsRenderer {
float healthMax = attrMaxHealth == null ? 0 : (float) attrMaxHealth.getValue(); float healthMax = attrMaxHealth == null ? 0 : (float) attrMaxHealth.getValue();
float absorb = Mth.ceil(player.getAbsorptionAmount()); float absorb = Mth.ceil(player.getAbsorptionAmount());
// CHANGE: simulate 10 hearts max if there's more, so vanilla only renders one row max // CHANGE: simulate 10 hearts max if there's more, so vanilla only renders one
// row max
healthMax = Math.min(healthMax, 20f); healthMax = Math.min(healthMax, 20f);
health = Math.min(health, 20); health = Math.min(health, 20);
absorb = Math.min(absorb, 20); absorb = Math.min(absorb, 20);
@ -139,7 +158,8 @@ public class HeartsRenderer {
int left = width / 2 - 91; int left = width / 2 - 91;
int top = height - left_height; int top = height - left_height;
// change: these are unused below, unneeded? should these adjust the Forge variable? // change: these are unused below, unneeded? should these adjust the Forge
// variable?
// left_height += (healthRows * rowHeight); // left_height += (healthRows * rowHeight);
// if (rowHeight != 10) left_height += 10 - rowHeight; // if (rowHeight != 10) left_height += 10 - rowHeight;
@ -152,26 +172,29 @@ public class HeartsRenderer {
final int TOP = 9 * (this.mc.level.getLevelData().isHardcore() ? 5 : 0); final int TOP = 9 * (this.mc.level.getLevelData().isHardcore() ? 5 : 0);
final int BACKGROUND = (highlight ? 25 : 16); final int BACKGROUND = (highlight ? 25 : 16);
int MARGIN = 16; int MARGIN = 16;
if (player.hasEffect(MobEffects.POISON)) MARGIN += 36; if (player.hasEffect(MobEffects.POISON))
else if (player.hasEffect(MobEffects.WITHER)) MARGIN += 72; MARGIN += 36;
else if (player.hasEffect(MobEffects.WITHER))
MARGIN += 72;
float absorbRemaining = absorb; float absorbRemaining = absorb;
PoseStack matrixStack = event.getMatrixStack(); PoseStack matrixStack = event.getPoseStack();
for (int i = Mth.ceil((healthMax + absorb) / 2.0F) - 1; i >= 0; --i) { for (int i = Mth.ceil((healthMax + absorb) / 2.0F) - 1; i >= 0; --i) {
int row = Mth.ceil((float) (i + 1) / 10.0F) - 1; int row = Mth.ceil((float) (i + 1) / 10.0F) - 1;
int x = left + i % 10 * 8; int x = left + i % 10 * 8;
int y = top - row * rowHeight; int y = top - row * rowHeight;
if (health <= 4) y += this.rand.nextInt(2); if (health <= 4)
if (i == this.regen) y -= 2; y += this.rand.nextInt(2);
if (i == this.regen)
y -= 2;
this.blit(matrixStack, x, y, BACKGROUND, TOP, 9, 9); this.blit(matrixStack, x, y, BACKGROUND, TOP, 9, 9);
if (highlight) { if (highlight) {
if (i * 2 + 1 < healthLast) { if (i * 2 + 1 < healthLast) {
this.blit(matrixStack, x, y, MARGIN + 54, TOP, 9, 9); // 6 this.blit(matrixStack, x, y, MARGIN + 54, TOP, 9, 9); // 6
} } else if (i * 2 + 1 == healthLast) {
else if (i * 2 + 1 == healthLast) {
this.blit(matrixStack, x, y, MARGIN + 63, TOP, 9, 9); // 7 this.blit(matrixStack, x, y, MARGIN + 63, TOP, 9, 9); // 7
} }
} }
@ -180,17 +203,14 @@ public class HeartsRenderer {
if (absorbRemaining == absorb && absorb % 2.0F == 1.0F) { if (absorbRemaining == absorb && absorb % 2.0F == 1.0F) {
this.blit(matrixStack, x, y, MARGIN + 153, TOP, 9, 9); // 17 this.blit(matrixStack, x, y, MARGIN + 153, TOP, 9, 9); // 17
absorbRemaining -= 1.0F; absorbRemaining -= 1.0F;
} } else {
else {
this.blit(matrixStack, x, y, MARGIN + 144, TOP, 9, 9); // 16 this.blit(matrixStack, x, y, MARGIN + 144, TOP, 9, 9); // 16
absorbRemaining -= 2.0F; absorbRemaining -= 2.0F;
} }
} } else {
else {
if (i * 2 + 1 < health) { if (i * 2 + 1 < health) {
this.blit(matrixStack, x, y, MARGIN + 36, TOP, 9, 9); // 4 this.blit(matrixStack, x, y, MARGIN + 36, TOP, 9, 9); // 4
} } else if (i * 2 + 1 == health) {
else if (i * 2 + 1 == health) {
this.blit(matrixStack, x, y, MARGIN + 45, TOP, 9, 9); // 5 this.blit(matrixStack, x, y, MARGIN + 45, TOP, 9, 9); // 5
} }
} }
@ -200,20 +220,22 @@ public class HeartsRenderer {
this.renderExtraAbsorption(matrixStack, left, top - rowHeight, player); this.renderExtraAbsorption(matrixStack, left, top - rowHeight, player);
RenderSystem.setShaderTexture(0, ICON_VANILLA); RenderSystem.setShaderTexture(0, ICON_VANILLA);
gui.left_height += 10; gui.leftHeight += 10;
if (absorb > 0) { if (absorb > 0) {
gui.left_height += 10; gui.leftHeight += 10;
} }
event.setCanceled(true); event.setCanceled(true);
RenderSystem.disableBlend(); RenderSystem.disableBlend();
this.mc.getProfiler().pop(); this.mc.getProfiler().pop();
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PostLayer(matrixStack, event, ForgeIngameGui.PLAYER_HEALTH_ELEMENT)); MinecraftForge.EVENT_BUS
.post(new RenderGuiOverlayEvent.Post(mc.getWindow(), event.getPoseStack(), event.getPartialTick(), ActualOverlay));
} }
/** /**
* Gets the texture from potion effects * Gets the texture from potion effects
*
* @param player Player instance * @param player Player instance
* @return Texture offset for potion effects * @return Texture offset for potion effects
*/ */
@ -236,6 +258,7 @@ public class HeartsRenderer {
/** /**
* Renders the health above 10 hearts * Renders the health above 10 hearts
*
* @param matrixStack Matrix stack instance * @param matrixStack Matrix stack instance
* @param xBasePos Health bar top corner * @param xBasePos Health bar top corner
* @param yBasePos Health bar top corner * @param yBasePos Health bar top corner
@ -253,6 +276,7 @@ public class HeartsRenderer {
/** /**
* Renders the absorption health above 10 hearts * Renders the absorption health above 10 hearts
*
* @param matrixStack Matrix stack instance * @param matrixStack Matrix stack instance
* @param xBasePos Health bar top corner * @param xBasePos Health bar top corner
* @param yBasePos Health bar top corner * @param yBasePos Health bar top corner
@ -269,6 +293,7 @@ public class HeartsRenderer {
/** /**
* Gets the texture offset from the regen effect * Gets the texture offset from the regen effect
*
* @param i Heart index * @param i Heart index
* @param offset Current offset * @param offset Current offset
*/ */

View file

@ -6,7 +6,7 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version # A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[40,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. loaderVersion="[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="GPLv3" license="GPLv3"
@ -51,7 +51,7 @@ modId="forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified # Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory mandatory=true #mandatory
# The version range of the dependency # The version range of the dependency
versionRange="[40,)" #mandatory versionRange="[43,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE" ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER # Side this dependency is applied on - BOTH, CLIENT or SERVER
@ -61,10 +61,10 @@ side="BOTH"
modId="minecraft" modId="minecraft"
mandatory=true mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version # This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.18.2,1.19)" versionRange="[1.19,1.20)"
ordering="NONE" ordering="NONE"
side="BOTH" side="BOTH"
[[dependencies.libzontreck]] [[dependencies.ariasessentials]]
modId="libzontreck" modId="libzontreck"
mandatory=true mandatory=true
versionRange="[1.10,1.11)" versionRange="[1.10,1.11)"

View file

@ -2,7 +2,7 @@
"pack": { "pack": {
"description": "Aria's Essentials resources", "description": "Aria's Essentials resources",
"pack_format": 9, "pack_format": 9,
"forge:resource_pack_format": 8, "forge:resource_pack_format": 9,
"forge:data_pack_format": 9 "forge:data_pack_format": 10
} }
} }