Skip to content

Commit

Permalink
Merge pull request #14 from BlazingTwist/1.20.1
Browse files Browse the repository at this point in the history
1.20.1
  • Loading branch information
BlazingTwist authored Jun 21, 2023
2 parents daad7a9 + 4616bfd commit a8152fe
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ItemCounts

A Minecraft [Fabric](https://fabricmc.net/) mod that displays the total amount of items in your hotbar.
Built for version 1.19.4
Built for version 1.20.1

[Curseforge release](https://www.curseforge.com/minecraft/mc-mods/item-counts-fabric)

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation("me.shedaniel.cloth:cloth-config-fabric:[10.0,11.0)") {
modImplementation("me.shedaniel.cloth:cloth-config-fabric:[11.0,12.0)") {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation("com.terraformersmc:modmenu:[6.0,7.0)") {
modImplementation("com.terraformersmc:modmenu:[7.1,8.0)") {
exclude group: "net.fabricmc.fabric-api"
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.1
loader_version=0.14.21

# Mod Properties
mod_version = 1.3.0
maven_group = blazingtwist
archives_base_name = itemcounts

# Dependencies
fabric_version=0.75.3+1.19.4
fabric_version=0.83.0+1.20.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public int getHotbarItemCount(PlayerEntity player, ItemStack stack) {
}

private boolean mergeStackCounts(ItemStack a, ItemStack b) {
return b.isItemEqual(a) && !countStacksSeparately(a, b);
return ItemStack.areItemsEqual(a, b) && !countStacksSeparately(a, b);
}

private boolean countStacksSeparately(ItemStack a, ItemStack b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.DiffuseLighting;
import net.minecraft.client.render.OverlayTexture;
Expand Down Expand Up @@ -159,15 +160,15 @@ private void renderItemAt(ItemStack item, int x, int y, float scaleFactor, boole
}

@Inject(method = "renderHotbarItem(" +
"Lnet/minecraft/client/util/math/MatrixStack;" +
"Lnet/minecraft/client/gui/DrawContext;" +
"I" +
"I" +
"F" +
"Lnet/minecraft/entity/player/PlayerEntity;" +
"Lnet/minecraft/item/ItemStack;" +
"I" +
")V", at = @At("HEAD"))
public void onRenderHotbarItem(MatrixStack matrixStack, int x, int y, float tickDelta, PlayerEntity player, ItemStack stack, int seed, CallbackInfo info) {
public void onRenderHotbarItem(DrawContext context, int x, int y, float tickDelta, PlayerEntity player, ItemStack stack, int seed, CallbackInfo info) {
if (stack.isEmpty()) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
],

"depends": {
"fabricloader": ">=0.14.17",
"fabricloader": ">=0.14.21",
"fabric": "*",
"minecraft": "~1.19.4",
"minecraft": "~1.20.1",
"java": ">=17"
},
"suggests": {
Expand Down

0 comments on commit a8152fe

Please sign in to comment.