Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.21.2 #178

Merged
merged 44 commits into from
Nov 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d1ea5a1
chore(docs): Apply contributing formating
ChampionAsh5357 Oct 14, 2024
3d8884d
chore(docs): Move old version to 1.21.1 subdirectory
ChampionAsh5357 Oct 14, 2024
f2fe5e0
feat(docs): Update advanced section
ChampionAsh5357 Oct 14, 2024
ea78032
feat(docs): Update Getting Started section
ChampionAsh5357 Oct 14, 2024
fdf6dc0
feat(docs): Update concepts section
ChampionAsh5357 Oct 14, 2024
19e279b
feat(docs): Update legacy section
ChampionAsh5357 Oct 14, 2024
1b57d99
feat(docs): Update world gen section
ChampionAsh5357 Oct 14, 2024
f0f7044
feat(docs): Update blocks section
ChampionAsh5357 Oct 15, 2024
be95a9f
feat(docs): Update block entities section
ChampionAsh5357 Oct 15, 2024
5785aa4
feat(docs): Update misc section
ChampionAsh5357 Oct 15, 2024
cf39971
feat(docs): Update data storage section
ChampionAsh5357 Oct 15, 2024
d770815
feat(docs): Update enchantments section
ChampionAsh5357 Oct 15, 2024
cdd31c9
fix(docs): Be more explicit in registration
ChampionAsh5357 Oct 17, 2024
043b67b
fix(docs): Add information about using BEWLR
ChampionAsh5357 Oct 17, 2024
8333111
feat(docs): Update datamaps section
ChampionAsh5357 Oct 17, 2024
ea97c6d
fix(docs): Add back in applyEffects as it is ATed
ChampionAsh5357 Oct 17, 2024
70ab9b6
feat(docs): Update loot tables section
ChampionAsh5357 Oct 17, 2024
6040a7d
feat(docs): Update networking section
ChampionAsh5357 Oct 18, 2024
9bb34f5
feat(docs): Update client section
ChampionAsh5357 Oct 18, 2024
45ee798
feat(docs): Update GUI section
ChampionAsh5357 Oct 18, 2024
365d215
feat(docs): Update server section
ChampionAsh5357 Oct 18, 2024
4acc763
feat(docs): Update models section
ChampionAsh5357 Oct 19, 2024
a884c79
fix(docs): Fix incorrect information
ChampionAsh5357 Oct 19, 2024
f2bbeba
feat(docs): Begin items section
ChampionAsh5357 Oct 19, 2024
b5056fc
feat(docs): Progress on items and mob effects
ChampionAsh5357 Oct 20, 2024
93ca4a5
feat(docs): Document consumables for food update
ChampionAsh5357 Oct 20, 2024
d4272e8
feat(docs): Update tools section
ChampionAsh5357 Oct 20, 2024
430a3b3
fix(docs): Add information on replacing the current item
ChampionAsh5357 Oct 20, 2024
ad0e811
fix(docs): Add more appropriate tag access
ChampionAsh5357 Oct 21, 2024
bccf545
feat(docs): Update armor section
ChampionAsh5357 Oct 22, 2024
e46e593
fix(docs): Porting to 1.21.3
ChampionAsh5357 Oct 23, 2024
1d9d59a
fix(docs): Add information about color handlers
ChampionAsh5357 Oct 23, 2024
ceac726
fix(docs): Fix building PR
ChampionAsh5357 Oct 23, 2024
dda28d5
feat(docs): Update recipes section
ChampionAsh5357 Oct 24, 2024
1d378c6
fix(docs): Use reload listener solution
ChampionAsh5357 Oct 24, 2024
bb1f486
fix(docs): Address IHH's first round of comments
ChampionAsh5357 Oct 28, 2024
b429d49
fix(docs): Address xfact's comment
ChampionAsh5357 Oct 30, 2024
83bc7fa
fix(docs): Apply IHH's suggestions
ChampionAsh5357 Oct 31, 2024
3f39fee
fix(docs): More of IHH's comments during round 2
ChampionAsh5357 Oct 31, 2024
3658e6e
fix(docs): Apply suggestions from Xfact
ChampionAsh5357 Nov 12, 2024
1cd2cd9
fix(docs): Address the rest of xfact's comments
ChampionAsh5357 Nov 12, 2024
79f4be9
fix(docs): Fix issues
ChampionAsh5357 Nov 12, 2024
18e58d6
fix(docs): Remove extra spacing
ChampionAsh5357 Nov 13, 2024
4980454
fix(docs): Add IHH's suggestions
ChampionAsh5357 Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(docs): Update networking section
ChampionAsh5357 committed Oct 18, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 6040a7d77ab7bd963f66f51e497ef11d93f60eda
15 changes: 6 additions & 9 deletions docs/networking/streamcodecs.md
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ Unless you are manually handling the buffer object, you will generally never cal
| `BYTE` | `Byte` |
| `SHORT` | `Short` |
| `INT` | `Integer` |
| `LONG` | `Long` |
| `FLOAT` | `Float` |
| `DOUBLE` | `Double` |
| `BYTE_ARRAY` | `byte[]`\* |
@@ -53,7 +54,7 @@ Unless you are manually handling the buffer object, you will generally never cal

