Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jun 11, 2024
1 parent b92351d commit 8acafaa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fabric_version=0.100.0+1.20.6

maven_group = eu.pb4

mod_version = 0.8.3
mod_version = 0.8.4

minecraft_version_supported = ">=1.20.5-"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public final class PolymerItemUtils {
DataComponentTypes.STORED_ENCHANTMENTS,
DataComponentTypes.POTION_CONTENTS,
DataComponentTypes.CUSTOM_NAME,
DataComponentTypes.CONTAINER,
};
@SuppressWarnings("rawtypes")
private static final List<HideableTooltip> HIDEABLE_TOOLTIPS = List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,30 +341,18 @@ public static void clearTabs(Predicate<InternalClientItemGroup> removePredicate)
ITEM_GROUPS.removeIf(removePredicate);
CreativeInventoryScreenAccessor.setSelectedTab(ItemGroups.getDefaultTab());

if (CompatStatus.FABRIC_ITEM_GROUP) {
try {
var f1 = CreativeInventoryScreen.class.getDeclaredField("fabric_currentPage");
f1.setAccessible(true);
f1.setInt(null, 0);
} catch (Throwable e) {
if (PolymerImpl.LOG_MORE_ERRORS) {
PolymerImpl.LOGGER.error("Failed to change item group page (FABRIC)!", e);
}
}
}

if (CompatStatus.QUILT_ITEM_GROUP) {
if (CompatStatus.FABRIC_ITEM_GROUP || CompatStatus.QUILT_ITEM_GROUP) {
try {
for (var f1 : CreativeInventoryScreen.class.getDeclaredFields()) {
if (f1.getName().contains("quilt$currentPage")) {
if (f1.getName().contains("currentPage")) {
f1.setAccessible(true);
f1.setInt(null, 0);
break;
}
}
} catch (Throwable e) {
if (PolymerImpl.LOG_MORE_ERRORS) {
PolymerImpl.LOGGER.error("Failed to change item group page (QUILT)!", e);
PolymerImpl.LOGGER.error("Failed to change item group page (FABRIC / QUILT)!", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ public class EntityTrackerUpdateS2CPacketMixin implements EntityTrackerUpdateS2C

var legalTrackedData = InternalEntityHelpers.getExampleTrackedDataOfEntityType((polymerEntity.getPolymerEntityType(player)));

if (!mod.isEmpty() && legalTrackedData != null && legalTrackedData.length > 0) {
if (!mod.isEmpty() && legalTrackedData != null && legalTrackedData.length != 0) {
for (var entry : mod) {
var x = legalTrackedData[entry.id()];
if (x != null && x.getData().dataType() == entry.handler()) {
entries.add(entry);
if (entry.id() < legalTrackedData.length) {
var x = legalTrackedData[entry.id()];
if (x != null && x.getData().dataType() == entry.handler()) {
entries.add(entry);
}
}
}
} else {
Expand Down

0 comments on commit 8acafaa

Please sign in to comment.