Skip to content

Commit dffa0c5

Browse files
committed
Updated to version 1.2.3 and 1.20.4.
1 parent d1c1ec0 commit dffa0c5

3 files changed

Lines changed: 25 additions & 10 deletions

File tree

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.20.2
8-
yarn_mappings=1.20.2+build.2
9-
loader_version=0.14.22
7+
minecraft_version=1.20.4
8+
yarn_mappings=1.20.4+build.1
9+
loader_version=0.15.1
1010

1111
#Fabric api
12-
fabric_version=0.89.3+1.20.2
12+
fabric_version=0.91.2+1.20.4
1313

1414
# Mod Properties
15-
mod_version=1.2.2
15+
mod_version=1.2.3
1616
maven_group=xyz.imcodist
1717
archives_base_name=quick-menu
1818

1919
# owo-lib
20-
owo_version=0.11.3+1.20.2
20+
owo_version=0.12.0+1.20.3

src/main/java/xyz/imcodist/data/ActionButtonData.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package xyz.imcodist.data;
22

3-
import io.wispforest.owo.nbt.NbtKey;
43
import net.minecraft.client.MinecraftClient;
54
import net.minecraft.client.util.InputUtil;
65
import net.minecraft.item.ItemStack;
76
import net.minecraft.nbt.NbtCompound;
7+
import net.minecraft.nbt.NbtElement;
88
import net.minecraft.registry.Registries;
99
import net.minecraft.text.Text;
1010
import net.minecraft.util.Identifier;
@@ -45,7 +45,14 @@ public ActionButtonDataJSON toJSON() {
4545
jsonData.icon = icon.getRegistryEntry().getKey().get().getValue().toString();
4646
}
4747

48-
jsonData.customModelData = icon.getOr(new NbtKey<>("CustomModelData", NbtKey.Type.INT), null);
48+
if (icon.getNbt() != null) {
49+
NbtElement nbtElement = icon.getNbt().get("CustomModelData");
50+
if (nbtElement != null) {
51+
jsonData.customModelData = Integer.parseInt(nbtElement.toString());
52+
}
53+
}
54+
55+
//jsonData.customModelData = icon.getOr(new NbtKey<>("CustomModelData", NbtKey.Type.INT), null);
4956
}
5057

5158
return jsonData;

src/main/java/xyz/imcodist/ui/ActionEditorUI.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package xyz.imcodist.ui;
22

3-
import io.wispforest.owo.nbt.NbtKey;
43
import io.wispforest.owo.ui.base.BaseOwoScreen;
54
import io.wispforest.owo.ui.component.ButtonComponent;
65
import io.wispforest.owo.ui.component.Components;
@@ -15,6 +14,7 @@
1514
import net.minecraft.client.util.InputUtil;
1615
import net.minecraft.item.ItemStack;
1716
import net.minecraft.nbt.NbtCompound;
17+
import net.minecraft.nbt.NbtElement;
1818
import net.minecraft.text.MutableText;
1919
import net.minecraft.text.Text;
2020
import net.minecraft.util.Formatting;
@@ -217,7 +217,15 @@ protected void build(FlowLayout rootComponent) {
217217
private Integer getCustomModelData(ItemStack item) {
218218
Integer existingCustomModelData = null;
219219
if (item != null) {
220-
existingCustomModelData = item.getOr(new NbtKey<>("CustomModelData", NbtKey.Type.INT), null);
220+
if (item.getNbt() != null) {
221+
NbtElement nbtElement = item.getNbt().get("CustomModelData");
222+
if (nbtElement != null) {
223+
System.out.println(nbtElement);
224+
existingCustomModelData = Integer.parseInt(nbtElement.toString());
225+
}
226+
}
227+
228+
//existingCustomModelData = item.getOr(new NbtKey<>("CustomModelData", NbtKey.Type.INT), null);
221229
}
222230

223231
return existingCustomModelData;

0 commit comments

Comments
 (0)