2019-07-28 10:08:49 +02:00
|
|
|
package com.simibubi.create;
|
|
|
|
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
|
|
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunUpgradeRecipe;
|
|
|
|
|
|
|
|
import net.minecraft.item.crafting.IRecipeSerializer;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraftforge.event.RegistryEvent;
|
|
|
|
|
|
|
|
public enum AllRecipes {
|
|
|
|
|
2019-08-06 19:00:51 +02:00
|
|
|
Placement_Handgun_Upgrade(BuilderGunUpgradeRecipe.Serializer::new),
|
|
|
|
|
|
|
|
;
|
2019-07-28 10:08:49 +02:00
|
|
|
|
|
|
|
public IRecipeSerializer<?> serializer;
|
|
|
|
public Supplier<IRecipeSerializer<?>> supplier;
|
|
|
|
|
|
|
|
private AllRecipes(Supplier<IRecipeSerializer<?>> supplier) {
|
|
|
|
this.supplier = supplier;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void register(RegistryEvent.Register<IRecipeSerializer<?>> event) {
|
|
|
|
for (AllRecipes r : AllRecipes.values()) {
|
|
|
|
r.serializer = r.supplier.get();
|
|
|
|
ResourceLocation location = new ResourceLocation(Create.ID, r.name().toLowerCase());
|
|
|
|
event.getRegistry().register(r.serializer.setRegistryName(location));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|