mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 13:09:42 +00:00
Fix more bugs, rename petal and rune recipe folders
This commit is contained in:
1 parent
5d04baf7d7
commit
af9b77e0ea
63 files changed
+10
-5
No files matched your search
@@ -194,7 +194,7 @@ public class RecipeBrew implements IRecipe<RecipeWrapper> {
|
||||
|
||||
@Override
|
||||
public void write(@Nonnull PacketBuffer buf, @Nonnull RecipeBrew recipe) {
|
||||
buf.writeResourceLocation(recipe.getBrew().getRegistryName());
|
||||
buf.writeRegistryIdUnsafe(BotaniaAPI.brewRegistry, recipe.getBrew());
|
||||
buf.writeVarInt(recipe.getIngredients().size());
|
||||
for (Ingredient input : recipe.getIngredients()) {
|
||||
input.write(buf);
|
||||
|
||||
+7
-2
@@ -12,6 +12,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -34,13 +35,17 @@ public class RotatingRecipeComponent extends RotatingItemListComponentBase {
|
||||
protected List<Ingredient> makeIngredients() {
|
||||
Map<ResourceLocation, ? extends IRecipe<?>> map;
|
||||
if ("runic_altar".equals(recipeType)) {
|
||||
map = Collections.emptyMap(); // BotaniaAPI.runeAltarRecipes;
|
||||
map = Minecraft.getInstance().world.getRecipeManager().getRecipes(ModRecipeTypes.RUNE_TYPE);
|
||||
} else if ("petal_apothecary".equals(recipeType)) {
|
||||
map = Minecraft.getInstance().world.getRecipeManager().getRecipes(ModRecipeTypes.PETAL_TYPE);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Type must be 'runic_altar' or 'petal_apothecary'!");
|
||||
}
|
||||
return map.get(new ResourceLocation(recipeName)).getIngredients();
|
||||
IRecipe<?> recipe = map.get(new ResourceLocation(recipeName));
|
||||
if (recipe == null) {
|
||||
throw new RuntimeException("Missing recipe " + recipeName);
|
||||
}
|
||||
return recipe.getIngredients();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -144,7 +144,7 @@ public class PetalProvider extends RecipeProvider {
|
||||
}
|
||||
|
||||
private static ResourceLocation idFor(ResourceLocation name) {
|
||||
return new ResourceLocation(name.getNamespace(), "petal/" + name.getPath());
|
||||
return new ResourceLocation(name.getNamespace(), "petal_apothecary/" + name.getPath());
|
||||
}
|
||||
|
||||
private static class FinishedRecipe implements IFinishedRecipe {
|
||||
|
||||
@@ -87,7 +87,7 @@ public class RuneProvider extends RecipeProvider {
|
||||
}
|
||||
|
||||
private static ResourceLocation idFor(String s) {
|
||||
return prefix("rune/" + s);
|
||||
return prefix("runic_altar/" + s);
|
||||
}
|
||||
|
||||
private static class FinishedRecipe implements IFinishedRecipe {
|
||||
|
||||
Reference in new issue
Block a user