Flywheel/src/main/java/com/simibubi/create/AllRecipes.java
simibubi facef0ddb1 Bug Fixes in 0.1.1a
- Fixed id downcasing not working properly in non-english environments #25
- Removed event subscriber annotations for mod & registry events
- Added more displayable slots in the Washing JEI view
- Fixed Windowed blocks referencing IBakedModel on the server
- Changed stairs to use blockstate supplier
- Fixed Symmetry Wand crashing when configured in the off-hand
- Fixed "Hold Shift" in tooltips not being translated
- Chassis now drop applied slime balls
- Slime Balls are now craftable
- Mechanical Belts now lock living entities in place
- Blockzapper recipes can now be viewed from the uses of their ingredient materials
- Configured FlexPeaters now synchronize with other players
- Fixed client crash when rendering lava in a deployed schematic #15
- Made encased fans a little less expensive
- Added other coral types to tree fertilizer recipe
2019-10-15 22:22:19 +02:00

62 lines
2.3 KiB
Java

package com.simibubi.create;
import java.util.function.Supplier;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.base.ProcessingRecipeSerializer;
import com.simibubi.create.modules.contraptions.receivers.CrushingRecipe;
import com.simibubi.create.modules.contraptions.receivers.PressingRecipe;
import com.simibubi.create.modules.contraptions.receivers.SplashingRecipe;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunUpgradeRecipe;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
import net.minecraftforge.event.RegistryEvent;
public enum AllRecipes {
BLOCKZAPPER_UPGRADE(BuilderGunUpgradeRecipe.Serializer::new, IRecipeType.CRAFTING),
CRUSHING(() -> new ProcessingRecipeSerializer<>(CrushingRecipe::new), Types.CRUSHING),
SPLASHING(() -> new ProcessingRecipeSerializer<>(SplashingRecipe::new), Types.SPLASHING),
PRESSING(() -> new ProcessingRecipeSerializer<>(PressingRecipe::new), Types.PRESSING),
;
public static class Types {
public static IRecipeType<CrushingRecipe> CRUSHING = register("crushing");
public static IRecipeType<SplashingRecipe> SPLASHING = register("splashing");
public static IRecipeType<PressingRecipe> PRESSING = register("pressing");
static <T extends IRecipe<?>> IRecipeType<T> register(final String key) {
return Registry.register(Registry.RECIPE_TYPE, new ResourceLocation(key), new IRecipeType<T>() {
public String toString() {
return key;
}
});
}
}
public IRecipeSerializer<?> serializer;
public Supplier<IRecipeSerializer<?>> supplier;
public IRecipeType<? extends IRecipe<? extends IInventory>> type;
private AllRecipes(Supplier<IRecipeSerializer<?>> supplier,
IRecipeType<? extends IRecipe<? extends IInventory>> type) {
this.supplier = supplier;
this.type = type;
}
public static void register(RegistryEvent.Register<IRecipeSerializer<?>> event) {
for (AllRecipes r : AllRecipes.values()) {
r.serializer = r.supplier.get();
ResourceLocation location = new ResourceLocation(Create.ID, Lang.asId(r.name()));
event.getRegistry().register(r.serializer.setRegistryName(location));
}
}
}