-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
When creating custom Endecs (I.E. StructEndecs) you need to register these using the ReflectiveEndecBuilder
An example from Numismatic Overhaul:
// Endec used for shop offers
public static final Endec<ShopOffer> ENDEC = StructEndecBuilder.of(
BuiltInEndecs.ITEM_STACK.fieldOf("sell", ShopOffer::getSellStack),
Endec.LONG.fieldOf("price", ShopOffer::getPrice),
ShopOffer::new
);
// Register method in the "UpdateShopScreenS2CPacket" class
ReflectiveEndecBuilder.register(ShopOffer.ENDEC, ShopOffer.class);Metadata
Metadata
Assignees
Labels
No labels