Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into timings/use-internals
Browse files Browse the repository at this point in the history
  • Loading branch information
electronicboy committed May 9, 2024
2 parents 1028e02 + f2512b1 commit ef6b243
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ into most IDEs and formatters by default. There are a few notes, however:
There are exceptions, especially in Spigot-related files
- When in doubt or the code around your change is in a clearly different style,
use the same style as the surrounding code.
- `var` usage is heavily discouraged, as it makes reading patch files a lot harder
and can lead to confusion during updates due to changed return types. The only
exception to this is if a line would otherwise be way too long/filled with hard
to parse generics in a case where the base type itself is already obvious
- Usage of the `var` keyword is heavily discouraged, as it makes reading patch files
a lot harder and can lead to confusion during updates due to changed return types.
The only exception to this is if a line would otherwise be way too long/filled with
hard to parse generics in a case where the base type itself is already obvious

### Imports
When adding new imports to a class in a file not created by the current patch, use the fully qualified class name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
Date: Thu, 9 May 2024 15:11:34 +0200
Subject: [PATCH] Print data component type on encoding error


diff --git a/src/main/java/net/minecraft/core/component/DataComponentPatch.java b/src/main/java/net/minecraft/core/component/DataComponentPatch.java
index 913327c9bb937c95e487ba21cf8e2084817bbfdb..f7632a099e1c6e214b5689375889eee7d6426e67 100644
--- a/src/main/java/net/minecraft/core/component/DataComponentPatch.java
+++ b/src/main/java/net/minecraft/core/component/DataComponentPatch.java
@@ -143,7 +143,13 @@ public final class DataComponentPatch {
}

private static <T> void encodeComponent(RegistryFriendlyByteBuf buf, DataComponentType<T> type, Object value) {
+ // Paper start - codec errors of random anonymous classes are useless
+ try {
type.streamCodec().encode(buf, (T) value); // CraftBukkit - decompile error
+ } catch (final Exception e) {
+ throw new RuntimeException("Error encoding component " + type, e);
+ }
+ // Paper end - codec errors of random anonymous classes are useless
}
};
private static final String REMOVED_PREFIX = "!";

0 comments on commit ef6b243

Please sign in to comment.