Fix Fabric Networking issues resulting in server crash and undelivered packets

This commit is contained in:
2023-05-30 18:54:04 +02:00
parent 5a1492a25a
commit d7a67ee3d5
11 changed files with 95 additions and 25 deletions

View File

@@ -39,8 +39,6 @@ public interface LibClientHelper {
Connection getClientConnection();
void registerClientReceiver(@NotNull ResourceLocation channelName, @NotNull Function<FriendlyByteBuf, @NotNull CraterPacket<?>> factory);
void registerBlockEntityRenderer(@NotNull BlockEntityType<? extends BlockEntity> blockEntityType, @NotNull BlockEntityRendererProvider blockEntityRendererFactory);
}

View File

@@ -33,8 +33,5 @@ public interface LibCommonHelper {
<T extends AbstractContainerMenu> MenuType<T> createMenuType(TriFunction<Integer, Inventory, FriendlyByteBuf, T> constructor);
/* FABRIC ONLY */
void registerServerReceiver(ResourceLocation channelName, Function<FriendlyByteBuf, CraterPacket<?>> factory);
<T> Optional<T> getCapabilityHandler(BlockEntity entity, Direction side, CraterCapabilityHandler capability);
}

View File

@@ -18,7 +18,7 @@ public class CommandMixin {
at = @At(value = "INVOKE",
target = "Lcom/mojang/brigadier/CommandDispatcher;execute(Lcom/mojang/brigadier/ParseResults;)I",
shift = At.Shift.BEFORE
), cancellable = true, remap = false
), cancellable = true
)
private void injectCommandEvent(ParseResults<CommandSourceStack> stackParseResults, String command, CallbackInfoReturnable<Integer> cir) {
CraterCommandEvent commandEvent = new CraterCommandEvent(stackParseResults, command);