Skip to content

Commit

Permalink
Fix compat with fabric 0.100.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jun 9, 2024
1 parent 216a938 commit b92351d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ yarn_mappings=1.20.6+build.1
loader_version=0.15.10

#Fabric api
fabric_version=0.97.6+1.20.6
fabric_version=0.100.0+1.20.6

maven_group = eu.pb4

mod_version = 0.8.2
mod_version = 0.8.3

minecraft_version_supported = ">=1.20.5-"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public static void markAsPolymer(DataComponentType<?>... types) {
}

public static boolean isPolymerComponent(DataComponentType<?> type) {
return UNSYNCED_COMPONENTS.add(type);
return UNSYNCED_COMPONENTS.contains(type);
}

public static ItemStack getClientItemStack(ItemStack stack, ServerPlayerEntity player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,13 @@ private static void setItemGroupPage(ItemGroup group, int page) {
((ClientItemGroupExtension) group).polymerCore$setPage(page);
if (CompatStatus.FABRIC_ITEM_GROUP) {
try {
((net.fabricmc.fabric.impl.itemgroup.FabricItemGroup) group).setPage(page);
try {
((net.fabricmc.fabric.impl.itemgroup.FabricItemGroupImpl) group).fabric_setPage(page);
} catch (Throwable e) {
var method = group.getClass().getMethod("setPage", int.class);
method.invoke(group, page);
}

} catch (Throwable e) {
PolymerImpl.LOGGER.warn("Couldn't set page of ItemGroup (FABRIC)", e);
}
Expand Down

0 comments on commit b92351d

Please sign in to comment.