Skip to content

Commit

Permalink
Merge branch '1.20.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed May 27, 2024
2 parents a8029d4 + b40cf80 commit f823b91
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 53 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ buildscript {
}

plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
}

def ENV = System.getenv()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

version = project.mod_version
group = project.maven_group

Expand Down Expand Up @@ -56,18 +59,15 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
// Minecraft 1.20.5 (24w14a) upwards uses Java 21.
it.options.release = 21
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

jar {
Expand Down Expand Up @@ -103,7 +103,7 @@ curseforge {
changelogType = "html"
changelog = file("changelog.txt")
releaseType = "release"
addGameVersion "1.20.2"
addGameVersion "1.20.6"
addGameVersion "Fabric"

mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>A changelog can be found at: <a href="https://www.wimods.net/chestesp/chestesp-1-0/?utm_source=CurseForge&utm_medium=ChestESP">https://www.wimods.net/chestesp/chestesp-1-0/</a></p>
<p>A changelog can be found at: <a href="https://www.wimods.net/chestesp/chestesp-1-1/?utm_source=CurseForge&utm_medium=ChestESP">https://www.wimods.net/chestesp/chestesp-1-1/</a></p>
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ org.gradle.parallel=true

# Fabric Properties
# check these at https://fabricmc.net/develop/ and
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.22
# https://modrinth.com/mod/fabric-api/versions
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.3
loader_version=0.15.11

#Fabric api
fabric_version=0.89.3+1.20.2
# Fabric API
fabric_version=0.99.0+1.20.6

# Mod Properties
mod_version = 1.0-MC1.20.2-Fabric
mod_version = 1.1-MC1.20.6-Fabric
maven_group = net.wimods.chestesp
archives_base_name = ChestESP

# Dependencies
# check at https://modrinth.com/mod/modmenu/versions
modmenu_version=8.0.0
modmenu_version=10.0.0-beta.1
# check at https://modrinth.com/mod/cloth-config/versions?l=fabric
cloth_config_version=12.0.109
cloth_config_version=14.0.126
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,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=SC2039,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=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ 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
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
12 changes: 12 additions & 0 deletions src/main/java/net/wimods/chestesp/ChestEspConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public final class ChestEspConfig implements ConfigData
@ConfigEntry.Gui.Tooltip
public int barrel_color = 0x00FF00;

public boolean include_pots = false;

@ConfigEntry.ColorPicker
@ConfigEntry.Gui.Tooltip
public int pot_color = 0x00FF00;

public boolean include_shulker_boxes = true;

@ConfigEntry.ColorPicker
Expand Down Expand Up @@ -86,6 +92,12 @@ public final class ChestEspConfig implements ConfigData
@ConfigEntry.Gui.Tooltip
public int dispenser_color = 0xFF8000;

public boolean include_crafters = false;

@ConfigEntry.ColorPicker
@ConfigEntry.Gui.Tooltip
public int crafter_color = 0xFFFFFF;

public boolean include_furnaces = false;

@ConfigEntry.ColorPicker
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/net/wimods/chestesp/ChestEspGroupManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ public final class ChestEspGroupManager
public final ChestEspEntityGroup chestCarts;
public final ChestEspEntityGroup chestBoats;
public final ChestEspBlockGroup barrels;
public final ChestEspBlockGroup pots;
public final ChestEspBlockGroup shulkerBoxes;
public final ChestEspBlockGroup hoppers;
public final ChestEspEntityGroup hopperCarts;
public final ChestEspBlockGroup droppers;
public final ChestEspBlockGroup dispensers;
public final ChestEspBlockGroup crafters;
public final ChestEspBlockGroup furnaces;

public final List<ChestEspGroup> allGroups;
Expand All @@ -43,6 +45,8 @@ public ChestEspGroupManager(ConfigHolder<ChestEspConfig> ch)
c -> c.include_chest_boats);
barrels = new ChestEspBlockGroup(ch, c -> c.barrel_color,
c -> c.include_barrels);
pots =
new ChestEspBlockGroup(ch, c -> c.pot_color, c -> c.include_pots);
shulkerBoxes = new ChestEspBlockGroup(ch, c -> c.shulker_box_color,
c -> c.include_shulker_boxes);
hoppers = new ChestEspBlockGroup(ch, c -> c.hopper_color,
Expand All @@ -53,12 +57,14 @@ public ChestEspGroupManager(ConfigHolder<ChestEspConfig> ch)
c -> c.include_droppers);
dispensers = new ChestEspBlockGroup(ch, c -> c.dispenser_color,
c -> c.include_dispensers);
crafters = new ChestEspBlockGroup(ch, c -> c.crafter_color,
c -> c.include_crafters);
furnaces = new ChestEspBlockGroup(ch, c -> c.furnace_color,
c -> c.include_furnaces);

allGroups = Arrays.asList(basicChests, trapChests, enderChests,
chestCarts, chestBoats, barrels, shulkerBoxes, hoppers, hopperCarts,
droppers, dispensers, furnaces);
chestCarts, chestBoats, barrels, pots, shulkerBoxes, hoppers,
hopperCarts, droppers, dispensers, crafters, furnaces);
entityGroups = Arrays.asList(chestCarts, chestBoats, hopperCarts);
}
}
4 changes: 4 additions & 0 deletions src/main/java/net/wimods/chestesp/ChestEspMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ else if(blockEntity instanceof ShulkerBoxBlockEntity)
groups.shulkerBoxes.add(blockEntity);
else if(blockEntity instanceof BarrelBlockEntity)
groups.barrels.add(blockEntity);
else if(blockEntity instanceof DecoratedPotBlockEntity)
groups.pots.add(blockEntity);
else if(blockEntity instanceof HopperBlockEntity)
groups.hoppers.add(blockEntity);
else if(blockEntity instanceof DropperBlockEntity)
groups.droppers.add(blockEntity);
else if(blockEntity instanceof DispenserBlockEntity)
groups.dispensers.add(blockEntity);
else if(blockEntity instanceof CrafterBlockEntity)
groups.crafters.add(blockEntity);
else if(blockEntity instanceof AbstractFurnaceBlockEntity)
groups.furnaces.add(blockEntity);
});
Expand Down
39 changes: 28 additions & 11 deletions src/main/java/net/wimods/chestesp/mixin/GameRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,47 @@
*/
package net.wimods.chestesp.mixin;

