use of net.silentchaos512.gear.api.part.IPartSerializer in project Silent-Gear by SilentChaos512.
the class PartSerializers method write.
@SuppressWarnings("unchecked")
public static <T extends IGearPart> void write(T part, FriendlyByteBuf buffer) {
ResourceLocation id = part.getId();
ResourceLocation type = part.getSerializer().getName();
log(() -> "write " + id + " (type " + type + ")");
buffer.writeResourceLocation(id);
buffer.writeResourceLocation(type);
IPartSerializer<T> serializer = (IPartSerializer<T>) part.getSerializer();
serializer.write(buffer, part);
}
Aggregations