mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-28 15:38:00 +01:00
ad7a7d84c0
- Foods fill for different amounts for different races - Certain foods can no longer be eaten by certain races - Added food categories for candy, rocks, desserts - Moved everything to datapacks
22 lines
770 B
Java
22 lines
770 B
Java
package com.minelittlepony.unicopia.diet;
|
|
|
|
import com.minelittlepony.unicopia.diet.affliction.Affliction;
|
|
import com.mojang.serialization.Codec;
|
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
|
|
|
import net.minecraft.network.PacketByteBuf;
|
|
|
|
public record Ailment(Affliction effects) {
|
|
public static final Ailment EMPTY = new Ailment(Affliction.EMPTY);
|
|
public static final Codec<Ailment> CODEC = RecordCodecBuilder.create(instance -> instance.group(
|
|
Affliction.CODEC.fieldOf("effects").forGetter(Ailment::effects)
|
|
).apply(instance, Ailment::new));
|
|
|
|
public Ailment(PacketByteBuf buffer) {
|
|
this(Affliction.read(buffer));
|
|
}
|
|
|
|
public void toBuffer(PacketByteBuf buffer) {
|
|
Affliction.write(buffer, effects);
|
|
}
|
|
}
|