import org.joml.Matrix4f;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.llamalad7.mixinextras.sugar.Local;

import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.resource.SynchronousResourceReloader;
import net.wimods.chestesp.ChestEspMod;

@Mixin(GameRenderer.class)
public abstract class GameRendererMixin
implements AutoCloseable, SynchronousResourceReloader
public abstract class GameRendererMixin implements AutoCloseable
{
@Unique
private boolean cancelNextBobView;

/**
* Fires the CameraTransformViewBobbingEvent event and records whether the
* next view-bobbing call should be cancelled.
*/
@Inject(at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/render/GameRenderer;bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V",
ordinal = 0),
method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V")
ordinal = 0), method = "renderWorld(FJ)V")
private void onRenderWorldViewBobbing(float tickDelta, long limitTime,
MatrixStack matrices, CallbackInfo ci)
CallbackInfo ci)
{
ChestEspMod chestEsp = ChestEspMod.getInstance();

if(chestEsp != null && chestEsp.isEnabled())
cancelNextBobView = chestEsp.shouldCancelViewBobbing();
}

/**
* Cancels the view-bobbing call if requested by the last
* CameraTransformViewBobbingEvent.
*/
@Inject(at = @At("HEAD"),
method = "bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V",
cancellable = true)
Expand All @@ -51,10 +61,15 @@ private void onBobView(MatrixStack matrices, float tickDelta,
cancelNextBobView = false;
}

/**
* This mixin is injected into a random method call later in the
* renderWorld() method to ensure that cancelNextBobView is always reset
* after the view-bobbing call.
*/
@Inject(at = @At("HEAD"),
method = "renderHand(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/Camera;F)V")
private void renderHand(MatrixStack matrices, Camera camera,
float tickDelta, CallbackInfo ci)
method = "renderHand(Lnet/minecraft/client/render/Camera;FLorg/joml/Matrix4f;)V")
private void onRenderHand(Camera camera, float tickDelta, Matrix4f matrix4f,
CallbackInfo ci)
{
cancelNextBobView = false;
}
Expand All @@ -64,10 +79,12 @@ private void renderHand(MatrixStack matrices, Camera camera,
target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z",
opcode = Opcodes.GETFIELD,
ordinal = 0),
method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V")
method = "renderWorld(FJ)V")
private void onRenderWorld(float partialTicks, long finishTimeNano,
MatrixStack matrixStack, CallbackInfo ci)
CallbackInfo ci, @Local(ordinal = 1) Matrix4f matrix4f2)
{
MatrixStack matrixStack = new MatrixStack();
matrixStack.multiplyPositionMatrix(matrix4f2);
ChestEspMod chestEsp = ChestEspMod.getInstance();

if(chestEsp != null && chestEsp.isEnabled())
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/assets/chestesp/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"text.autoconfig.chestesp.option.include_barrels": "Include barrels",
"text.autoconfig.chestesp.option.barrel_color": "Barrel color",
"text.autoconfig.chestesp.option.barrel_color.@Tooltip": "Barrels will be highlighted in this color.",
"text.autoconfig.chestesp.option.include_pots": "Include pots",
"text.autoconfig.chestesp.option.pot_color": "Pots color",
"text.autoconfig.chestesp.option.pot_color.@Tooltip": "Decorated pots will be highlighted in this color.",
"text.autoconfig.chestesp.option.include_shulker_boxes": "Include shulkers",
"text.autoconfig.chestesp.option.shulker_box_color": "Shulker color",
"text.autoconfig.chestesp.option.shulker_box_color.@Tooltip": "Shulker boxes will be highlighted in this color.",
Expand All @@ -40,6 +43,9 @@
"text.autoconfig.chestesp.option.include_dispensers": "Include dispensers",
"text.autoconfig.chestesp.option.dispenser_color": "Dispenser color",
"text.autoconfig.chestesp.option.dispenser_color.@Tooltip": "Dispensers will be highlighted in this color.",
"text.autoconfig.chestesp.option.include_crafters": "Include crafters",
"text.autoconfig.chestesp.option.crafter_color": "Crafter color",
"text.autoconfig.chestesp.option.crafter_color.@Tooltip": "Crafters will be highlighted in this color.",
"text.autoconfig.chestesp.option.include_furnaces": "Include furnaces",
"text.autoconfig.chestesp.option.furnace_color": "Furnace color",
"text.autoconfig.chestesp.option.furnace_color.@Tooltip": "Furnaces, smokers, and blast furnaces will be highlighted in this color."
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
],

"depends": {
"fabricloader": ">=0.14.22",
"fabricloader": ">=0.15.10",
"fabric-api": "*",
"modmenu": "^8.0.0",
"cloth-config": "^12.0.0",
"minecraft": "~1.20.2",
"java": ">=17"
"modmenu": "^10.0.0-beta.1",
"cloth-config": "^14.0.0",
"minecraft": "~1.20.5",
"java": ">=21"
},
"suggests": {
"wi_zoom": "*",
Expand Down

0 comments on commit f823b91

Please sign in to comment.