Skip to content

Commit

Permalink
Fix some networking bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Aug 13, 2023
1 parent 68a20c7 commit 3a4d3c1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 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.83.0+1.20.1

maven_group = eu.pb4

mod_version = 0.5.9
mod_version = 0.5.10

minecraft_version_supported = ">=1.20-"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,23 +321,27 @@ public static void clear() {
((PolymerIdList) BLOCK_STATES).polymer$clear();
BLOCK_STATES.set(ClientPolymerBlock.NONE_STATE, 0);

clearTabs(i -> true);
for (var group : Registries.ITEM_GROUP) {
if (group.getType() == ItemGroup.Type.CATEGORY) {
try {
((ClientItemGroupExtension) group).polymer$clearStacks();
} catch (Throwable e) {
e.printStackTrace();

MinecraftClient.getInstance().execute(() -> {
clearTabs(i -> true);

for (var group : Registries.ITEM_GROUP) {
if (group.getType() == ItemGroup.Type.CATEGORY) {
try {
((ClientItemGroupExtension) group).polymer$clearStacks();
} catch (Throwable e) {
e.printStackTrace();
}
}
}
}
try {
if (ItemGroupsAccessor.getDisplayContext() != null) {
ItemGroupsAccessor.callUpdateEntries(ItemGroupsAccessor.getDisplayContext());
try {
if (ItemGroupsAccessor.getDisplayContext() != null) {
ItemGroupsAccessor.callUpdateEntries(ItemGroupsAccessor.getDisplayContext());
}
} catch (Throwable e) {
e.printStackTrace();
}
} catch (Throwable e) {
e.printStackTrace();
}
});
PolymerClientUtils.ON_CLEAR.invoke(EventRunners.RUN);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static void register() {
registerPacketHandler(ServerPackets.SYNC_ITEM_GROUP_REMOVE, PolymerClientProtocolHandler::handleItemGroupRemove);
registerPacketHandler(ServerPackets.SYNC_ITEM_GROUP_APPLY_UPDATE, PolymerClientProtocolHandler::handleItemGroupApplyUpdates);
registerPacketHandler(ServerPackets.SYNC_CLEAR, (handler, version, buf) -> {
MinecraftClient.getInstance().execute(InternalClientRegistry::clear);
InternalClientRegistry.clear();
});
registerPacketHandler(ServerPackets.DEBUG_VALIDATE_STATES, (handler, version, buf) -> handleGenericSync(handler, version, buf, DebugBlockStateEntry::read, PolymerClientProtocolHandler::handleDebugValidateStates));

Expand Down

0 comments on commit 3a4d3c1

Please sign in to comment.