File tree Expand file tree Collapse file tree
src/main/java/xyz/imcodist Expand file tree Collapse file tree Original file line number Diff line number Diff 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
1616maven_group =xyz.imcodist
1717archives_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
Original file line number Diff line number Diff line change 11package xyz .imcodist .data ;
22
3- import io .wispforest .owo .nbt .NbtKey ;
43import net .minecraft .client .MinecraftClient ;
54import net .minecraft .client .util .InputUtil ;
65import net .minecraft .item .ItemStack ;
76import net .minecraft .nbt .NbtCompound ;
7+ import net .minecraft .nbt .NbtElement ;
88import net .minecraft .registry .Registries ;
99import net .minecraft .text .Text ;
1010import 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 ;
Original file line number Diff line number Diff line change 11package xyz .imcodist .ui ;
22
3- import io .wispforest .owo .nbt .NbtKey ;
43import io .wispforest .owo .ui .base .BaseOwoScreen ;
54import io .wispforest .owo .ui .component .ButtonComponent ;
65import io .wispforest .owo .ui .component .Components ;
1514import net .minecraft .client .util .InputUtil ;
1615import net .minecraft .item .ItemStack ;
1716import net .minecraft .nbt .NbtCompound ;
17+ import net .minecraft .nbt .NbtElement ;
1818import net .minecraft .text .MutableText ;
1919import net .minecraft .text .Text ;
2020import 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 ;
You can’t perform that action at this time.
0 commit comments