\* `byte[]` can be limited to a certain number of values via `ByteBufCodecs#byteArray`.

\* `String` can be limited to a certain number of characters via `ByteBufCodecs#stringUtf8`.
\*\* `String` can be limited to a certain number of characters via `ByteBufCodecs#stringUtf8`.

Additionally, there are some static instances that encode and decode primivites and objects using a different method.

@@ -66,7 +67,7 @@ Additionally, there are some static instances that encode and decode primivites
`VAR_INT` and `VAR_LONG` are stream codecs where the value is encoded to be as small as possible. This is done by encoding seven bits at a time, using the upper bit as a marker of whether there is more data for this number. Numbers between 0 and 2^28-1 for integers or 0 and 2^56-1 for longs will be sent shorter or equal to the number of bytes in a integer or long, respectively. If the values of your numbers are normally in this range and generally at the lower end of it, then these variable stream codecs should be used.

:::note
`VAR_INT` is an alternative for `INT`.
`VAR_INT` and `VAR_LONG` are alternatives for `INT` and `LONG`, respectively.
:::

#### Trusted Tags
@@ -116,7 +117,7 @@ public static StreamCodec<ByteBuf, ExampleObject> =

### Composites

Stream codecs can read and write objects via `StreamCodec#composite`. Each composite stream codec defines a list of stream codecs and getters which are read/written in the order they are provided. `composite` has overloads up to six parameters.
Stream codecs can read and write objects via `StreamCodec#composite`. Each composite stream codec defines a list of stream codecs and getters which are read/written in the order they are provided. `composite` has overloads up to eight parameters.

Every two parameters in a `composite` represents the stream codec used to read/write the field and a getter to get the field to encode from the object. The final parameter is a function to create a new instance of the object when decoding.

@@ -283,10 +284,6 @@ public static final StreamCodec<ByteBuf, ExampleIdObject> ID_STREAM_CODEC =
ByteBufCodecs.idMapper(ExampleIdObject.BY_ID, ExampleIdObject::getId);
```

:::note
NeoForge provides an alternative for id mappers that does not cache the enum values on construction via `IExtensibleEnum#createStreamCodecForExtensibleEnum`. However, this rarely needs to be used outside of extensible enums.
:::

### Optional

A stream codec for sending an `Optional` wrapped value can be generated by supplying a stream codec to `ByteBufCodecs#optional`. This method first reads/writes a boolean indicating whether to read/write the object.
@@ -369,14 +366,14 @@ public abstract class ExampleObject {
public abstract StreamCodec<? super RegistryFriendlyByteBuf, ? extends ExampleObject> streamCodec();
}

// Assume there is a ResourceKey<StreamCodec< super RegistryFriendlyByteBuf, ? extends ExampleObject>> DISPATCH
// Assume there is a ResourceKey<StreamCodec<? super RegistryFriendlyByteBuf, ? extends ExampleObject>> DISPATCH
public static final StreamCodec<RegistryFriendlyByteBuf, ExampleObject> DISPATCH_STREAM_CODEC =
ByteBufCodecs.registry(DISPATCH).dispatch(
// Get the stream codec from the specific object
ExampleObject::streamCodec,
// Get the stream codec from the registry object
Function.identity()
)
);
```

[networking]: ./payload.md