-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add NETWORK serialization attribute and make MinecraftEndecs#ofRegist…
…ry use it
- Loading branch information
1 parent
68b0aa6
commit b077211
Showing
5 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/io/wispforest/owo/serialization/MinecraftSerializationAttributes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.wispforest.owo.serialization; | ||
|
||
import io.wispforest.endec.SerializationAttribute; | ||
|
||
public final class MinecraftSerializationAttributes { | ||
private MinecraftSerializationAttributes() { } | ||
|
||
/** | ||
* This format will be sent over the network. | ||
* <p> | ||
* Registries and block states can be represented as integer IDs. | ||
*/ | ||
public static final SerializationAttribute.Marker NETWORK = SerializationAttribute.marker("network"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/testmod/java/io/wispforest/uwu/network/DispatchedSubclassThree.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.wispforest.uwu.network; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.item.Item; | ||
|
||
public record DispatchedSubclassThree(Item item, Block block) implements DispatchedInterface { | ||
@Override | ||
public String getName() { | ||
return "three"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters