2025-11-24 22:52:51 +03:00

43 lines
1.4 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.advancements;
import java.util.List;
import net.minecraft.advancements.Advancement;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.Identifier;
public record AdvancementHolder(Identifier id, Advancement value) {
public static final StreamCodec<RegistryFriendlyByteBuf, AdvancementHolder> STREAM_CODEC = StreamCodec.composite(Identifier.STREAM_CODEC, AdvancementHolder::id, Advancement.STREAM_CODEC, AdvancementHolder::value, AdvancementHolder::new);
public static final StreamCodec<RegistryFriendlyByteBuf, List<AdvancementHolder>> LIST_STREAM_CODEC = STREAM_CODEC.apply(ByteBufCodecs.list());
/*
* Enabled force condition propagation
* Lifted jumps to return sites
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AdvancementHolder)) return false;
AdvancementHolder holder = (AdvancementHolder)obj;
if (!this.id.equals(holder.id)) return false;
return true;
}
@Override
public int hashCode() {
return this.id.hashCode();
}
@Override
public String toString() {
return this.id.toString();
}
}