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

41 lines
1.2 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.world.item.crafting;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.crafting.Recipe;
public record RecipeHolder<T extends Recipe<?>>(ResourceKey<Recipe<?>> id, T value) {
public static final StreamCodec<RegistryFriendlyByteBuf, RecipeHolder<?>> STREAM_CODEC = StreamCodec.composite(ResourceKey.streamCodec(Registries.RECIPE), RecipeHolder::id, Recipe.STREAM_CODEC, RecipeHolder::value, RecipeHolder::new);
/*
* Enabled force condition propagation
* Lifted jumps to return sites
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof RecipeHolder)) return false;
RecipeHolder holder = (RecipeHolder)obj;
if (this.id != holder.id) return false;
return true;
}
@Override
public int hashCode() {
return this.id.hashCode();
}
@Override
public String toString() {
return this.id.toString();
}
}